@arcgis/core 5.2.0-next.47 → 5.2.0-next.48

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 (187) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +1 -0
  3. package/assets/esri/core/workers/chunks/{2a4868acd546312aa6d8.js → 05f6887805d92da03122.js} +1 -1
  4. package/assets/esri/core/workers/chunks/069b6d8bdb34ee88d437.js +1 -0
  5. package/assets/esri/core/workers/chunks/{68f7eaa3122de7c00adb.js → 0ea374f7b16745b9bbc7.js} +1 -1
  6. package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +1 -0
  7. package/assets/esri/core/workers/chunks/1843a762f7051f61af43.js +1 -0
  8. package/assets/esri/core/workers/chunks/20c363a113dc068de9e0.js +1 -0
  9. package/assets/esri/core/workers/chunks/{f2c8122d31aedc2604ee.js → 24d936d459c538187af6.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4d4710d57c72ec75cccc.js → 26f1fd3f2be5102aae1d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/285a5bd708f0fe1c620c.js +1 -0
  12. package/assets/esri/core/workers/chunks/2e121eac97ae72a8b49a.js +1 -0
  13. package/assets/esri/core/workers/chunks/{7777a79f26a06a6c5240.js → 304a22c580ce103480cb.js} +1 -1
  14. package/assets/esri/core/workers/chunks/327899182a4dace428eb.js +1 -0
  15. package/assets/esri/core/workers/chunks/32ca15d928d51b380068.js +1 -0
  16. package/assets/esri/core/workers/chunks/{383392c63202ac044b6c.js → 33bd9785bd0b6ccef21b.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{0f19bc532be24ca64755.js → 36fe6adf6517d8f80125.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3e1a7e4c674057807e3a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d36f17d32c654b1ac7fa.js → 3f1a7f8a9ead64bf0b7b.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{cc637aec16918052548e.js → 47af3525396f890f2a6b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/4d9433f127aef76f3449.js +1 -0
  22. package/assets/esri/core/workers/chunks/4e2baa60c5d5197b2271.js +1 -0
  23. package/assets/esri/core/workers/chunks/4ee900e5dbb130fa0c7b.js +1 -0
  24. package/assets/esri/core/workers/chunks/519c0b51b1ba42fb71d7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{c4b13124a9cfc78c42a6.js → 57fa3c0e7892c2eef3ee.js} +1 -1
  26. package/assets/esri/core/workers/chunks/68b615bbd27fadcfcb66.js +1 -0
  27. package/assets/esri/core/workers/chunks/68d898037feb0aee3138.js +1 -0
  28. package/assets/esri/core/workers/chunks/69b9a327f23e052fced7.js +1 -0
  29. package/assets/esri/core/workers/chunks/69d740ab18510156f5d6.js +1 -0
  30. package/assets/esri/core/workers/chunks/6c2b5087a9df65267f4e.js +1 -0
  31. package/assets/esri/core/workers/chunks/6fbcf1b85461c6c6c127.js +1 -0
  32. package/assets/esri/core/workers/chunks/7659391f952d134164cf.js +1 -0
  33. package/assets/esri/core/workers/chunks/7759a489205a874e13bb.js +1 -0
  34. package/assets/esri/core/workers/chunks/78918035144c3c76df71.js +1 -0
  35. package/assets/esri/core/workers/chunks/{2b669473aa2c7cfb63c7.js → 7b0ed52363704cfce129.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{98f575c038da74ced2a6.js → 7d0ff52748fd4eb0334d.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{8f9fb4e8a7d73db41664.js → 851bcc75acac4a2f199b.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{6010b7be978698a642d0.js → 8977c85aecc7e08ab13c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +1 -0
  40. package/assets/esri/core/workers/chunks/{f2adf1227a795604d3b8.js → 90ae80b797642bff0efa.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{dee4019338a79c1ecd26.js → 9d0a9d465ec3a8ba1ed2.js} +1 -1
  42. package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +1 -0
  43. package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +1 -0
  44. package/assets/esri/core/workers/chunks/{728ea88e7d4733230e1f.js → b30237361d87cf982e41.js} +23 -24
  45. package/assets/esri/core/workers/chunks/{ee58f4bbc0a1f7d03df0.js → b32ede7805c7c6644e4c.js} +1 -1
  46. package/assets/esri/core/workers/chunks/b5d23efa584c74955d5b.js +1 -0
  47. package/assets/esri/core/workers/chunks/b83f2bbd634f57a5e8f9.js +1 -0
  48. package/assets/esri/core/workers/chunks/b8bdacebd4d24ba90f3f.js +1 -0
  49. package/assets/esri/core/workers/chunks/bab71e1b8b93d09d4809.js +1 -0
  50. package/assets/esri/core/workers/chunks/bb8e9b8343b83dd1ba3c.js +1 -0
  51. package/assets/esri/core/workers/chunks/bd8b180c61a80e60568c.js +1 -0
  52. package/assets/esri/core/workers/chunks/be6caade351e89f84251.js +680 -0
  53. package/assets/esri/core/workers/chunks/{8026cc0065f6520c4161.js → bef1990159c0e49e7d27.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{b3cd17daf5a297b96705.js → c3766d98f0a70897647f.js} +1 -1
  55. package/assets/esri/core/workers/chunks/cd1f1a72483b7c80bd9a.js +1 -0
  56. package/assets/esri/core/workers/chunks/{744f34e379484e63277c.js → cdb331b58e22f8c1c988.js} +2 -2
  57. package/assets/esri/core/workers/chunks/{b23d1e10fc4161d1f3eb.js → d021775cf747556660a5.js} +1 -1
  58. package/assets/esri/core/workers/chunks/d49e42f36bc3dc256b9f.js +1 -0
  59. package/assets/esri/core/workers/chunks/{7c2784ebbe17d79f669c.js → de50a19944617cd426b8.js} +1 -1
  60. package/assets/esri/core/workers/chunks/e232459f0b00110e07ac.js +1 -0
  61. package/assets/esri/core/workers/chunks/e7e3ea7af928b49b226c.js +1 -0
  62. package/assets/esri/core/workers/chunks/ee6bb6cd16f99421c76b.js +1 -0
  63. package/assets/esri/core/workers/chunks/fd2ba6f76645ba503cbb.js +1 -0
  64. package/assets/esri/core/workers/chunks/{85cd0cd721b27c497b18.js → fed6c75485601cd3afa1.js} +1 -1
  65. package/assets/esri/core/workers/chunks/ff2c4f648f77850922d5.js +1 -0
  66. package/assets/esri/libs/basisu/basis_encoder.wasm +0 -0
  67. package/assets/esri/libs/basisu/basis_transcoder.wasm +0 -0
  68. package/chunks/DefaultMaterial.glsl.js +1 -1
  69. package/chunks/basis_encoder.js +1 -1
  70. package/chunks/basis_transcoder.js +1 -1
  71. package/config.js +1 -1
  72. package/core/has.js +1 -1
  73. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  74. package/core/promiseUtils.js +1 -1
  75. package/core/workers/workerFactory.js +1 -1
  76. package/geometry/Mesh.d.ts +4 -4
  77. package/geometry/support/MeshMaterialMetallicRoughness.d.ts +13 -1
  78. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  79. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  80. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  81. package/geometry/support/meshUtils.d.ts +33 -5
  82. package/geometry/support/plane.js +1 -1
  83. package/kernel.js +1 -1
  84. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  85. package/layers/raster/formats/JpgPlus.js +1 -1
  86. package/layers/raster/formats/RasterCodec.js +1 -1
  87. package/layers/raster/formats/TiffDecoder.js +1 -1
  88. package/layers/raster/formats/Zlib.js +2 -0
  89. package/package.json +2 -2
  90. package/rest/featureService/FeatureService.d.ts +74 -1
  91. package/rest/featureService/FeatureService.js +1 -1
  92. package/support/revision.js +1 -1
  93. package/symbols/ObjectSymbol3DLayer.d.ts +10 -8
  94. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +9 -4
  95. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +1 -1
  96. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  97. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  98. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  99. package/views/2d/layers/features/Processor.js +1 -1
  100. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  101. package/views/2d/layers/features/processor/AggregateStrategy.js +2 -0
  102. package/views/2d/layers/features/processor/bins/BinAdapter.js +2 -0
  103. package/views/2d/layers/features/processor/bins/BinLevelState.js +2 -0
  104. package/views/2d/layers/features/processor/bins/BinState.js +2 -0
  105. package/views/2d/layers/features/processor/bins/createBinningStrategy.js +2 -0
  106. package/views/2d/layers/features/processor/clusters/ClusterAdapter.js +2 -0
  107. package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +2 -0
  108. package/views/2d/layers/features/processor/clusters/ClusterSendState.js +2 -0
  109. package/views/2d/layers/features/processor/clusters/createClusterStrategy.js +2 -0
  110. package/views/2d/layers/features/processor/createAggregateStrategy.js +2 -0
  111. package/views/2d/layers/features/processor/tracks/Track.js +2 -0
  112. package/views/2d/layers/features/processor/tracks/TrackAdapter.js +2 -0
  113. package/views/2d/layers/features/processor/tracks/TrackLevelState.js +2 -0
  114. package/views/2d/layers/features/processor/tracks/TrackSendState.js +2 -0
  115. package/views/2d/layers/features/processor/tracks/createTrackStrategy.js +2 -0
  116. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  117. package/views/3d/glTF/LoaderResult.js +1 -1
  118. package/views/3d/glTF/internal/Resource.js +1 -1
  119. package/views/3d/glTF/loader.js +1 -1
  120. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  121. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  122. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  123. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  124. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  125. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +19 -20
  126. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  127. package/views/3d/webgl-engine/lib/NavigationDepthCache.js +1 -1
  128. package/views/3d/webgl-engine/lib/NavigationDepthCacheStore.js +2 -0
  129. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  130. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  131. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  132. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  133. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  134. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  135. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  136. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  137. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  138. package/views/PopupView.js +1 -1
  139. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  140. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  141. package/views/support/AnalysisViewManager.js +1 -1
  142. package/assets/esri/core/workers/chunks/0115681a3de6df0aebdf.js +0 -1
  143. package/assets/esri/core/workers/chunks/025caafc70ac26f0a4ed.js +0 -1
  144. package/assets/esri/core/workers/chunks/08e18fb12533fc76e49c.js +0 -1
  145. package/assets/esri/core/workers/chunks/176c5eaaa23a479c88e0.js +0 -1
  146. package/assets/esri/core/workers/chunks/1f118d85d8271ad7690b.js +0 -1
  147. package/assets/esri/core/workers/chunks/268637fd6c50264acfc3.js +0 -1
  148. package/assets/esri/core/workers/chunks/296fa9fb80e521c30cb1.js +0 -1
  149. package/assets/esri/core/workers/chunks/354199a41de44902de84.js +0 -1
  150. package/assets/esri/core/workers/chunks/384b619854ef8a3f6e94.js +0 -1
  151. package/assets/esri/core/workers/chunks/3af923abeb6e65c4468f.js +0 -1
  152. package/assets/esri/core/workers/chunks/46d3ddf62fa7a76dd57d.js +0 -1
  153. package/assets/esri/core/workers/chunks/4b24f72b56edc28bb15e.js +0 -1
  154. package/assets/esri/core/workers/chunks/4f09f208ece2ec1db727.js +0 -1
  155. package/assets/esri/core/workers/chunks/57374213084bef59b776.js +0 -1
  156. package/assets/esri/core/workers/chunks/5f9c4dad6952c4c58ebf.js +0 -1
  157. package/assets/esri/core/workers/chunks/706230b70a36d2e038f7.js +0 -1
  158. package/assets/esri/core/workers/chunks/7cc729b57a6a52c8ac68.js +0 -1
  159. package/assets/esri/core/workers/chunks/804ab5f614efa12a131b.js +0 -1
  160. package/assets/esri/core/workers/chunks/81d55594cee124040565.js +0 -1
  161. package/assets/esri/core/workers/chunks/8d90bef1091204fba0f1.js +0 -1
  162. package/assets/esri/core/workers/chunks/8ec5e470583b75fceae1.js +0 -1
  163. package/assets/esri/core/workers/chunks/9114a575b78a7ea18d0f.js +0 -1
  164. package/assets/esri/core/workers/chunks/93e705c1147cc8ceca02.js +0 -1
  165. package/assets/esri/core/workers/chunks/a8033e606b2db1ee332d.js +0 -1
  166. package/assets/esri/core/workers/chunks/a9c641bcdef161c754bf.js +0 -1
  167. package/assets/esri/core/workers/chunks/ad5c2b0de6713d0a93a4.js +0 -680
  168. package/assets/esri/core/workers/chunks/ae50b2d5e63f62c088d2.js +0 -1
  169. package/assets/esri/core/workers/chunks/aea247138617e12b699b.js +0 -1
  170. package/assets/esri/core/workers/chunks/b03dcf3d55266745f3d1.js +0 -1
  171. package/assets/esri/core/workers/chunks/c01a121ebe571a848452.js +0 -1
  172. package/assets/esri/core/workers/chunks/c3cd38ca8690286d40d7.js +0 -1
  173. package/assets/esri/core/workers/chunks/c6042825f61cd70d54d8.js +0 -1
  174. package/assets/esri/core/workers/chunks/d8b67ca02cdc1e8191e3.js +0 -1
  175. package/assets/esri/core/workers/chunks/dadefe369f49e89a2610.js +0 -1
  176. package/assets/esri/core/workers/chunks/db416ba3132034e20642.js +0 -1
  177. package/assets/esri/core/workers/chunks/dfbdc72c7ea137e3841d.js +0 -1
  178. package/assets/esri/core/workers/chunks/e3e966777f18164afcd8.js +0 -1
  179. package/assets/esri/core/workers/chunks/e9c48630757bea465b7e.js +0 -1
  180. package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +0 -1
  181. package/assets/esri/core/workers/chunks/ff089723a27859fe18d1.js +0 -1
  182. package/chunks/Zlib.js +0 -2
  183. package/views/2d/layers/features/processor/AAggregateStrategy.js +0 -2
  184. package/views/2d/layers/features/processor/BinningStrategy.js +0 -2
  185. package/views/2d/layers/features/processor/ClusterStrategy.js +0 -2
  186. package/views/2d/layers/features/processor/TrackStrategy.js +0 -2
  187. /package/assets/esri/core/workers/chunks/{744f34e379484e63277c.js.LICENSE.txt → cdb331b58e22f8c1c988.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import{Loadable as u}from"../../core/Loadable.js";import{throwIfAborted as d,throwIfAbortError as p}from"../../core/promiseUtils.js";import{property as c,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/SpatialReference.js";import{curveTypeDict as h}from"../../geometry/support/typeUtils.js";import{getFeatureJSON as f,getFeatureIds as b,getAttachmentEditsJSON as v,isProtectedOrPrivateVersionError as g,unpackEditResultData as j,createEditedFeatures as S}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as C,normalizeEdits as T,processGeometries as A}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as E}from"../../layers/mixins/EditBusLayer.js";import{ensureCredentialIfSignedIn as F}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as O}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as I,allCurveTypes as w}from"../../layers/support/serviceCapabilitiesUtils.js";import R from"../../portal/PortalItem.js";import{getUserPrivileges as U}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as P}from"../../portal/support/urlUtils.js";import{parseUrl as D,asValidOptions as V,encode as G}from"../utils.js";import{unapplyEditsZUnitScaling as k}from"../query/operations/editsZScale.js";import{readBoolean as _,readNumber as x}from"../support/jsonUtils.js";import{isSafeToEditVersion as M,isVersionInEditSession as N,currentSessionId as L}from"../../versionManagement/support/versionManagementUtils.js";import{reader as J}from"../../core/accessorSupport/decorators/reader.js";function Q(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function q(e){return{data:W(e),sync:Z(e),operations:B(e.capabilities,e),query:H(e),editing:z(e)}}function W(e){const t=_(e,"supportsTrueCurve",!1);return{isDataVersioned:_(e,"hasVersionedData",!1),isDataBranchVersioned:_(e,"hasBranchVersionedData",!1),supportsTrueCurve:t,supportedCurveTypes:K(e,t)}}function B(e,t){const s=e?e.toLowerCase().split(",").map(e=>e.trim()):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:_(t,"supportsQueryDataElements",!1),supportsQueryDomains:_(t,"supportsQueryDomains",!1),supportsQueryContingentValues:_(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function H(e){return{maxRecordCountFactor:x(e,"maxRecordCountFactor",void 0),maxRecordCount:x(e,"maxRecordCount",void 0),supportsTrueCurveWithPBF:$(e)}}function $(e){return!!Array.isArray(e.supportedTrueCurvePbfFeatureEncodings)&&e.supportedTrueCurvePbfFeatureEncodings.includes("esriDefault")}function z(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:_(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:_(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:_(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:_(e,"supportsSharedTemplates",!1)||_(e,"hasSharedTemplates",!1),supportsSplit:_(t,"supportsSplit",!1),supportsTrueCurveUpdate:_(e,"allowTrueCurvesUpdates",!1),supportsTrueCurveUpdateByTrueCurveClientsOnly:_(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0)}}function Z(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:_(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}function K(e,t){return Array.isArray(e.supportedCurveTypes)?e.supportedCurveTypes.map(e=>h.fromJSON(e)).filter(i):t?w:[]}let X=class extends(n(o(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null,this._layerTableIndex=new Map,this._xyToleranceCache=new Map}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!P(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map(e=>{const{type:t,geometryType:s}=e;return{...Q(this.url,e),type:t||"Feature Layer",geometryType:s}})}readTableInfos(e,t){return(t.tables||[]).map(e=>Q(this.url,e))}readCapabilities(e,t){return q(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}get loaded(){return super.loaded}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then(()=>this._setUserPrivileges(e))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),d(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter(e=>!e.error).map(l);let n=0;return r.map(e=>{s=E(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null}),r}catch(r){throw s&&s.reject(r),r}}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){p(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await O(this.url,t)}catch(u){p(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){p(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new R({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return U(l)}catch(u){p(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await F(this.url);const s=t?.globalIdUsed??!1,a=y.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map(async e=>{const t=e.addFeatures?.map(e=>f({spatialReference:a},e,null))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map(e=>f({spatialReference:a},e,null))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,d=b(e.identifierFields,e.deleteFeatures,s),p=d.length>0?d:null;k(o,u,a);const c=await v(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:p,attachments:m,...y}})),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,trueCurveClient:n?.editsRespectTrueCurves,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await M(this.url,t?.gdbVersion,!0);const d=N(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const p=D(this.url),c=V(p.query,{query:G({...u,f:"json"}),method:"post"});let m;d&&(c.authMode="immediate",c.query.sessionId=L);try{m=await r(this.url+"/applyEdits",c)}catch(h){if(!g(h))throw h;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...Y(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0,usingTelecomOperations:e.some(e=>e.deleteAssociations||e.combineGroupedObjects||e.divideGroupedObjects)};return{edits:await Promise.all(e.map(async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(C(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=T(e,t,"feature-service"),n={};if(e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects),!e.identifierFields){await this.fetchAllLayersAndTables();const t=this._layerTableIndex.get(e.id);t&&(e.identifierFields={globalIdField:t.globalIdField,objectIdField:t.objectIdField})}const l=await A(o,t.data.supportedCurveTypes,this._xyToleranceCache);return{id:e.id,...l,...n,identifierFields:e.identifierFields}})),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:D(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:D(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map(e=>{const{type:t,geometryType:s}=e,r=Q(this.url,e),i=I(e,r.url);return this._layerTableIndex.set(e.id,e),{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}}),tables:s.data.tables.map(e=>{const t=Q(this.url,e),s=I(e,t.url);return this._layerTableIndex.set(e.id,e),{...t,capabilities:s}})}}};function Y(e){const t=e.data,s=[];return{results:t.map(e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=j(t),i=e.editedFeatures,a=i?.spatialReference?new y({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?S(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}}),editedFeatures:s}}e([c()],X.prototype,"url",void 0),e([c()],X.prototype,"sourceJSON",void 0),e([c()],X.prototype,"userHasFullEditingPrivileges",void 0),e([c()],X.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],X.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],X.prototype,"versionManagementServiceUrl",null),e([c()],X.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],X.prototype,"layerInfos",void 0),e([J("layerInfos",["layers"])],X.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],X.prototype,"tableInfos",void 0),e([J("tableInfos",["tables"])],X.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],X.prototype,"capabilities",void 0),e([J("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],X.prototype,"readCapabilities",null),e([c({readOnly:!0})],X.prototype,"effectiveCapabilities",null),X=e([m("esri.rest.featureService.FeatureService")],X);const ee=X;export{ee as default};
2
+ import{__decorate as e}from"tslib";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{EventedMixin as o}from"../../core/Evented.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import{JSONSupportMixin as l}from"../../core/JSONSupport.js";import{clone as u}from"../../core/lang.js";import{Loadable as d}from"../../core/Loadable.js";import{throwIfAborted as p,throwIfAbortError as c}from"../../core/promiseUtils.js";import{removeTrailingSlash as m}from"../../core/urlUtils.js";import{property as y,subclass as h}from"../../core/accessorSupport/decorators.js";import f from"../../geometry/SpatialReference.js";import{curveTypeDict as v}from"../../geometry/support/typeUtils.js";import{getFeatureJSON as b,getFeatureIds as g,getAttachmentEditsJSON as S,isProtectedOrPrivateVersionError as E,unpackEditResultData as j,createEditedFeatures as C}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as R,normalizeEdits as T,processGeometries as F}from"../../layers/graphics/editingSupport.js";import{onApplyEditsEvent as O,onUpdateMomentEvent as A,emitApplyEditsEvent as I}from"../../layers/mixins/EditBusLayer.js";import{ensureCredentialIfSignedIn as w}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as U}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as _,allCurveTypes as P}from"../../layers/support/serviceCapabilitiesUtils.js";import D from"../../portal/PortalItem.js";import{getUserPrivileges as V}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as G}from"../../portal/support/urlUtils.js";import{parseUrl as M,asValidOptions as k,encode as x}from"../utils.js";import{unapplyEditsZUnitScaling as N}from"../query/operations/editsZScale.js";import{readBoolean as L,readNumber as J}from"../support/jsonUtils.js";import{versionCollection as Q,currentSessionId as H,isSafeToEditVersion as q,isVersionInEditSession as W}from"../../versionManagement/support/versionManagementUtils.js";import{reader as B}from"../../core/accessorSupport/decorators/reader.js";function $(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function z(e){return{data:Z(e),sync:te(e),operations:K(e.capabilities,e),query:X(e),editing:ee(e)}}function Z(e){const t=L(e,"supportsTrueCurve",!1);return{isDataVersioned:L(e,"hasVersionedData",!1),isDataBranchVersioned:L(e,"hasBranchVersionedData",!1),supportsTrueCurve:t,supportedCurveTypes:se(e,t)}}function K(e,t){const s=e?e.toLowerCase().split(",").map(e=>e.trim()):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:L(t,"supportsQueryDataElements",!1),supportsQueryDomains:L(t,"supportsQueryDomains",!1),supportsQueryContingentValues:L(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function X(e){return{maxRecordCountFactor:J(e,"maxRecordCountFactor",void 0),maxRecordCount:J(e,"maxRecordCount",void 0),supportsTrueCurveWithPBF:Y(e)}}function Y(e){return!!Array.isArray(e.supportedTrueCurvePbfFeatureEncodings)&&e.supportedTrueCurvePbfFeatureEncodings.includes("esriDefault")}function ee(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:L(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:L(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:L(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:L(e,"supportsSharedTemplates",!1)||L(e,"hasSharedTemplates",!1),supportsSplit:L(t,"supportsSplit",!1),supportsTrueCurveUpdate:L(e,"allowTrueCurvesUpdates",!1),supportsTrueCurveUpdateByTrueCurveClientsOnly:L(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0)}}function te(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:L(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}function se(e,t){return Array.isArray(e.supportedCurveTypes)?e.supportedCurveTypes.map(e=>v.fromJSON(e)).filter(i):t?P:[]}let re=class extends(o(l(n(d)))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null,this._layerTableIndex=new Map,this._xyToleranceCache=new Map,this._applyEditsHandler=e=>{const{serviceUrl:t,...s}=e;m(t)===m(this.url)&&this.emit("apply-edits",s)},this._updateMomentHandler=e=>{const{serviceUrl:t,...s}=e;m(t)===m(this.url)&&this.emit("update-moment",s)}}initialize(){this.addHandles([O(this._applyEditsHandler),A(this._updateMomentHandler)])}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!G(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map(e=>{const{type:t,geometryType:s}=e;return{...$(this.url,e),type:t||"Feature Layer",geometryType:s}})}readTableInfos(e,t){return(t.tables||[]).map(e=>$(this.url,e))}readCapabilities(e,t){return z(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=u(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}get loaded(){return super.loaded}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then(()=>this._setUserPrivileges(e))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),p(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){const{results:s,edits:r,editedFeatures:i}=await this._internalApplyEdits(e,t);return this._emitServiceEditsEvents(s,t?.gdbVersion,r,i),s}getMoment(e){if(!this.versionManagementServiceUrl)return null;const t=Q.get(this.versionManagementServiceUrl)?.get(e.guid);return t?t.moment:null}getSessionId(){return H}addEditOperation(e,t){const s=e.filter(e=>!!e.editedFeatures).map(e=>({layerId:e.id,editedFeatures:e.editedFeatures}));this._emitServiceEditsEvents(e,t?.name,null,s)}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){c(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await U(this.url,t)}catch(u){c(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){c(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new D({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return V(l)}catch(u){c(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}_emitServiceEditsEvents(e,t,s,r){let i=null;try{e.forEach((e,a)=>{i=I(this.url,e.id,t,!0);const o={edits:s?.[a]??null,addedFeatures:this._processSuccessfulEditResults(e.addFeatureResults),updatedFeatures:this._processSuccessfulEditResults(e.updateFeatureResults),deletedFeatures:this._processSuccessfulEditResults(e.deleteFeatureResults),addedAttachments:this._processSuccessfulEditResults(e.addAttachmentResults),updatedAttachments:this._processSuccessfulEditResults(e.updateAttachmentResults),deletedAttachments:this._processSuccessfulEditResults(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};r.length>0&&(o.editedFeatures=r),i.resolve(o),i=null})}catch(a){throw i&&i.reject(a),a}}_processSuccessfulEditResults(e){return e.filter(e=>!e.error).map(u)}async _internalApplyEdits(e,t){await w(this.url);const s=t?.globalIdUsed??!1,a=f.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map(async e=>{const t=e.addFeatures?.map(e=>b({spatialReference:a},e,null))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map(e=>b({spatialReference:a},e,null))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,d=g(e.identifierFields,e.deleteFeatures,s),p=d.length>0?d:null;N(o,u,a);const c=await S(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:p,attachments:m,...y}})),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,trueCurveClient:n?.editsRespectTrueCurves,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await q(this.url,t?.gdbVersion,!0);const d=W(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const p=M(this.url),c=k(p.query,{query:x({...u,f:"json"}),method:"post"});let m;d&&(c.authMode="immediate",c.query.sessionId=H);try{m=await r(this.url+"/applyEdits",c)}catch(y){if(!E(y))throw y;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...ie(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0,usingTelecomOperations:e.some(e=>e.deleteAssociations||e.combineGroupedObjects||e.divideGroupedObjects)};return{edits:await Promise.all(e.map(async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(R(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=T(e,t,"feature-service"),n={};if(e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects),!e.identifierFields){await this.fetchAllLayersAndTables();const t=this._layerTableIndex.get(e.id);t&&(e.identifierFields={globalIdField:t.globalIdField,objectIdField:t.objectIdField})}const l=await F(o,t.data.supportedCurveTypes,this._xyToleranceCache);return{id:e.id,...l,...n,identifierFields:e.identifierFields}})),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:M(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:M(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map(e=>{const{type:t,geometryType:s}=e,r=$(this.url,e),i=_(e,r.url);return this._layerTableIndex.set(e.id,e),{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}}),tables:s.data.tables.map(e=>{const t=$(this.url,e),s=_(e,t.url);return this._layerTableIndex.set(e.id,e),{...t,capabilities:s}})}}};function ie(e){const t=e.data,s=[];return{results:t.map(e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=j(t),i=e.editedFeatures,a=i?.spatialReference?new f({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?C(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}}),editedFeatures:s}}e([y()],re.prototype,"url",void 0),e([y()],re.prototype,"sourceJSON",void 0),e([y()],re.prototype,"userHasFullEditingPrivileges",void 0),e([y()],re.prototype,"userHasUpdateItemPrivileges",void 0),e([y({readOnly:!0})],re.prototype,"utilityNetworkUrl",null),e([y({readOnly:!0})],re.prototype,"versionManagementServiceUrl",null),e([y()],re.prototype,"userTypeExtensions",void 0),e([y({json:{read:{source:["layers"]}}})],re.prototype,"layerInfos",void 0),e([B("layerInfos",["layers"])],re.prototype,"readLayerInfos",null),e([y({json:{read:{source:["tables"]}}})],re.prototype,"tableInfos",void 0),e([B("tableInfos",["tables"])],re.prototype,"readTableInfos",null),e([y({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],re.prototype,"capabilities",void 0),e([B("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],re.prototype,"readCapabilities",null),e([y({readOnly:!0})],re.prototype,"effectiveCapabilities",null),re=e([h("esri.rest.featureService.FeatureService")],re);const ae=re;export{ae as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const b="20260713",c="fe49b687051225ccb6a7cc245710bb8f21b4593a";export{b as buildDate,c as commitHash};
2
+ const b="20260714",c="dbac1bd110d89d159c73758c25e187b8993bb46e";export{b as buildDate,c as commitHash};
@@ -68,10 +68,11 @@ export interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties,
68
68
  */
69
69
  material?: Symbol3DMaterialProperties | null;
70
70
  /**
71
- * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the
72
- * points. If both properties are present, `primitive` takes precedence and `href` is ignored.
73
- * When using the `href` property, external 3D models must be present in
74
- * [glTF format](https://www.khronos.org/gltf/).
71
+ * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties
72
+ * are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models
73
+ * must be present in [glTF format](https://www.khronos.org/gltf/).
74
+ *
75
+ * See [ObjectSymbol3DLayerResource.href](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ObjectSymbol3DLayerResource/#href) for more information on using external 3D models.
75
76
  *
76
77
  * @default { primitive: "sphere" }
77
78
  * @see [Sample: Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/)
@@ -267,10 +268,11 @@ export default class ObjectSymbol3DLayer extends Symbol3DLayer {
267
268
  get material(): Symbol3DMaterial | null | undefined;
268
269
  set material(value: Symbol3DMaterialProperties | null | undefined);
269
270
  /**
270
- * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the
271
- * points. If both properties are present, `primitive` takes precedence and `href` is ignored.
272
- * When using the `href` property, external 3D models must be present in
273
- * [glTF format](https://www.khronos.org/gltf/).
271
+ * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties
272
+ * are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models
273
+ * must be present in [glTF format](https://www.khronos.org/gltf/).
274
+ *
275
+ * See [ObjectSymbol3DLayerResource.href](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ObjectSymbol3DLayerResource/#href) for more information on using external 3D models.
274
276
  *
275
277
  * @default { primitive: "sphere" }
276
278
  * @see [Sample: Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/)
@@ -9,10 +9,15 @@ export default class ObjectSymbol3DLayerResource extends JSONSupport {
9
9
  /** @since 5.0 */
10
10
  constructor(properties?: ObjectSymbol3DLayerResourceProperties);
11
11
  /**
12
- * The URL to the 3D model in [glTF format](https://www.khronos.org/gltf/).
13
- * The URL should point to a glTF file (.gltf or .glb)
14
- * which can reference additional binary (.bin) and image files (.jpg, .png). See the guide topic on
15
- * [Visualizing points with 3D symbols](https://developers.arcgis.com/javascript/latest/visualizing-points-3d/) to learn how to use a custom 3D model.
12
+ * The URL to the 3D model in [glTF format](https://www.khronos.org/gltf/). The URL should point to a glTF file (.gltf
13
+ * or .glb) which can reference additional binary (.bin) and image files (.jpg, .png). See the guide topic on
14
+ * [Visualizing points with 3D symbols](https://developers.arcgis.com/javascript/latest/visualizing-points-3d/) to
15
+ * learn how to use a custom 3D model.
16
+ *
17
+ * See [Supported GLTF features](https://developers.arcgis.com/javascript/latest/references/core/geometry/support/meshUtils/#supported-gltf-features)
18
+ * in the meshUtils documentation for details about which glTF extensions are currently supported.
19
+ * In addition for [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/) the [MSFT_lod](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/MSFT_lod)
20
+ * extension can be used to provide models with multiple levels of details.
16
21
  *
17
22
  * @since 5.0
18
23
  */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import s from"../../../../Graphic.js";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{formatArea as i}from"../../../../core/quantityFormatUtils.js";import{initial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../../../../core/support/UpdatingHandles.js";import{onLocaleChange as m}from"../../../../intl/locale.js";import{fetchMessageBundle as p}from"../../../../intl/messages.js";import h from"../../../../layers/GraphicsLayer.js";import{getAreaMeasurementFillSymbol as u,getAreaMeasurementOutlineSymbol as c,getAreaMeasurementTextSymbol as d}from"./utils.js";let g=class extends t{get _messages(){return this._messagesTask?.value}constructor(e){super(e),this._graphicsLayer=new h({listMode:"hide",internal:!0}),this._updatingHandles=new n}initialize(){this.view.map?.add(this._graphicsLayer),this.addHandles(m(()=>this._updateMessageBundle())),this._updatingHandles.add(()=>({accentColor:this.view.effectiveTheme.accentColor,area:this.measurementViewData.result?.area,fill:this.measurementViewData.result?.display.fill,messages:this._messages,outline:this.measurementViewData.result?.display.outline,textColor:this.view.effectiveTheme.textColor,unit:this.measurementViewData.unit,visible:this.measurementViewData.visible}),({accentColor:e,area:t,fill:r,messages:a,outline:o,textColor:l,unit:n,visible:m},p)=>{if(this._graphicsLayer.visible=m,!m)return;if(!(t&&r&&a&&o))return void this._graphicsLayer.graphics.destroyAll();const h=a&&t?i(a,t,n):null;if(3===this._graphicsLayer.graphics.length&&e.equals(p?.accentColor)&&l.equals(p?.textColor)){const[e,s,t]=this._graphicsLayer.graphics.toArray();return e.geometry=r,s.geometry=o,t.setAttribute("areaText",h),void(t.geometry=r)}this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.addMany([new s({geometry:r,symbol:u(e)}),new s({geometry:o,symbol:c(e)}),new s({attributes:{areaText:h},geometry:r,symbol:d(l)})])},a),this._updateMessageBundle()}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get updating(){return!this._graphicsLayer.loaded||!this._messagesTask?.finished||this._updatingHandles.updating}_updateMessageBundle(){return this._messagesTask?.abort(),this._messagesTask=r(()=>p("esri/core/t9n/Units")),this._messagesTask.promise}};e([o()],g.prototype,"_messages",null),e([o()],g.prototype,"_messagesTask",void 0),e([o()],g.prototype,"measurementViewData",void 0),e([o()],g.prototype,"updating",null),e([o()],g.prototype,"view",void 0),g=e([l("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementAreaVisualization")],g);export{g as AreaMeasurementAreaVisualization};
2
+ import{__decorate as e}from"tslib";import s from"../../../../Graphic.js";import t from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{formatArea as r}from"../../../../core/quantityFormatUtils.js";import{initial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../geometry/Polyline.js";import{onLocaleChange as h}from"../../../../intl/locale.js";import{fetchMessageBundle as m}from"../../../../intl/messages.js";import u from"../../../../layers/GraphicsLayer.js";import{getAreaMeasurementFillSymbol as c,getAreaMeasurementOutlineSymbol as g,getAreaMeasurementTextSymbol as d}from"./utils.js";let y=class extends t{get _messages(){return this._messagesTask?.value}constructor(e){super(e),this._graphicsLayer=new u({listMode:"hide",internal:!0}),this._updatingHandles=new n,this._previewOutlineGraphic=null}initialize(){this.view.map?.add(this._graphicsLayer),this.addHandles(h(()=>this._updateMessageBundle())),this._updatingHandles.add(()=>({accentColor:this.view.effectiveTheme.accentColor,area:this.measurementViewData.result?.area,fill:this.measurementViewData.result?.display.fill,geometry:this.measurementViewData.analysis.geometry,messages:this._messages,outline:this.measurementViewData.result?.display.outline,textColor:this.view.effectiveTheme.textColor,unit:this.measurementViewData.unit,visible:this.measurementViewData.visible}),({accentColor:e,area:t,fill:i,geometry:a,messages:o,outline:l,textColor:n,unit:p,visible:h},m)=>{if(this._graphicsLayer.visible=h,!h)return;if(!(t&&i&&o&&l))return void this._updatePreviewOutline(a,e);const u=o&&t?r(o,t,p):null;if(3===this._graphicsLayer.graphics.length&&e.equals(m?.accentColor)&&n.equals(m?.textColor)){const[e,s,t]=this._graphicsLayer.graphics.toArray();return e.geometry=i,s.geometry=l,t.setAttribute("areaText",u),void(t.geometry=i)}this._previewOutlineGraphic=null,this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.addMany([new s({geometry:i,symbol:c(e)}),new s({geometry:l,symbol:g(e)}),new s({attributes:{areaText:u},geometry:i,symbol:d(n)})])},a),this._updateMessageBundle()}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy(),this._previewOutlineGraphic=null}get updating(){return!this._graphicsLayer.loaded||!this._messagesTask?.finished||this._updatingHandles.updating}_updateMessageBundle(){return this._messagesTask?.abort(),this._messagesTask=i(()=>m("esri/core/t9n/Units")),this._messagesTask.promise}_updatePreviewOutline(e,t){const i=e?.rings.some(e=>e.length>0)?new p({paths:e.rings,spatialReference:e.spatialReference}):null;if(!i)return this._previewOutlineGraphic=null,void this._graphicsLayer.graphics.destroyAll();const r=g(t);if(this._previewOutlineGraphic)return this._previewOutlineGraphic.geometry=i,void(this._previewOutlineGraphic.symbol=r);this._graphicsLayer.graphics.destroyAll(),this._previewOutlineGraphic=new s({geometry:i,symbol:r}),this._graphicsLayer.add(this._previewOutlineGraphic)}};e([o()],y.prototype,"_messages",null),e([o()],y.prototype,"_messagesTask",void 0),e([o()],y.prototype,"measurementViewData",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"view",void 0),y=e([l("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementAreaVisualization")],y);export{y as AreaMeasurementAreaVisualization};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{isAborted as a,ignoreAbortErrors as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleFillSymbol.js";import m from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as d}from"../../../analysis/ExclusiveOperationManager.js";import u from"../../../../widgets/Sketch/SketchViewModel.js";function y(e){return"polygon"===e?.type}let w=class extends t{constructor(e){super(e),this._invisibleAreaSymbol=new p({color:null,outline:null}),this._operationManager=new d,this._updatingHandles=new c}initialize(){this._sketchViewModel=new u({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,cancelUpdateOnClickAway:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&this.reshape().catch(()=>{}):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new p({color:i(e,.3),outline:new m({color:e,width:2})})},n)])}destroy(){this._areaSymbol?.destroy(),this._invisibleAreaSymbol.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=e=>{const i="state"in e?e.state:"active",s="graphic"in e?e.graphic:e.graphics?.at(0);switch(i){case"start":case"active":{const e=s?.geometry;"polygon"===e?.type&&(this._analysis.geometry=e);break}case"cancel":case"complete":t.stop(),this.reshape().catch(()=>{})}},n=this._sketchViewModel.on(["create","undo","redo"],o);t.handles.push(n,s(()=>{n.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?a(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(r(this._sketchViewModel.create("polygon")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._areaSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(r(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=y(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],w.prototype,"_sketchViewModel",void 0),e([l()],w.prototype,"measurementViewData",void 0),e([l()],w.prototype,"state",null),e([l()],w.prototype,"updating",null),e([l()],w.prototype,"view",void 0),w=e([h("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool")],w);export{w as AreaMeasurementTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{isAborted as a,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{watch as r,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleFillSymbol.js";import m from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as d}from"../../../analysis/ExclusiveOperationManager.js";import u from"../../../../widgets/Sketch/SketchViewModel.js";function y(e){return"polygon"===e?.type}let w=class extends t{constructor(e){super(e),this._invisibleAreaSymbol=new p({color:null,outline:null}),this._invisibleLineSymbol=new m({color:null,width:0}),this._operationManager=new d,this._updatingHandles=new c}initialize(){this._sketchViewModel=new u({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,cancelUpdateOnClickAway:!1,view:this.view}),this.addHandles([r(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&this.reshape().catch(()=>{}):this._operationManager.stop()}),r(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),r(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),r(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new p({color:i(e,.3),outline:new m({color:e,width:2})})},n)])}destroy(){this._areaSymbol?.destroy(),this._invisibleAreaSymbol.destroy(),this._invisibleLineSymbol.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),r=e=>{const i="state"in e?e.state:"active",s="graphic"in e?e.graphic:e.graphics?.at(0);switch(i){case"start":case"active":{const e=s?.geometry;"polygon"===e?.type&&(this._analysis.geometry=e);break}case"cancel":case"complete":t.stop(),o(this.reshape())}},n=this._sketchViewModel.on(["create","undo","redo"],r);t.handles.push(n,s(()=>{n.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?a(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.activeLineSymbol=this._invisibleLineSymbol,this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(o(this._sketchViewModel.create("polygon")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._areaSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.activeLineSymbol=null,this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(o(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),r=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=y(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(r,s(()=>{if(r.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],w.prototype,"_sketchViewModel",void 0),e([l()],w.prototype,"measurementViewData",void 0),e([l()],w.prototype,"state",null),e([l()],w.prototype,"updating",null),e([l()],w.prototype,"view",void 0),w=e([h("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool")],w);export{w as AreaMeasurementTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{isAborted as a,ignoreAbortErrors as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as m}from"../../../analysis/ExclusiveOperationManager.js";import d from"../../../../widgets/Sketch/SketchViewModel.js";function u(e){return"polyline"===e?.type}let y=class extends t{constructor(e){super(e),this._invisibleLineSymbol=new p({color:null,width:0}),this._operationManager=new m,this._updatingHandles=new c}initialize(){this._sketchViewModel=new d({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&this.reshape().catch(()=>{}):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new p({color:i(e,.3),width:2})},n)])}destroy(){this._invisibleLineSymbol.destroy(),this._lineSymbol?.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":case"active":{const t=e.graphic?.geometry;"polyline"===t?.type&&(this._analysis.geometry=t);break}case"cancel":case"complete":t.stop(),this.reshape().catch(()=>{})}});t.handles.push(o,s(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?a(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.polylineSymbol=this._invisibleLineSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(r(this._sketchViewModel.create("polyline")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._lineSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polylineSymbol=this._lineSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(r(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=u(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],y.prototype,"_sketchViewModel",void 0),e([l()],y.prototype,"measurementViewData",void 0),e([l()],y.prototype,"state",null),e([l()],y.prototype,"updating",null),e([l()],y.prototype,"view",void 0),y=e([h("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementTool")],y);export{y as DistanceMeasurementTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as a,isAborted as r}from"../../../../core/promiseUtils.js";import{watch as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as m}from"../../../analysis/ExclusiveOperationManager.js";import d from"../../../../widgets/Sketch/SketchViewModel.js";function u(e){return"polyline"===e?.type}let y=class extends t{constructor(e){super(e),this._invisibleLineSymbol=new p({color:null,width:0}),this._operationManager=new m,this._updatingHandles=new c}initialize(){this._sketchViewModel=new d({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e&&this._analysis.geometry?"place"!==this._operationManager.currentOperationType&&this.reshape().catch(()=>{}):this._operationManager.stop()}),o(()=>this.measurementViewData.analysis.geometry,e=>{e||(this._operationManager.stop(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll())}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new p({color:i(e,.3),width:2})},n)])}destroy(){this._invisibleLineSymbol.destroy(),this._lineSymbol?.destroy(),this._operationManager.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._analysis.clone(),o=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":case"active":{const t=e.graphic?.geometry;"polyline"===t?.type&&(this._analysis.geometry=t);break}case"cancel":case"complete":t.stop(),a(this.reshape())}});t.handles.push(o,s(()=>{o.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll();const s=this._analysis;return s.valid?r(e)||i.equals(s)?t.reject():void t.resolve({}):(s.clear(),t.reject())})),this._sketchViewModel.activeLineSymbol=this._invisibleLineSymbol,this._sketchViewModel.polylineSymbol=this._invisibleLineSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.consumePromise(a(this._sketchViewModel.create("polyline")))},e)}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._lineSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.activeLineSymbol=null,this._sketchViewModel.polylineSymbol=this._lineSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(a(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),o=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this._analysis.geometry=u(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(o,s(()=>{if(o.remove(),this._sketchViewModel?.cancel(),r(e))return t.reject();t.resolve()})),await i()},e)}get _analysis(){return this.measurementViewData.analysis}};e([l()],y.prototype,"_sketchViewModel",void 0),e([l()],y.prototype,"measurementViewData",void 0),e([l()],y.prototype,"state",null),e([l()],y.prototype,"updating",null),e([l()],y.prototype,"view",void 0),y=e([h("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementTool")],y);export{y as DistanceMeasurementTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../tiling/TileInfoView.js";import e from"../../../tiling/TileKey.js";import"../../../tiling/TileQueue.js";import"../../../tiling/TileStrategy.js";import{tileSize as s}from"../definitions.js";import{MeshData as t}from"./MeshData.js";const r=1,i=2,n=4,h=8,o=16,c=32,a=64,f=128;function l(e){switch(e){case r:case h:case c:return-1;case i:case a:return 0;case n:case o:case f:return 1}}function u(e){switch(e){case r:case i:case n:return-1;case h:case o:return 0;case c:case a:case f:return 1}}const m=r|h|c,_=n|o|f,d=r|i|n,p=c|a|f;class g{constructor(e,s,r,i,n=0){this.tileKey=e,this._bufferingEnabled=s,this._sizeHint=n,this._meshes={self:new t(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const h=i?1:0;this._copyBufferedDataIntoSelf=r&&this._bufferingEnabled&&e.level===h}get id(){return this.tileKey.id}get requiresRefresh(){return this._meshes.self.requiresRefresh||this._meshes.neighbors.some(e=>e.requiresRefresh)}set requiresRefresh(e){this._meshes.self.requiresRefresh=e}vertexStart(){return this._meshes.self.vertexStart()??0}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,s=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,s)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const s=1<<e;!!(this._currentEntityOverlaps&s)&&this._meshes.neighbors[e].entityEnd()}}}recordStart(e,s,t){this._currentRecordOverlaps=0,this._meshes.self.recordStart(e,s,t)}recordEnd(e=0){const s=this._meshes.self.recordEnd(this._currentRecordOverlaps);return s&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):s}recordBounds(e,s,t,r){this._bufferingEnabled&&this._addOverlap(e,s,t,r)}recordCount(){return this._meshes.self.recordCount()}metricStart(e){this._meshes.self.metricStart(e)}metricBoxWrite(e){this._meshes.self.metricBoxWrite(e)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(e){this._meshes.self.vertexWrite(e)}vertexWriteF32(e){this._meshes.self.vertexWriteF32(e)}vertexWriteRegion(e){this._meshes.self.vertexWriteRegion(e)}indexWrite(e){this._meshes.self.indexWrite(e)}serialize(s){const t={message:[],transferList:[]},r=this._meshes.self.serialize();return t.message.push({tileId:this.tileKey.id,requiresRefresh:this.requiresRefresh,...r.message}),t.transferList.push(...r.transferList),this._meshes.neighbors.forEach((r,i)=>{const n=r.serialize(),h=1<<i,o=l(h),c=u(h),a=new e(this.tileKey).getNormalizedNeighbor(o,c,s);t.message.push({tileId:a.id,requiresRefresh:this.requiresRefresh,...n.message}),t.transferList.push(...n.transferList)}),t}_addOverlap(e,t,r,i){const n=Math.min(s/2,r),h=Math.min(s/2,i),o=255^((e<0+n?_:e>=s-n?m:_|m)|(t<0+h?p:t>=s-h?d:p|d));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let e=0;e<8;e++){const r=1<<e;if(!!(this._currentRecordOverlaps&r)){if(this._copyBufferedDataIntoSelf){const e=-l(r)*s,t=-u(r)*s;if(0!==t)continue;this._meshes.self.copyLast(e,t);continue}if(!this._meshes.neighbors[e]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[e]=new t(r,s)}const i=this._meshes.neighbors[e],n=-l(r)*s,h=-u(r)*s;i.copyLastFrom(this._meshes.self,n,h)}}}}export{g as MultiTileMeshData};
2
+ import has from"../../../../../core/has.js";import"../../../tiling/TileInfoView.js";import e from"../../../tiling/TileKey.js";import"../../../tiling/TileQueue.js";import"../../../tiling/TileStrategy.js";import{tileSize as s}from"../definitions.js";import{MeshData as t}from"./MeshData.js";const r=!!has("featurelayer-pixel-buffering-enabled"),i=1,n=2,h=4,o=8,c=16,a=32,f=64,l=128;function u(e){switch(e){case i:case o:case a:return-1;case n:case f:return 0;case h:case c:case l:return 1}}function m(e){switch(e){case i:case n:case h:return-1;case o:case c:return 0;case a:case f:case l:return 1}}const _=i|o|a,d=h|c|l,p=i|n|h,g=a|f|l;class y{constructor(e,s,i,n=0){this.tileKey=e,this._sizeHint=n,this._meshes={self:new t(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const h=i?1:0;this._copyBufferedDataIntoSelf=s&&r&&e.level===h}get id(){return this.tileKey.id}get requiresRefresh(){return this._meshes.self.requiresRefresh||this._meshes.neighbors.some(e=>e.requiresRefresh)}set requiresRefresh(e){this._meshes.self.requiresRefresh=e}vertexStart(){return this._meshes.self.vertexStart()??0}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,s=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,s)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),r){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const s=1<<e;!!(this._currentEntityOverlaps&s)&&this._meshes.neighbors[e].entityEnd()}}}recordStart(e,s,t){this._currentRecordOverlaps=0,this._meshes.self.recordStart(e,s,t)}recordEnd(e=0){const s=this._meshes.self.recordEnd(this._currentRecordOverlaps);return s&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):s}recordBounds(e,s,t,i){r&&this._addOverlap(e,s,t,i)}recordCount(){return this._meshes.self.recordCount()}metricStart(e){this._meshes.self.metricStart(e)}metricBoxWrite(e){this._meshes.self.metricBoxWrite(e)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(e){this._meshes.self.vertexWrite(e)}vertexWriteF32(e){this._meshes.self.vertexWriteF32(e)}vertexWriteRegion(e){this._meshes.self.vertexWriteRegion(e)}indexWrite(e){this._meshes.self.indexWrite(e)}serialize(s){const t={message:[],transferList:[]},r=this._meshes.self.serialize();return t.message.push({tileId:this.tileKey.id,requiresRefresh:this.requiresRefresh,...r.message}),t.transferList.push(...r.transferList),this._meshes.neighbors.forEach((r,i)=>{const n=r.serialize(),h=1<<i,o=u(h),c=m(h),a=new e(this.tileKey).getNormalizedNeighbor(o,c,s);t.message.push({tileId:a.id,requiresRefresh:this.requiresRefresh,...n.message}),t.transferList.push(...n.transferList)}),t}_addOverlap(e,t,r,i){const n=Math.min(s/2,r),h=Math.min(s/2,i),o=255^((e<0+n?d:e>=s-n?_:d|_)|(t<0+h?g:t>=s-h?p:g|p));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let e=0;e<8;e++){const r=1<<e;if(!!(this._currentRecordOverlaps&r)){if(this._copyBufferedDataIntoSelf){const e=-u(r)*s,t=-m(r)*s;if(0!==t)continue;this._meshes.self.copyLast(e,t);continue}if(!this._meshes.neighbors[e]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[e]=new t(r,s)}const i=this._meshes.neighbors[e],n=-u(r)*s,h=-m(r)*s;i.copyLastFrom(this._meshes.self,n,h)}}}}export{y as MultiTileMeshData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfAborted as s,after as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import{normalizeTransform as o,quantizeX as n,quantizeY as c}from"../../../../geometry/support/quantizationUtils.js";import{checkProjectionSupport as h}from"../../../../layers/graphics/data/projectionSupport.js";import{MultiTileMeshData as u}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as p}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as g}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as y}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as d}from"../../engine/webgl/util/MatcherContext.js";import{BinningStrategy as _}from"./processor/BinningStrategy.js";import{ClusterStrategy as l}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as m}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as f}from"./processor/TrackStrategy.js";import{AttributeStore as b}from"./support/AttributeStore.js";import{ComputedAttributeStorage as w}from"./support/ComputedAttributeStorage.js";class S{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new y,this._proxy=new g({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)}),this._attributeStore=new b({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,s,r,a,o){const n=e.processor,c=t(this._schema?.storage,n.storage),u=t(this._schema?.mesh.properties,n.mesh.properties),g=t(this._schema?.mesh.factory,n.mesh.factory),y=t(this._schema?.mesh.strategy,n.mesh.strategy),_=j(this._schema?.expressionProperties,n.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,b=m||f,S=u||g||y;if(!(c||S||(m||l||f))&&!a)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,n),schema:n}),this._schema=n,"annotation-feature"===n.mesh.factory.symbology.type||"dimension-feature"===n.mesh.factory.symbology.type){const e=this._source.metadata.outSpatialReference,t=this._source.metadata.attributeSpatialReference??this._source.metadata.spatialReference??e;await h(t,e)}const I=new w({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),M={currentUser:n.mesh.properties.currentUser};if((c||S||l)&&(await this._attributeStore.update(n.storage,I,this._source.metadata,s),this._strategy?.invalidateAttributeData(v(n))),!a&&!S&&!b)return!1;(y||u||b)&&await this._updateStrategy(n.mesh.strategy,o,v(n),M),this._updateSortKey(I,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const x="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,U=new d(I,this._proxy,r,this._registry,x);return(g||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await p.create(U,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{const s=await this._strategy.applyOverrideUpdate(e);s&&await this._process(s,t)}catch(s){}}async updateChunks(e,t,s){await this._doUpdateChunks(e,t,s),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e,t,s){if(this._strategy){try{const r=await this._strategy.updateChunks(e,t);r&&await this._process(r,s)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}}async _updateStrategy(e,t,s,r){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new m(this._source,this._attributeStore,s,r);break;case"binning":this._strategy=await _.create(e,this._source,this._attributeStore,s,r);break;case"cluster":this._strategy=await l.create(this._connection,e,this._source,this._attributeStore,s,r);break;case"track":this._strategy=await f.create(e,this._source,this._attributeStore,s,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e,t){switch(e.type){case"level-replace":return this._processLevelBatch(e,t);case"append":case"update":return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){const s=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(s)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(const r of e){const e=r.subscription;if(has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(r,i),s(e.signal);const a=await this._write(r,e.tile.createArcadeEvaluationOptions(v(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);s(e.signal);const{message:n,transferList:c}=a.serialize(o),h={objectIdMap:null,inner:r.createMessage(n,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){h.objectIdMap={};const e=r.reader?.getCursor();if(e)for(;e.next();)h.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(s(e.signal),await this._connection.container.onMessage(h,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;const t=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:"2d"},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(v(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t,e.id);await this._proxy.fetchEnqueuedResources()}async _write(e,t,i,a){const o=e.subscription.tile,n=e.reader?.getCursor(),c=n?.getSize()??0,h=o.tileInfoView.tileInfo.isWrappable,p=o.tileInfoView.spatialReference.isWGS84,g=this._schema?.mesh.factory.referenceScale,y=new u(o.key,this._strategy.enablePixelBuffering,h,p,c);if(!n)return y;const d=I(o.transform,a),_=o.createArcadeEvaluationOptions(v(this._schema));let l=0;for(;n.next();){++l%1e3||(await r(0),s(e.subscription));const a=this._getSortKeyValue(n,t);y.entityStart(n.getDisplayId(),a);try{this._factory.write(y,this._proxy,n,_,i,o.level,d,g)}catch(m){}y.entityEnd()}return y}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function j(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function v(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}function I(e,t){const s=o(e),r=[];for(const i of t.rings){const e=[];for(const t of i)e.push([n(s,t[0]),c(s,t[1])]);r.push(e)}return{rings:r}}export{S as default};
2
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfAborted as s,after as r}from"../../../../core/promiseUtils.js";import{diff as i}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as a}from"../../../../core/workers/utils.js";import{normalizeTransform as o,quantizeX as n,quantizeY as c}from"../../../../geometry/support/quantizationUtils.js";import{checkProjectionSupport as h}from"../../../../layers/graphics/data/projectionSupport.js";import{MultiTileMeshData as u}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as p}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as g}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as y}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as d}from"../../engine/webgl/util/MatcherContext.js";import{createAggregateStrategy as l}from"./processor/createAggregateStrategy.js";import{AttributeStore as _}from"./support/AttributeStore.js";import{ComputedAttributeStorage as m}from"./support/ComputedAttributeStorage.js";class f{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new y,this._proxy=new g({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)}),this._attributeStore=new _({isLocal:!1,update:e=>a(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,s,r,a,o){const n=e.processor,c=t(this._schema?.storage,n.storage),u=t(this._schema?.mesh.properties,n.mesh.properties),g=t(this._schema?.mesh.factory,n.mesh.factory),y=t(this._schema?.mesh.strategy,n.mesh.strategy),l=b(this._schema?.expressionProperties,n.expressionProperties),_=l.some(e=>this._attributeStore.hasArcadeDependency(e)),f=l.some(e=>this._factory?.hasArcadeDependency(e)??!1),S=l.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&_,v=f||S,I=u||g||y;if(!(c||I||(f||_||S))&&!a)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:i(this._schema,n),schema:n}),this._schema=n,"annotation-feature"===n.mesh.factory.symbology.type||"dimension-feature"===n.mesh.factory.symbology.type){const e=this._source.metadata.outSpatialReference,t=this._source.metadata.attributeSpatialReference??this._source.metadata.spatialReference??e;await h(t,e)}const j=new m({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),M={currentUser:n.mesh.properties.currentUser};if((c||I||_)&&(await this._attributeStore.update(n.storage,j,this._source.metadata,s),this._strategy?.invalidateAttributeData(w(n))),!a&&!I&&!v)return!1;(y||u||v)&&await this._updateStrategy(n.mesh.strategy,o,w(n),M),this._updateSortKey(j,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const x="dictionary"===n.mesh.factory.symbology.type?n.mesh.factory.symbology.fieldMap:null,U=new d(j,this._proxy,r,this._registry,x);return(g||"dictionary"===n.mesh.factory.symbology.type)&&(this._factory=await p.create(U,n.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{const s=await this._strategy.applyOverrideUpdate(e);s&&await this._process(s,t)}catch(s){}}async updateChunks(e,t,s){await this._doUpdateChunks(e,t,s),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e,t,s){if(this._strategy){try{const r=await this._strategy.updateChunks(e,t);r&&await this._process(r,s)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}}async _updateStrategy(e,t,s,r){this._strategy?.destroy(),this._strategy=await l(this._connection,e,this._source,this._attributeStore,s,r);for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e,t){switch(e.type){case"level-replace":return this._processLevelBatch(e,t);case"append":case"update":return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){const s=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(s)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(const r of e){const e=r.subscription;if(has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(r,i),s(e.signal);const a=await this._write(r,e.tile.createArcadeEvaluationOptions(w(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);s(e.signal);const{message:n,transferList:c}=a.serialize(o),h={objectIdMap:null,inner:r.createMessage(n,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){h.objectIdMap={};const e=r.reader?.getCursor();if(e)for(;e.next();)h.objectIdMap[e.getDisplayId()]=e.getObjectId()}if(s(e.signal),await this._connection.container.onMessage(h,{signal:e.signal,transferList:c}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${r.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;const t=e.subscription.tile.createArcadeEvaluationOptions(w(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:"2d"},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(w(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t,e.id);await this._proxy.fetchEnqueuedResources()}async _write(e,t,i,a){const o=e.subscription.tile,n=e.reader?.getCursor(),c=n?.getSize()??0,h=o.tileInfoView.tileInfo.isWrappable,p=o.tileInfoView.spatialReference.isWGS84,g=this._schema?.mesh.factory.referenceScale,y=new u(o.key,h,p,c);if(!n)return y;const d=S(o.transform,a),l=o.createArcadeEvaluationOptions(w(this._schema));let _=0;for(;n.next();){++_%1e3||(await r(0),s(e.subscription));const a=this._getSortKeyValue(n,t);y.entityStart(n.getDisplayId(),a);try{this._factory.write(y,this._proxy,n,l,i,o.level,d,g)}catch(m){}y.entityEnd()}return y}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function b(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function w(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}function S(e,t){const s=o(e),r=[];for(const i of t.rings){const e=[];for(const t of i)e.push([n(s,t[0]),c(s,t[1])]);r.push(e)}return{rings:r}}export{f as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../../core/has.js";class e{constructor(e){this.subscription=e,this.handledChunks=new Set,has("esri-2d-update-debug")&&console.debug(`Tile[${e.tile.id}] ASendState.create`)}destroy(){}}class t{constructor(){this.type="append",this.messages=[]}}class s{constructor(){this.type="update",this.messages=[]}}class r{constructor(e){this.level=e,this.type="level-replace",this.messages=[]}}class i{constructor(e,t,s){this._source=e,this._attributeStore=t,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}get usedMemory(){return 0}onSubscribe(e){const t=this.createState(e);this._sendStates.set(e.key.id,t)}onUnsubscribe(e){this._sendStates.get(e.key.id)?.destroy(),this._sendStates.delete(e.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(e){return!1}invalidate(){const e=Array.from(this._sendStates.values());this._sendStates.clear();for(const t of e)t.destroy(),this.onSubscribe(t.subscription)}invalidateAttributeData(e){}hasArcadeDependency(e){return!1}getFeatureObjectIdsForAggregate(e){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(e){return this.displayMap(e,e=>e,e=>e)}getDisplayAndObjectIds(e){return this.displayMap(e,e=>e,(e,t,s)=>[e,s])}afterUpdateChunks(){}}export{i as AProcessorStrategy,e as ASendState,t as AppendBatch,r as LevelReplaceBatch,s as UpdateBatch};
2
+ import has from"../../../../../core/has.js";class e{constructor(e){this.subscription=e,this.handledChunks=new Set,has("esri-2d-update-debug")&&console.debug(`Tile[${e.tile.id}] ASendState.create`)}destroy(){}}class t{constructor(){this.type="append",this.messages=[]}}class s{constructor(){this.type="update",this.messages=[]}}class r{constructor(e){this.level=e,this.type="level-replace",this.messages=[]}}class i{constructor(e,t,s){this._source=e,this._attributeStore=t,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get isAggregate(){return!1}get usedMemory(){return 0}onSubscribe(e){const t=this.createState(e);this._sendStates.set(e.key.id,t)}onUnsubscribe(e){this._sendStates.get(e.key.id)?.destroy(),this._sendStates.delete(e.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(e){return!1}invalidate(){const e=Array.from(this._sendStates.values());this._sendStates.clear();for(const t of e)t.destroy(),this.onSubscribe(t.subscription)}invalidateAttributeData(e){}hasArcadeDependency(e){return!1}getFeatureObjectIdsForAggregate(e){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(e){return this.displayMap(e,e=>e,e=>e)}getDisplayAndObjectIds(e){return this.displayMap(e,e=>e,(e,t,s)=>[e,s])}afterUpdateChunks(){}}export{i as AProcessorStrategy,e as ASendState,t as AppendBatch,r as LevelReplaceBatch,s as UpdateBatch};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{EventEmitter as e}from"../../../../../core/Evented.js";import{create as t}from"../../../../../geometry/support/aaBoundingBox.js";import{getBoundsOptimizedGeometry as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{optimizedFeatureQueryEngineAdapter as s}from"../../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";import{QueryEngine as a}from"../../../../../layers/graphics/data/QueryEngine.js";import{collectExpressionDependencies as i}from"../../../../../support/ArcadeExpression.js";import{AProcessorStrategy as n,LevelReplaceBatch as l}from"./AProcessorStrategy.js";class o extends n{constructor(t,r,a,n,l,o){super(t,r,l),this.spatialReference=a,this.aggregateFields=n,this._adapter=o,this._arcadeDependencies=new Set,this._levelStates=new Map,this.events=new e,this.featureAdapter=s;for(const e of n)i(this._arcadeDependencies,e.computed)}get aggregateQueryEngine(){if(!this._aggregateQueryEngine){const{metadata:e}=this._adapter;this._aggregateQueryEngine=new a({featureStore:this,fieldsIndex:e.fieldsIndex,geometryType:e.geometryType,featureIdInfo:e.featureIdInfo,spatialReference:this.spatialReference})}return this._aggregateQueryEngine}get isAggregate(){return!0}removeChunks(e){}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}destroy(){super.destroy();for(const e of this._levelStates.values())e.destroy();this._levelStates.clear()}onSubscribe(e){super.onSubscribe(e);const{scale:t,level:r}=e.tile;this._lastSubscribedLodInfo={scale:t,level:r}}onUnsubscribe(e){this._levelStates.get(e.tile.level)?.removeTile(e),super.onUnsubscribe(e)}requiresInvalidation(e){return!1}invalidate(){for(const e of this._levelStates.values())e.invalidate()}displayMap(e,t,r){return this.getActiveLevelState()?.displayMap(e,t,r)??[]}getDisplayFeatures(e){return this.getActiveLevelState()?.getDisplayFeatures(e)??{features:[],aggregates:[],tracks:[]}}getFeatureObjectIdsForAggregate(e){return this.getActiveLevelState()?.getFeatureObjectIdsForAggregate(e)??[]}applyOverrideUpdate(e){return this._adapter.applyOverrideUpdate(e,this._levelStates.values())}createState(e){return this._adapter.createSendState(e)}async updateChunks(e,t){const r=this._lastSubscribedLodInfo;if(null==r)return null;const s=this._getOrCreateLevelState(r),a=this._getSendStatesForLevel(r.level);await s.update(e,a);const i=new l(r.level);for(const n of a)i.messages.push(...s.createMessages(n,e,t,()=>{this.events.emit("changed")}));return await this._adapter.afterUpdateLevelState(s,e,a),i}getActiveLevelState(){const e=this._lastSubscribedLodInfo;return null==e?null:this._levelStates.get(e.level)}_getOrCreateLevelState(e){let t=this._levelStates.get(e.level);return null==t&&(t=this._adapter.createLevelState(e),this._levelStates.set(e.level,t)),t}_getSendStatesForLevel(e){return Array.from(this._sendStates.values()).filter(t=>t.subscription.tile.level===e)}forEach(e){this.getActiveLevelState()?.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,s){const a=t();for(const t of e){const e=r(a,t.geometry);e&&s(e)}}}export{o as AggregateStrategy};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import e from"../../../../../../layers/support/FieldsIndex.js";import{BinLevelState as t}from"./BinLevelState.js";import{BinState as a}from"./BinState.js";import{FeatureMetadata as i}from"../../support/FeatureMetadata.js";import{Hashed as s}from"../../support/Hashed.js";class n{constructor(t,a,s,n,r,l,o,d){this._schema=t,this._featureFilter=a,this._arcadeContextInfo=s,this._aggregateFields=n,this._spatialReference=r,this._sqlOptions=d,this.metadata=i.createFeature({geometryType:"esriGeometryPolygon",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new e(t.fields).toJSON(),globalIdField:null,spatialReference:l.metadata.spatialReference,outSpatialReference:l.metadata.outSpatialReference,attributeSpatialReference:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null}),this._getIndex=this._createGetIndex(),this._binContext={getIndex:this._getIndex,spatialReference:this._spatialReference,attributeStore:o,metadata:this.metadata,arcadeContextInfo:this._arcadeContextInfo,sqlOptions:this._sqlOptions}}createSendState(e){return new a(e)}createLevelState(e){return new t(e.level,this._binContext)}async applyOverrideUpdate(e,t){for(const a of t)a.invalidate();return null}afterUpdateLevelState(e,t,a){}_createGetIndex(){return(e,t)=>{switch(this._schema.index.type){case"geohash":return e.getGeohashIndex(new s({type:"geohash",fields:this._aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this._spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:t.scale,sqlOptions:this._sqlOptions}));case"grid":{const a=this._schema.index.fixedBinLevel,i=null!=a?t.tileInfoView.getLODInfoAt(a).scale:t.scale;return e.getGridIndex(new s({type:"grid",fields:this._aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this._spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:i,sqlOptions:this._sqlOptions}))}}}}}export{n as BinAdapter};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import has from"../../../../../../core/has.js";import{convertToFeature as e,unquantizeOptimizedGeometryInPlace as t}from"../../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as s}from"../../../../../../layers/graphics/OptimizedFeature.js";import{FeatureTileAppendMessage as o}from"../../sources/FeatureSourceMessage.js";import{FeatureSetReaderJSON as r}from"../../support/FeatureSetReaderJSON.js";class a{constructor(e,t){this.level=e,this._context=t,this._tileStates=new Map}destroy(){for(const e of this._tileStates.values())this._releaseTileState(e);this._tileStates.clear()}invalidate(){}update(e,t){}removeTile(e){const t=this._tileStates.get(e.key.id);null!=t&&(this._releaseTileState(t),this._tileStates.delete(e.key.id))}displayMap(e,t,s){const o=new Map(e.map(e=>[t(e),e])),r=[];for(const a of this._featuresWorldSpace()){const{objectId:e,displayId:t}=a,i=o.get(e);if(null!=i){const a=s(t,i,e);r.push(a),o.delete(e)}}return r}getDisplayFeatures(t){const s=new Set(t),o=new Set,r=[];for(const a of this._featuresWorldSpace())s.has(a.displayId)&&!o.has(a.objectId)&&(a.geometry&&r.push({...e(a,this._context.metadata.geometryType,!1,!1),displayId:a.displayId}),o.add(a.objectId));return{features:[],aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._tileStates.values())for(const s of t.bins.values())if(s.id===e){const e=[];for(const t of s.containedObjectIds)for(const s of t.values())e.push(s);return e}return[]}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._featuresWorldSpace())t.has(s.objectId)||(e(s),t.add(s.objectId))}createMessages(e,t,a,i){const{subscription:n}=e,c=this._getOrCreateTileState(n),l=this._takeTileState(c),d=n.tile,u=new Set;for(const s of t){this._context.getIndex(s,d).putBounded(c.bins,u,d.extent,d.resolution)}const f=[],p=n.tile.transform,h=n.tile.key.level;for(const o of c.bins.values()){const e=o.getGeometry(this._context.spatialReference,p),t=new s(e,o.getAttributes(),null,o.id);e||(t.centroid=o.getGeometricCentroid(this._context.spatialReference,p)),t.displayId=this._context.attributeStore.createDisplayIdForObjectId(`${t.objectId}.${h}`),c.featureCache.set(o.id,t),f.push(t)}i(),e.done||=!a;const b=r.fromOptimizedFeatures(f,this._context.metadata,p),g=b.getCursor(),S=e.subscription.tile.createArcadeEvaluationOptions(this._context.arcadeContextInfo);for(;g.next();)this._context.attributeStore.setAttributeData(g.getDisplayId(),g,S,this._context.sqlOptions);has("esri-2d-update-debug")&&console.debug(`Tile[${e.subscription.tile.id}] BinningStrategy._update`,{done:e.done});const _=new o(e.subscription,b,e.done,{});for(const s of l.featureCache.keys())this._context.attributeStore.releaseDisplayIdForObjectId(`${s}.${h}`);return[_]}_getOrCreateTileState(e){let t=this._tileStates.get(e.key.id);return null==t&&(t={subscription:e,bins:new Map,featureCache:new Map},this._tileStates.set(e.key.id,t)),t}_takeTileState(e){const t=e.bins,s=e.featureCache;return e.bins=new Map,e.featureCache=new Map,{bins:t,featureCache:s}}_releaseTileState(e){const t=e.subscription.tile.key.level;for(const s of e.featureCache.keys())this._context.attributeStore.releaseDisplayIdForObjectId(`${s}.${t}`);e.bins.clear(),e.featureCache.clear()}*_featuresWorldSpace(){for(const e of this._tileStates.values())for(const s of e.featureCache.values()){const o=s.clone();o.geometry&&t(o.geometry,e.subscription.tile.transform),yield o}}}export{a as BinLevelState};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ASendState as r}from"../AProcessorStrategy.js";class s extends r{constructor(r){super(r),this.done=!1}}export{s as BinState};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import e from"../../../../../../geometry/SpatialReference.js";import{checkProjectionSupport as t}from"../../../../../../layers/graphics/data/projectionSupport.js";import{ComputedAggregateField as a}from"../../aggregation/ComputedAggregateField.js";import{AggregateStrategy as r}from"../AggregateStrategy.js";import{BinAdapter as o}from"./BinAdapter.js";import{ComputedAttributeStorage as i}from"../../support/ComputedAttributeStorage.js";import m from"../../support/FeatureFilterEvaluator.js";export{BinState}from"./BinState.js";async function p(p,n,s,f,l){const g=n.metadata.outSpatialReference,d=new i({spatialReference:g}),u=await Promise.all(p.fields.map(async e=>a.create(d,e))),c=p.featureFilter?await m.create({geometryType:n.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:n.metadata.timeInfo,fieldsIndex:n.metadata.fieldsIndex,spatialReference:g,filterJSON:p.featureFilter}):null;"geohash"===p.index.type&&await t(g,e.WGS84);const y=new o(p,c,f,u,g,n,s,l);return new r(n,s,g,u,l,y)}export{p as createBinningStrategy};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import e from"../../../../../../layers/support/FieldsIndex.js";import{ClusterLevelState as t}from"./ClusterLevelState.js";import{ClusterSendState as a}from"./ClusterSendState.js";import{FeatureMetadata as l}from"../../support/FeatureMetadata.js";class r{constructor(t,a,r,n,i,s,d){this.metadata=l.createFeature({geometryType:"esriGeometryPoint",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new e([...n,...i.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:i.metadata.spatialReference,outSpatialReference:i.metadata.outSpatialReference,attributeSpatialReference:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null}),this._clusterContext={connection:t,clusterRadius:a,indexOptions:r,attributeStore:s,metadata:this.metadata,sqlOptions:d}}createSendState(e){return new a(e)}createLevelState(e){return new t(e.level,e.scale,this._clusterContext)}async applyOverrideUpdate(e,t){for(const a of t)a.invalidate();return null}afterUpdateLevelState(e,t,a){return e.updateStatistics()}}export{r as ClusterAdapter};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import has from"../../../../../../core/has.js";import{convertToFeature as t}from"../../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as e}from"../../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as i}from"../../../../engine/webgl/definitions.js";import{GridCell as n}from"../../aggregation/GridCell.js";import{pixelsPerMapUnit as r}from"../../aggregation/GridSpatialIndex.js";import{WithDisplayId as a}from"../support/WithDisplayId.js";import{FeatureTileAppendMessage as o}from"../../sources/FeatureSourceMessage.js";import{FeatureSetReaderJSON as l}from"../../support/FeatureSetReaderJSON.js";import{Hashed as c}from"../../support/Hashed.js";const d=128;class u{constructor(t,e,s){this.level=t,this._scale=e,this._context=s,this._statistics=new Map,this._handledChunks=new Set,this._handledIds=new Set,this._cells=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const t of this._clusters.values())this._context.attributeStore.releaseDisplayIdForObjectId(t.inner.id);this._clusters.clear()}invalidate(){this._cells.clear(),this._handledChunks.clear(),this._handledIds.clear()}removeTile(t){}*aggregatesWorldSpace(){for(const t of this._clusters.values()){const s=t.inner.getCentroid(null),i=new e(s,t.inner.getAttributes(),null,t.inner.id,t.displayId);yield i}}clusters(){return this._clusters.values()}displayMap(t,e,s){const i=new Map(t.map(t=>[e(t),t])),n=[];for(const r of this._clusters.values()){const t=i.get(r.inner.id);if(null!=t){const e=s(r.displayId,t,r.inner.id);n.push(e),i.delete(r.inner.id);continue}if(1===r.inner.count){const{firstObjectId:t}=r.inner,e=t?i.get(t):null;if(null!=e){const a=s(r.displayId,e,t);n.push(a),i.delete(t)}}}return n}getDisplayFeatures(e){const s=new Set(e),i=new Set,n=[],r=[];for(const a of this.aggregatesWorldSpace())if(s.has(a.displayId)&&!i.has(a.displayId)){const e=t(a,this._context.metadata.geometryType,!1,!1);if(i.add(a.displayId),1===e.attributes.cluster_count){n.push({...e,displayId:a.displayId});continue}r.push({...e,displayId:a.displayId})}return{features:n,aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(t){for(const e of this._clusters.values())if(e.inner.id===t){const t=[];for(const s of e.inner.containedObjectIds)for(const e of s.values())t.push(e);return t}return[]}forEachAggregateWorldSpace(t){for(const e of this.aggregatesWorldSpace())t(e)}update(t,e){let s=!1;const i=new c({...this._context.indexOptions,scale:this._scale});for(const r of t){if(this._handledChunks.has(r.normalizedChunkId))continue;if(this._handledChunks.add(r.normalizedChunkId),null!=r.lodInfo&&r.lodInfo.level!==this.level)continue;r.getGridIndex(i).put(this._cells,this._handledIds),s=!0}const n=r(this._context.indexOptions.spatialReference,this._scale),a=this._context.indexOptions.cellSize,o={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};for(const{subscription:r}of e){const t=r.tile.bounds,e=Math.floor(t[0]*n/a),s=Math.floor(t[1]*n/a),i=Math.ceil(t[2]*n/a),l=Math.ceil(t[3]*n/a);o.xMin=Math.min(o.xMin,e),o.yMin=Math.min(o.yMin,s),o.xMax=Math.max(o.xMax,i),o.yMax=Math.max(o.yMax,l)}null!=this._lastCellBounds&&o.xMin===this._lastCellBounds.xMin&&o.xMax===this._lastCellBounds.xMax&&o.yMin===this._lastCellBounds.yMin&&o.yMax===this._lastCellBounds.yMax||(this._lastCellBounds=o,s=!0),s&&this._clusterCells(o)}async updateStatistics(){let t=!1;for(const e of this._clusters.values())e.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,e.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([t,e])=>({fieldName:t,minValue:e.minValue,maxValue:e.maxValue}));await this._context.connection.container.updateStatistics(this.level,t)}}createMessages(t,e,s,i){const n=this._createAggregateFeatures(t);i(),t.done=t.done||!s;const r=n.getCursor(),a=t.subscription.tile.createArcadeEvaluationOptions(this._context.indexOptions.arcadeContextInfo);for(;r.next();)this._context.attributeStore.setAttributeData(r.getDisplayId(),r,a,this._context.sqlOptions);return has("esri-2d-update-debug")&&console.debug(`Tile[${t.subscription.tile.id}] ClusterStrategy._update`,{done:t.done}),[new o(t.subscription,n,t.done,{})]}_createAggregateFeatures(t){const n=t.subscription,r=[],a=n.tile.transform,o=Array.from(this._clusters.values()),c=o.length;for(const l of o){const t=l.inner.getCentroidX(a),n=l.inner.getCentroidY(a),o=1===l.inner.count?l.inner.firstObjectId:l.inner.id,c=l.displayId;if(t<i+d&&t>=-d&&n<i+d&&n>=-d){const i=new s([],[t,n]),a=new e(i,l.inner.getAttributes(),null,o,c);r.push(a)}}const u=l.fromOptimizedFeatures(r,this._context.metadata,n.tile.transform);return has("esri-2d-update-debug")&&console.debug(`Tile[${t.subscription.tile.id}] ClusterLevelState.createAggregateFeatures`,{clusters:u,levelClusterCount:c}),u}_clusterCells(t){const e=this._clusters;this._clusters=new Map;const s=this._context.clusterRadius*(1/r(this._context.indexOptions.spatialReference,this._scale));let i=Array.from(this._cells.values());i=i.sort((t,e)=>e.count-t.count);const o=new Set;for(const r of i){if(o.has(r.id))continue;if(r.gridX<t.xMin||r.gridX>t.xMax||r.gridY<t.yMin||r.gridY>t.yMax)continue;const e=1+this._context.clusterRadius/this._context.indexOptions.cellSize,i=this._context.attributeStore.createDisplayIdForObjectId(r.id),l=new a(r.clone(),i);o.add(r.id),this._clusters.set(r.id,l);const c=r.centroidXWorld,d=r.centroidYWorld;for(let t=r.gridY-e;t<=r.gridY+e;t++)for(let i=r.gridX-e;i<=r.gridX+e;i++){if(t===r.gridY&&i===r.gridX)continue;const e=this._cells.get(n.createId(i,t));if(!e||o.has(e.id))continue;const a=Math.abs(e.centroidXWorld-c),u=Math.abs(e.centroidYWorld-d);a<s&&u<s&&(l.inner.merge(e),o.add(e.id))}}for(const n of e.values())this._context.attributeStore.releaseDisplayIdForObjectId(n.inner.id)}_updateAggregateStatistics(t,e){let s=!1;for(const i of e.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const e=i.value,n=i.field,r=t.get(n.name);if(r){const{minValue:t,maxValue:i}=r,n=Math.min(r.minValue,e),a=Math.max(r.maxValue,e);t===n&&i===a||(r.minValue=n,r.maxValue=a,s=!0);continue}t.set(n.name,{minValue:e,maxValue:e}),s=!0}return s}}export{u as ClusterLevelState};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ASendState as s}from"../AProcessorStrategy.js";class r extends s{constructor(s){super(s),this.didSend=!1,this.done=!1}}export{r as ClusterSendState};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ComputedAggregateField as e}from"../../aggregation/ComputedAggregateField.js";import{AggregateStrategy as t}from"../AggregateStrategy.js";import{ClusterAdapter as a}from"./ClusterAdapter.js";import{ComputedAttributeStorage as r}from"../../support/ComputedAttributeStorage.js";import i from"../../support/FeatureFilterEvaluator.js";export{ClusterSendState}from"./ClusterSendState.js";async function s(s,o,l,n,f,p){const m=l.metadata.outSpatialReference,d=new r({spatialReference:m}),u=await Promise.all(o.fields.map(async t=>e.create(d,t))),c={type:"grid",fields:u,spatialReference:m,featureFilter:o.featureFilter?await i.create({geometryType:l.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:l.metadata.timeInfo,fieldsIndex:l.metadata.fieldsIndex,spatialReference:m,filterJSON:o.featureFilter}):null,cellSize:o.clusterRadius/4,arcadeContextInfo:f,sqlOptions:p},g=new a(s,o.clusterRadius,c,o.fields,l,n,p);return new t(l,n,c.spatialReference,u,p,g)}export{s as createClusterStrategy};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{FeatureUpdateStrategy as r}from"./FeatureUpdateStrategy.js";import{createBinningStrategy as t}from"./bins/createBinningStrategy.js";import{createClusterStrategy as e}from"./clusters/createClusterStrategy.js";import{createTrackStrategy as a}from"./tracks/createTrackStrategy.js";async function s(s,c,n,i,o,u){switch(c.type){case"feature":return new r(n,i,o,u);case"binning":return t(c,n,i,o,u);case"cluster":return e(s,c,n,i,o,u);case"track":return a(c,n,i,o,u)}}export{s as createAggregateStrategy};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{assertIsSome as t}from"../../../../../../core/maybe.js";import{load as e,execute as s}from"../../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as r}from"../../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as i,fromValues as o,intersects as a,empty as n,expandPointInPlace as l}from"../../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as c}from"../../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as h}from"../../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as d,convertFromPolyline as u}from"../../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as p}from"../../../../../../layers/graphics/OptimizedFeature.js";import b from"../../../../../../layers/graphics/OptimizedGeometry.js";import{externalTrackLineOidPrefix as f,internalTimeReceivedField as _,internalTrackPartField as y}from"../../../../../../layers/support/streamLayerUtils.js";import{tileSize as g}from"../../../../engine/webgl/definitions.js";import{AccumulatedStatistics as v}from"../../aggregation/AccumulatedStatistics.js";let I;const x=32;class O{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}async function j(t){if(t.isWrappable||null!=I)return;const[s,r]=await Promise.all([import("../../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../../geometry/operators/support/jsonConverter.js"),e()]);I={fromGeometryToGXGeometry:r.fromGeometryToGXGeometry,toGeometry:r.toGeometry,fromSpatialReference:s.fromSpatialReference}}class k{static getOid(t){return f+t}constructor(t,e,s,r){this._context=t,this.trackId=e,this.objectId=s,this.displayId=r,this._maxDisplayDuration=this._context.schema.maxDisplayDuration>0?this._context.schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._context.schema.maxDisplayObservationsPerTrack>=1?this._context.schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecordsByObjectId=new Map,this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new b}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._context.metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){const s=e.getObjectId();this._nextObservationRecordsByObjectId.delete(s),this._nextObservationRecordsByObjectId.set(s,new O(t,e.getIndex(),s,e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(e,s,r){const i=Array.from(this._nextObservationRecordsByObjectId.values()),o=new Set(i.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!o.has(t.objectId)).map(t=>t.objectId);let n,l;switch(this._observationRecords=[],this._trackLinePath=[],this._context.isStream||null==this._startTimeField||i.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._context.schema.timeField){case"startTimeField":n=this._context.metadata.timeInfo?.startTimeField;break;case"endTimeField":n=this._context.metadata.timeInfo?.endTimeField;break;case"timeReceived":n=this._context.isStream?_:null}l=this._context.isStream?r?.end??Date.now():r?.end??-1/0;const c=s.map(t=>t.reader.getCursor());let h;for(let m=i.length-1;m>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);m--){const e=i[m],s=c[e.chunkIndex];t(s),s.setIndex(e.featureIndex);const r=null!=n?s.readAttributeAsTimestamp(n):null;(null!=r?l-r:0)>=this._maxDisplayDuration||(this._commitObservation(e,s),h??=e)}if(null!=h){const{chunkIndex:s,featureIndex:r}=h,i=`${h.objectId}.latest`,o=e.createDisplayIdForObjectId(i),n=c[s];t(n),n.setIndex(r);const l=new p(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=l,this._latestObservationRecord=h}else this._latestObservationFeature=null;return this._trackLineGeometry=F(this._trackLinePath,this._context.spatialReference),this._bounds=R(this._trackLineGeometry),this._nextObservationRecordsByObjectId.clear(),a}updateStatistics(e,s){this._statistics=v.create(this._context.aggregateFields);const r=e.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:o}of this._observationRecords){const e=r[i];t(e),e.setIndex(o),this._statistics.insert(e,s)}}overlapsTile(t){for(const e of this._bounds)if(i(e,t.bounds,x))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,n=m(r,this._context.metadata.geometryType,t.subscription.tile.transform)??new b,c=o(1/0,1/0,-1/0,-1/0);T(n,(t,e)=>l(c,[t,e]));if(!a(c,o(0,0,g,g)))return null;return new p(n,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new b;return new p(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new p(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:d(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}function F(e,i){if(e.length<2)return u({paths:[e]},!1,!1);if(i.isWrappable){let t=!1;for(let s=1;s<e.length;s++){const r=e[s][0],o=c(r,e[s-1][0],i);r!==o&&(e[s][0]=o,t=!0)}if(t){const t=h({paths:[e],spatialReference:i});if(null!=t)return u({paths:t.paths},!1,!1)}return u({paths:[e]},!1,!1)}t(I);const o=I.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),a=I.fromSpatialReference(i);if(null!=a){const t=s(o,1e6,a,r.geodesic);if(null!=t){const e=I.toGeometry(t,a);if(null!=e&&"paths"in e)return u({paths:e.paths},!1,!1)}}return u({paths:[e]},!1,!1)}function T(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let o=0;for(let a=0;a<i.length;a++){const t=i[a];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+o)],l+=r[s*(i+o)+1],e(n,l);o+=t}}function R(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[n()];const i=[];let o=0;for(let a=0;a<e.length;a++){const t=e[a],c=n();i.push(c);for(let e=0;e<t;e++){const t=s[r*(e+o)],i=s[r*(e+o)+1];l(c,[t,i])}o+=t}return i}export{O as ObservationRecord,k as Track,j as loadTrackGeometryOperator};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import e from"../../../../../../core/Logger.js";import{internalTrackPartField as t}from"../../../../../../layers/support/streamLayerUtils.js";import{TrackLevelState as a}from"./TrackLevelState.js";import{TrackSendState as r}from"./TrackSendState.js";import{FeatureMetadata as l}from"../../support/FeatureMetadata.js";const i=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy");class s{constructor(e,a,r,i,s,n,o,d){const p=a.metadata.weakCloneWithAdditionalFields([{name:t,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),m=l.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...a.metadata.fieldsIndex.fields,...s,{name:t,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:a.metadata.spatialReference,outSpatialReference:a.metadata.outSpatialReference,attributeSpatialReference:null,subtypeField:null,subtypes:null,timeInfo:a.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1});this.metadata=p,this._trackContext={schema:e,source:a,attributeStore:r,spatialReference:i,metadata:p,trackLineMetadata:m,aggregateFields:s,arcadeContextInfo:o,sqlOptions:d,featureFilter:n,isStream:a.isStream}}createSendState(e){return new r(e)}createLevelState(e){return new a(e.level,this._trackContext)}async applyOverrideUpdate(e,t){return i().error("Applying override to tracks is not supported"),null}afterUpdateLevelState(e,t,a){}}export{s as TrackAdapter};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{isSome as t}from"../../../../../../core/arrayUtils.js";import{internalTrackPartField as e}from"../../../../../../layers/support/streamLayerUtils.js";import{Track as s}from"./Track.js";import{FeatureTileAppendMessage as r}from"../../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as o}from"../../support/arcadeUtils.js";import{FeatureSetReaderIndirect as a}from"../../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as i}from"../../support/FeatureSetReaderJSON.js";class n{constructor(t,e){this.level=t,this._context=e,this._chunks=[],this._tracks=new Map,this._handledChunks=new Set}destroy(){this._clear()}invalidate(){}removeTile(t){}update(t,e){const s=this._chunks,r=this._tracks,o=this._handledChunks;this._chunks=t,this._tracks=new Map,this._handledChunks=new Set,this._rebuildTracks(t),this._releaseState(s,r,o)}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),o=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);o.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);o.push(a),r.delete(e.objectId);continue}}for(const i of a.observations()){const t=r.get(i.objectId);if(null!=t){const e=s(i.displayId,t,i.objectId);o.push(e),r.delete(i.objectId)}}}return o}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],o=this._chunks.map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,i=o[e];i.setIndex(r),s.push({displayId:t,...i.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:i}of a.observations())if(e.has(t)){const e=o[r];e.setIndex(i),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}createMessages(s,o,n,c){s.done=s.done||!n;const l=[],u=[];for(const t of this._tracks.values())if(t.length>0){if(this._context.schema.showLatestObservation){const e=t.getLatestObservationFeatureForTile(s);null!=e&&l.push(e)}this._context.schema.showTrackLine&&t.overlapsTile(s.subscription.tile)&&u.push(t.getTrackLineFeatureForTile(s))}const d=i.fromOptimizedFeatures(l,this._context.metadata,s.subscription.tile.transform),h=i.fromOptimizedFeatures(u,this._context.trackLineMetadata,s.subscription.tile.transform);let f=[];if(this._context.schema.showPreviousObservations){const r=this._chunks.map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:s}of t.previousObservations())r[e].push(s);f=this._chunks.map((t,o)=>{const i=s.subscription.tile;let n;if("esriGeometryPolygon"===this._context.metadata.geometryType){const e=t.queryFeaturesInBounds(i.bounds);e.setTransformForDisplay(i.transform),n=e}else n=t.getTileReader(i);if(null==n)return null;const c=a.from(n,r[o]);return c.setProcessorAttributes({[e]:2}),"esriGeometryPoint"!==c.geometryType&&null!=c.getInTransform()||c.setTransformForDisplay(s.subscription.tile.transform),c}).filter(t)}c();const p=s.subscription.tile.createArcadeEvaluationOptions(this._context.arcadeContextInfo),_=h.getCursor();for(;_.next();)this._context.attributeStore.setAttributeData(_.getDisplayId(),_,p,this._context.sqlOptions);for(const t of f){const e=t.getCursor();for(;e.next();)this._context.attributeStore.setAttributeData(e.getDisplayId(),e,p,this._context.sqlOptions)}const b=d.getCursor();for(;b.next();)this._context.attributeStore.setAttributeData(b.getDisplayId(),b,p,this._context.sqlOptions);return[new r(s.subscription,h,!1,{}),...f.map(t=>new r(s.subscription,t,!1,{})),new r(s.subscription,d,s.done,{})]}_clear(){this._releaseState(this._chunks,this._tracks,this._handledChunks),this._chunks=[],this._tracks.clear(),this._handledChunks.clear()}_rebuildTracks(t){if(!t.length)return;const e=this._context.metadata.timeInfo?.trackIdField;if(null!=e){for(let r=0;r<t.length;r++){const o=t[r];if(null!=o.lodInfo&&o.lodInfo.level!==this.level)continue;if(this._handledChunks.has(o.chunkId))continue;this._handledChunks.add(o.chunkId);const a=o.reader.getCursor();for(;a.next();){const t=a.getObjectId();a.setDisplayId(this._context.attributeStore.createDisplayIdForObjectId(t));const o=a.readAttribute(e);if(null!=o&&null!=t&&(null===this._context.featureFilter||this._context.featureFilter.check(a,this._context.sqlOptions))){if(!this._tracks.has(o)){const t=s.getOid(o),e=this._context.attributeStore.createDisplayIdForObjectId(t),r=new s(this._context,o,t,e);this._tracks.set(o,r)}this._tracks.get(o).stageObservation(r,a)}}}for(const e of this._tracks.values()){const s=e.commitObservations(this._context.attributeStore,t,this._context.featureFilter?.timeExtent);for(const t of s)this._context.attributeStore.releaseDisplayIdForObjectId(t);e.updateStatistics(t,o(1,this._context.arcadeContextInfo))}}}_releaseState(t,e,s){for(const r of t)if(s.has(r.chunkId)){const t=r.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._context.attributeStore.releaseDisplayIdForObjectId(e)}}for(const r of e.values())this._releaseTrack(r)}_releaseTrack(t){this._context.attributeStore.releaseDisplayIdForObjectId(t.objectId),null!=t.latestObservationFeature&&this._context.attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}}export{n as TrackLevelState};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ASendState as r}from"../AProcessorStrategy.js";class s extends r{constructor(r){super(r),this.done=!1}}export{s as TrackSendState};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ComputedAggregateField as e}from"../../aggregation/ComputedAggregateField.js";import{AggregateStrategy as t}from"../AggregateStrategy.js";import{loadTrackGeometryOperator as a}from"./Track.js";import{TrackAdapter as r}from"./TrackAdapter.js";import{ComputedAttributeStorage as o}from"../../support/ComputedAttributeStorage.js";import i from"../../support/FeatureFilterEvaluator.js";async function m(m,p,s,n,f){const l=p.metadata.outSpatialReference,d=new o({spatialReference:l}),g=await Promise.all(m.fields.map(async t=>e.create(d,t))),u=m.featureFilter?await i.create({geometryType:p.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:p.metadata.timeInfo,fieldsIndex:p.metadata.fieldsIndex,spatialReference:l,filterJSON:m.featureFilter}):null;await a(l);const c=new r(m,p,s,l,g,u,n,f);return new t(p,s,l,g,f,c)}export{m as createTrackStrategy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import{normalizeTransform as e,quantizeX as t,quantizeY as s}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";class d extends i{static from(r,e){if(r instanceof this){const t=new Set(e),s=r._indices.filter(r=>t.has(r));return new d(r._reader,s)}return new d(r.copy(),e)}constructor(r,e){super(r.metadata),this._currentIndex=-1,this._displayTransform=null,this._reader=r,this._indices=e}setTransformForDisplay(r){const t=this._reader.getInTransform();if(null==t)return void(this._displayTransform=e(r));const s=e(t),a=e(r),[i,d]=s.scale,[n,o]=s.translate,[h,u]=a.scale,[_,l]=a.translate,y=i/h,c=d/u,p=(n-_)/h,m=(o-l)/u;this._displayTransform={originPosition:"lowerLeft",scale:[1/y,1/c,1,1],translate:[-p/y,-m/c,0,0]}}getInTransform(){return this._reader.getInTransform()}getDisplayTransform(){return this._displayTransform}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const r=new d(this._reader.copy(),this._indices);return r._currentIndex=this._currentIndex,r._displayTransform=this._displayTransform,r._processorAttributes=this._processorAttributes,r}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(r){this._reader.contextTimeZone=r}get usedMemory(){return r+this._reader.usedMemory}setProcessorAttributes(r){this._processorAttributes=Object.assign(this._processorAttributes??{},r)}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}readXForDisplay(){return this._displayTransform?t(this._displayTransform,this._reader.readXForDisplay()):this._reader.readXForDisplay()}readYForDisplay(){return this._displayTransform?s(this._displayTransform,this._reader.readYForDisplay()):this._reader.readYForDisplay()}readGeometryForDisplay(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform):this._reader.readGeometryForDisplay()}readCentroidForDisplay(){const r=this._reader.readCentroidForDisplay()?.clone();if(r){const[e,a]=r.coords;this._displayTransform&&(r.coords[0]=t(this._displayTransform,e),r.coords[1]=s(this._displayTransform,a))}return r}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}readAttribute(r,e=!1){const t=this._reader.readAttribute(r,e);return null==t&&this._processorAttributes?this._processorAttributes[r]:t}readAttributes(){return{...this._processorAttributes,...this._reader.readAttributes()}}joinAttributes(r){return this._reader.joinAttributes(r)}getBounds(r){return this._reader.getBounds(r)}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(r){return this._reader.setDisplayId(r)}setIndex(r){return this._reader.setIndex(r)}getIndex(){return this._reader.getIndex()}readXWorldSpace(){return this._reader.readXWorldSpace()}readYWorldSpace(){return this._reader.readYWorldSpace()}_readX(){return this._reader.readXForDisplay()}_readY(){return this._reader.readYForDisplay()}_readServerCentroid(){return this._reader._readServerCentroid()}readLegacyFeatureForDisplay(){const r=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(r&&{x:r.coords[0],y:r.coords[1]})??null}}readLegacyGeometryForDisplay(){const r=this.readGeometryForDisplay();return a(r,this.geometryType,!1,!1)}readGeometryArea(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform)?.area()??0:this._reader.readGeometryArea()}readGeometryWorldSpace(){return this._reader.readGeometryWorldSpace()}_readGeometry(){return this._reader._readGeometry()}_readAttribute(r,e){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(r){return this._reader.field(r)}hasField(r){return this._reader.hasField(r)}setField(r,e){return this._reader.setField(r,e)}keys(){return this._reader.keys()}castToText(r=!1){return this._reader.castToText(r)}}export{d as FeatureSetReaderIndirect};
2
+ import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import{normalizeTransform as e,quantizeX as t,quantizeY as s}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as i}from"../../../../../layers/graphics/featureConversionUtils.js";import{FeatureSetReader as a}from"./FeatureSetReader.js";class d extends a{static from(r,e){if(r instanceof this){const t=new Set(e),s=r._indices.filter(r=>t.has(r)),i=r.copy();return i._indices=s,i._currentIndex=-1,i}return new d(r.copy(),e)}constructor(r,e){super(r.metadata),this._currentIndex=-1,this._displayTransform=null,this._reader=r,this._indices=e}setTransformForDisplay(r){const t=this._reader.getInTransform();if(null==t)return void(this._displayTransform=e(r));const s=e(t),i=e(r),[a,d]=s.scale,[n,o]=s.translate,[h,u]=i.scale,[_,l]=i.translate,y=a/h,c=d/u,p=(n-_)/h,m=(o-l)/u;this._displayTransform={originPosition:"lowerLeft",scale:[1/y,1/c,1,1],translate:[-p/y,-m/c,0,0]}}getInTransform(){return this._reader.getInTransform()}getDisplayTransform(){return this._displayTransform}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const r=new d(this._reader.copy(),this._indices);return r._currentIndex=this._currentIndex,r._displayTransform=this._displayTransform,r._processorAttributes=this._processorAttributes,r}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(r){this._reader.contextTimeZone=r}get usedMemory(){return r+this._reader.usedMemory}setProcessorAttributes(r){this._processorAttributes=Object.assign(this._processorAttributes??{},r)}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}readXForDisplay(){return this._displayTransform?t(this._displayTransform,this._reader.readXForDisplay()):this._reader.readXForDisplay()}readYForDisplay(){return this._displayTransform?s(this._displayTransform,this._reader.readYForDisplay()):this._reader.readYForDisplay()}readGeometryForDisplay(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform):this._reader.readGeometryForDisplay()}readCentroidForDisplay(){const r=this._reader.readCentroidForDisplay()?.clone();if(r){const[e,i]=r.coords;this._displayTransform&&(r.coords[0]=t(this._displayTransform,e),r.coords[1]=s(this._displayTransform,i))}return r}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}readAttribute(r,e=!1){const t=this._reader.readAttribute(r,e);return null==t&&this._processorAttributes?this._processorAttributes[r]:t}readAttributes(){return{...this._processorAttributes,...this._reader.readAttributes()}}joinAttributes(r){return this._reader.joinAttributes(r)}getBounds(r){return this._reader.getBounds(r)}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(r){return this._reader.setDisplayId(r)}setIndex(r){return this._reader.setIndex(r)}getIndex(){return this._reader.getIndex()}readXWorldSpace(){return this._reader.readXWorldSpace()}readYWorldSpace(){return this._reader.readYWorldSpace()}_readX(){return this._reader.readXForDisplay()}_readY(){return this._reader.readYForDisplay()}_readServerCentroid(){return this._reader._readServerCentroid()}readLegacyFeatureForDisplay(){const r=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(r&&{x:r.coords[0],y:r.coords[1]})??null}}readLegacyGeometryForDisplay(){const r=this.readGeometryForDisplay();return i(r,this.geometryType,!1,!1)}readGeometryArea(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform)?.area()??0:this._reader.readGeometryArea()}readGeometryWorldSpace(){return this._reader.readGeometryWorldSpace()}_readGeometry(){return this._reader._readGeometry()}_readAttribute(r,e){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(r){return this._reader.field(r)}hasField(r){return this._reader.hasField(r)}setField(r,e){return this._reader.setField(r,e)}keys(){return this._reader.keys()}castToText(r=!1){return this._reader.castToText(r)}}export{d as FeatureSetReaderIndirect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function e(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclusion:!0,colorTexture:null,normalTexture:null,occlusionTexture:null,emissiveTexture:null,emissiveStrengthKHR:null,metallicRoughnessTexture:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}function l(e,l={}){return{data:e,parameters:{wrap:{s:10497,t:10497,...l.wrap},noUnpackFlip:!0,mipmap:!1,...l}}}export{e as makeMaterialParameters,l as makeTextureSource};
2
+ function e(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclusion:!0,unlit:!1,colorTexture:null,normalTexture:null,occlusionTexture:null,emissiveTexture:null,emissiveStrengthKHR:null,metallicRoughnessTexture:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}function l(e,l={}){return{data:e,parameters:{wrap:{s:10497,t:10497,...l.wrap},noUnpackFlip:!0,mipmap:!1,...l}}}export{e as makeMaterialParameters,l as makeTextureSource};