@arcgis/core 4.34.0-next.88 → 4.34.0-next.89

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 (227) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/arcade/Dictionary.js +1 -1
  3. package/arcade/Feature.js +1 -1
  4. package/arcade/Pixel.js +1 -1
  5. package/arcade/Voxel.js +1 -1
  6. package/arcade/containerUtils.js +1 -1
  7. package/arcade/featureSetUtils.js +1 -1
  8. package/arcade/featureset/actions/GroupBy.js +1 -1
  9. package/arcade/featureset/actions/OrderBy.js +1 -1
  10. package/arcade/featureset/support/FeatureSet.js +1 -1
  11. package/arcade/functions/date.js +1 -1
  12. package/arcade/functions/feature.js +1 -1
  13. package/arcade/functions/featuresetbase.js +1 -1
  14. package/arcade/functions/featuresetstats.js +1 -1
  15. package/arcade/functions/featuresetstring.js +1 -1
  16. package/arcade/functions/fieldStats.js +1 -1
  17. package/arcade/functions/geometry.js +1 -1
  18. package/arcade/functions/maths.js +1 -1
  19. package/arcade/functions/string.js +1 -1
  20. package/arcade/languageUtils.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/{ed8863c3d334f438b625.js → 0037abf0a82d1ed32e91.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d7fc8ea2ff527a09f4b9.js → 0296ebe8e37e30af771c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{39a1f361bb69073af765.js → 04dbdaa63c950f32b8f0.js} +1 -1
  25. package/assets/esri/core/workers/chunks/05aac984cbbadb5f6aa0.js +1 -0
  26. package/assets/esri/core/workers/chunks/0fadd1defbb6743dacdc.js +1 -0
  27. package/assets/esri/core/workers/chunks/{0f05425954578ac796ec.js → 135142f3cbfaf24949bc.js} +1 -1
  28. package/assets/esri/core/workers/chunks/2b2f1fcd50dea017d891.js +1 -0
  29. package/assets/esri/core/workers/chunks/{9ca55d33ae4bf25e8edd.js → 2e1cc11462846febb3b2.js} +1 -1
  30. package/assets/esri/core/workers/chunks/300b96f0f8e34b4a5d8b.js +1 -0
  31. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +1 -0
  32. package/assets/esri/core/workers/chunks/{2dc88379ee94fabdaf52.js → 39a5863355cccaabd2d6.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{f3ee035fa7bf638c8e60.js → 3d68a650a1f944ec5171.js} +1 -1
  34. package/assets/esri/core/workers/chunks/47c0c16c1e995a441ec2.js +1 -0
  35. package/assets/esri/core/workers/chunks/48913b944c28343816ac.js +1 -0
  36. package/assets/esri/core/workers/chunks/{4d4db6854aff7656f6e1.js → 4dd4b19c410026233999.js} +1 -1
  37. package/assets/esri/core/workers/chunks/52121179d4f9833008ec.js +1 -0
  38. package/assets/esri/core/workers/chunks/58e2652810143f509fe1.js +1 -0
  39. package/assets/esri/core/workers/chunks/{97489bf16a1d327992b2.js → 595593dd03bcfba795c8.js} +11 -16
  40. package/assets/esri/core/workers/chunks/59e27818cb68f0285d54.js +1 -0
  41. package/assets/esri/core/workers/chunks/620a94b54be3ed78350d.js +1 -0
  42. package/assets/esri/core/workers/chunks/6f29951f5a2da068b257.js +1 -0
  43. package/assets/esri/core/workers/chunks/71c6c0b26253c4ca1b68.js +1 -0
  44. package/assets/esri/core/workers/chunks/{1c1b0cc91fe9cb3fec61.js → 71df48968d6cdc736458.js} +1 -1
  45. package/assets/esri/core/workers/chunks/779ee975efebb838b5d6.js +1 -0
  46. package/assets/esri/core/workers/chunks/7a240ab31d9ff2d2c5af.js +1 -0
  47. package/assets/esri/core/workers/chunks/834985ec601623df34a1.js +1 -0
  48. package/assets/esri/core/workers/chunks/{5dee8c0c60ced791e57f.js → 84a556dafd583635ad5e.js} +1 -1
  49. package/assets/esri/core/workers/chunks/8be9fa12e854a83062c3.js +1 -0
  50. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +1 -0
  51. package/assets/esri/core/workers/chunks/{65ec21d29e8563fdbc55.js → 94c9d3094c93f7760433.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{177840d5f0076c0de46b.js → 96de78f9994207aa7201.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{366db86914a63e6d0c68.js → 978ffde9ebebf5c83aea.js} +1 -1
  54. package/assets/esri/core/workers/chunks/a1abe9865d66789bd5af.js +1 -0
  55. package/assets/esri/core/workers/chunks/{257fd65786feb5951b90.js → a96e58ed9a4a2329ee53.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{0074f1836d7ff69ff6ec.js → aa778e5d7db40d9b9b4a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{c78de6dd6c10280cee69.js → baa48614d9567d5f240d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/c3010d783506f8410f99.js +1 -0
  59. package/assets/esri/core/workers/chunks/c55c096669677321a227.js +1 -0
  60. package/assets/esri/core/workers/chunks/c86ca87959f04075e834.js +1 -0
  61. package/assets/esri/core/workers/chunks/c954d281038f6bf80232.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a48f980c1531805db73b.js → d1fc2c6e95fe2572d297.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{fc5ac54aab66562c8463.js → d51aabb9b950f49df183.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{639d856cd217914dfe1f.js → de34c21d3e6913befe5a.js} +1 -1
  65. package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +1 -0
  66. package/assets/esri/core/workers/chunks/f6806780ca2aa591475a.js +1 -0
  67. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -0
  68. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -0
  69. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -0
  70. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -0
  71. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -0
  72. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -0
  73. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -0
  74. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -0
  75. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -0
  76. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -0
  77. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -0
  78. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -0
  79. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -0
  80. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -0
  81. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -0
  82. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -0
  83. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -0
  84. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -0
  85. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -0
  86. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -0
  87. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -0
  88. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -0
  89. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -0
  90. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -0
  91. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -0
  92. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -0
  93. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -0
  94. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -0
  95. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -0
  96. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -0
  97. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -0
  98. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -0
  99. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -0
  100. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -0
  101. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -0
  102. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -0
  103. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -0
  104. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -0
  105. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -0
  106. package/chunks/ComponentShader.glsl.js +15 -16
  107. package/chunks/DefaultMaterial.glsl.js +15 -16
  108. package/chunks/Path.glsl.js +12 -12
  109. package/chunks/RealisticTree.glsl.js +5 -6
  110. package/chunks/aiServices.js +1 -1
  111. package/chunks/array.js +1 -1
  112. package/chunks/languageUtils.js +1 -1
  113. package/config.js +1 -1
  114. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  115. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  116. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  117. package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
  118. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  119. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  120. package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
  121. package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
  122. package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
  123. package/editing/sharedTemplates/templateDefinitions/parts/TemplatePartBase.js +1 -1
  124. package/interfaces.d.ts +40 -25
  125. package/kernel.js +1 -1
  126. package/layers/CSVLayer.js +1 -1
  127. package/layers/FeatureLayer.js +1 -1
  128. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  129. package/layers/OrientedImageryLayer.js +1 -1
  130. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  131. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  132. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  133. package/layers/support/DateTimeFieldFormat.js +1 -1
  134. package/layers/support/FieldConfiguration.js +1 -1
  135. package/layers/support/FieldFormat.js +1 -1
  136. package/layers/support/NumberFieldFormat.js +1 -1
  137. package/layers/support/Sublayer.js +1 -1
  138. package/layers/support/capabilities.js +1 -1
  139. package/layers/support/fieldConfigUtils.js +1 -1
  140. package/layers/support/fieldFormatUtils.js +5 -0
  141. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  142. package/layers/support/vectorTileLayerLoader.js +1 -1
  143. package/package.json +1 -1
  144. package/popup/FieldInfo.js +1 -1
  145. package/popup/content/FieldsContent.js +1 -1
  146. package/portal/Portal.js +1 -1
  147. package/portal/schemas/definitions.js +1 -1
  148. package/rest/sharedTemplates/addSharedTemplates.js +5 -0
  149. package/rest/sharedTemplates/querySharedTemplates.js +1 -1
  150. package/rest/sharedTemplates/utils.js +5 -0
  151. package/support/ArcadeExpression.js +1 -1
  152. package/support/revision.js +1 -1
  153. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  154. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
  155. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  156. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  157. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  158. package/views/3d/environment/CloudsComposition.js +1 -1
  159. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  160. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  161. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  162. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +5 -0
  163. package/views/3d/layers/I3SMeshView3D.js +1 -1
  164. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  165. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  167. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  169. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  170. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  171. package/views/3d/state/ViewState.js +1 -1
  172. package/views/3d/state/ViewStateManager.js +1 -1
  173. package/views/3d/support/ResourceController.js +1 -1
  174. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  175. package/views/3d/support/orientedBoundingBox.js +1 -1
  176. package/views/3d/terrain/TerrainRenderer.js +1 -1
  177. package/views/3d/webgl/RenderNode.js +1 -1
  178. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  179. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  180. package/views/3d/webgl-engine/collections/Component/{ComponentObjectElevationAgnosticComponentBVH.js → ComponentObjectElevationAgnosticBVH.js} +1 -1
  181. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +5 -0
  182. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  183. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  184. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  185. package/views/3d/webgl-engine/collections/Component/ObjectParameters.js +1 -1
  186. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  187. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  188. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  189. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +0 -3
  190. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  191. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  192. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  194. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  195. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  196. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  197. package/views/GroundView.js +1 -1
  198. package/views/interactive/dragEventPipeline.js +1 -1
  199. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  200. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  201. package/views/support/Scheduler.js +1 -1
  202. package/widgets/ScaleRangeSlider.js +1 -1
  203. package/assets/esri/core/workers/chunks/09c2004126f4a5242b85.js +0 -1
  204. package/assets/esri/core/workers/chunks/0dfc2ca36014910457ef.js +0 -1
  205. package/assets/esri/core/workers/chunks/1c7fffb496af6f2540dd.js +0 -1
  206. package/assets/esri/core/workers/chunks/1fc6311d4f0d27e88737.js +0 -1
  207. package/assets/esri/core/workers/chunks/2fe96bf7dedef11a3b63.js +0 -1
  208. package/assets/esri/core/workers/chunks/36a006c55766f9540bfc.js +0 -1
  209. package/assets/esri/core/workers/chunks/5f0a50ebd2a08b9b9de2.js +0 -1
  210. package/assets/esri/core/workers/chunks/637a5293e36f4f7f2853.js +0 -1
  211. package/assets/esri/core/workers/chunks/7540b34e743a23e67729.js +0 -1
  212. package/assets/esri/core/workers/chunks/7be11a3ef1f49245089f.js +0 -1
  213. package/assets/esri/core/workers/chunks/819a8bc1f0a694017ee6.js +0 -1
  214. package/assets/esri/core/workers/chunks/88d8ff0140f5ea97c6b7.js +0 -1
  215. package/assets/esri/core/workers/chunks/8de11aab65d91e7f1a4d.js +0 -1
  216. package/assets/esri/core/workers/chunks/96740c75ad65d651cc43.js +0 -1
  217. package/assets/esri/core/workers/chunks/9971de3f38a55735cec9.js +0 -1
  218. package/assets/esri/core/workers/chunks/9e47f680b66320dcfd34.js +0 -1
  219. package/assets/esri/core/workers/chunks/a7fcb60d5a9d2d9560e4.js +0 -1
  220. package/assets/esri/core/workers/chunks/a9e133166e9200fe135e.js +0 -1
  221. package/assets/esri/core/workers/chunks/aa84775399420e35c6a5.js +0 -1
  222. package/assets/esri/core/workers/chunks/acb1c5dd987c801d7b31.js +0 -1
  223. package/assets/esri/core/workers/chunks/b0508c96338d7cf296c1.js +0 -1
  224. package/assets/esri/core/workers/chunks/b09b34f64a6bc2b49e0a.js +0 -1
  225. package/assets/esri/core/workers/chunks/c0ae186620b68d43b338.js +0 -1
  226. package/assets/esri/core/workers/chunks/cc579c94438f48a0dbab.js +0 -1
  227. package/assets/esri/core/workers/chunks/ce0bf0d0cd9e9a90093b.js +0 -1
@@ -0,0 +1 @@
1
+ {"labels":{"cut":"Đ_Cut: {volume}______________ớ","fill":"Đ_Fill: {volume}_______________ớ"}}
@@ -0,0 +1 @@
1
+ {"labels":{"cut":"试_Cut: {volume}______________验","fill":"试_Fill: {volume}_______________验"}}
@@ -0,0 +1 @@
1
+ {"labels":{"cut":"試_Cut: {volume}______________驗","fill":"試_Fill: {volume}_______________驗"}}
@@ -0,0 +1 @@
1
+ {"labels":{"cut":"試_Cut: {volume}______________驗","fill":"試_Fill: {volume}_______________驗"}}
@@ -2,12 +2,12 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r,mars as o,moon as a}from"../geometry/support/Ellipsoid.js";import{ComponentData as i}from"../views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js";import{ForwardLinearDepthToWriteShadowMap as l}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColorOrColorEmission as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePass as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{TextureCoordinateAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VertexPosition as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js";import{OutputDepth as c}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as v}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as u}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{ReadDepth as h}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{computeFragmentNormals as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import{ComputeMaterialColor as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import{ComputeNormalTexture as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateSceneLighting as f,addLightingGlobalFactor as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y,addMainLightDirection as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRenderingParameters as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadBaseColorTexture as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import{ReadShadowMapPass as S}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{OverlayIM as N}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{DiscardOrAdjustAlphaDraw as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{If as T,glsl as D}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as M}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{SnowCover as A}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{outputColorHighlightOID as W}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{sphereDepthInterpolate as P}from"../views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js";import{ShaderBuilder as R}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as z}from"../webscene/support/AlphaCutoff.js";function F(F){const B=new R,{vertex:_,fragment:I}=B;B.include(m,F),B.include(g,F),B.include(s,F),B.include(d,F),B.include(i,F),B.include(O,F),I.include(n,F),B.include(j,F),B.include($,F);const{output:E,pbrMode:H,hasNormalTexture:V,snowCover:G,receiveShadows:k,shadeNormals:U,spherical:q,ellipsoidMode:J,overlayEnabled:K,componentData:Q,vertexDiscardMode:X,hasGlow:Y,renderOccluded:Z}=F,ee=1===H||2===H;ee&&(B.include(L,F),V&&B.include(b,F));const re=4===E||5===E||6===E,oe=re&&1===Q,ae=1===J,ie=1===J?r.radius:ae?o.radius:a.radius;K&&(B.include(f,F),B.include(N,F),_.code.add(`\n ${T(q,`const float invRadius = ${D.float(1/ie)};`)}\n vec2 projectOverlay(vec3 pos) { return pos.xy ${T(q,"/ (1.0 + invRadius * pos.z);")}; }`));const le=K&&t(E)&&4===H;le&&(B.varyings.add("tbnTangent","vec3"),B.varyings.add("tbnBiTangent","vec3"),B.varyings.add("groundNormal","vec3"));const te=0===X,ne=2===X,de=1-1/255;if(B.include(S,F),B.include(l,F),_.main.add(D`
5
+ import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r,mars as o,moon as a}from"../geometry/support/Ellipsoid.js";import{ComponentData as i}from"../views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js";import{ForwardLinearDepthToWriteShadowMap as l}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColorOrColorEmission as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SlicePass as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{TextureCoordinateAttribute as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VertexPosition as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js";import{OutputDepth as c}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as v}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{OutputHighlightOverlay as u}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js";import{ReadDepth as h}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{computeFragmentNormals as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js";import{ComputeMaterialColor as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import{ComputeNormalTexture as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateSceneLighting as f,addLightingGlobalFactor as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y,addMainLightDirection as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRenderingParameters as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadBaseColorTexture as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import{ReadShadowMapPass as S}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{OverlayIM as N}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{DiscardOrAdjustAlphaDraw as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{If as T,glsl as D}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DBindUniform as M}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{SnowCover as A}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{outputColorHighlightOID as W}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{sphereDepthInterpolate as P}from"../views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js";import{ShaderBuilder as R}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as z}from"../webscene/support/AlphaCutoff.js";function F(F){const B=new R,{vertex:_,fragment:I}=B;B.include(m,F),B.include(g,F),B.include(s,F),B.include(d,F),B.include(i,F),B.include(O,F),I.include(n,F),B.include(j,F),B.include($,F);const{output:E,pbrMode:H,hasNormalTexture:V,snowCover:G,receiveShadows:k,shadeNormals:U,spherical:q,ellipsoidMode:J,overlayEnabled:K,componentData:Q,vertexDiscardMode:X,renderOccluded:Y}=F,Z=1===H||2===H;Z&&(B.include(L,F),V&&B.include(b,F));const ee=4===E||5===E||6===E,re=ee&&1===Q,oe=1===J,ae=1===J?r.radius:oe?o.radius:a.radius;K&&(B.include(f,F),B.include(N,F),_.code.add(`\n ${T(q,`const float invRadius = ${D.float(1/ae)};`)}\n vec2 projectOverlay(vec3 pos) { return pos.xy ${T(q,"/ (1.0 + invRadius * pos.z);")}; }`));const ie=K&&t(E)&&4===H;ie&&(B.varyings.add("tbnTangent","vec3"),B.varyings.add("tbnBiTangent","vec3"),B.varyings.add("groundNormal","vec3"));const le=0===X,te=2===X,ne=1-1/255;if(B.include(S,F),B.include(l,F),_.main.add(D`
6
6
  bool castShadows;
7
7
  vec4 externalColor = forwardExternalColor(castShadows);
8
- ${T(oe,"if(!castShadows) { gl_Position = vec4(vec3(1e38), 1.0); return; }")}
8
+ ${T(re,"if(!castShadows) { gl_Position = vec4(vec3(1e38), 1.0); return; }")}
9
9
 
10
- ${T(!te,`{ if (externalColor.a ${ne?">":"<="} ${D.float(de)}) { gl_Position = vec4(vec3(1e38), 1.0); return; } }`)}
10
+ ${T(!le,`{ if (externalColor.a ${te?">":"<="} ${D.float(ne)}) { gl_Position = vec4(vec3(1e38), 1.0); return; } }`)}
11
11
 
12
12
  ${T(10===E,"externalColor.a = 1.0;")}
13
13
 
@@ -20,7 +20,7 @@ import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r
20
20
  forwardLinearDepthToWriteShadowMap();
21
21
  forwardEmissiveStrength();
22
22
  forwardObjectAndLayerIdColor();
23
- ${T(le,q?D`
23
+ ${T(ie,q?D`
24
24
  groundNormal = normalize(positionWorld());
25
25
  tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), groundNormal));
26
26
  tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:D`
@@ -47,19 +47,19 @@ import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r
47
47
  /* When rendering the occluded overlay, we still need to read the base color texture
48
48
  * because we need to use the same discard logic. However after that to render only the
49
49
  * draped overlay, we simply set the base texture color to zero. */
50
- ${T(Z,D`textureColor = vec4(0);`)}
50
+ ${T(Y,D`textureColor = vec4(0);`)}
51
51
 
52
52
  ${T(K,D`vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay);`)}
53
53
 
54
54
  /* Early discard to only emit when we have overlay */
55
- ${T(K&&Z,D`if (overlayColor.a < ${D.float(z)}) { discard; }`)}
55
+ ${T(K&&Y,D`if (overlayColor.a < ${D.float(z)}) { discard; }`)}
56
56
 
57
57
  vec4 externalColor;
58
58
  int externalColorMixMode;
59
59
  readExternalColor(externalColor, externalColorMixMode);
60
60
 
61
61
  vec4 materialColor = computeMaterialColor(textureColor, externalColor, externalColorMixMode);
62
- `),ee?(y(I),q&&C(I),I.main.add(D`
62
+ `),Z?(y(I),q&&C(I),I.main.add(D`
63
63
  applyPBRFactors();
64
64
  ${T(1===H,D`if (externalColorMixMode == 3) {
65
65
  mrr = vec3(0.0, 0.6, 0.2);
@@ -78,11 +78,10 @@ import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r
78
78
  ${T(K,"materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;")}
79
79
 
80
80
  vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld());
81
- vec4 emission = ${Y?"vec4(0.0)":"getEmissions(materialColor.rgb)"};
82
81
  ${T(q,"float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());")}
83
82
  ${q?D`float shadow = max(lightingGlobalFactor * (1.0 - additionalAmbientScale), evaluateShadow());`:"float shadow = evaluateShadow();"}
84
83
  vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, shadow, ssao, additionalLight, viewDir, groundNormal, mrr, additionalIrradiance), materialColor.a);
85
- `)):(x(I),q&&C(I),le&&I.uniforms.add(new M("ovNormalTex",e=>e.overlay?.getTexture(3))),I.main.add(D`
84
+ `)):(x(I),q&&C(I),ie&&I.uniforms.add(new M("ovNormalTex",e=>e.overlay?.getTexture(3))),I.main.add(D`
86
85
  ${T(q,"float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld());")}
87
86
  float shadow = ${k?q?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), evaluateShadow())":"evaluateShadow()":q?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
88
87
 
@@ -100,7 +99,7 @@ import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r
100
99
  ${T(K,"materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;")}
101
100
 
102
101
  vec4 shadedColor = vec4(evaluateSceneLighting(fragmentShadingNormal, materialColor.rgb, shadow, ssao, additionalLight), materialColor.a);
103
- ${T(le,D`vec4 overlayWaterMask = getOverlayColor(ovNormalTex, vtcOverlay);
102
+ ${T(ie,D`vec4 overlayWaterMask = getOverlayColor(ovNormalTex, vtcOverlay);
104
103
  float waterNormalLength = length(overlayWaterMask);
105
104
  if (waterNormalLength > 0.95) {
106
105
  mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, groundNormal);
@@ -109,19 +108,19 @@ import{radiusModifier as e}from"../geometry/ellipsoidUtils.js";import{earth as r
109
108
  // un-gamma the ground color to mix in linear space
110
109
  shadedColor = mix(shadedColor, waterColorNonLinear, waterColorLinear.w);
111
110
  }`)}
112
- `)),I.main.add(`outputColorHighlightOID(shadedColor, vPositionWorldCameraRelative, materialColor.rgb ${T(G,", snow")});`),F.sphereDepthInterpolate&&(B.include(P,{radius:ie*e}),B.fragment.include(h),I.main.add(D`if (sphereFade()>0.0) {
111
+ `)),I.main.add(`outputColorHighlightOID(shadedColor, vPositionWorldCameraRelative, materialColor.rgb ${T(G,", snow")});`),F.sphereDepthInterpolate&&(B.include(P,{radius:ae*e}),B.fragment.include(h),I.main.add(D`if (sphereFade()>0.0) {
113
112
  vec3 worldRay = normalize(vPositionWorldCameraRelative);
114
113
  vec3 viewRay = normalize(vPosition_view);
115
114
  gl_FragDepth = delinearizeDepth(sphereDepthInterpolate(worldRay, viewRay, linearizeDepth(gl_FragCoord.z)));
116
115
  } else {
117
116
  gl_FragDepth = gl_FragCoord.z;
118
- }`)),B;const se=3===E,ge=10===E,me=9===E,ce=re||7===E||8===E;return ce&&B.include(c,F),se&&B.include(w,F),K&&B.include(u,F),B.include(v,F),I.main.add(D`
117
+ }`)),B;const de=3===E,se=10===E,ge=9===E,me=ee||7===E||8===E;return me&&B.include(c,F),de&&B.include(w,F),K&&B.include(u,F),B.include(v,F),I.main.add(D`
119
118
  discardBySlice(vPositionWorldCameraRelative);
120
119
 
121
120
  vec4 textureColor = readBaseColorTexture();
122
121
  discardOrAdjustAlpha(textureColor);
123
122
 
124
- ${T(ce,"outputDepth(linearDepth);")}
125
- ${T(se,D`fragColor = vec4(vec3(0.5) + 0.5 * fragmentFaceNormalView, 1.0);`)}
126
- ${T(ge,K?"fragColor = getOverlayColorTexel();":"outputObjectAndLayerIdColor();")}
127
- ${T(me,T(K,D`calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded());`,D`calculateOcclusionAndOutputHighlight();`))}`),B}const B=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}));export{B as C,F as b};
123
+ ${T(me,"outputDepth(linearDepth);")}
124
+ ${T(de,D`fragColor = vec4(vec3(0.5) + 0.5 * fragmentFaceNormalView, 1.0);`)}
125
+ ${T(se,K?"fragColor = getOverlayColorTexel();":"outputObjectAndLayerIdColor();")}
126
+ ${T(ge,T(K,D`calculateOcclusionAndOutputHighlight(getAllOverlayHighlightValuesEncoded());`,D`calculateOcclusionAndOutputHighlight();`))}`),B}const B=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}));export{B as C,F as b};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as r}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstanceColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as l,CreateMaskedFromNaNColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as v}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as u}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as p,addAmbientBoostFactor as h,addLightingGlobalFactor as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as j,ReadShadowMapDraw as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{colorTextureUV as N,normalTextureUV as T,emissiveTextureUV as O,occlusionTextureUV as S,metallicRoughnessTextureUV as V}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as A}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as E,addCameraPosition as U}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as I}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as B}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as _,glsl as F}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as R}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as z}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{colorMixModes as W}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as G}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as H}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as q}from"../webscene/support/AlphaCutoff.js";function J(J){const K=new H,{attributes:Q,vertex:X,fragment:Y,varyings:Z}=K,{output:ee,normalType:re,offsetBackfaces:oe,spherical:ie,snowCover:ae,pbrMode:se,textureAlphaPremultiplied:le,instancedDoublePrecision:ne,hasVertexColors:te,hasVertexTangents:de,hasColorTexture:me,hasNormalTexture:ce,hasNormalTextureTransform:ge,hasColorTextureTransform:ve,hasGlow:ue}=J;if(E(X,J),Q.add("position","vec3"),Z.add("vpos","vec3",{invariant:!0}),K.include($,J),K.include(s,J),K.include(v,J),K.include(N,J),!r(ee))return K.include(u,J),K;K.include(T,J),K.include(O,J),K.include(S,J),K.include(V,J),U(X,J),K.include(t,J),K.include(i);const we=0===re||1===re;return we&&oe&&K.include(e),K.include(w,J),K.include(g,J),K.include(a,J),Z.add("vPositionLocal","vec3"),K.include(m,J),K.include(d,J),K.include(c,J),X.uniforms.add(new B("externalColor",e=>e.externalColor,{supportsNaN:!0})),Z.add("vcolorExt","vec4"),K.include(M,J),X.include(l),X.include(n),K.include(ne?j:P,J),X.main.add(F`
5
+ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as r}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstanceColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as s,CreateMaskedFromNaNColor as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as t}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VertexNormal as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js";import{VerticalOffset as u}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as v}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{ComputeNormalTexture as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import{EvaluateAmbientOcclusion as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as b,addAmbientBoostFactor as f,addLightingGlobalFactor as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{PhysicallyBasedRendering as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as j,ReadShadowMapDraw as P}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{colorTextureUV as N,normalTextureUV as T,emissiveTextureUV as O,occlusionTextureUV as S,metallicRoughnessTextureUV as V}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as $}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as A}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as D}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as U,addCameraPosition as I}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as B}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as E}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as k}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{If as _,glsl as R}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as F}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as z}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{colorMixModes as W}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as G}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as H}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as q}from"../webscene/support/AlphaCutoff.js";function J(J){const K=new H,{attributes:Q,vertex:X,fragment:Y,varyings:Z}=K,{output:ee,normalType:re,offsetBackfaces:oe,spherical:ie,snowCover:ae,pbrMode:le,textureAlphaPremultiplied:se,instancedDoublePrecision:ne,hasVertexColors:te,hasVertexTangents:de,hasColorTexture:ce,hasNormalTexture:me,hasNormalTextureTransform:ge,hasColorTextureTransform:ue}=J;if(U(X,J),Q.add("position","vec3"),Z.add("vpos","vec3",{invariant:!0}),K.include($,J),K.include(l,J),K.include(u,J),K.include(N,J),!r(ee))return K.include(v,J),K;K.include(T,J),K.include(O,J),K.include(S,J),K.include(V,J),I(X,J),K.include(t,J),K.include(i);const ve=0===re||1===re;return ve&&oe&&K.include(e),K.include(w,J),K.include(g,J),K.include(a,J),Z.add("vPositionLocal","vec3"),K.include(c,J),K.include(d,J),K.include(m,J),X.uniforms.add(new E("externalColor",e=>e.externalColor,{supportsNaN:!0})),Z.add("vcolorExt","vec4"),K.include(M,J),X.include(s),X.include(n),K.include(ne?j:P,J),X.main.add(R`
6
6
  forwardNormalizedVertexColor();
7
7
 
8
8
  MaskedColor maskedColor =
@@ -14,11 +14,11 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
14
14
  vpos = getVertexInLocalOriginSpace();
15
15
  vPositionLocal = vpos - view[3].xyz;
16
16
  vpos = subtractOrigin(vpos);
17
- ${_(we,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
17
+ ${_(ve,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
18
18
  vpos = addVerticalOffset(vpos, localOrigin);
19
19
  ${_(de,"vTangent = dpTransformVertexTangent(tangent);")}
20
20
  gl_Position = transformPosition(proj, view, vpos);
21
- ${_(we&&oe,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
21
+ ${_(ve&&oe,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
22
22
 
23
23
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
24
24
  forwardTextureCoordinates();
@@ -28,19 +28,19 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
28
28
  forwardOcclusionUV();
29
29
  forwardMetallicRoughnessUV();
30
30
 
31
- if (opacityMixMode != ${F.int(W.ignore)} && vcolorExt.a < ${F.float(q)}) {
31
+ if (opacityMixMode != ${R.int(W.ignore)} && vcolorExt.a < ${R.float(q)}) {
32
32
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
33
33
  }
34
34
  forwardLinearDepthToReadShadowMap();
35
- `),K.include(p,J),Y.include(b,J),K.include(A,J),Y.include(o,J),K.include(G,J),U(Y,J),Y.uniforms.add(X.uniforms.get("localOrigin"),new I("ambient",e=>e.ambient),new I("diffuse",e=>e.diffuse),new k("opacity",e=>e.opacity),new k("layerOpacity",e=>e.layerOpacity)),me&&Y.uniforms.add(new R("tex",e=>e.texture)),K.include(L,J),Y.include(C,J),Y.include(D),K.include(x,J),Y.include(z,J),h(Y),f(Y),y(Y),Y.main.add(F`
35
+ `),K.include(b,J),Y.include(p,J),K.include(A,J),Y.include(o,J),K.include(G,J),I(Y,J),Y.uniforms.add(X.uniforms.get("localOrigin"),new B("ambient",e=>e.ambient),new B("diffuse",e=>e.diffuse),new k("opacity",e=>e.opacity),new k("layerOpacity",e=>e.layerOpacity)),ce&&Y.uniforms.add(new F("tex",e=>e.texture)),K.include(L,J),Y.include(C,J),Y.include(D),K.include(x,J),Y.include(z,J),f(Y),h(Y),y(Y),Y.main.add(R`
36
36
  discardBySlice(vpos);
37
37
  discardByTerrainDepth();
38
- ${me?F`
39
- vec4 texColor = texture(tex, ${ve?"colorUV":"vuv0"});
40
- ${_(le,"texColor.rgb /= texColor.a;")}
41
- discardOrAdjustAlpha(texColor);`:F`vec4 texColor = vec4(1.0);`}
38
+ ${ce?R`
39
+ vec4 texColor = texture(tex, ${ue?"colorUV":"vuv0"});
40
+ ${_(se,"texColor.rgb /= texColor.a;")}
41
+ discardOrAdjustAlpha(texColor);`:R`vec4 texColor = vec4(1.0);`}
42
42
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
43
- ${2===re?F`vec3 normal = screenDerivativeNormal(vPositionLocal);`:F`shadingParams.normalView = vNormalWorld;
43
+ ${2===re?R`vec3 normal = screenDerivativeNormal(vPositionLocal);`:R`shadingParams.normalView = vNormalWorld;
44
44
  vec3 normal = shadingNormal(shadingParams);`}
45
45
  applyPBRFactors();
46
46
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
@@ -54,10 +54,10 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
54
54
  vec3 albedo = mixExternalColor(${_(te,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
55
55
  float opacity_ = layerOpacity * mixExternalOpacity(${_(te,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
56
56
 
57
- ${ce?`mat3 tangentSpace = computeTangentSpace(${de?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ge?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
57
+ ${me?`mat3 tangentSpace = computeTangentSpace(${de?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ge?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
58
58
  vec3 normalGround = ${ie?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
59
59
 
60
- ${_(ae,F`
60
+ ${_(ae,R`
61
61
  float snow = getSnow(normal, normalGround);
62
62
  albedo = mix(albedo, vec3(1), snow);
63
63
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -65,11 +65,10 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
65
65
 
66
66
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
67
67
 
68
- ${1===se||2===se?F`
68
+ ${1===le||2===le?R`
69
69
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
70
- vec4 emission = ${ue?"vec4(0.0)":"getEmissions(albedo)"};
71
- ${_(ae,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
72
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:F`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
70
+ ${_(ae,"mrr = applySnowToMRR(mrr, snow);")}
71
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:R`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
73
72
  vec4 finalColor = vec4(shadedColor, opacity_);
74
73
  outputColorHighlightOID(finalColor, vpos, albedo ${_(ae,", snow")});
75
74
  `),K}const K=Object.freeze(Object.defineProperty({__proto__:null,build:J},Symbol.toStringTag,{value:"Module"}));export{K as D,J as b};
@@ -2,13 +2,13 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{addNearFar as e}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColorOrColorEmission as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as a}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as r}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{PathVertexPosition as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{OutputDepth as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as l}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as t,addAmbientBoostFactor as c,addLightingGlobalFactor as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{NormalUtils as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRenderingParameters as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDraw as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as b}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as f,addViewNormal as y,addCameraPosition as j}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as L}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as S,If as O}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{SnowCover as C}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{outputColorHighlightOID as A}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as D}from"../views/webgl/ShaderBuilder.js";function B(B){const I=new D,{vertex:F,fragment:M,varyings:_}=I;f(F,B),_.add("vpos","vec3",{invariant:!0}),I.include(n,B);const{output:V,spherical:x,pbrMode:z,hasGlow:T,snowCover:$}=B;switch((i(V)||10===V)&&(I.include(a),I.include(h,B),I.include(r,B),I.include(u,B),_.add("vnormal","vec3"),_.add("vcolor","vec4"),F.main.add(S`vpos = calculateVPos();
5
+ import{addNearFar as e}from"../views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import{isColorOrColorEmission as i}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as a}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as r}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{PathVertexPosition as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{OutputDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as s}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as t,addAmbientBoostFactor as c,addLightingGlobalFactor as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightIntensity as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{NormalUtils as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRenderingParameters as w}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapDraw as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as b}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as f,addViewNormal as y,addCameraPosition as j}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as L}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as P}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as S,If as O}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{SnowCover as C}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{outputColorHighlightOID as A}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as D}from"../views/webgl/ShaderBuilder.js";function B(B){const I=new D,{vertex:M,fragment:_,varyings:F}=I;f(M,B),F.add("vpos","vec3",{invariant:!0}),I.include(n,B);const{output:V,spherical:x,pbrMode:z,snowCover:T}=B;switch((i(V)||10===V)&&(I.include(a),I.include(u,B),I.include(r,B),I.include(h,B),F.add("vnormal","vec3"),F.add("vcolor","vec4"),M.main.add(S`vpos = calculateVPos();
6
6
  vnormal = normalize(localNormal());
7
7
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
8
8
  gl_Position = transformPosition(proj, view, vpos);
9
9
  forwardObjectAndLayerIdColor();
10
10
  vcolor = getColor();
11
- forwardLinearDepthToReadShadowMap();`)),V){case 1:case 0:I.include(w,B),I.include(t,B),M.include(d,B),I.include(v,B),M.include(o,B),I.include(A,B),j(M,B),c(M),m(M),M.uniforms.add(F.uniforms.get("localOrigin"),new L("ambient",e=>e.ambient),new L("diffuse",e=>e.diffuse),new P("opacity",e=>e.opacity)),M.include(b),M.include(C,B),g(M),M.main.add(S`
11
+ forwardLinearDepthToReadShadowMap();`)),V){case 1:case 0:I.include(w,B),I.include(t,B),_.include(d,B),I.include(v,B),_.include(o,B),I.include(A,B),j(_,B),c(_),m(_),_.uniforms.add(M.uniforms.get("localOrigin"),new L("ambient",e=>e.ambient),new L("diffuse",e=>e.diffuse),new P("opacity",e=>e.opacity)),_.include(b),_.include(C,B),g(_),_.main.add(S`
12
12
  discardBySlice(vpos);
13
13
  discardByTerrainDepth();
14
14
 
@@ -23,7 +23,7 @@ forwardLinearDepthToReadShadowMap();`)),V){case 1:case 0:I.include(w,B),I.includ
23
23
  vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one
24
24
  float combinedOpacity = vcolor.a * opacity;
25
25
 
26
- ${O($,S`float snow = getSnow(normal, normalGround);
26
+ ${O(T,S`float snow = getSnow(normal, normalGround);
27
27
  albedo = mix(albedo, vec3(1), snow);
28
28
  ssao = mix(ssao, 1.0, snow);`)}
29
29
 
@@ -31,19 +31,19 @@ forwardLinearDepthToReadShadowMap();`)),V){case 1:case 0:I.include(w,B),I.includ
31
31
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
32
32
  float shadow = readShadow(additionalAmbientScale, vpos);
33
33
 
34
- ${O(2===z,`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n vec4 emission = ${T?"vec4(0.0)":"getEmissions(albedo)"};\n ${O($,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}`)}
34
+ ${O(2===z,`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];\n ${O(T,"mrr = applySnowToMRR(mrr, snow);")}`)}
35
35
 
36
36
  vec3 shadedColor = ${2===z?"evaluateSceneLightingPBR(normal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);":"evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight);"}
37
37
  vec4 finalColor = vec4(shadedColor, combinedOpacity);
38
- outputColorHighlightOID(finalColor, vpos, albedo ${O($,", snow")});`);break;case 2:I.include(a),F.main.add(S`vpos = calculateVPos();
39
- gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),M.main.add(S`discardBySlice(vpos);`);break;case 4:case 5:case 6:case 7:I.include(a),e(I),_.add("depth","float"),F.main.add(S`vpos = calculateVPos();
40
- gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);`),I.fragment.include(o,B),I.include(s,B),M.main.add(S`discardBySlice(vpos);
41
- outputDepth(depth);`);break;case 10:I.fragment.include(o,B),M.main.add(S`discardBySlice(vpos);
42
- outputObjectAndLayerIdColor();`);break;case 3:I.include(a),I.include(p,B),y(F),_.add("vnormal","vec3"),F.main.add(S`vpos = calculateVPos();
38
+ outputColorHighlightOID(finalColor, vpos, albedo ${O(T,", snow")});`);break;case 2:I.include(a),M.main.add(S`vpos = calculateVPos();
39
+ gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),_.main.add(S`discardBySlice(vpos);`);break;case 4:case 5:case 6:case 7:I.include(a),e(I),F.add("depth","float"),M.main.add(S`vpos = calculateVPos();
40
+ gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);`),I.fragment.include(o,B),I.include(l,B),_.main.add(S`discardBySlice(vpos);
41
+ outputDepth(depth);`);break;case 10:I.fragment.include(o,B),_.main.add(S`discardBySlice(vpos);
42
+ outputObjectAndLayerIdColor();`);break;case 3:I.include(a),I.include(p,B),y(M),F.add("vnormal","vec3"),M.main.add(S`vpos = calculateVPos();
43
43
  vnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz);
44
- gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),M.main.add(S`discardBySlice(vpos);
44
+ gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),_.main.add(S`discardBySlice(vpos);
45
45
  vec3 normal = normalize(vnormal);
46
46
  if (gl_FrontFacing == false) normal = -normal;
47
- fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 9:I.include(a),I.include(p,B),_.add("vnormal","vec3"),F.main.add(S`vpos = calculateVPos();
48
- gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),I.include(l,B),M.main.add(S`discardBySlice(vpos);
47
+ fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);`);break;case 9:I.include(a),I.include(p,B),F.add("vnormal","vec3"),M.main.add(S`vpos = calculateVPos();
48
+ gl_Position = transformPosition(proj, view, vpos);`),I.fragment.include(o,B),I.include(s,B),_.main.add(S`discardBySlice(vpos);
49
49
  calculateOcclusionAndOutputHighlight();`)}return I}const I=Object.freeze(Object.defineProperty({__proto__:null,build:B},Symbol.toStringTag,{value:"Module"}));export{I as P,B as b};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstanceColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as t,CreateMaskedFromNaNColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VerticalOffset as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as v}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as p,addLightingGlobalFactor as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as f,addMainLightIntensity as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRendering as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as C,ReadShadowMapDraw as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{VisualVariables as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as N}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as P,addCameraPosition as S}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as E}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as F,If as V}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as $}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as T}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{colorMixModes as I}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as k}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as R}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as B}from"../webscene/support/AlphaCutoff.js";function _(_){const z=new R,{attributes:U,vertex:W,fragment:G,varyings:H}=z,{output:q,offsetBackfaces:J,pbrMode:K,snowCover:Q,spherical:X,hasGlow:Y}=_,Z=1===K||2===K;if(P(W,_),U.add("position","vec3"),H.add("vpos","vec3",{invariant:!0}),z.include(M,_),z.include(l,_),z.include(m,_),z.include(j,_),!o(q))return z.include(v,_),z;S(z.vertex,_),z.include(n,_),z.include(i),J&&z.include(e),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3",{invariant:!0}),z.include(c,_),z.include(d,_),z.include(a,_),z.include(g,_),W.include(t),W.include(s),W.uniforms.add(new E("externalColor",e=>e.externalColor,{supportsNaN:!0})),H.add("vcolorExt","vec4"),z.include(_.instancedDoublePrecision?C:L,_),W.main.add(F`
5
+ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColorOrColorEmission as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstanceColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstanceColor.glsl.js";import{InstancedDoublePrecision as l}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{MaskedColorDefinition as t,CreateMaskedFromNaNColor as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/MaskedColor.glsl.js";import{NormalAttribute as n}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{SymbolColor as d}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js";import{TextureCoordinateAttribute as c}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexColor as g}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js";import{VerticalOffset as m}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as v}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{EvaluateAmbientOcclusion as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as w,addAmbientBoostFactor as p,addLightingGlobalFactor as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{addMainLightDirection as f,addMainLightIntensity as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{PhysicallyBasedRendering as y}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as x}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReadShadowMapPass as C,ReadShadowMapDraw as L}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{terrainDepthTest as j}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{VisualVariables as M}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as O}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{MixExternalColor as N}from"../views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js";import{addProjViewLocalOrigin as P,addCameraPosition as S}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{Float4PassUniform as E}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as F,If as V}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as T}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as $}from"../views/3d/webgl-engine/effects/weather/SnowCover.glsl.js";import{colorMixModes as I}from"../views/3d/webgl-engine/materials/internal/MaterialUtil.js";import{outputColorHighlightOID as k}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as R}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as B}from"../webscene/support/AlphaCutoff.js";function _(_){const z=new R,{attributes:U,vertex:W,fragment:H,varyings:G}=z,{output:q,offsetBackfaces:J,pbrMode:K,snowCover:Q,spherical:X}=_,Y=1===K||2===K;if(P(W,_),U.add("position","vec3"),G.add("vpos","vec3",{invariant:!0}),z.include(M,_),z.include(l,_),z.include(m,_),z.include(j,_),!o(q))return z.include(v,_),z;S(z.vertex,_),z.include(n,_),z.include(i),J&&z.include(e),G.add("vNormalWorld","vec3"),G.add("localvpos","vec3",{invariant:!0}),z.include(c,_),z.include(d,_),z.include(a,_),z.include(g,_),W.include(t),W.include(s),W.uniforms.add(new E("externalColor",e=>e.externalColor,{supportsNaN:!0})),G.add("vcolorExt","vec4"),z.include(_.instancedDoublePrecision?C:L,_),W.main.add(F`
6
6
  forwardNormalizedVertexColor();
7
7
 
8
8
  MaskedColor maskedColorExt =
@@ -25,11 +25,11 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
25
25
  forwardLinearDepthToReadShadowMap();
26
26
  gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
27
27
  ${V(J,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
28
- `);const{hasColorTexture:ee,hasColorTextureTransform:oe}=_;return z.include(w,_),G.include(b,_),z.include(O,_),G.include(r,_),z.include(k,_),S(G,_),f(G),p(G),u(G),G.uniforms.add(W.uniforms.get("localOrigin"),W.uniforms.get("view"),new A("ambient",e=>e.ambient),new A("diffuse",e=>e.diffuse),new D("opacity",e=>e.opacity),new D("layerOpacity",e=>e.layerOpacity)),ee&&G.uniforms.add(new $("tex",e=>e.texture)),z.include(x,_),G.include(y,_),G.include(N),G.include(T,_),h(G),G.main.add(F`
28
+ `);const{hasColorTexture:Z,hasColorTextureTransform:ee}=_;return z.include(w,_),H.include(b,_),z.include(O,_),H.include(r,_),z.include(k,_),S(H,_),f(H),p(H),u(H),H.uniforms.add(W.uniforms.get("localOrigin"),W.uniforms.get("view"),new A("ambient",e=>e.ambient),new A("diffuse",e=>e.diffuse),new D("opacity",e=>e.opacity),new D("layerOpacity",e=>e.layerOpacity)),Z&&H.uniforms.add(new T("tex",e=>e.texture)),z.include(x,_),H.include(y,_),H.include(N),H.include($,_),h(H),H.main.add(F`
29
29
  discardBySlice(vpos);
30
30
  discardByTerrainDepth();
31
- vec4 texColor = ${ee?`texture(tex, ${oe?"colorUV":"vuv0"})`:" vec4(1.0)"};
32
- ${V(ee,`${V(_.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
31
+ vec4 texColor = ${Z?`texture(tex, ${ee?"colorUV":"vuv0"})`:" vec4(1.0)"};
32
+ ${V(Z,`${V(_.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
33
33
  vec3 viewDirection = normalize(vpos - cameraPosition);
34
34
  applyPBRFactors();
35
35
  float ssao = evaluateAmbientOcclusionInverse();
@@ -56,9 +56,8 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
56
56
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
57
57
  additionalLight += backLightFactor * mainLightIntensity;`}
58
58
 
59
- ${Z?F`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
59
+ ${Y?F`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
60
60
  ${V(Q,"mrr = applySnowToMRR(mrr, snow);")}
61
- vec4 emission = ${Q||Y?"vec4(0.0)":"getEmissions(albedo)"};
62
61
  vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:F`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
63
62
  vec4 finalColor = vec4(shadedColor, opacity_);
64
63
  outputColorHighlightOID(finalColor, vpos, albedo ${V(Q,", 1.0")});`),z}const z=Object.freeze(Object.defineProperty({__proto__:null,build:_},Symbol.toStringTag,{value:"Module"}));export{z as R,_ as b};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{toSymbolId as t}from"../arcade/arcadeEnvironment.js";import e from"../arcade/Dictionary.js";import{ArcadeExecutionError as s}from"../arcade/executionError.js";import{B as r,j as n,L as o}from"./languageUtils.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{getOrCreateMapValue as c}from"../core/MapUtils.js";import l from"../portal/Portal.js";import{translate as u}from"../rest/translate.js";import h from"../rest/support/TranslateContent.js";import m from"../rest/support/TranslateParameters.js";import f from"../rest/support/TranslateResult.js";import{isString as p,isArray as _}from"../support/guards.js";class d{constructor(t,e){this.portal=t,this._debugLog=e}async translate(t){this.portal.loaded||await this.portal.load();const e=this.portal.helperServices?.aiUtilityServices;if(null==e)return{success:!1};const s=e.url+e.translateUtility;try{t.requestSource??="arcade";return{success:!0,results:(await u(s,t,{authMode:"no-prompt"})).map(t=>t.toJSON())}}catch(r){return null!=this._debugLog&&(r instanceof Error||r instanceof a)&&this._debugLog(`TranslateText error: ${r.message}`),i.getLogger("esri.arcade.functions.aiServices").error(r),{success:!1}}}}class g{constructor(t,e,s){this._parameters=t,this._maxTotalContentSize=e,this._maxContentsLength=s,this._requests=[],this._normalizedContents=new Map,this._contentsTotalSize=0}tryAdd(t){const e=new Set(t.filter(t=>!this._normalizedContents.has(t.text)).map(t=>t.text));if(this._requests.length+e.size>this._maxContentsLength)return null;let s=0;for(const n of e)s+=n.length;if((s+this._contentsTotalSize)*(this._parameters.to.length??1)>this._maxTotalContentSize)return null;const r=this._requests.length;for(const{key:n,text:o}of t)c(this._normalizedContents,o,()=>[]).push({batchIdx:r,key:n});return this._requests.push(t),this._contentsTotalSize+=s,r}async send(t){const e=[],s=[];let r=0;for(const[i,c]of this._normalizedContents)e.push(new h({key:String(r++),text:i})),s.push(c);const n=new m(this._parameters);n.contents=e;const o=await t.translate(n);if(!o.success)return Array.from(this._requests,()=>o);const a=Array.from(this._requests,()=>({success:!0,results:[]}));for(const i of o.results){const t=Number(i.key);for(const e of s[t])a[e.batchIdx].results.push({...i,key:e.key})}return a}}function y(t){const e=[...new Set(t.to)].sort(),s=t.from??null,r=t.portalUrl,n=t.translator,o=t.apiKey??null;return JSON.stringify([e,s,r,n,o])}async function w(t,e,s){try{return(await t.yieldFor(s))[e]}catch{return{success:!1}}}class x{constructor(t,e,{maxTotalContentSize:s=5e4,maxContentsLength:r=1e3}={}){this._executor=t,this._service=e,this._openBatches=new Map,this._maxTotalContentSize=s,this._maxContentsLength=r}create(t){return{translate:async e=>{const s=y(e),{contents:r,to:n,from:o,translator:a,portalUrl:i,apiKey:c}=e;if(null==n)return{success:!1};if(null==r||r.every(t=>0===t.text.length))return{success:!1};const l=this._openBatches.get(s);if(null!=l){const e=l.data.tryAdd(r);if(null!=e)return await w(t,e,l);l.send()}const u=new g({to:n,from:o,translator:a,portalUrl:i,apiKey:c},this._maxTotalContentSize,this._maxContentsLength),h=u.tryAdd(r);if(null!=h){const e=this._executor.openBatch(u,{open:t=>{this._openBatches.set(s,t)},execute:t=>t.send(this._service),close:t=>{this._openBatches.get(s)===t&&this._openBatches.delete(s)}});return await w(t,h,e)}return await this._service.translate(e)}}}}function S(a){"async"===a.mode&&(a.functions[t("TranslateText")]=function(t,i){return a.standardFunctionAsync(t,i,async(t,a,i)=>{if(r(i,2,3,t,a),!p(i[0])&&!_(i[0])&&!n(i[0]))throw new s(t,"InvalidParameter",a);const c=o(i[0]);if(!p(i[1])&&!_(i[1])&&!n(i[1]))throw new s(t,"InvalidParameter",a);const u=o(i[1]);let g=null;if(i.length>=3){if(!p(i[2]))throw new s(t,"InvalidParameter",a);g=i[2]}const w=c.map((t,e)=>new h({key:String(e),text:t})),x=t.services?.portal??l.getDefault(),S=new m({to:u,contents:w,from:g,portalUrl:x.restUrl.replace(/\/sharing\/rest$/,"")}),T=new Map;let v=null;if(null!=t.lrucache){const e=t.lrucache;v??=y(S),S.contents=S.contents?.filter(t=>{const s=e.getCachedTranslation(v,t.text);return null==s||(T.set(t.key,{...s,key:t.key,text:t.text}),!1)})}if(S.contents?.length){const r=t.services?.translation??new d(x,t.console),n=await r.translate(S);if(!n.success)return new e({__proto__:null,success:!1});for(const e of n.results){const r=S.contents?.find(t=>t.key===e.key)?.text;if(null==r)throw new s(null,"NeverReach",null);T.set(e.key,e),null!=t.lrucache&&(v??=y(S),t.lrucache.setCachedTranslation(v,r,{detectedLanguage:e.detectedLanguage,translation:e.translation}))}}const C=Array.from(w,r=>{const n=f.fromJSON(T.get(r.key));if(null==n)throw new s(null,"NeverReach",null);return n.text=r.text,e.convertJsonToArcade(n.toJSON(),t.timeZone??"system",!0)});return new e({__proto__:null,success:!0,results:C})})})}const T=Object.freeze(Object.defineProperty({__proto__:null,BatchTranslationServiceFactory:x,PortalTranslationService:d,getTranslateParametersKey:y,registerFunctions:S},Symbol.toStringTag,{value:"Module"}));export{T as A,x as B,d as P,y as g,S as r};
5
+ import{toSymbolId as t}from"../arcade/arcadeEnvironment.js";import e from"../arcade/Dictionary.js";import{ArcadeExecutionError as s}from"../arcade/executionError.js";import{B as r,j as n,M as o}from"./languageUtils.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{getOrCreateMapValue as c}from"../core/MapUtils.js";import l from"../portal/Portal.js";import{translate as u}from"../rest/translate.js";import h from"../rest/support/TranslateContent.js";import m from"../rest/support/TranslateParameters.js";import f from"../rest/support/TranslateResult.js";import{isString as p,isArray as _}from"../support/guards.js";class d{constructor(t,e){this.portal=t,this._debugLog=e}async translate(t){this.portal.loaded||await this.portal.load();const e=this.portal.helperServices?.aiUtilityServices;if(null==e)return{success:!1};const s=e.url+e.translateUtility;try{t.requestSource??="arcade";return{success:!0,results:(await u(s,t,{authMode:"no-prompt"})).map(t=>t.toJSON())}}catch(r){return null!=this._debugLog&&(r instanceof Error||r instanceof a)&&this._debugLog(`TranslateText error: ${r.message}`),i.getLogger("esri.arcade.functions.aiServices").error(r),{success:!1}}}}class g{constructor(t,e,s){this._parameters=t,this._maxTotalContentSize=e,this._maxContentsLength=s,this._requests=[],this._normalizedContents=new Map,this._contentsTotalSize=0}tryAdd(t){const e=new Set(t.filter(t=>!this._normalizedContents.has(t.text)).map(t=>t.text));if(this._requests.length+e.size>this._maxContentsLength)return null;let s=0;for(const n of e)s+=n.length;if((s+this._contentsTotalSize)*(this._parameters.to.length??1)>this._maxTotalContentSize)return null;const r=this._requests.length;for(const{key:n,text:o}of t)c(this._normalizedContents,o,()=>[]).push({batchIdx:r,key:n});return this._requests.push(t),this._contentsTotalSize+=s,r}async send(t){const e=[],s=[];let r=0;for(const[i,c]of this._normalizedContents)e.push(new h({key:String(r++),text:i})),s.push(c);const n=new m(this._parameters);n.contents=e;const o=await t.translate(n);if(!o.success)return Array.from(this._requests,()=>o);const a=Array.from(this._requests,()=>({success:!0,results:[]}));for(const i of o.results){const t=Number(i.key);for(const e of s[t])a[e.batchIdx].results.push({...i,key:e.key})}return a}}function y(t){const e=[...new Set(t.to)].sort(),s=t.from??null,r=t.portalUrl,n=t.translator,o=t.apiKey??null;return JSON.stringify([e,s,r,n,o])}async function w(t,e,s){try{return(await t.yieldFor(s))[e]}catch{return{success:!1}}}class x{constructor(t,e,{maxTotalContentSize:s=5e4,maxContentsLength:r=1e3}={}){this._executor=t,this._service=e,this._openBatches=new Map,this._maxTotalContentSize=s,this._maxContentsLength=r}create(t){return{translate:async e=>{const s=y(e),{contents:r,to:n,from:o,translator:a,portalUrl:i,apiKey:c}=e;if(null==n)return{success:!1};if(null==r||r.every(t=>0===t.text.length))return{success:!1};const l=this._openBatches.get(s);if(null!=l){const e=l.data.tryAdd(r);if(null!=e)return await w(t,e,l);l.send()}const u=new g({to:n,from:o,translator:a,portalUrl:i,apiKey:c},this._maxTotalContentSize,this._maxContentsLength),h=u.tryAdd(r);if(null!=h){const e=this._executor.openBatch(u,{open:t=>{this._openBatches.set(s,t)},execute:t=>t.send(this._service),close:t=>{this._openBatches.get(s)===t&&this._openBatches.delete(s)}});return await w(t,h,e)}return await this._service.translate(e)}}}}function S(a){"async"===a.mode&&(a.functions[t("TranslateText")]=function(t,i){return a.standardFunctionAsync(t,i,async(t,a,i)=>{if(r(i,2,3,t,a),!p(i[0])&&!_(i[0])&&!n(i[0]))throw new s(t,"InvalidParameter",a);const c=o(i[0]);if(!p(i[1])&&!_(i[1])&&!n(i[1]))throw new s(t,"InvalidParameter",a);const u=o(i[1]);let g=null;if(i.length>=3){if(!p(i[2]))throw new s(t,"InvalidParameter",a);g=i[2]}const w=c.map((t,e)=>new h({key:String(e),text:t})),x=t.services?.portal??l.getDefault(),S=new m({to:u,contents:w,from:g,portalUrl:x.restUrl.replace(/\/sharing\/rest$/,"")}),T=new Map;let v=null;if(null!=t.lrucache){const e=t.lrucache;v??=y(S),S.contents=S.contents?.filter(t=>{const s=e.getCachedTranslation(v,t.text);return null==s||(T.set(t.key,{...s,key:t.key,text:t.text}),!1)})}if(S.contents?.length){const r=t.services?.translation??new d(x,t.console),n=await r.translate(S);if(!n.success)return new e({__proto__:null,success:!1});for(const e of n.results){const r=S.contents?.find(t=>t.key===e.key)?.text;if(null==r)throw new s(null,"NeverReach",null);T.set(e.key,e),null!=t.lrucache&&(v??=y(S),t.lrucache.setCachedTranslation(v,r,{detectedLanguage:e.detectedLanguage,translation:e.translation}))}}const C=Array.from(w,r=>{const n=f.fromJSON(T.get(r.key));if(null==n)throw new s(null,"NeverReach",null);return n.text=r.text,e.convertJsonToArcade(n.toJSON(),t.timeZone??"system",!0)});return new e({__proto__:null,success:!0,results:C})})})}const T=Object.freeze(Object.defineProperty({__proto__:null,BatchTranslationServiceFactory:x,PortalTranslationService:d,getTranslateParametersKey:y,registerFunctions:S},Symbol.toStringTag,{value:"Module"}));export{T as A,x as B,d as P,y as g,S as r};
package/chunks/array.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{deepClone as n}from"../arcade/deepClone.js";import{ArcadeExecutionError as t}from"../arcade/executionError.js";import r from"../arcade/ImmutableArray.js";import{B as e,J as o,j as i,s as u,v as a,n as s,u as c,x as l,i as f,M as d}from"./languageUtils.js";import{isPromiseLike as h}from"../core/promiseUtils.js";import{isArray as w,isBoolean as g,isInteger as m}from"../support/guards.js";function F(F){function p(n,e,o){if(n instanceof r)return n.toArray();if(w(n))return n;throw new t(e,"InvalidParameter",o)}function y(n,t){const r=n.length,e=Math.floor(r/2);return 0===r?[]:1===r?[n[0]]:v(y(n.slice(0,e),t),y(n.slice(e,r),t),t)}function v(n,t,r){const e=[];for(;n.length>0||t.length>0;)if(n.length>0&&t.length>0){let o=r(n[0],t[0]);isNaN(o)&&(o=0),o<=0?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1))}else n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}async function P(n,t){const r=n.length,e=Math.floor(r/2);if(0===r)return[];if(1===r)return[n[0]];const o=[await P(n.slice(0,e),t),await P(n.slice(e,r),t)];return I(o[0],o[1],t,[])}async function I(n,t,r,e){const o=e;if(n.length>0||t.length>0){if(n.length>0&&t.length>0){let i=await r(n[0],t[0]);return isNaN(i)&&(i=1),i<=0?(o.push(n[0]),n=n.slice(1)):(o.push(t[0]),t=t.slice(1)),I(n,t,r,e)}return n.length>0?(o.push(n[0]),I(n=n.slice(1),t,r,e)):(o.push(t[0]),I(n,t=t.slice(1),r,e))}return e}function N(n,r,o,u){e(o,1,2,n,r);let s=o[0];if(i(s)&&(s=s.toArray()),!1===w(s))throw new t(n,"InvalidParameter",r);if(o.length>1){if(!1===f(o[1]))throw new t(n,"InvalidParameter",r);let e=s;const i=o[1].createFunction(n);return u?P(e,i):(e=y(e,(n,t)=>i(n,t)),e)}let l=s;if(0===l.length)return[];const h={};for(let t=0;t<l.length;t++){const n=d(l[t]);""!==n&&(h[n]=!0)}if(!0===h.Array||!0===h.Dictionary||!0===h.Feature||!0===h.Voxel||!0===h.Pixel||!0===h.Point||!0===h.Polygon||!0===h.Polyline||!0===h.Multipoint||!0===h.Extent||!0===h.Function)return l.slice();let g=0,m="";for(const t in h)g++,m=t;return l=g>1||"String"===m?y(l,(n,t)=>{if(null==n||n===a)return null==t||t===a?0:1;if(null==t||t===a)return-1;const r=c(n),e=c(t);return r<e?-1:r===e?0:1}):"Number"===m?y(l,(n,t)=>n-t):"Boolean"===m?y(l,(n,t)=>n===t?0:t?-1:1):"Date"===m?y(l,(n,t)=>n.toNumber()-t.toNumber()):l.slice(),l}F.functions.array=function(r,a){return F.standardFunction(r,a,(s,c,l)=>{if(e(l,0,2,r,a),0===l.length)return[];if(1===l.length&&null===l[0])return[];if(w(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].slice()}if(i(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].toArray().slice()}const f=u(l[0]);if(isNaN(f)||!1===m(f))throw new t(r,"InvalidParameter",a);const d=o(l[1],null),h=new Array(f);return h.fill(d),h})},F.functions.front=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(0)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][0]}throw new t(n,"InvalidParameter",r)})},F.functions.back=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(a[0].length()-1)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][a[0].length-1]}throw new t(n,"InvalidParameter",r)})},F.functions.push=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,2,n,r),w(u[0]))return u[0][u[0].length]=u[1],u[0].length;throw new t(n,"InvalidParameter",r)})},F.functions.pop=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,1,n,r),w(u[0])){if(u[0].length<=0)throw new t(n,"OutOfBounds",r);const e=u[0][u[0].length-1];return u[0].length=u[0].length-1,e}throw new t(n,"InvalidParameter",r)})},F.functions.erase=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,2,2,n,r),w(l[0])){let e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[0];if(o.length<=0)throw new t(n,"OutOfBounds",r);if(e<0&&(e=o.length+e),e<0)throw new t(n,"OutOfBounds",r);if(e>=o.length)throw new t(n,"OutOfBounds",r);return o.splice(e,1),a}if(s(l[0]))return l[0].eraseField(c(l[1])),a;throw new t(n,"InvalidParameter",r)})},F.functions.insert=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,3,3,n,r),w(l[0])){const e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[2],i=l[0];if(e>i.length)throw new t(n,"OutOfBounds",r);if(e<0&&e<-1*i.length)throw new t(n,"OutOfBounds",r);return e===i.length?(i[e]=o,a):(i.splice(e,0,o),a)}if(s(l[0]))return l[0].setField(c(l[1]),l[2]),a;throw new t(n,"InvalidParameter",r)})},F.functions.getkeys=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].keys();throw new t(n,"InvalidParameter",r)})},F.functions.getvalues=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].values();throw new t(n,"InvalidParameter",r)})},F.functions.resize=function(n,r){return F.standardFunction(n,r,(i,s,c)=>{if(e(c,2,3,n,r),w(c[0])){const e=u(c[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(e<0)throw new t(n,"InvalidParameter",r);const i=o(c[2],null),s=c[0];if(s.length>=e)return s.length=e,a;const l=s.length;s.length=e;for(let n=l;n<s.length;n++)s[n]=i;return a}throw new t(n,"InvalidParameter",r)})},F.functions.includes=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,2,2,n,r),w(a[0])){const n=a[1];return!!a[0].some(t=>l(t,n))}if(i(a[0])){const n=a[1];return!!a[0].toArray().some(t=>l(t,n))}throw new t(n,"InvalidParameter",r)})},F.functions.slice=function(n,r){return F.standardFunction(n,r,(a,s,c)=>{if(e(c,1,3,n,r),w(c[0])){const e=u(o(c[1],0)),i=u(o(c[2],c[0].length));if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);return c[0].slice(e,i)}if(i(c[0])){const e=c[0],i=u(o(c[1],0)),a=u(o(c[2],e.length()));if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);if(isNaN(a)||!1===m(a))throw new t(n,"InvalidParameter",r);return e.toArray().slice(i,a)}throw new t(n,"InvalidParameter",r)})},F.functions.splice=function(n,t){return F.standardFunction(n,t,(n,t,r)=>{const e=[];for(let o=0;o<r.length;o++)w(r[o])?e.push(...r[o]):i(r[o])?e.push(...r[o].toArray()):e.push(r[o]);return e})},F.functions.top=function(n,r){return F.standardFunction(n,r,(o,a,s)=>{if(e(s,2,2,n,r),w(s[0]))return u(s[1])>=s[0].length?s[0].slice():s[0].slice(0,u(s[1]));if(i(s[0]))return u(s[1])>=s[0].length()?s[0].slice():s[0].slice(0,u(s[1]));throw new t(n,"InvalidParameter",r)})},F.functions.first=function(n,t){return F.standardFunction(n,t,(r,o,u)=>(e(u,1,1,n,t),w(u[0])?0===u[0].length?null:u[0][0]:i(u[0])?0===u[0].length()?null:u[0].get(0):null))},"sync"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunction(n,t,(t,r,e)=>N(n,r,e,!1))},F.functions.any=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=i(n);if(g(t)&&!0===t)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0!==i(n))return!1}return!0})},F.functions.none=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0===i(n))return!1}return!0})},F.functions.reduce=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,3,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);return 2===o.length?0===u.length?null:u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null}):u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null},o[2])})},F.functions.map=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=i(n);void 0!==t&&t!==a?s.push(t):s.push(null)}return s})},F.functions.filter=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){!0===i(n)&&a.push(n)}return a})}),"async"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,e)=>N(n,r,e,!0))},F.functions.any=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,g(r)&&!0===r)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0!==r)return!1}return!0})},F.functions.none=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0===r)return!1}return!0})},F.functions.filter=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,!0===r&&a.push(n)}return a})},F.functions.reduce=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,i)=>{e(i,2,3,n,r);const u=i[1].createFunction(n),s=p(i[0],n,r);let c;if(i.length>2){const n=o(i[2],null);c=s.reduce(async(n,t)=>{let r=await n;return void 0!==r&&r!==a||(r=null),u(r,t)},Promise.resolve(n))}else{if(0===s.length)return null;c=s.reduce(async(n,t,r)=>{if(r<=1)return u(n,t);let e=await n;return void 0!==e&&e!==a||(e=null),u(e,t)})}return c.then(n=>void 0!==n&&n!==a?n:null)})},F.functions.map=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,void 0!==r&&r!==a?s.push(r):s.push(null)}return s})})}const p=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:F},Symbol.toStringTag,{value:"Module"}));export{p as A,F as r};
5
+ import{deepClone as n}from"../arcade/deepClone.js";import{ArcadeExecutionError as t}from"../arcade/executionError.js";import r from"../arcade/ImmutableArray.js";import{B as e,J as o,j as i,s as u,v as a,n as s,u as c,x as l,i as f,N as d}from"./languageUtils.js";import{isPromiseLike as h}from"../core/promiseUtils.js";import{isArray as w,isBoolean as g,isInteger as m}from"../support/guards.js";function F(F){function p(n,e,o){if(n instanceof r)return n.toArray();if(w(n))return n;throw new t(e,"InvalidParameter",o)}function y(n,t){const r=n.length,e=Math.floor(r/2);return 0===r?[]:1===r?[n[0]]:v(y(n.slice(0,e),t),y(n.slice(e,r),t),t)}function v(n,t,r){const e=[];for(;n.length>0||t.length>0;)if(n.length>0&&t.length>0){let o=r(n[0],t[0]);isNaN(o)&&(o=0),o<=0?(e.push(n[0]),n=n.slice(1)):(e.push(t[0]),t=t.slice(1))}else n.length>0?(e.push(n[0]),n=n.slice(1)):t.length>0&&(e.push(t[0]),t=t.slice(1));return e}async function P(n,t){const r=n.length,e=Math.floor(r/2);if(0===r)return[];if(1===r)return[n[0]];const o=[await P(n.slice(0,e),t),await P(n.slice(e,r),t)];return I(o[0],o[1],t,[])}async function I(n,t,r,e){const o=e;if(n.length>0||t.length>0){if(n.length>0&&t.length>0){let i=await r(n[0],t[0]);return isNaN(i)&&(i=1),i<=0?(o.push(n[0]),n=n.slice(1)):(o.push(t[0]),t=t.slice(1)),I(n,t,r,e)}return n.length>0?(o.push(n[0]),I(n=n.slice(1),t,r,e)):(o.push(t[0]),I(n,t=t.slice(1),r,e))}return e}function N(n,r,o,u){e(o,1,2,n,r);let s=o[0];if(i(s)&&(s=s.toArray()),!1===w(s))throw new t(n,"InvalidParameter",r);if(o.length>1){if(!1===f(o[1]))throw new t(n,"InvalidParameter",r);let e=s;const i=o[1].createFunction(n);return u?P(e,i):(e=y(e,(n,t)=>i(n,t)),e)}let l=s;if(0===l.length)return[];const h={};for(let t=0;t<l.length;t++){const n=d(l[t]);""!==n&&(h[n]=!0)}if(!0===h.Array||!0===h.Dictionary||!0===h.Feature||!0===h.Voxel||!0===h.Pixel||!0===h.Point||!0===h.Polygon||!0===h.Polyline||!0===h.Multipoint||!0===h.Extent||!0===h.Function)return l.slice();let g=0,m="";for(const t in h)g++,m=t;return l=g>1||"String"===m?y(l,(n,t)=>{if(null==n||n===a)return null==t||t===a?0:1;if(null==t||t===a)return-1;const r=c(n),e=c(t);return r<e?-1:r===e?0:1}):"Number"===m?y(l,(n,t)=>n-t):"Boolean"===m?y(l,(n,t)=>n===t?0:t?-1:1):"Date"===m?y(l,(n,t)=>n.toNumber()-t.toNumber()):l.slice(),l}F.functions.array=function(r,a){return F.standardFunction(r,a,(s,c,l)=>{if(e(l,0,2,r,a),0===l.length)return[];if(1===l.length&&null===l[0])return[];if(w(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].slice()}if(i(l[0])){if(2===l.length&&!1===g(l[1]))throw new t(r,"InvalidParameter",a);return!0===o(l[1],!1)?n(l[0]):l[0].toArray().slice()}const f=u(l[0]);if(isNaN(f)||!1===m(f))throw new t(r,"InvalidParameter",a);const d=o(l[1],null),h=new Array(f);return h.fill(d),h})},F.functions.front=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(0)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][0]}throw new t(n,"InvalidParameter",r)})},F.functions.back=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,1,1,n,r),i(a[0])){if(a[0].length()<=0)throw new t(n,"OutOfBounds",r);return a[0].get(a[0].length()-1)}if(w(a[0])){if(a[0].length<=0)throw new t(n,"OutOfBounds",r);return a[0][a[0].length-1]}throw new t(n,"InvalidParameter",r)})},F.functions.push=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,2,n,r),w(u[0]))return u[0][u[0].length]=u[1],u[0].length;throw new t(n,"InvalidParameter",r)})},F.functions.pop=function(n,r){return F.standardFunction(n,r,(o,i,u)=>{if(e(u,1,1,n,r),w(u[0])){if(u[0].length<=0)throw new t(n,"OutOfBounds",r);const e=u[0][u[0].length-1];return u[0].length=u[0].length-1,e}throw new t(n,"InvalidParameter",r)})},F.functions.erase=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,2,2,n,r),w(l[0])){let e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[0];if(o.length<=0)throw new t(n,"OutOfBounds",r);if(e<0&&(e=o.length+e),e<0)throw new t(n,"OutOfBounds",r);if(e>=o.length)throw new t(n,"OutOfBounds",r);return o.splice(e,1),a}if(s(l[0]))return l[0].eraseField(c(l[1])),a;throw new t(n,"InvalidParameter",r)})},F.functions.insert=function(n,r){return F.standardFunction(n,r,(o,i,l)=>{if(e(l,3,3,n,r),w(l[0])){const e=u(l[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);const o=l[2],i=l[0];if(e>i.length)throw new t(n,"OutOfBounds",r);if(e<0&&e<-1*i.length)throw new t(n,"OutOfBounds",r);return e===i.length?(i[e]=o,a):(i.splice(e,0,o),a)}if(s(l[0]))return l[0].setField(c(l[1]),l[2]),a;throw new t(n,"InvalidParameter",r)})},F.functions.getkeys=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].keys();throw new t(n,"InvalidParameter",r)})},F.functions.getvalues=function(n,r){return F.standardFunction(n,r,(n,r,o)=>{if(e(o,1,1,n,r),null==o[0])return[];if(s(o[0]))return o[0].values();throw new t(n,"InvalidParameter",r)})},F.functions.resize=function(n,r){return F.standardFunction(n,r,(i,s,c)=>{if(e(c,2,3,n,r),w(c[0])){const e=u(c[1]);if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(e<0)throw new t(n,"InvalidParameter",r);const i=o(c[2],null),s=c[0];if(s.length>=e)return s.length=e,a;const l=s.length;s.length=e;for(let n=l;n<s.length;n++)s[n]=i;return a}throw new t(n,"InvalidParameter",r)})},F.functions.includes=function(n,r){return F.standardFunction(n,r,(o,u,a)=>{if(e(a,2,2,n,r),w(a[0])){const n=a[1];return!!a[0].some(t=>l(t,n))}if(i(a[0])){const n=a[1];return!!a[0].toArray().some(t=>l(t,n))}throw new t(n,"InvalidParameter",r)})},F.functions.slice=function(n,r){return F.standardFunction(n,r,(a,s,c)=>{if(e(c,1,3,n,r),w(c[0])){const e=u(o(c[1],0)),i=u(o(c[2],c[0].length));if(isNaN(e)||!1===m(e))throw new t(n,"InvalidParameter",r);if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);return c[0].slice(e,i)}if(i(c[0])){const e=c[0],i=u(o(c[1],0)),a=u(o(c[2],e.length()));if(isNaN(i)||!1===m(i))throw new t(n,"InvalidParameter",r);if(isNaN(a)||!1===m(a))throw new t(n,"InvalidParameter",r);return e.toArray().slice(i,a)}throw new t(n,"InvalidParameter",r)})},F.functions.splice=function(n,t){return F.standardFunction(n,t,(n,t,r)=>{const e=[];for(let o=0;o<r.length;o++)w(r[o])?e.push(...r[o]):i(r[o])?e.push(...r[o].toArray()):e.push(r[o]);return e})},F.functions.top=function(n,r){return F.standardFunction(n,r,(o,a,s)=>{if(e(s,2,2,n,r),w(s[0]))return u(s[1])>=s[0].length?s[0].slice():s[0].slice(0,u(s[1]));if(i(s[0]))return u(s[1])>=s[0].length()?s[0].slice():s[0].slice(0,u(s[1]));throw new t(n,"InvalidParameter",r)})},F.functions.first=function(n,t){return F.standardFunction(n,t,(r,o,u)=>(e(u,1,1,n,t),w(u[0])?0===u[0].length?null:u[0][0]:i(u[0])?0===u[0].length()?null:u[0].get(0):null))},"sync"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunction(n,t,(t,r,e)=>N(n,r,e,!1))},F.functions.any=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=i(n);if(g(t)&&!0===t)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0!==i(n))return!1}return!0})},F.functions.none=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){if(!0===i(n))return!1}return!0})},F.functions.reduce=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,3,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);return 2===o.length?0===u.length?null:u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null}):u.reduce((n,t)=>{const r=i(n,t);return n=void 0!==r&&r!==a?r:null},o[2])})},F.functions.map=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=i(n);void 0!==t&&t!==a?s.push(t):s.push(null)}return s})},F.functions.filter=function(n,t){return F.standardFunction(n,t,(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){!0===i(n)&&a.push(n)}return a})}),"async"===F.mode&&(F.functions.sort=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,e)=>N(n,r,e,!0))},F.functions.any=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,g(r)&&!0===r)return!0}return!1})},F.functions.all=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0!==r)return!1}return!0})},F.functions.none=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r);for(const n of u){const t=await i(n);let r=null;if(r=h(r)?await t:t,!0===r)return!1}return!0})},F.functions.filter=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),a=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,!0===r&&a.push(n)}return a})},F.functions.reduce=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,i)=>{e(i,2,3,n,r);const u=i[1].createFunction(n),s=p(i[0],n,r);let c;if(i.length>2){const n=o(i[2],null);c=s.reduce(async(n,t)=>{let r=await n;return void 0!==r&&r!==a||(r=null),u(r,t)},Promise.resolve(n))}else{if(0===s.length)return null;c=s.reduce(async(n,t,r)=>{if(r<=1)return u(n,t);let e=await n;return void 0!==e&&e!==a||(e=null),u(e,t)})}return c.then(n=>void 0!==n&&n!==a?n:null)})},F.functions.map=function(n,t){return F.standardFunctionAsync(n,t,async(t,r,o)=>{e(o,2,2,n,r);const i=o[1].createFunction(n),u=p(o[0],n,r),s=[];for(const n of u){const t=await i(n);let r=null;r=h(r)?await t:t,void 0!==r&&r!==a?s.push(r):s.push(null)}return s})})}const p=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:F},Symbol.toStringTag,{value:"Module"}));export{p as A,F as r};