@arcgis/core 4.33.0-next.20250423 → 4.33.0-next.20250424
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.
- package/Graphic.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/Analysis.d.ts +4 -0
- package/analysis/Analysis.js +1 -1
- package/analysis/SliceAnalysis.js +1 -1
- package/analysis/SlicePlane.js +1 -1
- package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
- package/analysis/support/AnalysisOriginWebScene.js +5 -0
- package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f8782b3b6ad414409e8.js → 0a48b9734ab4c64a6f4f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ccc50f28f217e50cc2c3.js → 1427e7953c3d8c87c5e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{184d7c8ea818bec5c462.js → 146b3699a9e8b1f2dcc2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
- package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
- package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa8a3c75f9b41d31559b.js → 265f69d153b7b6f07e42.js} +1 -1
- package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
- package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
- package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
- package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
- package/assets/esri/core/workers/chunks/5958af341014e13475d2.js +1 -0
- package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
- package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
- package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
- package/assets/esri/core/workers/chunks/7ffa68d69c138db1295d.js +1 -0
- package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +1 -0
- package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
- package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
- package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
- package/assets/esri/core/workers/chunks/{a276980c06d5d311a37e.js → 9f416cc5673665f8c37c.js} +1 -1
- package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
- package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
- package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
- package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
- package/assets/esri/core/workers/chunks/{26fcbe053194bd78fcc3.js → d8474dca270b25705699.js} +1 -1
- package/assets/esri/core/workers/chunks/{7c42281188b874ffcdad.js → db5913824d5e5a2a8365.js} +1 -1
- package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
- package/assets/esri/core/workers/chunks/{9408a72968cbd985dd24.js → f2cef954b58c6604642c.js} +34 -34
- package/chunks/BloomBlur.glsl.js +7 -7
- package/chunks/BloomComposition.glsl.js +24 -25
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/sphere.js +1 -1
- package/core/Collection.js +1 -1
- package/core/JSONSupport.js +1 -1
- package/core/SetUtils.js +1 -1
- package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +344 -111
- package/layers/DimensionLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/ViewshedLayer.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/FieldsIndex.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
- package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
- package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
- package/layers/support/rasterFunctions/RemapFunction.js +1 -1
- package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
- package/layers/support/videoUtils.js +5 -0
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/atmosphereUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/cameraUtilsSpherical.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/terrain/OverlayRenderTargets.js +1 -1
- package/views/3d/webgl/ManagedDepthTexture.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -14
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/webgl/FBOAttachmentType.js +5 -0
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Renderbuffer.js +1 -1
- package/views/webgl/RenderbufferDescriptor.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/TextureDescriptor.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/webscene/InitialViewProperties.js +1 -1
- package/webscene/Presentation.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/SlideLegendInfo.js +1 -1
- package/webscene/background/ColorBackground.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/webscene/spec-certification/index.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/webscene/support/Description.js +1 -1
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlideEnvironment.js +1 -1
- package/webscene/support/SlideGround.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/webscene/support/Title.js +1 -1
- package/webscene/support/analysisUtils.js +5 -0
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/support/SketchController.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
- package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
- package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
- package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
- package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
- package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
- package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
- package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
- package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
- package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
- package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
- package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
- package/views/webgl/formats.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[254],{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)}}},2272:(e,t,n)=>{n.d(t,{Dl:()=>l,gf:()=>d,jV:()=>u,lF:()=>c});var r=n(92602),a=n(70333),i=n(4718),o=n(84952),s=n(926);function u(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,o.An)(e):(0,i.o8)(e)}function c(e,t,n){const r={};for(const a in e){if("declaredClass"===a)continue;const i=e[a];if(null!=i&&"function"!=typeof i)if(Array.isArray(i))r[a]=i.map((e=>c(e)));else if("object"==typeof i)if(i.toJSON){const e=i.toJSON(n?.[a]);r[a]=t?e:JSON.stringify(e)}else r[a]=t?i:JSON.stringify(i);else r[a]=i}return r}async function d(e,t,i){const o=function(e,t){return e?(0,s.Jn)(e,t)?t||r.A.apiKey:a.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!a.id&&r.A.request.useIdentity&&await Promise.all([n.e(7292),n.e(3747)]).then(n.bind(n,73747));const u=await(a.id?.getCredential(e,i));return u?.token}},3330:(e,t,n)=>{n.d(t,{GB:()=>a,Qo:()=>o,Y4:()=>i});var r=n(96285);class a{static{this.instance=new r.oh("Etc/UTC")}}function i(e){return e instanceof r.bo?e===a.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return i(e)?a.instance:e}},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 d=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let f="";i<10&&(f="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${f+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(d+"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)}}},66131:(e,t,n)=>{n.d(t,{lY:()=>d,mT:()=>f});var r,a=n(799),i=n(3330),o=n(96285);(r||(r={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const s={[r.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class u extends Error{constructor(e,t){super((0,a.HC)(s[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,u)}}function l(e,t,n){return e<t?e-t:e>n?e-n:0}function c(e,t,n){return e<t?t:e>n?n:e}class d{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,n=1,r=0,a=0,i=0,s=0,u){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(a)||isNaN(i)||isNaN(s))return null;const m=o.c9.local(e,t).daysInMonth;let h=o.c9.fromObject({day:c(n,1,m),year:e,month:c(t,1,12),hour:c(r,0,23),minute:c(a,0,59),second:c(i,0,59),millisecond:c(s,0,999)},{zone:f(u)});return h=h.plus({months:l(t,1,12),days:l(n,1,m),hours:l(r,0,23),minutes:l(a,0,59),seconds:l(i,0,59),milliseconds:l(s,0,999)}),new d(h)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const n=f(t);return e.isUnknownTimeZone||n===i.GB.instance?d.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,n):new d(e._date.setZone(n))}static dateJSToArcadeDate(e){return new d(o.c9.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const n=f(t);return new d(o.c9.fromJSDate(e,{zone:n}))}static unknownEpochToArcadeDate(e){return new d(o.c9.fromMillis(e,{zone:i.GB.instance}))}static unknownDateJSToArcadeDate(e){return new d(o.c9.fromMillis(e.getTime(),{zone:i.GB.instance}))}static epochToArcadeDate(e,t="system"){const n=f(t);return new d(o.c9.fromMillis(e,{zone:n}))}static dateTimeToArcadeDate(e){return new d(e)}clone(){return new d(this._date)}changeTimeZone(e){const t=f(e);return d.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const n=f(t);return e.zone===i.GB.instance||n===i.GB.instance?d.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,n):new d(e.setZone(n))}static nowToArcadeDate(e){const t=f(e);return new d(o.c9.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new d(o.c9.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===d.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===i.GB.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new d(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new d(this._date.toUTC())}toLocal(){return new d(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=o.c9.fromISO(e,{setZone:!0});return new d(t)}}function f(e,t=!0){if(e instanceof o.bo)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return i.GB.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=o.mQ.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const n=o.oh.create(e);if(!n.isValid){if(t)throw new u(r.TimeZoneNotRecognized);return null}return n}},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=>d(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(!f(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 d(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(!f(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function f(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=d(e);if(null===t)return null;let n=0;for(const r of e){if(!f(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 d=n(55612),f=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]+)$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,T=/^(\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})$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,S=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function L(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 D(e){return i.n.isDateOnly(e)}function _(e){return f.k.isTimeOnly(e)}function C(e){return d.g.isTimestampOffset(e)}function Z(e){let t=p.exec(e);if(null!==t){const[,e,n,r]=t,a=f.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=f.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=f.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 F(e,t,n=!1){let r=g.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=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,f]=r,m=d.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(f,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=d.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=S.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=y.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 M(e,t){const n=y.exec(e);if(null===n)try{return F(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)||!!C(e)}function P(e){return!!(O(e)||D(e)||C(e)||_(e))}function U(e){if(O(e))return e.toMillis();if(D(e))return e.toNumber();if(C(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function $(e,t,n){if(null==e||null==t)return null;if((0,b.Et)(e)){if((0,b.Et)(t))return R(e,t,n);if((0,b.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return R(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(D(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 R(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator);if(C(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(d.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(d.g.isTimestampOffset(e))return k(e,t,n)}return R(U(e),U(t),n)}if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return R((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(_(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(C(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),R(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"),R(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))return R(e.toNumber(),t.toNumber(),n);if(_(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(_(e)){if(_(t))return R(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if(A(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(A(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):R(U(e),U(t),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return R((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(_(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 R(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){d.g.isTimestampOffset(e)&&(e=e.toDateTime()),d.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=z(e),a=z(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function z(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function V(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)||D(e)||O(e)||_(e)||C(e))}function H(e){return D(e)||_(e)?e.toString():C(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(D(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(_(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(C(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes}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=>$(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 f.k.fromDateJS(e);if(O(e))return f.k.fromDateTime(e);if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e))return e;if(C(e))return f.k.fromSqlTimeStampOffset(e);if((0,b.Kg)(e))return Z(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(D(e))return e;if(_(e))throw new o.L8(o.Z7.CannotCastValue);if(C(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 L(e,t);if(O(e))return e;if(D(e))return e.toDateTimeLuxon("unknown");if(_(e))throw new o.L8(o.Z7.CannotCastValue);if(C(e))return e;if((0,b.Kg)(e))return F(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 J(e,t,n,r){if("||"===e)return V("concat",[t,n],r);if(null===t||null===n)return null;if((0,b.Et)(t)){if((0,b.Et)(n))return B(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(_(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(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 B(e,r,n)}(t,n,e);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(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(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(C(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(_(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(_(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(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(_(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(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.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(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(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(C(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(C(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(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(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(C(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 B(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(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(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 B(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 K{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=">",d="<=",f="<>",m="!=",h="||",p="@",v="'",w="N'",y="''",g=".",T="null",I="true",S="false",L="in",N="is",O="like",D="escape",_="not",C="and",Z="or",F="between",M="from",x="for",E="substring",b="extract",A="trim",P="position",U="timestamp",$="date",R="time",k="leading",z="trailing",V="both",q="cast",H="as",Y="integer",J="int",B="smallint",j="float",K="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",de="then",fe="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ye=/^[+\-]/,ge=/^[*\/]/,Te=/^[A-Za-z_\x80-\uFFFF]/,Ie=/^[A-Za-z0-9_]/,Se=/^[A-Za-z0-9_.\x80-\uFFFF]/,Le=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,De=/^[eE]/,_e=/^[ \t\n\r]/,Ce=/^[^`]/,Ze=Ka("!",!1),Fe=Ka("=",!1),Me=Ka(">=",!1),xe=Ka(">",!1),Ee=Ka("<=",!1),be=Ka("<>",!1),Ae=Ga([["<","="]],!1,!1),Pe=Ka("!=",!1),Ue=Ga(["+","-"],!1,!1),$e=Ka("||",!1),Re=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["",""]],!1,!1),ze=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),qe=Ga(['"'],!1,!1),He=Ka("@",!1),Ye=Ka("'",!1),Je=Ka("N'",!1),Be=Ka("''",!1),Qe=Ga(["'"],!0,!1),je=Ka(".",!1),Ke=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=Ka("NULL",!0),Xe=Ka("TRUE",!0),et=Ka("FALSE",!0),tt=Ka("IN",!0),nt=Ka("IS",!0),rt=Ka("LIKE",!0),at=Ka("ESCAPE",!0),it=Ka("NOT",!0),ot=Ka("AND",!0),st=Ka("OR",!0),ut=Ka("BETWEEN",!0),lt=Ka("FROM",!0),ct=Ka("FOR",!0),dt=Ka("SUBSTRING",!0),ft=Ka("EXTRACT",!0),mt=Ka("TRIM",!0),ht=Ka("POSITION",!0),pt=Ka("TIMESTAMP",!0),vt=Ka("DATE",!0),wt=Ka("TIME",!0),yt=Ka("LEADING",!0),gt=Ka("TRAILING",!0),Tt=Ka("BOTH",!0),It=Ka("CAST",!0),St=Ka("AS",!0),Lt=Ka("INTEGER",!0),Nt=Ka("INT",!0),Ot=Ka("SMALLINT",!0),Dt=Ka("FLOAT",!0),_t=Ka("REAL",!0),Ct=Ka("VARCHAR",!0),Zt=Ka("TO",!0),Ft=Ka("INTERVAL",!0),Mt=Ka("YEAR",!0),xt=Ka("TIMEZONE_HOUR",!0),Et=Ka("TIMEZONE_MINUTE",!0),bt=Ka("MONTH",!0),At=Ka("DAY",!0),Pt=Ka("HOUR",!0),Ut=Ka("MINUTE",!0),$t=Ka("SECOND",!0),Rt=Ka("CASE",!0),kt=Ka("END",!0),zt=Ka("WHEN",!0),Vt=Ka("THEN",!0),qt=Ka("ELSE",!0),Ht=Ka(",",!1),Yt=Ka("(",!1),Jt=Ka(")",!1),Bt=Ga([" ","\t","\n","\r"],!1,!1),Qt=Ka("`",!1),jt=Ga(["`"],!0,!1),Kt=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):zo(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 Vo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},dn=function(e,t,n){return Vo(Qa(),t,n)},fn=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}},yn=function(e,t){return{op:e,right:t}},gn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Tn=function(e,t){return qo(e,t)},In=function(e,t,n){return{op:t,expr:n,location:Qa()}},Sn=function(e,t){return qo(e,t)},Ln=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}},Dn=function(e){return e},_n=function(e,t){return e+t.join("")},Cn=function(e,t){return e+t.join("")},Zn=function(e){return e},Fn=function(e){return e.join("")},Mn=function(){return'"'},xn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return Vo(Qa(),e,t)},bn=function(e,t){return Vo(Qa(),e,t)},An=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return Vo(Qa(),e,t,...n?[n]:[])},Un=function(e,t,n){return Vo(Qa(),e,t,n)},$n=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},Rn=function(e,t){return Vo(Qa(),e,t)},kn=function(e,t){return Vo(Qa(),e,t)},zn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},Vn=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"}}},Jn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},Bn=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)}}},Kn=function(e,t,n){return Vo(Qa(),e,t,n)},Gn=function(e,t){return Vo(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 Vo(Qa(),e,t)},tr=function(e,t){return Vo(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}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},fr=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}},yr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},gr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Tr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Ir=function(){return{type:"string",location:Qa(),value:"day"}},Sr=function(){return{type:"string",location:Qa(),value:"hour"}},Lr=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"}},Dr=function(e){return parseFloat(e)},_r=function(e){return parseFloat(e)},Cr=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}},Zr=function(){return{type:"null",location:Qa(),value:null}},Fr=function(){return{type:"boolean",location:Qa(),value:!0}},Mr=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}},Ur=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},$r=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},zr=function(e){return{type:"number",location:Qa(),value:e}},Vr=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)},Jr=function(e,t){return e[0]+t},Br=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},jr=function(e){return e.join("")},Kr=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"},da=function(){return"TIMESTAMP"},fa=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ya=function(){return"AS"},ga=function(){return"INTEGER"},Ta=function(){return"INT"},Ia=function(){return"SMALLINT"},Sa=function(){return"FLOAT"},La=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Da=function(){return"INTERVAL"},_a=function(){return"YEAR"},Ca=function(){return"TIMEZONE_HOUR"},Za=function(){return"TIMEZONE_MINUTE"},Fa=function(){return"MONTH"},Ma=function(){return"DAY"},xa=function(){return"HOUR"},Ea=function(){return"MINUTE"},ba=function(){return"SECOND"},Aa=function(){return"CASE"},Pa=function(){return"END"},Ua=function(){return"WHEN"},$a=function(){return"THEN"},Ra=function(){return"ELSE"},ka=function(e){return e},za=function(e){return e.join("")},Va=0|t.peg$currPos,qa=Va,Ha=[{line:1,column:1}],Ya=Va,Ja=t.peg$maxFailExpected||[],Ba=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,Va)}function ja(e,t){throw ti(e,t=void 0!==t?t:Xa(qa,Va))}function Ka(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){Va<Ya||(Va>Ya&&(Ya=Va,Ja=[]),Ja.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=Va,$o(),(t=ai())!==r?($o(),qa=e,e=Kt(t)):(Va=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=Va,Po()!==r){for($o(),t=[],n=ai();n!==r;)t.push(n),n=Va,a=Va,i=$o(),(o=Ao())!==r?a=i=[i,o,$o()]:(Va=a,a=r),a!==r&&(a=ai())===r?(Va=n,n=r):n=a;n=$o(),(a=Uo())!==r?(qa=e,e=Gt(t)):(Va=e,e=r)}else Va=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=Va,(t=ii())!==r){for(n=[],a=Va,$o(),(i=Gi())!==r?($o(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=Gi())!==r?($o(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=Xt(t,n)}else Va=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=Va,(t=oi())!==r){for(n=[],a=Va,$o(),(i=Ki())!==r?($o(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=Ki())!==r?($o(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=tn(t,n)}else Va=e,e=r;return e}function oi(){var t,n,a,i,o;return t=Va,(n=ji())===r&&(n=Va,33===e.charCodeAt(Va)?(a=s,Va++):(a=r,0===Ba&&ei(Ze)),a!==r?(i=Va,Ba++,61===e.charCodeAt(Va)?(o=u,Va++):(o=r,0===Ba&&ei(Fe)),Ba--,o===r?i=void 0:(Va=i,i=r),i!==r?n=a=[a,i]:(Va=n,n=r)):(Va=n,n=r)),n!==r?(a=$o(),(i=oi())!==r?(qa=t,t=nn(i)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=Va,(t=ci())!==r?(n=Va,$o(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Va,t=[],n=Va,$o(),(a=si())!==r?($o(),(i=ci())!==r?(qa=n,n=an(a,i)):(Va=n,n=r)):(Va=n,n=r),n!==r)for(;n!==r;)t.push(n),n=Va,$o(),(a=si())!==r?($o(),(i=ci())!==r?(qa=n,n=an(a,i)):(Va=n,n=r)):(Va=n,n=r);else t=r;return t!==r&&(qa=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=Va,(t=li())!==r?($o(),(n=ri())!==r?(qa=e,e=wn(t,n)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=li())!==r?($o(),(n=Si())!==r?(qa=e,e=yn(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=Va,(t=ji())!==r?($o(),(n=Wi())!==r?(a=$o(),i=Va,(o=ci())!==r?($o(),(s=Ki())!==r?($o(),(u=ci())!==r?(qa=i,i=ln(n,o,u)):(Va=i,i=r)):(Va=i,i=r)):(Va=i,i=r),i!==r?(qa=e,e=cn(n,i)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Wi())!==r?($o(),n=Va,(a=ci())!==r?(i=$o(),(o=Ki())!==r?($o(),(s=ci())!==r?(qa=n,n=dn(t,a,s)):(Va=n,n=r)):(Va=n,n=r)):(Va=n,n=r),n!==r?(qa=e,e=fn(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Va,(t=Ji())!==r?($o(),(n=ji())!==r?($o(),(a=ci())!==r?(qa=e,e=sn(t,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Ji())!==r?($o(),(n=ci())!==r?(qa=e,e=un(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Va,(t=ui())!==r?($o(),(n=Mi())!==r?($o(),Qi()!==r?($o(),(a=xi())!==r?(qa=e,e=pn(t,n,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=ui())!==r?($o(),(n=Mi())!==r?(qa=e,e=vn(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}()),e}())!==r?n=a:(Va=n,n=r),n===r&&(n=null),qa=e,e=rn(t,n)):(Va=e,e=r),e}()),t}function si(){var t;return e.substr(Va,2)===l?(t=l,Va+=2):(t=r,0===Ba&&ei(Me)),t===r&&(62===e.charCodeAt(Va)?(t=c,Va++):(t=r,0===Ba&&ei(xe)),t===r&&(e.substr(Va,2)===d?(t=d,Va+=2):(t=r,0===Ba&&ei(Ee)),t===r&&(e.substr(Va,2)===f?(t=f,Va+=2):(t=r,0===Ba&&ei(be)),t===r&&(t=e.charAt(Va),we.test(t)?Va++:(t=r,0===Ba&&ei(Ae)),t===r&&(e.substr(Va,2)===m?(t=m,Va+=2):(t=r,0===Ba&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=Va,t=Va,(n=ji())!==r?(a=$o(),(i=Bi())!==r?t=n=[n,a,i]:(Va=t,t=r)):(Va=t,t=r),t!==r&&(qa=e,t=mn(t)),(e=t)===r&&(e=Bi()),e}function li(){var e,t,n,a,i;return e=Va,t=Va,(n=ji())!==r?(a=$o(),(i=Yi())!==r?t=n=[n,a,i]:(Va=t,t=r)):(Va=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=Va,(t=fi())!==r){for(n=[],a=Va,$o(),(i=di())!==r?($o(),(o=fi())!==r?(qa=a,a=gn(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=di())!==r?($o(),(o=fi())!==r?(qa=a,a=gn(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=Tn(t,n)}else Va=e,e=r;return e}function di(){var t;return t=e.charAt(Va),ye.test(t)?Va++:(t=r,0===Ba&&ei(Ue)),t===r&&(e.substr(Va,2)===h?(t=h,Va+=2):(t=r,0===Ba&&ei($e))),t}function fi(){var e,t,n,a,i,o;if(e=Va,(t=hi())!==r){for(n=[],a=Va,$o(),(i=mi())!==r?($o(),(o=hi())!==r?(qa=a,a=In(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=mi())!==r?($o(),(o=hi())!==r?(qa=a,a=In(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=Sn(t,n)}else Va=e,e=r;return e}function mi(){var t;return t=e.charAt(Va),ge.test(t)?Va++:(t=r,0===Ba&&ei(Re)),t}function hi(){var e,t;return(e=function(){var e;return(e=xi())===r&&(e=function(){var e,t,n,a;return e=Va,(t=function(){var e,t,n,a;return e=Va,(t=Pi())!==r&&(n=Ui())!==r&&(a=$i())!==r?(qa=e,e=Vr(t,n,a)):(Va=e,e=r),e===r&&(e=Va,(t=Pi())!==r&&(n=Ui())!==r?(qa=e,e=qr(t,n)):(Va=e,e=r),e===r&&(e=Va,(t=Pi())!==r&&(n=$i())!==r?(qa=e,e=Hr(t,n)):(Va=e,e=r),e===r&&(e=Va,(t=Pi())!==r&&(qa=e,t=Yr(t)),e=t))),e}())!==r?(n=Va,Ba++,a=vi(),Ba--,a===r?n=void 0:(Va=n,n=r),n!==r?(qa=e,e=zr(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t;return e=Va,(t=qi())!==r&&(qa=e,t=Fr()),(e=t)===r&&(e=Va,(t=Hi())!==r&&(qa=e,t=Mr()),e=t),e}())===r&&(e=function(){var e,t;return e=Va,(t=Vi())!==r&&(qa=e,t=Zr()),t}())===r&&(e=function(){var e,t;return e=Va,oo()!==r?($o(),(t=Mi())!==r?(qa=e,e=Cr(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t;return e=Va,io()!==r?($o(),(t=Mi())!==r?(qa=e,e=ir(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=Di())===r&&(e=function(){var e,t;return e=Va,so()!==r?($o(),(t=Mi())!==r?(qa=e,e=or(t)):(Va=e,e=r)):(Va=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=Va,no()!==r?($o(),t=Va,Po()!==r?($o(),(n=Oi())!==r?($o(),Xi()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=En(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=Oi())!==r?($o(),Ao()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=bn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=An(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=Va,to()!==r?($o(),t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Xi()!==r?($o(),(a=ai())!==r?($o(),i=Va,eo()!==r?(o=$o(),(s=ai())!==r?($o(),i=s):(Va=i,i=r)):(Va=i,i=r),i===r&&(i=null),Uo()!==r?(qa=t,t=Pn(n,a,i)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Ao()!==r?($o(),(a=ai())!==r?($o(),(i=Ao())!==r?($o(),(o=ai())!==r&&(s=Uo())!==r?(qa=t,t=Un(n,a,o)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=$n(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=Va,ro()!==r?($o(),t=Va,Po()!==r?($o(),n=Ni(),$o(),(a=ai())!==r?($o(),Xi()!==r?($o(),(i=ai())!==r?($o(),Uo()!==r?(qa=t,t=Kn(n,a,i)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),n=Ni(),$o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=Gn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=Wn(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Va,ao()!==r?($o(),t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Yi()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=er(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Ao()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=tr(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=nr(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Va,fo()!==r?($o(),t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),mo()!==r?($o(),(a=Li())!==r?($o(),Uo()!==r?(qa=t,t=Rn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Ao()!==r?($o(),(a=Li())!==r?($o(),Uo()!==r?(qa=t,t=kn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=zn(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Va,t=Va,Ba++,n=no(),Ba--,n===r?t=void 0:(Va=t,t=r),t!==r&&(n=ko())!==r?($o(),(a=ri())!==r?(qa=e,e=rr(n,a)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Va,Fo()!==r)if($o(),(t=ai())!==r){for($o(),n=[],a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);a!==r;)n.push(a),a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);(a=Mo())!==r?(qa=e,e=br(t,n)):(Va=e,e=r)}else Va=e,e=r;else Va=e,e=r;if(e===r)if(e=Va,Fo()!==r)if($o(),(t=ai())!==r){for($o(),n=[],a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);a!==r;)n.push(a),a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);(a=Ai())!==r?(i=$o(),Mo()!==r?(qa=e,e=Ar(t,n,a)):(Va=e,e=r)):(Va=e,e=r)}else Va=e,e=r;else Va=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=Va,Fo()!==r){for($o(),t=[],n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);n!==r;)t.push(n),n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);(n=Mo())!==r?(qa=e,e=Pr(t)):(Va=e,e=r)}else Va=e,e=r;if(e===r)if(e=Va,Fo()!==r){for($o(),t=[],n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);n!==r;)t.push(n),n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);(n=Ai())!==r?(a=$o(),Mo()!==r?(qa=e,e=Ur(t,n)):(Va=e,e=r)):(Va=e,e=r)}else Va=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=Va,(t=function(){var e,t;return e=Va,(t=function(){var e,t,n,a;if(e=Va,(t=vi())!==r){for(n=[],a=yi();a!==r;)n.push(a),a=yi();qa=e,e=_n(t,n)}else Va=e,e=r;return e}())!==r&&(qa=e,t=Dn(t)),t}())!==r&&(qa=e,t=Nn(t)),(e=t)===r&&(e=Va,(t=function(){var e,t;return e=Va,Ii()!==r?(t=function(){var e,t,n;for(e=Va,t=[],n=gi();n!==r;)t.push(n),n=gi();return qa=e,Fn(t)}(),Ii()!==r?(qa=e,e=Zn(t)):(Va=e,e=r)):(Va=e,e=r),e}())!==r&&(qa=e,t=On(t)),e=t),e}())===r&&(e=Si())===r&&(e=Va,Po()!==r?($o(),(t=ai())!==r?($o(),Uo()!==r?(qa=e,e=Ln(t)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)),e}function pi(){var e,t,n,a;if(e=Va,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();qa=e,e=Cn(t,n)}else Va=e,e=r;return e}function vi(){var t;return t=e.charAt(Va),Te.test(t)?Va++:(t=r,0===Ba&&ei(ke)),t}function wi(){var t;return t=e.charAt(Va),Ie.test(t)?Va++:(t=r,0===Ba&&ei(ze)),t}function yi(){var t;return t=e.charAt(Va),Se.test(t)?Va++:(t=r,0===Ba&&ei(Ve)),t}function gi(){var e;return(e=Ti())===r&&(e=function(){var e;return e=Va,Ii()!==r&&Ii()!==r?(qa=e,e=Mn()):(Va=e,e=r),e}()),e}function Ti(){var t;return t=e.charAt(Va),Se.test(t)?Va++:(t=r,0===Ba&&ei(Ve)),t}function Ii(){var t;return t=e.charAt(Va),Le.test(t)?Va++:(t=r,0===Ba&&ei(qe)),t}function Si(){var t,n,a,i;return t=Va,n=Va,64===e.charCodeAt(Va)?(a=p,Va++):(a=r,0===Ba&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(Va=n,n=r),n!==r&&(qa=t,n=xn(n)),n}function Li(){var e,t,n;return e=Va,(t=ho())===r&&(t=po()),t!==r&&(qa=e,t=Vn()),(e=t)===r&&(e=Va,(t=vo())!==r&&(qa=e,t=qn()),(e=t)===r&&(e=Va,(t=wo())!==r&&(qa=e,t=Hn()),(e=t)===r&&(e=Va,(t=yo())!==r&&(qa=e,t=Yn()),(e=t)===r&&(e=Va,(t=oo())!==r&&(qa=e,t=Jn()),(e=t)===r&&(e=Va,(t=io())!==r&&(qa=e,t=Bn()),(e=t)===r&&(e=Va,(t=so())!==r&&(qa=e,t=Qn()),(e=t)===r&&(e=Va,(t=go())!==r?($o(),Po()!==r?($o(),(n=Ri())!==r?($o(),Uo()!==r?(qa=e,e=jn(n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)))))))),e}function Ni(){var e,t;return e=Va,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),qa=e,Xn(t)}function Oi(){var e,t;return e=Va,(t=So())===r&&(t=Oo())===r&&(t=Do())===r&&(t=_o())===r&&(t=Co())===r&&(t=Zo())===r&&(t=Lo())===r&&(t=No()),t!==r&&(qa=e,t=ar(t)),t}function Di(){var t,n,a,i;return t=Va,Io()!==r?($o(),n=e.charAt(Va),ye.test(n)?Va++:(n=r,0===Ba&&ei(Ue)),n!==r?($o(),(a=Mi())!==r?($o(),(i=_i())!==r?(qa=t,t=sr(n,a,i)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Io()!==r?($o(),(n=Mi())!==r?($o(),(a=_i())!==r?(qa=t,t=ur(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t}function _i(){var e,t,n;return e=Va,(t=function(){var e,t,n;return e=Va,(t=Ci())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Uo()!==r?(qa=e,e=cr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Ci())!==r&&(qa=e,t=dr(t)),e=t),e}())!==r?($o(),To()!==r?($o(),(n=function(){var e,t,n,a;return e=Va,(t=Ci())!==r&&(qa=e,t=fr(t)),(e=t)===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Ao()!==r?($o(),(a=Zi())!==r?($o(),Uo()!==r?(qa=e,e=mr(n,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Uo()!==r?(qa=e,e=hr(n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r&&(qa=e,t=pr()),e=t))),e}())!==r?(qa=e,e=lr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=Va,(t=Ci())!==r?($o(),Po()!==r?($o(),(n=Zi())!==r?($o(),Uo()!==r?(qa=e,e=vr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Ci())!==r&&(qa=e,t=wr(t)),(e=t)===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Ao()!==r?($o(),(a=Zi())!==r?($o(),Uo()!==r?(qa=e,e=yr(n,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Zi())!==r?($o(),Uo()!==r?(qa=e,e=gr(n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r&&(qa=e,t=Tr()),e=t)))),e}()),e}function Ci(){var e,t;return e=Va,(t=Do())!==r&&(qa=e,t=Ir()),(e=t)===r&&(e=Va,(t=_o())!==r&&(qa=e,t=Sr()),(e=t)===r&&(e=Va,(t=Co())!==r&&(qa=e,t=Lr()),(e=t)===r&&(e=Va,(t=Oo())!==r&&(qa=e,t=Nr()),(e=t)===r&&(e=Va,(t=So())!==r&&(qa=e,t=Or()),e=t)))),e}function Zi(){var e,t;return e=Va,(t=Ri())!==r&&(qa=e,t=Dr(t)),t}function Fi(){var e,t;return e=Va,(t=Ri())!==r&&(qa=e,t=_r(t)),t}function Mi(){var e;return(e=xi())===r&&(e=Si()),e}function xi(){var t,n,a,i,o;if(t=Va,39===e.charCodeAt(Va)?(n=v,Va++):(n=r,0===Ba&&ei(Ye)),n===r&&(e.substr(Va,2)===w?(n=w,Va+=2):(n=r,0===Ba&&ei(Je))),n!==r){for(a=[],i=Va,e.substr(Va,2)===y?(o=y,Va+=2):(o=r,0===Ba&&ei(Be)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(Va),Ne.test(i)?Va++:(i=r,0===Ba&&ei(Qe)));i!==r;)a.push(i),i=Va,e.substr(Va,2)===y?(o=y,Va+=2):(o=r,0===Ba&&ei(Be)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(Va),Ne.test(i)?Va++:(i=r,0===Ba&&ei(Qe)));39===e.charCodeAt(Va)?(i=v,Va++):(i=r,0===Ba&&ei(Ye)),i!==r?(qa=t,t=Er(a)):(Va=t,t=r)}else Va=t,t=r;return t}function Ei(){var e,t,n;return e=Va,xo()!==r?($o(),(t=ai())!==r?($o(),Eo()!==r?($o(),(n=ai())!==r?(qa=e,e=$r(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e}function bi(){var e,t,n;return e=Va,xo()!==r?($o(),(t=ai())!==r?($o(),Eo()!==r?($o(),(n=ai())!==r?(qa=e,e=Rr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e}function Ai(){var e,t;return e=Va,bo()!==r?($o(),(t=ai())!==r?(qa=e,e=kr(t)):(Va=e,e=r)):(Va=e,e=r),e}function Pi(){var t,n,a;return(t=Ri())===r&&(t=Va,n=e.charAt(Va),ye.test(n)?Va++:(n=r,0===Ba&&ei(Ue)),n!==r&&(a=Ri())!==r?(qa=t,t=Jr(n,a)):(Va=t,t=r)),t}function Ui(){var t,n,a;return t=Va,46===e.charCodeAt(Va)?(n=g,Va++):(n=r,0===Ba&&ei(je)),n!==r?((a=Ri())===r&&(a=null),qa=t,t=Br(a)):(Va=t,t=r),t}function $i(){var e,t,n;return e=Va,(t=zi())!==r&&(n=Ri())!==r?(qa=e,e=Qr(t,n)):(Va=e,e=r),e}function Ri(){var e,t,n;if(e=Va,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(Va),Oe.test(t)?Va++:(t=r,0===Ba&&ei(Ke)),t}function zi(){var t,n,a;return t=Va,n=e.charAt(Va),De.test(n)?Va++:(n=r,0===Ba&&ei(Ge)),n!==r?(a=e.charAt(Va),ye.test(a)?Va++:(a=r,0===Ba&&ei(Ue)),a===r&&(a=null),qa=t,t=Kr(n,a)):(Va=t,t=r),t}function Vi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===T?Va+=4:(n=r,0===Ba&&ei(We)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?t=n=[n,a]:(Va=t,t=r)):(Va=t,t=r),t}function qi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===I?Va+=4:(n=r,0===Ba&&ei(Xe)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?t=n=[n,a]:(Va=t,t=r)):(Va=t,t=r),t}function Hi(){var t,n,a,i;return t=Va,(n=e.substr(Va,5)).toLowerCase()===S?Va+=5:(n=r,0===Ba&&ei(et)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?t=n=[n,a]:(Va=t,t=r)):(Va=t,t=r),t}function Yi(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===L?Va+=2:(n=r,0===Ba&&ei(tt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Gr()):(Va=t,t=r)):(Va=t,t=r),t}function Ji(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===N?Va+=2:(n=r,0===Ba&&ei(nt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Wr()):(Va=t,t=r)):(Va=t,t=r),t}function Bi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===O?Va+=4:(n=r,0===Ba&&ei(rt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Xr()):(Va=t,t=r)):(Va=t,t=r),t}function Qi(){var t,n,a,i;return t=Va,(n=e.substr(Va,6)).toLowerCase()===D?Va+=6:(n=r,0===Ba&&ei(at)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ea()):(Va=t,t=r)):(Va=t,t=r),t}function ji(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===_?Va+=3:(n=r,0===Ba&&ei(it)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ta()):(Va=t,t=r)):(Va=t,t=r),t}function Ki(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===C?Va+=3:(n=r,0===Ba&&ei(ot)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=na()):(Va=t,t=r)):(Va=t,t=r),t}function Gi(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===Z?Va+=2:(n=r,0===Ba&&ei(st)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ra()):(Va=t,t=r)):(Va=t,t=r),t}function Wi(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===F?Va+=7:(n=r,0===Ba&&ei(ut)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=aa()):(Va=t,t=r)):(Va=t,t=r),t}function Xi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===M?Va+=4:(n=r,0===Ba&&ei(lt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ia()):(Va=t,t=r)):(Va=t,t=r),t}function eo(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===x?Va+=3:(n=r,0===Ba&&ei(ct)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=oa()):(Va=t,t=r)):(Va=t,t=r),t}function to(){var t,n,a,i;return t=Va,(n=e.substr(Va,9)).toLowerCase()===E?Va+=9:(n=r,0===Ba&&ei(dt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=sa()):(Va=t,t=r)):(Va=t,t=r),t}function no(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===b?Va+=7:(n=r,0===Ba&&ei(ft)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ua()):(Va=t,t=r)):(Va=t,t=r),t}function ro(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===A?Va+=4:(n=r,0===Ba&&ei(mt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=la()):(Va=t,t=r)):(Va=t,t=r),t}function ao(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===P?Va+=8:(n=r,0===Ba&&ei(ht)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ca()):(Va=t,t=r)):(Va=t,t=r),t}function io(){var t,n,a,i;return t=Va,(n=e.substr(Va,9)).toLowerCase()===U?Va+=9:(n=r,0===Ba&&ei(pt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=da()):(Va=t,t=r)):(Va=t,t=r),t}function oo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===$?Va+=4:(n=r,0===Ba&&ei(vt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=fa()):(Va=t,t=r)):(Va=t,t=r),t}function so(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===R?Va+=4:(n=r,0===Ba&&ei(wt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ma()):(Va=t,t=r)):(Va=t,t=r),t}function uo(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===k?Va+=7:(n=r,0===Ba&&ei(yt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ha()):(Va=t,t=r)):(Va=t,t=r),t}function lo(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===z?Va+=8:(n=r,0===Ba&&ei(gt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=pa()):(Va=t,t=r)):(Va=t,t=r),t}function co(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===V?Va+=4:(n=r,0===Ba&&ei(Tt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=va()):(Va=t,t=r)):(Va=t,t=r),t}function fo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===q?Va+=4:(n=r,0===Ba&&ei(It)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=wa()):(Va=t,t=r)):(Va=t,t=r),t}function mo(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===H?Va+=2:(n=r,0===Ba&&ei(St)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ya()):(Va=t,t=r)):(Va=t,t=r),t}function ho(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===Y?Va+=7:(n=r,0===Ba&&ei(Lt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ga()):(Va=t,t=r)):(Va=t,t=r),t}function po(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===J?Va+=3:(n=r,0===Ba&&ei(Nt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ta()):(Va=t,t=r)):(Va=t,t=r),t}function vo(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===B?Va+=8:(n=r,0===Ba&&ei(Ot)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ia()):(Va=t,t=r)):(Va=t,t=r),t}function wo(){var t,n,a,i;return t=Va,(n=e.substr(Va,5)).toLowerCase()===j?Va+=5:(n=r,0===Ba&&ei(Dt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Sa()):(Va=t,t=r)):(Va=t,t=r),t}function yo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===K?Va+=4:(n=r,0===Ba&&ei(_t)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=La()):(Va=t,t=r)):(Va=t,t=r),t}function go(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===G?Va+=7:(n=r,0===Ba&&ei(Ct)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Na()):(Va=t,t=r)):(Va=t,t=r),t}function To(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===W?Va+=2:(n=r,0===Ba&&ei(Zt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Oa()):(Va=t,t=r)):(Va=t,t=r),t}function Io(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===X?Va+=8:(n=r,0===Ba&&ei(Ft)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Da()):(Va=t,t=r)):(Va=t,t=r),t}function So(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ee?Va+=4:(n=r,0===Ba&&ei(Mt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=_a()):(Va=t,t=r)):(Va=t,t=r),t}function Lo(){var t,n,a,i;return t=Va,(n=e.substr(Va,13)).toLowerCase()===te?Va+=13:(n=r,0===Ba&&ei(xt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ca()):(Va=t,t=r)):(Va=t,t=r),t}function No(){var t,n,a,i;return t=Va,(n=e.substr(Va,15)).toLowerCase()===ne?Va+=15:(n=r,0===Ba&&ei(Et)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Za()):(Va=t,t=r)):(Va=t,t=r),t}function Oo(){var t,n,a,i;return t=Va,(n=e.substr(Va,5)).toLowerCase()===re?Va+=5:(n=r,0===Ba&&ei(bt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Fa()):(Va=t,t=r)):(Va=t,t=r),t}function Do(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===ae?Va+=3:(n=r,0===Ba&&ei(At)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ma()):(Va=t,t=r)):(Va=t,t=r),t}function _o(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ie?Va+=4:(n=r,0===Ba&&ei(Pt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=xa()):(Va=t,t=r)):(Va=t,t=r),t}function Co(){var t,n,a,i;return t=Va,(n=e.substr(Va,6)).toLowerCase()===oe?Va+=6:(n=r,0===Ba&&ei(Ut)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ea()):(Va=t,t=r)):(Va=t,t=r),t}function Zo(){var t,n,a,i;return t=Va,(n=e.substr(Va,6)).toLowerCase()===se?Va+=6:(n=r,0===Ba&&ei($t)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ba()):(Va=t,t=r)):(Va=t,t=r),t}function Fo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ue?Va+=4:(n=r,0===Ba&&ei(Rt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Aa()):(Va=t,t=r)):(Va=t,t=r),t}function Mo(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===le?Va+=3:(n=r,0===Ba&&ei(kt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Pa()):(Va=t,t=r)):(Va=t,t=r),t}function xo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ce?Va+=4:(n=r,0===Ba&&ei(zt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ua()):(Va=t,t=r)):(Va=t,t=r),t}function Eo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===de?Va+=4:(n=r,0===Ba&&ei(Vt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=$a()):(Va=t,t=r)):(Va=t,t=r),t}function bo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===fe?Va+=4:(n=r,0===Ba&&ei(qt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ra()):(Va=t,t=r)):(Va=t,t=r),t}function Ao(){var t;return 44===e.charCodeAt(Va)?(t=me,Va++):(t=r,0===Ba&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(Va)?(t=he,Va++):(t=r,0===Ba&&ei(Yt)),t}function Uo(){var t;return 41===e.charCodeAt(Va)?(t=pe,Va++):(t=r,0===Ba&&ei(Jt)),t}function $o(){var e,t;for(e=[],t=Ro();t!==r;)e.push(t),t=Ro();return e}function Ro(){var t;return t=e.charAt(Va),_e.test(t)?Va++:(t=r,0===Ba&&ei(Bt)),t}function ko(){var t,n,a,i;if(t=Va,(n=pi())!==r&&(qa=t,n=ka(n)),(t=n)===r)if(t=Va,96===e.charCodeAt(Va)?(n=ve,Va++):(n=r,0===Ba&&ei(Qt)),n!==r){if(a=[],i=e.charAt(Va),Ce.test(i)?Va++:(i=r,0===Ba&&ei(jt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(Va),Ce.test(i)?Va++:(i=r,0===Ba&&ei(jt));else a=r;a!==r?(96===e.charCodeAt(Va)?(i=ve,Va++):(i=r,0===Ba&&ei(Qt)),i!==r?(qa=t,t=za(a)):(Va=t,t=r)):(Va=t,t=r)}else Va=t,t=r;return t}function zo(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 Vo(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=zo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:Va,peg$FAILED:r,peg$maxFailExpected:Ja,peg$maxFailPos:Ya};if(n!==r&&Va===e.length)return n;throw n!==r&&Va<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(Ja,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 de(e)}featureValue(e,t,n,r){return Le(e,t,n,r)}equalsNull(e){return null===e}applyLike(e,t,n){return Se(e,t,n)}ensureArray(e){return fe(e)}applyIn(e,t){return ve(e,t)}currentTimestamp(e){return we(e)}currentDate(e){return ye(e)}currentTime(e){return ge(e)}makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}compare(e,t,n){return $(t,n,e)}calculate(e,t,n,r){return J(e,t,n,r)}evaluateTime(e){return Z(e)}evaluateTimestamp(e,t,n){return F(e,t,n)}evaluateDate(e,t){return M(e,t)}evaluateFunction(e,t,n){return V(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:$(e,t[0],">=")&&$(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:$(e,t[0],"<")||$(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(Z(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(M(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(F(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=K.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():C(e)?e.toStorageFormat():_(e)?e.toStorageString():D(e)?e.toStorageFormat():e;switch(t){case"date":return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():C(e)?e.toMilliseconds():D(e)?e.toNumber():e;case"date-only":return(0,b.$P)(e)?i.n.fromDateJS(e).toString():C(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,b.$P)(e)?f.k.fromDateJS(e).toStorageString():O(e)?f.k.fromDateTime(e).toStorageString():C(e)?f.k.fromSqlTimeStampOffset(e).toStorageString():_(e)?e.toStorageString():e;case"timestamp-offset":if((0,b.$P)(e))return d.g.fromJSDate(e).toStorageFormat();if(O(e))return d.g.fromDateTime(e).toStorageFormat();if(C(e))return e.toStorageFormat()}return e}get fieldNames(){return this._referencedFieldNames}testSet(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=Ne,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}tryGetCompiledExecutor(){if(null!=this._compiledExecutor)return this._compiledExecutor;if((0,r.A)("esri-csp-restrictions"))return null;const e=new le(this.parseTree);return this._compiledExecutor=e.compile(),this._compiledExecutor}calculateValueCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.calculateValue(e,t):r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}testFeature(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.testFeature(e,t):!!r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,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($(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(de(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=fe(this._evaluateNode(e.right,t,n,r,i));return ve(this._evaluateNode(e.left,t,n,r,i),a)}case"NOT IN":{const a=fe(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:$(a,o[0],">=")&&$(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:$(a,o[0],"<")||$(a,o[1],">")}case"LIKE":return Se(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return me(Se(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 $(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator);case"-":case"+":case"*":case"/":case"||":return J(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??=M(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=F(e.value,"unknown"),e.parsedValue;case"time":return Z(e.value);case"current-time":return"date"===e.mode?ye(this.timeZone):"time"===e.mode?ge(this.timeZone):we(this.timeZone);case"current-user":return i??null;case"column-reference":return Le(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 V(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function de(e){return!0===e}function fe(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=$(e,r,"="),n))break}return n}function we(e){return L(new Date,e)}function ye(e){return i.n.fromNow(e)}function ge(e){const t=L(new Date,e);return f.k.fromDateTime(t)}const Te="-[]/{}()*+?.\\^$|";var Ie;function Se(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=Ie.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case Ie.Normal:i===n?a=Ie.Escaped:Te.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case Ie.Escaped:Te.includes(i)?r+="\\"+i:r+=i,a=Ie.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Le(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t);if(null==a)return a;const o=n?.get(t);switch(o?.type){case"esriFieldTypeDate":case"date":return L(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance);case"esriFieldTypeDateOnly":case"date-only":return i.n.fromReader(a);case"esriFieldTypeTimeOnly":case"time-only":return f.k.fromReader(a);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return new d.g(a)}return a}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Ie||(Ie={}));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),d=n(96285);const f=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$?d.mQ.utcInstance:(0,o.tE)(f,t,(()=>d.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,d=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,c.ZS)(r.timeReference):s:null,f=new Map([[h(a?.creationDateField??""),u],[h(a?.editDateField??""),u],[h(i),d],[h(o),d]]);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=f.get(h(r??""))??s;t.set(r,e)}return t}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[254],{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)}}},2272:(e,t,n)=>{n.d(t,{Dl:()=>l,gf:()=>d,jV:()=>u,lF:()=>c});var r=n(92602),a=n(70333),i=n(4718),o=n(84952),s=n(926);function u(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,o.An)(e):(0,i.o8)(e)}function c(e,t,n){const r={};for(const a in e){if("declaredClass"===a)continue;const i=e[a];if(null!=i&&"function"!=typeof i)if(Array.isArray(i))r[a]=i.map((e=>c(e)));else if("object"==typeof i)if(i.toJSON){const e=i.toJSON(n?.[a]);r[a]=t?e:JSON.stringify(e)}else r[a]=t?i:JSON.stringify(i);else r[a]=i}return r}async function d(e,t,i){const o=function(e,t){return e?(0,s.Jn)(e,t)?t||r.A.apiKey:a.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!a.id&&r.A.request.useIdentity&&await Promise.all([n.e(7292),n.e(3747)]).then(n.bind(n,73747));const u=await(a.id?.getCredential(e,i));return u?.token}},3330:(e,t,n)=>{n.d(t,{GB:()=>a,Qo:()=>o,Y4:()=>i});var r=n(96285);class a{static{this.instance=new r.oh("Etc/UTC")}}function i(e){return e instanceof r.bo?e===a.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return i(e)?a.instance:e}},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 d=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let f="";i<10&&(f="0");let m=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${f+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(d+"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)}}},66131:(e,t,n)=>{n.d(t,{lY:()=>d,mT:()=>f});var r,a=n(799),i=n(3330),o=n(96285);(r||(r={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const s={[r.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class u extends Error{constructor(e,t){super((0,a.HC)(s[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,u)}}function l(e,t,n){return e<t?e-t:e>n?e-n:0}function c(e,t,n){return e<t?t:e>n?n:e}class d{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,n=1,r=0,a=0,i=0,s=0,u){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(a)||isNaN(i)||isNaN(s))return null;const m=o.c9.local(e,t).daysInMonth;let h=o.c9.fromObject({day:c(n,1,m),year:e,month:c(t,1,12),hour:c(r,0,23),minute:c(a,0,59),second:c(i,0,59),millisecond:c(s,0,999)},{zone:f(u)});return h=h.plus({months:l(t,1,12),days:l(n,1,m),hours:l(r,0,23),minutes:l(a,0,59),seconds:l(i,0,59),milliseconds:l(s,0,999)}),new d(h)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const n=f(t);return e.isUnknownTimeZone||n===i.GB.instance?d.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,n):new d(e._date.setZone(n))}static dateJSToArcadeDate(e){return new d(o.c9.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const n=f(t);return new d(o.c9.fromJSDate(e,{zone:n}))}static unknownEpochToArcadeDate(e){return new d(o.c9.fromMillis(e,{zone:i.GB.instance}))}static unknownDateJSToArcadeDate(e){return new d(o.c9.fromMillis(e.getTime(),{zone:i.GB.instance}))}static epochToArcadeDate(e,t="system"){const n=f(t);return new d(o.c9.fromMillis(e,{zone:n}))}static dateTimeToArcadeDate(e){return new d(e)}clone(){return new d(this._date)}changeTimeZone(e){const t=f(e);return d.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const n=f(t);return e.zone===i.GB.instance||n===i.GB.instance?d.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,n):new d(e.setZone(n))}static nowToArcadeDate(e){const t=f(e);return new d(o.c9.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new d(o.c9.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===d.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===i.GB.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new d(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new d(this._date.toUTC())}toLocal(){return new d(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=o.c9.fromISO(e,{setZone:!0});return new d(t)}}function f(e,t=!0){if(e instanceof o.bo)return e;if("system"===e.toLowerCase())return"system";if("utc"===e.toLowerCase())return"UTC";if("unknown"===e.toLowerCase())return i.GB.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(e)){const t=o.mQ.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}const n=o.oh.create(e);if(!n.isValid){if(t)throw new u(r.TimeZoneNotRecognized);return null}return n}},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=>d(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(!f(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 d(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(!f(i))throw new a.L8(a.Z7.InvalidValueForAggregateFunction);n++,t+=i}}return 0===n?null:t/e.length}function f(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=d(e);if(null===t)return null;let n=0;for(const r of e){if(!f(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 d=n(55612),f=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]+)$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,T=/^(\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})$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,S=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function L(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 D(e){return i.n.isDateOnly(e)}function _(e){return f.k.isTimeOnly(e)}function C(e){return d.g.isTimestampOffset(e)}function Z(e){let t=p.exec(e);if(null!==t){const[,e,n,r]=t,a=f.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=f.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=f.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 F(e,t,n=!1){let r=g.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=T.exec(e),null!==r){const[,e,t,n,a,i,s,u,l,c,f]=r,m=d.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(f,10));if(!1===m.isValid)throw new o.L8(o.Z7.InvalidTimeStamp);return m}if(r=I.exec(e),null!==r){const[,e,t,n,a,i,s,u,l]=r,c=d.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=S.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=y.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 M(e,t){const n=y.exec(e);if(null===n)try{return F(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)||!!C(e)}function P(e){return!!(O(e)||D(e)||C(e)||_(e))}function U(e){if(O(e))return e.toMillis();if(D(e))return e.toNumber();if(C(e))return e.toMilliseconds();throw new o.L8(o.Z7.InvalidDataType)}function $(e,t,n){if(null==e||null==t)return null;if((0,b.Et)(e)){if((0,b.Et)(t))return R(e,t,n);if((0,b.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return R(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(D(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 R(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if(_(t))throw new o.L8(o.Z7.InvalidOperator);if(C(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(d.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(d.g.isTimestampOffset(e))return k(e,t,n)}return R(U(e),U(t),n)}if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return R((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(_(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(C(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),R(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"),R(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))return R(e.toNumber(),t.toNumber(),n);if(_(t))throw new o.L8(o.Z7.InvalidOperator);if((0,b.Et)(t))throw new o.L8(o.Z7.InvalidOperator)}else if(_(e)){if(_(t))return R(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(D(t))throw new o.L8(o.Z7.InvalidOperator);if(A(t))throw new o.L8(o.Z7.InvalidOperator)}else if(C(e)){if(A(t))return h.c9.isDateTime(t)&&(0,m.Y4)(t.zone)?k(e,t,n):R(U(e),U(t),n);if((0,b.Kg)(t))throw new o.L8(o.Z7.InvalidOperator);if(D(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return R((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(_(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 R(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){d.g.isTimestampOffset(e)&&(e=e.toDateTime()),d.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=z(e),a=z(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function z(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function V(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)||D(e)||O(e)||_(e)||C(e))}function H(e){return D(e)||_(e)?e.toString():C(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(D(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(_(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(C(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes}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=>$(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 f.k.fromDateJS(e);if(O(e))return f.k.fromDateTime(e);if(D(e))throw new o.L8(o.Z7.CannotCastValue);if(_(e))return e;if(C(e))return f.k.fromSqlTimeStampOffset(e);if((0,b.Kg)(e))return Z(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(D(e))return e;if(_(e))throw new o.L8(o.Z7.CannotCastValue);if(C(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 L(e,t);if(O(e))return e;if(D(e))return e.toDateTimeLuxon("unknown");if(_(e))throw new o.L8(o.Z7.CannotCastValue);if(C(e))return e;if((0,b.Kg)(e))return F(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 J(e,t,n,r){if("||"===e)return V("concat",[t,n],r);if(null===t||null===n)return null;if((0,b.Et)(t)){if((0,b.Et)(n))return B(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(_(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(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 B(e,r,n)}(t,n,e);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(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(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(C(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(_(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(_(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(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(_(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(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.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(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(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(C(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(C(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(_(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(D(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(C(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 B(r,t,n)}(t,n,e);if(N(n))return function(){throw new o.L8(o.Z7.InvalidOperator)}();if(_(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(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 B(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 K{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=">",d="<=",f="<>",m="!=",h="||",p="@",v="'",w="N'",y="''",g=".",T="null",I="true",S="false",L="in",N="is",O="like",D="escape",_="not",C="and",Z="or",F="between",M="from",x="for",E="substring",b="extract",A="trim",P="position",U="timestamp",$="date",R="time",k="leading",z="trailing",V="both",q="cast",H="as",Y="integer",J="int",B="smallint",j="float",K="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",de="then",fe="else",me=",",he="(",pe=")",ve="`",we=/^[<-=]/,ye=/^[+\-]/,ge=/^[*\/]/,Te=/^[A-Za-z_\x80-\uFFFF]/,Ie=/^[A-Za-z0-9_]/,Se=/^[A-Za-z0-9_.\x80-\uFFFF]/,Le=/^["]/,Ne=/^[^']/,Oe=/^[0-9]/,De=/^[eE]/,_e=/^[ \t\n\r]/,Ce=/^[^`]/,Ze=Ka("!",!1),Fe=Ka("=",!1),Me=Ka(">=",!1),xe=Ka(">",!1),Ee=Ka("<=",!1),be=Ka("<>",!1),Ae=Ga([["<","="]],!1,!1),Pe=Ka("!=",!1),Ue=Ga(["+","-"],!1,!1),$e=Ka("||",!1),Re=Ga(["*","/"],!1,!1),ke=Ga([["A","Z"],["a","z"],"_",["",""]],!1,!1),ze=Ga([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Ve=Ga([["A","Z"],["a","z"],["0","9"],"_",".",["",""]],!1,!1),qe=Ga(['"'],!1,!1),He=Ka("@",!1),Ye=Ka("'",!1),Je=Ka("N'",!1),Be=Ka("''",!1),Qe=Ga(["'"],!0,!1),je=Ka(".",!1),Ke=Ga([["0","9"]],!1,!1),Ge=Ga(["e","E"],!1,!1),We=Ka("NULL",!0),Xe=Ka("TRUE",!0),et=Ka("FALSE",!0),tt=Ka("IN",!0),nt=Ka("IS",!0),rt=Ka("LIKE",!0),at=Ka("ESCAPE",!0),it=Ka("NOT",!0),ot=Ka("AND",!0),st=Ka("OR",!0),ut=Ka("BETWEEN",!0),lt=Ka("FROM",!0),ct=Ka("FOR",!0),dt=Ka("SUBSTRING",!0),ft=Ka("EXTRACT",!0),mt=Ka("TRIM",!0),ht=Ka("POSITION",!0),pt=Ka("TIMESTAMP",!0),vt=Ka("DATE",!0),wt=Ka("TIME",!0),yt=Ka("LEADING",!0),gt=Ka("TRAILING",!0),Tt=Ka("BOTH",!0),It=Ka("CAST",!0),St=Ka("AS",!0),Lt=Ka("INTEGER",!0),Nt=Ka("INT",!0),Ot=Ka("SMALLINT",!0),Dt=Ka("FLOAT",!0),_t=Ka("REAL",!0),Ct=Ka("VARCHAR",!0),Zt=Ka("TO",!0),Ft=Ka("INTERVAL",!0),Mt=Ka("YEAR",!0),xt=Ka("TIMEZONE_HOUR",!0),Et=Ka("TIMEZONE_MINUTE",!0),bt=Ka("MONTH",!0),At=Ka("DAY",!0),Pt=Ka("HOUR",!0),Ut=Ka("MINUTE",!0),$t=Ka("SECOND",!0),Rt=Ka("CASE",!0),kt=Ka("END",!0),zt=Ka("WHEN",!0),Vt=Ka("THEN",!0),qt=Ka("ELSE",!0),Ht=Ka(",",!1),Yt=Ka("(",!1),Jt=Ka(")",!1),Bt=Ga([" ","\t","\n","\r"],!1,!1),Qt=Ka("`",!1),jt=Ga(["`"],!0,!1),Kt=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):zo(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 Vo(Qa(),t,n)},cn=function(e,t){return{op:"NOT"+e,right:t}},dn=function(e,t,n){return Vo(Qa(),t,n)},fn=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}},yn=function(e,t){return{op:e,right:t}},gn=function(e,t,n){return{op:t,expr:n,location:Qa()}},Tn=function(e,t){return qo(e,t)},In=function(e,t,n){return{op:t,expr:n,location:Qa()}},Sn=function(e,t){return qo(e,t)},Ln=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}},Dn=function(e){return e},_n=function(e,t){return e+t.join("")},Cn=function(e,t){return e+t.join("")},Zn=function(e){return e},Fn=function(e){return e.join("")},Mn=function(){return'"'},xn=function(e){return{type:"parameter",location:Qa(),value:e[1]}},En=function(e,t){return Vo(Qa(),e,t)},bn=function(e,t){return Vo(Qa(),e,t)},An=function(e){return{type:"function",location:Qa(),name:"extract",args:e}},Pn=function(e,t,n){return Vo(Qa(),e,t,...n?[n]:[])},Un=function(e,t,n){return Vo(Qa(),e,t,n)},$n=function(e){return{type:"function",location:Qa(),name:"substring",args:e}},Rn=function(e,t){return Vo(Qa(),e,t)},kn=function(e,t){return Vo(Qa(),e,t)},zn=function(e){return{type:"function",location:Qa(),name:"cast",args:e}},Vn=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"}}},Jn=function(){return{type:"data-type",location:Qa(),value:{type:"date"}}},Bn=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)}}},Kn=function(e,t,n){return Vo(Qa(),e,t,n)},Gn=function(e,t){return Vo(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 Vo(Qa(),e,t)},tr=function(e,t){return Vo(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}},dr=function(e){return{type:"interval-period",location:Qa(),period:e.value,precision:null,secondary:null}},fr=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}},yr=function(e,t){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:t}},gr=function(e){return{type:"interval-period",location:Qa(),period:"second",precision:e,secondary:null}},Tr=function(){return{type:"interval-period",location:Qa(),period:"second",precision:null,secondary:null}},Ir=function(){return{type:"string",location:Qa(),value:"day"}},Sr=function(){return{type:"string",location:Qa(),value:"hour"}},Lr=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"}},Dr=function(e){return parseFloat(e)},_r=function(e){return parseFloat(e)},Cr=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}},Zr=function(){return{type:"null",location:Qa(),value:null}},Fr=function(){return{type:"boolean",location:Qa(),value:!0}},Mr=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}},Ur=function(e,t){return{type:"case-expression",location:Qa(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}},$r=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},Rr=function(e,t){return{type:"when-clause",location:Qa(),operand:e,value:t}},kr=function(e){return{type:"else-clause",location:Qa(),value:e}},zr=function(e){return{type:"number",location:Qa(),value:e}},Vr=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)},Jr=function(e,t){return e[0]+t},Br=function(e){return"."+(null!=e?e:"")},Qr=function(e,t){return e+t},jr=function(e){return e.join("")},Kr=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"},da=function(){return"TIMESTAMP"},fa=function(){return"DATE"},ma=function(){return"TIME"},ha=function(){return"LEADING"},pa=function(){return"TRAILING"},va=function(){return"BOTH"},wa=function(){return"CAST"},ya=function(){return"AS"},ga=function(){return"INTEGER"},Ta=function(){return"INT"},Ia=function(){return"SMALLINT"},Sa=function(){return"FLOAT"},La=function(){return"REAL"},Na=function(){return"VARCHAR"},Oa=function(){return"TO"},Da=function(){return"INTERVAL"},_a=function(){return"YEAR"},Ca=function(){return"TIMEZONE_HOUR"},Za=function(){return"TIMEZONE_MINUTE"},Fa=function(){return"MONTH"},Ma=function(){return"DAY"},xa=function(){return"HOUR"},Ea=function(){return"MINUTE"},ba=function(){return"SECOND"},Aa=function(){return"CASE"},Pa=function(){return"END"},Ua=function(){return"WHEN"},$a=function(){return"THEN"},Ra=function(){return"ELSE"},ka=function(e){return e},za=function(e){return e.join("")},Va=0|t.peg$currPos,qa=Va,Ha=[{line:1,column:1}],Ya=Va,Ja=t.peg$maxFailExpected||[],Ba=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,Va)}function ja(e,t){throw ti(e,t=void 0!==t?t:Xa(qa,Va))}function Ka(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){Va<Ya||(Va>Ya&&(Ya=Va,Ja=[]),Ja.push(e))}function ti(e,t){return new Q(e,null,null,t)}function ni(){var e,t;return e=Va,$o(),(t=ai())!==r?($o(),qa=e,e=Kt(t)):(Va=e,e=r),e}function ri(){var e,t,n,a,i,o;if(e=Va,Po()!==r){for($o(),t=[],n=ai();n!==r;)t.push(n),n=Va,a=Va,i=$o(),(o=Ao())!==r?a=i=[i,o,$o()]:(Va=a,a=r),a!==r&&(a=ai())===r?(Va=n,n=r):n=a;n=$o(),(a=Uo())!==r?(qa=e,e=Gt(t)):(Va=e,e=r)}else Va=e,e=r;return e}function ai(){var e,t,n,a,i,o;if(e=Va,(t=ii())!==r){for(n=[],a=Va,$o(),(i=Gi())!==r?($o(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=Gi())!==r?($o(),(o=ii())!==r?(qa=a,a=Wt(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=Xt(t,n)}else Va=e,e=r;return e}function ii(){var e,t,n,a,i,o;if(e=Va,(t=oi())!==r){for(n=[],a=Va,$o(),(i=Ki())!==r?($o(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=Ki())!==r?($o(),(o=oi())!==r?(qa=a,a=en(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=tn(t,n)}else Va=e,e=r;return e}function oi(){var t,n,a,i,o;return t=Va,(n=ji())===r&&(n=Va,33===e.charCodeAt(Va)?(a=s,Va++):(a=r,0===Ba&&ei(Ze)),a!==r?(i=Va,Ba++,61===e.charCodeAt(Va)?(o=u,Va++):(o=r,0===Ba&&ei(Fe)),Ba--,o===r?i=void 0:(Va=i,i=r),i!==r?n=a=[a,i]:(Va=n,n=r)):(Va=n,n=r)),n!==r?(a=$o(),(i=oi())!==r?(qa=t,t=nn(i)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=function(){var e,t,n,a;return e=Va,(t=ci())!==r?(n=Va,$o(),(a=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Va,t=[],n=Va,$o(),(a=si())!==r?($o(),(i=ci())!==r?(qa=n,n=an(a,i)):(Va=n,n=r)):(Va=n,n=r),n!==r)for(;n!==r;)t.push(n),n=Va,$o(),(a=si())!==r?($o(),(i=ci())!==r?(qa=n,n=an(a,i)):(Va=n,n=r)):(Va=n,n=r);else t=r;return t!==r&&(qa=e,t=on(t)),t}())===r&&(e=function(){var e,t,n;return e=Va,(t=li())!==r?($o(),(n=ri())!==r?(qa=e,e=wn(t,n)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=li())!==r?($o(),(n=Si())!==r?(qa=e,e=yn(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}())===r&&(e=function(){var e,t,n,a,i,o,s,u;return e=Va,(t=ji())!==r?($o(),(n=Wi())!==r?(a=$o(),i=Va,(o=ci())!==r?($o(),(s=Ki())!==r?($o(),(u=ci())!==r?(qa=i,i=ln(n,o,u)):(Va=i,i=r)):(Va=i,i=r)):(Va=i,i=r),i!==r?(qa=e,e=cn(n,i)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Wi())!==r?($o(),n=Va,(a=ci())!==r?(i=$o(),(o=Ki())!==r?($o(),(s=ci())!==r?(qa=n,n=dn(t,a,s)):(Va=n,n=r)):(Va=n,n=r)):(Va=n,n=r),n!==r?(qa=e,e=fn(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Va,(t=Ji())!==r?($o(),(n=ji())!==r?($o(),(a=ci())!==r?(qa=e,e=sn(t,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Ji())!==r?($o(),(n=ci())!==r?(qa=e,e=un(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}())===r&&(e=function(){var e,t,n,a;return e=Va,(t=ui())!==r?($o(),(n=Mi())!==r?($o(),Qi()!==r?($o(),(a=xi())!==r?(qa=e,e=pn(t,n,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=ui())!==r?($o(),(n=Mi())!==r?(qa=e,e=vn(t,n)):(Va=e,e=r)):(Va=e,e=r)),e}()),e}())!==r?n=a:(Va=n,n=r),n===r&&(n=null),qa=e,e=rn(t,n)):(Va=e,e=r),e}()),t}function si(){var t;return e.substr(Va,2)===l?(t=l,Va+=2):(t=r,0===Ba&&ei(Me)),t===r&&(62===e.charCodeAt(Va)?(t=c,Va++):(t=r,0===Ba&&ei(xe)),t===r&&(e.substr(Va,2)===d?(t=d,Va+=2):(t=r,0===Ba&&ei(Ee)),t===r&&(e.substr(Va,2)===f?(t=f,Va+=2):(t=r,0===Ba&&ei(be)),t===r&&(t=e.charAt(Va),we.test(t)?Va++:(t=r,0===Ba&&ei(Ae)),t===r&&(e.substr(Va,2)===m?(t=m,Va+=2):(t=r,0===Ba&&ei(Pe))))))),t}function ui(){var e,t,n,a,i;return e=Va,t=Va,(n=ji())!==r?(a=$o(),(i=Bi())!==r?t=n=[n,a,i]:(Va=t,t=r)):(Va=t,t=r),t!==r&&(qa=e,t=mn(t)),(e=t)===r&&(e=Bi()),e}function li(){var e,t,n,a,i;return e=Va,t=Va,(n=ji())!==r?(a=$o(),(i=Yi())!==r?t=n=[n,a,i]:(Va=t,t=r)):(Va=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=Va,(t=fi())!==r){for(n=[],a=Va,$o(),(i=di())!==r?($o(),(o=fi())!==r?(qa=a,a=gn(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=di())!==r?($o(),(o=fi())!==r?(qa=a,a=gn(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=Tn(t,n)}else Va=e,e=r;return e}function di(){var t;return t=e.charAt(Va),ye.test(t)?Va++:(t=r,0===Ba&&ei(Ue)),t===r&&(e.substr(Va,2)===h?(t=h,Va+=2):(t=r,0===Ba&&ei($e))),t}function fi(){var e,t,n,a,i,o;if(e=Va,(t=hi())!==r){for(n=[],a=Va,$o(),(i=mi())!==r?($o(),(o=hi())!==r?(qa=a,a=In(t,i,o)):(Va=a,a=r)):(Va=a,a=r);a!==r;)n.push(a),a=Va,$o(),(i=mi())!==r?($o(),(o=hi())!==r?(qa=a,a=In(t,i,o)):(Va=a,a=r)):(Va=a,a=r);qa=e,e=Sn(t,n)}else Va=e,e=r;return e}function mi(){var t;return t=e.charAt(Va),ge.test(t)?Va++:(t=r,0===Ba&&ei(Re)),t}function hi(){var e,t;return(e=function(){var e;return(e=xi())===r&&(e=function(){var e,t,n,a;return e=Va,(t=function(){var e,t,n,a;return e=Va,(t=Pi())!==r&&(n=Ui())!==r&&(a=$i())!==r?(qa=e,e=Vr(t,n,a)):(Va=e,e=r),e===r&&(e=Va,(t=Pi())!==r&&(n=Ui())!==r?(qa=e,e=qr(t,n)):(Va=e,e=r),e===r&&(e=Va,(t=Pi())!==r&&(n=$i())!==r?(qa=e,e=Hr(t,n)):(Va=e,e=r),e===r&&(e=Va,(t=Pi())!==r&&(qa=e,t=Yr(t)),e=t))),e}())!==r?(n=Va,Ba++,a=vi(),Ba--,a===r?n=void 0:(Va=n,n=r),n!==r?(qa=e,e=zr(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t;return e=Va,(t=qi())!==r&&(qa=e,t=Fr()),(e=t)===r&&(e=Va,(t=Hi())!==r&&(qa=e,t=Mr()),e=t),e}())===r&&(e=function(){var e,t;return e=Va,(t=Vi())!==r&&(qa=e,t=Zr()),t}())===r&&(e=function(){var e,t;return e=Va,oo()!==r?($o(),(t=Mi())!==r?(qa=e,e=Cr(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t;return e=Va,io()!==r?($o(),(t=Mi())!==r?(qa=e,e=ir(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=Di())===r&&(e=function(){var e,t;return e=Va,so()!==r?($o(),(t=Mi())!==r?(qa=e,e=or(t)):(Va=e,e=r)):(Va=e,e=r),e}()),e}())===r&&(e=function(){var e,t,n,a;return e=Va,no()!==r?($o(),t=Va,Po()!==r?($o(),(n=Oi())!==r?($o(),Xi()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=En(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=Oi())!==r?($o(),Ao()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=bn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=An(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i,o,s;return e=Va,to()!==r?($o(),t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Xi()!==r?($o(),(a=ai())!==r?($o(),i=Va,eo()!==r?(o=$o(),(s=ai())!==r?($o(),i=s):(Va=i,i=r)):(Va=i,i=r),i===r&&(i=null),Uo()!==r?(qa=t,t=Pn(n,a,i)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Ao()!==r?($o(),(a=ai())!==r?($o(),(i=Ao())!==r?($o(),(o=ai())!==r&&(s=Uo())!==r?(qa=t,t=Un(n,a,o)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=$n(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a,i;return e=Va,ro()!==r?($o(),t=Va,Po()!==r?($o(),n=Ni(),$o(),(a=ai())!==r?($o(),Xi()!==r?($o(),(i=ai())!==r?($o(),Uo()!==r?(qa=t,t=Kn(n,a,i)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),n=Ni(),$o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=Gn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=Wn(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Va,ao()!==r?($o(),t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Yi()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=er(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Ao()!==r?($o(),(a=ai())!==r?($o(),Uo()!==r?(qa=t,t=tr(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=nr(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Va,fo()!==r?($o(),t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),mo()!==r?($o(),(a=Li())!==r?($o(),Uo()!==r?(qa=t,t=Rn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Po()!==r?($o(),(n=ai())!==r?($o(),Ao()!==r?($o(),(a=Li())!==r?($o(),Uo()!==r?(qa=t,t=kn(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t!==r?(qa=e,e=zn(t)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e,t,n,a;return e=Va,t=Va,Ba++,n=no(),Ba--,n===r?t=void 0:(Va=t,t=r),t!==r&&(n=ko())!==r?($o(),(a=ri())!==r?(qa=e,e=rr(n,a)):(Va=e,e=r)):(Va=e,e=r),e}())===r&&(e=function(){var e;return(e=function(){var e,t,n,a,i;if(e=Va,Fo()!==r)if($o(),(t=ai())!==r){for($o(),n=[],a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);a!==r;)n.push(a),a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);(a=Mo())!==r?(qa=e,e=br(t,n)):(Va=e,e=r)}else Va=e,e=r;else Va=e,e=r;if(e===r)if(e=Va,Fo()!==r)if($o(),(t=ai())!==r){for($o(),n=[],a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);a!==r;)n.push(a),a=Va,(i=bi())!==r?($o(),a=i):(Va=a,a=r);(a=Ai())!==r?(i=$o(),Mo()!==r?(qa=e,e=Ar(t,n,a)):(Va=e,e=r)):(Va=e,e=r)}else Va=e,e=r;else Va=e,e=r;return e}())===r&&(e=function(){var e,t,n,a;if(e=Va,Fo()!==r){for($o(),t=[],n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);n!==r;)t.push(n),n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);(n=Mo())!==r?(qa=e,e=Pr(t)):(Va=e,e=r)}else Va=e,e=r;if(e===r)if(e=Va,Fo()!==r){for($o(),t=[],n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);n!==r;)t.push(n),n=Va,(a=Ei())!==r?($o(),n=a):(Va=n,n=r);(n=Ai())!==r?(a=$o(),Mo()!==r?(qa=e,e=Ur(t,n)):(Va=e,e=r)):(Va=e,e=r)}else Va=e,e=r;return e}()),e}())===r&&(e=function(){var e,t;return e=Va,(t=function(){var e,t;return e=Va,(t=function(){var e,t,n,a;if(e=Va,(t=vi())!==r){for(n=[],a=yi();a!==r;)n.push(a),a=yi();qa=e,e=_n(t,n)}else Va=e,e=r;return e}())!==r&&(qa=e,t=Dn(t)),t}())!==r&&(qa=e,t=Nn(t)),(e=t)===r&&(e=Va,(t=function(){var e,t;return e=Va,Ii()!==r?(t=function(){var e,t,n;for(e=Va,t=[],n=gi();n!==r;)t.push(n),n=gi();return qa=e,Fn(t)}(),Ii()!==r?(qa=e,e=Zn(t)):(Va=e,e=r)):(Va=e,e=r),e}())!==r&&(qa=e,t=On(t)),e=t),e}())===r&&(e=Si())===r&&(e=Va,Po()!==r?($o(),(t=ai())!==r?($o(),Uo()!==r?(qa=e,e=Ln(t)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)),e}function pi(){var e,t,n,a;if(e=Va,(t=vi())!==r){for(n=[],a=wi();a!==r;)n.push(a),a=wi();qa=e,e=Cn(t,n)}else Va=e,e=r;return e}function vi(){var t;return t=e.charAt(Va),Te.test(t)?Va++:(t=r,0===Ba&&ei(ke)),t}function wi(){var t;return t=e.charAt(Va),Ie.test(t)?Va++:(t=r,0===Ba&&ei(ze)),t}function yi(){var t;return t=e.charAt(Va),Se.test(t)?Va++:(t=r,0===Ba&&ei(Ve)),t}function gi(){var e;return(e=Ti())===r&&(e=function(){var e;return e=Va,Ii()!==r&&Ii()!==r?(qa=e,e=Mn()):(Va=e,e=r),e}()),e}function Ti(){var t;return t=e.charAt(Va),Se.test(t)?Va++:(t=r,0===Ba&&ei(Ve)),t}function Ii(){var t;return t=e.charAt(Va),Le.test(t)?Va++:(t=r,0===Ba&&ei(qe)),t}function Si(){var t,n,a,i;return t=Va,n=Va,64===e.charCodeAt(Va)?(a=p,Va++):(a=r,0===Ba&&ei(He)),a!==r&&(i=pi())!==r?n=a=[a,i]:(Va=n,n=r),n!==r&&(qa=t,n=xn(n)),n}function Li(){var e,t,n;return e=Va,(t=ho())===r&&(t=po()),t!==r&&(qa=e,t=Vn()),(e=t)===r&&(e=Va,(t=vo())!==r&&(qa=e,t=qn()),(e=t)===r&&(e=Va,(t=wo())!==r&&(qa=e,t=Hn()),(e=t)===r&&(e=Va,(t=yo())!==r&&(qa=e,t=Yn()),(e=t)===r&&(e=Va,(t=oo())!==r&&(qa=e,t=Jn()),(e=t)===r&&(e=Va,(t=io())!==r&&(qa=e,t=Bn()),(e=t)===r&&(e=Va,(t=so())!==r&&(qa=e,t=Qn()),(e=t)===r&&(e=Va,(t=go())!==r?($o(),Po()!==r?($o(),(n=Ri())!==r?($o(),Uo()!==r?(qa=e,e=jn(n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)))))))),e}function Ni(){var e,t;return e=Va,(t=uo())===r&&(t=lo())===r&&(t=co()),t===r&&(t=null),qa=e,Xn(t)}function Oi(){var e,t;return e=Va,(t=So())===r&&(t=Oo())===r&&(t=Do())===r&&(t=_o())===r&&(t=Co())===r&&(t=Zo())===r&&(t=Lo())===r&&(t=No()),t!==r&&(qa=e,t=ar(t)),t}function Di(){var t,n,a,i;return t=Va,Io()!==r?($o(),n=e.charAt(Va),ye.test(n)?Va++:(n=r,0===Ba&&ei(Ue)),n!==r?($o(),(a=Mi())!==r?($o(),(i=_i())!==r?(qa=t,t=sr(n,a,i)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r),t===r&&(t=Va,Io()!==r?($o(),(n=Mi())!==r?($o(),(a=_i())!==r?(qa=t,t=ur(n,a)):(Va=t,t=r)):(Va=t,t=r)):(Va=t,t=r)),t}function _i(){var e,t,n;return e=Va,(t=function(){var e,t,n;return e=Va,(t=Ci())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Uo()!==r?(qa=e,e=cr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Ci())!==r&&(qa=e,t=dr(t)),e=t),e}())!==r?($o(),To()!==r?($o(),(n=function(){var e,t,n,a;return e=Va,(t=Ci())!==r&&(qa=e,t=fr(t)),(e=t)===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Ao()!==r?($o(),(a=Zi())!==r?($o(),Uo()!==r?(qa=e,e=mr(n,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Uo()!==r?(qa=e,e=hr(n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r&&(qa=e,t=pr()),e=t))),e}())!==r?(qa=e,e=lr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=function(){var e,t,n,a;return e=Va,(t=Ci())!==r?($o(),Po()!==r?($o(),(n=Zi())!==r?($o(),Uo()!==r?(qa=e,e=vr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Ci())!==r&&(qa=e,t=wr(t)),(e=t)===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Fi())!==r?($o(),Ao()!==r?($o(),(a=Zi())!==r?($o(),Uo()!==r?(qa=e,e=yr(n,a)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r?($o(),Po()!==r?($o(),(n=Zi())!==r?($o(),Uo()!==r?(qa=e,e=gr(n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e===r&&(e=Va,(t=Zo())!==r&&(qa=e,t=Tr()),e=t)))),e}()),e}function Ci(){var e,t;return e=Va,(t=Do())!==r&&(qa=e,t=Ir()),(e=t)===r&&(e=Va,(t=_o())!==r&&(qa=e,t=Sr()),(e=t)===r&&(e=Va,(t=Co())!==r&&(qa=e,t=Lr()),(e=t)===r&&(e=Va,(t=Oo())!==r&&(qa=e,t=Nr()),(e=t)===r&&(e=Va,(t=So())!==r&&(qa=e,t=Or()),e=t)))),e}function Zi(){var e,t;return e=Va,(t=Ri())!==r&&(qa=e,t=Dr(t)),t}function Fi(){var e,t;return e=Va,(t=Ri())!==r&&(qa=e,t=_r(t)),t}function Mi(){var e;return(e=xi())===r&&(e=Si()),e}function xi(){var t,n,a,i,o;if(t=Va,39===e.charCodeAt(Va)?(n=v,Va++):(n=r,0===Ba&&ei(Ye)),n===r&&(e.substr(Va,2)===w?(n=w,Va+=2):(n=r,0===Ba&&ei(Je))),n!==r){for(a=[],i=Va,e.substr(Va,2)===y?(o=y,Va+=2):(o=r,0===Ba&&ei(Be)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(Va),Ne.test(i)?Va++:(i=r,0===Ba&&ei(Qe)));i!==r;)a.push(i),i=Va,e.substr(Va,2)===y?(o=y,Va+=2):(o=r,0===Ba&&ei(Be)),o!==r&&(qa=i,o=xr()),(i=o)===r&&(i=e.charAt(Va),Ne.test(i)?Va++:(i=r,0===Ba&&ei(Qe)));39===e.charCodeAt(Va)?(i=v,Va++):(i=r,0===Ba&&ei(Ye)),i!==r?(qa=t,t=Er(a)):(Va=t,t=r)}else Va=t,t=r;return t}function Ei(){var e,t,n;return e=Va,xo()!==r?($o(),(t=ai())!==r?($o(),Eo()!==r?($o(),(n=ai())!==r?(qa=e,e=$r(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e}function bi(){var e,t,n;return e=Va,xo()!==r?($o(),(t=ai())!==r?($o(),Eo()!==r?($o(),(n=ai())!==r?(qa=e,e=Rr(t,n)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r)):(Va=e,e=r),e}function Ai(){var e,t;return e=Va,bo()!==r?($o(),(t=ai())!==r?(qa=e,e=kr(t)):(Va=e,e=r)):(Va=e,e=r),e}function Pi(){var t,n,a;return(t=Ri())===r&&(t=Va,n=e.charAt(Va),ye.test(n)?Va++:(n=r,0===Ba&&ei(Ue)),n!==r&&(a=Ri())!==r?(qa=t,t=Jr(n,a)):(Va=t,t=r)),t}function Ui(){var t,n,a;return t=Va,46===e.charCodeAt(Va)?(n=g,Va++):(n=r,0===Ba&&ei(je)),n!==r?((a=Ri())===r&&(a=null),qa=t,t=Br(a)):(Va=t,t=r),t}function $i(){var e,t,n;return e=Va,(t=zi())!==r&&(n=Ri())!==r?(qa=e,e=Qr(t,n)):(Va=e,e=r),e}function Ri(){var e,t,n;if(e=Va,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(Va),Oe.test(t)?Va++:(t=r,0===Ba&&ei(Ke)),t}function zi(){var t,n,a;return t=Va,n=e.charAt(Va),De.test(n)?Va++:(n=r,0===Ba&&ei(Ge)),n!==r?(a=e.charAt(Va),ye.test(a)?Va++:(a=r,0===Ba&&ei(Ue)),a===r&&(a=null),qa=t,t=Kr(n,a)):(Va=t,t=r),t}function Vi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===T?Va+=4:(n=r,0===Ba&&ei(We)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?t=n=[n,a]:(Va=t,t=r)):(Va=t,t=r),t}function qi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===I?Va+=4:(n=r,0===Ba&&ei(Xe)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?t=n=[n,a]:(Va=t,t=r)):(Va=t,t=r),t}function Hi(){var t,n,a,i;return t=Va,(n=e.substr(Va,5)).toLowerCase()===S?Va+=5:(n=r,0===Ba&&ei(et)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?t=n=[n,a]:(Va=t,t=r)):(Va=t,t=r),t}function Yi(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===L?Va+=2:(n=r,0===Ba&&ei(tt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Gr()):(Va=t,t=r)):(Va=t,t=r),t}function Ji(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===N?Va+=2:(n=r,0===Ba&&ei(nt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Wr()):(Va=t,t=r)):(Va=t,t=r),t}function Bi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===O?Va+=4:(n=r,0===Ba&&ei(rt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Xr()):(Va=t,t=r)):(Va=t,t=r),t}function Qi(){var t,n,a,i;return t=Va,(n=e.substr(Va,6)).toLowerCase()===D?Va+=6:(n=r,0===Ba&&ei(at)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ea()):(Va=t,t=r)):(Va=t,t=r),t}function ji(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===_?Va+=3:(n=r,0===Ba&&ei(it)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ta()):(Va=t,t=r)):(Va=t,t=r),t}function Ki(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===C?Va+=3:(n=r,0===Ba&&ei(ot)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=na()):(Va=t,t=r)):(Va=t,t=r),t}function Gi(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===Z?Va+=2:(n=r,0===Ba&&ei(st)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ra()):(Va=t,t=r)):(Va=t,t=r),t}function Wi(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===F?Va+=7:(n=r,0===Ba&&ei(ut)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=aa()):(Va=t,t=r)):(Va=t,t=r),t}function Xi(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===M?Va+=4:(n=r,0===Ba&&ei(lt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ia()):(Va=t,t=r)):(Va=t,t=r),t}function eo(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===x?Va+=3:(n=r,0===Ba&&ei(ct)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=oa()):(Va=t,t=r)):(Va=t,t=r),t}function to(){var t,n,a,i;return t=Va,(n=e.substr(Va,9)).toLowerCase()===E?Va+=9:(n=r,0===Ba&&ei(dt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=sa()):(Va=t,t=r)):(Va=t,t=r),t}function no(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===b?Va+=7:(n=r,0===Ba&&ei(ft)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ua()):(Va=t,t=r)):(Va=t,t=r),t}function ro(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===A?Va+=4:(n=r,0===Ba&&ei(mt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=la()):(Va=t,t=r)):(Va=t,t=r),t}function ao(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===P?Va+=8:(n=r,0===Ba&&ei(ht)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ca()):(Va=t,t=r)):(Va=t,t=r),t}function io(){var t,n,a,i;return t=Va,(n=e.substr(Va,9)).toLowerCase()===U?Va+=9:(n=r,0===Ba&&ei(pt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=da()):(Va=t,t=r)):(Va=t,t=r),t}function oo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===$?Va+=4:(n=r,0===Ba&&ei(vt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=fa()):(Va=t,t=r)):(Va=t,t=r),t}function so(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===R?Va+=4:(n=r,0===Ba&&ei(wt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ma()):(Va=t,t=r)):(Va=t,t=r),t}function uo(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===k?Va+=7:(n=r,0===Ba&&ei(yt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ha()):(Va=t,t=r)):(Va=t,t=r),t}function lo(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===z?Va+=8:(n=r,0===Ba&&ei(gt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=pa()):(Va=t,t=r)):(Va=t,t=r),t}function co(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===V?Va+=4:(n=r,0===Ba&&ei(Tt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=va()):(Va=t,t=r)):(Va=t,t=r),t}function fo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===q?Va+=4:(n=r,0===Ba&&ei(It)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=wa()):(Va=t,t=r)):(Va=t,t=r),t}function mo(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===H?Va+=2:(n=r,0===Ba&&ei(St)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ya()):(Va=t,t=r)):(Va=t,t=r),t}function ho(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===Y?Va+=7:(n=r,0===Ba&&ei(Lt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ga()):(Va=t,t=r)):(Va=t,t=r),t}function po(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===J?Va+=3:(n=r,0===Ba&&ei(Nt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ta()):(Va=t,t=r)):(Va=t,t=r),t}function vo(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===B?Va+=8:(n=r,0===Ba&&ei(Ot)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ia()):(Va=t,t=r)):(Va=t,t=r),t}function wo(){var t,n,a,i;return t=Va,(n=e.substr(Va,5)).toLowerCase()===j?Va+=5:(n=r,0===Ba&&ei(Dt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Sa()):(Va=t,t=r)):(Va=t,t=r),t}function yo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===K?Va+=4:(n=r,0===Ba&&ei(_t)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=La()):(Va=t,t=r)):(Va=t,t=r),t}function go(){var t,n,a,i;return t=Va,(n=e.substr(Va,7)).toLowerCase()===G?Va+=7:(n=r,0===Ba&&ei(Ct)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Na()):(Va=t,t=r)):(Va=t,t=r),t}function To(){var t,n,a,i;return t=Va,(n=e.substr(Va,2)).toLowerCase()===W?Va+=2:(n=r,0===Ba&&ei(Zt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Oa()):(Va=t,t=r)):(Va=t,t=r),t}function Io(){var t,n,a,i;return t=Va,(n=e.substr(Va,8)).toLowerCase()===X?Va+=8:(n=r,0===Ba&&ei(Ft)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Da()):(Va=t,t=r)):(Va=t,t=r),t}function So(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ee?Va+=4:(n=r,0===Ba&&ei(Mt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=_a()):(Va=t,t=r)):(Va=t,t=r),t}function Lo(){var t,n,a,i;return t=Va,(n=e.substr(Va,13)).toLowerCase()===te?Va+=13:(n=r,0===Ba&&ei(xt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ca()):(Va=t,t=r)):(Va=t,t=r),t}function No(){var t,n,a,i;return t=Va,(n=e.substr(Va,15)).toLowerCase()===ne?Va+=15:(n=r,0===Ba&&ei(Et)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Za()):(Va=t,t=r)):(Va=t,t=r),t}function Oo(){var t,n,a,i;return t=Va,(n=e.substr(Va,5)).toLowerCase()===re?Va+=5:(n=r,0===Ba&&ei(bt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Fa()):(Va=t,t=r)):(Va=t,t=r),t}function Do(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===ae?Va+=3:(n=r,0===Ba&&ei(At)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ma()):(Va=t,t=r)):(Va=t,t=r),t}function _o(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ie?Va+=4:(n=r,0===Ba&&ei(Pt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=xa()):(Va=t,t=r)):(Va=t,t=r),t}function Co(){var t,n,a,i;return t=Va,(n=e.substr(Va,6)).toLowerCase()===oe?Va+=6:(n=r,0===Ba&&ei(Ut)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ea()):(Va=t,t=r)):(Va=t,t=r),t}function Zo(){var t,n,a,i;return t=Va,(n=e.substr(Va,6)).toLowerCase()===se?Va+=6:(n=r,0===Ba&&ei($t)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=ba()):(Va=t,t=r)):(Va=t,t=r),t}function Fo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ue?Va+=4:(n=r,0===Ba&&ei(Rt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Aa()):(Va=t,t=r)):(Va=t,t=r),t}function Mo(){var t,n,a,i;return t=Va,(n=e.substr(Va,3)).toLowerCase()===le?Va+=3:(n=r,0===Ba&&ei(kt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Pa()):(Va=t,t=r)):(Va=t,t=r),t}function xo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===ce?Va+=4:(n=r,0===Ba&&ei(zt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ua()):(Va=t,t=r)):(Va=t,t=r),t}function Eo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===de?Va+=4:(n=r,0===Ba&&ei(Vt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=$a()):(Va=t,t=r)):(Va=t,t=r),t}function bo(){var t,n,a,i;return t=Va,(n=e.substr(Va,4)).toLowerCase()===fe?Va+=4:(n=r,0===Ba&&ei(qt)),n!==r?(a=Va,Ba++,i=wi(),Ba--,i===r?a=void 0:(Va=a,a=r),a!==r?(qa=t,t=Ra()):(Va=t,t=r)):(Va=t,t=r),t}function Ao(){var t;return 44===e.charCodeAt(Va)?(t=me,Va++):(t=r,0===Ba&&ei(Ht)),t}function Po(){var t;return 40===e.charCodeAt(Va)?(t=he,Va++):(t=r,0===Ba&&ei(Yt)),t}function Uo(){var t;return 41===e.charCodeAt(Va)?(t=pe,Va++):(t=r,0===Ba&&ei(Jt)),t}function $o(){var e,t;for(e=[],t=Ro();t!==r;)e.push(t),t=Ro();return e}function Ro(){var t;return t=e.charAt(Va),_e.test(t)?Va++:(t=r,0===Ba&&ei(Bt)),t}function ko(){var t,n,a,i;if(t=Va,(n=pi())!==r&&(qa=t,n=ka(n)),(t=n)===r)if(t=Va,96===e.charCodeAt(Va)?(n=ve,Va++):(n=r,0===Ba&&ei(Qt)),n!==r){if(a=[],i=e.charAt(Va),Ce.test(i)?Va++:(i=r,0===Ba&&ei(jt)),i!==r)for(;i!==r;)a.push(i),i=e.charAt(Va),Ce.test(i)?Va++:(i=r,0===Ba&&ei(jt));else a=r;a!==r?(96===e.charCodeAt(Va)?(i=ve,Va++):(i=r,0===Ba&&ei(Qt)),i!==r?(qa=t,t=za(a)):(Va=t,t=r)):(Va=t,t=r)}else Va=t,t=r;return t}function zo(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 Vo(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=zo(e,n,r,void 0,{...n.location,end:a});return n}if(n=o(),t.peg$library)return{peg$result:n,peg$currPos:Va,peg$FAILED:r,peg$maxFailExpected:Ja,peg$maxFailPos:Ya};if(n!==r&&Va===e.length)return n;throw n!==r&&Va<e.length&&ei({type:"end"}),function(e,t,n){return new Q(Q.buildMessage(e,t),e,t,n)}(Ja,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 de(e)}featureValue(e,t,n,r){return Le(e,t,n,r)}equalsNull(e){return null===e}applyLike(e,t,n){return Se(e,t,n)}ensureArray(e){return fe(e)}applyIn(e,t){return ve(e,t)}currentTimestamp(e){return we(e)}currentDate(e){return ye(e)}currentTime(e){return ge(e)}makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}compare(e,t,n){return $(t,n,e)}calculate(e,t,n,r){return J(e,t,n,r)}evaluateTime(e){return Z(e)}evaluateTimestamp(e,t,n){return F(e,t,n)}evaluateDate(e,t){return M(e,t)}evaluateFunction(e,t,n){return V(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:$(e,t[0],">=")&&$(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:$(e,t[0],"<")||$(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(Z(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(M(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(F(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=K.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():C(e)?e.toStorageFormat():_(e)?e.toStorageString():D(e)?e.toStorageFormat():e;switch(t){case"date":return(0,b.$P)(e)?e.getTime():O(e)?e.toMillis():C(e)?e.toMilliseconds():D(e)?e.toNumber():e;case"date-only":return(0,b.$P)(e)?i.n.fromDateJS(e).toString():C(e)?i.n.fromSqlTimeStampOffset(e).toString():O(e)?i.n.fromDateTime(e).toString():e;case"time-only":return(0,b.$P)(e)?f.k.fromDateJS(e).toStorageString():O(e)?f.k.fromDateTime(e).toStorageString():C(e)?f.k.fromSqlTimeStampOffset(e).toStorageString():_(e)?e.toStorageString():e;case"timestamp-offset":if((0,b.$P)(e))return d.g.fromJSDate(e).toStorageFormat();if(O(e))return d.g.fromDateTime(e).toStorageFormat();if(C(e))return e.toStorageFormat()}return e}get fieldNames(){return this._referencedFieldNames}testSet(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=Ne,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}tryGetCompiledExecutor(){if(null!=this._compiledExecutor)return this._compiledExecutor;if((0,r.A)("esri-csp-restrictions"))return null;const e=new le(this.parseTree);return this._compiledExecutor=e.compile(),this._compiledExecutor}calculateValueCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.calculateValue(e,t):r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}testFeature(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.testFeature(e,t):!!r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,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($(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(de(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=fe(this._evaluateNode(e.right,t,n,r,i));return ve(this._evaluateNode(e.left,t,n,r,i),a)}case"NOT IN":{const a=fe(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:$(a,o[0],">=")&&$(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:$(a,o[0],"<")||$(a,o[1],">")}case"LIKE":return Se(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.escape);case"NOT LIKE":return me(Se(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 $(this._evaluateNode(e.left,t,n,r,i),this._evaluateNode(e.right,t,n,r,i),e.operator);case"-":case"+":case"*":case"/":case"||":return J(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??=M(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=F(e.value,"unknown"),e.parsedValue;case"time":return Z(e.value);case"current-time":return"date"===e.mode?ye(this.timeZone):"time"===e.mode?ge(this.timeZone):we(this.timeZone);case"current-user":return i??null;case"column-reference":return Le(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 V(e.name,o,this.timeZone)}}throw new o.L8(o.Z7.UnsupportedSyntax,{node:e.type})}}function de(e){return!0===e}function fe(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=$(e,r,"="),n))break}return n}function we(e){return L(new Date,e)}function ye(e){return i.n.fromNow(e)}function ge(e){const t=L(new Date,e);return f.k.fromDateTime(t)}const Te="-[]/{}()*+?.\\^$|";var Ie;function Se(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=Ie.Normal;for(let t=0;t<e.length;t++){const i=e.charAt(t);switch(a){case Ie.Normal:i===n?a=Ie.Escaped:Te.includes(i)?r+="\\"+i:r+="%"===i?".*":"_"===i?".":i;break;case Ie.Escaped:Te.includes(i)?r+="\\"+i:r+=i,a=Ie.Normal}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Le(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t);if(null==a)return a;const o=n?.get(t);switch(o?.type){case"esriFieldTypeDate":case"date":return L(new Date(a),n?.getLuxonTimeZone(o.name)??h.mQ.utcInstance);case"esriFieldTypeDateOnly":case"date-only":return i.n.fromReader(a);case"esriFieldTypeTimeOnly":case"time-only":return f.k.fromReader(a);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return new d.g(a)}return a}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Ie||(Ie={}));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(53966),i=n(91869),o=n(3330),s=n(12195),u=n(30524),l=n(98623),c=n(56400),d=n(96285);const f=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?(a.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?o.GB.instance:t===l.n$?d.mQ.utcInstance:(0,i.tE)(f,t,(()=>d.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=>(0,s.W)(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,d=r?function(e){return"timeZone"in e}(r)?r.timeZone??s:r.timeReference?(0,c.ZS)(r.timeReference):s:null,f=new Map([[h(a?.creationDateField??""),u],[h(a?.editDateField??""),u],[h(i),d],[h(o),d]]);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=f.get(h(r??""))??s;t.set(r,e)}return t}}}]);
|