@arcgis/core 4.34.0-next.28 → 4.34.0-next.29

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 (91) hide show
  1. package/applications/Components/featureUtils.d.ts +6 -0
  2. package/applications/Components/featureUtils.js +5 -0
  3. package/arcade/arcade.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/functions/feature.js +1 -1
  8. package/arcade/functions/track.js +5 -0
  9. package/arcade/treeAnalysis.js +1 -1
  10. package/arcade.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/086f3bc5938bf9a37274.js +1 -0
  13. package/assets/esri/core/workers/chunks/{7e5d3735a9c718591d64.js → 22f38cad0213f2112394.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{746c78e1c84f9612d69b.js → 2f54776ff86f397adc55.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{edfd8b482182803b44ca.js → 2fdf457786d2d5d7414f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/5192f38682f1f9be7da0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{7ee50f75914d8d650af4.js → 63cb3dcd359e96733b1b.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{e49a95f2126ef9a994d3.js → 6ccd6171d3c572883034.js} +1 -1
  19. package/assets/esri/core/workers/chunks/89999baefa341bd3329c.js +1 -0
  20. package/assets/esri/core/workers/chunks/{629a924e99d5d6eb1998.js → 90a9b618058dc41294de.js} +1 -1
  21. package/assets/esri/core/workers/chunks/98f6d4ea026ed96fd3f3.js +1 -0
  22. package/assets/esri/core/workers/chunks/d3b1d1c389d70919fb02.js +1 -0
  23. package/assets/esri/core/workers/chunks/db81d881805f6f92a2e4.js +1 -0
  24. package/assets/esri/core/workers/chunks/e89698fc404379627349.js +1 -0
  25. package/assets/esri/core/workers/chunks/{0254ef9fb7f8ebb25304.js → ecc15622d6c434ea842b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{aa781b28dbe457427afc.js → fb71e533995c54cd806f.js} +1 -1
  27. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  28. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
  29. package/chunks/OperatorGeodesicBuffer.js +1 -1
  30. package/chunks/OperatorGeodeticArea.js +1 -1
  31. package/chunks/OperatorGeodeticLength.js +1 -1
  32. package/chunks/OperatorProximityGeodesic.js +1 -1
  33. package/chunks/OperatorShapePreservingLength.js +1 -1
  34. package/chunks/OperatorShapePreservingProject.js +1 -1
  35. package/chunks/Terrain.glsl.js +11 -11
  36. package/chunks/UnitFactory.js +1 -1
  37. package/chunks/arcade.js +1 -1
  38. package/chunks/bundle.js +1 -1
  39. package/config.js +1 -1
  40. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  41. package/interfaces.d.ts +80 -2
  42. package/kernel.js +1 -1
  43. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  44. package/layers/ParquetLayer.js +1 -1
  45. package/layers/graphics/sources/ParquetSource.js +1 -1
  46. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  47. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  48. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  49. package/layers/orientedImagery/transformations/utils.js +1 -1
  50. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  51. package/layers/support/ParquetEncodingWkb.js +1 -1
  52. package/layers/support/layerUtils.js +1 -1
  53. package/layers/support/parquetUtils.js +1 -1
  54. package/libs/parquet/parquet.js +1 -1
  55. package/package.json +2 -2
  56. package/support/arcadeUtils.js +1 -1
  57. package/support/revision.js +1 -1
  58. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  59. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  60. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  61. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  62. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  63. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +5 -0
  64. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +5 -0
  65. package/views/2d/layers/features/sources/strategies/chunks/FeatureSourceEndChunk.js +5 -0
  66. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +5 -0
  67. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  68. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  69. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  70. package/views/2d/layers/features/support/XZOrder.js +5 -0
  71. package/views/3d/terrain/TerrainRenderer.js +1 -1
  72. package/views/3d/webgl-engine/shaders/{ReadShadowMapConfiguration.js → ReceiveShadowsConfiguration.js} +1 -1
  73. package/views/draw/support/ConnectedReshapeManager.js +5 -0
  74. package/views/draw/support/Reshape.js +1 -1
  75. package/views/draw/support/layerUtils.js +1 -1
  76. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  77. package/widgets/Feature/support/featureUtils.js +1 -1
  78. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  79. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  80. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  81. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  82. package/widgets/OrientedImageryViewer/constants.js +1 -1
  83. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  84. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  85. package/widgets/PanoramicViewer.js +1 -1
  86. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  87. package/assets/esri/core/workers/chunks/16ff0bf4cb74f478ec1e.js +0 -1
  88. package/assets/esri/core/workers/chunks/1aff43dad2302677b4f4.js +0 -1
  89. package/assets/esri/core/workers/chunks/c6be02d2dff6e0734dab.js +0 -1
  90. package/assets/esri/core/workers/chunks/c8719205518e97131375.js +0 -1
  91. package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as e,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as s,transpose as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as f,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{a as h,f as m}from"../../../chunks/vec32.js";import{isSerializable as p}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectWithZConversion as v}from"../../../geometry/projectionUtils.js";import{earth as g}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as w,ConstantElevation as y,isElevationSource as b}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as j}from"../core/utils.js";import{getElevationSampler as O}from"./updateElevationUtils.js";import{isNumber as z}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[i,o,r,c]=n,[s,l,h,m]=a;P(i,o,r,c);const p=P(s,l,h,m),M=R(i,o,r,c),v=R(s,l,h,m),g=f(e(),M),d=u(e(),g,v),[x,w,y,b]=V(t,d);return[x/b,w/b,p?0:y/b]}function P(t,n,a,i){return 0===t[2]&&0===n[2]&&0===a[2]&&0===i[2]&&(t[2]=n[2]=a[2]=i[2]=1,!0)}function S(t){return 0===t?1:t}function V(t,n){const[a,i,e]=t,o=[0,0,0,0];return o[0]=a*n[0]+i*n[1]+e*n[2]+n[3],o[1]=a*n[4]+i*n[5]+e*n[6]+n[7],o[2]=a*n[8]+i*n[9]+e*n[10]+n[11],o[3]=S(a*n[12]+i*n[13]+e*n[14]+n[15]),o}function R(t,n,a,i){const c=q(r([...i,1]),f(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=c[0],l=c[1],u=c[2],h=e();return h[0]=s*t[0],h[1]=l*n[0],h[2]=u*a[0],h[3]=0,h[4]=s*t[1],h[5]=l*n[1],h[6]=u*a[1],h[7]=0,h[8]=s*t[2],h[9]=l*n[2],h[10]=u*a[2],h[11]=0,h[12]=s,h[13]=l,h[14]=u,h[15]=1,h}function D(t,n,a,i,e=c()){return e[0]=t[0]+n[0]*a,e[1]=t[1]+n[1]*a,e[2]=t[2]+n[2]*(a/i),e}function H(t,n,a){const i=c();return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*(n/a),i}function L(t,n){const[a,i,e]=t,o=c();return o[0]=a*n[0]+i*n[3]+e*n[6],o[1]=a*n[1]+i*n[4]+e*n[7],o[2]=a*n[2]+i*n[5]+e*n[8],o}function q(t,n){const[a,i,e,o]=t,r=new Array(4);return r[0]=a*n[0]+i*n[1]+e*n[2]+o*n[3],r[1]=a*n[4]+i*n[5]+e*n[6]+o*n[7],r[2]=a*n[8]+i*n[9]+e*n[10]+o*n[11],r[3]=a*n[12]+i*n[13]+e*n[14]+o*n[15],r}function N(n,e,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=i();switch(e){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function A(n,a,e=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=i();for(let t=0;t<3;t++){const[i,r]=a[t],c=N(n[t],i,r,e);s(o,c,o)}return o}function I(t,n=!0){return A(t,k.OPK,n)}function U(t,n=!0){return A(t,k.HPR,n)}function C(t,n,i){const e=Math.sin(a(i)),o=Math.cos(a(i)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-e*t[1],e*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,n){const i=a(t[1]),e=a(t[0]),o=t[2],[r,c,s,l]=n,f=a(r),u=a(c),h=s/Math.sqrt(1-l*Math.sin(f)**2),m=e-u,p=s/Math.sqrt(1-l*Math.sin(f)**2),M=l*(h*Math.sin(f)-p*Math.sin(i));return[(p+o)*Math.cos(i)*Math.sin(m),(p+o)*(Math.sin(i)*Math.cos(f)-Math.sin(f)*Math.cos(f)*Math.cos(m))+M*Math.cos(f),(p+o)*(Math.sin(i)*Math.sin(f)+Math.cos(f)*Math.cos(i)*Math.cos(m))-h+M*Math.sin(f)]}function T(t,i){const e=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=i,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=e/m,M=o/m,v=r/m,g=Math.cos(u)-Math.sin(u)*M+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*M+Math.sin(u)*v,x=Math.sqrt(g**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(e/(m*g))+h,O=n(b);return[n(j),O,e/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const i=360/n,e=180/a;return{heading:(t.x-n/2)*i,pitch:90-(t.y-a/2)*e}}function X(t,n,a,i=F/2){const{heading:e,pitch:o}=Z(t,i);return Y(e,o,n,a)}function Y(t,n,a,i){return{x:a/2+t/(360/a),y:i-n/(180/i),heading:t,pitch:n}}function Z(t,a){const i=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:i}}function G(t,n,i=F/2){return[i*(Math.sin(a(t))*Math.sin(a(n))),i*(Math.cos(a(t))*Math.sin(a(n))),i*Math.cos(a(180-n))]}function J(t,n,a,i=F/2){const{heading:e,pitch:o}=W(t,n,a);return G(e,o,i)}async function $(t,a,i){const e=await v(a,t.spatialReference,i);let o=n(Math.atan2(e.y-t.y,e.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function B(t,n,a){const i=Math.cos(a),e=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*i+o[2]*e,c=o[1]*i+o[3]*e,s=-o[0]*e+o[2]*i,l=-o[1]*e+o[3]*i;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const Q=t=>t.toArray(),_=(...t)=>t.some(t=>t);function tt(t,n){if(_(0===t.length,t.some(({x:t,y:n})=>_(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function nt(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function at(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function it(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/g.radius))):1}const et=t=>n=>new M(n,t),ot=t=>null!=t&&"queryExtent"in t;function rt(t,n,a,i){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,e])=>E(x(c(),a,[n,e,0]),i,t))}function ct({a0:t,a1:n,a2:a,b0:i,b1:e,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,i??c/2-.5,e??0,o].map(st);return null!=s&&lt(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function st(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function lt(t){return null!=t[1]&&null!=t[5]}function ft(t,n,a){const{cameraHeight:i,cameraPitch:e,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-i;return{...mt(t,n,a),averageElevation:u,cameraPitch:e,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ut(t,n,a,i){return yt(i)?I([i.omega,i.phi,i.kappa]):bt(i)?U([i.heading,i.pitch,i.roll]):U([t,n,a??0])}function ht(t,n,a){const{cameraHeading:i,cameraHeight:e,elevation:o,farDistance:r,horizontalFieldOfView:c,location:s,verticalFieldOfView:l}=zt(t,t.location.spatialReference);return{averageElevation:o??(s.z??0)-e,cameraLocation:s,cameraHeading:i,farDistance:r,horizontalFieldOfView:c,imageHeight:a,imageWidth:n,verticalFieldOfView:l}}function mt(t,n,a){const{a0:i,a1:e,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:M,matrix:v,principalX:g,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=ct({a0:i,a1:e,a2:o,b0:r,b1:c,b2:s},n,a,m),O=v??ut(l,u,h,f),z=null!=g&&null!=d?[g,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:M.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const pt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>b(t?.elevationSource)&&null!=t?.extent,vt=t=>w(t?.elevationSource),gt=async(t,n,a,i,e)=>{const o=j(t),r=n-a/o;return vt(i)?(i.elevationSource=new y({constantElevation:i.elevationSource.constantElevation/o}),i):pt(i)?i:Mt(i)?{elevationSample:await O({...p(i.elevationSource)?i.elevationSource.toJSON():i.elevationSource,extent:i.extent},e),elevationSource:new y({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},dt=t=>z(t?.heading)&&z(t?.pitch),xt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function wt(t){const{cameraLocation:n,farDistance:e,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:s,verticalFieldOfView:f}=t,u=i();l(u,r);const p=2*Math.tan(a(f)/2)*e*s,M=2*Math.tan(a(o)/2)*e*s,v=L([0,0,-1],u),g=D([n.x,n.y,n.z],v,t.farDistance*s,s),d=L([0,1,0],u),x=L([1,0,0],u),w=H(d,p/2,s),y=H(x,M/2,s),b=h(c(),w,y),j=m(c(),w,y);return[m(c(),g,b),m(c(),g,j),h(c(),g,b),h(c(),g,j)]}const yt=t=>2===t?.type,bt=t=>1===t?.type;function jt(t){const n=t%360;return n<-180?n+360:n}function Ot(t,n,a){if("panoramic"===t){const[t,i]=a;return X({x:n.x,y:n.y,z:n.z},t,i)}return{x:n.x+.5,y:.5-n.y}}function zt(t,n,a=!0){const i=j(n),e=a?t.clone():t;return e.cameraHeight/=i,e.farDistance/=i,e.nearDistance/=i,w(e.elevationSource)&&(e.elevationSource.constantElevation/=i),e}export{wt as computeFarplaneVertices,C as computeHFOVAndVFOV,rt as computeNewReferenceCoordinates,G as convertHeadingPitchToSphereVertex,Y as convertOrientationToPixelLocation,J as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,Z as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,A as createRotationMatrix,U as createRotationMatrixFromHPR,I as createRotationMatrixFromOPK,K as geographicToLTP,ct as getAffinesAndFocalLength,ht as getImageToWorldPanoramicProperties,ft as getImageToWorldProperties,$ as getInitialAngle,gt as getUpdateElevationProps,it as getWebMercatorScalingFactor,mt as getWorldToImageProperties,dt as hasAngles,bt as hasHeadingPitchRoll,yt as hasOmegaPhiKappa,ot as isElevationSampler,pt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,vt as isUpdateUsingConstantElevation,lt as isValidAffines,R as linearEquationSolve,T as ltpToGeographic,jt as normalizeHeading,_ as or,Q as pointToArray,E as projectiveTransform,xt as reducerFn,B as rotatePixel,D as scaleAndAddWithFactor,H as scaleWithFactor,Ot as transformGraphicCoordinatesToPixel,L as transformMat3,q as transformMat4,tt as validatePixelsToTransform,nt as validatePointsToTransform,at as validateRotationMatrix,et as vecToPoint};
5
+ import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as e,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as s,transpose as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as f,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{a as h,f as m}from"../../../chunks/vec32.js";import{isSerializable as p}from"../../../core/support/jsonUtils.js";import M from"../../../geometry/Point.js";import{projectWithZConversion as g}from"../../../geometry/projectionUtils.js";import{earth as v}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as w,ConstantElevation as y,isElevationSource as b}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as j}from"../core/utils.js";import{getElevationSampler as O}from"./updateElevationUtils.js";import{isNumber as z}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[i,o,r,c]=n,[s,l,h,m]=a;P(i,o,r,c);const p=P(s,l,h,m),M=R(i,o,r,c),g=R(s,l,h,m),v=f(e(),M),d=u(e(),v,g),[x,w,y,b]=V(t,d);return[x/b,w/b,p?0:y/b]}function P(t,n,a,i){return 0===t[2]&&0===n[2]&&0===a[2]&&0===i[2]&&(t[2]=n[2]=a[2]=i[2]=1,!0)}function S(t){return 0===t?1:t}function V(t,n){const[a,i,e]=t,o=[0,0,0,0];return o[0]=a*n[0]+i*n[1]+e*n[2]+n[3],o[1]=a*n[4]+i*n[5]+e*n[6]+n[7],o[2]=a*n[8]+i*n[9]+e*n[10]+n[11],o[3]=S(a*n[12]+i*n[13]+e*n[14]+n[15]),o}function R(t,n,a,i){const c=q(r([...i,1]),f(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=c[0],l=c[1],u=c[2],h=e();return h[0]=s*t[0],h[1]=l*n[0],h[2]=u*a[0],h[3]=0,h[4]=s*t[1],h[5]=l*n[1],h[6]=u*a[1],h[7]=0,h[8]=s*t[2],h[9]=l*n[2],h[10]=u*a[2],h[11]=0,h[12]=s,h[13]=l,h[14]=u,h[15]=1,h}function D(t,n,a,i,e=c()){return e[0]=t[0]+n[0]*a,e[1]=t[1]+n[1]*a,e[2]=t[2]+n[2]*(a/i),e}function H(t,n,a){const i=c();return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*(n/a),i}function L(t,n){const[a,i,e]=t,o=c();return o[0]=a*n[0]+i*n[3]+e*n[6],o[1]=a*n[1]+i*n[4]+e*n[7],o[2]=a*n[2]+i*n[5]+e*n[8],o}function q(t,n){const[a,i,e,o]=t,r=new Array(4);return r[0]=a*n[0]+i*n[1]+e*n[2]+o*n[3],r[1]=a*n[4]+i*n[5]+e*n[6]+o*n[7],r[2]=a*n[8]+i*n[9]+e*n[10]+o*n[11],r[3]=a*n[12]+i*n[13]+e*n[14]+o*n[15],r}function N(n,e,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=i();switch(e){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const k={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function A(n,a,e=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=i();for(let t=0;t<3;t++){const[i,r]=a[t],c=N(n[t],i,r,e);s(o,c,o)}return o}function I(t,n=!0){return A(t,k.OPK,n)}function U(t,n=!0){return A(t,k.HPR,n)}function C(t,n,i){const e=Math.sin(a(i)),o=Math.cos(a(i)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-e*t[1],e*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,n){const i=a(t[1]),e=a(t[0]),o=t[2],[r,c,s,l]=n,f=a(r),u=a(c),h=s/Math.sqrt(1-l*Math.sin(f)**2),m=e-u,p=s/Math.sqrt(1-l*Math.sin(f)**2),M=l*(h*Math.sin(f)-p*Math.sin(i));return[(p+o)*Math.cos(i)*Math.sin(m),(p+o)*(Math.sin(i)*Math.cos(f)-Math.sin(f)*Math.cos(f)*Math.cos(m))+M*Math.cos(f),(p+o)*(Math.sin(i)*Math.sin(f)+Math.cos(f)*Math.cos(i)*Math.cos(m))-h+M*Math.sin(f)]}function T(t,i){const e=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=i,u=a(c),h=a(s),m=l/Math.sqrt(1-f*Math.sin(u)**2),p=e/m,M=o/m,g=r/m,v=Math.cos(u)-Math.sin(u)*M+Math.cos(u)*g,d=Math.sin(u)+Math.cos(u)*M+Math.sin(u)*g,x=Math.sqrt(v**2+p**2),w=f*m*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(m*x))},b=y(u),j=Math.atan(e/(m*v))+h,O=n(b);return[n(j),O,e/(Math.cos(b)*Math.sin(j-h))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function W(t,n,a){const i=360/n,e=180/a;return{heading:(t.x-n/2)*i,pitch:90-(t.y-a/2)*e}}function X(t,n,a,i=F/2){const{heading:e,pitch:o}=Z(t,i);return Y(e,o,n,a)}function Y(t,n,a,i){const e=t%360;return{x:a/2+(e<-180?e+360:e>180?e-360:e)/(360/a),y:i-n/(180/i),heading:t,pitch:n}}function Z(t,a){const i=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:i}}function G(t,n,i=F/2){return[i*(Math.sin(a(t))*Math.sin(a(n))),i*(Math.cos(a(t))*Math.sin(a(n))),i*Math.cos(a(180-n))]}function J(t,n,a,i=F/2){const{heading:e,pitch:o}=W(t,n,a);return G(e,o,i)}async function $(t,a,i){const e=await g(a,t.spatialReference,i);let o=n(Math.atan2(e.y-t.y,e.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function B(t,n,a){const i=Math.cos(a),e=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*i+o[2]*e,c=o[1]*i+o[3]*e,s=-o[0]*e+o[2]*i,l=-o[1]*e+o[3]*i;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const Q=t=>t.toArray(),_=(...t)=>t.some(t=>t);function tt(t,n){if(_(0===t.length,t.some(({x:t,y:n})=>_(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function nt(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function at(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function it(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/v.radius))):1}const et=t=>n=>new M(n,t),ot=t=>null!=t&&"queryExtent"in t;function rt(t,n,a,i){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,e])=>E(x(c(),a,[n,e,0]),i,t))}function ct({a0:t,a1:n,a2:a,b0:i,b1:e,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,i??c/2-.5,e??0,o].map(st);return null!=s&&lt(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function st(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function lt(t){return null!=t[1]&&null!=t[5]}function ft(t,n,a){const{cameraHeight:i,cameraPitch:e,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=zt(t,t.location.spatialReference),u=r??(l.z??0)-i;return{...mt(t,n,a),averageElevation:u,cameraPitch:e,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ut(t,n,a,i){return yt(i)?I([i.omega,i.phi,i.kappa]):bt(i)?U([i.heading,i.pitch,i.roll]):U([t,n,a??0])}function ht(t,n,a){const{cameraHeading:i,cameraHeight:e,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=zt(t,t.location.spatialReference);return{averageElevation:(c.z??0)-e,cameraLocation:c,cameraHeading:i,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s}}function mt(t,n,a){const{a0:i,a1:e,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:h,focalLength:m,horizontalFieldOfView:p,location:M,matrix:g,principalX:v,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=ct({a0:i,a1:e,a2:o,b0:r,b1:c,b2:s},n,a,m),O=g??ut(l,u,h,f),z=null!=v&&null!=d?[v,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:M.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const pt=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,Mt=t=>b(t?.elevationSource)&&null!=t?.extent,gt=t=>w(t?.elevationSource),vt=async(t,n,a,i,e)=>{const o=j(t),r=n-a/o;return gt(i)?(i.elevationSource=new y({constantElevation:i.elevationSource.constantElevation/o}),i):pt(i)?i:Mt(i)?{elevationSample:await O({...p(i.elevationSource)?i.elevationSource.toJSON():i.elevationSource,extent:i.extent},e),elevationSource:new y({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},dt=t=>z(t?.heading)&&z(t?.pitch),xt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function wt(t){const{cameraLocation:n,farDistance:e,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:s,verticalFieldOfView:f}=t,u=i();l(u,r);const p=2*Math.tan(a(f)/2)*e*s,M=2*Math.tan(a(o)/2)*e*s,g=L([0,0,-1],u),v=D([n.x,n.y,n.z],g,t.farDistance*s,s),d=L([0,1,0],u),x=L([1,0,0],u),w=H(d,p/2,s),y=H(x,M/2,s),b=h(c(),w,y),j=m(c(),w,y);return[m(c(),v,b),m(c(),v,j),h(c(),v,b),h(c(),v,j)]}const yt=t=>2===t?.type,bt=t=>1===t?.type;function jt(t){const n=t%360;return n<-180?n+360:n}function Ot(t,n,a){if("panoramic"===t){const[t,i]=a;return X({x:n.x,y:n.y,z:n.z},t,i)}return{x:n.x+.5,y:.5-n.y}}function zt(t,n,a=!0){const i=j(n),e=a?t.clone():t;return e.cameraHeight/=i,e.farDistance/=i,e.nearDistance/=i,w(e.elevationSource)&&(e.elevationSource.constantElevation/=i),e}export{wt as computeFarplaneVertices,C as computeHFOVAndVFOV,rt as computeNewReferenceCoordinates,G as convertHeadingPitchToSphereVertex,Y as convertOrientationToPixelLocation,J as convertPixelLocationToSphereVertex,W as convertPixelToHeadingPitch,Z as convertSphereVertexToOrientation,X as convertSphereVertexToPixelLocation,zt as convertToSRUnits,A as createRotationMatrix,U as createRotationMatrixFromHPR,I as createRotationMatrixFromOPK,K as geographicToLTP,ct as getAffinesAndFocalLength,ht as getImageToWorldPanoramicProperties,ft as getImageToWorldProperties,$ as getInitialAngle,vt as getUpdateElevationProps,it as getWebMercatorScalingFactor,mt as getWorldToImageProperties,dt as hasAngles,bt as hasHeadingPitchRoll,yt as hasOmegaPhiKappa,ot as isElevationSampler,pt as isUpdateElevationWithElevationSampler,Mt as isUpdateElevationWithElevationSource,gt as isUpdateUsingConstantElevation,lt as isValidAffines,R as linearEquationSolve,T as ltpToGeographic,jt as normalizeHeading,_ as or,Q as pointToArray,E as projectiveTransform,xt as reducerFn,B as rotatePixel,D as scaleAndAddWithFactor,H as scaleWithFactor,Ot as transformGraphicCoordinatesToPixel,L as transformMat3,q as transformMat4,tt as validatePixelsToTransform,nt as validatePointsToTransform,at as validateRotationMatrix,et as vecToPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{rad2deg as t,deg2rad as a}from"../../../core/mathUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{j as o,a as n}from"../../../chunks/vec32.js";import{webMercatorToGeographic as e}from"../../../geometry/support/webMercatorUtils.js";import{normalizeHeading as i,convertOrientationToPixelLocation as c,validatePointsToTransform as s,validateRotationMatrix as f,getWebMercatorScalingFactor as m}from"./utils.js";function l(t,a){const{cameraLocation:r,pointsToTransform:o,scalingFactor:n}=g(t,a.cameraLocation,a.rotationMatrix),e=new Array;return p(o,e,{...a,cameraLocation:r,scalingFactor:n,...T(a)}),Array.isArray(t)?e:e[0]}function u(t,a,r){return l(t?a.map(t=>e(t)):a,r).map(t=>({...t,z:1}))}function p(t,a,o){const{affineTransformations:e,cameraLocation:i,focalLengthX:c,focalLengthY:s,principalOffsetPoint:f,radialDistortionCoefficients:m,rotationMatrix:l,scalingFactor:u,tangentialDistortionCoefficients:p}=o;for(const h of t){const t=r();n(t,h,i),t[0]=t[0]/u,t[1]=t[1]/u;const o=-c*((l[0]*t[0]+l[3]*t[1]+l[6]*t[2])/(l[2]*t[0]+l[5]*t[1]+l[8]*t[2])),g=-s*((l[1]*t[0]+l[4]*t[1]+l[7]*t[2])/(l[2]*t[0]+l[5]*t[1]+l[8]*t[2])),y=o*o+g*g;let L=0,A=0,T=0,b=0,d=0,w=0,M=0;m&&(L=m[0]??0,A=m[1]??0,T=m[2]??0),p&&(b=p[0],d=p[1]),f&&(w=f[0]??0,M=f[1]??0);const j=1+L*y+A*y*y+T*y*y*y;let F=o*j+b*(y+2*o**2)+2*d*o*g,N=g*j+d*(y+2*g**2)+2*b*o*g;F+=w,N+=M;const x=Number(e[0])+Number(e[1])*F+Number(e[2])*N,v=Number(e[3])+Number(e[4])*F+Number(e[5])*N;a.push({x,y:v})}}function h(a,r){const{cameraHeading:n,imageHeight:e,imageWidth:s}=r,{cameraLocation:f,pointsToTransform:m}=y(a,r.cameraLocation),l=new Array;for(const u of m){const a=o(f,u),r=i(t(Math.atan2(u[0]-f[0],u[1]-f[1]))-n),m=t(Math.acos((f[2]-u[2])/a));l.push(c(r,m,s,e))}return Array.isArray(a)?l:l[0]}function g(t,a,r){const o=Array.isArray(t)||"items"in t?t:[t];s(o,a),L(o,a),f(r);const n=m(a.y,a.spatialReference);return{pointsToTransform:o.map(t=>t.toArray()),scalingFactor:n,cameraLocation:a.toArray()}}function y(t,a){const r=Array.isArray(t)||"items"in t?t:[t];return s(r,a),L(r,a),{pointsToTransform:r.map(t=>t.toArray()),cameraLocation:a.toArray()}}function L(t,a){if(t.some(t=>!t.spatialReference.equals(a.spatialReference)))throw new Error("Input points and camera location must have the same spatial reference")}function A(t){return null!=t?.focalLength}function T(t){if(A(t))return{focalLengthX:t.focalLength,focalLengthY:t.focalLength};const{imageWidth:r,imageHeight:o,horizontalFieldOfView:n,verticalFieldOfView:e}=t;return{focalLengthX:r/(2*Math.tan(a(n)/2)),focalLengthY:o/(2*Math.tan(a(e)/2))}}export{l as worldToImage,h as worldToImagePanoramic,u as worldToImageWithLTPFlag};
5
+ import{rad2deg as t,deg2rad as a}from"../../../core/mathUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{j as o,a as n}from"../../../chunks/vec32.js";import{webMercatorToGeographic as e}from"../../../geometry/support/webMercatorUtils.js";import{getWebMercatorScalingFactor as i,convertOrientationToPixelLocation as c,validatePointsToTransform as s,validateRotationMatrix as m}from"./utils.js";import{normalizeDegrees as f}from"../../../widgets/OrientedImageryViewer/components/imageNavigationUtils.js";function l(t,a){const{cameraLocation:r,pointsToTransform:o,scalingFactor:n}=h(t,a.cameraLocation,a.rotationMatrix),e=new Array;return p(o,e,{...a,cameraLocation:r,scalingFactor:n,...d(a)}),Array.isArray(t)?e:e[0]}function u(t,a,r){return l(t?a.map(t=>e(t)):a,r).map(t=>({...t,z:1}))}function p(t,a,o){const{affineTransformations:e,cameraLocation:i,focalLengthX:c,focalLengthY:s,principalOffsetPoint:m,radialDistortionCoefficients:f,rotationMatrix:l,scalingFactor:u,tangentialDistortionCoefficients:p}=o;for(const g of t){const t=r();n(t,g,i),t[0]=t[0]/u,t[1]=t[1]/u;const o=-c*((l[0]*t[0]+l[3]*t[1]+l[6]*t[2])/(l[2]*t[0]+l[5]*t[1]+l[8]*t[2])),h=-s*((l[1]*t[0]+l[4]*t[1]+l[7]*t[2])/(l[2]*t[0]+l[5]*t[1]+l[8]*t[2])),y=o*o+h*h;let L=0,A=0,d=0,w=0,T=0,b=0,j=0;f&&(L=f[0]??0,A=f[1]??0,d=f[2]??0),p&&(w=p[0],T=p[1]),m&&(b=m[0]??0,j=m[1]??0);const M=1+L*y+A*y*y+d*y*y*y;let N=o*M+w*(y+2*o**2)+2*T*o*h,F=h*M+T*(y+2*h**2)+2*w*o*h;N+=b,F+=j;const v=Number(e[0])+Number(e[1])*N+Number(e[2])*F,x=Number(e[3])+Number(e[4])*N+Number(e[5])*F;a.push({x:v,y:x})}}function g(a,r){const{cameraHeading:n,imageHeight:e,imageWidth:s}=r,{cameraLocation:m,pointsToTransform:l}=y(a,r.cameraLocation),u=new Array,p=i(m[1],r.cameraLocation.spatialReference);for(const i of l){const a=o([m[0],m[1],m[2]*p],[i[0],i[1],i[2]*p]),r=[(i[0]-m[0])/a,(i[1]-m[1])/a,(i[2]-m[2])*p/a],l=0!==r[0]&&0!==r[1]?f(t(Math.atan2(r[0],r[1]))-n):0,g=t(Math.acos(-r[2]));u.push(c(l,g,s,e))}return Array.isArray(a)?u:u[0]}function h(t,a,r){const o=Array.isArray(t)||"items"in t?t:[t];s(o,a),L(o,a),m(r);const n=i(a.y,a.spatialReference);return{pointsToTransform:o.map(t=>t.toArray()),scalingFactor:n,cameraLocation:a.toArray()}}function y(t,a){const r=Array.isArray(t)||"items"in t?t:[t];return s(r,a),L(r,a),{pointsToTransform:r.map(t=>t.toArray()),cameraLocation:a.toArray()}}function L(t,a){if(t.some(t=>!t.spatialReference.equals(a.spatialReference)))throw new Error("Input points and camera location must have the same spatial reference")}function A(t){return null!=t?.focalLength}function d(t){if(A(t))return{focalLengthX:t.focalLength,focalLengthY:t.focalLength};const{imageWidth:r,imageHeight:o,horizontalFieldOfView:n,verticalFieldOfView:e}=t;return{focalLengthX:r/(2*Math.tan(a(n)/2)),focalLengthY:o/(2*Math.tan(a(e)/2))}}export{l as worldToImage,g as worldToImagePanoramic,u as worldToImageWithLTPFlag};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import r from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends r{constructor(o){super(o),this.type="wkb",this.primaryFieldName=null}};o([t({type:["wkb"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([t({json:{write:!0}})],s.prototype,"multiscale",void 0),o([t({json:{write:!0}})],s.prototype,"orientation",void 0),o([t({json:{write:!0}})],s.prototype,"primaryFieldName",void 0),s=o([e("esri.layers.support.ParquetEncodingWkb")],s);const p=s;export{p as default};
5
+ import{__decorate as o}from"tslib";import r from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends r{constructor(o){super(o),this.type="wkb",this.primaryFieldName=null}};o([t({type:["wkb"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([t({json:{write:!0}})],s.prototype,"orientation",void 0),o([t({json:{write:!0}})],s.prototype,"primaryFieldName",void 0),s=o([e("esri.layers.support.ParquetEncodingWkb")],s);const p=s;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";function i(e){return g(e)||f(e)}function u(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function f(e){return"scene"===e?.type}function y(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function p(e){return"subtype-sublayer"===e?.type}function g(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function b(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function d(e){return null!=e&&"type"in e&&"group"===e.type}const m={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function h(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function j(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function v(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function w(e){return"voxel"===e?.type}function L(e){return"imagery-tile"===e?.type}function S(e,t){return null!=e?.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent[t].includes(e)}function E(e){return S(e,"baseLayers")}function C(e){return S(e,"referenceLayers")}function M(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function x(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function I(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function T(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function U(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function k(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function O(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const s=`${n.slice(0,u)}/rest/info`,o=null!=r?r.signal:null,{data:a}=await t(s,{query:{f:"json"},responseType:"json",signal:o});return a?.owningSystemUrl||null}function B(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function P(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function q(e){return B(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function D(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function J(e){return!!D(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function N(e){if(!e)return[];return("subtypes"in e?e.subtypes:y(e.parent)?e.parent.subtypes:[])??[]}function F(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function V(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||r(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function $(e,t){return null}function z(e){return null}function A(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function G(e,t){if(!t||!A(e))return;const n=$(e.url);n&&(e.url=n)}export{G as applyPreferredHostToPortalItem,J as getEffectiveEditingEnabled,q as getEffectiveLayerCapabilities,V as getLayersWithChartSupport,O as getOwningPortalUrl,z as getPreferredHost,$ as getPreferredUrl,N as getSubtypesFromLayer,k as getTileMaxtrixSetFromActiveLayer,E as isBaseLayer,i as isBasemap3DSupportedLayer,g as isBasemapSupportedTiledLayer,M as isFeatureCollectionLayer,u as isFeatureLayer,I as isFeatureServiceLayer,s as isGraphicsLayer,d as isGroupLayer,L as isImageryTileLayer,v as isIntegratedMeshLayer,j as isIntegratedMeshOperationalLayer,c as isKnowledgeGraphLayer,B as isLayerWithFeatureCapabilities,x as isLayerWithFeatureLayerSource,F as isLayerWithFlowRenderer,l as isLinkChartLayer,o as isMapImageLayer,a as isMapNotesLayer,A as isPreferredUrlApplicable,C as isReferenceLayer,f as isSceneLayer,h as isSceneServiceLayer,y as isSubtypeGroupLayer,p as isSubtypeSublayer,P as isTable,b as isTiledLayer,w as isVoxelLayer,m as sceneServiceLayerTypeToClassName,T as serializeLayerDefinitions,U as serializeTimeOptions};
5
+ import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";function i(e){return b(e)||y(e)}function u(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function g(e){return"subtype-sublayer"===e?.type}function b(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function d(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function m(e){return null!=e&&"type"in e&&"group"===e.type}const h={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function j(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function v(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function w(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function L(e){return"voxel"===e?.type}function S(e){return"imagery-tile"===e?.type}function E(e,t){return null!=e?.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent[t].includes(e)}function C(e){return E(e,"baseLayers")}function M(e){return E(e,"referenceLayers")}function k(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function x(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function I(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function T(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function U(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function O(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function B(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:a}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return a?.owningSystemUrl||null}function P(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function q(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function D(e){return P(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function J(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function N(e){return!!J(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function F(e){if(!e)return[];return("subtypes"in e?e.subtypes:p(e.parent)?e.parent.subtypes:[])??[]}function V(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function $(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||r(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function z(e,t){return null}function A(e){return null}function G(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function H(e,t){if(!t||!G(e))return;const n=z(e.url);n&&(e.url=n)}export{H as applyPreferredHostToPortalItem,N as getEffectiveEditingEnabled,D as getEffectiveLayerCapabilities,$ as getLayersWithChartSupport,B as getOwningPortalUrl,A as getPreferredHost,z as getPreferredUrl,F as getSubtypesFromLayer,O as getTileMaxtrixSetFromActiveLayer,C as isBaseLayer,i as isBasemap3DSupportedLayer,b as isBasemapSupportedTiledLayer,k as isFeatureCollectionLayer,u as isFeatureLayer,I as isFeatureServiceLayer,o as isGraphicsLayer,m as isGroupLayer,S as isImageryTileLayer,w as isIntegratedMeshLayer,v as isIntegratedMeshOperationalLayer,c as isKnowledgeGraphLayer,l as isKnowledgeGraphSublayer,P as isLayerWithFeatureCapabilities,x as isLayerWithFeatureLayerSource,V as isLayerWithFlowRenderer,f as isLinkChartLayer,s as isMapImageLayer,a as isMapNotesLayer,G as isPreferredUrlApplicable,M as isReferenceLayer,y as isSceneLayer,j as isSceneServiceLayer,p as isSubtypeGroupLayer,g as isSubtypeSublayer,q as isTable,d as isTiledLayer,L as isVoxelLayer,h as sceneServiceLayerTypeToClassName,T as serializeLayerDefinitions,U as serializeTimeOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import o from"../../geometry/SpatialReference.js";import r from"./Field.js";import{inferLocationInfo as i}from"./locationUtils.js";import a from"./ParquetEncodingLocation.js";import l from"./ParquetEncodingWkb.js";import{ParquetMetadata as s}from"../../libs/parquet/parquet.js";const u=new n({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function m(e){return u.toJSON(e)}function c(t,n={}){return p({urls:new e(t)},n)}async function p(e,n={}){if(e.geometryType&&e.spatialReference&&e.encoding&&e.fields)return e;if(e.urls.length<1)throw new t("parquet:bad-input","At least one url must be specified",e);const i=e.metadata??await s.create(e.urls.getItemAt(0),()=>n.customParameters),a=i.tryReadGeoMetadata(),l={...e,metadata:i};if(null==l.fields&&(l.fields=i.fields.map(e=>r.fromJSON(e))),null==l.encoding&&(l.encoding=d(i,a)),!l.encoding)return l;switch(l.encoding.type){case"location":null==l.spatialReference&&(l.spatialReference=o.WGS84),null==l.geometryType&&(l.geometryType="point");break;case"wkb":{if(!a)return l;const e=a.primary_column,t=a.columns[e];l.geometryType||(l.geometryType=y(t)),l.spatialReference||(l.spatialReference=g(t))}}return l}function d(e,t){if(null!=t){const n=t.primary_column,o=t.columns[n],r=e.tryReadEsriMetadata();return new l({primaryFieldName:n,orientation:o.orientation??null,multiscale:r?.multiscale})}const n=i(e.fields.map(e=>e.name));return new a({latitudeFieldName:n.latitudeFieldName,longitudeFieldName:n.longitudeFieldName})}function f(e){switch(e){case"Point":return"point";case"Polygon":case"MultiPolygon":return"polygon";case"LineString":return"polyline";case"MultiPoint":return"multipoint";default:return null}}function y(e){const{geometry_types:n}=e,o=new Set;for(const t of n){const e=f(t);e&&o.add(e)}if(o.size>1)throw new t("unsupported","Parquet mixed geometry types are not support",{geometryTypes:o});return 1===o.size?o.values().next().value:void 0}function g(e){const t=e.crs?.id?.code;return t&&"number"==typeof t?new o({wkid:t}):void 0}export{p as completeParquetLayerInfo,c as getParquetLayerInfo,u as parquetGeometryTypeKebabDict,m as toParquetJSONGeometryType};
5
+ import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import n from"../../geometry/SpatialReference.js";import i from"./Field.js";import{inferLocationInfo as r}from"./locationUtils.js";import l from"./ParquetEncodingLocation.js";import s from"./ParquetEncodingWkb.js";import{createParquetFile as a,readGeoMetadata as m,readEsriMetadata as u}from"../../libs/parquet/parquet.js";const c=new o({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function p(e){return c.toJSON(e)}function f(t,o={}){return d({urls:new e(t)},o)}async function d(e,o={}){if(e.geometryType&&e.spatialReference&&e.encoding&&e.fields)return e;if(e.urls.length<1)throw new t("parquet:bad-input","At least one url must be specified",e);const r=await a(e.urls.getItemAt(0),{getCustomParameters:()=>o.customParameters}),l=m(r),s={...e,file:r};null==s.fields&&(s.fields=r.fields().map(e=>i.fromJSON({name:e.name,type:e.type}))),null==s.encoding&&(s.encoding=y(l,s.fields));const c=u(r);if(c)switch(c.mode){case"z":s.displayOptimization={mode:"z"};break;case"xz":{const e=c.multiscale;if(!e)throw new t("bad-format","XZ display optimization requires multiscale geometries");s.displayOptimization={mode:"xz",multiscale:e};break}}if(!s.encoding)return s;switch(s.encoding.type){case"location":null==s.spatialReference&&(s.spatialReference=n.WGS84),null==s.geometryType&&(s.geometryType="point");break;case"wkb":{if(!l)return s;const e=l.primary_column,t=l.columns[e];s.geometryType||(s.geometryType=w(t)),s.spatialReference||(s.spatialReference=P(t))}}return s}function y(e,t){if(null!=e){const t=e.primary_column,o=e.columns[t];return new s({primaryFieldName:t,orientation:o.orientation??null})}const o=r(t.map(e=>e.name));return new l({latitudeFieldName:o.latitudeFieldName,longitudeFieldName:o.longitudeFieldName})}function g(e){switch(e){case"Point":return"point";case"Polygon":case"MultiPolygon":return"polygon";case"LineString":return"polyline";case"MultiPoint":return"multipoint";default:return null}}function w(e){const{geometry_types:o}=e,n=new Set;for(const t of o){const e=g(t);e&&n.add(e)}if(n.size>1)throw new t("unsupported","Parquet mixed geometry types are not support",{geometryTypes:n});return 1===n.size?n.values().next().value:void 0}function P(e){const t=e.crs?.id?.code;return t&&"number"==typeof t?new n({wkid:t}):void 0}export{d as completeParquetLayerInfo,f as getParquetLayerInfo,c as parquetGeometryTypeKebabDict,p as toParquetJSONGeometryType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import{loadParquetModule as t}from"./loadParquetModule.js";import{GeometryInfoDescriptor as a,MultiScaleInfo as n,GeometryType as r}from"../../chunks/bundle.js";const i=t=>async function(a,n,r){const i=t(),{data:s}=await e(a,{responseType:"array-buffer",query:i,headers:{range:`bytes=${n}-${r}`},useRequestQueue:!0});return s},s=t=>async function(a){const n=t(),{data:r}=await e(a,{responseType:"native",method:"head",query:n,useRequestQueue:!0}),i=r.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class o{static async create(e,a){const n=await t(),r=await n.readMetadata(e,i(a),s(a));return o.fromFileMetadata(r)}static fromFileMetadata(e){const t=[];for(let a=0;a<e.numFields();a++){const n=e.getFieldByIndex(a);t.push({name:n.name,type:n.type,alias:n.name,index:n.index}),n.free()}return new o(e,t)}constructor(e,t){this._inner=e,this.fields=t}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(e){return this._inner.getFieldIndex(e)}tryReadGeoMetadata(){const e=this._inner.keyValueMetadata("geo");return null==e?null:JSON.parse(e)}tryReadEsriMetadata(){const e=this._inner.keyValueMetadata("esri");return null==e?null:JSON.parse(e)}}function d(e){switch(e){case"esriGeometryPoint":return r.Point;case"esriGeometryPolygon":return r.Polygon;case"esriGeometryPolyline":return r.Polyline;case"esriGeometryMultipoint":return r.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${e}`)}}function l(e,t,r){const i=a.new();if(i.geometryType=d(e.geometryType),"location"===e.encoding.type)i.latIndex=t.getFieldIndex(e.encoding.latitudeFieldName),i.lngIndex=t.getFieldIndex(e.encoding.longitudeFieldName);else if(i.wkbIndex=t.getFieldIndex(e.encoding.primaryFieldName),e.encoding.multiscale){const a=n.new();for(const n of e.encoding.multiscale.levels){const[e,r]=n.transform.translate,[i,s]=n.transform.scale,o=t.getFieldIndex(n.column);a.push(o,e,r,i,s)}i.setMultiscaleInfo(a)}return i.inWkid=e.spatialReference.wkid,r&&(i.outWkid=r.wkid),i}class u{static async create(e,a){const n=await t(),r=i(a.getCustomParameters),d=s(a.getCustomParameters),c=await n.readMetadata(e,r,d),m=l(a.geometryInfo,c,a.outSpatialReference),y=await n.readFile(e,r,d,c,m);return new u(y,o.fromFileMetadata(y.metadata()))}static async fromFile(e,a,n){const r=await t(),i=await r.readMetadataFromFile(e),s=a?l(a,i,n):void 0,d=await r.readFileFromBinary(s,e);return new u(d,o.fromFileMetadata(d.metadata()))}constructor(e,t){this.inner=e,this.metadata=t}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{u as ParquetFile,o as ParquetMetadata};
5
+ import e from"../../request.js";import t from"../../core/Error.js";import{loadParquetModule as n}from"./loadParquetModule.js";import{MultiscaleGeometryField as r,GeometryInfo as o,GeometryType as a,PrimaryGeometryField as i}from"../../chunks/bundle.js";const s=t=>async function(n,r,o,a){const i=t?.(),s=i?{...i,debug:a}:{debug:a},{data:u}=await e(n,{responseType:"array-buffer",query:s,headers:{range:`bytes=${r}-${o}`}});return u},u=t=>async function(n){const{data:r}=await e(n,{responseType:"native",method:"head",query:t?.()}),o=r.headers.get("Content-Length");if(null==o)throw new Error("Unable to parse content length");return parseInt(o,10)};function l(e){switch(e){case"esriGeometryPoint":return a.Point;case"esriGeometryPolygon":return a.Polygon;case"esriGeometryPolyline":return a.Polyline;case"esriGeometryMultipoint":return a.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function c(e){switch(e.encoding.type){case"wkb":return i.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:n}=e.encoding;return i.fromLocation(t,n)}}}function m(e,n){const a=e.spatialReference.wkid,i=n.wkid;if(!a||!i)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const s=l(e.geometryType),u=c(e),m=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,n]=e.transform.translate,[o,a]=e.transform.scale,i=new Float64Array([t,n]),s=new Float64Array([o,a]);m.push(r.new(e.level,e.column,i,s))}}return o.new(s,a,i,u,m)}async function f(e,t={}){const{ParquetFile:r}=await n(),o=s(t.getCustomParameters),a=u(t.getCustomParameters),i=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference):null;return r.fromUrl(e,o,a,i)}async function y(e,t={}){const{ParquetFile:r}=await n(),o=t.geometryInfo?m(t.geometryInfo,t.outSpatialReference):null;return r.fromBinary(e,o)}function d(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function p(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{f as createParquetFile,y as createParquetFileFromBytes,p as readEsriMetadata,d as readGeoMetadata};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.28",
3
+ "version": "4.34.0-next.29",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@esri/arcgis-html-sanitizer": "~4.1.0",
29
29
  "@esri/calcite-components": "^3.2.1",
30
- "@vaadin/grid": "~24.8.1",
30
+ "@vaadin/grid": "~24.8.2",
31
31
  "@zip.js/zip.js": "~2.7.62",
32
32
  "luxon": "~3.6.1",
33
33
  "marked": "~16.0.0",
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{p as e,c as n,e as r,a as t,r as o,l as a,b as l,d as i,f as u,s,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import{ArcadeDate as f}from"../arcade/ArcadeDate.js";import{toSymbolId as p}from"../arcade/arcadeEnvironment.js";import m from"../arcade/Dictionary.js";import d from"../arcade/Feature.js";import{j as y,e as v,k as x,m as g,l as j}from"../chunks/languageUtils.js";export{Voxel}from"../arcade/Voxel.js";import{clone as S}from"../core/lang.js";import{DateOnly as w}from"../core/sql/DateOnly.js";import{TimeOnly as $}from"../core/sql/TimeOnly.js";import b from"../geometry/Extent.js";import E from"../geometry/Multipoint.js";import A from"../geometry/Point.js";import F from"../geometry/Polygon.js";import P from"../geometry/Polyline.js";import{isArray as C,isString as _,isBoolean as D,isNumber as I}from"./guards.js";const M={vars:{$feature:"any",$view:"any"}};function R(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function T(e){return null==e?null:C(e)||y(e)?"array":v(e)?"date":_(e)?"text":D(e)?"boolean":I(e)?"number":e instanceof m?"dictionary":x(e)?"feature":e instanceof A?"point":e instanceof F?"polygon":e instanceof P?"polyline":e instanceof E?"multipoint":e instanceof b?"extent":e instanceof w?"dateOnly":e instanceof $?"time":g(e)?"featureSet":j(e)?"featureSetCollection":null}function k(n){if(!n)return null;try{return e(n)}catch(r){}return null}function z(e,r){const t="string"==typeof e?k(e):e;if(!t)return null;try{return r=r||S(M),n(t,r)}catch(o){}return null}function J(e,n,r){return{vars:{$feature:null==e?new d:d.createFromGraphic(e,r),$view:n?.view},spatialReference:n?.sr,timeZone:r??null}}function V(e,n,r){return d.createFromGraphicLikeObject(n,e,r,null)}function O(e,n){null!=e.vars&&(e.vars.$feature=n)}function Z(e,n){let t;try{t=r(e,n)}catch(o){t=null}return t}function q(e,n){let r;try{r=e?e(n):null}catch(t){r=null}return r}function G(e,n){try{return e?e(n):Promise.resolve(null)}catch(r){return Promise.resolve(null)}}const L=new Set(["$feature","$aggregatedFeatures","$voxel"].map(e=>p(e)));function N(e,n){if(!e)return[];const r="string"==typeof e?k(e):e;if(!r)return[];const o=t(r).filter(({varId:e})=>L.has(e)).map(({memberNamePattern:e})=>e).flatMap(e=>{if(e.includes("*")){if(null==n)return[];const r=new RegExp(`^${e.split(/\*+/).map(R).join(".*")}$`,"i");return n.filter(e=>r.test(e))}return e.toLowerCase()});return[...new Set(o.sort())]}function U(e){return o(e,"$view")}function B(e,n){return!!e&&o(e,n)}function H(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;let n,r;const{timeProperties:t,timeZone:o}=e;if(null!=t){const{currentStart:e,currentEnd:a}=t;null!=o?(n=null!=e?f.dateJSAndZoneToArcadeDate(e,o):null,r=null!=a?f.dateJSAndZoneToArcadeDate(a,o):null):(n=null!=e?f.dateJSToArcadeDate(e):null,r=null!=a?f.dateJSToArcadeDate(a):null)}return{view:e.viewingMode&&null!=e.scale?new m({__proto__:null,viewingMode:e.viewingMode,scale:e.scale,timeProperties:null!=n||null!=r?new m({__proto__:null,currentStart:n,currentEnd:r,startIncluded:!0,endIncluded:!0}):null}):null,sr:e.spatialReference}}function K({url:e,spatialReference:n,lrucache:r,interceptor:t}){const o=u();return o?o.createFeatureSetCollectionFromService(e,n,r,t):null}function Q({layer:e,spatialReference:n,outFields:r,returnGeometry:t,lrucache:o,interceptor:a}){if(null===e)return null;const l=u();return l?l.constructFeatureSet(e,n,r,t??!0,o,a):null}function W(e){if(null===e?.map)return null;const n=u();return n?n.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function X(e,n){return m.convertJsonToArcade(e,n)}function Y(e,n,r=[]){return a(e,n,r)}function ee(){return l()}function ne(){return i()}function re(e){return"type"in e&&("class-breaks"===e.type||"dictionary"===e.type||"dot-density"===e.type||"pie-chart"===e.type||"simple"===e.type||"unique-value"===e.type)}function te(e){return"esri.layers.support.LabelClass"===e.declaredClass}function oe(e){return"esri.PopupTemplate"===e.declaredClass}function ae(e,n){if(!e)return!1;if("string"==typeof e)return n(e);const r=e;if(re(r)){if("dot-density"===r.type){const e=r.attributes?.some(e=>n(e.valueExpression));if(e)return e}const e=r.visualVariables,t=!!e&&e.some(e=>{let r=n(e.valueExpression);return"size"===e.type&&(ce(e.minSize)&&(r=r||n(e.minSize.valueExpression)),ce(e.maxSize)&&(r=r||n(e.maxSize.valueExpression))),r});return!(!("valueExpression"in r)||!n(r.valueExpression))||t}if(te(r)){const e=r.labelExpressionInfo?.expression;return!(!e||!n(e))||!1}return!!oe(r)&&(!!r.expressionInfos&&r.expressionInfos.some(e=>n(e.expression))||Array.isArray(r.content)&&r.content.some(e=>"expression"===e.type&&n(e.expressionInfo?.expression)))}function le(e){const n=k(e);return!!n&&s(n)}function ie(e){return ae(e,le)}function ue(e){const n=k(e);return!!n&&c(n)}function se(e){return ae(e,ue)}function ce(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}export{m as Dictionary,d as arcadeFeature,Q as convertFeatureLayerToFeatureSet,X as convertJsonToArcade,W as convertMapToFeatureSetCollection,K as convertServiceUrlToWorkspace,J as createExecContext,V as createFeature,z as createFunction,k as createSyntaxTree,U as dependsOnView,ne as enableFeatureSetOperations,ee as enableGeometryOperations,Z as evalSyntaxTree,G as executeAsyncFunction,q as executeFunction,N as extractFieldNames,T as getArcadeType,H as getViewInfo,ie as hasGeometryFunctions,se as hasGeometryOperations,B as hasVariable,Y as loadScriptDependencies,O as updateExecContext};
5
+ import{p as e,c as n,e as r,a as t,r as o,l as a,b as l,d as u,f as s,s as c,g as f,h as p}from"../chunks/arcade.js";export{i as arcade}from"../chunks/arcade.js";import{ArcadeDate as m}from"../arcade/ArcadeDate.js";import{toSymbolId as d}from"../arcade/arcadeEnvironment.js";import y from"../arcade/Dictionary.js";import v from"../arcade/Feature.js";import{j as x,e as g,k as j,m as S,l as h}from"../chunks/languageUtils.js";export{Voxel}from"../arcade/Voxel.js";import{clone as w}from"../core/lang.js";import{DateOnly as $}from"../core/sql/DateOnly.js";import{TimeOnly as b}from"../core/sql/TimeOnly.js";import E from"../geometry/Extent.js";import A from"../geometry/Multipoint.js";import F from"../geometry/Point.js";import P from"../geometry/Polygon.js";import C from"../geometry/Polyline.js";import{isArray as _,isString as D,isBoolean as I,isNumber as M}from"./guards.js";const R={vars:{$feature:"any",$view:"any"}};function T(e){return e.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function k(e){return null==e?null:_(e)||x(e)?"array":g(e)?"date":D(e)?"text":I(e)?"boolean":M(e)?"number":e instanceof y?"dictionary":j(e)?"feature":e instanceof F?"point":e instanceof P?"polygon":e instanceof C?"polyline":e instanceof A?"multipoint":e instanceof E?"extent":e instanceof $?"dateOnly":e instanceof b?"time":S(e)?"featureSet":h(e)?"featureSetCollection":null}function z(n){if(!n)return null;try{return e(n)}catch(r){}return null}function J(e,r){const t="string"==typeof e?z(e):e;if(!t)return null;try{return r=r||w(R),n(t,r)}catch(o){}return null}function V(e,n,r){return{vars:{$feature:null==e?new v:v.createFromGraphic(e,r),$view:n?.view},spatialReference:n?.sr,timeZone:r??null}}function O(e,n,r){return v.createFromGraphicLikeObject(n,e,r,null)}function Z(e,n){null!=e.vars&&(e.vars.$feature=n)}function q(e,n){let t;try{t=r(e,n)}catch(o){t=null}return t}function G(e,n){let r;try{r=e?e(n):null}catch(t){r=null}return r}function L(e,n){try{return e?e(n):Promise.resolve(null)}catch(r){return Promise.resolve(null)}}const N=new Set(["$feature","$aggregatedFeatures","$voxel"].map(e=>d(e)));function U(e,n){if(!e)return[];const r="string"==typeof e?z(e):e;if(!r)return[];const o=t(r).filter(({varId:e})=>N.has(e)).map(({memberNamePattern:e})=>e).flatMap(e=>{if(e.includes("*")){if(null==n)return[];const r=new RegExp(`^${e.split(/\*+/).map(T).join(".*")}$`,"i");return n.filter(e=>r.test(e))}return e.toLowerCase()});return[...new Set(o.sort())]}function B(e){return o(e,"$view")}function H(e,n){return!!e&&o(e,n)}function K(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;let n,r;const{timeProperties:t,timeZone:o}=e;if(null!=t){const{currentStart:e,currentEnd:a}=t;null!=o?(n=null!=e?m.dateJSAndZoneToArcadeDate(e,o):null,r=null!=a?m.dateJSAndZoneToArcadeDate(a,o):null):(n=null!=e?m.dateJSToArcadeDate(e):null,r=null!=a?m.dateJSToArcadeDate(a):null)}return{view:e.viewingMode&&null!=e.scale?new y({__proto__:null,viewingMode:e.viewingMode,scale:e.scale,timeProperties:null!=n||null!=r?new y({__proto__:null,currentStart:n,currentEnd:r,startIncluded:!0,endIncluded:!0}):null}):null,sr:e.spatialReference}}function Q({url:e,spatialReference:n,lrucache:r,interceptor:t}){const o=s();return o?o.createFeatureSetCollectionFromService(e,n,r,t):null}function W({layer:e,spatialReference:n,outFields:r,returnGeometry:t,lrucache:o,interceptor:a}){if(null===e)return null;const i=s();return i?i.constructFeatureSet(e,n,r,t??!0,o,a):null}function X(e){if(null===e?.map)return null;const n=s();return n?n.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Y(e,n){return y.convertJsonToArcade(e,n)}function ee(e,n,r=[]){return a(e,n,r)}function ne(){return l()}function re(){return u()}function te(e){return"type"in e&&("class-breaks"===e.type||"dictionary"===e.type||"dot-density"===e.type||"pie-chart"===e.type||"simple"===e.type||"unique-value"===e.type)}function oe(e){return"esri.layers.support.LabelClass"===e.declaredClass}function ae(e){return"esri.PopupTemplate"===e.declaredClass}function ie(e,n){if(!e)return!1;if("string"==typeof e)return n(e);const r=e;if(te(r)){if("dot-density"===r.type){const e=r.attributes?.some(e=>n(e.valueExpression));if(e)return e}const e=r.visualVariables,t=!!e&&e.some(e=>{let r=n(e.valueExpression);return"size"===e.type&&(pe(e.minSize)&&(r=r||n(e.minSize.valueExpression)),pe(e.maxSize)&&(r=r||n(e.maxSize.valueExpression))),r});return!(!("valueExpression"in r)||!n(r.valueExpression))||t}if(oe(r)){const e=r.labelExpressionInfo?.expression;return!(!e||!n(e))||!1}return!!ae(r)&&(!!r.expressionInfos&&r.expressionInfos.some(e=>n(e.expression))||Array.isArray(r.content)&&r.content.some(e=>"expression"===e.type&&n(e.expressionInfo?.expression)))}function le(e){const n=z(e);return!!n&&f(n)}function ue(e){return ie(e,le)}function se(e){const n=z(e);return!!n&&p(n)}function ce(e){return ie(e,se)}function fe(e){return ie(e,e=>{const n=z(e);return!!n&&c(n)})}function pe(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}export{y as Dictionary,v as arcadeFeature,W as convertFeatureLayerToFeatureSet,Y as convertJsonToArcade,X as convertMapToFeatureSetCollection,Q as convertServiceUrlToWorkspace,V as createExecContext,O as createFeature,J as createFunction,z as createSyntaxTree,B as dependsOnView,re as enableFeatureSetOperations,ne as enableGeometryOperations,q as evalSyntaxTree,L as executeAsyncFunction,G as executeFunction,U as extractFieldNames,k as getArcadeType,K as getViewInfo,ue as hasGeometryFunctions,ce as hasGeometryOperations,H as hasVariable,ee as loadScriptDependencies,fe as requiresTrack,Z as updateExecContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const e="20250702",a="674864ded3d837e633f203c1fa7aa349eef56c78";export{e as buildDate,a as commitHash};
5
+ const f="20250703",d="5c19f90991ddd5ff5635f045bebd5af2f99c0d78";export{f as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import c from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import A from"../../../geometry/Extent.js";import F from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as P}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as M}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import re from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import ie from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as ae}from"../../support/HighlightDefaults.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new F}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),f(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new M(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new P(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=t?.name??ae;return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),c=this.featureContainer.getSortKeys(a),h=({displayId:e},{displayId:t})=>c.has(e)&&c.has(t)?c.get(e)-c.get(t):e-t;return n.sort(h).reverse(),u.sort(h).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:A.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.subscriptionManager.update(e.targetState,this._lastTargetState),r=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=r.has(s.id);this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?c.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return c.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const c=await this.getWorker();await c.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const h=o.processor.mesh.strategy,d="cluster"===h.type||"binning"===h.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ce(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||c.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ce(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),e([_()],le.prototype,"updating",void 0),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import A from"../../../geometry/Extent.js";import F from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as P}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as M}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import re from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import ie from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as ae}from"../../support/HighlightDefaults.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new F,this._lastUpdate=0}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new M(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new P(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=t?.name??ae;return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:A.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),s=new Set(this.subscriptionManager.coverage?.target.keys());for(const i of this.featureContainer.tiles||[])i.isCoverage=s.has(i.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,f=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(f),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),e([_()],le.prototype,"updating",void 0),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,l=a(r,e)??i(r),o=t(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:l,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(t){const a=l(this.layer),i=t.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:i,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()},metadata:{spatialReference:this.layer.spatialReference,outSpatialReference:i,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:a,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,r,l){const a={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),layerId:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return o(e,r,a,l)}}export{y as ParquetLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,l=i(r,e)??a(r),o=t(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:l,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(t){const i=l(this.layer),a=t.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:a,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON(),displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:i,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,r,l){const i={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),layerId:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return o(e,r,i,l)}}export{y as ParquetLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../core/has.js";import{AProcessorStrategy as e,ASendState as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends t{}class i extends e{constructor(e,t,s,r){super(e,t,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,null!=this._evalOptions&&(this._evalOptions=a(this._evalOptions.$view.scale,e))}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new d(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map(e=>[t(e),e])),o=[];for(const a of this._source.chunks()){const e=a.reader.getCursor();for(;e.next();){const t=e.getObjectId(),a=e.getDisplayId(),n=r.get(t);if(null!=n){const e=s(a,n,t);o.push(e),r.delete(t)}}}return o}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const o of this._source.chunks()){const e=o.reader.getCursor();for(;e.next();){const o=e.getObjectId(),a=e.getDisplayId();t.has(a)&&!s.has(o)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(e){const t=[];for(const s of e.modified){const e=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=e,t.push(e)}const r=n.fromOptimizedFeatures(e.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const a=[];for(const s of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(s);null!=e&&a.push(e)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:t,removedDisplayIds:a});const d=o.fromFeatures(e.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,t,!1,d.queryInfo);for(const o of this._sendStates.values()){const e=d.getTileReader(o.subscription.tile);yield new s(o.subscription,e,a,!1,d.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions,this._sqlOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const o of this._source.chunks()){const{chunkId:a}=o;if(s.has(a))continue;s.add(a);const n=o.getTileReader(t.tile);n&&(yield new r(e.subscription,n,!1,o.end,o.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
5
+ import has from"../../../../../core/has.js";import{AProcessorStrategy as t,ASendState as e}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends e{}class i extends t{constructor(t,e,s,r){super(t,e,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(t){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=t,null!=this._evalOptions&&(this._evalOptions=a(this._evalOptions.$view.scale,t))}onSubscribe(t){super.onSubscribe(t),this._evalOptions=t.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(t){return new d(t)}get aggregateQueryEngine(){return null}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),o=[];for(const a of this._source.chunks()){const t=a.reader.getCursor();for(;t.next();){const e=t.getObjectId(),a=t.getDisplayId(),n=r.get(e);if(null!=n){const t=s(a,n,e);o.push(t),r.delete(e)}}}return o}getDisplayFeatures(t){const e=new Set(t),s=new Set,r=[];for(const o of this._source.chunks()){const t=o.reader.getCursor();for(;t.next();){const o=t.getObjectId(),a=t.getDisplayId();e.has(a)&&!s.has(o)&&(r.push({...t.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(t){const e=[];for(const s of t.modified){const t=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=t,e.push(t)}const r=n.fromOptimizedFeatures(t.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const a=[];for(const s of t.removed){const t=this._attributeStore.getDisplayIdForObjectId(s);null!=t&&a.push(t)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:t,modifiedDisplayIds:e,removedDisplayIds:a});const d=o.fromFeatures(t.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,e,!1,d.queryInfo);for(const o of this._sendStates.values()){const t=d.getTileReader(o.subscription.tile);yield new s(o.subscription,t,a,!1,d.queryInfo)}for(const s of t.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const t of this._sendStates.values())yield*this._update(t)}}removeChunks(t){for(const e of t)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const t of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(t);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(t){if(this.handledChunksForIdCreation.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(t.chunkId)}}async _updateAttributeData(){for(const t of this._source.chunks()){const{chunkId:e,reader:s}=t;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const t=s.getCursor();for(;t.next();){const e=this._attributeStore.createDisplayIdForObjectId(t.getObjectId());t.setDisplayId(e)}}}for(const t of this._source.chunks())if(!this.handledChunksForAttributeData.has(t.chunkId)){this.handledChunksForAttributeData.add(t.chunkId);const e=t.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions,this._sqlOptions)}}}*_update(t){const{subscription:e,handledChunks:s}=t;for(const o of this._source.chunks()){const{chunkId:a}=o;if(s.has(a)||!this.handledChunksForIdCreation.has(a)||!this.handledChunksForAttributeData.has(a))continue;s.add(a);const n=o.getTileReader(e.tile);n&&(yield new r(t.subscription,n,!1,o.end,o.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQuery as c,executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import u from"../../../../../rest/support/StatisticDefinition.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as m}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as l}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as y}from"./strategies/PagedTileLoadStrategy.js";import{ParquetLoadStrategy as _}from"./strategies/ParquetLoadStrategy.js";import{SnapshotLoadStrategy as g}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as f}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as S}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as v}from"../support/FeatureMetadata.js";import{UpdateTracking2D as b}from"../../support/UpdateTracking2D.js";class E{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._connection=r,this._cachedObjectIds=a,this._updateTracking=new b({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=v.createFeature(e.metadata),this._store=new S(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,featureIdInfo:s.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&("displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo)}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(e,t){const s=new Set,r=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),s.add(a));for(const a of t)this._cachedObjectIds.delete(a),r.add(a);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,r)}async applyCacheUpdate(){this.hasDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this._store.cleanup()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!!(i(n,"dataFilter")||i(n,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&i(n,"displayFilterInfo"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new p(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this._store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new f(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return new _(e,this._metadata,this._schema,this._store)}const a=this.service,i=m.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new g(a,i,this._store,n,this.metadata,this._connection):r?new y(a,i,this._store,this.metadata,this._connection):new l(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.addPromise(i),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r)return null;return await this._executeExceedsLimitQuery(e,t,r)?null:r}async _executeExceedsLimitQuery(e,t,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(e,t,s);try{const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const i=new u;i.statisticType="exceedslimit",i.maxPointCount=s.maxFeatureCount,i.maxRecordCount=s.maxFeatureCount,i.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(i.maxVertexCount=s.maxVertexCount),a.inner.outStatistics=[i],a.inner.cacheHint=!0;const n=await c(r,a.inner,void 0,{query:a.customParameters}),o=n.data.features[0]?.attributes.exceedslimit;return!(0===o)}catch(r){return!0}}async _executeExceedsLimitFallbackQuery(e,t,s){if(s.maxVertexCount)return!0;const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1,a.inner.cacheHint=!0;try{return(await d(r,a.inner,{query:a.customParameters})).data.count>s.maxFeatureCount}catch(i){return!0}}}export{E as FeatureSource};
5
+ import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQuery as c,executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import u from"../../../../../rest/support/StatisticDefinition.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as m}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as l}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as y}from"./strategies/PagedTileLoadStrategy.js";import{ParquetSnapshotLoadStrategy as _}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as g}from"./strategies/ParquetTileLoadStrategy.js";import{SnapshotLoadStrategy as f}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as S}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as v}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as b}from"../support/FeatureMetadata.js";import{UpdateTracking2D as E}from"../../support/UpdateTracking2D.js";class F{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._connection=r,this._cachedObjectIds=a,this._updateTracking=new E({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=b.createFeature(e.metadata),this._store=new v(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,featureIdInfo:s.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&("displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo)}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(e,t){const s=new Set,r=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),s.add(a));for(const a of t)this._cachedObjectIds.delete(a),r.add(a);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,r)}async applyCacheUpdate(){this.hasDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this._store.cleanup()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!!(i(n,"dataFilter")||i(n,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&i(n,"displayFilterInfo"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new p(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this._store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new S(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return null!=e.geometryInfo.displayOptimization?new g(e,this._metadata,this._schema,this._store):new _(e,this._metadata,this._schema,this._store)}const a=this.service,i=m.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new f(a,i,this._store,n,this.metadata,this._connection):r?new y(a,i,this._store,this.metadata,this._connection):new l(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.addPromise(i),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r)return null;return await this._executeExceedsLimitQuery(e,t,r)?null:r}async _executeExceedsLimitQuery(e,t,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(e,t,s);try{const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const i=new u;i.statisticType="exceedslimit",i.maxPointCount=s.maxFeatureCount,i.maxRecordCount=s.maxFeatureCount,i.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(i.maxVertexCount=s.maxVertexCount),a.inner.outStatistics=[i],a.inner.cacheHint=!0;const n=await c(r,a.inner,void 0,{query:a.customParameters}),o=n.data.features[0]?.attributes.exceedslimit;return!(0===o)}catch(r){return!0}}async _executeExceedsLimitFallbackQuery(e,t,s){if(s.maxVertexCount)return!0;const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1,a.inner.cacheHint=!0;try{return(await d(r,a.inner,{query:a.customParameters})).data.count>s.maxFeatureCount}catch(i){return!0}}}export{F as FeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- class r{constructor(r){this._store=r,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(r){throw new Error("InternalError: LoadStrategy does not support query info")}async queryByObjectId(r){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(r){throw new Error("InternalError: LoadStrategy does not support loading blobs")}prepareCacheUpdate(r,t){}applyCacheUpdate(){return null}}export{r as ALoadStrategy};
5
+ class r{constructor(r){this._store=r,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}get _signal(){return this._controller.signal}unsafeSetQueryHistoricMoment(r){throw new Error("InternalError: LoadStrategy does not support query info")}async queryByObjectId(r){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(r){throw new Error("InternalError: LoadStrategy does not support loading blobs")}prepareCacheUpdate(r,t){}applyCacheUpdate(){return null}}export{r as ALoadStrategy};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{difference as t,union as s}from"../../../../../../core/SetUtils.js";import i from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as r}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as a}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as o}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as l}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as n}from"../../support/FeatureSetReaderParquet.js";class m extends a{constructor(e,t,s,i){super(i),this._service=e,this._metadata=t,this._schema=s,this._chunkId=0,this._files=[],this._availableFields=new Set(s.mutable.availableFields)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async updateFields(e){await this._promise;const i=new Set(e),r=t(i,this._availableFields);this._availableFields=s(r,this._availableFields);const a=this._fieldsIndex;if(null==a)return;const o=Array.from(r).map(e=>a.get(e)?.attributeId);if(r.size)for(const t of this._files)await t.ensureFields(new Uint16Array(o))}async load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(t){const s=await r(t,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters});this._files.push(s),e(this._options);const a=s.fields().map(e=>({name:e.name,alias:e.name,type:e.type,attributeId:s.attributeIdFor(e.name)})),{timeZoneByFieldName:l}=this._service.metadata.fieldsIndex,m=i.fromJSON({fields:a,timeZoneByFieldName:l});this._fieldsIndex=m;const u=new Uint16Array(Array.from(this._availableFields.values()).map(e=>m.get(e)?.attributeId).filter(e=>null!=e));await s.readAllChunks(u,this._signal,e=>{if(this._signal.aborted)return;const t=this._chunkId++,s=new n(this._metadata,m,e,t),i=new o(s,null,t,!1);this._store.insert(i)})}async _download(){try{await Promise.all(this._service.source.urls.map(e=>this._insert(e)));const e=new o(l.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}export{m as ParquetSnapshotLoadStrategy};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{QueueProcessor as e}from"../../../../../../core/QueueProcessor.js";import{difference as t,union as i}from"../../../../../../core/SetUtils.js";import s from"../../../../../../geometry/Polygon.js";import a from"../../../../../../geometry/SpatialReference.js";import{toExtent as r}from"../../../../../../geometry/support/aaBoundingRect.js";import{convertFromPolygon as n}from"../../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../../layers/graphics/OptimizedGeometry.js";import{project as l}from"../../../../../../layers/graphics/data/projectionSupport.js";import d from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as m}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as u}from"./ALoadStrategy.js";import{ParquetSourceChunk as h}from"./chunks/ParquetSourceChunk.js";import{FeatureSetReaderParquet as p}from"../../support/FeatureSetReaderParquet.js";class f extends u{constructor(e,t,i,s){super(s),this._metadata=t,this._schema=i,this._files=[];const a=new Set(i.mutable.availableFields);if(!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._index=c.create(t,e,a,s,()=>this._schema.mutable.dataFilter.customParameters)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async load(e){const t=await this._index;await t.ensureLoaded(e)}unload(e){this._index.then(t=>t.unload(e.tile))}async updateFields(e){return(await this._index).updateFields(e)}async addParquetFile(e){throw new Error("Impl!")}}class c{static async create(e,t,i,s,a){const r=await Promise.all(t.source.urls.map(e=>m(e,{geometryInfo:t.geometryInfo,outSpatialReference:t.outSpatialReference,getCustomParameters:a}))),[n]=r,o=n.fields().map(e=>({name:e.name,alias:e.name,type:e.type,attributeId:n.attributeIdFor(e.name)})),{timeZoneByFieldName:l}=t.metadata.fieldsIndex,u=d.fromJSON({fields:o,timeZoneByFieldName:l}),h=new Uint16Array(Array.from(i.values()).map(e=>u.get(e)?.attributeId).filter(e=>null!=e)),p=t.geometryInfo.displayOptimization;if(!p)throw new Error("InternalError: tiled parquet load requires display optimization");return new c(e,await Promise.all(r),u,h,s,i,p)}constructor(t,i,s,a,r,n,o){this._metadata=t,this._files=i,this._fieldsIndex=s,this._fieldIndices=a,this._store=r,this._availableFields=n,this._displayOptimization=o,this._queue=new e({concurrency:1,process:e=>this._ensureLoaded(e)}),this._tileIdToChunkId=new Map}get file(){return this._files[0]}async ensureLoaded(e){return this._queue.push(e)}unload(e){const t=this._tileIdToChunkId.get(e.id);if(null!=t){for(const e of t)this._store.removeById(e);this._tileIdToChunkId.delete(e.id)}}async _ensureLoaded(e){const t=this._metadata.outSpatialReference,i=e.tile,{xmin:s,ymin:a,xmax:r,ymax:n}=y(i.extent,t);let o=0;const l={extent:i.extent,extent_lat_lng:{xmin:s,ymin:a,xmax:r,ymax:n},tile_level:i.level,attributes:this._fieldIndices};if("z"===this._displayOptimization.mode?await this.file.queryZChunks(l.extent_lat_lng,this._fieldIndices,e.signal,t=>{if(e.signal.aborted)return;const s=new p(this._metadata,this._fieldsIndex,t,o),a=new h(this._metadata,s,i,o++,!1);this._insertChunk(i,a)}):await this.file.queryXZChunks(l,e.signal,t=>{if(e.signal.aborted)return;const s=new p(this._metadata,this._fieldsIndex,t,o),a=new h(this._metadata,s,i,o++,!1);this._insertChunk(i,a)}),e.signal.aborted)return;const d=new h(this._metadata,null,i,o++,!0);this._insertChunk(i,d)}_insertChunk(e,t){let i=this._tileIdToChunkId.get(e.id);null==i&&(i=[],this._tileIdToChunkId.set(e.id,i)),i.push(t.chunkId),this._store.insert(t)}async updateFields(e){const s=new Set(e),a=t(s,this._availableFields);if(this._availableFields=i(a,this._availableFields),a.size)for(const t of this._files){const e=Array.from(a).map(e=>this._fieldsIndex.get(e)?.attributeId);await t.ensureFields(new Uint16Array(e))}}}function y(e,t){const i=[e.xmin,e.ymin,e.xmax,e.ymax],d=s.fromExtent(r(i,t)),m=l(d,t,a.WGS84);if(!m)return null;const u=n(new o,m,!1,!1),h=u.coords.filter((e,t)=>!(t%2)),p=u.coords.filter((e,t)=>t%2);return{xmin:Math.min(...h),ymin:Math.min(...p),xmax:Math.max(...h),ymax:Math.max(...p)}}export{f as ParquetTileLoadStrategy};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as t}from"../../../support/FeatureSetReaderJSON.js";class r extends e{constructor(e,r){super(),this.chunkId=e,this.normalizedChunkId=this.chunkId,this._empty=t.empty(r)}get reader(){return this._empty}get queryInfo(){return{}}get first(){return!1}get end(){return!0}get isTiled(){return!1}getTileReader(e){return this._empty}}export{r as FeatureSourceEndChunk};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderIndirect as t}from"../../../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as r}from"../../../support/FeatureSetReaderJSON.js";class i extends e{constructor(e,t,r,i,s){super(),this._metadata=e,this._reader=t,this._tile=r,this._page=i,this._end=s,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._page}${this.end?"e":""}`}get reader(){return this._reader??r.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get tile(){return this.tile}get queryInfo(){return{type:"parquet",chunkId:this.chunkId,queryJSON:null,page:this._page,size:this.size(),tileId:this._tile.id,end:this.end}}get isTiled(){return!0}getTileReader(e){if(this._tile.key.id===e.key.id){const r=[];for(let e=0;e<this.reader.getSize();e++)r.push(e);const i=t.from(this.reader,r);return i.setTransformForDisplay(e.transform),i}return null}}export{i as ParquetSourceChunk};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as s}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as t}from"../../../FeatureStoreQueryAdapter.js";import{OverrideState as r}from"./Overrides.js";class o{constructor(s){this._metadata=s,this._chunks=new Map,this._chunksToRemove=[],this._overrides=new r,this.events=new e,this.featureAdapter=new t}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrides.clearWeakOverrides()}*chunks(){this._overrides&&(yield this._overrides.asChunk(this._metadata)),yield*this._chunks.values()}insert(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrides.onChunkInsert(e),this._chunks.set(e.chunkId,e),this.events.emit("changed")}remove(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanup(){const e=this._chunksToRemove;return this._chunksToRemove=[],this._overrides.cleanup(this._chunks.values()),e}applyOverride(e){this._overrides.apply(e,this),this.events.emit("changed");for(const s of this._chunks.values())s.invalidate()}takeOverrideUpdate(){return this._overrides.takeOverrideUpdate()}refresh(){this.events.emit("refresh")}forEach(e){const s=new Set;for(const t of this.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r.copy()),s.add(t))}}}forEachUnsafe(e){const s=new Set;for(const t of this.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r),s.add(t))}}}mapObjectIdsFromGlobalIds(e,s){const t=new Map,r=new Set(e);return this._overrides.putWeakObjectIdsFromGlobalIds(t,r,s),this._forEachUnsafeIgnoreOverrides(e=>{const o=e.readAttribute(s);if(o&&r.has(o)&&!t.has(o)){const s=e.getObjectId();t.set(o,s)}}),t}forEachInBounds(e,s){const t=new Set;for(const r of this.chunks()){const o=r.queryFeaturesInBounds(e);for(;o.next();){const e=o.getObjectId();t.has(e)||(s(o.copy()),t.add(e))}}}forEachBounds(e,t){const r=s();for(const s of e){s.getBounds(r)&&t(r)}}_forEachUnsafeIgnoreOverrides(e){const s=new Set;for(const t of this._chunks.values()){const r=t.reader.withoutOverrides().getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r),s.add(t))}}}}export{o as FeatureSourceChunkStore};
5
+ import e from"../../../../../../../core/Evented.js";import has from"../../../../../../../core/has.js";import{create as s}from"../../../../../../../geometry/support/aaBoundingBox.js";import{FeatureStoreQueryAdapter as t}from"../../../FeatureStoreQueryAdapter.js";import{OverrideState as r}from"./Overrides.js";class o{constructor(s){this._metadata=s,this._chunks=new Map,this._chunksToRemove=[],this._overrides=new r,this.events=new e,this.featureAdapter=new t}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrides.clearWeakOverrides()}*chunks(){this._overrides&&(yield this._overrides.asChunk(this._metadata)),yield*this._chunks.values()}insert(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrides.onChunkInsert(e),this._chunks.set(e.chunkId,e),this.events.emit("changed")}remove(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}removeById(e){has("esri-2d-update-debug")&&console.debug(`Chunk[${e}] SourceChunkStore.remove`);const s=this._chunks.get(e);this._chunks.delete(e),s&&this._chunksToRemove.push(s)}cleanup(){const e=this._chunksToRemove;return this._chunksToRemove=[],this._overrides.cleanup(this._chunks.values()),e}applyOverride(e){this._overrides.apply(e,this),this.events.emit("changed");for(const s of this._chunks.values())s.invalidate()}takeOverrideUpdate(){return this._overrides.takeOverrideUpdate()}refresh(){this.events.emit("refresh")}forEach(e){const s=new Set;for(const t of this.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r.copy()),s.add(t))}}}forEachUnsafe(e){const s=new Set;for(const t of this.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r),s.add(t))}}}mapObjectIdsFromGlobalIds(e,s){const t=new Map,r=new Set(e);return this._overrides.putWeakObjectIdsFromGlobalIds(t,r,s),this._forEachUnsafeIgnoreOverrides(e=>{const o=e.readAttribute(s);if(o&&r.has(o)&&!t.has(o)){const s=e.getObjectId();t.set(o,s)}}),t}forEachInBounds(e,s){const t=new Set;for(const r of this.chunks()){const o=r.queryFeaturesInBounds(e);for(;o.next();){const e=o.getObjectId();t.has(e)||(s(o.copy()),t.add(e))}}}forEachBounds(e,t){const r=s();for(const s of e){s.getBounds(r)&&t(r)}}_forEachUnsafeIgnoreOverrides(e){const s=new Set;for(const t of this._chunks.values()){const r=t.reader.withoutOverrides().getCursor();for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r),s.add(t))}}}}export{o as FeatureSourceChunkStore};