@arcgis/core 4.22.0 → 4.22.1

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 (88) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{22c0032451a4e1d43167.js → 04adf8c6c5e8ad67aa06.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0677ed519c51710d7629.js +1 -0
  4. package/assets/esri/core/workers/chunks/{8150ec4b80adcf5fca86.js → 2174266668fa6f2df8cc.js} +1 -1
  5. package/assets/esri/core/workers/chunks/25017204ffbd1bbac91f.js +1 -0
  6. package/assets/esri/core/workers/chunks/{95b085ff097005995ced.js → 2d97adeb48adeecd7607.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{753846665158c1c321ee.js → 2f29fb12452d363a1b17.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{67482a0c298e41ea47f5.js → 32efb77e3dabd2c11446.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{dab0bfa26073cf325e08.js → 3a4885bf1cfc82cf2b67.js} +1 -1
  10. package/assets/esri/core/workers/chunks/5a31dfbac9c7e15a4dc5.js +1 -0
  11. package/assets/esri/core/workers/chunks/{d7f77fe32bb2d69b5714.js → 762f45a7ecd40d564be2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/7b12bf4be88ca0e14683.js +1 -0
  13. package/assets/esri/core/workers/chunks/{764126387018aa548f58.js → 8b98fc7d115469e6ae5d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{89d1c5f6ed167515ad24.js → a3b7217566347ab595d0.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{79ddc2e92f0f057f6be3.js → ac9b25ce30f2cd569944.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5915752b754997630665.js → c535188091d83fd50d74.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{8ac288ac3ff8e61b98c4.js → d431b35c274b76150724.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{5f2718cd77cbd5ba7920.js → da62f8159ec2fdbdeb58.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ab635e54fda321961683.js → e7117121160907a593d4.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c32a849111ae061ae194.js → fa9c5dd90d19d4061b40.js} +1 -1
  21. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  22. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  23. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  24. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  25. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  26. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  27. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  28. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  29. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  30. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  31. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  32. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  33. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  34. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  35. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  36. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  37. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  38. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  39. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  40. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  41. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  42. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  43. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  44. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  45. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  46. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  47. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  48. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  49. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  50. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  51. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  52. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  53. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  54. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  55. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  56. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  57. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  58. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  59. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  60. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  61. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  62. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  63. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  64. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  65. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  66. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  67. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  68. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  69. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  70. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  71. package/config.js +1 -1
  72. package/interfaces.d.ts +2 -2
  73. package/layers/mixins/ArcGISImageService.js +1 -1
  74. package/package.json +1 -1
  75. package/rest/query/operations/query.js +1 -1
  76. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  77. package/support/arcadeUtils.js +1 -1
  78. package/support/revision.js +1 -1
  79. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  80. package/views/2d/engine/webgl/collisions/CollisionGrid.js +1 -1
  81. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  82. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  83. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  84. package/widgets/UtilityNetworkTrace.js +1 -1
  85. package/assets/esri/core/workers/chunks/49bb222ee07a768e998d.js +0 -1
  86. package/assets/esri/core/workers/chunks/650f04de72c173beaebc.js +0 -1
  87. package/assets/esri/core/workers/chunks/a680a6acb45fa65436e6.js +0 -1
  88. package/assets/esri/core/workers/chunks/af6251cc7973b43a1523.js +0 -1
@@ -1 +1 @@
1
- {"widgetLabel":"Utility Network Trace","widgetDescription":"A widget to perform traces in a Utility Network.","globalStrings":{"selectTerminalPlaceholder":"Select Terminals","remove":"Remove","locateFeature":"Locate","zoomToFeature":"Zoom to","clearResults":"Discard","select":"Select","cancel":"Cancel","ok":"OK"},"inputsStrings":{"headerTabInputs":"Inputs","headerStartingPoint":"Starting points","startingPointHint":"Add starting points for the trace.","headerBarrier":"Barriers","barrierButton":"Barrier","barrierPointHint":"Add barrier points for the trace.","barrierFilter":"Filter barrier","addPointOption":"Add a point","addPointHint":"Click the map to add a point","removeAllPoints":"Remove all","selectTraces":"Select traces"},"tracingStrings":{"traceOperation":"Trace types","runTrace":"Run"},"resultsStrings":{"headerTabResults":"Results","resultsListOptions":"Options","ellipsesOptions":"Options","displayAttribute":"Display attribute","sortBy":"Sort by","startOverButton":"Clear All","startOverValidation":"Are you sure? All the trace Inputs and Results will be lost.","highlightTrace":"Show graphics","noSelectionResults":"Features cannot be selected. Enable to show graphics instead.","viewFeatures":"Features","selectFeatures":"Select features","graphicColor":"Select color","functionHeader":"Functions","noValue":"No value"},"alertsStrings":{"startingPointAlertHeader":"Starting point missing","startingPointAlert":"Add a starting point to run this trace.","selectTraceAlertHeader":"Trace type not selected","selectTraceAlert":"Select a trace type to run.","NoRunAlertHeader":"No results available","noResultsInfo":"Go to the Inputs tab to select a trace type, add a starting point, and click Run to view the results.","traceExecuting":"Trace in progress...","genericResultHeader":"Trace result","noAssetsFoundHeader":"Cannot add point","noAssetFound":"The point must intersect with a feature on the map.","clearResultsAlert":"Are you sure? All the results for this trace will be discarded.","noTraceSupported":"This map does not support tracing the Utility Network. Publish a web map with a Utility Network and shared Trace Configurations."}}
1
+ {"widgetLabel":"Трасування інженерно-комунікаційної мережі","widgetDescription":"Віджет для виконання трасування в інженерно-комунікаційній мережі.","globalStrings":{"selectTerminalPlaceholder":"Вибрати термінали","remove":"Вилучити","locateFeature":"Знайти","zoomToFeature":"Масштабувати до","clearResults":"Вилучити","select":"Вибрати","cancel":"Скасувати","ok":"OK"},"inputsStrings":{"headerTabInputs":"Введення","headerStartingPoint":"Початкові точки","startingPointHint":"Додати початкові точки для трасування.","headerBarrier":"Бар'єри","barrierButton":"Бар’єр","barrierPointHint":"Додати бар’єрні точки для трасування.","barrierFilter":"Фільтрувальний бар’єр","addPointOption":"Додати точку","addPointHint":"Клацніть карту, щоб додати точку","removeAllPoints":"Видалити всі","selectTraces":"Вибрати трасування"},"tracingStrings":{"traceOperation":"Типи трасування","runTrace":"Запустити"},"resultsStrings":{"headerTabResults":"Результати","resultsListOptions":"Опції","ellipsesOptions":"Опції","displayAttribute":"Відображати атрибут","sortBy":"Сортувати за","startOverButton":"Очистити всі","startOverValidation":"Ви впевнені? Усі вхідні дані та результати трасування будуть втрачені.","highlightTrace":"Показати графіку","noSelectionResults":"Неможливо вибрати об'єкти. Увімкніть, щоб натомість показувати графіку.","viewFeatures":"Об’єкти","selectFeatures":"Вибрати об’єкти","graphicColor":"Вибрати колір","functionHeader":"Функції","noValue":"Без значення"},"alertsStrings":{"startingPointAlertHeader":"Відсутня початкова точка","startingPointAlert":"Додати початкову точку для запуску цього трасування.","selectTraceAlertHeader":"Тип трасування не вибрано","selectTraceAlert":"Виберіть тип трасування для запуску.","NoRunAlertHeader":"Результати недоступні","noResultsInfo":"Перейдіть на вкладку «Введення», щоб вибрати тип трасування, додати початкову точку та натисніть «Запустити», щоб переглянути результати.","traceExecuting":"Триває трасування...","genericResultHeader":"Результат трасування","noAssetsFoundHeader":"Неможливо додати точку","noAssetFound":"Точка повинна перетинатися з об’єктом на карті.","clearResultsAlert":"Ви впевнені? Усі результати для цього трасування будуть скасовані.","noTraceSupported":"Ця карта не підтримує трасування інженерно-комунікаційної мережі. Публікування веб-карти з інженерно-комунікаційною мережею та спільними конфігураціями трасування."}}
@@ -1 +1 @@
1
- {"widgetLabel":"Utility Network Trace","widgetDescription":"A widget to perform traces in a Utility Network.","globalStrings":{"selectTerminalPlaceholder":"Select Terminals","remove":"Remove","locateFeature":"Locate","zoomToFeature":"Zoom to","clearResults":"Discard","select":"Select","cancel":"Cancel","ok":"OK"},"inputsStrings":{"headerTabInputs":"Inputs","headerStartingPoint":"Starting points","startingPointHint":"Add starting points for the trace.","headerBarrier":"Barriers","barrierButton":"Barrier","barrierPointHint":"Add barrier points for the trace.","barrierFilter":"Filter barrier","addPointOption":"Add a point","addPointHint":"Click the map to add a point","removeAllPoints":"Remove all","selectTraces":"Select traces"},"tracingStrings":{"traceOperation":"Trace types","runTrace":"Run"},"resultsStrings":{"headerTabResults":"Results","resultsListOptions":"Options","ellipsesOptions":"Options","displayAttribute":"Display attribute","sortBy":"Sort by","startOverButton":"Clear All","startOverValidation":"Are you sure? All the trace Inputs and Results will be lost.","highlightTrace":"Show graphics","noSelectionResults":"Features cannot be selected. Enable to show graphics instead.","viewFeatures":"Features","selectFeatures":"Select features","graphicColor":"Select color","functionHeader":"Functions","noValue":"No value"},"alertsStrings":{"startingPointAlertHeader":"Starting point missing","startingPointAlert":"Add a starting point to run this trace.","selectTraceAlertHeader":"Trace type not selected","selectTraceAlert":"Select a trace type to run.","NoRunAlertHeader":"No results available","noResultsInfo":"Go to the Inputs tab to select a trace type, add a starting point, and click Run to view the results.","traceExecuting":"Trace in progress...","genericResultHeader":"Trace result","noAssetsFoundHeader":"Cannot add point","noAssetFound":"The point must intersect with a feature on the map.","clearResultsAlert":"Are you sure? All the results for this trace will be discarded.","noTraceSupported":"This map does not support tracing the Utility Network. Publish a web map with a Utility Network and shared Trace Configurations."}}
1
+ {"widgetLabel":"Theo dõi Mạng lưới Tiện ích","widgetDescription":"Một tiện ích để thực hiện theo dõi trong Mạng lưới Tiện ích.","globalStrings":{"selectTerminalPlaceholder":"Chọn Đầu cuối","remove":"Gỡ bỏ","locateFeature":"Định vị","zoomToFeature":"Phóng tới","clearResults":"Hủy","select":"Chọn","cancel":"Hủy","ok":"OK"},"inputsStrings":{"headerTabInputs":"Đầu vào","headerStartingPoint":"Điểm bắt đầu","startingPointHint":"Thêm điểm bắt đầu cho hoạt động theo dõi.","headerBarrier":"Rào cản","barrierButton":"Rào cản","barrierPointHint":"Thêm điểm rào cản cho hoạt động theo dõi.","barrierFilter":"Lọc rào cản","addPointOption":"Thêm một điểm","addPointHint":"Nhấp vào bản đồ để thêm điểm","removeAllPoints":"Xóa tất cả","selectTraces":"Chọn theo dõi"},"tracingStrings":{"traceOperation":"Loại theo dõi","runTrace":"Chạy"},"resultsStrings":{"headerTabResults":"Kết quả","resultsListOptions":"Tùy chọn","ellipsesOptions":"Tùy chọn","displayAttribute":"Hiển thị thuộc tính","sortBy":"Sắp xếp theo","startOverButton":"Xóa tất cả","startOverValidation":"Bạn có chắc không? Tất cả Đầu vào và Kết quả theo dõi sẽ bị mất.","highlightTrace":"Hiển thị đồ họa","noSelectionResults":"Không thể chọn đối tượng này. Bật để hiển thị đồ họa.","viewFeatures":"Đối tượng","selectFeatures":"Chọn các đối tượng","graphicColor":"Chọn màu sắc","functionHeader":"Chức năng","noValue":"Không có giá trị"},"alertsStrings":{"startingPointAlertHeader":"Thiếu điểm bắt đầu","startingPointAlert":"Thêm một điểm bắt đầu để chạy hoạt động theo dõi này.","selectTraceAlertHeader":"Chưa chọn loại theo dõi","selectTraceAlert":"Chọn một loại theo dõi để chạy.","NoRunAlertHeader":"Không có kết quả nào","noResultsInfo":"Đi đến tab Đầu vào để chọn loại theo dõi, thêm điểm bắt đầu và nhấp vào Chạy để xem kết quả.","traceExecuting":"Đang tiến hành theo dõi...","genericResultHeader":"Kết quả theo dõi","noAssetsFoundHeader":"Không thể thêm điểm","noAssetFound":"Điểm phải giao cắt với một đối tượng trên bản đồ.","clearResultsAlert":"Bạn có chắc không? Tất cả kết quả cho lần theo dõi này sẽ bị hủy bỏ.","noTraceSupported":"Bản đồ này không hỗ trợ việc theo dõi Mạng lưới Tiện ích. Xuất bản bản đồ web có Mạng lưới Tiện ích và Cấu hình Theo dõi được chia sẻ."}}
@@ -1 +1 @@
1
- {"widgetLabel":"Utility Network Trace","widgetDescription":"A widget to perform traces in a Utility Network.","globalStrings":{"selectTerminalPlaceholder":"Select Terminals","remove":"Remove","locateFeature":"Locate","zoomToFeature":"Zoom to","clearResults":"Discard","select":"Select","cancel":"Cancel","ok":"OK"},"inputsStrings":{"headerTabInputs":"Inputs","headerStartingPoint":"Starting points","startingPointHint":"Add starting points for the trace.","headerBarrier":"Barriers","barrierButton":"Barrier","barrierPointHint":"Add barrier points for the trace.","barrierFilter":"Filter barrier","addPointOption":"Add a point","addPointHint":"Click the map to add a point","removeAllPoints":"Remove all","selectTraces":"Select traces"},"tracingStrings":{"traceOperation":"Trace types","runTrace":"Run"},"resultsStrings":{"headerTabResults":"Results","resultsListOptions":"Options","ellipsesOptions":"Options","displayAttribute":"Display attribute","sortBy":"Sort by","startOverButton":"Clear All","startOverValidation":"Are you sure? All the trace Inputs and Results will be lost.","highlightTrace":"Show graphics","noSelectionResults":"Features cannot be selected. Enable to show graphics instead.","viewFeatures":"Features","selectFeatures":"Select features","graphicColor":"Select color","functionHeader":"Functions","noValue":"No value"},"alertsStrings":{"startingPointAlertHeader":"Starting point missing","startingPointAlert":"Add a starting point to run this trace.","selectTraceAlertHeader":"Trace type not selected","selectTraceAlert":"Select a trace type to run.","NoRunAlertHeader":"No results available","noResultsInfo":"Go to the Inputs tab to select a trace type, add a starting point, and click Run to view the results.","traceExecuting":"Trace in progress...","genericResultHeader":"Trace result","noAssetsFoundHeader":"Cannot add point","noAssetFound":"The point must intersect with a feature on the map.","clearResultsAlert":"Are you sure? All the results for this trace will be discarded.","noTraceSupported":"This map does not support tracing the Utility Network. Publish a web map with a Utility Network and shared Trace Configurations."}}
1
+ {"widgetLabel":"公共设施追踪","widgetDescription":"用于在公共设施网络中执行追踪的微件。","globalStrings":{"selectTerminalPlaceholder":"选择终端","remove":"移除","locateFeature":"定位","zoomToFeature":"缩放至","clearResults":"放弃","select":"选择","cancel":"取消","ok":"确定"},"inputsStrings":{"headerTabInputs":"输入","headerStartingPoint":"起点","startingPointHint":"添加追踪起点。","headerBarrier":"障碍","barrierButton":"障碍","barrierPointHint":"添加追踪障碍点。","barrierFilter":"过滤器障碍","addPointOption":"添加点","addPointHint":"单击地图添加点。","removeAllPoints":"全部移除","selectTraces":"选择轨迹"},"tracingStrings":{"traceOperation":"追踪类型","runTrace":"运行"},"resultsStrings":{"headerTabResults":"结果","resultsListOptions":"选项","ellipsesOptions":"选项","displayAttribute":"显示属性","sortBy":"排序方式","startOverButton":"全部清除","startOverValidation":"是否确定? 所有追踪“输入”和“结果”均将丢失。","highlightTrace":"显示图形","noSelectionResults":"无法选择要素。 启用以显示图形。","viewFeatures":"要素","selectFeatures":"选择要素","graphicColor":"选择颜色","functionHeader":"函数","noValue":"没有值"},"alertsStrings":{"startingPointAlertHeader":"起点缺失","startingPointAlert":"添加一个起点来运行此追踪。","selectTraceAlertHeader":"未选择追踪类型","selectTraceAlert":"选择要运行的追踪类型。","NoRunAlertHeader":"无可用结果","noResultsInfo":"转至“输入”选项卡以选择追踪类型,添加起点,然后单击“运行”来查看结果。","traceExecuting":"追踪进行中...","genericResultHeader":"追踪结果","noAssetsFoundHeader":"无法添加点","noAssetFound":"该点必须与地图上的要素相交。","clearResultsAlert":"是否确定? 将丢弃此追踪的所有结果。","noTraceSupported":"此地图不支持追踪公共设施网络。 发布具有公共设施网络和共享追踪配置的 web 地图。"}}
@@ -1 +1 @@
1
- {"widgetLabel":"Utility Network Trace","widgetDescription":"A widget to perform traces in a Utility Network.","globalStrings":{"selectTerminalPlaceholder":"Select Terminals","remove":"Remove","locateFeature":"Locate","zoomToFeature":"Zoom to","clearResults":"Discard","select":"Select","cancel":"Cancel","ok":"OK"},"inputsStrings":{"headerTabInputs":"Inputs","headerStartingPoint":"Starting points","startingPointHint":"Add starting points for the trace.","headerBarrier":"Barriers","barrierButton":"Barrier","barrierPointHint":"Add barrier points for the trace.","barrierFilter":"Filter barrier","addPointOption":"Add a point","addPointHint":"Click the map to add a point","removeAllPoints":"Remove all","selectTraces":"Select traces"},"tracingStrings":{"traceOperation":"Trace types","runTrace":"Run"},"resultsStrings":{"headerTabResults":"Results","resultsListOptions":"Options","ellipsesOptions":"Options","displayAttribute":"Display attribute","sortBy":"Sort by","startOverButton":"Clear All","startOverValidation":"Are you sure? All the trace Inputs and Results will be lost.","highlightTrace":"Show graphics","noSelectionResults":"Features cannot be selected. Enable to show graphics instead.","viewFeatures":"Features","selectFeatures":"Select features","graphicColor":"Select color","functionHeader":"Functions","noValue":"No value"},"alertsStrings":{"startingPointAlertHeader":"Starting point missing","startingPointAlert":"Add a starting point to run this trace.","selectTraceAlertHeader":"Trace type not selected","selectTraceAlert":"Select a trace type to run.","NoRunAlertHeader":"No results available","noResultsInfo":"Go to the Inputs tab to select a trace type, add a starting point, and click Run to view the results.","traceExecuting":"Trace in progress...","genericResultHeader":"Trace result","noAssetsFoundHeader":"Cannot add point","noAssetFound":"The point must intersect with a feature on the map.","clearResultsAlert":"Are you sure? All the results for this trace will be discarded.","noTraceSupported":"This map does not support tracing the Utility Network. Publish a web map with a Utility Network and shared Trace Configurations."}}
1
+ {"widgetLabel":"公用事業網路追蹤","widgetDescription":"在公用事業網路中執行追蹤的 widget。","globalStrings":{"selectTerminalPlaceholder":"選擇終端","remove":"移除","locateFeature":"定位","zoomToFeature":"縮放至","clearResults":"放棄","select":"選擇","cancel":"取消","ok":"確定"},"inputsStrings":{"headerTabInputs":"輸入","headerStartingPoint":"起點","startingPointHint":"新增追蹤的起點。","headerBarrier":"屏障","barrierButton":"屏障","barrierPointHint":"新增追蹤的屏障點。","barrierFilter":"篩選屏障","addPointOption":"新增一點","addPointHint":"按一下地圖以新增點","removeAllPoints":"全部移除","selectTraces":"選擇軌跡"},"tracingStrings":{"traceOperation":"追蹤類型","runTrace":"執行"},"resultsStrings":{"headerTabResults":"結果","resultsListOptions":"選項","ellipsesOptions":"選項","displayAttribute":"顯示屬性","sortBy":"排序方式","startOverButton":"全部清除","startOverValidation":"是否確定? 將遺失所有追蹤輸入和結果。","highlightTrace":"顯示圖形","noSelectionResults":"無法選擇圖徵。 啟用以改為顯示圖形。","viewFeatures":"圖徽","selectFeatures":"選擇圖徵","graphicColor":"選擇顏色","functionHeader":"函數","noValue":"沒有值"},"alertsStrings":{"startingPointAlertHeader":"起點遺失","startingPointAlert":"新增起點以執行此追蹤。","selectTraceAlertHeader":"未選擇追蹤類型","selectTraceAlert":"選擇要執行的追蹤類型。","NoRunAlertHeader":"無可用結果","noResultsInfo":"移至「輸入」頁籤以選擇追蹤類型,新增起點,再按一下「執行」以檢視結果。","traceExecuting":"追蹤進行中...","genericResultHeader":"追蹤結果","noAssetsFoundHeader":"無法新增點","noAssetFound":"點必須與地圖上的圖徵相交","clearResultsAlert":"是否確定? 將捨棄此追蹤的所有結果。","noTraceSupported":"此地圖不支援追蹤公用事業網路。 使用公用事業網路發佈 Web 地圖,並分享追蹤配置"}}
@@ -1 +1 @@
1
- {"widgetLabel":"Utility Network Trace","widgetDescription":"A widget to perform traces in a Utility Network.","globalStrings":{"selectTerminalPlaceholder":"Select Terminals","remove":"Remove","locateFeature":"Locate","zoomToFeature":"Zoom to","clearResults":"Discard","select":"Select","cancel":"Cancel","ok":"OK"},"inputsStrings":{"headerTabInputs":"Inputs","headerStartingPoint":"Starting points","startingPointHint":"Add starting points for the trace.","headerBarrier":"Barriers","barrierButton":"Barrier","barrierPointHint":"Add barrier points for the trace.","barrierFilter":"Filter barrier","addPointOption":"Add a point","addPointHint":"Click the map to add a point","removeAllPoints":"Remove all","selectTraces":"Select traces"},"tracingStrings":{"traceOperation":"Trace types","runTrace":"Run"},"resultsStrings":{"headerTabResults":"Results","resultsListOptions":"Options","ellipsesOptions":"Options","displayAttribute":"Display attribute","sortBy":"Sort by","startOverButton":"Clear All","startOverValidation":"Are you sure? All the trace Inputs and Results will be lost.","highlightTrace":"Show graphics","noSelectionResults":"Features cannot be selected. Enable to show graphics instead.","viewFeatures":"Features","selectFeatures":"Select features","graphicColor":"Select color","functionHeader":"Functions","noValue":"No value"},"alertsStrings":{"startingPointAlertHeader":"Starting point missing","startingPointAlert":"Add a starting point to run this trace.","selectTraceAlertHeader":"Trace type not selected","selectTraceAlert":"Select a trace type to run.","NoRunAlertHeader":"No results available","noResultsInfo":"Go to the Inputs tab to select a trace type, add a starting point, and click Run to view the results.","traceExecuting":"Trace in progress...","genericResultHeader":"Trace result","noAssetsFoundHeader":"Cannot add point","noAssetFound":"The point must intersect with a feature on the map.","clearResultsAlert":"Are you sure? All the results for this trace will be discarded.","noTraceSupported":"This map does not support tracing the Utility Network. Publish a web map with a Utility Network and shared Trace Configurations."}}
1
+ {"widgetLabel":"公用事業網路追蹤","widgetDescription":"在公用事業網路中執行追蹤的 widget。","globalStrings":{"selectTerminalPlaceholder":"選擇終端","remove":"移除","locateFeature":"定位","zoomToFeature":"縮放至","clearResults":"放棄","select":"選擇","cancel":"取消","ok":"確定"},"inputsStrings":{"headerTabInputs":"輸入","headerStartingPoint":"起點","startingPointHint":"新增追蹤的起點。","headerBarrier":"屏障","barrierButton":"屏障","barrierPointHint":"新增追蹤的屏障點。","barrierFilter":"篩選屏障","addPointOption":"新增一點","addPointHint":"按一下地圖以新增點","removeAllPoints":"全部移除","selectTraces":"選擇軌跡"},"tracingStrings":{"traceOperation":"追蹤類型","runTrace":"執行"},"resultsStrings":{"headerTabResults":"結果","resultsListOptions":"選項","ellipsesOptions":"選項","displayAttribute":"顯示屬性","sortBy":"排序方式","startOverButton":"全部清除","startOverValidation":"是否確定? 將遺失所有追蹤輸入和結果。","highlightTrace":"顯示圖形","noSelectionResults":"無法選擇圖徵。 啟用以改為顯示圖形。","viewFeatures":"圖徽","selectFeatures":"選擇圖徵","graphicColor":"選擇顏色","functionHeader":"函數","noValue":"沒有值"},"alertsStrings":{"startingPointAlertHeader":"起點遺失","startingPointAlert":"新增起點以執行此追蹤。","selectTraceAlertHeader":"未選擇追蹤類型","selectTraceAlert":"選擇要執行的追蹤類型。","NoRunAlertHeader":"無可用結果","noResultsInfo":"移至「輸入」頁籤以選擇追蹤類型,新增起點,再按一下「執行」以檢視結果。","traceExecuting":"追蹤進行中...","genericResultHeader":"追蹤結果","noAssetsFoundHeader":"無法新增點","noAssetFound":"點必須與地圖上的圖徵相交","clearResultsAlert":"是否確定? 將捨棄此追蹤的所有結果。","noTraceSupported":"此地圖不支援追蹤公用事業網路。 使用公用事業網路發佈 Web 地圖,並分享追蹤配置"}}
package/config.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.22/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";var s;const r={apiKey:void 0,applicationUrl:null==(s=globalThis.location)?void 0:s.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.22.0";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";var s;const r={apiKey:void 0,applicationUrl:null==(s=globalThis.location)?void 0:s.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryService:null,geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.22.1";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
package/interfaces.d.ts CHANGED
@@ -37492,7 +37492,7 @@ declare namespace __esri {
37492
37492
  */
37493
37493
  spatialReference: SpatialReference;
37494
37494
  /**
37495
- * An [Collection](/api-reference/esri-core-Collection.html) of [Sublayer](/api-reference/esri-layers-support-Sublayer.html) objects used to change the layer ordering and/or rendering, or redefine the map.
37495
+ * An [Collection](esri-core-Collection.html) of [Sublayer](esri-layers-support-Sublayer.html) objects used to change the layer ordering and/or rendering, or redefine the map.
37496
37496
  *
37497
37497
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers)
37498
37498
  */
@@ -37639,7 +37639,7 @@ declare namespace __esri {
37639
37639
  */
37640
37640
  spatialReference?: SpatialReferenceProperties;
37641
37641
  /**
37642
- * An [Collection](/api-reference/esri-core-Collection.html) of [Sublayer](/api-reference/esri-layers-support-Sublayer.html) objects used to change the layer ordering and/or rendering, or redefine the map.
37642
+ * An [Collection](esri-core-Collection.html) of [Sublayer](esri-layers-support-Sublayer.html) objects used to change the layer ordering and/or rendering, or redefine the map.
37643
37643
  *
37644
37644
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers)
37645
37645
  */
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import{read as r,rasterRendererTypes as i,websceneRasterRendererTypes as s}from"../../rasterRenderers.js";import n from"../../request.js";import a from"../../core/Error.js";import{strict as o}from"../../core/jsonMap.js";import{clone as l}from"../../core/lang.js";import u from"../../core/Logger.js";import{isSome as p,isNone as c,unwrap as m}from"../../core/maybe.js";import{when as d}from"../../core/promiseUtils.js";import{urlToObject as h}from"../../core/urlUtils.js";import{aliasOf as f}from"../../core/accessorSupport/decorators/aliasOf.js";import{ensureClass as y,Integer as g,ensureNumber as R}from"../../core/accessorSupport/ensureType.js";import{property as v,ensureRange as x}from"../../core/accessorSupport/decorators/property.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{subclass as S}from"../../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../../core/accessorSupport/decorators/writer.js";import{opacity as _,url as w}from"../support/commonProperties.js";import F from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as O}from"../support/ExportImageServiceParameters.js";import P from"../support/Field.js";import T from"../support/FieldsIndex.js";import{isSupportedRendererType as D}from"../support/imageryRendererUtils.js";import N from"../support/MosaicRule.js";import j from"../support/PixelBlock.js";import{interpolationKebab as C,noDataInterpretationKebab as M}from"../support/rasterEnums.js";import J from"../support/RasterFunction.js";import q from"../support/RasterInfo.js";import V from"../support/RasterJobHandler.js";import{decode as A,getFormat as z}from"../support/rasterFormats/RasterCodec.js";import{uvComponentToVector as Q}from"../support/rasterFunctions/vectorFieldUtils.js";import{getSupportedRendererTypes as E,getDefaultBandCombination as U,createDefaultRenderer as H,normalizeRendererJSON as L}from"../../renderers/support/rasterRendererHelper.js";import k from"../../renderers/support/RasterSymbolizer.js";import{computeAngles as B,computePixelSpaceLocations as G,computeHistograms as W,computeStatisticsHistograms as X,getImageSpatialReferenceQueryParameter as Y,getSamples as K,identify as $}from"../../rest/imageService.js";import"../../core/unitUtils.js";import"../../kernel.js";import"../../rest/query/support/AttachmentInfo.js";import"../../rest/support/AttachmentQuery.js";import{executeForCount as Z}from"../../rest/query/executeForCount.js";import ee from"../../geometry/Extent.js";import"../../geometry/Geometry.js";import"../../geometry/Multipoint.js";import te from"../../geometry/Point.js";import re from"../../geometry/Polygon.js";import"../../geometry/Polyline.js";import"../../geometry/support/normalizeUtils.js";import"../../core/pbf.js";import"../../geometry/support/spatialReferenceUtils.js";import ie from"../../rest/support/Query.js";import{executeForIds as se}from"../../rest/query/executeForIds.js";import{executeQueryJSON as ne}from"../../rest/query/executeQueryJSON.js";import"../../core/has.js";import"../graphics/featureConversionUtils.js";import ae from"../../rest/support/FeatureSet.js";import"../../rest/support/RelationshipQuery.js";import"../../rest/support/TopFeaturesQuery.js";import oe from"../../rest/support/ImageAngleParameters.js";import le from"../../rest/support/ImageHistogramParameters.js";import ue from"../../rest/support/ImageIdentifyParameters.js";import pe from"../../rest/support/ImagePixelLocationParameters.js";import ce from"../../rest/support/ImageSampleParameters.js";import{createStreamlinesMesh as me}from"../../views/2d/engine/flow/dataUtils.js";import de from"../../geometry/SpatialReference.js";const he=u.getLogger("esri.layers.mixins.ArcGISImageService"),fe=o()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),ye=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),ge=x(R,{min:0,max:255});function Re(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi),r=null==t?void 0:t.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return r?r.join("/"):null}const ve=o=>{let u=class extends o{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._symbolizer=null,this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandCount=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelSizeX=null,this.pixelSizeY=null,this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.renderer=null,this.rasterAttributeTable=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=null}initialize(){this._set("exportImageServiceParameters",new O({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?N.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,r){null!=e&&"lerc"!==this.format&&(t[r]=e)}writeCompressionTolerance(e,t,r){"lerc"===this.format&&null!=e&&(t[r]=e)}get fieldsIndex(){return this.fields?new T(this.fields):null}set format(e){e&&ye.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=N.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const r=e||t.mosaicRule;return r?N.fromJSON(r):this._isMosaicRuleSupported(t)?N.fromJSON(t):null}writeMosaicRule(e,t,r){let i=this.mosaicRule;const s=this.definitionExpression;i?s&&s!==i.where&&(i=i.clone(),i.where=s):s&&(i=new N({where:s})),this._isValidCustomizedMosaicRule(i)&&(t[r]=i.toJSON())}writeNoData(e,t,r){null!=e&&"number"==typeof e&&(t[r]=ge(e))}readObjectIdField(e,t){if(!e){const r=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=r&&r[0]&&r[0].name}return e}get parsedUrl(){return this.url?h(this.url):null}readRenderer(e,t,i){var s,n;const a=null==t||null==(s=t.layerDefinition)||null==(n=s.drawingInfo)?void 0:n.renderer,o=r(a,i);return null==o?null:("vector-field"===o.type&&t.symbolTileSize&&!a.symbolTileSize&&(o.symbolTileSize=t.symbolTileSize),D(o)||he.warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),o)}writeRenderer(e,t,r){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new P({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new P({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new P({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let s=this.fields?l(this.fields):[];s.push(r),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&s.push(t),this.version>=10.4&&p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&s.push(i),p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{s.push(new P({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),null==this.pixelFilter||"esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType||(s.push(new P({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),s.push(new P({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const n=this.rasterInfo.attributeTable&&this.rasterInfo.attributeTable.fields||null;if(n&&n.length>0){const t=n.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const r=l(t);return r.name=e+t.name,r}));s=s.concat(t)}return s}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const r=t.rasterFunctionInfos;return t.renderingRule||r&&r.length&&"None"!==r[0].name?J.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,r){this._isRFTJson(e)||(t[r]=e.toJSON())}readSpatialReference(e,t){const r=e||t.extent.spatialReference;return r?de.fromJSON(r):null}readPixelType(e){return fe.fromJSON(e)||e}writePixelType(e,t,r){(c(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[r]=fe.toJSON(e))}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),r}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let r=e;if(!this._isPicture()&&this.renderer&&this._symbolizer&&!this.pixelFilter){const i=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),s=this._rasterJobHandler.instance,{bandIds:n}=this;if(s){i&&(this._symbolizer.bind(),await s.updateSymbolizer(this._symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await s.symbolize({bandIds:n,...e},t);r={extent:e.extent,pixelBlock:a}}else r={extent:e.extent,pixelBlock:this._symbolizer.symbolize({bandIds:n,...e})}}return r}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputeAngles)throw new a("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=y(oe,e).clone(),B(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new a("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=y(pe,e).clone(),G(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputeHistograms)throw new a("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=y(le,e).clone();const{raster:r,mosaicRule:i,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),i&&null==e.mosaicRule&&(e.mosaicRule=i),r&&null==e.raster&&(e.raster=r),W(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new a("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=y(le,e).clone();const{raster:r,mosaicRule:i,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),i&&null==e.mosaicRule&&(e.mosaicRule=i),r&&null==e.raster&&(e.raster=r),X(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return p(t)?t.get(e):void 0}getFieldDomain(e,t){const r=this.getField(e);return r?r.domain:null}fetchImage(e,t,r,i={}){if(null==e||null==t||null==r)return Promise.reject(new a("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const s=this.renderer||this._symbolizer?this.generateRasterInfo(this.renderingRule,{signal:i.signal}):null;return d(s).then((s=>{s&&(this.rasterInfo=s);const n={imageServiceParameters:this.getExportImageServiceParameters(e,t,r,i.timeExtent),imageProps:{extent:e,width:t,height:r,format:this.format},requestAsImageElement:i.requestAsImageElement&&!this.pixelFilter||!1,signal:i.signal};return this._requestArrayBuffer(n)}))}fetchKeyProperties(e){const t=e&&e.renderingRule&&e.renderingRule.toJSON();return n(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3&&t?JSON.stringify(t):null})}).then((e=>e.data))}fetchRasterAttributeTable(e){const t=e&&e.renderingRule&&e.renderingRule.toJSON();return this.version<10.1?Promise.reject(new a("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):n(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3&&t?JSON.stringify(t):null})}).then((e=>ae.fromJSON(e.data)))}async getCatalogItemRasterInfo(e,t){const r=n(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t}).then((e=>e.data)),i=n(this.parsedUrl.path+"/"+e+"/info/keyProperties",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>{})),s=await Promise.all([r,i]);if(!s[0])return;const a=ee.fromJSON(s[0].extent),o=s[0].statistics?s[0].statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))):null;return new q({bandCount:s[0].bandCount,extent:a,spatialReference:a.sr,pixelSize:new te({x:s[0].pixelSizeX,y:s[0].pixelSizeY,spatialReference:a.sr}),pixelType:s[0].pixelType.toLowerCase(),statistics:o,histograms:s[0].histograms,keyProperties:s[1]||{}})}async getCatalogItemICSInfo(e,t){const{data:r}=await n(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),i=r&&r.ics;if(!i)return;let s=null;try{s=(await n(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:i,icsToPixelTransform:null,icsExtent:null,northDirection:null};const a=this.version>=10.7?n(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},o=s.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[s]}),inSR:o.wkid||JSON.stringify(o),outSR:"0:"+e},u=n(this.parsedUrl.path+"/project",{query:this._getQueryParams(l),...t}).then((e=>e.data)).catch((()=>({}))),p=5,c=(s.xmin+s.xmax)/2,m=(s.ymax-s.ymin)/(p+1),d=s.ymin+m,h=[];for(let n=0;n<p;n++)h.push({x:c,y:d+m*n});const f={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:h}),inSR:o.wkid||JSON.stringify(o),outSR:"0:"+e},y=n(this.parsedUrl.path+"/project",{query:this._getQueryParams(f),...t}).then((e=>e.data)).catch((()=>({}))),g=await Promise.all([a,u,y]);let R=g[0].ipxf;if(null==R){var v,x,b;const e=null==(v=i.geodataXform)?void 0:v.xf_0;"topup"===(null==e||null==(x=e.name)?void 0:x.toLowerCase())&&6===(null==e||null==(b=e.coefficients)?void 0:b.length)&&(R={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const S=ee.fromJSON(g[1]&&g[1].geometries&&g[1].geometries[0]);S&&(S.spatialReference=new de({wkid:0,imageCoordinateSystem:i}));const I=g[2].geometries?g[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],_=I.length;if(_<3)return{ics:i,icsToPixelTransform:R,icsExtent:S,northDirection:null};let w=0,F=0,O=0,P=0;for(let n=0;n<_;n++)w+=I[n].x,F+=I[n].y,O+=I[n].x*I[n].x,P+=I[n].x*I[n].y;const T=(_*P-w*F)/(_*O-w*w);let D=0;const N=I[p-1].x>I[0].x,j=I[p-1].y>I[0].y;return T===1/0?D=j?90:270:0===T?D=N?0:180:T>0?D=N?180*Math.atan(T)/Math.PI:180*Math.atan(T)/Math.PI+180:T<0&&(D=j?180+180*Math.atan(T)/Math.PI:360+180*Math.atan(T)/Math.PI),{ics:i,icsToPixelTransform:R,icsExtent:S,northDirection:D}}async generateRasterInfo(e,t){if((!e||"none"===e.functionName.toLowerCase()||this._isVectorFieldResampleFunction(e))&&p(this.serviceRasterInfo))return this.serviceRasterInfo;const r=Re(e);if(this._functionRasterInfos[r])return this._functionRasterInfos[r];const i=this._generateRasterInfo(e,t);this._functionRasterInfos[r]=i;try{return await i}catch{return this._functionRasterInfos[r]=null,null}}getExportImageServiceParameters(e,t,r,i){e=e.clone().shiftCentralMeridian();const s=Y(e.spatialReference,this.parsedUrl.path);p(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const n=this.exportImageServiceParameters.toJSON(),{bandIds:a,noData:o}=n;let{renderingRule:l}=n;const u=this.renderingRule&&"none"!==this.renderingRule.functionName.toLowerCase(),c=!this.renderer||"raster-stretch"===this.renderer.type;if(null!=a&&a.length&&u&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:a}};if("Stretch"===l.rasterFunction)e.rasterFunctionArguments.Raster=l.rasterFunctionArguments.Raster,l.rasterFunctionArguments.Raster=e;else if("Colormap"===l.rasterFunction){const t=l.rasterFunctionArguments.Raster;"Stretch"===(null==t?void 0:t.rasterFunction)?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,l.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=l,l=e;n.bandIds=void 0}else n.bandIds=null==a?void 0:a.join(",");o instanceof Array&&o.length>0&&(n.noData=o.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,i):null;n.mosaicRule=m&&JSON.stringify(m),n.renderingRule=l&&JSON.stringify(l);const d={};if(i){const{start:e,end:t}=i.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${null==e?"null":e},${null==t?"null":t}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:s,imageSR:s,size:t+","+r,...n,...d}}async getSamples(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsGetSamples)throw new a("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=y(ce,e).clone();const{raster:r}=this;return r&&null==e.raster&&(e.raster=r),K(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsIdentify)throw new a("imagery-layer:query-rasters","query operation is not supported on the input image service");e=y(ue,e).clone();const{raster:r,mosaicRule:i,renderingRule:s}=this;if(s&&null==e.renderingRule&&(e.renderingRule=s),i&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(i,e.timeExtent);e.mosaicRule=m(t)}return r&&null==e.raster&&(e.raster=r),$(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new ie;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),ne(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),se(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Z(this.url,e,t)}queryVisibleRasters(e,t){if(!e)return Promise.reject(new a("imagery-layer: query-visible-rasters","missing query parameter"));const{pixelSize:r,returnDomainValues:i,returnTopmostRaster:s,showNoDataRecords:n}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const m="raster.servicepixelvalue",d=this.rasterFunctionNamesIndex;if(p(e.outFields)&&(o=e.outFields.some((e=>-1===e.toLowerCase().indexOf(m))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().indexOf(m)>-1&&e.length>m.length)).map((e=>{const t=e.slice(m.length+1);return[this._updateRenderingRulesFunctionName(t,d),t]}));l=t.map((e=>new J({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const h=c(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),f=e.timeExtent||this.timeExtent,y=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,f),g=this._getQueryParams({geometry:e.geometry,timeExtent:f,mosaicRule:y,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:r,returnCatalogItems:o,returnGeometry:h,raster:this.raster,maxItemCount:s?1:null});delete g.f;const R=new ue(g),v=this.generateRasterInfo(this.renderingRule);return new Promise((r=>{v.then((()=>{$(this.url,R,{signal:null==t?void 0:t.signal,query:{...this.customParameters}}).then((t=>{var s;const l=e.outFields,p=t.value.toLowerCase().indexOf("nodata")>-1;if(o&&!h&&null!=t&&null!=(s=t.catalogItems)&&s.features.length&&(n||!p)){const s=this.objectIdField||"ObjectId",o=t.catalogItems.features,p=o.map((e=>e.attributes&&e.attributes[s])),c=new ie({objectIds:p,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[s]});return this.queryRasters(c).then((a=>{a&&a.features&&a.features.length>0&&a.features.forEach((t=>{o.forEach((r=>{r.attributes[s]===t.attributes[s]&&(r.geometry=new re(t.geometry),r.geometry.spatialReference=e.outSpatialReference)}))})),r(this._processVisibleRastersResponse(t,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:l}))})).catch((()=>{throw new a("imagery-layer:query-visible-rasters","encountered error when querying visible rasters geometry")}))}r(this._processVisibleRastersResponse(t,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:l}))})).catch((()=>{throw new a("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}))}))}))}async fetchVariableStatisticsHistograms(e,t){const r=n(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.statistics})),i=n(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),s=await Promise.all([r,i]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createStreamlinesMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createStreamlinesMesh(e,t):me(e.rendererSettings,e.flowData,p(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),p(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,r=p(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):this._fetchAuxiliaryRasterInfo({serviceInfo:t,signal:e}).then((e=>(this._set("serviceRasterInfo",e),e))),i=this.renderingRule&&"none"!==this.renderingRule.functionName.toLowerCase()?this.generateRasterInfo(this.renderingRule,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([r,i,s]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this.renderer=null,he.warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._configDefaultRenderer(),this.watch("renderer",(()=>this._configDefaultRenderer())),this.watch("renderingRule",(e=>{(this.renderer||this._symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))}));const t=p(this.serviceRasterInfo)&&this.serviceRasterInfo.multidimensionalInfo;t&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const r=this.timeInfo;if(c(e)||c(this.multidimensionalInfo)||c(t)||c(null==r?void 0:r.startField))return e;const{startField:i}=r;var s;if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=null==(s=e.multidimensionalDefinition)?void 0:s.filter((e=>e.dimensionName!==i)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const n=e.multidimensionalDefinition.filter((e=>e.dimensionName===i)),a=p(t.start)?t.start.getTime():null,o=p(t.end)?t.end.getTime():null,l=null==a||null==o||a===o,u=l?[a||o]:[[a,o]],m=this.version>=10.8;if(n.length)n.forEach((e=>{e.dimensionName===i&&(m?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=l,e.values=u))}));else if(!m){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=i,e.isSlice=l,e.values=u})):e.multidimensionalDefinition.push(new F({variableName:"",dimensionName:i,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return c(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){var r;if(await this._fetchCapabilities(null==(r=t)?void 0:r.signal),!this.capabilities.operations.supportsQuery)throw new a("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=p(e)?y(ie,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new V;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:r}=this;return"unique-value"===e.type&&r&&"none"!==r.functionName.toLowerCase()&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||E(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var t;let r=this.sourceJSON;if(!r){const{data:t,ssl:i}=await n(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});r=t,this.sourceJSON=r,i&&(this.url=this.url.replace(/^http:/i,"https:"))}if((null==(t=r.capabilities)?void 0:t.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly"))>-1)throw new a("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:(null==(t=e.fields)?void 0:t.length)>0}_isMosaicRuleSupported(e){var t;if(!e)return!1;const r=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&(null==(t=e.fields)?void 0:t.length)>1);return r||i}_isVectorFieldResampleFunction(e){if(!p(e))return!1;const{functionName:t,functionArguments:r}=e,i="resample"===t.toLowerCase(),s=(null==r?void 0:r.ResampleType)||(null==r?void 0:r.resampleType);return i&&(7===s||10===s)}_isPicture(){return!this.format||this.format.indexOf("jpg")>-1||this.format.indexOf("png")>-1}_configDefaultRenderer(){if(!this._isPicture()&&!this.pixelFilter){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=U(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}var e,t;if(!this.renderer)this.renderer=H(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:null==(e=this.mosaicRule)||null==(t=e.multidimensionalDefinition)?void 0:t[0].variableName});this._symbolizer?(this._symbolizer.rendererJSON=L(this.renderer.toJSON()),this._symbolizer.rasterInfo=this.rasterInfo):this._symbolizer=new k({rendererJSON:this.renderer.toJSON(),rasterInfo:this.rasterInfo}),this._symbolizer.bind().success||(this._symbolizer=null)}}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:p(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){const{raster:t,viewId:r}=this;return{raster:t,viewId:r,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...null==e?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,r){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):A(e,t,r)}async _fetchMultidimensionalInfo(e){var t;const r=await n(this.parsedUrl.path+"/multidimensionalInfo",{query:this._getQueryParams(),signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.multidimensionalInfo}));return null!=(t=r.variables)&&t.length&&r.variables.forEach((e=>{var t;null!=(t=e.statistics)&&t.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))})),r}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:n(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.rasterFunctionInfos})):null}_fetchAuxiliaryRasterInfo(e){const t=e&&e.serviceInfo;if(!t)return Promise.reject(new a("imagery-layer:fetch-metadata","valid serviceInfo is required"));const r=e.renderingRule?JSON.stringify(e.renderingRule.toJSON()):null,i=e.signal,s=!!(t.hasRasterAttributeTable&&this.version>=10.1)&&n(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.1?r:null}),signal:i}).then((e=>ae.fromJSON(e.data))).catch((()=>null)),o=!!(t.hasColormap&&this.version>=10.1)&&n(this.parsedUrl.path+"/colormap",{query:this._getQueryParams({renderingRule:this.version>=10.6?r:null}),signal:i}).then((e=>{var t;return null==(t=e.data)?void 0:t.colormap})),l=!!(t.hasHistograms&&this.version>=10.1)&&n(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({renderingRule:this.version>=10.1?r:null}),signal:i}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),u=this.version>=10.3&&n(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:r}),signal:i}).then((e=>e.data)).catch((()=>{})),p=!!(t.hasMultidimensions&&this.version>=10.3)&&this._fetchMultidimensionalInfo();return Promise.all([s,o,l,u,p]).then((e=>{let r=null;if(t.minValues&&t.minValues.length===t.bandCount){r=[];for(let e=0;e<t.minValues.length;e++)r.push({min:t.minValues[e],max:t.maxValues[e],avg:t.meanValues[e],stddev:t.stdvValues[e]})}const i=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),s=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),n=de.fromJSON(t.spatialReference||t.extent.spatialReference);return new q({width:i,height:s,bandCount:t.bandCount,extent:ee.fromJSON(t.extent),spatialReference:n,pixelSize:new te({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n}),pixelType:t.pixelType.toLowerCase(),statistics:r,attributeTable:e[0]||null,colormap:e[1]||null,histograms:e[2]||null,keyProperties:e[3]||{},multidimensionalInfo:e[4]||null})}))}_requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:r,signal:i}=e;if(r&&!this.pixelFilter&&t.format&&t.format.indexOf("png")>-1)return n(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:i}).then((e=>({imageElement:e.data,params:t})));const s=this._initJobHandler(),o=n(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:i});return Promise.all([o,s]).then((e=>{const r=e[0].data,s=t.format||"jpgpng";let n=s;if("bsq"!==n&&"bip"!==n&&(n=z(r)),!n){throw new a("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(r)))}const o="gif"===s||"bmp"===s||s.indexOf("png")>-1&&("png"===n||"jpg"===n),l={signal:i};return o?A(r,{useCanvas:!0,...t},l).then((e=>({pixelData:{pixelBlock:e,extent:t.extent},params:t}))):this._decodePixelBlock(r,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:s},l).then((e=>({pixelData:{pixelBlock:e,extent:t.extent},params:t})))}))}async _generateRasterInfo(e,t){const{data:r}=await n(this.parsedUrl.path,{query:this._getQueryParams({renderingRule:e}),...t});return await this._fetchAuxiliaryRasterInfo({serviceInfo:r,renderingRule:e,...t})}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule&&this._defaultServiceMosaicRule.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=e.variables[0].dimensions,r="",i=[];for(const s in t)if(t.hasOwnProperty(s)){const e=t[s],n=e.extent;let a=!0,o=[n[0]];e.hasRanges&&!0===e.hasRanges?(a=!1,o=[e.values[0]]):"stdz"===e.name.toLowerCase()&&Math.abs(n[1])<=Math.abs(n[0])&&(o=[n[1]]),i.push(new F({variableName:r,dimensionName:t[s].name,isSlice:a,values:o}))}if(i.length>0){this.mosaicRule=this.mosaicRule||new N;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=i)}}_formatAttributeValue(e,t){if("string"==typeof e){const r=this.popupTemplate&&this.popupTemplate.fieldInfos,i=this._getFieldInfo(r,t),s=i&&i.format;if(s){let t,r;return e.trim().indexOf(",")>-1?(t=",",r=t+" ",this._formatDelimitedString(e,t,r,s)):e.trim().indexOf(" ")>-1?(t=r=" ",this._formatDelimitedString(e,t,r,s)):this._formatNumberFromString(e,s)}}return e}_getFieldInfo(e,t){if(!e||!e.length||!t)return;const r=t.toLowerCase();let i;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==r&&e.fieldName.toLowerCase()!==r.replace(/ /g,"_"))&&(i=e,!0))),i}_formatDelimitedString(e,t,r,i){return e&&t&&r&&i?e.trim().split(t).map((e=>this._formatNumberFromString(e,i))).join(r):e}_formatNumberFromString(e,t){if(!e||!t)return e;const r=Number(e);return isNaN(r)?e:t.format(r)}_processVisibleRastersResponse(e,r){r=r||{};const i=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:a,templateFields:o}=r,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,c=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const m=this.objectIdField||"ObjectId",d="string"==typeof i&&i.toLowerCase().indexOf("nodata")>-1,h=[];if(i&&!u&&!d){const e={};e[m]=0;c=[i],u=[new t(this.fullExtent,null,e)]}if(!u)return[];let f,y,g;this._updateResponseFieldNames(u,o),d&&!n&&(u=[]);for(let t=0;t<u.length;t++){if(f=u[t],null!=i){if(y=c[t],g=this.renderingRule&&l&&l.length>0&&s&&s.length>0&&s.indexOf(this.renderingRule.functionName)>-1?l[s.indexOf(this.renderingRule.functionName)]:i,"nodata"===y.toLowerCase()&&!n)continue;const e="Raster.ItemPixelValue",r="Raster.ServicePixelValue";f.attributes[e]=this._formatAttributeValue(y,e),f.attributes[r]=this._formatAttributeValue(g,r),this._updateFeatureWithMagDirValues(f,y);const a=this.fields&&this.fields.length>0;let o=this.renderingRule&&p(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?a?y:i:g;this.renderingRule||(o=a?y:i),this._updateFeatureWithRasterAttributeTableValues(f,o)}if(f.sourceLayer=this,a&&this._updateFeatureWithDomainValues(f),s&&l&&s.length===l.length)for(let e=0;e<s.length;e++){const t="Raster.ServicePixelValue."+s[e];f.attributes[t]=this._formatAttributeValue(l[e],t)}h.push(u[t])}return h}_updateFeatureWithRasterAttributeTableValues(e,t){const r=this.rasterInfo&&this.rasterInfo.attributeTable||p(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable,i=r&&r.features;if(!i)return;const s=r.fields,n=s.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),a=n&&n[0];if(!a)return;const o=i.filter((e=>e.attributes[a]===(null!=t?parseInt(t,10):null)));o&&o[0]&&s.forEach((t=>{const r=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[r]=this._formatAttributeValue(o[0].attributes[t.name],r)}))}_updateFeatureWithMagDirValues(e,t){if("esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType)return;const r=t.split(/,\s*/).map((e=>parseFloat(e))),i=r.map((e=>[e])),s=r.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),n=new j({height:1,width:1,pixelType:"f32",pixels:i,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new ee(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:Q([n.pixels[0][0],n.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const r=e.attributes[t.name];if(null!=r){const i=t.domain.codedValues.filter((e=>e.code===r))[0];i&&(e.attributes[t.name]=i.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const r=this.fieldsIndex;p(r)&&e.forEach((e=>{if(e&&e.attributes)for(const i of t)if(r.has(i)){const t=r.get(i).name;t!==i&&(e.attributes[i]=e.attributes[t],delete e.attributes[t])}}))}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const r=e.toLowerCase().replace(/ /gi,"_");return t.has(r)?t.get(r):e}_isRFTJson(e){return e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:r,advancedQueryCapabilities:i,maxRecordCount:s}=e,n=t.indexOf("image")>-1,a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:n,supportsExportImage:n,supportsIdentify:n,supportsMeasure:t.indexOf("mensuration")>-1&&o,supportsDownload:t.indexOf("download")>-1,supportsQuery:t.indexOf("catalog")>-1&&e.fields&&e.fields.length>0,supportsGetSamples:r>=10.2&&n,supportsProject:r>=10.3&&n,supportsComputeStatisticsHistograms:r>=10.4&&n,supportsQueryBoundary:r>=10.6&&n,supportsCalculateVolume:r>=10.7&&a,supportsComputePixelLocation:r>=10.7&&t.indexOf("catalog")>-1,supportsComputeAngles:r>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1},query:{maxRecordCount:s,maxRecordCountFactor:void 0,supportsStatistics:!(null==i||!i.supportsStatistics),supportsOrderBy:!(null==i||!i.supportsOrderBy),supportsDistinct:!(null==i||!i.supportsDistinct),supportsPagination:!(null==i||!i.supportsPagination),supportsStandardizedQueriesOnly:!(null==i||!i.useStandardizedQueries),supportsPercentileStatistics:!(null==i||!i.supportsPercentileStatistics),supportsCentroid:!(null==i||!i.supportsReturningGeometryCentroid),supportsDistance:!(null==i||!i.supportsQueryWithDistance),supportsExtent:!(null==i||!i.supportsReturningQueryExtent),supportsGeometryProperties:!(null==i||!i.supportsReturningGeometryProperties),supportsHavingClause:!(null==i||!i.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return e([v()],u.prototype,"_functionRasterInfos",void 0),e([v()],u.prototype,"_rasterJobHandler",void 0),e([v()],u.prototype,"_symbolizer",void 0),e([v({dependsOn:["_serviceSupportsMosaicRule"]})],u.prototype,"_defaultServiceMosaicRule",void 0),e([b("_defaultServiceMosaicRule",["defaultMosaicMethod"])],u.prototype,"readDefaultServiceMosaicRule",null),e([v()],u.prototype,"_cachedRendererJson",void 0),e([v({readOnly:!0})],u.prototype,"_serviceSourceType",void 0),e([b("_serviceSourceType",["serviceSourceType","fields"])],u.prototype,"readServiceSourceType",null),e([v({readOnly:!0})],u.prototype,"_serviceSupportsMosaicRule",void 0),e([b("_serviceSupportsMosaicRule",["currentVersion","fields"])],u.prototype,"readServiceSupportsMosaicRule",null),e([v()],u.prototype,"rasterAttributeTableFieldPrefix",void 0),e([v({readOnly:!0})],u.prototype,"rasterFunctionNamesIndex",null),e([v()],u.prototype,"adjustAspectRatio",void 0),e([v({readOnly:!0}),f("serviceRasterInfo.bandCount")],u.prototype,"bandCount",void 0),e([v({type:[g],json:{write:!0}})],u.prototype,"bandIds",void 0),e([b("bandIds")],u.prototype,"readBandIds",null),e([v({readOnly:!0,json:{read:!1}})],u.prototype,"capabilities",void 0),e([b("service","capabilities",["capabilities","currentVersion","serviceDataType"])],u.prototype,"readCapabilities",null),e([v({type:Number})],u.prototype,"compressionQuality",void 0),e([I("compressionQuality")],u.prototype,"writeCompressionQuality",null),e([v({type:Number})],u.prototype,"compressionTolerance",void 0),e([I("compressionTolerance")],u.prototype,"writeCompressionTolerance",null),e([v({json:{read:{source:"copyrightText"}}})],u.prototype,"copyright",void 0),e([v({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],u.prototype,"definitionExpression",void 0),e([v({readOnly:!0,constructOnly:!0})],u.prototype,"exportImageServiceParameters",void 0),e([v()],u.prototype,"rasterInfo",void 0),e([v({readOnly:!0,type:[P]})],u.prototype,"fields",void 0),e([v({readOnly:!0})],u.prototype,"fieldsIndex",null),e([v({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],u.prototype,"format",null),e([b("service","format",["serviceDataType"])],u.prototype,"readFormat",null),e([v({type:ee})],u.prototype,"fullExtent",void 0),e([v({readOnly:!0})],u.prototype,"hasMultidimensions",void 0),e([v({json:{read:{source:"maxImageHeight"}}})],u.prototype,"imageMaxHeight",void 0),e([v({json:{read:{source:"maxImageWidth"}}})],u.prototype,"imageMaxWidth",void 0),e([v({type:String,json:{type:C.jsonValues,read:C.read,write:C.write}})],u.prototype,"interpolation",void 0),e([v()],u.prototype,"minScale",void 0),e([b("service","minScale")],u.prototype,"readMinScale",null),e([v()],u.prototype,"maxScale",void 0),e([b("service","maxScale")],u.prototype,"readMaxScale",null),e([v({type:N})],u.prototype,"mosaicRule",null),e([b("mosaicRule",["mosaicRule","defaultMosaicMethod"])],u.prototype,"readMosaicRule",null),e([I("mosaicRule")],u.prototype,"writeMosaicRule",null),e([v({readOnly:!0}),f("serviceRasterInfo.multidimensionalInfo")],u.prototype,"multidimensionalInfo",void 0),e([v({json:{type:g}})],u.prototype,"noData",void 0),e([I("noData")],u.prototype,"writeNoData",null),e([v({type:String,json:{type:M.jsonValues,read:M.read,write:M.write}})],u.prototype,"noDataInterpretation",void 0),e([v({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],u.prototype,"objectIdField",void 0),e([b("objectIdField")],u.prototype,"readObjectIdField",null),e([v({})],u.prototype,"geometryType",void 0),e([v({})],u.prototype,"typeIdField",void 0),e([v({})],u.prototype,"types",void 0),e([v({readOnly:!0})],u.prototype,"parsedUrl",null),e([v({readOnly:!0}),f("serviceRasterInfo.pixelSize.x")],u.prototype,"pixelSizeX",void 0),e([v({readOnly:!0}),f("serviceRasterInfo.pixelSize.y")],u.prototype,"pixelSizeY",void 0),e([v({type:Function})],u.prototype,"pixelFilter",void 0),e([v()],u.prototype,"raster",void 0),e([v()],u.prototype,"viewId",void 0),e([v({types:i,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:s,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"animated-flow"!==e.type})}}}}})],u.prototype,"renderer",void 0),e([b("renderer")],u.prototype,"readRenderer",null),e([I("renderer")],u.prototype,"writeRenderer",null),e([v(_)],u.prototype,"opacity",void 0),e([v({readOnly:!0}),f("serviceRasterInfo.attributeTable")],u.prototype,"rasterAttributeTable",void 0),e([v({readOnly:!0})],u.prototype,"rasterFields",null),e([v({constructOnly:!0})],u.prototype,"rasterFunctionInfos",void 0),e([v({type:J})],u.prototype,"renderingRule",null),e([b("renderingRule",["renderingRule","rasterFunctionInfos"])],u.prototype,"readRenderingRule",null),e([I("renderingRule")],u.prototype,"writeRenderingRule",null),e([v()],u.prototype,"serviceDataType",void 0),e([v({readOnly:!0,type:de})],u.prototype,"spatialReference",void 0),e([b("spatialReference",["spatialReference","extent"])],u.prototype,"readSpatialReference",null),e([v({json:{type:fe.jsonValues}})],u.prototype,"pixelType",void 0),e([b("pixelType")],u.prototype,"readPixelType",null),e([I("pixelType")],u.prototype,"writePixelType",null),e([v({constructOnly:!0,type:q})],u.prototype,"serviceRasterInfo",void 0),e([v()],u.prototype,"sourceJSON",void 0),e([v(w)],u.prototype,"url",void 0),e([v({readOnly:!0})],u.prototype,"version",void 0),e([b("version",["currentVersion","fields","timeInfo"])],u.prototype,"readVersion",null),u=e([S("esri.layers.mixins.ArcGISImageService")],u),u};export{ve as ArcGISImageService};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import{read as r,rasterRendererTypes as i,websceneRasterRendererTypes as s}from"../../rasterRenderers.js";import n from"../../request.js";import a from"../../core/Error.js";import{strict as o}from"../../core/jsonMap.js";import{clone as l}from"../../core/lang.js";import u from"../../core/Logger.js";import{isSome as p,isNone as c,unwrap as m}from"../../core/maybe.js";import{when as d}from"../../core/promiseUtils.js";import{urlToObject as h}from"../../core/urlUtils.js";import{aliasOf as f}from"../../core/accessorSupport/decorators/aliasOf.js";import{ensureClass as y,Integer as g,ensureNumber as R}from"../../core/accessorSupport/ensureType.js";import{property as v,ensureRange as x}from"../../core/accessorSupport/decorators/property.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{subclass as S}from"../../core/accessorSupport/decorators/subclass.js";import{writer as I}from"../../core/accessorSupport/decorators/writer.js";import{opacity as _,url as w}from"../support/commonProperties.js";import F from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as O}from"../support/ExportImageServiceParameters.js";import P from"../support/Field.js";import T from"../support/FieldsIndex.js";import{isSupportedRendererType as D}from"../support/imageryRendererUtils.js";import N from"../support/MosaicRule.js";import j from"../support/PixelBlock.js";import{interpolationKebab as C,noDataInterpretationKebab as M}from"../support/rasterEnums.js";import J from"../support/RasterFunction.js";import q from"../support/RasterInfo.js";import V from"../support/RasterJobHandler.js";import{decode as A,getFormat as z}from"../support/rasterFormats/RasterCodec.js";import{uvComponentToVector as Q}from"../support/rasterFunctions/vectorFieldUtils.js";import{getSupportedRendererTypes as E,getDefaultBandCombination as U,createDefaultRenderer as H,normalizeRendererJSON as L}from"../../renderers/support/rasterRendererHelper.js";import k from"../../renderers/support/RasterSymbolizer.js";import{computeAngles as B,computePixelSpaceLocations as G,computeHistograms as W,computeStatisticsHistograms as X,getImageSpatialReferenceQueryParameter as Y,getSamples as K,identify as $}from"../../rest/imageService.js";import"../../core/unitUtils.js";import"../../kernel.js";import"../../rest/query/support/AttachmentInfo.js";import"../../rest/support/AttachmentQuery.js";import{executeForCount as Z}from"../../rest/query/executeForCount.js";import ee from"../../geometry/Extent.js";import"../../geometry/Geometry.js";import"../../geometry/Multipoint.js";import te from"../../geometry/Point.js";import re from"../../geometry/Polygon.js";import"../../geometry/Polyline.js";import"../../geometry/support/normalizeUtils.js";import"../support/arcgisLayerUrl.js";import"../../core/pbf.js";import"../../geometry/support/spatialReferenceUtils.js";import ie from"../../rest/support/Query.js";import{executeForIds as se}from"../../rest/query/executeForIds.js";import{executeQueryJSON as ne}from"../../rest/query/executeQueryJSON.js";import"../../core/has.js";import"../graphics/featureConversionUtils.js";import ae from"../../rest/support/FeatureSet.js";import"../../rest/support/RelationshipQuery.js";import"../../rest/support/TopFeaturesQuery.js";import oe from"../../rest/support/ImageAngleParameters.js";import le from"../../rest/support/ImageHistogramParameters.js";import ue from"../../rest/support/ImageIdentifyParameters.js";import pe from"../../rest/support/ImagePixelLocationParameters.js";import ce from"../../rest/support/ImageSampleParameters.js";import{createStreamlinesMesh as me}from"../../views/2d/engine/flow/dataUtils.js";import de from"../../geometry/SpatialReference.js";const he=u.getLogger("esri.layers.mixins.ArcGISImageService"),fe=o()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),ye=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),ge=x(R,{min:0,max:255});function Re(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi),r=null==t?void 0:t.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return r?r.join("/"):null}const ve=o=>{let u=class extends o{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._symbolizer=null,this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandCount=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelSizeX=null,this.pixelSizeY=null,this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.renderer=null,this.rasterAttributeTable=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=null}initialize(){this._set("exportImageServiceParameters",new O({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?N.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,r){null!=e&&"lerc"!==this.format&&(t[r]=e)}writeCompressionTolerance(e,t,r){"lerc"===this.format&&null!=e&&(t[r]=e)}get fieldsIndex(){return this.fields?new T(this.fields):null}set format(e){e&&ye.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=N.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const r=e||t.mosaicRule;return r?N.fromJSON(r):this._isMosaicRuleSupported(t)?N.fromJSON(t):null}writeMosaicRule(e,t,r){let i=this.mosaicRule;const s=this.definitionExpression;i?s&&s!==i.where&&(i=i.clone(),i.where=s):s&&(i=new N({where:s})),this._isValidCustomizedMosaicRule(i)&&(t[r]=i.toJSON())}writeNoData(e,t,r){null!=e&&"number"==typeof e&&(t[r]=ge(e))}readObjectIdField(e,t){if(!e){const r=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=r&&r[0]&&r[0].name}return e}get parsedUrl(){return this.url?h(this.url):null}readRenderer(e,t,i){var s,n;const a=null==t||null==(s=t.layerDefinition)||null==(n=s.drawingInfo)?void 0:n.renderer,o=r(a,i);return null==o?null:("vector-field"===o.type&&t.symbolTileSize&&!a.symbolTileSize&&(o.symbolTileSize=t.symbolTileSize),D(o)||he.warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),o)}writeRenderer(e,t,r){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new P({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new P({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new P({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let s=this.fields?l(this.fields):[];s.push(r),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&s.push(t),this.version>=10.4&&p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&s.push(i),p(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{s.push(new P({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),null==this.pixelFilter||"esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType||(s.push(new P({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),s.push(new P({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const n=this.rasterInfo.attributeTable&&this.rasterInfo.attributeTable.fields||null;if(n&&n.length>0){const t=n.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const r=l(t);return r.name=e+t.name,r}));s=s.concat(t)}return s}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const r=t.rasterFunctionInfos;return t.renderingRule||r&&r.length&&"None"!==r[0].name?J.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,r){this._isRFTJson(e)||(t[r]=e.toJSON())}readSpatialReference(e,t){const r=e||t.extent.spatialReference;return r?de.fromJSON(r):null}readPixelType(e){return fe.fromJSON(e)||e}writePixelType(e,t,r){(c(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[r]=fe.toJSON(e))}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),r}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let r=e;if(!this._isPicture()&&this.renderer&&this._symbolizer&&!this.pixelFilter){const i=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),s=this._rasterJobHandler.instance,{bandIds:n}=this;if(s){i&&(this._symbolizer.bind(),await s.updateSymbolizer(this._symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await s.symbolize({bandIds:n,...e},t);r={extent:e.extent,pixelBlock:a}}else r={extent:e.extent,pixelBlock:this._symbolizer.symbolize({bandIds:n,...e})}}return r}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputeAngles)throw new a("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=y(oe,e).clone(),B(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new a("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=y(pe,e).clone(),G(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputeHistograms)throw new a("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=y(le,e).clone();const{raster:r,mosaicRule:i,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),i&&null==e.mosaicRule&&(e.mosaicRule=i),r&&null==e.raster&&(e.raster=r),W(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new a("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=y(le,e).clone();const{raster:r,mosaicRule:i,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),i&&null==e.mosaicRule&&(e.mosaicRule=i),r&&null==e.raster&&(e.raster=r),X(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return p(t)?t.get(e):void 0}getFieldDomain(e,t){const r=this.getField(e);return r?r.domain:null}fetchImage(e,t,r,i={}){if(null==e||null==t||null==r)return Promise.reject(new a("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const s=this.renderer||this._symbolizer?this.generateRasterInfo(this.renderingRule,{signal:i.signal}):null;return d(s).then((s=>{s&&(this.rasterInfo=s);const n={imageServiceParameters:this.getExportImageServiceParameters(e,t,r,i.timeExtent),imageProps:{extent:e,width:t,height:r,format:this.format},requestAsImageElement:i.requestAsImageElement&&!this.pixelFilter||!1,signal:i.signal};return this._requestArrayBuffer(n)}))}fetchKeyProperties(e){const t=e&&e.renderingRule&&e.renderingRule.toJSON();return n(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3&&t?JSON.stringify(t):null})}).then((e=>e.data))}fetchRasterAttributeTable(e){const t=e&&e.renderingRule&&e.renderingRule.toJSON();return this.version<10.1?Promise.reject(new a("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):n(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3&&t?JSON.stringify(t):null})}).then((e=>ae.fromJSON(e.data)))}async getCatalogItemRasterInfo(e,t){const r=n(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t}).then((e=>e.data)),i=n(this.parsedUrl.path+"/"+e+"/info/keyProperties",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>{})),s=await Promise.all([r,i]);if(!s[0])return;const a=ee.fromJSON(s[0].extent),o=s[0].statistics?s[0].statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))):null;return new q({bandCount:s[0].bandCount,extent:a,spatialReference:a.sr,pixelSize:new te({x:s[0].pixelSizeX,y:s[0].pixelSizeY,spatialReference:a.sr}),pixelType:s[0].pixelType.toLowerCase(),statistics:o,histograms:s[0].histograms,keyProperties:s[1]||{}})}async getCatalogItemICSInfo(e,t){const{data:r}=await n(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),i=r&&r.ics;if(!i)return;let s=null;try{s=(await n(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:i,icsToPixelTransform:null,icsExtent:null,northDirection:null};const a=this.version>=10.7?n(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},o=s.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[s]}),inSR:o.wkid||JSON.stringify(o),outSR:"0:"+e},u=n(this.parsedUrl.path+"/project",{query:this._getQueryParams(l),...t}).then((e=>e.data)).catch((()=>({}))),p=5,c=(s.xmin+s.xmax)/2,m=(s.ymax-s.ymin)/(p+1),d=s.ymin+m,h=[];for(let n=0;n<p;n++)h.push({x:c,y:d+m*n});const f={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:h}),inSR:o.wkid||JSON.stringify(o),outSR:"0:"+e},y=n(this.parsedUrl.path+"/project",{query:this._getQueryParams(f),...t}).then((e=>e.data)).catch((()=>({}))),g=await Promise.all([a,u,y]);let R=g[0].ipxf;if(null==R){var v,x,b;const e=null==(v=i.geodataXform)?void 0:v.xf_0;"topup"===(null==e||null==(x=e.name)?void 0:x.toLowerCase())&&6===(null==e||null==(b=e.coefficients)?void 0:b.length)&&(R={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const S=ee.fromJSON(g[1]&&g[1].geometries&&g[1].geometries[0]);S&&(S.spatialReference=new de({wkid:0,imageCoordinateSystem:i}));const I=g[2].geometries?g[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],_=I.length;if(_<3)return{ics:i,icsToPixelTransform:R,icsExtent:S,northDirection:null};let w=0,F=0,O=0,P=0;for(let n=0;n<_;n++)w+=I[n].x,F+=I[n].y,O+=I[n].x*I[n].x,P+=I[n].x*I[n].y;const T=(_*P-w*F)/(_*O-w*w);let D=0;const N=I[p-1].x>I[0].x,j=I[p-1].y>I[0].y;return T===1/0?D=j?90:270:0===T?D=N?0:180:T>0?D=N?180*Math.atan(T)/Math.PI:180*Math.atan(T)/Math.PI+180:T<0&&(D=j?180+180*Math.atan(T)/Math.PI:360+180*Math.atan(T)/Math.PI),{ics:i,icsToPixelTransform:R,icsExtent:S,northDirection:D}}async generateRasterInfo(e,t){if((!e||"none"===e.functionName.toLowerCase()||this._isVectorFieldResampleFunction(e))&&p(this.serviceRasterInfo))return this.serviceRasterInfo;const r=Re(e);if(this._functionRasterInfos[r])return this._functionRasterInfos[r];const i=this._generateRasterInfo(e,t);this._functionRasterInfos[r]=i;try{return await i}catch{return this._functionRasterInfos[r]=null,null}}getExportImageServiceParameters(e,t,r,i){e=e.clone().shiftCentralMeridian();const s=Y(e.spatialReference,this.parsedUrl.path);p(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const n=this.exportImageServiceParameters.toJSON(),{bandIds:a,noData:o}=n;let{renderingRule:l}=n;const u=this.renderingRule&&"none"!==this.renderingRule.functionName.toLowerCase(),c=!this.renderer||"raster-stretch"===this.renderer.type;if(null!=a&&a.length&&u&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:a}};if("Stretch"===l.rasterFunction)e.rasterFunctionArguments.Raster=l.rasterFunctionArguments.Raster,l.rasterFunctionArguments.Raster=e;else if("Colormap"===l.rasterFunction){const t=l.rasterFunctionArguments.Raster;"Stretch"===(null==t?void 0:t.rasterFunction)?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,l.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=l,l=e;n.bandIds=void 0}else n.bandIds=null==a?void 0:a.join(",");o instanceof Array&&o.length>0&&(n.noData=o.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,i):null;n.mosaicRule=m&&JSON.stringify(m),n.renderingRule=l&&JSON.stringify(l);const d={};if(i){const{start:e,end:t}=i.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${null==e?"null":e},${null==t?"null":t}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:s,imageSR:s,size:t+","+r,...n,...d}}async getSamples(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsGetSamples)throw new a("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=y(ce,e).clone();const{raster:r}=this;return r&&null==e.raster&&(e.raster=r),K(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(null==t?void 0:t.signal),!this.capabilities.operations.supportsIdentify)throw new a("imagery-layer:query-rasters","query operation is not supported on the input image service");e=y(ue,e).clone();const{raster:r,mosaicRule:i,renderingRule:s}=this;if(s&&null==e.renderingRule&&(e.renderingRule=s),i&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(i,e.timeExtent);e.mosaicRule=m(t)}return r&&null==e.raster&&(e.raster=r),$(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new ie;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),ne(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),se(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Z(this.url,e,t)}queryVisibleRasters(e,t){if(!e)return Promise.reject(new a("imagery-layer: query-visible-rasters","missing query parameter"));const{pixelSize:r,returnDomainValues:i,returnTopmostRaster:s,showNoDataRecords:n}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const m="raster.servicepixelvalue",d=this.rasterFunctionNamesIndex;if(p(e.outFields)&&(o=e.outFields.some((e=>-1===e.toLowerCase().indexOf(m))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().indexOf(m)>-1&&e.length>m.length)).map((e=>{const t=e.slice(m.length+1);return[this._updateRenderingRulesFunctionName(t,d),t]}));l=t.map((e=>new J({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const h=c(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),f=e.timeExtent||this.timeExtent,y=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,f),g=this._getQueryParams({geometry:e.geometry,timeExtent:f,mosaicRule:y,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:r,returnCatalogItems:o,returnGeometry:h,raster:this.raster,maxItemCount:s?1:null});delete g.f;const R=new ue(g),v=this.generateRasterInfo(this.renderingRule);return new Promise((r=>{v.then((()=>{$(this.url,R,{signal:null==t?void 0:t.signal,query:{...this.customParameters}}).then((t=>{var s;const l=e.outFields,p=t.value.toLowerCase().indexOf("nodata")>-1;if(o&&!h&&null!=t&&null!=(s=t.catalogItems)&&s.features.length&&(n||!p)){const s=this.objectIdField||"ObjectId",o=t.catalogItems.features,p=o.map((e=>e.attributes&&e.attributes[s])),c=new ie({objectIds:p,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[s]});return this.queryRasters(c).then((a=>{a&&a.features&&a.features.length>0&&a.features.forEach((t=>{o.forEach((r=>{r.attributes[s]===t.attributes[s]&&(r.geometry=new re(t.geometry),r.geometry.spatialReference=e.outSpatialReference)}))})),r(this._processVisibleRastersResponse(t,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:l}))})).catch((()=>{throw new a("imagery-layer:query-visible-rasters","encountered error when querying visible rasters geometry")}))}r(this._processVisibleRastersResponse(t,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:l}))})).catch((()=>{throw new a("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}))}))}))}async fetchVariableStatisticsHistograms(e,t){const r=n(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.statistics})),i=n(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),s=await Promise.all([r,i]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createStreamlinesMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createStreamlinesMesh(e,t):me(e.rendererSettings,e.flowData,p(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),p(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,r=p(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):this._fetchAuxiliaryRasterInfo({serviceInfo:t,signal:e}).then((e=>(this._set("serviceRasterInfo",e),e))),i=this.renderingRule&&"none"!==this.renderingRule.functionName.toLowerCase()?this.generateRasterInfo(this.renderingRule,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([r,i,s]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this.renderer=null,he.warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._configDefaultRenderer(),this.watch("renderer",(()=>this._configDefaultRenderer())),this.watch("renderingRule",(e=>{(this.renderer||this._symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))}));const t=p(this.serviceRasterInfo)&&this.serviceRasterInfo.multidimensionalInfo;t&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const r=this.timeInfo;if(c(e)||c(this.multidimensionalInfo)||c(t)||c(null==r?void 0:r.startField))return e;const{startField:i}=r;var s;if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=null==(s=e.multidimensionalDefinition)?void 0:s.filter((e=>e.dimensionName!==i)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const n=e.multidimensionalDefinition.filter((e=>e.dimensionName===i)),a=p(t.start)?t.start.getTime():null,o=p(t.end)?t.end.getTime():null,l=null==a||null==o||a===o,u=l?[a||o]:[[a,o]],m=this.version>=10.8;if(n.length)n.forEach((e=>{e.dimensionName===i&&(m?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=l,e.values=u))}));else if(!m){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=i,e.isSlice=l,e.values=u})):e.multidimensionalDefinition.push(new F({variableName:"",dimensionName:i,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return c(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){var r;if(await this._fetchCapabilities(null==(r=t)?void 0:r.signal),!this.capabilities.operations.supportsQuery)throw new a("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=p(e)?y(ie,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new V;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:r}=this;return"unique-value"===e.type&&r&&"none"!==r.functionName.toLowerCase()&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||E(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var t;let r=this.sourceJSON;if(!r){const{data:t,ssl:i}=await n(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});r=t,this.sourceJSON=r,i&&(this.url=this.url.replace(/^http:/i,"https:"))}if((null==(t=r.capabilities)?void 0:t.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly"))>-1)throw new a("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:(null==(t=e.fields)?void 0:t.length)>0}_isMosaicRuleSupported(e){var t;if(!e)return!1;const r=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&(null==(t=e.fields)?void 0:t.length)>1);return r||i}_isVectorFieldResampleFunction(e){if(!p(e))return!1;const{functionName:t,functionArguments:r}=e,i="resample"===t.toLowerCase(),s=(null==r?void 0:r.ResampleType)||(null==r?void 0:r.resampleType);return i&&(7===s||10===s)}_isPicture(){return!this.format||this.format.indexOf("jpg")>-1||this.format.indexOf("png")>-1}_configDefaultRenderer(){if(!this._isPicture()&&!this.pixelFilter){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=U(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}var e,t;if(!this.renderer)this.renderer=H(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:null==(e=this.mosaicRule)||null==(t=e.multidimensionalDefinition)?void 0:t[0].variableName});this._symbolizer?(this._symbolizer.rendererJSON=L(this.renderer.toJSON()),this._symbolizer.rasterInfo=this.rasterInfo):this._symbolizer=new k({rendererJSON:this.renderer.toJSON(),rasterInfo:this.rasterInfo}),this._symbolizer.bind().success||(this._symbolizer=null)}}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:p(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){const{raster:t,viewId:r}=this;return{raster:t,viewId:r,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...null==e?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,r){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):A(e,t,r)}async _fetchMultidimensionalInfo(e){var t;const r=await n(this.parsedUrl.path+"/multidimensionalInfo",{query:this._getQueryParams(),signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.multidimensionalInfo}));return null!=(t=r.variables)&&t.length&&r.variables.forEach((e=>{var t;null!=(t=e.statistics)&&t.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))})),r}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:n(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.rasterFunctionInfos})):null}_fetchAuxiliaryRasterInfo(e){const t=e&&e.serviceInfo;if(!t)return Promise.reject(new a("imagery-layer:fetch-metadata","valid serviceInfo is required"));const r=e.renderingRule?JSON.stringify(e.renderingRule.toJSON()):null,i=e.signal,s=!!(t.hasRasterAttributeTable&&this.version>=10.1)&&n(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.1?r:null}),signal:i}).then((e=>ae.fromJSON(e.data))).catch((()=>null)),o=!!(t.hasColormap&&this.version>=10.1)&&n(this.parsedUrl.path+"/colormap",{query:this._getQueryParams({renderingRule:this.version>=10.6?r:null}),signal:i}).then((e=>{var t;return null==(t=e.data)?void 0:t.colormap})),l=!!(t.hasHistograms&&this.version>=10.1)&&n(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({renderingRule:this.version>=10.1?r:null}),signal:i}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),u=this.version>=10.3&&n(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:r}),signal:i}).then((e=>e.data)).catch((()=>{})),p=!!(t.hasMultidimensions&&this.version>=10.3)&&this._fetchMultidimensionalInfo();return Promise.all([s,o,l,u,p]).then((e=>{let r=null;if(t.minValues&&t.minValues.length===t.bandCount){r=[];for(let e=0;e<t.minValues.length;e++)r.push({min:t.minValues[e],max:t.maxValues[e],avg:t.meanValues[e],stddev:t.stdvValues[e]})}const i=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),s=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),n=de.fromJSON(t.spatialReference||t.extent.spatialReference);return new q({width:i,height:s,bandCount:t.bandCount,extent:ee.fromJSON(t.extent),spatialReference:n,pixelSize:new te({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n}),pixelType:t.pixelType.toLowerCase(),statistics:r,attributeTable:e[0]||null,colormap:e[1]||null,histograms:e[2]||null,keyProperties:e[3]||{},multidimensionalInfo:e[4]||null})}))}_requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:r,signal:i}=e;if(r&&!this.pixelFilter&&t.format&&t.format.indexOf("png")>-1)return n(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:i}).then((e=>({imageElement:e.data,params:t})));const s=this._initJobHandler(),o=n(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:i});return Promise.all([o,s]).then((e=>{const r=e[0].data,s=t.format||"jpgpng";let n=s;if("bsq"!==n&&"bip"!==n&&(n=z(r)),!n){throw new a("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(r)))}const o="gif"===s||"bmp"===s||s.indexOf("png")>-1&&("png"===n||"jpg"===n),l={signal:i};return o?A(r,{useCanvas:!0,...t},l).then((e=>({pixelData:{pixelBlock:e,extent:t.extent},params:t}))):this._decodePixelBlock(r,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:s},l).then((e=>({pixelData:{pixelBlock:e,extent:t.extent},params:t})))}))}async _generateRasterInfo(e,t){const{data:r}=await n(this.parsedUrl.path,{query:this._getQueryParams({renderingRule:e}),...t});return await this._fetchAuxiliaryRasterInfo({serviceInfo:r,renderingRule:e,...t})}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule&&this._defaultServiceMosaicRule.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=e.variables[0].dimensions,r="",i=[];for(const s in t)if(t.hasOwnProperty(s)){const e=t[s],n=e.extent;let a=!0,o=[n[0]];e.hasRanges&&!0===e.hasRanges?(a=!1,o=[e.values[0]]):"stdz"===e.name.toLowerCase()&&Math.abs(n[1])<=Math.abs(n[0])&&(o=[n[1]]),i.push(new F({variableName:r,dimensionName:t[s].name,isSlice:a,values:o}))}if(i.length>0){this.mosaicRule=this.mosaicRule||new N;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=i)}}_formatAttributeValue(e,t){if("string"==typeof e){const r=this.popupTemplate&&this.popupTemplate.fieldInfos,i=this._getFieldInfo(r,t),s=i&&i.format;if(s){let t,r;return e.trim().indexOf(",")>-1?(t=",",r=t+" ",this._formatDelimitedString(e,t,r,s)):e.trim().indexOf(" ")>-1?(t=r=" ",this._formatDelimitedString(e,t,r,s)):this._formatNumberFromString(e,s)}}return e}_getFieldInfo(e,t){if(!e||!e.length||!t)return;const r=t.toLowerCase();let i;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==r&&e.fieldName.toLowerCase()!==r.replace(/ /g,"_"))&&(i=e,!0))),i}_formatDelimitedString(e,t,r,i){return e&&t&&r&&i?e.trim().split(t).map((e=>this._formatNumberFromString(e,i))).join(r):e}_formatNumberFromString(e,t){if(!e||!t)return e;const r=Number(e);return isNaN(r)?e:t.format(r)}_processVisibleRastersResponse(e,r){r=r||{};const i=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:a,templateFields:o}=r,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,c=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const m=this.objectIdField||"ObjectId",d="string"==typeof i&&i.toLowerCase().indexOf("nodata")>-1,h=[];if(i&&!u&&!d){const e={};e[m]=0;c=[i],u=[new t(this.fullExtent,null,e)]}if(!u)return[];let f,y,g;this._updateResponseFieldNames(u,o),d&&!n&&(u=[]);for(let t=0;t<u.length;t++){if(f=u[t],null!=i){if(y=c[t],g=this.renderingRule&&l&&l.length>0&&s&&s.length>0&&s.indexOf(this.renderingRule.functionName)>-1?l[s.indexOf(this.renderingRule.functionName)]:i,"nodata"===y.toLowerCase()&&!n)continue;const e="Raster.ItemPixelValue",r="Raster.ServicePixelValue";f.attributes[e]=this._formatAttributeValue(y,e),f.attributes[r]=this._formatAttributeValue(g,r),this._updateFeatureWithMagDirValues(f,y);const a=this.fields&&this.fields.length>0;let o=this.renderingRule&&p(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?a?y:i:g;this.renderingRule||(o=a?y:i),this._updateFeatureWithRasterAttributeTableValues(f,o)}if(f.sourceLayer=this,a&&this._updateFeatureWithDomainValues(f),s&&l&&s.length===l.length)for(let e=0;e<s.length;e++){const t="Raster.ServicePixelValue."+s[e];f.attributes[t]=this._formatAttributeValue(l[e],t)}h.push(u[t])}return h}_updateFeatureWithRasterAttributeTableValues(e,t){const r=this.rasterInfo&&this.rasterInfo.attributeTable||p(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable,i=r&&r.features;if(!i)return;const s=r.fields,n=s.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),a=n&&n[0];if(!a)return;const o=i.filter((e=>e.attributes[a]===(null!=t?parseInt(t,10):null)));o&&o[0]&&s.forEach((t=>{const r=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[r]=this._formatAttributeValue(o[0].attributes[t.name],r)}))}_updateFeatureWithMagDirValues(e,t){if("esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType)return;const r=t.split(/,\s*/).map((e=>parseFloat(e))),i=r.map((e=>[e])),s=r.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),n=new j({height:1,width:1,pixelType:"f32",pixels:i,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new ee(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:Q([n.pixels[0][0],n.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const r=e.attributes[t.name];if(null!=r){const i=t.domain.codedValues.filter((e=>e.code===r))[0];i&&(e.attributes[t.name]=i.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const r=this.fieldsIndex;p(r)&&e.forEach((e=>{if(e&&e.attributes)for(const i of t)if(r.has(i)){const t=r.get(i).name;t!==i&&(e.attributes[i]=e.attributes[t],delete e.attributes[t])}}))}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const r=e.toLowerCase().replace(/ /gi,"_");return t.has(r)?t.get(r):e}_isRFTJson(e){return e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:r,advancedQueryCapabilities:i,maxRecordCount:s}=e,n=t.indexOf("image")>-1,a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:n,supportsExportImage:n,supportsIdentify:n,supportsMeasure:t.indexOf("mensuration")>-1&&o,supportsDownload:t.indexOf("download")>-1,supportsQuery:t.indexOf("catalog")>-1&&e.fields&&e.fields.length>0,supportsGetSamples:r>=10.2&&n,supportsProject:r>=10.3&&n,supportsComputeStatisticsHistograms:r>=10.4&&n,supportsQueryBoundary:r>=10.6&&n,supportsCalculateVolume:r>=10.7&&a,supportsComputePixelLocation:r>=10.7&&t.indexOf("catalog")>-1,supportsComputeAngles:r>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1},query:{maxRecordCount:s,maxRecordCountFactor:void 0,supportsStatistics:!(null==i||!i.supportsStatistics),supportsOrderBy:!(null==i||!i.supportsOrderBy),supportsDistinct:!(null==i||!i.supportsDistinct),supportsPagination:!(null==i||!i.supportsPagination),supportsStandardizedQueriesOnly:!(null==i||!i.useStandardizedQueries),supportsPercentileStatistics:!(null==i||!i.supportsPercentileStatistics),supportsCentroid:!(null==i||!i.supportsReturningGeometryCentroid),supportsDistance:!(null==i||!i.supportsQueryWithDistance),supportsExtent:!(null==i||!i.supportsReturningQueryExtent),supportsGeometryProperties:!(null==i||!i.supportsReturningGeometryProperties),supportsHavingClause:!(null==i||!i.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return e([v()],u.prototype,"_functionRasterInfos",void 0),e([v()],u.prototype,"_rasterJobHandler",void 0),e([v()],u.prototype,"_symbolizer",void 0),e([v({dependsOn:["_serviceSupportsMosaicRule"]})],u.prototype,"_defaultServiceMosaicRule",void 0),e([b("_defaultServiceMosaicRule",["defaultMosaicMethod"])],u.prototype,"readDefaultServiceMosaicRule",null),e([v()],u.prototype,"_cachedRendererJson",void 0),e([v({readOnly:!0})],u.prototype,"_serviceSourceType",void 0),e([b("_serviceSourceType",["serviceSourceType","fields"])],u.prototype,"readServiceSourceType",null),e([v({readOnly:!0})],u.prototype,"_serviceSupportsMosaicRule",void 0),e([b("_serviceSupportsMosaicRule",["currentVersion","fields"])],u.prototype,"readServiceSupportsMosaicRule",null),e([v()],u.prototype,"rasterAttributeTableFieldPrefix",void 0),e([v({readOnly:!0})],u.prototype,"rasterFunctionNamesIndex",null),e([v()],u.prototype,"adjustAspectRatio",void 0),e([v({readOnly:!0}),f("serviceRasterInfo.bandCount")],u.prototype,"bandCount",void 0),e([v({type:[g],json:{write:!0}})],u.prototype,"bandIds",void 0),e([b("bandIds")],u.prototype,"readBandIds",null),e([v({readOnly:!0,json:{read:!1}})],u.prototype,"capabilities",void 0),e([b("service","capabilities",["capabilities","currentVersion","serviceDataType"])],u.prototype,"readCapabilities",null),e([v({type:Number})],u.prototype,"compressionQuality",void 0),e([I("compressionQuality")],u.prototype,"writeCompressionQuality",null),e([v({type:Number})],u.prototype,"compressionTolerance",void 0),e([I("compressionTolerance")],u.prototype,"writeCompressionTolerance",null),e([v({json:{read:{source:"copyrightText"}}})],u.prototype,"copyright",void 0),e([v({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],u.prototype,"definitionExpression",void 0),e([v({readOnly:!0,constructOnly:!0})],u.prototype,"exportImageServiceParameters",void 0),e([v()],u.prototype,"rasterInfo",void 0),e([v({readOnly:!0,type:[P]})],u.prototype,"fields",void 0),e([v({readOnly:!0})],u.prototype,"fieldsIndex",null),e([v({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],u.prototype,"format",null),e([b("service","format",["serviceDataType"])],u.prototype,"readFormat",null),e([v({type:ee})],u.prototype,"fullExtent",void 0),e([v({readOnly:!0})],u.prototype,"hasMultidimensions",void 0),e([v({json:{read:{source:"maxImageHeight"}}})],u.prototype,"imageMaxHeight",void 0),e([v({json:{read:{source:"maxImageWidth"}}})],u.prototype,"imageMaxWidth",void 0),e([v({type:String,json:{type:C.jsonValues,read:C.read,write:C.write}})],u.prototype,"interpolation",void 0),e([v()],u.prototype,"minScale",void 0),e([b("service","minScale")],u.prototype,"readMinScale",null),e([v()],u.prototype,"maxScale",void 0),e([b("service","maxScale")],u.prototype,"readMaxScale",null),e([v({type:N})],u.prototype,"mosaicRule",null),e([b("mosaicRule",["mosaicRule","defaultMosaicMethod"])],u.prototype,"readMosaicRule",null),e([I("mosaicRule")],u.prototype,"writeMosaicRule",null),e([v({readOnly:!0}),f("serviceRasterInfo.multidimensionalInfo")],u.prototype,"multidimensionalInfo",void 0),e([v({json:{type:g}})],u.prototype,"noData",void 0),e([I("noData")],u.prototype,"writeNoData",null),e([v({type:String,json:{type:M.jsonValues,read:M.read,write:M.write}})],u.prototype,"noDataInterpretation",void 0),e([v({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],u.prototype,"objectIdField",void 0),e([b("objectIdField")],u.prototype,"readObjectIdField",null),e([v({})],u.prototype,"geometryType",void 0),e([v({})],u.prototype,"typeIdField",void 0),e([v({})],u.prototype,"types",void 0),e([v({readOnly:!0})],u.prototype,"parsedUrl",null),e([v({readOnly:!0}),f("serviceRasterInfo.pixelSize.x")],u.prototype,"pixelSizeX",void 0),e([v({readOnly:!0}),f("serviceRasterInfo.pixelSize.y")],u.prototype,"pixelSizeY",void 0),e([v({type:Function})],u.prototype,"pixelFilter",void 0),e([v()],u.prototype,"raster",void 0),e([v()],u.prototype,"viewId",void 0),e([v({types:i,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:s,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"animated-flow"!==e.type})}}}}})],u.prototype,"renderer",void 0),e([b("renderer")],u.prototype,"readRenderer",null),e([I("renderer")],u.prototype,"writeRenderer",null),e([v(_)],u.prototype,"opacity",void 0),e([v({readOnly:!0}),f("serviceRasterInfo.attributeTable")],u.prototype,"rasterAttributeTable",void 0),e([v({readOnly:!0})],u.prototype,"rasterFields",null),e([v({constructOnly:!0})],u.prototype,"rasterFunctionInfos",void 0),e([v({type:J})],u.prototype,"renderingRule",null),e([b("renderingRule",["renderingRule","rasterFunctionInfos"])],u.prototype,"readRenderingRule",null),e([I("renderingRule")],u.prototype,"writeRenderingRule",null),e([v()],u.prototype,"serviceDataType",void 0),e([v({readOnly:!0,type:de})],u.prototype,"spatialReference",void 0),e([b("spatialReference",["spatialReference","extent"])],u.prototype,"readSpatialReference",null),e([v({json:{type:fe.jsonValues}})],u.prototype,"pixelType",void 0),e([b("pixelType")],u.prototype,"readPixelType",null),e([I("pixelType")],u.prototype,"writePixelType",null),e([v({constructOnly:!0,type:q})],u.prototype,"serviceRasterInfo",void 0),e([v()],u.prototype,"sourceJSON",void 0),e([v(w)],u.prototype,"url",void 0),e([v({readOnly:!0})],u.prototype,"version",void 0),e([b("version",["currentVersion","fields","timeInfo"])],u.prototype,"readVersion",null),u=e([S("esri.layers.mixins.ArcGISImageService")],u),u};export{ve as ArcGISImageService};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.22.0",
3
+ "version": "4.22.1",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../request.js";import{isSome as e}from"../../../core/maybe.js";import{join as r,urlToObject as n}from"../../../core/urlUtils.js";import{getJsonType as i}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as o}from"../../../geometry/support/normalizeUtils.js";import{parsePBFFeatureQuery as s}from"./pbfQueryUtils.js";import{applyFeatureSetZUnitScaling as a}from"./queryZScale.js";import{mapParameters as u}from"../../../tasks/operations/urlUtils.js";const l="Layer does not support extent calculation.";function m(t,r){const n=t.geometry,o=t.toJSON(),s=o,a=t.outSpatialReference;let u,l;if(e(n)){if(u=n.spatialReference,l=n.spatialReference.wkid||JSON.stringify(n.spatialReference),s.geometryType=i(n),"extent"===n.type)s.geometry=`${n.xmin},${n.ymin},${n.xmax},${n.ymax}`;else if("point"===n.type)s.geometry=`${n.x},${n.y}`;else{const t=n.toJSON();delete t.spatialReference,s.geometry=JSON.stringify(t)}s.inSR=l}if(u||(u=a),o.groupByFieldsForStatistics&&(s.groupByFieldsForStatistics=o.groupByFieldsForStatistics.join(",")),o.objectIds&&(s.objectIds=o.objectIds.join(",")),o.orderByFields&&(s.orderByFields=o.orderByFields.join(",")),!o.outFields||!o.returnDistinctValues&&(null!=r&&r.returnCountOnly||null!=r&&r.returnExtentOnly||null!=r&&r.returnIdsOnly)?delete s.outFields:-1!==o.outFields.indexOf("*")?s.outFields="*":s.outFields=o.outFields.join(","),o.outSR?s.outSR=o.outSR.wkid||JSON.stringify(o.outSR):n&&(o.returnGeometry||o.returnCentroid)&&(s.outSR=s.inSR),o.returnGeometry&&delete o.returnGeometry,o.outStatistics&&(s.outStatistics=JSON.stringify(o.outStatistics)),o.pixelSize&&(s.pixelSize=JSON.stringify(o.pixelSize)),o.quantizationParameters&&(e(u)&&e(t.quantizationParameters)&&e(t.quantizationParameters.extent)&&u.equals(t.quantizationParameters.extent.spatialReference)&&delete o.quantizationParameters.extent.spatialReference,s.quantizationParameters=JSON.stringify(o.quantizationParameters)),o.parameterValues&&(s.parameterValues=JSON.stringify(o.parameterValues)),o.rangeValues&&(s.rangeValues=JSON.stringify(o.rangeValues)),o.dynamicDataSource&&(s.layer=JSON.stringify({source:o.dynamicDataSource}),delete o.dynamicDataSource),o.timeExtent){const t=o.timeExtent,{start:e,end:r}=t;null==e&&null==r||(s.time=e===r?e:`${null==e?"null":e},${null==r?"null":r}`),delete o.timeExtent}return s}async function y(t,r,n,i){const o=e(r.timeExtent)&&r.timeExtent.isEmpty?{data:{features:[]}}:await S(t,r,"json",i);return a(r,n,o.data),o}async function c(t,r,n,i){if(e(r.timeExtent)&&r.timeExtent.isEmpty)return Promise.resolve({data:n.createFeatureResult()});const o=await f(t,r,i),a=o;return a.data=s(o.data,n),a}function f(t,e,r){return S(t,e,"pbf",r)}function p(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):S(t,r,"json",n,{returnIdsOnly:!0})}function d(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):S(t,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function x(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):S(t,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then((t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(l);if(e.hasOwnProperty("count"))throw new Error(l);return t}))}function S(i,s,a,l={},y={}){const c="string"==typeof i?n(i):i,f=s.geometry?[s.geometry]:[];return l.responseType="pbf"===a?"array-buffer":"json",o(f,null,l).then((n=>{const i=n&&n[0];e(i)&&((s=s.clone()).geometry=i);const o=u({...c.query,f:a,...y,...m(s,y)});return t(r(c.path,"query"),{...l,query:{...o,...l.query}})}))}export{y as executeQuery,d as executeQueryForCount,x as executeQueryForExtent,p as executeQueryForIds,c as executeQueryPBF,f as executeQueryPBFBuffer,m as queryToQueryStringParameters,S as runQuery};
5
+ import t from"../../../request.js";import{isSome as e}from"../../../core/maybe.js";import{join as r,urlToObject as n}from"../../../core/urlUtils.js";import{getJsonType as i}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as o}from"../../../geometry/support/normalizeUtils.js";import{isHostedAgolService as s}from"../../../layers/support/arcgisLayerUrl.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{applyFeatureSetZUnitScaling as u}from"./queryZScale.js";import{mapParameters as l}from"../../../tasks/operations/urlUtils.js";const m="Layer does not support extent calculation.";function y(t,r,n=!1){const o=t.geometry,s=t.toJSON(),a=s,u=t.outSpatialReference;let l,m;if(e(o)){if(l=o.spatialReference,m=o.spatialReference.wkid||JSON.stringify(o.spatialReference),a.geometryType=i(o),"extent"===o.type)a.geometry=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`;else if("point"===o.type)a.geometry=`${o.x},${o.y}`;else{const t=o.toJSON();delete t.spatialReference,a.geometry=JSON.stringify(t)}a.inSR=m}if(l||(l=u),s.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=s.groupByFieldsForStatistics.join(",")),s.objectIds&&(a.objectIds=s.objectIds.join(",")),s.orderByFields&&(a.orderByFields=s.orderByFields.join(",")),!s.outFields||!s.returnDistinctValues&&(null!=r&&r.returnCountOnly||null!=r&&r.returnExtentOnly||null!=r&&r.returnIdsOnly)?delete a.outFields:-1!==s.outFields.indexOf("*")?a.outFields="*":a.outFields=s.outFields.join(","),s.outSR?a.outSR=s.outSR.wkid||JSON.stringify(s.outSR):o&&(s.returnGeometry||s.returnCentroid)&&(a.outSR=a.inSR),s.returnGeometry&&delete s.returnGeometry,s.outStatistics&&(a.outStatistics=JSON.stringify(s.outStatistics)),s.pixelSize&&(a.pixelSize=JSON.stringify(s.pixelSize)),s.quantizationParameters&&(n&&e(l)&&e(t.quantizationParameters)&&e(t.quantizationParameters.extent)&&l.equals(t.quantizationParameters.extent.spatialReference)&&delete s.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(s.quantizationParameters)),s.parameterValues&&(a.parameterValues=JSON.stringify(s.parameterValues)),s.rangeValues&&(a.rangeValues=JSON.stringify(s.rangeValues)),s.dynamicDataSource&&(a.layer=JSON.stringify({source:s.dynamicDataSource}),delete s.dynamicDataSource),s.timeExtent){const t=s.timeExtent,{start:e,end:r}=t;null==e&&null==r||(a.time=e===r?e:`${null==e?"null":e},${null==r?"null":r}`),delete s.timeExtent}return a}async function c(t,r,n,i){const o=e(r.timeExtent)&&r.timeExtent.isEmpty?{data:{features:[]}}:await g(t,r,"json",i);return u(r,n,o.data),o}async function p(t,r,n,i){if(e(r.timeExtent)&&r.timeExtent.isEmpty)return Promise.resolve({data:n.createFeatureResult()});const o=await f(t,r,i),s=o;return s.data=a(o.data,n),s}function f(t,e,r){return g(t,e,"pbf",r)}function d(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):g(t,r,"json",n,{returnIdsOnly:!0})}function x(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):g(t,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function S(t,r,n){return e(r.timeExtent)&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):g(t,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then((t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(m);if(e.hasOwnProperty("count"))throw new Error(m);return t}))}function g(i,a,u,m={},c={}){const p="string"==typeof i?n(i):i,f=a.geometry?[a.geometry]:[];return m.responseType="pbf"===u?"array-buffer":"json",o(f,null,m).then((n=>{const i=n&&n[0];e(i)&&((a=a.clone()).geometry=i);const o=s(p.path),f=l({...p.query,f:u,...c,...y(a,c,o)});return t(r(p.path,"query"),{...m,query:{...f,...m.query}})}))}export{c as executeQuery,x as executeQueryForCount,S as executeQueryForExtent,d as executeQueryForIds,p as executeQueryPBF,f as executeQueryPBFBuffer,y as queryToQueryStringParameters,g as runQuery};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{isSome as r}from"../../../core/maybe.js";import{formatNumber as a}from"../../../intl/number.js";import{createClassBreaksRenderer as t,getField as s}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as n}from"../support/utils.js";async function o(a){const t=(a=await n(a)).layer,{rasterInfo:o}=t;if(o.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");if(!r(o.attributeTable)&&!r(o.histograms)&&(await t.updateRasterInfoWithEstimatedStats({renderingRule:a.renderingRule,signal:a.signal}),!r(o.histograms)))throw new e("raster-class-breaks-renderer:not-supported","Histograms or raster attribute table is required on the source raster. Unable to estimate histograms");const{colors:i,numClasses:l}=a;if(i&&l&&i.length!==l)throw new e("raster-class-breaks-renderer:not-supported","The size of the `colors` parameter does not match 'numClasses'");return a.field||(a.field=r(o.attributeTable)?s(o.attributeTable,"value").name:"value"),a.classificationMethod||(a.classificationMethod="natural-breaks"),a}async function i(a){a=await o(a);const s=t(a.layer.rasterInfo,a);if(!r(s))throw new e("raster-class-breaks-renderer:not-supported","Class breaks renderer is not supported on this data");const n={minValue:s.minValue,maxValue:s.classBreakInfos[s.classBreakInfos.length-1].maxValue,normalizationTotal:null,classBreakInfos:s.classBreakInfos.map((e=>{const r=l(e.minValue,e.maxValue);return e.label=r,{minValue:e.minValue,maxValue:e.maxValue,label:r}}))};return{renderer:s,classBreaksResult:n}}function l(e,r){return a(e,{maximumFractionDigits:3})+" - "+a(r,{maximumFractionDigits:3})}export{i as createRenderer};
5
+ import e from"../../../core/Error.js";import{isSome as r}from"../../../core/maybe.js";import{formatNumber as a}from"../../../intl/number.js";import{createClassBreaksRenderer as t,getField as s}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as n}from"../support/utils.js";async function o(a){const t=(a=await n(a)).layer,{rasterInfo:o}=t;if(o.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");a.field||(a.field=r(o.attributeTable)?s(o.attributeTable,"value").name:"value");const i=r(o.attributeTable),l=i&&o.attributeTable.fields.find((e=>"count"===e.name.toLowerCase())),u=i&&o.attributeTable.fields.find((e=>e.name.toLowerCase()===a.field.toLowerCase()));if(!(l&&u||r(o.histograms)||(await t.updateRasterInfoWithEstimatedStats({renderingRule:a.renderingRule,signal:a.signal}),r(o.histograms))))throw new e("raster-class-breaks-renderer:not-supported","Histograms or raster attribute table is required on the source raster. Unable to estimate histograms");const{colors:m,numClasses:c}=a;if(m&&c&&m.length!==c)throw new e("raster-class-breaks-renderer:not-supported","The size of the `colors` parameter does not match 'numClasses'");return a.classificationMethod||(a.classificationMethod="natural-breaks"),a}async function i(a){a=await o(a);const s=t(a.layer.rasterInfo,a);if(!r(s))throw new e("raster-class-breaks-renderer:not-supported","Class breaks renderer is not supported on this data");const n={minValue:s.minValue,maxValue:s.classBreakInfos[s.classBreakInfos.length-1].maxValue,normalizationTotal:null,classBreakInfos:s.classBreakInfos.map((e=>{const r=l(e.minValue,e.maxValue);return e.label=r,{minValue:e.minValue,maxValue:e.maxValue,label:r}}))};return{renderer:s,classBreaksResult:n}}function l(e,r){return a(e,{maximumFractionDigits:3})+" - "+a(r,{maximumFractionDigits:3})}export{i as createRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{p as e,c as r,e as n,a as t,r as u,l as i,b as a,d as s,f as o,s as l,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import f from"../arcade/Dictionary.js";export{default as Dictionary}from"../arcade/Dictionary.js";import p from"../arcade/Feature.js";export{default as arcadeFeature}from"../arcade/Feature.js";import{clone as m}from"../core/lang.js";import{isSizeVariable as d}from"../renderers/visualVariables/support/sizeVariableUtils.js";const y=/^\$(feature|aggregatedFeatures)\./i,v={vars:{$feature:"any",$view:"any"},spatialReference:null};function x(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function g(r){if(!r)return null;try{return e(r)}catch(n){}return null}function w(e,n){const t="string"==typeof e?g(e):e;if(!t)return null;try{return n=n||m(v),r(t,n)}catch(u){}return null}function E(e,r){return{vars:{$feature:null==e?new p:p.createFromGraphic(e),$view:r&&r.view},spatialReference:r&&r.sr}}function F(e,r,n){return p.createFromGraphicLikeObject(r,e,n)}function $(e,r){e.vars.$feature=r}function b(e,r){let t;try{t=n(e,r)}catch(u){t=null}return t}function j(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function S(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}function R(e,r){if(!e)return[];const n="string"==typeof e?g(e):e;if(!n)return[];const u=t(n);let i=new Array;u.forEach((e=>{y.test(e)&&(e=e.replace(y,""),i.push(e))}));const a=i.filter((e=>e.includes("*")));return i=i.filter((e=>!a.includes(e))),r&&a.forEach((e=>{const n=new RegExp(`^${e.split(/\*+/).map(x).join(".*")}$`,"i");r.forEach((e=>n.test(e)?i.push(e):null))})),[...new Set(i.sort())]}function z(e){return u(e,"$view")}function C(e,r){return!!e&&u(e,r)}function M(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;return{view:e.viewingMode&&null!=e.scale?new f({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function k({url:e,spatialReference:r,lrucache:n,interceptor:t}){const u=o();return u?u.createFeatureSetCollectionFromService(e,r,n,t):null}function I({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:u,interceptor:i}){if(null===e)return null;const a=o();return a?a.constructFeatureSet(e,r,n,null==t||t,u,i):null}function D(e){if(null===(null==e?void 0:e.map))return null;const r=o();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function G(e,r,n=[]){return i(e,r,n)}function P(){return a()}function V(){return s()}function L(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type||"dot-density"===e.type||"dictionary"===e.type}function q(e){return"esri.layers.support.LabelClass"===e.declaredClass}function A(e){return"esri.PopupTemplate"===e.declaredClass}function O(e,r){if(!e)return!1;if("string"==typeof e)return r(e);const n=e;if(L(n)){if("dot-density"===n.type){const e=n.attributes.some((e=>r(e.valueExpression)));if(e)return e}const e=n.visualVariables,t=!!e&&e.some((e=>{let n=r(e.valueExpression);return"size"===e.type&&(d(e.minSize)&&(n=n||r(e.minSize.valueExpression)),d(e.maxSize)&&(n=n||r(e.maxSize.valueExpression))),n}));return!(!("valueExpression"in n)||!r(n.valueExpression))||t}if(q(n)){const e=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!e||!r(e))||!1}return!!A(n)&&(!!n.expressionInfos&&n.expressionInfos.some((e=>r(e.expression))))}function T(e){const r=g(e);return!!r&&l(r)}function U(e){return O(e,T)}function B(e){const r=g(e);return!!r&&c(r)}function H(e){return O(e,B)}export{I as convertFeatureLayerToFeatureSet,D as convertMapToFeatureSetCollection,k as convertServiceUrlToWorkspace,E as createExecContext,F as createFeature,w as createFunction,g as createSyntaxTree,z as dependsOnView,V as enableFeatureSetOperations,P as enableGeometryOperations,b as evalSyntaxTree,S as executeAsyncFunction,j as executeFunction,R as extractFieldNames,M as getViewInfo,U as hasGeometryFunctions,H as hasGeometryOperations,C as hasVariable,G as loadScriptDependencies,$ as updateExecContext};
5
+ import{p as e,c as r,e as n,a as t,r as u,l as s,b as i,d as a,f as o,s as l,g as c}from"../chunks/arcade.js";export{h as arcade}from"../chunks/arcade.js";import f from"../arcade/Dictionary.js";export{default as Dictionary}from"../arcade/Dictionary.js";import p from"../arcade/Feature.js";export{default as arcadeFeature}from"../arcade/Feature.js";import{clone as m}from"../core/lang.js";import{isSizeVariable as d}from"../renderers/visualVariables/support/sizeVariableUtils.js";const y=/^\$(feature|aggregatedFeatures)\./i,v={vars:{$feature:"any",$view:"any"},spatialReference:null};function x(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function g(r){if(!r)return null;try{return e(r)}catch(n){}return null}function w(e,n){const t="string"==typeof e?g(e):e;if(!t)return null;try{return n=n||m(v),r(t,n)}catch(u){}return null}function E(e,r){return{vars:{$feature:null==e?new p:p.createFromGraphic(e),$view:r&&r.view},spatialReference:r&&r.sr}}function F(e,r,n){return p.createFromGraphicLikeObject(r,e,n)}function $(e,r){e.vars.$feature=r}function b(e,r){let t;try{t=n(e,r)}catch(u){t=null}return t}function j(e,r){let n;try{n=e?e(r):null}catch(t){n=null}return n}function S(e,r){try{return e?e(r):Promise.resolve(null)}catch(n){return Promise.resolve(null)}}function R(e,r){if(!e)return[];const n="string"==typeof e?g(e):e;if(!n)return[];const u=t(n);let s=new Array;u.forEach((e=>{y.test(e)&&(e=e.replace(y,""),s.push(e))}));const i=s.filter((e=>e.includes("*")));return s=s.filter((e=>!i.includes(e))),r&&i.forEach((e=>{const n=new RegExp(`^${e.split(/\*+/).map(x).join(".*")}$`,"i");r.forEach((e=>n.test(e)?s.push(e):null))})),[...new Set(s.sort())]}function z(e){return u(e,"$view")}function C(e,r){return!!e&&u(e,r)}function I(e){if(!e||null==e.spatialReference&&(null==e.scale||null==e.viewingMode))return;return{view:e.viewingMode&&null!=e.scale?new f({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function M({url:e,spatialReference:r,lrucache:n,interceptor:t}){const u=o();return u?u.createFeatureSetCollectionFromService(e,r,n,t):null}function k({layer:e,spatialReference:r,outFields:n,returnGeometry:t,lrucache:u,interceptor:s}){if(null===e)return null;const i=o();return i?i.constructFeatureSet(e,r,n,null==t||t,u,s):null}function A(e){if(null===(null==e?void 0:e.map))return null;const r=o();return r?r.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function D(e,r,n=[]){return s(e,r,n)}function G(){return i()}function P(){return a()}function V(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type||"dot-density"===e.type||"dictionary"===e.type}function L(e){return"esri.layers.support.LabelClass"===e.declaredClass}function q(e){return"esri.PopupTemplate"===e.declaredClass}function O(e,r){if(!e)return!1;if("string"==typeof e)return r(e);const n=e;if(V(n)){if("dot-density"===n.type){const e=n.attributes.some((e=>r(e.valueExpression)));if(e)return e}const e=n.visualVariables,t=!!e&&e.some((e=>{let n=r(e.valueExpression);return"size"===e.type&&(d(e.minSize)&&(n=n||r(e.minSize.valueExpression)),d(e.maxSize)&&(n=n||r(e.maxSize.valueExpression))),n}));return!(!("valueExpression"in n)||!r(n.valueExpression))||t}if(L(n)){const e=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!e||!r(e))||!1}return!!q(n)&&(!!n.expressionInfos&&n.expressionInfos.some((e=>r(e.expression)))||Array.isArray(n.content)&&n.content.some((e=>{var n;return"expression"===e.type&&r(null==(n=e.expressionInfo)?void 0:n.expression)})))}function T(e){const r=g(e);return!!r&&l(r)}function U(e){return O(e,T)}function B(e){const r=g(e);return!!r&&c(r)}function H(e){return O(e,B)}export{k as convertFeatureLayerToFeatureSet,A as convertMapToFeatureSetCollection,M as convertServiceUrlToWorkspace,E as createExecContext,F as createFeature,w as createFunction,g as createSyntaxTree,z as dependsOnView,P as enableFeatureSetOperations,G as enableGeometryOperations,b as evalSyntaxTree,S as executeAsyncFunction,j as executeFunction,R as extractFieldNames,I as getViewInfo,U as hasGeometryFunctions,H as hasGeometryOperations,C as hasVariable,D as loadScriptDependencies,$ as updateExecContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- const c="20211209",b="84d3b592e14ffc7448dfe33171da130bb6c80c65";export{c as buildDate,b as commitHash};
5
+ const a="20211214",b="2f62aa11eb308d30278a805efbaca7231370b0d8";export{a as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as t}from"../../../../../core/maybe.js";import{pt2px as i}from"../../../../../core/screenUtils.js";import{FILTER_FLAG_0 as o,EFFECT_FLAG_0 as r}from"../definitions.js";import{CollisionBitsetGrid as n,NONE as s,HAS_COLLISION as a,OUTSIDE_EXTENT as l}from"./CollisionGrid.js";import{getSizeForValueSimple as c}from"./visualVariableSimpleUtils.js";const d=254,u=255,f=0;function b(t,i){const o=[];t.forEachTile((e=>o.push(e))),o.sort(((e,t)=>e.instanceId-t.instanceId)),o.forEach((t=>{e(t.labelMetrics)&&t.isReady&&i(t,t.labelMetrics.getCursor())}))}function y(e){return"feature"===e.layer.type||"csv"===e.layer.type||"geojson"===e.layer.type||"ogc-feature"===e.layer.type||"stream"===e.layer.type||"subtype-group"===e.layer.type||"wfs"===e.layer.type}function p(e){return t=>i(c(t,e))}function m(e){const t="visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if("size"===i.type)return p(i);return null}function h(e){for(const i of e){var t;const e="featureReduction"in i&&"cluster"===(null==(t=i.featureReduction)?void 0:t.type)&&i.featureReduction,o=[...i.labelingInfo||[],...e.labelingInfo||[]];if(!i.labelsVisible||!o.length)continue;if(o.some((e=>"none"===e.deconflictionStrategy)))return!0}return!1}function M(e,i){if(!y(i))return;const o="subtype-group"===i.layer.type?i.layer.sublayers.items:[i.layer],r=i.layer.geometryType,n=!h(o),s={};if("subtype-group"!==i.layer.type){if("heatmap"===i.layer.renderer.type)return;const e=m(i.layer.renderer);s[0]=e}const a=i.tileRenderer;if(t(a))return;const l=i.layer.visible&&!i.suspended;e.push({tileRenderer:a,vvEvaluators:s,deconflictionEnabled:n,geometryType:r,visible:l})}class g{run(e,t,i){const o=[];for(let r=e.length-1;r>=0;r--){M(o,e[r])}this._transformMetrics(o,t),this._runCollision(o,t,i)}_runCollision(e,t,i){const[o,r]=t.state.size,s=new n(o*t.pixelRatio,r*t.pixelRatio);for(const{tileRenderer:n,deconflictionEnabled:a,visible:l,geometryType:c}of e){const e=n.featuresView.attributeView;if(!a){b(n,((t,i)=>{for(;i.nextId();)e.setLabelMinZoom(i.id,f)}));continue}if(!l){b(n,((t,i)=>{for(;i.nextId();)e.setLabelMinZoom(i.id,u)}));continue}const t="polyline"===c;this._prepare(n),this._collideVisible(s,n,i,t),this._collideInvisible(s,n,t)}}_isFiltered(t,i,n){const s=i.getFilterFlags(t),a=!n.hasFilter||!!(s&o),l=!e(n.featureEffect)||n.featureEffect.excludedLabelsVisible||!!(s&r);return!(a&&l)}_prepare(e){const t=e.featuresView.attributeView,i=new Set;b(e,((o,r)=>{for(;r.nextId();){if(i.has(r.id))continue;if(i.add(r.id),this._isFiltered(r.id,t,e.layerView)){t.setLabelMinZoom(r.id,d);continue}t.getLabelMinZoom(r.id)!==f?t.setLabelMinZoom(r.id,u):t.setLabelMinZoom(r.id,f)}}))}_collideVisible(e,t,i,o){const r=t.featuresView.attributeView,n=new Set;b(t,((t,c)=>{for(;c.nextId();)if(!n.has(c.id))if(t.key.level===i){if(0===r.getLabelMinZoom(c.id)){switch(e.insertMetrics(c,o)){case l:break;case a:r.setLabelMinZoom(c.id,d),n.add(c.id);break;case s:r.setLabelMinZoom(c.id,f),n.add(c.id)}}}else r.setLabelMinZoom(c.id,d)}))}_collideInvisible(e,t,i){const o=t.featuresView.attributeView,r=new Set;b(t,((t,n)=>{for(;n.nextId();)if(!r.has(n.id)&&o.getLabelMinZoom(n.id)===u){switch(e.insertMetrics(n,i)){case l:break;case a:o.setLabelMinZoom(n.id,u),r.add(n.id);break;case s:o.setLabelMinZoom(n.id,f),r.add(n.id)}}}))}_transformMetrics(t,i){for(const{tileRenderer:o,geometryType:r,vvEvaluators:n}of t)b(o,((t,s)=>{const a=o.featuresView.attributeView,l=t.transforms.labelMat2d;l[4]=Math.round(l[4]),l[5]=Math.round(l[5]);const c=l[4],d=l[5],u="polyline"===r;for(;s.next();){const t=s.boundsCount,o=s.anchorX,r=s.anchorY;let f=s.size;const b=n[0];if(e(b)){const e=b(a.getVVSize(s.id));f=isNaN(e)||null==e||e===1/0?f:e}const y=s.directionX*(f/2),p=s.directionY*(f/2);for(let e=0;e<t;e++){let t=o,n=s.anchorY;if(u){let o=t+s.boundsX(e)+y,r=n+s.boundsY(e)+p;i.state.rotation?(o=l[0]*o+l[2]*r+l[4],r=l[1]*o+l[3]*r+l[5]):(o+=c,r+=d),s.setBoundsComputedAnchorX(e,Math.floor(o)),s.setBoundsComputedAnchorY(e,Math.floor(r))}else{i.state.rotation?(t=l[0]*o+l[2]*r+l[4],n=l[1]*o+l[3]*r+l[5]):(t+=c,n+=d);const a=t+s.boundsX(e)+y,u=n+s.boundsY(e)+p;s.setBoundsComputedAnchorX(e,a),s.setBoundsComputedAnchorY(e,u)}}}}))}}export{g as CollisionEngine};
5
+ import{isSome as e,isNone as t}from"../../../../../core/maybe.js";import{pt2px as i}from"../../../../../core/screenUtils.js";import{FILTER_FLAG_0 as o,EFFECT_FLAG_0 as r}from"../definitions.js";import{CollisionBitsetGrid as n,NONE as s,HAS_COLLISION as a,OUTSIDE_EXTENT as l}from"./CollisionGrid.js";import{getSizeForValueSimple as d}from"./visualVariableSimpleUtils.js";const c=254,u=255,f=0;function b(t,i){const o=[];t.forEachTile((e=>o.push(e))),o.sort(((e,t)=>e.instanceId-t.instanceId)),o.forEach((t=>{e(t.labelMetrics)&&t.isReady&&i(t,t.labelMetrics.getCursor())}))}function p(e){return"feature"===e.layer.type||"csv"===e.layer.type||"geojson"===e.layer.type||"ogc-feature"===e.layer.type||"stream"===e.layer.type||"subtype-group"===e.layer.type||"wfs"===e.layer.type}function y(e){return t=>i(d(t,e))}function m(e){const t="visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if("size"===i.type)return y(i);return null}function h(e){for(const i of e){var t;const e="featureReduction"in i&&"cluster"===(null==(t=i.featureReduction)?void 0:t.type)&&i.featureReduction,o=[...i.labelingInfo||[],...e.labelingInfo||[]];if(!i.labelsVisible||!o.length)continue;if(o.some((e=>"none"===e.deconflictionStrategy)))return!0}return!1}function M(e,i){if(!p(i))return;const o="subtype-group"===i.layer.type?i.layer.sublayers.items:[i.layer],r=i.layer.geometryType,n=!h(o),s={};if("subtype-group"!==i.layer.type){if("heatmap"===i.layer.renderer.type)return;const e=m(i.layer.renderer);s[0]=e}const a=i.tileRenderer;if(t(a))return;const l=i.layer.visible&&!i.suspended;e.push({tileRenderer:a,vvEvaluators:s,deconflictionEnabled:n,geometryType:r,visible:l})}class g{run(e,t,i){const o=[];for(let r=e.length-1;r>=0;r--){M(o,e[r])}this._transformMetrics(o,t),this._runCollision(o,t,i)}_runCollision(e,t,i){const[o,r]=t.state.size,s=new n(o*t.pixelRatio,r*t.pixelRatio);for(const{tileRenderer:n,deconflictionEnabled:a,visible:l}of e){const e=n.featuresView.attributeView;a?l?(this._prepare(n),this._collideVisible(s,n,i),this._collideInvisible(s,n)):b(n,((t,i)=>{for(;i.nextId();)e.setLabelMinZoom(i.id,u)})):b(n,((t,i)=>{for(;i.nextId();)e.setLabelMinZoom(i.id,f)}))}}_isFiltered(t,i,n){const s=i.getFilterFlags(t),a=!n.hasFilter||!!(s&o),l=!e(n.featureEffect)||n.featureEffect.excludedLabelsVisible||!!(s&r);return!(a&&l)}_prepare(e){const t=e.featuresView.attributeView,i=new Set;b(e,((o,r)=>{for(;r.nextId();){if(i.has(r.id))continue;if(i.add(r.id),this._isFiltered(r.id,t,e.layerView)){t.setLabelMinZoom(r.id,c);continue}t.getLabelMinZoom(r.id)!==f?t.setLabelMinZoom(r.id,u):t.setLabelMinZoom(r.id,f)}}))}_collideVisible(e,t,i){const o=t.featuresView.attributeView,r=new Set;b(t,((t,n)=>{for(;n.nextId();)if(!r.has(n.id))if(t.key.level===i){if(0===o.getLabelMinZoom(n.id)){switch(e.insertMetrics(n)){case l:break;case a:o.setLabelMinZoom(n.id,c),r.add(n.id);break;case s:o.setLabelMinZoom(n.id,f),r.add(n.id)}}}else o.setLabelMinZoom(n.id,c)}))}_collideInvisible(e,t){const i=t.featuresView.attributeView,o=new Set;b(t,((t,r)=>{for(;r.nextId();)if(!o.has(r.id)&&i.getLabelMinZoom(r.id)===u){switch(e.insertMetrics(r)){case l:break;case a:i.setLabelMinZoom(r.id,u),o.add(r.id);break;case s:i.setLabelMinZoom(r.id,f),o.add(r.id)}}}))}_transformMetrics(t,i){for(const{tileRenderer:o,geometryType:r,vvEvaluators:n}of t)b(o,((t,s)=>{const a=o.featuresView.attributeView,l=t.transforms.labelMat2d;l[4]=Math.round(l[4]),l[5]=Math.round(l[5]);const d=l[4],c=l[5],u="polyline"===r;for(;s.next();){const t=s.boundsCount,o=s.anchorX,r=s.anchorY;let f=s.size;const b=n[0];if(e(b)){const e=b(a.getVVSize(s.id));f=isNaN(e)||null==e||e===1/0?f:e}const p=s.directionX*(f/2),y=s.directionY*(f/2);for(let e=0;e<t;e++){let t=o,n=s.anchorY;if(u){let o=t+s.boundsX(e)+p,r=n+s.boundsY(e)+y;i.state.rotation?(o=l[0]*o+l[2]*r+l[4],r=l[1]*o+l[3]*r+l[5]):(o+=d,r+=c),s.setBoundsComputedAnchorX(e,Math.floor(o)),s.setBoundsComputedAnchorY(e,Math.floor(r))}else{i.state.rotation?(t=l[0]*o+l[2]*r+l[4],n=l[1]*o+l[3]*r+l[5]):(t+=d,n+=c);const a=t+s.boundsX(e)+p,u=n+s.boundsY(e)+y;s.setBoundsComputedAnchorX(e,a),s.setBoundsComputedAnchorY(e,u)}}}}))}}export{g as CollisionEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.22/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../../core/mathUtils.js";import{TILE_SIZE as s}from"../definitions.js";import{StaticBitSet as e}from"../../../layers/features/support/StaticBitSet.js";const i=2,o=1,h=0,r=1,n=2;class c{constructor(t,s){this.width=t,this.height=s;const i=Math.ceil(t/o),h=Math.ceil(s/o);this._cols=i,this._rows=h,this._cells=e.create(i*h)}insertMetrics(t,s){if(s)return this._markMetrics(t),h;const e=this._hasCollision(t);return e===h&&this._markMetrics(t),e}getCellId(t,s){return t+s*this._cols}has(t){return this._cells.has(t)}hasRange(t,s){return this._cells.hasRange(t,s)}set(t){this._cells.set(t)}setRange(t,s){this._cells.setRange(t,s)}_hasCollision(t){const s=t.id;let e=0,o=0;t.save();do{const s=t.boundsCount;e+=s;for(let e=0;e<s;e++){const s=t.boundsComputedAnchorX(e),h=t.boundsComputedAnchorY(e),c=t.boundsWidth(e)+i,l=t.boundsHeight(e)+i;switch(this._collide(s,h,c,l)){case n:return n;case r:o++}}}while(t.peekId()===s&&t.next());return t.restore(),e===o?r:h}_collide(s,e,i,c){const l=s-i/2,_=e-c/2,a=l+i,u=_+c;if(a<0||u<0||l>this.width||_>this.height)return r;const d=t(Math.floor(l/o),0,this._cols),g=t(Math.floor(_/o),0,this._rows),f=t(Math.ceil(a/o),0,this._cols),m=t(Math.ceil(u/o),0,this._rows);for(let t=g;t<=m;t++)for(let s=d;s<=f;s++){const e=this.getCellId(s,t);if(this.has(e))return n}return h}_mark(s,e,i,h){const r=s-i/2,n=e-h/2,c=r+i,l=n+h,_=t(Math.floor(r/o),0,this._cols),a=t(Math.floor(n/o),0,this._rows),u=t(Math.ceil(c/o),0,this._cols),d=t(Math.ceil(l/o),0,this._rows);for(let t=a;t<=d;t++)for(let s=_;s<=u;s++){const e=this.getCellId(s,t);this.set(e)}return!1}_markMetrics(t){const s=t.id;do{const s=t.boundsCount;for(let e=0;e<s;e++){const s=t.boundsComputedAnchorX(e),o=t.boundsComputedAnchorY(e),h=t.boundsWidth(e)+i,r=t.boundsHeight(e)+i;this._mark(s,o,h,r)}}while(t.peekId()===s&&t.next())}}class l{constructor(t,e=2){this._bucketSize=t,this._rowsLength=s/t,this._colsLength=s/t,this._elementsPerBucket=e,this._grid=this._initGrid()}checkOverlap(t,s){const e=Math.floor(t/this._bucketSize),i=Math.floor(s/this._bucketSize);return e<0||e>=this._rowsLength||i<0||i>=this._colsLength||this._grid[i*this._colsLength+e]>=this._elementsPerBucket}markUsed(t,s){const e=Math.floor(t/this._bucketSize),i=Math.floor(s/this._bucketSize);this._grid[i*this._colsLength+e]+=1}reset(){this._grid=this._initGrid()}_initGrid(){return new Uint8Array(this._rowsLength*this._colsLength)}}export{c as CollisionBitsetGrid,l as CollisionGrid,n as HAS_COLLISION,h as NONE,r as OUTSIDE_EXTENT};
5
+ import{clamp as t}from"../../../../../core/mathUtils.js";import{TILE_SIZE as s}from"../definitions.js";import{StaticBitSet as e}from"../../../layers/features/support/StaticBitSet.js";const i=2,o=1,h=0,r=1,n=2;class c{constructor(t,s){this.width=t,this.height=s;const i=Math.ceil(t/o),h=Math.ceil(s/o);this._cols=i,this._rows=h,this._cells=e.create(i*h)}insertMetrics(t){const s=this._hasCollision(t);return s===h&&this._markMetrics(t),s}getCellId(t,s){return t+s*this._cols}has(t){return this._cells.has(t)}hasRange(t,s){return this._cells.hasRange(t,s)}set(t){this._cells.set(t)}setRange(t,s){this._cells.setRange(t,s)}_hasCollision(t){const s=t.id;let e=0,o=0;t.save();do{const s=t.boundsCount;e+=s;for(let e=0;e<s;e++){const s=t.boundsComputedAnchorX(e),h=t.boundsComputedAnchorY(e),c=t.boundsWidth(e)+i,l=t.boundsHeight(e)+i;switch(this._collide(s,h,c,l)){case n:return n;case r:o++}}}while(t.peekId()===s&&t.next());return t.restore(),e===o?r:h}_collide(s,e,i,c){const l=s-i/2,_=e-c/2,a=l+i,u=_+c;if(a<0||u<0||l>this.width||_>this.height)return r;const d=t(Math.floor(l/o),0,this._cols),g=t(Math.floor(_/o),0,this._rows),f=t(Math.ceil(a/o),0,this._cols),m=t(Math.ceil(u/o),0,this._rows);for(let t=g;t<=m;t++)for(let s=d;s<=f;s++){const e=this.getCellId(s,t);if(this.has(e))return n}return h}_mark(s,e,i,h){const r=s-i/2,n=e-h/2,c=r+i,l=n+h,_=t(Math.floor(r/o),0,this._cols),a=t(Math.floor(n/o),0,this._rows),u=t(Math.ceil(c/o),0,this._cols),d=t(Math.ceil(l/o),0,this._rows);for(let t=a;t<=d;t++)for(let s=_;s<=u;s++){const e=this.getCellId(s,t);this.set(e)}return!1}_markMetrics(t){const s=t.id;do{const s=t.boundsCount;for(let e=0;e<s;e++){const s=t.boundsComputedAnchorX(e),o=t.boundsComputedAnchorY(e),h=t.boundsWidth(e)+i,r=t.boundsHeight(e)+i;this._mark(s,o,h,r)}}while(t.peekId()===s&&t.next())}}class l{constructor(t,e=2){this._bucketSize=t,this._rowsLength=s/t,this._colsLength=s/t,this._elementsPerBucket=e,this._grid=this._initGrid()}checkOverlap(t,s){const e=Math.floor(t/this._bucketSize),i=Math.floor(s/this._bucketSize);return e<0||e>=this._rowsLength||i<0||i>=this._colsLength||this._grid[i*this._colsLength+e]>=this._elementsPerBucket}markUsed(t,s){const e=Math.floor(t/this._bucketSize),i=Math.floor(s/this._bucketSize);this._grid[i*this._colsLength+e]+=1}reset(){this._grid=this._initGrid()}_initGrid(){return new Uint8Array(this._rowsLength*this._colsLength)}}export{c as CollisionBitsetGrid,l as CollisionGrid,n as HAS_COLLISION,h as NONE,r as OUTSIDE_EXTENT};