@arcgis/core 5.0.0-next.11 → 5.0.0-next.12

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 (382) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  4. package/arcade/functions/geomasync.js +1 -1
  5. package/arcade/functions/geomsync.js +1 -1
  6. package/arcade/functions/knowledgegraph.js +1 -1
  7. package/arcade/geometry/nearestVertex.js +5 -0
  8. package/arcade/geometry/operators.js +1 -1
  9. package/arcade/geometry/operatorsWorker.js +1 -1
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
  17. package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
  23. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
  26. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
  29. package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
  30. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  31. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
  33. package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
  35. package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
  36. package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
  37. package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
  38. package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
  40. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  41. package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
  42. package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
  43. package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
  44. package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
  45. package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
  48. package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
  51. package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
  54. package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
  55. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
  56. package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
  57. package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
  58. package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
  61. package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
  63. package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
  64. package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
  66. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
  67. package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
  73. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
  74. package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
  75. package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
  76. package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
  77. package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
  78. package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
  79. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  80. package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
  81. package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
  84. package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
  85. package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
  86. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
  87. package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{6cf391b5ed7351601a2a.js → 9978ec6c67e87dc08a1d.js} +1 -1
  89. package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
  90. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  91. package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
  95. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  96. package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
  97. package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
  98. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  99. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  100. package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
  101. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  102. package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
  103. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  104. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
  105. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  106. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
  107. package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
  108. package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
  109. package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{b6853c6a25eaabc9a7f6.js → c9579d607e59bae214da.js} +1 -1
  113. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  114. package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
  115. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
  116. package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
  117. package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
  118. package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
  119. package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
  121. package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
  122. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
  123. package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
  124. package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
  125. package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
  127. package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
  128. package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
  129. package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
  130. package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
  131. package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  136. package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
  140. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  141. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  142. package/assets/esri/themes/dark/main.css +1 -1
  143. package/assets/esri/themes/light/main.css +1 -1
  144. package/assets/esri/themes/light/view.css +1 -1
  145. package/chunks/Envelope.js +1 -1
  146. package/chunks/Geometry.js +1 -1
  147. package/chunks/MultiPathImpl.js +1 -1
  148. package/chunks/Point2D.js +1 -1
  149. package/chunks/UnitFactory.js +1 -1
  150. package/chunks/containsOperator.js +1 -1
  151. package/chunks/densifyOperator.js +1 -1
  152. package/chunks/differenceOperator.js +1 -1
  153. package/chunks/intersectsOperator.js +1 -1
  154. package/chunks/persistableUrlUtils.js +1 -1
  155. package/config.js +1 -1
  156. package/core/XHRAdapter.js +1 -1
  157. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  158. package/core/quantityFormatUtils.js +1 -1
  159. package/core/unitFormatUtils.js +1 -1
  160. package/core/unitUtils.js +1 -1
  161. package/editing/fieldUtils.js +5 -0
  162. package/geometry/Extent.js +1 -1
  163. package/geometry/Geometry.js +1 -1
  164. package/geometry/Mesh.js +1 -1
  165. package/geometry/Point.js +1 -1
  166. package/geometry/SpatialReference.js +1 -1
  167. package/geometry/ellipsoidUtils.js +1 -1
  168. package/geometry/operators/support/jsonConverter.js +1 -1
  169. package/geometry/support/MeshTransform.js +1 -1
  170. package/geometry/support/axisAngleDegrees.js +1 -1
  171. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  172. package/geometry/support/meshUtils/rotate.js +1 -1
  173. package/geometry/support/meshUtils/scale.js +1 -1
  174. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  175. package/geometry/support/plane.js +1 -1
  176. package/geometry/support/polygonUtils.js +1 -1
  177. package/interfaces.d.ts +90 -7
  178. package/kernel.js +1 -1
  179. package/layers/Layer.js +1 -1
  180. package/layers/MapNotesLayer.js +1 -1
  181. package/layers/graphics/data/QueryEngine.js +1 -1
  182. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  183. package/layers/save/groupLayerUtils.js +1 -1
  184. package/layers/save/imageryUtils.js +1 -1
  185. package/layers/save/streamLayerUtils.js +1 -1
  186. package/layers/support/DateTimeFieldFormat.js +1 -1
  187. package/layers/support/FieldFormat.js +1 -1
  188. package/layers/support/LayerLoadContext.js +1 -1
  189. package/layers/support/NumberFieldFormat.js +1 -1
  190. package/layers/support/arcgisLayerUrl.js +1 -1
  191. package/layers/support/arcgisLayers.js +1 -1
  192. package/layers/support/fetchService.js +1 -1
  193. package/layers/support/fieldUtils.js +1 -1
  194. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  195. package/layers/video/VideoCameraSensorModel.js +1 -1
  196. package/networks/support/UNTraceConfiguration.js +1 -1
  197. package/package.json +1 -1
  198. package/popup/ExpressionInfo.js +1 -1
  199. package/popup/FieldInfo.js +1 -1
  200. package/popup/content/AttachmentsContent.js +1 -1
  201. package/popup/content/BarChartMediaInfo.js +1 -1
  202. package/popup/content/ColumnChartMediaInfo.js +1 -1
  203. package/popup/content/Content.js +1 -1
  204. package/popup/content/CustomContent.js +1 -1
  205. package/popup/content/ExpressionContent.js +1 -1
  206. package/popup/content/FieldsContent.js +1 -1
  207. package/popup/content/ImageMediaInfo.js +1 -1
  208. package/popup/content/LineChartMediaInfo.js +1 -1
  209. package/popup/content/MediaContent.js +1 -1
  210. package/popup/content/PieChartMediaInfo.js +1 -1
  211. package/popup/content/RelationshipContent.js +1 -1
  212. package/popup/content/TextContent.js +1 -1
  213. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  214. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  215. package/popup/content/mixins/MediaInfo.js +1 -1
  216. package/popup/content.js +1 -1
  217. package/popup/support/FieldInfoFormat.js +1 -1
  218. package/portal/support/layersLoader.js +1 -1
  219. package/request/cors.js +5 -0
  220. package/request/loadImage.js +5 -0
  221. package/request/preferredHosts.js +5 -0
  222. package/request/process.js +5 -0
  223. package/request/queue.js +5 -0
  224. package/request/serviceJSON.js +5 -0
  225. package/request.js +1 -1
  226. package/rest/geometryService/utils.js +1 -1
  227. package/rest/knowledgeGraphService.d.ts +1 -0
  228. package/support/getDefaultUnitForView.js +1 -1
  229. package/support/popupUtils.js +1 -1
  230. package/support/revision.js +1 -1
  231. package/symbols/support/symbolUtils.js +1 -1
  232. package/time/TimeExtent.js +1 -1
  233. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
  234. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
  235. package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
  236. package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
  237. package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
  238. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
  239. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
  240. package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
  241. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  242. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  243. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  244. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  245. package/views/3d/environment/CloudsRenderer.js +1 -1
  246. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  247. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  248. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  249. package/views/3d/layers/FlowSubView3D.js +1 -1
  250. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  251. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  252. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  253. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
  255. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  256. package/views/3d/support/StreamTextureCollection.js +1 -1
  257. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  258. package/views/3d/terrain/TerrainSurface.js +1 -1
  259. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  260. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  261. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  262. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  263. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  264. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  265. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  266. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  267. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  268. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  269. package/views/View2D.js +1 -1
  270. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  271. package/views/analysis/ElevationProfile/constants.js +1 -1
  272. package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
  273. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  274. package/views/draw/DrawOperation.js +1 -1
  275. package/views/magnifier/resources.js +1 -1
  276. package/webdoc/support/webdocSaveUtils.js +1 -1
  277. package/widgets/BasemapLayerList.js +1 -1
  278. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  279. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  280. package/widgets/Editor/EditorViewModel.js +1 -1
  281. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  282. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  283. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  284. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  285. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  286. package/widgets/Editor/UpdateWorkflow.js +1 -1
  287. package/widgets/Editor/Workflow.js +1 -1
  288. package/widgets/Editor/components/FeatureList.js +1 -1
  289. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  290. package/widgets/Editor/components/Notices.js +1 -1
  291. package/widgets/Editor/components/PanelContent.js +1 -1
  292. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  293. package/widgets/Editor/css.js +1 -1
  294. package/widgets/Editor/support/EditorItem.js +1 -1
  295. package/widgets/Editor/support/SketchController.js +1 -1
  296. package/widgets/Editor/support/errors.js +1 -1
  297. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  298. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  299. package/widgets/Editor/workflowUtils.js +1 -1
  300. package/widgets/Editor.js +1 -1
  301. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  302. package/widgets/FeatureForm/FieldInput.js +1 -1
  303. package/widgets/FeatureForm.js +1 -1
  304. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  305. package/widgets/FeatureTable/FieldColumn.js +1 -1
  306. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  307. package/widgets/LayerList.js +1 -1
  308. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  309. package/widgets/Legend/support/utils.js +1 -1
  310. package/widgets/PanoramicVideoViewer.js +1 -1
  311. package/widgets/support/FilterCondition.js +1 -1
  312. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
  313. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
  314. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
  315. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
  316. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
  317. package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
  318. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
  319. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
  320. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
  321. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
  322. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
  323. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
  324. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
  325. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
  326. package/assets/esri/core/workers/chunks/4291681d067ebdf86e73.js +0 -1
  327. package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
  328. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
  329. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
  330. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
  331. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  332. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
  333. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
  334. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  335. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
  336. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
  337. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
  338. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
  339. package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
  340. package/assets/esri/core/workers/chunks/655beaf83e9845a02334.js +0 -1
  341. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
  342. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
  343. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
  344. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
  345. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
  346. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
  347. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
  348. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
  349. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
  350. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
  351. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  352. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
  353. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
  354. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
  355. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
  356. package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
  357. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
  358. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
  359. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  360. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
  361. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
  362. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
  363. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
  364. package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
  365. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  366. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
  367. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
  368. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
  369. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
  370. package/assets/esri/core/workers/chunks/f57401a759f420596b2c.js +0 -1
  371. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
  372. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
  373. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
  374. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
  375. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
  376. package/processRequest.js +0 -5
  377. package/requestQueue.js +0 -5
  378. package/support/requestPresets.js +0 -5
  379. package/support/requestUtils.js +0 -5
  380. /package/{rest/support → request}/ImageWithType.js +0 -0
  381. /package/{requestConfig.js → request/config.js} +0 -0
  382. /package/{support/requestImageUtils.js → request/image.js} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1863],{159:(e,t,r)=>{r.d(t,{A:()=>u});var n,i=r(31635),s=r(69622),o=r(10107),l=(r(44208),r(53966),r(87811),r(64108)),a=r(99157);let u=n=class extends s.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new n;for(let t=this.steps.length-1;t>=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}};(0,i.Cg)([(0,o.MZ)({type:[a.A],nonNullable:!0})],u.prototype,"steps",void 0),u=n=(0,i.Cg)([(0,l.$)("esri.geometry.operators.support.GeographicTransformation")],u)},162:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Y});var n=r(31635),i=r(7762),s=r(38961),o=r(25728),l=r(74887),a=r(36708),u=r(84952),c=r(10107),p=(r(44208),r(53966),r(87811),r(36005)),d=r(64108),h=r(43937),f=r(5443),y=r(16930),m=r(4146),g=r(63074),b=r(16131),v=r(8303),w=r(54310),M=r(25036),_=r(10873),S=r(65529),T=r(25482),x=r(92474),I=r(799),F=r(56507),A=r(89808),C=r(99959);const R=Symbol("isKMLGraphicOrigin");var P;class O extends C.A{get[(P=R,A.Q)](){return this.layer}constructor(e,t){super(),this[P]=!0,this.type="kml",this.layer=e,this.sublayer=t}get id(){return`${this.layer.id}:__${this.sublayer.id}__`}}var Z=r(92602),E=r(70333),j=(r(37838),r(43773)),L=r(4718),G=r(70328),N=r(6606);r(65494),r(22671);const k={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function q(e){const t=e.folders||[],r=t.slice(),n=new Map,i=new Map,s=new Map,o=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:s,esriGeometryPolygon:o};(e.featureCollection?.layers||[]).forEach(e=>{const t=(0,L.o8)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;n.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?V(i,l,e.featureSet.features):"esriGeometryPolyline"===r?V(s,l,e.featureSet.features):"esriGeometryPolygon"===r&&V(o,l,e.featureSet.features)}),e.groundOverlays&&e.groundOverlays.forEach(e=>{l.set(e.id,e)}),t.forEach(t=>{t.networkLinkIds.forEach(n=>{const i=function(e,t,r){const n=function(e,t){let r;return t.some(t=>t.id===e&&(r=t,!0)),r}(e,r);return n&&(n.parentFolderId=t,n.networkLink=n),n}(n,t.id,e.networkLinks);i&&r.push(i)})}),r.forEach(e=>{if(e.featureInfos){e.points=(0,L.o8)(n.get("esriGeometryPoint")),e.polylines=(0,L.o8)(n.get("esriGeometryPolyline")),e.polygons=(0,L.o8)(n.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[k[t.type]]?.featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=z([e])}});const u=z(r);return{folders:t,sublayers:r,extent:u}}function D(e,t,r,n){const i=E.id?.findCredential(e);e=(0,u.a6)(e,{token:i?.token});const s=Z.A.kmlServiceUrl;return(0,j.A)(s,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:n})}function $(e,t,r=null,n=[]){const i=[],s={},o=t.sublayers,l=new Set(t.folders.map(e=>e.id));return o.forEach(t=>{const o=new e;if(r?o.read(t,r):o.read(t),n.length&&l.has(o.id)&&(o.visible=n.includes(o.id)),s[t.id]=o,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=s[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers?.unshift(o)}else i.unshift(o)}),i}function V(e,t,r){r.forEach(r=>{e.set(r.attributes[t],r)})}function z(e){const t=(0,G.vt)(G.qv),r=(0,G.vt)(G.qv);for(const n of e){if(n.polygons?.featureSet?.features)for(const e of n.polygons.featureSet.features)(0,N.LJ)(t,e.geometry),(0,G.RF)(r,t);if(n.polylines?.featureSet?.features)for(const e of n.polylines.featureSet.features)(0,N.LJ)(t,e.geometry),(0,G.RF)(r,t);if(n.points?.featureSet?.features)for(const e of n.points.featureSet.features)(0,N.LJ)(t,e.geometry),(0,G.RF)(r,t);if(n.mapImages)for(const e of n.mapImages)(0,N.LJ)(t,e.extent),(0,G.RF)(r,t)}return(0,G.aI)(r,G.qv)?void 0:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:y.A.WGS84}}var J;let U=J=class extends((0,S.Zt)((0,T.T)(x.x_))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([(0,a.on)(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},a.OH),(0,a.on)(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},a.OH),(0,a.wB)(()=>this.sublayers,(e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=this,t.layer=this.layer},a.OH),(0,a.wB)(()=>this.layer,e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e},a.OH)])}initialize(){(0,a.C_)(()=>this.networkLink).then(()=>(0,a.C_)(()=>!0===this.visible)).then(()=>this.load())}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=null!=e?e.signal:null,r=this._fetchService(this._get("networkLink")?.href??"",t).then(e=>{const t=z(e.sublayers);this.fullExtent=f.A.fromJSON(t),this.sourceJSON=e;const r=(0,F.dp)(i.A.ofType(J),$(J,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(r),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}get origin(){return this.layer?new O(this.layer,this):null}_fetchService(e,t){return D(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(e=>q(e.data))}};(0,n.Cg)([(0,c.MZ)()],U.prototype,"description",void 0),(0,n.Cg)([(0,c.MZ)({type:f.A})],U.prototype,"fullExtent",void 0),(0,n.Cg)([(0,c.MZ)()],U.prototype,"id",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0,value:null})],U.prototype,"networkLink",void 0),(0,n.Cg)([(0,c.MZ)({json:{write:{allowNull:!0}}})],U.prototype,"parent",void 0),(0,n.Cg)([(0,c.MZ)({type:i.A.ofType(U),json:{write:{allowNull:!0}}})],U.prototype,"sublayers",void 0),(0,n.Cg)([(0,c.MZ)({value:null,json:{read:{source:"name",reader:e=>(0,I._e)(e)}}})],U.prototype,"title",void 0),(0,n.Cg)([(0,c.MZ)({value:!0})],U.prototype,"visible",null),(0,n.Cg)([(0,p.w)("visible",["visibility"])],U.prototype,"readVisible",null),(0,n.Cg)([(0,c.MZ)()],U.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,c.MZ)()],U.prototype,"layer",void 0),(0,n.Cg)([(0,c.MZ)()],U.prototype,"origin",null),U=J=(0,n.Cg)([(0,d.$)("esri.layers.support.KMLSublayer")],U);const B=["kml","xml"];let H=class extends((0,g.dM)((0,w.J)((0,M.j)((0,b.q)((0,v.A)((0,o.P)(m.A))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new s.A({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=y.A.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([(0,a.wB)(()=>this.sublayers,(e,t)=>{t&&t.forEach(e=>{e.parent=null,e.layer=null}),e&&e.forEach(e=>{e.parent=this,e.layer=this})},a.OH),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}get sublayerById(){const e=new Map;for(const t of this.allSublayers)e.set(t.id,t);return e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return $(U,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],n=e.toArray();for(;n.length;){const e=n[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&n.push(...e.sublayers.toArray())),n.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.e7)(this.url,B)||"KML":e}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e?.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(l.QP).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=q((await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:D(this.url??"",this.outSpatialReference,this.refreshInterval,e))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const n of r.sublayers.items)t(n),n.visible&&n.fullExtent&&(null!=e?e.union(n.fullExtent):e=n.fullExtent.clone())};return t(this),e}};(0,n.Cg)([(0,c.MZ)({readOnly:!0})],H.prototype,"allSublayers",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0})],H.prototype,"sublayerById",null),(0,n.Cg)([(0,c.MZ)({type:y.A})],H.prototype,"outSpatialReference",void 0),(0,n.Cg)([(0,c.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],H.prototype,"path",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1}})],H.prototype,"legendEnabled",void 0),(0,n.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],H.prototype,"listMode",void 0),(0,n.Cg)([(0,c.MZ)({type:["KML"]})],H.prototype,"operationalLayerType",void 0),(0,n.Cg)([(0,c.MZ)({})],H.prototype,"resourceInfo",void 0),(0,n.Cg)([(0,c.MZ)({type:i.A.ofType(U),json:{write:{ignoreOrigin:!0}}})],H.prototype,"sublayers",void 0),(0,n.Cg)([(0,p.w)(["web-map","portal-item"],"sublayers",["visibleFolders"])],H.prototype,"readSublayersFromItemOrWebMap",null),(0,n.Cg)([(0,p.w)("service","sublayers",["sublayers"])],H.prototype,"readSublayers",null),(0,n.Cg)([(0,h.K)("sublayers")],H.prototype,"writeSublayers",null),(0,n.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],H.prototype,"type",void 0),(0,n.Cg)([(0,c.MZ)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],H.prototype,"title",null),(0,n.Cg)([(0,c.MZ)(_.OZ)],H.prototype,"url",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0})],H.prototype,"visibleSublayers",null),(0,n.Cg)([(0,c.MZ)({type:f.A})],H.prototype,"extent",void 0),(0,n.Cg)([(0,c.MZ)()],H.prototype,"fullExtent",null),H=(0,n.Cg)([(0,d.$)("esri.layers.KMLLayer")],H);const Y=H},3330:(e,t,r)=>{r.d(t,{GB:()=>i,Qo:()=>o,Y4:()=>s});var n=r(28097);class i{static{this.instance=new n.oh("Etc/UTC")}}function s(e){return e instanceof n.bo?e===i.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return s(e)?i.instance:e}},4197:(e,t,r)=>{r.d(t,{Vj:()=>u,cj:()=>a,jh:()=>s,l5:()=>l,xm:()=>o});var n=r(34275),i=r(9093);function s(e){return e<=n.y9?new Array(e).fill(0):new Float64Array(e)}function o(e){return((0,n.iu)(e)?e.byteLength/8:e.length)<=n.y9?Array.from(e):new Float64Array(e)}function l(e,t,r){return Array.isArray(e)?e.slice(t,t+r):e.subarray(t,t+r)}function a(e){return[...e]}function u(e){const t=(0,i.vt)();for(let r=0;r<16;++r)t[r]=e[r];return t}},6797:(e,t,r)=>{r.d(t,{Ui:()=>d});var n=r(69622),i=r(7762),s=r(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof n.A}function a(e){return e instanceof i.A?Object.keys(e.items):l(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof i.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function p(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const n=a(e),i=a(t);if(0===n.length&&0===i.length)return;if(!n.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=i.filter(e=>!n.includes(e)),d=n.filter(e=>!i.includes(e)),h=n.filter(r=>i.includes(r)&&u(e,r)!==u(t,r)).concat(s,d).sort(),f=c(e);if(f&&o.has(f)&&h.length)return{type:"complete",oldValue:e,newValue:t};let y;const m=l(e)&&l(t);for(const n of h){const i=u(e,n),s=u(t,n);let o;if((m||"function"!=typeof i&&"function"!=typeof s)&&i!==s&&(null!=i||null!=s)){if(r&&r[n]&&"function"==typeof r[n])o=r[n]?.(i,s);else if(i instanceof Date&&s instanceof Date){if(i.getTime()===s.getTime())continue;o={type:"complete",oldValue:i,newValue:s}}else o="object"==typeof i&&"object"==typeof s&&c(i)===c(s)?p(i,s):{type:"complete",oldValue:i,newValue:s};null!=o&&(null!=y?y.diff[n]=o:y={type:"partial",diff:{[n]:o}})}}return y}function d(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:p(e,t)}},8303:(e,t,r)=>{r.d(t,{A:()=>_});var n=r(31635),i=r(92602),s=r(70333),o=r(43773),l=r(60999),a=r(49186),u=r(53966),c=r(97768),p=r(74887),d=r(84952),h=r(10107),f=(r(44208),r(87811),r(36005)),y=r(64108),m=r(43937),g=r(77548),b=r(20655),v=r(80812),w=r(41318),M=r(10407);const _=e=>{const t=e;let _=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:n}=await r.e(1204).then(r.bind(r,41204));return(0,p.Te)(t),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:n},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",n),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const n=!s.id?.findCredential(this.url),i=e===r.id;if(i&&r.portal.user)return this._getUserPrivileges(r,n);let o,l;if(i)o=r.portal.url;else try{o=await(0,g.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!o||!(0,d.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,c=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(i?await r.reload():(r=new v.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,n)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const r=(0,M.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=s.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const n=`${r.owningSystemUrl}/sharing/rest`,i=b.A.getDefault();if(i&&i.loaded&&(0,d.S8)(i.restUrl)===(0,d.S8)(n))return i.user;const a=`${n}/community/self`,u=null!=e?e.signal:null,c=await(0,l.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?w.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,n=this.portalItem?.id&&(this.portalItem.portal||b.A.getDefault());return r&&n&&!(0,d.ut)(n.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,n.Cg)([(0,h.MZ)({type:v.default})],_.prototype,"portalItem",null),(0,n.Cg)([(0,f.w)("web-document","portalItem",["itemId"])],_.prototype,"readPortalItem",null),(0,n.Cg)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],_.prototype,"writePortalItem",null),(0,n.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"resourceReferences",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasEditingPrivileges",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasFullEditingPrivileges",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],_.prototype,"userHasUpdateItemPrivileges",void 0),_=(0,n.Cg)([(0,y.$)("esri.layers.mixins.PortalLayer")],_),_},S={credential:null,user:null}},9093:(e,t,r)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}r.d(t,{o8:()=>i,vt:()=>n,zK:()=>s});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:s,clone:i,create:n,fromValues:function(e,t,r,n,i,s,o,l,a,u,c,p,d,h,f,y){return[e,t,r,n,i,s,o,l,a,u,c,p,d,h,f,y]}},Symbol.toStringTag,{value:"Module"}))},9762:(e,t,r)=>{r.r(t),r.d(t,{projectBuffer:()=>i});var n=r(37539);function i(e,t,r,i,s,o,l=Math.floor(e.length/3)){const a=(0,n.jd)(t,s);if(null==a)return!1;if(a===n.pO){if(e===i&&r===o)return!0;const t=r+3*l;for(let n=r,s=o;n<t;n++,s++)i[s]=e[n];return!0}const u=r+3*l;for(let t=r,n=o;t<u;t+=3,n+=3)a(e,t,i,n);return!0}},10407:(e,t,r)=>{r.d(t,{It:()=>h,LG:()=>o,OM:()=>u,Sm:()=>c,Y:()=>l,bK:()=>a,mm:()=>d,sQ:()=>p});var n=r(91218),i=r(16930),s=r(28735);function o(e,t){if(!l(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return l(e,d.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function c(e,t,r){r?o(e,t):u(e,t)}async function p(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const r=i.A.WGS84;return await(0,n.initializeProjection)(t,r),(0,n.project)(e,r)}(r)}const d={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function h(e){const{portal:t,isOrgItem:r,itemControl:n}=e,i=t.user?.privileges;let s=!i||i.includes("features:user:edit"),o=!!r&&!!i?.includes("features:user:fullEdit");const l="update"===n||"admin"===n;return l?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:l}}}},20437:(e,t,r)=>{r.d(t,{A:()=>y});var n,i=r(31635),s=r(66552),o=r(25482),l=r(10107),a=r(56507),u=(r(44208),r(87811),r(93223)),c=r(36005),p=r(64108),d=r(80451),h=r(98453);const f=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let y=class extends o.o{static{n=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?f.fromJSON(r.fieldValueType):null}clone(){return new n({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"alias",void 0),(0,i.Cg)([(0,l.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],y.prototype,"defaultValue",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"description",void 0),(0,i.Cg)([(0,c.w)("description")],y.prototype,"readDescription",null),(0,i.Cg)([(0,l.MZ)({types:d.gK,json:{read:{reader:d.rS},write:!0}})],y.prototype,"domain",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"editable",void 0),(0,i.Cg)([(0,l.MZ)({type:a.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],y.prototype,"length",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"nullable",void 0),(0,i.Cg)([(0,u.e)(h.m)],y.prototype,"type",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"valueType",void 0),(0,i.Cg)([(0,c.w)("valueType",["description"])],y.prototype,"readValueType",null),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{read:!1}})],y.prototype,"visible",void 0),y=n=(0,i.Cg)([(0,p.$)("esri.layers.support.Field")],y)},22671:(e,t,r)=>{r.d(t,{A:()=>b});var n,i=r(31635),s=r(52106),o=r(66552),l=r(25482),a=r(4718),u=r(10107),c=(r(44208),r(53966),r(36005)),p=r(64108),d=r(43937),h=r(16930),f=r(65864),y=r(50498),m=r(20437);const g=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=n=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,r,n){if(e)return void g.write(e,t,r,n);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,f.rS)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=h.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,a.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e?.[r];n.geometry=t?.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,i]}=e,s=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-n)/t),e=>Math.round((i-e)/r));for(let e=0,t=s.length;e<t;e++)o?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,i],scale:[s,o]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*s+n,e=>i-e*o,l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const n=h.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=r.fromJSON(s),l=s.geometry?.spatialReference;null==o.geometry||l||(o.geometry.spatialReference=n);const a=s.aggregateGeometries,u=o.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],r=a[e],i=r?.spatialReference;null==t||i||(t.spatialReference=n)}i.push(o)}return i}_quantizePoints(e,t,r){let n,i;const s=[];for(let o=0,l=e.length;o<l;o++){const l=e[o];if(o>0){const e=t(l[0]),o=r(l[1]);e===n&&o===i||(s.push([e-n,o-i]),n=e,i=o)}else n=t(l[0]),i=r(l[1]),s.push([n,i])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],o=this._quantizePoints(s,t,r);o&&i.push(o)}return i.length>0?((0,f.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,n,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,f.Bi)(e)?e.rings:e.paths;let o,l;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],l+=i[1]):(o=i[0],l=i[1]),i[0]=t(o),i[1]=r(l)}}if(n&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2]),r[3]=i(r[3])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let o,l;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(o+=n[0],l+=n[1]):(o=n[0],l=n[1]),n[0]=t(o),n[1]=r(l)}if(n&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2]),t[3]=i(t[3])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2])}}:null}};(0,i.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,i.Cg)([(0,u.MZ)({type:[s.A],json:{write:!0}})],b.prototype,"features",void 0),(0,i.Cg)([(0,c.w)("features")],b.prototype,"readFeatures",null),(0,i.Cg)([(0,u.MZ)({type:[m.A],json:{write:!0}})],b.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],b.prototype,"geometryType",void 0),(0,i.Cg)([(0,d.K)("geometryType")],b.prototype,"writeGeometryType",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,i.Cg)([(0,u.MZ)({types:y.yR,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,i.Cg)([(0,c.w)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,i.Cg)([(0,u.MZ)({type:h.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,d.K)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,i.Cg)([(0,u.MZ)({json:{write:!0}})],b.prototype,"transform",void 0),b=n=(0,i.Cg)([(0,p.$)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0},37539:(e,t,r)=>{r.d(t,{pO:()=>y,jd:()=>d,Tp:()=>h,w5:()=>p});var n=r(34727),i=r(83047),s=r(73941),o=r(79258);Math.PI;const l=o.$O.radius,a=o.$O.eccentricitySquared,u={a1:l*a,a2:l*a*l*a,a3:l*a*a/2,a4:l*a*l*a*2.5,a5:l*a+l*a*a/2,a6:1-a};o.$O.radius,o.$O.flattening,o.Sw.radius,o.Sw.flattening,o.sH.radius,o.sH.flattening,o.sH.radius;var c=r(21325);const p={2:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:g,11:b,2:y,4:A},5:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:g,11:b,2:y,4:A},7:{5:null,7:y,9:null,10:y,1:null,6:_,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:y,10:y,1:null,6:null,8:M,0:null,3:null,11:null,2:null,4:null},3:{5:m,7:null,9:null,10:m,1:function(e,t,r,n){const i=e[t]/E,s=Z-2*Math.atan(Math.exp(-e[t+1]/E)),o=E+e[t+2],l=Math.cos(s)*o;r[n]=Math.cos(i)*l,r[n+1]=Math.sin(i)*l,r[n+2]=Math.sin(s)*o},6:null,8:null,0:null,3:y,11:function(e,t,r,n){m(e,t,r,n),b(r,n,r,n)},2:m,4:function(e,t,r,n){m(e,t,r,n),A(r,n,r,n)}},4:{5:C,7:null,9:null,10:C,1:function(e,t,r,n){C(e,t,r,n),S(r,n,r,n)},6:null,8:null,0:null,3:function(e,t,r,n){C(e,t,r,n),g(r,n,r,n)},11:function(e,t,r,n){C(e,t,r,n),b(r,n,r,n)},2:C,4:y},1:{5:F,7:null,9:null,10:F,1:y,6:null,8:null,0:null,3:function(e,t,r,n){F(e,t,r,n),g(r,n,r,n)},11:function(e,t,r,n){F(e,t,r,n),b(r,n,r,n)},2:F,4:function(e,t,r,n){F(e,t,r,n),A(r,n,r,n)}},6:{5:null,7:I,9:null,10:I,1:null,6:y,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:x,10:x,1:null,6:null,8:y,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:y,3:null,11:null,2:null,4:null},10:{5:y,7:y,9:y,10:y,1:S,6:_,8:M,0:null,3:g,11:b,2:y,4:A},11:{5:v,7:null,9:null,10:v,1:function(e,t,r,n){v(e,t,r,n),S(r,n,r,n)},6:null,8:null,0:null,3:function(e,t,r,n){v(e,t,r,n),g(r,n,r,n)},11:y,2:v,4:function(e,t,r,n){v(e,t,r,n),A(r,n,r,n)}}};function d(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(R.source.spatialReference===e&&R.dest.spatialReference===t)return R;const r=f(e,R.source),n=f(t,R.dest);return 0===r&&0===n?(0,c.aI)(e,t)?R.projector=y:R.projector=null:R.projector=p[r][n],R}function f(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,i.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function y(e,t,r,n){e!==r&&(r[n++]=e[t++],r[n++]=e[t++],r[n]=e[t])}function m(e,t,r,n){r[n]=O*(e[t]/E),r[n+1]=O*(Z-2*Math.atan(Math.exp(-e[t+1]/E))),r[n+2]=e[t+2]}function g(e,t,r,i){!function(e,t,r,i,s){const o=.4999999*Math.PI,l=(0,n.qE)(P*e[t+1],-o,o),a=Math.sin(l);r[i++]=P*e[t]*s.radius,r[i++]=s.halfSemiMajorAxis*Math.log((1+a)/(1-a)),r[i]=e[t+2]}(e,t,r,i,o.$O)}function b(e,t,r,n){r[n]=e[t]*j,r[n+1]=e[t+1]*j,r[n+2]=e[t+2]}function v(e,t,r,n){r[n]=e[t]*L,r[n+1]=e[t+1]*L,r[n+2]=e[t+2]}function w(e,t,r,n,i){const s=i+e[t+2],o=P*e[t+1],l=P*e[t],a=Math.cos(o)*s;r[n]=Math.cos(l)*a,r[n+1]=Math.sin(l)*a,r[n+2]=Math.sin(o)*s}function M(e,t,r,n){w(e,t,r,n,o.Sw.radius)}function _(e,t,r,n){w(e,t,r,n,o.sH.radius)}function S(e,t,r,n){w(e,t,r,n,o.$O.radius)}function T(e,t,r,i,s){const o=e[t],l=e[t+1],a=e[t+2],u=Math.sqrt(o*o+l*l+a*a),c=(0,n.YN)(a/(0===u?1:u)),p=Math.atan2(l,o);r[i++]=O*p,r[i++]=O*c,r[i]=u-s}function x(e,t,r,n){T(e,t,r,n,o.Sw.radius)}function I(e,t,r,n){T(e,t,r,n,o.sH.radius)}function F(e,t,r,n){T(e,t,r,n,o.$O.radius)}function A(e,t,r,n){!function(e,t,r,n,i){const s=P*e[t],o=P*e[t+1],l=e[t+2],a=Math.sin(o),u=Math.cos(o),c=i.radius/Math.sqrt(1-i.eccentricitySquared*a*a);r[n++]=(c+l)*u*Math.cos(s),r[n++]=(c+l)*u*Math.sin(s),r[n++]=(c*(1-i.eccentricitySquared)+l)*a}(e,t,r,n,o.$O)}function C(e,t,r,n){const i=u,s=e[t],l=e[t+1],a=e[t+2];let c,p,d,h,f,y,m,g,b,v,w,M,_,S,T,x,I,F,A,C,R;c=Math.abs(a),p=s*s+l*l,d=Math.sqrt(p),h=p+a*a,f=Math.sqrt(h),C=Math.atan2(l,s),y=a*a/h,m=p/h,S=i.a2/f,T=i.a3-i.a4/f,m>.3?(g=c/f*(1+m*(i.a1+S+y*T)/f),A=Math.asin(g),v=g*g,b=Math.sqrt(1-v)):(b=d/f*(1-y*(i.a5-S-m*T)/f),A=Math.acos(b),v=1-b*b,g=Math.sqrt(v)),w=1-o.$O.eccentricitySquared*v,M=o.$O.radius/Math.sqrt(w),_=i.a6*M,S=d-M*b,T=c-_*g,I=b*S+g*T,x=b*T-g*S,F=x/(_/w+I),A+=F,R=I+x*F/2,a<0&&(A=-A),r[n++]=O*C,r[n++]=O*A,r[n]=R}const R={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:y},P=(0,n.kU)(1),O=(0,n.KJ)(1),Z=.5*Math.PI,E=o.$O.radius,j=E*Math.PI/180,L=180/(E*Math.PI)},38961:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(31635),i=r(7762),s=r(36708),o=r(10107),l=r(64108),a=r(80559);let u=class extends i.A{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,a.fm)(()=>this._refresh(),s.OH))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections?.();if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t)}_createNewInstance(e){return new i.A(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const n of t)if(n){if(r(n)){const t=this.indexOf(n,e);t>=0?t!==e&&this.reorder(n,e):this.add(n,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(n);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,n.Cg)([(0,o.MZ)()],u.prototype,"getCollections",void 0),(0,n.Cg)([(0,o.MZ)()],u.prototype,"getChildrenFunction",void 0),(0,n.Cg)([(0,o.MZ)()],u.prototype,"itemFilterFunction",void 0),u=(0,n.Cg)([(0,l.$)("esri.core.CollectionFlattener")],u)},39357:(e,t,r)=>{r.d(t,{H:()=>a});var n,i=r(31635),s=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(64108));let a=n=class extends s.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new n({name:this.name,code:this.code})}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],a.prototype,"code",void 0),a=n=(0,i.Cg)([(0,l.$)("esri.layers.support.CodedValue")],a)},46140:(e,t,r)=>{r.d(t,{R:()=>i});var n=r(49186);let i=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,s]=t.split("."),o=/^\s*\d+\s*$/;if(!i?.match||!o.test(i))throw new n.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!o.test(s))throw new n.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(i,10),a=parseInt(s,10);return new e(l,a,r)}}},50498:(e,t,r)=>{r.d(t,{Ye:()=>p,gy:()=>c,yR:()=>d});var n=r(66552),i=r(5443),s=r(91075),o=r(48526),l=r(86738),a=r(39829),u=r(82799);const c=(0,n.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),p=(0,n.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),d={base:s.A,key:"type",typeMap:{extent:i.A,multipoint:o.A,point:l.A,polyline:u.A,polygon:a.A}}},52106:(e,t,r)=>{r.d(t,{A:()=>_});var n,i=r(31635),s=r(37838),o=r(69540),l=r(51447),a=r(25482),u=r(53966),c=r(36708),p=r(24326),d=r(10107),h=(r(44208),r(87811),r(64108)),f=r(12195),y=r(65864),m=r(50498),g=r(55156),b=r(60950),v=r(54339),w=r(33910);function M(e){if(null==e)return null;const t={};for(const r in e){const n=e[r];n&&(t[r]=n.toJSON())}return 0!==Object.keys(t).length?t:null}let _=class extends((0,o.OU)(a.o)){static{n=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,p.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new n({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,b.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,g.I)(this.origin);if(e)return(0,v.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,v.r)(this,t):null}getGlobalId(){const e=(0,g.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:M(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,f.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,n){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=n),"attributes"===e&&(i.attributeName=n),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,i.Cg)([(0,d.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const n=(0,y.rS)(e[r]);n&&(t[r]=n)}return 0!==Object.keys(t).length?t:null}}})],_.prototype,"aggregateGeometries",null),(0,i.Cg)([(0,d.MZ)({value:null})],_.prototype,"attributes",null),(0,i.Cg)([(0,d.MZ)({value:null,types:m.yR,json:{read:y.rS}})],_.prototype,"geometry",null),(0,i.Cg)([(0,d.MZ)({type:Boolean})],_.prototype,"isAggregate",void 0),(0,i.Cg)([(0,d.MZ)({clonable:!1})],_.prototype,"layer",void 0),(0,i.Cg)([(0,d.MZ)({clonable:"reference"})],_.prototype,"origin",void 0),(0,i.Cg)([(0,d.MZ)({type:s.A,value:null})],_.prototype,"popupTemplate",null),(0,i.Cg)([(0,d.MZ)({clonable:"reference"})],_.prototype,"sourceLayer",void 0),(0,i.Cg)([(0,d.MZ)({value:null,types:w.Es})],_.prototype,"symbol",null),(0,i.Cg)([(0,d.MZ)({clonable:!1,json:{read:!1,write:!1}})],_.prototype,"_version",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,value:!0})],_.prototype,"visible",null),_=n=(0,i.Cg)([(0,h.$)("esri.Graphic")],_)},53177:(e,t,r)=>{r.d(t,{A:()=>p});var n,i=r(31635),s=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(64108),u=r(39357),c=r(76357);let p=class extends c.A{static{n=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some(e=>(String(e.code)===r&&(t=e.name),!!t))}return t}clone(){return new n({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,i.Cg)([(0,o.MZ)({type:[u.H],json:{write:{isRequired:!0}}})],p.prototype,"codedValues",void 0),(0,i.Cg)([(0,l.e)({codedValue:"coded-value"})],p.prototype,"type",void 0),p=n=(0,i.Cg)([(0,a.$)("esri.layers.support.CodedValueDomain")],p)},54339:(e,t,r)=>{function n(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const r=[];for(const n of t.fieldNames)r.push(e.attributes[n]??null);return JSON.stringify(r)}}}function i(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>n,r:()=>i})},55156:(e,t,r)=>{r.d(t,{I:()=>i,e:()=>n});const n=Symbol("idFieldsProviderSymbol");function i(e){return(t=e)&&n in t?e[n]:void 0;var t}},55674:(e,t,r)=>{r.d(t,{Ad:()=>h,Gj:()=>m,QY:()=>d,lL:()=>g,xR:()=>f});var n=r(66131),i=r(49186),s=(r(44208),r(44729)),o=r(15032),l=r(65864),a=r(95466),u=r(43668),c=r(98623);const p=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const r of p)t.hasArcadeDependency(r)&&e.add(r);return e}function h(e,t){return y.create(e,t,null,["$feature","$view"])}function f(e,t,r){return y.create(e,t,r,["$feature","$view","$config"])}class y{static async create(e,t,r,n){const{arcade:s,Dictionary:o}=await(0,u.l)();let l;try{l=s.parseScript(e)}catch(t){throw new i.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const a=s.scriptUsesGeometryEngine(l);a&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,l,null,!1,a);const c={vars:n.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},p=s.compileScript(l,c);let d=null;null!=r&&(d=new o(r),d.immutable=!0);const h=new o;return h.immutable=!1,h.setField("scale",0),new y(e,s,l,p,t,h,d,o)}constructor(e,t,r,n,i,s,o,l){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=n,this._spatialReference=i,this._viewDict=s,this._configDict=o,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:i,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=i?null!=r?n.lY.epochToArcadeDate(i,r):n.lY.unknownEpochToArcadeDate(i):void 0,currentEnd:null!=s?null!=r?n.lY.epochToArcadeDate(s,r):n.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const n=t??new a.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=n.fields,this._boundSchema.fieldsIndex=n,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return n.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?n.lY.unknownEpochToArcadeDate(t):n.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},62815:(e,t,r)=>{r.d(t,{N:()=>o});var n=r(83047),i=r(73941),s=r(21325);function o(e,t,r){if(null==t||null==r||r.vcsWkid||(0,s.aI)(t,r)||(0,i.xP)(t)||(0,i.xP)(r))return null;const o=(0,n.G9)(t)/(0,n.G9)(r);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,o);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},65494:(e,t,r)=>{r.d(t,{L:()=>a,r:()=>o});var n=r(67076),i=r(90360),s=r(41214);function o(e,t){return a(e,null,t)}const l=(0,i.C)({types:s.Hg});function a(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new n.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):l(e,t,r):null}},70328:(e,t,r)=>{r.d(t,{BI:()=>v,DC:()=>p,Ej:()=>h,Ie:()=>g,Jt:()=>b,Ne:()=>f,RF:()=>c,aI:()=>M,fA:()=>o,gE:()=>a,hZ:()=>m,iT:()=>d,is:()=>w,qv:()=>_,vI:()=>y,vY:()=>l,v_:()=>S,vt:()=>s,w1:()=>u});var n=r(5443),i=(r(19419),r(4197));function s(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,r,n,i,o,l=s()){return l[0]=e,l[1]=t,l[2]=r,l[3]=n,l[4]=i,l[5]=o,l}function l(e,t=s()){return function(e,t,r,n=s()){return m(n,_),function(e,t,r=0,n=t.length/3){let i=e[0],s=e[1],o=e[2],l=e[3],a=e[4],u=e[5];for(let e=0;e<n;e++)i=Math.min(i,t[r+3*e]),s=Math.min(s,t[r+3*e+1]),o=Math.min(o,t[r+3*e+2]),l=Math.max(l,t[r+3*e]),a=Math.max(a,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=i,e[1]=s,e[2]=o,e[3]=l,e[4]=a,e[5]=u}(n,e,t,r),n}(e,0,e.length/3,t)}function a(e,t=(0,i.jh)(24)){const[r,n,s,o,l,a]=e;return t[0]=r,t[1]=n,t[2]=s,t[3]=r,t[4]=n,t[5]=a,t[6]=r,t[7]=l,t[8]=s,t[9]=r,t[10]=l,t[11]=a,t[12]=o,t[13]=n,t[14]=s,t[15]=o,t[16]=n,t[17]=a,t[18]=o,t[19]=l,t[20]=s,t[21]=o,t[22]=l,t[23]=a,t}function u(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new n.A(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function p(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function d(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function h(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function f(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function y(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function g(e){return e?m(e,_):s(_)}function b(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function v(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=i,e[5]=Number.POSITIVE_INFINITY,e}function w(e){return 6===e.length}function M(e,t,r){if(null==e||null==t)return e===t;if(!w(e)||!w(t))return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const _=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];s()},73681:(e,t,r)=>{r.d(t,{n:()=>a});var n=r(49186),i=r(53966),s=r(46140),o=r(95466),l=r(55674);class a{static async from(e,t,r){const o=e.dictionary_version?s.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),p={};if(t)for(const e in t)p[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)p.hasOwnProperty(t.name)||(p[t.name]=t.value);const d=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))d.delete(e);d.size&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const h=await(0,l.xR)(e.expression,null,p);if(!h)throw new n.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const f=!o||!o.greaterEqual(4,0);f&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const y=new u(r,f);return new a(f,c,h,y)}constructor(e,t,r,n){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=n}get itemNames(){return this._itemNames}evaluate(e,t,r,n){try{return this._reader.bind(e,r,n),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},76357:(e,t,r)=>{r.d(t,{A:()=>c});var n=r(31635),i=r(66552),s=r(25482),o=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),a=r(64108);const u=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends s.o{constructor(e){super(e),this.name=null,this.type=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,n.Cg)([(0,l.e)(u),(0,o.MZ)({json:{write:{isRequired:!0}}})],c.prototype,"type",void 0),c=(0,n.Cg)([(0,a.$)("esri.layers.support.Domain")],c)},80451:(e,t,r)=>{r.d(t,{rS:()=>f,gK:()=>h}),r(44208);var n,i=r(53177),s=r(76357),o=r(31635),l=(r(53966),r(87811),r(49186),r(93223)),a=r(64108);let u=class extends s.A{static{n=this}constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,o.Cg)([(0,l.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=n=(0,o.Cg)([(0,a.$)("esri.layers.support.InheritedDomain")],u);var c,p=r(10107);let d=class extends s.A{static{c=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new c({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,o.Cg)([(0,p.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],d.prototype,"maxValue",void 0),(0,o.Cg)([(0,p.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],d.prototype,"minValue",void 0),(0,o.Cg)([(0,l.e)({range:"range"})],d.prototype,"type",void 0),d=c=(0,o.Cg)([(0,a.$)("esri.layers.support.RangeDomain")],d);const h={key:"type",base:s.A,typeMap:{range:d,"coded-value":i.A,inherited:u}};function f(e){if(!e?.type)return null;switch(e.type){case"range":return d.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},89808:(e,t,r)=>{r.d(t,{Q:()=>n});const n=Symbol("getSliceableSymbol")},91218:(e,t,r)=>{r.r(t),r.d(t,{canProjectWithoutEngine:()=>z,initializeProjection:()=>U,isEqualBaseGCS:()=>J,isLoaded:()=>R,isLoadedOrLoad:()=>P,isLoadedOrLoadFor:()=>O,load:()=>E,project:()=>j,projectExtent:()=>re,projectMany:()=>L,projectMultipoint:()=>K,projectOrLoad:()=>G,projectOrLoadMany:()=>N,projectPoint:()=>H,projectPolygon:()=>ee,projectPolyline:()=>Q,projectWithZConversion:()=>V,projectWithoutEngine:()=>B,requiresLoad:()=>Z,test:()=>D,tryProjectWithZConversion:()=>$,unload:()=>q});var n=r(49186),i=r(74887),s=r(62788),o=r(95488),l=r(51850),a=r(21276),u=r(73941),c=r(5443),p=r(91075),d=r(48526),h=r(86738),f=r(39829),y=r(82799),m=r(16930),g=r(159),b=r(9762),v=r(37539);function w(e,t,r,n,i,s){return M[0]=e,M[1]=t,M[2]=r,(0,b.projectBuffer)(M,n,0,i,s,0)}const M=(0,l.vt)();var _=r(21325),S=r(62815);let T=null,x=null,I=null,F=null,A={};const C=new o.I;function R(){return!!(x?.isLoaded()&&I?.isLoaded()&&F?.isLoaded())}function P(){return!!R()||((0,s.gc)(C),E(),!1)}function O(e,t){return!e||!t||z(e,t)||P()}function Z(e,t){return!z(e,t)&&!R()}async function E(e){null==T&&(T=Promise.all([r.e(3276).then(r.bind(r,83276)).then(e=>(x=e,x.load())),r.e(8377).then(r.bind(r,8377)).then(e=>(I=e,I.load())),r.e(2158).then(r.bind(r,12158)).then(e=>(F=e,F.load()))])),await T,(0,i.Te)(e),C.notify()}function j(e,t,r){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),L(e,e[0].spatialReference,t,r)):((0,a.f)(e),L([e],e.spatialReference,t,r)[0])}function L(e,t,r,n){if(null==t||null==r)return e;if(z(t,r,n))return e.map(e=>B(e,t,r));if(null==n?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>B(e,t,m.A.WGS84)).map(e=>$(e,r));if(null==n?.geographicTransformation&&(0,u.jA)(r))return e.map(e=>$(e,m.A.WGS84)).map(e=>B(e,m.A.WGS84,r));if(!R())throw new k;if(!n?.geographicTransformation)if(n?.extendedParams)n={...n,geographicTransformation:F.getTransformation(t,r,n.areaOfInterestExtent)||new g.A};else if(!n?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,r);let i=A[e];i||(i=F.getTransformation(t,r)||new g.A,A[e]=i),n={geographicTransformation:i}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?x.executeMany(e,r,n):I.executeMany(e,r,n)}function G(e,t){const r=N([e],t);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function N(e,t){if(!R())for(const r of e)if(null!=r&&!(0,_.aI)(r.spatialReference,t)&&(0,_.fn)(r.spatialReference)&&(0,_.fn)(t)&&!z(r.spatialReference,t))return(0,s.gc)(C),{pending:E(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,_.aI)(e.spatialReference,t)?e:(0,_.fn)(e.spatialReference)&&(0,_.fn)(t)?$(e,t):null)}}class k extends n.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function q(){T=null,x=null,I=null,F=null,A={}}const D={get loadPromise(){return T}};function $(e,t){try{const r=j(e,t);if(null==r)return null;"xmin"in e&&"xmin"in r&&(r.zmin=e.zmin,r.zmax=e.zmax);const n=(0,S.N)(r.type,e.spatialReference,t);return null!=n&&n(r),r}catch(e){if(!(e instanceof k))throw e;return null}}async function V(e,t,r){const n=e.spatialReference;return null!=n&&null!=t&&await U(n,t,null,r),$(e,t)}function z(e,t,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!(0,_.aI)(e,t)||(0,_.fn)(e)&&(0,_.fn)(t)&&!!(0,v.jd)(e,t))}function J(e,t){if((0,_.aI)(e,t))return!0;if(!(0,_.fn)(e)||!(0,_.fn)(t))return!1;const r=(0,_.oT)(e)||(0,_.K8)(e)||(0,_.x1)(e),n=(0,_.oT)(t)||(0,_.K8)(t)||(0,_.x1)(t);return r&&n}async function U(e,t,r,n){if(R())return(0,i.NO)(n);if(Array.isArray(e)){for(const{source:t,dest:r,options:i}of e)if(t&&r&&!z(t,r,i))return E(n)}else if(e&&t&&!z(e,t,r))return E(n);return(0,i.NO)(n)}function B(e,t,r){return e?"x"in e?Y(e,t,new h.A,r,0):"xmin"in e?ne(e,t,new c.A,r,0):"rings"in e?te(e,t,new f.A,r,0):"paths"in e?X(e,t,new y.A,r,0):"points"in e?W(e,t,new d.A,r,0):null:null}function H(e,t,r=t.spatialReference,n=0){return null!=r&&null!=e.spatialReference&&null!=Y(e,e.spatialReference,t,r,n)}function Y(e,t,r,n,i){se[0]=e.x,se[1]=e.y;const s=e.z;return se[2]=void 0!==s?s:i,(0,b.projectBuffer)(se,t,0,se,n,0)?(r.x=se[0],r.y=se[1],r.spatialReference=n,void 0!==s||(0,u.xP)(n)?(r.z=se[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===e.m?(r.m=void 0,r.hasM=!1):(r.m=e.m,r.hasM=!0),r):null}function K(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=W(e,e.spatialReference,t,r,n)}function W(e,t,r,n,i){const{points:s,hasZ:o,hasM:l}=e,a=[],c=s.length,p=[];for(const e of s)p.push(e[0],e[1],o?e[2]:i);if(!(0,b.projectBuffer)(p,t,0,p,n,0,c))return null;const d=o||(0,u.xP)(n);for(let e=0;e<c;++e){const t=3*e,r=p[t],n=p[t+1];d&&l?a.push([r,n,p[t+2],s[e][3]]):d?a.push([r,n,p[t+2]]):l?a.push([r,n,s[e][2]]):a.push([r,n])}return r.points=a,r.spatialReference=n,r.hasZ=o,r.hasM=l,r}function Q(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=X(e,e.spatialReference,t,r,n)}function X(e,t,r,n,i){const{paths:s,hasZ:o,hasM:l}=e,a=[];if(!ie(s,o??!1,l??!1,t,a,n,i))return null;const c=o||(0,u.xP)(n);return r.paths=a,r.spatialReference=n,r.hasZ=c,r.hasM=l,r}function ee(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=te(e,e.spatialReference,t,r,n)}function te(e,t,r,n,i){const{rings:s,hasZ:o,hasM:l}=e,a=[];if(!ie(s,o??!1,l??!1,t,a,n,i))return null;const c=o||(0,u.xP)(n);return r.rings=a,r.spatialReference=n,r.hasZ=c,r.hasM=l,r}function re(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=ne(e,e.spatialReference,t,r,n)}function ne(e,t,r,n,i){const{xmin:s,ymin:o,xmax:l,ymax:a,hasZ:c,hasM:p}=e;if(!w(s,o,c?e.zmin:i,t,se,n))return null;const d=c||(0,u.xP)(n);return r.xmin=se[0],r.ymin=se[1],d&&(r.zmin=se[2]),w(l,a,c?e.zmax:i,t,se,n)?(r.xmax=se[0],r.ymax=se[1],d&&(r.zmax=se[2]),p&&(r.mmin=e.mmin,r.mmax=e.mmax),r.spatialReference=n,r):null}function ie(e,t,r,n,i,s,o=0){const l=new Array;for(const r of e)for(const e of r)l.push(e[0],e[1],t?e[2]:o);if(!(0,b.projectBuffer)(l,n,0,l,s,0))return!1;let a=0;i.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const n of t)c&&r?e.push([l[a++],l[a++],l[a++],n[3]]):c?e.push([l[a++],l[a++],l[a++]]):r?(e.push([l[a++],l[a++],n[2]]),a++):(e.push([l[a++],l[a++]]),a++);i.push(e)}return!0}const se=(0,l.vt)()},95466:(e,t,r)=>{r.d(t,{A:()=>h});var n=r(49186),i=r(53966),s=r(91869),o=r(3330),l=r(12195),a=r(30524),u=r(98623),c=r(56400),p=r(28097);const d=new Map;class h{static fromJSON(e){return new h(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new h(e.fields??[],g(e))}static fromLayerJSON(e){return new h(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,n=y(t);if(t&&n){const i=f(t);this._fieldsMap.set(t,e),this._fieldsMap.set(i,e),this._normalizedFieldsMap.set(n,e),r.push(`${i}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(f(e))??this._normalizedFieldsMap.get(y(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(i.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new n.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):m.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?p.mQ.utcInstance:(0,s.tE)(d,t,()=>p.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,l.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function f(e){return e.trim().toLowerCase()}function y(e){return(0,a.rS)(e)?.toLowerCase()??""}const m=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:i}=e,s=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,a=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.dateFieldsTimeReference?(0,c.ZS)(i.dateFieldsTimeReference):l??u.n$:null,p=n?function(e){return"timeZone"in e}(n)?n.timeZone??l:n.timeReference?(0,c.ZS)(n.timeReference):l:null,d=new Map([[f(i?.creationDateField??""),a],[f(i?.editDateField??""),a],[f(s),p],[f(o),p]]);for(const{name:n,type:i}of e.fields)if(m.has(i))t.set(n,u.L5);else if("date"!==i&&"esriFieldTypeDate"!==i)t.set(n,null);else if(r)t.set(n,u.L5);else{const e=d.get(f(n??""))??l;t.set(n,e)}return t}},96576:(e,t,r)=>{r.d(t,{A:()=>d});var n,i=r(31635),s=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(64108),u=r(92438),c=r(63988),p=r(49849);let d=n=class extends((0,c.h)(u.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new n({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)(p.Wp)],d.prototype,"symbol",void 0),(0,i.Cg)([(0,l.e)({simple:"simple"})],d.prototype,"type",void 0),d=n=(0,i.Cg)([(0,a.$)("esri.renderers.SimpleRenderer")],d)},98453:(e,t,r)=>{r.d(t,{m:()=>n});const n=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},99157:(e,t,r)=>{r.d(t,{A:()=>a});var n,i=r(31635),s=r(69622),o=r(10107),l=(r(44208),r(53966),r(87811),r(64108));let a=n=class extends s.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new n({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"isInverse",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"wkt",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"wkid",void 0),a=n=(0,i.Cg)([(0,l.$)("esri.geometry.operators.support.GeographicTransformationStep")],a)},99959:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(31635),i=(r(53966),r(44208),r(87811),r(49186),r(64108));let s=class{};s=(0,n.Cg)([(0,i.$)("esri.graphic.GraphicOrigin")],s)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8368],{1262:(e,t,n)=>{n.d(t,{L:()=>o});var r=n(799);const a={InvalidValueForAggregateFunction:"Invalid value used in aggregate function",MissingStatisticParameters:"Statistic does not have 1 or 0 Parameters",InvalidFunctionParameters:"Invalid parameters for call to {function}",UnsupportedIsLhs:"Unsupported left hand expression in is statement",UnsupportedIsRhs:"Unsupported right hand expression in is statement",UnsupportedOperator:"Unsupported operator - {operator}",UnsupportedSyntax:"Unsupported syntax - {node}",UnsupportedSqlFunction:"Sql function not found = {function}",InvalidDataType:"Invalid sql data type",InvalidDate:"Invalid date encountered",InvalidOperator:"Invalid operator encountered",InvalidTime:"Invalid time encountered",IllegalInterval:"Illegal interval",FunctionNotRecognized:"Function not recognized",InvalidTimeStamp:"Invalid timestamp encountered",InvalidParameterCount:"Invalid parameter count for call to {name}",PrimarySecondaryQualifiers:"Primary and Secondary SqlInterval qualifiers not supported",YearMonthIntervals:"Year-Month Intervals not supported",CannotCastValue:"Cannot cast value to the required data type"};class o extends Error{constructor(e,t){super((0,r.HC)(a[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,o)}}},3330:(e,t,n)=>{n.d(t,{GB:()=>a,Qo:()=>i,Y4:()=>o});var r=n(28097);class a{static{this.instance=new r.oh("Etc/UTC")}}function o(e){return e instanceof r.bo?e===a.instance:"unknown"===e?.toString().toLowerCase()}function i(e){return o(e)?a.instance:e}},55612:(e,t,n)=>{n.d(t,{g:()=>i});var r=n(28097);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const o="esri.core.sql.SqlTimeStampOffset";class i{constructor(e){this._timeStampOffset=e,this.declaredRootClass=o,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===o}toDateTime(){return this._date??=r.c9.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return a(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return a(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return i.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new i(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new i(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,o=0,s=0,u=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let d="";o<10&&(d="0");let p=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+o.toString()}`;0!==s&&(p+="."+s.toString().padStart(3,"0"));const m=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new i(f+"T"+p+m)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return i.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>u});var r=n(44729),a=n(1262),o=n(55612),i=n(15032),s=n(28097);function u(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L("FunctionNotRecognized");if(t.length<n.minParams||t.length>n.maxParams)throw new a.L("InvalidParameterCount",{name:e.toUpperCase()});return n.evaluate(t)}function l(e,t){const n=c[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}const c={min:{minParams:1,maxParams:1,evaluate:e=>p(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>p(e[0],"max")},avg:{minParams:1,maxParams:1,evaluate:e=>f(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(null!==r){if(!d(r))throw new a.L("InvalidValueForAggregateFunction");t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=m(e);return null===t?null:Math.sqrt(t)}(e[0])},count:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].length},var:{minParams:1,maxParams:1,evaluate:e=>m(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const o=e[r];if(null!==o){if(!d(o))throw new a.L("InvalidValueForAggregateFunction");n++,t+=o}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function p(e,t){if(null===e)return null;let n=null,a=null;for(const u of e){let e=u;e=r.n.isDateOnly(u)||i.k.isTimeOnly(u)?u.toNumber():s.c9.isDateTime(u)?u.toMillis():o.g.isTimestampOffset(u)?u.toMilliseconds():u,(null===n||"max"===t&&null!==a&&null!==e&&a<=e||"min"===t&&null!==a&&null!==e&&a>=e)&&(n=u,a=e)}return n}function m(e){if(null===e)return null;if(0===(e=e.filter(e=>null!==e)).length)return null;const t=f(e);if(null===t)return null;let n=0;for(const r of e){if(!d(r))throw new a.L("InvalidValueForAggregateFunction");n+=(t-r)**2}return n/(e.length-1)}},88368:(e,t,n)=>{n.d(t,{A:()=>ce});var r=n(44208),a=n(74639),o=n(44729),i=n(1262);function s(e){if(null!==e.precision||null!==e.secondary)throw new i.L("PrimarySecondaryQualifiers")}function u(e,t){if(t.includes(".")){const n=t.split(".");e.second=parseFloat(n[0]),e.millis=parseInt(n[1],10)}else e.second=parseFloat(t)}const l="esri.core.sql.SqlInterval";class c{constructor(){this.declaredRootClass=l,this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static isInterval(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===l}static createFromMilliseconds(e){const t=new c;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,n){let r=null;const a=new c;if(a.op="-"===n?"-":"+","interval-period"===t.type){s(t);const n=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new i.L("YearMonthIntervals");if("second"===t.period){if(!/^[0-9]{1,}(\.[0-9]{1,}){0,1}$/.test(e))throw new i.L("IllegalInterval");u(a,e)}else{if(!n.test(e))throw new i.L("IllegalInterval");a[t.period]=parseFloat(e)}}else{if(s(t.start),s(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new i.L("YearMonthIntervals");switch(t.start.period){case"day":switch(t.end.period){case"hour":if(r=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!r.test(e))throw new i.L("IllegalInterval");a[t.start.period]=parseFloat(e.split(" ")[0]),a[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!r.test(e))throw new i.L("IllegalInterval");{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1])}break;case"second":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}(\\.[0-9]{1,}){0,1}$"),!r.test(e))throw new i.L("IllegalInterval");{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1]),u(a,n[2])}break;default:throw new i.L("IllegalInterval")}break;case"hour":switch(t.end.period){case"minute":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!r.test(e))throw new i.L("IllegalInterval");a.hour=parseFloat(e.split(":")[0]),a.minute=parseFloat(e.split(":")[1]);break;case"second":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}(\\.[0-9]{1,}){0,1}$"),!r.test(e))throw new i.L("IllegalInterval");{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),u(a,t[2])}break;default:throw new i.L("IllegalInterval")}break;case"minute":if("second"!==t.end.period)throw new i.L("IllegalInterval");if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}(\\.[0-9]{1,}){0,1}$"),!r.test(e))throw new i.L("IllegalInterval");{const t=e.split(":");a.minute=parseFloat(t[0]),u(a,t[1])}break;default:throw new i.L("IllegalInterval")}}return a}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}var f=n(55612),d=n(15032),p=n(3330),m=n(28097);const h=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,w=/^(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)? {0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,L=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})? {0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function N(e,t){if(t instanceof m.bo)return t===p.GB.instance?m.c9.fromMillis(e.getTime(),{zone:p.GB.instance}):m.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return m.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?m.c9.fromMillis(e.getTime(),{zone:p.GB.instance}):m.c9.fromJSDate(e,{zone:t})}}function O(e){return c.isInterval(e)}function E(e){return m.c9.isDateTime(e)}function S(e){return o.n.isDateOnly(e)}function x(e){return d.k.isTimeOnly(e)}function C(e){return f.g.isTimestampOffset(e)}function D(e){let t=h.exec(e);if(null!==t){const[,e,n,r]=t,a=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),0);if(null!==a)return a;throw new i.L("InvalidTime")}if(t=w.exec(e),null!==t){const[,e,n]=t,r=d.k.fromParts(parseInt(e,10),parseInt(n,10),0,0);if(null!==r)return r;throw new i.L("InvalidTime")}if(t=v.exec(e),null!==t){const[,e,n,r,a]=t,o=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==o)return o;throw new i.L("InvalidTime")}throw new i.L("InvalidTime")}function _(e,t,n=!1){let r=g.exec(e);if(null!==r){const[,e,n,a,o,s,u,l]=r,c=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(o,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,p.Qo)(t)});if(!1===c.isValid)throw new i.L("InvalidTimeStamp");return c}if(r=y.exec(e),null!==r){const[,e,t,n,a,o,s,u,l,c,d]=r,p=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),u?parseInt(u.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===p.isValid)throw new i.L("InvalidTimeStamp");return p}if(r=L.exec(e),null!==r){const[,e,t,n,a,o,s,u,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(o,10),0,0,"-"===s,parseInt(u,10),parseInt(l,10));if(!1===c.isValid)throw new i.L("InvalidTimeStamp");return c}if(r=T.exec(e),null!==r){const[,e,n,a,o,s]=r,u=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(o,10),minute:parseInt(s,10),second:0},{zone:(0,p.Qo)(t)});if(!1===u.isValid)throw new i.L("InvalidTimeStamp");return u}if(r=I.exec(e),null!==r){const[,e,n,a]=r,o=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,p.Qo)(t)});if(!1===o.isValid)throw new i.L("InvalidTimeStamp");return o}throw new i.L("InvalidTimeStamp")}function M(e,t){const n=I.exec(e);if(null===n)try{return _(e,t)}catch{throw new i.L("InvalidDate")}const[,r,a,s]=n,u=o.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(s,10));if(null===u)throw new i.L("InvalidDate");return u}var b=n(34727),P=n(799),A=n(54218);function F(e){return!!E(e)||!!C(e)}function $(e){return!!(E(e)||S(e)||C(e)||x(e))}function R(e){if(E(e))return e.toMillis();if(S(e))return e.toNumber();if(C(e))return e.toMilliseconds();throw new i.L("InvalidDataType")}function k(e,t,n){if(null==e||null==t)return null;if((0,A.Et)(e)){if((0,A.Et)(t))return U(e,t,n);if((0,A.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return U(e,r,n);const a=e.toString();switch(n){case"<>":return a!==t;case"=":return a===t;case">":return a>t;case"<":return a<t;case">=":return a>=t;case"<=":return a<=t}}(e,t,n);if($(t))throw new i.L("InvalidOperator");if(S(t))throw new i.L("InvalidOperator")}else if((0,A.Kg)(e)){if((0,A.Et)(t))return function(e,t,n){const r=parseFloat(e);if(!isNaN(r))return U(r,t,n);const a=t.toString();switch(n){case"<>":return e!==a;case"=":return e===a;case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a}}(e,t,n);if((0,A.Kg)(t))return function(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}(e,t,n);if(E(t))throw new i.L("InvalidOperator");if(S(t))throw new i.L("InvalidOperator");if(x(t))throw new i.L("InvalidOperator");if(C(t))throw new i.L("InvalidOperator")}else if(E(e)){if(F(t)){if((0,p.Y4)(e.zone)){if(m.c9.isDateTime(t)&&!(0,p.Y4)(t.zone))return V(e,t,n);if(f.g.isTimestampOffset(t))return V(e,t,n)}else if(m.c9.isDateTime(t)&&(0,p.Y4)(t.zone)){if(!(0,p.Y4)(e.zone))return V(e,t,n);if(f.g.isTimestampOffset(e))return V(e,t,n)}return U(R(e),R(t),n)}if((0,A.Kg)(t))throw new i.L("InvalidOperator");if(S(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return U((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(x(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator")}else if(S(e)){if(C(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),U(r.toMillis(),t.toMilliseconds(),n)}(e,t,n);if(E(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),U(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,A.Kg)(t))throw new i.L("InvalidOperator");if(S(t))return U(e.toNumber(),t.toNumber(),n);if(x(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator")}else if(x(e)){if(x(t))return U(e.toNumber(),t.toNumber(),n);if((0,A.Kg)(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator");if(S(t))throw new i.L("InvalidOperator");if(F(t))throw new i.L("InvalidOperator")}else if(C(e)){if(F(t))return m.c9.isDateTime(t)&&(0,p.Y4)(t.zone)?V(e,t,n):U(R(e),R(t),n);if((0,A.Kg)(t))throw new i.L("InvalidOperator");if(S(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return U((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(x(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator")}switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function U(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function V(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=z(e),a=z(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function z(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function H(e,t,n){const r=Z[e.toLowerCase()];if(null==r)throw new i.L("FunctionNotRecognized");if(t.length<r.minParams||t.length>r.maxParams)throw new i.L("InvalidParameterCount",{name:e.toUpperCase()});return r.evaluate(t,n)}function q(e){return!((0,A.$P)(e)||S(e)||E(e)||x(e)||C(e))}function K(e){return S(e)||x(e)?e.toString():C(e)?e.toSQLValue():E(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,A.$P)(e)?K(m.c9.fromJSDate(e)):e.toString()}const Z={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,A.$P)(t))switch(e.toUpperCase()){case"SECOND":return t.getSeconds();case"MINUTE":return t.getMinutes();case"HOUR":return t.getHours();case"DAY":return t.getDate();case"MONTH":return t.getMonth()+1;case"YEAR":return t.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0;case"DOW":return m.c9.fromJSDate(t,{zone:"system"}).weekday;case"DOY":return m.c9.fromJSDate(t,{zone:"system"}).ordinal;case"WEEK":return m.c9.fromJSDate(t,{zone:"system"}).weekNumber}else if(E(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new i.L("InvalidFunctionParameters",{function:"EXTRACT"});case"DOW":return t.weekday;case"DOY":return t.ordinal;case"WEEK":return t.weekNumber}else if(S(t))switch(e.toUpperCase()){case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new i.L("InvalidFunctionParameters",{function:"EXTRACT"});case"DOW":return t.toDateTime("unknown").weekday;case"DOY":return t.toDateTime("unknown").ordinal;case"WEEK":return t.toDateTime("unknown").weekNumber}else if(x(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(C(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes;case"DOW":return t.toDateTime().weekday;case"DOY":return t.toDateTime().ordinal;case"WEEK":return t.toDateTime().weekNumber}throw new i.L("InvalidFunctionParameters",{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,n]=e;return null==t||null==n?null:t.toString().substring(n-1)}if(3===e.length){const[t,n,r]=e;return null==t||null==n||null==r?null:r<=0?"":t.toString().substring(n-1,n+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,t])=>null==e||null==t?null:t.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const t=3===e.length,n=t?e[1]:" ",r=t?e[2]:e[1];if(null==n||null==r)return null;const a=`(${(0,P.Cj)(n)})`;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${a}*|${a}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${a}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${a}*$`,"g"),"")}throw new i.L("InvalidFunctionParameters",{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const t=e[0],n=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*n)/n}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length||0===e[1]?Math.trunc(e[0]):(0,b.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,A.Kg)(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let n=0;n<e.length;n++){if(null==e[n])return null;t+=e[n].toString()}return t}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const t of e)if(null!==t)return t;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:e=>k(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const n=e[0],r=e[1];if(null===n)return null;switch(r.type){case"integer":{if(!q(n))throw new i.L("CannotCastValue");const e=parseInt(n,10);if(isNaN(e))throw new i.L("CannotCastValue");return e}case"smallint":{if(!q(n))throw new i.L("CannotCastValue");const e=parseInt(n,10);if(isNaN(e))throw new i.L("CannotCastValue");if(e>32767||e<-32767)throw new i.L("CannotCastValue");return e}case"float":case"real":{if(!q(n))throw new i.L("CannotCastValue");const e=parseFloat(n);if(isNaN(e))throw new i.L("CannotCastValue");return e}case"time":return function(e){if((0,A.$P)(e))return d.k.fromDateJS(e);if(E(e))return d.k.fromDateTime(e);if(S(e))throw new i.L("CannotCastValue");if(x(e))return e;if(C(e))return d.k.fromSqlTimeStampOffset(e);if((0,A.Kg)(e))return D(e);throw new i.L("CannotCastValue")}(n);case"date":return function(e){if((0,A.$P)(e))return o.n.fromDateJS(e);if(E(e))return o.n.fromParts(e.year,e.month,e.day);if(S(e))return e;if(x(e))throw new i.L("CannotCastValue");if(C(e)&&null===o.n.fromParts(e.year,e.month,e.day))throw new i.L("CannotCastValue");if((0,A.Kg)(e)){const t=o.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new i.L("CannotCastValue")}(n);case"timestamp":return function(e,t,n){if((0,A.$P)(e))return N(e,t);if(E(e))return e;if(S(e))return e.toDateTimeLuxon("unknown");if(x(e))throw new i.L("CannotCastValue");if(C(e))return e;if((0,A.Kg)(e))return _(e,"unknown",n);throw new i.L("CannotCastValue")}(n,t,!0===r.withtimezone);case"varchar":{const e=K(n);if(e.length>r.size)throw new i.L("CannotCastValue");return e}default:throw new i.L("InvalidDataType")}}}};function Y(e,t,n,r){if("||"===e)return H("concat",[t,n],r);if(null===t||null===n)return null;if((0,A.Et)(t)){if((0,A.Et)(n))return j(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e/t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(){throw new i.L("InvalidOperator")}();if(C(n))return function(){throw new i.L("InvalidOperator")}();if(E(n))return function(){throw new i.L("InvalidOperator")}();if((0,A.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new i.L("InvalidOperator");return j(e,r,n)}(t,n,e);throw new i.L("InvalidOperator")}if(S(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(x(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(){throw new i.L("InvalidOperator")}();if(C(n))return function(){throw new i.L("InvalidOperator")}();if(E(n))return function(){throw new i.L("InvalidOperator")}();if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(O(t)){if((0,A.Et)(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new i.L("InvalidOperator")}(t,n,e);if(S(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(E(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus({milliseconds:r});case"-":return e.minus({milliseconds:r})}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(C(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.addMilliseconds(r);case"-":return e.addMilliseconds(-1*r)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if((0,A.Kg)(t)){if((0,A.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new i.L("InvalidOperator");return j(r,t,n)}(t,n,e);if(O(n))return function(){throw new i.L("InvalidOperator")}();if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(){throw new i.L("InvalidOperator")}();if(C(n))return function(){throw new i.L("InvalidOperator")}();if(E(n))return function(){throw new i.L("InvalidOperator")}();if((0,A.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new i.L("InvalidOperator")}(t,n,e);throw new i.L("InvalidOperator")}throw new i.L("InvalidOperator")}function j(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new i.L("InvalidOperator")}class W extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let n=null;const r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));const a=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,i=this.location.source+":"+o.line+":"+o.column;if(n){const e=this.location.end,r="".padEnd(o.line.toString().length," "),s=n[a.line-1],u=(a.line===e.line?e.column:s.length+1)-a.column||1;t+="\n --\x3e "+i+"\n"+r+" |\n"+o.line+" | "+s+"\n"+r+" | "+"".padEnd(a.column-1," ")+"".padEnd(u,"^")}else t+="\n at "+i}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function a(e){return r?e.replace(r,e=>"\\u{"+n(e)+"}"):e}function o(e){return a(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}function i(e){return a(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}const s={literal:e=>'"'+o(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function u(e){return s[e.type](e)}return"Expected "+function(e){const t=e.map(u);if(t.sort(),t.length>0){let e=1;for(let n=1;n<t.length;n++)t[n-1]!==t[n]&&(t[e]=t[n],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."}}function B(e,t){const n={},r=(t=void 0!==t?t:{}).grammarSource,a={start:Tn};let o=Tn;const i="!",s="=",u=">=",l=">",c="<=",f="<>",d="!=",p="||",m="@",h="'",w="N'",v="''",I=".",g="null",y="true",L="false",T="in",N="is",O="like",E="escape",S="not",x="and",C="or",D="between",_="from",M="for",b="substring",P="extract",A="trim",F="position",$="timestamp",R="date",k="time",U="leading",V="trailing",z="both",H="cast",q="as",K="integer",Z="int",Y="smallint",j="float",B="real",G="varchar",J="to",Q="interval",X="year",ee="timezone_hour",te="timezone_minute",ne="month",re="day",ae="hour",oe="minute",ie="second",se="dow",ue="doy",le="week",ce="case",fe="end",de="when",pe="then",me="else",he=",",we="(",ve=")",Ie="`",ge=/^[<-=]/,ye=/^[+\-]/,Le=/^[*\/]/,Te=/^[A-Za-z_\x80-\uFFFF]/,Ne=/^[A-Za-z0-9_]/,Oe=/^[A-Za-z0-9_.\x80-\uFFFF]/,Ee=/^["]/,Se=/^[^']/,xe=/^[0-9]/,Ce=/^[eE]/,De=/^[ \t\n\r]/,_e=/^[^`]/,Me=vn("!",!1),be=vn("=",!1),Pe=vn(">=",!1),Ae=vn(">",!1),Fe=vn("<=",!1),$e=vn("<>",!1),Re=In([["<","="]],!1,!1,!1),ke=vn("!=",!1),Ue=In(["+","-"],!1,!1,!1),Ve=vn("||",!1),ze=In(["*","/"],!1,!1,!1),He=In([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1,!1),qe=In([["A","Z"],["a","z"],["0","9"],"_"],!1,!1,!1),Ke=In([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1,!1),Ze=In(['"'],!1,!1,!1),Ye=vn("@",!1),je=vn("'",!1),We=vn("N'",!1),Be=vn("''",!1),Ge=In(["'"],!0,!1,!1),Je=vn(".",!1),Qe=In([["0","9"]],!1,!1,!1),Xe=In(["e","E"],!1,!1,!1),et=vn("NULL",!0),tt=vn("TRUE",!0),nt=vn("FALSE",!0),rt=vn("IN",!0),at=vn("IS",!0),ot=vn("LIKE",!0),it=vn("ESCAPE",!0),st=vn("NOT",!0),ut=vn("AND",!0),lt=vn("OR",!0),ct=vn("BETWEEN",!0),ft=vn("FROM",!0),dt=vn("FOR",!0),pt=vn("SUBSTRING",!0),mt=vn("EXTRACT",!0),ht=vn("TRIM",!0),wt=vn("POSITION",!0),vt=vn("TIMESTAMP",!0),It=vn("DATE",!0),gt=vn("TIME",!0),yt=vn("LEADING",!0),Lt=vn("TRAILING",!0),Tt=vn("BOTH",!0),Nt=vn("CAST",!0),Ot=vn("AS",!0),Et=vn("INTEGER",!0),St=vn("INT",!0),xt=vn("SMALLINT",!0),Ct=vn("FLOAT",!0),Dt=vn("REAL",!0),_t=vn("VARCHAR",!0),Mt=vn("TO",!0),bt=vn("INTERVAL",!0),Pt=vn("YEAR",!0),At=vn("TIMEZONE_HOUR",!0),Ft=vn("TIMEZONE_MINUTE",!0),$t=vn("MONTH",!0),Rt=vn("DAY",!0),kt=vn("HOUR",!0),Ut=vn("MINUTE",!0),Vt=vn("SECOND",!0),zt=vn("DOW",!0),Ht=vn("DOY",!0),qt=vn("WEEK",!0),Kt=vn("CASE",!0),Zt=vn("END",!0),Yt=vn("WHEN",!0),jt=vn("THEN",!0),Wt=vn("ELSE",!0),Bt=vn(",",!1),Gt=vn("(",!1),Jt=vn(")",!1),Qt=In([" ","\t","\n","\r"],!1,!1,!1),Xt=vn("`",!1),en=In(["`"],!0,!1,!1);function tn(e,t,n){return{op:t,expr:n,location:hn()}}function nn(e,t,n){return{op:t,expr:n,location:hn()}}function rn(e,t){return{op:e,expr:t,location:hn()}}function an(e,t,n){return{op:t,expr:n,location:hn()}}function on(e,t,n){return{op:t,expr:n,location:hn()}}function sn(){return"'"}let un=0|t.peg$currPos,ln=un;const cn=[{line:1,column:1}];let fn,dn=un,pn=t.peg$maxFailExpected||[],mn=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in a))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=a[t.startRule]}function hn(){return yn(ln,un)}function wn(e,t){throw function(e,t){return new W(e,null,null,t)}(e,t=void 0!==t?t:yn(ln,un))}function vn(e,t){return{type:"literal",text:e,ignoreCase:t}}function In(e,t,n,r){return{type:"class",parts:e,inverted:t,ignoreCase:n,unicode:r}}function gn(t){let n,r=cn[t];if(r)return r;if(t>=cn.length)n=cn.length-1;else for(n=t;!cn[--n];);for(r=cn[n],r={line:r.line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return cn[t]=r,r}function yn(e,t,n){const a=gn(e),o=gn(t);return{source:r,start:{offset:e,line:a.line,column:a.column},end:{offset:t,line:o.line,column:o.column}}}function Ln(e){un<dn||(un>dn&&(dn=un,pn=[]),pn.push(e))}function Tn(){let e,t;return e=un,oa(),t=On(),t!==n?(oa(),ln=e,e=t):(un=e,e=n),e}function Nn(){let e,t,r,a,o,i,s,u;if(e=un,t=ra(),t!==n){for(oa(),r=[],a=On();a!==n;)r.push(a),a=un,o=un,i=oa(),s=na(),s!==n?(u=oa(),i=[i,s,u],o=i):(un=o,o=n),o!==n?(o=On(),o===n?(un=a,a=n):a=o):a=o;a=oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"expression-list",location:hn(),value:e}}(r)):(un=e,e=n)}else un=e,e=n;return e}function On(){let e,t,r,a,o,i;if(e=un,t=En(),t!==n){for(r=[],a=un,oa(),o=wr(),o!==n?(oa(),i=En(),i!==n?(ln=a,a=tn(0,o,i)):(un=a,a=n)):(un=a,a=n);a!==n;)r.push(a),a=un,oa(),o=wr(),o!==n?(oa(),i=En(),i!==n?(ln=a,a=tn(0,o,i)):(un=a,a=n)):(un=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else un=e,e=n;return e}function En(){let e,t,r,a,o,i;if(e=un,t=Sn(),t!==n){for(r=[],a=un,oa(),o=hr(),o!==n?(oa(),i=Sn(),i!==n?(ln=a,a=nn(0,o,i)):(un=a,a=n)):(un=a,a=n);a!==n;)r.push(a),a=un,oa(),o=hr(),o!==n?(oa(),i=Sn(),i!==n?(ln=a,a=nn(0,o,i)):(un=a,a=n)):(un=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else un=e,e=n;return e}function Sn(){let t,r,a,o,u;return t=un,r=mr(),r===n&&(r=un,33===e.charCodeAt(un)?(a=i,un++):(a=n,0===mn&&Ln(Me)),a!==n?(o=un,mn++,61===e.charCodeAt(un)?(u=s,un++):(u=n,0===mn&&Ln(be)),mn--,u===n?o=void 0:(un=o,o=n),o!==n?(a=[a,o],r=a):(un=r,r=n)):(un=r,r=n)),r!==n?(a=oa(),o=Sn(),o!==n?(ln=t,t=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,hn())}(o)):(un=t,t=n)):(un=t,t=n),t===n&&(t=function(){let e,t,r,a;return e=un,t=_n(),t!==n?(r=un,oa(),a=function(){let e;return e=function(){let e,t,r,a,o;if(e=un,t=[],r=un,oa(),a=xn(),a!==n?(oa(),o=_n(),o!==n?(ln=r,r=rn(a,o)):(un=r,r=n)):(un=r,r=n),r!==n)for(;r!==n;)t.push(r),r=un,oa(),a=xn(),a!==n?(oa(),o=_n(),o!==n?(ln=r,r=rn(a,o)):(un=r,r=n)):(un=r,r=n);else t=n;return t!==n&&(ln=e,t=function(e){return{type:"arithmetic",tail:e}}(t)),e=t,e}(),e===n&&(e=function(){let e,t,r;return e=un,t=Dn(),t!==n?(oa(),r=Nn(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=Dn(),t!==n?(oa(),r=zn(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(un=e,e=n)):(un=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a,o,i,s,u;return e=un,t=mr(),t!==n?(oa(),r=vr(),r!==n?(a=oa(),o=un,i=_n(),i!==n?(oa(),s=hr(),s!==n?(oa(),u=_n(),u!==n?(ln=o,o=function(e,t,n){return la(hn(),t,n)}(0,i,u)):(un=o,o=n)):(un=o,o=n)):(un=o,o=n),o!==n?(ln=e,e=function(e,t){return{op:"NOT"+e,right:t}}(r,o)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=vr(),t!==n?(oa(),r=un,a=_n(),a!==n?(o=oa(),i=hr(),i!==n?(oa(),s=_n(),s!==n?(ln=r,r=function(e,t,n){return la(hn(),t,n)}(0,a,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(un=e,e=n)):(un=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a;return e=un,t=fr(),t!==n?(oa(),r=mr(),r!==n?(oa(),a=_n(),a!==n?(ln=e,e=function(e,t){return{op:e+"NOT",right:t}}(t,a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=fr(),t!==n?(oa(),r=_n(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(un=e,e=n)):(un=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a,o;return e=un,t=Cn(),t!==n?(oa(),r=Gn(),r!==n?(oa(),a=pr(),a!==n?(oa(),o=Jn(),o!==n?(ln=e,e=function(e,t,n){return{op:e,right:t,escape:n.value}}(t,r,o)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=Cn(),t!==n?(oa(),r=Gn(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t,escape:""}}(t,r)):(un=e,e=n)):(un=e,e=n)),e}())))),e}(),a!==n?r=a:(un=r,r=n),r===n&&(r=null),ln=e,e=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?ca(e,t.tail):ua(t.op,e,t.right,t.escape,hn())}(t,r)):(un=e,e=n),e}()),t}function xn(){let t;return e.substr(un,2)===u?(t=u,un+=2):(t=n,0===mn&&Ln(Pe)),t===n&&(62===e.charCodeAt(un)?(t=l,un++):(t=n,0===mn&&Ln(Ae)),t===n&&(e.substr(un,2)===c?(t=c,un+=2):(t=n,0===mn&&Ln(Fe)),t===n&&(e.substr(un,2)===f?(t=f,un+=2):(t=n,0===mn&&Ln($e)),t===n&&(t=e.charAt(un),ge.test(t)?un++:(t=n,0===mn&&Ln(Re)),t===n&&(e.substr(un,2)===d?(t=d,un+=2):(t=n,0===mn&&Ln(ke))))))),t}function Cn(){let e,t,r,a,o;return e=un,t=un,r=mr(),r!==n?(a=oa(),o=dr(),o!==n?(r=[r,a,o],t=r):(un=t,t=n)):(un=t,t=n),t!==n&&(ln=e,t=function(e){return e[0]+" "+e[2]}(t)),e=t,e===n&&(e=dr()),e}function Dn(){let e,t,r,a,o;return e=un,t=un,r=mr(),r!==n?(a=oa(),o=cr(),o!==n?(r=[r,a,o],t=r):(un=t,t=n)):(un=t,t=n),t!==n&&(ln=e,t=function(e){return e[0]+" "+e[2]}(t)),e=t,e===n&&(e=cr()),e}function _n(){let e,t,r,a,o,i;if(e=un,t=bn(),t!==n){for(r=[],a=un,oa(),o=Mn(),o!==n?(oa(),i=bn(),i!==n?(ln=a,a=an(0,o,i)):(un=a,a=n)):(un=a,a=n);a!==n;)r.push(a),a=un,oa(),o=Mn(),o!==n?(oa(),i=bn(),i!==n?(ln=a,a=an(0,o,i)):(un=a,a=n)):(un=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else un=e,e=n;return e}function Mn(){let t;return t=e.charAt(un),ye.test(t)?un++:(t=n,0===mn&&Ln(Ue)),t===n&&(e.substr(un,2)===p?(t=p,un+=2):(t=n,0===mn&&Ln(Ve))),t}function bn(){let e,t,r,a,o,i;if(e=un,t=An(),t!==n){for(r=[],a=un,oa(),o=Pn(),o!==n?(oa(),i=An(),i!==n?(ln=a,a=on(0,o,i)):(un=a,a=n)):(un=a,a=n);a!==n;)r.push(a),a=un,oa(),o=Pn(),o!==n?(oa(),i=An(),i!==n?(ln=a,a=on(0,o,i)):(un=a,a=n)):(un=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else un=e,e=n;return e}function Pn(){let t;return t=e.charAt(un),Le.test(t)?un++:(t=n,0===mn&&Ln(ze)),t}function An(){let e,t,r,a;return e=function(){let e;return e=Jn(),e===n&&(e=function(){let e,t,r,a;return e=un,t=function(){let e,t,r,a;return e=un,t=tr(),t!==n?(r=nr(),r!==n?(a=rr(),a!==n?(ln=e,e=function(e,t,n){return parseFloat(e+t+n)}(t,r,a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=tr(),t!==n?(r=nr(),r!==n?(ln=e,e=function(e,t){return parseFloat(e+t)}(t,r)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=tr(),t!==n?(r=rr(),r!==n?(ln=e,e=function(e,t){return parseFloat(e+t)}(t,r)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=tr(),t!==n&&(ln=e,t=function(e){return parseFloat(e)}(t)),e=t))),e}(),t!==n?(r=un,mn++,a=$n(),mn--,a===n?r=void 0:(un=r,r=n),r!==n?(ln=e,e=function(e){return{type:"number",location:hn(),value:e}}(t)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t;return e=un,t=ur(),t!==n&&(ln=e,t={type:"boolean",location:hn(),value:!0}),e=t,e===n&&(e=un,t=lr(),t!==n&&(ln=e,t={type:"boolean",location:hn(),value:!1}),e=t),e}(),e===n&&(e=function(){let e,t;return e=un,t=sr(),t!==n&&(ln=e,t={type:"null",location:hn(),value:null}),e=t,e}(),e===n&&(e=function(){let e,t,r;return e=un,t=Er(),t!==n?(oa(),r=Gn(),r!==n?(ln=e,e=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&wn("Date literal is invalid")}(e.value),{type:"date",location:hn(),value:e.value}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t,r;return e=un,t=Or(),t!==n?(oa(),r=Gn(),r!==n?(ln=e,e=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&wn("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:hn(),value:e.value}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=Zn(),e===n&&(e=function(){let e,t,r;return e=un,t=Sr(),t!==n?(oa(),r=Gn(),r!==n?(ln=e,e=function(e){return"string"===e.type&&function(e){!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)&&wn("Time literal is invalid")}(e.value),{type:"time",location:hn(),value:e.value}}(r)):(un=e,e=n)):(un=e,e=n),e}()))))))),e}(),e===n&&(e=function(){let e,t,r,a,o,i,s,u;return e=un,t=Lr(),t!==n?(oa(),r=un,a=ra(),a!==n?(oa(),o=Kn(),o!==n?(oa(),i=Ir(),i!==n?(oa(),s=On(),s!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n),r===n&&(r=un,a=ra(),a!==n?(oa(),o=Kn(),o!==n?(oa(),i=na(),i!==n?(oa(),s=On(),s!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"extract",args:e}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,s,u,l,c,f;return e=un,t=yr(),t!==n?(oa(),r=un,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=Ir(),i!==n?(oa(),s=On(),s!==n?(oa(),u=un,l=gr(),l!==n?(c=oa(),f=On(),f!==n?(oa(),u=f):(un=u,u=n)):(un=u,u=n),u===n&&(u=null),l=aa(),l!==n?(ln=r,r=function(e,t,n){return la(hn(),e,t,...n?[n]:[])}(o,s,u)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n),r===n&&(r=un,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=na(),i!==n?(oa(),s=On(),s!==n?(oa(),u=na(),u!==n?(l=oa(),c=On(),c!==n?(f=aa(),f!==n?(ln=r,r=function(e,t,n){return la(hn(),e,t,n)}(o,s,c)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"substring",args:e}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,s,u,l;return e=un,t=Tr(),t!==n?(oa(),r=un,a=ra(),a!==n?(oa(),o=qn(),oa(),i=On(),i!==n?(oa(),s=Ir(),s!==n?(oa(),u=On(),u!==n?(oa(),l=aa(),l!==n?(ln=r,r=function(e,t,n){return la(hn(),e,t,n)}(o,i,u)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n),r===n&&(r=un,a=ra(),a!==n?(oa(),o=qn(),oa(),i=On(),i!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,i)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"trim",args:e}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,s,u;return e=un,t=Nr(),t!==n?(oa(),r=un,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=cr(),i!==n?(oa(),s=On(),s!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n),r===n&&(r=un,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=na(),i!==n?(oa(),s=On(),s!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"position",args:e}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,s,u;return e=un,t=_r(),t!==n?(oa(),r=un,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=Mr(),i!==n?(oa(),s=Hn(),s!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n),r===n&&(r=un,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=na(),i!==n?(oa(),s=Hn(),s!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,s)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)):(un=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"cast",args:e}}(r)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a;return e=un,t=un,mn++,r=Lr(),mn--,r===n?t=void 0:(un=t,t=n),t!==n?(r=sa(),r!==n?(oa(),a=Nn(),a!==n?(ln=e,e=function(e,t){return{type:"function",location:hn(),name:e,args:t}}(r,a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e}(),e===n&&(e=function(){let e;return e=function(){let e,t,r,a,o,i,s;if(e=un,t=Jr(),t!==n)if(oa(),r=On(),r!==n){for(oa(),a=[],o=un,i=Xn(),i!==n?(s=oa(),o=i):(un=o,o=n);o!==n;)a.push(o),o=un,i=Xn(),i!==n?(s=oa(),o=i):(un=o,o=n);o=Qr(),o!==n?(ln=e,e=function(e,t){return{type:"case-expression",location:hn(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}}(r,a)):(un=e,e=n)}else un=e,e=n;else un=e,e=n;if(e===n)if(e=un,t=Jr(),t!==n)if(oa(),r=On(),r!==n){for(oa(),a=[],o=un,i=Xn(),i!==n?(s=oa(),o=i):(un=o,o=n);o!==n;)a.push(o),o=un,i=Xn(),i!==n?(s=oa(),o=i):(un=o,o=n);o=er(),o!==n?(i=oa(),s=Qr(),s!==n?(ln=e,e=function(e,t,n){return{type:"case-expression",location:hn(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}}(r,a,o)):(un=e,e=n)):(un=e,e=n)}else un=e,e=n;else un=e,e=n;return e}(),e===n&&(e=function(){let e,t,r,a,o,i;if(e=un,t=Jr(),t!==n){for(oa(),r=[],a=un,o=Qn(),o!==n?(i=oa(),a=o):(un=a,a=n);a!==n;)r.push(a),a=un,o=Qn(),o!==n?(i=oa(),a=o):(un=a,a=n);a=Qr(),a!==n?(ln=e,e=function(e){return{type:"case-expression",location:hn(),format:"searched",clauses:e,else:null,elseLocation:null}}(r)):(un=e,e=n)}else un=e,e=n;if(e===n)if(e=un,t=Jr(),t!==n){for(oa(),r=[],a=un,o=Qn(),o!==n?(i=oa(),a=o):(un=a,a=n);a!==n;)r.push(a),a=un,o=Qn(),o!==n?(i=oa(),a=o):(un=a,a=n);a=er(),a!==n?(o=oa(),i=Qr(),i!==n?(ln=e,e=function(e,t){return{type:"case-expression",location:hn(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}}(r,a)):(un=e,e=n)):(un=e,e=n)}else un=e,e=n;return e}()),e}(),e===n&&(e=function(){let e,t;return e=un,t=function(){let e,t;return e=un,t=function(){let e,t,r,a;if(e=un,t=$n(),t!==n){for(r=[],a=kn();a!==n;)r.push(a),a=kn();ln=e,e=function(e,t){return e+t.join("")}(t,r)}else un=e,e=n;return e}(),t!==n&&(ln=e),e=t,e}(),t!==n&&(ln=e,t=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:hn(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:hn(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:hn(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:hn()}:{type:"column-reference",location:hn(),table:"",column:e}}(t)),e=t,e===n&&(e=un,t=function(){let e,t,r,a;return e=un,t=Vn(),t!==n?(r=function(){let e,t,r;for(e=un,t=[],r=Un();r!==n;)t.push(r),r=Un();return ln=e,t=function(e){return e.join("")}(t),e=t,e}(),a=Vn(),a!==n?(ln=e,e=r):(un=e,e=n)):(un=e,e=n),e}(),t!==n&&(ln=e,t=function(e){return{type:"column-reference",location:hn(),table:"",column:e,delimited:!0}}(t)),e=t),e}(),e===n&&(e=zn(),e===n&&(e=un,t=ra(),t!==n?(oa(),r=On(),r!==n?(oa(),a=aa(),a!==n?(ln=e,e=function(e){return e.paren=!0,e}(r)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n))))))))))),e}function Fn(){let e,t,r,a;if(e=un,t=$n(),t!==n){for(r=[],a=Rn();a!==n;)r.push(a),a=Rn();ln=e,e=function(e,t){return e+t.join("")}(t,r)}else un=e,e=n;return e}function $n(){let t;return t=e.charAt(un),Te.test(t)?un++:(t=n,0===mn&&Ln(He)),t}function Rn(){let t;return t=e.charAt(un),Ne.test(t)?un++:(t=n,0===mn&&Ln(qe)),t}function kn(){let t;return t=e.charAt(un),Oe.test(t)?un++:(t=n,0===mn&&Ln(Ke)),t}function Un(){let t;return t=function(){let t;return t=e.charAt(un),Oe.test(t)?un++:(t=n,0===mn&&Ln(Ke)),t}(),t===n&&(t=function(){let e,t,r;return e=un,t=Vn(),t!==n?(r=Vn(),r!==n?(ln=e,e='"'):(un=e,e=n)):(un=e,e=n),e}()),t}function Vn(){let t;return t=e.charAt(un),Ee.test(t)?un++:(t=n,0===mn&&Ln(Ze)),t}function zn(){let t,r,a,o;return t=un,r=un,64===e.charCodeAt(un)?(a=m,un++):(a=n,0===mn&&Ln(Ye)),a!==n?(o=Fn(),o!==n?(a=[a,o],r=a):(un=r,r=n)):(un=r,r=n),r!==n&&(ln=t,r=function(e){return{type:"parameter",location:hn(),value:e[1]}}(r)),t=r,t}function Hn(){let e,t,r,a,o;return e=un,t=br(),t===n&&(t=Pr()),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"integer"}}),e=t,e===n&&(e=un,t=Ar(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"smallint"}}),e=t,e===n&&(e=un,t=Fr(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"float"}}),e=t,e===n&&(e=un,t=$r(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"real"}}),e=t,e===n&&(e=un,t=Er(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"date"}}),e=t,e===n&&(e=un,t=Or(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"timestamp"}}),e=t,e===n&&(e=un,t=Sr(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"time"}}),e=t,e===n&&(e=un,t=Rr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=ar(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"data-type",location:hn(),value:{type:"varchar",size:parseInt(e)}}}(a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)))))))),e}function qn(){let e,t;return e=un,t=xr(),t===n&&(t=Cr(),t===n&&(t=Dr())),t===n&&(t=null),ln=e,t=function(e){return{type:"string",location:hn(),value:e??"BOTH"}}(t),e=t,e}function Kn(){let e,t;return e=un,t=Vr(),t===n&&(t=qr(),t===n&&(t=Kr(),t===n&&(t=Zr(),t===n&&(t=Yr(),t===n&&(t=jr(),t===n&&(t=zr(),t===n&&(t=Hr(),t===n&&(t=Wr(),t===n&&(t=Br(),t===n&&(t=Gr())))))))))),t!==n&&(ln=e,t=function(e){return{type:"string",location:hn(),value:e}}(t)),e=t,e}function Zn(){let t,r,a,o,i;return t=un,r=Ur(),r!==n?(oa(),a=e.charAt(un),ye.test(a)?un++:(a=n,0===mn&&Ln(Ue)),a!==n?(oa(),o=Gn(),o!==n?(oa(),i=Yn(),i!==n?(ln=t,t=function(e,t,n){return{type:"interval",location:hn(),value:t,qualifier:n,op:e}}(a,o,i)):(un=t,t=n)):(un=t,t=n)):(un=t,t=n)):(un=t,t=n),t===n&&(t=un,r=Ur(),r!==n?(oa(),a=Gn(),a!==n?(oa(),o=Yn(),o!==n?(ln=t,t=function(e,t){return{type:"interval",location:hn(),value:e,qualifier:t,op:""}}(a,o)):(un=t,t=n)):(un=t,t=n)):(un=t,t=n)),t}function Yn(){let e,t,r,a;return e=un,t=function(){let e,t,r,a,o;return e=un,t=jn(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Bn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:e.value,precision:t,secondary:null}}(t,a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=jn(),t!==n&&(ln=e,t=function(e){return{type:"interval-period",location:hn(),period:e.value,precision:null,secondary:null}}(t)),e=t),e}(),t!==n?(oa(),r=kr(),r!==n?(oa(),a=function(){let e,t,r,a,o,i,s;return e=un,t=jn(),t!==n&&(ln=e,t=function(e){return{type:"interval-period",location:hn(),period:e.value,precision:null,secondary:null}}(t)),e=t,e===n&&(e=un,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Bn(),a!==n?(oa(),o=na(),o!==n?(oa(),i=Wn(),i!==n?(oa(),s=aa(),s!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:t}}(a,i)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Bn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:null}}(a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=jr(),t!==n&&(ln=e,t={type:"interval-period",location:hn(),period:"second",precision:null,secondary:null}),e=t))),e}(),a!==n?(ln=e,e=function(e,t){return{type:"interval-qualifier",location:hn(),start:e,end:t}}(t,a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=function(){let e,t,r,a,o,i,s;return e=un,t=jn(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Wn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:e.value,precision:t,secondary:null}}(t,a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=jn(),t!==n&&(ln=e,t=function(e){return{type:"interval-period",location:hn(),period:e.value,precision:null,secondary:null}}(t)),e=t,e===n&&(e=un,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Bn(),a!==n?(oa(),o=na(),o!==n?(oa(),i=Wn(),i!==n?(oa(),s=aa(),s!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:t}}(a,i)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Wn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:null}}(a)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e===n&&(e=un,t=jr(),t!==n&&(ln=e,t={type:"interval-period",location:hn(),period:"second",precision:null,secondary:null}),e=t)))),e}()),e}function jn(){let e,t;return e=un,t=Kr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"day"}),e=t,e===n&&(e=un,t=Zr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"hour"}),e=t,e===n&&(e=un,t=Yr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"minute"}),e=t,e===n&&(e=un,t=qr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"month"}),e=t,e===n&&(e=un,t=Vr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"year"}),e=t)))),e}function Wn(){let e,t;return e=un,t=ar(),t!==n&&(ln=e,t=function(e){return parseFloat(e)}(t)),e=t,e}function Bn(){let e,t;return e=un,t=ar(),t!==n&&(ln=e,t=function(e){return parseFloat(e)}(t)),e=t,e}function Gn(){let e;return e=Jn(),e===n&&(e=zn()),e}function Jn(){let t,r,a,o,i;if(t=un,39===e.charCodeAt(un)?(r=h,un++):(r=n,0===mn&&Ln(je)),r===n&&(e.substr(un,2)===w?(r=w,un+=2):(r=n,0===mn&&Ln(We))),r!==n){for(a=[],o=un,e.substr(un,2)===v?(i=v,un+=2):(i=n,0===mn&&Ln(Be)),i!==n&&(ln=o,i="'"),o=i,o===n&&(o=e.charAt(un),Se.test(o)?un++:(o=n,0===mn&&Ln(Ge)));o!==n;)a.push(o),o=un,e.substr(un,2)===v?(i=v,un+=2):(i=n,0===mn&&Ln(Be)),i!==n&&(ln=o,i=sn()),o=i,o===n&&(o=e.charAt(un),Se.test(o)?un++:(o=n,0===mn&&Ln(Ge)));39===e.charCodeAt(un)?(o=h,un++):(o=n,0===mn&&Ln(je)),o!==n?(ln=t,t=function(e){return{type:"string",location:hn(),value:e.join("")}}(a)):(un=t,t=n)}else un=t,t=n;return t}function Qn(){let e,t,r,a,o;return e=un,t=Xr(),t!==n?(oa(),r=On(),r!==n?(oa(),a=ea(),a!==n?(oa(),o=On(),o!==n?(ln=e,e=function(e,t){return{type:"when-clause",location:hn(),operand:e,value:t}}(r,o)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e}function Xn(){let e,t,r,a,o;return e=un,t=Xr(),t!==n?(oa(),r=On(),r!==n?(oa(),a=ea(),a!==n?(oa(),o=On(),o!==n?(ln=e,e=function(e,t){return{type:"when-clause",location:hn(),operand:e,value:t}}(r,o)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n)):(un=e,e=n),e}function er(){let e,t,r;return e=un,t=ta(),t!==n?(oa(),r=On(),r!==n?(ln=e,e=function(e){return{type:"else-clause",location:hn(),value:e}}(r)):(un=e,e=n)):(un=e,e=n),e}function tr(){let t,r,a;return t=ar(),t===n&&(t=un,r=e.charAt(un),ye.test(r)?un++:(r=n,0===mn&&Ln(Ue)),r!==n?(a=ar(),a!==n?(ln=t,t=function(e,t){return e[0]+t}(r,a)):(un=t,t=n)):(un=t,t=n)),t}function nr(){let t,r,a;return t=un,46===e.charCodeAt(un)?(r=I,un++):(r=n,0===mn&&Ln(Je)),r!==n?(a=ar(),a===n&&(a=null),ln=t,t=function(e){return"."+(null!=e?e:"")}(a)):(un=t,t=n),t}function rr(){let e,t,r;return e=un,t=ir(),t!==n?(r=ar(),r!==n?(ln=e,e=function(e,t){return e+t}(t,r)):(un=e,e=n)):(un=e,e=n),e}function ar(){let e,t,r;if(e=un,t=[],r=or(),r!==n)for(;r!==n;)t.push(r),r=or();else t=n;return t!==n&&(ln=e,t=function(e){return e.join("")}(t)),e=t,e}function or(){let t;return t=e.charAt(un),xe.test(t)?un++:(t=n,0===mn&&Ln(Qe)),t}function ir(){let t,r,a;return t=un,r=e.charAt(un),Ce.test(r)?un++:(r=n,0===mn&&Ln(Xe)),r!==n?(a=e.charAt(un),ye.test(a)?un++:(a=n,0===mn&&Ln(Ue)),a===n&&(a=null),ln=t,t=function(e,t){return"e"+(null===t?"":t)}(0,a)):(un=t,t=n),t}function sr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===g?un+=4:(r=n,0===mn&&Ln(et)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(r=[r,a],t=r):(un=t,t=n)):(un=t,t=n),t}function ur(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===y?un+=4:(r=n,0===mn&&Ln(tt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(r=[r,a],t=r):(un=t,t=n)):(un=t,t=n),t}function lr(){let t,r,a,o;return t=un,r=e.substr(un,5),r.toLowerCase()===L?un+=5:(r=n,0===mn&&Ln(nt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(r=[r,a],t=r):(un=t,t=n)):(un=t,t=n),t}function cr(){let t,r,a,o;return t=un,r=e.substr(un,2),r.toLowerCase()===T?un+=2:(r=n,0===mn&&Ln(rt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="IN"):(un=t,t=n)):(un=t,t=n),t}function fr(){let t,r,a,o;return t=un,r=e.substr(un,2),r.toLowerCase()===N?un+=2:(r=n,0===mn&&Ln(at)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="IS"):(un=t,t=n)):(un=t,t=n),t}function dr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===O?un+=4:(r=n,0===mn&&Ln(ot)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="LIKE"):(un=t,t=n)):(un=t,t=n),t}function pr(){let t,r,a,o;return t=un,r=e.substr(un,6),r.toLowerCase()===E?un+=6:(r=n,0===mn&&Ln(it)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="ESCAPE"):(un=t,t=n)):(un=t,t=n),t}function mr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===S?un+=3:(r=n,0===mn&&Ln(st)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="NOT"):(un=t,t=n)):(un=t,t=n),t}function hr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===x?un+=3:(r=n,0===mn&&Ln(ut)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="AND"):(un=t,t=n)):(un=t,t=n),t}function wr(){let t,r,a,o;return t=un,r=e.substr(un,2),r.toLowerCase()===C?un+=2:(r=n,0===mn&&Ln(lt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="OR"):(un=t,t=n)):(un=t,t=n),t}function vr(){let t,r,a,o;return t=un,r=e.substr(un,7),r.toLowerCase()===D?un+=7:(r=n,0===mn&&Ln(ct)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="BETWEEN"):(un=t,t=n)):(un=t,t=n),t}function Ir(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===_?un+=4:(r=n,0===mn&&Ln(ft)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="FROM"):(un=t,t=n)):(un=t,t=n),t}function gr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===M?un+=3:(r=n,0===mn&&Ln(dt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="FOR"):(un=t,t=n)):(un=t,t=n),t}function yr(){let t,r,a,o;return t=un,r=e.substr(un,9),r.toLowerCase()===b?un+=9:(r=n,0===mn&&Ln(pt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="SUBSTRING"):(un=t,t=n)):(un=t,t=n),t}function Lr(){let t,r,a,o;return t=un,r=e.substr(un,7),r.toLowerCase()===P?un+=7:(r=n,0===mn&&Ln(mt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="EXTRACT"):(un=t,t=n)):(un=t,t=n),t}function Tr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===A?un+=4:(r=n,0===mn&&Ln(ht)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TRIM"):(un=t,t=n)):(un=t,t=n),t}function Nr(){let t,r,a,o;return t=un,r=e.substr(un,8),r.toLowerCase()===F?un+=8:(r=n,0===mn&&Ln(wt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="POSITION"):(un=t,t=n)):(un=t,t=n),t}function Or(){let t,r,a,o;return t=un,r=e.substr(un,9),r.toLowerCase()===$?un+=9:(r=n,0===mn&&Ln(vt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TIMESTAMP"):(un=t,t=n)):(un=t,t=n),t}function Er(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===R?un+=4:(r=n,0===mn&&Ln(It)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="DATE"):(un=t,t=n)):(un=t,t=n),t}function Sr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===k?un+=4:(r=n,0===mn&&Ln(gt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TIME"):(un=t,t=n)):(un=t,t=n),t}function xr(){let t,r,a,o;return t=un,r=e.substr(un,7),r.toLowerCase()===U?un+=7:(r=n,0===mn&&Ln(yt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="LEADING"):(un=t,t=n)):(un=t,t=n),t}function Cr(){let t,r,a,o;return t=un,r=e.substr(un,8),r.toLowerCase()===V?un+=8:(r=n,0===mn&&Ln(Lt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TRAILING"):(un=t,t=n)):(un=t,t=n),t}function Dr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===z?un+=4:(r=n,0===mn&&Ln(Tt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="BOTH"):(un=t,t=n)):(un=t,t=n),t}function _r(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===H?un+=4:(r=n,0===mn&&Ln(Nt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="CAST"):(un=t,t=n)):(un=t,t=n),t}function Mr(){let t,r,a,o;return t=un,r=e.substr(un,2),r.toLowerCase()===q?un+=2:(r=n,0===mn&&Ln(Ot)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="AS"):(un=t,t=n)):(un=t,t=n),t}function br(){let t,r,a,o;return t=un,r=e.substr(un,7),r.toLowerCase()===K?un+=7:(r=n,0===mn&&Ln(Et)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="INTEGER"):(un=t,t=n)):(un=t,t=n),t}function Pr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===Z?un+=3:(r=n,0===mn&&Ln(St)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="INT"):(un=t,t=n)):(un=t,t=n),t}function Ar(){let t,r,a,o;return t=un,r=e.substr(un,8),r.toLowerCase()===Y?un+=8:(r=n,0===mn&&Ln(xt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="SMALLINT"):(un=t,t=n)):(un=t,t=n),t}function Fr(){let t,r,a,o;return t=un,r=e.substr(un,5),r.toLowerCase()===j?un+=5:(r=n,0===mn&&Ln(Ct)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="FLOAT"):(un=t,t=n)):(un=t,t=n),t}function $r(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===B?un+=4:(r=n,0===mn&&Ln(Dt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="REAL"):(un=t,t=n)):(un=t,t=n),t}function Rr(){let t,r,a,o;return t=un,r=e.substr(un,7),r.toLowerCase()===G?un+=7:(r=n,0===mn&&Ln(_t)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="VARCHAR"):(un=t,t=n)):(un=t,t=n),t}function kr(){let t,r,a,o;return t=un,r=e.substr(un,2),r.toLowerCase()===J?un+=2:(r=n,0===mn&&Ln(Mt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TO"):(un=t,t=n)):(un=t,t=n),t}function Ur(){let t,r,a,o;return t=un,r=e.substr(un,8),r.toLowerCase()===Q?un+=8:(r=n,0===mn&&Ln(bt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="INTERVAL"):(un=t,t=n)):(un=t,t=n),t}function Vr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===X?un+=4:(r=n,0===mn&&Ln(Pt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="YEAR"):(un=t,t=n)):(un=t,t=n),t}function zr(){let t,r,a,o;return t=un,r=e.substr(un,13),r.toLowerCase()===ee?un+=13:(r=n,0===mn&&Ln(At)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TIMEZONE_HOUR"):(un=t,t=n)):(un=t,t=n),t}function Hr(){let t,r,a,o;return t=un,r=e.substr(un,15),r.toLowerCase()===te?un+=15:(r=n,0===mn&&Ln(Ft)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="TIMEZONE_MINUTE"):(un=t,t=n)):(un=t,t=n),t}function qr(){let t,r,a,o;return t=un,r=e.substr(un,5),r.toLowerCase()===ne?un+=5:(r=n,0===mn&&Ln($t)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="MONTH"):(un=t,t=n)):(un=t,t=n),t}function Kr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===re?un+=3:(r=n,0===mn&&Ln(Rt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="DAY"):(un=t,t=n)):(un=t,t=n),t}function Zr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===ae?un+=4:(r=n,0===mn&&Ln(kt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="HOUR"):(un=t,t=n)):(un=t,t=n),t}function Yr(){let t,r,a,o;return t=un,r=e.substr(un,6),r.toLowerCase()===oe?un+=6:(r=n,0===mn&&Ln(Ut)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="MINUTE"):(un=t,t=n)):(un=t,t=n),t}function jr(){let t,r,a,o;return t=un,r=e.substr(un,6),r.toLowerCase()===ie?un+=6:(r=n,0===mn&&Ln(Vt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="SECOND"):(un=t,t=n)):(un=t,t=n),t}function Wr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===se?un+=3:(r=n,0===mn&&Ln(zt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="DOW"):(un=t,t=n)):(un=t,t=n),t}function Br(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===ue?un+=3:(r=n,0===mn&&Ln(Ht)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="DOY"):(un=t,t=n)):(un=t,t=n),t}function Gr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===le?un+=4:(r=n,0===mn&&Ln(qt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="WEEK"):(un=t,t=n)):(un=t,t=n),t}function Jr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===ce?un+=4:(r=n,0===mn&&Ln(Kt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="CASE"):(un=t,t=n)):(un=t,t=n),t}function Qr(){let t,r,a,o;return t=un,r=e.substr(un,3),r.toLowerCase()===fe?un+=3:(r=n,0===mn&&Ln(Zt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="END"):(un=t,t=n)):(un=t,t=n),t}function Xr(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===de?un+=4:(r=n,0===mn&&Ln(Yt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="WHEN"):(un=t,t=n)):(un=t,t=n),t}function ea(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===pe?un+=4:(r=n,0===mn&&Ln(jt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="THEN"):(un=t,t=n)):(un=t,t=n),t}function ta(){let t,r,a,o;return t=un,r=e.substr(un,4),r.toLowerCase()===me?un+=4:(r=n,0===mn&&Ln(Wt)),r!==n?(a=un,mn++,o=Rn(),mn--,o===n?a=void 0:(un=a,a=n),a!==n?(ln=t,t="ELSE"):(un=t,t=n)):(un=t,t=n),t}function na(){let t;return 44===e.charCodeAt(un)?(t=he,un++):(t=n,0===mn&&Ln(Bt)),t}function ra(){let t;return 40===e.charCodeAt(un)?(t=we,un++):(t=n,0===mn&&Ln(Gt)),t}function aa(){let t;return 41===e.charCodeAt(un)?(t=ve,un++):(t=n,0===mn&&Ln(Jt)),t}function oa(){let e,t;for(e=[],t=ia();t!==n;)e.push(t),t=ia();return e}function ia(){let t;return t=e.charAt(un),De.test(t)?un++:(t=n,0===mn&&Ln(Qt)),t}function sa(){let t,r,a,o;if(t=un,r=Fn(),r!==n&&(ln=t),t=r,t===n)if(t=un,96===e.charCodeAt(un)?(r=Ie,un++):(r=n,0===mn&&Ln(Xt)),r!==n){if(a=[],o=e.charAt(un),_e.test(o)?un++:(o=n,0===mn&&Ln(en)),o!==n)for(;o!==n;)a.push(o),o=e.charAt(un),_e.test(o)?un++:(o=n,0===mn&&Ln(en));else a=n;a!==n?(96===e.charCodeAt(un)?(o=Ie,un++):(o=n,0===mn&&Ln(Xt)),o!==n?(ln=t,t=function(e){return e.join("")}(a)):(un=t,t=n)):(un=t,t=n)}else un=t,t=n;return t}function ua(e,t,n,r,a){const o={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(o.escape=r),o}function la(e,...t){return{type:"expression-list",location:e,value:t}}function ca(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=ua(e,n,r,void 0,{...n.location,end:a});return n}fn=o();const fa=fn!==n&&un===e.length;function da(){throw fn!==n&&un<e.length&&Ln({type:"end"}),function(e,t,n){return new W(W.buildMessage(e,t),e,t,n)}(pn,dn<e.length?function(t=un){const n=e.codePointAt(t);return void 0===n?"":String.fromCodePoint(n)}(dn):null,dn<e.length?yn(dn,dn+1):yn(dn,dn))}return t.peg$library?{peg$result:fn,peg$currPos:un,peg$FAILED:n,peg$maxFailExpected:pn,peg$maxFailPos:dn,peg$success:fa,peg$throw:fa?void 0:da}:fa?fn:void da()}class G{static parse(e){return B(e)}}function J(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":J(e.operand,t),J(e.value,t);break;case"case-expression":for(const n of e.clauses)J(n,t);"simple"===e.format&&J(e.operand,t),null!==e.else&&J(e.else,t);break;case"expression-list":for(const n of e.value)J(n,t);break;case"unary-expression":J(e.expr,t);break;case"binary-expression":J(e.left,t),J(e.right,t);break;case"function":J(e.args,t);break;case"interval":J(e.value,t),J(e.qualifier,t);break;case"interval-qualifier":J(e.start,t),J(e.end,t)}}const Q=new Set(["current_timestamp","current_date","current_time"]);class X{constructor(e){this.staticData=e}makeBool(e){return fe(e)}featureValue(e,t,n,r){return Te(e,t,n,r)}equalsNull(e){return null===e}applyLike(e,t,n){return Le(e,t,n)}ensureArray(e){return de(e)}applyIn(e,t){return we(e,t)}currentTimestamp(e){return ve(e)}currentDate(e){return Ie(e)}currentTime(e){return ge(e)}makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}compare(e,t,n){return k(t,n,e)}calculate(e,t,n,r){return Y(e,t,n,r)}evaluateTime(e){return D(e)}evaluateTimestamp(e,t,n){return _(e,t,n)}evaluateDate(e,t){return M(e,t)}evaluateFunction(e,t,n){return H(e,t,n)}lookup(e,t){const n=t[e];return void 0===n?null:n}between(e,t){return null==e||null==t[0]||null==t[1]?null:k(e,t[0],">=")&&k(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:k(e,t[0],"<")||k(e,t[1],">")}ternaryNot(e){return pe(e)}ternaryAnd(e,t){return me(e,t)}ternaryOr(e,t){return he(e,t)}}function ee(e,...t){return`this.${e}(${t.join(", ")})`}function te(e){return void 0===e?"void 0":JSON.stringify(e)}function ne({type:e,period:t,precision:n,secondary:r}){return JSON.stringify({type:e,period:t,precision:n,secondary:r})}const re="feature",ae="lookups",oe="attributeAdapter",ie="fieldsIndex",se="timeZone",ue="currentUser";class le{constructor(e){this._parseTree=e,this._staticData=Object.create(null),this._nextStaticDataId=0,this._tempVars=new Set,this._nextTempVarId=0}compile(){const e=this._compileNode(this._parseTree),t=`\n ${this._tempVars.size>0?`var ${Array.from(this._tempVars).join(", ")};`:""}\n return this.convertInterval(${e});\n `;return new Function(re,ae,oe,ie,se,ue,t).bind(new X(this._staticData))}_storeStaticData(e){const t="static$"+this._nextStaticDataId++;return this._staticData[t]=e,t}_compileRefStaticData(e){return`this.staticData[${te(e)}]`}_generateTempVar(){const e="temp$"+this._nextTempVarId++;return this._tempVars.add(e),e}_compileSimpleCase(e){const t=this._compileNode(e.operand),n=this._generateTempVar(),r=[];for(const t of e.clauses){const e=ee("compare",te("="),n,this._compileNode(t.operand)),a=this._compileNode(t.value);r.push(`${e} ? (${a}) :`)}return null!=e.else?r.push(this._compileNode(e.else)):r.push(te(null)),`(${n} = ${t}, ${r.join(" ")})`}_compileSearchedCase(e){const t=[];for(const n of e.clauses){const e=ee("makeBool",this._compileNode(n.operand)),r=this._compileNode(n.value);t.push(`${e} ? (${r}) :`)}return null!=e.else?t.push(this._compileNode(e.else)):t.push(te(null)),t.join(" ")}_compileInExpr(e,t){const n=new Set,r=[];for(const e of t.value)"number"===e.type||"string"===e.type?n.add(e.value):r.push(e);const a=this._compileNode(e),o=ee("ensureArray",this._compileNode({type:"expression-list",location:t.location,value:r}));if(n.size>0){const e=this._compileRefStaticData(this._storeStaticData(n)),t=this._generateTempVar();return r.length>0?`(${t} = ${a}, ${e}.has(${t}) || ${ee("applyIn",t,o)})`:`(${t} = ${a}, ${t} == null ? null : ${e}.has(${t}))`}return ee("applyIn",a,o)}_compileNode(e){switch(e.type){case"interval":return ee("makeSqlInterval",this._compileNode(e.value),"interval-qualifier"===e.qualifier.type?function({type:e,start:t,end:n}){return`{type: ${te(e)}, start: ${ne(t)}, end: ${ne(n)}}`}(e.qualifier):ne(e.qualifier),te(e.op));case"case-expression":return"simple"===e.format?this._compileSimpleCase(e):this._compileSearchedCase(e);case"parameter":return ee("lookup",te(e.value.toLowerCase()),ae);case"expression-list":return`[${e.value.map(e=>this._compileNode(e)).join(", ")}]`;case"unary-expression":return ee("ternaryNot",this._compileNode(e.expr));case"binary-expression":switch(e.operator){case"AND":return ee("ternaryAnd",this._compileNode(e.left),this._compileNode(e.right));case"OR":return ee("ternaryOr",this._compileNode(e.left),this._compileNode(e.right));case"IS":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return ee("equalsNull",this._compileNode(e.left));case"ISNOT":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return`!${ee("equalsNull",this._compileNode(e.left))}`;case"IN":return this._compileInExpr(e.left,e.right);case"NOT IN":return ee("ternaryNot",this._compileInExpr(e.left,e.right));case"BETWEEN":return ee("between",this._compileNode(e.left),this._compileNode(e.right));case"NOTBETWEEN":return ee("notbetween",this._compileNode(e.left),this._compileNode(e.right));case"LIKE":return ee("applyLike",this._compileNode(e.left),this._compileNode(e.right),te(e.escape));case"NOT LIKE":return ee("ternaryNot",ee("applyLike",this._compileNode(e.left),this._compileNode(e.right),te(e.escape)));case"<>":case"<":case">":case">=":case"<=":case"=":return ee("compare",te(e.operator),this._compileNode(e.left),this._compileNode(e.right));case"*":case"-":case"+":case"/":case"||":return ee("calculate",te(e.operator),this._compileNode(e.left),this._compileNode(e.right),se);default:throw new i.L("UnsupportedOperator",{operator:e.operator})}case"null":case"boolean":case"string":case"number":return te(e.value);case"time":try{return this._compileRefStaticData(this._storeStaticData(D(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(M(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(_(e.value,"unknown")))}catch{return ee("evaluateTimestamp",te(e.value),te("unknown"))}case"current-time":return"date"===e.mode?ee("currentDate",se):"time"===e.mode?ee("currentTime",se):ee("currentTimestamp",se);case"current-user":return ue;case"column-reference":return ee("featureValue",re,te(e.column),ie,oe);case"data-type":return function({type:e,size:t,withtimezone:n}){return JSON.stringify({type:e,size:t,withtimezone:n})}(e.value);case"function":return ee("evaluateFunction",te(e.name),this._compileNode(e.args),se)}throw new i.L("UnsupportedSyntax",{node:e.type})}}class ce{static create(e,t={}){return new ce(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}constructor(e,t,n="UTC",r=null){this.fieldsIndex=t,this.timeZone=n,this.currentUser=r,this.parameters={},this._compiledExecutor=null,this._hasDateFunctions=void 0,this.parseTree=G.parse(e);const{isStandardized:a,isAggregate:o,currentUserRequired:i,referencedFieldNames:s}=this._extractExpressionInfo(t);this._referencedFieldNames=s,this.isStandardized=a,this.isAggregate=o,this.currentUserRequired=i}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,A.$P)(e)?e.getTime():E(e)?e.toMillis():C(e)?e.toStorageFormat():x(e)?e.toStorageString():S(e)?e.toStorageFormat():e;switch(t){case"date":return(0,A.$P)(e)?e.getTime():E(e)?e.toMillis():C(e)?e.toMilliseconds():S(e)?e.toNumber():e;case"date-only":return(0,A.$P)(e)?o.n.fromDateJS(e).toString():C(e)?o.n.fromSqlTimeStampOffset(e).toString():E(e)?o.n.fromDateTime(e).toString():e;case"time-only":return(0,A.$P)(e)?d.k.fromDateJS(e).toStorageString():E(e)?d.k.fromDateTime(e).toStorageString():C(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():x(e)?e.toStorageString():e;case"timestamp-offset":if((0,A.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(E(e))return f.g.fromDateTime(e).toStorageFormat();if(C(e))return e.toStorageFormat()}return e}get fieldNames(){return this._referencedFieldNames}testSet(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=Ne,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}tryGetCompiledExecutor(){if(null!=this._compiledExecutor)return this._compiledExecutor;if((0,r.A)("esri-csp-restrictions"))return null;const e=new le(this.parseTree);return this._compiledExecutor=e.compile(),this._compiledExecutor}calculateValueCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.calculateValue(e,t):r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}testFeature(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.testFeature(e,t):!!r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,J(this.parseTree,e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||Q.has(e.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const e=new Set;return J(this.parseTree,t=>{"function"===t.type&&e.add(t.name.toLowerCase())}),Array.from(e)}getExpressions(){const e=new Map;return J(this.parseTree,t=>{if("function"===t.type){const n=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,a=`${n}-${t}`;e.has(a)||e.set(a,{aggregateType:n,field:t})}}}),[...e.values()]}getVariables(){const e=new Set;return J(this.parseTree,t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())}),Array.from(e)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,o=!1,i=!1;return J(this.parseTree,s=>{switch(s.type){case"column-reference":{const r=e?.get(s.column);let a,o;r?a=o=r.name??"":(o=s.column,a=o.toLowerCase()),n.has(a)||(n.add(a),t.push(o)),s.column=o;break}case"current-user":i=!0;break;case"function":{const{name:e,args:t}=s,n=t.value.length;r&&(r=function(e,t){const n=Z[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===o&&(o=(0,a.M)(e,n));break}}}),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:o,currentUserRequired:i}}_evaluateNode(e,t,n,r,o){let s;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,o);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,o);for(let i=0;i<e.clauses.length;i++)if(k(a,this._evaluateNode(e.clauses[i].operand,t,n,r,o),"="))return this._evaluateNode(e.clauses[i].value,t,n,r,o);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,o)}else{for(let a=0;a<e.clauses.length;a++)if(fe(this._evaluateNode(e.clauses[a].operand,t,n,r,o)))return this._evaluateNode(e.clauses[a].value,t,n,r,o);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,o)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],(0,A.$P)(s)?m.c9.fromJSDate(s):null!=s&&"object"==typeof s&&"toDateTime"in s?s.toDateTime():s;case"expression-list":{const a=[];for(const i of e.value)a.push(this._evaluateNode(i,t,n,r,o));return a}case"unary-expression":return pe(this._evaluateNode(e.expr,t,n,r,o));case"binary-expression":switch(e.operator){case"AND":return me(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o));case"OR":return he(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o));case"IS":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return null===this._evaluateNode(e.left,t,n,r,o);case"ISNOT":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return null!==this._evaluateNode(e.left,t,n,r,o);case"IN":{const a=de(this._evaluateNode(e.right,t,n,r,o));return we(this._evaluateNode(e.left,t,n,r,o),a)}case"NOT IN":{const a=de(this._evaluateNode(e.right,t,n,r,o));return pe(we(this._evaluateNode(e.left,t,n,r,o),a))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,o),i=this._evaluateNode(e.right,t,n,r,o);return null==a||null==i[0]||null==i[1]?null:k(a,i[0],">=")&&k(a,i[1],"<=")}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,o),i=this._evaluateNode(e.right,t,n,r,o);return null==a||null==i[0]||null==i[1]?null:k(a,i[0],"<")||k(a,i[1],">")}case"LIKE":return Le(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),e.escape);case"NOT LIKE":return pe(Le(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return k(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),e.operator);case"-":case"+":case"*":case"/":case"||":return Y(e.operator,this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=_(e.value,"unknown"),e.parsedValue;case"time":return D(e.value);case"current-time":return"date"===e.mode?Ie(this.timeZone):"time"===e.mode?ge(this.timeZone):ve(this.timeZone);case"current-user":return o??null;case"column-reference":return Te(t,e.column,this.fieldsIndex,n);case"data-type":return e.value;case"function":{if(this.isAggregate&&(0,a.M)(e.name,e.args.value.length)){const t=[];for(const a of e.args?.value||[]){const e=[];for(const t of r||[])e.push(this._evaluateNode(a,t,n,null,o));t.push(e)}return(0,a.s)(e.name,t)}const i=this._evaluateNode(e.args,t,n,r,o);return H(e.name,i,this.timeZone)}}throw new i.L("UnsupportedSyntax",{node:e.type})}}function fe(e){return!0===e}function de(e){return Array.isArray(e)?e:[e]}function pe(e){return null!==e?!0!==e:null}function me(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function he(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function we(e,t){if(null==e)return null;let n=!1;for(const r of t)if(null==r)n=null;else{if(e===r){n=!0;break}if($(e)&&$(r)&&(n=k(e,r,"="),n))break}return n}function ve(e){return N(new Date,e)}function Ie(e){return o.n.fromNow(e)}function ge(e){const t=N(new Date,e);return d.k.fromDateTime(t)}const ye="-[]/{}()*+?.\\^$|";function Le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=0;for(let t=0;t<e.length;t++){const o=e.charAt(t);switch(a){case 0:o===n?a=1:ye.includes(o)?r+="\\"+o:r+="%"===o?".*":"_"===o?".":o;break;case 1:ye.includes(o)?r+="\\"+o:r+=o,a=0}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Te(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t);if(null==a)return a;const i=n?.get(t);switch(i?.type){case"esriFieldTypeDate":case"date":return N(new Date(a),n?.getLuxonTimeZone(i.name)??m.mQ.utcInstance);case"esriFieldTypeDateOnly":case"date-only":return o.n.fromReader(a);case"esriFieldTypeTimeOnly":case"time-only":return d.k.fromReader(a);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return new f.g(a)}return a}const Ne={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}}}]);