1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666 |
- import {
- o2 as o
- } from "./chunk-IKP3YN53.js";
- import {
- a
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/core/sql/AggregateFunctions.js
- function a2(a3, n4) {
- const t4 = l[a3.toLowerCase()];
- if (t4 == null)
- throw new Error("Function Not Recognised");
- if (n4.length < t4.minParams || n4.length > t4.maxParams)
- throw new Error(`Invalid Parameter count for call to ${a3.toUpperCase()}`);
- return t4.evaluate(n4);
- }
- function n(a3, n4) {
- const t4 = l[a3.toLowerCase()];
- return t4 != null && n4 >= t4.minParams && n4 <= t4.maxParams;
- }
- var l = { min: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.min.apply(Math, a3[0]) }, max: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.max.apply(Math, a3[0]) }, avg: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : t(a3[0]) }, sum: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : r(a3[0]) }, stddev: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.sqrt(e(a3[0])) }, count: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : a3[0].length }, var: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : e(a3[0]) } };
- function t(a3) {
- let n4 = 0;
- for (let l3 = 0; l3 < a3.length; l3++)
- n4 += a3[l3];
- return n4 / a3.length;
- }
- function r(a3) {
- let n4 = 0;
- for (let l3 = 0; l3 < a3.length; l3++)
- n4 += a3[l3];
- return n4;
- }
- function e(a3) {
- const n4 = t(a3), l3 = a3.length;
- let r3 = 0;
- for (const t4 of a3)
- r3 += (t4 - n4) ** 2;
- return l3 > 1 ? r3 / (l3 - 1) : 0;
- }
- // node_modules/@arcgis/core/core/sql/StandardizedFunctions.js
- var e2 = class {
- constructor() {
- this.op = "+", this.day = 0, this.second = 0, this.hour = 0, this.month = 0, this.year = 0, this.minute = 0;
- }
- static _fixDefaults(a3) {
- if (a3.precision !== null || a3.secondary !== null)
- throw new Error("Primary and Secondary SqlInterval qualifiers not supported");
- }
- static createFromMilliseconds(a3) {
- const r3 = new e2();
- return r3.second = a3 / 1e3, r3;
- }
- static createFromValueAndQualifer(a3, r3, t4) {
- let n4 = null;
- const l3 = new e2();
- if (l3.op = t4 === "-" ? "-" : "+", r3.type === "interval-period") {
- e2._fixDefaults(r3);
- const t5 = new RegExp("^[0-9]{1,}$");
- if (r3.period === "year" || r3.period === "month")
- throw new Error("Year-Month Intervals not supported");
- if (!t5.test(a3))
- throw new Error("Illegal Interval");
- l3[r3.period] = parseFloat(a3);
- } else {
- if (e2._fixDefaults(r3.start), e2._fixDefaults(r3.end), r3.start.period === "year" || r3.start.period === "month")
- throw new Error("Year-Month Intervals not supported");
- if (r3.end.period === "year" || r3.end.period === "month")
- throw new Error("Year-Month Intervals not supported");
- switch (r3.start.period) {
- case "day":
- switch (r3.end.period) {
- case "hour":
- if (n4 = new RegExp("^[0-9]{1,} [0-9]{1,}$"), !n4.test(a3))
- throw new Error("Illegal Interval");
- l3[r3.start.period] = parseFloat(a3.split(" ")[0]), l3[r3.end.period] = parseFloat(a3.split(" ")[1]);
- break;
- case "minute":
- if (n4 = new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"), !n4.test(a3))
- throw new Error("Illegal Interval");
- {
- l3[r3.start.period] = parseFloat(a3.split(" ")[0]);
- const e5 = a3.split(" ")[1].split(":");
- l3.hour = parseFloat(e5[0]), l3.minute = parseFloat(e5[1]);
- }
- break;
- case "second":
- if (n4 = new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"), !n4.test(a3))
- throw new Error("Illegal Interval");
- {
- l3[r3.start.period] = parseFloat(a3.split(" ")[0]);
- const e5 = a3.split(" ")[1].split(":");
- l3.hour = parseFloat(e5[0]), l3.minute = parseFloat(e5[1]), l3.second = parseFloat(e5[2]);
- }
- break;
- default:
- throw new Error("Invalid Interval.");
- }
- break;
- case "hour":
- switch (r3.end.period) {
- case "minute":
- if (n4 = new RegExp("^[0-9]{1,}:[0-9]{1,}$"), !n4.test(a3))
- throw new Error("Illegal Interval");
- l3.hour = parseFloat(a3.split(":")[0]), l3.minute = parseFloat(a3.split(":")[1]);
- break;
- case "second":
- if (n4 = new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"), !n4.test(a3))
- throw new Error("Illegal Interval");
- {
- const e5 = a3.split(":");
- l3.hour = parseFloat(e5[0]), l3.minute = parseFloat(e5[1]), l3.second = parseFloat(e5[2]);
- }
- break;
- default:
- throw new Error("Invalid Interval.");
- }
- break;
- case "minute":
- if (r3.end.period !== "second")
- throw new Error("Invalid Interval.");
- if (n4 = new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"), !n4.test(a3))
- throw new Error("Illegal Interval");
- {
- const e5 = a3.split(":");
- l3.minute = parseFloat(e5[0]), l3.second = parseFloat(e5[1]);
- }
- break;
- default:
- throw new Error("Invalid Interval.");
- }
- }
- return l3;
- }
- valueInMilliseconds() {
- return (this.op === "-" ? -1 : 1) * (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);
- }
- };
- function r2(a3, e5) {
- const r3 = n2[a3.toLowerCase()];
- if (r3 == null)
- throw new Error("Function Not Recognised");
- if (e5.length < r3.minParams || e5.length > r3.maxParams)
- throw new Error(`Invalid Parameter count for call to ${a3.toUpperCase()}`);
- return r3.evaluate(e5);
- }
- function t2(a3, e5) {
- const r3 = n2[a3.toLowerCase()];
- return r3 != null && e5 >= r3.minParams && e5 <= r3.maxParams;
- }
- var n2 = { extract: { minParams: 2, maxParams: 2, evaluate: ([a3, e5]) => {
- if (e5 == null)
- return null;
- if (e5 instanceof Date)
- switch (a3.toUpperCase()) {
- case "SECOND":
- return e5.getSeconds();
- case "MINUTE":
- return e5.getMinutes();
- case "HOUR":
- return e5.getHours();
- case "DAY":
- return e5.getDate();
- case "MONTH":
- return e5.getMonth() + 1;
- case "YEAR":
- return e5.getFullYear();
- }
- throw new Error("Invalid Parameter for call to EXTRACT");
- } }, substring: { minParams: 2, maxParams: 3, evaluate: (a3) => {
- if (a3.length === 2) {
- const [e5, r3] = a3;
- return e5 == null || r3 == null ? null : e5.toString().substring(r3 - 1);
- }
- if (a3.length === 3) {
- const [e5, r3, t4] = a3;
- return e5 == null || r3 == null || t4 == null ? null : t4 <= 0 ? "" : e5.toString().substring(r3 - 1, r3 + t4 - 1);
- }
- } }, position: { minParams: 2, maxParams: 2, evaluate: ([a3, e5]) => a3 == null || e5 == null ? null : e5.indexOf(a3) + 1 }, trim: { minParams: 2, maxParams: 3, evaluate: (e5) => {
- const r3 = e5.length === 3, t4 = r3 ? e5[1] : " ", n4 = r3 ? e5[2] : e5[1];
- if (t4 == null || n4 == null)
- return null;
- const l3 = `(${o(t4)})`;
- switch (e5[0]) {
- case "BOTH":
- return n4.replace(new RegExp(`^${l3}*|${l3}*$`, "g"), "");
- case "LEADING":
- return n4.replace(new RegExp(`^${l3}*`, "g"), "");
- case "TRAILING":
- return n4.replace(new RegExp(`${l3}*$`, "g"), "");
- }
- throw new Error("Invalid Parameter for call to TRIM");
- } }, abs: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.abs(a3[0]) }, ceiling: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.ceil(a3[0]) }, floor: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.floor(a3[0]) }, log: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.log(a3[0]) }, log10: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.log(a3[0]) * Math.LOG10E }, sin: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.sin(a3[0]) }, cos: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.cos(a3[0]) }, tan: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.tan(a3[0]) }, asin: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.asin(a3[0]) }, acos: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.acos(a3[0]) }, atan: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : Math.atan(a3[0]) }, sign: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : a3[0] > 0 ? 1 : a3[1] < 0 ? -1 : 0 }, power: { minParams: 2, maxParams: 2, evaluate: (a3) => a3[0] == null || a3[1] == null ? null : a3[0] ** a3[1] }, mod: { minParams: 2, maxParams: 2, evaluate: (a3) => a3[0] == null || a3[1] == null ? null : a3[0] % a3[1] }, round: { minParams: 1, maxParams: 2, evaluate: (a3) => {
- const e5 = a3[0], r3 = a3.length === 2 ? 10 ** a3[1] : 1;
- return e5 == null ? null : Math.round(e5 * r3) / r3;
- } }, truncate: { minParams: 1, maxParams: 2, evaluate: (a3) => a3[0] == null ? null : a3.length === 1 ? parseInt(a3[0].toFixed(0), 10) : parseFloat(a3[0].toFixed(a3[1])) }, char_length: { minParams: 1, maxParams: 1, evaluate: (a3) => typeof a3[0] == "string" || a3[0] instanceof String ? a3[0].length : 0 }, concat: { minParams: 1, maxParams: 1 / 0, evaluate: (a3) => {
- let e5 = "";
- for (let r3 = 0; r3 < a3.length; r3++) {
- if (a3[r3] == null)
- return null;
- e5 += a3[r3].toString();
- }
- return e5;
- } }, lower: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : a3[0].toString().toLowerCase() }, upper: { minParams: 1, maxParams: 1, evaluate: (a3) => a3[0] == null ? null : a3[0].toString().toUpperCase() } };
- // node_modules/@arcgis/core/core/sql/WhereGrammar.js
- var n3;
- var t3;
- var e4 = { exports: {} };
- t3 = function() {
- function r3(r4, n5) {
- function t5() {
- this.constructor = r4;
- }
- t5.prototype = n5.prototype, r4.prototype = new t5();
- }
- function n4(r4, t5, e6, u3) {
- var o3 = Error.call(this, r4);
- return Object.setPrototypeOf && Object.setPrototypeOf(o3, n4.prototype), o3.expected = t5, o3.found = e6, o3.location = u3, o3.name = "SyntaxError", o3;
- }
- function t4(r4, n5, t5) {
- return t5 = t5 || " ", r4.length > n5 ? r4 : (n5 -= r4.length, r4 + (t5 += t5.repeat(n5)).slice(0, n5));
- }
- function e5(r4, t5) {
- var e6, u3 = {}, o3 = (t5 = t5 !== void 0 ? t5 : {}).grammarSource, i = { start: je }, s = je, a3 = "!", c2 = "=", f2 = ">=", l3 = ">", v2 = "<=", p2 = "<>", d2 = "<", h2 = "!=", b2 = "+", y2 = "-", A2 = "*", g2 = "/", C = "@", m2 = "'", E2 = "N'", x2 = "''", L = ".", T2 = "null", w2 = "true", N2 = "false", O2 = "in", R = "is", I2 = "like", F2 = "escape", S2 = "not", M2 = "and", D2 = "or", H = "between", U = "from", j = "for", P = "substring", _2 = "extract", B = "trim", z = "position", G = "timestamp", Z = "date", W = "leading", Y = "trailing", k2 = "both", q = "to", K = "interval", V = "year", X = "month", $ = "day", J2 = "hour", Q = "minute", rr = "second", nr = "case", tr = "end", er = "when", ur = "then", or = "else", ir = ",", sr = "(", ar = ")", cr = "`", fr = /^[A-Za-z_\x80-\uFFFF]/, lr = /^[A-Za-z0-9_]/, vr = /^[A-Za-z0-9_.\x80-\uFFFF]/, pr = /^[^']/, dr = /^[0-9]/, hr = /^[eE]/, br = /^[+\-]/, yr = /^[ \t\n\r]/, Ar = /^[^`]/, gr = Ie("!", false), Cr = Ie("=", false), mr = Ie(">=", false), Er = Ie(">", false), xr = Ie("<=", false), Lr = Ie("<>", false), Tr = Ie("<", false), wr = Ie("!=", false), Nr = Ie("+", false), Or = Ie("-", false), Rr = Ie("*", false), Ir = Ie("/", false), Fr = Fe([["A", "Z"], ["a", "z"], "_", ["\x80", "\uFFFF"]], false, false), Sr = Fe([["A", "Z"], ["a", "z"], ["0", "9"], "_"], false, false), Mr = Fe([["A", "Z"], ["a", "z"], ["0", "9"], "_", ".", ["\x80", "\uFFFF"]], false, false), Dr = Ie("@", false), Hr = Ie("'", false), Ur = Ie("N'", false), jr = Ie("''", false), Pr = Fe(["'"], true, false), _r = Ie(".", false), Br = Fe([["0", "9"]], false, false), zr = Fe(["e", "E"], false, false), Gr = Fe(["+", "-"], false, false), Zr = Ie("NULL", true), Wr = Ie("TRUE", true), Yr = Ie("FALSE", true), kr = Ie("IN", true), qr = Ie("IS", true), Kr = Ie("LIKE", true), Vr = Ie("ESCAPE", true), Xr = Ie("NOT", true), $r = Ie("AND", true), Jr = Ie("OR", true), Qr = Ie("BETWEEN", true), rn = Ie("FROM", true), nn = Ie("FOR", true), tn = Ie("SUBSTRING", true), en = Ie("EXTRACT", true), un = Ie("TRIM", true), on = Ie("POSITION", true), sn = Ie("TIMESTAMP", true), an = Ie("DATE", true), cn = Ie("LEADING", true), fn = Ie("TRAILING", true), ln = Ie("BOTH", true), vn = Ie("TO", true), pn = Ie("INTERVAL", true), dn = Ie("YEAR", true), hn = Ie("MONTH", true), bn = Ie("DAY", true), yn = Ie("HOUR", true), An = Ie("MINUTE", true), gn = Ie("SECOND", true), Cn = Ie("CASE", true), mn = Ie("END", true), En = Ie("WHEN", true), xn = Ie("THEN", true), Ln = Ie("ELSE", true), Tn = Ie(",", false), wn = Ie("(", false), Nn = Ie(")", false), On = Fe([" ", " ", "\n", "\r"], false, false), Rn = Ie("`", false), In = Fe(["`"], true, false), Fn = function(r5) {
- return r5;
- }, Sn = function(r5, n5) {
- var t6 = { type: "expression-list" }, e7 = Po(r5, n5);
- return t6.value = e7, t6;
- }, Mn = function(r5, n5) {
- return _o(r5, n5);
- }, Dn = function(r5) {
- return Ho("NOT", r5);
- }, Hn = function(r5, n5) {
- return n5 == "" || n5 == null || n5 == null ? r5 : n5.type == "arithmetic" ? _o(r5, n5.tail) : Uo(n5.op, r5, n5.right, n5.escape);
- }, Un = function(r5) {
- return { type: "arithmetic", tail: r5 };
- }, jn = function(r5, n5) {
- return { op: r5 + "NOT", right: n5 };
- }, Pn = function(r5, n5) {
- return { op: r5, right: n5 };
- }, _n = function(r5, n5, t6) {
- return { op: "NOT" + r5, right: { type: "expression-list", value: [n5, t6] } };
- }, Bn = function(r5, n5, t6) {
- return { op: r5, right: { type: "expression-list", value: [n5, t6] } };
- }, zn = function(r5) {
- return r5[0] + " " + r5[2];
- }, Gn = function(r5, n5, t6) {
- return { op: r5, right: n5, escape: t6.value };
- }, Zn = function(r5, n5) {
- return { op: r5, right: n5, escape: "" };
- }, Wn = function(r5, n5) {
- return { op: r5, right: n5 };
- }, Yn = function(r5) {
- return { op: r5, right: { type: "expression-list", value: [] } };
- }, kn = function(r5, n5) {
- return { op: r5, right: n5 };
- }, qn = function(r5, n5) {
- return _o(r5, n5);
- }, Kn = function(r5) {
- return r5.paren = true, r5;
- }, Vn = function(r5) {
- return /^CURRENT_DATE$/i.test(r5) ? { type: "current-time", mode: "date" } : /^CURRENT_TIMESTAMP$/i.test(r5) ? { type: "current-time", mode: "timestamp" } : { type: "column-reference", table: "", column: r5 };
- }, Xn = function(r5) {
- return r5;
- }, $n = function(r5, n5) {
- return r5 + n5.join("");
- }, Jn = function(r5) {
- return { type: "parameter", value: r5[1] };
- }, Qn = function(r5, n5) {
- return { type: "function", name: "extract", args: { type: "expression-list", value: [{ type: "string", value: r5 }, n5] } };
- }, rt = function(r5, n5, t6) {
- return { type: "function", name: "substring", args: { type: "expression-list", value: t6 ? [r5, n5, t6[2]] : [r5, n5] } };
- }, nt = function(r5, n5, t6) {
- return { type: "function", name: "trim", args: { type: "expression-list", value: [{ type: "string", value: r5 == null ? "BOTH" : r5 }, n5, t6] } };
- }, tt = function(r5, n5) {
- return { type: "function", name: "trim", args: { type: "expression-list", value: [{ type: "string", value: r5 == null ? "BOTH" : r5 }, n5] } };
- }, et = function(r5, n5) {
- return { type: "function", name: "position", args: { type: "expression-list", value: [r5, n5] } };
- }, ut = function(r5, n5) {
- return { type: "function", name: r5, args: n5 || { type: "expression-list", value: [] } };
- }, ot = function(r5) {
- return { type: "timestamp", value: r5.value };
- }, it = function(r5, n5, t6) {
- return { type: "interval", value: n5, qualifier: t6, op: r5 };
- }, st = function(r5, n5) {
- return { type: "interval", value: r5, qualifier: n5, op: "" };
- }, at = function(r5, n5) {
- return { type: "interval-qualifier", start: r5, end: n5 };
- }, ct = function(r5, n5) {
- return { type: "interval-period", period: r5.value, precision: n5, secondary: null };
- }, ft = function(r5) {
- return { type: "interval-period", period: r5.value, precision: null, secondary: null };
- }, lt = function(r5) {
- return { type: "interval-period", period: r5.value, precision: null, secondary: null };
- }, vt = function(r5, n5) {
- return { type: "interval-period", period: "second", precision: r5, secondary: n5 };
- }, pt = function(r5) {
- return { type: "interval-period", period: "second", precision: r5, secondary: null };
- }, dt = function() {
- return { type: "interval-period", period: "second", precision: null, secondary: null };
- }, ht = function(r5, n5) {
- return { type: "interval-period", period: r5.value, precision: n5, secondary: null };
- }, bt = function(r5) {
- return { type: "interval-period", period: "second", precision: r5, secondary: null };
- }, yt = function() {
- return { type: "interval-period", period: "second", precision: null, secondary: null };
- }, At = function() {
- return { type: "string", value: "day" };
- }, gt = function() {
- return { type: "string", value: "hour" };
- }, Ct = function() {
- return { type: "string", value: "minute" };
- }, mt = function() {
- return { type: "string", value: "month" };
- }, Et = function() {
- return { type: "string", value: "year" };
- }, xt = function(r5) {
- return parseFloat(r5);
- }, Lt = function(r5) {
- return { type: "date", value: r5.value };
- }, Tt = function() {
- return { type: "null", value: null };
- }, wt = function() {
- return { type: "boolean", value: true };
- }, Nt = function() {
- return { type: "boolean", value: false };
- }, Ot = function() {
- return "'";
- }, Rt = function(r5) {
- return { type: "string", value: r5.join("") };
- }, It = function(r5, n5) {
- return { type: "case-expression", format: "simple", operand: r5, clauses: n5, else: null };
- }, Ft = function(r5, n5, t6) {
- return { type: "case-expression", format: "simple", operand: r5, clauses: n5, else: t6.value };
- }, St = function(r5) {
- return { type: "case-expression", format: "searched", clauses: r5, else: null };
- }, Mt = function(r5, n5) {
- return { type: "case-expression", format: "searched", clauses: r5, else: n5.value };
- }, Dt = function(r5, n5) {
- return { type: "when-clause", operand: r5, value: n5 };
- }, Ht = function(r5) {
- return { type: "else-clause", value: r5 };
- }, Ut = function(r5) {
- return { type: "number", value: r5 };
- }, jt = function(r5, n5, t6) {
- return parseFloat(r5 + n5 + t6);
- }, Pt = function(r5, n5) {
- return parseFloat(r5 + n5);
- }, _t = function(r5, n5) {
- return parseFloat(r5 + n5);
- }, Bt = function(r5) {
- return parseFloat(r5);
- }, zt = function(r5, n5) {
- return r5[0] + n5;
- }, Gt = function(r5) {
- return "." + (r5 != null ? r5 : "");
- }, Zt = function(r5, n5) {
- return r5 + n5;
- }, Wt = function(r5) {
- return r5.join("");
- }, Yt = function(r5, n5) {
- return "e" + (n5 === null ? "" : n5);
- }, kt = function() {
- return "IN";
- }, qt = function() {
- return "IS";
- }, Kt = function() {
- return "LIKE";
- }, Vt = function() {
- return "ESCAPE";
- }, Xt = function() {
- return "NOT";
- }, $t = function() {
- return "AND";
- }, Jt = function() {
- return "OR";
- }, Qt = function() {
- return "BETWEEN";
- }, re = function() {
- return "FROM";
- }, ne = function() {
- return "FOR";
- }, te = function() {
- return "SUBSTRING";
- }, ee = function() {
- return "EXTRACT";
- }, ue = function() {
- return "TRIM";
- }, oe = function() {
- return "POSITION";
- }, ie = function() {
- return "TIMESTAMP";
- }, se = function() {
- return "DATE";
- }, ae = function() {
- return "LEADING";
- }, ce = function() {
- return "TRAILING";
- }, fe = function() {
- return "BOTH";
- }, le = function() {
- return "TO";
- }, ve = function() {
- return "INTERVAL";
- }, pe = function() {
- return "YEAR";
- }, de = function() {
- return "MONTH";
- }, he = function() {
- return "DAY";
- }, be = function() {
- return "HOUR";
- }, ye = function() {
- return "MINUTE";
- }, Ae = function() {
- return "SECOND";
- }, ge = function() {
- return "CASE";
- }, Ce = function() {
- return "END";
- }, me = function() {
- return "WHEN";
- }, Ee = function() {
- return "THEN";
- }, xe = function() {
- return "ELSE";
- }, Le = function(r5) {
- return r5.join("");
- }, Te = 0, we = [{ line: 1, column: 1 }], Ne = 0, Oe = [], Re = 0;
- if ("startRule" in t5) {
- if (!(t5.startRule in i))
- throw new Error(`Can't start parsing from rule "` + t5.startRule + '".');
- s = i[t5.startRule];
- }
- function Ie(r5, n5) {
- return { type: "literal", text: r5, ignoreCase: n5 };
- }
- function Fe(r5, n5, t6) {
- return { type: "class", parts: r5, inverted: n5, ignoreCase: t6 };
- }
- function Se() {
- return { type: "end" };
- }
- function Me(n5) {
- var t6, e7 = we[n5];
- if (e7)
- return e7;
- for (t6 = n5 - 1; !we[t6]; )
- t6--;
- for (e7 = { line: (e7 = we[t6]).line, column: e7.column }; t6 < n5; )
- r4.charCodeAt(t6) === 10 ? (e7.line++, e7.column = 1) : e7.column++, t6++;
- return we[n5] = e7, e7;
- }
- function De(r5, n5) {
- var t6 = Me(r5), e7 = Me(n5);
- return { source: o3, start: { offset: r5, line: t6.line, column: t6.column }, end: { offset: n5, line: e7.line, column: e7.column } };
- }
- function He(r5) {
- Te < Ne || (Te > Ne && (Ne = Te, Oe = []), Oe.push(r5));
- }
- function Ue(r5, t6, e7) {
- return new n4(n4.buildMessage(r5, t6), r5, t6, e7);
- }
- function je() {
- var r5, n5;
- return r5 = Te, So(), (n5 = _e()) !== u3 ? (So(), r5 = Fn(n5)) : (Te = r5, r5 = u3), r5;
- }
- function Pe() {
- var r5, n5, t6, e7, o4, i2, s2, a4;
- if (r5 = Te, (n5 = _e()) !== u3) {
- for (t6 = [], e7 = Te, o4 = So(), (i2 = Ro()) !== u3 ? (s2 = So(), (a4 = _e()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3); e7 !== u3; )
- t6.push(e7), e7 = Te, o4 = So(), (i2 = Ro()) !== u3 ? (s2 = So(), (a4 = _e()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3);
- r5 = Sn(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function _e() {
- var r5, n5, t6, e7, o4, i2, s2, a4;
- if (r5 = Te, (n5 = Be()) !== u3) {
- for (t6 = [], e7 = Te, o4 = So(), (i2 = to()) !== u3 ? (s2 = So(), (a4 = Be()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3); e7 !== u3; )
- t6.push(e7), e7 = Te, o4 = So(), (i2 = to()) !== u3 ? (s2 = So(), (a4 = Be()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3);
- r5 = Mn(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function Be() {
- var r5, n5, t6, e7, o4, i2, s2, a4;
- if (r5 = Te, (n5 = ze()) !== u3) {
- for (t6 = [], e7 = Te, o4 = So(), (i2 = no()) !== u3 ? (s2 = So(), (a4 = ze()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3); e7 !== u3; )
- t6.push(e7), e7 = Te, o4 = So(), (i2 = no()) !== u3 ? (s2 = So(), (a4 = ze()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3);
- r5 = Mn(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function ze() {
- var n5, t6, e7, o4, i2;
- return n5 = Te, (t6 = ro()) === u3 && (t6 = Te, r4.charCodeAt(Te) === 33 ? (e7 = a3, Te++) : (e7 = u3, Re === 0 && He(gr)), e7 !== u3 ? (o4 = Te, Re++, r4.charCodeAt(Te) === 61 ? (i2 = c2, Te++) : (i2 = u3, Re === 0 && He(Cr)), Re--, i2 === u3 ? o4 = void 0 : (Te = o4, o4 = u3), o4 !== u3 ? t6 = e7 = [e7, o4] : (Te = t6, t6 = u3)) : (Te = t6, t6 = u3)), t6 !== u3 ? (e7 = So(), (o4 = ze()) !== u3 ? n5 = Dn(o4) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5 === u3 && (n5 = Ge()), n5;
- }
- function Ge() {
- var r5, n5, t6;
- return r5 = Te, (n5 = Je()) !== u3 ? (So(), (t6 = Ze()) === u3 && (t6 = null), r5 = Hn(n5, t6)) : (Te = r5, r5 = u3), r5;
- }
- function Ze() {
- var r5;
- return (r5 = We()) === u3 && (r5 = $e()) === u3 && (r5 = qe()) === u3 && (r5 = ke()) === u3 && (r5 = Xe()), r5;
- }
- function We() {
- var r5, n5, t6, e7, o4, i2;
- if (r5 = [], n5 = Te, t6 = So(), (e7 = Ye()) !== u3 ? (o4 = So(), (i2 = Je()) !== u3 ? n5 = t6 = [t6, e7, o4, i2] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5 !== u3)
- for (; n5 !== u3; )
- r5.push(n5), n5 = Te, t6 = So(), (e7 = Ye()) !== u3 ? (o4 = So(), (i2 = Je()) !== u3 ? n5 = t6 = [t6, e7, o4, i2] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3);
- else
- r5 = u3;
- return r5 !== u3 && (r5 = Un(r5)), r5;
- }
- function Ye() {
- var n5;
- return r4.substr(Te, 2) === f2 ? (n5 = f2, Te += 2) : (n5 = u3, Re === 0 && He(mr)), n5 === u3 && (r4.charCodeAt(Te) === 62 ? (n5 = l3, Te++) : (n5 = u3, Re === 0 && He(Er)), n5 === u3 && (r4.substr(Te, 2) === v2 ? (n5 = v2, Te += 2) : (n5 = u3, Re === 0 && He(xr)), n5 === u3 && (r4.substr(Te, 2) === p2 ? (n5 = p2, Te += 2) : (n5 = u3, Re === 0 && He(Lr)), n5 === u3 && (r4.charCodeAt(Te) === 60 ? (n5 = d2, Te++) : (n5 = u3, Re === 0 && He(Tr)), n5 === u3 && (r4.charCodeAt(Te) === 61 ? (n5 = c2, Te++) : (n5 = u3, Re === 0 && He(Cr)), n5 === u3 && (r4.substr(Te, 2) === h2 ? (n5 = h2, Te += 2) : (n5 = u3, Re === 0 && He(wr)))))))), n5;
- }
- function ke() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = $u()) !== u3 ? (So(), (t6 = ro()) !== u3 ? (So(), (e7 = Je()) !== u3 ? r5 = jn(n5, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = $u()) !== u3 ? (So(), (t6 = Je()) !== u3 ? r5 = Pn(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)), r5;
- }
- function qe() {
- var r5, n5, t6, e7, o4, i2;
- return r5 = Te, (n5 = ro()) !== u3 ? (So(), (t6 = eo()) !== u3 ? (So(), (e7 = Je()) !== u3 ? (So(), (o4 = no()) !== u3 ? (So(), (i2 = Je()) !== u3 ? r5 = _n(t6, e7, i2) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = eo()) !== u3 ? (So(), (t6 = Je()) !== u3 ? (So(), (e7 = no()) !== u3 ? (So(), (o4 = Je()) !== u3 ? r5 = Bn(n5, t6, o4) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)), r5;
- }
- function Ke() {
- var r5, n5, t6, e7, o4;
- return r5 = Te, n5 = Te, (t6 = ro()) !== u3 ? (e7 = So(), (o4 = Ju()) !== u3 ? n5 = t6 = [t6, e7, o4] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5 !== u3 && (n5 = zn(n5)), (r5 = n5) === u3 && (r5 = Ju()), r5;
- }
- function Ve() {
- var r5, n5, t6, e7, o4;
- return r5 = Te, n5 = Te, (t6 = ro()) !== u3 ? (e7 = So(), (o4 = Xu()) !== u3 ? n5 = t6 = [t6, e7, o4] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5 !== u3 && (n5 = zn(n5)), (r5 = n5) === u3 && (r5 = Xu()), r5;
- }
- function Xe() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = Ke()) !== u3 ? (So(), (t6 = Fu()) !== u3 ? (So(), Qu() !== u3 ? (So(), (e7 = Su()) !== u3 ? r5 = Gn(n5, t6, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = Ke()) !== u3 ? (So(), (t6 = Fu()) !== u3 ? r5 = Zn(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)), r5;
- }
- function $e() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = Ve()) !== u3 ? (So(), (t6 = Io()) !== u3 ? (So(), (e7 = Pe()) !== u3 ? (So(), Fo() !== u3 ? r5 = Wn(n5, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = Ve()) !== u3 ? (So(), (t6 = Io()) !== u3 ? (So(), (e7 = Fo()) !== u3 ? r5 = Yn(n5) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = Ve()) !== u3 ? (So(), (t6 = fu()) !== u3 ? r5 = kn(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3))), r5;
- }
- function Je() {
- var r5, n5, t6, e7, o4, i2, s2, a4;
- if (r5 = Te, (n5 = ru()) !== u3) {
- for (t6 = [], e7 = Te, o4 = So(), (i2 = Qe()) !== u3 ? (s2 = So(), (a4 = ru()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3); e7 !== u3; )
- t6.push(e7), e7 = Te, o4 = So(), (i2 = Qe()) !== u3 ? (s2 = So(), (a4 = ru()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3);
- r5 = Mn(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function Qe() {
- var n5;
- return r4.charCodeAt(Te) === 43 ? (n5 = b2, Te++) : (n5 = u3, Re === 0 && He(Nr)), n5 === u3 && (r4.charCodeAt(Te) === 45 ? (n5 = y2, Te++) : (n5 = u3, Re === 0 && He(Or))), n5;
- }
- function ru() {
- var r5, n5, t6, e7, o4, i2, s2, a4;
- if (r5 = Te, (n5 = tu()) !== u3) {
- for (t6 = [], e7 = Te, o4 = So(), (i2 = nu()) !== u3 ? (s2 = So(), (a4 = tu()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3); e7 !== u3; )
- t6.push(e7), e7 = Te, o4 = So(), (i2 = nu()) !== u3 ? (s2 = So(), (a4 = tu()) !== u3 ? e7 = o4 = [o4, i2, s2, a4] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3);
- r5 = qn(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function nu() {
- var n5;
- return r4.charCodeAt(Te) === 42 ? (n5 = A2, Te++) : (n5 = u3, Re === 0 && He(Rr)), n5 === u3 && (r4.charCodeAt(Te) === 47 ? (n5 = g2, Te++) : (n5 = u3, Re === 0 && He(Ir))), n5;
- }
- function tu() {
- var r5, n5;
- return (r5 = Au()) === u3 && (r5 = lu()) === u3 && (r5 = vu()) === u3 && (r5 = pu()) === u3 && (r5 = hu()) === u3 && (r5 = bu()) === u3 && (r5 = Mu()) === u3 && (r5 = eu()) === u3 && (r5 = fu()) === u3 && (r5 = Te, Io() !== u3 ? (So(), (n5 = _e()) !== u3 ? (So(), Fo() !== u3 ? r5 = Kn(n5) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)), r5;
- }
- function eu() {
- var r5;
- return (r5 = uu()) !== u3 && (r5 = Vn(r5)), r5;
- }
- function uu() {
- var r5;
- return (r5 = ou()) !== u3 && (r5 = Xn(r5)), r5;
- }
- function ou() {
- var r5, n5, t6, e7;
- if (r5 = Te, (n5 = su()) !== u3) {
- for (t6 = [], e7 = cu(); e7 !== u3; )
- t6.push(e7), e7 = cu();
- r5 = $n(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function iu() {
- var r5, n5, t6, e7;
- if (r5 = Te, (n5 = su()) !== u3) {
- for (t6 = [], e7 = au(); e7 !== u3; )
- t6.push(e7), e7 = au();
- r5 = $n(n5, t6);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function su() {
- var n5;
- return fr.test(r4.charAt(Te)) ? (n5 = r4.charAt(Te), Te++) : (n5 = u3, Re === 0 && He(Fr)), n5;
- }
- function au() {
- var n5;
- return lr.test(r4.charAt(Te)) ? (n5 = r4.charAt(Te), Te++) : (n5 = u3, Re === 0 && He(Sr)), n5;
- }
- function cu() {
- var n5;
- return vr.test(r4.charAt(Te)) ? (n5 = r4.charAt(Te), Te++) : (n5 = u3, Re === 0 && He(Mr)), n5;
- }
- function fu() {
- var n5, t6, e7;
- return n5 = Te, r4.charCodeAt(Te) === 64 ? (t6 = C, Te++) : (t6 = u3, Re === 0 && He(Dr)), t6 !== u3 && (e7 = iu()) !== u3 ? n5 = t6 = [t6, e7] : (Te = n5, n5 = u3), n5 !== u3 && (n5 = Jn(n5)), n5;
- }
- function lu() {
- var r5, n5, t6;
- return r5 = Te, so() !== u3 ? (So(), Io() !== u3 ? (So(), (n5 = yu()) !== u3 ? (So(), uo() !== u3 ? (So(), (t6 = _e()) !== u3 ? (So(), Fo() !== u3 ? r5 = Qn(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function vu() {
- var r5, n5, t6, e7, o4, i2, s2;
- return r5 = Te, io() !== u3 ? (So(), Io() !== u3 ? (So(), (n5 = _e()) !== u3 ? (So(), uo() !== u3 ? (So(), (t6 = _e()) !== u3 ? (So(), e7 = Te, (o4 = oo()) !== u3 ? (i2 = So(), (s2 = _e()) !== u3 ? e7 = o4 = [o4, i2, s2, So()] : (Te = e7, e7 = u3)) : (Te = e7, e7 = u3), e7 === u3 && (e7 = null), (o4 = Fo()) !== u3 ? r5 = rt(n5, t6, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function pu() {
- var r5, n5, t6, e7;
- return r5 = Te, ao() !== u3 ? (So(), Io() !== u3 ? (So(), (n5 = du()) === u3 && (n5 = null), So(), (t6 = _e()) !== u3 ? (So(), uo() !== u3 ? (So(), (e7 = _e()) !== u3 ? (So(), Fo() !== u3 ? r5 = nt(n5, t6, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, ao() !== u3 ? (So(), Io() !== u3 ? (So(), (n5 = du()) === u3 && (n5 = null), So(), (t6 = _e()) !== u3 ? (So(), Fo() !== u3 ? r5 = tt(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)), r5;
- }
- function du() {
- var r5;
- return (r5 = vo()) === u3 && (r5 = po()) === u3 && (r5 = ho()), r5;
- }
- function hu() {
- var r5, n5, t6;
- return r5 = Te, co() !== u3 ? (So(), Io() !== u3 ? (So(), (n5 = _e()) !== u3 ? (So(), Xu() !== u3 ? (So(), (t6 = _e()) !== u3 ? (So(), Fo() !== u3 ? r5 = et(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function bu() {
- var r5, n5, t6;
- return r5 = Te, (n5 = Do()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = Pe()) === u3 && (t6 = null), So(), Fo() !== u3 ? r5 = ut(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function yu() {
- var r5;
- return (r5 = Ao()) === u3 && (r5 = go()) === u3 && (r5 = Co()) === u3 && (r5 = mo()) === u3 && (r5 = Eo()) === u3 && (r5 = xo()), r5;
- }
- function Au() {
- var r5;
- return (r5 = Su()) === u3 && (r5 = _u()) === u3 && (r5 = Iu()) === u3 && (r5 = Ru()) === u3 && (r5 = Ou()) === u3 && (r5 = gu()) === u3 && (r5 = Cu()), r5;
- }
- function gu() {
- var r5, n5;
- return r5 = Te, fo() !== u3 ? (So(), (n5 = Fu()) !== u3 ? r5 = ot(n5) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function Cu() {
- var n5, t6, e7, o4;
- return n5 = Te, yo() !== u3 ? (So(), r4.charCodeAt(Te) === 45 ? (t6 = y2, Te++) : (t6 = u3, Re === 0 && He(Or)), t6 === u3 && (r4.charCodeAt(Te) === 43 ? (t6 = b2, Te++) : (t6 = u3, Re === 0 && He(Nr))), t6 !== u3 ? (So(), (e7 = Fu()) !== u3 ? (So(), (o4 = mu()) !== u3 ? n5 = it(t6, e7, o4) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5 === u3 && (n5 = Te, yo() !== u3 ? (So(), (t6 = Fu()) !== u3 ? (So(), (e7 = mu()) !== u3 ? n5 = st(t6, e7) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3)), n5;
- }
- function mu() {
- var r5, n5, t6;
- return r5 = Te, (n5 = Eu()) !== u3 ? (So(), bo() !== u3 ? (So(), (t6 = xu()) !== u3 ? r5 = at(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Lu()), r5;
- }
- function Eu() {
- var r5, n5, t6;
- return r5 = Te, (n5 = Tu()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = Nu()) !== u3 ? (So(), Fo() !== u3 ? r5 = ct(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = Tu()) !== u3 && (n5 = ft(n5)), r5 = n5), r5;
- }
- function xu() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = Tu()) !== u3 && (n5 = lt(n5)), (r5 = n5) === u3 && (r5 = Te, (n5 = xo()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = Nu()) !== u3 ? (So(), Ro() !== u3 ? (So(), (e7 = wu()) !== u3 ? (So(), Fo() !== u3 ? r5 = vt(t6, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = xo()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = Nu()) !== u3 ? (So(), Fo() !== u3 ? r5 = pt(t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = xo()) !== u3 && (n5 = dt()), r5 = n5))), r5;
- }
- function Lu() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = Tu()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = wu()) !== u3 ? (So(), Fo() !== u3 ? r5 = ht(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = Tu()) !== u3 && (n5 = ft(n5)), (r5 = n5) === u3 && (r5 = Te, (n5 = xo()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = Nu()) !== u3 ? (So(), Ro() !== u3 ? (So(), (e7 = wu()) !== u3 ? (So(), Fo() !== u3 ? r5 = vt(t6, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = xo()) !== u3 ? (So(), Io() !== u3 ? (So(), (t6 = wu()) !== u3 ? (So(), Fo() !== u3 ? r5 = bt(t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = xo()) !== u3 && (n5 = yt()), r5 = n5)))), r5;
- }
- function Tu() {
- var r5, n5;
- return r5 = Te, (n5 = Co()) !== u3 && (n5 = At()), (r5 = n5) === u3 && (r5 = Te, (n5 = mo()) !== u3 && (n5 = gt()), (r5 = n5) === u3 && (r5 = Te, (n5 = Eo()) !== u3 && (n5 = Ct()), (r5 = n5) === u3 && (r5 = Te, (n5 = go()) !== u3 && (n5 = mt()), (r5 = n5) === u3 && (r5 = Te, (n5 = Ao()) !== u3 && (n5 = Et()), r5 = n5)))), r5;
- }
- function wu() {
- var r5;
- return (r5 = Wu()) !== u3 && (r5 = xt(r5)), r5;
- }
- function Nu() {
- var r5;
- return (r5 = Wu()) !== u3 && (r5 = xt(r5)), r5;
- }
- function Ou() {
- var r5, n5;
- return r5 = Te, lo() !== u3 ? (So(), (n5 = Fu()) !== u3 ? r5 = Lt(n5) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function Ru() {
- var r5;
- return (r5 = qu()) !== u3 && (r5 = Tt()), r5;
- }
- function Iu() {
- var r5, n5;
- return r5 = Te, (n5 = Ku()) !== u3 && (n5 = wt()), (r5 = n5) === u3 && (r5 = Te, (n5 = Vu()) !== u3 && (n5 = Nt()), r5 = n5), r5;
- }
- function Fu() {
- var r5;
- return (r5 = Su()) === u3 && (r5 = fu()), r5;
- }
- function Su() {
- var n5, t6, e7, o4, i2;
- if (n5 = Te, r4.charCodeAt(Te) === 39 ? (t6 = m2, Te++) : (t6 = u3, Re === 0 && He(Hr)), t6 === u3 && (r4.substr(Te, 2) === E2 ? (t6 = E2, Te += 2) : (t6 = u3, Re === 0 && He(Ur))), t6 !== u3) {
- for (e7 = [], o4 = Te, r4.substr(Te, 2) === x2 ? (i2 = x2, Te += 2) : (i2 = u3, Re === 0 && He(jr)), i2 !== u3 && (i2 = Ot()), (o4 = i2) === u3 && (pr.test(r4.charAt(Te)) ? (o4 = r4.charAt(Te), Te++) : (o4 = u3, Re === 0 && He(Pr))); o4 !== u3; )
- e7.push(o4), o4 = Te, r4.substr(Te, 2) === x2 ? (i2 = x2, Te += 2) : (i2 = u3, Re === 0 && He(jr)), i2 !== u3 && (i2 = Ot()), (o4 = i2) === u3 && (pr.test(r4.charAt(Te)) ? (o4 = r4.charAt(Te), Te++) : (o4 = u3, Re === 0 && He(Pr)));
- r4.charCodeAt(Te) === 39 ? (o4 = m2, Te++) : (o4 = u3, Re === 0 && He(Hr)), o4 !== u3 ? n5 = Rt(e7) : (Te = n5, n5 = u3);
- } else
- Te = n5, n5 = u3;
- return n5;
- }
- function Mu() {
- var r5;
- return (r5 = Du()) === u3 && (r5 = Hu()), r5;
- }
- function Du() {
- var r5, n5, t6, e7, o4;
- if (r5 = Te, Lo() !== u3)
- if (So(), (n5 = _e()) !== u3) {
- for (So(), t6 = [], e7 = ju(); e7 !== u3; )
- t6.push(e7), e7 = ju();
- e7 = So(), (o4 = To()) !== u3 ? r5 = It(n5, t6) : (Te = r5, r5 = u3);
- } else
- Te = r5, r5 = u3;
- else
- Te = r5, r5 = u3;
- if (r5 === u3)
- if (r5 = Te, Lo() !== u3)
- if (So(), (n5 = _e()) !== u3) {
- for (So(), t6 = [], e7 = ju(); e7 !== u3; )
- t6.push(e7), e7 = ju();
- e7 = So(), (o4 = Pu()) !== u3 ? (So(), To() !== u3 ? r5 = Ft(n5, t6, o4) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3);
- } else
- Te = r5, r5 = u3;
- else
- Te = r5, r5 = u3;
- return r5;
- }
- function Hu() {
- var r5, n5, t6, e7;
- if (r5 = Te, Lo() !== u3) {
- for (So(), n5 = [], t6 = Uu(); t6 !== u3; )
- n5.push(t6), t6 = Uu();
- t6 = So(), (e7 = To()) !== u3 ? r5 = St(n5) : (Te = r5, r5 = u3);
- } else
- Te = r5, r5 = u3;
- if (r5 === u3)
- if (r5 = Te, Lo() !== u3) {
- for (So(), n5 = [], t6 = Uu(); t6 !== u3; )
- n5.push(t6), t6 = Uu();
- t6 = So(), (e7 = Pu()) !== u3 ? (So(), To() !== u3 ? r5 = Mt(n5, e7) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3);
- } else
- Te = r5, r5 = u3;
- return r5;
- }
- function Uu() {
- var r5, n5, t6;
- return r5 = Te, wo() !== u3 ? (So(), (n5 = _e()) !== u3 ? (So(), No() !== u3 ? (So(), (t6 = _e()) !== u3 ? r5 = Dt(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function ju() {
- var r5, n5, t6;
- return r5 = Te, wo() !== u3 ? (So(), (n5 = _e()) !== u3 ? (So(), No() !== u3 ? (So(), (t6 = _e()) !== u3 ? r5 = Dt(n5, t6) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function Pu() {
- var r5, n5;
- return r5 = Te, Oo() !== u3 ? (So(), (n5 = _e()) !== u3 ? r5 = Ht(n5) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function _u() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = Bu()) !== u3 ? (t6 = Te, Re++, e7 = su(), Re--, e7 === u3 ? t6 = void 0 : (Te = t6, t6 = u3), t6 !== u3 ? r5 = Ut(n5) : (Te = r5, r5 = u3)) : (Te = r5, r5 = u3), r5;
- }
- function Bu() {
- var r5, n5, t6, e7;
- return r5 = Te, (n5 = zu()) !== u3 && (t6 = Gu()) !== u3 && (e7 = Zu()) !== u3 ? r5 = jt(n5, t6, e7) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = zu()) !== u3 && (t6 = Gu()) !== u3 ? r5 = Pt(n5, t6) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = zu()) !== u3 && (t6 = Zu()) !== u3 ? r5 = _t(n5, t6) : (Te = r5, r5 = u3), r5 === u3 && (r5 = Te, (n5 = zu()) !== u3 && (n5 = Bt(n5)), r5 = n5))), r5;
- }
- function zu() {
- var n5, t6, e7;
- return (n5 = Wu()) === u3 && (n5 = Te, r4.charCodeAt(Te) === 45 ? (t6 = y2, Te++) : (t6 = u3, Re === 0 && He(Or)), t6 === u3 && (r4.charCodeAt(Te) === 43 ? (t6 = b2, Te++) : (t6 = u3, Re === 0 && He(Nr))), t6 !== u3 && (e7 = Wu()) !== u3 ? n5 = zt(t6, e7) : (Te = n5, n5 = u3)), n5;
- }
- function Gu() {
- var n5, t6, e7;
- return n5 = Te, r4.charCodeAt(Te) === 46 ? (t6 = L, Te++) : (t6 = u3, Re === 0 && He(_r)), t6 !== u3 ? ((e7 = Wu()) === u3 && (e7 = null), n5 = Gt(e7)) : (Te = n5, n5 = u3), n5;
- }
- function Zu() {
- var r5, n5, t6;
- return r5 = Te, (n5 = ku()) !== u3 && (t6 = Wu()) !== u3 ? r5 = Zt(n5, t6) : (Te = r5, r5 = u3), r5;
- }
- function Wu() {
- var r5, n5;
- if (r5 = [], (n5 = Yu()) !== u3)
- for (; n5 !== u3; )
- r5.push(n5), n5 = Yu();
- else
- r5 = u3;
- return r5 !== u3 && (r5 = Wt(r5)), r5;
- }
- function Yu() {
- var n5;
- return dr.test(r4.charAt(Te)) ? (n5 = r4.charAt(Te), Te++) : (n5 = u3, Re === 0 && He(Br)), n5;
- }
- function ku() {
- var n5, t6, e7;
- return n5 = Te, hr.test(r4.charAt(Te)) ? (t6 = r4.charAt(Te), Te++) : (t6 = u3, Re === 0 && He(zr)), t6 !== u3 ? (br.test(r4.charAt(Te)) ? (e7 = r4.charAt(Te), Te++) : (e7 = u3, Re === 0 && He(Gr)), e7 === u3 && (e7 = null), n5 = Yt(t6, e7)) : (Te = n5, n5 = u3), n5;
- }
- function qu() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === T2 ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(Zr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = t6 = [t6, e7] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Ku() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === w2 ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(Wr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = t6 = [t6, e7] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Vu() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 5).toLowerCase() === N2 ? (t6 = r4.substr(Te, 5), Te += 5) : (t6 = u3, Re === 0 && He(Yr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = t6 = [t6, e7] : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Xu() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 2).toLowerCase() === O2 ? (t6 = r4.substr(Te, 2), Te += 2) : (t6 = u3, Re === 0 && He(kr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = kt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function $u() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 2).toLowerCase() === R ? (t6 = r4.substr(Te, 2), Te += 2) : (t6 = u3, Re === 0 && He(qr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = qt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Ju() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === I2 ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(Kr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Kt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Qu() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 6).toLowerCase() === F2 ? (t6 = r4.substr(Te, 6), Te += 6) : (t6 = u3, Re === 0 && He(Vr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Vt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function ro() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 3).toLowerCase() === S2 ? (t6 = r4.substr(Te, 3), Te += 3) : (t6 = u3, Re === 0 && He(Xr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Xt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function no() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 3).toLowerCase() === M2 ? (t6 = r4.substr(Te, 3), Te += 3) : (t6 = u3, Re === 0 && He($r)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = $t() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function to() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 2).toLowerCase() === D2 ? (t6 = r4.substr(Te, 2), Te += 2) : (t6 = u3, Re === 0 && He(Jr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Jt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function eo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 7).toLowerCase() === H ? (t6 = r4.substr(Te, 7), Te += 7) : (t6 = u3, Re === 0 && He(Qr)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Qt() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function uo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === U ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(rn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = re() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function oo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 3).toLowerCase() === j ? (t6 = r4.substr(Te, 3), Te += 3) : (t6 = u3, Re === 0 && He(nn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ne() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function io() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 9).toLowerCase() === P ? (t6 = r4.substr(Te, 9), Te += 9) : (t6 = u3, Re === 0 && He(tn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = te() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function so() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 7).toLowerCase() === _2 ? (t6 = r4.substr(Te, 7), Te += 7) : (t6 = u3, Re === 0 && He(en)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ee() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function ao() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === B ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(un)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ue() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function co() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 8).toLowerCase() === z ? (t6 = r4.substr(Te, 8), Te += 8) : (t6 = u3, Re === 0 && He(on)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = oe() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function fo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 9).toLowerCase() === G ? (t6 = r4.substr(Te, 9), Te += 9) : (t6 = u3, Re === 0 && He(sn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ie() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function lo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === Z ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(an)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = se() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function vo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 7).toLowerCase() === W ? (t6 = r4.substr(Te, 7), Te += 7) : (t6 = u3, Re === 0 && He(cn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ae() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function po() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 8).toLowerCase() === Y ? (t6 = r4.substr(Te, 8), Te += 8) : (t6 = u3, Re === 0 && He(fn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ce() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function ho() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === k2 ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(ln)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = fe() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function bo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 2).toLowerCase() === q ? (t6 = r4.substr(Te, 2), Te += 2) : (t6 = u3, Re === 0 && He(vn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = le() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function yo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 8).toLowerCase() === K ? (t6 = r4.substr(Te, 8), Te += 8) : (t6 = u3, Re === 0 && He(pn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ve() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Ao() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === V ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(dn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = pe() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function go() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 5).toLowerCase() === X ? (t6 = r4.substr(Te, 5), Te += 5) : (t6 = u3, Re === 0 && He(hn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = de() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Co() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 3).toLowerCase() === $ ? (t6 = r4.substr(Te, 3), Te += 3) : (t6 = u3, Re === 0 && He(bn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = he() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function mo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === J2 ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(yn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = be() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Eo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 6).toLowerCase() === Q ? (t6 = r4.substr(Te, 6), Te += 6) : (t6 = u3, Re === 0 && He(An)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ye() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function xo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 6).toLowerCase() === rr ? (t6 = r4.substr(Te, 6), Te += 6) : (t6 = u3, Re === 0 && He(gn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Ae() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Lo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === nr ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(Cn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = ge() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function To() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 3).toLowerCase() === tr ? (t6 = r4.substr(Te, 3), Te += 3) : (t6 = u3, Re === 0 && He(mn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Ce() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function wo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === er ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(En)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = me() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function No() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === ur ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(xn)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = Ee() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Oo() {
- var n5, t6, e7, o4;
- return n5 = Te, r4.substr(Te, 4).toLowerCase() === or ? (t6 = r4.substr(Te, 4), Te += 4) : (t6 = u3, Re === 0 && He(Ln)), t6 !== u3 ? (e7 = Te, Re++, o4 = au(), Re--, o4 === u3 ? e7 = void 0 : (Te = e7, e7 = u3), e7 !== u3 ? n5 = xe() : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3), n5;
- }
- function Ro() {
- var n5;
- return r4.charCodeAt(Te) === 44 ? (n5 = ir, Te++) : (n5 = u3, Re === 0 && He(Tn)), n5;
- }
- function Io() {
- var n5;
- return r4.charCodeAt(Te) === 40 ? (n5 = sr, Te++) : (n5 = u3, Re === 0 && He(wn)), n5;
- }
- function Fo() {
- var n5;
- return r4.charCodeAt(Te) === 41 ? (n5 = ar, Te++) : (n5 = u3, Re === 0 && He(Nn)), n5;
- }
- function So() {
- var r5, n5;
- for (r5 = [], n5 = Mo(); n5 !== u3; )
- r5.push(n5), n5 = Mo();
- return r5;
- }
- function Mo() {
- var n5;
- return yr.test(r4.charAt(Te)) ? (n5 = r4.charAt(Te), Te++) : (n5 = u3, Re === 0 && He(On)), n5;
- }
- function Do() {
- var n5, t6, e7, o4;
- if (n5 = Te, (t6 = iu()) !== u3 && (t6 = Xn(t6)), (n5 = t6) === u3)
- if (n5 = Te, r4.charCodeAt(Te) === 96 ? (t6 = cr, Te++) : (t6 = u3, Re === 0 && He(Rn)), t6 !== u3) {
- if (e7 = [], Ar.test(r4.charAt(Te)) ? (o4 = r4.charAt(Te), Te++) : (o4 = u3, Re === 0 && He(In)), o4 !== u3)
- for (; o4 !== u3; )
- e7.push(o4), Ar.test(r4.charAt(Te)) ? (o4 = r4.charAt(Te), Te++) : (o4 = u3, Re === 0 && He(In));
- else
- e7 = u3;
- e7 !== u3 ? (r4.charCodeAt(Te) === 96 ? (o4 = cr, Te++) : (o4 = u3, Re === 0 && He(Rn)), o4 !== u3 ? n5 = Le(e7) : (Te = n5, n5 = u3)) : (Te = n5, n5 = u3);
- } else
- Te = n5, n5 = u3;
- return n5;
- }
- function Ho(r5, n5) {
- return { type: "unary-expression", operator: r5, expr: n5 };
- }
- function Uo(r5, n5, t6, e7) {
- var u4 = { type: "binary-expression", operator: r5, left: n5, right: t6 };
- return e7 !== void 0 && (u4.escape = e7), u4;
- }
- function jo(r5, n5) {
- for (var t6 = [r5], e7 = 0; e7 < n5.length; e7++)
- t6.push(n5[e7][3]);
- return t6;
- }
- function Po(r5, n5, t6) {
- return jo(r5, n5);
- }
- function _o(r5, n5) {
- for (var t6 = r5, e7 = 0; e7 < n5.length; e7++)
- t6 = Uo(n5[e7][1], t6, n5[e7][3]);
- return t6;
- }
- if ((e6 = s()) !== u3 && Te === r4.length)
- return e6;
- throw e6 !== u3 && Te < r4.length && He(Se()), Ue(Oe, Ne < r4.length ? r4.charAt(Ne) : null, Ne < r4.length ? De(Ne, Ne + 1) : De(Ne, Ne));
- }
- return r3(n4, Error), n4.prototype.format = function(r4) {
- var n5 = "Error: " + this.message;
- if (this.location) {
- var e6, u3 = null;
- for (e6 = 0; e6 < r4.length; e6++)
- if (r4[e6].source === this.location.source) {
- u3 = r4[e6].text.split(/\r\n|\n|\r/g);
- break;
- }
- var o3 = this.location.start, i = this.location.source + ":" + o3.line + ":" + o3.column;
- if (u3) {
- var s = this.location.end, a3 = t4("", o3.line.toString().length), c2 = u3[o3.line - 1], f2 = o3.line === s.line ? s.column : c2.length + 1;
- n5 += "\n --> " + i + "\n" + a3 + " |\n" + o3.line + " | " + c2 + "\n" + a3 + " | " + t4("", o3.column - 1) + t4("", f2 - o3.column, "^");
- } else
- n5 += "\n at " + i;
- }
- return n5;
- }, n4.buildMessage = function(r4, n5) {
- var t5 = { literal: function(r5) {
- return '"' + u3(r5.text) + '"';
- }, class: function(r5) {
- var n6 = r5.parts.map(function(r6) {
- return Array.isArray(r6) ? o3(r6[0]) + "-" + o3(r6[1]) : o3(r6);
- });
- return "[" + (r5.inverted ? "^" : "") + n6 + "]";
- }, any: function() {
- return "any character";
- }, end: function() {
- return "end of input";
- }, other: function(r5) {
- return r5.description;
- } };
- function e6(r5) {
- return r5.charCodeAt(0).toString(16).toUpperCase();
- }
- function u3(r5) {
- return r5.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(r6) {
- return "\\x0" + e6(r6);
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(r6) {
- return "\\x" + e6(r6);
- });
- }
- function o3(r5) {
- return r5.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(r6) {
- return "\\x0" + e6(r6);
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(r6) {
- return "\\x" + e6(r6);
- });
- }
- function i(r5) {
- return t5[r5.type](r5);
- }
- function s(r5) {
- var n6, t6, e7 = r5.map(i);
- if (e7.sort(), e7.length > 0) {
- for (n6 = 1, t6 = 1; n6 < e7.length; n6++)
- e7[n6 - 1] !== e7[n6] && (e7[t6] = e7[n6], t6++);
- e7.length = t6;
- }
- switch (e7.length) {
- case 1:
- return e7[0];
- case 2:
- return e7[0] + " or " + e7[1];
- default:
- return e7.slice(0, -1).join(", ") + ", or " + e7[e7.length - 1];
- }
- }
- function a3(r5) {
- return r5 ? '"' + u3(r5) + '"' : "end of input";
- }
- return "Expected " + s(r4) + " but " + a3(n5) + " found.";
- }, { SyntaxError: n4, parse: e5 };
- }, (n3 = e4).exports && (n3.exports = t3());
- var u = class {
- static parse(r3) {
- return e4.exports.parse(r3);
- }
- };
- // node_modules/@arcgis/core/core/sql/WhereClause.js
- var l2 = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
- var u2 = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)$/;
- var o2 = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)(\+|\-)(\d{1,2}):(\d{1,2})$/;
- var c = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})(\+|\-)(\d{1,2}):(\d{1,2})$/;
- var h = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;
- var d = new Set(["current_timestamp", "current_date", "current_time"]);
- function p(e5, t4) {
- return (e5 += "").length >= t4 ? e5 : new Array(t4 - e5.length + 1).join("0") + e5;
- }
- function v(e5, t4, a3 = "0", r3 = "0", s = "0", n4 = "0", i = "", l3 = "0", u3 = "0") {
- if (i === "+" || i === "-") {
- const o3 = `${p(parseInt(e5, 10), 4)}-${p(parseInt(t4, 10), 2)}-${p(parseInt(a3, 10), 2)}`;
- let c2 = "";
- parseFloat(n4) < 10 && (c2 = "0");
- const h2 = `${p(parseInt(r3, 10), 2)}:${p(parseInt(s, 10), 2)}:${c2 + parseFloat(n4).toString()}`, d2 = `${i}${p(parseInt(l3, 10), 2)}:${p(parseInt(u3, 10), 2)}`;
- return new Date(o3 + "T" + h2 + d2);
- }
- return new Date(parseInt(e5, 10), parseInt(t4, 10) - 1, parseInt(a3, 10), parseInt(r3, 10), parseInt(s, 10), parseFloat(n4));
- }
- var f = class {
- static makeBool(e5) {
- return T(e5);
- }
- static featureValue(e5, t4, a3, r3) {
- return O(e5, t4, a3, r3);
- }
- static equalsNull(e5) {
- return e5 === null;
- }
- static applyLike(e5, t4, a3) {
- return b(e5, t4, a3);
- }
- static ensureArray(e5) {
- return _(e5);
- }
- static applyIn(e5, t4) {
- return I(e5, t4);
- }
- static currentDate() {
- const e5 = new Date();
- return e5.setHours(0, 0, 0, 0), e5;
- }
- static makeSqlInterval(e5, t4, a3) {
- return e2.createFromValueAndQualifer(e5, t4, a3);
- }
- static convertInterval(e5) {
- return e5 instanceof e2 ? e5.valueInMilliseconds() : e5;
- }
- static currentTimestamp() {
- return new Date();
- }
- static compare(e5, t4, a3) {
- return x(e5, t4, a3);
- }
- static calculate(e5, t4, a3) {
- return F(e5, t4, a3);
- }
- static makeComparable(e5) {
- return E(e5);
- }
- static evaluateFunction(e5, t4) {
- return r2(e5, t4);
- }
- static lookup(e5, t4) {
- const a3 = t4[e5];
- return a3 === void 0 ? null : a3;
- }
- static between(e5, t4) {
- return e5 == null || t4[0] == null || t4[1] == null ? null : e5 >= t4[0] && e5 <= t4[1];
- }
- static notbetween(e5, t4) {
- return e5 == null || t4[0] == null || t4[1] == null ? null : e5 < t4[0] || e5 > t4[1];
- }
- static ternaryNot(e5) {
- return S(e5);
- }
- static ternaryAnd(e5, t4) {
- return w(e5, t4);
- }
- static ternaryOr(e5, t4) {
- return y(e5, t4);
- }
- };
- var m = class {
- constructor(e5, t4) {
- this.fieldsIndex = t4, this.datefields = {}, this.parameters = {}, this._hasDateFunctions = void 0, this.parseTree = u.parse(e5);
- const { isStandardized: a3, isAggregate: r3, referencedFieldNames: s } = this._extractExpressionInfo(t4);
- this.referencedFieldNames = s, this.isStandardized = a3, this.isAggregate = r3;
- }
- static create(e5, t4) {
- return new m(e5, t4);
- }
- get fieldNames() {
- return this.referencedFieldNames;
- }
- testSet(e5, t4 = k) {
- const a3 = {};
- for (const r3 of this.fieldNames)
- a3[r3] = e5.map((e6) => t4.getAttribute(e6, r3));
- return !!this._evaluateNode(this.parseTree, { attributes: a3 }, k);
- }
- calculateValue(e5, t4 = k) {
- const a3 = this._evaluateNode(this.parseTree, e5, t4);
- return a3 instanceof e2 ? a3.valueInMilliseconds() / 864e5 : a3;
- }
- calculateValueCompiled(t4, a3 = k) {
- return this.parseTree._compiledVersion != null ? this.parseTree._compiledVersion(t4, this.parameters, a3, this.datefields) : a("esri-csp-restrictions") ? this.calculateValue(t4, a3) : (this._compileMe(), this.parseTree._compiledVersion(t4, this.parameters, a3, this.datefields));
- }
- testFeature(e5, t4 = k) {
- return !!this._evaluateNode(this.parseTree, e5, t4);
- }
- testFeatureCompiled(t4, a3 = k) {
- return this.parseTree._compiledVersion != null ? !!this.parseTree._compiledVersion(t4, this.parameters, a3, this.datefields) : a("esri-csp-restrictions") ? this.testFeature(t4, a3) : (this._compileMe(), !!this.parseTree._compiledVersion(t4, this.parameters, a3, this.datefields));
- }
- get hasDateFunctions() {
- return this._hasDateFunctions != null || (this._hasDateFunctions = false, this._visitAll(this.parseTree, (e5) => {
- e5.type === "current-time" ? this._hasDateFunctions = true : e5.type === "function" && (this._hasDateFunctions = this._hasDateFunctions || d.has(e5.name.toLowerCase()));
- })), this._hasDateFunctions;
- }
- getFunctions() {
- const e5 = new Set();
- return this._visitAll(this.parseTree, (t4) => {
- t4.type === "function" && e5.add(t4.name.toLowerCase());
- }), Array.from(e5);
- }
- getExpressions() {
- const e5 = new Map();
- return this._visitAll(this.parseTree, (t4) => {
- if (t4.type === "function") {
- const a3 = t4.name.toLowerCase(), r3 = t4.args.value[0];
- if (r3.type === "column-reference") {
- const t5 = r3.column, s = `${a3}-${t5}`;
- e5.has(s) || e5.set(s, { aggregateType: a3, field: t5 });
- }
- }
- }), [...e5.values()];
- }
- getVariables() {
- const e5 = new Set();
- return this._visitAll(this.parseTree, (t4) => {
- t4.type === "parameter" && e5.add(t4.value.toLowerCase());
- }), Array.from(e5);
- }
- _compileMe() {
- const e5 = "return this.convertInterval(" + this.evaluateNodeToJavaScript(this.parseTree) + ")";
- this.parseTree._compiledVersion = new Function("feature", "lookups", "attributeAdapter", "datefields", e5).bind(f);
- }
- _extractExpressionInfo(e5) {
- const a3 = [], r3 = new Set();
- let n4 = true, i = true;
- return this._visitAll(this.parseTree, (l3) => {
- switch (l3.type) {
- case "column-reference": {
- const t4 = e5.get(l3.column);
- let s, n5;
- t4 ? s = n5 = t4.name : (n5 = l3.column, s = n5.toLowerCase()), !t4 || t4.type !== "date" && t4.type !== "esriFieldTypeDate" || (this.datefields[t4.name] = 1), r3.has(s) || (r3.add(s), a3.push(n5)), l3.column = n5;
- break;
- }
- case "function": {
- const { name: e6, args: a4 } = l3, r4 = a4.value.length;
- n4 && (n4 = t2(e6, r4)), i && (i = n(e6, r4));
- break;
- }
- }
- }), { referencedFieldNames: Array.from(a3), isStandardized: n4, isAggregate: i };
- }
- _visitAll(e5, t4) {
- if (e5 != null)
- switch (t4(e5), e5.type) {
- case "when-clause":
- this._visitAll(e5.operand, t4), this._visitAll(e5.value, t4);
- break;
- case "case-expression":
- for (const a3 of e5.clauses)
- this._visitAll(a3, t4);
- e5.format === "simple" && this._visitAll(e5.operand, t4), e5.else !== null && this._visitAll(e5.else, t4);
- break;
- case "expression-list":
- for (const a3 of e5.value)
- this._visitAll(a3, t4);
- break;
- case "unary-expression":
- this._visitAll(e5.expr, t4);
- break;
- case "binary-expression":
- this._visitAll(e5.left, t4), this._visitAll(e5.right, t4);
- break;
- case "function":
- this._visitAll(e5.args, t4);
- }
- }
- evaluateNodeToJavaScript(e5) {
- switch (e5.type) {
- case "interval":
- return "this.makeSqlInterval(" + this.evaluateNodeToJavaScript(e5.value) + ", " + JSON.stringify(e5.qualifier) + "," + JSON.stringify(e5.op) + ")";
- case "case-expression": {
- let t4 = "";
- if (e5.format === "simple") {
- const a3 = "this.makeComparable(" + this.evaluateNodeToJavaScript(e5.operand) + ")";
- t4 = "( ";
- for (let r3 = 0; r3 < e5.clauses.length; r3++)
- t4 += " (" + a3 + " === this.makeComparable(" + this.evaluateNodeToJavaScript(e5.clauses[r3].operand) + ")) ? (" + this.evaluateNodeToJavaScript(e5.clauses[r3].value) + ") : ";
- e5.else !== null ? t4 += this.evaluateNodeToJavaScript(e5.else) : t4 += "null", t4 += " )";
- } else {
- t4 = "( ";
- for (let a3 = 0; a3 < e5.clauses.length; a3++)
- t4 += " this.makeBool(" + this.evaluateNodeToJavaScript(e5.clauses[a3].operand) + ")===true ? (" + this.evaluateNodeToJavaScript(e5.clauses[a3].value) + ") : ";
- e5.else !== null ? t4 += this.evaluateNodeToJavaScript(e5.else) : t4 += "null", t4 += " )";
- }
- return t4;
- }
- case "parameter":
- return "this.lookup(" + JSON.stringify(e5.value.toLowerCase()) + ",lookups)";
- case "expression-list": {
- let t4 = "[";
- for (const a3 of e5.value)
- t4 !== "[" && (t4 += ","), t4 += this.evaluateNodeToJavaScript(a3);
- return t4 += "]", t4;
- }
- case "unary-expression":
- return "this.ternaryNot(" + this.evaluateNodeToJavaScript(e5.expr) + ")";
- case "binary-expression":
- switch (e5.operator) {
- case "AND":
- return "this.ternaryAnd(" + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + " )";
- case "OR":
- return "this.ternaryOr(" + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + " )";
- case "IS":
- if (e5.right.type !== "null")
- throw new Error("Unsupported RHS for IS");
- return "this.equalsNull(" + this.evaluateNodeToJavaScript(e5.left) + ")";
- case "ISNOT":
- if (e5.right.type !== "null")
- throw new Error("Unsupported RHS for IS");
- return "(!(this.equalsNull(" + this.evaluateNodeToJavaScript(e5.left) + ")))";
- case "IN":
- return "this.applyIn(" + this.evaluateNodeToJavaScript(e5.left) + ",this.ensureArray(" + this.evaluateNodeToJavaScript(e5.right) + "))";
- case "NOT IN":
- return "this.ternaryNot(this.applyIn(" + this.evaluateNodeToJavaScript(e5.left) + ",this.ensureArray(" + this.evaluateNodeToJavaScript(e5.right) + ")))";
- case "BETWEEN":
- return "this.between(" + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + ")";
- case "NOTBETWEEN":
- return "this.notbetween(" + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + ")";
- case "LIKE":
- return "this.applyLike(" + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + "," + JSON.stringify(e5.escape) + ")";
- case "NOT LIKE":
- return "this.ternaryNot(this.applyLike(" + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + "," + JSON.stringify(e5.escape) + "))";
- case "<>":
- case "<":
- case ">":
- case ">=":
- case "<=":
- case "=":
- return "this.compare(" + JSON.stringify(e5.operator) + "," + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + ")";
- case "*":
- case "-":
- case "+":
- case "/":
- return "this.calculate(" + JSON.stringify(e5.operator) + "," + this.evaluateNodeToJavaScript(e5.left) + "," + this.evaluateNodeToJavaScript(e5.right) + ")";
- }
- throw new Error("Not Supported Operator " + e5.operator);
- case "null":
- case "boolean":
- case "string":
- case "number":
- return JSON.stringify(e5.value);
- case "date":
- return "(new Date(" + g(e5.value).getTime().toString() + "))";
- case "timestamp":
- return "(new Date(" + N(e5.value).getTime().toString() + "))";
- case "current-time":
- return e5.mode === "date" ? "this.currentDate()" : "this.currentTimestamp()";
- case "column-reference":
- return "this.featureValue(feature," + JSON.stringify(e5.column) + ",datefields,attributeAdapter)";
- case "function":
- return "this.evaluateFunction(" + JSON.stringify(e5.name) + "," + this.evaluateNodeToJavaScript(e5.args) + ")";
- }
- throw new Error("Unsupported sql syntax " + e5.type);
- }
- _evaluateNode(e5, t4, s) {
- switch (e5.type) {
- case "interval": {
- const a3 = this._evaluateNode(e5.value, t4, s);
- return e2.createFromValueAndQualifer(a3, e5.qualifier, e5.op);
- }
- case "case-expression":
- if (e5.format === "simple") {
- const a3 = E(this._evaluateNode(e5.operand, t4, s));
- for (let r3 = 0; r3 < e5.clauses.length; r3++)
- if (a3 === E(this._evaluateNode(e5.clauses[r3].operand, t4, s)))
- return this._evaluateNode(e5.clauses[r3].value, t4, s);
- if (e5.else !== null)
- return this._evaluateNode(e5.else, t4, s);
- } else {
- for (let a3 = 0; a3 < e5.clauses.length; a3++)
- if (T(this._evaluateNode(e5.clauses[a3].operand, t4, s)))
- return this._evaluateNode(e5.clauses[a3].value, t4, s);
- if (e5.else !== null)
- return this._evaluateNode(e5.else, t4, s);
- }
- return null;
- case "parameter":
- return this.parameters[e5.value.toLowerCase()];
- case "expression-list": {
- const a3 = [];
- for (const r3 of e5.value)
- a3.push(this._evaluateNode(r3, t4, s));
- return a3;
- }
- case "unary-expression":
- return S(this._evaluateNode(e5.expr, t4, s));
- case "binary-expression":
- switch (e5.operator) {
- case "AND":
- return w(this._evaluateNode(e5.left, t4, s), this._evaluateNode(e5.right, t4, s));
- case "OR":
- return y(this._evaluateNode(e5.left, t4, s), this._evaluateNode(e5.right, t4, s));
- case "IS":
- if (e5.right.type !== "null")
- throw new Error("Unsupported RHS for IS");
- return this._evaluateNode(e5.left, t4, s) === null;
- case "ISNOT":
- if (e5.right.type !== "null")
- throw new Error("Unsupported RHS for IS");
- return this._evaluateNode(e5.left, t4, s) !== null;
- case "IN": {
- const a3 = _(this._evaluateNode(e5.right, t4, s));
- return I(this._evaluateNode(e5.left, t4, s), a3);
- }
- case "NOT IN": {
- const a3 = _(this._evaluateNode(e5.right, t4, s));
- return S(I(this._evaluateNode(e5.left, t4, s), a3));
- }
- case "BETWEEN": {
- const a3 = this._evaluateNode(e5.left, t4, s), r3 = this._evaluateNode(e5.right, t4, s);
- return a3 == null || r3[0] == null || r3[1] == null ? null : a3 >= E(r3[0]) && a3 <= E(r3[1]);
- }
- case "NOTBETWEEN": {
- const a3 = this._evaluateNode(e5.left, t4, s), r3 = this._evaluateNode(e5.right, t4, s);
- return a3 == null || r3[0] == null || r3[1] == null ? null : a3 < E(r3[0]) || a3 > E(r3[1]);
- }
- case "LIKE":
- return b(this._evaluateNode(e5.left, t4, s), this._evaluateNode(e5.right, t4, s), e5.escape);
- case "NOT LIKE":
- return S(b(this._evaluateNode(e5.left, t4, s), this._evaluateNode(e5.right, t4, s), e5.escape));
- case "<>":
- case "<":
- case ">":
- case ">=":
- case "<=":
- case "=":
- return x(e5.operator, this._evaluateNode(e5.left, t4, s), this._evaluateNode(e5.right, t4, s));
- case "-":
- case "+":
- case "*":
- case "/":
- return F(e5.operator, this._evaluateNode(e5.left, t4, s), this._evaluateNode(e5.right, t4, s));
- }
- case "null":
- case "boolean":
- case "string":
- case "number":
- return e5.value;
- case "date":
- return g(e5.value);
- case "timestamp":
- return N(e5.value);
- case "current-time": {
- const t5 = new Date();
- return e5.mode === "date" && t5.setHours(0, 0, 0, 0), t5;
- }
- case "column-reference":
- return O(t4, e5.column, this.datefields, s);
- case "function": {
- const r3 = this._evaluateNode(e5.args, t4, s);
- return this.isAggregate ? a2(e5.name, r3) : r2(e5.name, r3);
- }
- }
- throw new Error("Unsupported sql syntax " + e5.type);
- }
- };
- function N(e5) {
- let t4 = u2.exec(e5);
- if (t4 !== null) {
- const [, e6, a3, r3, s, n4, i] = t4;
- return v(e6, a3, r3, s, n4, i);
- }
- if (t4 = o2.exec(e5), t4 !== null) {
- const [, e6, a3, r3, s, n4, i, l3, u3, o3] = t4;
- return v(e6, a3, r3, s, n4, i, l3, u3, o3);
- }
- if (t4 = c.exec(e5), t4 !== null) {
- const [, e6, a3, r3, s, n4, i, l3, u3] = t4;
- return v(e6, a3, r3, s, n4, "0", i, l3, u3);
- }
- if (t4 = h.exec(e5), t4 !== null) {
- const [, e6, a3, r3, s, n4] = t4;
- return v(e6, a3, r3, s, n4);
- }
- if (t4 = l2.exec(e5), t4 !== null) {
- const [, e6, a3, r3] = t4;
- return v(e6, a3, r3);
- }
- throw new Error("SQL Invalid Timestamp");
- }
- function g(e5) {
- const t4 = l2.exec(e5);
- if (t4 === null)
- throw new Error("SQL Invalid Date");
- const [, a3, r3, s] = t4;
- return new Date(parseInt(a3, 10), parseInt(r3, 10) - 1, parseInt(s, 10));
- }
- function T(e5) {
- return e5 === true;
- }
- function _(e5) {
- return Array.isArray(e5) ? e5 : [e5];
- }
- function S(e5) {
- return e5 !== null ? e5 !== true : null;
- }
- function w(e5, t4) {
- return e5 != null && t4 != null ? e5 === true && t4 === true : e5 !== false && t4 !== false && null;
- }
- function y(e5, t4) {
- return e5 != null && t4 != null ? e5 === true || t4 === true : e5 === true || t4 === true || null;
- }
- function I(e5, t4) {
- if (e5 == null)
- return null;
- let a3 = false;
- for (const r3 of t4)
- if (r3 == null)
- a3 = null;
- else if (e5 === r3) {
- a3 = true;
- break;
- }
- return a3;
- }
- var J = "-[]/{}()*+?.\\^$|";
- var A;
- function D(e5, t4) {
- const a3 = t4;
- let r3 = "", s = A.Normal;
- for (let n4 = 0; n4 < e5.length; n4++) {
- const t5 = e5.charAt(n4);
- switch (s) {
- case A.Normal:
- t5 === a3 ? s = A.Escaped : J.includes(t5) ? r3 += "\\" + t5 : r3 += t5 === "%" ? ".*" : t5 === "_" ? "." : t5;
- break;
- case A.Escaped:
- J.includes(t5) ? r3 += "\\" + t5 : r3 += t5, s = A.Normal;
- }
- }
- return new RegExp("^" + r3 + "$", "m");
- }
- function b(e5, t4, a3) {
- if (e5 == null)
- return null;
- return D(t4, a3).test(e5);
- }
- function E(e5) {
- return e5 instanceof Date ? e5.valueOf() : e5;
- }
- function x(e5, t4, a3) {
- if (t4 == null || a3 == null)
- return null;
- const r3 = E(t4), s = E(a3);
- switch (e5) {
- case "<>":
- return r3 !== s;
- case "=":
- return r3 === s;
- case ">":
- return r3 > s;
- case "<":
- return r3 < s;
- case ">=":
- return r3 >= s;
- case "<=":
- return r3 <= s;
- }
- }
- function F(e5, t4, a3) {
- if (t4 instanceof e2)
- if (a3 instanceof Date)
- switch (e5) {
- case "+":
- return new Date(t4.valueInMilliseconds() + a3.getTime());
- case "-":
- return t4.valueInMilliseconds() - a3.getTime();
- case "*":
- return t4.valueInMilliseconds() * a3.getTime();
- case "/":
- return t4.valueInMilliseconds() / a3.getTime();
- }
- else if (a3 instanceof e2)
- switch (e5) {
- case "+":
- return e2.createFromMilliseconds(t4.valueInMilliseconds() + a3.valueInMilliseconds());
- case "-":
- return e2.createFromMilliseconds(t4.valueInMilliseconds() - a3.valueInMilliseconds());
- case "*":
- return t4.valueInMilliseconds() * a3.valueInMilliseconds();
- case "/":
- return t4.valueInMilliseconds() / a3.valueInMilliseconds();
- }
- else
- t4 = t4.valueInMilliseconds();
- else if (a3 instanceof e2)
- if (t4 instanceof Date)
- switch (e5) {
- case "+":
- return new Date(a3.valueInMilliseconds() + t4.getTime());
- case "-":
- return new Date(t4.getTime() - a3.valueInMilliseconds());
- case "*":
- return t4.getTime() * a3.valueInMilliseconds();
- case "/":
- return t4.getTime() / a3.valueInMilliseconds();
- }
- else
- a3 = a3.valueInMilliseconds();
- else if (t4 instanceof Date && typeof a3 == "number")
- switch (a3 = 24 * a3 * 60 * 60 * 1e3, t4 = t4.getTime(), e5) {
- case "+":
- return new Date(t4 + a3);
- case "-":
- return new Date(t4 - a3);
- case "*":
- return new Date(t4 * a3);
- case "/":
- return new Date(t4 / a3);
- }
- else if (a3 instanceof Date && typeof t4 == "number")
- switch (t4 = 24 * t4 * 60 * 60 * 1e3, a3 = a3.getTime(), e5) {
- case "+":
- return new Date(t4 + a3);
- case "-":
- return new Date(t4 - a3);
- case "*":
- return new Date(t4 * a3);
- case "/":
- return new Date(t4 / a3);
- }
- switch (e5) {
- case "+":
- return t4 + a3;
- case "-":
- return t4 - a3;
- case "*":
- return t4 * a3;
- case "/":
- return t4 / a3;
- }
- }
- function M(e5) {
- return e5 && typeof e5.attributes == "object";
- }
- function O(e5, t4, a3, r3) {
- const s = r3.getAttribute(e5, t4);
- return s != null && a3[t4] === 1 ? new Date(s) : s;
- }
- !function(e5) {
- e5[e5.Normal = 0] = "Normal", e5[e5.Escaped = 1] = "Escaped";
- }(A || (A = {}));
- var k = { getAttribute: (e5, t4) => (M(e5) ? e5.attributes : e5)[t4] };
- export {
- m,
- k
- };
- //# sourceMappingURL=chunk-ETWBEEKL.js.map
|