@arcgis/core 5.1.0-next.25 → 5.1.0-next.27

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 (161) hide show
  1. package/PopupTemplate.d.ts +12 -8
  2. package/README.md +4 -5
  3. package/applications/Components/testUtils.js +1 -1
  4. package/applications/Components/viewUtils.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{7a2e9626d0853a6d1547.js → 01e4cc34be6265843258.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0389ebb63510dd7024de.js +2 -0
  8. package/assets/esri/core/workers/chunks/03e20ac54d6f141b5001.js +1 -0
  9. package/assets/esri/core/workers/chunks/049ec6dcb5d9519029fe.js +1 -0
  10. package/assets/esri/core/workers/chunks/{54794b18edc584fd7515.js → 07528211e59740c47aaa.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{6e32e7b2ea2ea1a1fc04.js → 1069b92c2c5fe5f0398b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/17078f4ab1b3e33c80b4.js +1 -0
  13. package/assets/esri/core/workers/chunks/23079a2e584fca0bdb66.js +1 -0
  14. package/assets/esri/core/workers/chunks/{6fde745f3a62e7f5a97d.js → 36fd18a05ba503e6f3b5.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{a78ac951c00f090d9024.js → 3a018c78859b5edec4fd.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{abc2471cfa9430ca5645.js → 3a8f2f6ac3c3e7e71c00.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7189e03cc24f5c10865a.js → 4490f8eeeb2ee04daa9d.js} +2 -2
  18. package/assets/esri/core/workers/chunks/{593e9c8ac3b3b02deeb9.js → 4b4cf6efde26dd80f4ad.js} +1 -1
  19. package/assets/esri/core/workers/chunks/4e9b3b4b3dcce94c99a5.js +1 -0
  20. package/assets/esri/core/workers/chunks/{14792047c5519dd89828.js → 541619f434b643f0526d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{4fc6dd1423075e145b29.js → 5fff383615ba93adbf36.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{25bc7c7bc2793d209640.js → 776c0c38b9179dda00b3.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e6f51f66b71e0d6525ec.js → 8dcc8df5925f66e45b8c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/8eae33c4d8932b7a6bc1.js +1 -0
  25. package/assets/esri/core/workers/chunks/{f5c5a9e771074f780fc8.js → 94563b007647a9c4ad76.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{0140dc583e20b031eac9.js → 952ff668d202e80b43b0.js} +1 -1
  27. package/assets/esri/core/workers/chunks/a061a17b62686f945e81.js +1 -0
  28. package/assets/esri/core/workers/chunks/{835d6dd8c5a00682d879.js → a1eb8c6fd9a885cbaec9.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{9e7eea56e96f012f9ff4.js → a7d06c1553dfb6e83fe6.js} +1 -1
  30. package/assets/esri/core/workers/chunks/b1ddc837a6805a09d0da.js +1 -0
  31. package/assets/esri/core/workers/chunks/b9d68a5dcb50999d3a90.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f12f96770a45ce6d1ed7.js → c3a0b38abf0a12a466fa.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{e2661d39c48376163adf.js → c55c70dde682084867a2.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{2de299ff3a902d380be6.js → c814abf3e67d9eadbc6b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/c9bfe3d8416856c4a657.js +1 -0
  36. package/assets/esri/core/workers/chunks/e4faccd48060349b8da1.js +1 -0
  37. package/assets/esri/core/workers/chunks/{f1c1f7583fa13dff9b5c.js → e611f37bc22f75ce8a06.js} +44 -38
  38. package/assets/esri/core/workers/chunks/{deee88e3f1641c6ef5db.js → ee6f7c5d3c2f187645ff.js} +1 -1
  39. package/assets/esri/core/workers/chunks/ef29e9e575091ef3adbb.js +1 -0
  40. package/assets/esri/core/workers/chunks/{ef267b938327c41727c1.js → f89b7b0ccfbd1e5f9a0f.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{c794f7be868e53ca4a8c.js → fb05f27710fb50691d7a.js} +1 -1
  42. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +4 -1
  43. package/assets/esri/themes/dark/main.css +1 -1
  44. package/assets/esri/themes/light/main.css +1 -1
  45. package/assets/esri/themes/light/view.css +1 -1
  46. package/chunks/ImageMaterial.glsl.js +7 -7
  47. package/chunks/MeasurementArrow.glsl.js +5 -8
  48. package/chunks/ShadowCastAccumulate.glsl.js +5 -10
  49. package/chunks/ShadowHighlight.glsl.js +1 -1
  50. package/chunks/vec3.js +1 -1
  51. package/chunks/vec4.js +1 -1
  52. package/config.d.ts +2 -2
  53. package/config.js +1 -1
  54. package/editing/templateUtils.js +1 -1
  55. package/geometry/support/buffer/math/common.js +1 -1
  56. package/geometry/support/buffer/math/vec3.js +1 -1
  57. package/kernel.js +1 -1
  58. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  59. package/layers/support/FeatureReductionBinning.d.ts +3 -4
  60. package/layers/support/FeatureReductionBinning.js +1 -1
  61. package/layers/support/FeatureReductionCluster.d.ts +3 -4
  62. package/layers/support/FeatureReductionCluster.js +1 -1
  63. package/layers/support/featureReductionProperties.js +1 -1
  64. package/package.json +3 -3
  65. package/renderers/FlowRenderer.d.ts +6 -2
  66. package/support/actions/ActionBase.d.ts +5 -3
  67. package/support/actions/ActionBase.js +1 -1
  68. package/support/basemapDefinitions.js +1 -1
  69. package/support/revision.js +1 -1
  70. package/symbols/Font.d.ts +1 -1
  71. package/symbols/TextSymbol.d.ts +1 -1
  72. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  73. package/symbols/support/densifyForPreview.js +2 -0
  74. package/symbols/support/previewSymbol2D.js +1 -1
  75. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  76. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  77. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  78. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  79. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  80. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  81. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  82. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  83. package/views/2d/layers/MediaLayerView2D.js +1 -1
  84. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  85. package/views/3d/GroundView3D.js +1 -1
  86. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  87. package/views/3d/environment/CloudsComposition.js +1 -1
  88. package/views/3d/environment/CloudsRenderer.js +1 -1
  89. package/views/3d/environment/Fog.js +1 -1
  90. package/views/3d/environment/LocalAtmosphere.js +1 -1
  91. package/views/3d/environment/MarsAtmosphere.js +1 -1
  92. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  93. package/views/3d/environment/Precipitation.js +1 -1
  94. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  95. package/views/3d/layers/MediaLayerView3D.js +1 -1
  96. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  97. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +12 -6
  98. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  99. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  100. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  101. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  102. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  103. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  104. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +1 -1
  105. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  106. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  107. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  108. package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
  109. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  110. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  111. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  112. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  113. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  114. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  115. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  116. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  117. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  118. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  119. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  120. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  121. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  122. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  123. package/views/3d/webgl-engine/lib/Program.js +1 -1
  124. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  125. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  126. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  127. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  128. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  129. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  130. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  131. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  132. package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
  133. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  134. package/views/layers/MediaLayerView.d.ts +90 -4
  135. package/views/layers/MediaLayerView.js +1 -1
  136. package/views/support/waitForResources.js +1 -1
  137. package/widgets/Features/FeaturesViewModel.d.ts +14 -19
  138. package/widgets/Features.d.ts +1 -1
  139. package/widgets/Measurement.d.ts +1 -1
  140. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  141. package/widgets/OrientedImageryViewer/components/Arrow.js +1 -1
  142. package/widgets/Popup.d.ts +1 -1
  143. package/widgets/ValuePicker.d.ts +1 -1
  144. package/widgets/support/legacyIcon.js +1 -1
  145. package/assets/esri/core/workers/chunks/1be4e308280149eae4fb.js +0 -1
  146. package/assets/esri/core/workers/chunks/1dcd057695f8db79eca2.js +0 -1
  147. package/assets/esri/core/workers/chunks/1df8330823841b5bb6a5.js +0 -1
  148. package/assets/esri/core/workers/chunks/2063b49607a03f7718ee.js +0 -1
  149. package/assets/esri/core/workers/chunks/2b76a8897ad7ba284d33.js +0 -1
  150. package/assets/esri/core/workers/chunks/36da644678e6acf3bdb5.js +0 -1
  151. package/assets/esri/core/workers/chunks/4754610760f3f634adf9.js +0 -2
  152. package/assets/esri/core/workers/chunks/551fee27bf3abf0c41fd.js +0 -1
  153. package/assets/esri/core/workers/chunks/57b620d7e029747adca3.js +0 -1
  154. package/assets/esri/core/workers/chunks/74e3c224e879edb37812.js +0 -1
  155. package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +0 -1
  156. package/assets/esri/core/workers/chunks/e839c5f3a0213091a399.js +0 -1
  157. package/assets/esri/core/workers/chunks/feececf6809231f72c5a.js +0 -1
  158. package/views/layers/MediaLayerViewMixin.d.ts +0 -109
  159. package/views/layers/MediaLayerViewMixin.js +0 -2
  160. /package/assets/esri/core/workers/chunks/{4754610760f3f634adf9.js.LICENSE.txt → 0389ebb63510dd7024de.js.LICENSE.txt} +0 -0
  161. /package/assets/esri/core/workers/chunks/{7189e03cc24f5c10865a.js.LICENSE.txt → 4490f8eeeb2ee04daa9d.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getAssetUrl as e}from"../assets.js";import{fetchMessageBundle as r}from"../intl/messages.js";async function s(e){if(!e)return;const s=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,a=await r("esri/t9n/basemaps");return a[e]||a[s]}const a={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-hillshade",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1},{id:"terrain-base",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/33064a20de0c48d2bb61efa8faca93a8/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Terrain Base"},{id:"terrain-reference",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/14fbc125ccc9488888b014db09f35f67/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Reference Reference",isReference:!0}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/94329802cbfa44a18f423e6f1a0b875c/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",itemId:"9d3d89d42cfe4e2c9d108a2f0d518406",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",itemId:"9d3d89d42cfe4e2c9d108a2f0d518406",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Buildings_v1/SceneServer",itemId:"cd33b09dde0a419c986ca1a78a5fc06d",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]}};export{a as esriBasemapDefinitions,s as getBasemapTitle};
2
+ import{getAssetUrl as e}from"../assets.js";import{fetchMessageBundle as r}from"../intl/messages.js";async function s(e){if(!e)return;const s=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,a=await r("esri/t9n/basemaps");return a[e]||a[s]}const a={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-hillshade",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1},{id:"terrain-base",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/33064a20de0c48d2bb61efa8faca93a8/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Terrain Base"},{id:"terrain-reference",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/14fbc125ccc9488888b014db09f35f67/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Reference Reference",isReference:!0}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/94329802cbfa44a18f423e6f1a0b875c/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/d309c87e9f8c46a0af638d0533193e9b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/dbcfc899c38945d5b42416329e31df2a/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/204b38a0b9b24b0fac373167db16c5cd/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/4694cc30a67a434f80d09e557e74413d/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/75610658508d4d6e99298abaac8aff62/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/6a8f24366a8b42abb2535d8f14777768/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/9a8a322ab26f412fa4c299039f441ad7/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/e6b230fe483b43f390a7e767731d52d6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]}};export{a as esriBasemapDefinitions,s as getBasemapTitle};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const d="20260224",e="66d520d2d9ee5931d90f28c0c1bd76d4bfea694b";export{d as buildDate,e as commitHash};
2
+ const f="20260226",c="826299c0ef78043164f78457fd8ad614ecf547d2";export{f as buildDate,c as commitHash};
package/symbols/Font.d.ts CHANGED
@@ -40,7 +40,7 @@ export interface FontProperties extends Partial<Pick<Font, "decoration" | "famil
40
40
  * @see [TextSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/TextSymbol/)
41
41
  * @see [TextSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/TextSymbol3DLayer/)
42
42
  * @see [Sample: Add labels to a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/labels-basic/)
43
- * @see [Guide: Esri Icon Font](https://developers.arcgis.com/javascript/latest/esri-icon-font/)
43
+ * @see [Deprecated since 5.1 - Guide: Esri Icon Font](https://developers.arcgis.com/javascript/latest/esri-icon-font/)
44
44
  * @see [Guide: Labeling](https://developers.arcgis.com/javascript/latest/labeling/)
45
45
  * @example
46
46
  * let textSymbol = {
@@ -208,7 +208,7 @@ export interface TextSymbolProperties extends SymbolProperties, Partial<Pick<Tex
208
208
  * @since 4.0
209
209
  * @see [Symbol Builder](https://developers.arcgis.com/javascript/latest/visualization/symbols-color-ramps/symbol-builder/)
210
210
  * @see [Sample: Add labels to a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/labels-basic/)
211
- * @see [Sample: Using Esri Icon Fonts with map graphics](https://developers.arcgis.com/javascript/latest/sample-code/styling-icon-fonts/)
211
+ * @see [Using icon fonts with map graphics](https://developers.arcgis.com/javascript/latest/sample-code/styling-icon-fonts/)
212
212
  * @see [TextSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/TextSymbol3DLayer/)
213
213
  * @see [Labeling Guide](https://developers.arcgis.com/javascript/latest/labeling/)
214
214
  * @example
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isPolyline as e,isPolygon as t}from"../../geometry/support/jsonTypeUtils.js";import i from"./CIMResourceManager.js";import{CanvasDrawHelper as r,Transformation as h}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as s}from"./CIMSymbolHelper.js";import{OverrideHelper as n}from"./OverrideHelper.js";import{scale as a,translate as o}from"./rasterizingUtils.js";import{mapCIMSymbolToGeometryType as l}from"./utils.js";const m=96/72;class g{constructor(e){this._spatialReference=e,this._imageDataCanvas=null,this._cimResourceManager=new i}get _canvas(){return this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas")),this._imageDataCanvas}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(i,r,h,o,m,g,c,d,w,u){if(!i)return null;const{data:p}=i;if(!p||"CIMSymbolReference"!==p.type||!p.symbol)return null;const{symbol:f}=p;g||(g=l(f));const x=await n.resolveSymbolOverrides(p,r,this._spatialReference,m,g,c,d),b=this._cimResourceManager,M=[];s.fetchResources(x,b,M),s.fetchFonts(x,b,M),M.length>0&&await Promise.all(M);const{width:C,height:R}=h;let v=y(g,C,R,o,u);const I=s.getEnvelope(x,v,b);if(!I)return null;I.x===1/0&&(I.x=C+2),I.y===1/0&&(I.y=-R/2),I.width===-1/0&&(I.width=C),I.height===-1/0&&(I.height=R);let S=1,_=0,P=0;switch(f.type){case"CIMPointSymbol":case"CIMTextSymbol":{let e=1;I.width>C&&(e=C/I.width);let t=1;I.height>R&&(t=R/I.height),"preview"===o&&(I.width<C&&(e=C/I.width),I.height<R&&(t=R/I.height)),S=Math.min(e,t),_=I.x+I.width/2,P=I.y+I.height/2}break;case"CIMLineSymbol":if(u){P=I.y+I.height/2,_=I.x+I.width/2;const e=I.width-C,t=I.height-R;v={paths:a(v.paths,{xmin:-1*I.width/2+e,xmax:I.width/2-e,ymin:-1*I.height/2+t,ymax:I.height/2-t,width:I.width-2*e,height:I.height-2*t})}}else{(w||I.height>R)&&(S=R/I.height),P=I.y+I.height/2;const i=I.x*S+C/2,r=(I.x+I.width)*S+C/2,h=e(v)?v.paths:t(v)?v.rings:null;if(null===h)throw new Error("Bad geometry, can't rasterise symbol!");h[0][0][0]-=i/S,h[0][2][0]-=(r-C)/S}break;case"CIMPolygonSymbol":if(u){P=I.y+I.height/2,_=I.x+I.width/2;const e=I.width-C,t=I.height-R;v={paths:a(v.rings,{xmin:-1*I.width/2+e,xmax:I.width/2-e,ymin:-1*I.height/2+t,ymax:I.height/2-t,width:I.width-2*e,height:I.height-2*t})}}else{_=I.x+I.width/2,P=I.y+I.height/2;const e=I.x*S+C/2,t=(I.x+I.width)*S+C/2,i=I.y*S+R/2,r=(I.y+I.height)*S+R/2,{rings:h}=v;e<0&&(h[0][0][0]-=e,h[0][3][0]-=e,h[0][4][0]-=e),i<0&&(h[0][0][1]+=i,h[0][1][1]+=i,h[0][4][1]+=i),t>C&&(h[0][1][0]-=t-C,h[0][2][0]-=t-C),r>R&&(h[0][2][1]+=r-R,h[0][3][1]+=r-R)}}const j={type:"cim",data:{type:"CIMSymbolReference",symbol:x}};return this.rasterize(j,C,R,_,P,S,g,1,v)}rasterize(e,t,i,s,n,a,o,g=0,c=null,d=window.devicePixelRatio||1){const{data:w}=e;if(!w||"CIMSymbolReference"!==w.type||!w.symbol)return null;const{symbol:u}=w,p=this._canvas,f=d*m;p.width=t*f,p.height=i*f,o||(o=l(u)),c||(c=y(o,t,i,"legend")),p.width+=2*g,p.height+=2*g;const x=p.getContext("2d",{willReadFrequently:!0}),b=h.createIdentity();b.translate(-s,-n),b.scale(a*f,-a*f),b.translate(t*f/2+g,i*f/2+g),x.clearRect(0,0,p.width,p.height);return new r(x,this._cimResourceManager,b,!0).drawSymbol(u,c),x.getImageData(0,0,p.width,p.height)}}function c(e,t,i,r){if("esriGeometryPolygon"===t){return{rings:o(a(e.rings,{xmin:0,ymin:0,width:i,height:r}),-1*i/2,-1*r/2)}}if("esriGeometryPolyline"===t){return{paths:o(a(e.paths,{xmin:0,ymin:0,width:i,height:r}),-1*i/2,-1*r/2)}}return null}function y(e,t,i,r,h){const s=1,n=-t/2+s,a=t/2-s,o=i/2-s,l=-i/2+s;if(h&&("esriGeometryPolygon"===e||"esriGeometryPolyline"===e)){const r=c(h,e,t,i);if(r)return r}switch(e){case"esriGeometryPoint":return{x:0,y:0};case"esriGeometryPolyline":return{paths:[[[n,0,-4],[0,0,0],[a,0,2]]],hasM:!0};default:return"legend"===r?{rings:[[[n,o],[a,0],[a,l],[n,l],[n,o]]]}:{rings:[[[n,o],[a,o],[a,l],[n,l],[n,o]]]}}}export{g as CIMSymbolRasterizer};
2
+ import{isPolyline as e,isPolygon as t}from"../../geometry/support/jsonTypeUtils.js";import{isCurvedGeometry as i}from"../../geometry/support/curves/curveUtils.js";import r from"./CIMResourceManager.js";import{CanvasDrawHelper as s,Transformation as h}from"./CIMSymbolDrawHelper.js";import{CIMSymbolHelper as n}from"./CIMSymbolHelper.js";import{OverrideHelper as o}from"./OverrideHelper.js";import{scale as a,translate as l}from"./rasterizingUtils.js";import{mapCIMSymbolToGeometryType as m}from"./utils.js";import{densifyForPreview as c}from"../support/densifyForPreview.js";const g=96/72;class y{constructor(e){this._spatialReference=e,this._imageDataCanvas=null,this._cimResourceManager=new r}get _canvas(){return this._imageDataCanvas||(this._imageDataCanvas=document.createElement("canvas")),this._imageDataCanvas}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(i,r,s,h,l,c,g,y,d,u){if(!i)return null;const{data:p}=i;if(!p||"CIMSymbolReference"!==p.type||!p.symbol)return null;const{symbol:f}=p;c||(c=m(f));const x=await o.resolveSymbolOverrides(p,r,this._spatialReference,l,c,g,y),b=this._cimResourceManager,M=[];n.fetchResources(x,b,M),n.fetchFonts(x,b,M),M.length>0&&await Promise.all(M);const{width:v,height:C}=s;let R=w(c,v,C,h,u);const I=n.getEnvelope(x,R,b);if(!I)return null;I.x===1/0&&(I.x=v+2),I.y===1/0&&(I.y=-C/2),I.width===-1/0&&(I.width=v),I.height===-1/0&&(I.height=C);let S=1,_=0,P=0;switch(f.type){case"CIMPointSymbol":case"CIMTextSymbol":{let e=1;I.width>v&&(e=v/I.width);let t=1;I.height>C&&(t=C/I.height),"preview"===h&&(I.width<v&&(e=v/I.width),I.height<C&&(t=C/I.height)),S=Math.min(e,t),_=I.x+I.width/2,P=I.y+I.height/2}break;case"CIMLineSymbol":if(u){P=I.y+I.height/2,_=I.x+I.width/2;const e=I.width-v,t=I.height-C;R={paths:a(R.paths,{xmin:-1*I.width/2+e,xmax:I.width/2-e,ymin:-1*I.height/2+t,ymax:I.height/2-t,width:I.width-2*e,height:I.height-2*t})}}else{(d||I.height>C)&&(S=C/I.height),P=I.y+I.height/2;const i=I.x*S+v/2,r=(I.x+I.width)*S+v/2,s=e(R)?R.paths:t(R)?R.rings:null;if(null===s)throw new Error("Bad geometry, can't rasterise symbol!");s[0][0][0]-=i/S,s[0][2][0]-=(r-v)/S}break;case"CIMPolygonSymbol":if(u){P=I.y+I.height/2,_=I.x+I.width/2;const e=I.width-v,t=I.height-C;R={paths:a(R.rings,{xmin:-1*I.width/2+e,xmax:I.width/2-e,ymin:-1*I.height/2+t,ymax:I.height/2-t,width:I.width-2*e,height:I.height-2*t})}}else{_=I.x+I.width/2,P=I.y+I.height/2;const e=I.x*S+v/2,t=(I.x+I.width)*S+v/2,i=I.y*S+C/2,r=(I.y+I.height)*S+C/2,{rings:s}=R;e<0&&(s[0][0][0]-=e,s[0][3][0]-=e,s[0][4][0]-=e),i<0&&(s[0][0][1]+=i,s[0][1][1]+=i,s[0][4][1]+=i),t>v&&(s[0][1][0]-=t-v,s[0][2][0]-=t-v),r>C&&(s[0][2][1]+=r-C,s[0][3][1]+=r-C)}}const j={type:"cim",data:{type:"CIMSymbolReference",symbol:x}};return this.rasterize(j,v,C,_,P,S,c,1,R)}rasterize(e,t,i,r,n,o,a,l=0,c=null,y=window.devicePixelRatio||1){const{data:d}=e;if(!d||"CIMSymbolReference"!==d.type||!d.symbol)return null;const{symbol:u}=d,p=this._canvas,f=y*g;p.width=t*f,p.height=i*f,a||(a=m(u)),c||(c=w(a,t,i,"legend")),p.width+=2*l,p.height+=2*l;const x=p.getContext("2d",{willReadFrequently:!0}),b=h.createIdentity();b.translate(-r,-n),b.scale(o*f,-o*f),b.translate(t*f/2+l,i*f/2+l),x.clearRect(0,0,p.width,p.height);return new s(x,this._cimResourceManager,b,!0).drawSymbol(u,c),x.getImageData(0,0,p.width,p.height)}}function d(e,t,r,s){const h=i(e)?c(e,r,s):e;if("esriGeometryPolygon"===t){return{rings:l(a(h.rings,{xmin:0,ymin:0,width:r,height:s}),-1*r/2,-1*s/2)}}if("esriGeometryPolyline"===t){return{paths:l(a(h.paths,{xmin:0,ymin:0,width:r,height:s}),-1*r/2,-1*s/2)}}return null}function w(e,t,i,r,s){const h=1,n=-t/2+h,o=t/2-h,a=i/2-h,l=-i/2+h;if(s&&("esriGeometryPolygon"===e||"esriGeometryPolyline"===e)){const r=d(s,e,t,i);if(r)return r}switch(e){case"esriGeometryPoint":return{x:0,y:0};case"esriGeometryPolyline":return{paths:[[[n,0,-4],[0,0,0],[o,0,2]]],hasM:!0};default:return"legend"===r?{rings:[[[n,a],[o,0],[o,l],[n,l],[n,a]]]}:{rings:[[[n,a],[o,a],[o,l],[n,l],[n,a]]]}}}export{y as CIMSymbolRasterizer};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{create as t,height as o,width as r}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as e}from"../../geometry/support/boundsUtils.js";import{densifyCurvedGeometry as i}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getMaxDeviationInPixels as s}from"../../views/2d/layers/graphics/densificationConstants.js";function n(t,o,r,e){const{height:n,width:p}=e??m(t),u=Math.min(p/o,n/r)*s();return i(t,{maxDeviation:u})}function m(i){const s=e(t(),i);return{width:r(s),height:o(s)}}export{n as densifyForPreview};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import o from"../../core/Error.js";import{loadFont as i}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{isCurvedGeometry as s}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as r}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getFill as h,getStroke as c,getDashArray as m,getPatternUrlWithColor as u}from"./gfxUtils.js";import{shapes as p,adjustColorBrightness as d}from"./previewUtils.js";import{renderSymbol as f}from"./renderUtils.js";import{backgroundPadding as g}from"./textUtils.js";const y="picture-fill",w="picture-marker",x="simple-fill",v="simple-line",b="simple-marker",M="text",k="Aa",z=22,L=120,S=80,C=50,j=225,B=document.createElement("canvas");function P(t,e,o){const{extent:i}=t;if(!i)return"";const n=i.width||1,h=i.height||1;if("polygon"===t.type){const l=t.clone();s(l)&&(l.rings=r(l,{minSegmentsPerCurve:128}).rings),a({originPosition:"upperLeft",scale:[n/e,h/o],translate:[i.xmin,i.ymax]},l,l);let c="";for(let t=0;t<l.rings.length;t++){const e=l.rings[t];for(let t=0;t<e.length;t++){const o=e[t][0],i=e[t][1],n=0===t?"M":"l",a=t===e.length-1?" Z":"";c+=`${""!==c?" ":""}${n}${o.toString()} ${i.toString()}${a}`}}return c}if("polyline"===t.type){const a=t.clone();s(a)&&(a.paths=r(a,{minSegmentsPerCurve:128}).paths),l({originPosition:"upperLeft",scale:[n/e,h/o],translate:[i.xmin,i.ymax]},a,a);let c="";for(let t=0;t<a.paths.length;t++){const e=a.paths[t];for(let t=0;t<e.length;t++){const o=e[t][0],i=e[t][1];c+=`${""!==c?" ":""}${0===t?"M":"l"}${o.toString()} ${i.toString()}`}}return c}return""}function $(t,e){const o=B.getContext("2d"),i=[];e&&(e.weight&&i.push(e.weight),e.size&&i.push(e.size+"px"),e.family&&i.push(e.family)),o.font=i.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=o.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function E(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function U(t,e){const o=e.fill,i=t.color;if("pattern"===o?.type&&i&&t.type!==y){const t=await u(o.src,i.toCss(!0));o.src=t,e.fill=o}}async function F(t,e,o,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await i(t.font)}catch{}const{width:a,height:l}=E(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:i,height:s,x:r,y:h}=$(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});o[0]=a??i,o[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));o[1]=o[0]*e+o[1]*i}}}function A(t,e,o,i,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=o.map(()=>[]);const l=n(t.haloSize);i[0]+=l,i[1]+=l,o.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:i[0]+2*g,height:i[1]+2*g},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(i[0]+=2*g,i[1]+=2*g,o.unshift([{shape:{type:"rect",x:0,y:0,width:i[0],height:i[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function Z(t,e){return t>e?"dark":"light"}function D(t,e){const o="number"==typeof e?.size?e?.size:null,i=null!=o?n(o):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const s=h(t);let r=c(t);"dark"!==T(t,245)||e?.ignoreWhiteSymbols||(r={width:.75,...r,color:"#bdc3c7"});let u=null;const d={shape:null,fill:s,stroke:r,offset:[0,0]};r?.width&&(r.width=Math.min(r.width,S));const f=r?.width||0;let g=null!=e?.size&&(null==e?.scale||e?.scale),j=0,B=0,U=!1;switch(t.type){case b:{const o=t.style,{width:s,height:r}=E(e);let h=s===r&&null!=s?s:null!=i?i:Math.min(n(t.size),a||L);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||L);h=e>s&&e>r?Math.min(s,r):e}switch(j=h,B=h,o){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},g||(j+=f,B+=f);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*B]},{command:"L",values:[j,.5*B]},{command:"M",values:[.5*j,0]},{command:"L",values:[.5*j,B]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*B]},{command:"L",values:[.5*j,0]},{command:"L",values:[j,.5*B]},{command:"L",values:[.5*j,B]},{command:"Z",values:[]}]},g||(j+=f,B+=f);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[j,0]},{command:"L",values:[j,B]},{command:"L",values:[0,B]},{command:"Z",values:[]}]},g||(j+=f,B+=f),l&&(U=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*j,0]},{command:"L",values:[j,B]},{command:"L",values:[0,B]},{command:"Z",values:[]}]},g||(j+=f,B+=f),l&&(U=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[j,B]},{command:"M",values:[j,0]},{command:"L",values:[0,B]}]},l&&(U=!0);break;case"path":d.shape={type:"path",path:t.path||""},g||(j+=f,B+=f),l&&(U=!0),g=!0}break}case v:{const{width:t,height:o}=E(e),n=m(r).reduce((t,e)=>t+e,0),a=n&&Math.ceil(C/n),l=o??i??f,s=t??(n*a||C);if(g=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){j=s,B=o??j;const t=1e3,i=.15*t;u=[j,B],B=u[0]>u[1]?t*u[1]/u[0]:t,j=u[0]>u[1]?t:t*u[0]/u[1],r?.width&&(r.width=r.width*t/(u[1]>u[0]?u[1]:u[0]),r.width>i&&(r.width=i)),d.shape={type:"path",path:P(e.geometry,j,B)}}else j=null!=e?.maxSize?Math.min(s,e.maxSize):s,B=l,r&&(r.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,B/2]},{command:"L",values:[j-l/2,B/2]}]};break}case y:case x:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:o,height:n}=E(e);j=!t&&o!==n||null==o?null!=i?i:z:o,B=!t&&o!==n||null==n?j:n,g||(j+=f,B+=f),g=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(u=[j,B],B=u[0]>u[1]?1e3*u[1]/u[0]:1e3,j=u[0]>u[1]?1e3:1e3*u[0]/u[1],d.shape={type:"path",path:P(e.geometry,j,B)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[j,0]},{command:"L",values:[j,B]},{command:"L",values:[0,B]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:p.fill[0];break}case w:{const o=Math.min(n(t.width),a||L),s=Math.min(n(t.height),a||L),{width:r,height:h}=E(e),c=r===h&&null!=r?r:null!=i?i:Math.max(o,s),m=t.width/t.height;j=m<=1?Math.ceil(c*m):c,B=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round(j/2),y:-Math.round(B/2),width:j,height:B,src:t.url||""},l&&(U=!0);break}case M:{const o=t,l=e?.overrideText||o.text||k,s=o.font,{width:r,height:h}=E(e),c=null!=h?h:null!=i?i:Math.min(n(s.size),a||L),{width:m,height:u}=$(l,{weight:s.weight,size:c,family:s.family}),p=/[\uE600-\uE6FF]/.test(l);j=r??(p?c:m),B=p?c:u;let f=.5*(p?c:u);p&&(f+=5),d.shape={type:"text",text:l,x:o.xoffset||0,y:o.yoffset||f,align:"middle",alignBaseline:o.verticalAlignment,decoration:s&&s.decoration,rotated:o.rotated,kerning:o.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[j,B],outputSize:u,renderOptions:{node:e?.node,scale:g,opacity:e?.opacity,rotations:[l],useRotationSize:U,cssEffectFilter:e?.cssEffectFilter,ariaLabel:e?.ariaLabel,clipBloomEffect:e?.clipBloomEffect}}}async function q(t,e){const{shapeDescriptor:i,size:n,renderOptions:a,outputSize:l}=D(t,e);if(!i.shape)throw new o("symbolPreview: renderPreviewHTML2D","symbol not supported.");await U(t,i),await F(t,i,n,e);const s=[[i]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...i,offset:[-t,0],fill:d(i.fill,-.3)}]),s.push([{...i,offset:[t,0],fill:d(i.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&A(t,i,s,n,a);const r=f(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function T(o,i=j){const n=h(o),a=c(o),l=!n||"type"in n?null:new t(n),s=a?.color?new t(a?.color):null,r=l?Z(e(l),i):null,m=s?Z(e(s),i):null;return m?r?r===m?r:i>=j?"light":"dark":m:r}export{T as getContrastingBackgroundTheme,D as getRenderSymbolParameters,q as previewSymbol2D};
2
+ import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import o from"../../core/Error.js";import{loadFont as i}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{isCurvedGeometry as s}from"../../geometry/support/curves/curveUtils.js";import{densifyForPreview as r}from"./densifyForPreview.js";import{getFill as h,getStroke as c,getDashArray as m,getPatternUrlWithColor as p}from"./gfxUtils.js";import{shapes as u,adjustColorBrightness as d}from"./previewUtils.js";import{renderSymbol as f}from"./renderUtils.js";import{backgroundPadding as g}from"./textUtils.js";const y="picture-fill",w="picture-marker",x="simple-fill",b="simple-line",v="simple-marker",M="text",k="Aa",z=22,L=120,S=80,j=50,C=225,B=document.createElement("canvas");function P(t,e,o){const{extent:i}=t;if(!i)return"";const n=i.width||1,h=i.height||1;if("polygon"===t.type){const l=t.clone();s(l)&&(l.rings=r(l,e,o,i).rings),a({originPosition:"upperLeft",scale:[n/e,h/o],translate:[i.xmin,i.ymax]},l,l);let c="";for(let t=0;t<l.rings.length;t++){const e=l.rings[t];for(let t=0;t<e.length;t++){const o=e[t][0],i=e[t][1],n=0===t?"M":"l",a=t===e.length-1?" Z":"";c+=`${""!==c?" ":""}${n}${o.toString()} ${i.toString()}${a}`}}return c}if("polyline"===t.type){const a=t.clone();s(a)&&(a.paths=r(a,e,o,i).paths),l({originPosition:"upperLeft",scale:[n/e,h/o],translate:[i.xmin,i.ymax]},a,a);let c="";for(let t=0;t<a.paths.length;t++){const e=a.paths[t];for(let t=0;t<e.length;t++){const o=e[t][0],i=e[t][1];c+=`${""!==c?" ":""}${0===t?"M":"l"}${o.toString()} ${i.toString()}`}}return c}return""}function $(t,e){const o=B.getContext("2d"),i=[];e&&(e.weight&&i.push(e.weight),e.size&&i.push(e.size+"px"),e.family&&i.push(e.family)),o.font=i.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=o.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function E(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function U(t,e){const o=e.fill,i=t.color;if("pattern"===o?.type&&i&&t.type!==y){const t=await p(o.src,i.toCss(!0));o.src=t,e.fill=o}}async function F(t,e,o,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await i(t.font)}catch{}const{width:a,height:l}=E(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:i,height:s,x:r,y:h}=$(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});o[0]=a??i,o[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));o[1]=o[0]*e+o[1]*i}}}function A(t,e,o,i,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=o.map(()=>[]);const l=n(t.haloSize);i[0]+=l,i[1]+=l,o.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:i[0]+2*g,height:i[1]+2*g},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(i[0]+=2*g,i[1]+=2*g,o.unshift([{shape:{type:"rect",x:0,y:0,width:i[0],height:i[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function Z(t,e){return t>e?"dark":"light"}function D(t,e){const o="number"==typeof e?.size?e?.size:null,i=null!=o?n(o):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const s=h(t);let r=c(t);"dark"!==T(t,245)||e?.ignoreWhiteSymbols||(r={width:.75,...r,color:"#bdc3c7"});let p=null;const d={shape:null,fill:s,stroke:r,offset:[0,0]};r?.width&&(r.width=Math.min(r.width,S));const f=r?.width||0;let g=null!=e?.size&&(null==e?.scale||e?.scale),C=0,B=0,U=!1;switch(t.type){case v:{const o=t.style,{width:s,height:r}=E(e);let h=s===r&&null!=s?s:null!=i?i:Math.min(n(t.size),a||L);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||L);h=e>s&&e>r?Math.min(s,r):e}switch(C=h,B=h,o){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},g||(C+=f,B+=f);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*B]},{command:"L",values:[C,.5*B]},{command:"M",values:[.5*C,0]},{command:"L",values:[.5*C,B]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*B]},{command:"L",values:[.5*C,0]},{command:"L",values:[C,.5*B]},{command:"L",values:[.5*C,B]},{command:"Z",values:[]}]},g||(C+=f,B+=f);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[C,0]},{command:"L",values:[C,B]},{command:"L",values:[0,B]},{command:"Z",values:[]}]},g||(C+=f,B+=f),l&&(U=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*C,0]},{command:"L",values:[C,B]},{command:"L",values:[0,B]},{command:"Z",values:[]}]},g||(C+=f,B+=f),l&&(U=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[C,B]},{command:"M",values:[C,0]},{command:"L",values:[0,B]}]},l&&(U=!0);break;case"path":d.shape={type:"path",path:t.path||""},g||(C+=f,B+=f),l&&(U=!0),g=!0}break}case b:{const{width:t,height:o}=E(e),n=m(r).reduce((t,e)=>t+e,0),a=n&&Math.ceil(j/n),l=o??i??f,s=t??(n*a||j);if(g=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){C=s,B=o??C;const t=1e3,i=.15*t;p=[C,B],B=p[0]>p[1]?t*p[1]/p[0]:t,C=p[0]>p[1]?t:t*p[0]/p[1],r?.width&&(r.width=r.width*t/(p[1]>p[0]?p[1]:p[0]),r.width>i&&(r.width=i)),d.shape={type:"path",path:P(e.geometry,C,B)}}else C=null!=e?.maxSize?Math.min(s,e.maxSize):s,B=l,r&&(r.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,B/2]},{command:"L",values:[C-l/2,B/2]}]};break}case y:case x:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:o,height:n}=E(e);C=!t&&o!==n||null==o?null!=i?i:z:o,B=!t&&o!==n||null==n?C:n,g||(C+=f,B+=f),g=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(p=[C,B],B=p[0]>p[1]?1e3*p[1]/p[0]:1e3,C=p[0]>p[1]?1e3:1e3*p[0]/p[1],d.shape={type:"path",path:P(e.geometry,C,B)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[C,0]},{command:"L",values:[C,B]},{command:"L",values:[0,B]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:u.fill[0];break}case w:{const o=Math.min(n(t.width),a||L),s=Math.min(n(t.height),a||L),{width:r,height:h}=E(e),c=r===h&&null!=r?r:null!=i?i:Math.max(o,s),m=t.width/t.height;C=m<=1?Math.ceil(c*m):c,B=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round(C/2),y:-Math.round(B/2),width:C,height:B,src:t.url||""},l&&(U=!0);break}case M:{const o=t,l=e?.overrideText||o.text||k,s=o.font,{width:r,height:h}=E(e),c=null!=h?h:null!=i?i:Math.min(n(s.size),a||L),{width:m,height:p}=$(l,{weight:s.weight,size:c,family:s.family}),u=/[\uE600-\uE6FF]/.test(l);C=r??(u?c:m),B=u?c:p;let f=.5*(u?c:p);u&&(f+=5),d.shape={type:"text",text:l,x:o.xoffset||0,y:o.yoffset||f,align:"middle",alignBaseline:o.verticalAlignment,decoration:s&&s.decoration,rotated:o.rotated,kerning:o.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[C,B],outputSize:p,renderOptions:{node:e?.node,scale:g,opacity:e?.opacity,rotations:[l],useRotationSize:U,cssEffectFilter:e?.cssEffectFilter,ariaLabel:e?.ariaLabel,clipBloomEffect:e?.clipBloomEffect}}}async function q(t,e){const{shapeDescriptor:i,size:n,renderOptions:a,outputSize:l}=D(t,e);if(!i.shape)throw new o("symbolPreview: renderPreviewHTML2D","symbol not supported.");await U(t,i),await F(t,i,n,e);const s=[[i]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...i,offset:[-t,0],fill:d(i.fill,-.3)}]),s.push([{...i,offset:[t,0],fill:d(i.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&A(t,i,s,n,a);const r=f(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function T(o,i=C){const n=h(o),a=c(o),l=!n||"type"in n?null:new t(n),s=a?.color?new t(a?.color):null,r=l?Z(e(l),i):null,m=s?Z(e(s),i):null;return m?r?r===m?r:i>=C?"light":"dark":m:r}export{T as getContrastingBackgroundTheme,D as getRenderSymbolParameters,q as previewSymbol2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/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 p}from"../../../../core/support/UpdatingHandles.js";import c 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 c({color:null,outline:null}),this._operationManager=new d,this._updatingHandles=new p}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,view:this.view}),this.addHandles([o(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{t&&e?"place"!==this._operationManager.currentOperationType&&this.reshape():this._operationManager.stop()}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new c({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=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":case"active":{const t=e.graphic?.geometry;"polygon"===t?.type&&(this._analysis.geometry=t);break}case"cancel":case"complete":t.stop(),this.reshape()}});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.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 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 p}from"../../../../core/support/UpdatingHandles.js";import c 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 c({color:null,outline:null}),this._operationManager=new d,this._updatingHandles=new p}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,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():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 c({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=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":case"active":{const t=e.graphic?.geometry;"polygon"===t?.type&&(this._analysis.geometry=t);break}case"cancel":case"complete":t.stop(),this.reshape()}});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.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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/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 p}from"../../../../core/support/UpdatingHandles.js";import c 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 c({color:null,width:0}),this._operationManager=new m,this._updatingHandles=new p}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?"place"!==this._operationManager.currentOperationType&&this.reshape():this._operationManager.stop()}),o(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),o(()=>this.view.effectiveTheme.accentColor,e=>{this._lineSymbol=new c({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()}});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{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():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()}});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};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as s,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as o}from"./decluttering/util.js";import{RenderableTile as l}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import{simplePipelineState as a}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as d}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import h from"../../tiling/TileCoverage.js";import c from"../../tiling/TileKey.js";const u=1e-6;function y(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||1!==s.getValue()&&(void 0===e.minzoom||e.minzoom<t+u)&&(void 0===e.maxzoom||e.maxzoom>=t-u))return!0}return!1}class p extends n{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new d,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null);const e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,l){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=l,this._computeDisplayInfoView(l),null==this._symbolFader){const e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,o(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i("vector-tile",this._styleRepository,e,this.children,s)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic}}doRender(e){const{drawPhase:t}=e,s=1===t||64===t;this.visible&&s&&void 0!==this._spriteMosaic&&super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;64!==t?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,painter:s,state:r}=e,i=this._styleRepository;if(!i)return;const o=i.layers,l=this._displayInfo.scaleToZoom(r.scale);i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,l)),super.renderChildren(e),1===e.drawPhase&&this._fade(l,r);const n=this.children.filter(e=>e.visible&&e.hasData());if(n&&0!==n.length){for(const e of n)e.triangleCount=0;t.setClearDepth(1),t.clear(256),s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"none"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:{zNear:0,zFar:1},test:515}}),e.renderPass="opaque";for(let t=o.length-1;t>=0;t--)this._renderStyleLayer(o[t],e,n);s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass="translucent";for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,n);t.bindVAO(null),s.setPipelineState(a);for(const e of n)e.debugInfo.display.triangleCount=e.triangleCount}else t.bindVAO(null)}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:r,renderPass:i}=t;if(void 0===e)return;const o=e.getLayoutProperty("visibility");if(o&&1===o.getValue())return;switch(e.type){case 0:return;case 1:if("opaque"!==i&&"translucent"!==t.renderPass)return;break;case 2:case 4:case 3:if("translucent"!==i)return}if(s=3===e.type?s.filter(e=>e.decluttered):s.filter(e=>e.neededForCoverage),3!==e.type&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=r+u||void 0!==e.maxzoom&&e.maxzoom<r-u))return;const l=e.uid;t.styleLayerUID=l,t.styleLayer=e;const n=this._techniques.getTechnique(e.type);null!=n&&n.render(t,{tiles:s})}_renderBackgroundLayers(t,i,o){const{state:n}=t,a=this._styleRepository;let d=!1;for(const e of i){if(0===a.getLayerById(e).type&&y(a.getLayerById(e),o)){d=!0;break}}if(!d)return;const u=this.tilingScheme,p=u.getTileCoverage(t.state,0,!0,"smallest"),{spans:m,lodInfo:g}=p,{level:f}=g,_=e(),b=[],F=this._backgroundTiles;let v,R=0;for(const{row:h,colFrom:y,colTo:w}of m)for(let t=y;t<=w;t++){if(R<F.length)v=F[R],v.key.set(f,h,g.normalizeCol(t),g.getWorldForColumn(t)),u.getTileBounds(_,v.key,!1),v.x=_[0],v.y=_[3],v.resolution=u.getTileResolution(f);else{const i=new c(f,h,g.normalizeCol(t),g.getWorldForColumn(t)),o=u.getTileBounds(e(),i),n=u.getTileResolution(f);v=new l(i,n,o[0],o[3],r,r,s,s),F.push(v)}v.setTransform(n),b.push(v),R++}const T=this._techniques.getTechnique(0);for(const e of i){const s=a.getLayerById(e);0===s.type&&y(s,o)&&(t.styleLayerUID=s.uid,t.styleLayer=s,T.render(t,{tiles:b}))}h.pool.release(p)}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const i=Math.max(25,e.tileInfo.lods.length),o=[];for(let t=0;t<=i;t++)o.push(s),s/=2;this._displayInfo=t.create({scales:o,size:r,spatialReference:e.spatialReference,numLODs:i})}}export{p as VectorTileContainer};
2
+ import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as s,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as o}from"./decluttering/util.js";import{RenderableTile as l}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import{simplePipelineState as a}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as d}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import h from"../../tiling/TileCoverage.js";import c from"../../tiling/TileKey.js";const u=1e-6;function y(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||1!==s.getValue()&&(void 0===e.minzoom||e.minzoom<t+u)&&(void 0===e.maxzoom||e.maxzoom>=t-u))return!0}return!1}class p extends n{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new d,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null);const e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,l){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=l,this._computeDisplayInfoView(l),null==this._symbolFader){const e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,o(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i("vector-tile",this._styleRepository,e,this.children,s)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic}}doRender(e){const{drawPhase:t}=e,s=1===t||64===t;this.visible&&s&&void 0!==this._spriteMosaic&&super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;64!==t?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,painter:s,state:r}=e,i=this._styleRepository;if(!i)return;const o=i.layers,l=this._displayInfo.scaleToZoom(r.scale);i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,l)),super.renderChildren(e),1===e.drawPhase&&this._fade(l,r);const n=this.children.filter(e=>e.visible&&e.hasData());if(n&&0!==n.length){for(const e of n)e.triangleCount=0;t.setClearDepth(1),t.clear(256),s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"none"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:{zNear:0,zFar:1},test:515}}),e.renderPass="opaque";for(let t=o.length-1;t>=0;t--)this._renderStyleLayer(o[t],e,n);s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass="translucent";for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,n);t.bindVAO(null),s.setPipelineState(a);for(const e of n)e.debugInfo.display.triangleCount=e.triangleCount}else t.bindVAO(null)}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:r,renderPass:i}=t;if(void 0===e)return;const o=e.getLayoutProperty("visibility");if(o&&1===o.getValue())return;switch(e.type){case 0:return;case 1:if("opaque"!==i&&"translucent"!==t.renderPass)return;break;case 2:case 4:case 3:if("translucent"!==i)return}if(s=3===e.type?s.filter(e=>e.decluttered):s.filter(e=>e.neededForCoverage),3!==e.type&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=r+u||void 0!==e.maxzoom&&e.maxzoom<r-u))return;const l=e.uid;t.styleLayerUID=l,t.styleLayer=e;const n=this._techniques.getTechnique(e.type);null!=n&&n.render(t,{tiles:s})}_renderBackgroundLayers(t,i,o){const{state:n}=t,a=this._styleRepository;let d=!1;for(const e of i){const t=a.getLayerById(e);if(t&&0===t.type&&y(a.getLayerById(e),o)){d=!0;break}}if(!d)return;const u=this.tilingScheme,p=u.getTileCoverage(t.state,0,!0,"smallest"),{spans:m,lodInfo:g}=p,{level:f}=g,_=e(),b=[],F=this._backgroundTiles;let v,R=0;for(const{row:h,colFrom:y,colTo:w}of m)for(let t=y;t<=w;t++){if(R<F.length)v=F[R],v.key.set(f,h,g.normalizeCol(t),g.getWorldForColumn(t)),u.getTileBounds(_,v.key,!1),v.x=_[0],v.y=_[3],v.resolution=u.getTileResolution(f);else{const i=new c(f,h,g.normalizeCol(t),g.getWorldForColumn(t)),o=u.getTileBounds(e(),i),n=u.getTileResolution(f);v=new l(i,n,o[0],o[3],r,r,s,s),F.push(v)}v.setTransform(n),b.push(v),R++}const T=this._techniques.getTechnique(0);for(const e of i){const s=a.getLayerById(e);0===s.type&&y(s,o)&&(t.styleLayerUID=s.uid,t.styleLayer=s,T.render(t,{tiles:b}))}h.pool.release(p)}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const i=Math.max(25,e.tileInfo.lods.length),o=[];for(let t=0;t<=i;t++)o.push(s),s/=2;this._displayInfo=t.create({scales:o,size:r,spatialReference:e.spatialReference,numLODs:i})}}export{p as VectorTileContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../../Color.js";import{toLCH as e,toRGB as r,toLAB as s}from"../../../../../core/colorUtils.js";import{unitBezier as n}from"../../../unitBezier.js";import{interpolate as a}from"../GeometryUtils.js";import{booleanType as o,numberType as i,arrayType as l,colorType as u,stringType as c,valueType as h,typeToString as p,objectType as g,getType as f,valueToString as w,matchType as m}from"./types.js";class y{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class _{constructor(){this.type=h}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new _}evaluate(t,e){return t?.id}}class v{constructor(){this.type=c}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new v}evaluate(t,e){if(!t)return null;switch(t.type){case 1:return"Point";case 2:return"LineString";case 3:return"Polygon";default:return null}}}class b{constructor(){this.type=g}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new b}evaluate(t,e){return t?.values}}class d{constructor(){this.type=i}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new d}evaluate(t,e){return e}}class x{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=o}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new x(ht(t[1],e),ht(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class E extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t===e)}}class $ extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t!==e)}}class M extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t<e)}}class k extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t<=e)}}class A extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t>e)}}class j extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t>=e)}}class q{constructor(t){this._arg=t,this.type=o}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new q(ht(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class N{constructor(t){this._args=t,this.type=o}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(ht(t[s],e));return new N(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class R{constructor(t){this._args=t,this.type=o}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(ht(t[s],e));return new R(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class C{constructor(t){this._args=t,this.type=o}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(ht(t[s],e));return new C(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class z{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let s;const n=[];for(let o=1;o<t.length-1;o+=2){const a=ht(t[o],e),i=ht(t[o+1],e,r);s||(s=i.type),n.push({condition:a,output:i})}const a=ht(t[t.length-1],e,r);return s||(s=a.type),new z(s,n,a)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class I{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const s=[];for(let n=1;n<t.length;n++){const a=ht(t[n],e);r||(r=a.type),s.push(a)}return new I(r,s)}evaluate(t,e){for(const r of this._args){const s=r.evaluate(t,e);if(null!==s)return s}return null}}class L{constructor(t,e,r,s,n){this.type=t,this._input=e,this._labels=r,this._outputs=s,this._fallback=n}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const s=ht(t[1],e),n=[],a={};let o;for(let i=2;i<t.length-1;i+=2){let s=t[i];Array.isArray(s)||(s=[s]);for(const t of s){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(o){if(e!==o)throw new Error('"match" requires labels to have the same type')}else o=e;a[t]=n.length}const l=ht(t[i+1],e);r||(r=l.type),n.push(l)}return new L(r,s,a,n,ht(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class U{constructor(t,e,r,s,n){this._operator=t,this.type=e,this.interpolation=r,this.input=s,this._stops=n}static parse(t,e,r){const s=t[0];if(t.length<5)throw new Error(`"${s}" expects at least 4 arguments`);const n=t[1];if(!Array.isArray(n)||0===n.length)throw new Error(`"${n}" is not a valid interpolation`);switch(n[0]){case"linear":if(1!==n.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==n.length||"number"!=typeof n[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==n.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=n[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${n[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const a=ht(t[2],e,i);let o;"interpolate-hcl"===s||"interpolate-lab"===s?o=u:r&&"value"!==r.kind&&(o=r);const l=[];for(let i=3;i<t.length;i+=2){const r=t[i];if("number"!=typeof r)throw new Error(`"${s}" requires stop inputs as literal numbers`);if(l.length&&l[l.length-1][0]>=r)throw new Error(`"${s}" requires strictly ascending stop inputs`);const n=ht(t[i+1],e,o);o||(o=n.type),l.push([r,n])}if(o&&o!==u&&o!==i&&("array"!==o.kind||o.itemType!==i))throw new Error(`"${s}" cannot interpolate type ${p(o)}`);return new U(s,o,n,a,l)}evaluate(n,o){const i=this._stops;if(1===i.length)return i[0][1].evaluate(n,o);const l=this.input.evaluate(n,o);if(l<=i[0][0])return i[0][1].evaluate(n,o);if(l>=i[i.length-1][0])return i[i.length-1][1].evaluate(n,o);let u=0;for(;++u<i.length&&!(l<i[u][0]););const c=i[u-1][0],h=i[u][0],g=U.interpolationRatio(this.interpolation,l,c,h),f=i[u-1][1].evaluate(n,o),w=i[u][1].evaluate(n,o);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(f)&&Array.isArray(w))return f.map((t,e)=>a(t,w[e],g));if("color"===this.type.kind&&f instanceof t&&w instanceof t){const e=new t(f),r=new t(w);return new t([a(e.r,r.r,g),a(e.g,r.g,g),a(e.b,r.b,g),a(e.a,r.a,g)])}if("number"===this.type.kind&&"number"==typeof f&&"number"==typeof w)return a(f,w,g);throw new Error(`"${this._operator}" cannot interpolate type ${p(this.type)}`)}if("interpolate-hcl"===this._operator){const s=e(f),n=e(w),o=n.h-s.h,i=r({h:s.h+g*(o>180||o<-180?o-360*Math.round(o/360):o),c:a(s.c,n.c,g),l:a(s.l,n.l,g)});return new t({a:a(f.a,w.a,g),...i})}if("interpolate-lab"===this._operator){const e=s(f),n=s(w),o=r({l:a(e.l,n.l,g),a:a(e.a,n.a,g),b:a(e.b,n.b,g)});return new t({a:a(f.a,w.a,g),...o})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let s=0;for(;++s<r.length&&!(t<r[s][0]););const n=r[s-1][0],a=r[s][0];return U.interpolationRatio(this.interpolation,e,n,a)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let s=0;for(;++s<e.length&&!(t<e[s][0]););return[e[s-1][0],e[s][0]]}static interpolationRatio(t,e,r,s){let a=0;if("linear"===t[0])a=U._exponentialInterpolationRatio(e,1,r,s);else if("exponential"===t[0])a=U._exponentialInterpolationRatio(e,t[1],r,s);else if("cubic-bezier"===t[0]){a=n(t[1],t[2],t[3],t[4])(U._exponentialInterpolationRatio(e,1,r,s),1e-5)}return a<0?a=0:a>1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,s){const n=s-r;if(0===n)return 0;const a=t-r;return 1===e?a/n:(e**a-1)/(e**n-1)}}class B{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=ht(t[1],e,i);let s;const n=[];n.push([-1/0,ht(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(n.length&&n[n.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const o=ht(t[a+1],e);s||(s=o.type),n.push([r,o])}return new B(s,r,n)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let n=0;for(;++n<r.length&&!(s<r[n][0]););return this._stops[n-1][1].evaluate(t,e)}}class S{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const s=new y(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error(`"let" requires a string to define variable names - found ${r}`);s.add(r,ht(t[a+1],e))}const n=ht(t[t.length-1],s,r);return new S(n.type,n)}evaluate(t,e){return this._output.evaluate(t,e)}}class P{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const s=e.get(t[1]);if(!s)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new P(r||h,s)}evaluate(t,e){return this.output.evaluate(t,e)}}class O{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=ht(t[1],e,i),s=ht(t[2],e);return new O(s.type.itemType,r,s)}evaluate(t,e){const r=this._index.evaluate(t,e),s=this._array.evaluate(t,e);if(r<0||r>=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class T{constructor(t,e){this._key=t,this._obj=e,this.type=h}static parse(t,e){let r,s;switch(t.length){case 2:return r=ht(t[1],e),new T(r);case 3:return r=ht(t[1],e),s=ht(t[2],e),new T(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return this._obj.evaluate(t,e)[r]}return t?.values[r]}}class F{constructor(t,e){this._key=t,this._obj=e,this.type=o}static parse(t,e){let r,s;switch(t.length){case 2:return r=ht(t[1],e),new F(r);case 3:return r=ht(t[1],e),s=ht(t[2],e),new F(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return r in this._obj.evaluate(t,e)}return!!t?.values[r]}}class G{constructor(t,e){this._key=t,this._vals=e,this.type=o}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new G(ht(t[1],e),ht(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class V{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=ht(t[1],e),s=ht(t[2],e);if(4===t.length){const n=ht(t[3],e,i);return new V(r,s,n)}return new V(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const n=this._from.evaluate(t,e);if(n!==Math.floor(n))throw new Error('"index-of" index must be an integer');return s.indexOf(r,n)}return s.indexOf(r)}}class D{constructor(t){this._arg=t,this.type=i}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=ht(t[1],e);return new D(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class H{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=ht(t[1],e),s=ht(t[2],e,i);if(s.type!==i)throw new Error('"slice" index must return a number');if(4===t.length){const n=ht(t[3],e,i);if(n.type!==i)throw new Error('"slice" index must return a number');return new H(r.type,r,s,n)}return new H(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const n=this._to.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');return r.slice(s,n)}return r.slice(s)}}class J{constructor(){this.type=o}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new J}evaluate(t,e){return void 0!==t?.id}}class K{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static parse(t,e,r){const s=t.slice(1).map(t=>ht(t,e));return new K(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r.evaluate(t,e))),this._calculate(r)}}class Q extends K{static parse(t,e){switch(t.length){case 2:return K.parse(t,e,t=>-t[0]);case 3:return K.parse(t,e,t=>t[0]-t[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class W extends K{static parse(t,e){return K.parse(t,e,t=>{let e=1;for(const r of t)e*=r;return e})}}class X extends K{static parse(t,e){if(3===t.length)return K.parse(t,e,t=>t[0]/t[1]);throw new Error('"/" expects 2 arguments')}}class Y extends K{static parse(t,e){if(3===t.length)return K.parse(t,e,t=>t[0]%t[1]);throw new Error('"%" expects 2 arguments')}}class Z extends K{static parse(t,e){if(3===t.length)return K.parse(t,e,t=>t[0]**t[1]);throw new Error('"^" expects 1 or 2 arguments')}}class tt extends K{static parse(t,e){return K.parse(t,e,t=>{let e=0;for(const r of t)e+=r;return e})}}class et{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static{this.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])}}static parse(t,e){const r=t.slice(1).map(t=>ht(t,e));return new et(r,et.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r.evaluate(t,e))),this._calculate(r)}}class rt{constructor(t){this._args=t,this.type=c}static parse(t,e){return new rt(t.slice(1).map(t=>ht(t,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class st{constructor(t,e){this._arg=t,this._calculate=e,this.type=c}static{this.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()}}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=ht(t[1],e);return new st(r,st.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}class nt{constructor(t){this._args=t,this.type=u}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(t=>ht(t,e));return new nt(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r));return new t({r:s,g:n,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class at{constructor(t){this._args=t,this.type=u}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(t=>ht(t,e));return new at(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r)),o=this._validateAlpha(this._args[3].evaluate(e,r));return new t({r:s,g:n,b:a,a:o})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class ot{constructor(t){this._color=t,this.type=l(i,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=ht(t[1],e);return new ot(r)}evaluate(e,r){return new t(this._color.evaluate(e,r)).toRgba()}}class it{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,n=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":s=c;break;case"number":s=i;break;case"boolean":s=o;break;default:throw new Error('"array" type argument must be string, number or boolean')}n++}else s=h;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');n++}s=l(s,e)}else switch(r){case"string":s=c;break;case"number":s=i;break;case"boolean":s=o;break;case"object":s=g}const a=[];for(;n<t.length;n++){const r=ht(t[n],e);a.push(r)}return new it(s,a)}evaluate(t,e){let r;for(const s of this._args){const n=s.evaluate(t,e);if(r=f(n),m(r,this.type))return n}throw new Error(`Expected ${p(this.type)} but got ${p(r)}`)}}class lt{static{this.types={"to-boolean":o,"to-color":u,"to-number":i,"to-string":c}}constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],s=lt.types[r];if(s===o||s===c){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const n=[];for(let a=1;a<t.length;a++){const r=ht(t[a],e);n.push(r)}return new lt(s,n)}evaluate(e,r){if(this.type===o)return Boolean(this._args[0].evaluate(e,r));if(this.type===c)return w(this._args[0].evaluate(e,r));if(this.type===i){for(const t of this._args){const s=Number(t.evaluate(e,r));if(!isNaN(s))return s}return null}if(this.type===u){for(const s of this._args)try{const n=lt.toColor(s.evaluate(e,r));if(n instanceof t)return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return w(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(e){if(e instanceof t)return e;if("string"==typeof e){const r=t.fromString(e);if(r)return r;throw new Error(`"${e}" is not a color`)}if(Array.isArray(e))return t.fromArray(e);throw new Error(`"${e}" is not a color`)}}class ut{constructor(t){this._val=t,this.type=f(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new ut(t[1])}evaluate(t,e){return this._val}}class ct{constructor(t){this._arg=t,this.type=c}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new ct(ht(t[1],e))}evaluate(t,e){return p(f(this._arg.evaluate(t,e)))}}function ht(t,e,r){const s=typeof t;if("string"===s||"boolean"===s||"number"===s||null===t){if(r)switch(r.kind){case"string":"string"!==s&&(t=lt.toString(t));break;case"number":"number"!==s&&(t=lt.toNumber(t));break;case"color":t=lt.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const n=t[0];if("string"!=typeof n)throw new Error("First element of expression must be a string");const a=pt[n];if(void 0===a)throw new Error(`Invalid expression operator "${n}"`);if(!a)throw new Error(`Unimplemented expression operator "${n}"`);return a.parse(t,e,r)}const pt={array:it,boolean:it,collator:null,format:null,image:null,literal:ut,number:it,"number-format":null,object:it,string:it,"to-boolean":lt,"to-color":lt,"to-number":lt,"to-string":lt,typeof:ct,accumulated:null,"feature-state":null,"geometry-type":v,id:_,"line-progress":null,properties:b,at:O,get:T,has:F,in:G,"index-of":V,length:D,slice:H,"!":q,"!=":$,"<":M,"<=":k,"==":E,">":A,">=":j,all:N,any:R,case:z,coalesce:I,match:L,within:null,interpolate:U,"interpolate-hcl":U,"interpolate-lab":U,step:B,let:S,var:P,concat:rt,downcase:st,"is-supported-script":null,"resolved-locale":null,upcase:st,rgb:nt,rgba:at,"to-rgba":ot,"-":Q,"*":W,"/":X,"%":Y,"^":Z,"+":tt,abs:et,acos:et,asin:et,atan:et,ceil:et,cos:et,e:et,floor:et,ln:et,ln2:et,log10:et,log2:et,max:et,min:et,pi:et,round:et,sin:et,sqrt:et,tan:et,zoom:d,"heatmap-density":null,"has-id":J,none:C};export{N as ALL,R as ANY,tt as Add,it as Assert,O as At,et as Calculate,z as Case,I as Coalesce,lt as Coerce,rt as Concat,X as Div,E as EQ,j as GE,A as GT,v as GeomType,T as Get,F as Has,J as HasID,_ as ID,G as In,V as IndexOf,U as Interpolate,k as LE,M as LT,D as Length,S as Let,ut as Literal,L as Match,Y as Mod,W as Mul,$ as NE,C as NONE,q as NOT,Z as Pow,b as Properties,nt as Rgb,at as Rgba,H as Slice,B as Step,st as String,Q as Sub,ot as ToRgba,ct as TypeOf,P as Var,d as Zoom,ht as createExpression,pt as ops};
2
+ import t from"../../../../../Color.js";import{toLCH as e,toRGB as r,toLAB as s}from"../../../../../core/colorUtils.js";import{unitBezier as n}from"../../../unitBezier.js";import{interpolate as a}from"../GeometryUtils.js";import{booleanType as o,numberType as i,arrayType as l,colorType as u,stringType as c,valueType as h,typeToString as p,objectType as g,getType as f,valueToString as w,matchType as m}from"./types.js";class y{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class _{constructor(){this.type=h}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new _}evaluate(t,e){return t?.id}}class v{constructor(){this.type=c}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new v}evaluate(t,e){if(!t)return null;switch(t.type){case 1:return"Point";case 2:return"LineString";case 3:return"Polygon";default:return null}}}class b{constructor(){this.type=g}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new b}evaluate(t,e){return t?.values}}class d{constructor(){this.type=i}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new d}evaluate(t,e){return e}}class x{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=o}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new x(pt(t[1],e),pt(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class E extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t===e)}}class $ extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t!==e)}}class M extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t<e)}}class k extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t<=e)}}class A extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t>e)}}class j extends x{static parse(t,e){return x.parse(t,e,(t,e)=>t>=e)}}class q{constructor(t){this._arg=t,this.type=o}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new q(pt(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class N{constructor(t){this._args=t,this.type=o}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new N(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class R{constructor(t){this._args=t,this.type=o}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new R(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class C{constructor(t){this._args=t,this.type=o}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new C(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class z{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let s;const n=[];for(let o=1;o<t.length-1;o+=2){const a=pt(t[o],e),i=pt(t[o+1],e,r);s||(s=i.type),n.push({condition:a,output:i})}const a=pt(t[t.length-1],e,r);return s||(s=a.type),new z(s,n,a)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class I{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const s=[];for(let n=1;n<t.length;n++){const a=pt(t[n],e);r||(r=a.type),s.push(a)}return new I(r,s)}evaluate(t,e){for(const r of this._args){const s=r.evaluate(t,e);if(null!==s)return s}return null}}class L{constructor(t,e,r,s,n){this.type=t,this._input=e,this._labels=r,this._outputs=s,this._fallback=n}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const s=pt(t[1],e),n=[],a={};let o;for(let i=2;i<t.length-1;i+=2){let s=t[i];Array.isArray(s)||(s=[s]);for(const t of s){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(o){if(e!==o)throw new Error('"match" requires labels to have the same type')}else o=e;a[t]=n.length}const l=pt(t[i+1],e);r||(r=l.type),n.push(l)}return new L(r,s,a,n,pt(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class U{constructor(t,e,r,s,n){this._operator=t,this.type=e,this.interpolation=r,this.input=s,this._stops=n}static parse(t,e,r){const s=t[0];if(t.length<5)throw new Error(`"${s}" expects at least 4 arguments`);const n=t[1];if(!Array.isArray(n)||0===n.length)throw new Error(`"${n}" is not a valid interpolation`);switch(n[0]){case"linear":if(1!==n.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==n.length||"number"!=typeof n[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==n.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=n[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${n[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const a=pt(t[2],e,i);let o;"interpolate-hcl"===s||"interpolate-lab"===s?o=u:r&&"value"!==r.kind&&(o=r);const l=[];for(let i=3;i<t.length;i+=2){const r=t[i];if("number"!=typeof r)throw new Error(`"${s}" requires stop inputs as literal numbers`);if(l.length&&l[l.length-1][0]>=r)throw new Error(`"${s}" requires strictly ascending stop inputs`);const n=pt(t[i+1],e,o);o||(o=n.type),l.push([r,n])}if(o&&o!==u&&o!==i&&("array"!==o.kind||o.itemType!==i))throw new Error(`"${s}" cannot interpolate type ${p(o)}`);return new U(s,o,n,a,l)}evaluate(n,o){const i=this._stops;if(1===i.length)return i[0][1].evaluate(n,o);const l=this.input.evaluate(n,o);if(l<=i[0][0])return i[0][1].evaluate(n,o);if(l>=i[i.length-1][0])return i[i.length-1][1].evaluate(n,o);let u=0;for(;++u<i.length&&!(l<i[u][0]););const c=i[u-1][0],h=i[u][0],g=U.interpolationRatio(this.interpolation,l,c,h),f=i[u-1][1].evaluate(n,o),w=i[u][1].evaluate(n,o);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(f)&&Array.isArray(w))return f.map((t,e)=>a(t,w[e],g));if("color"===this.type.kind&&f instanceof t&&w instanceof t){const e=new t(f),r=new t(w);return new t([a(e.r,r.r,g),a(e.g,r.g,g),a(e.b,r.b,g),a(e.a,r.a,g)])}if("number"===this.type.kind&&"number"==typeof f&&"number"==typeof w)return a(f,w,g);throw new Error(`"${this._operator}" cannot interpolate type ${p(this.type)}`)}if("interpolate-hcl"===this._operator){const s=e(f),n=e(w),o=n.h-s.h,i=r({h:s.h+g*(o>180||o<-180?o-360*Math.round(o/360):o),c:a(s.c,n.c,g),l:a(s.l,n.l,g)});return new t({a:a(f.a,w.a,g),...i})}if("interpolate-lab"===this._operator){const e=s(f),n=s(w),o=r({l:a(e.l,n.l,g),a:a(e.a,n.a,g),b:a(e.b,n.b,g)});return new t({a:a(f.a,w.a,g),...o})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let s=0;for(;++s<r.length&&!(t<r[s][0]););const n=r[s-1][0],a=r[s][0];return U.interpolationRatio(this.interpolation,e,n,a)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let s=0;for(;++s<e.length&&!(t<e[s][0]););return[e[s-1][0],e[s][0]]}static interpolationRatio(t,e,r,s){let a=0;if("linear"===t[0])a=U._exponentialInterpolationRatio(e,1,r,s);else if("exponential"===t[0])a=U._exponentialInterpolationRatio(e,t[1],r,s);else if("cubic-bezier"===t[0]){a=n(t[1],t[2],t[3],t[4])(U._exponentialInterpolationRatio(e,1,r,s),1e-5)}return a<0?a=0:a>1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,s){const n=s-r;if(0===n)return 0;const a=t-r;return 1===e?a/n:(e**a-1)/(e**n-1)}}class B{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=pt(t[1],e,i);let s;const n=[];n.push([-1/0,pt(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(n.length&&n[n.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const o=pt(t[a+1],e);s||(s=o.type),n.push([r,o])}return new B(s,r,n)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let n=0;for(;++n<r.length&&!(s<r[n][0]););return this._stops[n-1][1].evaluate(t,e)}}class S{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const s=new y(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error(`"let" requires a string to define variable names - found ${r}`);s.add(r,pt(t[a+1],e))}const n=pt(t[t.length-1],s,r);return new S(n.type,n)}evaluate(t,e){return this._output.evaluate(t,e)}}class P{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const s=e.get(t[1]);if(!s)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new P(r||h,s)}evaluate(t,e){return this.output.evaluate(t,e)}}class O{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=pt(t[1],e,i),s=pt(t[2],e);return new O(s.type.itemType,r,s)}evaluate(t,e){const r=this._index.evaluate(t,e),s=this._array.evaluate(t,e);if(r<0||r>=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class T{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=t.slice(1).map(t=>Array.isArray(t)?pt(t,e):t);return new T(r)}evaluate(t,e){const r=(t,e)=>Array.from({length:t.length/2},(r,s)=>e(t[2*s],t[2*s+1])),s=(t,e)=>t;let n;return this._args&&(n=this._args.map(r=>r&&r.evaluate?r.evaluate(t,e):r)),!n||n.length<2&&n.length%2==1?"":r(n,s).join()}}class F{constructor(t,e){this._key=t,this._obj=e,this.type=h}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new F(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new F(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return this._obj.evaluate(t,e)[r]}return t?.values[r]}}class G{constructor(t,e){this._key=t,this._obj=e,this.type=o}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new G(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new G(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return r in this._obj.evaluate(t,e)}return!!t?.values[r]}}class V{constructor(t,e){this._key=t,this._vals=e,this.type=o}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new V(pt(t[1],e),pt(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class D{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=pt(t[1],e),s=pt(t[2],e);if(4===t.length){const n=pt(t[3],e,i);return new D(r,s,n)}return new D(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const n=this._from.evaluate(t,e);if(n!==Math.floor(n))throw new Error('"index-of" index must be an integer');return s.indexOf(r,n)}return s.indexOf(r)}}class H{constructor(t){this._arg=t,this.type=i}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=pt(t[1],e);return new H(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class J{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=pt(t[1],e),s=pt(t[2],e,i);if(s.type!==i)throw new Error('"slice" index must return a number');if(4===t.length){const n=pt(t[3],e,i);if(n.type!==i)throw new Error('"slice" index must return a number');return new J(r.type,r,s,n)}return new J(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const n=this._to.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');return r.slice(s,n)}return r.slice(s)}}class K{constructor(){this.type=o}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new K}evaluate(t,e){return void 0!==t?.id}}class Q{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static parse(t,e,r){const s=t.slice(1).map(t=>pt(t,e));return new Q(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r.evaluate(t,e))),this._calculate(r)}}class W extends Q{static parse(t,e){switch(t.length){case 2:return Q.parse(t,e,t=>-t[0]);case 3:return Q.parse(t,e,t=>t[0]-t[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class X extends Q{static parse(t,e){return Q.parse(t,e,t=>{let e=1;for(const r of t)e*=r;return e})}}class Y extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,t=>t[0]/t[1]);throw new Error('"/" expects 2 arguments')}}class Z extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,t=>t[0]%t[1]);throw new Error('"%" expects 2 arguments')}}class tt extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,t=>t[0]**t[1]);throw new Error('"^" expects 1 or 2 arguments')}}class et extends Q{static parse(t,e){return Q.parse(t,e,t=>{let e=0;for(const r of t)e+=r;return e})}}class rt{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static{this.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])}}static parse(t,e){const r=t.slice(1).map(t=>pt(t,e));return new rt(r,rt.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r.evaluate(t,e))),this._calculate(r)}}class st{constructor(t){this._args=t,this.type=c}static parse(t,e){return new st(t.slice(1).map(t=>pt(t,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class nt{constructor(t,e){this._arg=t,this._calculate=e,this.type=c}static{this.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()}}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=pt(t[1],e);return new nt(r,nt.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}class at{constructor(t){this._args=t,this.type=u}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(t=>pt(t,e));return new at(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r));return new t({r:s,g:n,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class ot{constructor(t){this._args=t,this.type=u}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(t=>pt(t,e));return new ot(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r)),o=this._validateAlpha(this._args[3].evaluate(e,r));return new t({r:s,g:n,b:a,a:o})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class it{constructor(t){this._color=t,this.type=l(i,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=pt(t[1],e);return new it(r)}evaluate(e,r){return new t(this._color.evaluate(e,r)).toRgba()}}class lt{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,n=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":s=c;break;case"number":s=i;break;case"boolean":s=o;break;default:throw new Error('"array" type argument must be string, number or boolean')}n++}else s=h;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');n++}s=l(s,e)}else switch(r){case"string":s=c;break;case"number":s=i;break;case"boolean":s=o;break;case"object":s=g}const a=[];for(;n<t.length;n++){const r=pt(t[n],e);a.push(r)}return new lt(s,a)}evaluate(t,e){let r;for(const s of this._args){const n=s.evaluate(t,e);if(r=f(n),m(r,this.type))return n}throw new Error(`Expected ${p(this.type)} but got ${p(r)}`)}}class ut{static{this.types={"to-boolean":o,"to-color":u,"to-number":i,"to-string":c}}constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],s=ut.types[r];if(s===o||s===c){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const n=[];for(let a=1;a<t.length;a++){const r=pt(t[a],e);n.push(r)}return new ut(s,n)}evaluate(e,r){if(this.type===o)return Boolean(this._args[0].evaluate(e,r));if(this.type===c)return w(this._args[0].evaluate(e,r));if(this.type===i){for(const t of this._args){const s=Number(t.evaluate(e,r));if(!isNaN(s))return s}return null}if(this.type===u){for(const s of this._args)try{const n=ut.toColor(s.evaluate(e,r));if(n instanceof t)return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return w(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(e){if(e instanceof t)return e;if("string"==typeof e){const r=t.fromString(e);if(r)return r;throw new Error(`"${e}" is not a color`)}if(Array.isArray(e))return t.fromArray(e);throw new Error(`"${e}" is not a color`)}}class ct{constructor(t){this._val=t,this.type=f(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new ct(t[1])}evaluate(t,e){return this._val}}class ht{constructor(t){this._arg=t,this.type=c}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new ht(pt(t[1],e))}evaluate(t,e){return p(f(this._arg.evaluate(t,e)))}}function pt(t,e,r){const s=typeof t;if("string"===s||"boolean"===s||"number"===s||null===t){if(r)switch(r.kind){case"string":"string"!==s&&(t=ut.toString(t));break;case"number":"number"!==s&&(t=ut.toNumber(t));break;case"color":t=ut.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const n=t[0];if("string"!=typeof n)throw new Error("First element of expression must be a string");const a=gt[n];if(void 0===a)throw new Error(`Invalid expression operator "${n}"`);if(!a)throw new Error(`Unimplemented expression operator "${n}"`);return a.parse(t,e,r)}const gt={array:lt,boolean:lt,collator:null,format:T,image:null,literal:ct,number:lt,"number-format":null,object:lt,string:lt,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,typeof:ht,accumulated:null,"feature-state":null,"geometry-type":v,id:_,"line-progress":null,properties:b,at:O,get:F,has:G,in:V,"index-of":D,length:H,slice:J,"!":q,"!=":$,"<":M,"<=":k,"==":E,">":A,">=":j,all:N,any:R,case:z,coalesce:I,match:L,within:null,interpolate:U,"interpolate-hcl":U,"interpolate-lab":U,step:B,let:S,var:P,concat:st,downcase:nt,"is-supported-script":null,"resolved-locale":null,upcase:nt,rgb:at,rgba:ot,"to-rgba":it,"-":W,"*":X,"/":Y,"%":Z,"^":tt,"+":et,abs:rt,acos:rt,asin:rt,atan:rt,ceil:rt,cos:rt,e:rt,floor:rt,ln:rt,ln2:rt,log10:rt,log2:rt,max:rt,min:rt,pi:rt,round:rt,sin:rt,sqrt:rt,tan:rt,zoom:d,"heatmap-density":null,"has-id":K,none:C};export{N as ALL,R as ANY,et as Add,lt as Assert,O as At,rt as Calculate,z as Case,I as Coalesce,ut as Coerce,st as Concat,Y as Div,E as EQ,T as Format,j as GE,A as GT,v as GeomType,F as Get,G as Has,K as HasID,_ as ID,V as In,D as IndexOf,U as Interpolate,k as LE,M as LT,H as Length,S as Let,ct as Literal,L as Match,Z as Mod,X as Mul,$ as NE,C as NONE,q as NOT,tt as Pow,b as Properties,at as Rgb,ot as Rgba,J as Slice,B as Step,nt as String,W as Sub,it as ToRgba,ht as TypeOf,P as Var,d as Zoom,pt as createExpression,gt as ops};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{i8888to32 as t}from"../../webgl/number.js";import{sortByAlignment as e}from"../../webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js";import{DataType as o}from"../../../../webgl/enums.js";import{fromLayouts as r,fromLayout as n}from"../../../../webgl/VertexAttributeLocations.js";import{VertexElementDescriptor as s}from"../../../../webgl/VertexElementDescriptor.js";class i{constructor(t){this._precisionFactors={},this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._geometryLayout||this._buildMaterialInfo(),this._stride}getAttributeLocations(){return this._geometryLayout||this._buildMaterialInfo(),this._locations}getPrecisionFactors(){return this._precisionFactors||this._buildMaterialInfo(),this._precisionFactors}get geometryLayout(){return this._geometryLayout||this._buildMaterialInfo(),this._geometryLayout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildMaterialInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildMaterialInfo(),this._uniforms}getUsedAttributes(){return this._usedAttributes||this._buildMaterialInfo(),this._usedAttributes}encodeAttributes(t,e,o,r){const n=this.propertyInfos,s=this.getEncodingInfos(),i=[],a=i.length,c=Math.ceil(this._ddStrideInBytes/4);for(let u=0;u<c;u++)i.push(0);for(const u of Object.keys(s)){const c=s[u],{type:h,precisionFactor:y,isLayout:l}=n[u],d=l?o.getLayoutProperty(u):o.getPaintProperty(u),p=d.interpolator?.getInterpolationRange(e);let _=0;for(const o of c){const{offset:n}=o,s=a+Math.floor(n/4),c=r??d.getValue(p?p[_]:e,t),u=y||1;switch(h){case 0:case 1:i[s]|=this._encodeByte(c*u,0);break;case 2:case 3:i[s]|=this._encodeShort(c*u,0);break;case 4:case 5:i[s]|=this._encodeByte(c*u,0),i[s]|=this._encodeByte(c*u,8);break;case 6:case 7:i[s]|=this._encodeShort(c*u,0),i[s]|=this._encodeShort(c*u,16);break;case 8:case 9:i[s]|=this._encodeByte(c*u,0),i[s]|=this._encodeByte(c*u,8),i[s]|=this._encodeByte(c*u,16),i[s]|=this._encodeByte(c*u,24);break;case 10:i[s]=this._encodeColor(c);break;case 11:case 12:this._encodePattern(s,i,c);break;default:throw new Error("Unsupported encoding type")}_++}}return i}getAtributeState(t){let e=0;const o=3+2*t;return e|=this._bit(o),e|=this._bit(o+1)<<1,e}static{this._encodingInfo={0:{dataType:o.BYTE,bytesPerElement:1,count:1,normalized:!1},1:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},2:{dataType:o.SHORT,bytesPerElement:2,count:1,normalized:!1},3:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},4:{dataType:o.BYTE,bytesPerElement:1,count:2,normalized:!1},5:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},6:{dataType:o.SHORT,bytesPerElement:2,count:2,normalized:!1},7:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},8:{dataType:o.BYTE,bytesPerElement:1,count:4,normalized:!1},9:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},10:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},11:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},12:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}}}_getLayoutElementsForPropertyState(t,e,o){const r=o[t],n=r.name,{count:s,dataType:a,normalized:c}=i._encodingInfo[r.type],{attribueIdx:u,precisionFactor:h}=r,y=h||1,l=[{location:u[0],name:n,propertyName:t,count:s,type:a,normalized:c,precisionFactor:y}];if(this._precisionFactors[n]=y,2===e){const e=`${n}To`;l.push({location:u[1],name:e,propertyName:t,count:s,type:a,normalized:c,precisionFactor:y}),this._precisionFactors[e]=y}return l}_buildMaterialInfo(){const t=[];this._propertyEncodingInfo={};const e={},o=this.properties,r=this.propertyInfos;let n=-1;for(const i of o){n++;const o=r[i].name;e[o]=!1,e[`${o}To`]=!1;const s=this.getAtributeState(n);if(0===s||3===s)continue;const a=this._getLayoutElementsForPropertyState(i,s,r);t.push(...a)}for(const i of t)e[i.name]=!0;const s=u(t);this._buildLayout(s),this._buildShaderUniforms(),this._usedAttributes=e}_buildLayout(t){this.opacityLayout?this._locations=r([this.baseGeometryLayout,this.opacityLayout]):this._locations=n(this.baseGeometryLayout);const e=this.baseGeometryLayout;let o=e[0].stride;const i=[];let u=0;for(const r of t)u+=a(r.type)*r.count;o=c(o+u);for(const r of e)i.push(new s(r.name,r.count,r.type,r.offset,o,r.normalized));let h=0;for(const r of t)i.push(new s(r.name,r.count,r.type,e[0].stride+h,o,r.normalized)),void 0===this._propertyEncodingInfo[r.propertyName]&&(this._propertyEncodingInfo[r.propertyName]=[]),this._propertyEncodingInfo[r.propertyName].push({offset:h}),h+=a(r.type)*r.count;this._ddStrideInBytes=h,this._geometryLayout=i;const y=this._locations;for(const r of t)y.set(r.name,r.location);this._stride=o}_buildShaderUniforms(){const t=[],e=this.properties,o=this.propertyInfos;let r=-1;for(const n of e){r++;const{name:e,type:s,isLayout:i}=o[n];switch(this.getAtributeState(r)){case 0:t.push({name:e,getValue:(t,e,o,r)=>{const a=i?t.getLayoutValue(n,e):t.getPaintValue(n,e);switch(s){case 11:{const o=t.getDashKey(a,t.getLayoutValue("line-cap",e)),n=r.getMosaicItemPosition(o,!1);if(null==n)return null;const{tl:s,br:i}=n;return[s[0],i[1],i[0],s[1]]}case 12:{const t=r.getMosaicItemPosition(a,!n.includes("line-"));if(null==t)return null;const{tl:e,br:o}=t;return[e[0],o[1],o[0],e[1]]}case 10:{const t=a[3];return[t*a[0],t*a[1],t*a[2],t]}default:return a}}});break;case 2:{const o=`${e}Mix`;t.push({name:o,getValue:(t,e,o,r)=>(i?t.getLayoutProperty(n):t.getPaintProperty(n)).interpolator.interpolationUniformValue(o,e)})}}}this._uniforms=t}_bit(t){return(this._key&1<<t)>>t}_encodeColor(e){const o=255*e[3];return t(e[0]*o,e[1]*o,e[2]*o,o)}_encodePattern(t,e,o){if(!o?.rect)return;const r=2,n=o.rect,s=o.width,i=o.height;e[t]=this._encodeShort(n.x+r,0),e[t]|=this._encodeShort(n.y+r+i,16),e[t+1]=this._encodeShort(n.x+r+s,0),e[t+1]|=this._encodeShort(n.y+r,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}const a=t=>{switch(t){case o.FLOAT:case o.INT:case o.UNSIGNED_INT:return 4;case o.SHORT:case o.UNSIGNED_SHORT:case o.HALF_FLOAT:return 2;case o.BYTE:case o.UNSIGNED_BYTE:return 1}},c=t=>t+3&-4;function u(t){const o=e(t),r=[];let n=0;for(const e of o)r.push({...e,offset:n}),n+=a(e.type)*e.count;return r}export{i as VTLMaterial};
2
+ import{i8888to32 as t}from"../../webgl/number.js";import{sortByAlignment as e}from"../../webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js";import{DataType as o}from"../../../../webgl/enums.js";import{fromLayouts as r,fromLayout as n}from"../../../../webgl/VertexAttributeLocations.js";import{VertexElementDescriptor as s}from"../../../../webgl/VertexElementDescriptor.js";class i{constructor(t){this._precisionFactors={},this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._geometryLayout||this._buildMaterialInfo(),this._stride}getAttributeLocations(){return this._geometryLayout||this._buildMaterialInfo(),this._locations}getPrecisionFactors(){return this._precisionFactors||this._buildMaterialInfo(),this._precisionFactors}get geometryLayout(){return this._geometryLayout||this._buildMaterialInfo(),this._geometryLayout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildMaterialInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildMaterialInfo(),this._uniforms}getUsedAttributes(){return this._usedAttributes||this._buildMaterialInfo(),this._usedAttributes}encodeAttributes(t,e,o,r){const n=this.propertyInfos,s=this.getEncodingInfos(),i=[],a=i.length,c=Math.ceil(this._ddStrideInBytes/4);for(let l=0;l<c;l++)i.push(0);let u=0,h=null;for(const l of Object.keys(s)){const c=s[l],{type:y,precisionFactor:d,isLayout:p}=n[l];h===y&&32!==u||(u=0,h=y);const _=p?o.getLayoutProperty(l):o.getPaintProperty(l),m=_.interpolator?.getInterpolationRange(e);let f=0;for(const o of c){const{offset:n}=o,s=a+Math.floor(n/4),c=r??_.getValue(m?m[f]:e,t),h=d||1;switch(y){case 0:case 1:i[s]|=this._encodeByte(c*h,0)<<u,u+=8;break;case 2:case 3:i[s]|=this._encodeShort(c*h,0)<<u,u+=16;break;case 4:case 5:{const t=this._encodeByte(c*h,0),e=this._encodeByte(c*h,8);i[s]|=t<<u,i[s]|=e<<u,u+=16}break;case 6:case 7:i[s]|=this._encodeShort(c*h,0),i[s]|=this._encodeShort(c*h,16);break;case 8:case 9:i[s]|=this._encodeByte(c*h,0),i[s]|=this._encodeByte(c*h,8),i[s]|=this._encodeByte(c*h,16),i[s]|=this._encodeByte(c*h,24);break;case 10:i[s]=this._encodeColor(c);break;case 11:case 12:this._encodePattern(s,i,c);break;default:throw new Error("Unsupported encoding type")}f++}}return i}getAtributeState(t){let e=0;const o=3+2*t;return e|=this._bit(o),e|=this._bit(o+1)<<1,e}static{this._encodingInfo={0:{dataType:o.BYTE,bytesPerElement:1,count:1,normalized:!1},1:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},2:{dataType:o.SHORT,bytesPerElement:2,count:1,normalized:!1},3:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},4:{dataType:o.BYTE,bytesPerElement:1,count:2,normalized:!1},5:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},6:{dataType:o.SHORT,bytesPerElement:2,count:2,normalized:!1},7:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},8:{dataType:o.BYTE,bytesPerElement:1,count:4,normalized:!1},9:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},10:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},11:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},12:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}}}_getLayoutElementsForPropertyState(t,e,o){const r=o[t],n=r.name,{count:s,dataType:a,normalized:c}=i._encodingInfo[r.type],{attribueIdx:u,precisionFactor:h}=r,l=h||1,y=[{location:u[0],name:n,propertyName:t,count:s,type:a,normalized:c,precisionFactor:l}];if(this._precisionFactors[n]=l,2===e){const e=`${n}To`;y.push({location:u[1],name:e,propertyName:t,count:s,type:a,normalized:c,precisionFactor:l}),this._precisionFactors[e]=l}return y}_buildMaterialInfo(){const t=[];this._propertyEncodingInfo={};const e={},o=this.properties,r=this.propertyInfos;let n=-1;for(const i of o){n++;const o=r[i].name;e[o]=!1,e[`${o}To`]=!1;const s=this.getAtributeState(n);if(0===s||3===s)continue;const a=this._getLayoutElementsForPropertyState(i,s,r);t.push(...a)}for(const i of t)e[i.name]=!0;const s=u(t);this._buildLayout(s),this._buildShaderUniforms(),this._usedAttributes=e}_buildLayout(t){this.opacityLayout?this._locations=r([this.baseGeometryLayout,this.opacityLayout]):this._locations=n(this.baseGeometryLayout);const e=this.baseGeometryLayout;let o=e[0].stride;const i=[];let u=0;for(const r of t)u+=a(r.type)*r.count;o=c(o+u);for(const r of e)i.push(new s(r.name,r.count,r.type,r.offset,o,r.normalized));let h=0;for(const r of t)i.push(new s(r.name,r.count,r.type,e[0].stride+h,o,r.normalized)),void 0===this._propertyEncodingInfo[r.propertyName]&&(this._propertyEncodingInfo[r.propertyName]=[]),this._propertyEncodingInfo[r.propertyName].push({offset:h}),h+=a(r.type)*r.count;this._ddStrideInBytes=h,this._geometryLayout=i;const l=this._locations;for(const r of t)l.set(r.name,r.location);this._stride=o}_buildShaderUniforms(){const t=[],e=this.properties,o=this.propertyInfos;let r=-1;for(const n of e){r++;const{name:e,type:s,isLayout:i}=o[n];switch(this.getAtributeState(r)){case 0:t.push({name:e,getValue:(t,e,o,r)=>{const a=i?t.getLayoutValue(n,e):t.getPaintValue(n,e);switch(s){case 11:{const o=t.getDashKey(a,t.getLayoutValue("line-cap",e)),n=r.getMosaicItemPosition(o,!1);if(null==n)return null;const{tl:s,br:i}=n;return[s[0],i[1],i[0],s[1]]}case 12:{const t=r.getMosaicItemPosition(a,!n.includes("line-"));if(null==t)return null;const{tl:e,br:o}=t;return[e[0],o[1],o[0],e[1]]}case 10:{const t=a[3];return[t*a[0],t*a[1],t*a[2],t]}default:return a}}});break;case 2:{const o=`${e}Mix`;t.push({name:o,getValue:(t,e,o,r)=>(i?t.getLayoutProperty(n):t.getPaintProperty(n)).interpolator.interpolationUniformValue(o,e)})}}}this._uniforms=t}_bit(t){return(this._key&1<<t)>>t}_encodeColor(e){const o=255*e[3];return t(e[0]*o,e[1]*o,e[2]*o,o)}_encodePattern(t,e,o){if(!o?.rect)return;const r=2,n=o.rect,s=o.width,i=o.height;e[t]=this._encodeShort(n.x+r,0),e[t]|=this._encodeShort(n.y+r+i,16),e[t+1]=this._encodeShort(n.x+r+s,0),e[t+1]|=this._encodeShort(n.y+r,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}const a=t=>{switch(t){case o.FLOAT:case o.INT:case o.UNSIGNED_INT:return 4;case o.SHORT:case o.UNSIGNED_SHORT:case o.HALF_FLOAT:return 2;case o.BYTE:case o.UNSIGNED_BYTE:return 1}},c=t=>t+3&-4;function u(t){const o=e(t),r=[];let n=0;for(const e of o)r.push({...e,offset:n}),n+=a(e.type)*e.count;return r}export{i as VTLMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as r,uniform as p,option as l,define as s,input as n,VertexInput as a,UniformGroup as y,FragmentInput as c}from"../../../GraphShaderModule.js";import{Vec2 as d,Float as v,Mat3 as u,negate as x,Vec3 as h,Vec4 as w,fract as f,mix as m,texture2D as g,pow as T,ceil as M,log2 as b,abs as C,Sampler2D as O}from"../../../graph/glsl.js";class z extends a{}t([r(0,d)],z.prototype,"position",void 0),t([r(1,w)],z.prototype,"color",void 0),t([r(2,v)],z.prototype,"opacity",void 0),t([r(3,w)],z.prototype,"tlbr",void 0),t([r(4,w)],z.prototype,"colorTo",void 0),t([r(5,v)],z.prototype,"opacityTo",void 0);class S extends c{}class F extends y{}t([p(u)],F.prototype,"dvsMat",void 0),t([p(u)],F.prototype,"displayMat",void 0);class L extends y{}t([p(v)],L.prototype,"depth",void 0),t([p(d)],L.prototype,"fillTranslation",void 0);class j extends y{}t([p(d)],j.prototype,"mosaicSize",void 0),t([p(v)],j.prototype,"patternFactor",void 0),t([p(w)],j.prototype,"tlbr",void 0),t([p(O)],j.prototype,"texture",void 0);class B extends y{}t([p(v)],B.prototype,"value",void 0);class R extends y{}t([p(v)],R.prototype,"value",void 0);class G extends y{}t([p(w)],G.prototype,"value",void 0);class P extends y{}t([p(w)],P.prototype,"value",void 0);class V extends e{constructor(){super(...arguments),this.type="VTLShaderFill"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t));let e=new d(0),i=this.getTLBR(t);if(1===this.fillType){const{mosaicSize:o,patternFactor:r}=this.patternOptions,p=k(i.z.subtract(i.x)),l=k(i.w.subtract(i.y)),s=new v(1).divide(p.multiply(r)),n=new v(1).divide(l.multiply(r));e=new u(s,new v(0),new v(0),new v(0),x(n),new v(0),new v(0),new v(0),new v(1)).multiply(new h(t.position,new v(1))).xy,i=i.divide(o.xyxy)}const r=this.transform.dvsMat.multiply(new h(t.position,1)).add(this.transform.displayMat.multiply(new h(this.config.fillTranslation,0)));return{glPosition:new w(r.xy,this.config.depth,1),color:o,tlbr:i,tileTextureCoord:e}}fragment(t){const o=new i;if(1===this.fillType){const{tlbr:e,tileTextureCoord:i}=t,{texture:r}=this.patternOptions,p=f(i),l=m(e.xy,e.zw,p),s=g(r,l);o.fragColor=t.color.a.multiply(s)}else o.fragColor=t.color;return o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?m(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new w(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?m(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getTLBR(t){return t.tlbr?t.tlbr:this.patternOptions?.tlbr||new w(0)}}function k(t){return T(new v(2),M(b(C(t))))}t([p(F)],V.prototype,"transform",void 0),t([p(L)],V.prototype,"config",void 0),t([l(j)],V.prototype,"patternOptions",void 0),t([l(B)],V.prototype,"opacity",void 0),t([l(R)],V.prototype,"opacityMix",void 0),t([l(G)],V.prototype,"color",void 0),t([l(P)],V.prototype,"colorMix",void 0),t([s],V.prototype,"fillType",void 0),t([o(0,n(z))],V.prototype,"vertex",null),t([o(0,n(S))],V.prototype,"fragment",null);export{V as VTLShaderFill};
2
+ import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as r,uniform as p,option as l,define as s,input as n,VertexInput as a,UniformGroup as y,FragmentInput as c}from"../../../GraphShaderModule.js";import{Vec2 as d,Float as v,Mat3 as u,negate as x,Vec3 as h,Vec4 as w,fract as f,mix as m,texture2D as g,pow as T,ceil as M,log2 as b,abs as C,Sampler2D as O}from"../../../graph/glsl.js";class z extends a{}t([r(0,d)],z.prototype,"position",void 0),t([r(1,w)],z.prototype,"color",void 0),t([r(2,v)],z.prototype,"opacity",void 0),t([r(3,w)],z.prototype,"tlbr",void 0),t([r(4,w)],z.prototype,"colorTo",void 0),t([r(5,v)],z.prototype,"opacityTo",void 0);class S extends c{}class F extends y{}t([p(u)],F.prototype,"dvsMat",void 0),t([p(u)],F.prototype,"displayMat",void 0);class L extends y{}t([p(v)],L.prototype,"depth",void 0),t([p(d)],L.prototype,"fillTranslation",void 0);class j extends y{}t([p(d)],j.prototype,"mosaicSize",void 0),t([p(v)],j.prototype,"patternFactor",void 0),t([p(w)],j.prototype,"tlbr",void 0),t([p(O)],j.prototype,"texture",void 0);class B extends y{}t([p(v)],B.prototype,"value",void 0);class R extends y{}t([p(v)],R.prototype,"value",void 0);class G extends y{}t([p(w)],G.prototype,"value",void 0);class P extends y{}t([p(v)],P.prototype,"value",void 0);class V extends e{constructor(){super(...arguments),this.type="VTLShaderFill"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t));let e=new d(0),i=this.getTLBR(t);if(1===this.fillType){const{mosaicSize:o,patternFactor:r}=this.patternOptions,p=k(i.z.subtract(i.x)),l=k(i.w.subtract(i.y)),s=new v(1).divide(p.multiply(r)),n=new v(1).divide(l.multiply(r));e=new u(s,new v(0),new v(0),new v(0),x(n),new v(0),new v(0),new v(0),new v(1)).multiply(new h(t.position,new v(1))).xy,i=i.divide(o.xyxy)}const r=this.transform.dvsMat.multiply(new h(t.position,1)).add(this.transform.displayMat.multiply(new h(this.config.fillTranslation,0)));return{glPosition:new w(r.xy,this.config.depth,1),color:o,tlbr:i,tileTextureCoord:e}}fragment(t){const o=new i;if(1===this.fillType){const{tlbr:e,tileTextureCoord:i}=t,{texture:r}=this.patternOptions,p=f(i),l=m(e.xy,e.zw,p),s=g(r,l);o.fragColor=t.color.a.multiply(s)}else o.fragColor=t.color;return o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?m(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new w(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?m(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getTLBR(t){return t.tlbr?t.tlbr:this.patternOptions?.tlbr||new w(0)}}function k(t){return T(new v(2),M(b(C(t))))}t([p(F)],V.prototype,"transform",void 0),t([p(L)],V.prototype,"config",void 0),t([l(j)],V.prototype,"patternOptions",void 0),t([l(B)],V.prototype,"opacity",void 0),t([l(R)],V.prototype,"opacityMix",void 0),t([l(G)],V.prototype,"color",void 0),t([l(P)],V.prototype,"colorMix",void 0),t([s],V.prototype,"fillType",void 0),t([o(0,n(z))],V.prototype,"vertex",null),t([o(0,n(S))],V.prototype,"fragment",null);export{V as VTLShaderFill};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,define as r,option as a,input as s,FragmentInput as d,VertexInput as y,UniformGroup as n}from"../../../GraphShaderModule.js";import{Vec2 as u,Float as v,Vec3 as c,Vec4 as h,dot as f,length as m,clamp as w,fract as x,mix as b,texture2D as g,Mat3 as T,Sampler2D as M}from"../../../graph/glsl.js";import{rgba2float as z}from"../utils.js";const I=1/31,L=15.5,S=8;class O extends y{}t([l(0,u)],O.prototype,"position",void 0),t([l(1,h)],O.prototype,"extrudeOffset",void 0),t([l(2,h)],O.prototype,"directionNormal",void 0),t([l(3,u)],O.prototype,"accumulatedDistance",void 0),t([l(4,h)],O.prototype,"color",void 0),t([l(5,v)],O.prototype,"width",void 0),t([l(6,v)],O.prototype,"opacity",void 0),t([l(7,v)],O.prototype,"blur",void 0),t([l(8,v)],O.prototype,"offset",void 0),t([l(9,h)],O.prototype,"tlbr",void 0),t([l(10,h)],O.prototype,"colorTo",void 0),t([l(11,v)],O.prototype,"widthTo",void 0),t([l(12,v)],O.prototype,"opacityTo",void 0),t([l(13,v)],O.prototype,"blurTo",void 0),t([l(14,v)],O.prototype,"offsetTo",void 0);class W extends n{}t([p(T)],W.prototype,"displayMat3",void 0),t([p(T)],W.prototype,"displayViewMat3",void 0),t([p(u)],W.prototype,"lineTranslation",void 0),t([p(v)],W.prototype,"depth",void 0),t([p(v)],W.prototype,"antialiasing",void 0);class R extends n{}t([p(u)],R.prototype,"mosaicSize",void 0),t([p(M)],R.prototype,"texture",void 0);class C extends n{}t([p(v)],C.prototype,"zoomFactor",void 0),t([p(T)],C.prototype,"dvsMat3",void 0);class D extends n{}t([p(h)],D.prototype,"value",void 0);class B extends n{}t([p(h)],B.prototype,"value",void 0);class j extends n{}t([p(v)],j.prototype,"value",void 0);class F extends n{}t([p(v)],F.prototype,"value",void 0);class N extends n{}t([p(v)],N.prototype,"value",void 0);class V extends n{}t([p(v)],V.prototype,"value",void 0);class G extends n{}t([p(v)],G.prototype,"value",void 0);class P extends n{}t([p(v)],P.prototype,"value",void 0);class k extends n{}t([p(v)],k.prototype,"value",void 0);class q extends n{}t([p(h)],q.prototype,"value",void 0);class A extends n{}t([p(h)],A.prototype,"value",void 0);class E extends e{constructor(){super(...arguments),this.type="VTLShaderLine"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t)),e=this.getBlur(t).add(this.layerInfo.antialiasing),i=t.directionNormal.zw.multiply(I);let l=this.getTLBR(t);const p=this.getWidth(t);let r=new u(0),a=new v(1);1!==this.lineType&&2!==this.lineType||(r=new u(l.z.subtract(l.x),l.y.subtract(l.w)),l=l.divide(this.page.mosaicSize.xyxy),a=1===this.lineType?p.divide(r.y):p.divide(L).multiply(.5));const s=new v(p.add(this.layerInfo.antialiasing)).multiply(.5),d=t.directionNormal.xy.multiply(I),y=t.extrudeOffset.zw.multiply(I).multiply(this.getOffset(t)),n=s.multiply(I).multiply(t.extrudeOffset.xy),m=new v(S).divide(this.tileInfo.zoomFactor),w=this.tileInfo.dvsMat3.multiply(new c(t.position.add(y.multiply(m)),1)),x=new c(this.layerInfo.displayViewMat3.multiply(new c(n,0))).add(this.layerInfo.displayMat3.multiply(new c(this.layerInfo.lineTranslation,0))),b=w.add(x),g=new h(b.xy,this.layerInfo.depth,1);let T=new v(0);return 1!==this.lineType&&2!==this.lineType||(T=t.accumulatedDistance.x.multiply(this.tileInfo.zoomFactor.divide(new v(S))).add(f(d,n.add(y)))),{glPosition:g,color:o,tlbr:l,normal:i,patternSize:r,widthRatio:a,halfLineWidth:s,blur:e,accumulatedDistance:T}}fragment(t){const o=new i,e=m(t.normal).multiply(t.halfLineWidth),l=new v(t.halfLineWidth.subtract(e)).divide(t.blur),p=w(l,new v(0),new v(1));if(1===this.lineType){const e=x(t.accumulatedDistance.divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(t.normal.y.multiply(t.halfLineWidth.divide(t.patternSize.y.multiply(t.widthRatio)))),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=g(this.page.texture,l);o.fragColor=r.multiply(p).multiply(t.color.a)}else if(2===this.lineType){const e=x(t.accumulatedDistance.multiply(.5).divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(new v(.25).multiply(t.normal.y)),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=z(g(this.page.texture,l)).subtract(new v(.5)).multiply(t.halfLineWidth.add(this.layerInfo.antialiasing.multiply(.5)));o.fragColor=p.multiply(w(new v(.5).subtract(r),new v(0),new v(1))).multiply(t.color)}else o.fragColor=t.color.multiply(p);return o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?b(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new h(0)}getWidth(t){return this.widthMix?.value&&t.width&&t.widthTo?b(t.width,t.widthTo,this.widthMix.value):t.width?t.width:this.width?.value||new v(0)}getBlur(t){return this.blurMix?.value&&t.blur&&t.blurTo?b(t.blur,t.blurTo,this.blurMix.value):t.blur?t.blur:this.blur?.value||new v(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?b(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getOffset(t){return this.offsetMix?.value&&t.offset&&t.offsetTo?b(t.offset,t.offsetTo,this.offsetMix.value):t.offset?t.offset:this.offset?.value||new v(0)}getTLBR(t){return t.tlbr?t.tlbr:this.tlbr?.value||new h(0)}}t([r],E.prototype,"lineType",void 0),t([p(W)],E.prototype,"layerInfo",void 0),t([p(C)],E.prototype,"tileInfo",void 0),t([a(R)],E.prototype,"page",void 0),t([a(D)],E.prototype,"color",void 0),t([a(D)],E.prototype,"colorMix",void 0),t([a(j)],E.prototype,"width",void 0),t([a(F)],E.prototype,"widthMix",void 0),t([a(N)],E.prototype,"opacity",void 0),t([a(V)],E.prototype,"opacityMix",void 0),t([a(G)],E.prototype,"blur",void 0),t([a(P)],E.prototype,"blurMix",void 0),t([a(k)],E.prototype,"offset",void 0),t([a(q)],E.prototype,"offsetMix",void 0),t([a(A)],E.prototype,"tlbr",void 0),t([o(0,s(O))],E.prototype,"vertex",null),t([o(0,s(d))],E.prototype,"fragment",null);export{E as VTLShaderLine};
2
+ import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,define as r,option as a,input as s,FragmentInput as d,VertexInput as y,UniformGroup as n}from"../../../GraphShaderModule.js";import{Vec2 as u,Float as v,Vec3 as c,Vec4 as h,dot as f,length as m,clamp as w,fract as x,mix as b,texture2D as g,Mat3 as T,Sampler2D as M}from"../../../graph/glsl.js";import{rgba2float as z}from"../utils.js";const I=1/31,L=15.5,S=8;class O extends y{}t([l(0,u)],O.prototype,"position",void 0),t([l(1,h)],O.prototype,"extrudeOffset",void 0),t([l(2,h)],O.prototype,"directionNormal",void 0),t([l(3,u)],O.prototype,"accumulatedDistance",void 0),t([l(4,h)],O.prototype,"color",void 0),t([l(5,v)],O.prototype,"width",void 0),t([l(6,v)],O.prototype,"opacity",void 0),t([l(7,v)],O.prototype,"blur",void 0),t([l(8,v)],O.prototype,"offset",void 0),t([l(9,h)],O.prototype,"tlbr",void 0),t([l(10,h)],O.prototype,"colorTo",void 0),t([l(11,v)],O.prototype,"widthTo",void 0),t([l(12,v)],O.prototype,"opacityTo",void 0),t([l(13,v)],O.prototype,"blurTo",void 0),t([l(14,v)],O.prototype,"offsetTo",void 0);class W extends n{}t([p(T)],W.prototype,"displayMat3",void 0),t([p(T)],W.prototype,"displayViewMat3",void 0),t([p(u)],W.prototype,"lineTranslation",void 0),t([p(v)],W.prototype,"depth",void 0),t([p(v)],W.prototype,"antialiasing",void 0);class R extends n{}t([p(u)],R.prototype,"mosaicSize",void 0),t([p(M)],R.prototype,"texture",void 0);class C extends n{}t([p(v)],C.prototype,"zoomFactor",void 0),t([p(T)],C.prototype,"dvsMat3",void 0);class D extends n{}t([p(h)],D.prototype,"value",void 0);class B extends n{}t([p(v)],B.prototype,"value",void 0);class j extends n{}t([p(v)],j.prototype,"value",void 0);class F extends n{}t([p(v)],F.prototype,"value",void 0);class N extends n{}t([p(v)],N.prototype,"value",void 0);class V extends n{}t([p(v)],V.prototype,"value",void 0);class G extends n{}t([p(v)],G.prototype,"value",void 0);class P extends n{}t([p(v)],P.prototype,"value",void 0);class k extends n{}t([p(v)],k.prototype,"value",void 0);class q extends n{}t([p(v)],q.prototype,"value",void 0);class A extends n{}t([p(h)],A.prototype,"value",void 0);class E extends e{constructor(){super(...arguments),this.type="VTLShaderLine"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t)),e=this.getBlur(t).add(this.layerInfo.antialiasing),i=t.directionNormal.zw.multiply(I);let l=this.getTLBR(t);const p=this.getWidth(t);let r=new u(0),a=new v(1);1!==this.lineType&&2!==this.lineType||(r=new u(l.z.subtract(l.x),l.y.subtract(l.w)),l=l.divide(this.page.mosaicSize.xyxy),a=1===this.lineType?p.divide(r.y):p.divide(L).multiply(.5));const s=new v(p.add(this.layerInfo.antialiasing)).multiply(.5),d=t.directionNormal.xy.multiply(I),y=t.extrudeOffset.zw.multiply(I).multiply(this.getOffset(t)),n=s.multiply(I).multiply(t.extrudeOffset.xy),m=new v(S).divide(this.tileInfo.zoomFactor),w=this.tileInfo.dvsMat3.multiply(new c(t.position.add(y.multiply(m)),1)),x=new c(this.layerInfo.displayViewMat3.multiply(new c(n,0))).add(this.layerInfo.displayMat3.multiply(new c(this.layerInfo.lineTranslation,0))),b=w.add(x),g=new h(b.xy,this.layerInfo.depth,1);let T=new v(0);return 1!==this.lineType&&2!==this.lineType||(T=t.accumulatedDistance.x.multiply(this.tileInfo.zoomFactor.divide(new v(S))).add(f(d,n.add(y)))),{glPosition:g,color:o,tlbr:l,normal:i,patternSize:r,widthRatio:a,halfLineWidth:s,blur:e,accumulatedDistance:T}}fragment(t){const o=new i,e=m(t.normal).multiply(t.halfLineWidth),l=new v(t.halfLineWidth.subtract(e)).divide(t.blur),p=w(l,new v(0),new v(1));if(1===this.lineType){const e=x(t.accumulatedDistance.divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(t.normal.y.multiply(t.halfLineWidth.divide(t.patternSize.y.multiply(t.widthRatio)))),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=g(this.page.texture,l);o.fragColor=r.multiply(p).multiply(t.color.a)}else if(2===this.lineType){const e=x(t.accumulatedDistance.multiply(.5).divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(new v(.25).multiply(t.normal.y)),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=z(g(this.page.texture,l)).subtract(new v(.5)).multiply(t.halfLineWidth.add(this.layerInfo.antialiasing.multiply(.5)));o.fragColor=p.multiply(w(new v(.5).subtract(r),new v(0),new v(1))).multiply(t.color)}else o.fragColor=t.color.multiply(p);return o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?b(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new h(0)}getWidth(t){return this.widthMix?.value&&t.width&&t.widthTo?b(t.width,t.widthTo,this.widthMix.value):t.width?t.width:this.width?.value||new v(0)}getBlur(t){return this.blurMix?.value&&t.blur&&t.blurTo?b(t.blur,t.blurTo,this.blurMix.value):t.blur?t.blur:this.blur?.value||new v(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?b(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getOffset(t){return this.offsetMix?.value&&t.offset&&t.offsetTo?b(t.offset,t.offsetTo,this.offsetMix.value):t.offset?t.offset:this.offset?.value||new v(0)}getTLBR(t){return t.tlbr?t.tlbr:this.tlbr?.value||new h(0)}}t([r],E.prototype,"lineType",void 0),t([p(W)],E.prototype,"layerInfo",void 0),t([p(C)],E.prototype,"tileInfo",void 0),t([a(R)],E.prototype,"page",void 0),t([a(D)],E.prototype,"color",void 0),t([a(B)],E.prototype,"colorMix",void 0),t([a(j)],E.prototype,"width",void 0),t([a(F)],E.prototype,"widthMix",void 0),t([a(N)],E.prototype,"opacity",void 0),t([a(V)],E.prototype,"opacityMix",void 0),t([a(G)],E.prototype,"blur",void 0),t([a(P)],E.prototype,"blurMix",void 0),t([a(k)],E.prototype,"offset",void 0),t([a(q)],E.prototype,"offsetMix",void 0),t([a(A)],E.prototype,"tlbr",void 0),t([o(0,s(O))],E.prototype,"vertex",null),t([o(0,s(d))],E.prototype,"fragment",null);export{E as VTLShaderLine};