UNPKG

@opra/common

Version:
6 lines (5 loc) 190 kB
/**************************************** * All rights reserved Panates® 2022-2026 * http://www.panates.com *****************************************/ var ci=Object.defineProperty;var Qa=(o,e,t)=>e in o?ci(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e)=>ci(o,"name",{value:e,configurable:!0});var br=(o,e)=>{for(var t in e)ci(o,t,{get:e[t],enumerable:!0})};var p=(o,e,t)=>Qa(o,typeof e!="symbol"?e+"":e,t);import"reflect-metadata";Array.prototype.findLast||(Array.prototype.findLast=function(o,e){let t=this.findLastIndex(o,e);return t>=0?this[t]:void 0},Array.prototype.findLastIndex=function(o,e){if(this==null)throw new TypeError("this is null or not defined");let t=Object(this),r=this.length;e=e||this;for(let i=r-1;i>=0;i--)if(o.call(e,t[i],i,t))return i;return-1});import{omitUndefined as Pp}from"@jsopen/objects";import{isString as Fp}from"valgen";import{omitUndefined as rp}from"@jsopen/objects";import Xa from"@browsery/i18next";import{splitString as Za,tokenize as Bs}from"fast-tokenizer";var Ya=/\\(.)/g,Ga=/(\\)/g;function $s(o){return o.replace(Ga,"\\\\")}a($s,"escapeString");function qs(o){return o.replace(Ya,"$1")}a(qs,"unescapeString");var Ha=Object.getPrototypeOf(Xa.createInstance()).constructor,Yt=class Yt extends Ha{async init(e,t){let r=typeof e=="object"?e:{},i=typeof e=="function"?e:t;try{let n=await super.init(r,i),s=this.services.formatter;if(s.add("lowercase",(c,l)=>c.toLocaleLowerCase(l)),s.add("uppercase",(c,l)=>c.toLocaleUpperCase(l)),s.add("upperFirst",(c,l)=>c.charAt(0).toLocaleUpperCase(l)+c.substring(1)),r!=null&&r.resources)for(let c of Object.keys(r.resources)){let l=r.resources[c];for(let m of Object.keys(l))this.addResourceBundle(c,m,l[m],!1,!0)}return i&&i(null,n),n}catch(n){throw i&&i(n,this.t),n}}deep(e,t){if(e==null)return e;let r=new WeakMap;return this._deepTranslate(e,r,t)}createInstance(e,t){return new Yt(e,t)}static createInstance(e,t){return new Yt(e,t)}_deepTranslate(e,t,r){if(e==null||r!=null&&r.ignore&&r.ignore(e,this))return e;if(typeof e=="object"&&t.has(e))return t.get(e);if(typeof e=="string"){let i="";for(let n of Bs(e,{brackets:{"$t(":")"},quotes:!0,keepQuotes:!0,keepBrackets:!0,keepDelimiters:!0})){if(n.startsWith("$t(")&&n.endsWith(")")){n=n.substring(3,n.length-1);let s=Za(n,{delimiters:"?",quotes:!0,brackets:{"{":"}"}}),c=qs(n.substring((s[0]||"").length+1));n=s[0]||"";let l=[],m=null;for(let g of Bs(n,{delimiters:",",quotes:!0,brackets:{"{":"}"}})){if(g.startsWith("{")){m=JSON.parse(g);continue}l.push(g)}let T=l.length>1?"$t("+l.join(",")+")":l[0];i+=c?this.t(T,c,{...r,...m}):this.t(T,{...r,...m});continue}i+=n}return i}if(Array.isArray(e)){let i=Array(e.length);t.set(e,i);for(let n=0,s=e.length;n<s;n++)i[n]=this._deepTranslate(e[n],t,r);return t.delete(e),i}if(typeof e=="object"){if(Buffer.isBuffer(e)||Buffer.isBuffer(e)||e instanceof Symbol||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet)return e;let i={};t.set(e,i);let n=Object.keys(e);for(let s=0,c=n.length;s<c;s++){let l=n[s];i[l]=this._deepTranslate(e[l],t,r)}return t.delete(e),i}return e}static get defaultInstance(){return ep}};a(Yt,"I18n");var Gt=Yt,ep=Gt.createInstance();var tp=/(\))/g;function Af(o,e,t){let r=e&&typeof e=="object"?e:void 0,i=typeof e=="string"?e:t;return"$t("+o+(r?","+JSON.stringify(r):"")+(i?"?"+$s(i).replace(tp,"\\$1"):"")+")"}a(Af,"translate");var li=Gt.createInstance();li.init().catch(()=>{});var fi=class fi extends Error{constructor(t,r){super("Unknown error");p(this,"cause");p(this,"severity","error");p(this,"system");p(this,"code");p(this,"details");r=r||(t instanceof Error?t:void 0),t instanceof Error&&(r=t),r&&r instanceof Error&&(this.cause=r,r.stack&&(this.stack=r.stack)),typeof t=="string"?this.initString(t):t instanceof Error?this.initError(t):this.init(t),this.message=this.message||this.constructor.name}toString(){return li.deep(this.message)}toJSON(){return rp({message:this.message,severity:this.severity,system:this.system,code:this.code,details:this.details,stack:this.stack},!0)}init(t){this.message=(t==null?void 0:t.message)||this.constructor.name,this.severity=(t==null?void 0:t.severity)||"error",t&&(this.system=t.system,this.code=t.code,this.details=t.details)}initString(t){this.init({message:String(t||"")||this.constructor.name,severity:"error",code:this.constructor.name})}initError(t){let r="production";this.init({message:t.message,severity:t.severity||"error",code:t.code||t.constructor.name,stack:r==="dev"||r==="development"||r==="test"?t.stack:void 0})}};a(fi,"OpraException");var Ee=fi;var mi=class mi extends Ee{constructor(t,r,i){super(t,r instanceof Error?r:void 0);p(this,"status");this.status=(typeof r=="number"?r:Number(i))||500}setStatus(t){return this.status=t,this}initError(t){typeof t.status=="number"?this.status=t.status:typeof t.getStatus=="function"&&(this.status=t.getStatus()),super.initError(t)}};a(mi,"OpraHttpError");var v=mi;var ui=class ui extends v{constructor(){super(...arguments);p(this,"status",400)}init(t){super.init({message:"Bad request",code:"BAD_REQUEST",...t})}};a(ui,"BadRequestError");var Ks=ui;var di=class di extends v{constructor(){super(...arguments);p(this,"status",409)}init(t){super.init({message:"Conflict",code:"CONFLICT",...t})}};a(di,"ConflictError");var Vs=di;var hi=class hi extends v{constructor(){super(...arguments);p(this,"status",424)}init(t){super.init({message:"The request failed due to failure of a previous request",code:"FAILED_DEPENDENCY",...t})}};a(hi,"FailedDependencyError");var Ws=hi;var zs;(function(o){o.X_Opra_Version="X-Opra-Version",o.X_Total_Count="X-Total-Count",o.WWW_Authenticate="WWW-Authenticate",o.Authorization="Authorization",o.Proxy_Authenticate="Proxy-Authenticate",o.Proxy_Authorization="Proxy-Authorization",o.Age="Age",o.Cache_Control="Cache-Control",o.Clear_Site_Data="Clear-Site-Data",o.Expires="Expires",o.Pragma="Pragma",o.Last_Modified="Last-Modified",o.ETag="ETag",o.If_Match="If-Match",o.If_None_Match="If-None-Match",o.If_Modified_Since="If-Modified-Since",o.If_Unmodified_Since="If-Unmodified-Since",o.Vary="Vary",o.Connection="Connection",o.Keep_Alive="Keep-Alive",o.Accept="Accept",o.Accept_Encoding="Accept-Encoding",o.Accept_Language="Accept-Language",o.Expect="Expect",o.Cookie="Cookie",o.Set_Cookie="Set-Cookie",o.Access_Control_Allow_Origin="Access-Control-Allow-Origin",o.Access_Control_Allow_Credentials="Access-Control-Allow-Credentials",o.Access_Control_Allow_Headers="Access-Control-Allow-Headers",o.Access_Control_Allow_Methods="Access-Control-Allow-Methods",o.Access_Control_Expose_Headers="Access-Control-Expose-Headers",o.Access_Control_Max_Age="Access-Control-Max-Age",o.Access_Control_Request_Headers="Access-Control-Request-Headers",o.Access_Control_Request_Method="Access-Control-Request-Method",o.Origin="Origin",o.Timing_Allow_Origin="Timing-Allow-Origin",o.Content_Disposition="Content-Disposition",o.Content_ID="Content-ID",o.Content_Length="Content-Length",o.Content_Type="Content-Type",o.Content_Transfer_Encoding="Content-Transfer-Encoding",o.Content_Encoding="Content-Encoding",o.Content_Language="Content-Language",o.Content_Location="Content-Location",o.Forwarded="Forwarded",o.X_Forwarded_For="X-Forwarded-For",o.X_Forwarded_Host="X-Forwarded-Host",o.X_Forwarded_Proto="X-Forwarded-Proto",o.Via="Via",o.Location="Location",o.From="From",o.Host="Host",o.Referer="Referer",o.Referrer_Policy="Referrer-Policy",o.User_Agent="User-Agent",o.Allow="Allow",o.Server="Server",o.Accept_Ranges="Accept-Ranges",o.Range="Range",o.If_Range="If-Range",o.Content_Range="Content-Range",o.Cross_Origin_Embedder_Policy="Cross-Origin-Embedder-Policy",o.Cross_Origin_Opener_Policy="Cross-Origin-Opener-Policy",o.Cross_Origin_Resource_Policy="Cross-Origin-Resource-Policy",o.Content_Security_Policy="Content-Security-Policy",o.Content_Security_Policy_Report_Only="Content-Security-Policy-Report-Only",o.Expect_CT="Expect-CT",o.Feature_Policy="Feature-Policy",o.Strict_Transport_Security="Strict-Transport-Security",o.Upgrade="Upgrade",o.Upgrade_Insecure_Requests="Upgrade-Insecure-Requests",o.X_Content_Type_Options="X-Content-Type-Options",o.X_Download_Options="X-Download-Options",o.X_Frame_Options="X-Frame-Options",o.X_Permitted_Cross_Domain_Policies="X-Permitted-Cross-Domain-Policies",o.X_Powered_By="X-Powered-By",o.X_XSS_Protection="X-XSS-Protection",o.Transfer_Encoding="Transfer-Encoding",o.TE="TE",o.Trailer="Trailer",o.Sec_WebSocket_Key="Sec-WebSocket-Key",o.Sec_WebSocket_Extensions="Sec-WebSocket-Extensions",o.Sec_WebSocket_Accept="Sec-WebSocket-Accept",o.Sec_WebSocket_Protocol="Sec-WebSocket-Protocol",o.Sec_WebSocket_Version="Sec-WebSocket-Version",o.Date="Date",o.Retry_After="Retry-After",o.Server_Timing="Server-Timing",o.X_DNS_Prefetch_Control="X-DNS-Prefetch-Control",o.Max_Forwards="Max-Forwards"})(zs||(zs={}));var R;(function(o){o[o.CONTINUE=100]="CONTINUE",o[o.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",o[o.PROCESSING=102]="PROCESSING",o[o.EARLYHINTS=103]="EARLYHINTS",o[o.OK=200]="OK",o[o.CREATED=201]="CREATED",o[o.ACCEPTED=202]="ACCEPTED",o[o.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",o[o.NO_CONTENT=204]="NO_CONTENT",o[o.RESET_CONTENT=205]="RESET_CONTENT",o[o.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",o[o.AMBIGUOUS=300]="AMBIGUOUS",o[o.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",o[o.FOUND=302]="FOUND",o[o.SEE_OTHER=303]="SEE_OTHER",o[o.NOT_MODIFIED=304]="NOT_MODIFIED",o[o.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",o[o.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",o[o.BAD_REQUEST=400]="BAD_REQUEST",o[o.UNAUTHORIZED=401]="UNAUTHORIZED",o[o.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",o[o.FORBIDDEN=403]="FORBIDDEN",o[o.NOT_FOUND=404]="NOT_FOUND",o[o.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",o[o.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",o[o.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",o[o.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",o[o.CONFLICT=409]="CONFLICT",o[o.GONE=410]="GONE",o[o.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",o[o.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",o[o.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",o[o.URI_TOO_LONG=414]="URI_TOO_LONG",o[o.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",o[o.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",o[o.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",o[o.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",o[o.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",o[o.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",o[o.LOCKED=423]="LOCKED",o[o.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",o[o.TOO_EARLY=425]="TOO_EARLY",o[o.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",o[o.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",o[o.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",o[o.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",o[o.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",o[o.BAD_GATEWAY=502]="BAD_GATEWAY",o[o.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",o[o.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",o[o.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",o[o.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",o[o.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",o[o.LOOP_DETECTED=508]="LOOP_DETECTED",o[o.NOT_EXTENDED=510]="NOT_EXTENDED",o[o.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(R||(R={}));var Qf={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};var N;(function(o){o.json="application/json",o.opra_response_json="application/opra.response+json",o.xml="application/XML",o.text="text/plain",o.html="text/html",o.markdown="text/markdown",o.binary="binary/octet-stream"})(N||(N={}));var yi=class yi extends v{constructor(){super(...arguments);p(this,"status",R.FORBIDDEN)}init(t){super.init({message:"You are not authorized to perform this action",code:"FORBIDDEN",...t})}};a(yi,"ForbiddenError");var Dr=yi;var Ti=class Ti extends v{constructor(){super(...arguments);p(this,"status",500)}init(t){super.init({message:"Internal server error",code:"INTERNAL_SERVER_ERROR",severity:"fatal",...t})}};a(Ti,"InternalServerError");var Js=Ti;var Ei=class Ei extends v{constructor(){super(...arguments);p(this,"status",405)}init(t){super.init({message:"Method not allowed",code:"METHOD_NOT_ALLOWED",...t})}};a(Ei,"MethodNotAllowedError");var Qs=Ei;var _i=class _i extends v{constructor(){super(...arguments);p(this,"status",406)}init(t){super.init({message:"Not Acceptable",code:"NOT_ACCEPTABLE",...t})}};a(_i,"NotAcceptableError");var Ys=_i;var xi=class xi extends v{constructor(){super(...arguments);p(this,"status",404)}init(t){super.init({message:"Not found",code:"NOT_FOUND",...t})}};a(xi,"NotFoundError");var Gs=xi;var gi=class gi extends Dr{init(e){super.init({message:"You dont have permission for this operation",code:"PERMISSION_ERROR",...e})}};a(gi,"PermissionError");var Xs=gi;var wi=class wi extends v{constructor(t,r,i){super({message:`There is already an other "${t}" resource with same values for field(s) [${r}]`,severity:"error",code:"RESOURCE_CONFLICT",details:{resource:t,location:r}},i);p(this,"status",409)}};a(wi,"ResourceConflictError");var Zs=wi;var Ai=class Ai extends v{constructor(e,t,r){super({message:`Resource "${e}${t?"/"+t:""}" is not available`,severity:"error",code:"RESOURCE_NOT_AVAILABLE",details:{resource:e,key:t}},r,R.UNPROCESSABLE_ENTITY)}};a(Ai,"ResourceNotAvailableError");var Hs=Ai;var Oi=class Oi extends v{constructor(){super(...arguments);p(this,"status",401)}init(t){super.init({message:"You don't have permission to perform this action",code:"UNAUTHORIZED",...t})}};a(Oi,"UnauthorizedError");var ea=Oi;var Ri=class Ri extends v{constructor(){super(...arguments);p(this,"status",422)}init(t){super.init({message:"Unprocessable entity",severity:"error",code:"UNPROCESSABLE_ENTITY",...t})}};a(Ri,"UnprocessableEntityError");var ta=Ri;var ra;(function(o){let e;(function(t){t.fatal="fatal",t.error="error",t.warning="warning",t.info="info"})(e=o.Enum||(o.Enum={})),o.name="IssueSeverity",o.description="Severity of the issue",o.Keys=Object.keys(o),o.descriptions={fatal:"The issue caused the action to fail and no further checking could be performed",error:"The issue is sufficiently important to cause the action to fail",warning:"The issue is not important enough to cause the action to fail but may cause it to be performed suboptimally or in a way that is not as desired",info:"The issue has no relation to the degree of success of the action"}})(ra||(ra={}));BigInt.prototype.toJSON||(BigInt.prototype.toJSON=function(){return this.toString()});RegExp.prototype.toJSON||(RegExp.prototype.toJSON=function(){return this.toString()});import{isConstructor as ip}from"@jsopen/objects";import op from"putil-promisify";async function Z(o){return o=op.isPromise(o)?await o:o,typeof o=="function"?ip(o)?o:await o():o}a(Z,"resolveThunk");var ia=/^(?:file:\/\/)?(.+)$/;function iu(o=1){if(o>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+o+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");let e=Error.prepareStackTrace;Error.prepareStackTrace=(r,i)=>i;let t=new Error().stack;if(Error.prepareStackTrace=e,t!==null&&typeof t=="object"){let r=t[o]?t[o].getFileName():void 0,i=r?ia.exec(r):void 0;return i?i[1]:""}return""}a(iu,"getStackFileName");function ou(o=1){if(o>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+o+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");let e=Error.prepareStackTrace;Error.prepareStackTrace=(r,i)=>i;let t=new Error().stack;if(Error.prepareStackTrace=e,t!==null&&typeof t=="object"){let r=t[o]?t[o].getFileName():void 0,i=r?ia.exec(r):void 0;return i?i[1]:""}return""}a(ou,"getErrorStack");function Nr(o,e,t){for(let r of Object.getOwnPropertyNames(e))r==="constructor"||r==="__proto__"||r==="toJSON"||r==="toString"||t&&!t(r)||Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(e,r)||Object.create(null))}a(Nr,"mergePrototype");function Sr(o,e,t=r=>!0){try{let r=new e;Object.getOwnPropertyNames(r).filter(n=>typeof r[n]<"u"&&typeof o[n]>"u").filter(n=>t(n)).forEach(n=>{o[n]=r[n]})}catch{}}a(Sr,"inheritPropertyInitializers");import{isPlainObject as na,merge as np}from"@jsopen/objects";var y=Symbol.for("opra.type.metadata"),se=Symbol("opra.http-controller.metadata"),ae=Symbol("opra.mq-controller.metadata"),pe=Symbol("opra.ws-controller.metadata"),Xt=Symbol("opra.ws-param.metadata"),cu=Symbol("opra.rpc-controller.metadata"),x=Symbol.for("opra.type.decoder"),w=Symbol("opra.type.encoder"),A=Symbol.for("DECORATOR"),Ke=Symbol.for("BUILTIN"),oa=/([a-z$_]\w+):(.+)/i,F=/^[a-z][\w_]*$/i,k=Symbol.for("kDataTypeMap"),Mr=Symbol.for("kCtorMap"),be=Symbol.for("kTypeNSMap");function L(o,e){return np({},o,{deep:a(t=>na(t)&&!t[y],"deep"),symbolKeys:!0,copyDescriptors:!0,ignoreUndefined:!0,filter(t,r){let i=r[t];return!e||typeof i!="function"&&(typeof i!="object"||na(i)||Array.isArray(i))}})}a(L,"cloneObject");import{splitString as sa}from"fast-tokenizer";var sp=/^([+-])?([a-z_$]\w*)$/i,ap=/[^.]\(/g,bi=class bi{};a(bi,"FieldsProjection");var Ve=bi;(function(o){let t=class t{constructor(){p(this,"sign");p(this,"projection")}};a(t,"Item");let e=t;o.Item=e})(Ve||(Ve={}));function aa(o,e){let t=Array.isArray(o)?o:[o];if(!(t&&t.length))return;let r=new Ve;for(let i of t)e||(i=i.toLowerCase()),pa(i,r);return r}a(aa,"parseFieldsProjection");function pa(o,e){o=o.replace(ap,r=>r.charAt(0)+"."+r.substring(1));let t=sa(o,{delimiters:".",brackets:!0,keepBrackets:!1});for(let r=0;r<t.length;r++){let i=t[r];if(i.includes(",")){let l=sa(i,{delimiters:",",brackets:!0,keepBrackets:!0});for(let m of l)pa(m,e);continue}let n=sp.exec(i);if(!n)throw new TypeError(`Invalid field path (${o})`);let s=n[2],c=e[s]=e[s]||new Ve.Item;n[1]&&(c.sign=n[1]),r===t.length-1?delete c.projection:e=c.projection=c.projection||new Ve}}a(pa,"parse");function pp(o){return o&&typeof o.forEach=="function"}a(pp,"isMap");var Q=Symbol.for("kEntries"),ce=Symbol.for("kKeyMap"),vr=Symbol.for("kWellKnownKeys"),Di=Symbol.for("kOptions"),pt=Symbol.for("kSize"),Ni=class Ni{constructor(e,t){Object.defineProperty(this,pt,{value:0,enumerable:!1,writable:!0}),Object.defineProperty(this,Q,{value:{},enumerable:!1,writable:!0}),Object.defineProperty(this,ce,{value:{},enumerable:!1,writable:!0}),Object.defineProperty(this,vr,{value:{},enumerable:!1,writable:!0});let r=!!(t!=null&&t.caseSensitive);Object.defineProperty(this,Di,{value:{caseSensitive:r},enumerable:!1}),t!=null&&t.wellKnownKeys&&t.wellKnownKeys.forEach(i=>{r?this[vr][i]=i:this[vr][i.toLowerCase()]=i}),this.clear(),e&&this.setAll(e)}get size(){return this[pt]}clear(){Object.keys(this[Q]).forEach(e=>delete this[Q][e]),Object.keys(this[ce]).forEach(e=>delete this[ce][e]),this[pt]=0}forEach(e,t){for(let[r,i]of this.entries())e.call(t,i,r,this)}get(e){if(e)return this[Q][this._getStoringKey(e)]}has(e){return e?Object.prototype.hasOwnProperty.call(this[Q],this._getStoringKey(e)):!1}set(e,t){let r=this._getStoringKey(e);e=this._getOriginalKey(e);let i=Object.prototype.hasOwnProperty.call(this[Q],r);return this[Q][r]=t,i||this[pt]++,this[ce][r]=e,this}setAll(e){return pp(e)?e.forEach((t,r)=>this.set(r,t)):Object.keys(e).forEach(t=>this.set(t,e[t])),this}keys(){return Object.values(this[ce])[Symbol.iterator]()}values(){return Object.values(this[Q])[Symbol.iterator]()}entries(){return Object.entries(this[Q])[Symbol.iterator]()}delete(e){let t=this._getStoringKey(e),r=Object.prototype.hasOwnProperty.call(this[Q],t);return delete this[Q][t],delete this[ce][t],r||this[pt]--,r}sort(e){let t={...this[Q]},r={...this[ce]},i=Array.from(this.keys());e?i.sort(e):i.sort(),this.clear();for(let n of i)this[Q][n]=t[n],this[ce][n]=r[n];return this[pt]=i.length,this}toObject(){let e={};for(let[t,r]of Object.entries(this[ce]))e[r]=this[Q][t];return e}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"[Object ResponsiveMap]"}_getOriginalKey(e){if(!e||this[Di].caseSensitive)return e;let t=this._getStoringKey(e);return this[ce][t]??this[vr][t]??e}_getStoringKey(e){return this[Di].caseSensitive?e:e.toLowerCase()}};a(Ni,"ResponsiveMap");var S=Ni;function xu(o,e,t){let r=new WeakSet;return JSON.stringify(o,(i,n)=>{if(n!==null&&typeof n=="object"){if(r.has(n))return;r.add(n)}return e?e(i,n):n},t)}a(xu,"safeJsonStringify");function Si(o){return o!==null&&typeof o=="object"&&typeof o.pipe=="function"}a(Si,"isStream");function Au(o){return Si(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}a(Au,"isReadable");function Ou(o){return Si(o)&&typeof o._write=="function"}a(Ou,"isWritable");function Ru(o){return Si(o)&&typeof o.getReader=="function"&&typeof o.pipeThrough=="function"&&typeof o.pipeTo=="function"}a(Ru,"isReadableStream");function bu(o){return o!==null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.arrayBuffer=="function"&&typeof o.stream=="function"}a(bu,"isBlob");function Du(o){return o!==null&&typeof o.constructor=="function"&&o.constructor.name==="FormData"&&typeof o.append=="function"&&typeof o.getAll=="function"}a(Du,"isFormData");function Nu(o){return o!==null&&typeof o=="object"&&typeof o.host=="string"&&typeof o.href=="string"}a(Nu,"isURL");var Mi=class Mi{constructor(){p(this,"kind");this.kind=Object.getPrototypeOf(this).constructor.name}};a(Mi,"Ast");var Zt=Mi;var vi=class vi extends Zt{};a(vi,"Expression");var q=vi;var Ii=class Ii extends q{};a(Ii,"Term");var We=Ii;var ki=class ki extends We{constructor(e){super(),this.value=e}toString(){return""+this.value}};a(ki,"Literal");var P=ki;var Li=class Li extends q{constructor(){super();p(this,"items",[])}append(t,r){return this.items.push(new Ir({op:t,expression:r})),this}toString(){return this.items.map((t,r)=>(r>0?t.op:"")+t.expression).join("")}};a(Li,"ArithmeticExpression");var ze=Li,Pi=class Pi{constructor(e){p(this,"op");p(this,"expression");Object.assign(this,e)}};a(Pi,"ArithmeticExpressionItem");var Ir=Pi;var Fi=class Fi extends We{constructor(t){super();p(this,"items");this.items=t}toString(){return"["+this.items.map(t=>""+t).join(",")+"]"}};a(Fi,"ArrayExpression");var _e=Fi;var cp=/\w/,ji=class ji extends q{constructor(t){super();p(this,"op");p(this,"left");p(this,"right");p(this,"prepare");Object.assign(this,t)}toString(){return`${this.left}${cp.test(this.op)?" "+this.op+" ":this.op}${this.right}`}};a(ji,"ComparisonExpression");var le=ji;var Ci=class Ci extends q{constructor(t){super();p(this,"op");p(this,"items");Object.assign(this,t),this.op==="&&"&&(this.op="and"),this.op==="||"&&(this.op="or")}toString(){return this.items.map(t=>""+t).join(" "+this.op+" ")}};a(Ci,"LogicalExpression");var fe=Ci;var Ui=class Ui extends q{constructor(t){super();p(this,"expression");this.expression=t}toString(){return`(${this.expression})`}};a(Ui,"NegativeExpression");var Ht=Ui;var $i=class $i extends q{constructor(t){super();p(this,"expression");this.expression=t}toString(){return`(${this.expression})`}};a($i,"ParenthesizedExpression");var xe=$i;var qi=class qi extends P{constructor(e){super(e)}};a(qi,"BooleanLiteral");var Je=qi;import{toDateDef as hp}from"putil-varhelpers";var Bi=class Bi extends TypeError{};a(Bi,"SyntaxError");var kr=Bi,Ki=class Ki extends TypeError{constructor(e){super(typeof e=="string"?e:e==null?void 0:e.message),typeof e=="object"&&Object.assign(this,e)}};a(Ki,"FilterValidationError");var me=Ki,Vi=class Vi extends Error{constructor(e,t){super(e),Object.assign(this,t)}};a(Vi,"FilterParseError");var Lr=Vi;var lp=/'/g,fp=/(\\)/g,mp=/\\(.)/g;function up(o){return o.replace(fp,"\\\\")}a(up,"escapeString");function dp(o){return o.replace(mp,"$1")}a(dp,"unescapeString");function De(o){return"'"+up(o).replace(lp,"\\'")+"'"}a(De,"quoteFilterString");function er(o){return o&&(o.startsWith("'")||o.startsWith('"'))&&o.endsWith(o.charAt(0))?dp(o.substring(1,o.length-1)):o}a(er,"unquoteFilterString");var ca=new Date(0),Wi=class Wi extends P{constructor(t){super("");p(this,"value");if(t instanceof Date){this.value=t.toISOString();return}if(typeof t=="string"&&hp(t,ca)!==ca){this.value=t;return}throw new me(`Invalid date value "${t}"`)}toString(){return De(this.value)}};a(Wi,"DateLiteral");var Ne=Wi;import{toDateDef as yp}from"putil-varhelpers";var la=new Date(0),zi=class zi extends P{constructor(t){super("");p(this,"value");if(t instanceof Date){this.value=t.toISOString();return}if(typeof t=="string"&&yp(t,la)!==la){this.value=t;return}throw new me(`Invalid date-time value "${t}"`)}toString(){return De(this.value)}};a(zi,"DateTimeLiteral");var tr=zi;var Ji=class Ji extends P{constructor(){super(null);p(this,"value",null)}};a(Ji,"NullLiteral");var Qe=Ji;var Qi=class Qi extends P{constructor(t){super(0);p(this,"value");if(typeof t=="number"||typeof t=="bigint"){this.value=t;return}try{if(typeof t=="string"){if(t.includes(".")){this.value=parseFloat(t);return}let r=Number(t);""+r===t?this.value=r:this.value=BigInt(t);return}}catch{}throw new me(`Invalid number literal ${t}`)}toString(){return typeof this.value=="bigint"?(""+this.value).replace(/n$/,""):""+this.value}};a(Qi,"NumberLiteral");var ge=Qi;var Yi=class Yi extends P{constructor(e){super(""+e)}};a(Yi,"QualifiedIdentifier");var H=Yi;var Gi=class Gi extends P{constructor(e){super(""+e)}toString(){return De(this.value)}};a(Gi,"StringLiteral");var Ye=Gi;var Tp=/^([01]\d|2[0-3]):([0-5]\d)(:[0-5]\d)?(\.(\d+))?$/,Xi=class Xi extends P{constructor(t){super("");p(this,"value");if(t instanceof Date){this.value=Pr(t.getHours())+":"+Pr(t.getMinutes())+(t.getSeconds()?":"+Pr(t.getSeconds()):"")+(t.getMilliseconds()?"."+Pr(t.getMilliseconds()):"");return}if(typeof t=="string"&&Tp.test(t)){this.value=t;return}throw new me(`Invalid time value "${t}"`)}toString(){return De(this.value)}};a(Xi,"TimeLiteral");var Ge=Xi;function Pr(o){return o<=9?"0"+o:""+o}a(Pr,"pad");import{CharStream as kp,CommonTokenStream as Lp}from"@browsery/antlr4";import{ATNDeserializer as Ep,DFA as _p,Lexer as xp,LexerATNSimulator as gp,PredictionContextCache as wp,Token as Ap}from"@browsery/antlr4";var h=class h extends xp{constructor(e){super(e),this._interp=new gp(this,h._ATN,h.DecisionsToDFA,new wp)}get grammarFileName(){return"OpraFilter.g4"}get literalNames(){return h.literalNames}get symbolicNames(){return h.symbolicNames}get ruleNames(){return h.ruleNames}get serializedATN(){return h._serializedATN}get channelNames(){return h.channelNames}get modeNames(){return h.modeNames}static get _ATN(){return h.__ATN||(h.__ATN=new Ep().deserialize(h._serializedATN)),h.__ATN}};a(h,"OpraFilterLexer"),p(h,"T__0",1),p(h,"T__1",2),p(h,"T__2",3),p(h,"T__3",4),p(h,"T__4",5),p(h,"T__5",6),p(h,"T__6",7),p(h,"T__7",8),p(h,"T__8",9),p(h,"T__9",10),p(h,"T__10",11),p(h,"T__11",12),p(h,"T__12",13),p(h,"T__13",14),p(h,"T__14",15),p(h,"T__15",16),p(h,"T__16",17),p(h,"T__17",18),p(h,"T__18",19),p(h,"T__19",20),p(h,"T__20",21),p(h,"T__21",22),p(h,"T__22",23),p(h,"T__23",24),p(h,"T__24",25),p(h,"T__25",26),p(h,"T__26",27),p(h,"T__27",28),p(h,"T__28",29),p(h,"T__29",30),p(h,"T__30",31),p(h,"T__31",32),p(h,"T__32",33),p(h,"T__33",34),p(h,"IDENTIFIER",35),p(h,"POLAR_OP",36),p(h,"DATE",37),p(h,"DATETIME",38),p(h,"TIME",39),p(h,"NUMBER",40),p(h,"INTEGER",41),p(h,"STRING",42),p(h,"WHITESPACE",43),p(h,"EOF",Ap.EOF),p(h,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),p(h,"literalNames",[null,"'('","')'","'not'","'!'","'.'","'@'","'['","','","']'","'true'","'false'","'null'","'Infinity'","'infinity'","'+'","'-'","'*'","'/'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'and'","'or'","'&&'","'||'"]),p(h,"symbolicNames",[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"IDENTIFIER","POLAR_OP","DATE","DATETIME","TIME","NUMBER","INTEGER","STRING","WHITESPACE"]),p(h,"modeNames",["DEFAULT_MODE"]),p(h,"ruleNames",["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","T__31","T__32","T__33","IDENTIFIER","POLAR_OP","DATE","DATETIME","TIME","NUMBER","INTEGER","STRING","WHITESPACE","DIGIT","DATEFORMAT","TIMEFORMAT","TIMEZONEOFFSETFORMAT","ESC","UNICODE","HEX"]),p(h,"_serializedATN",[4,0,43,461,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,32,1,32,1,32,1,33,1,33,1,33,1,34,1,34,5,34,225,8,34,10,34,12,34,228,9,34,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,3,36,240,8,36,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,3,37,291,8,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,3,38,301,8,38,1,39,3,39,304,8,39,1,39,4,39,307,8,39,11,39,12,39,308,1,39,1,39,5,39,313,8,39,10,39,12,39,316,9,39,3,39,318,8,39,1,39,1,39,3,39,322,8,39,1,39,4,39,325,8,39,11,39,12,39,326,3,39,329,8,39,1,39,1,39,1,39,1,39,4,39,335,8,39,11,39,12,39,336,3,39,339,8,39,1,40,3,40,342,8,40,1,40,4,40,345,8,40,11,40,12,40,346,1,40,1,40,1,40,1,40,4,40,353,8,40,11,40,12,40,354,3,40,357,8,40,1,41,1,41,1,41,5,41,362,8,41,10,41,12,41,365,9,41,1,41,1,41,1,41,1,41,5,41,371,8,41,10,41,12,41,374,9,41,1,41,3,41,377,8,41,1,42,4,42,380,8,42,11,42,12,42,381,1,42,1,42,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,397,8,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,406,8,44,1,45,1,45,1,45,1,45,3,45,412,8,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,4,45,424,8,45,11,45,12,45,425,3,45,428,8,45,3,45,430,8,45,1,46,1,46,1,46,3,46,435,8,46,1,46,1,46,1,46,3,46,440,8,46,1,46,1,46,1,46,3,46,445,8,46,3,46,447,8,46,1,47,1,47,1,47,3,47,452,8,47,1,48,1,48,1,48,1,48,1,48,1,48,1,49,1,49,0,0,50,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,0,89,0,91,0,93,0,95,0,97,0,99,0,1,0,16,4,0,36,36,65,90,95,95,97,122,5,0,36,36,48,57,65,90,95,95,97,122,2,0,43,43,45,45,1,0,39,39,1,0,34,34,3,0,9,10,13,13,32,32,1,0,48,57,1,0,48,48,1,0,49,57,1,0,49,49,1,0,48,50,1,0,49,51,1,0,48,49,1,0,48,51,1,0,48,53,3,0,48,57,65,70,97,102,491,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,1,101,1,0,0,0,3,103,1,0,0,0,5,105,1,0,0,0,7,109,1,0,0,0,9,111,1,0,0,0,11,113,1,0,0,0,13,115,1,0,0,0,15,117,1,0,0,0,17,119,1,0,0,0,19,121,1,0,0,0,21,126,1,0,0,0,23,132,1,0,0,0,25,137,1,0,0,0,27,146,1,0,0,0,29,155,1,0,0,0,31,157,1,0,0,0,33,159,1,0,0,0,35,161,1,0,0,0,37,163,1,0,0,0,39,166,1,0,0,0,41,168,1,0,0,0,43,170,1,0,0,0,45,173,1,0,0,0,47,175,1,0,0,0,49,178,1,0,0,0,51,181,1,0,0,0,53,185,1,0,0,0,55,190,1,0,0,0,57,196,1,0,0,0,59,202,1,0,0,0,61,209,1,0,0,0,63,213,1,0,0,0,65,216,1,0,0,0,67,219,1,0,0,0,69,222,1,0,0,0,71,229,1,0,0,0,73,239,1,0,0,0,75,290,1,0,0,0,77,300,1,0,0,0,79,338,1,0,0,0,81,356,1,0,0,0,83,376,1,0,0,0,85,379,1,0,0,0,87,385,1,0,0,0,89,387,1,0,0,0,91,411,1,0,0,0,93,446,1,0,0,0,95,448,1,0,0,0,97,453,1,0,0,0,99,459,1,0,0,0,101,102,5,40,0,0,102,2,1,0,0,0,103,104,5,41,0,0,104,4,1,0,0,0,105,106,5,110,0,0,106,107,5,111,0,0,107,108,5,116,0,0,108,6,1,0,0,0,109,110,5,33,0,0,110,8,1,0,0,0,111,112,5,46,0,0,112,10,1,0,0,0,113,114,5,64,0,0,114,12,1,0,0,0,115,116,5,91,0,0,116,14,1,0,0,0,117,118,5,44,0,0,118,16,1,0,0,0,119,120,5,93,0,0,120,18,1,0,0,0,121,122,5,116,0,0,122,123,5,114,0,0,123,124,5,117,0,0,124,125,5,101,0,0,125,20,1,0,0,0,126,127,5,102,0,0,127,128,5,97,0,0,128,129,5,108,0,0,129,130,5,115,0,0,130,131,5,101,0,0,131,22,1,0,0,0,132,133,5,110,0,0,133,134,5,117,0,0,134,135,5,108,0,0,135,136,5,108,0,0,136,24,1,0,0,0,137,138,5,73,0,0,138,139,5,110,0,0,139,140,5,102,0,0,140,141,5,105,0,0,141,142,5,110,0,0,142,143,5,105,0,0,143,144,5,116,0,0,144,145,5,121,0,0,145,26,1,0,0,0,146,147,5,105,0,0,147,148,5,110,0,0,148,149,5,102,0,0,149,150,5,105,0,0,150,151,5,110,0,0,151,152,5,105,0,0,152,153,5,116,0,0,153,154,5,121,0,0,154,28,1,0,0,0,155,156,5,43,0,0,156,30,1,0,0,0,157,158,5,45,0,0,158,32,1,0,0,0,159,160,5,42,0,0,160,34,1,0,0,0,161,162,5,47,0,0,162,36,1,0,0,0,163,164,5,60,0,0,164,165,5,61,0,0,165,38,1,0,0,0,166,167,5,60,0,0,167,40,1,0,0,0,168,169,5,62,0,0,169,42,1,0,0,0,170,171,5,62,0,0,171,172,5,61,0,0,172,44,1,0,0,0,173,174,5,61,0,0,174,46,1,0,0,0,175,176,5,33,0,0,176,177,5,61,0,0,177,48,1,0,0,0,178,179,5,105,0,0,179,180,5,110,0,0,180,50,1,0,0,0,181,182,5,33,0,0,182,183,5,105,0,0,183,184,5,110,0,0,184,52,1,0,0,0,185,186,5,108,0,0,186,187,5,105,0,0,187,188,5,107,0,0,188,189,5,101,0,0,189,54,1,0,0,0,190,191,5,33,0,0,191,192,5,108,0,0,192,193,5,105,0,0,193,194,5,107,0,0,194,195,5,101,0,0,195,56,1,0,0,0,196,197,5,105,0,0,197,198,5,108,0,0,198,199,5,105,0,0,199,200,5,107,0,0,200,201,5,101,0,0,201,58,1,0,0,0,202,203,5,33,0,0,203,204,5,105,0,0,204,205,5,108,0,0,205,206,5,105,0,0,206,207,5,107,0,0,207,208,5,101,0,0,208,60,1,0,0,0,209,210,5,97,0,0,210,211,5,110,0,0,211,212,5,100,0,0,212,62,1,0,0,0,213,214,5,111,0,0,214,215,5,114,0,0,215,64,1,0,0,0,216,217,5,38,0,0,217,218,5,38,0,0,218,66,1,0,0,0,219,220,5,124,0,0,220,221,5,124,0,0,221,68,1,0,0,0,222,226,7,0,0,0,223,225,7,1,0,0,224,223,1,0,0,0,225,228,1,0,0,0,226,224,1,0,0,0,226,227,1,0,0,0,227,70,1,0,0,0,228,226,1,0,0,0,229,230,7,2,0,0,230,72,1,0,0,0,231,232,5,39,0,0,232,233,3,89,44,0,233,234,5,39,0,0,234,240,1,0,0,0,235,236,5,34,0,0,236,237,3,89,44,0,237,238,5,34,0,0,238,240,1,0,0,0,239,231,1,0,0,0,239,235,1,0,0,0,240,74,1,0,0,0,241,242,5,39,0,0,242,243,3,89,44,0,243,244,5,84,0,0,244,245,3,91,45,0,245,246,3,93,46,0,246,247,5,39,0,0,247,248,5,39,0,0,248,249,3,89,44,0,249,250,5,32,0,0,250,251,3,91,45,0,251,252,3,93,46,0,252,253,5,39,0,0,253,254,5,39,0,0,254,255,3,89,44,0,255,256,5,84,0,0,256,257,3,91,45,0,257,258,5,39,0,0,258,259,5,39,0,0,259,260,3,89,44,0,260,261,5,32,0,0,261,262,3,91,45,0,262,263,5,39,0,0,263,291,1,0,0,0,264,265,5,34,0,0,265,266,3,89,44,0,266,267,5,84,0,0,267,268,3,91,45,0,268,269,3,93,46,0,269,270,5,34,0,0,270,291,1,0,0,0,271,272,5,34,0,0,272,273,3,89,44,0,273,274,5,32,0,0,274,275,3,91,45,0,275,276,3,93,46,0,276,277,5,34,0,0,277,291,1,0,0,0,278,279,5,34,0,0,279,280,3,89,44,0,280,281,5,84,0,0,281,282,3,91,45,0,282,283,5,34,0,0,283,291,1,0,0,0,284,285,5,34,0,0,285,286,3,89,44,0,286,287,5,32,0,0,287,288,3,91,45,0,288,289,5,34,0,0,289,291,1,0,0,0,290,241,1,0,0,0,290,264,1,0,0,0,290,271,1,0,0,0,290,278,1,0,0,0,290,284,1,0,0,0,291,76,1,0,0,0,292,293,5,39,0,0,293,294,3,91,45,0,294,295,5,39,0,0,295,301,1,0,0,0,296,297,5,34,0,0,297,298,3,91,45,0,298,299,5,34,0,0,299,301,1,0,0,0,300,292,1,0,0,0,300,296,1,0,0,0,301,78,1,0,0,0,302,304,3,71,35,0,303,302,1,0,0,0,303,304,1,0,0,0,304,306,1,0,0,0,305,307,3,87,43,0,306,305,1,0,0,0,307,308,1,0,0,0,308,306,1,0,0,0,308,309,1,0,0,0,309,317,1,0,0,0,310,314,5,46,0,0,311,313,3,87,43,0,312,311,1,0,0,0,313,316,1,0,0,0,314,312,1,0,0,0,314,315,1,0,0,0,315,318,1,0,0,0,316,314,1,0,0,0,317,310,1,0,0,0,317,318,1,0,0,0,318,328,1,0,0,0,319,321,5,69,0,0,320,322,7,2,0,0,321,320,1,0,0,0,321,322,1,0,0,0,322,324,1,0,0,0,323,325,3,87,43,0,324,323,1,0,0,0,325,326,1,0,0,0,326,324,1,0,0,0,326,327,1,0,0,0,327,329,1,0,0,0,328,319,1,0,0,0,328,329,1,0,0,0,329,339,1,0,0,0,330,331,5,48,0,0,331,332,5,120,0,0,332,334,1,0,0,0,333,335,3,99,49,0,334,333,1,0,0,0,335,336,1,0,0,0,336,334,1,0,0,0,336,337,1,0,0,0,337,339,1,0,0,0,338,303,1,0,0,0,338,330,1,0,0,0,339,80,1,0,0,0,340,342,3,71,35,0,341,340,1,0,0,0,341,342,1,0,0,0,342,344,1,0,0,0,343,345,3,87,43,0,344,343,1,0,0,0,345,346,1,0,0,0,346,344,1,0,0,0,346,347,1,0,0,0,347,357,1,0,0,0,348,349,5,48,0,0,349,350,5,120,0,0,350,352,1,0,0,0,351,353,3,99,49,0,352,351,1,0,0,0,353,354,1,0,0,0,354,352,1,0,0,0,354,355,1,0,0,0,355,357,1,0,0,0,356,341,1,0,0,0,356,348,1,0,0,0,357,82,1,0,0,0,358,363,5,39,0,0,359,362,3,95,47,0,360,362,8,3,0,0,361,359,1,0,0,0,361,360,1,0,0,0,362,365,1,0,0,0,363,361,1,0,0,0,363,364,1,0,0,0,364,366,1,0,0,0,365,363,1,0,0,0,366,377,5,39,0,0,367,372,5,34,0,0,368,371,3,95,47,0,369,371,8,4,0,0,370,368,1,0,0,0,370,369,1,0,0,0,371,374,1,0,0,0,372,370,1,0,0,0,372,373,1,0,0,0,373,375,1,0,0,0,374,372,1,0,0,0,375,377,5,34,0,0,376,358,1,0,0,0,376,367,1,0,0,0,377,84,1,0,0,0,378,380,7,5,0,0,379,378,1,0,0,0,380,381,1,0,0,0,381,379,1,0,0,0,381,382,1,0,0,0,382,383,1,0,0,0,383,384,6,42,0,0,384,86,1,0,0,0,385,386,7,6,0,0,386,88,1,0,0,0,387,388,7,6,0,0,388,389,7,6,0,0,389,390,7,6,0,0,390,391,7,6,0,0,391,396,5,45,0,0,392,393,7,7,0,0,393,397,7,8,0,0,394,395,7,9,0,0,395,397,7,10,0,0,396,392,1,0,0,0,396,394,1,0,0,0,397,398,1,0,0,0,398,405,5,45,0,0,399,400,7,11,0,0,400,406,7,7,0,0,401,402,7,10,0,0,402,406,7,8,0,0,403,404,5,51,0,0,404,406,5,49,0,0,405,399,1,0,0,0,405,401,1,0,0,0,405,403,1,0,0,0,406,90,1,0,0,0,407,408,7,12,0,0,408,412,7,6,0,0,409,410,5,50,0,0,410,412,7,13,0,0,411,407,1,0,0,0,411,409,1,0,0,0,412,413,1,0,0,0,413,414,5,58,0,0,414,415,7,14,0,0,415,416,7,6,0,0,416,429,1,0,0,0,417,418,5,58,0,0,418,419,7,14,0,0,419,420,7,6,0,0,420,427,1,0,0,0,421,423,5,46,0,0,422,424,7,6,0,0,423,422,1,0,0,0,424,425,1,0,0,0,425,423,1,0,0,0,425,426,1,0,0,0,426,428,1,0,0,0,427,421,1,0,0,0,427,428,1,0,0,0,428,430,1,0,0,0,429,417,1,0,0,0,429,430,1,0,0,0,430,92,1,0,0,0,431,447,5,90,0,0,432,439,7,2,0,0,433,435,7,12,0,0,434,433,1,0,0,0,434,435,1,0,0,0,435,436,1,0,0,0,436,440,7,6,0,0,437,438,5,50,0,0,438,440,7,13,0,0,439,434,1,0,0,0,439,437,1,0,0,0,440,444,1,0,0,0,441,442,5,58,0,0,442,443,7,14,0,0,443,445,7,6,0,0,444,441,1,0,0,0,444,445,1,0,0,0,445,447,1,0,0,0,446,431,1,0,0,0,446,432,1,0,0,0,447,94,1,0,0,0,448,451,5,92,0,0,449,452,3,97,48,0,450,452,9,0,0,0,451,449,1,0,0,0,451,450,1,0,0,0,452,96,1,0,0,0,453,454,5,117,0,0,454,455,3,99,49,0,455,456,3,99,49,0,456,457,3,99,49,0,457,458,3,99,49,0,458,98,1,0,0,0,459,460,7,15,0,0,460,100,1,0,0,0,35,0,226,239,290,300,303,308,314,317,321,326,328,336,338,341,346,354,356,361,363,370,372,376,381,396,405,411,425,427,429,434,439,444,446,451,1,0,1,0]),p(h,"__ATN"),p(h,"DecisionsToDFA",h._ATN.decisionToState.map((e,t)=>new _p(e,t)));var rr=h;import{ATN as fa,ATNDeserializer as Op,DFA as Rp,FailedPredicateException as bp,NoViableAltException as Zi,Parser as Dp,ParserATNSimulator as Np,ParserRuleContext as K,PredictionContextCache as Sp,RecognitionException as B,Token as Mp}from"@browsery/antlr4";var f=class f extends Dp{get grammarFileName(){return"OpraFilter.g4"}get literalNames(){return f.literalNames}get symbolicNames(){return f.symbolicNames}get ruleNames(){return f.ruleNames}get serializedATN(){return f._serializedATN}createFailedPredicateException(e,t){return new bp(this,e,t)}constructor(e){super(e),this._interp=new Np(this,f._ATN,f.DecisionsToDFA,new Sp)}root(){let e=new Hi(this,this._ctx,this.state);this.enterRule(e,0,f.RULE_root);try{this.enterOuterAlt(e,1),this.state=34,this.expression(0),this.state=35,this.match(f.EOF)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}expression(e){e===void 0&&(e=0);let t=this._ctx,r=this.state,i=new X(this,this._ctx,r),n=i,s=2;this.enterRecursionRule(i,2,f.RULE_expression,e);let c;try{let l;this.enterOuterAlt(i,1);{switch(this.state=48,this._errHandler.sync(this),this._input.LA(1)){case 35:i=new ro(this,i),this._ctx=i,n=i,this.state=38,i._left=this.comparisonLeft(),this.state=39,i._operator=this.comparisonOperator(),this.state=40,i._right=this.comparisonRight();break;case 1:i=new eo(this,i),this._ctx=i,n=i,this.state=42,this.match(f.T__0),this.state=43,this.parenthesizedItem(),this.state=44,this.match(f.T__1);break;case 3:case 4:i=new to(this,i),this._ctx=i,n=i,this.state=46,c=this._input.LA(1),c===3||c===4?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=47,this.expression(1);break;default:throw new Zi(this)}for(this._ctx.stop=this._input.LT(-1),this.state=56,this._errHandler.sync(this),l=this._interp.adaptivePredict(this._input,1,this._ctx);l!==2&&l!==fa.INVALID_ALT_NUMBER;){if(l===1){this._parseListeners!=null&&this.triggerExitRuleEvent(),n=i;{if(i=new ir(this,new X(this,t,r)),this.pushNewRecursionContext(i,s,f.RULE_expression),this.state=50,!this.precpred(this._ctx,3))throw this.createFailedPredicateException("this.precpred(this._ctx, 3)");this.state=51,i._op=this.logicalOperator(),this.state=52,this.expression(4)}}this.state=58,this._errHandler.sync(this),l=this._interp.adaptivePredict(this._input,1,this._ctx)}}}catch(l){if(l instanceof B)i.exception=l,this._errHandler.reportError(this,l),this._errHandler.recover(this,l);else throw l}finally{this.unrollRecursionContexts(t)}return i}comparisonLeft(){let e=new Fr(this,this._ctx,this.state);this.enterRule(e,4,f.RULE_comparisonLeft);try{this.enterOuterAlt(e,1),this.state=59,this.qualifiedIdentifier()}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}comparisonRight(){let e=new jr(this,this._ctx,this.state);this.enterRule(e,6,f.RULE_comparisonRight);try{switch(this.state=65,this._errHandler.sync(this),this._input.LA(1)){case 10:case 11:case 12:case 13:case 14:case 37:case 38:case 39:case 40:case 42:this.enterOuterAlt(e,1),this.state=61,this.value();break;case 35:this.enterOuterAlt(e,2),this.state=62,this.qualifiedIdentifier();break;case 6:this.enterOuterAlt(e,3),this.state=63,this.externalConstant();break;case 7:this.enterOuterAlt(e,4),this.state=64,this.arrayValue();break;default:throw new Zi(this)}}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}parenthesizedItem(){let e=new Cr(this,this._ctx,this.state);this.enterRule(e,8,f.RULE_parenthesizedItem);try{this.enterOuterAlt(e,1),this.state=67,this.expression(0)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}value(){let e=new Y(this,this._ctx,this.state);this.enterRule(e,10,f.RULE_value);try{switch(this.state=77,this._errHandler.sync(this),this._input.LA(1)){case 40:e=new lo(this,e),this.enterOuterAlt(e,1),this.state=69,this.match(f.NUMBER);break;case 13:case 14:e=new po(this,e),this.enterOuterAlt(e,2),this.state=70,this.infinity();break;case 10:case 11:e=new co(this,e),this.enterOuterAlt(e,3),this.state=71,this.boolean_();break;case 12:e=new oo(this,e),this.enterOuterAlt(e,4),this.state=72,this.null_();break;case 38:e=new no(this,e),this.enterOuterAlt(e,5),this.state=73,this.match(f.DATETIME);break;case 37:e=new ao(this,e),this.enterOuterAlt(e,6),this.state=74,this.match(f.DATE);break;case 39:e=new io(this,e),this.enterOuterAlt(e,7),this.state=75,this.match(f.TIME);break;case 42:e=new so(this,e),this.enterOuterAlt(e,8),this.state=76,this.match(f.STRING);break;default:throw new Zi(this)}}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}qualifiedIdentifier(){let e=new or(this,this._ctx,this.state);this.enterRule(e,12,f.RULE_qualifiedIdentifier);try{let t;this.enterOuterAlt(e,1);{for(this.state=84,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,4,this._ctx);t!==2&&t!==fa.INVALID_ALT_NUMBER;)t===1&&(this.state=79,this.identifier(),this.state=80,this.match(f.T__4)),this.state=86,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,4,this._ctx);this.state=87,this.identifier()}}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}externalConstant(){let e=new Ur(this,this._ctx,this.state);this.enterRule(e,14,f.RULE_externalConstant);try{this.enterOuterAlt(e,1),this.state=89,this.match(f.T__5),this.state=90,this.identifier()}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}identifier(){let e=new ct(this,this._ctx,this.state);this.enterRule(e,16,f.RULE_identifier);try{this.enterOuterAlt(e,1),this.state=92,this.match(f.IDENTIFIER)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}arrayValue(){let e=new $r(this,this._ctx,this.state);this.enterRule(e,18,f.RULE_arrayValue);let t;try{this.enterOuterAlt(e,1);{for(this.state=94,this.match(f.T__6),this.state=95,this.value(),this.state=100,this._errHandler.sync(this),t=this._input.LA(1);t===8;)this.state=96,this.match(f.T__7),this.state=97,this.value(),this.state=102,this._errHandler.sync(this),t=this._input.LA(1);this.state=103,this.match(f.T__8)}}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}boolean_(){let e=new qr(this,this._ctx,this.state);this.enterRule(e,20,f.RULE_boolean);let t;try{this.enterOuterAlt(e,1),this.state=105,t=this._input.LA(1),t===10||t===11?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}null_(){let e=new Br(this,this._ctx,this.state);this.enterRule(e,22,f.RULE_null);try{this.enterOuterAlt(e,1),this.state=107,this.match(f.T__11)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}infinity(){let e=new Kr(this,this._ctx,this.state);this.enterRule(e,24,f.RULE_infinity);let t;try{this.enterOuterAlt(e,1),this.state=109,t=this._input.LA(1),t===13||t===14?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}arithmeticOperator(){let e=new fo(this,this._ctx,this.state);this.enterRule(e,26,f.RULE_arithmeticOperator);let t;try{this.enterOuterAlt(e,1),this.state=111,t=this._input.LA(1),(t&-32)===0&&(1<<t&491520)!==0?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}comparisonOperator(){let e=new Vr(this,this._ctx,this.state);this.enterRule(e,28,f.RULE_comparisonOperator);let t;try{this.enterOuterAlt(e,1),this.state=113,t=this._input.LA(1),(t&-32)===0&&(1<<t&2146959360)!==0?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}logicalOperator(){let e=new Wr(this,this._ctx,this.state);this.enterRule(e,30,f.RULE_logicalOperator);let t;try{this.enterOuterAlt(e,1),this.state=1