@arcgis/core 4.33.0-next.20250228 → 4.33.0-next.20250301

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 (292) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/066844a51cd22cbef0e6.js +1 -0
  3. package/assets/esri/core/workers/chunks/0ce1bfcdcccb679569f8.js +1 -0
  4. package/assets/esri/core/workers/chunks/0e164b19e4ea3aa73843.js +1 -0
  5. package/assets/esri/core/workers/chunks/12d798775a96a45aada2.js +1 -0
  6. package/assets/esri/core/workers/chunks/{f298cda10a9ffe35ea49.js → 1377ddd582518e5fa051.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{95a5ed95f0060b43f38f.js → 15fe629cd4da1bb2169f.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1a5f96b1b892ecceb36a.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b4002b4fd99748fdf5da.js → 1e631e34ee495eb0e76e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/22618753349eb9d8b3df.js +1 -0
  11. package/assets/esri/core/workers/chunks/25a686f00479ac12a1ca.js +1 -0
  12. package/assets/esri/core/workers/chunks/25ef080163f3f795911a.js +1 -0
  13. package/assets/esri/core/workers/chunks/{afdbdc1569b56489c14d.js → 29fe3e9a0ecab74bb729.js} +1 -1
  14. package/assets/esri/core/workers/chunks/2c091edee3601f345f5f.js +1 -0
  15. package/assets/esri/core/workers/chunks/2f23fc27d005ffa18f47.js +1 -0
  16. package/assets/esri/core/workers/chunks/2f818b9a6b1f2b61410d.js +978 -0
  17. package/assets/esri/core/workers/chunks/3010a22d00f45fce5939.js +1 -0
  18. package/assets/esri/core/workers/chunks/{05869484d7de75f86916.js → 33005043f7084048296d.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{835fa4484c58d9b31c78.js → 3315de71eb8791189c05.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{f7a055be225f3498baaf.js → 354117429b3a0a0794c9.js} +1 -1
  21. package/assets/esri/core/workers/chunks/361a3253877acd3b4f07.js +1 -0
  22. package/assets/esri/core/workers/chunks/{53bc621e2cbc519b2535.js → 36b406131cd864567033.js} +1 -1
  23. package/assets/esri/core/workers/chunks/385dd6466fd967ce3ae9.js +1 -0
  24. package/assets/esri/core/workers/chunks/394b9723d108cff7136e.js +1 -0
  25. package/assets/esri/core/workers/chunks/4395b7263a299a8020d4.js +1 -0
  26. package/assets/esri/core/workers/chunks/47c04980098dc0c228d7.js +1 -0
  27. package/assets/esri/core/workers/chunks/{d6ee6ebdaf582f39c14b.js → 4c8164955f8d844c09ee.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{e4d7f1e685f69b3bf54d.js → 4c9160e3d596fe75392d.js} +1 -1
  29. package/assets/esri/core/workers/chunks/534f3d7e4300b662191a.js +1 -0
  30. package/assets/esri/core/workers/chunks/55c7c51e56d72f507c22.js +1 -0
  31. package/assets/esri/core/workers/chunks/5802406d0a239a27a9a3.js +1 -0
  32. package/assets/esri/core/workers/chunks/6ce738960ee47904968f.js +314 -0
  33. package/assets/esri/core/workers/chunks/{b12f2eaa15f6753fa1a8.js → 6ff981ec0c725efe5525.js} +1 -1
  34. package/assets/esri/core/workers/chunks/7ca33e03a2fd217b9443.js +1 -0
  35. package/assets/esri/core/workers/chunks/7d93ff4f18fd21c7b9f2.js +1 -0
  36. package/assets/esri/core/workers/chunks/{983d787730bf8b74fe13.js → 7ec2f531217718e76469.js} +1 -1
  37. package/assets/esri/core/workers/chunks/8196ff250c0de00104f7.js +1 -0
  38. package/assets/esri/core/workers/chunks/{ae25c6108918d37e61bf.js → 8278d9263e9b7e3bf2d1.js} +1 -1
  39. package/assets/esri/core/workers/chunks/852c32b5e717c54e3ae0.js +1 -0
  40. package/assets/esri/core/workers/chunks/856b03020b2dd047291d.js +1 -0
  41. package/assets/esri/core/workers/chunks/85a9025c2990a8bbd61b.js +1 -0
  42. package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +1 -0
  43. package/assets/esri/core/workers/chunks/8bf623f560b1ed440004.js +1 -0
  44. package/assets/esri/core/workers/chunks/8d421e0a01e2c3f6980c.js +1 -0
  45. package/assets/esri/core/workers/chunks/{f27828ba83846d686072.js → 97078a7871e243c19b6b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/a68b48fd1a529f69705e.js +1 -0
  47. package/assets/esri/core/workers/chunks/{272662e4e28341419b4f.js → a73a262ddc959a59819f.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{4253438dd3045566892d.js → aba4353892c47de98eb3.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{14cb593dfb50c724b9eb.js → ac6b582ca180210e596c.js} +1 -1
  50. package/assets/esri/core/workers/chunks/af27a3f646a4404d3b8d.js +1 -0
  51. package/assets/esri/core/workers/chunks/{fc07d47d44c04f123650.js → b1e275607d9754079f60.js} +1 -1
  52. package/assets/esri/core/workers/chunks/b3c126e8a0a722c03efc.js +1 -0
  53. package/assets/esri/core/workers/chunks/b464b7800a2ddd92b9a7.js +1 -0
  54. package/assets/esri/core/workers/chunks/b52a3a48d2d3ff22542d.js +1 -0
  55. package/assets/esri/core/workers/chunks/be883ebdbaf11647b718.js +1 -0
  56. package/assets/esri/core/workers/chunks/bf9b45604249520b596a.js +1 -0
  57. package/assets/esri/core/workers/chunks/c0400c25c53fd90fc90e.js +1 -0
  58. package/assets/esri/core/workers/chunks/c2939e0c45a6d074cac0.js +1 -0
  59. package/assets/esri/core/workers/chunks/{fccf505dbd98e59e721a.js → c3dc8d1958ddc71e1129.js} +1 -1
  60. package/assets/esri/core/workers/chunks/c68c68e918c72932b247.js +1 -0
  61. package/assets/esri/core/workers/chunks/c8cd9a3175f516624842.js +1 -0
  62. package/assets/esri/core/workers/chunks/cc1aedb2b3aa3854b0de.js +1 -0
  63. package/assets/esri/core/workers/chunks/d374d2a1487faee3672d.js +1 -0
  64. package/assets/esri/core/workers/chunks/d630e64463687090db92.js +1 -0
  65. package/assets/esri/core/workers/chunks/dbdca19978fbee8dc106.js +1 -0
  66. package/assets/esri/core/workers/chunks/ddfb5a2055a36576ba0d.js +1 -0
  67. package/assets/esri/core/workers/chunks/e1a90f63d2e6c761953b.js +1 -0
  68. package/assets/esri/core/workers/chunks/{5b5d89b94e020b4bfcc1.js → e3b0bb6850d5252d5f24.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{4235bb1334c95f3c828d.js → e45404a982e173459990.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{b7a3d9c5d18e59da378f.js → eab1e3c101158675abba.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{8a3290ee6e6587fa39a6.js → ed4afafbcb31491c2049.js} +1 -1
  72. package/assets/esri/core/workers/chunks/ef46613c3aa363dc1cfc.js +1 -0
  73. package/assets/esri/core/workers/chunks/{6c5877e4ad108a6d074e.js → f0351930cbb3d8643119.js} +1 -1
  74. package/assets/esri/core/workers/chunks/f31986ea5cadfade8344.js +1 -0
  75. package/assets/esri/core/workers/chunks/f350aefc5e348ebad1da.js +1 -0
  76. package/assets/esri/core/workers/chunks/{a2e52b40eeeda4282c07.js → f70dd16f14279bb7e60d.js} +1 -1
  77. package/assets/esri/core/workers/chunks/f995a74bd9b58c069c07.js +1 -0
  78. package/assets/esri/core/workers/chunks/{7437b7423c8b7fb4f0dd.js → fe3ed029b07bb1e4aef3.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{e6e6247ea5ce0c2b125f.js → fe8ee1938d196a70d809.js} +1 -1
  80. package/assets/esri/themes/base/widgets/_LabeledSwitch.scss +0 -2
  81. package/assets/esri/themes/dark/main.css +1 -1
  82. package/assets/esri/themes/light/main.css +1 -1
  83. package/assets/esri/themes/light/view.css +1 -1
  84. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  88. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  89. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  90. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  91. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  92. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  93. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  123. package/chunks/Envelope.js +1 -1
  124. package/chunks/{GeodeticDistanceCalculator-D4iQ-_NX.js → GeodeticDistanceCalculator-CcF1gMZX.js} +1 -1
  125. package/chunks/LineSeries.js +1 -1
  126. package/chunks/OperatorGeodeticArea.js +1 -1
  127. package/chunks/OperatorGeodeticDistance.js +1 -1
  128. package/chunks/OperatorProximityGeodesic.js +1 -1
  129. package/chunks/Point2D.js +1 -1
  130. package/chunks/ProjectionTransformation.js +1 -1
  131. package/chunks/QuadraticBezier.js +1 -1
  132. package/chunks/Theme.js +1 -1
  133. package/chunks/chartUtilsAm5.js +1 -1
  134. package/chunks/distanceOperator.js +1 -1
  135. package/core/timeUtils.js +1 -1
  136. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  137. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  138. package/editing/sharedTemplates/support/sharedTemplateErrors.js +1 -1
  139. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  140. package/editing/templateUtils.js +1 -1
  141. package/geometry/operators/extendOperator.js +1 -1
  142. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  143. package/geometry/operators/gx/operatorBuffer.js +1 -1
  144. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  145. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  146. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  147. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  148. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  149. package/geometry/operators/isNearOperator.js +1 -1
  150. package/geometry/operators/support/jsonConverter.js +1 -1
  151. package/geometry/support/PolylineBuilder.js +5 -0
  152. package/geometry/support/TileClipper.js +1 -1
  153. package/interfaces.d.ts +9 -9
  154. package/intl/date.js +1 -1
  155. package/layers/graphics/sources/WFSSource.js +1 -1
  156. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  157. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  158. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  159. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  160. package/layers/mixins/ImageryTileMixin.js +1 -1
  161. package/layers/ogc/ogcFeatureUtils.js +1 -1
  162. package/layers/support/FieldsIndex.js +1 -1
  163. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  164. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  165. package/networks/support/UtilityNetworkLookupHelper.js +5 -0
  166. package/package.json +2 -2
  167. package/smartMapping/support/utils.js +1 -1
  168. package/support/guards.js +1 -1
  169. package/support/revision.js +1 -1
  170. package/symbols/cim/CIMOperators.js +1 -1
  171. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  172. package/symbols/cim/defaultCIMValues.js +1 -1
  173. package/symbols/cim/effects/EffectEnclosingPolygon.js +5 -0
  174. package/symbols/cim/effects/EffectRadial.js +5 -0
  175. package/symbols/cim/effects/EffectTaperedPolygon.js +5 -0
  176. package/symbols/cim/utils.js +1 -1
  177. package/time/TimeExtent.js +1 -1
  178. package/time/constants.js +5 -0
  179. package/time/timeZoneUtils.js +1 -1
  180. package/views/2d/engine/webgl/TextureManager.js +1 -1
  181. package/views/2d/engine/webgl/Utils.js +1 -1
  182. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  184. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  186. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  187. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  190. package/views/2d/engine/webgl/textureUtils.js +5 -0
  191. package/views/2d/engine/webgl/urlUtils.js +5 -0
  192. package/views/2d/layers/MediaLayerView2D.js +1 -1
  193. package/views/2d/layers/TileLayerView2D.js +1 -1
  194. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  195. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  196. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  197. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  198. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  199. package/views/3d/terrain/TileRenderer.js +1 -1
  200. package/views/3d/webgl-engine/lib/TextureCompressionWorkerHandle.js +1 -1
  201. package/views/VideoView.js +1 -1
  202. package/views/View.js +1 -1
  203. package/views/support/TextureCompressionHelper.js +1 -1
  204. package/views/webgl/Texture.js +1 -1
  205. package/webmap/InitialViewProperties.js +1 -1
  206. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  207. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  208. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  209. package/widgets/Bookmarks.js +1 -1
  210. package/widgets/Directions/DirectionsViewModel.js +1 -1
  211. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  212. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  213. package/widgets/Feature/FeatureViewModel.js +1 -1
  214. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  215. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  216. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  217. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  218. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  219. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  220. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  221. package/widgets/FeatureTable/FieldColumn.js +1 -1
  222. package/widgets/Features/FeaturesViewModel.js +1 -1
  223. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  224. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  225. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  226. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  227. package/widgets/OrientedImageryViewer.js +1 -1
  228. package/widgets/TimeSlider.js +1 -1
  229. package/widgets/TimeZoneLabel.js +1 -1
  230. package/widgets/support/LabeledSwitch.js +1 -1
  231. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +5 -0
  232. package/widgets/support/UtilityNetworkAssociations/utils/formatPercentAlong.js +5 -0
  233. package/widgets/support/UtilityNetworkAssociations/utils/getAssociationTitle.js +5 -0
  234. package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +5 -0
  235. package/widgets/support/UtilityNetworkAssociations/utils/isConnectivity.js +5 -0
  236. package/widgets/support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js +5 -0
  237. package/widgets/support/UtilityNetworkAssociations/utils/isFromElement.js +5 -0
  238. package/widgets/support/dateUtils.js +1 -1
  239. package/assets/esri/core/workers/chunks/0509af0f6c732a847531.js +0 -1
  240. package/assets/esri/core/workers/chunks/1461ca910c3dba1d808b.js +0 -1
  241. package/assets/esri/core/workers/chunks/19f45bb389daf866dbc5.js +0 -1
  242. package/assets/esri/core/workers/chunks/1c4cafb879f21a42f7db.js +0 -978
  243. package/assets/esri/core/workers/chunks/2626f4201deb7bdd4866.js +0 -1
  244. package/assets/esri/core/workers/chunks/2e1126a35976b2d48197.js +0 -1
  245. package/assets/esri/core/workers/chunks/2eadc555038a38afdc9c.js +0 -1
  246. package/assets/esri/core/workers/chunks/36f0446d9d47685b7ce0.js +0 -1
  247. package/assets/esri/core/workers/chunks/3cf3aa74541f0cfff94f.js +0 -1
  248. package/assets/esri/core/workers/chunks/3d46327469ed5170e83e.js +0 -1
  249. package/assets/esri/core/workers/chunks/440afa7d26e721af578a.js +0 -1
  250. package/assets/esri/core/workers/chunks/460e5f78574cc0d157af.js +0 -1
  251. package/assets/esri/core/workers/chunks/4de09a997691305415b1.js +0 -1
  252. package/assets/esri/core/workers/chunks/5066fc5257296d95fe60.js +0 -1
  253. package/assets/esri/core/workers/chunks/53315ca098d76d34cf00.js +0 -1
  254. package/assets/esri/core/workers/chunks/539190038ac552e5374c.js +0 -1
  255. package/assets/esri/core/workers/chunks/55162949a2b2c8e1c95c.js +0 -1
  256. package/assets/esri/core/workers/chunks/58853056c16f2b525a9e.js +0 -1
  257. package/assets/esri/core/workers/chunks/5af9737d0530ca17b771.js +0 -1
  258. package/assets/esri/core/workers/chunks/5c0dfc75a9b654e6fa25.js +0 -1
  259. package/assets/esri/core/workers/chunks/6245c51d1525767ce2fe.js +0 -1
  260. package/assets/esri/core/workers/chunks/6728185fdf53b4921bf8.js +0 -1
  261. package/assets/esri/core/workers/chunks/68cb0c3462c90f2d1538.js +0 -1
  262. package/assets/esri/core/workers/chunks/6affa0f3d5bb74c7a1db.js +0 -1
  263. package/assets/esri/core/workers/chunks/6e108fb9884139dd3b52.js +0 -314
  264. package/assets/esri/core/workers/chunks/6f9bfa6ed34ef6efcc6f.js +0 -1
  265. package/assets/esri/core/workers/chunks/70943dc884d9ba8045a2.js +0 -1
  266. package/assets/esri/core/workers/chunks/7fe799c1e60e23a976e9.js +0 -1
  267. package/assets/esri/core/workers/chunks/80395a1d8ae91ff3961b.js +0 -1
  268. package/assets/esri/core/workers/chunks/87b78e491c800c96b503.js +0 -1
  269. package/assets/esri/core/workers/chunks/8abd2235aa702d8b239f.js +0 -1
  270. package/assets/esri/core/workers/chunks/8bf29e5e4c93d85a6abf.js +0 -1
  271. package/assets/esri/core/workers/chunks/99838ad20c10aa5aa471.js +0 -1
  272. package/assets/esri/core/workers/chunks/9fb568d25ed4f4660963.js +0 -1
  273. package/assets/esri/core/workers/chunks/9ff9cf156d024ade068b.js +0 -1
  274. package/assets/esri/core/workers/chunks/a288c2474ef193f9fbd3.js +0 -1
  275. package/assets/esri/core/workers/chunks/a2d0f7d82630dd8efb9b.js +0 -1
  276. package/assets/esri/core/workers/chunks/a66c3866888bd7e415e8.js +0 -1
  277. package/assets/esri/core/workers/chunks/b3bbe6f569ab6a3777b5.js +0 -1
  278. package/assets/esri/core/workers/chunks/ba33405a524c6bb88656.js +0 -1
  279. package/assets/esri/core/workers/chunks/bb1fb9990f8bf5f7a05f.js +0 -1
  280. package/assets/esri/core/workers/chunks/c22664f9f2b4ba7fe3d4.js +0 -1
  281. package/assets/esri/core/workers/chunks/c83245257deb230f79c0.js +0 -1
  282. package/assets/esri/core/workers/chunks/d2f8eed0b5b7cbdcd182.js +0 -1
  283. package/assets/esri/core/workers/chunks/d56426def776aae6fac6.js +0 -1
  284. package/assets/esri/core/workers/chunks/e12882be1b6820b8e9e8.js +0 -1
  285. package/assets/esri/core/workers/chunks/e648f1c96edf44c781eb.js +0 -1
  286. package/assets/esri/core/workers/chunks/ef6e9dbfc9a5bd38a7b6.js +0 -1
  287. package/assets/esri/core/workers/chunks/f2723d0c9c8d8ff4ec70.js +0 -1
  288. package/assets/esri/core/workers/chunks/f45ef721d21388846101.js +0 -1
  289. package/assets/esri/core/workers/chunks/fdab6921d007929ab288.js +0 -1
  290. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +0 -5
  291. /package/chunks/{Bufferer-B-V7yYm-.js → Bufferer-CicaNej1.js} +0 -0
  292. /package/chunks/{Distance2DCalculator-Coa0qAFt.js → Distance2DCalculator-C1KHhZwD.js} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5455],{1262:(e,t,n)=>{n.d(t,{L8:()=>s,Z7:()=>r});var r,a,i=n(799);(a=r||(r={})).InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters";const o={[r.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[r.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[r.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[r.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[r.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[r.UnsupportedOperator]:"Unsupported operator - {operator}",[r.UnsupportedSyntax]:"Unsupported syntax - {node}",[r.UnsupportedSqlFunction]:"Sql function not found = {function}",[r.InvalidDataType]:"Invalid sql data type",[r.InvalidDate]:"Invalid date encountered",[r.InvalidOperator]:"Invalid operator encountered",[r.InvalidTime]:"Invalid time encountered",[r.IllegalInterval]:"Illegal interval",[r.FunctionNotRecognized]:"Function not recognized",[r.InvalidTimeStamp]:"Invalid timestamp encountered",[r.InvalidParameterCount]:"Invalid parameter count for call to {name}",[r.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[r.YearMonthIntervals]:"Year-Month Intervals not supported",[r.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.HC)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}},15032:(e,t,n)=>{n.d(t,{k:()=>u});var r=n(78502),a=n(73444),i=n(96285);function o(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let n="";for(const r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":n+=r;break;case"A":case"a":n+="a";break;default:n+=`'${r}'`}return n}const s="esri.core.sql.timeonly";class u{constructor(e,t,n,r){this._hour=e,this._minute=t,this._second=n,this._millisecond=r,this.declaredRootClass=s}static isTimeOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return u.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,r.Fq)(this.hour)&&(0,r.Fq)(this.minute)&&(0,r.Fq)(this.second)&&(0,r.Fq)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=o(e))?i.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,n,r){const a=new u(e,t,n,r);return a.isValid()?a:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),n=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),a=Math.floor(e%1e3);return new u(r,n,t,a)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];t?(t=o(t))&&n.push(t):null!==t&&""!==t||(n.push("HH:mm:ss"),n.push("HH:mm:ss.SSS"),n.push("hh:mm:ss a"),n.push("hh:mm:ss.SSS a"),n.push("HH:mm"),n.push("hh:mm a"),n.push("H:mm"),n.push("h:mm a"),n.push("H:mm:ss"),n.push("h:mm:ss a"),n.push("H:mm:ss.SSS"),n.push("h:mm:ss.SSS a"));for(const t of n){const n=i.c9.fromFormat(e,t);if(n.isValid)return new u(n.hour,n.minute,n.second,n.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.c9.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},44729:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(66131),a=n(73444),i=n(96285);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(n)||[])switch(r){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?t+=`'${r.slice(1,-1)}'`:t+=`'${r}'`}return t}const s="esri.core.sql.dateonly";class u{constructor(e,t,n){this._year=e,this._month=t,this._day=n,this.declaredRootClass=s}static isDateOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return u.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new u(this._year,this._month,this._day)}toDateTime(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";const n=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(n).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.c9.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.c9.fromMillis(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.c9.fromSeconds(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,n){const r=new u(e,t,n);return!1===r.isValid?null:r}static fromDateJS(e){return u.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return u.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];if(t)(t=o(t))&&n.push(t);else if(null===t||""===t){const t=i.c9.fromISO(e,{setZone:!0});return t.isValid?u.fromParts(t.year,t.month,t.day):null}for(const r of n){const n=i.c9.fromFormat(e,t??r);if(n.isValid)return new u(n.year,n.month,n.day)}return null}static fromNow(e="system"){const t=i.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new u(t.year,t.month,t.day)}}},55612:(e,t,n)=>{n.d(t,{g:()=>o});var r=n(96285);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const i="esri.core.sql.SqlTimeStampOffset";class o{constructor(e){this._timeStampOffset=e,this.declaredRootClass=i,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===i}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 o.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new o(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new o(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,i=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="";i<10&&(d="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+i.toString()}`;0!==s&&(m+="."+s.toString().padStart(3,"0"));const h=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new o(f+"T"+m+h)}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 o.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>u});var r=n(44729),a=n(1262),i=n(55612),o=n(15032),s=n(96285);function u(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L8(a.Z7.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.L8(a.Z7.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=>m(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>m(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.L8(a.Z7.InvalidValueForAggregateFunction);t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=h(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=>h(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const i=e[r];if(null!==i){if(!d(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function m(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)||o.k.isTimeOnly(u)?u.toNumber():s.c9.isDateTime(u)?u.toMillis():i.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 h(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.L8(a.Z7.InvalidValueForAggregateFunction);n+=(t-r)**2}return n/(e.length-1)}},78502:(e,t,n)=>{n.d(t,{Fq:()=>o,Yc:()=>a,Yq:()=>i});var r=n(5443);function a(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new r.A({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function i(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function o(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},88368:(e,t,n)=>{n.d(t,{A:()=>ce});var r=n(44208),a=n(74639),i=n(44729),o=n(1262);function s(e){if(null!==e.precision||null!==e.secondary)throw new o.L8(o.Z7.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 o.L8(o.Z7.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new o.L8(o.Z7.IllegalInterval);u(a,e)}else{if(!n.test(e))throw new o.L8(o.Z7.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 o.L8(o.Z7.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 o.L8(o.Z7.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 o.L8(o.Z7.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,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.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 o.L8(o.Z7.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 o.L8(o.Z7.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,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),u(a,t[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new o.L8(o.Z7.IllegalInterval);if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.minute=parseFloat(t[0]),u(a,t[1])}break;default:throw new o.L8(o.Z7.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),m=n(3330),h=n(96285);const p=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2})$/,w=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,I=/^(\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})$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,L=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function S(e,t){if(t instanceof h.bo)return t===m.GB.instance?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return h.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t})}}function N(e){return c.isInterval(e)}function O(e){return h.c9.isDateTime(e)}function C(e){return i.n.isDateOnly(e)}function D(e){return d.k.isTimeOnly(e)}function _(e){return f.g.isTimestampOffset(e)}function F(e){let t=p.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 o.L8(o.Z7.InvalidTime)}if(t=v.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 o.L8(o.Z7.InvalidTime)}if(t=w.exec(e),null!==t){const[,e,n,r,a]=t,i=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==i)return i;throw new o.L8(o.Z7.InvalidTime)}throw new o.L8(o.Z7.InvalidTime)}function M(e,t,n=!1){let r=y.exec(e);if(null!==r){const[,e,n,a,i,s,u,l]=r,c=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,m.Qo)(t)});if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,d]=r,m=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),parseInt(s,10),u?parseInt(u.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),0,0,"-"===s,parseInt(u,10),parseInt(l,10));if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=L.exec(e),null!==r){const[,e,n,a,i,s]=r,u=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:0},{zone:(0,m.Qo)(t)});if(!1===u.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return u}if(r=g.exec(e),null!==r){const[,e,n,a]=r,i=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,m.Qo)(t)});if(!1===i.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return i}throw new o.L8(o.Z7.InvalidTimeStamp)}function Z(e,t){const n=g.exec(e);if(null===n)try{return M(e,t)}catch{throw new o.L8(o.Z7.InvalidDate)}const[,r,a,s]=n,u=i.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(s,10));if(null===u)throw new o.L8(o.Z7.InvalidDate);return u}var x=n(34727),E=n(799),b=n(54218);function A(e){return!!O(e)||!!_(e)}function P(e){return!!(O(e)||C(e)||_(e)||D(e))}function $(e){if(O(e))return e.toMillis();if(C(e))return e.toNumber();if(_(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function R(e,t,n){if(null==e||null==t)return null;if((0,b.Et)(e)){if((0,b.Et)(t))return U(e,t,n);if((0,b.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(P(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator)}else if((0,b.Kg)(e)){if((0,b.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,b.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(O(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator)}else if(O(e)){if(A(t)){if((0,m.Y4)(e.zone)){if(h.c9.isDateTime(t)&&!(0,m.Y4)(t.zone))return k(e,t,n);if(f.g.isTimestampOffset(t))return k(e,t,n)}else if(h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)){if(!(0,m.Y4)(e.zone))return k(e,t,n);if(f.g.isTimestampOffset(e))return k(e,t,n)}return U($(e),$(t),n)}if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(_(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(O(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,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return U(e.toNumber(),t.toNumber(),n);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(D(e)){if(D(t))return U(e.toNumber(),t.toNumber(),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(A(t))throw new o.L8(o.Z7.InvalidOperator)}else if(_(e)){if(A(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):U($(e),$(t),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.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 k(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=V(e),a=V(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 V(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function z(e,t,n){const r=Y[e.toLowerCase()];if(null==r)throw new o.L8(o.Z7.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new o.L8(o.Z7.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t,n)}function q(e){return!((0,b.$P)(e)||C(e)||O(e)||D(e)||_(e))}function H(e){return C(e)||D(e)?e.toString():_(e)?e.toSQLValue():O(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,b.$P)(e)?H(h.c9.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,b.$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}else if(O(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(C(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(D(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(_(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}throw new o.L8(o.Z7.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,E.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 o.L8(o.Z7.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,x.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,b.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=>R(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 o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"smallint":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);if(e>32767||e<-32767)throw new o.L8(o.Z7.CannotCastValue);return e}case"float":case"real":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseFloat(n);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"time":return function(e){if((0,b.$P)(e))return d.k.fromDateJS(e);if(O(e))return d.k.fromDateTime(e);if(C(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e))return e;if(_(e))return d.k.fromSqlTimeStampOffset(e);if((0,b.Kg)(e))return F(e);throw new o.L8(o.Z7.CannotCastValue)}(n);case"date":return function(e){if((0,b.$P)(e))return i.n.fromDateJS(e);if(O(e))return i.n.fromParts(e.year,e.month,e.day);if(C(e))return e;if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e)&&null===i.n.fromParts(e.year,e.month,e.day))throw new o.L8(o.Z7.CannotCastValue);if((0,b.Kg)(e)){const t=i.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new o.L8(o.Z7.CannotCastValue)}(n);case"timestamp":return function(e,t,n){if((0,b.$P)(e))return S(e,t);if(O(e))return e;if(C(e))return e.toDateTimeLuxon("unknown");if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e))return e;if((0,b.Kg)(e))return M(e,"unknown",n);throw new o.L8(o.Z7.CannotCastValue)}(n,t,!0===r.withtimezone);case"varchar":{const e=H(n);if(e.length>r.size)throw new o.L8(o.Z7.CannotCastValue);return e}default:throw new o.L8(o.Z7.InvalidDataType)}}}};function K(e,t,n,r){if("||"===e)return z("concat",[t,n],r);if(null===t||null===n)return null;if((0,b.Et)(t)){if((0,b.Et)(n))return j(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return j(e,r,n)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}if(C(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(D(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(N(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(O(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(_(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if((0,b.Kg)(t)){if((0,b.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return j(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}throw new o.L8(o.Z7.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 o.L8(o.Z7.InvalidOperator)}function Q(e,t,n,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=t,a.found=n,a.location=r,a.name="SyntaxError",a}function J(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(Q,Error),Q.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n,r=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,u=J("",i.line.toString().length," "),l=r[a.line-1],c=(a.line===s.line?s.column:l.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+l+"\n"+u+" | "+J("",a.column-1," ")+J("",c,"^")}else t+="\n at "+o}return t},Q.buildMessage=function(e,t){var n={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return 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,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function i(e){return 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,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return n[e.type](e)}return"Expected "+function(e){var t,n,r=e.map(o);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."};class B{static parse(e){return function(e,t){var n,r={},a=(t=void 0!==t?t:{}).grammarSource,i={start:ni},o=ni,s="!",u="=",l=">=",c=">",f="<=",d="<>",m="!=",h="||",p="@",v="'",w="N'",g="''",y=".",I="null",T="true",L="false",S="in",N="is",O="like",C="escape",D="not",_="and",F="or",M="between",Z="from",x="for",E="substring",b="extract",A="trim",P="position",$="timestamp",R="date",U="time",k="leading",V="trailing",z="both",q="cast",H="as",Y="integer",K="int",j="smallint",J="float",B="real",G="varchar",W="to",X="interval",ee="year",te="timezone_hour",ne="timezone_minute",re="month",ae="day",ie="hour",oe="minute",se="second",ue="case",le="end",ce="when",fe="then",de="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ge=/^[+\-]/,ye=/^[*\/]/,Ie=/^[A-Za-z_\x80-\uFFFF]/,Te=/^[A-Za-z0-9_]/,Le=/^[A-Za-z0-9_.\x80-\uFFFF]/,Se=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,Ce=/^[eE]/,De=/^[ \t\n\r]/,_e=/^[^`]/,Fe=Ba("!",!1),Me=Ba("=",!1),Ze=Ba(">=",!1),xe=Ba(">",!1),Ee=Ba("<=",!1),be=Ba("<>",!1),Ae=Ga([["<","="]],!1,!1),Pe=Ba("!=",!1),$e=Ga(["+","-"],!1,!1),Re=Ba("||",!1),Ue=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ze=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),qe=Ga(['"'],!1,!1),He=Ba("@",!1),Ye=Ba("'",!1),Ke=Ba("N'",!1),je=Ba("''",!1),Qe=Ga(["'"],!0,!1),Je=Ba(".",!1),Be=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=Ba("NULL",!0),Xe=Ba("TRUE",!0),et=Ba("FALSE",!0),tt=Ba("IN",!0),nt=Ba("IS",!0),rt=Ba("LIKE",!0),at=Ba("ESCAPE",!0),it=Ba("NOT",!0),ot=Ba("AND",!0),st=Ba("OR",!0),ut=Ba("BETWEEN",!0),lt=Ba("FROM",!0),ct=Ba("FOR",!0),ft=Ba("SUBSTRING",!0),dt=Ba("EXTRACT",!0),mt=Ba("TRIM",!0),ht=Ba("POSITION",!0),pt=Ba("TIMESTAMP",!0),vt=Ba("DATE",!0),wt=Ba("TIME",!0),gt=Ba("LEADING",!0),yt=Ba("TRAILING",!0),It=Ba("BOTH",!0),Tt=Ba("CAST",!0),Lt=Ba("AS",!0),St=Ba("INTEGER",!0),Nt=Ba("INT",!0),Ot=Ba("SMALLINT",!0),Ct=Ba("FLOAT",!0),Dt=Ba("REAL",!0),_t=Ba("VARCHAR",!0),Ft=Ba("TO",!0),Mt=Ba("INTERVAL",!0),Zt=Ba("YEAR",!0),xt=Ba("TIMEZONE_HOUR",!0),Et=Ba("TIMEZONE_MINUTE",!0),bt=Ba("MONTH",!0),At=Ba("DAY",!0),Pt=Ba("HOUR",!0),$t=Ba("MINUTE",!0),Rt=Ba("SECOND",!0),Ut=Ba("CASE",!0),kt=Ba("END",!0),Vt=Ba("WHEN",!0),zt=Ba("THEN",!0),qt=Ba("ELSE",!0),Ht=Ba(",",!1),Yt=Ba("(",!1),Kt=Ba(")",!1),jt=Ga([" ","\t","\n","\r"],!1,!1),Qt=Ba("`",!1),Jt=Ga(["`"],!0,!1),Bt=function(e){return e},Gt=function(e){return{type:"expression-list",location:Qa(),value:e}},Wt=function(e,t,n){return{op:t,expr:n,location:Qa()}},Xt=function(e,t){return qo(e,t)},en=function(e,t,n){return{op:t,expr:n,location:Qa()}},tn=function(e,t){return qo(e,t)},nn=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,Qa())},rn=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?qo(e,t.tail):Vo(t.op,e,t.right,t.escape,Qa())},an=function(e,t){return{op:e,expr:t,location:Qa()}},on=function(e){return{type:"arithmetic",tail:e}},sn=function(e,t){return{op:e+"NOT",right:t}},un=function(e,t){return{op:e,right:t}},ln=function(e,t,n){return zo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},fn=function(e,t,n){return zo(Qa(),t,n)},dn=function(e,t){return{op:e,right:t}},mn=function(e){return e[0]+" "+e[2]},hn=function(e){return e[0]+" "+e[2]},pn=function(e,t,n){return{op:e,right:t,escape:n.value}},vn=function(e,t){return{op:e,right:t,escape:""}},wn=function(e,t){return{op:e,right:t}},gn=function(e,t){return{op:e,right:t}},yn=function(e,t,n){return{op:t,expr:n,location:Qa()}},In=function(e,t){return qo(e,t)},Tn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Ln=function(e,t){return qo(e,t)},Sn=function(e){return e.paren=!0,e},Nn=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:Qa(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:Qa(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:Qa(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:Qa()}:{type:"column-reference",location:Qa(),table:"",column:e}},On=function(e){return{type:"column-reference",location:Qa(),table:"",column:e,delimited:!0}},Cn=function(e){return e},Dn=function(e,t){return e+t.join("")},_n=function(e,t){return e+t.join("")},Fn=function(e){return e},Mn=function(e){return e.join("")},Zn=function(){return'"'},xn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return zo(Qa(),e,t)},bn=function(e,t){return zo(Qa(),e,t)},An=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return zo(Qa(),e,t,...n?[n]:[])},$n=function(e,t,n){return zo(Qa(),e,t,n)},Rn=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},Un=function(e,t){return zo(Qa(),e,t)},kn=function(e,t){return zo(Qa(),e,t)},Vn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},zn=function(){return{type:"data-type",location:Qa(),value:{type:"integer"}}},qn=function(){return{type:"data-type",location:Qa(),value:{type:"smallint"}}},Hn=function(){return{type:"data-type",location:Qa(),value:{type:"float"}}},Yn=function(){return{type:"data-type",location:Qa(),value:{type:"real"}}},Kn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},jn=function(){return{type:"data-type",location:Qa(),value:{type:"timestamp"}}},Qn=function(){return{type:"data-type",location:Qa(),value:{type:"time"}}},Jn=function(e){return{type:"data-type",location:Qa(),value:{type:"varchar",size:parseInt(e)}}},Bn=function(e,t,n){return zo(Qa(),e,t,n)},Gn=function(e,t){return zo(Qa(),e,t)},Wn=function(e){return{type:"function",location:Qa(),name:"trim",args:e}},Xn=function(e){return{type:"string",location:Qa(),value:e??"BOTH"}},er=function(e,t){return zo(Qa(),e,t)},tr=function(e,t){return zo(Qa(),e,t)},nr=function(e){return{type:"function",location:Qa(),name:"position",args:e}},rr=function(e,t){return{type:"function",location:Qa(),name:e,args:t}},ar=function(e){return{type:"string",location:Qa(),value:e}},ir=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)&&Ja("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:Qa(),value:e.value}},or=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)&&Ja("Time literal is invalid")}(e.value),{type:"time",location:Qa(),value:e.value}},sr=function(e,t,n){return{type:"interval",location:Qa(),value:t,qualifier:n,op:e}},ur=function(e,t){return{type:"interval",location:Qa(),value:e,qualifier:t,op:""}},lr=function(e,t){return{type:"interval-qualifier",location:Qa(),start:e,end:t}},cr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},fr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},mr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},hr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},pr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},vr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},wr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},gr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},yr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Ir=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Tr=function(){return{type:"string",location:Qa(),value:"day"}},Lr=function(){return{type:"string",location:Qa(),value:"hour"}},Sr=function(){return{type:"string",location:Qa(),value:"minute"}},Nr=function(){return{type:"string",location:Qa(),value:"month"}},Or=function(){return{type:"string",location:Qa(),value:"year"}},Cr=function(e){return parseFloat(e)},Dr=function(e){return parseFloat(e)},_r=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)&&Ja("Date literal is invalid")}(e.value),{type:"date",location:Qa(),value:e.value}},Fr=function(){return{type:"null",location:Qa(),value:null}},Mr=function(){return{type:"boolean",location:Qa(),value:!0}},Zr=function(){return{type:"boolean",location:Qa(),value:!1}},xr=function(){return"'"},Er=function(e){return{type:"string",location:Qa(),value:e.join("")}},br=function(e,t){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}},Ar=function(e,t,n){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}},Pr=function(e){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:null,elseLocation:null}},$r=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},Ur=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},Vr=function(e){return{type:"number",location:Qa(),value:e}},zr=function(e,t,n){return parseFloat(e+t+n)},qr=function(e,t){return parseFloat(e+t)},Hr=function(e,t){return parseFloat(e+t)},Yr=function(e){return parseFloat(e)},Kr=function(e,t){return e[0]+t},jr=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},Jr=function(e){return e.join("")},Br=function(e,t){return"e"+(null===t?"":t)},Gr=function(){return"IN"},Wr=function(){return"IS"},Xr=function(){return"LIKE"},ea=function(){return"ESCAPE"},ta=function(){return"NOT"},na=function(){return"AND"},ra=function(){return"OR"},aa=function(){return"BETWEEN"},ia=function(){return"FROM"},oa=function(){return"FOR"},sa=function(){return"SUBSTRING"},ua=function(){return"EXTRACT"},la=function(){return"TRIM"},ca=function(){return"POSITION"},fa=function(){return"TIMESTAMP"},da=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ga=function(){return"AS"},ya=function(){return"INTEGER"},Ia=function(){return"INT"},Ta=function(){return"SMALLINT"},La=function(){return"FLOAT"},Sa=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Ca=function(){return"INTERVAL"},Da=function(){return"YEAR"},_a=function(){return"TIMEZONE_HOUR"},Fa=function(){return"TIMEZONE_MINUTE"},Ma=function(){return"MONTH"},Za=function(){return"DAY"},xa=function(){return"HOUR"},Ea=function(){return"MINUTE"},ba=function(){return"SECOND"},Aa=function(){return"CASE"},Pa=function(){return"END"},$a=function(){return"WHEN"},Ra=function(){return"THEN"},Ua=function(){return"ELSE"},ka=function(e){return e},Va=function(e){return e.join("")},za=0|t.peg$currPos,qa=za,Ha=[{line:1,column:1}],Ya=za,Ka=t.peg$maxFailExpected||[],ja=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=i[t.startRule]}function Qa(){return Xa(qa,za)}function Ja(e,t){throw ti(e,t=void 0!==t?t:Xa(qa,za))}function Ba(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ga(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Wa(t){var n,r=Ha[t];if(r)return r;if(t>=Ha.length)n=Ha.length-1;else for(n=t;!Ha[--n];);for(r={line:(r=Ha[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return Ha[t]=r,r}function Xa(e,t,n){var r=Wa(e),i=Wa(t);return{source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}}}function ei(e){za<Ya||(za>Ya&&(Ya=za,Ka=[]),Ka.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=za,Ro(),(t=ai())!==r?(Ro(),qa=e,e=Bt(t)):(za=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=za,Po()!==r){for(Ro(),t=[],n=ai();n!==r;)t.push(n),n=za,a=za,i=Ro(),(o=Ao())!==r?a=i=[i,o,Ro()]:(za=a,a=r),a!==r&&(a=ai())===r?(za=n,n=r):n=a;n=Ro(),(a=$o())!==r?(qa=e,e=Gt(t)):(za=e,e=r)}else za=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=za,(t=ii())!==r){for(n=[],a=za,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=Xt(t,n)}else za=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=za,(t=oi())!==r){for(n=[],a=za,Ro(),(i=Bi())!==r?(Ro(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=Bi())!==r?(Ro(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=tn(t,n)}else za=e,e=r;return e}function oi(){var t,n,a,i,o;return t=za,(n=Ji())===r&&(n=za,33===e.charCodeAt(za)?(a=s,za++):(a=r,0===ja&&ei(Fe)),a!==r?(i=za,ja++,61===e.charCodeAt(za)?(o=u,za++):(o=r,0===ja&&ei(Me)),ja--,o===r?i=void 0:(za=i,i=r),i!==r?n=a=[a,i]:(za=n,n=r)):(za=n,n=r)),n!==r?(a=Ro(),(i=oi())!==r?(qa=t,t=nn(i)):(za=t,t=r)):(za=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=za,(t=ci())!==r?(n=za,Ro(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=za,t=[],n=za,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(qa=n,n=an(a,i)):(za=n,n=r)):(za=n,n=r),n!==r)for(;n!==r;)t.push(n),n=za,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(qa=n,n=an(a,i)):(za=n,n=r)):(za=n,n=r);else t=r;return t!==r&&(qa=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=za,(t=li())!==r?(Ro(),(n=ri())!==r?(qa=e,e=wn(t,n)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=li())!==r?(Ro(),(n=Li())!==r?(qa=e,e=gn(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=za,(t=Ji())!==r?(Ro(),(n=Wi())!==r?(a=Ro(),i=za,(o=ci())!==r?(Ro(),(s=Bi())!==r?(Ro(),(u=ci())!==r?(qa=i,i=ln(n,o,u)):(za=i,i=r)):(za=i,i=r)):(za=i,i=r),i!==r?(qa=e,e=cn(n,i)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Wi())!==r?(Ro(),n=za,(a=ci())!==r?(i=Ro(),(o=Bi())!==r?(Ro(),(s=ci())!==r?(qa=n,n=fn(t,a,s)):(za=n,n=r)):(za=n,n=r)):(za=n,n=r),n!==r?(qa=e,e=dn(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=za,(t=Ki())!==r?(Ro(),(n=Ji())!==r?(Ro(),(a=ci())!==r?(qa=e,e=sn(t,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Ki())!==r?(Ro(),(n=ci())!==r?(qa=e,e=un(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=za,(t=ui())!==r?(Ro(),(n=Zi())!==r?(Ro(),Qi()!==r?(Ro(),(a=xi())!==r?(qa=e,e=pn(t,n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=ui())!==r?(Ro(),(n=Zi())!==r?(qa=e,e=vn(t,n)):(za=e,e=r)):(za=e,e=r)),e}()),e}())!==r?n=a:(za=n,n=r),n===r&&(n=null),qa=e,e=rn(t,n)):(za=e,e=r),e}()),t}function si(){var t;return e.substr(za,2)===l?(t=l,za+=2):(t=r,0===ja&&ei(Ze)),t===r&&(62===e.charCodeAt(za)?(t=c,za++):(t=r,0===ja&&ei(xe)),t===r&&(e.substr(za,2)===f?(t=f,za+=2):(t=r,0===ja&&ei(Ee)),t===r&&(e.substr(za,2)===d?(t=d,za+=2):(t=r,0===ja&&ei(be)),t===r&&(t=e.charAt(za),we.test(t)?za++:(t=r,0===ja&&ei(Ae)),t===r&&(e.substr(za,2)===m?(t=m,za+=2):(t=r,0===ja&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=za,t=za,(n=Ji())!==r?(a=Ro(),(i=ji())!==r?t=n=[n,a,i]:(za=t,t=r)):(za=t,t=r),t!==r&&(qa=e,t=mn(t)),(e=t)===r&&(e=ji()),e}function li(){var e,t,n,a,i;return e=za,t=za,(n=Ji())!==r?(a=Ro(),(i=Yi())!==r?t=n=[n,a,i]:(za=t,t=r)):(za=t,t=r),t!==r&&(qa=e,t=hn(t)),(e=t)===r&&(e=Yi()),e}function ci(){var e,t,n,a,i,o;if(e=za,(t=di())!==r){for(n=[],a=za,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(qa=a,a=yn(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(qa=a,a=yn(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=In(t,n)}else za=e,e=r;return e}function fi(){var t;return t=e.charAt(za),ge.test(t)?za++:(t=r,0===ja&&ei($e)),t===r&&(e.substr(za,2)===h?(t=h,za+=2):(t=r,0===ja&&ei(Re))),t}function di(){var e,t,n,a,i,o;if(e=za,(t=hi())!==r){for(n=[],a=za,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(qa=a,a=Tn(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(qa=a,a=Tn(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=Ln(t,n)}else za=e,e=r;return e}function mi(){var t;return t=e.charAt(za),ye.test(t)?za++:(t=r,0===ja&&ei(Ue)),t}function hi(){var e,t;return(e=function(){var e;return(e=xi())===r&&(e=function(){var e,t,n,a;return e=za,(t=function(){var e,t,n,a;return e=za,(t=Pi())!==r&&(n=$i())!==r&&(a=Ri())!==r?(qa=e,e=zr(t,n,a)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(n=$i())!==r?(qa=e,e=qr(t,n)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(n=Ri())!==r?(qa=e,e=Hr(t,n)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(qa=e,t=Yr(t)),e=t))),e}())!==r?(n=za,ja++,a=vi(),ja--,a===r?n=void 0:(za=n,n=r),n!==r?(qa=e,e=Vr(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t;return e=za,(t=qi())!==r&&(qa=e,t=Mr()),(e=t)===r&&(e=za,(t=Hi())!==r&&(qa=e,t=Zr()),e=t),e}())===r&&(e=function(){var e,t;return e=za,(t=zi())!==r&&(qa=e,t=Fr()),t}())===r&&(e=function(){var e,t;return e=za,oo()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=_r(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t;return e=za,io()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=ir(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=Ci())===r&&(e=function(){var e,t;return e=za,so()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=or(t)):(za=e,e=r)):(za=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=za,no()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=En(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=bn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=An(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=za,to()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),i=za,eo()!==r?(o=Ro(),(s=ai())!==r?(Ro(),i=s):(za=i,i=r)):(za=i,i=r),i===r&&(i=null),$o()!==r?(qa=t,t=Pn(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),(i=Ao())!==r?(Ro(),(o=ai())!==r&&(s=$o())!==r?(qa=t,t=$n(n,a,o)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Rn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=za,ro()!==r?(Ro(),t=za,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Xi()!==r?(Ro(),(i=ai())!==r?(Ro(),$o()!==r?(qa=t,t=Bn(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=Gn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Wn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,ao()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Yi()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=er(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=tr(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=nr(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,fo()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),mo()!==r?(Ro(),(a=Si())!==r?(Ro(),$o()!==r?(qa=t,t=Un(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=Si())!==r?(Ro(),$o()!==r?(qa=t,t=kn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Vn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,t=za,ja++,n=no(),ja--,n===r?t=void 0:(za=t,t=r),t!==r&&(n=ko())!==r?(Ro(),(a=ri())!==r?(qa=e,e=rr(n,a)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=za,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);a!==r;)n.push(a),a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);(a=Zo())!==r?(qa=e,e=br(t,n)):(za=e,e=r)}else za=e,e=r;else za=e,e=r;if(e===r)if(e=za,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);a!==r;)n.push(a),a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);(a=Ai())!==r?(i=Ro(),Zo()!==r?(qa=e,e=Ar(t,n,a)):(za=e,e=r)):(za=e,e=r)}else za=e,e=r;else za=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=za,Mo()!==r){for(Ro(),t=[],n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);n!==r;)t.push(n),n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);(n=Zo())!==r?(qa=e,e=Pr(t)):(za=e,e=r)}else za=e,e=r;if(e===r)if(e=za,Mo()!==r){for(Ro(),t=[],n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);n!==r;)t.push(n),n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);(n=Ai())!==r?(a=Ro(),Zo()!==r?(qa=e,e=$r(t,n)):(za=e,e=r)):(za=e,e=r)}else za=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=za,(t=function(){var e,t;return e=za,(t=function(){var e,t,n,a;if(e=za,(t=vi())!==r){for(n=[],a=gi();a!==r;)n.push(a),a=gi();qa=e,e=Dn(t,n)}else za=e,e=r;return e}())!==r&&(qa=e,t=Cn(t)),t}())!==r&&(qa=e,t=Nn(t)),(e=t)===r&&(e=za,(t=function(){var e,t;return e=za,Ti()!==r?(t=function(){var e,t,n;for(e=za,t=[],n=yi();n!==r;)t.push(n),n=yi();return qa=e,Mn(t)}(),Ti()!==r?(qa=e,e=Fn(t)):(za=e,e=r)):(za=e,e=r),e}())!==r&&(qa=e,t=On(t)),e=t),e}())===r&&(e=Li())===r&&(e=za,Po()!==r?(Ro(),(t=ai())!==r?(Ro(),$o()!==r?(qa=e,e=Sn(t)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)),e}function pi(){var e,t,n,a;if(e=za,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();qa=e,e=_n(t,n)}else za=e,e=r;return e}function vi(){var t;return t=e.charAt(za),Ie.test(t)?za++:(t=r,0===ja&&ei(ke)),t}function wi(){var t;return t=e.charAt(za),Te.test(t)?za++:(t=r,0===ja&&ei(Ve)),t}function gi(){var t;return t=e.charAt(za),Le.test(t)?za++:(t=r,0===ja&&ei(ze)),t}function yi(){var e;return(e=Ii())===r&&(e=function(){var e;return e=za,Ti()!==r&&Ti()!==r?(qa=e,e=Zn()):(za=e,e=r),e}()),e}function Ii(){var t;return t=e.charAt(za),Le.test(t)?za++:(t=r,0===ja&&ei(ze)),t}function Ti(){var t;return t=e.charAt(za),Se.test(t)?za++:(t=r,0===ja&&ei(qe)),t}function Li(){var t,n,a,i;return t=za,n=za,64===e.charCodeAt(za)?(a=p,za++):(a=r,0===ja&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(za=n,n=r),n!==r&&(qa=t,n=xn(n)),n}function Si(){var e,t,n;return e=za,(t=ho())===r&&(t=po()),t!==r&&(qa=e,t=zn()),(e=t)===r&&(e=za,(t=vo())!==r&&(qa=e,t=qn()),(e=t)===r&&(e=za,(t=wo())!==r&&(qa=e,t=Hn()),(e=t)===r&&(e=za,(t=go())!==r&&(qa=e,t=Yn()),(e=t)===r&&(e=za,(t=oo())!==r&&(qa=e,t=Kn()),(e=t)===r&&(e=za,(t=io())!==r&&(qa=e,t=jn()),(e=t)===r&&(e=za,(t=so())!==r&&(qa=e,t=Qn()),(e=t)===r&&(e=za,(t=yo())!==r?(Ro(),Po()!==r?(Ro(),(n=Ui())!==r?(Ro(),$o()!==r?(qa=e,e=Jn(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)))))))),e}function Ni(){var e,t;return e=za,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),qa=e,Xn(t)}function Oi(){var e,t;return e=za,(t=Lo())===r&&(t=Oo())===r&&(t=Co())===r&&(t=Do())===r&&(t=_o())===r&&(t=Fo())===r&&(t=So())===r&&(t=No()),t!==r&&(qa=e,t=ar(t)),t}function Ci(){var t,n,a,i;return t=za,To()!==r?(Ro(),n=e.charAt(za),ge.test(n)?za++:(n=r,0===ja&&ei($e)),n!==r?(Ro(),(a=Zi())!==r?(Ro(),(i=Di())!==r?(qa=t,t=sr(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,To()!==r?(Ro(),(n=Zi())!==r?(Ro(),(a=Di())!==r?(qa=t,t=ur(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t}function Di(){var e,t,n;return e=za,(t=function(){var e,t,n;return e=za,(t=_i())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),$o()!==r?(qa=e,e=cr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=_i())!==r&&(qa=e,t=fr(t)),e=t),e}())!==r?(Ro(),Io()!==r?(Ro(),(n=function(){var e,t,n,a;return e=za,(t=_i())!==r&&(qa=e,t=dr(t)),(e=t)===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Ao()!==r?(Ro(),(a=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=mr(n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),$o()!==r?(qa=e,e=hr(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r&&(qa=e,t=pr()),e=t))),e}())!==r?(qa=e,e=lr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=za,(t=_i())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=vr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=_i())!==r&&(qa=e,t=wr(t)),(e=t)===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Ao()!==r?(Ro(),(a=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=gr(n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=yr(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r&&(qa=e,t=Ir()),e=t)))),e}()),e}function _i(){var e,t;return e=za,(t=Co())!==r&&(qa=e,t=Tr()),(e=t)===r&&(e=za,(t=Do())!==r&&(qa=e,t=Lr()),(e=t)===r&&(e=za,(t=_o())!==r&&(qa=e,t=Sr()),(e=t)===r&&(e=za,(t=Oo())!==r&&(qa=e,t=Nr()),(e=t)===r&&(e=za,(t=Lo())!==r&&(qa=e,t=Or()),e=t)))),e}function Fi(){var e,t;return e=za,(t=Ui())!==r&&(qa=e,t=Cr(t)),t}function Mi(){var e,t;return e=za,(t=Ui())!==r&&(qa=e,t=Dr(t)),t}function Zi(){var e;return(e=xi())===r&&(e=Li()),e}function xi(){var t,n,a,i,o;if(t=za,39===e.charCodeAt(za)?(n=v,za++):(n=r,0===ja&&ei(Ye)),n===r&&(e.substr(za,2)===w?(n=w,za+=2):(n=r,0===ja&&ei(Ke))),n!==r){for(a=[],i=za,e.substr(za,2)===g?(o=g,za+=2):(o=r,0===ja&&ei(je)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(za),Ne.test(i)?za++:(i=r,0===ja&&ei(Qe)));i!==r;)a.push(i),i=za,e.substr(za,2)===g?(o=g,za+=2):(o=r,0===ja&&ei(je)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(za),Ne.test(i)?za++:(i=r,0===ja&&ei(Qe)));39===e.charCodeAt(za)?(i=v,za++):(i=r,0===ja&&ei(Ye)),i!==r?(qa=t,t=Er(a)):(za=t,t=r)}else za=t,t=r;return t}function Ei(){var e,t,n;return e=za,xo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(qa=e,e=Rr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e}function bi(){var e,t,n;return e=za,xo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(qa=e,e=Ur(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e}function Ai(){var e,t;return e=za,bo()!==r?(Ro(),(t=ai())!==r?(qa=e,e=kr(t)):(za=e,e=r)):(za=e,e=r),e}function Pi(){var t,n,a;return(t=Ui())===r&&(t=za,n=e.charAt(za),ge.test(n)?za++:(n=r,0===ja&&ei($e)),n!==r&&(a=Ui())!==r?(qa=t,t=Kr(n,a)):(za=t,t=r)),t}function $i(){var t,n,a;return t=za,46===e.charCodeAt(za)?(n=y,za++):(n=r,0===ja&&ei(Je)),n!==r?((a=Ui())===r&&(a=null),qa=t,t=jr(a)):(za=t,t=r),t}function Ri(){var e,t,n;return e=za,(t=Vi())!==r&&(n=Ui())!==r?(qa=e,e=Qr(t,n)):(za=e,e=r),e}function Ui(){var e,t,n;if(e=za,t=[],(n=ki())!==r)for(;n!==r;)t.push(n),n=ki();else t=r;return t!==r&&(qa=e,t=Jr(t)),t}function ki(){var t;return t=e.charAt(za),Oe.test(t)?za++:(t=r,0===ja&&ei(Be)),t}function Vi(){var t,n,a;return t=za,n=e.charAt(za),Ce.test(n)?za++:(n=r,0===ja&&ei(Ge)),n!==r?(a=e.charAt(za),ge.test(a)?za++:(a=r,0===ja&&ei($e)),a===r&&(a=null),qa=t,t=Br(n,a)):(za=t,t=r),t}function zi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===I?za+=4:(n=r,0===ja&&ei(We)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function qi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===T?za+=4:(n=r,0===ja&&ei(Xe)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function Hi(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===L?za+=5:(n=r,0===ja&&ei(et)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function Yi(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===S?za+=2:(n=r,0===ja&&ei(tt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Gr()):(za=t,t=r)):(za=t,t=r),t}function Ki(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===N?za+=2:(n=r,0===ja&&ei(nt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Wr()):(za=t,t=r)):(za=t,t=r),t}function ji(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===O?za+=4:(n=r,0===ja&&ei(rt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Xr()):(za=t,t=r)):(za=t,t=r),t}function Qi(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===C?za+=6:(n=r,0===ja&&ei(at)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ea()):(za=t,t=r)):(za=t,t=r),t}function Ji(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===D?za+=3:(n=r,0===ja&&ei(it)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ta()):(za=t,t=r)):(za=t,t=r),t}function Bi(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===_?za+=3:(n=r,0===ja&&ei(ot)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=na()):(za=t,t=r)):(za=t,t=r),t}function Gi(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===F?za+=2:(n=r,0===ja&&ei(st)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ra()):(za=t,t=r)):(za=t,t=r),t}function Wi(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===M?za+=7:(n=r,0===ja&&ei(ut)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=aa()):(za=t,t=r)):(za=t,t=r),t}function Xi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===Z?za+=4:(n=r,0===ja&&ei(lt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ia()):(za=t,t=r)):(za=t,t=r),t}function eo(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===x?za+=3:(n=r,0===ja&&ei(ct)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=oa()):(za=t,t=r)):(za=t,t=r),t}function to(){var t,n,a,i;return t=za,(n=e.substr(za,9)).toLowerCase()===E?za+=9:(n=r,0===ja&&ei(ft)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=sa()):(za=t,t=r)):(za=t,t=r),t}function no(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===b?za+=7:(n=r,0===ja&&ei(dt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ua()):(za=t,t=r)):(za=t,t=r),t}function ro(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===A?za+=4:(n=r,0===ja&&ei(mt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=la()):(za=t,t=r)):(za=t,t=r),t}function ao(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===P?za+=8:(n=r,0===ja&&ei(ht)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ca()):(za=t,t=r)):(za=t,t=r),t}function io(){var t,n,a,i;return t=za,(n=e.substr(za,9)).toLowerCase()===$?za+=9:(n=r,0===ja&&ei(pt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=fa()):(za=t,t=r)):(za=t,t=r),t}function oo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===R?za+=4:(n=r,0===ja&&ei(vt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=da()):(za=t,t=r)):(za=t,t=r),t}function so(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===U?za+=4:(n=r,0===ja&&ei(wt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ma()):(za=t,t=r)):(za=t,t=r),t}function uo(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===k?za+=7:(n=r,0===ja&&ei(gt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ha()):(za=t,t=r)):(za=t,t=r),t}function lo(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===V?za+=8:(n=r,0===ja&&ei(yt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=pa()):(za=t,t=r)):(za=t,t=r),t}function co(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===z?za+=4:(n=r,0===ja&&ei(It)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=va()):(za=t,t=r)):(za=t,t=r),t}function fo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===q?za+=4:(n=r,0===ja&&ei(Tt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=wa()):(za=t,t=r)):(za=t,t=r),t}function mo(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===H?za+=2:(n=r,0===ja&&ei(Lt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ga()):(za=t,t=r)):(za=t,t=r),t}function ho(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===Y?za+=7:(n=r,0===ja&&ei(St)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ya()):(za=t,t=r)):(za=t,t=r),t}function po(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===K?za+=3:(n=r,0===ja&&ei(Nt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ia()):(za=t,t=r)):(za=t,t=r),t}function vo(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===j?za+=8:(n=r,0===ja&&ei(Ot)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ta()):(za=t,t=r)):(za=t,t=r),t}function wo(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===J?za+=5:(n=r,0===ja&&ei(Ct)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=La()):(za=t,t=r)):(za=t,t=r),t}function go(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===B?za+=4:(n=r,0===ja&&ei(Dt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Sa()):(za=t,t=r)):(za=t,t=r),t}function yo(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===G?za+=7:(n=r,0===ja&&ei(_t)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Na()):(za=t,t=r)):(za=t,t=r),t}function Io(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===W?za+=2:(n=r,0===ja&&ei(Ft)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Oa()):(za=t,t=r)):(za=t,t=r),t}function To(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===X?za+=8:(n=r,0===ja&&ei(Mt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ca()):(za=t,t=r)):(za=t,t=r),t}function Lo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ee?za+=4:(n=r,0===ja&&ei(Zt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Da()):(za=t,t=r)):(za=t,t=r),t}function So(){var t,n,a,i;return t=za,(n=e.substr(za,13)).toLowerCase()===te?za+=13:(n=r,0===ja&&ei(xt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=_a()):(za=t,t=r)):(za=t,t=r),t}function No(){var t,n,a,i;return t=za,(n=e.substr(za,15)).toLowerCase()===ne?za+=15:(n=r,0===ja&&ei(Et)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Fa()):(za=t,t=r)):(za=t,t=r),t}function Oo(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===re?za+=5:(n=r,0===ja&&ei(bt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ma()):(za=t,t=r)):(za=t,t=r),t}function Co(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===ae?za+=3:(n=r,0===ja&&ei(At)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Za()):(za=t,t=r)):(za=t,t=r),t}function Do(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ie?za+=4:(n=r,0===ja&&ei(Pt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=xa()):(za=t,t=r)):(za=t,t=r),t}function _o(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===oe?za+=6:(n=r,0===ja&&ei($t)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ea()):(za=t,t=r)):(za=t,t=r),t}function Fo(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===se?za+=6:(n=r,0===ja&&ei(Rt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ba()):(za=t,t=r)):(za=t,t=r),t}function Mo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ue?za+=4:(n=r,0===ja&&ei(Ut)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Aa()):(za=t,t=r)):(za=t,t=r),t}function Zo(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===le?za+=3:(n=r,0===ja&&ei(kt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Pa()):(za=t,t=r)):(za=t,t=r),t}function xo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ce?za+=4:(n=r,0===ja&&ei(Vt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=$a()):(za=t,t=r)):(za=t,t=r),t}function Eo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===fe?za+=4:(n=r,0===ja&&ei(zt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ra()):(za=t,t=r)):(za=t,t=r),t}function bo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===de?za+=4:(n=r,0===ja&&ei(qt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ua()):(za=t,t=r)):(za=t,t=r),t}function Ao(){var t;return 44===e.charCodeAt(za)?(t=me,za++):(t=r,0===ja&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(za)?(t=he,za++):(t=r,0===ja&&ei(Yt)),t}function $o(){var t;return 41===e.charCodeAt(za)?(t=pe,za++):(t=r,0===ja&&ei(Kt)),t}function Ro(){var e,t;for(e=[],t=Uo();t!==r;)e.push(t),t=Uo();return e}function Uo(){var t;return t=e.charAt(za),De.test(t)?za++:(t=r,0===ja&&ei(jt)),t}function ko(){var t,n,a,i;if(t=za,(n=pi())!==r&&(qa=t,n=ka(n)),(t=n)===r)if(t=za,96===e.charCodeAt(za)?(n=ve,za++):(n=r,0===ja&&ei(Qt)),n!==r){if(a=[],i=e.charAt(za),_e.test(i)?za++:(i=r,0===ja&&ei(Jt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(za),_e.test(i)?za++:(i=r,0===ja&&ei(Jt));else a=r;a!==r?(96===e.charCodeAt(za)?(i=ve,za++):(i=r,0===ja&&ei(Qt)),i!==r?(qa=t,t=Va(a)):(za=t,t=r)):(za=t,t=r)}else za=t,t=r;return t}function Vo(e,t,n,r,a){const i={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(i.escape=r),i}function zo(e,...t){return{type:"expression-list",location:e,value:t}}function qo(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=Vo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:za,peg$FAILED:r,peg$maxFailExpected:Ka,peg$maxFailPos:Ya};if(n!==r&&za===e.length)return n;throw n!==r&&za<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(Ka,Ya<e.length?e.charAt(Ya):null,Ya<e.length?Xa(Ya,Ya+1):Xa(Ya,Ya))}(e)}}function G(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":G(e.operand,t),G(e.value,t);break;case"case-expression":for(const n of e.clauses)G(n,t);"simple"===e.format&&G(e.operand,t),null!==e.else&&G(e.else,t);break;case"expression-list":for(const n of e.value)G(n,t);break;case"unary-expression":G(e.expr,t);break;case"binary-expression":G(e.left,t),G(e.right,t);break;case"function":G(e.args,t);break;case"interval":G(e.value,t),G(e.qualifier,t);break;case"interval-qualifier":G(e.start,t),G(e.end,t)}}const W=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 Se(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 ve(e,t)}currentTimestamp(e){return we(e)}currentDate(e){return ge(e)}currentTime(e){return ye(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 R(t,n,e)}calculate(e,t,n,r){return K(e,t,n,r)}evaluateTime(e){return F(e)}evaluateTimestamp(e,t,n){return M(e,t,n)}evaluateDate(e,t){return Z(e,t)}evaluateFunction(e,t,n){return z(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:R(e,t[0],">=")&&R(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],"<")||R(e,t[1],">")}ternaryNot(e){return me(e)}ternaryAnd(e,t){return he(e,t)}ternaryOr(e,t){return pe(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",ie="attributeAdapter",oe="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,ie,oe,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),i=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,i)})`:`(${t} = ${a}, ${t} == null ? null : ${e}.has(${t}))`}return ee("applyIn",a,i)}_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 o.L8(o.Z7.UnsupportedIsRhs);return ee("equalsNull",this._compileNode(e.left));case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.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 o.L8(o.Z7.UnsupportedOperator,{operator:e.operator})}case"null":case"boolean":case"string":case"number":return te(e.value);case"time":try{return this._compileRefStaticData(this._storeStaticData(F(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(Z(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(M(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),oe,ie);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 o.L8(o.Z7.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=B.parse(e);const{isStandardized:a,isAggregate:i,currentUserRequired:o,referencedFieldNames:s}=this._extractExpressionInfo(t);this._referencedFieldNames=s,this.isStandardized=a,this.isAggregate=i,this.currentUserRequired=o}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():_(e)?e.toStorageFormat():D(e)?e.toStorageString():C(e)?e.toStorageFormat():e;switch(t){case"date":return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():_(e)?e.toMilliseconds():C(e)?e.toNumber():e;case"date-only":return(0,b.$P)(e)?i.n.fromDateJS(e).toString():_(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,b.$P)(e)?d.k.fromDateJS(e).toStorageString():O(e)?d.k.fromDateTime(e).toStorageString():_(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():D(e)?e.toStorageString():e;case"timestamp-offset":if((0,b.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(O(e))return f.g.fromDateTime(e).toStorageFormat();if(_(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,G(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||W.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return G(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return G(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 G(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,i=!1,o=!1;return G(this.parseTree,(s=>{switch(s.type){case"column-reference":{const r=e?.get(s.column);let a,i;r?a=i=r.name??"":(i=s.column,a=i.toLowerCase()),n.has(a)||(n.add(a),t.push(i)),s.column=i;break}case"current-user":o=!0;break;case"function":{const{name:e,args:t}=s,n=t.value.length;r&&(r=function(e,t){const n=Y[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===i&&(i=(0,a.M)(e,n));break}}})),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:i,currentUserRequired:o}}_evaluateNode(e,t,n,r,i){let s;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,i);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,i);for(let o=0;o<e.clauses.length;o++)if(R(a,this._evaluateNode(e.clauses[o].operand,t,n,r,i),"="))return this._evaluateNode(e.clauses[o].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}else{for(let a=0;a<e.clauses.length;a++)if(fe(this._evaluateNode(e.clauses[a].operand,t,n,r,i)))return this._evaluateNode(e.clauses[a].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],(0,b.$P)(s)?h.c9.fromJSDate(s):null!=s&&"object"==typeof s&&"toDateTime"in s?s.toDateTime():s;case"expression-list":{const a=[];for(const o of e.value)a.push(this._evaluateNode(o,t,n,r,i));return a}case"unary-expression":return me(this._evaluateNode(e.expr,t,n,r,i));case"binary-expression":switch(e.operator){case"AND":return he(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"OR":return pe(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,n,r,i);case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,n,r,i);case"IN":{const a=de(this._evaluateNode(e.right,t,n,r,i));return ve(this._evaluateNode(e.left,t,n,r,i),a)}case"NOT IN":{const a=de(this._evaluateNode(e.right,t,n,r,i));return me(ve(this._evaluateNode(e.left,t,n,r,i),a))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],">=")&&R(a,o[1],"<=")}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],"<")||R(a,o[1],">")}case"LIKE":return Le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return me(Le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return R(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator);case"-":case"+":case"*":case"/":case"||":return K(e.operator,this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=Z(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"time":return F(e.value);case"current-time":return"date"===e.mode?ge(this.timeZone):"time"===e.mode?ye(this.timeZone):we(this.timeZone);case"current-user":return i??null;case"column-reference":return Se(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,i));t.push(e)}return(0,a.s)(e.name,t)}const o=this._evaluateNode(e.args,t,n,r,i);return z(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function fe(e){return!0===e}function de(e){return Array.isArray(e)?e:[e]}function me(e){return null!==e?!0!==e:null}function he(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function pe(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function ve(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(P(e)&&P(r)&&(n=R(e,r,"="),n))break}return n}function we(e){return S(new Date,e)}function ge(e){return i.n.fromNow(e)}function ye(e){const t=S(new Date,e);return d.k.fromDateTime(t)}const Ie="-[]/{}()*+?.\\^$|";var Te;function Le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=Te.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case Te.Normal:i===n?a=Te.Escaped:Ie.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case Te.Escaped:Ie.includes(i)?r+="\\"+i:r+=i,a=Te.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Se(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t),o=n?.get(t);return null==a||"esriFieldTypeDate"!==o?.type&&"date"!==o?.type?null==a||"esriFieldTypeDateOnly"!==o?.type&&"date-only"!==o?.type?null==a||"esriFieldTypeTimeOnly"!==o?.type&&"time-only"!==o?.type?null==a||"esriFieldTypeTimestampOffset"!==o?.type&&"timestamp-offset"!==o?.type?a:new f.g(a):d.k.fromReader(a):i.n.fromReader(a):S(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Te||(Te={}));const Ne={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}},95466:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(49186),a=n(25482),i=n(53966),o=n(91869),s=n(3330),u=n(30524),l=n(56400),c=n(96285);const f=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],v(e))}static fromLayerJSON(e){return new d(e.fields??[],v(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 n=[];for(const e of this.fields){const t=e?.name,r=h(t);if(t&&r){const a=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(a,e),this._normalizedFieldsMap.set(r,e),n.push(`${a}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,u.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,u.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,u.te)(e)||(0,u.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,u.te)(e)||(0,u.Xz)(e)||e.nullable||void 0!==(0,u.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(m(e))??this._normalizedFieldsMap.get(h(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 r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),l.n$):p.has(t.type)?l.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===l.L5?s.GB.instance:t===l.n$?c.mQ.utcInstance:(0,o.tE)(f,t,(()=>c.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,u.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=>a.A.isSerializable(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,u.rS)(e)?.toLowerCase()??""}const p=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function v(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:a}=e,i=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",s=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,u=a?function(e){return"timeZone"in e}(a)?a.timeZone??s:a.dateFieldsTimeReference?(0,l.ZS)(a.dateFieldsTimeReference):s??l.n$:null,c=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,l.ZS)(r.timeReference):s:null,f=new Map([[m(a?.creationDateField??""),u],[m(a?.editDateField??""),u],[m(i),c],[m(o),c]]);for(const{name:r,type:a}of e.fields)if(p.has(a))t.set(r,l.L5);else if("date"!==a&&"esriFieldTypeDate"!==a)t.set(r,null);else if(n)t.set(r,l.L5);else{const e=f.get(m(r??""))??s;t.set(r,e)}return t}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5455],{1262:(e,t,n)=>{n.d(t,{L8:()=>s,Z7:()=>r});var r,a,i=n(799);(a=r||(r={})).InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters";const o={[r.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[r.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[r.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[r.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[r.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[r.UnsupportedOperator]:"Unsupported operator - {operator}",[r.UnsupportedSyntax]:"Unsupported syntax - {node}",[r.UnsupportedSqlFunction]:"Sql function not found = {function}",[r.InvalidDataType]:"Invalid sql data type",[r.InvalidDate]:"Invalid date encountered",[r.InvalidOperator]:"Invalid operator encountered",[r.InvalidTime]:"Invalid time encountered",[r.IllegalInterval]:"Illegal interval",[r.FunctionNotRecognized]:"Function not recognized",[r.InvalidTimeStamp]:"Invalid timestamp encountered",[r.InvalidParameterCount]:"Invalid parameter count for call to {name}",[r.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[r.YearMonthIntervals]:"Year-Month Intervals not supported",[r.CannotCastValue]:"Cannot cast value to the required data type"};class s extends Error{constructor(e,t){super((0,i.HC)(o[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,s)}}},15032:(e,t,n)=>{n.d(t,{k:()=>u});var r=n(78502),a=n(73444),i=n(96285);function o(e){if(!e)return"";const t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let n="";for(const r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":n+=r;break;case"A":case"a":n+="a";break;default:n+=`'${r}'`}return n}const s="esri.core.sql.timeonly";class u{constructor(e,t,n,r){this._hour=e,this._minute=t,this._second=n,this._millisecond=r,this.declaredRootClass=s}static isTimeOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return u.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,r.Fq)(this.hour)&&(0,r.Fq)(this.minute)&&(0,r.Fq)(this.second)&&(0,r.Fq)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=o(e))?i.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,n,r){const a=new u(e,t,n,r);return a.isValid()?a:null}static fromReader(e){if(!e)return null;const t=e.split(":");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),n=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),a=Math.floor(e%1e3);return new u(r,n,t,a)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];t?(t=o(t))&&n.push(t):null!==t&&""!==t||(n.push("HH:mm:ss"),n.push("HH:mm:ss.SSS"),n.push("hh:mm:ss a"),n.push("hh:mm:ss.SSS a"),n.push("HH:mm"),n.push("hh:mm a"),n.push("H:mm"),n.push("h:mm a"),n.push("H:mm:ss"),n.push("h:mm:ss a"),n.push("H:mm:ss.SSS"),n.push("h:mm:ss.SSS a"));for(const t of n){const n=i.c9.fromFormat(e,t);if(n.isValid)return new u(n.hour,n.minute,n.second,n.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.c9.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},44729:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(66131),a=n(73444),i=n(96285);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";const n=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of e.match(n)||[])switch(r){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=r;break;default:r.length>=2&&"["===r.slice(0,1)&&"]"===r.slice(-1)?t+=`'${r.slice(1,-1)}'`:t+=`'${r}'`}return t}const s="esri.core.sql.dateonly";class u{constructor(e,t,n){this._year=e,this._month=t,this._day=n,this.declaredRootClass=s}static isDateOnly(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===s}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return u.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new u(this._year,this._month,this._day)}toDateTime(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return i.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";const n=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(n).toFormat(e,{locale:(0,a.JK)(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.c9.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.c9.fromMillis(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.c9.fromSeconds(e,{zone:i.mQ.utcInstance});return t.isValid?u.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return 3!==t.length?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,n){const r=new u(e,t,n);return!1===r.isValid?null:r}static fromDateJS(e){return u.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return u.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e)return null;if(null===e)return null;const n=[];if(t)(t=o(t))&&n.push(t);else if(null===t||""===t){const t=i.c9.fromISO(e,{setZone:!0});return t.isValid?u.fromParts(t.year,t.month,t.day):null}for(const r of n){const n=i.c9.fromFormat(e,t??r);if(n.isValid)return new u(n.year,n.month,n.day)}return null}static fromNow(e="system"){const t=i.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new u(t.year,t.month,t.day)}}},55612:(e,t,n)=>{n.d(t,{g:()=>o});var r=n(96285);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const i="esri.core.sql.SqlTimeStampOffset";class o{constructor(e){this._timeStampOffset=e,this.declaredRootClass=i,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===i}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 o.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new o(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new o(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,i=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="";i<10&&(d="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+i.toString()}`;0!==s&&(m+="."+s.toString().padStart(3,"0"));const h=`${u?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new o(f+"T"+m+h)}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 o.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>u});var r=n(44729),a=n(1262),i=n(55612),o=n(15032),s=n(96285);function u(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L8(a.Z7.FunctionNotRecognized);if(t.length<n.minParams||t.length>n.maxParams)throw new a.L8(a.Z7.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=>m(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>m(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.L8(a.Z7.InvalidValueForAggregateFunction);t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=h(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=>h(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const i=e[r];if(null!==i){if(!d(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function m(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)||o.k.isTimeOnly(u)?u.toNumber():s.c9.isDateTime(u)?u.toMillis():i.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 h(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.L8(a.Z7.InvalidValueForAggregateFunction);n+=(t-r)**2}return n/(e.length-1)}},78502:(e,t,n)=>{n.d(t,{Fq:()=>o,Yc:()=>a,Yq:()=>i});var r=n(5443);function a(e){if(null==e)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new r.A({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function i(e){if(null==e)return null;const t=e.clone();return void 0!==e.cache._geVersion&&(t.cache._geVersion=e.cache._geVersion),t}function o(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},88368:(e,t,n)=>{n.d(t,{A:()=>ce});var r=n(44208),a=n(74639),i=n(44729),o=n(1262);function s(e){if(null!==e.precision||null!==e.secondary)throw new o.L8(o.Z7.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 o.L8(o.Z7.YearMonthIntervals);if("second"===t.period){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new o.L8(o.Z7.IllegalInterval);u(a,e)}else{if(!n.test(e))throw new o.L8(o.Z7.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 o.L8(o.Z7.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 o.L8(o.Z7.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 o.L8(o.Z7.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,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.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 o.L8(o.Z7.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 o.L8(o.Z7.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,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),u(a,t[2])}break;default:throw new o.L8(o.Z7.IllegalInterval)}break;case"minute":if("second"!==t.end.period)throw new o.L8(o.Z7.IllegalInterval);if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!r.test(e))throw new o.L8(o.Z7.IllegalInterval);{const t=e.split(":");a.minute=parseFloat(t[0]),u(a,t[1])}break;default:throw new o.L8(o.Z7.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),m=n(3330),h=n(96285);const p=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2})$/,w=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,I=/^(\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})$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,L=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function S(e,t){if(t instanceof h.bo)return t===m.GB.instance?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return h.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?h.c9.fromMillis(e.getTime(),{zone:m.GB.instance}):h.c9.fromJSDate(e,{zone:t})}}function N(e){return c.isInterval(e)}function O(e){return h.c9.isDateTime(e)}function C(e){return i.n.isDateOnly(e)}function D(e){return d.k.isTimeOnly(e)}function _(e){return f.g.isTimestampOffset(e)}function F(e){let t=p.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 o.L8(o.Z7.InvalidTime)}if(t=v.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 o.L8(o.Z7.InvalidTime)}if(t=w.exec(e),null!==t){const[,e,n,r,a]=t,i=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==i)return i;throw new o.L8(o.Z7.InvalidTime)}throw new o.L8(o.Z7.InvalidTime)}function M(e,t,n=!1){let r=y.exec(e);if(null!==r){const[,e,n,a,i,s,u,l]=r,c=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:parseInt(u,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,m.Qo)(t)});if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,d]=r,m=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),parseInt(s,10),u?parseInt(u.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(i,10),0,0,"-"===s,parseInt(u,10),parseInt(l,10));if(!1===c.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return c}if(r=L.exec(e),null!==r){const[,e,n,a,i,s]=r,u=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(i,10),minute:parseInt(s,10),second:0},{zone:(0,m.Qo)(t)});if(!1===u.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return u}if(r=g.exec(e),null!==r){const[,e,n,a]=r,i=h.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,m.Qo)(t)});if(!1===i.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return i}throw new o.L8(o.Z7.InvalidTimeStamp)}function Z(e,t){const n=g.exec(e);if(null===n)try{return M(e,t)}catch{throw new o.L8(o.Z7.InvalidDate)}const[,r,a,s]=n,u=i.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(s,10));if(null===u)throw new o.L8(o.Z7.InvalidDate);return u}var x=n(34727),E=n(799),b=n(54218);function A(e){return!!O(e)||!!_(e)}function P(e){return!!(O(e)||C(e)||_(e)||D(e))}function $(e){if(O(e))return e.toMillis();if(C(e))return e.toNumber();if(_(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function R(e,t,n){if(null==e||null==t)return null;if((0,b.Et)(e)){if((0,b.Et)(t))return U(e,t,n);if((0,b.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(P(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator)}else if((0,b.Kg)(e)){if((0,b.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,b.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(O(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator)}else if(O(e)){if(A(t)){if((0,m.Y4)(e.zone)){if(h.c9.isDateTime(t)&&!(0,m.Y4)(t.zone))return k(e,t,n);if(f.g.isTimestampOffset(t))return k(e,t,n)}else if(h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)){if(!(0,m.Y4)(e.zone))return k(e,t,n);if(f.g.isTimestampOffset(e))return k(e,t,n)}return U($(e),$(t),n)}if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(_(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(O(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,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))return U(e.toNumber(),t.toNumber(),n);if(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(D(e)){if(D(t))return U(e.toNumber(),t.toNumber(),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(t))throw new o.L8(o.Z7.InvalidOperator);if(A(t))throw new o.L8(o.Z7.InvalidOperator)}else if(_(e)){if(A(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):U($(e),$(t),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(C(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.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 k(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=V(e),a=V(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 V(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function z(e,t,n){const r=Y[e.toLowerCase()];if(null==r)throw new o.L8(o.Z7.FunctionNotRecognized);if(t.length<r.minParams||t.length>r.maxParams)throw new o.L8(o.Z7.InvalidParameterCount,{name:e.toUpperCase()});return r.evaluate(t,n)}function q(e){return!((0,b.$P)(e)||C(e)||O(e)||D(e)||_(e))}function H(e){return C(e)||D(e)?e.toString():_(e)?e.toSQLValue():O(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,b.$P)(e)?H(h.c9.fromJSDate(e)):e.toString()}const Y={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,b.$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}else if(O(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(C(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 o.L8(o.Z7.InvalidFunctionParameters,{function:"EXTRACT"})}else if(D(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(_(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}throw new o.L8(o.Z7.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,E.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 o.L8(o.Z7.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,x.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,b.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=>R(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 o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"smallint":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseInt(n,10);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);if(e>32767||e<-32767)throw new o.L8(o.Z7.CannotCastValue);return e}case"float":case"real":{if(!q(n))throw new o.L8(o.Z7.CannotCastValue);const e=parseFloat(n);if(isNaN(e))throw new o.L8(o.Z7.CannotCastValue);return e}case"time":return function(e){if((0,b.$P)(e))return d.k.fromDateJS(e);if(O(e))return d.k.fromDateTime(e);if(C(e))throw new o.L8(o.Z7.CannotCastValue);if(D(e))return e;if(_(e))return d.k.fromSqlTimeStampOffset(e);if((0,b.Kg)(e))return F(e);throw new o.L8(o.Z7.CannotCastValue)}(n);case"date":return function(e){if((0,b.$P)(e))return i.n.fromDateJS(e);if(O(e))return i.n.fromParts(e.year,e.month,e.day);if(C(e))return e;if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e)&&null===i.n.fromParts(e.year,e.month,e.day))throw new o.L8(o.Z7.CannotCastValue);if((0,b.Kg)(e)){const t=i.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new o.L8(o.Z7.CannotCastValue)}(n);case"timestamp":return function(e,t,n){if((0,b.$P)(e))return S(e,t);if(O(e))return e;if(C(e))return e.toDateTimeLuxon("unknown");if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e))return e;if((0,b.Kg)(e))return M(e,"unknown",n);throw new o.L8(o.Z7.CannotCastValue)}(n,t,!0===r.withtimezone);case"varchar":{const e=H(n);if(e.length>r.size)throw new o.L8(o.Z7.CannotCastValue);return e}default:throw new o.L8(o.Z7.InvalidDataType)}}}};function K(e,t,n,r){if("||"===e)return z("concat",[t,n],r);if(null===t||null===n)return null;if((0,b.Et)(t)){if((0,b.Et)(n))return j(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return j(e,r,n)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}if(C(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(D(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(N(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(O(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if(_(t)){if((0,b.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 o.L8(o.Z7.InvalidOperator)}(t,n,e);if(N(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(_(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if(O(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);if((0,b.Kg)(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();throw new o.L8(o.Z7.InvalidOperator)}if((0,b.Kg)(t)){if((0,b.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new o.L8(o.Z7.InvalidOperator);return j(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(C(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(O(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if((0,b.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new o.L8(o.Z7.InvalidOperator)}(t,n,e);throw new o.L8(o.Z7.InvalidOperator)}throw new o.L8(o.Z7.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 o.L8(o.Z7.InvalidOperator)}function Q(e,t,n,r){var a=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(a,Q.prototype),a.expected=t,a.found=n,a.location=r,a.name="SyntaxError",a}function J(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}(function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n})(Q,Error),Q.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var n,r=null;for(n=0;n<e.length;n++)if(e[n].source===this.location.source){r=e[n].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,o=this.location.source+":"+i.line+":"+i.column;if(r){var s=this.location.end,u=J("",i.line.toString().length," "),l=r[a.line-1],c=(a.line===s.line?s.column:l.length+1)-a.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+l+"\n"+u+" | "+J("",a.column-1," ")+J("",c,"^")}else t+="\n at "+o}return t},Q.buildMessage=function(e,t){var n={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return 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,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function i(e){return 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,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return n[e.type](e)}return"Expected "+function(e){var t,n,r=e.map(o);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(t)+" found."};class B{static parse(e){return function(e,t){var n,r={},a=(t=void 0!==t?t:{}).grammarSource,i={start:ni},o=ni,s="!",u="=",l=">=",c=">",f="<=",d="<>",m="!=",h="||",p="@",v="'",w="N'",g="''",y=".",I="null",T="true",L="false",S="in",N="is",O="like",C="escape",D="not",_="and",F="or",M="between",Z="from",x="for",E="substring",b="extract",A="trim",P="position",$="timestamp",R="date",U="time",k="leading",V="trailing",z="both",q="cast",H="as",Y="integer",K="int",j="smallint",J="float",B="real",G="varchar",W="to",X="interval",ee="year",te="timezone_hour",ne="timezone_minute",re="month",ae="day",ie="hour",oe="minute",se="second",ue="case",le="end",ce="when",fe="then",de="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ge=/^[+\-]/,ye=/^[*\/]/,Ie=/^[A-Za-z_\x80-\uFFFF]/,Te=/^[A-Za-z0-9_]/,Le=/^[A-Za-z0-9_.\x80-\uFFFF]/,Se=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,Ce=/^[eE]/,De=/^[ \t\n\r]/,_e=/^[^`]/,Fe=Ba("!",!1),Me=Ba("=",!1),Ze=Ba(">=",!1),xe=Ba(">",!1),Ee=Ba("<=",!1),be=Ba("<>",!1),Ae=Ga([["<","="]],!1,!1),Pe=Ba("!=",!1),$e=Ga(["+","-"],!1,!1),Re=Ba("||",!1),Ue=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ze=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),qe=Ga(['"'],!1,!1),He=Ba("@",!1),Ye=Ba("'",!1),Ke=Ba("N'",!1),je=Ba("''",!1),Qe=Ga(["'"],!0,!1),Je=Ba(".",!1),Be=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=Ba("NULL",!0),Xe=Ba("TRUE",!0),et=Ba("FALSE",!0),tt=Ba("IN",!0),nt=Ba("IS",!0),rt=Ba("LIKE",!0),at=Ba("ESCAPE",!0),it=Ba("NOT",!0),ot=Ba("AND",!0),st=Ba("OR",!0),ut=Ba("BETWEEN",!0),lt=Ba("FROM",!0),ct=Ba("FOR",!0),ft=Ba("SUBSTRING",!0),dt=Ba("EXTRACT",!0),mt=Ba("TRIM",!0),ht=Ba("POSITION",!0),pt=Ba("TIMESTAMP",!0),vt=Ba("DATE",!0),wt=Ba("TIME",!0),gt=Ba("LEADING",!0),yt=Ba("TRAILING",!0),It=Ba("BOTH",!0),Tt=Ba("CAST",!0),Lt=Ba("AS",!0),St=Ba("INTEGER",!0),Nt=Ba("INT",!0),Ot=Ba("SMALLINT",!0),Ct=Ba("FLOAT",!0),Dt=Ba("REAL",!0),_t=Ba("VARCHAR",!0),Ft=Ba("TO",!0),Mt=Ba("INTERVAL",!0),Zt=Ba("YEAR",!0),xt=Ba("TIMEZONE_HOUR",!0),Et=Ba("TIMEZONE_MINUTE",!0),bt=Ba("MONTH",!0),At=Ba("DAY",!0),Pt=Ba("HOUR",!0),$t=Ba("MINUTE",!0),Rt=Ba("SECOND",!0),Ut=Ba("CASE",!0),kt=Ba("END",!0),Vt=Ba("WHEN",!0),zt=Ba("THEN",!0),qt=Ba("ELSE",!0),Ht=Ba(",",!1),Yt=Ba("(",!1),Kt=Ba(")",!1),jt=Ga([" ","\t","\n","\r"],!1,!1),Qt=Ba("`",!1),Jt=Ga(["`"],!0,!1),Bt=function(e){return e},Gt=function(e){return{type:"expression-list",location:Qa(),value:e}},Wt=function(e,t,n){return{op:t,expr:n,location:Qa()}},Xt=function(e,t){return qo(e,t)},en=function(e,t,n){return{op:t,expr:n,location:Qa()}},tn=function(e,t){return qo(e,t)},nn=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,Qa())},rn=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?qo(e,t.tail):Vo(t.op,e,t.right,t.escape,Qa())},an=function(e,t){return{op:e,expr:t,location:Qa()}},on=function(e){return{type:"arithmetic",tail:e}},sn=function(e,t){return{op:e+"NOT",right:t}},un=function(e,t){return{op:e,right:t}},ln=function(e,t,n){return zo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},fn=function(e,t,n){return zo(Qa(),t,n)},dn=function(e,t){return{op:e,right:t}},mn=function(e){return e[0]+" "+e[2]},hn=function(e){return e[0]+" "+e[2]},pn=function(e,t,n){return{op:e,right:t,escape:n.value}},vn=function(e,t){return{op:e,right:t,escape:""}},wn=function(e,t){return{op:e,right:t}},gn=function(e,t){return{op:e,right:t}},yn=function(e,t,n){return{op:t,expr:n,location:Qa()}},In=function(e,t){return qo(e,t)},Tn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Ln=function(e,t){return qo(e,t)},Sn=function(e){return e.paren=!0,e},Nn=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:Qa(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:Qa(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:Qa(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:Qa()}:{type:"column-reference",location:Qa(),table:"",column:e}},On=function(e){return{type:"column-reference",location:Qa(),table:"",column:e,delimited:!0}},Cn=function(e){return e},Dn=function(e,t){return e+t.join("")},_n=function(e,t){return e+t.join("")},Fn=function(e){return e},Mn=function(e){return e.join("")},Zn=function(){return'"'},xn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return zo(Qa(),e,t)},bn=function(e,t){return zo(Qa(),e,t)},An=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return zo(Qa(),e,t,...n?[n]:[])},$n=function(e,t,n){return zo(Qa(),e,t,n)},Rn=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},Un=function(e,t){return zo(Qa(),e,t)},kn=function(e,t){return zo(Qa(),e,t)},Vn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},zn=function(){return{type:"data-type",location:Qa(),value:{type:"integer"}}},qn=function(){return{type:"data-type",location:Qa(),value:{type:"smallint"}}},Hn=function(){return{type:"data-type",location:Qa(),value:{type:"float"}}},Yn=function(){return{type:"data-type",location:Qa(),value:{type:"real"}}},Kn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},jn=function(){return{type:"data-type",location:Qa(),value:{type:"timestamp"}}},Qn=function(){return{type:"data-type",location:Qa(),value:{type:"time"}}},Jn=function(e){return{type:"data-type",location:Qa(),value:{type:"varchar",size:parseInt(e)}}},Bn=function(e,t,n){return zo(Qa(),e,t,n)},Gn=function(e,t){return zo(Qa(),e,t)},Wn=function(e){return{type:"function",location:Qa(),name:"trim",args:e}},Xn=function(e){return{type:"string",location:Qa(),value:e??"BOTH"}},er=function(e,t){return zo(Qa(),e,t)},tr=function(e,t){return zo(Qa(),e,t)},nr=function(e){return{type:"function",location:Qa(),name:"position",args:e}},rr=function(e,t){return{type:"function",location:Qa(),name:e,args:t}},ar=function(e){return{type:"string",location:Qa(),value:e}},ir=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)&&Ja("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:Qa(),value:e.value}},or=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)&&Ja("Time literal is invalid")}(e.value),{type:"time",location:Qa(),value:e.value}},sr=function(e,t,n){return{type:"interval",location:Qa(),value:t,qualifier:n,op:e}},ur=function(e,t){return{type:"interval",location:Qa(),value:e,qualifier:t,op:""}},lr=function(e,t){return{type:"interval-qualifier",location:Qa(),start:e,end:t}},cr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},fr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},mr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},hr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},pr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},vr=function(e,t){return{type:"interval-period",location:Qa(),period:e.value,precision:t,secondary:null}},wr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},gr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},yr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Ir=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Tr=function(){return{type:"string",location:Qa(),value:"day"}},Lr=function(){return{type:"string",location:Qa(),value:"hour"}},Sr=function(){return{type:"string",location:Qa(),value:"minute"}},Nr=function(){return{type:"string",location:Qa(),value:"month"}},Or=function(){return{type:"string",location:Qa(),value:"year"}},Cr=function(e){return parseFloat(e)},Dr=function(e){return parseFloat(e)},_r=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)&&Ja("Date literal is invalid")}(e.value),{type:"date",location:Qa(),value:e.value}},Fr=function(){return{type:"null",location:Qa(),value:null}},Mr=function(){return{type:"boolean",location:Qa(),value:!0}},Zr=function(){return{type:"boolean",location:Qa(),value:!1}},xr=function(){return"'"},Er=function(e){return{type:"string",location:Qa(),value:e.join("")}},br=function(e,t){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}},Ar=function(e,t,n){return{type:"case-expression",location:Qa(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}},Pr=function(e){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:null,elseLocation:null}},$r=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},Ur=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},Vr=function(e){return{type:"number",location:Qa(),value:e}},zr=function(e,t,n){return parseFloat(e+t+n)},qr=function(e,t){return parseFloat(e+t)},Hr=function(e,t){return parseFloat(e+t)},Yr=function(e){return parseFloat(e)},Kr=function(e,t){return e[0]+t},jr=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},Jr=function(e){return e.join("")},Br=function(e,t){return"e"+(null===t?"":t)},Gr=function(){return"IN"},Wr=function(){return"IS"},Xr=function(){return"LIKE"},ea=function(){return"ESCAPE"},ta=function(){return"NOT"},na=function(){return"AND"},ra=function(){return"OR"},aa=function(){return"BETWEEN"},ia=function(){return"FROM"},oa=function(){return"FOR"},sa=function(){return"SUBSTRING"},ua=function(){return"EXTRACT"},la=function(){return"TRIM"},ca=function(){return"POSITION"},fa=function(){return"TIMESTAMP"},da=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ga=function(){return"AS"},ya=function(){return"INTEGER"},Ia=function(){return"INT"},Ta=function(){return"SMALLINT"},La=function(){return"FLOAT"},Sa=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Ca=function(){return"INTERVAL"},Da=function(){return"YEAR"},_a=function(){return"TIMEZONE_HOUR"},Fa=function(){return"TIMEZONE_MINUTE"},Ma=function(){return"MONTH"},Za=function(){return"DAY"},xa=function(){return"HOUR"},Ea=function(){return"MINUTE"},ba=function(){return"SECOND"},Aa=function(){return"CASE"},Pa=function(){return"END"},$a=function(){return"WHEN"},Ra=function(){return"THEN"},Ua=function(){return"ELSE"},ka=function(e){return e},Va=function(e){return e.join("")},za=0|t.peg$currPos,qa=za,Ha=[{line:1,column:1}],Ya=za,Ka=t.peg$maxFailExpected||[],ja=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=i[t.startRule]}function Qa(){return Xa(qa,za)}function Ja(e,t){throw ti(e,t=void 0!==t?t:Xa(qa,za))}function Ba(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ga(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Wa(t){var n,r=Ha[t];if(r)return r;if(t>=Ha.length)n=Ha.length-1;else for(n=t;!Ha[--n];);for(r={line:(r=Ha[n]).line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return Ha[t]=r,r}function Xa(e,t,n){var r=Wa(e),i=Wa(t);return{source:a,start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:i.line,column:i.column}}}function ei(e){za<Ya||(za>Ya&&(Ya=za,Ka=[]),Ka.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=za,Ro(),(t=ai())!==r?(Ro(),qa=e,e=Bt(t)):(za=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=za,Po()!==r){for(Ro(),t=[],n=ai();n!==r;)t.push(n),n=za,a=za,i=Ro(),(o=Ao())!==r?a=i=[i,o,Ro()]:(za=a,a=r),a!==r&&(a=ai())===r?(za=n,n=r):n=a;n=Ro(),(a=$o())!==r?(qa=e,e=Gt(t)):(za=e,e=r)}else za=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=za,(t=ii())!==r){for(n=[],a=za,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=Gi())!==r?(Ro(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=Xt(t,n)}else za=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=za,(t=oi())!==r){for(n=[],a=za,Ro(),(i=Bi())!==r?(Ro(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=Bi())!==r?(Ro(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=tn(t,n)}else za=e,e=r;return e}function oi(){var t,n,a,i,o;return t=za,(n=Ji())===r&&(n=za,33===e.charCodeAt(za)?(a=s,za++):(a=r,0===ja&&ei(Fe)),a!==r?(i=za,ja++,61===e.charCodeAt(za)?(o=u,za++):(o=r,0===ja&&ei(Me)),ja--,o===r?i=void 0:(za=i,i=r),i!==r?n=a=[a,i]:(za=n,n=r)):(za=n,n=r)),n!==r?(a=Ro(),(i=oi())!==r?(qa=t,t=nn(i)):(za=t,t=r)):(za=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=za,(t=ci())!==r?(n=za,Ro(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=za,t=[],n=za,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(qa=n,n=an(a,i)):(za=n,n=r)):(za=n,n=r),n!==r)for(;n!==r;)t.push(n),n=za,Ro(),(a=si())!==r?(Ro(),(i=ci())!==r?(qa=n,n=an(a,i)):(za=n,n=r)):(za=n,n=r);else t=r;return t!==r&&(qa=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=za,(t=li())!==r?(Ro(),(n=ri())!==r?(qa=e,e=wn(t,n)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=li())!==r?(Ro(),(n=Li())!==r?(qa=e,e=gn(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=za,(t=Ji())!==r?(Ro(),(n=Wi())!==r?(a=Ro(),i=za,(o=ci())!==r?(Ro(),(s=Bi())!==r?(Ro(),(u=ci())!==r?(qa=i,i=ln(n,o,u)):(za=i,i=r)):(za=i,i=r)):(za=i,i=r),i!==r?(qa=e,e=cn(n,i)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Wi())!==r?(Ro(),n=za,(a=ci())!==r?(i=Ro(),(o=Bi())!==r?(Ro(),(s=ci())!==r?(qa=n,n=fn(t,a,s)):(za=n,n=r)):(za=n,n=r)):(za=n,n=r),n!==r?(qa=e,e=dn(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=za,(t=Ki())!==r?(Ro(),(n=Ji())!==r?(Ro(),(a=ci())!==r?(qa=e,e=sn(t,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Ki())!==r?(Ro(),(n=ci())!==r?(qa=e,e=un(t,n)):(za=e,e=r)):(za=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=za,(t=ui())!==r?(Ro(),(n=Zi())!==r?(Ro(),Qi()!==r?(Ro(),(a=xi())!==r?(qa=e,e=pn(t,n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=ui())!==r?(Ro(),(n=Zi())!==r?(qa=e,e=vn(t,n)):(za=e,e=r)):(za=e,e=r)),e}()),e}())!==r?n=a:(za=n,n=r),n===r&&(n=null),qa=e,e=rn(t,n)):(za=e,e=r),e}()),t}function si(){var t;return e.substr(za,2)===l?(t=l,za+=2):(t=r,0===ja&&ei(Ze)),t===r&&(62===e.charCodeAt(za)?(t=c,za++):(t=r,0===ja&&ei(xe)),t===r&&(e.substr(za,2)===f?(t=f,za+=2):(t=r,0===ja&&ei(Ee)),t===r&&(e.substr(za,2)===d?(t=d,za+=2):(t=r,0===ja&&ei(be)),t===r&&(t=e.charAt(za),we.test(t)?za++:(t=r,0===ja&&ei(Ae)),t===r&&(e.substr(za,2)===m?(t=m,za+=2):(t=r,0===ja&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=za,t=za,(n=Ji())!==r?(a=Ro(),(i=ji())!==r?t=n=[n,a,i]:(za=t,t=r)):(za=t,t=r),t!==r&&(qa=e,t=mn(t)),(e=t)===r&&(e=ji()),e}function li(){var e,t,n,a,i;return e=za,t=za,(n=Ji())!==r?(a=Ro(),(i=Yi())!==r?t=n=[n,a,i]:(za=t,t=r)):(za=t,t=r),t!==r&&(qa=e,t=hn(t)),(e=t)===r&&(e=Yi()),e}function ci(){var e,t,n,a,i,o;if(e=za,(t=di())!==r){for(n=[],a=za,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(qa=a,a=yn(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=fi())!==r?(Ro(),(o=di())!==r?(qa=a,a=yn(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=In(t,n)}else za=e,e=r;return e}function fi(){var t;return t=e.charAt(za),ge.test(t)?za++:(t=r,0===ja&&ei($e)),t===r&&(e.substr(za,2)===h?(t=h,za+=2):(t=r,0===ja&&ei(Re))),t}function di(){var e,t,n,a,i,o;if(e=za,(t=hi())!==r){for(n=[],a=za,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(qa=a,a=Tn(t,i,o)):(za=a,a=r)):(za=a,a=r);a!==r;)n.push(a),a=za,Ro(),(i=mi())!==r?(Ro(),(o=hi())!==r?(qa=a,a=Tn(t,i,o)):(za=a,a=r)):(za=a,a=r);qa=e,e=Ln(t,n)}else za=e,e=r;return e}function mi(){var t;return t=e.charAt(za),ye.test(t)?za++:(t=r,0===ja&&ei(Ue)),t}function hi(){var e,t;return(e=function(){var e;return(e=xi())===r&&(e=function(){var e,t,n,a;return e=za,(t=function(){var e,t,n,a;return e=za,(t=Pi())!==r&&(n=$i())!==r&&(a=Ri())!==r?(qa=e,e=zr(t,n,a)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(n=$i())!==r?(qa=e,e=qr(t,n)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(n=Ri())!==r?(qa=e,e=Hr(t,n)):(za=e,e=r),e===r&&(e=za,(t=Pi())!==r&&(qa=e,t=Yr(t)),e=t))),e}())!==r?(n=za,ja++,a=vi(),ja--,a===r?n=void 0:(za=n,n=r),n!==r?(qa=e,e=Vr(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t;return e=za,(t=qi())!==r&&(qa=e,t=Mr()),(e=t)===r&&(e=za,(t=Hi())!==r&&(qa=e,t=Zr()),e=t),e}())===r&&(e=function(){var e,t;return e=za,(t=zi())!==r&&(qa=e,t=Fr()),t}())===r&&(e=function(){var e,t;return e=za,oo()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=_r(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t;return e=za,io()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=ir(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=Ci())===r&&(e=function(){var e,t;return e=za,so()!==r?(Ro(),(t=Zi())!==r?(qa=e,e=or(t)):(za=e,e=r)):(za=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=za,no()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=En(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=Oi())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=bn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=An(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=za,to()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Xi()!==r?(Ro(),(a=ai())!==r?(Ro(),i=za,eo()!==r?(o=Ro(),(s=ai())!==r?(Ro(),i=s):(za=i,i=r)):(za=i,i=r),i===r&&(i=null),$o()!==r?(qa=t,t=Pn(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),(i=Ao())!==r?(Ro(),(o=ai())!==r&&(s=$o())!==r?(qa=t,t=$n(n,a,o)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Rn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=za,ro()!==r?(Ro(),t=za,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),Xi()!==r?(Ro(),(i=ai())!==r?(Ro(),$o()!==r?(qa=t,t=Bn(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),n=Ni(),Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=Gn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Wn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,ao()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Yi()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=er(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=ai())!==r?(Ro(),$o()!==r?(qa=t,t=tr(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=nr(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,fo()!==r?(Ro(),t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),mo()!==r?(Ro(),(a=Si())!==r?(Ro(),$o()!==r?(qa=t,t=Un(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,Po()!==r?(Ro(),(n=ai())!==r?(Ro(),Ao()!==r?(Ro(),(a=Si())!==r?(Ro(),$o()!==r?(qa=t,t=kn(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t!==r?(qa=e,e=Vn(t)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=za,t=za,ja++,n=no(),ja--,n===r?t=void 0:(za=t,t=r),t!==r&&(n=ko())!==r?(Ro(),(a=ri())!==r?(qa=e,e=rr(n,a)):(za=e,e=r)):(za=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=za,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);a!==r;)n.push(a),a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);(a=Zo())!==r?(qa=e,e=br(t,n)):(za=e,e=r)}else za=e,e=r;else za=e,e=r;if(e===r)if(e=za,Mo()!==r)if(Ro(),(t=ai())!==r){for(Ro(),n=[],a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);a!==r;)n.push(a),a=za,(i=bi())!==r?(Ro(),a=i):(za=a,a=r);(a=Ai())!==r?(i=Ro(),Zo()!==r?(qa=e,e=Ar(t,n,a)):(za=e,e=r)):(za=e,e=r)}else za=e,e=r;else za=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=za,Mo()!==r){for(Ro(),t=[],n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);n!==r;)t.push(n),n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);(n=Zo())!==r?(qa=e,e=Pr(t)):(za=e,e=r)}else za=e,e=r;if(e===r)if(e=za,Mo()!==r){for(Ro(),t=[],n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);n!==r;)t.push(n),n=za,(a=Ei())!==r?(Ro(),n=a):(za=n,n=r);(n=Ai())!==r?(a=Ro(),Zo()!==r?(qa=e,e=$r(t,n)):(za=e,e=r)):(za=e,e=r)}else za=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=za,(t=function(){var e,t;return e=za,(t=function(){var e,t,n,a;if(e=za,(t=vi())!==r){for(n=[],a=gi();a!==r;)n.push(a),a=gi();qa=e,e=Dn(t,n)}else za=e,e=r;return e}())!==r&&(qa=e,t=Cn(t)),t}())!==r&&(qa=e,t=Nn(t)),(e=t)===r&&(e=za,(t=function(){var e,t;return e=za,Ti()!==r?(t=function(){var e,t,n;for(e=za,t=[],n=yi();n!==r;)t.push(n),n=yi();return qa=e,Mn(t)}(),Ti()!==r?(qa=e,e=Fn(t)):(za=e,e=r)):(za=e,e=r),e}())!==r&&(qa=e,t=On(t)),e=t),e}())===r&&(e=Li())===r&&(e=za,Po()!==r?(Ro(),(t=ai())!==r?(Ro(),$o()!==r?(qa=e,e=Sn(t)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)),e}function pi(){var e,t,n,a;if(e=za,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();qa=e,e=_n(t,n)}else za=e,e=r;return e}function vi(){var t;return t=e.charAt(za),Ie.test(t)?za++:(t=r,0===ja&&ei(ke)),t}function wi(){var t;return t=e.charAt(za),Te.test(t)?za++:(t=r,0===ja&&ei(Ve)),t}function gi(){var t;return t=e.charAt(za),Le.test(t)?za++:(t=r,0===ja&&ei(ze)),t}function yi(){var e;return(e=Ii())===r&&(e=function(){var e;return e=za,Ti()!==r&&Ti()!==r?(qa=e,e=Zn()):(za=e,e=r),e}()),e}function Ii(){var t;return t=e.charAt(za),Le.test(t)?za++:(t=r,0===ja&&ei(ze)),t}function Ti(){var t;return t=e.charAt(za),Se.test(t)?za++:(t=r,0===ja&&ei(qe)),t}function Li(){var t,n,a,i;return t=za,n=za,64===e.charCodeAt(za)?(a=p,za++):(a=r,0===ja&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(za=n,n=r),n!==r&&(qa=t,n=xn(n)),n}function Si(){var e,t,n;return e=za,(t=ho())===r&&(t=po()),t!==r&&(qa=e,t=zn()),(e=t)===r&&(e=za,(t=vo())!==r&&(qa=e,t=qn()),(e=t)===r&&(e=za,(t=wo())!==r&&(qa=e,t=Hn()),(e=t)===r&&(e=za,(t=go())!==r&&(qa=e,t=Yn()),(e=t)===r&&(e=za,(t=oo())!==r&&(qa=e,t=Kn()),(e=t)===r&&(e=za,(t=io())!==r&&(qa=e,t=jn()),(e=t)===r&&(e=za,(t=so())!==r&&(qa=e,t=Qn()),(e=t)===r&&(e=za,(t=yo())!==r?(Ro(),Po()!==r?(Ro(),(n=Ui())!==r?(Ro(),$o()!==r?(qa=e,e=Jn(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)))))))),e}function Ni(){var e,t;return e=za,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),qa=e,Xn(t)}function Oi(){var e,t;return e=za,(t=Lo())===r&&(t=Oo())===r&&(t=Co())===r&&(t=Do())===r&&(t=_o())===r&&(t=Fo())===r&&(t=So())===r&&(t=No()),t!==r&&(qa=e,t=ar(t)),t}function Ci(){var t,n,a,i;return t=za,To()!==r?(Ro(),n=e.charAt(za),ge.test(n)?za++:(n=r,0===ja&&ei($e)),n!==r?(Ro(),(a=Zi())!==r?(Ro(),(i=Di())!==r?(qa=t,t=sr(n,a,i)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r),t===r&&(t=za,To()!==r?(Ro(),(n=Zi())!==r?(Ro(),(a=Di())!==r?(qa=t,t=ur(n,a)):(za=t,t=r)):(za=t,t=r)):(za=t,t=r)),t}function Di(){var e,t,n;return e=za,(t=function(){var e,t,n;return e=za,(t=_i())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),$o()!==r?(qa=e,e=cr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=_i())!==r&&(qa=e,t=fr(t)),e=t),e}())!==r?(Ro(),Io()!==r?(Ro(),(n=function(){var e,t,n,a;return e=za,(t=_i())!==r&&(qa=e,t=dr(t)),(e=t)===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Ao()!==r?(Ro(),(a=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=mr(n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),$o()!==r?(qa=e,e=hr(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r&&(qa=e,t=pr()),e=t))),e}())!==r?(qa=e,e=lr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=za,(t=_i())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=vr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=_i())!==r&&(qa=e,t=wr(t)),(e=t)===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Mi())!==r?(Ro(),Ao()!==r?(Ro(),(a=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=gr(n,a)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r?(Ro(),Po()!==r?(Ro(),(n=Fi())!==r?(Ro(),$o()!==r?(qa=e,e=yr(n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e===r&&(e=za,(t=Fo())!==r&&(qa=e,t=Ir()),e=t)))),e}()),e}function _i(){var e,t;return e=za,(t=Co())!==r&&(qa=e,t=Tr()),(e=t)===r&&(e=za,(t=Do())!==r&&(qa=e,t=Lr()),(e=t)===r&&(e=za,(t=_o())!==r&&(qa=e,t=Sr()),(e=t)===r&&(e=za,(t=Oo())!==r&&(qa=e,t=Nr()),(e=t)===r&&(e=za,(t=Lo())!==r&&(qa=e,t=Or()),e=t)))),e}function Fi(){var e,t;return e=za,(t=Ui())!==r&&(qa=e,t=Cr(t)),t}function Mi(){var e,t;return e=za,(t=Ui())!==r&&(qa=e,t=Dr(t)),t}function Zi(){var e;return(e=xi())===r&&(e=Li()),e}function xi(){var t,n,a,i,o;if(t=za,39===e.charCodeAt(za)?(n=v,za++):(n=r,0===ja&&ei(Ye)),n===r&&(e.substr(za,2)===w?(n=w,za+=2):(n=r,0===ja&&ei(Ke))),n!==r){for(a=[],i=za,e.substr(za,2)===g?(o=g,za+=2):(o=r,0===ja&&ei(je)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(za),Ne.test(i)?za++:(i=r,0===ja&&ei(Qe)));i!==r;)a.push(i),i=za,e.substr(za,2)===g?(o=g,za+=2):(o=r,0===ja&&ei(je)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(za),Ne.test(i)?za++:(i=r,0===ja&&ei(Qe)));39===e.charCodeAt(za)?(i=v,za++):(i=r,0===ja&&ei(Ye)),i!==r?(qa=t,t=Er(a)):(za=t,t=r)}else za=t,t=r;return t}function Ei(){var e,t,n;return e=za,xo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(qa=e,e=Rr(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e}function bi(){var e,t,n;return e=za,xo()!==r?(Ro(),(t=ai())!==r?(Ro(),Eo()!==r?(Ro(),(n=ai())!==r?(qa=e,e=Ur(t,n)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r)):(za=e,e=r),e}function Ai(){var e,t;return e=za,bo()!==r?(Ro(),(t=ai())!==r?(qa=e,e=kr(t)):(za=e,e=r)):(za=e,e=r),e}function Pi(){var t,n,a;return(t=Ui())===r&&(t=za,n=e.charAt(za),ge.test(n)?za++:(n=r,0===ja&&ei($e)),n!==r&&(a=Ui())!==r?(qa=t,t=Kr(n,a)):(za=t,t=r)),t}function $i(){var t,n,a;return t=za,46===e.charCodeAt(za)?(n=y,za++):(n=r,0===ja&&ei(Je)),n!==r?((a=Ui())===r&&(a=null),qa=t,t=jr(a)):(za=t,t=r),t}function Ri(){var e,t,n;return e=za,(t=Vi())!==r&&(n=Ui())!==r?(qa=e,e=Qr(t,n)):(za=e,e=r),e}function Ui(){var e,t,n;if(e=za,t=[],(n=ki())!==r)for(;n!==r;)t.push(n),n=ki();else t=r;return t!==r&&(qa=e,t=Jr(t)),t}function ki(){var t;return t=e.charAt(za),Oe.test(t)?za++:(t=r,0===ja&&ei(Be)),t}function Vi(){var t,n,a;return t=za,n=e.charAt(za),Ce.test(n)?za++:(n=r,0===ja&&ei(Ge)),n!==r?(a=e.charAt(za),ge.test(a)?za++:(a=r,0===ja&&ei($e)),a===r&&(a=null),qa=t,t=Br(n,a)):(za=t,t=r),t}function zi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===I?za+=4:(n=r,0===ja&&ei(We)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function qi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===T?za+=4:(n=r,0===ja&&ei(Xe)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function Hi(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===L?za+=5:(n=r,0===ja&&ei(et)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?t=n=[n,a]:(za=t,t=r)):(za=t,t=r),t}function Yi(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===S?za+=2:(n=r,0===ja&&ei(tt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Gr()):(za=t,t=r)):(za=t,t=r),t}function Ki(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===N?za+=2:(n=r,0===ja&&ei(nt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Wr()):(za=t,t=r)):(za=t,t=r),t}function ji(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===O?za+=4:(n=r,0===ja&&ei(rt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Xr()):(za=t,t=r)):(za=t,t=r),t}function Qi(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===C?za+=6:(n=r,0===ja&&ei(at)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ea()):(za=t,t=r)):(za=t,t=r),t}function Ji(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===D?za+=3:(n=r,0===ja&&ei(it)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ta()):(za=t,t=r)):(za=t,t=r),t}function Bi(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===_?za+=3:(n=r,0===ja&&ei(ot)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=na()):(za=t,t=r)):(za=t,t=r),t}function Gi(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===F?za+=2:(n=r,0===ja&&ei(st)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ra()):(za=t,t=r)):(za=t,t=r),t}function Wi(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===M?za+=7:(n=r,0===ja&&ei(ut)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=aa()):(za=t,t=r)):(za=t,t=r),t}function Xi(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===Z?za+=4:(n=r,0===ja&&ei(lt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ia()):(za=t,t=r)):(za=t,t=r),t}function eo(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===x?za+=3:(n=r,0===ja&&ei(ct)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=oa()):(za=t,t=r)):(za=t,t=r),t}function to(){var t,n,a,i;return t=za,(n=e.substr(za,9)).toLowerCase()===E?za+=9:(n=r,0===ja&&ei(ft)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=sa()):(za=t,t=r)):(za=t,t=r),t}function no(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===b?za+=7:(n=r,0===ja&&ei(dt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ua()):(za=t,t=r)):(za=t,t=r),t}function ro(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===A?za+=4:(n=r,0===ja&&ei(mt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=la()):(za=t,t=r)):(za=t,t=r),t}function ao(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===P?za+=8:(n=r,0===ja&&ei(ht)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ca()):(za=t,t=r)):(za=t,t=r),t}function io(){var t,n,a,i;return t=za,(n=e.substr(za,9)).toLowerCase()===$?za+=9:(n=r,0===ja&&ei(pt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=fa()):(za=t,t=r)):(za=t,t=r),t}function oo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===R?za+=4:(n=r,0===ja&&ei(vt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=da()):(za=t,t=r)):(za=t,t=r),t}function so(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===U?za+=4:(n=r,0===ja&&ei(wt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ma()):(za=t,t=r)):(za=t,t=r),t}function uo(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===k?za+=7:(n=r,0===ja&&ei(gt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ha()):(za=t,t=r)):(za=t,t=r),t}function lo(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===V?za+=8:(n=r,0===ja&&ei(yt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=pa()):(za=t,t=r)):(za=t,t=r),t}function co(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===z?za+=4:(n=r,0===ja&&ei(It)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=va()):(za=t,t=r)):(za=t,t=r),t}function fo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===q?za+=4:(n=r,0===ja&&ei(Tt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=wa()):(za=t,t=r)):(za=t,t=r),t}function mo(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===H?za+=2:(n=r,0===ja&&ei(Lt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ga()):(za=t,t=r)):(za=t,t=r),t}function ho(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===Y?za+=7:(n=r,0===ja&&ei(St)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ya()):(za=t,t=r)):(za=t,t=r),t}function po(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===K?za+=3:(n=r,0===ja&&ei(Nt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ia()):(za=t,t=r)):(za=t,t=r),t}function vo(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===j?za+=8:(n=r,0===ja&&ei(Ot)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ta()):(za=t,t=r)):(za=t,t=r),t}function wo(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===J?za+=5:(n=r,0===ja&&ei(Ct)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=La()):(za=t,t=r)):(za=t,t=r),t}function go(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===B?za+=4:(n=r,0===ja&&ei(Dt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Sa()):(za=t,t=r)):(za=t,t=r),t}function yo(){var t,n,a,i;return t=za,(n=e.substr(za,7)).toLowerCase()===G?za+=7:(n=r,0===ja&&ei(_t)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Na()):(za=t,t=r)):(za=t,t=r),t}function Io(){var t,n,a,i;return t=za,(n=e.substr(za,2)).toLowerCase()===W?za+=2:(n=r,0===ja&&ei(Ft)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Oa()):(za=t,t=r)):(za=t,t=r),t}function To(){var t,n,a,i;return t=za,(n=e.substr(za,8)).toLowerCase()===X?za+=8:(n=r,0===ja&&ei(Mt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ca()):(za=t,t=r)):(za=t,t=r),t}function Lo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ee?za+=4:(n=r,0===ja&&ei(Zt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Da()):(za=t,t=r)):(za=t,t=r),t}function So(){var t,n,a,i;return t=za,(n=e.substr(za,13)).toLowerCase()===te?za+=13:(n=r,0===ja&&ei(xt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=_a()):(za=t,t=r)):(za=t,t=r),t}function No(){var t,n,a,i;return t=za,(n=e.substr(za,15)).toLowerCase()===ne?za+=15:(n=r,0===ja&&ei(Et)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Fa()):(za=t,t=r)):(za=t,t=r),t}function Oo(){var t,n,a,i;return t=za,(n=e.substr(za,5)).toLowerCase()===re?za+=5:(n=r,0===ja&&ei(bt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ma()):(za=t,t=r)):(za=t,t=r),t}function Co(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===ae?za+=3:(n=r,0===ja&&ei(At)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Za()):(za=t,t=r)):(za=t,t=r),t}function Do(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ie?za+=4:(n=r,0===ja&&ei(Pt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=xa()):(za=t,t=r)):(za=t,t=r),t}function _o(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===oe?za+=6:(n=r,0===ja&&ei($t)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ea()):(za=t,t=r)):(za=t,t=r),t}function Fo(){var t,n,a,i;return t=za,(n=e.substr(za,6)).toLowerCase()===se?za+=6:(n=r,0===ja&&ei(Rt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=ba()):(za=t,t=r)):(za=t,t=r),t}function Mo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ue?za+=4:(n=r,0===ja&&ei(Ut)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Aa()):(za=t,t=r)):(za=t,t=r),t}function Zo(){var t,n,a,i;return t=za,(n=e.substr(za,3)).toLowerCase()===le?za+=3:(n=r,0===ja&&ei(kt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Pa()):(za=t,t=r)):(za=t,t=r),t}function xo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===ce?za+=4:(n=r,0===ja&&ei(Vt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=$a()):(za=t,t=r)):(za=t,t=r),t}function Eo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===fe?za+=4:(n=r,0===ja&&ei(zt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ra()):(za=t,t=r)):(za=t,t=r),t}function bo(){var t,n,a,i;return t=za,(n=e.substr(za,4)).toLowerCase()===de?za+=4:(n=r,0===ja&&ei(qt)),n!==r?(a=za,ja++,i=wi(),ja--,i===r?a=void 0:(za=a,a=r),a!==r?(qa=t,t=Ua()):(za=t,t=r)):(za=t,t=r),t}function Ao(){var t;return 44===e.charCodeAt(za)?(t=me,za++):(t=r,0===ja&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(za)?(t=he,za++):(t=r,0===ja&&ei(Yt)),t}function $o(){var t;return 41===e.charCodeAt(za)?(t=pe,za++):(t=r,0===ja&&ei(Kt)),t}function Ro(){var e,t;for(e=[],t=Uo();t!==r;)e.push(t),t=Uo();return e}function Uo(){var t;return t=e.charAt(za),De.test(t)?za++:(t=r,0===ja&&ei(jt)),t}function ko(){var t,n,a,i;if(t=za,(n=pi())!==r&&(qa=t,n=ka(n)),(t=n)===r)if(t=za,96===e.charCodeAt(za)?(n=ve,za++):(n=r,0===ja&&ei(Qt)),n!==r){if(a=[],i=e.charAt(za),_e.test(i)?za++:(i=r,0===ja&&ei(Jt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(za),_e.test(i)?za++:(i=r,0===ja&&ei(Jt));else a=r;a!==r?(96===e.charCodeAt(za)?(i=ve,za++):(i=r,0===ja&&ei(Qt)),i!==r?(qa=t,t=Va(a)):(za=t,t=r)):(za=t,t=r)}else za=t,t=r;return t}function Vo(e,t,n,r,a){const i={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(i.escape=r),i}function zo(e,...t){return{type:"expression-list",location:e,value:t}}function qo(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=Vo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:za,peg$FAILED:r,peg$maxFailExpected:Ka,peg$maxFailPos:Ya};if(n!==r&&za===e.length)return n;throw n!==r&&za<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(Ka,Ya<e.length?e.charAt(Ya):null,Ya<e.length?Xa(Ya,Ya+1):Xa(Ya,Ya))}(e)}}function G(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":G(e.operand,t),G(e.value,t);break;case"case-expression":for(const n of e.clauses)G(n,t);"simple"===e.format&&G(e.operand,t),null!==e.else&&G(e.else,t);break;case"expression-list":for(const n of e.value)G(n,t);break;case"unary-expression":G(e.expr,t);break;case"binary-expression":G(e.left,t),G(e.right,t);break;case"function":G(e.args,t);break;case"interval":G(e.value,t),G(e.qualifier,t);break;case"interval-qualifier":G(e.start,t),G(e.end,t)}}const W=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 Se(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 ve(e,t)}currentTimestamp(e){return we(e)}currentDate(e){return ge(e)}currentTime(e){return ye(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 R(t,n,e)}calculate(e,t,n,r){return K(e,t,n,r)}evaluateTime(e){return F(e)}evaluateTimestamp(e,t,n){return M(e,t,n)}evaluateDate(e,t){return Z(e,t)}evaluateFunction(e,t,n){return z(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:R(e,t[0],">=")&&R(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:R(e,t[0],"<")||R(e,t[1],">")}ternaryNot(e){return me(e)}ternaryAnd(e,t){return he(e,t)}ternaryOr(e,t){return pe(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",ie="attributeAdapter",oe="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,ie,oe,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),i=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,i)})`:`(${t} = ${a}, ${t} == null ? null : ${e}.has(${t}))`}return ee("applyIn",a,i)}_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 o.L8(o.Z7.UnsupportedIsRhs);return ee("equalsNull",this._compileNode(e.left));case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.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 o.L8(o.Z7.UnsupportedOperator,{operator:e.operator})}case"null":case"boolean":case"string":case"number":return te(e.value);case"time":try{return this._compileRefStaticData(this._storeStaticData(F(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(Z(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(M(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),oe,ie);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 o.L8(o.Z7.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=B.parse(e);const{isStandardized:a,isAggregate:i,currentUserRequired:o,referencedFieldNames:s}=this._extractExpressionInfo(t);this._referencedFieldNames=s,this.isStandardized=a,this.isAggregate=i,this.currentUserRequired=o}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():_(e)?e.toStorageFormat():D(e)?e.toStorageString():C(e)?e.toStorageFormat():e;switch(t){case"date":return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():_(e)?e.toMilliseconds():C(e)?e.toNumber():e;case"date-only":return(0,b.$P)(e)?i.n.fromDateJS(e).toString():_(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,b.$P)(e)?d.k.fromDateJS(e).toStorageString():O(e)?d.k.fromDateTime(e).toStorageString():_(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():D(e)?e.toStorageString():e;case"timestamp-offset":if((0,b.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(O(e))return f.g.fromDateTime(e).toStorageFormat();if(_(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,G(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||W.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return G(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return G(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 G(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,i=!1,o=!1;return G(this.parseTree,(s=>{switch(s.type){case"column-reference":{const r=e?.get(s.column);let a,i;r?a=i=r.name??"":(i=s.column,a=i.toLowerCase()),n.has(a)||(n.add(a),t.push(i)),s.column=i;break}case"current-user":o=!0;break;case"function":{const{name:e,args:t}=s,n=t.value.length;r&&(r=function(e,t){const n=Y[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===i&&(i=(0,a.M)(e,n));break}}})),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:i,currentUserRequired:o}}_evaluateNode(e,t,n,r,i){let s;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,i);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,i);for(let o=0;o<e.clauses.length;o++)if(R(a,this._evaluateNode(e.clauses[o].operand,t,n,r,i),"="))return this._evaluateNode(e.clauses[o].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}else{for(let a=0;a<e.clauses.length;a++)if(fe(this._evaluateNode(e.clauses[a].operand,t,n,r,i)))return this._evaluateNode(e.clauses[a].value,t,n,r,i);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,i)}return null;case"parameter":return s=this.parameters[e.value.toLowerCase()],(0,b.$P)(s)?h.c9.fromJSDate(s):null!=s&&"object"==typeof s&&"toDateTime"in s?s.toDateTime():s;case"expression-list":{const a=[];for(const o of e.value)a.push(this._evaluateNode(o,t,n,r,i));return a}case"unary-expression":return me(this._evaluateNode(e.expr,t,n,r,i));case"binary-expression":switch(e.operator){case"AND":return he(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"OR":return pe(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i));case"IS":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null===this._evaluateNode(e.left,t,n,r,i);case"ISNOT":if("null"!==e.right.type)throw new o.L8(o.Z7.UnsupportedIsRhs);return null!==this._evaluateNode(e.left,t,n,r,i);case"IN":{const a=de(this._evaluateNode(e.right,t,n,r,i));return ve(this._evaluateNode(e.left,t,n,r,i),a)}case"NOT IN":{const a=de(this._evaluateNode(e.right,t,n,r,i));return me(ve(this._evaluateNode(e.left,t,n,r,i),a))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],">=")&&R(a,o[1],"<=")}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,i),o=this._evaluateNode(e.right,t,n,r,i);return null==a||null==o[0]||null==o[1]?null:R(a,o[0],"<")||R(a,o[1],">")}case"LIKE":return Le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return me(Le(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return R(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator);case"-":case"+":case"*":case"/":case"||":return K(e.operator,this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=Z(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"time":return F(e.value);case"current-time":return"date"===e.mode?ge(this.timeZone):"time"===e.mode?ye(this.timeZone):we(this.timeZone);case"current-user":return i??null;case"column-reference":return Se(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,i));t.push(e)}return(0,a.s)(e.name,t)}const o=this._evaluateNode(e.args,t,n,r,i);return z(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function fe(e){return!0===e}function de(e){return Array.isArray(e)?e:[e]}function me(e){return null!==e?!0!==e:null}function he(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function pe(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function ve(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(P(e)&&P(r)&&(n=R(e,r,"="),n))break}return n}function we(e){return S(new Date,e)}function ge(e){return i.n.fromNow(e)}function ye(e){const t=S(new Date,e);return d.k.fromDateTime(t)}const Ie="-[]/{}()*+?.\\^$|";var Te;function Le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=Te.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case Te.Normal:i===n?a=Te.Escaped:Ie.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case Te.Escaped:Ie.includes(i)?r+="\\"+i:r+=i,a=Te.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Se(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t),o=n?.get(t);return null==a||"esriFieldTypeDate"!==o?.type&&"date"!==o?.type?null==a||"esriFieldTypeDateOnly"!==o?.type&&"date-only"!==o?.type?null==a||"esriFieldTypeTimeOnly"!==o?.type&&"time-only"!==o?.type?null==a||"esriFieldTypeTimestampOffset"!==o?.type&&"timestamp-offset"!==o?.type?a:new f.g(a):d.k.fromReader(a):i.n.fromReader(a):S(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance)}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Te||(Te={}));const Ne={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}},95466:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(49186),a=n(25482),i=n(53966),o=n(91869),s=n(3330),u=n(30524),l=n(98623),c=n(56400),f=n(96285);const d=new Map;class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],w(e))}static fromLayerJSON(e){return new m(e.fields??[],w(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 n=[];for(const e of this.fields){const t=e?.name,r=p(t);if(t&&r){const a=h(t);this._fieldsMap.set(t,e),this._fieldsMap.set(a,e),this._normalizedFieldsMap.set(r,e),n.push(`${a}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,u.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,u.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,u.te)(e)||(0,u.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,u.te)(e)||(0,u.Xz)(e)||e.nullable||void 0!==(0,u.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(h(e))??this._normalizedFieldsMap.get(p(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 r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),l.n$):v.has(t.type)?l.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===l.L5?s.GB.instance:t===l.n$?f.mQ.utcInstance:(0,o.tE)(d,t,(()=>f.oh.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,u.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=>a.A.isSerializable(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function h(e){return e.trim().toLowerCase()}function p(e){return(0,u.rS)(e)?.toLowerCase()??""}const v=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function w(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:a}=e,i=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",s=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,u=a?function(e){return"timeZone"in e}(a)?a.timeZone??s:a.dateFieldsTimeReference?(0,c.ZS)(a.dateFieldsTimeReference):s??l.n$:null,f=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,c.ZS)(r.timeReference):s:null,d=new Map([[h(a?.creationDateField??""),u],[h(a?.editDateField??""),u],[h(i),f],[h(o),f]]);for(const{name:r,type:a}of e.fields)if(v.has(a))t.set(r,l.L5);else if("date"!==a&&"esriFieldTypeDate"!==a)t.set(r,null);else if(n)t.set(r,l.L5);else{const e=d.get(h(r??""))??s;t.set(r,e)}return t}}}]);