@hzhangxyz/ddss 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js DELETED
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- import{promisify}from"node:util";import{randomUUID}from"node:crypto";import{createInterface}from"node:readline";import require$$1$1 from"process";import require$$0$1 from"tls";import require$$0 from"fs";import require$$0$2 from"os";import require$$0$3 from"net";import require$$0$4 from"events";import require$$1$2 from"stream";import require$$1$3 from"path";import require$$0$5 from"zlib";import require$$0$6 from"http2";import require$$3$1 from"http";import require$$6$1 from"url";import require$$1$4 from"dns";import require$$1$5 from"util";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var src$2={},callCredentials={},metadata={},logging={},constants={},hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,Object.defineProperty(constants,"__esModule",{value:!0}),constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=constants.Propagate=constants.LogVerbosity=constants.Status=void 0,function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED"}(e||(constants.Status=e={})),function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.ERROR=2]="ERROR",e[e.NONE=3]="NONE"}(t||(constants.LogVerbosity=t={})),function(e){e[e.DEADLINE=1]="DEADLINE",e[e.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",e[e.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",e[e.CANCELLATION=8]="CANCELLATION",e[e.DEFAULTS=65535]="DEFAULTS"}(r||(constants.Propagate=r={})),constants.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,constants.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4194304),constants;var e,t,r}var version="1.14.3",require$$12={version:version},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(e){var t,r,n,i;Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=function(t,r,n){g(r)&&(0,e.log)(t,(new Date).toISOString()+" | v"+o+" "+a.pid+" | "+r+" | "+n)},e.isTracerEnabled=g;const s=requireConstants(),a=require$$1$1,o=require$$12.version,l={error:(e,...t)=>{console.error("E "+e,...t)},info:(e,...t)=>{console.error("I "+e,...t)},debug:(e,...t)=>{console.error("D "+e,...t)}};let c=l,u=s.LogVerbosity.ERROR;switch((null!==(r=null!==(t=process.env.GRPC_NODE_VERBOSITY)&&void 0!==t?t:process.env.GRPC_VERBOSITY)&&void 0!==r?r:"").toUpperCase()){case"DEBUG":u=s.LogVerbosity.DEBUG;break;case"INFO":u=s.LogVerbosity.INFO;break;case"ERROR":u=s.LogVerbosity.ERROR;break;case"NONE":u=s.LogVerbosity.NONE}e.getLogger=()=>c;e.setLogger=e=>{c=e};e.setLoggerVerbosity=e=>{u=e};e.log=(e,...t)=>{let r;if(e>=u){switch(e){case s.LogVerbosity.DEBUG:r=c.debug;break;case s.LogVerbosity.INFO:r=c.info;break;case s.LogVerbosity.ERROR:r=c.error}r||(r=c.error),r&&r.bind(c)(...t)}};const h=null!==(i=null!==(n=process.env.GRPC_NODE_TRACE)&&void 0!==n?n:process.env.GRPC_TRACE)&&void 0!==i?i:"",d=new Set,p=new Set;for(const e of h.split(","))e.startsWith("-")?p.add(e.substring(1)):d.add(e);const f=d.has("all");function g(e){return!p.has(e)&&(f||d.has(e))}}(logging)),logging}var error={},hasRequiredError,hasRequiredMetadata,hasRequiredCallCredentials;function requireError(){if(hasRequiredError)return error;return hasRequiredError=1,Object.defineProperty(error,"__esModule",{value:!0}),error.getErrorMessage=function(e){return e instanceof Error?e.message:String(e)},error.getErrorCode=function(e){return"object"==typeof e&&null!==e&&"code"in e&&"number"==typeof e.code?e.code:null},error}function requireMetadata(){if(hasRequiredMetadata)return metadata;hasRequiredMetadata=1,Object.defineProperty(metadata,"__esModule",{value:!0}),metadata.Metadata=void 0;const e=requireLogging(),t=requireConstants(),r=requireError(),n=/^[:0-9a-z_.-]+$/,i=/^[ -~]*$/;function s(e){return e.endsWith("-bin")}function a(e){return!e.startsWith("grpc-")}function o(e){return e.toLowerCase()}function l(e,t){if(!function(e){return n.test(e)}(e))throw new Error('Metadata key "'+e+'" contains illegal characters');if(null!=t)if(s(e)){if(!Buffer.isBuffer(t))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(t))throw new Error("keys that don't end with '-bin' must have String values");if(!function(e){return i.test(e)}(t))throw new Error('Metadata string value "'+t+'" contains illegal characters')}}class c{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){l(e=o(e),t),this.internalRepr.set(e,[t])}add(e,t){l(e=o(e),t);const r=this.internalRepr.get(e);void 0===r?this.internalRepr.set(e,[t]):r.push(t)}remove(e){e=o(e),this.internalRepr.delete(e)}get(e){return e=o(e),this.internalRepr.get(e)||[]}getMap(){const e={};for(const[t,r]of this.internalRepr)if(r.length>0){const n=r[0];e[t]=Buffer.isBuffer(n)?Buffer.from(n):n}return e}clone(){const e=new c(this.options),t=e.internalRepr;for(const[e,r]of this.internalRepr){const n=r.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);t.set(e,n)}return e}merge(e){for(const[t,r]of e.internalRepr){const e=(this.internalRepr.get(t)||[]).concat(r);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){const e={};for(const[t,r]of this.internalRepr)t.startsWith(":")||(e[t]=r.map(u));return e}toJSON(){const e={};for(const[t,r]of this.internalRepr)e[t]=r;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(n){const i=new c;for(const o of Object.keys(n)){if(":"===o.charAt(0))continue;const l=n[o];try{s(o)?Array.isArray(l)?l.forEach(e=>{i.add(o,Buffer.from(e,"base64"))}):void 0!==l&&(a(o)?l.split(",").forEach(e=>{i.add(o,Buffer.from(e.trim(),"base64"))}):i.add(o,Buffer.from(l,"base64"))):Array.isArray(l)?l.forEach(e=>{i.add(o,e)}):void 0!==l&&i.add(o,l)}catch(n){const i=`Failed to add metadata entry ${o}: ${l}. ${(0,r.getErrorMessage)(n)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,e.log)(t.LogVerbosity.ERROR,i)}}return i}}metadata.Metadata=c;const u=e=>Buffer.isBuffer(e)?e.toString("base64"):e;return metadata}function requireCallCredentials(){if(hasRequiredCallCredentials)return callCredentials;hasRequiredCallCredentials=1,Object.defineProperty(callCredentials,"__esModule",{value:!0}),callCredentials.CallCredentials=void 0;const e=requireMetadata();class t{static createFromMetadataGenerator(e){return new n(e)}static createFromGoogleCredential(r){return t.createFromMetadataGenerator((t,n)=>{let i;i=function(e){return"getRequestHeaders"in e&&"function"==typeof e.getRequestHeaders}(r)?r.getRequestHeaders(t.service_url):new Promise((e,n)=>{r.getRequestMetadata(t.service_url,(t,r)=>{t?n(t):r?e(r):n(new Error("Headers not set by metadata plugin"))})}),i.then(t=>{const r=new e.Metadata;for(const e of Object.keys(t))r.add(e,t[e]);n(null,r)},e=>{n(e)})})}static createEmpty(){return new i}}callCredentials.CallCredentials=t;class r extends t{constructor(e){super(),this.creds=e}async generateMetadata(t){const r=new e.Metadata,n=await Promise.all(this.creds.map(e=>e.generateMetadata(t)));for(const e of n)r.merge(e);return r}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e||e instanceof r&&this.creds.every((t,r)=>t._equals(e.creds[r]))}}class n extends t{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,r)=>{this.metadataGenerator(e,(e,n)=>{void 0!==n?t(n):r(e)})})}compose(e){return new r([this,e])}_equals(e){return this===e||e instanceof n&&this.metadataGenerator===e.metadataGenerator}}class i extends t{generateMetadata(t){return Promise.resolve(new e.Metadata)}compose(e){return e}_equals(e){return e instanceof i}}return callCredentials}var channel={},channelCredentials={},tlsHelpers={},hasRequiredTlsHelpers;function requireTlsHelpers(){if(hasRequiredTlsHelpers)return tlsHelpers;hasRequiredTlsHelpers=1,Object.defineProperty(tlsHelpers,"__esModule",{value:!0}),tlsHelpers.CIPHER_SUITES=void 0,tlsHelpers.getDefaultRootsData=function(){if(t)return null===r&&(r=e.readFileSync(t)),r;return null};const e=require$$0;tlsHelpers.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;const t=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;let r=null;return tlsHelpers}var uriParser={},hasRequiredUriParser;function requireUriParser(){if(hasRequiredUriParser)return uriParser;hasRequiredUriParser=1,Object.defineProperty(uriParser,"__esModule",{value:!0}),uriParser.parseUri=function(t){const r=e.exec(t);if(null===r)return null;return{scheme:r[1],authority:r[2],path:r[3]}},uriParser.splitHostPort=function(e){if(e.startsWith("[")){const r=e.indexOf("]");if(-1===r)return null;const n=e.substring(1,r);if(-1===n.indexOf(":"))return null;if(e.length>r+1){if(":"===e[r+1]){const i=e.substring(r+2);return t.test(i)?{host:n,port:+i}:null}return null}return{host:n}}{const r=e.split(":");return 2===r.length?t.test(r[1])?{host:r[0],port:+r[1]}:null:{host:e}}},uriParser.combineHostPort=function(e){return void 0===e.port?e.host:e.host.includes(":")?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`},uriParser.uriToString=function(e){let t="";void 0!==e.scheme&&(t+=e.scheme+":");void 0!==e.authority&&(t+="//"+e.authority+"/");return t+=e.path,t};const e=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;const t=/^\d+$/;return uriParser}var resolver={},hasRequiredResolver,hasRequiredChannelCredentials;function requireResolver(){if(hasRequiredResolver)return resolver;hasRequiredResolver=1,Object.defineProperty(resolver,"__esModule",{value:!0}),resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,resolver.registerResolver=function(e,r){t[e]=r},resolver.registerDefaultScheme=function(e){r=e},resolver.createResolver=function(r,n,i){if(void 0!==r.scheme&&r.scheme in t)return new t[r.scheme](r,n,i);throw new Error(`No resolver could be created for target ${(0,e.uriToString)(r)}`)},resolver.getDefaultAuthority=function(r){if(void 0!==r.scheme&&r.scheme in t)return t[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,e.uriToString)(r)}`)},resolver.mapUriDefaultScheme=function(n){if(void 0===n.scheme||!(n.scheme in t))return null!==r?{scheme:r,authority:void 0,path:(0,e.uriToString)(n)}:null;return n};const e=requireUriParser();resolver.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";const t={};let r=null;return resolver}function requireChannelCredentials(){if(hasRequiredChannelCredentials)return channelCredentials;hasRequiredChannelCredentials=1,Object.defineProperty(channelCredentials,"__esModule",{value:!0}),channelCredentials.ChannelCredentials=void 0,channelCredentials.createCertificateProviderChannelCredentials=function(e,t,r){return new p(e,t,null!=r?r:{})};const e=require$$0$1,t=requireCallCredentials(),r=requireTlsHelpers(),n=requireUriParser(),i=requireResolver(),s=requireLogging(),a=requireConstants();function o(e,t){if(e&&!(e instanceof Buffer))throw new TypeError(`${t}, if provided, must be a Buffer.`)}class l{compose(e){return new f(this,e)}static createSsl(t,n,i,s){var a;if(o(t,"Root certificate"),o(n,"Private key"),o(i,"Certificate chain"),n&&!i)throw new Error("Private key must be given with accompanying certificate chain");if(!n&&i)throw new Error("Certificate chain must be given with accompanying private key");const l=(0,e.createSecureContext)({ca:null!==(a=null!=t?t:(0,r.getDefaultRootsData)())&&void 0!==a?a:void 0,key:null!=n?n:void 0,cert:null!=i?i:void 0,ciphers:r.CIPHER_SUITES});return new d(l,null!=s?s:{})}static createFromSecureContext(e,t){return new d(e,null!=t?t:{})}static createInsecure(){return new c}}channelCredentials.ChannelCredentials=l;class c extends l{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof c}_createSecureConnector(e,r,n){return{connect:e=>Promise.resolve({socket:e,secure:!1}),waitForReady:()=>Promise.resolve(),getCallCredentials:()=>null!=n?n:t.CallCredentials.createEmpty(),destroy(){}}}}function u(t,r,s,a){var o,l;const c={secureContext:t};let u=s;if("grpc.http_connect_target"in a){const e=(0,n.parseUri)(a["grpc.http_connect_target"]);e&&(u=e)}const h=(0,i.getDefaultAuthority)(u),d=(0,n.splitHostPort)(h),p=null!==(o=null==d?void 0:d.host)&&void 0!==o?o:h;if(c.host=p,r.checkServerIdentity&&(c.checkServerIdentity=r.checkServerIdentity),void 0!==r.rejectUnauthorized&&(c.rejectUnauthorized=r.rejectUnauthorized),c.ALPNProtocols=["h2"],a["grpc.ssl_target_name_override"]){const t=a["grpc.ssl_target_name_override"],r=null!==(l=c.checkServerIdentity)&&void 0!==l?l:e.checkServerIdentity;c.checkServerIdentity=(e,n)=>r(t,n),c.servername=t}else c.servername=p;return a["grpc-node.tls_enable_trace"]&&(c.enableTrace=!0),c}class h{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(t){const r=Object.assign({socket:t},this.connectionOptions);return new Promise((t,n)=>{const i=(0,e.connect)(r,()=>{var e;null!==(e=this.connectionOptions.rejectUnauthorized)&&void 0!==e&&!e||i.authorized?t({socket:i,secure:!0}):n(i.authorizationError)});i.on("error",e=>{n(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class d extends l{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e||e instanceof d&&(this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity)}_createSecureConnector(e,r,n){const i=u(this.secureContext,this.verifyOptions,e,r);return new h(i,null!=n?n:t.CallCredentials.createEmpty())}}class p extends l{constructor(e,t,r){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=r,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var t,r;return this===e||e instanceof p&&(this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&(null===(t=this.verifyOptions)||void 0===t?void 0:t.checkServerIdentity)===(null===(r=e.verifyOptions)||void 0===r?void 0:r.checkServerIdentity))}ref(){var e;0===this.refcount&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,0===this.refcount&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),null===(e=this.identityCertificateProvider)||void 0===e||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new p.SecureConnectorImpl(this,e,r,null!=n?n:t.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(const e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return void 0!==this.latestCaUpdate&&(!this.identityCertificateProvider||void 0!==this.latestIdentityUpdate)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var t,n;if(!this.latestCaUpdate)return null;if(null!==this.identityCertificateProvider&&!this.latestIdentityUpdate)return null;try{return(0,e.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:null===(t=this.latestIdentityUpdate)||void 0===t?void 0:t.privateKey,cert:null===(n=this.latestIdentityUpdate)||void 0===n?void 0:n.certificate,ciphers:r.CIPHER_SUITES})}catch(e){return(0,s.log)(a.LogVerbosity.ERROR,"Failed to createSecureContext with error "+e.message),null}}}p.SecureConnectorImpl=class{constructor(e,t,r,n){this.parent=e,this.channelTarget=t,this.options=r,this.callCredentials=n}connect(t){return new Promise((r,n)=>{const i=this.parent.getLatestSecureContext();if(!i)return void n(new Error("Failed to load credentials"));t.closed&&n(new Error("Socket closed while loading credentials"));const s=u(i,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},s),o=()=>{n(new Error("Socket closed"))},l=e=>{n(e)},c=(0,e.connect)(a,()=>{var e;c.removeListener("close",o),c.removeListener("error",l),null!==(e=this.parent.verifyOptions.rejectUnauthorized)&&void 0!==e&&!e||c.authorized?r({socket:c,secure:!0}):n(c.authorizationError)});c.once("close",o),c.once("error",l)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};class f extends l{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){const t=this.callCredentials.compose(e);return new f(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e||e instanceof f&&(this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials))}_createSecureConnector(e,r,n){const i=this.callCredentials.compose(null!=n?n:t.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,i)}}return channelCredentials}var internalChannel={},resolvingLoadBalancer={},loadBalancer={},hasRequiredLoadBalancer;function requireLoadBalancer(){if(hasRequiredLoadBalancer)return loadBalancer;hasRequiredLoadBalancer=1,Object.defineProperty(loadBalancer,"__esModule",{value:!0}),loadBalancer.createChildChannelControlHelper=function(e,t){var r,n,i,s,a,o,l,c,u,h;return{createSubchannel:null!==(n=null===(r=t.createSubchannel)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e.createSubchannel.bind(e),updateState:null!==(s=null===(i=t.updateState)||void 0===i?void 0:i.bind(t))&&void 0!==s?s:e.updateState.bind(e),requestReresolution:null!==(o=null===(a=t.requestReresolution)||void 0===a?void 0:a.bind(t))&&void 0!==o?o:e.requestReresolution.bind(e),addChannelzChild:null!==(c=null===(l=t.addChannelzChild)||void 0===l?void 0:l.bind(t))&&void 0!==c?c:e.addChannelzChild.bind(e),removeChannelzChild:null!==(h=null===(u=t.removeChannelzChild)||void 0===u?void 0:u.bind(t))&&void 0!==h?h:e.removeChannelzChild.bind(e)}},loadBalancer.registerLoadBalancerType=function(e,t,n){r[e]={LoadBalancer:t,LoadBalancingConfig:n}},loadBalancer.registerDefaultLoadBalancerType=function(e){n=e},loadBalancer.createLoadBalancer=function(e,t){const n=e.getLoadBalancerName();return n in r?new r[n].LoadBalancer(t):null},loadBalancer.isLoadBalancerNameRegistered=function(e){return e in r},loadBalancer.parseLoadBalancingConfig=i,loadBalancer.getDefaultConfig=function(){if(!n)throw new Error("No default load balancer type registered");return new r[n].LoadBalancingConfig},loadBalancer.selectLbConfigFromList=function(s,a=!1){for(const r of s)try{return i(r)}catch(r){(0,e.log)(t.LogVerbosity.DEBUG,"Config parsing failed with error",r.message);continue}return a&&n?new r[n].LoadBalancingConfig:null};const e=requireLogging(),t=requireConstants();const r={};let n=null;function i(e){const t=Object.keys(e);if(1!==t.length)throw new Error("Provided load balancing config has multiple conflicting entries");const n=t[0];if(!(n in r))throw new Error(`Unrecognized load balancing config name ${n}`);try{return r[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw new Error(`${n}: ${e.message}`)}}return loadBalancer}var serviceConfig={},hasRequiredServiceConfig;function requireServiceConfig(){if(hasRequiredServiceConfig)return serviceConfig;hasRequiredServiceConfig=1,Object.defineProperty(serviceConfig,"__esModule",{value:!0}),serviceConfig.validateRetryThrottling=a,serviceConfig.validateServiceConfig=l,serviceConfig.extractAndSelectServiceConfig=function(e,t){for(const r of e)if(r.length>0&&r[0].startsWith("grpc_config=")){const e=r.join("").substring(12);return u(JSON.parse(e),t)}return null};const e=require$$0$2,t=requireConstants(),r=/^\d+(\.\d{1,9})?s$/,n="node";function i(e){if("service"in e&&""!==e.service){if("string"!=typeof e.service)throw new Error("Invalid method config name: invalid service: expected type string, got "+typeof e.service);if("method"in e&&""!==e.method){if("string"!=typeof e.method)throw new Error("Invalid method config name: invalid method: expected type string, got "+typeof e.service);return{service:e.service,method:e.method}}return{service:e.service}}if("method"in e&&void 0!==e.method)throw new Error("Invalid method config name: method set with empty or unset service");return{}}function s(e){var n;const s={name:[]};if(!("name"in e)||!Array.isArray(e.name))throw new Error("Invalid method config: invalid name array");for(const t of e.name)s.name.push(i(t));if("waitForReady"in e){if("boolean"!=typeof e.waitForReady)throw new Error("Invalid method config: invalid waitForReady");s.waitForReady=e.waitForReady}if("timeout"in e)if("object"==typeof e.timeout){if(!("seconds"in e.timeout)||"number"!=typeof e.timeout.seconds)throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in e.timeout)||"number"!=typeof e.timeout.nanos)throw new Error("Invalid method config: invalid timeout.nanos");s.timeout=e.timeout}else{if("string"!=typeof e.timeout||!r.test(e.timeout))throw new Error("Invalid method config: invalid timeout");{const t=e.timeout.substring(0,e.timeout.length-1).split(".");s.timeout={seconds:0|t[0],nanos:0|(null!==(n=t[1])&&void 0!==n?n:0)}}}if("maxRequestBytes"in e){if("number"!=typeof e.maxRequestBytes)throw new Error("Invalid method config: invalid maxRequestBytes");s.maxRequestBytes=e.maxRequestBytes}if("maxResponseBytes"in e){if("number"!=typeof e.maxResponseBytes)throw new Error("Invalid method config: invalid maxRequestBytes");s.maxResponseBytes=e.maxResponseBytes}if("retryPolicy"in e){if("hedgingPolicy"in e)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");s.retryPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in e)||"string"!=typeof e.initialBackoff||!r.test(e.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in e)||"string"!=typeof e.maxBackoff||!r.test(e.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in e)||"number"!=typeof e.backoffMultiplier||e.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in e)||!Array.isArray(e.retryableStatusCodes))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(0===e.retryableStatusCodes.length)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(const r of e.retryableStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}return{maxAttempts:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}(e.retryPolicy)}else"hedgingPolicy"in e&&(s.hedgingPolicy=function(e){if(!("maxAttempts"in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in e&&("string"!=typeof e.hedgingDelay||!r.test(e.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in e&&Array.isArray(e.nonFatalStatusCodes))for(const r of e.nonFatalStatusCodes)if("number"==typeof r){if(!Object.values(t.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else{if("string"!=typeof r)throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");if(!Object.values(t.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}const n={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(n.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(n.nonFatalStatusCodes=e.nonFatalStatusCodes),n}(e.hedgingPolicy));return s}function a(e){if(!("maxTokens"in e)||"number"!=typeof e.maxTokens||e.maxTokens<=0||e.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in e)||"number"!=typeof e.tokenRatio||e.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function o(e){if("object"!=typeof e||null===e)throw new Error("Invalid loadBalancingConfig: unexpected type "+typeof e);const t=Object.keys(e);if(t.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(0===t.length)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[t[0]]:e[t[0]]}}function l(e){const t={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in e){if("string"!=typeof e.loadBalancingPolicy)throw new Error("Invalid service config: invalid loadBalancingPolicy");t.loadBalancingPolicy=e.loadBalancingPolicy}if("loadBalancingConfig"in e){if(!Array.isArray(e.loadBalancingConfig))throw new Error("Invalid service config: invalid loadBalancingConfig");for(const r of e.loadBalancingConfig)t.loadBalancingConfig.push(o(r))}if("methodConfig"in e&&Array.isArray(e.methodConfig))for(const r of e.methodConfig)t.methodConfig.push(s(r));"retryThrottling"in e&&(t.retryThrottling=a(e.retryThrottling));const r=[];for(const e of t.methodConfig)for(const t of e.name){for(const e of r)if(t.service===e.service&&t.method===e.method)throw new Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);r.push(t)}return t}function c(e){if(!("serviceConfig"in e))throw new Error("Invalid service config choice: missing service config");const t={serviceConfig:l(e.serviceConfig)};if("clientLanguage"in e){if(!Array.isArray(e.clientLanguage))throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage=[];for(const r of e.clientLanguage){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientLanguage");t.clientLanguage.push(r)}}if("clientHostname"in e){if(!Array.isArray(e.clientHostname))throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname=[];for(const r of e.clientHostname){if("string"!=typeof r)throw new Error("Invalid service config choice: invalid clientHostname");t.clientHostname.push(r)}}if("percentage"in e){if(!("number"==typeof e.percentage&&0<=e.percentage&&e.percentage<=100))throw new Error("Invalid service config choice: invalid percentage");t.percentage=e.percentage}const r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(const t in e)if(!r.includes(t))throw new Error(`Invalid service config choice: unexpected field ${t}`);return t}function u(t,r){if(!Array.isArray(t))throw new Error("Invalid service config list");for(const i of t){const t=c(i);if(!("number"==typeof t.percentage&&r>t.percentage)){if(Array.isArray(t.clientHostname)){let r=!1;for(const n of t.clientHostname)n===e.hostname()&&(r=!0);if(!r)continue}if(Array.isArray(t.clientLanguage)){let e=!1;for(const r of t.clientLanguage)r===n&&(e=!0);if(!e)continue}return t.serviceConfig}}throw new Error("No matching service config found")}return serviceConfig}var connectivityState={},hasRequiredConnectivityState;function requireConnectivityState(){return hasRequiredConnectivityState||(hasRequiredConnectivityState=1,Object.defineProperty(connectivityState,"__esModule",{value:!0}),connectivityState.ConnectivityState=void 0,function(e){e[e.IDLE=0]="IDLE",e[e.CONNECTING=1]="CONNECTING",e[e.READY=2]="READY",e[e.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",e[e.SHUTDOWN=4]="SHUTDOWN"}(e||(connectivityState.ConnectivityState=e={}))),connectivityState;var e}var picker={},hasRequiredPicker;function requirePicker(){if(hasRequiredPicker)return picker;hasRequiredPicker=1,Object.defineProperty(picker,"__esModule",{value:!0}),picker.QueuePicker=picker.UnavailablePicker=picker.PickResultType=void 0;const e=requireMetadata(),t=requireConstants();var r;!function(e){e[e.COMPLETE=0]="COMPLETE",e[e.QUEUE=1]="QUEUE",e[e.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",e[e.DROP=3]="DROP"}(r||(picker.PickResultType=r={}));picker.UnavailablePicker=class{constructor(r){this.status=Object.assign({code:t.Status.UNAVAILABLE,details:"No connection established",metadata:new e.Metadata},r)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};return picker.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}},picker}var backoffTimeout={},hasRequiredBackoffTimeout;function requireBackoffTimeout(){if(hasRequiredBackoffTimeout)return backoffTimeout;hasRequiredBackoffTimeout=1,Object.defineProperty(backoffTimeout,"__esModule",{value:!0}),backoffTimeout.BackoffTimeout=void 0;const e=requireConstants(),t=requireLogging();class r{constructor(e,t){this.callback=e,this.initialDelay=1e3,this.multiplier=1.6,this.maxDelay=12e4,this.jitter=.2,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=r.getNextId(),t&&(t.initialDelay&&(this.initialDelay=t.initialDelay),t.multiplier&&(this.multiplier=t.multiplier),t.jitter&&(this.jitter=t.jitter),t.maxDelay&&(this.maxDelay=t.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(r){t.trace(e.LogVerbosity.DEBUG,"backoff","{"+this.id+"} "+r)}runTimer(e){var t,r;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||null===(r=(t=this.timerId).unref)||void 0===r||r.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);const e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;var r,n;this.nextDelay=e+(r=-t,n=t,Math.random()*(n-r)+r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){const e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,null===(t=(e=this.timerId).ref)||void 0===t||t.call(e)}unref(){var e,t;this.hasRef=!1,null===(t=(e=this.timerId).unref)||void 0===t||t.call(e)}getEndTime(){return this.endTime}}return backoffTimeout.BackoffTimeout=r,r.nextId=0,backoffTimeout}var loadBalancerChildHandler={},hasRequiredLoadBalancerChildHandler,hasRequiredResolvingLoadBalancer;function requireLoadBalancerChildHandler(){if(hasRequiredLoadBalancerChildHandler)return loadBalancerChildHandler;hasRequiredLoadBalancerChildHandler=1,Object.defineProperty(loadBalancerChildHandler,"__esModule",{value:!0}),loadBalancerChildHandler.ChildLoadBalancerHandler=void 0;const e=requireLoadBalancer(),t=requireConnectivityState();return loadBalancerChildHandler.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,r,n){var i;if(this.calledByPendingChild()){if(e===t.ConnectivityState.CONNECTING)return;null===(i=this.parent.currentChild)||void 0===i||i.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,r,n)}requestReresolution(){var e;const t=null!==(e=this.parent.pendingChild)&&void 0!==e?e:this.parent.currentChild;this.child===t&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(t,r,n,i){let s;if(null===this.currentChild||null===this.latestConfig||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){const t=new this.ChildPolicyHelper(this),n=(0,e.createLoadBalancer)(r,t);t.setChild(n),null===this.currentChild?(this.currentChild=n,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,s=this.pendingChild)}else s=null===this.pendingChild?this.currentChild:this.pendingChild;return this.latestConfig=r,s.updateAddressList(t,r,n,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return"child_load_balancer_helper"}},loadBalancerChildHandler}function requireResolvingLoadBalancer(){if(hasRequiredResolvingLoadBalancer)return resolvingLoadBalancer;hasRequiredResolvingLoadBalancer=1,Object.defineProperty(resolvingLoadBalancer,"__esModule",{value:!0}),resolvingLoadBalancer.ResolvingLoadBalancer=void 0;const e=requireLoadBalancer(),t=requireServiceConfig(),r=requireConnectivityState(),n=requireResolver(),i=requirePicker(),s=requireBackoffTimeout(),a=requireConstants(),o=requireMetadata(),l=requireLogging(),c=requireConstants(),u=requireUriParser(),h=requireLoadBalancerChildHandler();function d(e){l.trace(c.LogVerbosity.DEBUG,"resolving_load_balancer",e)}const p=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function f(e,t,r,n){for(const i of r.name)switch(n){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===e&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===e&&i.method===t)return!0}return!1}function g(e,t,r,n){for(const i of r)if(f(e,t,i,n))return i;return null}return resolvingLoadBalancer.ResolvingLoadBalancer=class{constructor(e,a,o,l,c){this.target=e,this.channelControlHelper=a,this.channelOptions=o,this.onSuccessfulResolution=l,this.onFailedResolution=c,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new i.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o["grpc.service_config"]?this.defaultServiceConfig=(0,t.validateServiceConfig)(JSON.parse(o["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new i.QueuePicker(this),null),this.childLoadBalancer=new h.ChildLoadBalancerHandler({createSubchannel:a.createSubchannel.bind(a),requestReresolution:()=>{this.backoffTimeout.isRunning()?(d("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,r)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=r,this.updateState(e,t,r)},addChannelzChild:a.addChannelzChild.bind(a),removeChannelzChild:a.removeChannelzChild.bind(a)}),this.innerResolver=(0,n.createResolver)(e,this.handleResolverResult.bind(this),o);const u={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new s.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},u),this.backoffTimeout.unref()}handleResolverResult(t,r,i,s){var l,c;this.backoffTimeout.stop(),this.backoffTimeout.reset();let u=!0,h=null;if(null===i?h=this.defaultServiceConfig:i.ok?h=i.value:null!==this.previousServiceConfig?h=this.previousServiceConfig:(u=!1,this.handleResolutionFailure(i.error)),null!==h){const n=null!==(l=null==h?void 0:h.loadBalancingConfig)&&void 0!==l?l:[],i=(0,e.selectLbConfigFromList)(n,!0);null===i?(u=!1,this.handleResolutionFailure({code:a.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new o.Metadata})):u=this.childLoadBalancer.updateAddressList(t,i,Object.assign(Object.assign({},this.channelOptions),r),s)}return u&&this.onSuccessfulResolution(h,null!==(c=r[n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])&&void 0!==c?c:function(e){return{invoke(t,r){var n,i;const s=t.split("/").filter(e=>e.length>0),o=null!==(n=s[0])&&void 0!==n?n:"",l=null!==(i=s[1])&&void 0!==i?i:"";if(e&&e.methodConfig)for(const t of p){const r=g(o,l,e.methodConfig,t);if(r)return{methodConfig:r,pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:a.Status.OK,dynamicFilterFactories:[]}},unref(){}}}(h)),u}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){d((0,u.uriToString)(this.target)+" "+r.ConnectivityState[this.currentState]+" -> "+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new i.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new i.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){this.currentState!==r.ConnectivityState.IDLE&&this.currentState!==r.ConnectivityState.TRANSIENT_FAILURE||(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new i.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}},resolvingLoadBalancer}var subchannelPool={},channelOptions={},hasRequiredChannelOptions;function requireChannelOptions(){if(hasRequiredChannelOptions)return channelOptions;return hasRequiredChannelOptions=1,Object.defineProperty(channelOptions,"__esModule",{value:!0}),channelOptions.recognizedOptions=void 0,channelOptions.channelOptionsEqual=function(e,t){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(r.length!==n.length)return!1;for(let i=0;i<r.length;i+=1){if(r[i]!==n[i])return!1;if(e[r[i]]!==t[n[i]])return!1}return!0},channelOptions.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0},channelOptions}var subchannel={},subchannelAddress={},hasRequiredSubchannelAddress;function requireSubchannelAddress(){if(hasRequiredSubchannelAddress)return subchannelAddress;hasRequiredSubchannelAddress=1,Object.defineProperty(subchannelAddress,"__esModule",{value:!0}),subchannelAddress.EndpointMap=void 0,subchannelAddress.isTcpSubchannelAddress=t,subchannelAddress.subchannelAddressEqual=r,subchannelAddress.subchannelAddressToString=n,subchannelAddress.stringToSubchannelAddress=function(t,r){return(0,e.isIP)(t)?{host:t,port:null!=r?r:i}:{path:t}},subchannelAddress.endpointEqual=function(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!r(e.addresses[n],t.addresses[n]))return!1;return!0},subchannelAddress.endpointToString=function(e){return"["+e.addresses.map(n).join(", ")+"]"},subchannelAddress.endpointHasAddress=s;const e=require$$0$3;function t(e){return"port"in e}function r(e,r){return!e&&!r||!(!e||!r)&&(t(e)?t(r)&&e.host===r.host&&e.port===r.port:!t(r)&&e.path===r.path)}function n(r){return t(r)?(0,e.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}const i=443;function s(e,t){for(const n of e.addresses)if(r(n,t))return!0;return!1}function a(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(const n of e.addresses){let e=!1;for(const i of t.addresses)if(r(n,i)){e=!0;break}if(!e)return!1}return!0}return subchannelAddress.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(const t of this.map)if(s(t.key,e))return t.value}deleteMissing(e){const t=[];for(const r of this.map){let n=!1;for(const t of e)a(t,r.key)&&(n=!0);n||(t.push(r.value),this.map.delete(r))}return t}get(e){for(const t of this.map)if(a(e,t.key))return t.value}set(e,t){for(const r of this.map)if(a(e,r.key))return void(r.value=t);this.map.add({key:e,value:t})}delete(e){for(const t of this.map)if(a(e,t.key))return void this.map.delete(t)}has(e){for(const t of this.map)if(a(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(const e of this.map)yield e.key}*values(){for(const e of this.map)yield e.value}*entries(){for(const e of this.map)yield[e.key,e.value]}},subchannelAddress}var channelz={},extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function __generator(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}"function"==typeof SuppressedError&&SuppressedError;var TreeNode=function(){function e(e,t,r){void 0===r&&(r=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=r}return e.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&1===e.l)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var r=e.h;r.t===e;)r=(e=r).h;e=r}return e},e.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}for(var t=e.h;t.i===e;)t=(e=t).h;return e.i!==t?t:e},e.prototype.T=function(){var e=this.h,t=this.i,r=t.t;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.t=this,this.h=t,this.i=r,r&&(r.h=this),t},e.prototype.I=function(){var e=this.h,t=this.t,r=t.i;return e.h===this?e.h=t:e.t===this?e.t=t:e.i=t,t.h=e,t.i=this,this.h=t,this.t=r,r&&(r.h=this),t},e}(),TreeNodeEnableIndex=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.O=1,t}return __extends(t,e),t.prototype.T=function(){var t=e.prototype.T.call(this);return this.M(),t.M(),t},t.prototype.I=function(){var t=e.prototype.I.call(this);return this.M(),t.M(),t},t.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},t}(TreeNode),ContainerIterator=function(){function e(e){void 0===e&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.C===e.C},e}(),Base=function(){function e(){this._=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this._},e.prototype.empty=function(){return 0===this._},e}(),Container=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(Base);function throwIteratorAccessError(){throw new RangeError("Iterator access denied!")}var TreeContainer=function(e){function t(t,r){void 0===t&&(t=function(e,t){return e<t?-1:e>t?1:0}),void 0===r&&(r=!1);var n=e.call(this)||this;return n.N=void 0,n.g=t,n.enableIndex=r,n.S=r?TreeNodeEnableIndex:TreeNode,n.A=new n.S,n}return __extends(t,e),t.prototype.m=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)e=e.i;else{if(!(n>0))return e;r=e,e=e.t}}return r},t.prototype.B=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<=0?e=e.i:(r=e,e=e.t)}return r},t.prototype.j=function(e,t){for(var r=this.A;e;){var n=this.g(e.u,t);if(n<0)r=e,e=e.i;else{if(!(n>0))return e;e=e.t}}return r},t.prototype.k=function(e,t){for(var r=this.A;e;){this.g(e.u,t)<0?(r=e,e=e.i):e=e.t}return r},t.prototype.R=function(e){for(;;){var t,r=e.h;if(r===this.A)return;if(1===e.l)return void(e.l=0);if(e===r.t)if(1===(t=r.i).l)t.l=0,r.l=1,r===this.N?this.N=r.T():r.T();else{if(t.i&&1===t.i.l)return t.l=r.l,r.l=0,t.i.l=0,void(r===this.N?this.N=r.T():r.T());t.t&&1===t.t.l?(t.l=1,t.t.l=0,t.I()):(t.l=1,e=r)}else if(1===(t=r.t).l)t.l=0,r.l=1,r===this.N?this.N=r.I():r.I();else{if(t.t&&1===t.t.l)return t.l=r.l,r.l=0,t.t.l=0,void(r===this.N?this.N=r.I():r.I());t.i&&1===t.i.l?(t.l=1,t.i.l=0,t.T()):(t.l=1,e=r)}}},t.prototype.G=function(e){if(1!==this._){for(var t=e;t.t||t.i;){if(t.i)for(t=t.i;t.t;)t=t.t;else t=t.t;var r=e.u;e.u=t.u,t.u=r;var n=e.o;e.o=t.o,t.o=n,e=t}this.A.t===t?this.A.t=t.h:this.A.i===t&&(this.A.i=t.h),this.R(t);var i=t.h;if(t===i.t?i.t=void 0:i.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;i!==this.A;)i.O-=1,i=i.h}else this.clear()},t.prototype.P=function(e){for(var t="number"==typeof e?e:void 0,r="function"==typeof e?e:void 0,n=void 0===e?[]:void 0,i=0,s=this.N,a=[];a.length||s;)if(s)a.push(s),s=s.t;else{if(s=a.pop(),i===t)return s;n&&n.push(s),r&&r(s,i,this),i+=1,s=s.i}return n},t.prototype.q=function(e){for(;;){var t=e.h;if(0===t.l)return;var r=t.h;if(t===r.t){if((n=r.i)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.i)return t.l=0,r===this.N?this.N=r.I():r.I(),void(r.l=1);e.l=0,e.t&&(e.t.h=t),e.i&&(e.i.h=r),t.i=e.t,r.t=e.i,e.t=t,e.i=r,r===this.N?(this.N=e,this.A.h=e):(i=r.h).t===r?i.t=e:i.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}else{var n,i;if((n=r.t)&&1===n.l){if(n.l=t.l=0,r===this.N)return;r.l=1,e=r;continue}if(e!==t.t)return t.l=0,r===this.N?this.N=r.T():r.T(),void(r.l=1);e.l=0,e.t&&(e.t.h=r),e.i&&(e.i.h=t),r.i=e.t,t.t=e.i,e.t=r,e.i=t,r===this.N?(this.N=e,this.A.h=e):(i=r.h).t===r?i.t=e:i.i=e,e.h=r.h,t.h=e,r.h=e,r.l=1}return void(this.enableIndex&&(t.M(),r.M(),e.M()))}},t.prototype.D=function(e,t,r){if(void 0===this.N)return this._+=1,this.N=new this.S(e,t,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var n,i=this.A.t,s=this.g(i.u,e);if(0===s)return i.o=t,this._;if(s>0)i.t=new this.S(e,t),i.t.h=i,n=i.t,this.A.t=n;else{var a=this.A.i,o=this.g(a.u,e);if(0===o)return a.o=t,this._;if(o<0)a.i=new this.S(e,t),a.i.h=a,n=a.i,this.A.i=n;else{if(void 0!==r){var l=r.C;if(l!==this.A){var c=this.g(l.u,e);if(0===c)return l.o=t,this._;if(c>0){var u=l.v(),h=this.g(u.u,e);if(0===h)return u.o=t,this._;h<0&&(n=new this.S(e,t),void 0===u.i?(u.i=n,n.h=u):(l.t=n,n.h=l))}}}if(void 0===n)for(n=this.N;;){var d=this.g(n.u,e);if(d>0){if(void 0===n.t){n.t=new this.S(e,t),n.t.h=n,n=n.t;break}n=n.t}else{if(!(d<0))return n.o=t,this._;if(void 0===n.i){n.i=new this.S(e,t),n.i.h=n,n=n.i;break}n=n.i}}}}if(this.enableIndex)for(var p=n.h;p!==this.A;)p.O+=1,p=p.h;return this.q(n),this._+=1,this._},t.prototype.F=function(e,t){for(;e;){var r=this.g(e.u,t);if(r<0)e=e.i;else{if(!(r>0))return e;e=e.t}}return e||this.A},t.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},t.prototype.updateKeyByIterator=function(e,t){var r=e.C;if(r===this.A&&throwIteratorAccessError(),1===this._)return r.u=t,!0;var n=r.p().u;if(r===this.A.t)return this.g(n,t)>0&&(r.u=t,!0);var i=r.v().u;return r===this.A.i?this.g(i,t)<0&&(r.u=t,!0):!(this.g(i,t)>=0||this.g(n,t)<=0)&&(r.u=t,!0)},t.prototype.eraseElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return this.G(t),this._},t.prototype.eraseElementByKey=function(e){if(0===this._)return!1;var t=this.F(this.N,e);return t!==this.A&&(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.C;t===this.A&&throwIteratorAccessError();var r=void 0===t.i;return 0===e.iteratorType?r&&e.next():r&&void 0!==t.t||e.next(),this.G(t),e},t.prototype.getHeight=function(){if(0===this._)return 0;return function e(t){return t?Math.max(e(t.t),e(t.i))+1:0}(this.N)},t}(Container),TreeIterator=function(e){function t(t,r,n){var i=e.call(this,n)||this;return i.C=t,i.A=r,0===i.iteratorType?(i.pre=function(){return this.C===this.A.t&&throwIteratorAccessError(),this.C=this.C.v(),this},i.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.p(),this}):(i.pre=function(){return this.C===this.A.i&&throwIteratorAccessError(),this.C=this.C.p(),this},i.next=function(){return this.C===this.A&&throwIteratorAccessError(),this.C=this.C.v(),this}),i}return __extends(t,e),Object.defineProperty(t.prototype,"index",{get:function(){var e=this.C,t=this.A.h;if(e===this.A)return t?t.O-1:0;var r=0;for(e.t&&(r+=e.t.O);e!==t;){var n=e.h;e===n.i&&(r+=1,n.t&&(r+=n.t.O)),e=n}return r},enumerable:!1,configurable:!0}),t.prototype.isAccessible=function(){return this.C!==this.A},t}(ContainerIterator),OrderedMapIterator=function(e){function t(t,r,n,i){var s=e.call(this,t,r,i)||this;return s.container=n,s}return __extends(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){this.C===this.A&&throwIteratorAccessError();var e=this;return new Proxy([],{get:function(t,r){return"0"===r?e.C.u:"1"===r?e.C.o:(t[0]=e.C.u,t[1]=e.C.o,t[r])},set:function(t,r,n){if("1"!==r)throw new TypeError("prop must be 1");return e.C.o=n,!0}})},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.C,this.A,this.container,this.iteratorType)},t}(TreeIterator),OrderedMap=function(e){function t(t,r,n){void 0===t&&(t=[]);var i=e.call(this,r,n)||this,s=i;return t.forEach(function(e){s.setElement(e[0],e[1])}),i}return __extends(t,e),t.prototype.begin=function(){return new OrderedMapIterator(this.A.t||this.A,this.A,this)},t.prototype.end=function(){return new OrderedMapIterator(this.A,this.A,this)},t.prototype.rBegin=function(){return new OrderedMapIterator(this.A.i||this.A,this.A,this,1)},t.prototype.rEnd=function(){return new OrderedMapIterator(this.A,this.A,this,1)},t.prototype.front=function(){if(0!==this._){var e=this.A.t;return[e.u,e.o]}},t.prototype.back=function(){if(0!==this._){var e=this.A.i;return[e.u,e.o]}},t.prototype.lowerBound=function(e){var t=this.m(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.upperBound=function(e){var t=this.B(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseLowerBound=function(e){var t=this.j(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.reverseUpperBound=function(e){var t=this.k(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.forEach=function(e){this.P(function(t,r,n){e([t.u,t.o],r,n)})},t.prototype.setElement=function(e,t,r){return this.D(e,t,r)},t.prototype.getElementByPos=function(e){if(e<0||e>this._-1)throw new RangeError;var t=this.P(e);return[t.u,t.o]},t.prototype.find=function(e){var t=this.F(this.N,e);return new OrderedMapIterator(t,this.A,this)},t.prototype.getElementByKey=function(e){return this.F(this.N,e).o},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this._},t.prototype[Symbol.iterator]=function(){var e,t,r,n;return __generator(this,function(i){switch(i.label){case 0:e=this._,t=this.P(),r=0,i.label=1;case 1:return r<e?[4,[(n=t[r]).u,n.o]]:[3,4];case 2:i.sent(),i.label=3;case 3:return++r,[3,1];case 4:return[2]}})},t}(TreeContainer),esm=Object.freeze({__proto__:null,OrderedMap:OrderedMap}),require$$1=getAugmentedNamespace(esm),admin={},hasRequiredAdmin;function requireAdmin(){if(hasRequiredAdmin)return admin;hasRequiredAdmin=1,Object.defineProperty(admin,"__esModule",{value:!0}),admin.registerAdminService=function(t,r){e.push({getServiceDefinition:t,getHandlers:r})},admin.addAdminServicesToServer=function(t){for(const{getServiceDefinition:r,getHandlers:n}of e)t.addService(r(),n())};const e=[];return admin}var makeClient={},client={},call={},hasRequiredCall;function requireCall(){if(hasRequiredCall)return call;hasRequiredCall=1,Object.defineProperty(call,"__esModule",{value:!0}),call.ClientDuplexStreamImpl=call.ClientWritableStreamImpl=call.ClientReadableStreamImpl=call.ClientUnaryCallImpl=void 0,call.callErrorFromStatus=function(e,t){const n=`${e.code} ${r.Status[e.code]}: ${e.details}`,i=new Error(n),s=`${i.stack}\nfor call at\n${t}`;return Object.assign(new Error(n),e,{stack:s})};const e=require$$0$4,t=require$$1$2,r=requireConstants();class n extends e.EventEmitter{constructor(){super()}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}}call.ClientUnaryCallImpl=n;class i extends t.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}}call.ClientReadableStreamImpl=i;class s extends t.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_write(e,t,r){var n;const i={callback:r},s=Number(t);Number.isNaN(s)||(i.flags=s),null===(n=this.call)||void 0===n||n.sendMessageWithContext(i,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}call.ClientWritableStreamImpl=s;class a extends t.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;null===(e=this.call)||void 0===e||e.cancelWithStatus(r.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:"unknown"}getAuthContext(){var e,t;return null!==(t=null===(e=this.call)||void 0===e?void 0:e.getAuthContext())&&void 0!==t?t:null}_read(e){var t;null===(t=this.call)||void 0===t||t.startRead()}_write(e,t,r){var n;const i={callback:r},s=Number(t);Number.isNaN(s)||(i.flags=s),null===(n=this.call)||void 0===n||n.sendMessageWithContext(i,e)}_final(e){var t;null===(t=this.call)||void 0===t||t.halfClose(),e()}}return call.ClientDuplexStreamImpl=a,call}var clientInterceptors={},callInterface={},hasRequiredCallInterface,hasRequiredClientInterceptors,hasRequiredClient,hasRequiredMakeClient;function requireCallInterface(){if(hasRequiredCallInterface)return callInterface;hasRequiredCallInterface=1,Object.defineProperty(callInterface,"__esModule",{value:!0}),callInterface.InterceptingListenerImpl=void 0,callInterface.statusOrFromValue=function(e){return{ok:!0,value:e}},callInterface.statusOrFromError=function(t){var r;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:null!==(r=t.metadata)&&void 0!==r?r:new e.Metadata})}},callInterface.isInterceptingListener=function(e){return void 0!==e.onReceiveMetadata&&1===e.onReceiveMetadata.length};const e=requireMetadata();return callInterface.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}},callInterface}function requireClientInterceptors(){if(hasRequiredClientInterceptors)return clientInterceptors;hasRequiredClientInterceptors=1,Object.defineProperty(clientInterceptors,"__esModule",{value:!0}),clientInterceptors.InterceptingCall=clientInterceptors.RequesterBuilder=clientInterceptors.ListenerBuilder=clientInterceptors.InterceptorConfigurationError=void 0,clientInterceptors.getInterceptingCall=function(e,t,r,n){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new i("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new i("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let s=[];s=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);const a=Object.assign({},r,{method_definition:t}),o=s.reduceRight((e,t)=>r=>t(r,e),e=>u(n,e,t));return o(a)};const e=requireMetadata(),t=requireCallInterface(),r=requireConstants(),n=requireError();class i extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,i)}}clientInterceptors.InterceptorConfigurationError=i;clientInterceptors.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};clientInterceptors.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};const s={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},a={start:(e,t,r)=>{r(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};clientInterceptors.InterceptingCall=class{constructor(e,t){var r,n,i,s;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,this.requester=t?{start:null!==(r=t.start)&&void 0!==r?r:a.start,sendMessage:null!==(n=t.sendMessage)&&void 0!==n?n:a.sendMessage,halfClose:null!==(i=t.halfClose)&&void 0!==i?i:a.halfClose,cancel:null!==(s=t.cancel)&&void 0!==s?s:a.cancel}:a}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,i,a,o,l,c;const u={onReceiveMetadata:null!==(i=null===(n=null==r?void 0:r.onReceiveMetadata)||void 0===n?void 0:n.bind(r))&&void 0!==i?i:e=>{},onReceiveMessage:null!==(o=null===(a=null==r?void 0:r.onReceiveMessage)||void 0===a?void 0:a.bind(r))&&void 0!==o?o:e=>{},onReceiveStatus:null!==(c=null===(l=null==r?void 0:r.onReceiveStatus)||void 0===l?void 0:l.bind(r))&&void 0!==c?c:e=>{}};this.processingMetadata=!0,this.requester.start(e,u,(e,r)=>{var n,i,a;let o;if(this.processingMetadata=!1,(0,t.isInterceptingListener)(r))o=r;else{const e={onReceiveMetadata:null!==(n=r.onReceiveMetadata)&&void 0!==n?n:s.onReceiveMetadata,onReceiveMessage:null!==(i=r.onReceiveMessage)&&void 0!==i?i:s.onReceiveMessage,onReceiveStatus:null!==(a=r.onReceiveStatus)&&void 0!==a?a:s.onReceiveStatus};o=new t.InterceptingListenerImpl(e,u)}this.nextCall.start(e,o),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,r),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};class o{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let i;try{i=this.methodDefinition.requestSerialize(t)}catch(e){return void this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,n.getErrorMessage)(e)}`)}this.call.sendMessageWithContext(e,i)}sendMessage(e){this.sendMessageWithContext({},e)}start(t,i){let s=null;this.call.start(t,{onReceiveMetadata:e=>{var t;null===(t=null==i?void 0:i.onReceiveMetadata)||void 0===t||t.call(i,e)},onReceiveMessage:t=>{var a;let o;try{o=this.methodDefinition.responseDeserialize(t)}catch(t){return s={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,n.getErrorMessage)(t)}`,metadata:new e.Metadata},void this.call.cancelWithStatus(s.code,s.details)}null===(a=null==i?void 0:i.onReceiveMessage)||void 0===a||a.call(i,o)},onReceiveStatus:e=>{var t,r;s?null===(t=null==i?void 0:i.onReceiveStatus)||void 0===t||t.call(i,s):null===(r=null==i?void 0:i.onReceiveStatus)||void 0===r||r.call(i,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class l extends o{constructor(e,t){super(e,t)}start(e,t){var r,n;let i=!1;const s={onReceiveMetadata:null!==(n=null===(r=null==t?void 0:t.onReceiveMetadata)||void 0===r?void 0:r.bind(t))&&void 0!==n?n:e=>{},onReceiveMessage:e=>{var r;i=!0,null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,e)},onReceiveStatus:e=>{var r,n;i||null===(r=null==t?void 0:t.onReceiveMessage)||void 0===r||r.call(t,null),null===(n=null==t?void 0:t.onReceiveStatus)||void 0===n||n.call(t,e)}};super.start(e,s),this.call.startRead()}}class c extends o{}function u(e,t,r){const n=function(e,t,r){var n,i;const s=null!==(n=r.deadline)&&void 0!==n?n:1/0,a=r.host,o=null!==(i=r.parent)&&void 0!==i?i:null,l=r.propagate_flags,c=r.credentials,u=e.createCall(t,s,a,o,l);return c&&u.setCredentials(c),u}(e,r.path,t);return r.responseStream?new c(n,r):new l(n,r)}return clientInterceptors}function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1,Object.defineProperty(client,"__esModule",{value:!0}),client.Client=void 0;const e=requireCall(),t=requireChannel(),r=requireConnectivityState(),n=requireConstants(),i=requireMetadata(),s=requireClientInterceptors(),a=Symbol(),o=Symbol(),l=Symbol(),c=Symbol();function u(e){return"function"==typeof e}function h(e){var t;return(null===(t=e.stack)||void 0===t?void 0:t.split("\n").slice(1).join("\n"))||"no stack trace available"}return client.Client=class{constructor(e,r,n={}){var i,s;if(n=Object.assign({},n),this[o]=null!==(i=n.interceptors)&&void 0!==i?i:[],delete n.interceptors,this[l]=null!==(s=n.interceptor_providers)&&void 0!==s?s:[],delete n.interceptor_providers,this[o].length>0&&this[l].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[c]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[a]=n.channelOverride;else if(n.channelFactoryOverride){const t=n.channelFactoryOverride;delete n.channelFactoryOverride,this[a]=t(e,r,n)}else this[a]=new t.ChannelImplementation(e,r,n)}close(){this[a].close()}getChannel(){return this[a]}waitForReady(e,t){const n=i=>{if(i)return void t(new Error("Failed to connect before the deadline"));let s;try{s=this[a].getConnectivityState(!0)}catch(e){return void t(new Error("The channel has been closed"))}if(s===r.ConnectivityState.READY)t();else try{this[a].watchConnectivityState(s,e,n)}catch(e){t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,r){if(u(e))return{metadata:new i.Metadata,options:{},callback:e};if(u(t))return e instanceof i.Metadata?{metadata:e,options:{},callback:t}:{metadata:new i.Metadata,options:e,callback:t};if(!(e instanceof i.Metadata&&t instanceof Object&&u(r)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:r}}makeUnaryRequest(t,r,i,u,d,p,f){var g,v;const m=this.checkOptionalUnaryResponseArguments(d,p,f),A={path:t,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:i};let y={argument:u,metadata:m.metadata,call:new e.ClientUnaryCallImpl,channel:this[a],methodDefinition:A,callOptions:m.options,callback:m.callback};this[c]&&(y=this[c](y));const C=y.call,S={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(g=y.callOptions.interceptors)&&void 0!==g?g:[],callInterceptorProviders:null!==(v=y.callOptions.interceptor_providers)&&void 0!==v?v:[]},E=(0,s.getInterceptingCall)(S,y.methodDefinition,y.callOptions,y.channel);C.call=E;let _=null,b=!1,T=new Error;return E.start(y.metadata,{onReceiveMetadata:e=>{C.emit("metadata",e)},onReceiveMessage(e){null!==_&&E.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),_=e},onReceiveStatus(t){if(!b){if(b=!0,t.code===n.Status.OK)if(null===_){const r=h(T);y.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else y.callback(null,_);else{const r=h(T);y.callback((0,e.callErrorFromStatus)(t,r))}T=null,C.emit("status",t)}}}),E.sendMessage(u),E.halfClose(),C}makeClientStreamRequest(t,r,i,u,d,p){var f,g;const v=this.checkOptionalUnaryResponseArguments(u,d,p),m={path:t,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:i};let A={metadata:v.metadata,call:new e.ClientWritableStreamImpl(r),channel:this[a],methodDefinition:m,callOptions:v.options,callback:v.callback};this[c]&&(A=this[c](A));const y=A.call,C={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(f=A.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(g=A.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,s.getInterceptingCall)(C,A.methodDefinition,A.callOptions,A.channel);y.call=S;let E=null,_=!1,b=new Error;return S.start(A.metadata,{onReceiveMetadata:e=>{y.emit("metadata",e)},onReceiveMessage(e){null!==E&&S.cancelWithStatus(n.Status.UNIMPLEMENTED,"Too many responses received"),E=e,S.startRead()},onReceiveStatus(t){if(!_){if(_=!0,t.code===n.Status.OK)if(null===E){const r=h(b);A.callback((0,e.callErrorFromStatus)({code:n.Status.UNIMPLEMENTED,details:"No message received",metadata:t.metadata},r))}else A.callback(null,E);else{const r=h(b);A.callback((0,e.callErrorFromStatus)(t,r))}b=null,y.emit("status",t)}}}),y}checkMetadataAndOptions(e,t){let r,n;return e instanceof i.Metadata?(r=e,n=t||{}):(n=e||{},r=new i.Metadata),{metadata:r,options:n}}makeServerStreamRequest(t,r,i,u,d,p){var f,g;const v=this.checkMetadataAndOptions(d,p),m={path:t,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:i};let A={argument:u,metadata:v.metadata,call:new e.ClientReadableStreamImpl(i),channel:this[a],methodDefinition:m,callOptions:v.options};this[c]&&(A=this[c](A));const y=A.call,C={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(f=A.callOptions.interceptors)&&void 0!==f?f:[],callInterceptorProviders:null!==(g=A.callOptions.interceptor_providers)&&void 0!==g?g:[]},S=(0,s.getInterceptingCall)(C,A.methodDefinition,A.callOptions,A.channel);y.call=S;let E=!1,_=new Error;return S.start(A.metadata,{onReceiveMetadata(e){y.emit("metadata",e)},onReceiveMessage(e){y.push(e)},onReceiveStatus(t){if(!E){if(E=!0,y.push(null),t.code!==n.Status.OK){const r=h(_);y.emit("error",(0,e.callErrorFromStatus)(t,r))}_=null,y.emit("status",t)}}}),S.sendMessage(u),S.halfClose(),y}makeBidiStreamRequest(t,r,i,u,d){var p,f;const g=this.checkMetadataAndOptions(u,d),v={path:t,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:i};let m={metadata:g.metadata,call:new e.ClientDuplexStreamImpl(r,i),channel:this[a],methodDefinition:v,callOptions:g.options};this[c]&&(m=this[c](m));const A=m.call,y={clientInterceptors:this[o],clientInterceptorProviders:this[l],callInterceptors:null!==(p=m.callOptions.interceptors)&&void 0!==p?p:[],callInterceptorProviders:null!==(f=m.callOptions.interceptor_providers)&&void 0!==f?f:[]},C=(0,s.getInterceptingCall)(y,m.methodDefinition,m.callOptions,m.channel);A.call=C;let S=!1,E=new Error;return C.start(m.metadata,{onReceiveMetadata(e){A.emit("metadata",e)},onReceiveMessage(e){A.push(e)},onReceiveStatus(t){if(!S){if(S=!0,A.push(null),t.code!==n.Status.OK){const r=h(E);A.emit("error",(0,e.callErrorFromStatus)(t,r))}E=null,A.emit("status",t)}}}),A}},client}function requireMakeClient(){if(hasRequiredMakeClient)return makeClient;hasRequiredMakeClient=1,Object.defineProperty(makeClient,"__esModule",{value:!0}),makeClient.makeClientConstructor=n,makeClient.loadPackageDefinition=function(e){const t={};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const a=e[s],o=s.split(".");if(o.some(e=>r(e)))continue;const l=o[o.length-1];let c=t;for(const e of o.slice(0,-1))c[e]||(c[e]={}),c=c[e];i(a)?c[l]=a:c[l]=n(a,l)}return t};const e=requireClient(),t={unary:e.Client.prototype.makeUnaryRequest,server_stream:e.Client.prototype.makeServerStreamRequest,client_stream:e.Client.prototype.makeClientStreamRequest,bidi:e.Client.prototype.makeBidiStreamRequest};function r(e){return["__proto__","prototype","constructor"].includes(e)}function n(n,i,s){class a extends e.Client{}return Object.keys(n).forEach(e=>{if(r(e))return;const i=n[e];let s;if("string"==typeof e&&"$"===e.charAt(0))throw new Error("Method names cannot start with $");s=i.requestStream?i.responseStream?"bidi":"client_stream":i.responseStream?"server_stream":"unary";const o=i.requestSerialize,l=i.responseDeserialize,c=function(e,t,r,n){return function(...i){return e.call(this,t,r,n,...i)}}(t[s],i.path,o,l);a.prototype[e]=c,Object.assign(a.prototype[e],i),i.originalName&&!r(i.originalName)&&(a.prototype[i.originalName]=a.prototype[e])}),a.service=n,a.serviceName=i,a}function i(e){return"format"in e}return makeClient}var src$1={},lodash_camelcase,hasRequiredLodash_camelcase;function requireLodash_camelcase(){if(hasRequiredLodash_camelcase)return lodash_camelcase;hasRequiredLodash_camelcase=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",s="\\u20d0-\\u20f0",a="\\u2700-\\u27bf",o="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",c="\\ufe0e\\ufe0f",u="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",h="['’]",d="["+n+"]",p="["+u+"]",f="["+i+s+"]",g="\\d+",v="["+a+"]",m="["+o+"]",A="[^"+n+u+g+a+o+l+"]",y="\\ud83c[\\udffb-\\udfff]",C="[^"+n+"]",S="(?:\\ud83c[\\udde6-\\uddff]){2}",E="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+l+"]",b="\\u200d",T="(?:"+m+"|"+A+")",R="(?:"+_+"|"+A+")",x="(?:['’](?:d|ll|m|re|s|t|ve))?",w="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:"+f+"|"+y+")"+"?",N="["+c+"]?",I=N+k+("(?:"+b+"(?:"+[C,S,E].join("|")+")"+N+k+")*"),O="(?:"+[v,S,E].join("|")+")"+I,P="(?:"+[C+f+"?",f,S,E,d].join("|")+")",j=RegExp(h,"g"),L=RegExp(f,"g"),q=RegExp(y+"(?="+y+")|"+P+I,"g"),M=RegExp([_+"?"+m+"+"+x+"(?="+[p,_,"$"].join("|")+")",R+"+"+w+"(?="+[p,_+T,"$"].join("|")+")",_+"?"+T+"+"+x,_+"+"+w,g,O].join("|"),"g"),D=RegExp("["+b+n+i+s+c+"]"),F=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,B="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,U="object"==typeof self&&self&&self.Object===Object&&self,$=B||U||Function("return this")();var z=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"});function H(e){return D.test(e)}function W(e){return H(e)?function(e){return e.match(q)||[]}(e):function(e){return e.split("")}(e)}var G=Object.prototype.toString,V=$.Symbol,Y=V?V.prototype:void 0,K=Y?Y.toString:void 0;function J(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(e){return!!e&&"object"==typeof e}(t)&&G.call(t)==e}(t))return K?K.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}function X(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}(e,t,r)}function Q(e){return null==e?"":J(e)}var Z,ee=(Z=function(e,t,r){return t=t.toLowerCase(),e+(r?re(Q(t).toLowerCase()):t)},function(e){return function(e,t,r){for(var n=-1,i=e?e.length:0;++n<i;)r=t(r,e[n],n,e);return r}(function(e,r){return e=Q(e),void 0===r?function(e){return F.test(e)}(e)?function(e){return e.match(M)||[]}(e):function(e){return e.match(t)||[]}(e):e.match(r)||[]}(function(e){return(e=Q(e))&&e.replace(r,z).replace(L,"")}(e).replace(j,"")),Z,"")});var te,re=(te="toUpperCase",function(e){var t=H(e=Q(e))?W(e):void 0,r=t?t[0]:e.charAt(0),n=t?X(t,1).join(""):e.slice(1);return r[te]()+n});return lodash_camelcase=ee}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,s=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(i,a){r[n]=function(e){if(s)if(s=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){s&&(s=!1,a(e))}})},aspromise}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var r=new Array(64),n=new Array(123),i=0;i<64;)n[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,n){for(var i,s=null,a=[],o=0,l=0;t<n;){var c=e[t++];switch(l){case 0:a[o++]=r[c>>2],i=(3&c)<<4,l=1;break;case 1:a[o++]=r[i|c>>4],i=(15&c)<<2,l=2;break;case 2:a[o++]=r[i|c>>6],a[o++]=r[63&c],l=0}o>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),o=0)}return l&&(a[o++]=r[i],a[o++]=61,1===l&&(a[o++]=61)),s?(o&&s.push(String.fromCharCode.apply(String,a.slice(0,o))),s.join("")):String.fromCharCode.apply(String,a.slice(0,o))};var s="invalid encoding";t.decode=function(e,t,r){for(var i,a=r,o=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&o>1)break;if(void 0===(c=n[c]))throw Error(s);switch(o){case 0:i=c,o=1;break;case 1:t[r++]=i<<2|(48&c)>>4,i=c,o=2;break;case 2:t[r++]=(15&i)<<4|(60&c)>>2,i=c,o=3;break;case 3:t[r++]=(3&i)<<6|c,o=0}}if(1===o)throw Error(s);return r-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function s(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function o(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:s,e.writeFloatBE=n?s:i,e.readFloatLE=n?a:o,e.readFloatBE=n?o:a}():function(){function s(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),i=2*(n>>31)+1,s=n>>>23&255,a=8388607&n;return 255===s?a?NaN:i*(1/0):0===s?1401298464324817e-60*i*a:i*Math.pow(2,s-150)*(a+8388608)}e.writeFloatLE=s.bind(null,t),e.writeFloatBE=s.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function s(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function o(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:s,e.writeDoubleBE=n?s:i,e.readDoubleLE=n?a:o,e.readDoubleBE=n?o:a}():function(){function s(e,t,r,n,i,s){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,s+t),e(1/n>0?0:2147483648,i,s+r);else if(isNaN(n))e(0,i,s+t),e(2146959360,i,s+r);else if(n>17976931348623157e292)e(0,i,s+t),e((a<<31|2146435072)>>>0,i,s+r);else{var o;if(n<22250738585072014e-324)e((o=n/5e-324)>>>0,i,s+t),e((a<<31|o/4294967296)>>>0,i,s+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(o=n*Math.pow(2,-l))>>>0,i,s+t),e((a<<31|l+1023<<20|1048576*o&1048575)>>>0,i,s+r)}}}function a(e,t,r,n,i){var s=e(n,i+t),a=e(n,i+r),o=2*(a>>31)+1,l=a>>>20&2047,c=4294967296*(1048575&a)+s;return 2047===l?c?NaN:o*(1/0):0===l?5e-324*o*c:o*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=s.bind(null,t,0,4),e.writeDoubleBE=s.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function t(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function r(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,s=[],a=0;t<r;)(n=e[t++])<128?s[a++]=n:n>191&&n<224?s[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[a++]=55296+(n>>10),s[a++]=56320+(1023&n)):s[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))},t.write=function(e,t,r){for(var n,i,s=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-s}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,i=n>>>1,s=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(s=e(n),a=0);var o=t.call(s,a,a+=r);return 7&a&&(a=1+(7|a)),o}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var n=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var n=e<0;n&&(e=-e);var i=e>>>0,s=(e-i)/4294967296>>>0;return n&&(s=~s>>>0,i=~i>>>0,++i>4294967295&&(i=0,++s>4294967295&&(s=0))),new t(i,s)},t.from=function(n){if("number"==typeof n)return t.fromNumber(n);if(e.isString(n)){if(!e.Long)return t.fromNumber(parseInt(n,10));n=e.Long.fromString(n)}return n.low||n.high?new t(n.low>>>0,n.high>>>0):r},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var i=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((i.call(e,0)|i.call(e,1)<<8|i.call(e,2)<<16|i.call(e,3)<<24)>>>0,(i.call(e,4)|i.call(e,5)<<8|i.call(e,6)<<16|i.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10},longbits}function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(){var e=minimal;function t(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function r(e){function r(e,n){if(!(this instanceof r))return new r(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,r):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&t(this,n)}return r.prototype=Object.create(Error.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),r}e.asPromise=requireAspromise(),e.base64=requireBase64(),e.EventEmitter=requireEventemitter(),e.float=requireFloat(),e.inquire=requireInquire(),e.utf8=requireUtf8(),e.pool=requirePool(),e.LongBits=requireLongbits(),e.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),e.global=e.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.isString=function(e){return"string"==typeof e||e instanceof String},e.isObject=function(e){return e&&"object"==typeof e},e.isset=e.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},e.Buffer=function(){try{var t=e.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}(),e._Buffer_from=null,e._Buffer_allocUnsafe=null,e.newBuffer=function(t){return"number"==typeof t?e.Buffer?e._Buffer_allocUnsafe(t):new e.Array(t):e.Buffer?e._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},e.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||e.inquire("long"),e.key2Re=/^true|false|0|1$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,r){var n=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(n.lo,n.hi,r):n.toNumber(Boolean(r))},e.merge=t,e.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},e.newError=r,e.ProtocolError=r("ProtocolError"),e.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},e.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}()),minimal}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=l;var e,t=requireMinimal(),r=t.LongBits,n=t.base64,i=t.utf8;function s(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function o(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new s(a,0,0),this.tail=this.head,this.states=null}var c=function(){return t.Buffer?function(){return(l.create=function(){return new e})()}:function(){return new l}};function u(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function d(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function p(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=c(),l.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(l.alloc=t.pool(l.alloc,t.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new s(e,t,r),this.len+=t,this},h.prototype=Object.create(s.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(d,10,r.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=r.from(e);return this._push(d,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(d,t.length(),t)},l.prototype.bool=function(e){return this._push(u,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(p,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(p,4,t.lo)._push(p,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var f=t.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};return l.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(u,1,0);if(t.isString(e)){var i=l.alloc(r=n.length(e));n.decode(e,i,0),e=i}return this.uint32(r)._push(f,r,e)},l.prototype.string=function(e){var t=i.length(e);return t?this.uint32(t)._push(i.write,t,e):this._push(u,1,0)},l.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new s(a,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(a,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(t){e=t,l.create=c(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=r;var e=requireWriter();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal();function r(){e.call(this)}function n(e,r,n){e.length<40?t.utf8.write(e,r,n):r.utf8Write?r.utf8Write(e,n):r.write(e,n)}return r._configure=function(){r.alloc=t._Buffer_allocUnsafe,r.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},r.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var n=e.length>>>0;return this.uint32(n),n&&this._push(r.writeBytesBuffer,n,e),this},r.prototype.string=function(e){var r=t.Buffer.byteLength(e);return this.uint32(r),r&&this._push(n,r,e),this},r._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=s;var e,t=requireMinimal(),r=t.LongBits,n=t.utf8;function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var a,o="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new s(e);throw Error("illegal buffer")},l=function(){return t.Buffer?function(r){return(s.create=function(r){return t.Buffer.isBuffer(r)?new e(r):o(r)})(r)}:o};function c(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw i(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function u(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw i(this,8);return new r(u(this.buf,this.pos+=4),u(this.buf,this.pos+=4))}return s.create=l(),s.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,s.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return a;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return a}),s.prototype.int32=function(){return 0|this.uint32()},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},s.prototype.bool=function(){return 0!==this.uint32()},s.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return u(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|u(this.buf,this.pos+=4)},s.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw i(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var s=t.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)},s.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},s.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},s._configure=function(r){e=r,s.create=l(),e._configure();var n=t.Long?"toLong":"toNumber";t.merge(s.prototype,{int64:function(){return c.call(this)[n](!1)},uint64:function(){return c.call(this)[n](!0)},sint64:function(){return c.call(this).zzDecode()[n](!1)},fixed64:function(){return h.call(this)[n](!0)},sfixed64:function(){return h.call(this)[n](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=r;var e=requireReader();(r.prototype=Object.create(e.prototype)).constructor=r;var t=requireMinimal();function r(t){e.call(this,t)}return r._configure=function(){t.Buffer&&(r.prototype._slice=t.Buffer.prototype.slice)},r.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},r._configure(),reader_buffer}var rpc={},service$1,hasRequiredService$1,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal;function requireService$1(){if(hasRequiredService$1)return service$1;hasRequiredService$1=1,service$1=t;var e=requireMinimal();function t(t,r,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(r),this.responseDelimited=Boolean(n)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(r,n,i,s,a){if(!s)throw TypeError("request must be specified");var o=this;if(!a)return e.asPromise(t,o,r,n,i,s);if(o.rpcImpl)try{return o.rpcImpl(r,n[o.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(e,t){if(e)return o.emit("error",e,r),a(e);if(null!==t){if(!(t instanceof i))try{t=i[o.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return o.emit("error",e,r),a(e)}return o.emit("data",t,r),a(null,t)}o.end(!0)})}catch(e){return o.emit("error",e,r),void setTimeout(function(){a(e)},0)}else setTimeout(function(){a(Error("already ended"))},0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service$1}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,rpc.Service=requireService$1()),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(){var e=indexMinimal;function t(){e.util._configure(),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=requireWriter(),e.BufferWriter=requireWriter_buffer(),e.Reader=requireReader(),e.BufferReader=requireReader_buffer(),e.util=requireMinimal(),e.rpc=requireRpc(),e.roots=requireRoots(),e.configure=t,t()}()),indexMinimal}var types={},util$1={exports:{}},codegen_1,hasRequiredCodegen,fetch_1,hasRequiredFetch;function requireCodegen(){if(hasRequiredCodegen)return codegen_1;function e(t,r){"string"==typeof t&&(r=t,t=void 0);var n=[];function i(t){if("string"!=typeof t){var r=s();if(e.verbose&&console.log("codegen: "+r),r="return "+r,t){for(var a=Object.keys(t),o=new Array(a.length+1),l=new Array(a.length),c=0;c<a.length;)o[c]=a[c],l[c]=t[a[c++]];return o[c]=r,Function.apply(null,o).apply(null,l)}return Function(r)()}for(var u=new Array(arguments.length-1),h=0;h<u.length;)u[h]=arguments[++h];if(h=0,t=t.replace(/%([%dfijs])/g,function(e,t){var r=u[h++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"}),h!==u.length)throw Error("parameter count mismatch");return n.push(t),i}function s(e){return"function "+(e||r||"")+"("+(t&&t.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=s,i}return hasRequiredCodegen=1,codegen_1=e,e.verbose=!1,codegen_1}function requireFetch(){if(hasRequiredFetch)return fetch_1;hasRequiredFetch=1,fetch_1=r;var e=requireAspromise(),t=requireInquire()("fs");function r(n,i,s){return"function"==typeof i?(s=i,i={}):i||(i={}),s?!i.xhr&&t&&t.readFile?t.readFile(n,function(e,t){return e&&"undefined"!=typeof XMLHttpRequest?r.xhr(n,i,s):e?s(e):s(null,i.binary?t:t.toString("utf8"))}):r.xhr(n,i,s):e(r,this,n,i)}return r.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()},fetch_1}var path={},hasRequiredPath,namespace,hasRequiredNamespace,mapfield,hasRequiredMapfield,method,hasRequiredMethod,service,hasRequiredService,message,hasRequiredMessage,decoder_1,hasRequiredDecoder,verifier_1,hasRequiredVerifier;function requirePath(){return hasRequiredPath||(hasRequiredPath=1,function(e){var t=e,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var s=0;s<t.length;)".."===t[s]?s>0&&".."!==t[s-1]?t.splice(--s,2):n?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return i+t.join("/")};t.resolve=function(e,t,i){return i||(t=n(t)),r(t)?t:(i||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}}(path)),path}function requireNamespace(){if(hasRequiredNamespace)return namespace;hasRequiredNamespace=1,namespace=l;var e=requireObject();((l.prototype=Object.create(e.prototype)).constructor=l).className="Namespace";var t,r,n,i=requireField(),s=requireUtil$1(),a=requireOneof();function o(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(t,r){e.call(this,t,r),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function c(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}return l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=o,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=s.toArray(this.nested))}}),l.prototype.toJSON=function(e){return s.toObject(["options",this.options,"nested",o(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var s,a=Object.keys(e),o=0;o<a.length;++o)s=e[a[o]],this.add((void 0!==s.fields?t.fromJSON:void 0!==s.values?n.fromJSON:void 0!==s.methods?r.fromJSON:void 0!==s.id?i.fromJSON:l.fromJSON)(a[o],s));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof n)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof i&&void 0!==e.extend||e instanceof t||e instanceof a||e instanceof n||e instanceof r||e instanceof l))throw TypeError("object must be a valid nested object");if(this.nested){var s=this.get(e.name);if(s){if(!(s instanceof l&&e instanceof l)||s instanceof t||s instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var o=s.nestedArray,u=0;u<o.length;++u)e.add(o[u]);this.remove(s),this.nested||(this.nested={}),e.setOptions(s.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof t||this instanceof r||this instanceof n||this instanceof i||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var h=this;h=h.parent;)h._needsRecursiveFeatureResolution=!0,h._needsRecursiveResolve=!0;return e.onAdd(this),c(this)},l.prototype.remove=function(t){if(!(t instanceof e))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),c(this)},l.prototype.define=function(e,t){if(s.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},l.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.nestedArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),s.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var n=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n];if(i&&(!t||t.indexOf(i.constructor)>-1))return i;if((i=this._lookupImpl(e,n))&&(!t||t.indexOf(i.constructor)>-1))return i;if(r)return null;for(var a=this;a.parent;){if((i=a.parent._lookupImpl(e,n))&&(!t||t.indexOf(i.constructor)>-1))return i;a=a.parent}return null},l.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var r=this.get(e[0]),n=null;if(r)1===e.length?n=r:r instanceof l&&(e=e.slice(1),n=r._lookupImpl(e,e.join(".")));else for(var i=0;i<this.nestedArray.length;++i)this._nestedArray[i]instanceof l&&(r=this._nestedArray[i]._lookupImpl(e,t))&&(n=r);return this._lookupCache[t]=n,n},l.prototype.lookupType=function(e){var r=this.lookup(e,[t]);if(!r)throw Error("no such type: "+e);return r},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[t,n]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r},l.prototype.lookupService=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,i,s){t=e,r=i,n=s},namespace}function requireMapfield(){if(hasRequiredMapfield)return mapfield;hasRequiredMapfield=1,mapfield=n;var e=requireField();((n.prototype=Object.create(e.prototype)).constructor=n).className="MapField";var t=requireTypes(),r=requireUtil$1();function n(t,n,i,s,a,o){if(e.call(this,t,n,s,void 0,void 0,a,o),!r.isString(i))throw TypeError("keyType must be a string");this.keyType=i,this.resolvedKeyType=null,this.map=!0}return n.fromJSON=function(e,t){return new n(e,t.id,t.keyType,t.type,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},n.prototype.resolve=function(){if(this.resolved)return this;if(void 0===t.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return e.prototype.resolve.call(this)},n.d=function(e,t,i){return"function"==typeof i?i=r.decorateType(i).name:i&&"object"==typeof i&&(i=r.decorateEnum(i).name),function(s,a){r.decorateType(s.constructor).add(new n(a,e,t,i))}},mapfield}function requireMethod(){if(hasRequiredMethod)return method;hasRequiredMethod=1,method=r;var e=requireObject();((r.prototype=Object.create(e.prototype)).constructor=r).className="Method";var t=requireUtil$1();function r(r,n,i,s,a,o,l,c,u){if(t.isObject(a)?(l=a,a=o=void 0):t.isObject(o)&&(l=o,o=void 0),void 0!==n&&!t.isString(n))throw TypeError("type must be a string");if(!t.isString(i))throw TypeError("requestType must be a string");if(!t.isString(s))throw TypeError("responseType must be a string");e.call(this,r,l),this.type=n||"rpc",this.requestType=i,this.requestStream=!!a||void 0,this.responseType=s,this.responseStream=!!o||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=u}return r.fromJSON=function(e,t){return new r(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},r.prototype.toJSON=function(e){var r=!!e&&Boolean(e.keepComments);return t.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),e.prototype.resolve.call(this))},method}function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=i;var e=requireNamespace();((i.prototype=Object.create(e.prototype)).constructor=i).className="Service";var t=requireMethod(),r=requireUtil$1(),n=requireRpc();function i(t,r){e.call(this,t,r),this.methods={},this._methodsArray=null}function s(e){return e._methodsArray=null,e}return i.fromJSON=function(e,r){var n=new i(e,r.options);if(r.methods)for(var s=Object.keys(r.methods),a=0;a<s.length;++a)n.add(t.fromJSON(s[a],r.methods[s[a]]));return r.nested&&n.addJSON(r.nested),r.edition&&(n._edition=r.edition),n.comment=r.comment,n._defaultEdition="proto3",n},i.prototype.toJSON=function(t){var n=e.prototype.toJSON.call(this,t),i=!!t&&Boolean(t.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",n&&n.options||void 0,"methods",e.arrayToJSON(this.methodsArray,t)||{},"nested",n&&n.nested||void 0,"comment",i?this.comment:void 0])},Object.defineProperty(i.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=r.toArray(this.methods))}}),i.prototype.get=function(t){return this.methods[t]||e.prototype.get.call(this,t)},i.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolve.call(this);for(var t=this.methodsArray,r=0;r<t.length;++r)t[r].resolve();return this},i.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.methodsArray.forEach(e=>{e._resolveFeaturesRecursive(t)}),this):this},i.prototype.add=function(r){if(this.get(r.name))throw Error("duplicate name '"+r.name+"' in "+this);return r instanceof t?(this.methods[r.name]=r,r.parent=this,s(this)):e.prototype.add.call(this,r)},i.prototype.remove=function(r){if(r instanceof t){if(this.methods[r.name]!==r)throw Error(r+" is not a member of "+this);return delete this.methods[r.name],r.parent=null,s(this)}return e.prototype.remove.call(this,r)},i.prototype.create=function(e,t,i){for(var s,a=new n.Service(e,t,i),o=0;o<this.methodsArray.length;++o){var l=r.lcFirst((s=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,"");a[l]=r.codegen(["r","c"],r.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:s,q:s.resolvedRequestType.ctor,s:s.resolvedResponseType.ctor})}return a},service}function requireMessage(){if(hasRequiredMessage)return message;hasRequiredMessage=1,message=t;var e=requireMinimal();function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return t.create=function(e){return this.$type.create(e)},t.encode=function(e,t){return this.$type.encode(e,t)},t.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},t.decode=function(e){return this.$type.decode(e)},t.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},t.verify=function(e){return this.$type.verify(e)},t.fromObject=function(e){return this.$type.fromObject(e)},t.toObject=function(e,t){return this.$type.toObject(e,t)},t.prototype.toJSON=function(){return this.$type.toObject(this,e.toJSONOptions)},message}function requireDecoder(){if(hasRequiredDecoder)return decoder_1;hasRequiredDecoder=1,decoder_1=function(i){for(var s=r.codegen(["r","l","e"],i.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(i.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),a=0;a<i.fieldsArray.length;++a){var o=i._fieldsArray[a].resolve(),l=o.resolvedType instanceof e?"int32":o.type,c="m"+r.safeProp(o.name);s("case %i: {",o.id),o.map?(s("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==t.defaults[o.keyType]?s("k=%j",t.defaults[o.keyType]):s("k=null"),void 0!==t.defaults[l]?s("value=%j",t.defaults[l]):s("value=null"),s("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",o.keyType)("case 2:"),void 0===t.basic[l]?s("value=types[%i].decode(r,r.uint32())",a):s("value=r.%s()",l),s("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==t.long[o.keyType]?s('%s[typeof k==="object"?util.longToHash(k):k]=value',c):s("%s[k]=value",c)):o.repeated?(s("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==t.packed[l]&&s("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,l)("}else"),void 0===t.basic[l]?s(o.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",c,a):s("%s.push(r.%s())",c,l)):void 0===t.basic[l]?s(o.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",c,a):s("%s=r.%s()",c,l),s("break")("}")}for(s("default:")("r.skipType(t&7)")("break")("}")("}"),a=0;a<i._fieldsArray.length;++a){var u=i._fieldsArray[a];u.required&&s("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",n(u))}return s("return m")};var e=require_enum(),t=requireTypes(),r=requireUtil$1();function n(e){return"missing required '"+e.name+"'"}return decoder_1}function requireVerifier(){if(hasRequiredVerifier)return verifier_1;hasRequiredVerifier=1,verifier_1=function(e){var s=t.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),a=e.oneofsArray,o={};a.length&&s("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var c=e._fieldsArray[l].resolve(),u="m"+t.safeProp(c.name);if(c.optional&&s("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)s("if(!util.isObject(%s))",u)("return%j",r(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),i(s,c,"k[i]"),n(s,c,l,u+"[k[i]]")("}");else if(c.repeated)s("if(!Array.isArray(%s))",u)("return%j",r(c,"array"))("for(var i=0;i<%s.length;++i){",u),n(s,c,l,u+"[i]")("}");else{if(c.partOf){var h=t.safeProp(c.partOf.name);1===o[c.partOf.name]&&s("if(p%s===1)",h)("return%j",c.partOf.name+": multiple values"),o[c.partOf.name]=1,s("p%s=1",h)}n(s,c,l,u)}c.optional&&s("}")}return s("return null")};var e=require_enum(),t=requireUtil$1();function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function n(t,n,i,s){if(n.resolvedType)if(n.resolvedType instanceof e){t("switch(%s){",s)("default:")("return%j",r(n,"enum value"));for(var a=Object.keys(n.resolvedType.values),o=0;o<a.length;++o)t("case %i:",n.resolvedType.values[a[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",i,s)("if(e)")("return%j+e",n.name+".")("}");else switch(n.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",s)("return%j",r(n,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",s,s,s,s)("return%j",r(n,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',s)("return%j",r(n,"number"));break;case"bool":t('if(typeof %s!=="boolean")',s)("return%j",r(n,"boolean"));break;case"string":t("if(!util.isString(%s))",s)("return%j",r(n,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',s,s,s)("return%j",r(n,"buffer"))}return t}function i(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",r(t,"boolean key"))}return e}return verifier_1}var converter={},hasRequiredConverter;function requireConverter(){return hasRequiredConverter||(hasRequiredConverter=1,function(e){var t=e,r=require_enum(),n=requireUtil$1();function i(e,t,n,i){var s=!1;if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",i);for(var a=t.resolvedType.values,o=Object.keys(a),l=0;l<o.length;++l)a[o[l]]!==t.typeDefault||s||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',i,i,i),t.repeated||e("break"),s=!0),e("case%j:",o[l])("case %i:",a[o[l]])("m%s=%j",i,a[o[l]])("break");e("}")}else e('if(typeof d%s!=="object")',i)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,n,i);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,c)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length >= 0)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function s(e,t,n,i){if(t.resolvedType)t.resolvedType instanceof r?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",i,n,i,i,n,i,i):e("d%s=types[%i].toObject(m%s,o)",i,n,i);else{var s=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,s?"true":"",i);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}t.fromObject=function(e){var t=e.fieldsArray,s=n.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return s("return new this.ctor");s("var m=new this.ctor");for(var a=0;a<t.length;++a){var o=t[a].resolve(),l=n.safeProp(o.name);o.map?(s("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",o.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),i(s,o,a,l+"[ks[i]]")("}")("}")):o.repeated?(s("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",o.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),i(s,o,a,l+"[i]")("}")("}")):(o.resolvedType instanceof r||s("if(d%s!=null){",l),i(s,o,a,l),o.resolvedType instanceof r||s("}"))}return s("return m")},t.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);if(!t.length)return n.codegen()("return {}");for(var i=n.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),a=[],o=[],l=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?a:t[c].map?o:l).push(t[c]);if(a.length){for(i("if(o.arrays||o.defaults){"),c=0;c<a.length;++c)i("d%s=[]",n.safeProp(a[c].name));i("}")}if(o.length){for(i("if(o.objects||o.defaults){"),c=0;c<o.length;++c)i("d%s={}",n.safeProp(o[c].name));i("}")}if(l.length){for(i("if(o.defaults){"),c=0;c<l.length;++c){var u=l[c],h=n.safeProp(u.name);if(u.resolvedType instanceof r)i("d%s=o.enums===String?%j:%j",h,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)i("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",h)("}else")("d%s=o.longs===String?%j:%i",h,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var d="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";i("if(o.bytes===String)d%s=%j",h,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",h,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",h,h)("}")}else i("d%s=%j",h,u.typeDefault)}i("}")}var p=!1;for(c=0;c<t.length;++c){u=t[c];var f=e._fieldsArray.indexOf(u);h=n.safeProp(u.name);u.map?(p||(p=!0,i("var ks2")),i("if(m%s&&(ks2=Object.keys(m%s)).length){",h,h)("d%s={}",h)("for(var j=0;j<ks2.length;++j){"),s(i,u,f,h+"[ks2[j]]")("}")):u.repeated?(i("if(m%s&&m%s.length){",h,h)("d%s=[]",h)("for(var j=0;j<m%s.length;++j){",h),s(i,u,f,h+"[j]")("}")):(i("if(m%s!=null&&m.hasOwnProperty(%j)){",h,u.name),s(i,u,f,h),u.partOf&&i("if(o.oneofs)")("d%s=%j",n.safeProp(u.partOf.name),u.name)),i("}")}return i("return d")}}(converter)),converter}var wrappers={},hasRequiredWrappers,type,hasRequiredType,root,hasRequiredRoot,hasRequiredUtil$1,hasRequiredTypes,field,hasRequiredField,oneof,hasRequiredOneof,object,hasRequiredObject,_enum,hasRequired_enum,encoder_1,hasRequiredEncoder,hasRequiredIndexLight,tokenize_1,hasRequiredTokenize,parse_1,hasRequiredParse,common_1,hasRequiredCommon,hasRequiredSrc$2,protobufjs,hasRequiredProtobufjs;function requireWrappers(){return hasRequiredWrappers||(hasRequiredWrappers=1,function(e){var t=e,r=requireMessage();t[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var s=this.lookup(i);s&&(e=s.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof r){var a=e.$type.toObject(e,t);return""===n&&(n="type.googleapis.com/"),i=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=i,a}return this.toObject(e,t)}}}(wrappers)),wrappers}function requireType(){if(hasRequiredType)return type;hasRequiredType=1,type=g;var e=requireNamespace();((g.prototype=Object.create(e.prototype)).constructor=g).className="Type";var t=require_enum(),r=requireOneof(),n=requireField(),i=requireMapfield(),s=requireService(),a=requireMessage(),o=requireReader(),l=requireWriter(),c=requireUtil$1(),u=requireEncoder(),h=requireDecoder(),d=requireVerifier(),p=requireConverter(),f=requireWrappers();function g(t,r){e.call(this,t,r),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}return Object.defineProperties(g.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=c.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=c.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=g.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof a||((e.prototype=new a).constructor=e,c.merge(e.prototype,t)),e.$type=e.prototype.$type=this,c.merge(e,a,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:c.oneOfGetter(this._oneofsArray[r].oneof),set:c.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),g.generateConstructor=function(e){for(var t,r=c.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",c.safeProp(t.name)):t.repeated&&r("this%s=[]",c.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},g.fromJSON=function(a,o){var l=new g(a,o.options);l.extensions=o.extensions,l.reserved=o.reserved;for(var c=Object.keys(o.fields),u=0;u<c.length;++u)l.add((void 0!==o.fields[c[u]].keyType?i.fromJSON:n.fromJSON)(c[u],o.fields[c[u]]));if(o.oneofs)for(c=Object.keys(o.oneofs),u=0;u<c.length;++u)l.add(r.fromJSON(c[u],o.oneofs[c[u]]));if(o.nested)for(c=Object.keys(o.nested),u=0;u<c.length;++u){var h=o.nested[c[u]];l.add((void 0!==h.id?n.fromJSON:void 0!==h.fields?g.fromJSON:void 0!==h.values?t.fromJSON:void 0!==h.methods?s.fromJSON:e.fromJSON)(c[u],h))}return o.extensions&&o.extensions.length&&(l.extensions=o.extensions),o.reserved&&o.reserved.length&&(l.reserved=o.reserved),o.group&&(l.group=!0),o.comment&&(l.comment=o.comment),o.edition&&(l._edition=o.edition),l._defaultEdition="proto3",l},g.prototype.toJSON=function(t){var r=e.prototype.toJSON.call(this,t),n=!!t&&Boolean(t.keepComments);return c.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",e.arrayToJSON(this.oneofsArray,t),"fields",e.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])},g.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;e.prototype.resolveAll.call(this);var t=this.oneofsArray;for(n=0;n<t.length;)t[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this},g.prototype._resolveFeaturesRecursive=function(t){return this._needsRecursiveFeatureResolution?(t=this._edition||t,e.prototype._resolveFeaturesRecursive.call(this,t),this.oneofsArray.forEach(e=>{e._resolveFeatures(t)}),this.fieldsArray.forEach(e=>{e._resolveFeatures(t)}),this):this},g.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},g.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof n&&void 0===t.extend){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),v(this)}return t instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),v(this)):e.prototype.add.call(this,t)},g.prototype.remove=function(t){if(t instanceof n&&void 0===t.extend){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),v(this)}if(t instanceof r){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),v(this)}return e.prototype.remove.call(this,t)},g.prototype.isReservedId=function(t){return e.isReservedId(this.reserved,t)},g.prototype.isReservedName=function(t){return e.isReservedName(this.reserved,t)},g.prototype.create=function(e){return new this.ctor(e)},g.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=u(this)({Writer:l,types:t,util:c}),this.decode=h(this)({Reader:o,types:t,util:c}),this.verify=d(this)({types:t,util:c}),this.fromObject=p.fromObject(this)({types:t,util:c}),this.toObject=p.toObject(this)({types:t,util:c});var n=f[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},g.prototype.encode=function(e,t){return this.setup().encode(e,t)},g.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},g.prototype.decode=function(e,t){return this.setup().decode(e,t)},g.prototype.decodeDelimited=function(e){return e instanceof o||(e=o.create(e)),this.decode(e,e.uint32())},g.prototype.verify=function(e){return this.setup().verify(e)},g.prototype.fromObject=function(e){return this.setup().fromObject(e)},g.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},g.d=function(e){return function(t){c.decorateType(t,e)}},type}function requireRoot(){if(hasRequiredRoot)return root;hasRequiredRoot=1,root=l;var e=requireNamespace();((l.prototype=Object.create(e.prototype)).constructor=l).className="Root";var t,r,n,i=requireField(),s=require_enum(),a=requireOneof(),o=requireUtil$1();function l(t){e.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function c(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},l.prototype.resolvePath=o.path.resolve,l.prototype.fetch=o.fetch,l.prototype.load=function e(t,i,s){"function"==typeof i&&(s=i,i=void 0);var a=this;if(!s)return o.asPromise(e,a,t,i);var l=s===c;function u(e,t){if(s){if(l)throw e;t&&t.resolveAll();var r=s;s=null,r(e,t)}}function h(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in n)return r}return null}function d(e,t){try{if(o.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),o.isString(t)){r.filename=e;var n,s=r(t,a,i),c=0;if(s.imports)for(;c<s.imports.length;++c)(n=h(s.imports[c])||a.resolvePath(e,s.imports[c]))&&p(n);if(s.weakImports)for(c=0;c<s.weakImports.length;++c)(n=h(s.weakImports[c])||a.resolvePath(e,s.weakImports[c]))&&p(n,!0)}else a.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}l||f||u(null,a)}function p(e,t){if(e=h(e)||e,!(a.files.indexOf(e)>-1))if(a.files.push(e),e in n)l?d(e,n[e]):(++f,setTimeout(function(){--f,d(e,n[e])}));else if(l){var r;try{r=o.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}d(e,r)}else++f,a.fetch(e,function(r,n){--f,s&&(r?t?f||u(null,a):u(r):d(e,n))})}var f=0;o.isString(t)&&(t=[t]);for(var g,v=0;v<t.length;++v)(g=a.resolvePath("",t[v]))&&p(g);return l?(a.resolveAll(),a):(f||u(null,a),a)},l.prototype.loadSync=function(e,t){if(!o.isNode)throw Error("not supported");return this.load(e,t,c)},l.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return e.prototype.resolveAll.call(this)};var u=/^[A-Z]/;function h(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new i(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(n.name)||(n.declaringField=t,t.extensionField=n,r.add(n)),!0}return!1}return l.prototype._handleAdd=function(e){if(e instanceof i)void 0===e.extend||e.extensionField||h(0,e)||this.deferred.push(e);else if(e instanceof s)u.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof t)for(var r=0;r<this.deferred.length;)h(0,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);u.test(e.name)&&(e.parent[e.name]=e)}(e instanceof t||e instanceof s||e instanceof i)&&(this._fullyQualifiedObjects[e.fullName]=e)},l.prototype._handleRemove=function(t){if(t instanceof i){if(void 0!==t.extend)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var r=this.deferred.indexOf(t);r>-1&&this.deferred.splice(r,1)}}else if(t instanceof s)u.test(t.name)&&delete t.parent[t.name];else if(t instanceof e){for(var n=0;n<t.nestedArray.length;++n)this._handleRemove(t._nestedArray[n]);u.test(t.name)&&delete t.parent[t.name]}delete this._fullyQualifiedObjects[t.fullName]},l._configure=function(e,i,s){t=e,r=i,n=s},root}function requireUtil$1(){if(hasRequiredUtil$1)return util$1.exports;hasRequiredUtil$1=1;var e,t,r=util$1.exports=requireMinimal(),n=requireRoots();r.codegen=requireCodegen(),r.fetch=requireFetch(),r.path=requirePath(),r.fs=r.inquire("fs"),r.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},r.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var i=/\\/g,s=/"/g;r.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},r.safeProp=function(e){return!/^[$\w_]+$/.test(e)||r.isReserved(e)?'["'+e.replace(i,"\\\\").replace(s,'\\"')+'"]':"."+e},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var a=/_([a-z])/g;r.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(a,function(e,t){return t.toUpperCase()})},r.compareFieldsById=function(e,t){return e.id-t.id},r.decorateType=function(t,n){if(t.$type)return n&&t.$type.name!==n&&(r.decorateRoot.remove(t.$type),t.$type.name=n,r.decorateRoot.add(t.$type)),t.$type;e||(e=requireType());var i=new e(n||t.name);return r.decorateRoot.add(i),i.ctor=t,Object.defineProperty(t,"$type",{value:i,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:i,enumerable:!1}),i};var o=0;return r.decorateEnum=function(e){if(e.$type)return e.$type;t||(t=require_enum());var n=new t("Enum"+o++,e);return r.decorateRoot.add(n),Object.defineProperty(e,"$type",{value:n,enumerable:!1}),n},r.setProperty=function(e,t,r,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,i){var s=r.shift();if("__proto__"===s||"prototype"===s)return t;if(r.length>0)t[s]=e(t[s]||{},r,i);else{var a=t[s];if(a&&n)return t;a&&(i=[].concat(a).concat(i)),t[s]=i}return t}(e,t=t.split("."),r)},Object.defineProperty(r,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(requireRoot()))}}),util$1.exports}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(e){var t=e,r=requireUtil$1(),n=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function i(e,t){var r=0,i={};for(t|=0;r<e.length;)i[n[r+t]]=e[r++];return i}t.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),t.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",r.emptyArray,null]),t.long=i([0,0,0,1,1],7),t.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),t.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])}(types)),types}function requireField(){if(hasRequiredField)return field;hasRequiredField=1,field=a;var e=requireObject();((a.prototype=Object.create(e.prototype)).constructor=a).className="Field";var t,r=require_enum(),n=requireTypes(),i=requireUtil$1(),s=/^required|optional|repeated$/;function a(t,r,a,o,l,c,u){if(i.isObject(o)?(u=l,c=o,o=l=void 0):i.isObject(l)&&(u=c,c=l,l=void 0),e.call(this,t,c),!i.isInteger(r)||r<0)throw TypeError("id must be a non-negative integer");if(!i.isString(a))throw TypeError("type must be a string");if(void 0!==o&&!s.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==l&&!i.isString(l))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=a,this.id=r,this.extend=l||void 0,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!i.Long&&void 0!==n.long[a],this.bytes="bytes"===a,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}return a.fromJSON=function(e,t){var r=new a(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},Object.defineProperty(a.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(a.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(a.prototype,"delimited",{get:function(){return this.resolvedType instanceof t&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(a.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(a.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),a.prototype.setOption=function(t,r,n){return e.prototype.setOption.call(this,t,r,n)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof t?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof r||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=i.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var s;i.base64.test(this.typeDefault)?i.base64.decode(this.typeDefault,s=i.newBuffer(i.base64.length(this.typeDefault)),0):i.utf8.write(this.typeDefault,s=i.newBuffer(i.utf8.length(this.typeDefault)),0),this.typeDefault=s}return this.map?this.defaultValue=i.emptyObject:this.repeated?this.defaultValue=i.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof t&&(this.parent.ctor.prototype[this.name]=this.defaultValue),e.prototype.resolve.call(this)},a.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var r={};if("required"===this.rule&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===n.defaults[this.type]){var i=this.parent.get(this.type.split(".").pop());i&&i instanceof t&&i.group&&(r.message_encoding="DELIMITED")}return!0===this.getOption("packed")?r.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(r.repeated_field_encoding="EXPANDED"),r},a.prototype._resolveFeatures=function(t){return e.prototype._resolveFeatures.call(this,this._edition||t)},a.d=function(e,t,r,n){return"function"==typeof t?t=i.decorateType(t).name:t&&"object"==typeof t&&(t=i.decorateEnum(t).name),function(s,o){i.decorateType(s.constructor).add(new a(o,e,t,r,{default:n}))}},a._configure=function(e){t=e},field}function requireOneof(){if(hasRequiredOneof)return oneof;hasRequiredOneof=1,oneof=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="OneOf";var t=requireField(),r=requireUtil$1();function n(t,r,n,i){if(Array.isArray(r)||(n=r,r=void 0),e.call(this,t,n),void 0!==r&&!Array.isArray(r))throw TypeError("fieldNames must be an Array");this.oneof=r||[],this.fieldsArray=[],this.comment=i}function i(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}return n.fromJSON=function(e,t){return new n(e,t.oneof,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},n.prototype.add=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,i(this),this},n.prototype.remove=function(e){if(!(e instanceof t))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),(r=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(r,1),e.partOf=null,this},n.prototype.onAdd=function(t){e.prototype.onAdd.call(this,t);for(var r=0;r<this.oneof.length;++r){var n=t.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}i(this)},n.prototype.onRemove=function(t){for(var r,n=0;n<this.fieldsArray.length;++n)(r=this.fieldsArray[n]).parent&&r.parent.remove(r);e.prototype.onRemove.call(this,t)},Object.defineProperty(n.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),n.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,i){r.decorateType(t.constructor).add(new n(i,e)),Object.defineProperty(t,i,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}},oneof}function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=a,a.className="ReflectionObject";const e=requireOneof();var t,r=requireUtil$1(),n={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},i={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},s={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function a(e,t){if(!r.isString(e))throw TypeError("name must be a string");if(t&&!r.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(a.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),a.prototype.toJSON=function(){throw Error()},a.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof t&&r._handleAdd(this)},a.prototype.onRemove=function(e){var r=e.root;r instanceof t&&r._handleRemove(this),this.parent=null,this.resolved=!1},a.prototype.resolve=function(){return this.resolved||this.root instanceof t&&(this.resolved=!0),this},a.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},a.prototype._resolveFeatures=function(t){if(!this._featuresResolved){var r={};if(!t)throw new Error("Unknown edition for "+this.fullName);var a=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(t));if(this._edition){if("proto2"===t)r=Object.assign({},i);else if("proto3"===t)r=Object.assign({},s);else{if("2023"!==t)throw new Error("Unknown edition: "+t);r=Object.assign({},n)}return this._features=Object.assign(r,a||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof e){var o=Object.assign({},this.partOf._features);this._features=Object.assign(o,a||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var l=Object.assign({},this.parent._features);this._features=Object.assign(l,a||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},a.prototype._inferLegacyProtoFeatures=function(){return{}},a.prototype.getOption=function(e){if(this.options)return this.options[e]},a.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?r.setProperty(this.options,e,t,n):n&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},a.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var s=i.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(s){var a=s[e];r.setProperty(a,n,t)}else(s={})[e]=r.setProperty({},n,t),i.push(s)}else{var o={};o[e]=t,i.push(o)}return this},a.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},a.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},a.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},a._configure=function(e){t=e},object}function require_enum(){if(hasRequired_enum)return _enum;hasRequired_enum=1,_enum=n;var e=requireObject();((n.prototype=Object.create(e.prototype)).constructor=n).className="Enum";var t=requireNamespace(),r=requireUtil$1();function n(t,r,n,i,s,a){if(e.call(this,t,n),r&&"object"!=typeof r)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,r)for(var o=Object.keys(r),l=0;l<o.length;++l)"number"==typeof r[o[l]]&&(this.valuesById[this.values[o[l]]=r[o[l]]]=o[l])}return n.prototype._resolveFeatures=function(t){return t=this._edition||t,e.prototype._resolveFeatures.call(this,t),Object.keys(this.values).forEach(e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)}),this},n.fromJSON=function(e,t){var r=new n(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,t.edition&&(r._edition=t.edition),r._defaultEdition="proto3",r},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},n.prototype.add=function(e,t,n,i){if(!r.isString(e))throw TypeError("name must be a string");if(!r.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return i&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=i||null),this.comments[e]=n||null,this},n.prototype.remove=function(e){if(!r.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},n.prototype.isReservedId=function(e){return t.isReservedId(this.reserved,e)},n.prototype.isReservedName=function(e){return t.isReservedName(this.reserved,e)},_enum}function requireEncoder(){if(hasRequiredEncoder)return encoder_1;hasRequiredEncoder=1,encoder_1=function(i){for(var s,a=r.codegen(["m","w"],i.name+"$encode")("if(!w)")("w=Writer.create()"),o=i.fieldsArray.slice().sort(r.compareFieldsById),l=0;l<o.length;++l){var c=o[l].resolve(),u=i._fieldsArray.indexOf(c),h=c.resolvedType instanceof e?"int32":c.type,d=t.basic[h];s="m"+r.safeProp(c.name),c.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",s,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",s)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|t.mapKey[c.keyType],c.keyType),void 0===d?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,s):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,h,s),a("}")("}")):c.repeated?(a("if(%s!=null&&%s.length){",s,s),c.packed&&void 0!==t.packed[h]?a("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",s)("w.%s(%s[i])",h,s)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",s),void 0===d?n(a,c,u,s+"[i]"):a("w.uint32(%i).%s(%s[i])",(c.id<<3|d)>>>0,h,s)),a("}")):(c.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",s,c.name),void 0===d?n(a,c,u,s):a("w.uint32(%i).%s(%s)",(c.id<<3|d)>>>0,h,s))}return a("return w")};var e=require_enum(),t=requireTypes(),r=requireUtil$1();function n(e,t,r,n){return t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}return encoder_1}function requireIndexLight(){if(hasRequiredIndexLight)return indexLight.exports;hasRequiredIndexLight=1;var e=indexLight.exports=requireIndexMinimal();return e.build="light",e.load=function(t,r,n){return"function"==typeof r?(n=r,r=new e.Root):r||(r=new e.Root),r.load(t,n)},e.loadSync=function(t,r){return r||(r=new e.Root),r.loadSync(t)},e.encoder=requireEncoder(),e.decoder=requireDecoder(),e.verifier=requireVerifier(),e.converter=requireConverter(),e.ReflectionObject=requireObject(),e.Namespace=requireNamespace(),e.Root=requireRoot(),e.Enum=require_enum(),e.Type=requireType(),e.Field=requireField(),e.OneOf=requireOneof(),e.MapField=requireMapfield(),e.Service=requireService(),e.Method=requireMethod(),e.Message=requireMessage(),e.wrappers=requireWrappers(),e.types=requireTypes(),e.util=requireUtil$1(),e.ReflectionObject._configure(e.Root),e.Namespace._configure(e.Type,e.Service,e.Enum),e.Root._configure(e.Type),e.Field._configure(e.Type),indexLight.exports}function requireTokenize(){if(hasRequiredTokenize)return tokenize_1;hasRequiredTokenize=1,tokenize_1=u;var e=/[\s{}=;:[\],'"()<>]/g,t=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,s=/\n/g,a=/\s/,o=/\\(.?)/g,l={0:"\0",r:"\r",n:"\n",t:"\t"};function c(e){return e.replace(o,function(e,t){switch(t){case"\\":case"":return t;default:return l[t]||""}})}function u(o,l){o=o.toString();var u=0,h=o.length,d=1,p=0,f={},g=[],v=null;function m(e){return Error("illegal "+e+" (line "+d+")")}function A(e){return o.charAt(e)}function y(e,t,r){var a,c={type:o.charAt(e++),lineEmpty:!1,leading:r},u=e-(l?2:3);do{if(--u<0||"\n"===(a=o.charAt(u))){c.lineEmpty=!0;break}}while(" "===a||"\t"===a);for(var h=o.substring(e,t).split(s),g=0;g<h.length;++g)h[g]=h[g].replace(l?i:n,"").trim();c.text=h.join("\n").trim(),f[d]=c,p=d}function C(e){var t=S(e),r=o.substring(e,t);return/^\s*\/\//.test(r)}function S(e){for(var t=e;t<h&&"\n"!==A(t);)t++;return t}function E(){if(g.length>0)return g.shift();if(v)return function(){var e="'"===v?r:t;e.lastIndex=u-1;var n=e.exec(o);if(!n)throw m("string");return u=e.lastIndex,_(v),v=null,c(n[1])}();var n,i,s,p,f,E=0===u;do{if(u===h)return null;for(n=!1;a.test(s=A(u));)if("\n"===s&&(E=!0,++d),++u===h)return null;if("/"===A(u)){if(++u===h)throw m("comment");if("/"===A(u))if(l){if(p=u,f=!1,C(u-1)){f=!0;do{if((u=S(u))===h)break;if(u++,!E)break}while(C(u))}else u=Math.min(h,S(u)+1);f&&(y(p,u,E),E=!0),d++,n=!0}else{for(f="/"===A(p=u+1);"\n"!==A(++u);)if(u===h)return null;++u,f&&(y(p,u-1,E),E=!0),++d,n=!0}else{if("*"!==(s=A(u)))return"/";p=u+1,f=l||"*"===A(p);do{if("\n"===s&&++d,++u===h)throw m("comment");i=s,s=A(u)}while("*"!==i||"/"!==s);++u,f&&(y(p,u-2,E),E=!0),n=!0}}}while(n);var b=u;if(e.lastIndex=0,!e.test(A(b++)))for(;b<h&&!e.test(A(b));)++b;var T=o.substring(u,u=b);return'"'!==T&&"'"!==T||(v=T),T}function _(e){g.push(e)}function b(){if(!g.length){var e=E();if(null===e)return null;_(e)}return g[0]}return Object.defineProperty({next:E,peek:b,push:_,skip:function(e,t){var r=b();if(r===e)return E(),!0;if(!t)throw m("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=f[d-1],delete f[d-1],t&&(l||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(p<e&&b(),t=f[e],delete f[e],!t||t.lineEmpty||!l&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return d}})}return u.unescape=c,tokenize_1}function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1,parse_1=S,S.filename=null,S.defaults={keepCase:!1};var e=requireTokenize(),t=requireRoot(),r=requireType(),n=requireField(),i=requireMapfield(),s=requireOneof(),a=require_enum(),o=requireService(),l=requireMethod(),c=requireObject(),u=requireTypes(),h=requireUtil$1(),d=/^[1-9][0-9]*$/,p=/^-?[1-9][0-9]*$/,f=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,m=/^-?0[0-7]+$/,A=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,y=/^[a-zA-Z_][a-zA-Z_0-9]*$/,C=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function S(E,_,b){_ instanceof t||(b=_,_=new t),b||(b=S.defaults);var T,R,x,w,k=b.preferTrailingComment||!1,N=e(E,b.alternateCommentMode||!1),I=N.next,O=N.push,P=N.peek,j=N.skip,L=N.cmnt,q=!0,M="proto2",D=_,F=[],B={},U=b.keepCase?function(e){return e}:h.camelCase;function $(e,t,r){var n=S.filename;return r||(S.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+N.line+")")}function z(){var e,t=[];do{if('"'!==(e=I())&&"'"!==e)throw $(e);t.push(I()),j(e),e=P()}while('"'===e||"'"===e);return t.join("")}function H(e){var t=I();switch(t){case"'":case'"':return O(t),z();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(d.test(e))return r*parseInt(e,10);if(f.test(e))return r*parseInt(e,16);if(v.test(e))return r*parseInt(e,8);if(A.test(e))return r*parseFloat(e);throw $(e,"number",t)}(t,!0)}catch(e){if(C.test(t))return t;throw $(t,"value")}}function W(e,t){var r,n;do{if(!t||'"'!==(r=P())&&"'"!==r)try{e.push([n=G(I()),j("to",!0)?G(I()):n])}catch(n){if(!(t&&C.test(r)&&M>=2023))throw n;e.push(r)}else{var i=z();if(e.push(i),M>=2023)throw $(i,"id")}}while(j(",",!0));var s={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Q(s,function(e){if("option"!==e)throw $(e);re(s,e),j(";")},function(){se(s)})}function G(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw $(e,"id");if(p.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(m.test(e))return parseInt(e,8);throw $(e,"id")}function V(){if(void 0!==T)throw $("package");if(T=I(),!C.test(T))throw $(T,"name");D=D.define(T),j(";")}function Y(){var e,t=P();switch(t){case"weak":e=x||(x=[]),I();break;case"public":I();default:e=R||(R=[])}t=z(),j(";"),e.push(t)}function K(){if(j("="),(M=z())<2023)throw $(M,"syntax");j(";")}function J(){j("="),M=z();if(!["2023"].includes(M))throw $(M,"edition");j(";")}function X(e,t){switch(t){case"option":return re(e,t),j(";"),!0;case"message":return Z(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!y.test(t=I()))throw $(t,"service name");var r=new o(t);Q(r,function(e){if(!X(r,e)){if("rpc"!==e)throw $(e);!function(e,t){var r=L(),n=t;if(!y.test(t=I()))throw $(t,"name");var i,s,a,o,c=t;j("("),j("stream",!0)&&(s=!0);if(!C.test(t=I()))throw $(t);i=t,j(")"),j("returns"),j("("),j("stream",!0)&&(o=!0);if(!C.test(t=I()))throw $(t);a=t,j(")");var u=new l(c,n,i,a,s,o);u.comment=r,Q(u,function(e){if("option"!==e)throw $(e);re(u,e),j(";")}),e.add(u)}(r,e)}}),e.add(r),e===D&&F.push(r)}(e,t),!0;case"extend":return function(e,t){if(!C.test(t=I()))throw $(t,"reference");var r=t;Q(null,function(t){switch(t){case"required":case"repeated":ee(e,t,r);break;case"optional":ee(e,"proto3"===M?"proto3_optional":"optional",r);break;default:if("proto2"===M||!C.test(t))throw $(t);O(t),ee(e,"optional",r)}})}(e,t),!0}return!1}function Q(e,t,r){var n=N.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=S.filename),j("{",!0)){for(var i;"}"!==(i=I());)t(i);j(";",!0)}else r&&r(),j(";"),e&&("string"!=typeof e.comment||k)&&(e.comment=L(n)||e.comment)}function Z(e,t){if(!y.test(t=I()))throw $(t,"type name");var n=new r(t);Q(n,function(e){if(!X(n,e))switch(e){case"map":!function(e){j("<");var t=I();if(void 0===u.mapKey[t])throw $(t,"type");j(",");var r=I();if(!C.test(r))throw $(r,"type");j(">");var n=I();if(!y.test(n))throw $(n,"name");j("=");var s=new i(U(n),G(I()),t,r);Q(s,function(e){if("option"!==e)throw $(e);re(s,e),j(";")},function(){se(s)}),e.add(s)}(n);break;case"required":if("proto2"!==M)throw $(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===M)ee(n,"proto3_optional");else{if("proto2"!==M)throw $(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!y.test(t=I()))throw $(t,"name");var r=new s(U(t));Q(r,function(e){"option"===e?(re(r,e),j(";")):(O(e),ee(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":W(n.extensions||(n.extensions=[]));break;case"reserved":W(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===M||!C.test(e))throw $(e);O(e),ee(n,"optional")}}),e.add(n),e===D&&F.push(n)}function ee(e,t,i){var a=I();if("group"!==a){for(;a.endsWith(".")||P().startsWith(".");)a+=I();if(!C.test(a))throw $(a,"type");var o=I();if(!y.test(o))throw $(o,"name");o=U(o),j("=");var l=new n(o,G(I()),a,t,i);if(Q(l,function(e){if("option"!==e)throw $(e);re(l,e),j(";")},function(){se(l)}),"proto3_optional"===t){var c=new s("_"+o);l.setOption("proto3_optional",!0),c.add(l),e.add(c)}else e.add(l);e===D&&F.push(l)}else!function(e,t){if(M>=2023)throw $("group");var i=I();if(!y.test(i))throw $(i,"name");var s=h.lcFirst(i);i===s&&(i=h.ucFirst(i));j("=");var a=G(I()),o=new r(i);o.group=!0;var l=new n(s,a,i,t);l.filename=S.filename,Q(o,function(e){switch(e){case"option":re(o,e),j(";");break;case"required":case"repeated":ee(o,e);break;case"optional":ee(o,"proto3"===M?"proto3_optional":"optional");break;case"message":Z(o,e);break;case"enum":te(o,e);break;case"reserved":W(o.reserved||(o.reserved=[]),!0);break;default:throw $(e)}}),e.add(o).add(l)}(e,t)}function te(e,t){if(!y.test(t=I()))throw $(t,"name");var r=new a(t);Q(r,function(e){switch(e){case"option":re(r,e),j(";");break;case"reserved":W(r.reserved||(r.reserved=[]),!0),void 0===r.reserved&&(r.reserved=[]);break;default:!function(e,t){if(!y.test(t))throw $(t,"name");j("=");var r=G(I(),!0),n={options:void 0,getOption:function(e){return this.options[e]}};n.setOption=function(e,t){c.prototype.setOption.call(n,e,t)},n.setParsedOption=function(){},Q(n,function(e){if("option"!==e)throw $(e);re(n,e),j(";")},function(){se(n)}),e.add(t,r,n.comment,n.parsedOptions||n.options)}(r,e)}}),e.add(r),e===D&&F.push(r)}function re(e,t){var r,n,i=!0;for("option"===t&&(t=I());"="!==t;){if("("===t){var s=I();j(")"),t="("+s+")"}if(i){if(i=!1,t.includes(".")&&!t.includes("(")){var a=t.split(".");r=a[0]+".",t=a[1];continue}r=t}else n=n?n+=t:t;t=I()}var o=ne(e,n?r.concat(n):r);n=n&&"."===n[0]?n.slice(1):n,function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,r=r&&"."===r[r.length-1]?r.slice(0,-1):r,o,n)}function ne(e,t){if(j("{",!0)){for(var r={};!j("}",!0);){if(!y.test(w=I()))throw $(w,"name");if(null===w)throw $(w,"end of input");var n,i=w;if(j(":",!0),"{"===P())n=ne(e,t+"."+w);else if("["===P()){var s;if(n=[],j("[",!0)){do{s=H(),n.push(s)}while(j(",",!0));j("]"),void 0!==s&&ie(e,t+"."+w,s)}}else n=H(),ie(e,t+"."+w,n);var a=r[i];a&&(n=[].concat(a).concat(n)),r[i]=n,j(",",!0),j(";",!0)}return r}var o=H();return ie(e,t,o),o}function ie(e,t,r){D===e&&/^features\./.test(t)?B[t]=r:e.setOption&&e.setOption(t,r)}function se(e){if(j("[",!0)){do{re(e,"option")}while(j(",",!0));j("]")}return e}for(;null!==(w=I());)switch(w){case"package":if(!q)throw $(w);V();break;case"import":if(!q)throw $(w);Y();break;case"syntax":if(!q)throw $(w);K();break;case"edition":if(!q)throw $(w);J();break;case"option":re(D,w),j(";",!0);break;default:if(X(D,w)){q=!1;continue}throw $(w)}return F.forEach(e=>{e._edition=M,Object.keys(B).forEach(t=>{void 0===e.getOption(t)&&e.setOption(t,B[t],!0)})}),S.filename=null,{package:T,imports:R,weakImports:x,root:_}}return parse_1}function requireCommon(){if(hasRequiredCommon)return common_1;hasRequiredCommon=1,common_1=r;var e,t=/\/|\./;function r(e,n){t.test(e)||(e="google/protobuf/"+e+".proto",n={nested:{google:{nested:{protobuf:{nested:n}}}}}),r[e]=n}return r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:e={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:e}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null},common_1}function requireSrc$2(){if(hasRequiredSrc$2)return src.exports;hasRequiredSrc$2=1;var e=src.exports=requireIndexLight();return e.build="full",e.tokenize=requireTokenize(),e.parse=requireParse(),e.common=requireCommon(),e.Root._configure(e.Type,e.parse,e.common),src.exports}function requireProtobufjs(){return hasRequiredProtobufjs?protobufjs:(hasRequiredProtobufjs=1,protobufjs=requireSrc$2())}var descriptor={exports:{}},nested$3={google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}},require$$4={nested:nested$3},hasRequiredDescriptor;function requireDescriptor(){return hasRequiredDescriptor||(hasRequiredDescriptor=1,function(e,t){var r=requireProtobufjs();e.exports=t=r.descriptor=r.Root.fromJSON(require$$4).lookup(".google.protobuf");var n=r.Namespace,i=r.Root,s=r.Enum,a=r.Type,o=r.Field,l=r.MapField,c=r.OneOf,u=r.Service,h=r.Method;function d(e,r,l){var c=t.FileDescriptorProto.create({name:e.filename||(e.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});!function(e,r){if(!e)return;if("proto2"===e||"proto3"===e)r.syntax=e;else{if(r.syntax="editions","2023"!==e)throw new Error("Unsupported edition "+e);r.edition=t.Edition.EDITION_2023}}(l,c),e instanceof i||(c.package=e.fullName.substring(1));for(var h,p=0;p<e.nestedArray.length;++p)(h=e._nestedArray[p])instanceof a?c.messageType.push(h.toDescriptor(l)):h instanceof s?c.enumType.push(h.toDescriptor()):h instanceof o?c.extension.push(h.toDescriptor(l)):h instanceof u?c.service.push(h.toDescriptor()):h instanceof n&&d(h,r,l);c.options=_(e.options,t.FileOptions),c.messageType.length+c.enumType.length+c.extension.length+c.service.length&&r.push(c)}i.fromDescriptor=function(e){"number"==typeof e.length&&(e=t.FileDescriptorSet.decode(e));var r=new i;if(e.file)for(var n,l,c,h=0;h<e.file.length;++h){l=r,(n=e.file[h]).package&&n.package.length&&(l=r.define(n.package));var d=R(n);if(n.name&&n.name.length&&r.files.push(l.filename=n.name),n.messageType)for(c=0;c<n.messageType.length;++c)l.add(a.fromDescriptor(n.messageType[c],d));if(n.enumType)for(c=0;c<n.enumType.length;++c)l.add(s.fromDescriptor(n.enumType[c],d));if(n.extension)for(c=0;c<n.extension.length;++c)l.add(o.fromDescriptor(n.extension[c],d));if(n.service)for(c=0;c<n.service.length;++c)l.add(u.fromDescriptor(n.service[c],d));var p=S(n.options,t.FileOptions);if(p){var f=Object.keys(p);for(c=0;c<f.length;++c)l.setOption(f[c],p[f[c]])}}return r.resolveAll()},i.prototype.toDescriptor=function(e){var r=t.FileDescriptorSet.create();return d(this,r.file,e),r};var p=0;a.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.DescriptorProto.decode(e));var i,l=new a(e.name.length?e.name:"Type"+p++,S(e.options,t.MessageOptions));if(n||(l._edition=r),e.oneofDecl)for(i=0;i<e.oneofDecl.length;++i)l.add(c.fromDescriptor(e.oneofDecl[i]));if(e.field)for(i=0;i<e.field.length;++i){var u=o.fromDescriptor(e.field[i],r,!0);l.add(u),e.field[i].hasOwnProperty("oneofIndex")&&l.oneofsArray[e.field[i].oneofIndex].add(u)}if(e.extension)for(i=0;i<e.extension.length;++i)l.add(o.fromDescriptor(e.extension[i],r,!0));if(e.nestedType)for(i=0;i<e.nestedType.length;++i)l.add(a.fromDescriptor(e.nestedType[i],r,!0)),e.nestedType[i].options&&e.nestedType[i].options.mapEntry&&l.setOption("map_entry",!0);if(e.enumType)for(i=0;i<e.enumType.length;++i)l.add(s.fromDescriptor(e.enumType[i],r,!0));if(e.extensionRange&&e.extensionRange.length)for(l.extensions=[],i=0;i<e.extensionRange.length;++i)l.extensions.push([e.extensionRange[i].start,e.extensionRange[i].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(l.reserved=[],e.reservedRange)for(i=0;i<e.reservedRange.length;++i)l.reserved.push([e.reservedRange[i].start,e.reservedRange[i].end]);if(e.reservedName)for(i=0;i<e.reservedName.length;++i)l.reserved.push(e.reservedName[i])}return l},a.prototype.toDescriptor=function(e){var r,n=t.DescriptorProto.create({name:this.name});for(r=0;r<this.fieldsArray.length;++r){var i;if(n.field.push(i=this._fieldsArray[r].toDescriptor(e)),this._fieldsArray[r]instanceof l){var c=y(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),u=y(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),h=11===u||14===u?this._fieldsArray[r].resolvedType&&b(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(t.DescriptorProto.create({name:i.typeName,field:[t.FieldDescriptorProto.create({name:"key",number:1,label:1,type:c}),t.FieldDescriptorProto.create({name:"value",number:2,label:1,type:u,typeName:h})],options:t.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof o?n.field.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof a?n.nestedType.push(this._nestedArray[r].toDescriptor(e)):this._nestedArray[r]instanceof s&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(t.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)"string"==typeof this.reserved[r]?n.reservedName.push(this.reserved[r]):n.reservedRange.push(t.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=_(this.options,t.MessageOptions),n};var f=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;o.fromDescriptor=function(e,r,n){if("number"==typeof e.length&&(e=t.DescriptorProto.decode(e)),"number"!=typeof e.number)throw Error("missing field id");var i,s;switch(i=e.typeName&&e.typeName.length?e.typeName:function(e){switch(e){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+e)}(e.type),e.label){case 1:s=void 0;break;case 2:s="required";break;case 3:s="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;void 0!==e.extendee&&(a=a.length?a:void 0);var l=new o(e.name.length?e.name:"field"+e.number,e.number,i,s,a);if(n||(l._edition=r),l.options=S(e.options,t.FieldOptions),e.proto3_optional&&(l.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var c=e.defaultValue;switch(c){case"true":case"TRUE":c=!0;break;case"false":case"FALSE":c=!1;break;default:f.exec(c)&&(c=parseInt(c))}l.setOption("default",c)}return function(e){switch(e){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}(e.type)&&("proto3"===r?e.options&&!e.options.packed&&l.setOption("packed",!1):r&&"proto2"!==r||!e.options||!e.options.packed||l.setOption("packed",!0)),l},o.prototype.toDescriptor=function(e){var n=t.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)n.type=11,n.typeName=r.util.ucFirst(this.name),n.label=3;else{switch(n.type=y(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:n.typeName=this.resolvedType?b(this.parent,this.resolvedType):this.type}"repeated"===this.rule?n.label=3:this.required&&"proto2"===e?n.label=2:n.label=1}if(n.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(n.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(n.options=_(this.options,t.FieldOptions),null!=this.options.default&&(n.defaultValue=String(this.options.default)),this.options.proto3_optional&&(n.proto3_optional=!0)),"proto3"===e?this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!1):e&&"proto2"!==e||!this.packed||((n.options||(n.options=t.FieldOptions.create())).packed=!0),n};var g=0;s.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var a=0;a<e.value.length;++a){var o=e.value[a].name,l=e.value[a].number||0;i[o&&o.length?o:"NAME"+l]=l}var c=new s(e.name&&e.name.length?e.name:"Enum"+g++,i,S(e.options,t.EnumOptions));return n||(c._edition=r),c},s.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(t.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return t.EnumDescriptorProto.create({name:this.name,value:e,options:_(this.options,t.EnumOptions)})};var v=0;c.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.OneofDescriptorProto.decode(e)),new c(e.name&&e.name.length?e.name:"oneof"+v++)},c.prototype.toDescriptor=function(){return t.OneofDescriptorProto.create({name:this.name})};var m=0;u.fromDescriptor=function(e,r,n){"number"==typeof e.length&&(e=t.ServiceDescriptorProto.decode(e));var i=new u(e.name&&e.name.length?e.name:"Service"+m++,S(e.options,t.ServiceOptions));if(n||(i._edition=r),e.method)for(var s=0;s<e.method.length;++s)i.add(h.fromDescriptor(e.method[s]));return i},u.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return t.ServiceDescriptorProto.create({name:this.name,method:e,options:_(this.options,t.ServiceOptions)})};var A=0;function y(e,t,r){switch(e){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(t instanceof s)return 14;if(t instanceof a)return r?10:11;throw Error("illegal type: "+e)}function C(e,t){for(var r,n,i={},o=0;o<t.fieldsArray.length;++o)if("uninterpretedOption"!==(n=(r=t._fieldsArray[o]).name)&&Object.prototype.hasOwnProperty.call(e,n)){var l=T(n);r.resolvedType instanceof a?i[l]=C(e[n],r.resolvedType):r.resolvedType instanceof s?i[l]=r.resolvedType.valuesById[e[n]]:i[l]=e[n]}return i}function S(e,t){if(e)return C(t.toObject(e),t)}function E(e,t){for(var n={},i=Object.keys(e),s=0;s<i.length;++s){var o=i[s],l=r.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(t.fields,l)){var c=t.fields[l];c.resolvedType instanceof a?n[l]=E(e[o],c.resolvedType):n[l]=e[o],c.repeated&&!Array.isArray(n[l])&&(n[l]=[n[l]])}}return n}function _(e,t){if(e)return t.fromObject(E(e,t))}function b(e,t){var r=e.fullName.split("."),s=t.fullName.split("."),a=0,o=0,l=s.length-1;if(!(e instanceof i)&&t instanceof n)for(;a<r.length&&o<l&&r[a]===s[o];){var c=t.lookup(r[a++],!0);if(null!==c&&c!==t)break;++o}else for(;a<r.length&&o<l&&r[a]===s[o];++a,++o);return s.slice(o).join(".")}function T(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function R(e){if("editions"===e.syntax){if(e.edition===t.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+e.edition)}return"proto3"===e.syntax?"proto3":"proto2"}h.fromDescriptor=function(e){return"number"==typeof e.length&&(e=t.MethodDescriptorProto.decode(e)),new h(e.name&&e.name.length?e.name:"Method"+A++,"rpc",e.inputType,e.outputType,Boolean(e.clientStreaming),Boolean(e.serverStreaming),S(e.options,t.MethodOptions))},h.prototype.toDescriptor=function(){return t.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:_(this.options,t.MethodOptions)})}}(descriptor,descriptor.exports)),descriptor.exports}var util={},nested$2={google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}},require$$3={nested:nested$2},nested$1={google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$5={nested:nested$1},nested={google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}},require$$6={nested:nested},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1,
3
- /**
4
- * @license
5
- * Copyright 2018 gRPC authors.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- *
19
- */
20
- Object.defineProperty(util,"__esModule",{value:!0}),util.addCommonProtos=util.loadProtosWithOptionsSync=util.loadProtosWithOptions=void 0;const e=require$$0,t=require$$1$3,r=requireProtobufjs();function n(r,n){const i=r.resolvePath;r.resolvePath=(r,s)=>{if(t.isAbsolute(s))return s;for(const r of n){const n=t.join(r,s);try{return e.accessSync(n,e.constants.R_OK),n}catch(e){continue}}return process.emitWarning(`${s} not found in any of the include paths ${n}`),i(r,s)}}return util.loadProtosWithOptions=async function(e,t){const i=new r.Root;if((t=t||{}).includeDirs){if(!Array.isArray(t.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));n(i,t.includeDirs)}const s=await i.load(e,t);return s.resolveAll(),s},util.loadProtosWithOptionsSync=function(e,t){const i=new r.Root;if((t=t||{}).includeDirs){if(!Array.isArray(t.includeDirs))throw new Error("The includeDirs option must be an array");n(i,t.includeDirs)}const s=i.loadSync(e,t);return s.resolveAll(),s},util.addCommonProtos=function(){const e=require$$3,t=require$$4,n=require$$5,i=require$$6;r.common("api",e.nested.google.nested.protobuf.nested),r.common("descriptor",t.nested.google.nested.protobuf.nested),r.common("source_context",n.nested.google.nested.protobuf.nested),r.common("type",i.nested.google.nested.protobuf.nested)},util}var umd$1={exports:{}},umd=umd$1.exports,hasRequiredUmd,hasRequiredSrc$1,hasRequiredChannelz;function requireUmd(){return hasRequiredUmd||(hasRequiredUmd=1,e=umd$1,t=umd$1.exports,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
21
- /**
22
- * @license
23
- * Copyright 2009 The Closure Library Authors
24
- * Copyright 2020 Daniel Wirtz / The long.js Authors.
25
- *
26
- * Licensed under the Apache License, Version 2.0 (the "License");
27
- * you may not use this file except in compliance with the License.
28
- * You may obtain a copy of the License at
29
- *
30
- * http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing, software
33
- * distributed under the License is distributed on an "AS IS" BASIS,
34
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35
- * See the License for the specific language governing permissions and
36
- * limitations under the License.
37
- *
38
- * SPDX-License-Identifier: Apache-2.0
39
- */
40
- var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var s={},a={};function o(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=c(e,0,!0),i&&(a[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=s[e])?n:(r=c(e,e<0?-1:0,!1),i&&(s[e]=r),r)}function l(e,t){if(isNaN(e))return t?y:A;if(t){if(e<0)return y;if(e>=g)return b}else{if(e<=-v)return T;if(e+1>=v)return _}return e<0?l(-e,t).neg():c(e%f|0,e/f|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=l,r.fromBits=c;var u=Math.pow;function h(e,t,r){if(0===e.length)throw Error("empty string");if("number"==typeof t?(r=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?y:A;if((r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(e.substring(1),t,r).neg();for(var i=l(u(r,8)),s=A,a=0;a<e.length;a+=8){var o=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+o),r);if(o<8){var d=l(u(r,o));s=s.mul(d).add(l(c))}else s=(s=s.mul(i)).add(l(c))}return s.unsigned=t,s}function d(e,t){return"number"==typeof e?l(e,t):"string"==typeof e?h(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=h,r.fromValue=d;var p=65536,f=p*p,g=f*f,v=g/2,m=o(1<<24),A=o(0);r.ZERO=A;var y=o(0,!0);r.UZERO=y;var C=o(1);r.ONE=C;var S=o(1,!0);r.UONE=S;var E=o(-1);r.NEG_ONE=E;var _=c(-1,2147483647,!1);r.MAX_VALUE=_;var b=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=b;var T=c(0,-2147483648,!1);r.MIN_VALUE=T;var R=r.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(T)){var t=l(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=l(u(e,6),this.unsigned),s=this,a="";;){var o=s.div(i),c=(s.sub(o.mul(i)).toInt()>>>0).toString(e);if((s=o).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isSafeInteger=function(){var e=this.high>>21;return!e||!this.unsigned&&-1===e&&!(0===this.low&&-2097152===this.high)},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(C)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,s=65535&this.low,a=e.high>>>16,o=65535&e.high,l=e.low>>>16,u=0,h=0,p=0,f=0;return p+=(f+=s+(65535&e.low))>>>16,h+=(p+=i+l)>>>16,u+=(h+=r+o)>>>16,u+=t+a,c((p&=65535)<<16|(f&=65535),(u&=65535)<<16|(h&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return this;if(n(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?y:A;if(this.eq(T))return e.isOdd()?T:A;if(e.eq(T))return this.isOdd()?T:A;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return l(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,s=this.low>>>16,a=65535&this.low,o=e.high>>>16,u=65535&e.high,h=e.low>>>16,p=65535&e.low,f=0,g=0,v=0,C=0;return v+=(C+=a*p)>>>16,g+=(v+=s*p)>>>16,v&=65535,g+=(v+=a*h)>>>16,f+=(g+=i*p)>>>16,g&=65535,f+=(g+=s*h)>>>16,g&=65535,f+=(g+=a*u)>>>16,f+=r*p+i*h+s*u+a*o,c((v&=65535)<<16|(C&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,i,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:A;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return S;s=y}else{if(this.eq(T))return e.eq(C)||e.eq(E)?T:e.eq(T)?C:(r=this.shr(1).div(e).shl(1)).eq(A)?e.isNegative()?C:E:(i=this.sub(e.mul(r)),s=r.add(i.div(e)));if(e.eq(T))return this.unsigned?y:A;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=A}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),o=a<=48?1:u(2,a-48),h=l(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=l(r-=o,this.unsigned)).mul(e);h.isZero()&&(h=C),s=s.add(h),i=i.sub(p)}return s},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return c(~this.low,~this.high,this.unsigned)},R.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},R.clz=R.countLeadingZeros,R.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},R.ctz=R.countTrailingZeros,R.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):c(32===e?this.high:this.high>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.rotateLeft=function(e){var t;return n(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?c(this.high,this.low,this.unsigned):e<32?(t=32-e,c(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),c(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},R.rotl=R.rotateLeft,R.rotateRight=function(e){var t;return n(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?c(this.high,this.low,this.unsigned):e<32?(t=32-e,c(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),c(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},R.rotr=R.rotateRight,R.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},"function"==typeof BigInt&&(r.fromBigInt=function(e,t){return c(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},r.fromValue=function(e,t){return"bigint"==typeof e?r.fromBigInt(e,t):d(e,t)},R.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=r}(t),e.exports=function(e){return e.default||e}(t)),umd$1.exports;var e,t}function requireSrc$1(){return hasRequiredSrc$1||(hasRequiredSrc$1=1,function(e){
41
- /**
42
- * @license
43
- * Copyright 2018 gRPC authors.
44
- *
45
- * Licensed under the Apache License, Version 2.0 (the "License");
46
- * you may not use this file except in compliance with the License.
47
- * You may obtain a copy of the License at
48
- *
49
- * http://www.apache.org/licenses/LICENSE-2.0
50
- *
51
- * Unless required by applicable law or agreed to in writing, software
52
- * distributed under the License is distributed on an "AS IS" BASIS,
53
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
- * See the License for the specific language governing permissions and
55
- * limitations under the License.
56
- *
57
- */
58
- Object.defineProperty(e,"__esModule",{value:!0}),e.loadFileDescriptorSetFromObject=e.loadFileDescriptorSetFromBuffer=e.fromJSON=e.loadSync=e.load=e.IdempotencyLevel=e.isAnyExtension=e.Long=void 0;const t=requireLodash_camelcase(),r=requireProtobufjs(),n=requireDescriptor(),i=requireUtil(),s=requireUmd();var a;e.Long=s,e.isAnyExtension=function(e){return"@type"in e&&"string"==typeof e["@type"]},function(e){e.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",e.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",e.IDEMPOTENT="IDEMPOTENT"}(a=e.IdempotencyLevel||(e.IdempotencyLevel={}));const o={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function l(e,t){const n=(i=t,s=e.name,""===i?s:i+"."+s);var i,s;return function(e){return e instanceof r.Service||e instanceof r.Type||e instanceof r.Enum}(e)?[[n,e]]:function(e){return e instanceof r.Namespace||e instanceof r.Root}(e)&&void 0!==e.nested?Object.keys(e.nested).map(t=>l(e.nested[t],n)).reduce((e,t)=>e.concat(t),[]):[]}function c(e,t){return function(r){return e.toObject(e.decode(r),t)}}function u(e){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${e.name} structure, got array instead`);const r=e.fromObject(t);return e.encode(r).finish()}}function h(e){return(e||[]).reduce((e,t)=>{for(const[r,n]of Object.entries(t))if("uninterpreted_option"===r)e.uninterpreted_option.push(t.uninterpreted_option);else e[r]=n;return e},{deprecated:!1,idempotency_level:a.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function d(e,r,n,i){const s=e.resolvedRequestType,a=e.resolvedResponseType;return{path:"/"+r+"/"+e.name,requestStream:!!e.requestStream,responseStream:!!e.responseStream,requestSerialize:u(s),requestDeserialize:c(s,n),responseSerialize:u(a),responseDeserialize:c(a,n),originalName:t(e.name),requestType:p(s,n,i),responseType:p(a,n,i),options:h(e.parsedOptions)}}function p(e,t,r){const n=e.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,o),fileDescriptorProtos:r,serialize:u(e),deserialize:c(e,t)}}function f(e,t,n,i){if(e instanceof r.Service)return function(e,t,r,n){const i={};for(const s of e.methodsArray)i[s.name]=d(s,t,r,n);return i}(e,t,n,i);if(e instanceof r.Type)return p(e,n,i);if(e instanceof r.Enum)return function(e,t){const r=e.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,o),fileDescriptorProtos:t}}(e,i);throw new Error("Type mismatch in reflection object handling")}function g(e,t){const r={};e.resolveAll();const i=e.toDescriptor("proto3").file.map(e=>Buffer.from(n.FileDescriptorProto.encode(e).finish()));for(const[n,s]of l(e,""))r[n]=f(s,n,t,i);return r}function v(e,t){t=t||{};const n=r.Root.fromDescriptor(e);return n.resolveAll(),g(n,t)}e.load=function(e,t){return(0,i.loadProtosWithOptions)(e,t).then(e=>g(e,t))},e.loadSync=function(e,t){return g((0,i.loadProtosWithOptionsSync)(e,t),t)},e.fromJSON=function(e,t){t=t||{};const n=r.Root.fromJSON(e);return n.resolveAll(),g(n,t)},e.loadFileDescriptorSetFromBuffer=function(e,t){return v(n.FileDescriptorSet.decode(e),t)},e.loadFileDescriptorSetFromObject=function(e,t){return v(n.FileDescriptorSet.fromObject(e),t)},(0,i.addCommonProtos)()}(src$1)),src$1}function requireChannelz(){if(hasRequiredChannelz)return channelz;hasRequiredChannelz=1,Object.defineProperty(channelz,"__esModule",{value:!0}),channelz.registerChannelzSocket=channelz.registerChannelzServer=channelz.registerChannelzSubchannel=channelz.registerChannelzChannel=channelz.ChannelzCallTrackerStub=channelz.ChannelzCallTracker=channelz.ChannelzChildrenTrackerStub=channelz.ChannelzChildrenTracker=channelz.ChannelzTrace=channelz.ChannelzTraceStub=void 0,channelz.unregisterChannelzRef=function(e){p[e.kind].eraseElementByKey(e.id)},channelz.getChannelzHandlers=N,channelz.getChannelzServiceDefinition=O,channelz.setup=function(){(0,s.registerAdminService)(O,N)};const e=require$$0$3,t=require$$1,r=requireConnectivityState(),n=requireConstants(),i=requireSubchannelAddress(),s=requireAdmin(),a=requireMakeClient();function o(e){return{channel_id:e.id,name:e.name}}function l(e){return{subchannel_id:e.id,name:e.name}}function c(e){return{socket_id:e.id,name:e.name}}const u=100;channelz.ChannelzTraceStub=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:y(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};channelz.ChannelzTrace=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,r){const n=new Date;this.events.push({description:t,severity:e,timestamp:n,childChannel:"channel"===(null==r?void 0:r.kind)?r:void 0,childSubchannel:"subchannel"===(null==r?void 0:r.kind)?r:void 0}),this.events.length>=64&&(this.events=this.events.slice(32)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:y(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:y(e.timestamp),channel_ref:e.childChannel?o(e.childChannel):null,subchannel_ref:e.childSubchannel?l(e.childSubchannel):null}))}}};class h{constructor(){this.channelChildren=new t.OrderedMap,this.subchannelChildren=new t.OrderedMap,this.socketChildren=new t.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){const t=this.trackerMap[e.kind],r=t.find(e.id);r.equals(t.end())?t.setElement(e.id,{ref:e,count:1},r):r.pointer[1].count+=1}unrefChild(e){const t=this.trackerMap[e.kind],r=t.getElementByKey(e.id);void 0!==r&&(r.count-=1,0===r.count&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}}channelz.ChannelzChildrenTracker=h;channelz.ChannelzChildrenTrackerStub=class extends h{refChild(){}unrefChild(){}};class d{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}}channelz.ChannelzCallTracker=d;channelz.ChannelzCallTrackerStub=class extends d{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};const p={channel:new t.OrderedMap,subchannel:new t.OrderedMap,server:new t.OrderedMap,socket:new t.OrderedMap},f=e=>{let t=1;const r=p[e];return(n,i,s)=>{const a=t++,o={id:a,name:n,kind:e};return s&&r.setElement(a,{ref:o,getInfo:i}),o}};function g(e){if(""===e)return[];const t=e.split(":").map(e=>function(e){const t=Number.parseInt(e,16);return[t/256|0,t%256]}(e));return[].concat(...t)}function v(e){return Buffer.from(Uint8Array.from(e.split(".").map(e=>Number.parseInt(e))))}function m(t){if((0,e.isIPv4)(t))return v(t);if(function(t){return(0,e.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,e.isIPv4)(t.substring(7))}(t))return v(t.substring(7));if((0,e.isIPv6)(t)){let e,r;const n=t.indexOf("::");-1===n?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+2));const i=Buffer.from(g(e)),s=Buffer.from(g(r)),a=Buffer.alloc(16-i.length-s.length,0);return Buffer.concat([i,a,s])}return null}function A(e){switch(e){case r.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case r.ConnectivityState.IDLE:return{state:"IDLE"};case r.ConnectivityState.READY:return{state:"READY"};case r.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case r.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function y(e){if(!e)return null;const t=e.getTime();return{seconds:t/1e3|0,nanos:t%1e3*1e6}}function C(e){const t=e.getInfo(),r=[],n=[];return t.children.channels.forEach(e=>{r.push(o(e[1].ref))}),t.children.subchannels.forEach(e=>{n.push(l(e[1].ref))}),{ref:o(e.ref),data:{target:t.target,state:A(t.state),calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:y(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},channel_ref:r,subchannel_ref:n}}function S(e,t){const r=parseInt(e.request.channel_id,10),i=p.channel.getElementByKey(r);void 0!==i?t(null,{channel:C(i)}):t({code:n.Status.NOT_FOUND,details:"No channel data found for id "+r})}function E(e,t){const r=parseInt(e.request.max_results,10)||u,n=[],i=parseInt(e.request.start_channel_id,10),s=p.channel;let a;for(a=s.lowerBound(i);!a.equals(s.end())&&n.length<r;a=a.next())n.push(C(a.pointer[1]));t(null,{channel:n,end:a.equals(s.end())})}function _(e){const t=e.getInfo(),r=[];return t.listenerChildren.sockets.forEach(e=>{r.push(c(e[1].ref))}),{ref:(n=e.ref,{server_id:n.id}),data:{calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:y(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},listen_socket:r};var n}function b(e,t){const r=parseInt(e.request.server_id,10),i=p.server.getElementByKey(r);void 0!==i?t(null,{server:_(i)}):t({code:n.Status.NOT_FOUND,details:"No server data found for id "+r})}function T(e,t){const r=parseInt(e.request.max_results,10)||u,n=parseInt(e.request.start_server_id,10),i=p.server,s=[];let a;for(a=i.lowerBound(n);!a.equals(i.end())&&s.length<r;a=a.next())s.push(_(a.pointer[1]));t(null,{server:s,end:a.equals(i.end())})}function R(e,t){const r=parseInt(e.request.subchannel_id,10),i=p.subchannel.getElementByKey(r);if(void 0===i)return void t({code:n.Status.NOT_FOUND,details:"No subchannel data found for id "+r});const s=i.getInfo(),a=[];s.children.sockets.forEach(e=>{a.push(c(e[1].ref))});t(null,{subchannel:{ref:l(i.ref),data:{target:s.target,state:A(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:y(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a}})}function x(e){var t;return(0,i.isTcpSubchannelAddress)(e)?{address:"tcpip_address",tcpip_address:{ip_address:null!==(t=m(e.host))&&void 0!==t?t:void 0,port:e.port}}:{address:"uds_address",uds_address:{filename:e.path}}}function w(e,t){var r,i,s,a,o;const l=parseInt(e.request.socket_id,10),u=p.socket.getElementByKey(l);if(void 0===u)return void t({code:n.Status.NOT_FOUND,details:"No socket data found for id "+l});const h=u.getInfo(),d=h.security?{model:"tls",tls:{cipher_suite:h.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:null!==(r=h.security.cipherSuiteStandardName)&&void 0!==r?r:void 0,other_name:null!==(i=h.security.cipherSuiteOtherName)&&void 0!==i?i:void 0,local_certificate:null!==(s=h.security.localCertificate)&&void 0!==s?s:void 0,remote_certificate:null!==(a=h.security.remoteCertificate)&&void 0!==a?a:void 0}}:null;t(null,{socket:{ref:c(u.ref),local:h.localAddress?x(h.localAddress):null,remote:h.remoteAddress?x(h.remoteAddress):null,remote_name:null!==(o=h.remoteName)&&void 0!==o?o:void 0,security:d,data:{keep_alives_sent:h.keepAlivesSent,streams_started:h.streamsStarted,streams_succeeded:h.streamsSucceeded,streams_failed:h.streamsFailed,last_local_stream_created_timestamp:y(h.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:y(h.lastRemoteStreamCreatedTimestamp),messages_received:h.messagesReceived,messages_sent:h.messagesSent,last_message_received_timestamp:y(h.lastMessageReceivedTimestamp),last_message_sent_timestamp:y(h.lastMessageSentTimestamp),local_flow_control_window:h.localFlowControlWindow?{value:h.localFlowControlWindow}:null,remote_flow_control_window:h.remoteFlowControlWindow?{value:h.remoteFlowControlWindow}:null}}})}function k(e,t){const r=parseInt(e.request.server_id,10),i=p.server.getElementByKey(r);if(void 0===i)return void t({code:n.Status.NOT_FOUND,details:"No server data found for id "+r});const s=parseInt(e.request.start_socket_id,10),a=parseInt(e.request.max_results,10)||u,o=i.getInfo().sessionChildren.sockets,l=[];let h;for(h=o.lowerBound(s);!h.equals(o.end())&&l.length<a;h=h.next())l.push(c(h.pointer[1].ref));t(null,{socket_ref:l,end:h.equals(o.end())})}function N(){return{GetChannel:S,GetTopChannels:E,GetServer:b,GetServers:T,GetSubchannel:R,GetSocket:w,GetServerSockets:k}}channelz.registerChannelzChannel=f("channel"),channelz.registerChannelzSubchannel=f("subchannel"),channelz.registerChannelzServer=f("server"),channelz.registerChannelzSocket=f("socket");let I=null;function O(){if(I)return I;const e=(0,requireSrc$1().loadSync)("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]}),t=(0,a.loadPackageDefinition)(e);return I=t.grpc.channelz.v1.Channelz.service,I}return channelz}var singleSubchannelChannel={},callNumber={},hasRequiredCallNumber;function requireCallNumber(){if(hasRequiredCallNumber)return callNumber;hasRequiredCallNumber=1,Object.defineProperty(callNumber,"__esModule",{value:!0}),callNumber.getNextCallNumber=function(){return e++};let e=0;return callNumber}var compressionFilter={},compressionAlgorithms={},hasRequiredCompressionAlgorithms;function requireCompressionAlgorithms(){return hasRequiredCompressionAlgorithms||(hasRequiredCompressionAlgorithms=1,Object.defineProperty(compressionAlgorithms,"__esModule",{value:!0}),compressionAlgorithms.CompressionAlgorithms=void 0,function(e){e[e.identity=0]="identity",e[e.deflate=1]="deflate",e[e.gzip=2]="gzip"}(e||(compressionAlgorithms.CompressionAlgorithms=e={}))),compressionAlgorithms;var e}var filter={},hasRequiredFilter,hasRequiredCompressionFilter;function requireFilter(){if(hasRequiredFilter)return filter;hasRequiredFilter=1,Object.defineProperty(filter,"__esModule",{value:!0}),filter.BaseFilter=void 0;return filter.BaseFilter=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}},filter}function requireCompressionFilter(){if(hasRequiredCompressionFilter)return compressionFilter;hasRequiredCompressionFilter=1,Object.defineProperty(compressionFilter,"__esModule",{value:!0}),compressionFilter.CompressionFilterFactory=compressionFilter.CompressionFilter=void 0;const e=require$$0$5,t=requireCompressionAlgorithms(),r=requireConstants(),n=requireFilter(),i=requireLogging();class s{async writeMessage(e,t){let r=e;t&&(r=await this.compressMessage(r));const n=Buffer.allocUnsafe(r.length+5);return n.writeUInt8(t?1:0,0),n.writeUInt32BE(r.length,1),r.copy(n,5),n}async readMessage(e){const t=1===e.readUInt8(0);let r=e.slice(5);return t&&(r=await this.decompressMessage(r)),r}}class a extends s{async compressMessage(e){return e}async writeMessage(e,t){const r=Buffer.allocUnsafe(e.length+5);return r.writeUInt8(0,0),r.writeUInt32BE(e.length,1),e.copy(r,5),r}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}}class o extends s{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(t){return new Promise((r,n)=>{e.deflate(t,(e,t)=>{e?n(e):r(t)})})}decompressMessage(t){return new Promise((n,i)=>{let s=0;const a=[],o=e.createInflate();o.on("data",e=>{a.push(e),s+=e.byteLength,-1!==this.maxRecvMessageLength&&s>this.maxRecvMessageLength&&(o.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{n(Buffer.concat(a))}),o.write(t),o.end()})}}class l extends s{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(t){return new Promise((r,n)=>{e.gzip(t,(e,t)=>{e?n(e):r(t)})})}decompressMessage(t){return new Promise((n,i)=>{let s=0;const a=[],o=e.createGunzip();o.on("data",e=>{a.push(e),s+=e.byteLength,-1!==this.maxRecvMessageLength&&s>this.maxRecvMessageLength&&(o.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{n(Buffer.concat(a))}),o.write(t),o.end()})}}class c extends s{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}}function u(e,t){switch(e){case"identity":return new a;case"deflate":return new o(t);case"gzip":return new l(t);default:return new c(e)}}class h extends n.BaseFilter{constructor(e,n){var s,o,l;super(),this.sharedFilterConfig=n,this.sendCompression=new a,this.receiveCompression=new a,this.currentCompressionAlgorithm="identity";const c=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=null!==(s=e["grpc.max_receive_message_length"])&&void 0!==s?s:r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=null!==(o=e["grpc.max_send_message_length"])&&void 0!==o?o:r.DEFAULT_MAX_SEND_MESSAGE_LENGTH,void 0!==c)if("number"==typeof(h=c)&&"string"==typeof t.CompressionAlgorithms[h]){const e=t.CompressionAlgorithms[c],r=null===(l=n.serverSupportedEncodingHeader)||void 0===l?void 0:l.split(",");r&&!r.includes(e)||(this.currentCompressionAlgorithm=e,this.sendCompression=u(this.currentCompressionAlgorithm,-1))}else i.log(r.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${c}`);var h}async sendMetadata(e){const t=await e;return t.set("grpc-accept-encoding","identity,deflate,gzip"),t.set("accept-encoding","identity"),"identity"===this.currentCompressionAlgorithm?t.remove("grpc-encoding"):t.set("grpc-encoding",this.currentCompressionAlgorithm),t}receiveMetadata(e){const t=e.get("grpc-encoding");if(t.length>0){const e=t[0];"string"==typeof e&&(this.receiveCompression=u(e,this.maxReceiveMessageLength))}e.remove("grpc-encoding");const r=e.get("grpc-accept-encoding")[0];if(r){this.sharedFilterConfig.serverSupportedEncodingHeader=r;r.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new a,this.currentCompressionAlgorithm="identity")}return e.remove("grpc-accept-encoding"),e}async sendMessage(e){var t;const n=await e;if(-1!==this.maxSendMessageLength&&n.message.length>this.maxSendMessageLength)throw{code:r.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return i=!(this.sendCompression instanceof a)&&!(2&(null!==(t=n.flags)&&void 0!==t?t:0)),{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}}compressionFilter.CompressionFilter=h;return compressionFilter.CompressionFilterFactory=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new h(this.options,this.sharedFilterConfig)}},compressionFilter}var controlPlaneStatus={},hasRequiredControlPlaneStatus;function requireControlPlaneStatus(){if(hasRequiredControlPlaneStatus)return controlPlaneStatus;hasRequiredControlPlaneStatus=1,Object.defineProperty(controlPlaneStatus,"__esModule",{value:!0}),controlPlaneStatus.restrictControlPlaneStatusCode=function(r,n){return t.includes(r)?{code:e.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${e.Status[r]} ${n}`}:{code:r,details:n}};const e=requireConstants(),t=[e.Status.OK,e.Status.INVALID_ARGUMENT,e.Status.NOT_FOUND,e.Status.ALREADY_EXISTS,e.Status.FAILED_PRECONDITION,e.Status.ABORTED,e.Status.OUT_OF_RANGE,e.Status.DATA_LOSS];return controlPlaneStatus}var deadline={},hasRequiredDeadline;function requireDeadline(){if(hasRequiredDeadline)return deadline;hasRequiredDeadline=1,Object.defineProperty(deadline,"__esModule",{value:!0}),deadline.minDeadline=function(...e){let t=1/0;for(const r of e){const e=r instanceof Date?r.getTime():r;e<t&&(t=e)}return t},deadline.getDeadlineTimeoutString=function(t){const r=(new Date).getTime();t instanceof Date&&(t=t.getTime());const n=Math.max(t-r,0);for(const[t,r]of e){const e=n/r;if(e<1e8)return String(Math.ceil(e))+t}throw new Error("Deadline is too far in the future")},deadline.getRelativeTimeout=function(e){const r=e instanceof Date?e.getTime():e,n=(new Date).getTime(),i=r-n;return i<0?0:i>t?1/0:i},deadline.deadlineToString=function(e){if(e instanceof Date)return e.toISOString();{const t=new Date(e);return Number.isNaN(t.getTime())?""+e:t.toISOString()}},deadline.formatDateDifference=function(e,t){return((t.getTime()-e.getTime())/1e3).toFixed(3)+"s"};const e=[["m",1],["S",1e3],["M",6e4],["H",36e5]];const t=2147483647;return deadline}var filterStack={},hasRequiredFilterStack,hasRequiredSingleSubchannelChannel,hasRequiredSubchannel;function requireFilterStack(){if(hasRequiredFilterStack)return filterStack;hasRequiredFilterStack=1,Object.defineProperty(filterStack,"__esModule",{value:!0}),filterStack.FilterStackFactory=filterStack.FilterStack=void 0;class e{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMessage(t);return t}receiveMessage(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}}filterStack.FilterStack=e;class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new e(this.factories.map(e=>e.createFilter()))}}return filterStack.FilterStackFactory=t,filterStack}function requireSingleSubchannelChannel(){if(hasRequiredSingleSubchannelChannel)return singleSubchannelChannel;hasRequiredSingleSubchannelChannel=1,Object.defineProperty(singleSubchannelChannel,"__esModule",{value:!0}),singleSubchannelChannel.SingleSubchannelChannel=void 0;const e=requireCallNumber(),t=requireChannelz(),r=requireCompressionFilter(),n=requireConnectivityState(),i=requireConstants(),s=requireControlPlaneStatus(),a=requireDeadline(),o=requireFilterStack(),l=requireMetadata(),c=requireResolver(),u=requireUriParser();class h{constructor(e,t,r,n,s){var o,l;this.subchannel=e,this.method=t,this.options=n,this.callNumber=s,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;const c=this.method.split("/");let h="";c.length>=2&&(h=c[1]);const d=null!==(l=null===(o=(0,u.splitHostPort)(this.options.host))||void 0===o?void 0:o.host)&&void 0!==l?l:"localhost";this.serviceUrl=`https://${d}/${h}`;const p=(0,a.getRelativeTimeout)(n.deadline);p!==1/0&&(p<=0?this.cancelWithStatus(i.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(i.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},p)),this.filterStack=r.createFilter()}cancelWithStatus(e,t){this.childCall?this.childCall.cancelWithStatus(e,t):this.pendingStatus={code:e,details:t,metadata:new l.Metadata}}getPeer(){var e,t;return null!==(t=null===(e=this.childCall)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:this.subchannel.getAddress()}async start(e,t){if(this.pendingStatus)return void t.onReceiveStatus(this.pendingStatus);if(this.subchannel.getConnectivityState()!==n.ConnectivityState.READY)return void t.onReceiveStatus({code:i.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new l.Metadata});const r=await this.filterStack.sendMetadata(Promise.resolve(e));let a;try{a=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(e){const r=e,{code:n,details:a}=(0,s.restrictControlPlaneStatusCode)("number"==typeof r.code?r.code:i.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${r.message}`);return void t.onReceiveStatus({code:n,details:a,metadata:new l.Metadata})}a.merge(r);const o={onReceiveMetadata:async e=>{t.onReceiveMetadata(await this.filterStack.receiveMetadata(e))},onReceiveMessage:async e=>{this.readFilterPending=!0;const r=await this.filterStack.receiveMessage(e);this.readFilterPending=!1,t.onReceiveMessage(r),this.pendingStatus&&t.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async e=>{const r=await this.filterStack.receiveTrailers(e);this.readFilterPending?this.pendingStatus=r:t.onReceiveStatus(r)}};this.childCall=this.subchannel.createCall(a,this.options.host,this.method,o),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,t){this.writeFilterPending=!0;const r=await this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,r.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:r.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw new Error("Method not implemented.")}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}}return singleSubchannelChannel.SingleSubchannelChannel=class{constructor(e,n,i){this.subchannel=e,this.target=n,this.channelzEnabled=!1,this.channelzTrace=new t.ChannelzTrace,this.callTracker=new t.ChannelzCallTracker,this.childrenTracker=new t.ChannelzChildrenTracker,this.channelzEnabled=0!==i["grpc.enable_channelz"],this.channelzRef=(0,t.registerChannelzChannel)((0,u.uriToString)(n),()=>({target:`${(0,u.uriToString)(n)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new o.FilterStackFactory([new r.CompressionFilterFactory(this,i)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,t.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,u.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,t,r){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(t,r){const n={deadline:r,host:(0,c.getDefaultAuthority)(this.target),flags:i.Propagate.DEFAULTS,parentCall:null};return new h(this.subchannel,t,this.filterStackFactory,n,(0,e.getNextCallNumber)())}},singleSubchannelChannel}function requireSubchannel(){if(hasRequiredSubchannel)return subchannel;hasRequiredSubchannel=1,Object.defineProperty(subchannel,"__esModule",{value:!0}),subchannel.Subchannel=void 0;const e=requireConnectivityState(),t=requireBackoffTimeout(),r=requireLogging(),n=requireConstants(),i=requireUriParser(),s=requireSubchannelAddress(),a=requireChannelz(),o=requireSingleSubchannelChannel();return subchannel.Subchannel=class{constructor(r,n,i,o,l){var c;this.channelTarget=r,this.subchannelAddress=n,this.options=i,this.connector=l,this.connectivityState=e.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;const u={initialDelay:i["grpc.initial_reconnect_backoff_ms"],maxDelay:i["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new t.BackoffTimeout(()=>{this.handleBackoffTimer()},u),this.backoffTimeout.unref(),this.subchannelAddressString=(0,s.subchannelAddressToString)(n),this.keepaliveTime=null!==(c=i["grpc.keepalive_time_ms"])&&void 0!==c?c:-1,0===i["grpc.enable_channelz"]?(this.channelzEnabled=!1,this.channelzTrace=new a.ChannelzTraceStub,this.callTracker=new a.ChannelzCallTrackerStub,this.childrenTracker=new a.ChannelzChildrenTrackerStub,this.streamTracker=new a.ChannelzCallTrackerStub):(this.channelzTrace=new a.ChannelzTrace,this.callTracker=new a.ChannelzCallTracker,this.childrenTracker=new a.ChannelzChildrenTracker,this.streamTracker=new a.ChannelzCallTracker),this.channelzRef=(0,a.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(i,void 0,2)),this.secureConnector=o._createSecureConnector(r,i)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){r.trace(n.LogVerbosity.DEBUG,"subchannel","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){r.trace(n.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([e.ConnectivityState.TRANSIENT_FAILURE],e.ConnectivityState.CONNECTING):this.transitionToState([e.ConnectivityState.TRANSIENT_FAILURE],e.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let t=this.options;if(t["grpc.keepalive_time_ms"]){const e=Math.min(this.keepaliveTime,2147483647);t=Object.assign(Object.assign({},t),{"grpc.keepalive_time_ms":e})}this.connector.connect(this.subchannelAddress,this.secureConnector,t).then(t=>{this.transitionToState([e.ConnectivityState.CONNECTING],e.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&&this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(t=>{this.transitionToState([e.ConnectivityState.READY],e.ConnectivityState.IDLE),t&&this.keepaliveTime>0&&(this.keepaliveTime*=2,r.log(n.LogVerbosity.ERROR,`Connection to ${(0,i.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):t.shutdown()},t=>{this.transitionToState([e.ConnectivityState.CONNECTING],e.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(t,r,n){var i,s;if(-1===t.indexOf(this.connectivityState))return!1;n?this.trace(e.ConnectivityState[this.connectivityState]+" -> "+e.ConnectivityState[r]+' with error "'+n+'"'):this.trace(e.ConnectivityState[this.connectivityState]+" -> "+e.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+e.ConnectivityState[r]);const a=this.connectivityState;switch(this.connectivityState=r,r){case e.ConnectivityState.READY:this.stopBackoff();break;case e.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case e.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),null===(i=this.transport)||void 0===i||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case e.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),null===(s=this.transport)||void 0===s||s.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(const e of this.stateListeners)e(this,a,r,this.keepaliveTime,n);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,0===this.refcount&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,a.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([e.ConnectivityState.CONNECTING,e.ConnectivityState.READY],e.ConnectivityState.IDLE)}))}unrefIfOneRef(){return 1===this.refcount&&(this.unref(),!0)}createCall(e,t,r,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let s;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),s={onCallEnd:e=>{e.code===n.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):s={},this.transport.createCall(e,t,r,i,s)}startConnecting(){process.nextTick(()=>{this.transitionToState([e.ConnectivityState.IDLE],e.ConnectivityState.CONNECTING)||this.connectivityState===e.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([e.ConnectivityState.TRANSIENT_FAILURE],e.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new o.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,t){const r=this.dataProducers.get(e);if(r)return r;const n=t(this);return this.dataProducers.set(e,n),n}removeDataProducer(e){this.dataProducers.delete(e)}},subchannel}var transport={},http_proxy={},resolverDns={},environment={},hasRequiredEnvironment,hasRequiredResolverDns,hasRequiredHttp_proxy;function requireEnvironment(){return hasRequiredEnvironment||(hasRequiredEnvironment=1,Object.defineProperty(environment,"__esModule",{value:!0}),environment.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0,environment.GRPC_NODE_USE_ALTERNATIVE_RESOLVER="true"===(null!==(e=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)&&void 0!==e?e:"false")),environment;var e}function requireResolverDns(){return hasRequiredResolverDns||(hasRequiredResolverDns=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_PORT=void 0,e.setup=function(){(0,t.registerResolver)("dns",f),(0,t.registerDefaultScheme)("dns")};const t=requireResolver(),r=require$$1$4,n=requireServiceConfig(),i=requireConstants(),s=requireCallInterface(),a=requireMetadata(),o=requireLogging(),l=requireConstants(),c=requireUriParser(),u=require$$0$3,h=requireBackoffTimeout(),d=requireEnvironment();function p(e){o.trace(l.LogVerbosity.DEBUG,"dns_resolver",e)}e.DEFAULT_PORT=443;class f{constructor(t,n,s){var o,l,d;this.target=t,this.listener=n,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new r.promises.Resolver,p("Resolver constructed for target "+(0,c.uriToString)(t)),t.authority&&this.alternativeResolver.setServers([t.authority]);const f=(0,c.splitHostPort)(t.path);null===f?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,u.isIPv4)(f.host)||(0,u.isIPv6)(f.host)?(this.ipResult=[{addresses:[{host:f.host,port:null!==(o=f.port)&&void 0!==o?o:e.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=f.host,this.port=null!==(l=f.port)&&void 0!==l?l:e.DEFAULT_PORT),this.percentage=100*Math.random(),1===s["grpc.service_config_disable_resolution"]&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:i.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,c.uriToString)(this.target)}`,metadata:new a.Metadata};const g={initialDelay:s["grpc.initial_reconnect_backoff_ms"],maxDelay:s["grpc.max_reconnect_backoff_ms"]};this.backoff=new h.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},g),this.backoff.unref(),this.minTimeBetweenResolutionsMs=null!==(d=s["grpc.dns_min_time_between_resolutions_ms"])&&void 0!==d?d:3e4,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(null!==this.ipResult)return this.returnedIpResult||(p("Returning IP address for target "+(0,c.uriToString)(this.target)),setImmediate(()=>{this.listener((0,s.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),void this.stopNextResolutionTimer();if(null===this.dnsHostname)p("Failed to parse DNS address "+(0,c.uriToString)(this.target)),setImmediate(()=>{this.listener((0,s.statusOrFromError)({code:i.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,c.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(null!==this.pendingLookupPromise)return;p("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;const e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(e=>{if(null===this.pendingLookupPromise)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,s.statusOrFromValue)(e.map(e=>({addresses:[e]})));const t="["+e.map(e=>e.host+":"+e.port).join(",")+"]";p("Resolved addresses for target "+(0,c.uriToString)(this.target)+": "+t);const r=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(r)},e=>{null!==this.pendingLookupPromise&&(p("Resolution error for target "+(0,c.uriToString)(this.target)+": "+e.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,s.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,""))}),this.isServiceConfigEnabled&&null===this.pendingTxtPromise&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(e=>{if(null===this.pendingTxtPromise)return;let t;this.pendingTxtPromise=null;try{t=(0,n.extractAndSelectServiceConfig)(e,this.percentage),this.latestServiceConfigResult=t?(0,s.statusOrFromValue)(t):null}catch(e){this.latestServiceConfigResult=(0,s.statusOrFromError)({code:i.Status.UNAVAILABLE,details:`Parsing service config failed with error ${e.message}`})}null!==this.latestLookupResult&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},e=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(d.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){p("Using alternative DNS resolver.");const t=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(t.every(e=>"rejected"===e.status))throw new Error(t[0].reason);return t.reduce((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e,[]).map(e=>({host:e,port:+this.port}))}return(await r.promises.lookup(e,{all:!0})).map(e=>({host:e.address,port:+this.port}))}async resolveTxt(e){return d.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(p("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):r.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),null===(t=(e=this.nextResolutionTimer).unref)||void 0===t||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){null===this.pendingLookupPromise&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){null===this.pendingLookupPromise&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?p('resolution update delayed by "min time between resolutions" rate limit'):p("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}}}(resolverDns)),resolverDns}function requireHttp_proxy(){if(hasRequiredHttp_proxy)return http_proxy;hasRequiredHttp_proxy=1,Object.defineProperty(http_proxy,"__esModule",{value:!0}),http_proxy.parseCIDR=h,http_proxy.mapProxyName=function(n,i){var s;const l={target:n,extraOptions:{}};if(0===(null!==(s=i["grpc.enable_http_proxy"])&&void 0!==s?s:1))return l;if("unix"===n.scheme)return l;const c=function(){let r,n="",i="";if(process.env.grpc_proxy)i="grpc_proxy",n=process.env.grpc_proxy;else if(process.env.https_proxy)i="https_proxy",n=process.env.https_proxy;else{if(!process.env.http_proxy)return{};i="http_proxy",n=process.env.http_proxy}try{r=new o.URL(n)}catch(r){return(0,e.log)(t.LogVerbosity.ERROR,`cannot parse value of "${i}" env var`),{}}if("http:"!==r.protocol)return(0,e.log)(t.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let s=null;r.username&&(r.password?((0,e.log)(t.LogVerbosity.INFO,"userinfo found in proxy URI"),s=decodeURIComponent(`${r.username}:${r.password}`)):s=r.username);const a=r.hostname;let l=r.port;""===l&&(l="80");const c={address:`${a}:${l}`};s&&(c.creds=s);return u("Proxy server "+c.address+" set by environment variable "+i),c}();if(!c.address)return l;const d=(0,a.splitHostPort)(n.path);if(!d)return l;if(function(e){for(const t of function(){let e=process.env.no_grpc_proxy,t="no_grpc_proxy";e||(e=process.env.no_proxy,t="no_proxy");return e?(u("No proxy server list set by environment variable "+t),e.split(",")):[]}()){const n=h(t);if((0,r.isIPv4)(e)&&n&&p(n,e))return!0;if(e.endsWith(t))return!0}return!1}(d.host))return u("Not using proxy for target in no_proxy list: "+(0,a.uriToString)(n)),l;const f={"grpc.http_connect_target":(0,a.uriToString)(n)};c.creds&&(f["grpc.http_connect_creds"]=c.creds);return{target:{scheme:"dns",path:c.address},extraOptions:f}},http_proxy.getProxiedConnection=function(r,i){var o;if(!("grpc.http_connect_target"in i))return Promise.resolve(null);const c=i["grpc.http_connect_target"],h=(0,a.parseUri)(c);if(null===h)return Promise.resolve(null);const d=(0,a.splitHostPort)(h.path);if(null===d)return Promise.resolve(null);const p=`${d.host}:${null!==(o=d.port)&&void 0!==o?o:l.DEFAULT_PORT}`,f={method:"CONNECT",path:p},g={Host:p};(0,s.isTcpSubchannelAddress)(r)?(f.host=r.host,f.port=r.port):f.socketPath=r.path;"grpc.http_connect_creds"in i&&(g["Proxy-Authorization"]="Basic "+Buffer.from(i["grpc.http_connect_creds"]).toString("base64"));f.headers=g;const v=(0,s.subchannelAddressToString)(r);return u("Using proxy "+v+" to connect to "+f.path),new Promise((r,i)=>{const s=n.request(f);s.once("connect",(n,a,o)=>{s.removeAllListeners(),a.removeAllListeners(),200===n.statusCode?(u("Successfully connected to "+f.path+" through proxy "+v),o.length>0&&a.unshift(o),u("Successfully established a plaintext connection to "+f.path+" through proxy "+v),r(a)):((0,e.log)(t.LogVerbosity.ERROR,"Failed to connect to "+f.path+" through proxy "+v+" with status "+n.statusCode),i())}),s.once("error",r=>{s.removeAllListeners(),(0,e.log)(t.LogVerbosity.ERROR,"Failed to connect to proxy "+v+" with error "+r.message),i()}),s.end()})};const e=requireLogging(),t=requireConstants(),r=require$$0$3,n=require$$3$1,i=requireLogging(),s=requireSubchannelAddress(),a=requireUriParser(),o=require$$6$1,l=requireResolverDns(),c="proxy";function u(e){i.trace(t.LogVerbosity.DEBUG,c,e)}function h(e){const t=e.split("/");if(2!==t.length)return null;const n=parseInt(t[1],10);return!(0,r.isIPv4)(t[0])||Number.isNaN(n)||n<0||n>32?null:{ip:d(t[0]),prefixLength:n}}function d(e){return e.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function p(e,t){const r=e.ip,n=-1<<32-e.prefixLength;return(d(t)&n)===(r&n)}return http_proxy}var subchannelCall={},streamDecoder={},hasRequiredStreamDecoder,hasRequiredSubchannelCall,hasRequiredTransport,hasRequiredSubchannelPool;function requireStreamDecoder(){if(hasRequiredStreamDecoder)return streamDecoder;var e;hasRequiredStreamDecoder=1,Object.defineProperty(streamDecoder,"__esModule",{value:!0}),streamDecoder.StreamDecoder=void 0,function(e){e[e.NO_DATA=0]="NO_DATA",e[e.READING_SIZE=1]="READING_SIZE",e[e.READING_MESSAGE=2]="READING_MESSAGE"}(e||(e={}));return streamDecoder.StreamDecoder=class{constructor(t){this.maxReadMessageLength=t,this.readState=e.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(t){let r,n=0;const i=[];for(;n<t.length;)switch(this.readState){case e.NO_DATA:this.readCompressFlag=t.slice(n,n+1),n+=1,this.readState=e.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case e.READING_SIZE:if(r=Math.min(t.length-n,this.readSizeRemaining),t.copy(this.readPartialSize,4-this.readSizeRemaining,n,n+r),this.readSizeRemaining-=r,n+=r,0===this.readSizeRemaining){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),-1!==this.maxReadMessageLength&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=e.READING_MESSAGE;else{const t=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=e.NO_DATA,i.push(t)}}break;case e.READING_MESSAGE:if(r=Math.min(t.length-n,this.readMessageRemaining),this.readPartialMessage.push(t.slice(n,n+r)),this.readMessageRemaining-=r,n+=r,0===this.readMessageRemaining){const t=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),r=Buffer.concat(t,this.readMessageSize+5);this.readState=e.NO_DATA,i.push(r)}break;default:throw new Error("Unexpected read state")}return i}},streamDecoder}function requireSubchannelCall(){if(hasRequiredSubchannelCall)return subchannelCall;hasRequiredSubchannelCall=1,Object.defineProperty(subchannelCall,"__esModule",{value:!0}),subchannelCall.Http2SubchannelCall=void 0;const e=require$$0$6,t=require$$0$2,r=requireConstants(),n=requireMetadata(),i=requireStreamDecoder(),s=requireLogging(),a=requireConstants();function o(e){const t=`Received HTTP status code ${e}`;let i;switch(e){case 400:i=r.Status.INTERNAL;break;case 401:i=r.Status.UNAUTHENTICATED;break;case 403:i=r.Status.PERMISSION_DENIED;break;case 404:i=r.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:i=r.Status.UNAVAILABLE;break;default:i=r.Status.UNKNOWN}return{code:i,details:t,metadata:new n.Metadata}}return subchannelCall.Http2SubchannelCall=class{constructor(s,a,l,c,u){var h;this.http2Stream=s,this.callEventTracker=a,this.listener=l,this.transport=c,this.callId=u,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;const d=null!==(h=c.getOptions()["grpc.max_receive_message_length"])&&void 0!==h?h:r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new i.StreamDecoder(d),s.on("response",(t,i)=>{let s="";for(const e of Object.keys(t))s+="\t\t"+e+": "+t[e]+"\n";if(this.trace("Received server headers:\n"+s),this.httpStatusCode=t[":status"],i&e.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(t);else{let e;try{e=n.Metadata.fromHttp2Headers(t)}catch(e){return void this.endCall({code:r.Status.UNKNOWN,details:e.message,metadata:new n.Metadata})}this.listener.onReceiveMetadata(e)}}),s.on("trailers",e=>{this.handleTrailers(e)}),s.on("data",e=>{if(this.statusOutput)return;let t;this.trace("receive HTTP/2 data frame of length "+e.length);try{t=this.decoder.write(e)}catch(e){if(void 0!==this.httpStatusCode&&200!==this.httpStatusCode){const e=o(this.httpStatusCode);this.cancelWithStatus(e.code,e.details)}else this.cancelWithStatus(r.Status.RESOURCE_EXHAUSTED,e.message);return}for(const e of t)this.trace("parsed message of length "+e.length),this.callEventTracker.addMessageReceived(),this.tryPush(e)}),s.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),s.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var t;if(this.trace("HTTP/2 stream closed with code "+s.rstCode),(null===(t=this.finalStatus)||void 0===t?void 0:t.code)===r.Status.OK)return;let i,a="";switch(s.rstCode){case e.constants.NGHTTP2_NO_ERROR:if(null!==this.finalStatus)return;if(this.httpStatusCode&&200!==this.httpStatusCode){const e=o(this.httpStatusCode);i=e.code,a=e.details}else i=r.Status.INTERNAL,a=`Received RST_STREAM with code ${s.rstCode} (Call ended without gRPC status)`;break;case e.constants.NGHTTP2_REFUSED_STREAM:i=r.Status.UNAVAILABLE,a="Stream refused by server";break;case e.constants.NGHTTP2_CANCEL:this.connectionDropped?(i=r.Status.UNAVAILABLE,a="Connection dropped"):(i=r.Status.CANCELLED,a="Call cancelled");break;case e.constants.NGHTTP2_ENHANCE_YOUR_CALM:i=r.Status.RESOURCE_EXHAUSTED,a="Bandwidth exhausted or memory limit exceeded";break;case e.constants.NGHTTP2_INADEQUATE_SECURITY:i=r.Status.PERMISSION_DENIED,a="Protocol not secure enough";break;case e.constants.NGHTTP2_INTERNAL_ERROR:i=r.Status.INTERNAL,null===this.internalError?a=`Received RST_STREAM with code ${s.rstCode} (Internal server error)`:"ECONNRESET"===this.internalError.code||"ETIMEDOUT"===this.internalError.code?(i=r.Status.UNAVAILABLE,a=this.internalError.message):a=`Received RST_STREAM with code ${s.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:i=r.Status.INTERNAL,a=`Received RST_STREAM with code ${s.rstCode}`}this.endCall({code:i,details:a,metadata:new n.Metadata,rstCode:s.rstCode})})}),s.on("error",e=>{"ERR_HTTP2_STREAM_ERROR"!==e.code&&(this.trace("Node error event: message="+e.message+" code="+e.code+" errno="+function(e){for(const[r,n]of Object.entries(t.constants.errno))if(n===e)return r;return"Unknown system error "+e}(e.errno)+" syscall="+e.syscall),this.internalError=e),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:r.Status.UNAVAILABLE,details:"Connection dropped",metadata:new n.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){s.trace(a.LogVerbosity.DEBUG,"subchannel_call","["+this.callId+"] "+e)}endCall(e){null!==this.finalStatus&&this.finalStatus.code!==r.Status.OK||(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){null!==this.finalStatus&&(this.finalStatus.code!==r.Status.OK||this.readsClosed&&0===this.unpushedReadMessages.length&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,this.statusOutput||(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t,i="";for(const t of Object.keys(e))i+="\t\t"+t+": "+e[t]+"\n";this.trace("Received server trailers:\n"+i);try{t=n.Metadata.fromHttp2Headers(e)}catch(e){t=new n.Metadata}const s=t.getMap();let a;if("string"==typeof s["grpc-status"]){const e=Number(s["grpc-status"]);this.trace("received status code "+e+" from server"),t.remove("grpc-status");let r="";if("string"==typeof s["grpc-message"]){try{r=decodeURI(s["grpc-message"])}catch(e){r=s["grpc-message"]}t.remove("grpc-message"),this.trace('received status details string "'+r+'" from server')}a={code:e,details:r,metadata:t}}else this.httpStatusCode?(a=o(this.httpStatusCode),a.metadata=t):a={code:r.Status.UNKNOWN,details:"No status information received",metadata:t};this.endCall(a)}destroyHttp2Stream(){var t;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let n;n=(null===(t=this.finalStatus)||void 0===t?void 0:t.code)===r.Status.OK?e.constants.NGHTTP2_NO_ERROR:e.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+n),this.http2Stream.close(n)}}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.endCall({code:e,details:t,metadata:new n.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}getAuthContext(){return this.transport.getAuthContext()}startRead(){if(null!==this.finalStatus&&this.finalStatus.code!==r.Status.OK)return this.readsClosed=!0,void this.maybeOutputStatus();if(this.canPush=!0,this.unpushedReadMessages.length>0){const e=this.unpushedReadMessages.shift();return void this.push(e)}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);const i=t=>{process.nextTick(()=>{var n;let i=r.Status.UNAVAILABLE;"ERR_STREAM_WRITE_AFTER_END"===(null==t?void 0:t.code)&&(i=r.Status.INTERNAL),t&&this.cancelWithStatus(i,`Write error: ${t.message}`),null===(n=e.callback)||void 0===n||n.call(e)})};this.trace("sending data chunk of length "+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,i)}catch(e){this.endCall({code:r.Status.UNAVAILABLE,details:`Write failed with error ${e.message}`,metadata:new n.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}},subchannelCall}function requireTransport(){if(hasRequiredTransport)return transport;hasRequiredTransport=1,Object.defineProperty(transport,"__esModule",{value:!0}),transport.Http2SubchannelConnector=void 0;const e=require$$0$6,t=require$$0$1,r=requireChannelz(),n=requireConstants(),i=requireHttp_proxy(),s=requireLogging(),a=requireResolver(),o=requireSubchannelAddress(),l=requireUriParser(),c=require$$0$3,u=requireSubchannelCall(),h=requireCallNumber(),d="transport",p=require$$12.version,{HTTP2_HEADER_AUTHORITY:f,HTTP2_HEADER_CONTENT_TYPE:g,HTTP2_HEADER_METHOD:v,HTTP2_HEADER_PATH:m,HTTP2_HEADER_TE:A,HTTP2_HEADER_USER_AGENT:y}=e.constants,C=Buffer.from("too_many_pings","ascii");class S{constructor(n,i,a,l){this.session=n,this.options=a,this.remoteName=l,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,o.subchannelAddressToString)(i),0===a["grpc.enable_channelz"]?(this.channelzEnabled=!1,this.streamTracker=new r.ChannelzCallTrackerStub):this.streamTracker=new r.ChannelzCallTracker,this.channelzRef=(0,r.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[a["grpc.primary_user_agent"],`grpc-node-js/${p}`,a["grpc.secondary_user_agent"]].filter(e=>e).join(" "),this.keepaliveTimeMs="grpc.keepalive_time_ms"in a?a["grpc.keepalive_time_ms"]:-1,this.keepaliveTimeoutMs="grpc.keepalive_timeout_ms"in a?a["grpc.keepalive_timeout_ms"]:2e4,this.keepaliveWithoutCalls="grpc.keepalive_permit_without_calls"in a&&1===a["grpc.keepalive_permit_without_calls"],n.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),n.once("goaway",(t,r,n)=>{let i=!1;t===e.constants.NGHTTP2_ENHANCE_YOUR_CALM&&n&&n.equals(C)&&(i=!0),this.trace("connection closed by GOAWAY with code "+t+" and data "+(null==n?void 0:n.toString())),this.reportDisconnectToOwner(i)}),n.once("error",e=>{this.trace("connection closed with error "+e.message),this.handleDisconnect()}),n.socket.once("close",e=>{this.trace("connection closed. hadError="+e),this.handleDisconnect()}),s.isTracerEnabled(d)&&(n.on("remoteSettings",e=>{this.trace("new settings received"+(this.session!==n?" on the old connection":"")+": "+JSON.stringify(e))}),n.on("localSettings",e=>{this.trace("local settings acknowledged by remote"+(this.session!==n?" on the old connection":"")+": "+JSON.stringify(e))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),n.socket instanceof t.TLSSocket?this.authContext={transportSecurityType:"ssl",sslPeerCertificate:n.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){var e,t,r;const n=this.session.socket,i=n.remoteAddress?(0,o.stringToSubchannelAddress)(n.remoteAddress,n.remotePort):null,s=n.localAddress?(0,o.stringToSubchannelAddress)(n.localAddress,n.localPort):null;let a;if(this.session.encrypted){const t=n,r=t.getCipher(),i=t.getCertificate(),s=t.getPeerCertificate();a={cipherSuiteStandardName:null!==(e=r.standardName)&&void 0!==e?e:null,cipherSuiteOtherName:r.standardName?null:r.name,localCertificate:i&&"raw"in i?i.raw:null,remoteCertificate:s&&"raw"in s?s.raw:null}}else a=null;return{remoteAddress:i,localAddress:s,security:a,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:null!==(t=this.session.state.localWindowSize)&&void 0!==t?t:null,remoteFlowControlWindow:null!==(r=this.session.state.remoteWindowSize)&&void 0!==r?r:null}}trace(e){s.trace(n.LogVerbosity.DEBUG,d,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){s.trace(n.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){s.trace(n.LogVerbosity.DEBUG,"transport_flowctrl","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){s.trace(n.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(const e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing())return void(this.pendingSendKeepalivePing=!0);if(this.keepaliveTimer)return void console.error("keepaliveTimeout is not null");this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),null===(t=(e=this.keepaliveTimer).unref)||void 0===t||t.call(e);let r="";try{this.session.ping((e,t,r)=>{this.clearKeepaliveTimeout(),e?(this.keepaliveTrace("Ping failed with error "+e.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(r="Ping returned false")}catch(e){r=(e instanceof Error?e.message:"")||"Unknown error"}r&&(this.keepaliveTrace("Ping send failed: "+r),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),null===(t=(e=this.keepaliveTimer).unref)||void 0===t||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),0===this.activeCalls.size&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),1===this.activeCalls.size&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,r,n,i){const s=e.toHttp2Headers();let a,o,l;s[f]=t,s[y]=this.userAgent,s[g]="application/grpc",s[v]="POST",s[m]=r,s[A]="trailers";try{a=this.session.request(s)}catch(e){throw this.handleDisconnect(),e}return this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed),this.channelzEnabled?(this.streamTracker.addCallStarted(),o={addMessageSent:()=>{var e;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,null===(e=i.addMessageSent)||void 0===e||e.call(i)},addMessageReceived:()=>{var e;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,null===(e=i.addMessageReceived)||void 0===e||e.call(i)},onCallEnd:e=>{var t;null===(t=i.onCallEnd)||void 0===t||t.call(i,e),this.removeActiveCall(l)},onStreamEnd:e=>{var t;e?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),null===(t=i.onStreamEnd)||void 0===t||t.call(i,e)}}):o={addMessageSent:()=>{var e;null===(e=i.addMessageSent)||void 0===e||e.call(i)},addMessageReceived:()=>{var e;null===(e=i.addMessageReceived)||void 0===e||e.call(i)},onCallEnd:e=>{var t;null===(t=i.onCallEnd)||void 0===t||t.call(i,e),this.removeActiveCall(l)},onStreamEnd:e=>{var t;null===(t=i.onStreamEnd)||void 0===t||t.call(i,e)}},l=new u.Http2SubchannelCall(a,o,n,this,(0,h.getNextCallNumber)()),this.addActiveCall(l),l}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,r.unregisterChannelzRef)(this.channelzRef)}}return transport.Http2SubchannelConnector=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){s.trace(n.LogVerbosity.DEBUG,d,(0,l.uriToString)(this.channelTarget)+" "+e)}createSession(t,r,n){return this.isShutdown?Promise.reject():t.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((i,s)=>{var o,c,u,h,d,p,f,g;let v=null,m=this.channelTarget;if("grpc.http_connect_target"in n){const e=(0,l.parseUri)(n["grpc.http_connect_target"]);e&&(m=e,v=(0,l.uriToString)(e))}const A=t.secure?"https":"http",y=(0,a.getDefaultAuthority)(m),C=()=>{var e;null===(e=this.session)||void 0===e||e.destroy(),this.session=null,setImmediate(()=>{w||(w=!0,s(`${x.trim()} (${(new Date).toISOString()})`))})},E=e=>{var t;null===(t=this.session)||void 0===t||t.destroy(),x=e.message,this.trace("connection failed with error "+x),w||(w=!0,s(`${x} (${(new Date).toISOString()})`))},_={createConnection:(e,r)=>t.socket,settings:{initialWindowSize:null!==(h=null!==(o=n["grpc-node.flow_control_window"])&&void 0!==o?o:null===(u=null===(c=e.getDefaultSettings)||void 0===c?void 0:c.call(e))||void 0===u?void 0:u.initialWindowSize)&&void 0!==h?h:65535},maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER,maxSessionMemory:null!==(d=n["grpc-node.max_session_memory"])&&void 0!==d?d:Number.MAX_SAFE_INTEGER},b=e.connect(`${A}://${y}`,_),T=null!==(g=null===(f=null===(p=e.getDefaultSettings)||void 0===p?void 0:p.call(e))||void 0===f?void 0:f.initialWindowSize)&&void 0!==g?g:65535,R=n["grpc-node.flow_control_window"];this.session=b;let x="Failed to connect",w=!1;b.unref(),b.once("remoteSettings",()=>{var e;if(R&&R>T)try{b.setLocalWindowSize(R)}catch(t){const r=R-(null!==(e=b.state.localWindowSize)&&void 0!==e?e:T);r>0&&b.incrementWindowSize(r)}b.removeAllListeners(),t.socket.removeListener("close",C),t.socket.removeListener("error",E),i(new S(b,r,n,v)),this.session=null}),b.once("close",C),b.once("error",E),t.socket.once("close",C),t.socket.once("error",E)})}tcpConnect(e,t){return(0,i.getProxiedConnection)(e,t).then(t=>t||new Promise((t,r)=>{const n=()=>{r(new Error("Socket closed"))},i=e=>{r(e)},s=c.connect(e,()=>{s.removeListener("close",n),s.removeListener("error",i),t(s)});s.once("close",n),s.once("error",i)}))}async connect(e,t,r){if(this.isShutdown)return Promise.reject();let n=null,i=null;const s=(0,o.subchannelAddressToString)(e);try{return this.trace(s+" Waiting for secureConnector to be ready"),await t.waitForReady(),this.trace(s+" secureConnector is ready"),n=await this.tcpConnect(e,r),n.setNoDelay(),this.trace(s+" Established TCP connection"),i=await t.connect(n),this.trace(s+" Established secure connection"),this.createSession(i,e,r)}catch(e){throw null==n||n.destroy(),null==i||i.socket.destroy(),e}}shutdown(){var e;this.isShutdown=!0,null===(e=this.session)||void 0===e||e.close(),this.session=null}},transport}function requireSubchannelPool(){if(hasRequiredSubchannelPool)return subchannelPool;hasRequiredSubchannelPool=1,Object.defineProperty(subchannelPool,"__esModule",{value:!0}),subchannelPool.SubchannelPool=void 0,subchannelPool.getSubchannelPool=function(e){return e?a:new s};const e=requireChannelOptions(),t=requireSubchannel(),r=requireSubchannelAddress(),n=requireUriParser(),i=requireTransport();class s{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(const t in this.pool){const r=this.pool[t].filter(e=>!e.subchannel.unrefIfOneRef());r.length>0&&(e=!1),this.pool[t]=r}e&&null!==this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;null===this.cleanupTimer&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},1e4),null===(t=(e=this.cleanupTimer).unref)||void 0===t||t.call(e))}getOrCreateSubchannel(s,a,o,l){this.ensureCleanupTask();const c=(0,n.uriToString)(s);if(c in this.pool){const t=this.pool[c];for(const n of t)if((0,r.subchannelAddressEqual)(a,n.subchannelAddress)&&(0,e.channelOptionsEqual)(o,n.channelArguments)&&l._equals(n.channelCredentials))return n.subchannel}const u=new t.Subchannel(s,a,o,l,new i.Http2SubchannelConnector(s));return c in this.pool||(this.pool[c]=[]),this.pool[c].push({subchannelAddress:a,channelArguments:o,channelCredentials:l,subchannel:u}),u.ref(),u}}subchannelPool.SubchannelPool=s;const a=new s;return subchannelPool}var loadBalancingCall={},hasRequiredLoadBalancingCall;function requireLoadBalancingCall(){if(hasRequiredLoadBalancingCall)return loadBalancingCall;hasRequiredLoadBalancingCall=1,Object.defineProperty(loadBalancingCall,"__esModule",{value:!0}),loadBalancingCall.LoadBalancingCall=void 0;const e=requireConnectivityState(),t=requireConstants(),r=requireDeadline(),n=requireMetadata(),i=requirePicker(),s=requireUriParser(),a=requireLogging(),o=requireControlPlaneStatus(),l=require$$0$6;return loadBalancingCall.LoadBalancingCall=class{constructor(e,t,r,n,i,a,o){var l,c;this.channel=e,this.callConfig=t,this.methodName=r,this.host=n,this.credentials=i,this.deadline=a,this.callNumber=o,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;const u=this.methodName.split("/");let h="";u.length>=2&&(h=u[1]);const d=null!==(c=null===(l=(0,s.splitHostPort)(this.host))||void 0===l?void 0:l.host)&&void 0!==c?c:"localhost";this.serviceUrl=`https://${d}/${h}`,this.startTime=new Date}getDeadlineInfo(){var e,t;const n=[];return this.childStartTime?(this.childStartTime>this.startTime&&((null===(e=this.metadata)||void 0===e?void 0:e.getOptions().waitForReady)&&n.push("wait_for_ready"),n.push(`LB pick: ${(0,r.formatDateDifference)(this.startTime,this.childStartTime)}`)),n.push(...this.child.getDeadlineInfo()),n):((null===(t=this.metadata)||void 0===t?void 0:t.getOptions().waitForReady)&&n.push("wait_for_ready"),n.push("Waiting for LB pick"),n)}trace(e){a.trace(t.LogVerbosity.DEBUG,"load_balancing_call","["+this.callNumber+"] "+e)}outputStatus(e,t){var r,n;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());const i=Object.assign(Object.assign({},e),{progress:t});null===(r=this.listener)||void 0===r||r.onReceiveStatus(i),null===(n=this.onCallEnded)||void 0===n||n.call(this,i.code,i.details,i.metadata)}}doPick(){var s,a;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");const c=this.metadata.clone(),u=this.channel.doPick(c,this.callConfig.pickInformation),h=u.subchannel?"("+u.subchannel.getChannelzRef().id+") "+u.subchannel.getAddress():""+u.subchannel;switch(this.trace("Pick result: "+i.PickResultType[u.pickResultType]+" subchannel: "+h+" status: "+(null===(s=u.status)||void 0===s?void 0:s.code)+" "+(null===(a=u.status)||void 0===a?void 0:a.details)),u.pickResultType){case i.PickResultType.COMPLETE:this.credentials.compose(u.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(i=>{var s;if(this.ended)this.trace("Credentials metadata generation finished after call ended");else{if(c.merge(i),c.get("authorization").length>1&&this.outputStatus({code:t.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new n.Metadata},"PROCESSED"),u.subchannel.getConnectivityState()!==e.ConnectivityState.READY)return this.trace("Picked subchannel "+h+" has state "+e.ConnectivityState[u.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),void this.doPick();this.deadline!==1/0&&c.set("grpc-timeout",(0,r.getDeadlineTimeoutString)(this.deadline));try{this.child=u.subchannel.getRealSubchannel().createCall(c,this.host,this.methodName,{onReceiveMetadata:e=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(e)},onReceiveMessage:e=>{this.trace("Received message"),this.listener.onReceiveMessage(e)},onReceiveStatus:e=>{this.trace("Received status"),e.rstCode===l.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(e,"REFUSED"):this.outputStatus(e,"PROCESSED")}}),this.childStartTime=new Date}catch(e){return this.trace("Failed to start call on picked subchannel "+h+" with error "+e.message),void this.outputStatus({code:t.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+e.message,metadata:new n.Metadata},"NOT_STARTED")}null===(s=u.onCallStarted)||void 0===s||s.call(u),this.onCallEnded=u.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()}},e=>{const{code:r,details:i}=(0,o.restrictControlPlaneStatusCode)("number"==typeof e.code?e.code:t.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${e.message}`);this.outputStatus({code:r,details:i,metadata:new n.Metadata},"PROCESSED")});break;case i.PickResultType.DROP:const{code:s,details:a}=(0,o.restrictControlPlaneStatusCode)(u.status.code,u.status.details);setImmediate(()=>{this.outputStatus({code:s,details:a,metadata:u.status.metadata},"DROP")});break;case i.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{const{code:e,details:t}=(0,o.restrictControlPlaneStatusCode)(u.status.code,u.status.details);setImmediate(()=>{this.outputStatus({code:e,details:t,metadata:u.status.metadata},"PROCESSED")})}break;case i.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var r;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),null===(r=this.child)||void 0===r||r.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new n.Metadata},"PROCESSED")}getPeer(){var e,t;return null!==(t=null===(e=this.child)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}},loadBalancingCall}var resolvingCall={},hasRequiredResolvingCall;function requireResolvingCall(){if(hasRequiredResolvingCall)return resolvingCall;hasRequiredResolvingCall=1,Object.defineProperty(resolvingCall,"__esModule",{value:!0}),resolvingCall.ResolvingCall=void 0;const e=requireCallCredentials(),t=requireConstants(),r=requireDeadline(),n=requireMetadata(),i=requireLogging(),s=requireControlPlaneStatus();return resolvingCall.ResolvingCall=class{constructor(n,i,s,a,o){this.channel=n,this.method=i,this.filterStackFactory=a,this.callNumber=o,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=e.CallCredentials.createEmpty(),this.deadline=s.deadline,this.host=s.host,s.parentCall&&(s.flags&t.Propagate.CANCELLATION&&s.parentCall.on("cancelled",()=>{this.cancelWithStatus(t.Status.CANCELLED,"Cancelled by parent call")}),s.flags&t.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+s.parentCall.getDeadline()),this.deadline=(0,r.minDeadline)(this.deadline,s.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){i.trace(t.LogVerbosity.DEBUG,"resolving_call","["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,r.deadlineToString)(this.deadline));const e=(0,r.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");const n=()=>{if(!this.deadlineStartTime)return void this.cancelWithStatus(t.Status.DEADLINE_EXCEEDED,"Deadline exceeded");const e=[],n=new Date;e.push(`Deadline exceeded after ${(0,r.formatDateDifference)(this.deadlineStartTime,n)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&e.push(`name resolution: ${(0,r.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&e.push(`metadata filters: ${(0,r.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):e.push("waiting for metadata filters")):e.push("waiting for name resolution"),this.child&&e.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(t.Status.DEADLINE_EXCEEDED,e.join(","))};e<=0?process.nextTick(n):this.deadlineTimer=setTimeout(n,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);const t=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+t.code+' details="'+t.details+'"'),this.statusWatchers.forEach(e=>e(t)),process.nextTick(()=>{var e;null===(e=this.listener)||void 0===e||e.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error("sendMessageonChild called with child not populated");const r=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(t=>{this.writeFilterPending=!1,r.sendMessageWithContext(e,t.message),this.pendingHalfClose&&r.halfClose()},e=>{this.cancelWithStatus(e.code,e.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");const e=this.channel.getConfig(this.method,this.metadata);if("NONE"===e.type)return void this.channel.queueCallForConfig(this);if("ERROR"===e.type)return void(this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error));this.configReceivedTime=new Date;const i=e.config;if(i.status!==t.Status.OK){const{code:e,details:t}=(0,s.restrictControlPlaneStatusCode)(i.status,"Failed to route call to method "+this.method);return void this.outputStatus({code:e,details:t,metadata:new n.Metadata})}if(i.methodConfig.timeout){const e=new Date;e.setSeconds(e.getSeconds()+i.methodConfig.timeout.seconds),e.setMilliseconds(e.getMilliseconds()+i.methodConfig.timeout.nanos/1e6),this.deadline=(0,r.minDeadline)(this.deadline,e),this.runDeadlineTimer()}this.filterStackFactory.push(i.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(e=>{this.child=this.channel.createRetryingCall(i,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(e,{onReceiveMetadata:e=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(e))},onReceiveMessage:e=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(e).then(e=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(e),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},e=>{this.cancelWithStatus(e.code,e.details)})},onReceiveStatus:e=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=e:this.outputStatus(e)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},e=>{this.outputStatus(e)})}reportResolverError(e){var t;(null===(t=this.metadata)||void 0===t?void 0:t.getOptions().waitForReady)?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var r;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),null===(r=this.child)||void 0===r||r.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new n.Metadata})}getPeer(){var e,t;return null!==(t=null===(e=this.child)||void 0===e?void 0:e.getPeer())&&void 0!==t?t:this.channel.getTarget()}start(e,t){this.trace("start called"),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}},resolvingCall}var retryingCall={},hasRequiredRetryingCall;function requireRetryingCall(){if(hasRequiredRetryingCall)return retryingCall;hasRequiredRetryingCall=1,Object.defineProperty(retryingCall,"__esModule",{value:!0}),retryingCall.RetryingCall=retryingCall.MessageBufferTracker=retryingCall.RetryThrottler=void 0;const e=requireConstants(),t=requireDeadline(),r=requireMetadata(),n=requireLogging();retryingCall.RetryThrottler=class{constructor(e,t,r){this.maxTokens=e,this.tokenRatio=t,this.tokens=r?r.tokens*(e/r.maxTokens):e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};retryingCall.MessageBufferTracker=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var r;const n=null!==(r=this.allocatedPerCall.get(t))&&void 0!==r?r:0;return!(this.limitPerCall-n<e||this.totalLimit-this.totalAllocated<e)&&(this.allocatedPerCall.set(t,n+e),this.totalAllocated+=e,!0)}free(e,t){var r;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;const n=null!==(r=this.allocatedPerCall.get(t))&&void 0!==r?r:0;if(n<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${n}`);this.allocatedPerCall.set(t,n-e)}freeAll(e){var t;const r=null!==(t=this.allocatedPerCall.get(e))&&void 0!==t?t:0;if(this.totalAllocated<r)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${r} > total allocated ${this.totalAllocated}`);this.totalAllocated-=r,this.allocatedPerCall.delete(e)}};const i="grpc-previous-rpc-attempts";return retryingCall.RetryingCall=class{constructor(e,t,r,n,i,s,a,o,l){var c;this.channel=e,this.callConfig=t,this.methodName=r,this.host=n,this.credentials=i,this.deadline=s,this.callNumber=a,this.bufferTracker=o,this.retryThrottler=l,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;const u=null!==(c=e.getOptions()["grpc-node.retry_max_attempts_limit"])&&void 0!==c?c:5;if(0===e.getOptions()["grpc.enable_retries"])this.state="NO_RETRY",this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state="RETRY";const e=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(e.initialBackoff.substring(0,e.initialBackoff.length-1)),this.maxAttempts=Math.min(e.maxAttempts,u)}else t.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,u)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(0===this.underlyingCalls.length)return[];const e=[],r=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push("previous attempts: "+(this.underlyingCalls.length-1)),r.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,t.formatDateDifference)(this.startTime,r.startTime)}`),e.push(...r.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(t){n.trace(e.LogVerbosity.DEBUG,"retrying_call","["+this.callNumber+"] "+t)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;null===(t=this.listener)||void 0===t||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.reportStatus({code:e,details:t,metadata:new r.Metadata});for(const{call:r}of this.underlyingCalls)r.cancelWithStatus(e,t)}getPeer(){return null!==this.committedCallIndex?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var t;return null!==(t=this.writeBuffer[e-this.writeBufferOffset])&&void 0!==t?t:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if("COMMITTED"!==this.state)return;let e;e="COMPLETED"===this.underlyingCalls[this.committedCallIndex].state?this.getNextBufferIndex():this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){const e=this.getBufferEntry(t);e.allocated&&this.bufferTracker.free(e.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(t){var r,n;if("COMMITTED"!==this.state){this.trace("Committing call ["+this.underlyingCalls[t].call.getCallNumber()+"] at index "+t),this.state="COMMITTED",null===(n=(r=this.callConfig).onCommitted)||void 0===n||n.call(r),this.committedCallIndex=t;for(let r=0;r<this.underlyingCalls.length;r++)r!==t&&"COMPLETED"!==this.underlyingCalls[r].state&&(this.underlyingCalls[r].state="COMPLETED",this.underlyingCalls[r].call.cancelWithStatus(e.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if("COMMITTED"===this.state)return;let e=-1,t=-1;for(const[r,n]of this.underlyingCalls.entries())"ACTIVE"===n.state&&n.nextMessageToSend>e&&(e=n.nextMessageToSend,t=r);-1===t?this.state="TRANSPARENT_ONLY":this.commitCall(t)}isStatusCodeInList(t,r){return t.some(t=>{var n;return t===r||t.toString().toLowerCase()===(null===(n=e.Status[r])||void 0===n?void 0:n.toLowerCase())})}getNextRetryJitter(){return Math.random()*(1.2-.8)+.8}getNextRetryBackoffMs(){var e;const t=null===(e=this.callConfig)||void 0===e?void 0:e.methodConfig.retryPolicy;if(!t)return 0;const r=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,n=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,n),r}maybeRetryCall(e,t){if("RETRY"!==this.state)return void t(!1);if(this.attempts>=this.maxAttempts)return void t(!1);let r;if(null===e)r=this.getNextRetryBackoffMs();else{if(e<0)return this.state="TRANSPARENT_ONLY",void t(!1);r=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec}setTimeout(()=>{var e,r;"RETRY"===this.state?null===(r=null===(e=this.retryThrottler)||void 0===e?void 0:e.canRetryCall())||void 0===r||r?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),t(!1)):t(!1)},r)}countActiveCalls(){let e=0;for(const t of this.underlyingCalls)"ACTIVE"===(null==t?void 0:t.state)&&(e+=1);return e}handleProcessedStatus(e,t,r){var n,i,s;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(t),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList(null!==(n=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)&&void 0!==n?n:[],e.code)){let n;if(null===(i=this.retryThrottler)||void 0===i||i.addCallFailed(),null===r)n=0;else{if(r<0)return this.state="TRANSPARENT_ONLY",this.commitCall(t),void this.reportStatus(e);n=r}setTimeout(()=>{this.maybeStartHedgingAttempt(),0===this.countActiveCalls()&&(this.commitCall(t),this.reportStatus(e))},n)}else this.commitCall(t),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?(null===(s=this.retryThrottler)||void 0===s||s.addCallFailed(),this.maybeRetryCall(r,r=>{r||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e))}}getPushback(e){const t=e.get("grpc-retry-pushback-ms");if(0===t.length)return null;try{return parseInt(t[0])}catch(e){return-1}}handleChildStatus(t,r){var n;if("COMPLETED"===this.underlyingCalls[r].state)return;if(this.trace("state="+this.state+" handling status with progress "+t.progress+" from child ["+this.underlyingCalls[r].call.getCallNumber()+"] in state "+this.underlyingCalls[r].state),this.underlyingCalls[r].state="COMPLETED",t.code===e.Status.OK)return null===(n=this.retryThrottler)||void 0===n||n.addCallSucceeded(),this.commitCall(r),void this.reportStatus(t);if("NO_RETRY"===this.state)return this.commitCall(r),void this.reportStatus(t);if("COMMITTED"===this.state)return void this.reportStatus(t);const i=this.getPushback(t.metadata);switch(t.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(t,r,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(r),this.reportStatus(t);break;case"PROCESSED":this.handleProcessedStatus(t,r,i)}}maybeStartHedgingAttempt(){"HEDGING"===this.state&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,r;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),"HEDGING"!==this.state)return;if(!this.callConfig.methodConfig.hedgingPolicy)return;const n=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;const i=null!==(e=n.hedgingDelay)&&void 0!==e?e:"0s",s=Number(i.substring(0,i.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},1e3*s),null===(r=(t=this.hedgingTimer).unref)||void 0===r||r.call(t)}startNewAttempt(){const e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);const t=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});const r=this.attempts-1,n=this.initialMetadata.clone();r>0&&n.set(i,`${r}`);let s=!1;e.start(n,{onReceiveMetadata:n=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(t),s=!0,r>0&&n.set(i,`${r}`),"ACTIVE"===this.underlyingCalls[t].state&&this.listener.onReceiveMetadata(n)},onReceiveMessage:r=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(t),"ACTIVE"===this.underlyingCalls[t].state&&this.listener.onReceiveMessage(r)},onReceiveStatus:n=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!s&&r>0&&n.metadata.set(i,`${r}`),this.handleChildStatus(n,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace("start called"),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,t){var r,n;null===(n=(r=this.getBufferEntry(t)).callback)||void 0===n||n.call(r),this.clearSentMessages();this.underlyingCalls[e].nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){const t=this.underlyingCalls[e];if("COMPLETED"===t.state)return;const r=t.nextMessageToSend;if(this.getBufferEntry(r)){const n=this.getBufferEntry(r);switch(n.entryType){case"MESSAGE":t.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,r)}},n.message.message);"HALF_CLOSE"===this.getBufferEntry(r+1).entryType&&(this.trace("Sending halfClose immediately after message to child ["+t.call.getCallNumber()+"] - optimizing for unary/final message"),t.nextMessageToSend+=1,t.call.halfClose());break;case"HALF_CLOSE":t.nextMessageToSend+=1,t.call.halfClose()}}}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);const r={message:t,flags:e.flags},n=this.getNextBufferIndex(),i={entryType:"MESSAGE",message:r,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){process.nextTick(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e)});for(const[e,r]of this.underlyingCalls.entries())"ACTIVE"===r.state&&r.nextMessageToSend===n&&r.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,n)}},t)}else{if(this.commitCallWithMostMessages(),null===this.committedCallIndex)return;const r=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,"ACTIVE"===r.state&&r.nextMessageToSend===n&&r.call.sendMessageWithContext({callback:e=>{this.handleChildWriteCompleted(this.committedCallIndex,n)}},t)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(const e of this.underlyingCalls)"ACTIVE"===(null==e?void 0:e.state)&&e.call.startRead()}halfClose(){this.trace("halfClose called");const e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(const t of this.underlyingCalls)"ACTIVE"===(null==t?void 0:t.state)&&(t.nextMessageToSend!==e&&t.nextMessageToSend!==e-1||(this.trace("Sending halfClose immediately to child ["+t.call.getCallNumber()+"] - all messages already sent"),t.nextMessageToSend+=1,t.call.halfClose()))}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return null!==this.committedCallIndex?this.underlyingCalls[this.committedCallIndex].call.getAuthContext():null}},retryingCall}var subchannelInterface={},hasRequiredSubchannelInterface,hasRequiredInternalChannel,hasRequiredChannel;function requireSubchannelInterface(){if(hasRequiredSubchannelInterface)return subchannelInterface;hasRequiredSubchannelInterface=1,Object.defineProperty(subchannelInterface,"__esModule",{value:!0}),subchannelInterface.BaseSubchannelWrapper=void 0;return subchannelInterface.BaseSubchannelWrapper=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(e=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(const e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),this.refcount-=1,0===this.refcount&&this.destroy()}destroy(){for(const e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}},subchannelInterface}function requireInternalChannel(){return hasRequiredInternalChannel||(hasRequiredInternalChannel=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InternalChannel=e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;const t=requireChannelCredentials(),r=requireResolvingLoadBalancer(),n=requireSubchannelPool(),i=requirePicker(),s=requireMetadata(),a=requireConstants(),o=requireFilterStack(),l=requireCompressionFilter(),c=requireResolver(),u=requireLogging(),h=requireHttp_proxy(),d=requireUriParser(),p=requireConnectivityState(),f=requireChannelz(),g=requireLoadBalancingCall(),v=requireDeadline(),m=requireResolvingCall(),A=requireCallNumber(),y=requireControlPlaneStatus(),C=requireRetryingCall(),S=requireSubchannelInterface(),E=new Map;class _ extends S.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(e,r,n,i)=>{t.throttleKeepalive(i)}}ref(){0===this.refCount&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}}class b{pick(e){return{pickResultType:i.PickResultType.DROP,status:{code:a.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new s.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}}e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";class T{constructor(e){this.target=e,this.trace=new f.ChannelzTrace,this.callTracker=new f.ChannelzCallTracker,this.childrenTracker=new f.ChannelzChildrenTracker,this.state=p.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}}e.InternalChannel=class{constructor(s,g,v){var m,A,S,b,R,x;if(this.credentials=g,this.options=v,this.connectivityState=p.ConnectivityState.IDLE,this.currentPicker=new i.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),"string"!=typeof s)throw new TypeError("Channel target must be a string");if(!(g instanceof t.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(v&&"object"!=typeof v)throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new T(s);const w=(0,d.parseUri)(s);if(null===w)throw new Error(`Could not parse target name "${s}"`);const k=(0,c.mapUriDefaultScheme)(w);if(null===k)throw new Error(`Could not find a default scheme for target name "${s}"`);0===this.options["grpc.enable_channelz"]&&(this.channelzEnabled=!1),this.channelzRef=(0,f.registerChannelzChannel)(s,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,c.getDefaultAuthority)(k);const N=(0,h.mapProxyName)(k,v);this.target=N.target,this.options=Object.assign({},this.options,N.extraOptions),this.subchannelPool=(0,n.getSubchannelPool)(0===(null!==(m=this.options["grpc.use_local_subchannel_pool"])&&void 0!==m?m:0)),this.retryBufferTracker=new C.MessageBufferTracker(null!==(A=this.options["grpc.retry_buffer_size"])&&void 0!==A?A:16777216,null!==(S=this.options["grpc.per_rpc_retry_buffer_size"])&&void 0!==S?S:1048576),this.keepaliveTime=null!==(b=this.options["grpc.keepalive_time_ms"])&&void 0!==b?b:-1,this.idleTimeoutMs=Math.max(null!==(R=this.options["grpc.client_idle_timeout_ms"])&&void 0!==R?R:18e5,1e3);const I={createSubchannel:(t,r)=>{const n={};for(const[t,i]of Object.entries(r))t.startsWith(e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(n[t]=i);const i=this.subchannelPool.getOrCreateSubchannel(this.target,t,n,this.credentials);i.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",i.getChannelzRef());return new _(i,this)},updateState:(e,t)=>{this.currentPicker=t;const r=this.pickQueue.slice();this.pickQueue=[],r.length>0&&this.callRefTimerUnref();for(const e of r)e.doPick();this.updateState(e)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(e)},removeChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(e)}};this.resolvingLoadBalancer=new r.ResolvingLoadBalancer(this.target,I,this.options,(e,t)=>{var r;e.retryThrottling?E.set(this.getTarget(),new C.RetryThrottler(e.retryThrottling.maxTokens,e.retryThrottling.tokenRatio,E.get(this.getTarget()))):E.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),null===(r=this.configSelector)||void 0===r||r.unref(),this.configSelector=t,this.currentResolutionError=null,process.nextTick(()=>{const e=this.configSelectionQueue;this.configSelectionQueue=[],e.length>0&&this.callRefTimerUnref();for(const t of e)t.getConfig()})},e=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+e.code+' and details "'+e.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),null===this.configSelector&&(this.currentResolutionError=Object.assign(Object.assign({},(0,y.restrictControlPlaneStatusCode)(e.code,e.details)),{metadata:e.metadata}));const t=this.configSelectionQueue;this.configSelectionQueue=[],t.length>0&&this.callRefTimerUnref();for(const r of t)r.reportResolverError(e)}),this.filterStackFactory=new o.FilterStackFactory([new l.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(v,void 0,2));const O=new Error;(0,u.isTracerEnabled)("channel_stacktrace")&&(0,u.trace)(a.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+") Channel constructed \n"+(null===(x=O.stack)||void 0===x?void 0:x.substring(O.stack.indexOf("\n")+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,u.trace)(null!=t?t:a.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,d.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,t,r,n;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},2147483647)),(null===(t=(e=this.callRefTimer).hasRef)||void 0===t?void 0:t.call(e))||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),null===(n=(r=this.callRefTimer).ref)||void 0===n||n.call(r))}callRefTimerUnref(){var e,t,r;(null===(e=this.callRefTimer)||void 0===e?void 0:e.hasRef)&&!this.callRefTimer.hasRef()||(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),null===(r=null===(t=this.callRefTimer)||void 0===t?void 0:t.unref)||void 0===r||r.call(t))}removeConnectivityStateWatcher(e){const t=this.connectivityStateWatchers.findIndex(t=>t===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,u.trace)(a.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,d.uriToString)(this.target)+" "+p.ConnectivityState[this.connectivityState]+" -> "+p.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+p.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;const t=this.connectivityStateWatchers.slice();for(const r of t)e!==r.currentState&&(r.timer&&clearTimeout(r.timer),this.removeConnectivityStateWatcher(r),r.callback());e!==p.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(const t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==p.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.IDLE),this.currentPicker=new i.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,r;this.idleTimer=setTimeout(()=>{if(this.callCount>0)return void this.startIdleTimeout(this.idleTimeoutMs);const e=(new Date).valueOf()-this.lastActivityTimestamp.valueOf();e>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-e)},e),null===(r=(t=this.idleTimer).unref)||void 0===r||r.call(t)}maybeStartIdleTimer(){this.connectivityState===p.ConnectivityState.SHUTDOWN||this.idleTimer||this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===a.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,r,n,i){const s=(0,A.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+s+'] method="'+t+'"'),new g.LoadBalancingCall(this,e,t,r,n,i,s)}createRetryingCall(e,t,r,n,i){const s=(0,A.getNextCallNumber)();return this.trace("createRetryingCall ["+s+'] method="'+t+'"'),new C.RetryingCall(this,e,t,r,n,i,s,this.retryBufferTracker,E.get(this.getTarget()))}createResolvingCall(e,t,r,n,i){const s=(0,A.getNextCallNumber)();this.trace("createResolvingCall ["+s+'] method="'+e+'", deadline='+(0,v.deadlineToString)(t));const o={deadline:t,flags:null!=i?i:a.Propagate.DEFAULTS,host:null!=r?r:this.defaultAuthority,parentCall:n},l=new m.ResolvingCall(this,e,o,this.filterStackFactory.clone(),s);return this.onCallStart(),l.addStatusWatcher(e=>{this.onCallEnd(e)}),l}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.SHUTDOWN),this.currentPicker=new b;for(const e of this.configSelectionQueue)e.cancelWithStatus(a.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(const e of this.pickQueue)e.cancelWithStatus(a.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,f.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),null===(e=this.configSelector)||void 0===e||e.unref(),this.configSelector=null}getTarget(){return(0,d.uriToString)(this.target)}getConnectivityState(e){const t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,r){if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let n=null;if(t!==1/0){const e=t instanceof Date?t:new Date(t),s=new Date;if(t===-1/0||e<=s)return void process.nextTick(r,new Error("Deadline passed without connectivity state change"));n=setTimeout(()=>{this.removeConnectivityStateWatcher(i),r(new Error("Deadline passed without connectivity state change"))},e.getTime()-s.getTime())}const i={currentState:e,callback:r,timer:n};this.connectivityStateWatchers.push(i)}getChannelzRef(){return this.channelzRef}createCall(e,t,r,n,i){if("string"!=typeof e)throw new TypeError("Channel#createCall: method must be a string");if(!("number"==typeof t||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,t,r,n,i)}getOptions(){return this.options}}}(internalChannel)),internalChannel}function requireChannel(){if(hasRequiredChannel)return channel;hasRequiredChannel=1,Object.defineProperty(channel,"__esModule",{value:!0}),channel.ChannelImplementation=void 0;const e=requireChannelCredentials(),t=requireInternalChannel();return channel.ChannelImplementation=class{constructor(r,n,i){if("string"!=typeof r)throw new TypeError("Channel target must be a string");if(!(n instanceof e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(i&&"object"!=typeof i)throw new TypeError("Channel options must be an object");this.internalChannel=new t.InternalChannel(r,n,i)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,r){this.internalChannel.watchConnectivityState(e,t,r)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,r,n,i){if("string"!=typeof e)throw new TypeError("Channel#createCall: method must be a string");if(!("number"==typeof t||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,t,r,n,i)}},channel}var server={},serverCall={},hasRequiredServerCall;function requireServerCall(){if(hasRequiredServerCall)return serverCall;hasRequiredServerCall=1,Object.defineProperty(serverCall,"__esModule",{value:!0}),serverCall.ServerDuplexStreamImpl=serverCall.ServerWritableStreamImpl=serverCall.ServerReadableStreamImpl=serverCall.ServerUnaryCallImpl=void 0,serverCall.serverErrorToStatus=i;const e=require$$0$4,t=require$$1$2,r=requireConstants(),n=requireMetadata();function i(e,t){var n;const i={code:r.Status.UNKNOWN,details:"message"in e?e.message:"Unknown Error",metadata:null!==(n=null!=t?t:e.metadata)&&void 0!==n?n:null};return"code"in e&&"number"==typeof e.code&&Number.isInteger(e.code)&&(i.code=e.code,"details"in e&&"string"==typeof e.details&&(i.details=e.details)),i}class s extends e.EventEmitter{constructor(e,t,r,n){super(),this.path=e,this.call=t,this.metadata=r,this.request=n,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}serverCall.ServerUnaryCallImpl=s;class a extends t.Readable{constructor(e,t,r){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=r,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}serverCall.ServerReadableStreamImpl=a;class o extends t.Writable{constructor(e,t,s,a){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=s,this.request=a,this.pendingStatus={code:r.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new n.Metadata,this.on("error",e=>{this.pendingStatus=i(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,t,r){this.call.sendMessage(e,r)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:null!==(t=this.pendingStatus.metadata)&&void 0!==t?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}}serverCall.ServerWritableStreamImpl=o;class l extends t.Duplex{constructor(e,t,s){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=s,this.pendingStatus={code:r.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new n.Metadata,this.on("error",e=>{this.pendingStatus=i(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,t,r){this.call.sendMessage(e,r)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:null!==(t=this.pendingStatus.metadata)&&void 0!==t?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}}return serverCall.ServerDuplexStreamImpl=l,serverCall}var serverCredentials={},hasRequiredServerCredentials;function requireServerCredentials(){if(hasRequiredServerCredentials)return serverCredentials;hasRequiredServerCredentials=1,Object.defineProperty(serverCredentials,"__esModule",{value:!0}),serverCredentials.ServerCredentials=void 0,serverCredentials.createCertificateProviderServerCredentials=function(e,t,r){return new i(e,t,r)},serverCredentials.createServerCredentialsWithInterceptors=function(e,t){return new s(e,t)};const e=requireTlsHelpers();class t{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=null!=t?t:null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(const e of this.watchers)e(this.latestContextOptions)}_isSecure(){return null!==this.serverConstructorOptions}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new r}static createSsl(t,r,i=!1){var s;if(null!==t&&!Buffer.isBuffer(t))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(r))throw new TypeError("keyCertPairs must be an array");if("boolean"!=typeof i)throw new TypeError("checkClientCertificate must be a boolean");const a=[],o=[];for(let e=0;e<r.length;e++){const t=r[e];if(null===t||"object"!=typeof t)throw new TypeError(`keyCertPair[${e}] must be an object`);if(!Buffer.isBuffer(t.private_key))throw new TypeError(`keyCertPair[${e}].private_key must be a Buffer`);if(!Buffer.isBuffer(t.cert_chain))throw new TypeError(`keyCertPair[${e}].cert_chain must be a Buffer`);a.push(t.cert_chain),o.push(t.private_key)}return new n({requestCert:i,ciphers:e.CIPHER_SUITES},{ca:null!==(s=null!=t?t:(0,e.getDefaultRootsData)())&&void 0!==s?s:void 0,cert:a,key:o})}}serverCredentials.ServerCredentials=t;class r extends t{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}}class n extends t{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof n))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let t=0;t<this.options.cert.length;t++){const r=this.options.cert[t],n=e.options.cert[t];if(Buffer.isBuffer(r)&&Buffer.isBuffer(n)){if(!r.equals(n))return!1}else if(r!==n)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let t=0;t<this.options.key.length;t++){const r=this.options.key[t],n=e.options.key[t];if(Buffer.isBuffer(r)&&Buffer.isBuffer(n)){if(!r.equals(n))return!1}else if(r!==n)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}}class i extends t{constructor(t,r,n){super({requestCert:null!==r,rejectUnauthorized:n,ciphers:e.CIPHER_SUITES}),this.identityCertificateProvider=t,this.caCertificateProvider=r,this.requireClientCertificate=n,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;0===this.getWatcherCount()&&(null===(t=this.caCertificateProvider)||void 0===t||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),0===this.getWatcherCount()&&(null===(t=this.caCertificateProvider)||void 0===t||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e||e instanceof i&&(this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate)}calculateSecureContextOptions(){var e;return null===this.latestIdentityUpdate||null!==this.caCertificateProvider&&null===this.latestCaUpdate?null:{ca:null===(e=this.latestCaUpdate)||void 0===e?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){const e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}}class s extends t{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof s))return!1;if(!this.childCredentials._equals(e.childCredentials))return!1;if(this.interceptors.length!==e.interceptors.length)return!1;for(let t=0;t<this.interceptors.length;t++)if(this.interceptors[t]!==e.interceptors[t])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}}return serverCredentials}var serverInterceptors={},orca={},duration={},hasRequiredDuration,hasRequiredOrca,hasRequiredServerInterceptors,hasRequiredServer;function requireDuration(){if(hasRequiredDuration)return duration;hasRequiredDuration=1,Object.defineProperty(duration,"__esModule",{value:!0}),duration.durationMessageToDuration=function(e){return{seconds:Number.parseInt(e.seconds),nanos:e.nanos}},duration.msToDuration=function(e){return{seconds:e/1e3|0,nanos:e%1e3*1e6|0}},duration.durationToMs=function(e){return 1e3*e.seconds+e.nanos/1e6|0},duration.isDuration=function(e){return"number"==typeof e.seconds&&"number"==typeof e.nanos},duration.isDurationMessage=function(e){return"string"==typeof e.seconds&&"number"==typeof e.nanos},duration.parseDuration=function(t){const r=t.match(e);if(!r)return null;return{seconds:Number.parseInt(r[1],10),nanos:r[2]?Number.parseInt(r[2].padEnd(9,"0"),10):0}},duration.durationToString=function(e){if(0===e.nanos)return`${e.seconds}s`;let t;t=e.nanos%1e6==0?1e6:e.nanos%1e3==0?1e3:1;return`${e.seconds}.${e.nanos/t}s`};const e=/^(\d+)(?:\.(\d+))?s$/;return duration}function requireOrca(){return hasRequiredOrca||(hasRequiredOrca=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OrcaOobMetricsSubchannelWrapper=e.GRPC_METRICS_HEADER=e.ServerMetricRecorder=e.PerRequestMetricRecorder=void 0,e.createOrcaClient=c,e.createMetricsReader=function(t,r){return(n,i,s)=>{let a=s.getOpaque(u);if(a)t(a);else{const r=s.get(e.GRPC_METRICS_HEADER);if(r.length>0){a=l().xds.data.orca.v3.OrcaLoadReport.deserialize(r[0]),t(a),s.setOpaque(u,a)}}r&&r(n,i,s)}};const t=requireMakeClient(),r=requireDuration(),n=requireChannelCredentials(),i=requireSubchannelInterface(),s=requireConstants(),a=requireBackoffTimeout(),o=requireConnectivityState();function l(){const e=(0,requireSrc$1().loadSync)("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,t.loadPackageDefinition)(e)}e.PerRequestMetricRecorder=class{constructor(){this.message={}}recordRequestCostMetric(e,t){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=t}recordUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}recordNamedMetric(e,t){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=t}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return l().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};function c(e){return new(0,l().xds.service.orca.v3.OpenRcaService)("unused",n.ChannelCredentials.createInsecure(),{channelOverride:e})}e.ServerMetricRecorder=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{const t=e.request.report_interval?(0,r.durationToMs)((0,r.durationMessageToDuration)(e.request.report_interval)):3e4,n=setInterval(()=>{e.write(this.message)},t);e.on("cancelled",()=>{clearInterval(n)})}}}putUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var t;null===(t=this.message.utilization)||void 0===t||delete t[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){const t=l().xds.service.orca.v3.OpenRcaService.service;e.addService(t,this.serviceImplementation)}},e.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";const u="grpc_orca_load_report";const h="orca_oob_metrics";class d{constructor(e,t){this.metricsListener=e,this.intervalMs=t,this.dataProducer=null}setSubchannel(e){const t=e.getOrCreateDataProducer(h,g);this.dataProducer=t,t.addDataWatcher(this)}destroy(){var e;null===(e=this.dataProducer)||void 0===e||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}}class p{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new a.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();const t=e.getChannel();this.client=c(t),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var t;this.dataWatchers.delete(e),0===this.dataWatchers.size?(this.subchannel.removeDataProducer(h),null===(t=this.metricsCall)||void 0===t||t.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(0===this.dataWatchers.size||!this.orcaSupported||this.subchannel.getConnectivityState()!==o.ConnectivityState.READY)return;const t=Math.min(...Array.from(this.dataWatchers).map(e=>e.getInterval()));if(!this.metricsCall||t!==this.currentInterval){null===(e=this.metricsCall)||void 0===e||e.cancel(),this.currentInterval=t;const n=this.client.streamCoreMetrics({report_interval:(0,r.msToDuration)(t)});this.metricsCall=n,n.on("data",e=>{this.dataWatchers.forEach(t=>{t.onMetricsUpdate(e)})}),n.on("error",e=>{this.metricsCall=null,e.code!==s.Status.UNIMPLEMENTED?e.code!==s.Status.CANCELLED&&this.backoffTimer.runOnce():this.orcaSupported=!1})}}}class f extends i.BaseSubchannelWrapper{constructor(e,t,r){super(e),this.addDataWatcher(new d(t,r))}getWrappedSubchannel(){return this.child}}function g(e){return new p(e)}e.OrcaOobMetricsSubchannelWrapper=f}(orca)),orca}function requireServerInterceptors(){if(hasRequiredServerInterceptors)return serverInterceptors;hasRequiredServerInterceptors=1,Object.defineProperty(serverInterceptors,"__esModule",{value:!0}),serverInterceptors.BaseServerInterceptingCall=serverInterceptors.ServerInterceptingCall=serverInterceptors.ResponderBuilder=serverInterceptors.ServerListenerBuilder=void 0,serverInterceptors.isInterceptingServerListener=function(e){return void 0!==e.onReceiveMetadata&&1===e.onReceiveMetadata.length},serverInterceptors.getServerInterceptingCall=function(e,t,r,n,i,s){const a={path:i.path,requestStream:"clientStream"===i.type||"bidi"===i.type,responseStream:"serverStream"===i.type||"bidi"===i.type,requestDeserialize:i.deserialize,responseSerialize:i.serialize},o=new b(t,r,n,i,s);return e.reduce((e,t)=>t(a,e),o)};const e=requireMetadata(),t=requireConstants(),r=require$$0$6,n=requireError(),i=require$$0$5,s=requireStreamDecoder(),a=requireLogging(),o=require$$0$1,l=requireOrca(),c="server_call";function u(e){a.trace(t.LogVerbosity.DEBUG,c,e)}serverInterceptors.ServerListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};class h{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.cancelled||(this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.cancelled||(this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}}serverInterceptors.ResponderBuilder=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};const d={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveHalfClose:e=>{e()},onCancel:()=>{}},p={start:e=>{e()},sendMetadata:(e,t)=>{t(e)},sendMessage:(e,t)=>{t(e)},sendStatus:(e,t)=>{t(e)}};serverInterceptors.ServerInterceptingCall=class{constructor(e,t){var r,n,i,s;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:null!==(r=null==t?void 0:t.start)&&void 0!==r?r:p.start,sendMetadata:null!==(n=null==t?void 0:t.sendMetadata)&&void 0!==n?n:p.sendMetadata,sendMessage:null!==(i=null==t?void 0:t.sendMessage)&&void 0!==i?i:p.sendMessage,sendStatus:null!==(s=null==t?void 0:t.sendStatus)&&void 0!==s?s:p.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(t=>{var r,n,i,s;const a={onReceiveMetadata:null!==(r=null==t?void 0:t.onReceiveMetadata)&&void 0!==r?r:d.onReceiveMetadata,onReceiveMessage:null!==(n=null==t?void 0:t.onReceiveMessage)&&void 0!==n?n:d.onReceiveMessage,onReceiveHalfClose:null!==(i=null==t?void 0:t.onReceiveHalfClose)&&void 0!==i?i:d.onReceiveHalfClose,onCancel:null!==(s=null==t?void 0:t.onCancel)&&void 0!==s?s:d.onCancel},o=new h(a,e);this.nextCall.start(o)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,e=>{this.processingMetadata=!1,this.nextCall.sendMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(t,r){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new e.Metadata),this.responder.sendMessage(t,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.pendingMessageCallback=r):this.nextCall.sendMessage(e,r)})}sendStatus(e){this.responder.sendStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextCall.sendStatus(e)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};const f="grpc-accept-encoding",g="grpc-encoding",v="grpc-message",m="grpc-status",A="grpc-timeout",y=/(\d{1,8})\s*([HMSmun])/,C={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},S={[f]:"identity,deflate,gzip",[g]:"identity"},E={[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_OK,[r.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},_={waitForTrailers:!0};class b{constructor(n,i,o,h,d){var p,v;this.stream=n,this.callEventTracker=o,this.handler=h,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=t.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=t.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new l.PerRequestMetricRecorder,this.stream.once("error",e=>{}),this.stream.once("close",()=>{var e;u("Request to method "+(null===(e=this.handler)||void 0===e?void 0:e.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:t.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",e=>{this.handleDataFrame(e)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in d&&(this.maxSendMessageSize=d["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in d&&(this.maxReceiveMessageSize=d["grpc.max_receive_message_length"]),this.host=null!==(p=i[":authority"])&&void 0!==p?p:i.host,this.decoder=new s.StreamDecoder(this.maxReceiveMessageSize);const m=e.Metadata.fromHttp2Headers(i);a.isTracerEnabled(c)&&u("Request to "+this.handler.path+" received headers "+JSON.stringify(m.toJSON()));const y=m.get(A);y.length>0&&this.handleTimeoutHeader(y[0]);const C=m.get(g);C.length>0&&(this.incomingEncoding=C[0]),m.remove(A),m.remove(g),m.remove(f),m.remove(r.constants.HTTP2_HEADER_ACCEPT_ENCODING),m.remove(r.constants.HTTP2_HEADER_TE),m.remove(r.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=m;const S=null===(v=n.session)||void 0===v?void 0:v.socket;this.connectionInfo={localAddress:null==S?void 0:S.localAddress,localPort:null==S?void 0:S.localPort,remoteAddress:null==S?void 0:S.remoteAddress,remotePort:null==S?void 0:S.remotePort},this.shouldSendMetrics=!!d["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){const r=e.toString().match(y);if(null===r){const r={code:t.Status.INTERNAL,details:`Invalid ${A} value "${e}"`,metadata:null};return void process.nextTick(()=>{this.sendStatus(r)})}const n=+r[1]*C[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{const e={code:t.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(e)},n)}checkCancelled(){return this.cancelled||!this.stream.destroyed&&!this.stream.closed||(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;null===(e=this.listener)||void 0===e||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new e.Metadata)}serializeMessage(e){const t=this.handler.serialize(e),r=t.byteLength,n=Buffer.allocUnsafe(r+5);return n.writeUInt8(0,0),n.writeUInt32BE(r,1),t.copy(n,5),n}decompressMessage(e,r){const n=e.subarray(5);if("identity"===r)return n;if("deflate"===r||"gzip"===r){let e;return e="deflate"===r?i.createInflate():i.createGunzip(),new Promise((r,i)=>{let s=0;const a=[];e.on("data",r=>{a.push(r),s+=r.byteLength,-1!==this.maxReceiveMessageSize&&s>this.maxReceiveMessageSize&&(e.destroy(),i({code:t.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),e.on("end",()=>{r(Buffer.concat(a))}),e.write(n),e.end()})}return Promise.reject({code:t.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${r}"`})}async decompressAndMaybePush(e){if("COMPRESSED"!==e.type)throw new Error(`Invalid queue entry type: ${e.type}`);const r=1===e.compressedMessage.readUInt8(0)?this.incomingEncoding:"identity";let n;try{n=await this.decompressMessage(e.compressedMessage,r)}catch(e){return void this.sendStatus(e)}try{e.parsedMessage=this.handler.deserialize(n)}catch(e){return void this.sendStatus({code:t.Status.INTERNAL,details:`Error deserializing request: ${e.message}`})}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&"COMPRESSED"!==this.readQueue[0].type){this.isReadPending=!1;const e=this.readQueue.shift();"READABLE"===e.type?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var r;if(this.checkCancelled())return;let n;u("Request to "+this.handler.path+" received data frame of size "+e.length);try{n=this.decoder.write(e)}catch(e){return void this.sendStatus({code:t.Status.RESOURCE_EXHAUSTED,details:e.message})}for(const e of n){this.stream.pause();const t={type:"COMPRESSED",compressedMessage:e,parsedMessage:null};this.readQueue.push(t),this.decompressAndMaybePush(t),null===(r=this.callEventTracker)||void 0===r||r.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){u("Request to "+this.handler.path+" start called"),this.checkCancelled()||(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled())return;if(this.metadataSent)return;this.metadataSent=!0;const t=e?e.toHttp2Headers():null,r=Object.assign(Object.assign(Object.assign({},E),S),t);this.stream.respond(r,_)}sendMessage(e,r){if(this.checkCancelled())return;let i;try{i=this.serializeMessage(e)}catch(e){return void this.sendStatus({code:t.Status.INTERNAL,details:`Error serializing response: ${(0,n.getErrorMessage)(e)}`,metadata:null})}-1!==this.maxSendMessageSize&&i.length-5>this.maxSendMessageSize?this.sendStatus({code:t.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${i.length} vs. ${this.maxSendMessageSize})`,metadata:null}):(this.maybeSendMetadata(),u("Request to "+this.handler.path+" sent data frame of size "+i.length),this.stream.write(i,e=>{var i;e?this.sendStatus({code:t.Status.INTERNAL,details:`Error writing message: ${(0,n.getErrorMessage)(e)}`,metadata:null}):(null===(i=this.callEventTracker)||void 0===i||i.addMessageSent(),r())}))}sendStatus(r){var n,i,s;if(this.checkCancelled())return;u("Request to method "+(null===(n=this.handler)||void 0===n?void 0:n.path)+" ended with status code: "+t.Status[r.code]+" details: "+r.details);const a=null!==(s=null===(i=r.metadata)||void 0===i?void 0:i.clone())&&void 0!==s?s:new e.Metadata;if(this.shouldSendMetrics&&a.set(l.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(r));const e=Object.assign({[m]:r.code,[v]:encodeURI(r.details)},a.toHttp2Headers());this.stream.sendTrailers(e),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(r));const e=Object.assign(Object.assign({[m]:r.code,[v]:encodeURI(r.details)},E),a.toHttp2Headers());this.stream.respond(e,{endStream:!0}),this.notifyOnCancel()}}startRead(){u("Request to "+this.handler.path+" startRead called"),this.checkCancelled()||(this.isReadPending=!0,0===this.readQueue.length?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;const t=null===(e=this.stream.session)||void 0===e?void 0:e.socket;return(null==t?void 0:t.remoteAddress)?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var e;if((null===(e=this.stream.session)||void 0===e?void 0:e.socket)instanceof o.TLSSocket){const e=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:e.raw?e:void 0}}return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}}return serverInterceptors.BaseServerInterceptingCall=b,serverInterceptors}function requireServer(){if(hasRequiredServer)return server;hasRequiredServer=1;var e=server&&server.__runInitializers||function(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0},t=server&&server.__esDecorate||function(e,t,r,n,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d=!1,p=r.length-1;p>=0;p--){var f={};for(var g in n)f[g]="access"===g?{}:n[g];for(var g in n.access)f.access[g]=n.access[g];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,r[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(o=a(v.get))&&(h.get=o),(o=a(v.set))&&(h.set=o),(o=a(v.init))&&i.unshift(o)}else(o=a(v))&&("field"===l?i.unshift(o):h[c]=o)}u&&Object.defineProperty(u,n.name,h),d=!0};Object.defineProperty(server,"__esModule",{value:!0}),server.Server=void 0;const r=require$$0$6,n=require$$1$5,i=requireConstants(),s=requireServerCall(),a=requireServerCredentials(),o=requireResolver(),l=requireLogging(),c=requireSubchannelAddress(),u=requireUriParser(),h=requireChannelz(),d=requireServerInterceptors(),p=2147483647,f=2147483647,g=2147483647,{HTTP2_HEADER_PATH:v}=r.constants,m=Buffer.from("max_age");function A(e){l.trace(i.LogVerbosity.DEBUG,"server_call",e)}function y(){}function C(e){return function(t,r){return n.deprecate(t,e)}}function S(e){return{code:i.Status.UNIMPLEMENTED,details:`The server does not implement the method ${e}`}}let E=(()=>{var n;let E,_=[];return n=class{constructor(t){var r,n,i,s,a,o;this.boundPorts=(e(this,_),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=null!=t?t:{},0===this.options["grpc.enable_channelz"]?(this.channelzEnabled=!1,this.channelzTrace=new h.ChannelzTraceStub,this.callTracker=new h.ChannelzCallTrackerStub,this.listenerChildrenTracker=new h.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new h.ChannelzChildrenTrackerStub):(this.channelzTrace=new h.ChannelzTrace,this.callTracker=new h.ChannelzCallTracker,this.listenerChildrenTracker=new h.ChannelzChildrenTracker,this.sessionChildrenTracker=new h.ChannelzChildrenTracker),this.channelzRef=(0,h.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=null!==(r=this.options["grpc.max_connection_age_ms"])&&void 0!==r?r:p,this.maxConnectionAgeGraceMs=null!==(n=this.options["grpc.max_connection_age_grace_ms"])&&void 0!==n?n:p,this.keepaliveTimeMs=null!==(i=this.options["grpc.keepalive_time_ms"])&&void 0!==i?i:f,this.keepaliveTimeoutMs=null!==(s=this.options["grpc.keepalive_timeout_ms"])&&void 0!==s?s:2e4,this.sessionIdleTimeout=null!==(a=this.options["grpc.max_connection_idle_ms"])&&void 0!==a?a:g,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=null!==(o=this.options.interceptors)&&void 0!==o?o:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(e){var t,r,n;const i=this.sessions.get(e),s=e.socket,a=s.remoteAddress?(0,c.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,o=s.localAddress?(0,c.stringToSubchannelAddress)(s.localAddress,s.localPort):null;let l;if(e.encrypted){const e=s,r=e.getCipher(),n=e.getCertificate(),i=e.getPeerCertificate();l={cipherSuiteStandardName:null!==(t=r.standardName)&&void 0!==t?t:null,cipherSuiteOtherName:r.standardName?null:r.name,localCertificate:n&&"raw"in n?n.raw:null,remoteCertificate:i&&"raw"in i?i.raw:null}}else l=null;return{remoteAddress:a,localAddress:o,security:l,remoteName:null,streamsStarted:i.streamTracker.callsStarted,streamsSucceeded:i.streamTracker.callsSucceeded,streamsFailed:i.streamTracker.callsFailed,messagesSent:i.messagesSent,messagesReceived:i.messagesReceived,keepAlivesSent:i.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:i.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:i.lastMessageSentTimestamp,lastMessageReceivedTimestamp:i.lastMessageReceivedTimestamp,localFlowControlWindow:null!==(r=e.state.localWindowSize)&&void 0!==r?r:null,remoteFlowControlWindow:null!==(n=e.state.remoteWindowSize)&&void 0!==n?n:null}}trace(e){l.trace(i.LogVerbosity.DEBUG,"server","("+this.channelzRef.id+") "+e)}keepaliveTrace(e){l.trace(i.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+e)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(e,t){if(null===e||"object"!=typeof e||null===t||"object"!=typeof t)throw new Error("addService() requires two objects as arguments");const r=Object.keys(e);if(0===r.length)throw new Error("Cannot add an empty service to a server");r.forEach(r=>{const n=e[r];let i;i=n.requestStream?n.responseStream?"bidi":"clientStream":n.responseStream?"serverStream":"unary";let s,a=t[r];void 0===a&&"string"==typeof n.originalName&&(a=t[n.originalName]),s=void 0!==a?a.bind(t):function(e,t){const r=S(t);switch(e){case"unary":case"clientStream":return(e,t)=>{t(r,null)};case"serverStream":case"bidi":return e=>{e.emit("error",r)};default:throw new Error(`Invalid handlerType ${e}`)}}(i,r);if(!1===this.register(n.path,s,n.responseSerialize,n.requestDeserialize,i))throw new Error(`Method handler for ${n.path} already provided.`)})}removeService(e){if(null===e||"object"!=typeof e)throw new Error("removeService() requires object as argument");Object.keys(e).forEach(t=>{const r=e[t];this.unregister(r.path)})}bind(e,t){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(e){return(0,h.registerChannelzSocket)((0,c.subchannelAddressToString)(e),()=>({localAddress:e,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(e){(0,h.unregisterChannelzRef)(e)}createHttp2Server(e){let t;if(e._isSecure()){const n=e._getConstructorOptions(),s=e._getSecureContextOptions(),a=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),n),s),{enableTrace:1===this.options["grpc-node.tls_enable_trace"]});let o=null!==s;this.trace("Initial credentials valid: "+o),t=r.createSecureServer(a),t.prependListener("connection",e=>{o||(this.trace("Dropped connection from "+JSON.stringify(e.address())+" due to unloaded credentials"),e.destroy())}),t.on("secureConnection",e=>{e.on("error",e=>{this.trace("An incoming TLS connection closed with error: "+e.message)})});const c=e=>{if(e){const r=t;try{r.setSecureContext(e)}catch(t){l.log(i.LogVerbosity.ERROR,"Failed to set secure context with error "+t.message),e=null}}o=null!==e,this.trace("Post-update credentials valid: "+o)};e._addWatcher(c),t.on("close",()=>{e._removeWatcher(c)})}else t=r.createServer(this.commonServerOptions);return t.setTimeout(0,y),this._setupHandlers(t,e._getInterceptors()),t}bindOneAddress(e,t){this.trace("Attempting to bind "+(0,c.subchannelAddressToString)(e));const r=this.createHttp2Server(t.credentials);return new Promise((n,i)=>{const s=t=>{this.trace("Failed to bind "+(0,c.subchannelAddressToString)(e)+" with error "+t.message),n({port:"port"in e?e.port:1,error:t.message})};r.once("error",s),r.listen(e,()=>{const e=r.address();let i;i="string"==typeof e?{path:e}:{host:e.address,port:e.port};const a=this.experimentalRegisterListenerToChannelz(i);this.listenerChildrenTracker.refChild(a),this.http2Servers.set(r,{channelzRef:a,sessions:new Set,ownsChannelzRef:!0}),t.listeningServers.add(r),this.trace("Successfully bound "+(0,c.subchannelAddressToString)(i)),n({port:"port"in i?i.port:1}),r.removeListener("error",s)})})}async bindManyPorts(e,t){if(0===e.length)return{count:0,port:0,errors:[]};if((0,c.isTcpSubchannelAddress)(e[0])&&0===e[0].port){const r=await this.bindOneAddress(e[0],t);if(r.error){const n=await this.bindManyPorts(e.slice(1),t);return Object.assign(Object.assign({},n),{errors:[r.error,...n.errors]})}{const n=e.slice(1).map(e=>(0,c.isTcpSubchannelAddress)(e)?{host:e.host,port:r.port}:e),i=await Promise.all(n.map(e=>this.bindOneAddress(e,t))),s=[r,...i];return{count:s.filter(e=>void 0===e.error).length,port:r.port,errors:s.filter(e=>e.error).map(e=>e.error)}}}{const r=await Promise.all(e.map(e=>this.bindOneAddress(e,t)));return{count:r.filter(e=>void 0===e.error).length,port:r[0].port,errors:r.filter(e=>e.error).map(e=>e.error)}}}async bindAddressList(e,t){const r=await this.bindManyPorts(e,t);if(r.count>0)return r.count<e.length&&l.log(i.LogVerbosity.INFO,`WARNING Only ${r.count} addresses added out of total ${e.length} resolved`),r.port;{const t=`No address added out of total ${e.length} resolved`;throw l.log(i.LogVerbosity.ERROR,t),new Error(`${t} errors: [${r.errors.join(",")}]`)}}resolvePort(e){return new Promise((t,r)=>{let n=!1;(0,o.createResolver)(e,(i,s,a,o)=>{if(n)return!0;if(n=!0,!i.ok)return r(new Error(i.error.details)),!0;const l=[].concat(...i.value.map(e=>e.addresses));return 0===l.length?(r(new Error(`No addresses resolved for port ${e}`)),!0):(t(l),!0)},this.options).updateResolution()})}async bindPort(e,t){const r=await this.resolvePort(e);if(t.cancelled)throw this.completeUnbind(t),new Error("bindAsync operation cancelled by unbind call");const n=await this.bindAddressList(r,t);if(t.cancelled)throw this.completeUnbind(t),new Error("bindAsync operation cancelled by unbind call");return n}normalizePort(e){const t=(0,u.parseUri)(e);if(null===t)throw new Error(`Could not parse port "${e}"`);const r=(0,o.mapUriDefaultScheme)(t);if(null===r)throw new Error(`Could not get a default scheme for port "${e}"`);return r}bindAsync(e,t,r){if(this.shutdown)throw new Error("bindAsync called after shutdown");if("string"!=typeof e)throw new TypeError("port must be a string");if(null===t||!(t instanceof a.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if("function"!=typeof r)throw new TypeError("callback must be a function");this.trace("bindAsync port="+e);const n=this.normalizePort(e),i=(e,t)=>{process.nextTick(()=>r(e,t))};let s=this.boundPorts.get((0,u.uriToString)(n));if(s)return t._equals(s.credentials)?(s.cancelled=!1,void(s.completionPromise?s.completionPromise.then(e=>r(null,e),e=>r(e,0)):i(null,s.portNumber))):void i(new Error(`${e} already bound with incompatible credentials`),0);s={mapKey:(0,u.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:t,listeningServers:new Set};const o=(0,u.splitHostPort)(n.path),l=this.bindPort(n,s);s.completionPromise=l,0===(null==o?void 0:o.port)?l.then(e=>{const t={scheme:n.scheme,authority:n.authority,path:(0,u.combineHostPort)({host:o.host,port:e})};s.mapKey=(0,u.uriToString)(t),s.completionPromise=null,s.portNumber=e,this.boundPorts.set(s.mapKey,s),r(null,e)},e=>{r(e,0)}):(this.boundPorts.set(s.mapKey,s),l.then(e=>{s.completionPromise=null,s.portNumber=e,r(null,e)},e=>{r(e,0)}))}registerInjectorToChannelz(){return(0,h.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(e,t,n=!1){if(null===e||!(e instanceof a.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(t);const i=this.createHttp2Server(e),s=new Set;return this.http2Servers.set(i,{channelzRef:t,sessions:s,ownsChannelzRef:n}),{injectConnection:e=>{i.emit("connection",e)},drain:e=>{var t,n;for(const e of s)this.closeSession(e);null===(n=(t=setTimeout(()=>{for(const e of s)e.destroy(r.constants.NGHTTP2_CANCEL)},e)).unref)||void 0===n||n.call(t)},destroy:()=>{this.closeServer(i);for(const e of s)this.closeSession(e)}}}createConnectionInjector(e){if(null===e||!(e instanceof a.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");const t=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(e,t,!0)}closeServer(e,t){this.trace("Closing server with address "+JSON.stringify(e.address()));const r=this.http2Servers.get(e);e.close(()=>{r&&r.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(r.channelzRef),(0,h.unregisterChannelzRef)(r.channelzRef)),this.http2Servers.delete(e),null==t||t()})}closeSession(e,t){var r;this.trace("Closing session initiated by "+(null===(r=e.socket)||void 0===r?void 0:r.remoteAddress));const n=this.sessions.get(e),i=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,h.unregisterChannelzRef)(n.ref)),null==t||t()};e.closed?queueMicrotask(i):e.close(i)}completeUnbind(e){for(const t of e.listeningServers){const r=this.http2Servers.get(t);if(this.closeServer(t,()=>{e.listeningServers.delete(t)}),r)for(const e of r.sessions)this.closeSession(e)}this.boundPorts.delete(e.mapKey)}unbind(e){this.trace("unbind port="+e);const t=this.normalizePort(e),r=(0,u.splitHostPort)(t.path);if(0===(null==r?void 0:r.port))throw new Error("Cannot unbind port 0");const n=this.boundPorts.get((0,u.uriToString)(t));n&&(this.trace("unbinding "+n.mapKey+" originally bound as "+(0,u.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(e,t){var n,i;this.trace("drain port="+e+" graceTimeMs="+t);const s=this.normalizePort(e),a=(0,u.splitHostPort)(s.path);if(0===(null==a?void 0:a.port))throw new Error("Cannot drain port 0");const o=this.boundPorts.get((0,u.uriToString)(s));if(!o)return;const l=new Set;for(const e of o.listeningServers){const t=this.http2Servers.get(e);if(t)for(const e of t.sessions)l.add(e),this.closeSession(e,()=>{l.delete(e)})}null===(i=(n=setTimeout(()=>{for(const e of l)e.destroy(r.constants.NGHTTP2_CANCEL)},t)).unref)||void 0===i||i.call(n)}forceShutdown(){for(const e of this.boundPorts.values())e.cancelled=!0;this.boundPorts.clear();for(const e of this.http2Servers.keys())this.closeServer(e);this.sessions.forEach((e,t)=>{this.closeSession(t),t.destroy(r.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,h.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(e,t,r,n,i){return!this.handlers.has(e)&&(this.handlers.set(e,{func:t,serialize:r,deserialize:n,type:i,path:e}),!0)}unregister(e){return this.handlers.delete(e)}start(){if(0===this.http2Servers.size||[...this.http2Servers.keys()].every(e=>!e.listening))throw new Error("server must be bound in order to start");if(!0===this.started)throw new Error("server is already started");this.started=!0}tryShutdown(e){var t;const r=t=>{(0,h.unregisterChannelzRef)(this.channelzRef),e(t)};let n=0;function i(){n--,0===n&&r()}this.shutdown=!0;for(const[e,r]of this.http2Servers.entries()){n++;const s=r.channelzRef.name;this.trace("Waiting for server "+s+" to close"),this.closeServer(e,()=>{this.trace("Server "+s+" finished closing"),i()});for(const e of r.sessions.keys()){n++;const r=null===(t=e.socket)||void 0===t?void 0:t.remoteAddress;this.trace("Waiting for session "+r+" to close"),this.closeSession(e,()=>{this.trace("Session "+r+" finished closing"),i()})}}0===n&&r()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(e,t){const n=t[r.constants.HTTP2_HEADER_CONTENT_TYPE];return!("string"!=typeof n||!n.startsWith("application/grpc"))||(e.respond({[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1)}_retrieveHandler(e){A("Received call to method "+e+" at address "+this.serverAddressString);const t=this.handlers.get(e);return void 0===t?(A("No handler registered for method "+e+". Sending UNIMPLEMENTED status."),null):t}_respondWithError(e,t,n=null){var s,a;const o=Object.assign({"grpc-status":null!==(s=e.code)&&void 0!==s?s:i.Status.INTERNAL,"grpc-message":e.details,[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_OK,[r.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},null===(a=e.metadata)||void 0===a?void 0:a.toHttp2Headers());t.respond(o,{endStream:!0}),this.callTracker.addCallFailed(),null==n||n.streamTracker.addCallFailed()}_channelzHandler(e,t,r){this.onStreamOpened(t);const n=this.sessions.get(t.session);if(this.callTracker.addCallStarted(),null==n||n.streamTracker.addCallStarted(),!this._verifyContentType(t,r))return this.callTracker.addCallFailed(),void(null==n||n.streamTracker.addCallFailed());const s=r[v],a=this._retrieveHandler(s);if(!a)return void this._respondWithError(S(s),t,n);const o={addMessageSent:()=>{n&&(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{n&&(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:e=>{e.code===i.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:e=>{n&&(e?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},l=(0,d.getServerInterceptingCall)([...e,...this.interceptors],t,r,o,a,this.options);this._runHandlerForCall(l,a)||(this.callTracker.addCallFailed(),null==n||n.streamTracker.addCallFailed(),l.sendStatus({code:i.Status.INTERNAL,details:`Unknown handler type: ${a.type}`}))}_streamHandler(e,t,r){if(this.onStreamOpened(t),!0!==this._verifyContentType(t,r))return;const n=r[v],s=this._retrieveHandler(n);if(!s)return void this._respondWithError(S(n),t,null);const a=(0,d.getServerInterceptingCall)([...e,...this.interceptors],t,r,null,s,this.options);this._runHandlerForCall(a,s)||a.sendStatus({code:i.Status.INTERNAL,details:`Unknown handler type: ${s.type}`})}_runHandlerForCall(e,t){const{type:r}=t;if("unary"===r)!async function(e,t){let r,n;function a(t,r,n,a){t?e.sendStatus((0,s.serverErrorToStatus)(t,n)):e.sendMessage(r,()=>{e.sendStatus({code:i.Status.OK,details:"OK",metadata:null!=n?n:null})})}let o=null;e.start({onReceiveMetadata(t){n=t,e.startRead()},onReceiveMessage(r){o?e.sendStatus({code:i.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null}):(o=r,e.startRead())},onReceiveHalfClose(){if(o){r=new s.ServerWritableStreamImpl(t.path,e,n,o);try{t.func(r,a)}catch(t){e.sendStatus({code:i.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}}else e.sendStatus({code:i.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null})},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}(e,t);else if("clientStream"===r)!function(e,t){let r;function n(t,r,n,a){t?e.sendStatus((0,s.serverErrorToStatus)(t,n)):e.sendMessage(r,()=>{e.sendStatus({code:i.Status.OK,details:"OK",metadata:null!=n?n:null})})}e.start({onReceiveMetadata(a){r=new s.ServerDuplexStreamImpl(t.path,e,a);try{t.func(r,n)}catch(t){e.sendStatus({code:i.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){r.push(e)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}(e,t);else if("serverStream"===r)!function(e,t){let r,n,a=null;e.start({onReceiveMetadata(t){n=t,e.startRead()},onReceiveMessage(r){a?e.sendStatus({code:i.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null}):(a=r,e.startRead())},onReceiveHalfClose(){if(a){r=new s.ServerWritableStreamImpl(t.path,e,n,a);try{t.func(r)}catch(t){e.sendStatus({code:i.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}}else e.sendStatus({code:i.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null})},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}(e,t);else{if("bidi"!==r)return!1;!function(e,t){let r;e.start({onReceiveMetadata(n){r=new s.ServerDuplexStreamImpl(t.path,e,n);try{t.func(r)}catch(t){e.sendStatus({code:i.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){r.push(e)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}(e,t)}return!0}_setupHandlers(e,t){if(null===e)return;const r=e.address();let n="null";r&&(n="string"==typeof r?r:r.address+":"+r.port),this.serverAddressString=n;const i=this.channelzEnabled?this._channelzHandler:this._streamHandler,s=this.channelzEnabled?this._channelzSessionHandler(e):this._sessionHandler(e);e.on("stream",i.bind(this,t)),e.on("session",s)}_sessionHandler(e){return t=>{var n,i;null===(n=this.http2Servers.get(e))||void 0===n||n.sessions.add(t);let s=null,a=null,o=null,l=!1;const c=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==p){const e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;s=setTimeout(()=>{var e,n;l=!0,this.trace("Connection dropped by max connection age: "+(null===(e=t.socket)||void 0===e?void 0:e.remoteAddress));try{t.goaway(r.constants.NGHTTP2_NO_ERROR,~(1<<31),m)}catch(e){return void t.destroy()}t.close(),this.maxConnectionAgeGraceMs!==p&&(a=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),null===(n=a.unref)||void 0===n||n.call(a))},this.maxConnectionAgeMs+n),null===(i=s.unref)||void 0===i||i.call(s)}const u=()=>{o&&(clearTimeout(o),o=null)},h=()=>!t.destroyed&&this.keepaliveTimeMs<f&&this.keepaliveTimeMs>0;let d;const g=()=>{var e;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),o=setTimeout(()=>{u(),d()},this.keepaliveTimeMs),null===(e=o.unref)||void 0===e||e.call(o))};d=()=>{var e;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let r="";try{t.ping((e,r,n)=>{u(),e?(this.keepaliveTrace("Ping failed with error: "+e.message),l=!0,t.destroy()):(this.keepaliveTrace("Received ping response"),g())})||(r="Ping returned false")}catch(e){r=(e instanceof Error?e.message:"")||"Unknown error"}if(r)return this.keepaliveTrace("Ping send failed: "+r),this.trace("Connection dropped due to ping send error: "+r),l=!0,void t.destroy();o=setTimeout(()=>{u(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),l=!0,t.destroy()},this.keepaliveTimeoutMs),null===(e=o.unref)||void 0===e||e.call(o)},g(),t.on("close",()=>{var r,n;l||this.trace(`Connection dropped by client ${null===(r=t.socket)||void 0===r?void 0:r.remoteAddress}`),s&&clearTimeout(s),a&&clearTimeout(a),u(),null!==c&&(clearTimeout(c.timeout),this.sessionIdleTimeouts.delete(t)),null===(n=this.http2Servers.get(e))||void 0===n||n.sessions.delete(t)})}}_channelzSessionHandler(e){return t=>{var n,i,s,a;const o=(0,h.registerChannelzSocket)(null!==(i=null===(n=t.socket)||void 0===n?void 0:n.remoteAddress)&&void 0!==i?i:"unknown",this.getChannelzSessionInfo.bind(this,t),this.channelzEnabled),l={ref:o,streamTracker:new h.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};null===(s=this.http2Servers.get(e))||void 0===s||s.sessions.add(t),this.sessions.set(t,l);const c=`${t.socket.remoteAddress}:${t.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+c),this.trace("Connection established by client "+c),this.sessionChildrenTracker.refChild(o);let u=null,d=null,g=null,v=!1;const A=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==p){const e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;u=setTimeout(()=>{var e;v=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+c);try{t.goaway(r.constants.NGHTTP2_NO_ERROR,~(1<<31),m)}catch(e){return void t.destroy()}t.close(),this.maxConnectionAgeGraceMs!==p&&(d=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),null===(e=d.unref)||void 0===e||e.call(d))},this.maxConnectionAgeMs+n),null===(a=u.unref)||void 0===a||a.call(u)}const y=()=>{g&&(clearTimeout(g),g=null)},C=()=>!t.destroyed&&this.keepaliveTimeMs<f&&this.keepaliveTimeMs>0;let S;const E=()=>{var e;C()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),g=setTimeout(()=>{y(),S()},this.keepaliveTimeMs),null===(e=g.unref)||void 0===e||e.call(g))};S=()=>{var e;if(!C())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let r="";try{const e=t.ping((e,r,n)=>{y(),e?(this.keepaliveTrace("Ping failed with error: "+e.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+e.message+" return in "+r),v=!0,t.destroy()):(this.keepaliveTrace("Received ping response"),E())});e||(r="Ping returned false")}catch(e){r=(e instanceof Error?e.message:"")||"Unknown error"}if(r)return this.keepaliveTrace("Ping send failed: "+r),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+r),v=!0,void t.destroy();l.keepAlivesSent+=1,g=setTimeout(()=>{y(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+c),v=!0,t.destroy()},this.keepaliveTimeoutMs),null===(e=g.unref)||void 0===e||e.call(g)},E(),t.on("close",()=>{var r;v||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+c),this.sessionChildrenTracker.unrefChild(o),(0,h.unregisterChannelzRef)(o),u&&clearTimeout(u),d&&clearTimeout(d),y(),null!==A&&(clearTimeout(A.timeout),this.sessionIdleTimeouts.delete(t)),null===(r=this.http2Servers.get(e))||void 0===r||r.sessions.delete(t),this.sessions.delete(t)})}}enableIdleTimeout(e){var t,r;if(this.sessionIdleTimeout>=g)return null;const n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,e),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,e)};null===(r=(t=n.timeout).unref)||void 0===r||r.call(t),this.sessionIdleTimeouts.set(e,n);const{socket:i}=e;return this.trace("Enable idle timeout for "+i.remoteAddress+":"+i.remotePort),n}onIdleTimeout(e,t){const{socket:r}=t,n=e.sessionIdleTimeouts.get(t);void 0!==n&&0===n.activeStreams&&(Date.now()-n.lastIdle>=e.sessionIdleTimeout?(e.trace("Session idle timeout triggered for "+(null==r?void 0:r.remoteAddress)+":"+(null==r?void 0:r.remotePort)+" last idle at "+n.lastIdle),e.closeSession(t)):n.timeout.refresh())}onStreamOpened(e){const t=e.session,r=this.sessionIdleTimeouts.get(t);r&&(r.activeStreams+=1,e.once("close",r.onClose))}onStreamClose(e){var t,r;const n=this.sessionIdleTimeouts.get(e);n&&(n.activeStreams-=1,0===n.activeStreams&&(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace("Session onStreamClose"+(null===(t=e.socket)||void 0===t?void 0:t.remoteAddress)+":"+(null===(r=e.socket)||void 0===r?void 0:r.remotePort)+" at "+n.lastIdle)))}},(()=>{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;E=[C("Calling start() is no longer necessary. It can be safely omitted.")],t(n,null,E,{kind:"method",name:"start",static:!1,private:!1,access:{has:e=>"start"in e,get:e=>e.start},metadata:e},null,_),e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})})(),n})();return server.Server=E,server}var statusBuilder={},hasRequiredStatusBuilder;function requireStatusBuilder(){if(hasRequiredStatusBuilder)return statusBuilder;hasRequiredStatusBuilder=1,Object.defineProperty(statusBuilder,"__esModule",{value:!0}),statusBuilder.StatusBuilder=void 0;return statusBuilder.StatusBuilder=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){const e={};return null!==this.code&&(e.code=this.code),null!==this.details&&(e.details=this.details),null!==this.metadata&&(e.metadata=this.metadata),e}},statusBuilder}var experimental={},loadBalancerPickFirst={},hasRequiredLoadBalancerPickFirst;function requireLoadBalancerPickFirst(){if(hasRequiredLoadBalancerPickFirst)return loadBalancerPickFirst;hasRequiredLoadBalancerPickFirst=1,Object.defineProperty(loadBalancerPickFirst,"__esModule",{value:!0}),loadBalancerPickFirst.LeafLoadBalancer=loadBalancerPickFirst.PickFirstLoadBalancer=loadBalancerPickFirst.PickFirstLoadBalancingConfig=void 0,loadBalancerPickFirst.shuffled=p,loadBalancerPickFirst.setup=function(){(0,e.registerLoadBalancerType)(u,g,h),(0,e.registerDefaultLoadBalancerType)(u)};const e=requireLoadBalancer(),t=requireConnectivityState(),r=requirePicker(),n=requireSubchannelAddress(),i=requireLogging(),s=requireConstants(),a=requireSubchannelAddress(),o=require$$0$3,l=requireCallInterface();function c(e){i.trace(s.LogVerbosity.DEBUG,"pick_first",e)}const u="pick_first";class h{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return u}toJsonObject(){return{[u]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&"boolean"!=typeof e.shuffleAddressList)throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new h(!0===e.shuffleAddressList)}}loadBalancerPickFirst.PickFirstLoadBalancingConfig=h;class d{constructor(e){this.subchannel=e}pick(e){return{pickResultType:r.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}}function p(e){const t=e.slice();for(let e=t.length-1;e>1;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}const f="grpc-node.internal.pick-first.report_health_status";class g{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=t.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(e,t,r,n,i)=>{this.onSubchannelStateUpdate(e,t,r,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){const e=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(t.ConnectivityState.READY,new d(this.currentPick),null);else if(0===(null===(e=this.latestAddressList)||void 0===e?void 0:e.length)){const e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else if(0===this.children.length)this.updateState(t.ConnectivityState.IDLE,new r.QueuePicker(this),null);else if(this.stickyTransientFailureMode){const e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(t.ConnectivityState.CONNECTING,new r.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF())if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode)this.calculateAndReportNewState();else{this.stickyTransientFailureMode=!0;for(const{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){null!==this.currentPick&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,r,n,i){var s;if(null===(s=this.currentPick)||void 0===s?void 0:s.realSubchannelEquals(e))n!==t.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());else for(const[r,s]of this.children.entries())if(e.realSubchannelEquals(s.subchannel))return n===t.ConnectivityState.READY&&this.pickSubchannel(s.subchannel),n===t.ConnectivityState.TRANSIENT_FAILURE&&(s.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),r===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(r+1)),void s.subchannel.startConnecting()}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(const[r,n]of this.children.entries())if(r>=e){const e=n.subchannel.getConnectivityState();if(e===t.ConnectivityState.IDLE||e===t.ConnectivityState.CONNECTING)return void this.startConnecting(r)}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===t.ConnectivityState.IDLE&&(c("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var t;null===(t=this.children[e])||void 0===t||t.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},250),null===(n=(r=this.connectionDelayTimeout).unref)||void 0===n||n.call(r)}pickSubchannel(e){c("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,r,n){c(t.ConnectivityState[this.currentState]+" -> "+t.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(const e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,r){c("connectToAddressList(["+e.map(e=>(0,n.subchannelAddressToString)(e))+"])");const i=e.map(e=>({subchannel:this.channelControlHelper.createSubchannel(e,r),hasReportedTransientFailure:!1}));for(const{subchannel:e}of i)if(e.getConnectivityState()===t.ConnectivityState.READY)return void this.pickSubchannel(e);for(const{subchannel:e}of i)e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef());this.resetSubchannelList(),this.children=i;for(const{subchannel:e}of this.children)e.addConnectivityStateListener(this.subchannelStateListener);for(const e of this.children)e.subchannel.getConnectivityState()===t.ConnectivityState.TRANSIENT_FAILURE&&(e.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,i,s,l){if(!(i instanceof h))return!1;if(!e.ok)return 0===this.children.length&&null===this.currentPick&&this.channelControlHelper.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;let u=e.value;this.reportHealthStatus=s[f],i.getShuffleAddressList()&&(u=p(u));const d=[].concat(...u.map(e=>e.addresses));c("updateAddressList(["+d.map(e=>(0,n.subchannelAddressToString)(e))+"])");const g=function(e){if(0===e.length)return[];const t=[],r=[],n=[],i=(0,a.isTcpSubchannelAddress)(e[0])&&(0,o.isIPv6)(e[0].host);for(const t of e)(0,a.isTcpSubchannelAddress)(t)&&(0,o.isIPv6)(t.host)?r.push(t):n.push(t);const s=i?r:n,l=i?n:r;for(let e=0;e<Math.max(s.length,l.length);e++)e<s.length&&t.push(s[e]),e<l.length&&t.push(l[e]);return t}(d);return this.latestAddressList=g,this.latestOptions=s,this.connectToAddressList(g,s),this.latestResolutionNote=l,d.length>0||(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===t.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return u}}loadBalancerPickFirst.PickFirstLoadBalancer=g;const v=new h(!1);return loadBalancerPickFirst.LeafLoadBalancer=class{constructor(n,i,s,a){this.endpoint=n,this.options=s,this.resolutionNote=a,this.latestState=t.ConnectivityState.IDLE;const o=(0,e.createChildChannelControlHelper)(i,{updateState:(e,t,r)=>{this.latestState=e,this.latestPicker=t,i.updateState(e,t,r)}});this.pickFirstBalancer=new g(o),this.latestPicker=new r.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,l.statusOrFromValue)([this.endpoint]),v,Object.assign(Object.assign({},this.options),{[f]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==t.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}},loadBalancerPickFirst}var certificateProvider={},hasRequiredCertificateProvider,hasRequiredExperimental;function requireCertificateProvider(){if(hasRequiredCertificateProvider)return certificateProvider;hasRequiredCertificateProvider=1,Object.defineProperty(certificateProvider,"__esModule",{value:!0}),certificateProvider.FileWatcherCertificateProvider=void 0;const e=require$$0,t=requireLogging(),r=requireConstants();function n(e){t.trace(r.LogVerbosity.DEBUG,"certificate_provider",e)}const i=(0,require$$1$5.promisify)(e.readFile);return certificateProvider.FileWatcherCertificateProvider=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,void 0===e.certificateFile!=(void 0===e.privateKeyFile))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(void 0===e.certificateFile&&void 0===e.caCertificateFile)throw new Error("At least one of certificateFile and caCertificateFile must be set");n("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?i(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?i(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?i(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,r])=>{if(this.refreshTimer){n("File watcher read certificates certificate "+e.status+", privateKey "+t.status+", CA certificate "+r.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,"fulfilled"===e.status&&"fulfilled"===t.status?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,"fulfilled"===r.status?this.latestCaUpdate={caCertificate:r.value}:this.latestCaUpdate=null;for(const e of this.identityListeners)e(this.latestIdentityUpdate);for(const e of this.caListeners)e(this.latestCaUpdate)}}),n("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){const e=this.lastUpdateTime?(new Date).getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>2*this.config.refreshIntervalMs&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),n("File watcher started watching")}}maybeStopWatchingFiles(){0===this.caListeners.size&&0===this.identityListeners.size&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),void 0!==this.latestCaUpdate&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),void 0!==this.latestIdentityUpdate&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}},certificateProvider}function requireExperimental(){return hasRequiredExperimental||(hasRequiredExperimental=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=e.createCertificateProviderChannelCredentials=e.FileWatcherCertificateProvider=e.createCertificateProviderServerCredentials=e.createServerCredentialsWithInterceptors=e.BaseSubchannelWrapper=e.registerAdminService=e.FilterStackFactory=e.BaseFilter=e.statusOrFromError=e.statusOrFromValue=e.PickResultType=e.QueuePicker=e.UnavailablePicker=e.ChildLoadBalancerHandler=e.EndpointMap=e.endpointHasAddress=e.endpointToString=e.subchannelAddressToString=e.LeafLoadBalancer=e.isLoadBalancerNameRegistered=e.parseLoadBalancingConfig=e.selectLbConfigFromList=e.registerLoadBalancerType=e.createChildChannelControlHelper=e.BackoffTimeout=e.parseDuration=e.durationToMs=e.splitHostPort=e.uriToString=e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=e.createResolver=e.registerResolver=e.log=e.trace=void 0;var t=requireLogging();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return t.trace}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return t.log}});var r=requireResolver();Object.defineProperty(e,"registerResolver",{enumerable:!0,get:function(){return r.registerResolver}}),Object.defineProperty(e,"createResolver",{enumerable:!0,get:function(){return r.createResolver}}),Object.defineProperty(e,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return r.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var n=requireUriParser();Object.defineProperty(e,"uriToString",{enumerable:!0,get:function(){return n.uriToString}}),Object.defineProperty(e,"splitHostPort",{enumerable:!0,get:function(){return n.splitHostPort}});var i=requireDuration();Object.defineProperty(e,"durationToMs",{enumerable:!0,get:function(){return i.durationToMs}}),Object.defineProperty(e,"parseDuration",{enumerable:!0,get:function(){return i.parseDuration}});var s=requireBackoffTimeout();Object.defineProperty(e,"BackoffTimeout",{enumerable:!0,get:function(){return s.BackoffTimeout}});var a=requireLoadBalancer();Object.defineProperty(e,"createChildChannelControlHelper",{enumerable:!0,get:function(){return a.createChildChannelControlHelper}}),Object.defineProperty(e,"registerLoadBalancerType",{enumerable:!0,get:function(){return a.registerLoadBalancerType}}),Object.defineProperty(e,"selectLbConfigFromList",{enumerable:!0,get:function(){return a.selectLbConfigFromList}}),Object.defineProperty(e,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return a.parseLoadBalancingConfig}}),Object.defineProperty(e,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return a.isLoadBalancerNameRegistered}});var o=requireLoadBalancerPickFirst();Object.defineProperty(e,"LeafLoadBalancer",{enumerable:!0,get:function(){return o.LeafLoadBalancer}});var l=requireSubchannelAddress();Object.defineProperty(e,"subchannelAddressToString",{enumerable:!0,get:function(){return l.subchannelAddressToString}}),Object.defineProperty(e,"endpointToString",{enumerable:!0,get:function(){return l.endpointToString}}),Object.defineProperty(e,"endpointHasAddress",{enumerable:!0,get:function(){return l.endpointHasAddress}}),Object.defineProperty(e,"EndpointMap",{enumerable:!0,get:function(){return l.EndpointMap}});var c=requireLoadBalancerChildHandler();Object.defineProperty(e,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return c.ChildLoadBalancerHandler}});var u=requirePicker();Object.defineProperty(e,"UnavailablePicker",{enumerable:!0,get:function(){return u.UnavailablePicker}}),Object.defineProperty(e,"QueuePicker",{enumerable:!0,get:function(){return u.QueuePicker}}),Object.defineProperty(e,"PickResultType",{enumerable:!0,get:function(){return u.PickResultType}});var h=requireCallInterface();Object.defineProperty(e,"statusOrFromValue",{enumerable:!0,get:function(){return h.statusOrFromValue}}),Object.defineProperty(e,"statusOrFromError",{enumerable:!0,get:function(){return h.statusOrFromError}});var d=requireFilter();Object.defineProperty(e,"BaseFilter",{enumerable:!0,get:function(){return d.BaseFilter}});var p=requireFilterStack();Object.defineProperty(e,"FilterStackFactory",{enumerable:!0,get:function(){return p.FilterStackFactory}});var f=requireAdmin();Object.defineProperty(e,"registerAdminService",{enumerable:!0,get:function(){return f.registerAdminService}});var g=requireSubchannelInterface();Object.defineProperty(e,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return g.BaseSubchannelWrapper}});var v=requireServerCredentials();Object.defineProperty(e,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return v.createServerCredentialsWithInterceptors}}),Object.defineProperty(e,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return v.createCertificateProviderServerCredentials}});var m=requireCertificateProvider();Object.defineProperty(e,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return m.FileWatcherCertificateProvider}});var A=requireChannelCredentials();Object.defineProperty(e,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return A.createCertificateProviderChannelCredentials}});var y=requireInternalChannel();Object.defineProperty(e,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return y.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})}(experimental)),experimental}var resolverUds={},hasRequiredResolverUds;function requireResolverUds(){if(hasRequiredResolverUds)return resolverUds;hasRequiredResolverUds=1,Object.defineProperty(resolverUds,"__esModule",{value:!0}),resolverUds.setup=function(){(0,e.registerResolver)("unix",r)};const e=requireResolver(),t=requireCallInterface();class r{constructor(e,t,r){let n;this.listener=t,this.hasReturnedResult=!1,this.endpoints=[],n=""===e.authority?"/"+e.path:e.path,this.endpoints=[{addresses:[{path:n}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,t.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}}return resolverUds}var resolverIp={},hasRequiredResolverIp;function requireResolverIp(){if(hasRequiredResolverIp)return resolverIp;hasRequiredResolverIp=1,Object.defineProperty(resolverIp,"__esModule",{value:!0}),resolverIp.setup=function(){(0,i.registerResolver)(c,h),(0,i.registerResolver)(u,h)};const e=require$$0$3,t=requireCallInterface(),r=requireConstants(),n=requireMetadata(),i=requireResolver(),s=requireSubchannelAddress(),a=requireUriParser(),o=requireLogging();function l(e){o.trace(r.LogVerbosity.DEBUG,"ip_resolver",e)}const c="ipv4",u="ipv6";class h{constructor(t,i,o){var h;this.listener=i,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,l("Resolver constructed for target "+(0,a.uriToString)(t));const d=[];if(t.scheme!==c&&t.scheme!==u)return void(this.error={code:r.Status.UNAVAILABLE,details:`Unrecognized scheme ${t.scheme} in IP resolver`,metadata:new n.Metadata});const p=t.path.split(",");for(const i of p){const s=(0,a.splitHostPort)(i);if(null===s)return void(this.error={code:r.Status.UNAVAILABLE,details:`Failed to parse ${t.scheme} address ${i}`,metadata:new n.Metadata});if(t.scheme===c&&!(0,e.isIPv4)(s.host)||t.scheme===u&&!(0,e.isIPv6)(s.host))return void(this.error={code:r.Status.UNAVAILABLE,details:`Failed to parse ${t.scheme} address ${i}`,metadata:new n.Metadata});d.push({host:s.host,port:null!==(h=s.port)&&void 0!==h?h:443})}this.endpoints=d.map(e=>({addresses:[e]})),l("Parsed "+t.scheme+" address list "+d.map(s.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,t.statusOrFromError)(this.error),{},null,""):this.listener((0,t.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}}return resolverIp}var loadBalancerRoundRobin={},hasRequiredLoadBalancerRoundRobin;function requireLoadBalancerRoundRobin(){if(hasRequiredLoadBalancerRoundRobin)return loadBalancerRoundRobin;hasRequiredLoadBalancerRoundRobin=1,Object.defineProperty(loadBalancerRoundRobin,"__esModule",{value:!0}),loadBalancerRoundRobin.RoundRobinLoadBalancer=void 0,loadBalancerRoundRobin.setup=function(){(0,e.registerLoadBalancerType)(l,h,c)};const e=requireLoadBalancer(),t=requireConnectivityState(),r=requirePicker(),n=requireLogging(),i=requireConstants(),s=requireSubchannelAddress(),a=requireLoadBalancerPickFirst();function o(e){n.trace(i.LogVerbosity.DEBUG,"round_robin",e)}const l="round_robin";class c{getLoadBalancerName(){return l}constructor(){}toJsonObject(){return{[l]:{}}}static createFromJson(e){return new c}}class u{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){const t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}}class h{constructor(r){this.channelControlHelper=r,this.children=[],this.currentState=t.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,e.createChildChannelControlHelper)(r,{updateState:(e,r,n)=>{this.currentState===t.ConnectivityState.READY&&e!==t.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),n&&(this.lastError=n),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(t.ConnectivityState.READY)>0){const e=this.children.filter(e=>e.getConnectivityState()===t.ConnectivityState.READY);let r=0;if(null!==this.currentReadyPicker){const t=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(e=>(0,s.endpointEqual)(e.getEndpoint(),t)),r<0&&(r=0)}this.updateState(t.ConnectivityState.READY,new u(e.map(e=>({endpoint:e.getEndpoint(),picker:e.getPicker()})),r),null)}else if(this.countChildrenWithState(t.ConnectivityState.CONNECTING)>0)this.updateState(t.ConnectivityState.CONNECTING,new r.QueuePicker(this),null);else if(this.countChildrenWithState(t.ConnectivityState.TRANSIENT_FAILURE)>0){const e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(t.ConnectivityState.IDLE,new r.QueuePicker(this),null);for(const e of this.children)e.getConnectivityState()===t.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){o(t.ConnectivityState[this.currentState]+" -> "+t.ConnectivityState[e]),e===t.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(const e of this.children)e.destroy();this.children=[]}updateAddressList(e,n,i,l){if(!(n instanceof c))return!1;if(!e.ok)return 0===this.children.length&&this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;const u=Math.random()*e.value.length|0,h=function(e,t){return[...e.slice(t),...e.slice(0,t)]}(e.value,u);if(this.resetSubchannelList(),0===h.length){const e=`No addresses resolved. Resolution note: ${l}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}o("Connect to endpoint list "+h.map(s.endpointToString)),this.updatesPaused=!0,this.children=h.map(e=>new a.LeafLoadBalancer(e,this.childChannelControlHelper,i,l));for(const e of this.children)e.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return l}}return loadBalancerRoundRobin.RoundRobinLoadBalancer=h,loadBalancerRoundRobin}var loadBalancerOutlierDetection={},hasRequiredLoadBalancerOutlierDetection;function requireLoadBalancerOutlierDetection(){if(hasRequiredLoadBalancerOutlierDetection)return loadBalancerOutlierDetection;var e;hasRequiredLoadBalancerOutlierDetection=1,Object.defineProperty(loadBalancerOutlierDetection,"__esModule",{value:!0}),loadBalancerOutlierDetection.OutlierDetectionLoadBalancer=loadBalancerOutlierDetection.OutlierDetectionLoadBalancingConfig=void 0,loadBalancerOutlierDetection.setup=function(){p&&(0,i.registerLoadBalancerType)(d,_,y)};const t=requireConnectivityState(),r=requireConstants(),n=requireDuration(),i=requireExperimental(),s=requireLoadBalancer(),a=requireLoadBalancerChildHandler(),o=requirePicker(),l=requireSubchannelAddress(),c=requireSubchannelInterface(),u=requireLogging();function h(e){u.trace(r.LogVerbosity.DEBUG,"outlier_detection",e)}const d="outlier_detection",p="true"===(null!==(e=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)&&void 0!==e?e:"true"),f={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},g={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function v(e,t,r,n){if(t in e&&void 0!==e[t]&&typeof e[t]!==r){throw new Error(`outlier detection config ${n?`${n}.${t}`:t} parse error: expected ${r}, got ${typeof e[t]}`)}}function m(e,t,r){const i=t;if(t in e&&void 0!==e[t]){if(!(0,n.isDuration)(e[t]))throw new Error(`outlier detection config ${i} parse error: expected Duration, got ${typeof e[t]}`);if(!(e[t].seconds>=0&&e[t].seconds<=315576e6&&e[t].nanos>=0&&e[t].nanos<=999999999))throw new Error(`outlier detection config ${i} parse error: values out of range for non-negative Duaration`)}}function A(e,t,r){const n=r?`${r}.${t}`:t;if(v(e,t,"number",r),t in e&&void 0!==e[t]&&!(e[t]>=0&&e[t]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}class y{constructor(e,t,r,n,i,s,a){if(this.childPolicy=a,"pick_first"===a.getLoadBalancerName())throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=null!=e?e:1e4,this.baseEjectionTimeMs=null!=t?t:3e4,this.maxEjectionTimeMs=null!=r?r:3e5,this.maxEjectionPercent=null!=n?n:10,this.successRateEjection=i?Object.assign(Object.assign({},f),i):null,this.failurePercentageEjection=s?Object.assign(Object.assign({},g),s):null}getLoadBalancerName(){return d}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,n.msToDuration)(this.intervalMs),base_ejection_time:(0,n.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,n.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:null!==(e=this.successRateEjection)&&void 0!==e?e:void 0,failure_percentage_ejection:null!==(t=this.failurePercentageEjection)&&void 0!==t?t:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var t;if(m(e,"interval"),m(e,"base_ejection_time"),m(e,"max_ejection_time"),A(e,"max_ejection_percent"),"success_rate_ejection"in e&&void 0!==e.success_rate_ejection){if("object"!=typeof e.success_rate_ejection)throw new Error("outlier detection config success_rate_ejection must be an object");v(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),A(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),v(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),v(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&void 0!==e.failure_percentage_ejection){if("object"!=typeof e.failure_percentage_ejection)throw new Error("outlier detection config failure_percentage_ejection must be an object");A(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),A(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),v(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),v(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");const r=(0,s.selectLbConfigFromList)(e.child_policy);if(!r)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new y(e.interval?(0,n.durationToMs)(e.interval):null,e.base_ejection_time?(0,n.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,n.durationToMs)(e.max_ejection_time):null,null!==(t=e.max_ejection_percent)&&void 0!==t?t:null,e.success_rate_ejection,e.failure_percentage_ejection,r)}}loadBalancerOutlierDetection.OutlierDetectionLoadBalancingConfig=y;class C extends c.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){const e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}}class S{constructor(){this.activeBucket={success:0,failure:0},this.inactiveBucket={success:0,failure:0}}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket={success:0,failure:0}}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}}class E{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){const t=this.wrappedPicker.pick(e);if(t.pickResultType===o.PickResultType.COMPLETE){const e=t.subchannel,n=e.getMapEntry();if(n){let i=t.onCallEnded;return this.countCalls&&(i=(e,i,s)=>{var a;e===r.Status.OK?n.counter.addSuccess():n.counter.addFailure(),null===(a=t.onCallEnded)||void 0===a||a.call(t,e,i,s)}),Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel(),onCallEnded:i})}return Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel()})}return t}}class _{constructor(e){this.entryMap=new l.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new a.ChildLoadBalancerHandler((0,i.createChildChannelControlHelper)(e,{createSubchannel:(t,r)=>{const n=e.createSubchannel(t,r),i=this.entryMap.getForSubchannelAddress(t),s=new C(n,i);return null!==(null==i?void 0:i.currentEjectionTimestamp)&&s.eject(),null==i||i.subchannelWrappers.push(s),s},updateState:(r,n,i)=>{r===t.ConnectivityState.READY?e.updateState(r,new E(n,this.isCountingEnabled()),i):e.updateState(r,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return null!==this.latestConfig&&(null!==this.latestConfig.getSuccessRateEjectionConfig()||null!==this.latestConfig.getFailurePercentageEjectionConfig())}getCurrentEjectionPercent(){let e=0;for(const t of this.entryMap.values())null!==t.currentEjectionTimestamp&&(e+=1);return 100*e/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;const t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;h("Running success rate check");const r=t.request_volume;let n=0;const i=[];for(const[e,t]of this.entryMap.entries()){const s=t.counter.getLastSuccesses(),a=t.counter.getLastFailures();h("Stats for "+(0,l.endpointToString)(e)+": successes="+s+" failures="+a+" targetRequestVolume="+r),s+a>=r&&(n+=1,i.push(s/(s+a)))}if(h("Found "+n+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+i+"]"),n<t.minimum_hosts)return;const s=i.reduce((e,t)=>e+t)/i.length;let a=0;for(const e of i){const t=e-s;a+=t*t}const o=a/i.length,c=Math.sqrt(o),u=s-c*(t.stdev_factor/1e3);h("stdev="+c+" ejectionThreshold="+u);for(const[n,i]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;const s=i.counter.getLastSuccesses(),a=i.counter.getLastFailures();if(s+a<r)continue;const o=s/(s+a);if(h("Checking candidate "+n+" successRate="+o),o<u){const r=100*Math.random();h("Candidate "+n+" randomNumber="+r+" enforcement_percentage="+t.enforcement_percentage),r<t.enforcement_percentage&&(h("Ejecting candidate "+n),this.eject(i,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;const t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;h("Running failure percentage check. threshold="+t.threshold+" request volume threshold="+t.request_volume);let r=0;for(const e of this.entryMap.values()){e.counter.getLastSuccesses()+e.counter.getLastFailures()>=t.request_volume&&(r+=1)}if(!(r<t.minimum_hosts))for(const[r,n]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;const i=n.counter.getLastSuccesses(),s=n.counter.getLastFailures();if(h("Candidate successes="+i+" failures="+s),i+s<t.request_volume)continue;if(100*s/(s+i)>t.threshold){const i=100*Math.random();h("Candidate "+r+" randomNumber="+i+" enforcement_percentage="+t.enforcement_percentage),i<t.enforcement_percentage&&(h("Ejecting candidate "+r),this.eject(n,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(const t of e.subchannelWrappers)t.eject()}uneject(e){e.currentEjectionTimestamp=null;for(const t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(const e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,r;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),null===(r=(t=this.ejectionTimer).unref)||void 0===r||r.call(t)}runChecks(){const e=new Date;if(h("Ejection timer running"),this.switchAllBuckets(),this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(const[e,t]of this.entryMap.entries())if(null===t.currentEjectionTimestamp)t.ejectionTimeMultiplier>0&&(t.ejectionTimeMultiplier-=1);else{const r=this.latestConfig.getBaseEjectionTimeMs(),n=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(t.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(r*t.ejectionTimeMultiplier,Math.max(r,n))),i<new Date&&(h("Unejecting "+e),this.uneject(t))}}}updateAddressList(e,t,r,n){if(!(t instanceof y))return!1;if(h("Received update with config: "+JSON.stringify(t.toJsonObject(),void 0,2)),e.ok){for(const t of e.value)this.entryMap.has(t)||(h("Adding map entry for "+(0,l.endpointToString)(t)),this.entryMap.set(t,{counter:new S,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}const i=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,i,r,n),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){h("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);const e=t.getIntervalMs()-((new Date).getTime()-this.timerStartTime.getTime());this.startTimer(e)}else h("Starting new timer"),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{h("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(const e of this.entryMap.values())this.uneject(e),e.ejectionTimeMultiplier=0}return this.latestConfig=t,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return d}}return loadBalancerOutlierDetection.OutlierDetectionLoadBalancer=_,loadBalancerOutlierDetection}var loadBalancerWeightedRoundRobin={},priorityQueue={},hasRequiredPriorityQueue,hasRequiredLoadBalancerWeightedRoundRobin,hasRequiredSrc;function requirePriorityQueue(){if(hasRequiredPriorityQueue)return priorityQueue;hasRequiredPriorityQueue=1,Object.defineProperty(priorityQueue,"__esModule",{value:!0}),priorityQueue.PriorityQueue=void 0;const e=e=>Math.floor(e/2),t=e=>2*e+1,r=e=>2*e+2;return priorityQueue.PriorityQueue=class{constructor(e=(e,t)=>e>t){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return 0==this.size()}peek(){return this.heap[0]}push(...e){return e.forEach(e=>{this.heap.push(e),this.siftUp()}),this.size()}pop(){const e=this.peek(),t=this.size()-1;return t>0&&this.swap(0,t),this.heap.pop(),this.siftDown(),e}replace(e){const t=this.peek();return this.heap[0]=e,this.siftDown(),t}greater(e,t){return this.comparator(this.heap[e],this.heap[t])}swap(e,t){[this.heap[e],this.heap[t]]=[this.heap[t],this.heap[e]]}siftUp(){let t=this.size()-1;for(;t>0&&this.greater(t,e(t));)this.swap(t,e(t)),t=e(t)}siftDown(){let e=0;for(;t(e)<this.size()&&this.greater(t(e),e)||r(e)<this.size()&&this.greater(r(e),e);){let n=r(e)<this.size()&&this.greater(r(e),t(e))?r(e):t(e);this.swap(e,n),e=n}}},priorityQueue}function requireLoadBalancerWeightedRoundRobin(){if(hasRequiredLoadBalancerWeightedRoundRobin)return loadBalancerWeightedRoundRobin;hasRequiredLoadBalancerWeightedRoundRobin=1,Object.defineProperty(loadBalancerWeightedRoundRobin,"__esModule",{value:!0}),loadBalancerWeightedRoundRobin.WeightedRoundRobinLoadBalancingConfig=void 0,loadBalancerWeightedRoundRobin.setup=function(){(0,n.registerLoadBalancerType)(h,v,f)};const e=requireConnectivityState(),t=requireConstants(),r=requireDuration(),n=requireLoadBalancer(),i=requireLoadBalancerPickFirst(),s=requireLogging(),a=requireOrca(),o=requirePicker(),l=requirePriorityQueue(),c=requireSubchannelAddress();function u(e){s.trace(t.LogVerbosity.DEBUG,"weighted_round_robin",e)}const h="weighted_round_robin";function d(e,t,r){if(t in e&&void 0!==e[t]&&typeof e[t]!==r)throw new Error(`weighted round robin config ${t} parse error: expected ${r}, got ${typeof e[t]}`)}function p(e,t){if(t in e&&void 0!==e[t]&&null!==e[t]){let n;if((0,r.isDuration)(e[t]))n=e[t];else if((0,r.isDurationMessage)(e[t]))n=(0,r.durationMessageToDuration)(e[t]);else{if("string"!=typeof e[t])throw new Error(`weighted round robin config ${t}: expected duration, got ${typeof e[t]}`);{const i=(0,r.parseDuration)(e[t]);if(!i)throw new Error(`weighted round robin config ${t}: failed to parse duration string ${e[t]}`);n=i}}return(0,r.durationToMs)(n)}return null}class f{constructor(e,t,r,n,i,s){this.enableOobLoadReport=null!=e&&e,this.oobLoadReportingPeriodMs=null!=t?t:1e4,this.blackoutPeriodMs=null!=r?r:1e4,this.weightExpirationPeriodMs=null!=n?n:18e4,this.weightUpdatePeriodMs=Math.max(null!=i?i:1e3,100),this.errorUtilizationPenalty=null!=s?s:1}getLoadBalancerName(){return h}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,r.durationToString)((0,r.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,r.durationToString)((0,r.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,r.durationToString)((0,r.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,r.durationToString)((0,r.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(d(e,"enable_oob_load_report","boolean"),d(e,"error_utilization_penalty","number"),e.error_utilization_penalty<0)throw new Error("weighted round robin config error_utilization_penalty < 0");return new f(e.enable_oob_load_report,p(e,"oob_load_reporting_period"),p(e,"blackout_period"),p(e,"weight_expiration_period"),p(e,"weight_update_period"),e.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}}loadBalancerWeightedRoundRobin.WeightedRoundRobinLoadBalancingConfig=f;class g{constructor(e,t){this.metricsHandler=t,this.queue=new l.PriorityQueue((e,t)=>e.deadline<t.deadline);const r=e.filter(e=>e.weight>0);let n;if(r.length<2)n=1;else{let e=0;for(const{weight:t}of r)e+=t;n=e/r.length}for(const t of e){const e=t.weight>0?1/t.weight:n;this.queue.push({endpointName:t.endpointName,picker:t.picker,period:e,deadline:Math.random()*e})}}pick(e){const t=this.queue.pop();this.queue.push(Object.assign(Object.assign({},t),{deadline:t.deadline+t.period}));const r=t.picker.pick(e);if(r.pickResultType===o.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},r),{onCallEnded:(0,a.createMetricsReader)(e=>this.metricsHandler(e,t.endpointName),r.onCallEnded)});{const e=r.subchannel;return Object.assign(Object.assign({},r),{subchannel:e.getWrappedSubchannel()})}}return r}}class v{constructor(t){this.channelControlHelper=t,this.latestConfig=null,this.children=new Map,this.currentState=e.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let t=0;for(const r of this.children.values())r.child.getConnectivityState()===e&&(t+=1);return t}updateWeight(e,t){var r,n;const i=t.rps_fractional;let s=t.application_utilization;s>0&&i>0&&(s+=t.eps/i*(null!==(n=null===(r=this.latestConfig)||void 0===r?void 0:r.getErrorUtilizationPenalty())&&void 0!==n?n:0));const a=0===s?0:i/s;if(0===a)return;const o=new Date;null===e.nonEmptySince&&(e.nonEmptySince=o),e.lastUpdated=o,e.weight=a}getWeight(e){if(!this.latestConfig)return 0;const t=(new Date).getTime();if(t-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;const r=this.latestConfig.getBlackoutPeriodMs();return r>0&&(null===e.nonEmptySince||t-e.nonEmptySince.getTime()<r)?0:e.weight}calculateAndUpdateState(){if(!this.updatesPaused&&this.latestConfig){if(this.countChildrenWithState(e.ConnectivityState.READY)>0){const t=[];for(const[r,n]of this.children)n.child.getConnectivityState()===e.ConnectivityState.READY&&t.push({endpointName:r,picker:n.child.getPicker(),weight:this.getWeight(n)});let r;u("Created picker with weights: "+t.map(e=>e.endpointName+":"+e.weight).join(",")),r=this.latestConfig.getEnableOobLoadReport()?null:(e,t)=>{const r=this.children.get(t);r&&this.updateWeight(r,e)},this.updateState(e.ConnectivityState.READY,new g(t,r),null)}else if(this.countChildrenWithState(e.ConnectivityState.CONNECTING)>0)this.updateState(e.ConnectivityState.CONNECTING,new o.QueuePicker(this),null);else if(this.countChildrenWithState(e.ConnectivityState.TRANSIENT_FAILURE)>0){const t=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(e.ConnectivityState.TRANSIENT_FAILURE,new o.UnavailablePicker({details:t}),t)}else this.updateState(e.ConnectivityState.IDLE,new o.QueuePicker(this),null);for(const{child:t}of this.children.values())t.getConnectivityState()===e.ConnectivityState.IDLE&&t.exitIdle()}}updateState(t,r,n){u(e.ConnectivityState[this.currentState]+" -> "+e.ConnectivityState[t]),this.currentState=t,this.channelControlHelper.updateState(t,r,n)}updateAddressList(t,r,s,l){var h,d;if(!(r instanceof f))return!1;if(!t.ok)return 0===this.children.size&&this.updateState(e.ConnectivityState.TRANSIENT_FAILURE,new o.UnavailablePicker(t.error),t.error.details),!0;if(0===t.value.length){const t=`No addresses resolved. Resolution note: ${l}`;return this.updateState(e.ConnectivityState.TRANSIENT_FAILURE,new o.UnavailablePicker({details:t}),t),!1}u("Connect to endpoint list "+t.value.map(c.endpointToString));const p=new Date,g=new Set;this.updatesPaused=!0,this.latestConfig=r;for(const o of t.value){const t=(0,c.endpointToString)(o);g.add(t);let u=this.children.get(t);u||(u={child:new i.LeafLoadBalancer(o,(0,n.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(t,r,n)=>{this.currentState===e.ConnectivityState.READY&&t!==e.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),t===e.ConnectivityState.READY&&(u.nonEmptySince=null),n&&(this.lastError=n),this.calculateAndUpdateState()},createSubchannel:(e,t)=>{const r=this.channelControlHelper.createSubchannel(e,t);return(null==u?void 0:u.oobMetricsListener)?new a.OrcaOobMetricsSubchannelWrapper(r,u.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):r}}),s,l),lastUpdated:p,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(t,u)),r.getEnableOobLoadReport()?u.oobMetricsListener=e=>{this.updateWeight(u,e)}:u.oobMetricsListener=null}for(const[e,t]of this.children)g.has(e)?t.child.startConnecting():(t.child.destroy(),this.children.delete(e));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=null===(d=(h=setInterval(()=>{this.currentState===e.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)||void 0===d?void 0:d.call(h),!0}exitIdle(){}resetBackoff(){}destroy(){for(const e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return h}}return loadBalancerWeightedRoundRobin}function requireSrc(){return hasRequiredSrc||(hasRequiredSrc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.experimental=e.ServerMetricRecorder=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=e.addAdminServicesToServer=e.getChannelzHandlers=e.getChannelzServiceDefinition=e.InterceptorConfigurationError=e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.StatusBuilder=e.getClientChannel=e.ServerCredentials=e.Server=e.setLogVerbosity=e.setLogger=e.load=e.loadObject=e.CallCredentials=e.ChannelCredentials=e.waitForClientReady=e.closeClient=e.Channel=e.makeGenericClientConstructor=e.makeClientConstructor=e.loadPackageDefinition=e.Client=e.compressionAlgorithms=e.propagate=e.connectivityState=e.status=e.logVerbosity=e.Metadata=e.credentials=void 0;const t=requireCallCredentials();Object.defineProperty(e,"CallCredentials",{enumerable:!0,get:function(){return t.CallCredentials}});const r=requireChannel();Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return r.ChannelImplementation}});const n=requireCompressionAlgorithms();Object.defineProperty(e,"compressionAlgorithms",{enumerable:!0,get:function(){return n.CompressionAlgorithms}});const i=requireConnectivityState();Object.defineProperty(e,"connectivityState",{enumerable:!0,get:function(){return i.ConnectivityState}});const s=requireChannelCredentials();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return s.ChannelCredentials}});const a=requireClient();Object.defineProperty(e,"Client",{enumerable:!0,get:function(){return a.Client}});const o=requireConstants();Object.defineProperty(e,"logVerbosity",{enumerable:!0,get:function(){return o.LogVerbosity}}),Object.defineProperty(e,"status",{enumerable:!0,get:function(){return o.Status}}),Object.defineProperty(e,"propagate",{enumerable:!0,get:function(){return o.Propagate}});const l=requireLogging(),c=requireMakeClient();Object.defineProperty(e,"loadPackageDefinition",{enumerable:!0,get:function(){return c.loadPackageDefinition}}),Object.defineProperty(e,"makeClientConstructor",{enumerable:!0,get:function(){return c.makeClientConstructor}}),Object.defineProperty(e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return c.makeClientConstructor}});const u=requireMetadata();Object.defineProperty(e,"Metadata",{enumerable:!0,get:function(){return u.Metadata}});const h=requireServer();Object.defineProperty(e,"Server",{enumerable:!0,get:function(){return h.Server}});const d=requireServerCredentials();Object.defineProperty(e,"ServerCredentials",{enumerable:!0,get:function(){return d.ServerCredentials}});const p=requireStatusBuilder();Object.defineProperty(e,"StatusBuilder",{enumerable:!0,get:function(){return p.StatusBuilder}}),e.credentials={combineChannelCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),combineCallCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),createInsecure:s.ChannelCredentials.createInsecure,createSsl:s.ChannelCredentials.createSsl,createFromSecureContext:s.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:t.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:t.CallCredentials.createFromGoogleCredential,createEmpty:t.CallCredentials.createEmpty};e.closeClient=e=>e.close();e.waitForClientReady=(e,t,r)=>e.waitForReady(t,r);e.loadObject=(e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};e.load=(e,t,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};e.setLogger=e=>{l.setLogger(e)};e.setLogVerbosity=e=>{l.setLoggerVerbosity(e)};e.getClientChannel=e=>a.Client.prototype.getChannel.call(e);var f=requireClientInterceptors();Object.defineProperty(e,"ListenerBuilder",{enumerable:!0,get:function(){return f.ListenerBuilder}}),Object.defineProperty(e,"RequesterBuilder",{enumerable:!0,get:function(){return f.RequesterBuilder}}),Object.defineProperty(e,"InterceptingCall",{enumerable:!0,get:function(){return f.InterceptingCall}}),Object.defineProperty(e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return f.InterceptorConfigurationError}});var g=requireChannelz();Object.defineProperty(e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return g.getChannelzServiceDefinition}}),Object.defineProperty(e,"getChannelzHandlers",{enumerable:!0,get:function(){return g.getChannelzHandlers}});var v=requireAdmin();Object.defineProperty(e,"addAdminServicesToServer",{enumerable:!0,get:function(){return v.addAdminServicesToServer}});var m=requireServerInterceptors();Object.defineProperty(e,"ServerListenerBuilder",{enumerable:!0,get:function(){return m.ServerListenerBuilder}}),Object.defineProperty(e,"ResponderBuilder",{enumerable:!0,get:function(){return m.ResponderBuilder}}),Object.defineProperty(e,"ServerInterceptingCall",{enumerable:!0,get:function(){return m.ServerInterceptingCall}});var A=requireOrca();Object.defineProperty(e,"ServerMetricRecorder",{enumerable:!0,get:function(){return A.ServerMetricRecorder}});const y=requireExperimental();e.experimental=y;const C=requireResolverDns(),S=requireResolverUds(),E=requireResolverIp(),_=requireLoadBalancerPickFirst(),b=requireLoadBalancerRoundRobin(),T=requireLoadBalancerOutlierDetection(),R=requireLoadBalancerWeightedRoundRobin(),x=requireChannelz();C.setup(),S.setup(),E.setup(),_.setup(),b.setup(),T.setup(),R.setup(),x.setup()}(src$2)),src$2}var srcExports=requireSrc();const A$1=await async function(e={}){var t=e,r=!!globalThis.window,n=!!globalThis.WorkerGlobalScope,i=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;if(i){const{createRequire:e}=await import("module");var s=e(import.meta.url)}var a=(e,t)=>{throw t},o=import.meta.url;if(i)s("fs"),o.startsWith("file:")&&s("path").dirname(s("url").fileURLToPath(o)),process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),a=(e,t)=>{throw process.exitCode=e,t};else if(r||n)try{new URL(".",o).href}catch{}console.log.bind(console);var l,c,u,h,d,p,f,g,v,m,A,y,C,S,E=console.error.bind(console),_=!1,b=!1;function T(){var e=Te.buffer;h=new Int8Array(e),p=new Int16Array(e),d=new Uint8Array(e),f=new Uint16Array(e),g=new Int32Array(e),v=new Uint32Array(e),m=new Float32Array(e),A=new Float64Array(e),y=new BigInt64Array(e),C=new BigUint64Array(e)}function R(e){t.onAbort?.(e),E(e="Aborted("+e+")"),_=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw u?.(r),r}class x{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var w=e=>{for(;e.length>0;)e.shift()(t)},k=[],N=e=>k.push(e),I=[],O=e=>I.push(e),P=!0;class j{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){v[this.ptr+4>>2]=e}get_type(){return v[this.ptr+4>>2]}set_destructor(e){v[this.ptr+8>>2]=e}get_destructor(){return v[this.ptr+8>>2]}set_caught(e){e=e?1:0,h[this.ptr+12]=e}get_caught(){return 0!=h[this.ptr+12]}set_rethrown(e){e=e?1:0,h[this.ptr+13]=e}get_rethrown(){return 0!=h[this.ptr+13]}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){v[this.ptr+16>>2]=e}get_adjusted_ptr(){return v[this.ptr+16>>2]}}var L=e=>{for(var t="";;){var r=d[e++];if(!r)return t;t+=String.fromCharCode(r)}},q={},M={},D={},F=class extends Error{constructor(e){super(e),this.name="BindingError"}},B=e=>{throw new F(e)};function U(e,t,r={}){return function(e,t,r={}){var n=t.name;if(e||B(`type "${n}" must have a positive integer typeid pointer`),M.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;B(`Cannot register type '${n}' twice`)}if(M[e]=t,delete D[e],q.hasOwnProperty(e)){var i=q[e];delete q[e],i.forEach(e=>e())}}(e,t,r)}var $=(e,t,r)=>{switch(t){case 1:return r?e=>h[e]:e=>d[e];case 2:return r?e=>p[e>>1]:e=>f[e>>1];case 4:return r?e=>g[e>>2]:e=>v[e>>2];case 8:return r?e=>y[e>>3]:e=>C[e>>3];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},z=e=>{B(e.$$.ptrType.registeredClass.name+" instance already deleted")},H=!1,W=e=>{},G=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},V=e=>globalThis.FinalizationRegistry?(H=new FinalizationRegistry(e=>{G(e.$$)}),V=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};H.register(e,r,e)}return e},W=e=>H.unregister(e),V(e)):(V=e=>e,e);function Y(){}var K=(e,t)=>Object.defineProperty(t,"name",{value:e}),J={},X=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(...n){return e[t].overloadTable.hasOwnProperty(n.length)||B(`Function '${r}' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[n.length].apply(this,n)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Q=(e,r,n)=>{t.hasOwnProperty(e)?(B(`Cannot register public name '${e}' twice`),X(t,e,e),t[e].overloadTable.hasOwnProperty(n)&&B(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[e].overloadTable[n]=r):(t[e]=r,t[e].argCount=n)};function Z(e,t,r,n,i,s,a,o){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=i,this.getActualType=s,this.upcast=a,this.downcast=o,this.pureVirtualFunctions=[]}var ee=(e,t,r)=>{for(;t!==r;)t.upcast||B(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},te=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function re(e,t){if(null===t)return this.isReference&&B(`null is not a valid ${this.name}`),0;t.$$||B(`Cannot pass "${te(t)}" as a ${this.name}`),t.$$.ptr||B(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ee(t.$$.ptr,r,this.registeredClass)}function ne(e,t){var r;if(null===t)return this.isReference&&B(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t&&t.$$||B(`Cannot pass "${te(t)}" as a ${this.name}`),t.$$.ptr||B(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&B(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=ee(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&B("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:B(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var i=t.clone();r=this.rawShare(r,Oe.toHandle(()=>i.delete())),null!==e&&e.push(this.rawDestructor,r)}break;default:B("Unsupporting sharing policy")}return r}function ie(e,t){if(null===t)return this.isReference&&B(`null is not a valid ${this.name}`),0;t.$$||B(`Cannot pass "${te(t)}" as a ${this.name}`),t.$$.ptr||B(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&B(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return ee(t.$$.ptr,r,this.registeredClass)}function se(e){return this.fromWireType(v[e>>2])}var ae=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=ae(e,t,r.baseClass);return null===n?null:r.downcast(n)},oe={},le=class extends Error{constructor(e){super(e),this.name="InternalError"}},ce=e=>{throw new le(e)},ue=(e,t)=>(t.ptrType&&t.ptr||ce("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&ce("Both smartPtrType and smartPtr must be specified"),t.count={value:1},V(Object.create(e,{$$:{value:t,writable:!0}})));function he(e,t,r,n,i,s,a,o,l,c,u){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=i,this.pointeeType=s,this.sharingPolicy=a,this.rawGetPointee=o,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=u,i||void 0!==t.baseClass?this.toWireType=ne:n?(this.toWireType=re,this.destructorFunction=null):(this.toWireType=ie,this.destructorFunction=null)}var de=[],pe=(e,t,r=!1)=>{e=L(e);var n,i,s=((i=de[n=t])||(de[n]=i=Re.get(n)),i);return"function"!=typeof s&&B(`unknown function pointer with signature ${e}: ${t}`),s};class fe extends Error{}var ge=e=>{var t=Ee(e),r=L(t);return be(t),r},ve=(e,t)=>{var r=[],n={};throw t.forEach(function e(t){n[t]||M[t]||(D[t]?D[t].forEach(e):(r.push(t),n[t]=!0))}),new fe(`${e}: `+r.map(ge).join([", "]))},me=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&ce("Mismatched type converter count");for(var i=0;i<e.length;++i)U(e[i],n[i])}e.forEach(e=>D[e]=t);var i=new Array(t.length),s=[],a=0;for(let[e,r]of t.entries())M.hasOwnProperty(r)?i[e]=M[r]:(s.push(r),q.hasOwnProperty(r)||(q[r]=[]),q[r].push(()=>{i[e]=M[r],++a===s.length&&n(i)}));0===s.length&&n(i)},Ae=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function ye(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].destructorFunction)return!0;return!1}function Ce(e,t,r,n,i,s){var a=t.length;a<2&&B("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==t[1]&&null!==r,l=ye(t),c=!t[0].isVoid,u=t[0],h=t[1],d=[e,B,n,i,Ae,u.fromWireType.bind(u),h?.toWireType.bind(h)],p=2;p<a;++p){var f=t[p];d.push(f.toWireType.bind(f))}if(!l)for(p=o?1:2;p<t.length;++p)null!==t[p].destructorFunction&&d.push(t[p].destructorFunction);let g=function(e,t,r,n){var i=ye(e),s=e.length-2,a=[],o=["fn"];t&&o.push("thisWired");for(var l=0;l<s;++l)a.push(`arg${l}`),o.push(`arg${l}Wired`);a=a.join(","),o=o.join(",");var c=`return function (${a}) {\n`;i&&(c+="var destructors = [];\n");var u=i?"destructors":"null",h=["humanName","throwBindingError","invoker","fn","runDestructors","fromRetWire","toClassParamWire"];for(t&&(c+=`var thisWired = toClassParamWire(${u}, this);\n`),l=0;l<s;++l){var d=`toArg${l}Wire`;c+=`var arg${l}Wired = ${d}(${u}, arg${l});\n`,h.push(d)}if(c+=(r||n?"var rv = ":"")+`invoker(${o});\n`,i)c+="runDestructors(destructors);\n";else for(l=t?1:2;l<e.length;++l){var p=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(c+=`${p}_dtor(${p});\n`,h.push(`${p}_dtor`))}return r&&(c+="var ret = fromRetWire(rv);\nreturn ret;\n"),c+="}\n",new Function(h,c)}(t,o,c,s);var v=g(...d);return K(e,v)}for(var Se,Ee,_e,be,Te,Re,xe=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(v[t+4*n>>2]);return r},we=e=>{const t=(e=e.trim()).indexOf("(");return-1===t?e:e.slice(0,t)},ke=[],Ne=[0,1,,1,null,1,!0,1,!1,1],Ie=e=>{e>9&&0===--Ne[e+1]&&(Ne[e]=void 0,ke.push(e))},Oe={toValue:e=>(e||B(`Cannot use deleted val. handle = ${e}`),Ne[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=ke.pop()||Ne.length;return Ne[t]=e,Ne[t+1]=1,t}}}},Pe={name:"emscripten::val",fromWireType:e=>{var t=Oe.toValue(e);return Ie(e),t},toWireType:(e,t)=>Oe.toHandle(t),readValueFromPointer:se,destructorFunction:null},je=(e,t,r)=>{switch(t){case 1:return r?function(e){return this.fromWireType(h[e])}:function(e){return this.fromWireType(d[e])};case 2:return r?function(e){return this.fromWireType(p[e>>1])}:function(e){return this.fromWireType(f[e>>1])};case 4:return r?function(e){return this.fromWireType(g[e>>2])}:function(e){return this.fromWireType(v[e>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Le=(e,t)=>{var r=M[e];return void 0===r&&B(`${t} has unknown type ${ge(e)}`),r},qe=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(m[e>>2])};case 8:return function(e){return this.fromWireType(A[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Me=Object.assign({optional:!0},Pe),De=globalThis.TextDecoder&&new TextDecoder,Fe=(e,t,r,n)=>{var i=t+r;if(n)return i;for(;e[t]&&!(t>=i);)++t;return t},Be=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Ue=(e,t,r)=>{var n=e>>1,i=Fe(f,n,t/2,r);if(i-n>16&&Be)return Be.decode(f.subarray(n,i));for(var s="",a=n;a<i;++a){var o=f[a];s+=String.fromCharCode(o)}return s},$e=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,i=(r-=2)<2*e.length?r/2:e.length,s=0;s<i;++s){var a=e.charCodeAt(s);p[t>>1]=a,t+=2}return p[t>>1]=0,t-n},ze=e=>2*e.length,He=(e,t,r)=>{for(var n="",i=e>>2,s=0;!(s>=t/4);s++){var a=v[i+s];if(!a&&!r)break;n+=String.fromCodePoint(a)}return n},We=(e,t,r)=>{if(r??=2147483647,r<4)return 0;for(var n=t,i=n+r-4,s=0;s<e.length;++s){var a=e.codePointAt(s);if(a>65535&&s++,g[t>>2]=a,(t+=4)+4>i)break}return g[t>>2]=0,t-n},Ge=e=>{for(var t=0,r=0;r<e.length;++r)e.codePointAt(r)>65535&&r++,t+=4;return t},Ve=0,Ye=[],Ke=(e,t,r)=>{var n=[],i=e(n,r);return n.length&&(v[t>>2]=Oe.toHandle(n)),i},Je={},Xe=e=>{var t=Je[e];return void 0===t?L(e):t},Qe={},Ze=e=>{if(e instanceof x||"unwind"==e)return l;a(1,e)},et=()=>P||Ve>0,tt=e=>{l=e,et()||(t.onExit?.(e),_=!0),a(e,new x(e))},rt=e=>{if(!_)try{e(),(()=>{if(!et())try{(e=>{l=e,tt(e)})(l)}catch(e){Ze(e)}})()}catch(e){Ze(e)}},nt=(e,t)=>Math.ceil(e/t)*t,it=e=>{var t=(e-Te.buffer.byteLength+65535)/65536|0;try{return Te.grow(t),T(),1}catch(e){}},st=new Uint8Array(123),at=25;at>=0;--at)st[48+at]=52+at,st[65+at]=at,st[97+at]=26+at;if(st[43]=62,st[47]=63,(()=>{let e=Y.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof Y))return!1;if(!(e instanceof Y))return!1;var t=this.$$.ptrType.registeredClass,r=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return t===n&&r===i},clone(){if(this.$$.ptr||z(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=V(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||z(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&B("Object already scheduled for deletion"),W(this),G(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||z(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&B("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)})(),Object.assign(he.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},readValueFromPointer:se,fromWireType:function(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=((e,t)=>(t=((e,t)=>{for(void 0===t&&B("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),oe[t]))(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function i(){return this.isSmartPointer?ue(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ue(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var s,a=this.registeredClass.getActualType(t),o=J[a];if(!o)return i.call(this);s=this.isConst?o.constPointerType:o.pointerType;var l=ae(t,this.registeredClass,s.registeredClass);return null===l?i.call(this):this.isSmartPointer?ue(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:e}):ue(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}}),t.noExitRuntime&&(P=t.noExitRuntime),t.print&&t.print,t.printErr&&(E=t.printErr),t.wasmBinary&&t.wasmBinary,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()();var ot,lt={l:(e,t,r)=>{throw new j(e).init(t,r),e},s:()=>R(""),o:(e,t,r,n,i)=>{t=L(t);const s=0n===n;let a=e=>e;if(s){const e=8*r;a=t=>BigInt.asUintN(e,t),i=a(i)}U(e,{name:t,fromWireType:a,toWireType:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),readValueFromPointer:$(t,r,!s),destructorFunction:null})},w:(e,t,r,n)=>{U(e,{name:t=L(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},readValueFromPointer:function(e){return this.fromWireType(d[e])},destructorFunction:null})},e:(e,r,n,i,s,a,o,l,c,u,h,d,p)=>{h=L(h),a=pe(s,a),l&&=pe(o,l),u&&=pe(c,u),p=pe(d,p);var f=(e=>{var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e})(h);Q(f,function(){ve(`Cannot construct ${h} due to unbound types`,[i])}),me([e,r,n],i?[i]:[],r=>{var n,s;r=r[0],s=i?(n=r.registeredClass).instancePrototype:Y.prototype;var o=K(h,function(...e){if(Object.getPrototypeOf(this)!==c)throw new F(`Use 'new' to construct ${h}`);if(void 0===d.constructor_body)throw new F(`${h} has no accessible constructor`);var t=d.constructor_body[e.length];if(void 0===t)throw new F(`Tried to invoke ctor of ${h} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),c=Object.create(s,{constructor:{value:o}});o.prototype=c;var d=new Z(h,o,c,p,n,a,l,u);d.baseClass&&(d.baseClass.__derivedClasses??=[],d.baseClass.__derivedClasses.push(d));var g=new he(h,d,!0,!1,!1),v=new he(h+"*",d,!1,!1,!1),m=new he(h+" const*",d,!1,!0,!1);return J[e]={pointerType:v,constPointerType:m},((e,r,n)=>{t.hasOwnProperty(e)||ce("Replacing nonexistent public symbol"),t[e].overloadTable,t[e]=r,t[e].argCount=n})(f,o),[g,v,m]})},b:(e,t,r,n,i,s,a,o,l)=>{var c=xe(r,n);t=L(t),t=we(t),s=pe(i,s,o),me([],[e],e=>{var n=`${(e=e[0]).name}.${t}`;function i(){ve(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var l=e.registeredClass.constructor;return void 0===l[t]?(i.argCount=r-1,l[t]=i):(X(l,t,n),l[t].overloadTable[r-1]=i),me([],c,i=>{var c=[i[0],null].concat(i.slice(1)),u=Ce(n,c,null,s,a,o);if(void 0===l[t].overloadTable?(u.argCount=r-1,l[t]=u):l[t].overloadTable[r-1]=u,e.registeredClass.__derivedClasses)for(const r of e.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(t)||(r.constructor[t]=u);return[]}),[]})},n:(e,t,r,n,i,s)=>{var a=xe(t,r);i=pe(n,i),me([],[e],e=>{var r=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new F(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{ve(`Cannot construct ${e.name} due to unbound types`,a)},me([],a,n=>(n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ce(r,n,null,i,s),[])),[]})},a:(e,t,r,n,i,s,a,o,l,c)=>{var u=xe(r,n);t=L(t),t=we(t),s=pe(i,s,l),me([],[e],e=>{var n=`${(e=e[0]).name}.${t}`;function i(){ve(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),o&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,h=c[t];return void 0===h||void 0===h.overloadTable&&h.className!==e.name&&h.argCount===r-2?(i.argCount=r-2,i.className=e.name,c[t]=i):(X(c,t,n),c[t].overloadTable[r-2]=i),me([],u,i=>{var o=Ce(n,i,e,s,a,l);return void 0===c[t].overloadTable?(o.argCount=r-2,c[t]=o):c[t].overloadTable[r-2]=o,[]}),[]})},u:e=>U(e,Pe),z:(e,t,r,n)=>{function i(){}t=L(t),i.values={},U(e,{name:t,constructor:i,fromWireType:function(e){return this.constructor.values[e]},toWireType:(e,t)=>t.value,readValueFromPointer:je(t,r,n),destructorFunction:null}),Q(t,i)},f:(e,t,r)=>{var n=Le(e,"enum");t=L(t);var i=n.constructor,s=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:K(`${n.name}_${t}`,function(){})}});i.values[r]=s,i[t]=s},m:(e,t,r)=>{U(e,{name:t=L(t),fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:qe(t,r),destructorFunction:null})},d:(e,t,r,n,i)=>{t=L(t);let s=e=>e;if(0===n){var a=32-8*r;s=e=>e<<a>>>a,i=s(i)}U(e,{name:t,fromWireType:s,toWireType:(e,t)=>t,readValueFromPointer:$(t,r,0!==n),destructorFunction:null})},c:(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function i(e){var t=v[e>>2],r=v[e+4>>2];return new n(h.buffer,r,t)}U(e,{name:r=L(r),fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},A:(e,t)=>{U(e,Me)},v:(e,t)=>{U(e,{name:t=L(t),fromWireType(e){var t;return t=((e,t,r)=>e?((e,t=0,r,n)=>{var i=Fe(e,t,r,n);if(i-t>16&&e.buffer&&De)return De.decode(e.subarray(t,i));for(var s="";t<i;){var a=e[t++];if(128&a){var o=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++])<65536)s+=String.fromCharCode(a);else{var c=a-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s})(d,e,t,r):"")(e+4,v[e>>2],!0),be(e),t},toWireType(e,t){var r;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||ArrayBuffer.isView(t)&&1==t.BYTES_PER_ELEMENT||B("Cannot pass non-string to std::string"),r=n?(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t})(t):t.length;var i=Se(4+r+1),s=i+4;return v[i>>2]=r,n?((e,t,r,n)=>{if(!(n>0))return 0;for(var i=r+n-1,s=0;s<e.length;++s){var a=e.codePointAt(s);if(a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a,s++}}t[r]=0})(t,d,s,r+1):d.set(t,s),null!==e&&e.push(be,i),i},readValueFromPointer:se,destructorFunction(e){be(e)}})},j:(e,t,r)=>{var n,i,s;r=L(r),2===t?(n=Ue,i=$e,s=ze):(n=He,i=We,s=Ge),U(e,{name:r,fromWireType:e=>{var r=v[e>>2],i=n(e+4,r*t,!0);return be(e),i},toWireType:(e,n)=>{"string"!=typeof n&&B(`Cannot pass non-string to C++ string type ${r}`);var a=s(n),o=Se(4+a+t);return v[o>>2]=a/t,i(n,o+4,a+t),null!==e&&e.push(be,o),o},readValueFromPointer:se,destructorFunction(e){be(e)}})},x:(e,t)=>{U(e,{isVoid:!0,name:t=L(t),fromWireType:()=>{},toWireType:(e,t)=>{}})},q:()=>{P=!1,Ve=0},i:(e,t,r)=>{var[n,...i]=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Le(v[t+4*n>>2],`parameter ${n}`);return r})(e,t),s=n.toWireType.bind(n),a=i.map(e=>e.readValueFromPointer.bind(e));e--;var o,l={toValue:Oe.toValue},c=a.map((e,t)=>{var r=`argFromPtr${t}`;return l[r]=e,`${r}(args${t?"+"+8*t:""})`});switch(r){case 0:o="toValue(handle)";break;case 2:o="new (toValue(handle))";break;case 3:o="";break;case 1:l.getStringOrSymbol=Xe,o="toValue(handle)[getStringOrSymbol(methodName)]"}o+=`(${c})`,n.isVoid||(l.toReturnWire=s,l.emval_returnValue=Ke,o=`return emval_returnValue(toReturnWire, destructorsRef, ${o})`),o=`return function (handle, methodName, destructorsRef, args) {\n ${o}\n }`;var u,h,d=new Function(Object.keys(l),o)(...Object.values(l)),p=`methodCaller<(${i.map(e=>e.name)}) => ${n.name}>`;return u=K(p,d),h=Ye.length,Ye.push(u),h},k:Ie,y:e=>{e>9&&(Ne[e+1]+=1)},h:(e,t,r,n,i)=>Ye[e](t,r,n,i),g:e=>{var t=Oe.toValue(e);Ae(t),Ie(e)},r:(e,t)=>{if(Qe[e]&&(clearTimeout(Qe[e].id),delete Qe[e]),!t)return 0;var r=setTimeout(()=>{delete Qe[e],rt(()=>_e(e,performance.now()))},t);return Qe[e]={id:r,timeout_ms:t},0},t:e=>{var t=d.length,r=2147483648;if((e>>>=0)>r)return!1;for(var n=1;n<=4;n*=2){var i=t*(1+.2/n);i=Math.min(i,e+100663296);var s=Math.min(r,nt(Math.max(e,i),65536));if(it(s))return!0}return!1},p:tt};return ot=await async function(){function e(e,t){return function(e){Se=e.D,Ee=e.E,_e=e.F,be=e.H,Te=e.B,Re=e.G}(ot=e.exports),T(),ot}var r={a:lt};return t.instantiateWasm?new Promise((n,i)=>{t.instantiateWasm(r,(t,r)=>{n(e(t))})}):(S??=function(e){for(var t,r=0,n=new Uint8Array(43076);r<43076;++r)t=e.charCodeAt(r),n[r]=~t>>8&t;return n}('\0asm\0\0\0«````\0`\0`\0`\0\0`\0`\0`\0````\0`\n\0`\t\0`\r\0`|`~~\0`|`\0`|\0£aa\0ab\0ac\0ad\0\tae\0af\0ag\0ah\0ai\0aj\0ak\0al\0am\0an\0\bao\0ap\0aq\0ar\0as\0at\0\0au\0av\0aw\0ax\0ay\0az\0aA\0žœ\0\0\v\0\0\0\0\n\0\b\v\0\0\n\n\f\n\v\0\0\t\0\0\0\0\v\f\n\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\n\0\0\0\b\b\t\t\t\b\0\0\r\0\0\0p¿¿‚€€\bAð¾\v B\0C\0¶D\x007E\0­F\0œG\0H\0\tù\0A\v¾Kcµ²®©¢™˜—–•”“’0‘000Ž00/S.R-,+@?>/S.R-,+@?>/Œ.‹-,+@?>/Š.‰-,+QPO/ˆ.‡-,+†…„/ƒ.‚-,+QPO)N)&N€~&}&|&{&z&y&xwMvMutsLrLqponmlkjihgfedb)][)"´³G"±°¯"¬Z)"GGW"W"« £¥"¤TT"Ÿ¡¦"ª¨§)"žš›\f\nÀ›œFA \0 \0AM!\0@@ \07" AÜ=(\0"\rA\0\v\f\v \0\f\0\v\0\v"\0E@Z\0\v \0\vß\v\b@ \0E\r\0 \0A\bk" \0Ak(\0"Axq"\0j!@ Aq\r\0 AqE\r  (\0"k"A8(\0I\r \0 j!\0@@@A”8(\0 G@ (\f! AÿM@  (\b"G\rA€8A€8(\0A~ Avwq6\0\f\v (!  G@ (\b" 6\f  6\b\f\v (" Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v ("AqAG\rAˆ8 \x006\0  A~q6  \0Ar6  \x006\0\v  6\f  6\b\f\vA\0!\v E\r\0@ ("At"(°: F@ A°:j 6\0 \rA„8A„8(\0A~ wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("@  6  6\v ("E\r\0  6  6\v  O\r\0 ("AqE\r\0@@@@ AqE@A˜8(\0 F@A˜8 6\0AŒ8AŒ8(\0 \0j"\x006\0  \0Ar6 A”8(\0G\rAˆ8A\x006\0A”8A\x006\0\vA”8(\0" F@A”8 6\0Aˆ8Aˆ8(\0 \0j"\x006\0  \0Ar6 \0 j \x006\0\v Axq \0j!\0 (\f! AÿM@ (\b" F@A€8A€8(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!\b  G@ (\b" 6\f  6\b\f\v (" Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v  A~q6  \0Ar6 \0 j \x006\0\f\vA\0!\v \bE\r\0@ ("At"(°: F@ A°:j 6\0 \rA„8A„8(\0A~ wq6\0\f\v@  \b(F@ \b 6\f\v \b 6\v E\r\v  \b6 ("@  6  6\v ("E\r\0  6  6\v  \0Ar6 \0 j \x006\0  G\r\0Aˆ8 \x006\0\v \0AÿM@ \0AøqA¨8j!A€8(\0"A \0Avt"\0qE@A€8 \0 r6\0 \f\v (\b\v!\0  6\b \0 6\f  6\f  \x006\b\vA! \0AÿÿÿM@ \0A& \0A\bvg"kvAq AtkA>j!\v  6 B\x007 AtA°:j!@A„8(\0"A t"qE@A„8  r6\0  6\0A!A\b\f\v \0A AvkA\0 AGt! (\0!@ "(Axq \0F\r Av! At!  Aqj"("\r\0\v  6A! !A\b\v!\0 "\f\v (\b" 6\f  6\bA!\0A\b!A\0\v!  j 6\0  6\f \0 j 6\0A 8A 8(\0Ak"\0A \06\0\v\v,\0 E@ \0( (F\v \0 F@A\v \0( (\'E\v}@@ \0"AqE\r\0 -\0\0E@A\0\v@ Aj"AqE\r -\0\0\r\0\v\f\v@ "Aj!A€‚„\b (\0"k rA€‚„xqA€‚„xF\r\0\v@ "Aj! -\0\0\r\0\v\v  \0k\v\f\0  \0(\0\0\0\v®#\0Ak"$\0  \0(\0"A\bk(\0"6\f  \0 j6  Ak(\x006\b (!@ (\b" A\0@A\0  (\f!\f\v#\0A@j"$\0 \0 N@  6\f  6  \x006\b AjA\0A$ü\v\0 A\x006< B€€€€€€€74  Aj  AA\0 (\0(\b\0 \0A\0 (!\v A@k$\0 "\r\0#\0A@j"$\0 A¼-6\f  \x006\b  6A\0!\0 AjA\0A+ü\v\0 A\x006< A:\0;  Aj AA\0 (\0(\t\0@@@ ((\0\v (A\0 ($AFA\0 ( AFA\0 (,AF!\0\f\v (AG@ (,\r ( AG\r ($AG\r\v (!\0\v A@k$\0 \0!\v Aj$\0 \v A! \0Aj" \0/\0AtAþÿqj!\0@ @@@@@ \0  AtAkAþÿqj.\0"j"\0-\0\0Ak\0\v  \0/Ajj!\f\v  \0/Ajj!\f\v \0/"E@ Aj!\f\v At" \0 AkAþÿqj/jAj!\v  j!\f\v@@@ \0-\0\0Ak\0\v \0/Aj!\f\v \0/Aj!\f\v \0/"E@A!\f\v At" \0 AkAþÿqj/jAj!\v  AtAþÿqj ;\0\v\0 \0\v\b\0A—\n_\0\v2 \0@ \0(\0$ \0($ \0(! \0A\x006 @ \v \0\v\v@@ AO@ \0 rAq\r@ \0(\0 (\0G\r Aj! \0Aj!\0 Ak"AK\r\0\v\v E\r\v@ \0-\0\0" -\0\0"F@ Aj! \0Aj!\0 Ak"\r\f\v\v  k\vA\0\v5  \0("Auj! \0(\0!\0  Aq (\0 \0j(\0 \0\v\0\0\vM -\0\0!@ \0-\0\0"E\r\0  G\r\0@ -\0! \0-\0"E\r Aj! \0Aj!\0  F\r\0\v\v  k\v¢\r@@@@@ -\0\0Ak\0\v AjA\0 -\0\0AFAj"\r ."AtAþÿqj! A\0 A\0J! Aj!@ \b G@A\0! \b \r \bAtAkAþÿqj.\0A\0\v j"AjA\0 -\0\0AF!\t /"Á!\v@@@@ Ak\0\v\vA!\fA! \tA\tjA\0 -\0\tAFAj"\f\vA! \tA\vjA\0 \t-\0\nAFAj!A!\f . \tA\njj"AjA\0 -\0\0AFAj\v!  \vH\rA\0\f\v \tAj!\nA!\f "!A\0\f\v \tAj" \vAtAþÿqj!\n  AtjAk.\0\v \nj\v!\n \v \fLA\0 \tAj" \vAtAþÿqj  \fAtjAk.\0j\v!@ @  \'\r\v  \nAj\'\r\0 \0A\0 \0    (\v \bAj!\b\f\v\v E\r  \0 /AjÁjO\rA\0\v E\r  \0 /AjÁjO\r\f\v A\0 \0Aj" K\r\0 \0A:\0\0 .! @   AtAjÁjI\r\v \0 ; A\0L@ \0\v AtAþÿq"@ \0AjA\0 ü\v\0\v  \0Aj"j Aj" /AtAþÿqj   (E\r\0 A\0!A!\b@ .\0"\t \bL@ \0\v  \bAtAkAþÿq"\nj.\0  \tAtAþÿqjj  \nj.\0  /AtAþÿqjj   (@  \b! \bAj!\b\fA\0\v\0\v\0\vA\0\v /AjÁ"E@ \0\v \0  ü\n\0\0 \0\v\0 \0\vT~@Aô7(\0"­ \0­B|Bøÿÿÿƒ|"BÿÿÿÿX@ §"\0?\0AtM\r \0\r\vAü7A06\0A\vAô7 \x006\0 \v–#\0Ak"$\0 Aj  \0\0A\f"\0A\x006\b \0B\x007\0@ (\b" ("G@  k"A\0H\r \0 "6\0 \0  j"6\b @   ü\n\0\0\v \0 6\v @  6\b \v Aj$\0 \0\v2\0\v1 \0( \0(\0k! \0( \0(\0"\0k"@  \0 ü\n\0\0\v \v\t\0  \0\0\0\vr#\0Ak"$\0 Aj"   \0\0 (\b ,\0" A\0H""\0Aj7" \x006\0 (! \0@ Aj    \0ü\n\0\0\v A\0H@ \v Aj$\0 \v°#\0Ak"$\0 (\0"AøÿÿÿI@@@ A\vO@ Ar"Aj!  Aÿÿÿÿk6\f  6  6\b\f\v  :\0 Aj! E\r\v E\r\0  Aj ü\n\0\0\v  jA\0:\0\0 Aj  \0\0 ,\0A\0H@ (\v Aj$\0\v#\0\v\v\0 \0@ \0\v\v¥ \0Aÿq!@@@ \0Aà\0F@A\b!AÜ!\f\v A‚„\bl!A\b!AÜ!@A€‚„\b (\0 s"k rA€‚„xqA€‚„xG\r Aj! Ak"AK\r\0\v E\r\v \0Aÿq!\0@ -\0\0 \0F\r Aj! Ak"\r\0\v\vA\0!\v \v\b\0AÌ\b_\0\v§@  O\r\0 A(:\0\0 Aj!@ \0.\0"A\0L\r\0@@@@ \0Aj"\b AtAþÿqj"-\0\0Ak\0\v  M\r Aà\0:\0 Aj! -\0"E\r Aj!@  M\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v -\0"E\r Aj!@  M\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v Aj  3"E\r\vA! \0.\0AL\r\0@  M\r A :\0\0 Aj!@@@@ At \bjAk.\0 \b \0/\0AtAþÿqjj"-\0\0Ak\0\v Aj  3"E\r\f\v  M\r Aà\0:\0 Aj! -\0"E\r Aj!@  M\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v -\0"E@ !\f\v Aj! !@  M\r  :\0\0 Aj! -\0! Aj! \r\0\v\v Aj" \0.\0H\r\0\v\v  M\r\0 A):\0\0 Aj!\v \vÒ  \0 F":\0\f@ \r\0@ (\b"-\0\f\r@@ (\b"(\0" F@@ ("E\r\0 -\0\f\r\0 A:\0\f  \0 F:\0\f A:\0\f\f\v@ (\0 F@ !\f\v  ("(\0"\x006@ \0E@  6\b  6\0\f\v \0 6\b (\b"(\0  6\b F@  6\0\f\v  6\v  6\0  6\b (\b"(\0!\v A:\0\f A\0:\0\f  ("\x006\0 \0@ \0 6\b\v  (\b"\x006\b@ \0(\0 F@ \0 6\0\f\v \0 6\v  6  6\b\v E\r -\0\f\r A:\0\f  \0 F:\0\f A:\0\f\v " \0G\r\f\v\v@ (\0" G@ !\f\v  ("\x006\0 \0@ \0 6\b (\b!\v  6\b@ (\0 F@  6\0\f\v  6\v  6  6\b (\b!\v A:\0\f A\0:\0\f  ("(\0"\x006 \0@ \0 6\b\v  (\b"\x006\b@ \0(\0 F@ \0 6\0\f\v \0 6\v  6\0  6\b\v\v¯\n \0Aj! \0("E@  6\0 \v /\0"\bAt"\0Aj!\t  \0AkAþÿqj!\n@ !\0A\0!A\0!A\0!@@ \b \n/A\0\v \tjÁ" \0("/\0"\v  \vAt"AkAþÿqj/A\0\v Aj"\fjÁ"N@  J\r   %A\0N\r\v \0! \0(\0"\r\f\vA\0!A\0! \v  AkAÿÿqj/A\0\v \fjÁ" \b \n/A\0\v \tjÁ"N@  J\r   %A\0N\r\v \0Aj! \0("\r\v\v  \x006\0 \vø@@@@@ -\0\0Ak\0\v  \0AjI\r /! /! /\f! \0A:\0\0  \0Aj"   jj"Áj"I\r \0 ; ."A\0J@ @  (\0 ü\n\0\0\v /!\v AkÁ"@  Áj Aj ü\n\0\0\v@ .\f"A\0L\r\0 E\r\0  .j j (\b ü\n\0\0\v AkA\0:\0\0 \0\v  \0 /AjÁ"jI\r E\r \0  ü\n\0\0\f\v  \0Aj"I\r\0 \0A:\0\0   ."At"AjÁjI\r\0 \0 ; A\0L\r Aÿÿq"@ \0AjA\0 ü\v\0\v \0Aj" AtAþÿqj Aj" /AtAþÿqj  6E\r\0 A\0!A!@  .\0"\bN\r  AtAkAþÿq"\tj.\0  \bAtAþÿqjj  \tj.\0  /AtAþÿqjj  6@  ! Aj!\f\v\v\vA\0\v \0\vÁ\'\v#\0Ak"\n$\0@@@@@@@@@@ \0AôM@A€8(\0"A \0A\vjAøq \0A\vI"Av"\0v"Aq@@ AsAq \0j"At"A¨8j"\0 (°8"(\b"F@A€8 A~ wq6\0\f\v  \x006\f \0 6\b\v A\bj!\0  Ar6  j" (Ar6\f\v\v Aˆ8(\0"\bM\r @@A \0t"A\0 kr  \0tqh"At"A¨8j" (°8"\0(\b"F@A€8 A~ wq"6\0\f\v  6\f  6\b\v \0 Ar6 \0 j"  k"Ar6 \0 j 6\0 \b@ \bAxqA¨8j!A”8(\0! A \bAvt"qE@A€8  r6\0 \f\v (\b\v!  6\b  6\f  6\f  6\b\v \0A\bj!\0A”8 6\0Aˆ8 6\0\f\v\vA„8(\0"\vE\r \vhAt(°:"(Axq k! !@@ ("\0E@ ("\0E\r\v \0(Axq k"   I"! \0  ! \0!\f\v\v (!\t  (\f"\0G@ (\b" \x006\f \0 6\b\f\n\v (" Aj ("E\r Aj\v!@ ! "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v A\x006\0\f\t\vA! \0A¿K\r\0 \0A\vj"Axq!A„8(\0"E\r\0A!\bA\0 k! \0AôÿÿM@ A& A\bvg"\0kvAq \0AtkA>j!\b\v@@@ \bAt(°:"E@A\0!\0\f\vA\0!\0 A \bAvkA\0 \bAGt!@@ (Axq k" O\r\0 ! "\r\0A\0! !\0\f\v \0 ("   AvAqj("F \0 !\0 At! \r\0\v\v \0 rE@A\0!A \bt"\0A\0 \0kr q"\0E\r \0hAt(°:!\0\v \0E\r\v@ \0(Axq k" I!   ! \0  ! \0("  \0(\v"\0\r\0\v\v E\r\0 Aˆ8(\0 kO\r\0 (!\b  (\f"\0G@ (\b" \x006\f \0 6\b\f\b\v (" Aj ("E\r Aj\v!@ ! "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v A\x006\0\f\v Aˆ8(\0"M@A”8(\0!\0@  k"AO@ \0 j" Ar6 \0 j 6\0 \0 Ar6\f\v \0 Ar6 \0 j" (Ar6A\0!A\0!\vAˆ8 6\0A”8 6\0 \0A\bj!\0\f\t\v AŒ8(\0"I@AŒ8  k"6\0A˜8A˜8(\0"\0 j"6\0  Ar6 \0 Ar6 \0A\bj!\0\f\t\vA\0!\0 A/j"AØ;(\0@Aà;(\0\f\vAä;B7\0AÜ;B€ €€€€7\0AØ; \nA\fjApqAتժs6\0Aì;A\x006\0A¼;A\x006\0A€ \v"j"A\0 k"q" M\r\bA¸;(\0"@A°;(\0"\b j"\t \bM\r\t  \tI\r\t\v@A¼;-\0\0AqE@@@@@A˜8(\0"@AÀ;!\0@ \0(\0"\b M@  \b \0(jI\r\v \0(\b"\0\r\0\v\vA\0*"AF\r !AÜ;(\0"\0Ak" q@  k  jA\0 \0kqj!\v  M\rA¸;(\0"\0@A°;(\0" j" M\r \0 I\r\v *"\0 G\r\f\v  k q"*" \0(\0 \0(jF\r !\0\v \0AF\r A0j M@ \0!\f\vAà;(\0"  kjA\0 kq"*AF\r  j! \0!\f\v AG\r\vA¼;A¼;(\0Ar6\0\v *!A\0*!\0 AF\r \0AF\r \0 M\r \0 k" A(jM\r\vA°;A°;(\0 j"\x006\0A´;(\0 \0I@A´; \x006\0\v@A˜8(\0"@AÀ;!\0@  \0(\0" \0("jF\r \0(\b"\0\r\0\v\f\vA8(\0"\0A\0 \0 ME@A8 6\0\vA\0!\0AÄ; 6\0AÀ; 6\0A 8A6\0A¤8AØ;(\x006\0AÌ;A\x006\0@ \0At" A¨8j"6°8  6´8 \0Aj"\0A G\r\0\vAŒ8 A(k"\0Ax kAq"k"6\0A˜8  j"6\0  Ar6 \0 jA(6Aœ8Aè;(\x006\0\f\v  M\r  K\r \0(\fA\bq\r \0  j6A˜8 Ax kAq"\0j"6\0AŒ8AŒ8(\0 j" \0k"\x006\0  \0Ar6  jA(6Aœ8Aè;(\x006\0\f\vA\0!\0\f\vA\0!\0\f\vA8(\0 K@A8 6\0\v  j!AÀ;!\0@@  \0(\0"G@ \0(\b"\0\r\f\v\v \0-\0\fA\bqE\r\vAÀ;!\0@@ \0(\0" M@   \0(j"I\r\v \0(\b!\0\f\v\vAŒ8 A(k"\0Ax kAq"k"6\0A˜8  j"6\0  Ar6 \0 jA(6Aœ8Aè;(\x006\0  A\' kAqjA/k"\0 \0 AjI"A6 AÈ;)\x007 AÀ;)\x007\bAÈ; A\bj6\0AÄ; 6\0AÀ; 6\0AÌ;A\x006\0 Aj!\0@ \0A6 \0A\bj \0Aj!\0 I\r\0\v  F\r\0  (A~q6   k"Ar6  6\0 AÿM@ AøqA¨8j!\0A€8(\0"A Avt"qE@A€8  r6\0 \0\f\v \0(\b\v! \0 6\b  6\fA\f!A\b\f\vA!\0 AÿÿÿM@ A& A\bvg"\0kvAq \0AtkA>j!\0\v  \x006 B\x007 \0AtA°:j!@@A„8(\0"A \0t"qE@A„8  r6\0  6\0\f\v A \0AvkA\0 \0AGt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"("\r\0\v  6\v  6A\b! "!\0A\f\f\v (\b"\0 6\f  6\b  \x006\bA\0!\0A!A\f\v j 6\0  j \x006\0\vAŒ8(\0"\0 M\r\0AŒ8 \0 k"6\0A˜8A˜8(\0"\0 j"6\0  Ar6 \0 Ar6 \0A\bj!\0\f\vAü7A06\0A\0!\0\f\v \0 6\0 \0 \0( j6 Ax kAqj"\b Ar6 Ax kAqj"  \bj"k!@A˜8(\0 F@A˜8 6\0AŒ8AŒ8(\0 j"\x006\0  \0Ar6\f\vA”8(\0 F@A”8 6\0Aˆ8Aˆ8(\0 j"\x006\0  \0Ar6 \0 j \x006\0\f\v ("\0AqAF@ \0Axq!\t (\f!@ \0AÿM@ (\b" F@A€8A€8(\0A~ \0Avwq6\0\f\v  6\f  6\b\f\v (!@  G@ (\b"\0 6\f  \x006\b\f\v@ ("\0 Aj ("\0E\r Aj\v!@ ! \0"Aj! \0("\0\r\0 Aj! ("\0\r\0\v A\x006\0\f\vA\0!\v E\r\0@ ("\0At"(°: F@ A°:j 6\0 \rA„8A„8(\0A~ \0wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("\0@  \x006 \0 6\v ("\0E\r\0  \x006 \0 6\v  \tj!  \tj"(!\0\v  \0A~q6  Ar6  j 6\0 AÿM@ AøqA¨8j!\0A€8(\0"A Avt"qE@A€8  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA! AÿÿÿM@ A& A\bvg"\0kvAq \0AtkA>j!\v  6 B\x007 AtA°:j!\0@@A„8(\0"A t"qE@A„8  r6\0 \0 6\0\f\v A AvkA\0 AGt! \0(\0!@ "\0(Axq F\r Av! At! \0 Aqj"("\r\0\v  6\v  \x006  6\f  6\b\f\v \0(\b" 6\f \0 6\b A\x006  \x006\f  6\b\v \bA\bj!\0\f\v@ \bE\r\0@ ("At"(°: F@ A°:j \x006\0 \0\rA„8 A~ wq"6\0\f\v@  \b(F@ \b \x006\f\v \b \x006\v \0E\r\v \0 \b6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 AÿM@ AøqA¨8j!\0A€8(\0"A Avt"qE@A€8  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA!\0 AÿÿÿM@ A& A\bvg"\0kvAq \0AtkA>j!\0\v  \x006 B\x007 \0AtA°:j!@@ A \0t"qE@A„8  r6\0  6\0  6\f\v A \0AvkA\0 \0AGt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"("\r\0\v  6  6\v  6\f  6\b\f\v (\b"\0 6\f  6\b A\x006  6\f  \x006\b\v A\bj!\0\f\v@ \tE\r\0@ ("At"(°: F@ A°:j \x006\0 \0\rA„8 \vA~ wq6\0\f\v@  \t(F@ \t \x006\f\v \t \x006\v \0E\r\v \0 \t6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 \b@ \bAxqA¨8j!\0A”8(\0!A \bAvt" qE@A€8  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\vA”8 6\0Aˆ8 6\0\v A\bj!\0\v \nAj$\0 \0\v? A\bu! \0  Aq  (\0j(\0 \v j A Aq  \0(\0(\t\0\vÕ\b#\0Ak"$\0@@@ \0("-\0\0Ak\0\v@ \0(\b" \0(\f"\b\'\r\0A!@@@@ \0(\0"-\0\0"\tAk\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v Aÿÿq /AjAÿÿqG\r\0A!A!@@@@ \tAk\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v   Á%E\r\vA\0! Aj \b (\0 (D"E\r  \0(\x006\0 Aj! @ ."AN@ .!\0 -\0\0!  6\b  \0 AtAþÿq A\0 AFjjAj6\f\v  6\b A\x006A\0 AH\r\v A\0 -\0\0AF"\0Aj AtAþÿqj \0.j\v"\0AjA\0 \0-\0\0AFAj6\f  9!\f\vA! ."A\0L@A\0!\f\v  \0(\x006\0  Aj" AtAþÿq"\bj6  \0(\b6\b  \0(\f6\f  9\r\0 A\0 A\0J!A!  \bj!@  F@A\0!\f\v  \0(\x006\0    AtAkAþÿqj.\0j6  \0(\b6\b  \0(\f6\f Aj!  9E\r\0\v\v Aj$\0 \v­\b#\0Ak"$\0 \0("-\0\0!@ \0(\0"-\0\0"AF@@ AG\r\0 \0(\b \0(\f\'\r\0 /" /G\r\0   AjÁ%E\r\v  6\0  \0(6  \0(\b6\b  \0(\f6\f  E\f\v AF@  6  6\0  \0(\f6\b  \0(\b6\f  E\f\v@ AG\r\0 AG\r\0 /"\0 /F@   \0AjÁ%E\r\v A\x006\f\v@@ AG\r\0 AG\r\0 / /G\rA! ."\bA\0L\r  Aj" \bAtAþÿqj6\0  Aj"\b ."AtAþÿqjA\0 A\0J6  \0(\b6\b  \0(\f6\f  : (E\r@  ."N\r   AtAkAþÿq"\tj.\0  AtAþÿqjj6\0  ." LA\0 \b \tj.\0 \b AtAþÿqjj\v6  \0(\b6\b  \0(\f6\f Aj!  : (\r\0\v\f\v A\x006\f\v A\x006\v Aj$\0\v2 \0@ \0(\0; \0(; \0(! \0A\x006 @ \v \0\v\vº\b \0Aj!@@ \0("\0E\r\0 /\0"At"Aj!  AkAþÿqj!\b !@A!@ \0("\t/\0" At" \t AkAþÿqj/jAjA\vÁ"  \b/A\0\v jÁ"H@ \0Aj!\0\f\v  H@ \0!\f\v  \0 \t  %"A\0H! \0 AvAqj!\0\v \0(\0"\0\r\0\v  F\r\0  \b/A\0\v jÁ!  ("/\0"\0 \0At"\0  \0AkAþÿqj/jAjA\vÁ"\0H\r\0 \0 H\r   %A\0N\r\v !\v \vñ .\0!@ @  \0 AtAjÁjI\r\v \0 ;\0 A\0L@ \0\v AtAþÿq"@ \0AjA\0 ü\v\0\v \0Aj" j Aj" /\0AtAþÿqj   (E\r\0 \0A\0!A!@ \0.\0"\b L@ \0\v  AtAkAþÿq"\tj.\0  \bAtAþÿqjj  \tj.\0  /\0AtAþÿqjj   (E\r \0 ! Aj!\f\0\v\0\vA\0\v\v\0 \0/\0AjÁ\v+ \0/\0AjÁ! \0/\0AjÁ"@  \0 ü\n\0\0\v \vt \0A\x006\b \0B\x007\0 /\0Aj"Á!@ Aÿÿq@ A\0H\r ! @ A\0 ü\v\0\v \0  j"6\b \0 6 \0 6\0\v @   ü\n\0\0\v\v2\0\vA A\bu! \0   Aq  (\0j(\0 \v j A Aq  \0(\0(\b\0\vv \0($"E@ \0 6 \0 6 \0A6$ \0 \0(86\v@@ \0( \0(8G\r\0 \0( G\r\0 \0(AG\r \0 6\v \0A:\x006 \0A6 \0 Aj6$\v\vš\0 \0A:\x005@  \0(G\r\0 \0A:\x004@ \0("E@ \0A6$ \0 6 \0 6 AG\r \0(0AF\r\f\v  F@ \0("AF@ \0 6 !\v \0(0AG\r AF\r\f\v \0 \0($Aj6$\v \0A:\x006\v\vž  G@ \0Aj!@ -\0\0!@ Aj /"At"Aþÿqj"\0Aj \'\r\0 \0 .jAj \'\r\0 \vA!\0@@@ Ak\0\0\v Aj!\0\f\v   AkAþÿqj/jAj!\0\v  \0Áj" G\r\0\v\vA\0\vž\f#\0Ak"\b$\0@ \0(\0"Aj \0(\b"\n (\0" ("D"@ Aj! \b@ ."AN@ \b . AtAþÿq A\0 -\0\0AFjjAj6\0 \b \0(6\f\v \bA\x006\0 \b \0(6A\0 AH\r\v A\0 -\0\0AF"Aj AtAþÿqj .j\v"AjA\0 -\0\0AFAj6\b \b \0(\f6\f \b :\f\v@ \0("-\0\0AG\r\0 Aj \0(\f  D"E\r\0 \b 6\0 Aj! \b@ ."AN@ .! -\0\0!\0 \b \n6\b \b  AtAþÿq A\0 \0AFjjAj6\f\v \b \n6\b \bA\x006A\0 AH\r\v A\0 -\0\0AF"\0Aj AtAþÿqj \0.j\v"\0AjA\0 \0-\0\0AFAj6\f \b E\f\v \0 9@ A\x006\f\v Aj!\v@ (\f"E\r\0  \vO\r\0 A\x006\f\v A:\0\0@ A\0  A\vjIE@ B\x007 A;@ (\f"E\r\0  A\fjO\r\0 A\x006\f\v A:\0\v A\0  \0(\b"AjÁ"\t Aj"\njI\r  \t;\f \tAN@A\0!@ A\0!\tA!E@  j-\0\0"\tE!\v  \nj \t:\0\0 Aj" .\f"\tAkH\r\0\v\v \t \njAkA\0:\0\0A!@@@@ Aj"\f /"AtAþÿqj"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\vA! /"E\r\0 At"  AkAþÿqj/jAj!\v  ;  Áj!@ (\f"E\r\0  A\0 AKAjO\r\0 A\x006\f\v A:\0\0A\0! A\0 AK"AjA\0 -\0\0"\nAFAj!\r@ A\0  \r \0(\f"AjÁ"\tjIE@  \t; \tAN@A\0!@ A\0!\tA!E@  j-\0\0"\tE!\v  \rj \t:\0\0 Aj" ."\tAkH\r\0\v\v \t \rjAkA\0:\0\0 \nAF\r\v A\x006\f\vA!@@@@ \f \v/\0"AtAþÿqj"\n \f.\0"j"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v   j";@ (\f"E\r\0A!@@@@ \0(\0"\v-\0\0Ak\0\v \v/Aj!\f\v \v/Aj!\f\v \v/"E@A!\f\v At" \v AkAþÿqj/jAj!\v  Á \n ÁjA\0 AKjO\r\0 A\x006\f\vA!@@@@ \0(\0"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v Á"@ \n ÁjA\0 AK  ü\n\0\0\vA!@@@@ \f /"AtAþÿqj"\n ."j"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v   j";@ (\f"E\r\0A!@@@@ \0("\v-\0\0Ak\0\v \v/Aj!\f\v \v/Aj!\f\v \v/"E@A!\f\v At" \v AkAþÿqj/jAj!\v  Á \n ÁjA\0 AKjO\r\0 A\x006\f\vA!@@@@ \0("-\0\0Ak\0\v /Aj!\f\v /Aj!\f\vA! /"\0E\r\0 \0At"\0  \0AkAþÿqj/jAj!\v Á"\0@ \n ÁjA\0 AK  \0ü\n\0\0\vA!\0A!@@@@ ." \f /AtAþÿqjj"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v   j;\t@@@@ ("-\0\0Ak\0\v /Aj!\0\f\v /Aj!\0\f\v /"\0E@A!\0\f\v \0At"\0  \0AkAþÿqj/jAj!\0\v   \0Áj6  /\bAj;\b\f\v A\x006\f\v A\x006\v \bAj$\0\v¾ Aj!@@ -\0"A)F@ \0!\f\v \0!@@ Aÿq"A?K\r\0B ­†BÌ€€ƒP\r\0 -\0! Aj! A)G\r\f\v  Aj"I\r@@@ A(G@ Aà\0F@ A:\0\0 ! Aj"\t!@ Aj! ,\0"1\r  O\r\b  :\0\0 Aj! !\f\0\v\0\v A:\0\0 Aj"\t!@ ,\0\0"1E@  O\r\b  :\0\0 Aj! Aj!\f\v\v  I\r\f\v A:\0\0   F"\r\f\v  O\r\v A\0:\0\0  \tAj;\0\vA!@@@@ -\0\0Ak\0\v /\0Aj!\f\v /\0Aj!\f\v /\0"E@A!\f\v At"  AkAþÿqj/jAj!\v Aj!  Áj! -\0\0"A)G\r\0\v\v   At"AjÁ"jI\r\0  \0k"@ \0 j \0 ü\n\0\0\v Aj!\b \0 ;\0 ÁA\0L\r\0 \0Aj!\0 Aÿÿq"@ \0A\0 ü\v\0\vA!@@@@ \0 j"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v \0 ;\0 Aÿÿq"AF\r\0A!@A!@@@@  \0 At"AkAþÿqj.\0"j"-\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v \0 j  j;\0 Aj" G\r\0\v\v \b\v\0\vï@ \0-\0\0"AG\r\0 \0Aj"/\0AG\r\0 A\0 AF"-\0AG"@A\0\v \0. Ajj"-\0\0AG"@A\0\v A\0; A\x006\0@@ Aj"/\0\0\v \0-\0\fAG\r A\0  Aj6\0  \0/\rAk;\v A\0;\f A\x006\b@@ Aj"\0/\0\0\v -\0AG\r A\0 \0 Aj6\b  /Ak;\f\vA!\v \vñ\b\b \0Aj!\t@ E\r\0  \tO\r\0A\0\v@ .\0"AF\r\0 /\0AG\r\0A! \0  AtAþÿqjAjA\0 AJ AjAæ\bA²& JE\r\0@@@@ \0-\0\0Ak\0\v \0/Aj!\f\v \0/Aj!\f\v \0/"E@A!\f\v At" \0 AkAþÿqj/jAj!\v \0 Áj"  \0Aæ\b =E\r\0 /\0" At"  AkAþÿqj/jAjÁA\v j"  \0A²& =E\r\0A!  .\0"AtAþÿqjAj! .\0"A\0LA\0 Aj"\b At"\nAþÿqj!\vA\0! AG \b \nAkAþÿqj.\0A\0\v \vj\v!@@@@ -\0\0"\bAk\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\vA!@@@@ -\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v Aÿÿq AÿÿqG\r\0A!@@@@ \bAk\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v   Á%\r\0  AtAþÿqj"Aj!A!@@@@ -\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v /\0 E@ Aj!A\0\f\v  At" Aj" AkAþÿqj/\0jAjÁj!A\0 AH\r\0  Aÿÿqj\v!Ak!A!@@@@ -\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v At!   Ájk"@ \0 AjÁj  Áj ü\n\0\0\v \0 Á";\0 A\0L@ \0\vA\0! Aÿÿq"@ \tA\0 ü\v\0\v@ \0 Á! AjÁ" H\r\0\v \0\v \0A\0;\0A\0\vš#\0A k"$\0 \0Aj!@@ E\r\0  O\r\0A\0!\f\v  6  6  6  6  6\fA\0! A\0;\b  \x006  \x006\0 Aj : ("E@ \0A\0:\0\0\f\v A\0  /\bAtAjÁ" jI\r\0  (\0"k"@  j  ü\n\0\0\v \0A:\0\0 \0 .\b"; A\0J@A\0! AtAþÿq"@ \0AjA\0 ü\v\0\v@  Á! AjÁ" H\r\0\v\v \0!\v A j$\0 \vßAø;-\0\0E@Aø;A:\0\0AäAì0\vAÔA€A¸A\0AîAAñA\0AñA\0AÓ\bAóAAÔAAøAüAA\rA"\0A6\0AÔAµ\tAA€AŒA \0A\0A\0A\0\0A"\0A\b6\0AÔAÕ\nAA A°A\t \0A\0A\0A\0\0A"\0A\n6\0AÔA€\vAA¸AÀA\v \0A\0A\0A\0\0A"\0A\f6\0AÔAÂ\bAAÌAØA\r \0A\0A\0A\0\0A"\0A6\0AÔA¾\bAAàAðA \0A\0A\0A\0\0AøAA°A\0AÑAAñA\0AñA\0AÎ\nAÔAAØAðAA\0A¯AAñA\0AñA\0A\tA²AA¸AÔAøA\0AœAAñA\0AñA\0AÁ\vAŸAA¤A¼AÜA\0AûAAñA\0AñA\0A›\bAþAA„AœA¼A\0AÛAAñA\0AñA\0A‚\tAÞAAäAŒA¬A\0AËAAñA\0AñA\0A¬\vAÎAAøA‹\nAAÔAàAAA\0A\0AøA\nAAèAôAAA\0A\0AøAŠ\bAAüA„A A!A\0A\0AøA€\bAAˆAA"A#A\0A\0A"\0A$6\0AøAŸ\vAA”AœA% \0A\0A\0A\0\0A"\0A&6\0AøAû\nAA A¨A\' \0A\0A\0A\0\0AØA‹\nAA¬A¸A(A)A\0A\0AØA\nAAÀAÌA*A+A\0A\0AØAŠ\bAAÔAÜA,A-A\0A\0AØA€\bAAàAèA.A/A\0A\0A"\0A06\0AØAŸ\vAAìAôA1 \0A\0A\0A\0\0A"\0A26\0AØAû\nAAøA€A3 \0A\0A\0A\0\0A¸A‹\nAA„AA4A5A\0A\0A¸A\nAA˜A¤A6A7A\0A\0A¸AŠ\bAA¬A´A8A9A\0A\0A¸A€\bAA¸AÀA:A;A\0A\0A"\0A<6\0A¸AŸ\vAAÄAÌA= \0A\0A\0A\0\0A"\0A>6\0A¸Aû\nAAÐAØA? \0A\0A\0A\0\0A¤A‹\nAAÜAèAÀ\0AÁ\0A\0A\0A¤A\nAAðAüAÂ\0AÃ\0A\0A\0A¤AŠ\bAA„AŒAÄ\0AÅ\0A\0A\0A¤A€\bAAA˜AÆ\0AÇ\0A\0A\0A"\0AÈ\x006\0A¤AŸ\vAAœA¤AÉ\0 \0A\0A\0A\0\0A"\0AÊ\x006\0A¤Aû\nAA¨A°AË\0 \0A\0A\0A\0\0A„A‹\nAA´AÀAÌ\0AÍ\0A\0A\0A„A\nAAÈAÔAÎ\0AÏ\0A\0A\0A„AŠ\bAAÜAäAÐ\0AÑ\0A\0A\0A„A€\bAAèAðAÒ\0AÓ\0A\0A\0A"\0AÔ\x006\0A„AŸ\vAAôAüAÕ\0 \0A\0A\0A\0\0A"\0AÖ\x006\0A„Aû\nAA€AˆA×\0 \0A\0A\0A\0\0AäA‹\nAAŒA˜AØ\0AÙ\0A\0A\0AäA\nAA A¬AÚ\0AÛ\0A\0A\0AäAŠ\bAA´A¼AÜ\0AÝ\0A\0A\0AäA€\bAAÀAÈAÞ\0Aß\0A\0A\0A"\0Aà\x006\0AäAŸ\vAAÌAÔAá\0 \0A\0A\0A\0\0A"\0Aâ\x006\0AäAû\nAAØAàAã\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aä\x006\0AØA§\vAAäAìAå\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aæ\x006\0A¸A§\vAAðAøAç\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aè\x006\0A¤A¿\tAAüA„ Aé\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aê\x006\0A¤A‡\tAAˆ A” Aë\0 \0A\0A\0A\0\0Aœ A–\vAA\0Aœ AÁ\vAAœ A\tAAœ A›\bAAœ A™\tA\0A\b"\0A\x006 \0Aì\x006\0A„A\vAA¸ AÀ Aí\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aî\x006\0A„A¸\vAAÄ AÌ Aï\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Að\x006\0A„AŠ\tAAÐ AØ Añ\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aò\x006\0A„A–\bAAÜ Aä Aó\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aô\x006\0AäA¿\tAAè Að Aõ\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aö\x006\0AäA÷\bAAô Aü A÷\0 \0A\0A\0A\0\0A\b"\0A\x006 \0Aø\x006\0AäA‡\tAA€!AŒ!Aù\0 \0A\0A\0A\0\0A„AÊ\vAA !A´!Aú\0Aû\0A\0A\0AäAÊ\vAAÀ!AÔ!Aü\0Aý\0A\0A\0A„AÆ\tAAà!Aø!Aþ\0Aÿ\0A\0A\0AäAÆ\tAA€"A"A€AA\0A\0A„A¥\vAA "A°"A‚AƒA\0A\0AäA¥\vAA€"A"A€A„A\0A\0A¸"AÐ"Að"A\0A‘#A…AñA\0AñA\0AÌ\tA”#A†A¸"AA˜#A¤#A‡Aˆ\rA\b"\0A\x006 \0A‰6\0A¸"AÜ\nAA¬#A¸#AŠ \0A\0A\0A\0\0A\b"\0A\x006 \0A‹6\0A¸"Aë\nAA¬#A¸#AŠ \0A\0A\0A\0\0A\b"\0A\x006 \0AŒ6\0A¸"A¼\bAAÀ#AÈ#A \0A\0A\0A\0\0A"\0AŽ6\0A¸"AÖ\vAAÌ#AØ#A \0A\0A\0A\0\0A"\0A6\0A¸"A…\vAAà#Aì#A‘ \0A\0A\0A\0\0\v\r\0    \0\0\v´#\0Ak"$\0 (\0"AøÿÿÿI@@@ A\vO@ Ar"\bAj!  \bAÿÿÿÿk6\f  6  6\b\f\v  :\0 Aj! E\r\v E\r\0  Aj ü\n\0\0\v  jA\0:\0\0   Aj  \0\n\0 ,\0A\0H@ (\v Aj$\0\v#\0\v5  \0("Auj! \0(\0!\0  Aq (\0\0 \0j(\0 \0\v\0\0\v. \0/\0"E@A\v At" \0 AkAþÿqj/jAjÁ\vrA!A! \0/\0" At" \0 AkAþÿqj/jAjÁA\v! \0/\0"@ At" \0 AkAþÿqj/jAjÁ!\v @  \0 ü\n\0\0\v \v° \0A\x006\b \0B\x007\0@ /\0"  At"AkAþÿqj/A\0\v Aj"j"Aÿÿq@ Á"A\0H\r ! @ A\0 ü\v\0\v \0  j"6\b \0 6 \0 6\0\v   AkAÿÿqj/A\0\v jÁ"\0@   \0ü\n\0\0\v\v2\0\vó "!@@ -\0"@ Aj!  j!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\v  k G\r\v  \0A\x006\b \0B\x007\0\v A\0:\0\0 "AøÿÿÿI@@@ A\vO@ Ar"Aj! \0 Aÿÿÿÿk6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0  ü\n\0\0\v \0 jA\0:\0\0 \v#\0\v€ ! \0(\0 \0 \0,\0\vA\0H!  j! Aj"!\0@@ ,\0\0"1E@ \0 O\r \0 :\0\0 \0Aj!\0 Aj!\f\v\v \0 O\r\0 \0A\0:\0\0  Aj;\0 \v A\0\v\b\0 \0]\vK@ E\r\0 A°/ "E\r\0 (\b \0(\bAsq\r\0 \0(\f (\fA\0E\r\0 \0( (A\0!\v \vn Aq! -\x007AF@ A\bu" E\r  (\0j(\0\f\v A\bu E\r\0  \0(68A\0!A\0\v! \0   j A Aq \0(\0(\0\v\n\0 \0 A\0\v\0\0\v\0X\0\v\0Y\0\vÚ\0A¼0AÑ\vAÔ0A”\tAA\0Aà0Aã\bAA€Aÿ\0Aø0AÜ\bAA€Aÿ\0Aì0AÚ\bAA\0AÿA„1A©\bAA€€~AÿÿA1A \bAA\0AÿÿAœ1A¸\bAA€€€€xAÿÿÿÿA¨1A¯\bAA\0AA´1Aï\tAA€€€€xAÿÿÿÿAÀ1Aæ\tAA\0AAÌ1AÜ\tA\bB€€€€€€€€€Bÿÿÿÿÿÿÿÿÿ\0AØ1AÓ\tA\bB\0BAä1AÆ\bA\fAì1A±\vA\b\fAÐ&A¤\nA˜\'AAô\t\tAà\'AA°\n\tA¬(AA¿\n\tA´&Aø(A\0AA )A\0AÒAÈ)AA«Að)AAÚ\vA˜*AAù\vAÀ*AA¡\fAè*AA¾\fA+AA÷A¸+AA•A )A\0A¤\rAÈ)AAƒ\rAð)AAæ\rA˜*AAÄ\rAÀ*AAìAè*AAÊAà+A\bA©Aˆ,A\tA‡A°,AAä\fAØ,AA¼\vù@  \0Aj"I\r\0@ -\0\0"A(G@ Aà\0G\r \0A:\0\0 \0Aj"!\0@@ Aj! ,\0"1\r\0 \0 O\r \0 :\0\0 \0Aj!\0 !\f\v\v \0 O\r \0A\0:\0\0  Aj;\0 \v \0A:\0\0   F\v \0A:\0\0 \0Aj"!\0@ ,\0\0"1E@ \0 O\r \0 :\0\0 \0Aj!\0 Aj!\f\v\v \0 O\r\0 \0A\0:\0\0  Aj;\0 !\v \v1 \0Aˆ46\0 \0(A\fk" (\bAk"6\b A\0H@ \v \0\v\0 \0AÐ\0r7AÐ\0j\vmA\b^"AÜ56\0 Aˆ46\0 \0"A\rj"A\x006\b  6  6\0 A\fj! Aj"@  \0 ü\n\0\0\v  6 A¸46\0 AÄ4A“\v\0\vø\t@ "(\0"@ ("E\r@ "(\0"\r\0\v\v ("\r\0 (\b!A\0!A\f\v  (\b"6\bA\0\v!@ (\0" F@  6\0 \0 F@A\0! !\0\f\v (!\f\v  6\v -\0\f!  G@  (\b"6\b@ (\0 F@  6\0\f\v  6\v  (\0"6\0  6\b  ("6 @  6\b\v  -\0\f:\0\f  \0 \0 F!\0\v@ \0E\r\0 AqE\r\0 @@ -\0\f!@ (\b"(\0" G@ AqE@ A:\0\f A\0:\0\f  ("(\0"6 @  6\b\v  (\b"6\b@ (\0 F@  6\0\f\v  6\v  6\0  6\b  \0 \0 (\0"F!\0 (!\v@@ (\0"@ -\0\fAG\r\v@ ("E\r\0 -\0\fAF\r\0 !\f\v A\0:\0\f \0 (\b"G@ -\0\f\r\v A:\0\f\v@ ("E\r\0 -\0\fAF\r\0 !\f\v A:\0\f A\0:\0\f  ("\x006\0 \0@ \0 6\b\v  (\b"\x006\b@ \0(\0 F@ \0 6\0\f\v \0 6\v  6  6\b !\v  (\b"\0-\0\f:\0\f \0A:\0\f A:\0\f \0 \0("(\0"6 @  \x006\b\v  \0(\b"6\b@ (\0 \0F@  6\0\f\v  6\v  \x006\0 \0 6\b\v AqE@ A:\0\f A\0:\0\f  ("6\0 @  6\b\v  (\b"6\b@ (\0 F@  6\0\f\v  6\v  6  6\b  \0 \0 ("F!\0 (\0!\v@@ (\0"E\r\0 -\0\fAF\r\0 !\f\v@ ("@ -\0\fAG\r\v A\0:\0\f (\b"-\0\fAF \0 Gq\r A:\0\f\v@ E\r\0 -\0\fAF\r\0 !\f\v A:\0\f A\0:\0\f  (\0"\x006 \0@ \0 6\b\v  (\b"\x006\b@ \0(\0 F@ \0 6\0\f\v \0 6\v  6\0  6\b !\v  (\b"\0-\0\f:\0\f \0A:\0\f A:\0\f \0 \0(\0"("6\0 @  \x006\b\v  \0(\b"6\b@ (\0 \0F@  6\0\f\v  6\v  \x006 \0 6\b\v (\b"AA\0  (\0Fj(\0!\f\0\v\0\v A:\0\f\v\v \0!@@A\0! -\0\0"E\r\0@@ Aÿq"A?K\r\0B ­†BÌ€€ƒP\r\0 -\0! Aj! \r\f\v@ A-G\r\0 -\0A-G\r\0 !@ -\0\0 Aj"!A-F\r\0\vA! -\0\0"\r\f\v\v   \\"E@A\0\vA!@@@@ -\0\0Ak\0\v /Aj!\f\v /Aj!\f\v /"E@A!\f\v At"  AkAþÿqj/jAj!\v Aj!  Áj! E\r\v\v   At"AjÁ"jI@A\0\v  \0k"@ \0 j \0 ü\n\0\0\v \0 ;\0 Á"A\0J@A\0! Aÿÿq"@ \0AjA\0 ü\v\0\v@ \0 Á! AjÁ" H\r\0\v\v \vG#\0Ak"$\0 \0(\0!\0  6\f A <6\b  A\bj \0\0 (\f"A\tO@ \n\v Aj$\0\v\0AÔ\võ\f\r#\0A@j"$\0  6\f Aü#6\b  A\bj6  A4j"\b60 B\x0074  A(j"\v6$ B\x007( \0A\bj!\f@@@@@ \0(\b" \0A\fj"\tF\r\0 \0Aj" \0(F\r\0 \0Aj!\n@  \n(\0"G@@@ \0." .N@ . L\r\v \0( " ( (  \0.jI \0( "/\0"E\r\0 \0.\0 At"Aj"\r  Ak"Aþÿqj/jÁH\r\0@ AG@ \f < \tG\r A0j < \bG\r \r  Aÿÿqj/jÁ! \0( "/\0" At"  AkAþÿqj/jAjÁA\v"@   ü\n\0\0\v A0j A<j 5"(\0E@A" 6  (<6\b B\x007\0  6\0 (0(\0"@  60\v (4 4  (8Aj68\f\v \f\v \n < G\r A$j < \vG\r \r  Aÿÿqj/\0jÁ! \0( "/\0" At"  AkAþÿqj/jAjÁA\v"@   ü\n\0\0\v A$j A<j 5"(\0E@A" 6  (<6\b B\x007\0  6\0 ($(\0"@  6$\v (( 4  (,Aj6,\f\v \v  \0( 6< ("E\r  A<j (\0(\0\r\v@ ("@@ "(\0"\r\0\f\v\0\v@  (\b"(\0G !\r\0\v\v  "G\r\0\v\v@ ("@@ "(\0"\r\0\f\v\0\v@  (\b"(\0G !\r\0\v\v \t "G\r\0\v\v \0 \0/";\f\v \0/!\v \0 Aj; (,!\t (8!\n (0" \bF\r@ ("! !@ @@ "(\0"\r\0\v@ "(\0"\r\0\v\f\v@  (\b"(\0G !\r\0\v !@  (\b"(\0G !\r\0\v\v  (0F@  60\v  (8Ak68 (4 ` \f A<j (5"(\0E@A! (! A\x006  6  \0/;  (<6\b B\x007\0  6\0 \0(\b(\0"@ \f 6\0\v \0(\f 4 \0 \0(Aj6\v (! A\x006 @ \v  \b "G\r\0\v\f\vA^"\0Aˆ-6\0 \0A”-A’\v\0\v \v ($"G@ \0Aj!\b@ ("! !@ @@ "(\0"\r\0\v@ "(\0"\r\0\v\f\v@  (\b"(\0G !\r\0\v !@  (\b"(\0G !\r\0\v\v  ($F@  6$\v  (,Ak6, (( ` \b A<j (5"(\0E@A! (! A\x006  6  \0/;  (<6\b B\x007\0  6\0 \0((\0"@ \b 6\0\v \0( 4 \0 \0(Aj6\v (! A\x006 @ \v  \v "G\r\0\v\v ((; (4;@ ("\0 A\bjFA \0E\rA\v! \0 \0(\0 j(\0\0\v A@k$\0 \t \njÁ\v·#\0Ak"$\0 (\0"AøÿÿÿI@ \0(\0!@@ A\vO@ Ar"Aj!\0  Aÿÿÿÿk6\f  \x006  6\b\f\v  :\0 Aj!\0 E\r\v E\r\0 \0 Aj ü\n\0\0\v \0 jA\0:\0\0  Aj \0 ,\0A\0H@ (\v Aj$\0\v#\0\vä#\0Ak"$\0 ,\0\v! (\0!@ \0.\0""   A\0H  ja"E@ \f\v \0/" \0/F@ \0 Aj;\v@@ /\0AG@ \0A\bj A\bj 5"(\0\rA" 6  \0/;  (\b6\b B\x007\0  6\0 \0(\b(\0"@ \0 6\b\v \0(\f 4 \0 \0(Aj6\f\v \0Aj A\fj 5"(\0\rA" 6  \0/;  (\f6\b B\x007\0  6\0 \0((\0"@ \0 6\v \0( 4 \0 \0(Aj6\vA\0!\v E\r\0 \v Aj$\0 A\0G\v5  \0("Auj! \0(\0!\0  Aq (\0 \0j(\0 \0\v\0\v9\0 \0A\x006 \0(\f$ \0 \0A\fj6\b \0B\x007\f \0($ \0 \0Aj6 \0B\x007\v/ \0 ; ! \0( ! \0 6 @ \v \0A\0;\v7  \0("Auj! \0(\0!\0   Aq (\0 \0j(\0 \0\v\0\v\0 \0A\0; \0 ;\0\vªA$! .\0! \0/\0!\0 B\x007  A\fj"6\b B\x007\f A\x006  Aj"6 A\0;  \0;\0  ; ! ( !\0  6 \0@ \0\v A\x006 (\f$  6\b B\x007\f ($  6 B\x007 \v1#\0Ak"$\0  ;  ;\f Aj A\fj \0\0 Aj$\0\v2 \0@ \0( ! \0A\x006 @ \v \0($ \0(\f$ \0\v\v\0A¸"\vž#\0Ak"$\0 !@@ /\0AG\r\0 Aj HE\r\0  \0.\0"At"AjÁH\r\0  ;\0 A\0L\r Aÿÿq"@ AjA\0 ü\v\0\v Aj" AtAþÿqj \0Aj" \0/\0AtAþÿqj   j"6E\r\0 A\0!A!@  .\0"N\r  AtAkAþÿq"\bj.\0  AtAþÿqjj  \bj.\0  \0/\0AtAþÿqjj  6E\r  ! Aj!\f\0\v\0\v A\0!\v Aj$\0 \v?#\0Ak"$\0 !@  H@  \0   j6\r\v A\0!\v Aj$\0 \v! " \0   jI  A\0\v\vA " \0  (\0  ,\0\vA\0H (\0  ,\0\vA\0H  jJ@ \v A\0\vÆ#\0A k"$\0@ (\0"AøÿÿÿO\r\0@@ A\vO@ Ar"\tAj!\b  \tAÿÿÿÿk6  \b6  6\f\v  :\0 Aj!\b E\r\v E\r\0 \b Aj ü\n\0\0\v  \bjA\0:\0\0 (\0"AøÿÿÿO\r\0@@ A\vO@ Ar"Aj!\b  Aÿÿÿÿk6  \b6\b  6\f\f\v  :\0 A\bj!\b E\r\v E\r\0 \b Aj ü\n\0\0\v  \bjA\0:\0\0   Aj A\bj  \0\v\0 ,\0A\0H@ (\b\v ,\0A\0H@ (\v A j$\0\v#\0\vZ ,\0\v! (! (\0! " \0 AjA\0 /\0AF   A\0H"\0A\0   \0  j=@ \v A\0\vL ,\0\v! (! (\0! " \0    A\0H"\0A\0   \0  j(@ \v A\0\v7  \0("Auj! \0(\0!\0   Aq (\0 \0j(\0 \0\v\0\vZ@ A\0H\r\0 \0.\0"Ak L\r\0  N\r\0 \0Aj"\0 AtAþÿqj!  \0 AtAkAþÿqj.\0A\0\v j!\v \vL \0.\0"A\0L@A\0\v \0Aj" At"Aþÿqj!A\0!\0 AG  AkAþÿqj.\0A\0\v j\v\v\0 \0/\0AkÁ\v\0 \0AjA\0 \0-\0\0AF\v\0 \0AjA\0 \0-\0\0AF\v\0 \0AjA\0 \0-\0\0AF\v\0 \0-\0\0\v7  \0("Auj! \0(\0!\0   Aq (\0\0 \0j(\0 \0\v\0\vP@ A\0H\r\0  \0.\0"N\r\0 \0Aj"\0 AtAþÿqj!  \0 AtAkAþÿqj.\0A\0\v j!\v \v\0 \0.\0\vÕ\t !\b@@ /\0"E\r\0  \bj! Aj!\vA!\t \b!@ AkÁ \nJ@@@@@ Á \nÁLA\0 \v AtAþÿqj! \n \v \nAtAkAþÿqj.\0A\0\v j\v"-\0\0Ak\0\v  O\r Aà\0:\0\0 Aj! -\0"E\r Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v ! -\0"E\r Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v Aj  3!\v E\r  O\r A\n:\0\0  k" \t Á \tÁJ!\t \nAj!\n Aj! /\0!\f\v\v   \tÁ"jM\r\0 A\0J@ \tAÿÿq"@ A- ü\v\0\v  j!\v A\n:\0\0 \v /\0"AtAþÿqj!A\0! Aj!@@@@ AG \v AtAkAþÿqj.\0A\0\v j"-\0\0Ak\0\v  O\r Aà\0:\0 Aj! -\0"E\r Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v -\0"E\r Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v Aj  3!\v E\r\0  O\r\0 A\n:\0\0 Aj \bk G\r\v \b \0A\x006\b \0B\x007\0\v A\0:\0 \b"AøÿÿÿI@@@ A\vO@ Ar"Aj! \0 Aÿÿÿÿk6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0 \b ü\n\0\0\v \0 jA\0:\0\0 \b\v#\0\v- " \0(\0 \0 \0,\0\vA\0H  ja@ \v A\0\vWA!@@@ \0-\0\0Ak\0\v \0/"E@A\v At" \0 AkAþÿqj/jAj!\v Á\v \0/AjÁ\vçA!A!@@@@ \0-\0\0Ak\0\v \0/Aj!\f\v \0/Aj!\f\v \0/"E@A!\f\v At" \0 AkAþÿqj/jAj!\v Á!@@@@ \0-\0\0Ak\0\v \0/Aj!\f\v \0/Aj!\f\v \0/"E@A!\f\v At" \0 AkAþÿqj/jAj!\v Á"@  \0 ü\n\0\0\v \v· \0A\x006\b \0B\x007\0A!@@@@@@ -\0\0"Ak\0\v /Aj\f\v /Aj\f\v /"E@A!\f\v At"  AkAþÿqj/jAj\v"AÿÿqE@\f\v Á"A\0H\r\v ! @ A\0 ü\v\0\v \0  j"6\b \0 6 \0 6\0\vA!\0@@@@ Ak\0\v /Aj!\0\f\v /Aj!\0\f\v /"\0E@A!\0\f\v \0At"\0  \0AkAþÿqj/jAj!\0\v \0Á"\0@   \0ü\n\0\0\v\v2\0\vô " j!@@@@@@ -\0\0Ak\0\v A\0L\r Aà\0:\0\0 Aj! -\0"E\r Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v ! -\0"E\r Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\f\v Aj  3!\v E\r\0  k G\r\v  \0A\x006\b \0B\x007\0\v A\0:\0\0 "AøÿÿÿI@@@ A\vO@ Ar"Aj! \0 Aÿÿÿÿk6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0  ü\n\0\0\v \0 jA\0:\0\0 \v#\0\v- " \0(\0 \0 \0,\0\vA\0H  j\\@ \v A\0\v¹  "  j3"A\0  k GE@  \0A\x006\b \0B\x007\0\v A\0:\0\0 "AøÿÿÿI@@@ A\vO@ Ar"Aj! \0 Aÿÿÿÿk6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0  ü\n\0\0\v \0 jA\0:\0\0 \v#\0\v- " \0(\0 \0 \0,\0\vA\0H  jF@ \v A\0\v‡ !@@ A\0L\r\0 Aà\0:\0\0 Aj! -\0"@  j! Aj!@  O\r  :\0\0 Aj! -\0! Aj! \r\0\v\v  k G\r\v  \0A\x006\b \0B\x007\0\v A\0:\0\0 "AøÿÿÿI@@@ A\vO@ Ar"Aj! \0 Aÿÿÿÿk6\b \0 6\0 \0 6 !\0\f\v \0 :\0\v E\r\v E\r\0 \0  ü\n\0\0\v \0 jA\0:\0\0 \v#\0\v€ ! \0(\0 \0 \0,\0\vA\0H!  j! Aj"!\0@@ ,\0"1E@ \0 O\r Aj! \0 :\0\0 \0Aj!\0\f\v\v \0 O\r\0 \0A\0:\0\0  Aj;\0 \v A\0\v\0Aä\v\0A„\v\0A¤\v\0A¸\v\0AØ\v\0Aø\v0#\0Ak"$\0 \0(\0!\0  :\0   Aj \0\0 Aj$\0\v\0 \0(\0 j -\0\0:\0\0A\v¦#\0Ak"$\0 Aj   \0(\0\0A!\0@ -\0AqE\r\0 -\0!@A€<-\0\0Aq@Aü;(\0!\0\f\vAAÄA\b!\0A€<A:\0\0Aü; \x006\0\v  6\b A\x006 \0A\0A\0 Aj A\bjü!\0 ("E\r\0 \v Aj$\0 \0\v3 ( (\0"k K@A!  j-\0\0!\v \0 :\0 \0 :\0\0\v\r\0 \0( \0(\0k\v0#\0Ak"$\0 \0(\0!\0  :\0   Aj \0\0 Aj$\0\và@@ \0(" \0(\0"k" I@  k" \0(\b" kM@ @  -\0\0 ü\v\0\v \0  j6\v A\0H\rAÿÿÿÿ  k"At"   I AÿÿÿÿO"! @  j -\0\0 ü\v\0\v @   ü\n\0\0\v \0  j6\b \0  j6 \0 6\0 E\r \v  O\r\0 \0  j6\v\v2\0\v\r\0 \0A€j\0\v\0X\0\ve \0D\0\0\0\0\0\0\0\0@Aà=(\0AAA \0AF \0AF"\0AkvAq@Aà>Aà>(\0A \0Aktr6\0\f\v \0At(ð5"@ \0 \0\v\v\v\0 \0(\v\0Aè\b\v\0 \0 (\b @    C\v\v \0 (\b @    C\v -\x005 \0(\f! A\0:\x005 -\x004 A\0:\x004 \0( \0(     A -\x004"\tr!\b -\x005"\nr!@ AI\r\0 \0Aj Atj!\v \0Aj!@ -\x006\r@ \tAq@ (AF\r \0-\0\bAq\r\f\v \nAqE\r\0 \0-\0\bAqE\r\v A\0;4 (\0 (     A -\x005"\n rAq! -\x004"\t \brAq!\b A\bj" \vI\r\0\v\v  Aq:\x005  \bAq:\x004\v§\0 \0 (\b @@  (G\r\0 (AF\r\0  6\v\v@ \0 (\0 E\r\0@ ( G@  (G\r\v AG\r A6 \v  6  6  ((Aj6(@ ($AG\r\0 (AG\r\0 A:\x006\v A6,\v\v.#\0Ak"$\0 \0(\0!\0  :\0  Aj \0\0 Aj$\0\væ \0 (\b @@  (G\r\0 (AF\r\0  6\v\v@ \0 (\0 @@ ( G@  (G\r\v AG\r A6 \v  6 @ (,AF\r\0 \0Aj" \0(\fAtj!A\0!@@@  O\r\0 A\0;4 (\0 (   A A -\x006\r\0@ -\x005AG\r\0 -\x004AF@ (AG@A!A! \0-\0\bAq\r\v A6,\vA! \0-\0\bAqE\r\v A\bj!\f\v\v AA 6, E\r\f\v A6, \r\v  6  ((Aj6( ($AG\r (AG\r A:\x006\v \0(\f! \0( \0(    8 AI\r\0 \0Aj Atj! \0Aj!@ \0(\b"\0AqE@ ($AG\r\v@ -\x006\r (\0 (    8 A\bj" I\r\0\v\f\v \0AqE@@ -\x006\r ($AF\r (\0 (    8 A\bj" I\r\0\f\v\0\v@ -\x006\r ($AF@ (AF\r\v (\0 (    8 A\bj" I\r\0\v\v\v¿#\0A@j"$\0@ AÈ0A\0@ A\x006\0A!\f\v@ \0  \0-\0\bAqA E\r Aœ. "E\r -\0\bAqA\0G\v!\v @A! (\0"\0E\r  \0(\x006\0\f\v E\r\0 AÌ. "E\r\0 (\0"@  (\0"6\0\v (\b" \0(\b"AsqAq\r\0 As qAà\0q\r\0A! \0(\f" (\f"\0A\0\r\0 A¼0A\0@ \0E\r \0Aü. E!\f\vA\0! E\r\0 AÌ. "@ AqE\r@@ \0E\r \0AÌ. "\0E\r \0(\b (\b"Asq\rA (\f" \0(\f"\0A\0\r AqE\r E\r AÌ. "\r\0\v A°/ "E\r\0  \0U!\v \v!\f\v A°/ "@ AqE\r  \0U!\f\v Aì- "E\r\0 \0E\r\0 \0Aì- "\0E\r\0 A\bjA\0A8ü\v\0  A\0G:\0; A6  6\f  \x006 A64 \0 Aj A \0(\0(\0 ("\0AF@  (A\0 6\0\v \0AF!\v A@k$\0 \vz \0 (\bA\0@   B\v \0(\f! \0( \0(   V@ AI\r\0 \0Aj Atj! \0Aj!\0@ \0(\0 \0(   V -\x006\r \0A\bj"\0 I\r\0\v\v\v\0 \0 (\bA\0@   B\v\v1\0 \0 (\bA\0@   B\v \0(\b"\0    \0(\0(\0\v‹\0 \0 (\b @@  (G\r\0 (AF\r\0  6\v\v@ \0 (\0 @@ ( G@  (G\r\v AG\r A6 \v  6 @ (,AF\r\0 A\0;4 \0(\b"\0   A  \0(\0(\b\0 -\x005AF@ A6, -\x004E\r\f\v A6,\v  6  ((Aj6( ($AG\r (AG\r A:\x006\v \0(\b"\0     \0(\0(\t\0\v\vÁ \0(" \0(\b"I@  -\0\0:\0\0 \0 Aj6\v  \0(\0"k"Aj"A\0N@ Aÿÿÿÿ  k"At"   I AÿÿÿÿO" A\0\v"j" -\0\0:\0\0 @   ü\n\0\0\v \0  j6\b \0 Aj"6 \0 6\0 @ \v \0 6\v2\0\v7\0 \0 (\b @    C\v \0(\b"\0      \0(\0(\b\0\v­#\0A@j"$\0@A \0 A\0\r\0A\0 E\r\0A\0 Aì- "E\r\0 (\0"E\r A\bjA\0A8ü\v\0 A:\0; A6  \x006\f  6 A64  Aj A (\0(\0 ("\0AF@  (6\0\v \0AF\v A@k$\0\vY\0\v\0Až\t\v§ \0("Aj"7"\0 A€O@ @ \0  ü\n\0\0\v \0\f\v \0 j!@ \0 sAqE@@ \0AqE@ \0!\f\v E@ \0!\f\v \0!@  -\0\0:\0\0 Aj! Aj"AqE\r  I\r\0\v\v A|q!@ AÀ\0I\r\0  A@j"K\r\0@  (\x006\0  (6  (\b6\b  (\f6\f  (6  (6  (6  (6  ( 6  ($6$  ((6(  (,6,  (060  (464  (868  (<6< A@k! A@k" M\r\0\v\v  O\r@  (\x006\0 Aj! Aj" I\r\0\v\f\v AI@ \0!\f\v AI@ \0!\f\v Ak! \0!@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0 Aj! Aj" M\r\0\v\v  I@@  -\0\0:\0\0 Aj! Aj" G\r\0\v\v \0\vA\0\v\vA\f"\0A\x006\b \0B\x007\0 \0\v\0Að%\v\0 \0AjA\0 (Aø%F\v‡|#\0Ak"$\0 \0((! (\0!@Aˆ<-\0\0Aq@A„<(\0!\0\f\vAAà%A\0\b!\0Aˆ<A:\0\0A„< \x006\0\v  6\b A\x006 \0 A\0 Aj A\bj ("\0@ \0\vA<-\0\0AqE@AAè%A\b!\0A<A:\0\0AŒ< \x006\0\vü"\0A\tO@ \0\v  \x006\b A\x006AŒ<(\0 \0A\0 Aj A\bj ("@ \v \0A\tO@ \0\n\v Aj$\0D\0\0\0\0\0\0\0\0b\v\0 \0\r\0\v\0  \0(6 Aü#6\0\vA\b" \0(6 Aü#6\0 \v" \0@ \0(\0"@ \0 6 \v \0\v\v€\0Að;A6\0Aô;A\x006\0KAô;A”<(\x006\0A”<Að;6\0A˜<A”6\0Aœ<A\x006\0[Aœ<A”<(\x006\0A”<A˜<6\0AÜ<A€À\x006\0AÔ<Að¾6\0A¸<A*6\0A€=AÄ=6\0AØ<A€€6\0\v\vÃ.\0A€\b\vto_binary\0from_binary\0list\0List\0unsigned short\0unsigned int\0reset\0get\0float\0vector\0Buffer\0unsigned char\0std::exception\0conclusion\0Term\0getitem\0Item\0bool\0Null\0std::bad_function_call\0push_back\0length\0match\0Search\0unsigned long long\0unsigned long\0std::wstring\0to_string\0from_string\0basic_string\0std::string\0std::u16string\0std::u32string\0String\0resize\0set_limit_size\0set_buffer_size\0data_size\0execute\0get_type\0TermType\0clone\0rename\0Rule\0double\0variable\0Variable\0ground\0void\0add\0emscripten::memory_view<short>\0emscripten::memory_view<unsigned short>\0emscripten::memory_view<int>\0emscripten::memory_view<unsigned int>\0emscripten::memory_view<float>\0emscripten::memory_view<uint8_t>\0emscripten::memory_view<int8_t>\0emscripten::memory_view<uint16_t>\0emscripten::memory_view<int16_t>\0emscripten::memory_view<uint64_t>\0emscripten::memory_view<int64_t>\0emscripten::memory_view<uint32_t>\0emscripten::memory_view<int32_t>\0emscripten::memory_view<char>\0emscripten::memory_view<unsigned char>\0emscripten::memory_view<signed char>\0emscripten::memory_view<long>\0emscripten::memory_view<unsigned long>\0emscripten::memory_view<double>\0`() \t\r\n\0€\0\0Œ\b\0\0\0\0\0\0\0\0\0¤\b\0\0\0\0\0\0ð\t\0\0\0\0\0\0 \n\0\0\0\0\0\0NSt3__28optionalIhEE\0\0\0\0¬\0\0°\b\0\0à\b\0\0NSt3__227__optional_move_assign_baseIhLb1EEE\0\0\0\0¬\0\0ì\b\0\0\t\0\0NSt3__227__optional_copy_assign_baseIhLb1EEE\0\0\0\0¬\0\0(\t\0\0P\t\0\0NSt3__220__optional_move_baseIhLb1EEE\0\0\0¬\0\0\\\t\0\0„\t\0\0NSt3__220__optional_copy_baseIhLb1EEE\0\0\0¬\0\0\t\0\0¼\t\0\0NSt3__223__optional_storage_baseIhLb0EEE\0\0\0\0t\0\0Ä\t\0\0NSt3__224__optional_destruct_baseIhLb1EEE\0\0\0t\0\0ø\t\0\0NSt3__218__sfinae_ctor_baseILb1ELb1EEE\0\0t\0\0(\n\0\0NSt3__220__sfinae_assign_baseILb1ELb1EEE\0\0\0\0t\0\0\\\n\0\0NSt3__26vectorIhNS_9allocatorIhEEEE\0Ü\0\0\n\0\0\0\0\0\0T\n\0\0PNSt3__26vectorIhNS_9allocatorIhEEEE\0\0\0\0Ü\0\0È\n\0\0\0\0\0T\n\0\0PKNSt3__26vectorIhNS_9allocatorIhEEEE\0pp\0v\0vp\0\0\0€\n\0\0pp\0\0<\0\0T\n\0\0l\0\0vppi\0A \vð\n<\0\0T\n\0\0¨\0\0l\0\0vppii\0\0\0¨\0\0T\n\0\0ipp\x004\0\0l\0\0d\b\0\0T\n\0\0¨\0\0pppi\0\0\0\0T\0\0T\n\0\0¨\0\0l\0\0ippii\0\0\0t\0\0€\v\0\0N2ds8string_tE\0\0Ü\0\0 \v\0\0\0\0\0\0x\v\0\0PN2ds8string_tE\0Ü\0\0À\v\0\0\0\0\0x\v\0\0PKN2ds8string_tE\0pp\0vp\0\0t\0\0à\v\0\0N2ds6item_tE\0\0\0\0Ü\0\0\0\f\0\0\0\0\0\0Ø\v\0\0PN2ds6item_tE\0\0\0Ü\0\0 \f\0\0\0\0\0Ø\v\0\0PKN2ds6item_tE\0pp\0vp\0\0\0\0t\0\0@\f\0\0N2ds10variable_tE\0\0\0Ü\0\0d\f\0\0\0\0\0\x008\f\0\0PN2ds10variable_tE\0\0Ü\0\0ˆ\f\0\0\0\0\x008\f\0\0PKN2ds10variable_tE\0pp\0vp\0\0\0t\0\0¬\f\0\0N2ds6list_tE\0\0\0\0Ü\0\0Ì\f\0\0\0\0\0\0¤\f\0\0PN2ds6list_tE\0\0\0Ü\0\0ì\f\0\0\0\0\0¤\f\0\0PKN2ds6list_tE\0pp\0vp\0\0\0\0t\0\0\f\r\0\0N2ds6term_tE\0\0\0\0Ü\0\0,\r\0\0\0\0\0\0\r\0\0PN2ds6term_tE\0\0\0Ü\0\0L\r\0\0\0\0\0\r\0\0PKN2ds6term_tE\0pp\0vp\0\0\0\0€\0\0|\r\0\0\0\0\0\0\0\0\0¤\f\0\0\0\0\0\0N2ds6rule_tE\0\0\0\0Ü\0\0œ\r\0\0\0\0\0\0d\r\0\0PN2ds6rule_tE\0\0\0Ü\0\0¼\r\0\0\0\0\0d\r\0\0PKN2ds6rule_tE\0pp\0vp\0\0\0\0x\v\0\0P\0\0œ\0\0pppi\0\0\0\0P\0\0\v\0\0œ\0\0pppi\0\0\0\0x\v\0\0T\n\0\0ppp\0T\n\0\0\v\0\0ppp\0x\v\0\0\v\0\0ppp\0œ\0\0\v\0\0ipp\0Ø\v\0\0P\0\0œ\0\0pppi\0\0\0\0P\0\0ð\v\0\0œ\0\0pppi\0\0\0\0Ø\v\0\0T\n\0\0ppp\0T\n\0\0ð\v\0\0ppp\0Ø\v\0\0ð\v\0\0ppp\0œ\0\0ð\v\0\0ipp\x008\f\0\0P\0\0œ\0\0pppi\0\0\0\0P\0\0T\f\0\0œ\0\0pppi\0\0\0\x008\f\0\0T\n\0\0ppp\0T\n\0\0T\f\0\0ppp\x008\f\0\0T\f\0\0ppp\0œ\0\0T\f\0\0ipp\0¤\f\0\0P\0\0œ\0\0pppi\0\0\0\0P\0\0¼\f\0\0œ\0\0pppi\0\0\0\0¤\f\0\0T\n\0\0ppp\0T\n\0\0¼\f\0\0ppp\0¤\f\0\0¼\f\0\0ppp\0œ\0\0¼\f\0\0ipp\0\r\0\0P\0\0œ\0\0pppi\0\0\0\0P\0\0\r\0\0œ\0\0pppi\0\0\0\0\r\0\0T\n\0\0ppp\0T\n\0\0\r\0\0ppp\0\r\0\0\r\0\0ppp\0œ\0\0\r\0\0ipp\0d\r\0\0P\0\0œ\0\0pppi\0\0\0\0P\0\0Œ\r\0\0œ\0\0pppi\0\0\0\0d\r\0\0T\n\0\0ppp\0T\n\0\0Œ\r\0\0ppp\0d\r\0\0Œ\r\0\0ppp\0œ\0\0Œ\r\0\0ipp\0\v\0\0ð\v\0\0ppp\0\v\0\0T\f\0\0ppp\0„\0\0¼\f\0\0ipp\0\r\0\0¼\f\0\0„\0\0pppi\0\0\0\0\0\0\0$\0\0N2ds11term_type_tE\0\0\0\0\r\0\0ipp\0T\f\0\0\r\0\0ppp\0ð\v\0\0\r\0\0ppp\0¼\f\0\0\r\0\0ppp\0„\0\0Œ\r\0\0ipp\0\r\0\0Œ\r\0\0ppp\0\r\0\0Œ\r\0\0„\0\0pppi\0A !\vu\r\0\0\r\0\0\r\0\0P\0\0œ\0\0pppppi\0\0\0\0\0\0d\r\0\0Œ\r\0\0Œ\r\0\0P\0\0œ\0\0pppppi\0\0\0\0\0\0\r\0\0\r\0\0\r\0\0P\0\0P\0\0œ\0\0ppppppi\0d\r\0\0Œ\r\0\0Œ\r\0\0œ\0\0ppppi\0A "\vÅ\r\0\0\r\0\0\r\0\0œ\0\0ppppi\0\0\0t\0\0@\0\0N2ds8search_tE\0\0Ü\0\0`\0\0\0\0\0\x008\0\0PN2ds8search_tE\0Ü\0\0€\0\0\0\0\x008\0\0PKN2ds8search_tE\0pp\0vp\0\0P\0\0„\0\0„\0\0ppii\0\0\0\0<\0\0P\0\0„\0\0vppi\0\0\0\0<\0\0P\0\0vpp\0T\0\0P\0\0P\0\0ippp\0\0\0\0„\0\0P\0\x004\0\0ippp\0\0\0\0\0\0\0\0 \0\0•\0\0\0–\0\0\0—\0\0\0˜\0\0\0™\0\0\0š\0\0\0›\0\0\0œ\0\0\0\0\0\0¬\0\0,\0\0¨\0\0NSt3__210__function6__funcIZ14search_executePN2ds8search_tERKN10emscripten3valEE3$_0NS_9allocatorIS9_EEFbPNS2_6rule_tEEEE\0\0\0t\0\0°\0\0NSt3__210__function6__baseIFbPN2ds6rule_tEEEE\0\0\x004\0\0Œ\r\0\0T\0\x004\0\0t\0\0ø\0\0Z14search_executePN2ds8search_tERKN10emscripten3valEE3$_0\0f\0t\0\0<\0\0N10emscripten3valE\0\0t\0\0X\0\0NSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0t\0\0 \0\0NSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE\0\0t\0\0è\0\0NSt3__212basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE\0\0\0t\0\x004\0\0NSt3__212basic_stringIDiNS_11char_traitsIDiEENS_9allocatorIDiEEEE\0\0\0t\0\0€\0\0N10emscripten11memory_viewIcEE\0\0t\0\0¨\0\0N10emscripten11memory_viewIaEE\0\0t\0\0Ð\0\0N10emscripten11memory_viewIhEE\0\0t\0\0ø\0\0N10emscripten11memory_viewIsEE\0\0t\0\0 \0\0N10emscripten11memory_viewItEE\0\0t\0\0H\0\0N10emscripten11memory_viewIiEE\0\0t\0\0p\0\0N10emscripten11memory_viewIjEE\0\0t\0\0˜\0\0N10emscripten11memory_viewIlEE\0\0t\0\0À\0\0N10emscripten11memory_viewImEE\0\0t\0\0è\0\0N10emscripten11memory_viewIxEE\0\0t\0\0\0\0N10emscripten11memory_viewIyEE\0\0t\0\x008\0\0N10emscripten11memory_viewIfEE\0\0t\0\0`\0\0N10emscripten11memory_viewIdEE\0\0\0\0\0\0”\0\0’\0\0\0ž\0\0\0Ÿ\0\0\0¬\0\0 \0\0Ì\0\0NSt3__217bad_function_callE\0¬\0\0È\0\0d\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0¬\0\0ø\0\0¼\0\0N10__cxxabiv117__class_type_infoE\0\0\0¬\0\0(\0\0¼\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0¬\0\0X\0\0\0\0N10__cxxabiv119__pointer_type_infoE\0¬\0\0ˆ\0\0¼\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0¬\0\0¼\0\0\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0\b\0\0¡\0\0\0¢\0\0\0£\0\0\0¤\0\0\0¥\0\0\0¬\0\0\0\0¼\0\0N10__cxxabiv123__fundamental_type_infoE\0ô\0\0D\0\0v\0\0\0ô\0\0P\0\0Dn\0\0ô\0\0\\\0\0b\0\0\0ô\0\0h\0\0c\0\0\0ô\0\0t\0\0h\0\0\0ô\0\0€\0\0a\0\0\0ô\0\0Œ\0\0s\0\0\0ô\0\0˜\0\0t\0\0\0ô\0\0¤\0\0i\0\0\0ô\0\0°\0\0j\0\0\0ô\0\0¼\0\0l\0\0\0ô\0\0È\0\0m\0\0\0ô\0\0Ô\0\0x\0\0\0ô\0\0à\0\0y\0\0\0ô\0\x002\0\0ô\0\0ô\0\0d\0\0\0\0\0\0\0\0\0¡\0\0\0¦\0\0\0£\0\0\0¤\0\0\0§\0\0\0¬\0\0 \0\0¼\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0¬\0\0P\0\0ì\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0 \0\0¡\0\0\0¨\0\0\0£\0\0\0¤\0\0\0©\0\0\0ª\0\0\0«\0\0\0¬\0\0\0¬\0\0¬\0\0ì\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0L\0\0¡\0\0\0­\0\0\0£\0\0\0¤\0\0\0®\0\0\0St9exception\0\0\0\0\0\0\0\0\0\0“\0\0\0¯\0\0\0°\0\0\0¬\0\0 \0\0Ì\0\0St11logic_error\0\0\0\0\0D\0\0“\0\0\0±\0\0\0°\0\0\0¬\0\0P\0\0\0\0St12length_error\0\0\0\0t\0\0”\0\0\0\0\0\0ì\0\0¡\0\0\0²\0\0\0£\0\0\0¤\0\0\0©\0\0\0³\0\0\0´\0\0\0µ\0\0\0St9type_info\0\0\0\0\0\0\0\0D\0\0¡\0\0\0¶\0\0\0£\0\0\0¤\0\0\0©\0\0\0·\0\0\0¸\0\0\0¹\0\0\0t\0\0ð\0\0\0\0\0\0Ì\0\0º\0\0\0»\0\0\0¼\0Aô5\v9½\0\0\0½\0\0\0¾\0\0\0¾\0\0\0¾\0\0\0¾\0\0\0¾\0\0\0¾\0\0\0½\0\0\0½\0\0\0¾\0\0\0½\0\0\0½\0\0\0½\0\0\0½\0AÐ6\v¾\0\0\0¾\0\0\0½\0\0\0½\0\0\0\0\0\0\0½\0\0\0\0\0\0\0¾\0Aô7\vp\0 '),function(t){return e(t.instance)}(await async function(e,t,r){return async function(e,t){try{var r=await async function(e){return e}(e);return await WebAssembly.instantiate(r,t)}catch(e){E(`failed to asynchronously prepare wasm: ${e}`),R(e)}}(t,r)}(0,S,r)))}(),function(){function e(){t.calledRun=!0,_||(b=!0,ot.C(),c?.(t),t.onRuntimeInitialized?.(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)N(t.postRun.shift());w(k)}())}!function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)O(t.preRun.shift());w(I)}(),t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),e()},1)):e()}(),b?t:new Promise((e,t)=>{c=e,u=t})}();let r$1=1024;function t$1(e=0){const t=r$1;return 0!==e&&(r$1=e),t}let e$1=class e{type;value;capacity;constructor(t,r,n=0){if(this.type=t,r instanceof e){if(this.value=r.value,this.capacity=r.capacity,0!==n)throw new Error("Cannot set capacity when copying from another instance.")}else if(r instanceof this.type)this.value=r,this.capacity=n;else if("string"==typeof r){if(this.capacity=0!==n?n:t$1(),this.value=this.type.from_string(r,this.capacity),null===this.value)throw new Error("Initialization from a string failed.")}else{if(!(r instanceof A$1.Buffer))throw new Error("Unsupported type for initialization.");if(this.value=this.type.from_binary(r),this.capacity=this.size(),0!==n)throw new Error("Cannot set capacity when initializing from bytes.")}}toString(){const e=this.type.to_string(this.value,t$1());if(""===e)throw new Error("Conversion to string failed.");return e}data(){return this.type.to_binary(this.value)}size(){return this.value.data_size()}copy(){return new this.constructor(this.value.clone(),this.size())}key(){return this.toString()}},v$1=class extends e$1{constructor(e,t=0){super(A$1.String,e,t)}},n$1=class extends e$1{constructor(e,t=0){super(A$1.Variable,e,t)}name(){return new v$1(this.value.name())}},i$1=class extends e$1{constructor(e,t=0){super(A$1.Item,e,t)}name(){return new v$1(this.value.name())}},s$1=class extends e$1{constructor(e,t=0){super(A$1.List,e,t)}length(){return this.value.length()}getitem(e){return new a$1(this.value.getitem(e))}},a$1=class e extends e$1{constructor(e,t=0){super(A$1.Term,e,t)}term(){const e=this.value.get_type();if(e===A$1.TermType.Variable)return new n$1(this.value.variable());if(e===A$1.TermType.Item)return new i$1(this.value.item());if(e===A$1.TermType.List)return new s$1(this.value.list());throw new Error("Unexpected term type.")}ground(t,r=""){const n=t$1(),i=A$1.Term.ground(this.value,t.value,r,n);return null===i?null:new e(i,n)}match(t){const r=t$1(),n=A$1.Term.match(this.value,t.value,"1","2",r);return null===n?null:new e(n,r)}rename(t){const r=t$1(),n=A$1.Term.rename(this.value,t.value,r);return null===n?null:new e(n,r)}},j$1=class e extends e$1{constructor(e,t=0){super(A$1.Rule,e,t)}length(){return this.value.length()}getitem(e){return new a$1(this.value.getitem(e))}conclusion(){return new a$1(this.value.conclusion())}ground(t,r=""){const n=t$1(),i=A$1.Rule.ground(this.value,t.value,r,n);return null===i?null:new e(i,n)}match(t){const r=t$1(),n=A$1.Rule.match(this.value,t.value,r);return null===n?null:new e(n,r)}rename(t){const r=t$1(),n=A$1.Rule.rename(this.value,t.value,r);return null===n?null:new e(n,r)}},o$1=class{_search;constructor(e=1e3,t=1e4){this._search=new A$1.Search(e,t)}set_limit_size(e){this._search.set_limit_size(e)}set_buffer_size(e){this._search.set_buffer_size(e)}reset(){this._search.reset()}add(e){return this._search.add(e)}execute(e){return this._search.execute(t=>e(new j$1(t).copy()))}};var t={763:()=>{}},e={};function s(r){var n=e[r];if(void 0!==n)return n.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,s),i.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};s.d(n,{MG:()=>j,fr:()=>kt,sR:()=>Ae,Zo:()=>ye,iH:()=>we,rt:()=>Pt,jB:()=>be,M8:()=>le,$t:()=>Ce,aq:()=>me,pG:()=>vt,eP:()=>_e,KU:()=>xe,zW:()=>Le,IX:()=>E,mY:()=>S,a7:()=>$,JG:()=>Ut,ay:()=>Xt,X2:()=>ee,WU:()=>de,Uw:()=>pe,gw:()=>ge,iX:()=>De,re:()=>ne,Pg:()=>He,tD:()=>ie,R$:()=>te,Dj:()=>Dt,m7:()=>U,NZ:()=>P,xo:()=>b,ou:()=>i,qC:()=>Be,mD:()=>d,Ay:()=>Ke});class i{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(e){this._text=e}}function r(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!(e[r]===t[r]||e[r].equals&&e[r].equals(t[r])))return!1;return!0}i.INVALID_TYPE=0,i.EPSILON=-2,i.MIN_USER_TOKEN_TYPE=1,i.EOF=-1,i.DEFAULT_CHANNEL=0,i.HIDDEN_CHANNEL=1;const o=Math.round(Math.random()*Math.pow(2,32));function a(e){if(!e)return 0;const t=typeof e,r="string"===t?e:!("object"!==t||!e.toString)&&e.toString();if(!r)return 0;let n,i;const s=3&r.length,a=r.length-s;let l=o;const c=3432918353,u=461845907;let h=0;for(;h<a;)i=255&r.charCodeAt(h)|(255&r.charCodeAt(++h))<<8|(255&r.charCodeAt(++h))<<16|(255&r.charCodeAt(++h))<<24,++h,i=(65535&i)*c+(((i>>>16)*c&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*u+(((i>>>16)*u&65535)<<16)&4294967295,l^=i,l=l<<13|l>>>19,n=5*(65535&l)+((5*(l>>>16)&65535)<<16)&4294967295,l=27492+(65535&n)+((58964+(n>>>16)&65535)<<16);switch(i=0,s){case 3:i^=(255&r.charCodeAt(h+2))<<16;case 2:i^=(255&r.charCodeAt(h+1))<<8;case 1:i^=255&r.charCodeAt(h),i=(65535&i)*c+(((i>>>16)*c&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*u+(((i>>>16)*u&65535)<<16)&4294967295,l^=i}return l^=r.length,l^=l>>>16,l=2246822507*(65535&l)+((2246822507*(l>>>16)&65535)<<16)&4294967295,l^=l>>>13,l=3266489909*(65535&l)+((3266489909*(l>>>16)&65535)<<16)&4294967295,l^=l>>>16,l>>>0}class l{constructor(){this.count=0,this.hash=0}update(){for(let e=0;e<arguments.length;e++){const t=arguments[e];if(null!=t)if(Array.isArray(t))this.update.apply(this,t);else{let e=0;switch(typeof t){case"undefined":case"function":continue;case"number":case"boolean":e=t;break;case"string":e=a(t);break;default:t.updateHashCode?t.updateHashCode(this):console.log("No updateHashCode for "+t.toString());continue}e*=3432918353,e=e<<15|e>>>17,e*=461845907,this.count=this.count+1;let r=this.hash^e;r=r<<13|r>>>19,r=5*r+3864292196,this.hash=r}}}finish(){let e=this.hash^4*this.count;return e^=e>>>16,e*=2246822507,e^=e>>>13,e*=3266489909,e^=e>>>16,e}static hashStuff(){const e=new l;return e.update.apply(e,arguments),e.finish()}}function h(e){return e?"string"==typeof e?a(e):e.hashCode():-1}function c(e,t){return e&&e.equals?e.equals(t):e===t}function u(e){return null===e?"null":e}function d(e){return Array.isArray(e)?"["+e.map(u).join(", ")+"]":"null"}class p{constructor(e,t){this.buckets=new Array(16),this.threshold=Math.floor(12),this.itemCount=0,this.hashFunction=e||h,this.equalsFunction=t||c}get(e){if(null==e)return e;const t=this._getBucket(e);if(!t)return null;for(const r of t)if(this.equalsFunction(r,e))return r;return null}add(e){return this.getOrAdd(e)===e}getOrAdd(e){this._expand();const t=this._getSlot(e);let r=this.buckets[t];if(!r)return r=[e],this.buckets[t]=r,this.itemCount++,e;for(const t of r)if(this.equalsFunction(t,e))return t;return r.push(e),this.itemCount++,e}has(e){return null!=this.get(e)}values(){return this.buckets.filter(e=>null!=e).flat(1)}toString(){return d(this.values())}get length(){return this.itemCount}_getSlot(e){return this.hashFunction(e)&this.buckets.length-1}_getBucket(e){return this.buckets[this._getSlot(e)]}_expand(){if(this.itemCount<=this.threshold)return;const e=this.buckets,t=2*this.buckets.length;this.buckets=new Array(t),this.threshold=Math.floor(.75*t);for(const t of e)if(t)for(const e of t){const t=this._getSlot(e);let r=this.buckets[t];r||(r=[],this.buckets[t]=r),r.push(e)}}}class g{hashCode(){const e=new l;return this.updateHashCode(e),e.finish()}evaluate(e,t){}evalPrecedence(e,t){return this}static andContext(e,t){if(null===e||e===g.NONE)return t;if(null===t||t===g.NONE)return e;const r=new f(e,t);return 1===r.opnds.length?r.opnds[0]:r}static orContext(e,t){if(null===e)return t;if(null===t)return e;if(e===g.NONE||t===g.NONE)return g.NONE;const r=new x(e,t);return 1===r.opnds.length?r.opnds[0]:r}}class f extends g{constructor(e,t){super();const r=new p;e instanceof f?e.opnds.map(function(e){r.add(e)}):r.add(e),t instanceof f?t.opnds.map(function(e){r.add(e)}):r.add(t);const n=_(r);if(n.length>0){let e=null;n.map(function(t){(null===e||t.precedence<e.precedence)&&(e=t)}),r.add(e)}this.opnds=Array.from(r.values())}equals(e){return this===e||e instanceof f&&r(this.opnds,e.opnds)}updateHashCode(e){e.update(this.opnds,"AND")}evaluate(e,t){for(let r=0;r<this.opnds.length;r++)if(!this.opnds[r].evaluate(e,t))return!1;return!0}evalPrecedence(e,t){let r=!1;const n=[];for(let i=0;i<this.opnds.length;i++){const s=this.opnds[i],a=s.evalPrecedence(e,t);if(r|=a!==s,null===a)return null;a!==g.NONE&&n.push(a)}if(!r)return this;if(0===n.length)return g.NONE;let i=null;return n.map(function(e){i=null===i?e:g.andContext(i,e)}),i}toString(){const e=this.opnds.map(e=>e.toString());return(e.length>3?e.slice(3):e).join("&&")}}class x extends g{constructor(e,t){super();const r=new p;e instanceof x?e.opnds.map(function(e){r.add(e)}):r.add(e),t instanceof x?t.opnds.map(function(e){r.add(e)}):r.add(t);const n=_(r);if(n.length>0){const e=n.sort(function(e,t){return e.compareTo(t)}),t=e[e.length-1];r.add(t)}this.opnds=Array.from(r.values())}equals(e){return this===e||e instanceof x&&r(this.opnds,e.opnds)}updateHashCode(e){e.update(this.opnds,"OR")}evaluate(e,t){for(let r=0;r<this.opnds.length;r++)if(this.opnds[r].evaluate(e,t))return!0;return!1}evalPrecedence(e,t){let r=!1;for(let n=0;n<this.opnds.length;n++){const i=this.opnds[n],s=i.evalPrecedence(e,t);if(r|=s!==i,s===g.NONE)return g.NONE}return r?null:this}toString(){const e=this.opnds.map(e=>e.toString());return(e.length>3?e.slice(3):e).join("||")}}function _(e){const t=[];return e.values().map(function(e){e instanceof g.PrecedencePredicate&&t.push(e)}),t}function T(e,t){if(null===e){const e={state:null,alt:null,context:null,semanticContext:null};return t&&(e.reachesIntoOuterContext=0),e}{const r={};return r.state=e.state||null,r.alt=void 0===e.alt?null:e.alt,r.context=e.context||null,r.semanticContext=e.semanticContext||null,t&&(r.reachesIntoOuterContext=e.reachesIntoOuterContext||0,r.precedenceFilterSuppressed=e.precedenceFilterSuppressed||!1),r}}class m{constructor(e,t){this.checkContext(e,t),e=T(e),t=T(t,!0),this.state=null!==e.state?e.state:t.state,this.alt=null!==e.alt?e.alt:t.alt,this.context=null!==e.context?e.context:t.context,this.semanticContext=null!==e.semanticContext?e.semanticContext:null!==t.semanticContext?t.semanticContext:g.NONE,this.reachesIntoOuterContext=t.reachesIntoOuterContext,this.precedenceFilterSuppressed=t.precedenceFilterSuppressed}checkContext(e,t){null!==e.context&&void 0!==e.context||null!==t&&null!==t.context&&void 0!==t.context||(this.context=null)}hashCode(){const e=new l;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(e){return this===e||e instanceof m&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&(null===this.context?null===e.context:this.context.equals(e.context))&&this.semanticContext.equals(e.semanticContext)&&this.precedenceFilterSuppressed===e.precedenceFilterSuppressed}hashCodeForConfigSet(){const e=new l;return e.update(this.state.stateNumber,this.alt,this.semanticContext),e.finish()}equalsForConfigSet(e){return this===e||e instanceof m&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&this.semanticContext.equals(e.semanticContext)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==g.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class E{constructor(e,t){this.start=e,this.stop=t}clone(){return new E(this.start,this.stop)}contains(e){return e>=this.start&&e<this.stop}toString(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()}get length(){return this.stop-this.start}}E.INVALID_INTERVAL=new E(-1,-2);class S{constructor(){this.intervals=null,this.readOnly=!1}first(e){return null===this.intervals||0===this.intervals.length?i.INVALID_TYPE:this.intervals[0].start}addOne(e){this.addInterval(new E(e,e+1))}addRange(e,t){this.addInterval(new E(e,t+1))}addInterval(e){if(null===this.intervals)this.intervals=[],this.intervals.push(e.clone());else{for(let t=0;t<this.intervals.length;t++){const r=this.intervals[t];if(e.stop<r.start)return void this.intervals.splice(t,0,e);if(e.stop===r.start)return void(this.intervals[t]=new E(e.start,r.stop));if(e.start<=r.stop)return this.intervals[t]=new E(Math.min(r.start,e.start),Math.max(r.stop,e.stop)),void this.reduce(t)}this.intervals.push(e.clone())}}addSet(e){return null!==e.intervals&&e.intervals.forEach(e=>this.addInterval(e),this),this}reduce(e){if(e<this.intervals.length-1){const t=this.intervals[e],r=this.intervals[e+1];t.stop>=r.stop?(this.intervals.splice(e+1,1),this.reduce(e)):t.stop>=r.start&&(this.intervals[e]=new E(t.start,r.stop),this.intervals.splice(e+1,1))}}complement(e,t){const r=new S;return r.addInterval(new E(e,t+1)),null!==this.intervals&&this.intervals.forEach(e=>r.removeRange(e)),r}contains(e){if(null===this.intervals)return!1;for(let t=0;t<this.intervals.length;t++)if(this.intervals[t].contains(e))return!0;return!1}removeRange(e){if(e.start===e.stop-1)this.removeOne(e.start);else if(null!==this.intervals){let t=0;for(let r=0;r<this.intervals.length;r++){const r=this.intervals[t];if(e.stop<=r.start)return;if(e.start>r.start&&e.stop<r.stop){this.intervals[t]=new E(r.start,e.start);const n=new E(e.stop,r.stop);return void this.intervals.splice(t,0,n)}e.start<=r.start&&e.stop>=r.stop?(this.intervals.splice(t,1),t-=1):e.start<r.stop?this.intervals[t]=new E(r.start,e.start):e.stop<r.stop&&(this.intervals[t]=new E(e.stop,r.stop)),t+=1}}}removeOne(e){if(null!==this.intervals)for(let t=0;t<this.intervals.length;t++){const r=this.intervals[t];if(e<r.start)return;if(e===r.start&&e===r.stop-1)return void this.intervals.splice(t,1);if(e===r.start)return void(this.intervals[t]=new E(r.start+1,r.stop));if(e===r.stop-1)return void(this.intervals[t]=new E(r.start,r.stop-1));if(e<r.stop-1){const n=new E(r.start,e);return r.start=e+1,void this.intervals.splice(t,0,n)}}}toString(e,t,r){return e=e||null,t=t||null,r=r||!1,null===this.intervals?"{}":null!==e||null!==t?this.toTokenString(e,t):r?this.toCharString():this.toIndexString()}toCharString(){const e=[];for(let t=0;t<this.intervals.length;t++){const r=this.intervals[t];r.stop===r.start+1?r.start===i.EOF?e.push("<EOF>"):e.push("'"+String.fromCharCode(r.start)+"'"):e.push("'"+String.fromCharCode(r.start)+"'..'"+String.fromCharCode(r.stop-1)+"'")}return e.length>1?"{"+e.join(", ")+"}":e[0]}toIndexString(){const e=[];for(let t=0;t<this.intervals.length;t++){const r=this.intervals[t];r.stop===r.start+1?r.start===i.EOF?e.push("<EOF>"):e.push(r.start.toString()):e.push(r.start.toString()+".."+(r.stop-1).toString())}return e.length>1?"{"+e.join(", ")+"}":e[0]}toTokenString(e,t){const r=[];for(let n=0;n<this.intervals.length;n++){const i=this.intervals[n];for(let n=i.start;n<i.stop;n++)r.push(this.elementName(e,t,n))}return r.length>1?"{"+r.join(", ")+"}":r[0]}elementName(e,t,r){return r===i.EOF?"<EOF>":r===i.EPSILON?"<EPSILON>":e[r]||t[r]}get length(){return this.intervals.map(e=>e.length).reduce((e,t)=>e+t)}}class C{constructor(){this.atn=null,this.stateNumber=C.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null}toString(){return this.stateNumber}equals(e){return e instanceof C&&this.stateNumber===e.stateNumber}isNonGreedyExitState(){return!1}addTransition(e,t){void 0===t&&(t=-1),0===this.transitions.length?this.epsilonOnlyTransitions=e.isEpsilon:this.epsilonOnlyTransitions!==e.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===t?this.transitions.push(e):this.transitions.splice(t,1,e)}}C.INVALID_TYPE=0,C.BASIC=1,C.RULE_START=2,C.BLOCK_START=3,C.PLUS_BLOCK_START=4,C.STAR_BLOCK_START=5,C.TOKEN_START=6,C.RULE_STOP=7,C.BLOCK_END=8,C.STAR_LOOP_BACK=9,C.STAR_LOOP_ENTRY=10,C.PLUS_LOOP_BACK=11,C.LOOP_END=12,C.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],C.INVALID_STATE_NUMBER=-1;class A extends C{constructor(){return super(),this.stateType=C.RULE_STOP,this}}class N{constructor(e){if(null==e)throw"target cannot be null.";this.target=e,this.isEpsilon=!1,this.label=null}}N.EPSILON=1,N.RANGE=2,N.RULE=3,N.PREDICATE=4,N.ATOM=5,N.ACTION=6,N.SET=7,N.NOT_SET=8,N.WILDCARD=9,N.PRECEDENCE=10,N.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],N.serializationTypes={EpsilonTransition:N.EPSILON,RangeTransition:N.RANGE,RuleTransition:N.RULE,PredicateTransition:N.PREDICATE,AtomTransition:N.ATOM,ActionTransition:N.ACTION,SetTransition:N.SET,NotSetTransition:N.NOT_SET,WildcardTransition:N.WILDCARD,PrecedencePredicateTransition:N.PRECEDENCE};class y extends N{constructor(e,t,r,n){super(e),this.ruleIndex=t,this.precedence=r,this.followState=n,this.serializationType=N.RULE,this.isEpsilon=!0}matches(e,t,r){return!1}}class L extends N{constructor(e,t){super(e),this.serializationType=N.SET,null!=t?this.label=t:(this.label=new S,this.label.addOne(i.INVALID_TYPE))}matches(e,t,r){return this.label.contains(e)}toString(){return this.label.toString()}}class I extends L{constructor(e,t){super(e,t),this.serializationType=N.NOT_SET}matches(e,t,r){return e>=t&&e<=r&&!super.matches(e,t,r)}toString(){return"~"+super.toString()}}class k extends N{constructor(e){super(e),this.serializationType=N.WILDCARD}matches(e,t,r){return e>=t&&e<=r}toString(){return"."}}class v extends N{constructor(e){super(e)}}class w{}class R extends w{}class O extends R{}class P extends O{get ruleContext(){throw new Error("missing interface implementation")}}class b extends O{}class F extends b{}const D={toStringTree:function(e,t,r){t=t||null,null!==(r=r||null)&&(t=r.ruleNames);let n=D.getNodeText(e,t);n=function(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(n);const i=e.getChildCount();if(0===i)return n;let s="("+n+" ";i>0&&(n=D.toStringTree(e.getChild(0),t),s=s.concat(n));for(let r=1;r<i;r++)n=D.toStringTree(e.getChild(r),t),s=s.concat(" "+n);return s=s.concat(")"),s},getNodeText:function(e,t,r){if(t=t||null,null!==(r=r||null)&&(t=r.ruleNames),null!==t){if(e instanceof P){const r=e.ruleContext.getAltNumber();return 0!=r?t[e.ruleIndex]+":"+r:t[e.ruleIndex]}if(e instanceof F)return e.toString();if(e instanceof b&&null!==e.symbol)return e.symbol.text}const n=e.getPayload();return n instanceof i?n.text:e.getPayload().toString()},getChildren:function(e){const t=[];for(let r=0;r<e.getChildCount();r++)t.push(e.getChild(r));return t},getAncestors:function(e){let t=[];for(e=e.getParent();null!==e;)t=[e].concat(t),e=e.getParent();return t},findAllTokenNodes:function(e,t){return D.findAllNodes(e,t,!0)},findAllRuleNodes:function(e,t){return D.findAllNodes(e,t,!1)},findAllNodes:function(e,t,r){const n=[];return D._findAllNodes(e,t,r,n),n},_findAllNodes:function(e,t,r,n){r&&e instanceof b?e.symbol.type===t&&n.push(e):!r&&e instanceof P&&e.ruleIndex===t&&n.push(e);for(let i=0;i<e.getChildCount();i++)D._findAllNodes(e.getChild(i),t,r,n)},descendants:function(e){let t=[e];for(let r=0;r<e.getChildCount();r++)t=t.concat(D.descendants(e.getChild(r)));return t}},M=D;class U extends P{constructor(e,t){super(),this.parentCtx=e||null,this.invokingState=t||-1}depth(){let e=0,t=this;for(;null!==t;)t=t.parentCtx,e+=1;return e}isEmpty(){return-1===this.invokingState}getSourceInterval(){return E.INVALID_INTERVAL}get ruleContext(){return this}getPayload(){return this}getText(){return 0===this.getChildCount()?"":this.children.map(function(e){return e.getText()}).join("")}getAltNumber(){return 0}setAltNumber(e){}getChild(e){return null}getChildCount(){return 0}accept(e){return e.visitChildren(this)}toStringTree(e,t){return M.toStringTree(this,e,t)}toString(e,t){e=e||null,t=t||null;let r=this,n="[";for(;null!==r&&r!==t;){if(null===e)r.isEmpty()||(n+=r.invokingState);else{const t=r.ruleIndex;n+=t>=0&&t<e.length?e[t]:""+t}null===r.parentCtx||null===e&&r.parentCtx.isEmpty()||(n+=" "),r=r.parentCtx}return n+="]",n}}class H{constructor(e){this.cachedHashCode=e}isEmpty(){return this===H.EMPTY}hasEmptyPath(){return this.getReturnState(this.length-1)===H.EMPTY_RETURN_STATE}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}}H.EMPTY=null,H.EMPTY_RETURN_STATE=2147483647,H.globalNodeCount=1,H.id=H.globalNodeCount,H.trace_atn_sim=!1;class B extends H{constructor(e,t){const r=new l;return r.update(e,t),super(r.finish()),this.parents=e,this.returnStates=t,this}isEmpty(){return this.returnStates[0]===H.EMPTY_RETURN_STATE}getParent(e){return this.parents[e]}getReturnState(e){return this.returnStates[e]}equals(e){return this===e||e instanceof B&&this.hashCode()===e.hashCode()&&r(this.returnStates,e.returnStates)&&r(this.parents,e.parents)}toString(){if(this.isEmpty())return"[]";{let e="[";for(let t=0;t<this.returnStates.length;t++)t>0&&(e+=", "),this.returnStates[t]!==H.EMPTY_RETURN_STATE?(e+=this.returnStates[t],null!==this.parents[t]?e=e+" "+this.parents[t]:e+="null"):e+="$";return e+"]"}}get length(){return this.returnStates.length}}class V extends H{constructor(e,t){let r=0;const n=new l;null!==e?n.update(e,t):n.update(1),r=n.finish(),super(r),this.parentCtx=e,this.returnState=t}getParent(e){return this.parentCtx}getReturnState(e){return this.returnState}equals(e){return this===e||e instanceof V&&this.hashCode()===e.hashCode()&&this.returnState===e.returnState&&(null==this.parentCtx?null==e.parentCtx:this.parentCtx.equals(e.parentCtx))}toString(){const e=null===this.parentCtx?"":this.parentCtx.toString();return 0===e.length?this.returnState===H.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+e}get length(){return 1}static create(e,t){return t===H.EMPTY_RETURN_STATE&&null===e?H.EMPTY:new V(e,t)}}class z extends V{constructor(){super(null,H.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(e){return null}getReturnState(e){return this.returnState}equals(e){return this===e}toString(){return"$"}}H.EMPTY=new z;class Y{constructor(e,t){this.buckets=new Array(16),this.threshold=Math.floor(12),this.itemCount=0,this.hashFunction=e||h,this.equalsFunction=t||c}set(e,t){this._expand();const r=this._getSlot(e);let n=this.buckets[r];if(!n)return n=[[e,t]],this.buckets[r]=n,this.itemCount++,t;const i=n.find(t=>this.equalsFunction(t[0],e),this);if(i){const e=i[1];return i[1]=t,e}return n.push([e,t]),this.itemCount++,t}containsKey(e){const t=this._getBucket(e);return!!t&&!!t.find(t=>this.equalsFunction(t[0],e),this)}get(e){const t=this._getBucket(e);if(!t)return null;const r=t.find(t=>this.equalsFunction(t[0],e),this);return r?r[1]:null}entries(){return this.buckets.filter(e=>null!=e).flat(1)}getKeys(){return this.entries().map(e=>e[0])}getValues(){return this.entries().map(e=>e[1])}toString(){return"["+this.entries().map(e=>"{"+e[0]+":"+e[1]+"}").join(", ")+"]"}get length(){return this.itemCount}_getSlot(e){return this.hashFunction(e)&this.buckets.length-1}_getBucket(e){return this.buckets[this._getSlot(e)]}_expand(){if(this.itemCount<=this.threshold)return;const e=this.buckets,t=2*this.buckets.length;this.buckets=new Array(t),this.threshold=Math.floor(.75*t);for(const t of e)if(t)for(const e of t){const t=this._getSlot(e[0]);let r=this.buckets[t];r||(r=[],this.buckets[t]=r),r.push(e)}}}function q(e,t){if(null==t&&(t=U.EMPTY),null===t.parentCtx||t===U.EMPTY)return H.EMPTY;const r=q(e,t.parentCtx),n=e.states[t.invokingState].transitions[0];return V.create(r,n.followState.stateNumber)}function K(e,t,r){if(e.isEmpty())return e;let n=r.get(e)||null;if(null!==n)return n;if(n=t.get(e),null!==n)return r.set(e,n),n;let i=!1,s=[];for(let n=0;n<s.length;n++){const a=K(e.getParent(n),t,r);if(i||a!==e.getParent(n)){if(!i){s=[];for(let t=0;t<e.length;t++)s[t]=e.getParent(t);i=!0}s[n]=a}}if(!i)return t.add(e),r.set(e,e),e;let a=null;return a=0===s.length?H.EMPTY:1===s.length?V.create(s[0],e.getReturnState(0)):new B(s,e.returnStates),t.add(a),r.set(a,a),r.set(e,a),a}function W(e,t,r,n){if(e===t)return e;if(e instanceof V&&t instanceof V)return function(e,t,r,n){if(null!==n){let r=n.get(e,t);if(null!==r)return r;if(r=n.get(t,e),null!==r)return r}const i=function(e,t,r){if(r){if(e===H.EMPTY)return H.EMPTY;if(t===H.EMPTY)return H.EMPTY}else{if(e===H.EMPTY&&t===H.EMPTY)return H.EMPTY;if(e===H.EMPTY){const e=[t.returnState,H.EMPTY_RETURN_STATE],r=[t.parentCtx,null];return new B(r,e)}if(t===H.EMPTY){const t=[e.returnState,H.EMPTY_RETURN_STATE],r=[e.parentCtx,null];return new B(r,t)}}return null}(e,t,r);if(null!==i)return null!==n&&n.set(e,t,i),i;if(e.returnState===t.returnState){const i=W(e.parentCtx,t.parentCtx,r,n);if(i===e.parentCtx)return e;if(i===t.parentCtx)return t;const s=V.create(i,e.returnState);return null!==n&&n.set(e,t,s),s}{let r=null;if((e===t||null!==e.parentCtx&&e.parentCtx===t.parentCtx)&&(r=e.parentCtx),null!==r){const i=[e.returnState,t.returnState];e.returnState>t.returnState&&(i[0]=t.returnState,i[1]=e.returnState);const s=new B([r,r],i);return null!==n&&n.set(e,t,s),s}const i=[e.returnState,t.returnState];let s=[e.parentCtx,t.parentCtx];e.returnState>t.returnState&&(i[0]=t.returnState,i[1]=e.returnState,s=[t.parentCtx,e.parentCtx]);const a=new B(s,i);return null!==n&&n.set(e,t,a),a}}(e,t,r,n);if(r){if(e instanceof z)return e;if(t instanceof z)return t}return e instanceof V&&(e=new B([e.getParent()],[e.returnState])),t instanceof V&&(t=new B([t.getParent()],[t.returnState])),function(e,t,r,n){if(null!==n){let r=n.get(e,t);if(null!==r)return H.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> previous"),r;if(r=n.get(t,e),null!==r)return H.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> previous"),r}let i=0,s=0,a=0,o=new Array(e.returnStates.length+t.returnStates.length).fill(0),l=new Array(e.returnStates.length+t.returnStates.length).fill(null);for(;i<e.returnStates.length&&s<t.returnStates.length;){const c=e.parents[i],u=t.parents[s];if(e.returnStates[i]===t.returnStates[s]){const t=e.returnStates[i];t===H.EMPTY_RETURN_STATE&&null===c&&null===u||null!==c&&null!==u&&c===u?(l[a]=c,o[a]=t):(l[a]=W(c,u,r,n),o[a]=t),i+=1,s+=1}else e.returnStates[i]<t.returnStates[s]?(l[a]=c,o[a]=e.returnStates[i],i+=1):(l[a]=u,o[a]=t.returnStates[s],s+=1);a+=1}if(i<e.returnStates.length)for(let t=i;t<e.returnStates.length;t++)l[a]=e.parents[t],o[a]=e.returnStates[t],a+=1;else for(let e=s;e<t.returnStates.length;e++)l[a]=t.parents[e],o[a]=t.returnStates[e],a+=1;if(a<l.length){if(1===a){const r=V.create(l[0],o[0]);return null!==n&&n.set(e,t,r),r}l=l.slice(0,a),o=o.slice(0,a)}const c=new B(l,o);return c.equals(e)?(null!==n&&n.set(e,t,e),H.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> a"),e):c.equals(t)?(null!==n&&n.set(e,t,t),H.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> b"),t):(function(e){const t=new Y;for(let r=0;r<e.length;r++){const n=e[r];t.containsKey(n)||t.set(n,n)}for(let r=0;r<e.length;r++)e[r]=t.get(e[r])}(l),null!==n&&n.set(e,t,c),H.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> "+c),c)}(e,t,r,n)}class G{constructor(){this.data=new Uint32Array(1)}set(e){G._checkIndex(e),this._resize(e),this.data[e>>>5]|=1<<e%32}get(e){G._checkIndex(e);const t=e>>>5;return!(t>=this.data.length||!(this.data[t]&1<<e%32))}clear(e){G._checkIndex(e);const t=e>>>5;t<this.data.length&&(this.data[t]&=~(1<<e))}or(e){const t=Math.min(this.data.length,e.data.length);for(let r=0;r<t;++r)this.data[r]|=e.data[r];if(this.data.length<e.data.length){this._resize((e.data.length<<5)-1);const r=e.data.length;for(let n=t;n<r;++n)this.data[n]=e.data[n]}}values(){const e=new Array(this.length);let t=0;const r=this.data.length;for(let n=0;n<r;++n){let r=this.data[n];for(;0!==r;){const i=r&-r;e[t++]=(n<<5)+G._bitCount(i-1),r^=i}}return e}minValue(){for(let e=0;e<this.data.length;++e){let t=this.data[e];if(0!==t){let r=0;for(;!(1&t);)r++,t>>=1;return r+32*e}}return 0}hashCode(){return l.hashStuff(this.values())}equals(e){return e instanceof G&&r(this.data,e.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.data.map(e=>G._bitCount(e)).reduce((e,t)=>e+t,0)}_resize(e){const t=e+32>>>5;if(t<=this.data.length)return;const r=new Uint32Array(t);r.set(this.data),r.fill(0,this.data.length),this.data=r}static _checkIndex(e){if(e<0)throw new RangeError("index cannot be negative")}static _bitCount(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,0+(e+=e>>16)&63}}class ${constructor(e){this.atn=e}getDecisionLookahead(e){if(null===e)return null;const t=e.transitions.length,r=[];for(let n=0;n<t;n++){r[n]=new S;const t=new p,i=!1;this._LOOK(e.transition(n).target,null,H.EMPTY,r[n],t,new G,i,!1),(0===r[n].length||r[n].contains($.HIT_PRED))&&(r[n]=null)}return r}LOOK(e,t,r){const n=new S,i=null!==(r=r||null)?q(e.atn,r):null;return this._LOOK(e,t,i,n,new p,new G,!0,!0),n}_LOOK(e,t,r,n,s,a,o,l){const c=new m({state:e,alt:0,context:r},null);if(!s.has(c)){if(s.add(c),e===t){if(null===r)return void n.addOne(i.EPSILON);if(r.isEmpty()&&l)return void n.addOne(i.EOF)}if(e instanceof A){if(null===r)return void n.addOne(i.EPSILON);if(r.isEmpty()&&l)return void n.addOne(i.EOF);if(r!==H.EMPTY){const i=a.get(e.ruleIndex);try{a.clear(e.ruleIndex);for(let e=0;e<r.length;e++){const i=this.atn.states[r.getReturnState(e)];this._LOOK(i,t,r.getParent(e),n,s,a,o,l)}}finally{i&&a.set(e.ruleIndex)}return}}for(let c=0;c<e.transitions.length;c++){const u=e.transitions[c];if(u.constructor===y){if(a.get(u.target.ruleIndex))continue;const e=V.create(r,u.followState.stateNumber);try{a.set(u.target.ruleIndex),this._LOOK(u.target,t,e,n,s,a,o,l)}finally{a.clear(u.target.ruleIndex)}}else if(u instanceof v)o?this._LOOK(u.target,t,r,n,s,a,o,l):n.addOne($.HIT_PRED);else if(u.isEpsilon)this._LOOK(u.target,t,r,n,s,a,o,l);else if(u.constructor===k)n.addRange(i.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{let e=u.label;null!==e&&(u instanceof I&&(e=e.complement(i.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),n.addSet(e))}}}}}$.HIT_PRED=i.INVALID_TYPE;class j{constructor(e,t){this.grammarType=e,this.maxTokenType=t,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[]}nextTokensInContext(e,t){return new $(this).LOOK(e,null,t)}nextTokensNoContext(e){return null!==e.nextTokenWithinRule||(e.nextTokenWithinRule=this.nextTokensInContext(e,null),e.nextTokenWithinRule.readOnly=!0),e.nextTokenWithinRule}nextTokens(e,t){return void 0===t?this.nextTokensNoContext(e):this.nextTokensInContext(e,t)}addState(e){null!==e&&(e.atn=this,e.stateNumber=this.states.length),this.states.push(e)}removeState(e){this.states[e.stateNumber]=null}defineDecisionState(e){return this.decisionToState.push(e),e.decision=this.decisionToState.length-1,e.decision}getDecisionState(e){return 0===this.decisionToState.length?null:this.decisionToState[e]}getExpectedTokens(e,t){if(e<0||e>=this.states.length)throw"Invalid state number.";const r=this.states[e];let n=this.nextTokens(r);if(!n.contains(i.EPSILON))return n;const s=new S;for(s.addSet(n),s.removeOne(i.EPSILON);null!==t&&t.invokingState>=0&&n.contains(i.EPSILON);){const e=this.states[t.invokingState].transitions[0];n=this.nextTokens(e.followState),s.addSet(n),s.removeOne(i.EPSILON),t=t.parentCtx}return n.contains(i.EPSILON)&&s.addOne(i.EOF),s}}j.INVALID_ALT_NUMBER=0;class X extends C{constructor(){super(),this.stateType=C.BASIC}}class J extends C{constructor(){return super(),this.decision=-1,this.nonGreedy=!1,this}}class Q extends J{constructor(){return super(),this.endState=null,this}}class Z extends C{constructor(){return super(),this.stateType=C.BLOCK_END,this.startState=null,this}}class tt extends C{constructor(){return super(),this.stateType=C.LOOP_END,this.loopBackState=null,this}}class et extends C{constructor(){return super(),this.stateType=C.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}}class st extends J{constructor(){return super(),this.stateType=C.TOKEN_START,this}}class nt extends J{constructor(){return super(),this.stateType=C.PLUS_LOOP_BACK,this}}class it extends C{constructor(){return super(),this.stateType=C.STAR_LOOP_BACK,this}}class rt extends J{constructor(){return super(),this.stateType=C.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}}class ot extends Q{constructor(){return super(),this.stateType=C.PLUS_BLOCK_START,this.loopBackState=null,this}}class at extends Q{constructor(){return super(),this.stateType=C.STAR_BLOCK_START,this}}class lt extends Q{constructor(){return super(),this.stateType=C.BLOCK_START,this}}class ht extends N{constructor(e,t){super(e),this.label_=t,this.label=this.makeLabel(),this.serializationType=N.ATOM}makeLabel(){const e=new S;return e.addOne(this.label_),e}matches(e,t,r){return this.label_===e}toString(){return this.label_}}class ct extends N{constructor(e,t,r){super(e),this.serializationType=N.RANGE,this.start=t,this.stop=r,this.label=this.makeLabel()}makeLabel(){const e=new S;return e.addRange(this.start,this.stop),e}matches(e,t,r){return e>=this.start&&e<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class ut extends N{constructor(e,t,r,n){super(e),this.serializationType=N.ACTION,this.ruleIndex=t,this.actionIndex=void 0===r?-1:r,this.isCtxDependent=void 0!==n&&n,this.isEpsilon=!0}matches(e,t,r){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}}class dt extends N{constructor(e,t){super(e),this.serializationType=N.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=t}matches(e,t,r){return!1}toString(){return"epsilon"}}class pt extends g{constructor(e,t,r){super(),this.ruleIndex=void 0===e?-1:e,this.predIndex=void 0===t?-1:t,this.isCtxDependent=void 0!==r&&r}evaluate(e,t){const r=this.isCtxDependent?t:null;return e.sempred(r,this.ruleIndex,this.predIndex)}updateHashCode(e){e.update(this.ruleIndex,this.predIndex,this.isCtxDependent)}equals(e){return this===e||e instanceof pt&&this.ruleIndex===e.ruleIndex&&this.predIndex===e.predIndex&&this.isCtxDependent===e.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}g.NONE=new pt;class gt extends v{constructor(e,t,r,n){super(e),this.serializationType=N.PREDICATE,this.ruleIndex=t,this.predIndex=r,this.isCtxDependent=n,this.isEpsilon=!0}matches(e,t,r){return!1}getPredicate(){return new pt(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}}class ft extends g{constructor(e){super(),this.precedence=void 0===e?0:e}evaluate(e,t){return e.precpred(t,this.precedence)}evalPrecedence(e,t){return e.precpred(t,this.precedence)?g.NONE:null}compareTo(e){return this.precedence-e.precedence}updateHashCode(e){e.update(this.precedence)}equals(e){return this===e||e instanceof ft&&this.precedence===e.precedence}toString(){return"{"+this.precedence+">=prec}?"}}g.PrecedencePredicate=ft;class xt extends v{constructor(e,t){super(e),this.serializationType=N.PRECEDENCE,this.precedence=t,this.isEpsilon=!0}matches(e,t,r){return!1}getPredicate(){return new ft(this.precedence)}toString(){return this.precedence+" >= _p"}}class _t{constructor(e){void 0===e&&(e=null),this.readOnly=!1,this.verifyATN=null===e||e.verifyATN,this.generateRuleBypassTransitions=null!==e&&e.generateRuleBypassTransitions}}_t.defaultOptions=new _t,_t.defaultOptions.readOnly=!0;class Tt{constructor(e){this.actionType=e,this.isPositionDependent=!1}hashCode(){const e=new l;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.actionType)}equals(e){return this===e}}class mt extends Tt{constructor(){super(6)}execute(e){e.skip()}toString(){return"skip"}}mt.INSTANCE=new mt;class Et extends Tt{constructor(e){super(0),this.channel=e}execute(e){e._channel=this.channel}updateHashCode(e){e.update(this.actionType,this.channel)}equals(e){return this===e||e instanceof Et&&this.channel===e.channel}toString(){return"channel("+this.channel+")"}}class St extends Tt{constructor(e,t){super(1),this.ruleIndex=e,this.actionIndex=t,this.isPositionDependent=!0}execute(e){e.action(null,this.ruleIndex,this.actionIndex)}updateHashCode(e){e.update(this.actionType,this.ruleIndex,this.actionIndex)}equals(e){return this===e||e instanceof St&&this.ruleIndex===e.ruleIndex&&this.actionIndex===e.actionIndex}}class Ct extends Tt{constructor(){super(3)}execute(e){e.more()}toString(){return"more"}}Ct.INSTANCE=new Ct;class At extends Tt{constructor(e){super(7),this.type=e}execute(e){e.type=this.type}updateHashCode(e){e.update(this.actionType,this.type)}equals(e){return this===e||e instanceof At&&this.type===e.type}toString(){return"type("+this.type+")"}}class Nt extends Tt{constructor(e){super(5),this.mode=e}execute(e){e.pushMode(this.mode)}updateHashCode(e){e.update(this.actionType,this.mode)}equals(e){return this===e||e instanceof Nt&&this.mode===e.mode}toString(){return"pushMode("+this.mode+")"}}class yt extends Tt{constructor(){super(4)}execute(e){e.popMode()}toString(){return"popMode"}}yt.INSTANCE=new yt;class Lt extends Tt{constructor(e){super(2),this.mode=e}execute(e){e.setMode(this.mode)}updateHashCode(e){e.update(this.actionType,this.mode)}equals(e){return this===e||e instanceof Lt&&this.mode===e.mode}toString(){return"mode("+this.mode+")"}}function It(e,t){const r=[];return r[e-1]=t,r.map(function(e){return t})}class kt{constructor(e){null==e&&(e=_t.defaultOptions),this.deserializationOptions=e,this.stateFactories=null,this.actionFactories=null}deserialize(e){const t=this.reset(e);this.checkVersion(t),t&&this.skipUUID();const r=this.readATN();this.readStates(r,t),this.readRules(r,t),this.readModes(r);const n=[];return this.readSets(r,n,this.readInt.bind(this)),t&&this.readSets(r,n,this.readInt32.bind(this)),this.readEdges(r,n),this.readDecisions(r),this.readLexerActions(r,t),this.markPrecedenceDecisions(r),this.verifyATN(r),this.deserializationOptions.generateRuleBypassTransitions&&1===r.grammarType&&(this.generateRuleBypassTransitions(r),this.verifyATN(r)),r}reset(e){if(3===(e.charCodeAt?e.charCodeAt(0):e[0])){const t=function(e){const t=e.charCodeAt(0);return t>1?t-2:t+65534},r=e.split("").map(t);return r[0]=e.charCodeAt(0),this.data=r,this.pos=0,!0}return this.data=e,this.pos=0,!1}skipUUID(){let e=0;for(;e++<8;)this.readInt()}checkVersion(e){const t=this.readInt();if(!e&&4!==t)throw"Could not deserialize ATN with version "+t+" (expected 4)."}readATN(){const e=this.readInt(),t=this.readInt();return new j(e,t)}readStates(e,t){let r,n,i;const s=[],a=[],o=this.readInt();for(let r=0;r<o;r++){const r=this.readInt();if(r===C.INVALID_TYPE){e.addState(null);continue}let n=this.readInt();t&&65535===n&&(n=-1);const i=this.stateFactory(r,n);if(r===C.LOOP_END){const e=this.readInt();s.push([i,e])}else if(i instanceof Q){const e=this.readInt();a.push([i,e])}e.addState(i)}for(r=0;r<s.length;r++)n=s[r],n[0].loopBackState=e.states[n[1]];for(r=0;r<a.length;r++)n=a[r],n[0].endState=e.states[n[1]];let l=this.readInt();for(r=0;r<l;r++)i=this.readInt(),e.states[i].nonGreedy=!0;let c=this.readInt();for(r=0;r<c;r++)i=this.readInt(),e.states[i].isPrecedenceRule=!0}readRules(e,t){let r;const n=this.readInt();for(0===e.grammarType&&(e.ruleToTokenType=It(n,0)),e.ruleToStartState=It(n,0),r=0;r<n;r++){const n=this.readInt();if(e.ruleToStartState[r]=e.states[n],0===e.grammarType){let n=this.readInt();t&&65535===n&&(n=i.EOF),e.ruleToTokenType[r]=n}}for(e.ruleToStopState=It(n,0),r=0;r<e.states.length;r++){const t=e.states[r];t instanceof A&&(e.ruleToStopState[t.ruleIndex]=t,e.ruleToStartState[t.ruleIndex].stopState=t)}}readModes(e){const t=this.readInt();for(let r=0;r<t;r++){let t=this.readInt();e.modeToStartState.push(e.states[t])}}readSets(e,t,r){const n=this.readInt();for(let e=0;e<n;e++){const e=new S;t.push(e);const n=this.readInt();0!==this.readInt()&&e.addOne(-1);for(let t=0;t<n;t++){const t=r(),n=r();e.addRange(t,n)}}}readEdges(e,t){let r,n,i,s,a;const o=this.readInt();for(r=0;r<o;r++){const r=this.readInt(),n=this.readInt(),i=this.readInt(),a=this.readInt(),o=this.readInt(),l=this.readInt();s=this.edgeFactory(e,i,r,n,a,o,l,t),e.states[r].addTransition(s)}for(r=0;r<e.states.length;r++)for(i=e.states[r],n=0;n<i.transitions.length;n++){const t=i.transitions[n];if(!(t instanceof y))continue;let r=-1;e.ruleToStartState[t.target.ruleIndex].isPrecedenceRule&&0===t.precedence&&(r=t.target.ruleIndex),s=new dt(t.followState,r),e.ruleToStopState[t.target.ruleIndex].addTransition(s)}for(r=0;r<e.states.length;r++){if(i=e.states[r],i instanceof Q){if(null===i.endState)throw"IllegalState";if(null!==i.endState.startState)throw"IllegalState";i.endState.startState=i}if(i instanceof nt)for(n=0;n<i.transitions.length;n++)a=i.transitions[n].target,a instanceof ot&&(a.loopBackState=i);else if(i instanceof it)for(n=0;n<i.transitions.length;n++)a=i.transitions[n].target,a instanceof rt&&(a.loopBackState=i)}}readDecisions(e){const t=this.readInt();for(let r=0;r<t;r++){const t=this.readInt(),n=e.states[t];e.decisionToState.push(n),n.decision=r}}readLexerActions(e,t){if(0===e.grammarType){const r=this.readInt();e.lexerActions=It(r,null);for(let n=0;n<r;n++){const r=this.readInt();let i=this.readInt();t&&65535===i&&(i=-1);let s=this.readInt();t&&65535===s&&(s=-1),e.lexerActions[n]=this.lexerActionFactory(r,i,s)}}}generateRuleBypassTransitions(e){let t;const r=e.ruleToStartState.length;for(t=0;t<r;t++)e.ruleToTokenType[t]=e.maxTokenType+t+1;for(t=0;t<r;t++)this.generateRuleBypassTransition(e,t)}generateRuleBypassTransition(e,t){let r,n;const i=new lt;i.ruleIndex=t,e.addState(i);const s=new Z;s.ruleIndex=t,e.addState(s),i.endState=s,e.defineDecisionState(i),s.startState=i;let a=null,o=null;if(e.ruleToStartState[t].isPrecedenceRule){for(o=null,r=0;r<e.states.length;r++)if(n=e.states[r],this.stateIsEndStateFor(n,t)){o=n,a=n.loopBackState.transitions[0];break}if(null===a)throw"Couldn't identify final state of the precedence rule prefix section."}else o=e.ruleToStopState[t];for(r=0;r<e.states.length;r++){n=e.states[r];for(let e=0;e<n.transitions.length;e++){const t=n.transitions[e];t!==a&&t.target===o&&(t.target=s)}}const l=e.ruleToStartState[t],c=l.transitions.length;for(;c>0;)i.addTransition(l.transitions[c-1]),l.transitions=l.transitions.slice(-1);e.ruleToStartState[t].addTransition(new dt(i)),s.addTransition(new dt(o));const u=new X;e.addState(u),u.addTransition(new ht(s,e.ruleToTokenType[t])),i.addTransition(new dt(u))}stateIsEndStateFor(e,t){if(e.ruleIndex!==t)return null;if(!(e instanceof rt))return null;const r=e.transitions[e.transitions.length-1].target;return r instanceof tt&&r.epsilonOnlyTransitions&&r.transitions[0].target instanceof A?e:null}markPrecedenceDecisions(e){for(let t=0;t<e.states.length;t++){const r=e.states[t];if(r instanceof rt&&e.ruleToStartState[r.ruleIndex].isPrecedenceRule){const e=r.transitions[r.transitions.length-1].target;e instanceof tt&&e.epsilonOnlyTransitions&&e.transitions[0].target instanceof A&&(r.isPrecedenceDecision=!0)}}}verifyATN(e){if(this.deserializationOptions.verifyATN)for(let t=0;t<e.states.length;t++){const r=e.states[t];if(null!==r)if(this.checkCondition(r.epsilonOnlyTransitions||r.transitions.length<=1),r instanceof ot)this.checkCondition(null!==r.loopBackState);else if(r instanceof rt)if(this.checkCondition(null!==r.loopBackState),this.checkCondition(2===r.transitions.length),r.transitions[0].target instanceof at)this.checkCondition(r.transitions[1].target instanceof tt),this.checkCondition(!r.nonGreedy);else{if(!(r.transitions[0].target instanceof tt))throw"IllegalState";this.checkCondition(r.transitions[1].target instanceof at),this.checkCondition(r.nonGreedy)}else r instanceof it?(this.checkCondition(1===r.transitions.length),this.checkCondition(r.transitions[0].target instanceof rt)):r instanceof tt?this.checkCondition(null!==r.loopBackState):r instanceof et?this.checkCondition(null!==r.stopState):r instanceof Q?this.checkCondition(null!==r.endState):r instanceof Z?this.checkCondition(null!==r.startState):r instanceof J?this.checkCondition(r.transitions.length<=1||r.decision>=0):this.checkCondition(r.transitions.length<=1||r instanceof A)}}checkCondition(e,t){if(!e)throw null==t&&(t="IllegalState"),t}readInt(){return this.data[this.pos++]}readInt32(){return this.readInt()|this.readInt()<<16}edgeFactory(e,t,r,n,s,a,o,l){const c=e.states[n];switch(t){case N.EPSILON:return new dt(c);case N.RANGE:return new ct(c,0!==o?i.EOF:s,a);case N.RULE:return new y(e.states[s],a,o,c);case N.PREDICATE:return new gt(c,s,a,0!==o);case N.PRECEDENCE:return new xt(c,s);case N.ATOM:return new ht(c,0!==o?i.EOF:s);case N.ACTION:return new ut(c,s,a,0!==o);case N.SET:return new L(c,l[s]);case N.NOT_SET:return new I(c,l[s]);case N.WILDCARD:return new k(c);default:throw"The specified transition type: "+t+" is not valid."}}stateFactory(e,t){if(null===this.stateFactories){const e=[];e[C.INVALID_TYPE]=null,e[C.BASIC]=()=>new X,e[C.RULE_START]=()=>new et,e[C.BLOCK_START]=()=>new lt,e[C.PLUS_BLOCK_START]=()=>new ot,e[C.STAR_BLOCK_START]=()=>new at,e[C.TOKEN_START]=()=>new st,e[C.RULE_STOP]=()=>new A,e[C.BLOCK_END]=()=>new Z,e[C.STAR_LOOP_BACK]=()=>new it,e[C.STAR_LOOP_ENTRY]=()=>new rt,e[C.PLUS_LOOP_BACK]=()=>new nt,e[C.LOOP_END]=()=>new tt,this.stateFactories=e}if(e>this.stateFactories.length||null===this.stateFactories[e])throw"The specified state type "+e+" is not valid.";{const r=this.stateFactories[e]();if(null!==r)return r.ruleIndex=t,r}}lexerActionFactory(e,t,r){if(null===this.actionFactories){const e=[];e[0]=(e,t)=>new Et(e),e[1]=(e,t)=>new St(e,t),e[2]=(e,t)=>new Lt(e),e[3]=(e,t)=>Ct.INSTANCE,e[4]=(e,t)=>yt.INSTANCE,e[5]=(e,t)=>new Nt(e),e[6]=(e,t)=>mt.INSTANCE,e[7]=(e,t)=>new At(e),this.actionFactories=e}if(e>this.actionFactories.length||null===this.actionFactories[e])throw"The specified lexer action type "+e+" is not valid.";return this.actionFactories[e](t,r)}}class vt{syntaxError(e,t,r,n,i,s){}reportAmbiguity(e,t,r,n,i,s,a){}reportAttemptingFullContext(e,t,r,n,i,s){}reportContextSensitivity(e,t,r,n,i,s){}}class wt extends vt{constructor(){super()}syntaxError(e,t,r,n,i,s){console.error("line "+r+":"+n+" "+i)}}wt.INSTANCE=new wt;class Rt extends vt{constructor(e){if(super(),null===e)throw"delegates";return this.delegates=e,this}syntaxError(e,t,r,n,i,s){this.delegates.map(a=>a.syntaxError(e,t,r,n,i,s))}reportAmbiguity(e,t,r,n,i,s,a){this.delegates.map(o=>o.reportAmbiguity(e,t,r,n,i,s,a))}reportAttemptingFullContext(e,t,r,n,i,s){this.delegates.map(a=>a.reportAttemptingFullContext(e,t,r,n,i,s))}reportContextSensitivity(e,t,r,n,i,s){this.delegates.map(a=>a.reportContextSensitivity(e,t,r,n,i,s))}}class Ot{constructor(){this._listeners=[wt.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(e){const t="4.13.2";t!==e&&console.log("ANTLR runtime and generated code versions disagree: "+t+"!="+e)}addErrorListener(e){this._listeners.push(e)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const e=this.getLiteralNames(),t=this.getSymbolicNames(),r=e.length>t.length?e.length:t.length;this.tokenNames=[];for(let n=0;n<r;n++)this.tokenNames[n]=e[n]||t[n]||"<INVALID"}return this.tokenNames}getTokenTypeMap(){const e=this.getTokenNames();if(null===e)throw"The current recognizer does not provide a list of token names.";let t=this.tokenTypeMapCache[e];return void 0===t&&(t=e.reduce(function(e,t,r){e[t]=r}),t.EOF=i.EOF,this.tokenTypeMapCache[e]=t),t}getRuleIndexMap(){const e=this.ruleNames;if(null===e)throw"The current recognizer does not provide a list of rule names.";let t=this.ruleIndexMapCache[e];return void 0===t&&(t=e.reduce(function(e,t,r){e[t]=r}),this.ruleIndexMapCache[e]=t),t}getTokenType(e){const t=this.getTokenTypeMap()[e];return void 0!==t?t:i.INVALID_TYPE}getErrorHeader(e){return"line "+e.getOffendingToken().line+":"+e.getOffendingToken().column}getTokenErrorDisplay(e){if(null===e)return"<no token>";let t=e.text;return null===t&&(t=e.type===i.EOF?"<EOF>":"<"+e.type+">"),t=t.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+t+"'"}getErrorListenerDispatch(){return console.warn("Calling deprecated method in Recognizer class: getErrorListenerDispatch()"),this.getErrorListener()}getErrorListener(){return new Rt(this._listeners)}sempred(e,t,r){return!0}precpred(e,t){return!0}get atn(){return this._interp.atn}get state(){return this._stateNumber}set state(e){this._stateNumber=e}}Ot.tokenTypeMapCache={},Ot.ruleIndexMapCache={};class Pt extends i{constructor(e,t,r,n,s){super(),this.source=void 0!==e?e:Pt.EMPTY_SOURCE,this.type=void 0!==t?t:null,this.channel=void 0!==r?r:i.DEFAULT_CHANNEL,this.start=void 0!==n?n:-1,this.stop=void 0!==s?s:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=e[0].line,this.column=e[0].column):this.column=-1}clone(){const e=new Pt(this.source,this.type,this.channel,this.start,this.stop);return e.tokenIndex=this.tokenIndex,e.line=this.line,e.column=this.column,e.text=this.text,e}cloneWithType(e){const t=new Pt(this.source,e,this.channel,this.start,this.stop);return t.tokenIndex=this.tokenIndex,t.line=this.line,t.column=this.column,e===i.EOF&&(t.text=""),t}toString(){let e=this.text;return e=null!==e?e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+e+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const e=this.getInputStream();if(null===e)return null;const t=e.size;return this.start<t&&this.stop<t?e.getText(this.start,this.stop):"<EOF>"}set text(e){this._text=e}}Pt.EMPTY_SOURCE=[null,null];class bt{}class Ft extends bt{constructor(e){super(),this.copyText=void 0!==e&&e}create(e,t,r,n,i,s,a,o){const l=new Pt(e,t,n,i,s);return l.line=a,l.column=o,null!==r?l.text=r:this.copyText&&null!==e[1]&&(l.text=e[1].getText(i,s)),l}createThin(e,t){const r=new Pt(null,e);return r.text=t,r}}Ft.DEFAULT=new Ft;class Dt extends Error{constructor(e){super(e.message),Error.captureStackTrace&&Error.captureStackTrace(this,Dt),this.message=e.message,this.recognizer=e.recognizer,this.input=e.input,this.ctx=e.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}}class Mt extends Dt{constructor(e,t,r,n){super({message:"",recognizer:e,input:t,ctx:null}),this.startIndex=r,this.deadEndConfigs=n}toString(){let e="";return this.startIndex>=0&&this.startIndex<this.input.size&&(e=this.input.getText(new E(this.startIndex,this.startIndex))),"LexerNoViableAltException"+e}}class Ut extends Ot{constructor(e){super(),this._input=e,this._factory=Ft.DEFAULT,this._tokenFactorySourcePair=[this,e],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=i.DEFAULT_CHANNEL,this._type=i.INVALID_TYPE,this._modeStack=[],this._mode=Ut.DEFAULT_MODE,this._text=null}reset(){null!==this._input&&this._input.seek(0),this._token=null,this._type=i.INVALID_TYPE,this._channel=i.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=Ut.DEFAULT_MODE,this._modeStack=[],this._interp.reset()}nextToken(){if(null===this._input)throw"nextToken requires a non-null input stream.";const e=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=i.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;let t=!1;for(;;){this._type=i.INVALID_TYPE;let r=Ut.SKIP;try{r=this._interp.match(this._input,this._mode)}catch(e){if(!(e instanceof Dt))throw console.log(e.stack),e;this.notifyListeners(e),this.recover(e)}if(this._input.LA(1)===i.EOF&&(this._hitEOF=!0),this._type===i.INVALID_TYPE&&(this._type=r),this._type===Ut.SKIP){t=!0;break}if(this._type!==Ut.MORE)break}if(!t)return null===this._token&&this.emit(),this._token}}finally{this._input.release(e)}}skip(){this._type=Ut.SKIP}more(){this._type=Ut.MORE}mode(e){console.warn("Calling deprecated method in Lexer class: mode(...)"),this.setMode(e)}setMode(e){this._mode=e}getMode(){return this._mode}getModeStack(){return this._modeStack}pushMode(e){this._interp.debug&&console.log("pushMode "+e),this._modeStack.push(this._mode),this.setMode(e)}popMode(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.setMode(this._modeStack.pop()),this._mode}emitToken(e){this._token=e}emit(){const e=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(e),e}emitEOF(){const e=this.column,t=this.line,r=this._factory.create(this._tokenFactorySourcePair,i.EOF,null,i.DEFAULT_CHANNEL,this._input.index,this._input.index-1,t,e);return this.emitToken(r),r}getCharIndex(){return this._input.index}getAllTokens(){const e=[];let t=this.nextToken();for(;t.type!==i.EOF;)e.push(t),t=this.nextToken();return e}notifyListeners(e){const t=this._tokenStartCharIndex,r=this._input.index,n=this._input.getText(t,r),i="token recognition error at: '"+this.getErrorDisplay(n)+"'";this.getErrorListener().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,i,e)}getErrorDisplay(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r]);return t.join("")}getErrorDisplayForChar(e){return e.charCodeAt(0)===i.EOF?"<EOF>":"\n"===e?"\\n":"\t"===e?"\\t":"\r"===e?"\\r":e}getCharErrorDisplay(e){return"'"+this.getErrorDisplayForChar(e)+"'"}recover(e){this._input.LA(1)!==i.EOF&&(e instanceof Mt?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(e){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=e,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(e){this._type=e}get line(){return this._interp.line}set line(e){this._interp.line=e}get column(){return this._interp.column}set column(e){this._interp.column=e}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(e){this._text=e}}function Ht(e){return e.hashCodeForConfigSet()}function Bt(e,t){return e===t||null!==e&&null!==t&&e.equalsForConfigSet(t)}Ut.DEFAULT_MODE=0,Ut.MORE=-2,Ut.SKIP=-3,Ut.DEFAULT_TOKEN_CHANNEL=i.DEFAULT_CHANNEL,Ut.HIDDEN=i.HIDDEN_CHANNEL,Ut.MIN_CHAR_VALUE=0,Ut.MAX_CHAR_VALUE=1114111;class Vt{constructor(e){this.configLookup=new p(Ht,Bt),this.fullCtx=void 0===e||e,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(e,t){if(void 0===t&&(t=null),this.readOnly)throw"This set is readonly";e.semanticContext!==g.NONE&&(this.hasSemanticContext=!0),e.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const r=this.configLookup.getOrAdd(e);if(r===e)return this.cachedHashCode=-1,this.configs.push(e),!0;const n=!this.fullCtx,i=W(r.context,e.context,n,t);return r.reachesIntoOuterContext=Math.max(r.reachesIntoOuterContext,e.reachesIntoOuterContext),e.precedenceFilterSuppressed&&(r.precedenceFilterSuppressed=!0),r.context=i,!0}getStates(){const e=new p;for(let t=0;t<this.configs.length;t++)e.add(this.configs[t].state);return e}getPredicates(){const e=[];for(let t=0;t<this.configs.length;t++){const r=this.configs[t].semanticContext;r!==g.NONE&&e.push(r.semanticContext)}return e}optimizeConfigs(e){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(let t=0;t<this.configs.length;t++){const r=this.configs[t];r.context=e.getCachedContext(r.context)}}addAll(e){for(let t=0;t<e.length;t++)this.add(e[t]);return!1}equals(e){return this===e||e instanceof Vt&&r(this.configs,e.configs)&&this.fullCtx===e.fullCtx&&this.uniqueAlt===e.uniqueAlt&&this.conflictingAlts===e.conflictingAlts&&this.hasSemanticContext===e.hasSemanticContext&&this.dipsIntoOuterContext===e.dipsIntoOuterContext}hashCode(){const e=new l;return e.update(this.configs),e.finish()}updateHashCode(e){this.readOnly?(-1===this.cachedHashCode&&(this.cachedHashCode=this.hashCode()),e.update(this.cachedHashCode)):e.update(this.hashCode())}isEmpty(){return 0===this.configs.length}contains(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(e)}containsFast(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(e)}clear(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new p}setReadonly(e){this.readOnly=e,e&&(this.configLookup=null)}toString(){return d(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==j.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")}get items(){return this.configs}get length(){return this.configs.length}}class zt{constructor(e,t){return null===e&&(e=-1),null===t&&(t=new Vt),this.stateNumber=e,this.configs=t,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}getAltSet(){const e=new p;if(null!==this.configs)for(let t=0;t<this.configs.length;t++){const r=this.configs[t];e.add(r.alt)}return 0===e.length?null:e}equals(e){return this===e||e instanceof zt&&this.configs.equals(e.configs)}toString(){let e=this.stateNumber+":"+this.configs;return this.isAcceptState&&(e+="=>",null!==this.predicates?e+=this.predicates:e+=this.prediction),e}hashCode(){const e=new l;return e.update(this.configs),e.finish()}}class Yt{constructor(e,t){return this.atn=e,this.sharedContextCache=t,this}getCachedContext(e){if(null===this.sharedContextCache)return e;const t=new Y;return K(e,this.sharedContextCache,t)}}Yt.ERROR=new zt(2147483647,new Vt);class qt extends Vt{constructor(){super(),this.configLookup=new p}}class Kt extends m{constructor(e,t){super(e,t);const r=e.lexerActionExecutor||null;return this.lexerActionExecutor=r||(null!==t?t.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==t&&this.checkNonGreedyDecision(t,this.state),this.hashCodeForConfigSet=Kt.prototype.hashCode,this.equalsForConfigSet=Kt.prototype.equals,this}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)}equals(e){return this===e||e instanceof Kt&&this.passedThroughNonGreedyDecision===e.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(e.lexerActionExecutor):!e.lexerActionExecutor)&&super.equals(e)}checkNonGreedyDecision(e,t){return e.passedThroughNonGreedyDecision||t instanceof J&&t.nonGreedy}}class Wt extends Tt{constructor(e,t){super(t.actionType),this.offset=e,this.action=t,this.isPositionDependent=!0}execute(e){this.action.execute(e)}updateHashCode(e){e.update(this.actionType,this.offset,this.action)}equals(e){return this===e||e instanceof Wt&&this.offset===e.offset&&this.action===e.action}}class Gt{constructor(e){return this.lexerActions=null===e?[]:e,this.cachedHashCode=l.hashStuff(e),this}fixOffsetBeforeMatch(e){let t=null;for(let r=0;r<this.lexerActions.length;r++)!this.lexerActions[r].isPositionDependent||this.lexerActions[r]instanceof Wt||(null===t&&(t=this.lexerActions.concat([])),t[r]=new Wt(e,this.lexerActions[r]));return null===t?this:new Gt(t)}execute(e,t,r){let n=!1;const i=t.index;try{for(let s=0;s<this.lexerActions.length;s++){let a=this.lexerActions[s];if(a instanceof Wt){const e=a.offset;t.seek(r+e),a=a.action,n=r+e!==i}else a.isPositionDependent&&(t.seek(i),n=!1);a.execute(e)}}finally{n&&t.seek(i)}}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}equals(e){if(this===e)return!0;if(e instanceof Gt){if(this.cachedHashCode!=e.cachedHashCode)return!1;if(this.lexerActions.length!=e.lexerActions.length)return!1;{const t=this.lexerActions.length;for(let r=0;r<t;++r)if(!this.lexerActions[r].equals(e.lexerActions[r]))return!1;return!0}}return!1}static append(e,t){if(null===e)return new Gt([t]);const r=e.lexerActions.concat([t]);return new Gt(r)}}function $t(e){e.index=-1,e.line=0,e.column=-1,e.dfaState=null}class jt{constructor(){$t(this)}reset(){$t(this)}}class Xt extends Yt{constructor(e,t,r,n){super(t,n),this.decisionToDFA=r,this.recog=e,this.startIndex=-1,this.line=1,this.column=0,this.mode=Ut.DEFAULT_MODE,this.prevAccept=new jt}copyState(e){this.column=e.column,this.line=e.line,this.mode=e.mode,this.startIndex=e.startIndex}match(e,t){this.mode=t;const r=e.mark();try{this.startIndex=e.index,this.prevAccept.reset();const r=this.decisionToDFA[t];return null===r.s0?this.matchATN(e):this.execATN(e,r.s0)}finally{e.release(r)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=Ut.DEFAULT_MODE}matchATN(e){const t=this.atn.modeToStartState[this.mode];Xt.debug&&console.log("matchATN mode "+this.mode+" start: "+t);const r=this.mode,n=this.computeStartState(e,t),i=n.hasSemanticContext;n.hasSemanticContext=!1;const s=this.addDFAState(n);i||(this.decisionToDFA[this.mode].s0=s);const a=this.execATN(e,s);return Xt.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[r].toLexerString()),a}execATN(e,t){Xt.debug&&console.log("start state closure="+t.configs),t.isAcceptState&&this.captureSimState(this.prevAccept,e,t);let r=e.LA(1),n=t;for(;;){Xt.debug&&console.log("execATN loop starting closure: "+n.configs);let t=this.getExistingTargetState(n,r);if(null===t&&(t=this.computeTargetState(e,n,r)),t===Yt.ERROR)break;if(r!==i.EOF&&this.consume(e),t.isAcceptState&&(this.captureSimState(this.prevAccept,e,t),r===i.EOF))break;r=e.LA(1),n=t}return this.failOrAccept(this.prevAccept,e,n.configs,r)}getExistingTargetState(e,t){if(null===e.edges||t<Xt.MIN_DFA_EDGE||t>Xt.MAX_DFA_EDGE)return null;let r=e.edges[t-Xt.MIN_DFA_EDGE];return void 0===r&&(r=null),Xt.debug&&null!==r&&console.log("reuse state "+e.stateNumber+" edge to "+r.stateNumber),r}computeTargetState(e,t,r){const n=new qt;return this.getReachableConfigSet(e,t.configs,n,r),0===n.items.length?(n.hasSemanticContext||this.addDFAEdge(t,r,Yt.ERROR),Yt.ERROR):this.addDFAEdge(t,r,null,n)}failOrAccept(e,t,r,n){if(null!==this.prevAccept.dfaState){const r=e.dfaState.lexerActionExecutor;return this.accept(t,r,this.startIndex,e.index,e.line,e.column),e.dfaState.prediction}if(n===i.EOF&&t.index===this.startIndex)return i.EOF;throw new Mt(this.recog,t,this.startIndex,r)}getReachableConfigSet(e,t,r,n){let s=j.INVALID_ALT_NUMBER;for(let a=0;a<t.items.length;a++){const o=t.items[a],l=o.alt===s;if(!l||!o.passedThroughNonGreedyDecision){Xt.debug&&console.log("testing %s at %s\n",this.getTokenName(n),o.toString(this.recog,!0));for(let t=0;t<o.state.transitions.length;t++){const a=o.state.transitions[t],c=this.getReachableTarget(a,n);if(null!==c){let t=o.lexerActionExecutor;null!==t&&(t=t.fixOffsetBeforeMatch(e.index-this.startIndex));const a=n===i.EOF,u=new Kt({state:c,lexerActionExecutor:t},o);this.closure(e,u,r,l,!0,a)&&(s=o.alt)}}}}}accept(e,t,r,n,i,s){Xt.debug&&console.log("ACTION %s\n",t),e.seek(n),this.line=i,this.column=s,null!==t&&null!==this.recog&&t.execute(this.recog,e,r)}getReachableTarget(e,t){return e.matches(t,0,Ut.MAX_CHAR_VALUE)?e.target:null}computeStartState(e,t){const r=H.EMPTY,n=new qt;for(let i=0;i<t.transitions.length;i++){const s=t.transitions[i].target,a=new Kt({state:s,alt:i+1,context:r},null);this.closure(e,a,n,!1,!1,!1)}return n}closure(e,t,r,n,i,s){let a=null;if(Xt.debug&&console.log("closure("+t.toString(this.recog,!0)+")"),t.state instanceof A){if(Xt.debug&&(null!==this.recog?console.log("closure at %s rule stop %s\n",this.recog.ruleNames[t.state.ruleIndex],t):console.log("closure at rule stop %s\n",t)),null===t.context||t.context.hasEmptyPath()){if(null===t.context||t.context.isEmpty())return r.add(t),!0;r.add(new Kt({state:t.state,context:H.EMPTY},t)),n=!0}if(null!==t.context&&!t.context.isEmpty())for(let o=0;o<t.context.length;o++)if(t.context.getReturnState(o)!==H.EMPTY_RETURN_STATE){const l=t.context.getParent(o),c=this.atn.states[t.context.getReturnState(o)];a=new Kt({state:c,context:l},t),n=this.closure(e,a,r,n,i,s)}return n}t.state.epsilonOnlyTransitions||n&&t.passedThroughNonGreedyDecision||r.add(t);for(let o=0;o<t.state.transitions.length;o++){const l=t.state.transitions[o];a=this.getEpsilonTarget(e,t,l,r,i,s),null!==a&&(n=this.closure(e,a,r,n,i,s))}return n}getEpsilonTarget(e,t,r,n,s,a){let o=null;if(r.serializationType===N.RULE){const e=V.create(t.context,r.followState.stateNumber);o=new Kt({state:r.target,context:e},t)}else{if(r.serializationType===N.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(r.serializationType===N.PREDICATE)Xt.debug&&console.log("EVAL rule "+r.ruleIndex+":"+r.predIndex),n.hasSemanticContext=!0,this.evaluatePredicate(e,r.ruleIndex,r.predIndex,s)&&(o=new Kt({state:r.target},t));else if(r.serializationType===N.ACTION)if(null===t.context||t.context.hasEmptyPath()){const e=Gt.append(t.lexerActionExecutor,this.atn.lexerActions[r.actionIndex]);o=new Kt({state:r.target,lexerActionExecutor:e},t)}else o=new Kt({state:r.target},t);else r.serializationType===N.EPSILON?o=new Kt({state:r.target},t):r.serializationType!==N.ATOM&&r.serializationType!==N.RANGE&&r.serializationType!==N.SET||a&&r.matches(i.EOF,0,Ut.MAX_CHAR_VALUE)&&(o=new Kt({state:r.target},t))}return o}evaluatePredicate(e,t,r,n){if(null===this.recog)return!0;if(!n)return this.recog.sempred(null,t,r);const i=this.column,s=this.line,a=e.index,o=e.mark();try{return this.consume(e),this.recog.sempred(null,t,r)}finally{this.column=i,this.line=s,e.seek(a),e.release(o)}}captureSimState(e,t,r){e.index=t.index,e.line=this.line,e.column=this.column,e.dfaState=r}addDFAEdge(e,t,r,n){if(void 0===r&&(r=null),void 0===n&&(n=null),null===r&&null!==n){const e=n.hasSemanticContext;if(n.hasSemanticContext=!1,r=this.addDFAState(n),e)return r}return t<Xt.MIN_DFA_EDGE||t>Xt.MAX_DFA_EDGE||(Xt.debug&&console.log("EDGE "+e+" -> "+r+" upon "+t),null===e.edges&&(e.edges=[]),e.edges[t-Xt.MIN_DFA_EDGE]=r),r}addDFAState(e){const t=new zt(null,e);let r=null;for(let t=0;t<e.items.length;t++){const n=e.items[t];if(n.state instanceof A){r=n;break}}null!==r&&(t.isAcceptState=!0,t.lexerActionExecutor=r.lexerActionExecutor,t.prediction=this.atn.ruleToTokenType[r.state.ruleIndex]);const n=this.decisionToDFA[this.mode],i=n.states.get(t);if(null!==i)return i;const s=t;return s.stateNumber=n.states.length,e.setReadonly(!0),s.configs=e,n.states.add(s),s}getDFA(e){return this.decisionToDFA[e]}getText(e){return e.getText(this.startIndex,e.index-1)}consume(e){e.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,e.consume()}getTokenName(e){return-1===e?"EOF":"'"+String.fromCharCode(e)+"'"}}Xt.debug=!1,Xt.dfa_debug=!1,Xt.MIN_DFA_EDGE=0,Xt.MAX_DFA_EDGE=127;class Jt{constructor(e,t){this.alt=t,this.pred=e}toString(){return"("+this.pred+", "+this.alt+")"}}class Qt{constructor(){this.data={}}get(e){return this.data["k-"+e]||null}set(e,t){this.data["k-"+e]=t}values(){return Object.keys(this.data).filter(e=>e.startsWith("k-")).map(e=>this.data[e],this)}}const Zt={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(e,t){if(Zt.allConfigsInRuleStopStates(t))return!0;if(e===Zt.SLL&&t.hasSemanticContext){const e=new Vt;for(let r=0;r<t.items.length;r++){let n=t.items[r];n=new m({semanticContext:g.NONE},n),e.add(n)}t=e}const r=Zt.getConflictingAltSubsets(t);return Zt.hasConflictingAltSet(r)&&!Zt.hasStateAssociatedWithOneAlt(t)},hasConfigInRuleStopState:function(e){for(let t=0;t<e.items.length;t++)if(e.items[t].state instanceof A)return!0;return!1},allConfigsInRuleStopStates:function(e){for(let t=0;t<e.items.length;t++)if(!(e.items[t].state instanceof A))return!1;return!0},resolvesToJustOneViableAlt:function(e){return Zt.getSingleViableAlt(e)},allSubsetsConflict:function(e){return!Zt.hasNonConflictingAltSet(e)},hasNonConflictingAltSet:function(e){for(let t=0;t<e.length;t++)if(1===e[t].length)return!0;return!1},hasConflictingAltSet:function(e){for(let t=0;t<e.length;t++)if(e[t].length>1)return!0;return!1},allSubsetsEqual:function(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null===t)t=n;else if(n!==t)return!1}return!0},getUniqueAlt:function(e){const t=Zt.getAlts(e);return 1===t.length?t.minValue():j.INVALID_ALT_NUMBER},getAlts:function(e){const t=new G;return e.map(function(e){t.or(e)}),t},getConflictingAltSubsets:function(e){const t=new Y;return t.hashFunction=function(e){l.hashStuff(e.state.stateNumber,e.context)},t.equalsFunction=function(e,t){return e.state.stateNumber===t.state.stateNumber&&e.context.equals(t.context)},e.items.map(function(e){let r=t.get(e);null===r&&(r=new G,t.set(e,r)),r.set(e.alt)}),t.getValues()},getStateToAltMap:function(e){const t=new Qt;return e.items.map(function(e){let r=t.get(e.state);null===r&&(r=new G,t.set(e.state,r)),r.set(e.alt)}),t},hasStateAssociatedWithOneAlt:function(e){const t=Zt.getStateToAltMap(e).values();for(let e=0;e<t.length;e++)if(1===t[e].length)return!0;return!1},getSingleViableAlt:function(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r].minValue();if(null===t)t=n;else if(t!==n)return j.INVALID_ALT_NUMBER}return t}},te=Zt;class ee extends Dt{constructor(e,t,r,n,i,s){s=s||e._ctx,n=n||e.getCurrentToken(),r=r||e.getCurrentToken(),t=t||e.getInputStream(),super({message:"",recognizer:e,input:t,ctx:s}),this.deadEndConfigs=i,this.startToken=r,this.offendingToken=n}}class se{constructor(e){this.defaultMapCtor=e||Y,this.cacheMap=new this.defaultMapCtor}get(e,t){const r=this.cacheMap.get(e)||null;return null===r?null:r.get(t)||null}set(e,t,r){let n=this.cacheMap.get(e)||null;null===n&&(n=new this.defaultMapCtor,this.cacheMap.set(e,n)),n.set(t,r)}}class ne extends Yt{constructor(e,t,r,n){super(t,n),this.parser=e,this.decisionToDFA=r,this.predictionMode=te.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this.debug=!1,this.debug_closure=!1,this.debug_add=!1,this.trace_atn_sim=!1,this.dfa_debug=!1,this.retry_debug=!1}reset(){}adaptivePredict(e,t,r){(this.debug||this.trace_atn_sim)&&console.log("adaptivePredict decision "+t+" exec LA(1)=="+this.getLookaheadName(e)+" line "+e.LT(1).line+":"+e.LT(1).column),this._input=e,this._startIndex=e.index,this._outerContext=r;const n=this.decisionToDFA[t];this._dfa=n;const i=e.mark(),s=e.index;try{let t;if(t=n.precedenceDfa?n.getPrecedenceStartState(this.parser.getPrecedence()):n.s0,null===t){null===r&&(r=U.EMPTY),this.debug&&console.log("predictATN decision "+n.decision+" exec LA(1)=="+this.getLookaheadName(e)+", outerContext="+r.toString(this.parser.ruleNames));const i=!1;let s=this.computeStartState(n.atnStartState,U.EMPTY,i);n.precedenceDfa?(n.s0.configs=s,s=this.applyPrecedenceFilter(s),t=this.addDFAState(n,new zt(null,s)),n.setPrecedenceStartState(this.parser.getPrecedence(),t)):(t=this.addDFAState(n,new zt(null,s)),n.s0=t)}const i=this.execATN(n,t,e,s,r);return this.debug&&console.log("DFA after predictATN: "+n.toString(this.parser.literalNames,this.parser.symbolicNames)),i}finally{this._dfa=null,this.mergeCache=null,e.seek(s),e.release(i)}}execATN(e,t,r,n,s){let a;(this.debug||this.trace_atn_sim)&&console.log("execATN decision "+e.decision+", DFA state "+t+", LA(1)=="+this.getLookaheadName(r)+" line "+r.LT(1).line+":"+r.LT(1).column);let o=t;this.debug&&console.log("s0 = "+t);let l=r.LA(1);for(;;){let t=this.getExistingTargetState(o,l);if(null===t&&(t=this.computeTargetState(e,o,l)),t===Yt.ERROR){const e=this.noViableAlt(r,s,o.configs,n);if(r.seek(n),a=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(o.configs,s),a!==j.INVALID_ALT_NUMBER)return a;throw e}if(t.requiresFullContext&&this.predictionMode!==te.SLL){let i=null;if(null!==t.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");const e=r.index;if(e!==n&&r.seek(n),i=this.evalSemanticContext(t.predicates,s,!0),1===i.length)return this.debug&&console.log("Full LL avoided"),i.minValue();e!==n&&r.seek(e)}this.dfa_debug&&console.log("ctx sensitive state "+s+" in "+t);const o=!0,l=this.computeStartState(e.atnStartState,s,o);return this.reportAttemptingFullContext(e,i,t.configs,n,r.index),a=this.execATNWithFullContext(e,t,l,r,n,s),a}if(t.isAcceptState){if(null===t.predicates)return t.prediction;const i=r.index;r.seek(n);const a=this.evalSemanticContext(t.predicates,s,!0);if(0===a.length)throw this.noViableAlt(r,s,t.configs,n);return 1===a.length||this.reportAmbiguity(e,t,n,i,!1,a,t.configs),a.minValue()}o=t,l!==i.EOF&&(r.consume(),l=r.LA(1))}}getExistingTargetState(e,t){const r=e.edges;return null===r?null:r[t+1]||null}computeTargetState(e,t,r){const n=this.computeReachSet(t.configs,r,!1);if(null===n)return this.addDFAEdge(e,t,r,Yt.ERROR),Yt.ERROR;let i=new zt(null,n);const s=this.getUniqueAlt(n);if(this.debug){const e=te.getConflictingAltSubsets(n);console.log("SLL altSubSets="+d(e)+", configs="+n+", predict="+s+", allSubsetsConflict="+te.allSubsetsConflict(e)+", conflictingAlts="+this.getConflictingAlts(n))}return s!==j.INVALID_ALT_NUMBER?(i.isAcceptState=!0,i.configs.uniqueAlt=s,i.prediction=s):te.hasSLLConflictTerminatingPrediction(this.predictionMode,n)&&(i.configs.conflictingAlts=this.getConflictingAlts(n),i.requiresFullContext=!0,i.isAcceptState=!0,i.prediction=i.configs.conflictingAlts.minValue()),i.isAcceptState&&i.configs.hasSemanticContext&&(this.predicateDFAState(i,this.atn.getDecisionState(e.decision)),null!==i.predicates&&(i.prediction=j.INVALID_ALT_NUMBER)),i=this.addDFAEdge(e,t,r,i),i}predicateDFAState(e,t){const r=t.transitions.length,n=this.getConflictingAltsOrUniqueAlt(e.configs),i=this.getPredsForAmbigAlts(n,e.configs,r);null!==i?(e.predicates=this.getPredicatePredictions(n,i),e.prediction=j.INVALID_ALT_NUMBER):e.prediction=n.minValue()}execATNWithFullContext(e,t,r,n,s,a){(this.debug||this.trace_atn_sim)&&console.log("execATNWithFullContext "+r);let o,l=!1,c=r;n.seek(s);let u=n.LA(1),h=-1;for(;;){if(o=this.computeReachSet(c,u,!0),null===o){const e=this.noViableAlt(n,a,c,s);n.seek(s);const t=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(c,a);if(t!==j.INVALID_ALT_NUMBER)return t;throw e}const e=te.getConflictingAltSubsets(o);if(this.debug&&console.log("LL altSubSets="+e+", predict="+te.getUniqueAlt(e)+", resolvesToJustOneViableAlt="+te.resolvesToJustOneViableAlt(e)),o.uniqueAlt=this.getUniqueAlt(o),o.uniqueAlt!==j.INVALID_ALT_NUMBER){h=o.uniqueAlt;break}if(this.predictionMode!==te.LL_EXACT_AMBIG_DETECTION){if(h=te.resolvesToJustOneViableAlt(e),h!==j.INVALID_ALT_NUMBER)break}else if(te.allSubsetsConflict(e)&&te.allSubsetsEqual(e)){l=!0,h=te.getSingleViableAlt(e);break}c=o,u!==i.EOF&&(n.consume(),u=n.LA(1))}return o.uniqueAlt!==j.INVALID_ALT_NUMBER?(this.reportContextSensitivity(e,h,o,s,n.index),h):(this.reportAmbiguity(e,t,s,n.index,l,null,o),h)}computeReachSet(e,t,r){this.debug&&console.log("in computeReachSet, starting closure: "+e),null===this.mergeCache&&(this.mergeCache=new se);const n=new Vt(r);let s=null;for(let a=0;a<e.items.length;a++){const o=e.items[a];if(this.debug&&console.log("testing "+this.getTokenName(t)+" at "+o),o.state instanceof A)(r||t===i.EOF)&&(null===s&&(s=[]),s.push(o),this.debug_add&&console.log("added "+o+" to skippedStopStates"));else for(let e=0;e<o.state.transitions.length;e++){const r=o.state.transitions[e],i=this.getReachableTarget(r,t);if(null!==i){const e=new m({state:i},o);n.add(e,this.mergeCache),this.debug_add&&console.log("added "+e+" to intermediate")}}}let a=null;if(null===s&&t!==i.EOF&&(1===n.items.length||this.getUniqueAlt(n)!==j.INVALID_ALT_NUMBER)&&(a=n),null===a){a=new Vt(r);const e=new p,s=t===i.EOF;for(let t=0;t<n.items.length;t++)this.closure(n.items[t],a,e,!1,r,s)}if(t===i.EOF&&(a=this.removeAllConfigsNotInRuleStopState(a,a===n)),!(null===s||r&&te.hasConfigInRuleStopState(a)))for(let e=0;e<s.length;e++)a.add(s[e],this.mergeCache);return this.trace_atn_sim&&console.log("computeReachSet "+e+" -> "+a),0===a.items.length?null:a}removeAllConfigsNotInRuleStopState(e,t){if(te.allConfigsInRuleStopStates(e))return e;const r=new Vt(e.fullCtx);for(let n=0;n<e.items.length;n++){const s=e.items[n];if(s.state instanceof A)r.add(s,this.mergeCache);else if(t&&s.state.epsilonOnlyTransitions&&this.atn.nextTokens(s.state).contains(i.EPSILON)){const e=this.atn.ruleToStopState[s.state.ruleIndex];r.add(new m({state:e},s),this.mergeCache)}}return r}computeStartState(e,t,r){const n=q(this.atn,t),i=new Vt(r);this.trace_atn_sim&&console.log("computeStartState from ATN state "+e+" initialContext="+n.toString(this.parser));for(let t=0;t<e.transitions.length;t++){const s=e.transitions[t].target,a=new m({state:s,alt:t+1,context:n},null),o=new p;this.closure(a,i,o,!0,r,!1)}return i}applyPrecedenceFilter(e){let t;const r=[],n=new Vt(e.fullCtx);for(let i=0;i<e.items.length;i++){if(t=e.items[i],1!==t.alt)continue;const s=t.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==s&&(r[t.state.stateNumber]=t.context,s!==t.semanticContext?n.add(new m({semanticContext:s},t),this.mergeCache):n.add(t,this.mergeCache))}for(let i=0;i<e.items.length;i++)if(t=e.items[i],1!==t.alt){if(!t.precedenceFilterSuppressed){const e=r[t.state.stateNumber]||null;if(null!==e&&e.equals(t.context))continue}n.add(t,this.mergeCache)}return n}getReachableTarget(e,t){return e.matches(t,0,this.atn.maxTokenType)?e.target:null}getPredsForAmbigAlts(e,t,r){let n=[];for(let r=0;r<t.items.length;r++){const i=t.items[r];e.get(i.alt)&&(n[i.alt]=g.orContext(n[i.alt]||null,i.semanticContext))}let i=0;for(let e=1;e<r+1;e++){const t=n[e]||null;null===t?n[e]=g.NONE:t!==g.NONE&&(i+=1)}return 0===i&&(n=null),this.debug&&console.log("getPredsForAmbigAlts result "+d(n)),n}getPredicatePredictions(e,t){const r=[];let n=!1;for(let i=1;i<t.length;i++){const s=t[i];null!==e&&e.get(i)&&r.push(new Jt(s,i)),s!==g.NONE&&(n=!0)}return n?r:null}getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(e,t){const r=this.splitAccordingToSemanticValidity(e,t),n=r[0],i=r[1];let s=this.getAltThatFinishedDecisionEntryRule(n);return s!==j.INVALID_ALT_NUMBER||i.items.length>0&&(s=this.getAltThatFinishedDecisionEntryRule(i),s!==j.INVALID_ALT_NUMBER)?s:j.INVALID_ALT_NUMBER}getAltThatFinishedDecisionEntryRule(e){const t=[];for(let r=0;r<e.items.length;r++){const n=e.items[r];(n.reachesIntoOuterContext>0||n.state instanceof A&&n.context.hasEmptyPath())&&t.indexOf(n.alt)<0&&t.push(n.alt)}return 0===t.length?j.INVALID_ALT_NUMBER:Math.min.apply(null,t)}splitAccordingToSemanticValidity(e,t){const r=new Vt(e.fullCtx),n=new Vt(e.fullCtx);for(let i=0;i<e.items.length;i++){const s=e.items[i];s.semanticContext!==g.NONE?s.semanticContext.evaluate(this.parser,t)?r.add(s):n.add(s):r.add(s)}return[r,n]}evalSemanticContext(e,t,r){const n=new G;for(let i=0;i<e.length;i++){const s=e[i];if(s.pred===g.NONE){if(n.set(s.alt),!r)break;continue}const a=s.pred.evaluate(this.parser,t);if((this.debug||this.dfa_debug)&&console.log("eval pred "+s+"="+a),a&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+s.alt),n.set(s.alt),!r))break}return n}closure(e,t,r,n,i,s){this.closureCheckingStopState(e,t,r,n,i,0,s)}closureCheckingStopState(e,t,r,n,i,s,a){if((this.trace_atn_sim||this.debug_closure)&&console.log("closure("+e.toString(this.parser,!0)+")"),e.state instanceof A){if(!e.context.isEmpty()){for(let o=0;o<e.context.length;o++){if(e.context.getReturnState(o)===H.EMPTY_RETURN_STATE){if(i){t.add(new m({state:e.state,context:H.EMPTY},e),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex)),this.closure_(e,t,r,n,i,s,a);continue}const l=this.atn.states[e.context.getReturnState(o)],c=e.context.getParent(o),u={state:l,alt:e.alt,context:c,semanticContext:e.semanticContext},h=new m(u,null);h.reachesIntoOuterContext=e.reachesIntoOuterContext,this.closureCheckingStopState(h,t,r,n,i,s-1,a)}return}if(i)return void t.add(e,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex))}this.closure_(e,t,r,n,i,s,a)}closure_(e,t,r,n,i,s,a){const o=e.state;o.epsilonOnlyTransitions||t.add(e,this.mergeCache);for(let l=0;l<o.transitions.length;l++){if(0===l&&this.canDropLoopEntryEdgeInLeftRecursiveRule(e))continue;const c=o.transitions[l],u=n&&!(c instanceof ut),h=this.getEpsilonTarget(e,c,u,0===s,i,a);if(null!==h){let n=s;if(e.state instanceof A){if(null!==this._dfa&&this._dfa.precedenceDfa&&c.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(h.precedenceFilterSuppressed=!0),h.reachesIntoOuterContext+=1,r.getOrAdd(h)!==h)continue;t.dipsIntoOuterContext=!0,n-=1,this.debug&&console.log("dips into outer ctx: "+h)}else{if(!c.isEpsilon&&r.getOrAdd(h)!==h)continue;c instanceof y&&n>=0&&(n+=1)}this.closureCheckingStopState(h,t,r,u,i,n,a)}}}canDropLoopEntryEdgeInLeftRecursiveRule(e){const t=e.state;if(t.stateType!==C.STAR_LOOP_ENTRY)return!1;if(t.stateType!==C.STAR_LOOP_ENTRY||!t.isPrecedenceDecision||e.context.isEmpty()||e.context.hasEmptyPath())return!1;const r=e.context.length;for(let n=0;n<r;n++)if(this.atn.states[e.context.getReturnState(n)].ruleIndex!==t.ruleIndex)return!1;const n=t.transitions[0].target.endState.stateNumber,i=this.atn.states[n];for(let n=0;n<r;n++){const r=e.context.getReturnState(n),s=this.atn.states[r];if(1!==s.transitions.length||!s.transitions[0].isEpsilon)return!1;const a=s.transitions[0].target;if(!(s.stateType===C.BLOCK_END&&a===t||s===i||a===i||a.stateType===C.BLOCK_END&&1===a.transitions.length&&a.transitions[0].isEpsilon&&a.transitions[0].target===t))return!1}return!0}getRuleName(e){return null!==this.parser&&e>=0?this.parser.ruleNames[e]:"<rule "+e+">"}getEpsilonTarget(e,t,r,n,s,a){switch(t.serializationType){case N.RULE:return this.ruleTransition(e,t);case N.PRECEDENCE:return this.precedenceTransition(e,t,r,n,s);case N.PREDICATE:return this.predTransition(e,t,r,n,s);case N.ACTION:return this.actionTransition(e,t);case N.EPSILON:return new m({state:t.target},e);case N.ATOM:case N.RANGE:case N.SET:return a&&t.matches(i.EOF,0,1)?new m({state:t.target},e):null;default:return null}}actionTransition(e,t){if(this.debug){const e=-1===t.actionIndex?65535:t.actionIndex;console.log("ACTION edge "+t.ruleIndex+":"+e)}return new m({state:t.target},e)}precedenceTransition(e,t,r,n,i){this.debug&&(console.log("PRED (collectPredicates="+r+") "+t.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+d(this.parser.getRuleInvocationStack())));let s=null;if(r&&n)if(i){const r=this._input.index;this._input.seek(this._startIndex);const n=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(r),n&&(s=new m({state:t.target},e))}else{const r=g.andContext(e.semanticContext,t.getPredicate());s=new m({state:t.target,semanticContext:r},e)}else s=new m({state:t.target},e);return this.debug&&console.log("config from pred transition="+s),s}predTransition(e,t,r,n,i){this.debug&&(console.log("PRED (collectPredicates="+r+") "+t.ruleIndex+":"+t.predIndex+", ctx dependent="+t.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+d(this.parser.getRuleInvocationStack())));let s=null;if(r&&(t.isCtxDependent&&n||!t.isCtxDependent))if(i){const r=this._input.index;this._input.seek(this._startIndex);const n=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(r),n&&(s=new m({state:t.target},e))}else{const r=g.andContext(e.semanticContext,t.getPredicate());s=new m({state:t.target,semanticContext:r},e)}else s=new m({state:t.target},e);return this.debug&&console.log("config from pred transition="+s),s}ruleTransition(e,t){this.debug&&console.log("CALL rule "+this.getRuleName(t.target.ruleIndex)+", ctx="+e.context);const r=t.followState,n=V.create(e.context,r.stateNumber);return new m({state:t.target,context:n},e)}getConflictingAlts(e){const t=te.getConflictingAltSubsets(e);return te.getAlts(t)}getConflictingAltsOrUniqueAlt(e){let t=null;return e.uniqueAlt!==j.INVALID_ALT_NUMBER?(t=new G,t.set(e.uniqueAlt)):t=e.conflictingAlts,t}getTokenName(e){if(e===i.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(e>=this.parser.literalNames.length&&e>=this.parser.symbolicNames.length))return(this.parser.literalNames[e]||this.parser.symbolicNames[e])+"<"+e+">";console.log(e+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+e}getLookaheadName(e){return this.getTokenName(e.LA(1))}dumpDeadEndConfigs(e){console.log("dead end configs: ");const t=e.getDeadEndConfigs();for(let e=0;e<t.length;e++){const r=t[e];let n="no edges";if(r.state.transitions.length>0){const e=r.state.transitions[0];e instanceof ht?n="Atom "+this.getTokenName(e.label):e instanceof L&&(n=(e instanceof I?"~":"")+"Set "+e.set)}console.error(r.toString(this.parser,!0)+":"+n)}}noViableAlt(e,t,r,n){return new ee(this.parser,e,e.get(n),e.LT(1),r,t)}getUniqueAlt(e){let t=j.INVALID_ALT_NUMBER;for(let r=0;r<e.items.length;r++){const n=e.items[r];if(t===j.INVALID_ALT_NUMBER)t=n.alt;else if(n.alt!==t)return j.INVALID_ALT_NUMBER}return t}addDFAEdge(e,t,r,n){if(this.debug&&console.log("EDGE "+t+" -> "+n+" upon "+this.getTokenName(r)),null===n)return null;if(n=this.addDFAState(e,n),null===t||r<-1||r>this.atn.maxTokenType)return n;if(null===t.edges&&(t.edges=[]),t.edges[r+1]=n,this.debug){const t=null===this.parser?null:this.parser.literalNames,r=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+e.toString(t,r))}return n}addDFAState(e,t){if(t===Yt.ERROR)return t;const r=e.states.get(t);return null!==r?(this.trace_atn_sim&&console.log("addDFAState "+t+" exists"),r):(t.stateNumber=e.states.length,t.configs.readOnly||(t.configs.optimizeConfigs(this),t.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+t),e.states.add(t),this.debug&&console.log("adding new DFA state: "+t),t)}reportAttemptingFullContext(e,t,r,n,i){if(this.debug||this.retry_debug){const t=new E(n,i+1);console.log("reportAttemptingFullContext decision="+e.decision+":"+r+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListener().reportAttemptingFullContext(this.parser,e,n,i,t,r)}reportContextSensitivity(e,t,r,n,i){if(this.debug||this.retry_debug){const t=new E(n,i+1);console.log("reportContextSensitivity decision="+e.decision+":"+r+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListener().reportContextSensitivity(this.parser,e,n,i,t,r)}reportAmbiguity(e,t,r,n,i,s,a){if(this.debug||this.retry_debug){const e=new E(r,n+1);console.log("reportAmbiguity "+s+":"+a+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListener().reportAmbiguity(this.parser,e,r,n,i,s,a)}}class ie{constructor(){this.cache=new Y}add(e){if(e===H.EMPTY)return H.EMPTY;const t=this.cache.get(e)||null;return null!==t?t:(this.cache.set(e,e),e)}get(e){return this.cache.get(e)||null}get length(){return this.cache.length}}const re={ATN:j,ATNDeserializer:kt,LexerATNSimulator:Xt,ParserATNSimulator:ne,PredictionMode:te,PredictionContextCache:ie};class oe{constructor(e,t,r){this.dfa=e,this.literalNames=t||[],this.symbolicNames=r||[]}toString(){if(null===this.dfa.s0)return null;let e="";const t=this.dfa.sortedStates();for(let r=0;r<t.length;r++){const n=t[r];if(null!==n.edges){const t=n.edges.length;for(let r=0;r<t;r++){const t=n.edges[r]||null;null!==t&&2147483647!==t.stateNumber&&(e=e.concat(this.getStateString(n)),e=e.concat("-"),e=e.concat(this.getEdgeLabel(r)),e=e.concat("->"),e=e.concat(this.getStateString(t)),e=e.concat("\n"))}}}return 0===e.length?null:e}getEdgeLabel(e){return 0===e?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[e-1]||this.symbolicNames[e-1]:String.fromCharCode(e-1)}getStateString(e){const t=(e.isAcceptState?":":"")+"s"+e.stateNumber+(e.requiresFullContext?"^":"");return e.isAcceptState?null!==e.predicates?t+"=>"+d(e.predicates):t+"=>"+e.prediction.toString():t}}class ae extends oe{constructor(e){super(e,null)}getEdgeLabel(e){return"'"+String.fromCharCode(e)+"'"}}class le{constructor(e,t){if(void 0===t&&(t=0),this.atnStartState=e,this.decision=t,this._states=new p,this.s0=null,this.precedenceDfa=!1,e instanceof rt&&e.isPrecedenceDecision){this.precedenceDfa=!0;const e=new zt(null,new Vt);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}}getPrecedenceStartState(e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return e<0||e>=this.s0.edges.length?null:this.s0.edges[e]||null}setPrecedenceStartState(e,t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";e<0||(this.s0.edges[e]=t)}setPrecedenceDfa(e){if(this.precedenceDfa!==e){if(this._states=new p,e){const e=new zt(null,new Vt);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}else this.s0=null;this.precedenceDfa=e}}sortedStates(){return this._states.values().sort(function(e,t){return e.stateNumber-t.stateNumber})}toString(e,t){return e=e||null,t=t||null,null===this.s0?"":new oe(this,e,t).toString()}toLexerString(){return null===this.s0?"":new ae(this).toString()}get states(){return this._states}}const he={DFA:le,DFASerializer:oe,LexerDFASerializer:ae,PredPrediction:Jt},ce={PredictionContext:H},ue={Interval:E,IntervalSet:S};class de{visitTerminal(e){}visitErrorNode(e){}enterEveryRule(e){}exitEveryRule(e){}}class pe{visit(e){return Array.isArray(e)?e.map(function(e){return e.accept(this)},this):e.accept(this)}visitChildren(e){return e.children?this.visit(e.children):null}visitTerminal(e){}visitErrorNode(e){}}class ge{walk(e,t){if(t instanceof F||void 0!==t.isErrorNode&&t.isErrorNode())e.visitErrorNode(t);else if(t instanceof b)e.visitTerminal(t);else{this.enterRule(e,t);for(let r=0;r<t.getChildCount();r++){const n=t.getChild(r);this.walk(e,n)}this.exitRule(e,t)}}enterRule(e,t){const r=t.ruleContext;e.enterEveryRule(r),r.enterRule(e)}exitRule(e,t){const r=t.ruleContext;r.exitRule(e),e.exitEveryRule(r)}}ge.DEFAULT=new ge;const fe={Trees:M,RuleNode:P,ErrorNode:F,TerminalNode:b,ParseTreeListener:de,ParseTreeVisitor:pe,ParseTreeWalker:ge};class xe extends Dt{constructor(e){super({message:"",recognizer:e,input:e.getInputStream(),ctx:e._ctx}),this.offendingToken=e.getCurrentToken()}}class _e extends Dt{constructor(e,t,r){super({message:Te(t,r||null),recognizer:e,input:e.getInputStream(),ctx:e._ctx});const n=e._interp.atn.states[e.state].transitions[0];n instanceof gt?(this.ruleIndex=n.ruleIndex,this.predicateIndex=n.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=t,this.offendingToken=e.getCurrentToken()}}function Te(e,t){return null!==t?t:"failed predicate: {"+e+"}?"}class me extends vt{constructor(e){super(),e=e||!0,this.exactOnly=e}reportAmbiguity(e,t,r,n,i,s,a){if(this.exactOnly&&!i)return;const o="reportAmbiguity d="+this.getDecisionDescription(e,t)+": ambigAlts="+this.getConflictingAlts(s,a)+", input='"+e.getTokenStream().getText(new E(r,n))+"'";e.notifyErrorListeners(o)}reportAttemptingFullContext(e,t,r,n,i,s){const a="reportAttemptingFullContext d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new E(r,n))+"'";e.notifyErrorListeners(a)}reportContextSensitivity(e,t,r,n,i,s){const a="reportContextSensitivity d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new E(r,n))+"'";e.notifyErrorListeners(a)}getDecisionDescription(e,t){const r=t.decision,n=t.atnStartState.ruleIndex,i=e.ruleNames;if(n<0||n>=i.length)return""+r;const s=i[n]||null;return null===s||0===s.length?""+r:`${r} (${s})`}getConflictingAlts(e,t){if(null!==e)return e;const r=new G;for(let e=0;e<t.items.length;e++)r.set(t.items[e].alt);return`{${r.values().join(", ")}}`}}class Ee extends Error{constructor(){super(),Error.captureStackTrace(this,Ee)}}class Se{reset(e){}recoverInline(e){}recover(e,t){}sync(e){}inErrorRecoveryMode(e){}reportError(e){}}class Ce extends Se{constructor(){super(),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this.nextTokensContext=null,this.nextTokenState=0}reset(e){this.endErrorCondition(e)}beginErrorCondition(e){this.errorRecoveryMode=!0}inErrorRecoveryMode(e){return this.errorRecoveryMode}endErrorCondition(e){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}reportMatch(e){this.endErrorCondition(e)}reportError(e,t){this.inErrorRecoveryMode(e)||(this.beginErrorCondition(e),t instanceof ee?this.reportNoViableAlternative(e,t):t instanceof xe?this.reportInputMismatch(e,t):t instanceof _e?this.reportFailedPredicate(e,t):(console.log("unknown recognition error type: "+t.constructor.name),console.log(t.stack),e.notifyErrorListeners(t.getOffendingToken(),t.getMessage(),t)))}recover(e,t){this.lastErrorIndex===e.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(e.state)>=0&&e.consume(),this.lastErrorIndex=e._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(e.state);const r=this.getErrorRecoverySet(e);this.consumeUntil(e,r)}sync(e){if(this.inErrorRecoveryMode(e))return;const t=e._interp.atn.states[e.state],r=e.getTokenStream().LA(1),n=e.atn.nextTokens(t);if(n.contains(r))return this.nextTokensContext=null,void(this.nextTokenState=C.INVALID_STATE_NUMBER);if(n.contains(i.EPSILON))null===this.nextTokensContext&&(this.nextTokensContext=e._ctx,this.nextTokensState=e._stateNumber);else switch(t.stateType){case C.BLOCK_START:case C.STAR_BLOCK_START:case C.PLUS_BLOCK_START:case C.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(e))return;throw new xe(e);case C.PLUS_LOOP_BACK:case C.STAR_LOOP_BACK:{this.reportUnwantedToken(e);const t=new S;t.addSet(e.getExpectedTokens());const r=t.addSet(this.getErrorRecoverySet(e));this.consumeUntil(e,r)}}}reportNoViableAlternative(e,t){const r=e.getTokenStream();let n;n=null!==r?t.startToken.type===i.EOF?"<EOF>":r.getText(new E(t.startToken.tokenIndex,t.offendingToken.tokenIndex)):"<unknown input>";const s="no viable alternative at input "+this.escapeWSAndQuote(n);e.notifyErrorListeners(s,t.offendingToken,t)}reportInputMismatch(e,t){const r="mismatched input "+this.getTokenErrorDisplay(t.offendingToken)+" expecting "+t.getExpectedTokens().toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(r,t.offendingToken,t)}reportFailedPredicate(e,t){const r="rule "+e.ruleNames[e._ctx.ruleIndex]+" "+t.message;e.notifyErrorListeners(r,t.offendingToken,t)}reportUnwantedToken(e){if(this.inErrorRecoveryMode(e))return;this.beginErrorCondition(e);const t=e.getCurrentToken(),r="extraneous input "+this.getTokenErrorDisplay(t)+" expecting "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(r,t,null)}reportMissingToken(e){if(this.inErrorRecoveryMode(e))return;this.beginErrorCondition(e);const t=e.getCurrentToken(),r="missing "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames)+" at "+this.getTokenErrorDisplay(t);e.notifyErrorListeners(r,t,null)}recoverInline(e){const t=this.singleTokenDeletion(e);if(null!==t)return e.consume(),t;if(this.singleTokenInsertion(e))return this.getMissingSymbol(e);throw new xe(e)}singleTokenInsertion(e){const t=e.getTokenStream().LA(1),r=e._interp.atn,n=r.states[e.state].transitions[0].target;return!!r.nextTokens(n,e._ctx).contains(t)&&(this.reportMissingToken(e),!0)}singleTokenDeletion(e){const t=e.getTokenStream().LA(2);if(this.getExpectedTokens(e).contains(t)){this.reportUnwantedToken(e),e.consume();const t=e.getCurrentToken();return this.reportMatch(e),t}return null}getMissingSymbol(e){const t=e.getCurrentToken(),r=this.getExpectedTokens(e).first();let n;n=r===i.EOF?"<missing EOF>":"<missing "+e.literalNames[r]+">";let s=t;const a=e.getTokenStream().LT(-1);return s.type===i.EOF&&null!==a&&(s=a),e.getTokenFactory().create(s.source,r,n,i.DEFAULT_CHANNEL,-1,-1,s.line,s.column)}getExpectedTokens(e){return e.getExpectedTokens()}getTokenErrorDisplay(e){if(null===e)return"<no token>";let t=e.text;return null===t&&(t=e.type===i.EOF?"<EOF>":"<"+e.type+">"),this.escapeWSAndQuote(t)}escapeWSAndQuote(e){return"'"+(e=(e=(e=e.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}getErrorRecoverySet(e){const t=e._interp.atn;let r=e._ctx;const n=new S;for(;null!==r&&r.invokingState>=0;){const e=t.states[r.invokingState].transitions[0],i=t.nextTokens(e.followState);n.addSet(i),r=r.parentCtx}return n.removeOne(i.EPSILON),n}consumeUntil(e,t){let r=e.getTokenStream().LA(1);for(;r!==i.EOF&&!t.contains(r);)e.consume(),r=e.getTokenStream().LA(1)}}class Ae extends Ce{constructor(){super()}recover(e,t){let r=e._ctx;for(;null!==r;)r.exception=t,r=r.parentCtx;throw new Ee(t)}recoverInline(e){this.recover(e,new xe(e))}sync(e){}}const Ne={RecognitionException:Dt,NoViableAltException:ee,LexerNoViableAltException:Mt,InputMismatchException:xe,FailedPredicateException:_e,DiagnosticErrorListener:me,BailErrorStrategy:Ae,DefaultErrorStrategy:Ce,ErrorListener:vt};class ye{constructor(e,t){if(this.name="<empty>",this.strdata=e,this.decodeToUnicodeCodePoints=t||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(let e=0;e<this.strdata.length;){const t=this.strdata.codePointAt(e);this.data.push(t),e+=t<=65535?1:2}else{this.data=new Array(this.strdata.length);for(let e=0;e<this.strdata.length;e++)this.data[e]=this.strdata.charCodeAt(e)}this._size=this.data.length}reset(){this._index=0}consume(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}LA(e){if(0===e)return 0;e<0&&(e+=1);const t=this._index+e-1;return t<0||t>=this._size?i.EOF:this.data[t]}LT(e){return this.LA(e)}mark(){return-1}release(e){}seek(e){e<=this._index?this._index=e:this._index=Math.min(e,this._size)}getText(e,t){if(t>=this._size&&(t=this._size-1),e>=this._size)return"";if(this.decodeToUnicodeCodePoints){let r="";for(let n=e;n<=t;n++)r+=String.fromCodePoint(this.data[n]);return r}return this.strdata.slice(e,t+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}class Le extends ye{constructor(e,t){super(e,t)}}var Ie=s(763);const ke="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;class ve extends Le{static fromPath(e,t,r){if(!ke)throw new Error("FileStream is only available when running in Node!");Ie.readFile(e,t,function(e,t){let n=null;null!==t&&(n=new ye(t,!0)),r(e,n)})}constructor(e,t,r){if(!ke)throw new Error("FileStream is only available when running in Node!");super(Ie.readFileSync(e,t||"utf-8"),r),this.fileName=e}}const we={fromString:function(e){return new ye(e,!0)},fromBlob:function(e,t,r,n){const i=new window.FileReader;i.onload=function(e){const t=new ye(e.target.result,!0);r(t)},i.onerror=n,i.readAsText(e,t)},fromBuffer:function(e,t){return new ye(e.toString(t),!0)},fromPath:function(e,t,r){ve.fromPath(e,t,r)},fromPathSync:function(e,t){return new ve(e,t)}},Re={arrayToString:d,stringToCharArray:function(e){let t=new Uint16Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}};class Oe{}class Pe extends Oe{constructor(e){super(),this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(e){}reset(){this.seek(0)}seek(e){this.lazyInit(),this.index=this.adjustSeekIndex(e)}get size(){return this.tokens.length}get(e){return this.lazyInit(),this.tokens[e]}consume(){let e=!1;if(e=this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length),!e&&this.LA(1)===i.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}sync(e){const t=e-this.tokens.length+1;return!(t>0)||this.fetch(t)>=t}fetch(e){if(this.fetchedEOF)return 0;for(let t=0;t<e;t++){const e=this.tokenSource.nextToken();if(e.tokenIndex=this.tokens.length,this.tokens.push(e),e.type===i.EOF)return this.fetchedEOF=!0,t+1}return e}getTokens(e,t,r){if(void 0===r&&(r=null),e<0||t<0)return null;this.lazyInit();const n=[];t>=this.tokens.length&&(t=this.tokens.length-1);for(let s=e;s<t;s++){const e=this.tokens[s];if(e.type===i.EOF)break;(null===r||r.contains(e.type))&&n.push(e)}return n}LA(e){return this.LT(e).type}LB(e){return this.index-e<0?null:this.tokens[this.index-e]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);const t=this.index+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]}adjustSeekIndex(e){return e}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(e){this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(e,t){if(this.sync(e),e>=this.tokens.length)return-1;let r=this.tokens[e];for(;r.channel!==t;){if(r.type===i.EOF)return-1;e+=1,this.sync(e),r=this.tokens[e]}return e}previousTokenOnChannel(e,t){for(;e>=0&&this.tokens[e].channel!==t;)e-=1;return e}getHiddenTokensToRight(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const r=this.nextTokenOnChannel(e+1,Ut.DEFAULT_TOKEN_CHANNEL),n=e+1,i=-1===r?this.tokens.length-1:r;return this.filterForChannel(n,i,t)}getHiddenTokensToLeft(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const r=this.previousTokenOnChannel(e-1,Ut.DEFAULT_TOKEN_CHANNEL);if(r===e-1)return null;const n=r+1,i=e-1;return this.filterForChannel(n,i,t)}filterForChannel(e,t,r){const n=[];for(let i=e;i<t+1;i++){const e=this.tokens[i];-1===r?e.channel!==Ut.DEFAULT_TOKEN_CHANNEL&&n.push(e):e.channel===r&&n.push(e)}return 0===n.length?null:n}getSourceName(){return this.tokenSource.getSourceName()}getText(e){this.lazyInit(),this.fill(),e||(e=new E(0,this.tokens.length-1));let t=e.start;t instanceof i&&(t=t.tokenIndex);let r=e.stop;if(r instanceof i&&(r=r.tokenIndex),null===t||null===r||t<0||r<0)return"";r>=this.tokens.length&&(r=this.tokens.length-1);let n="";for(let e=t;e<r+1;e++){const t=this.tokens[e];if(t.type===i.EOF)break;n+=t.text}return n}fill(){for(this.lazyInit();1e3===this.fetch(1e3););}}Object.defineProperty(Pe,"size",{get:function(){return this.tokens.length}});class be extends Pe{constructor(e,t){super(e),this.channel=void 0===t?i.DEFAULT_CHANNEL:t}adjustSeekIndex(e){return this.nextTokenOnChannel(e,this.channel)}LB(e){if(0===e||this.index-e<0)return null;let t=this.index,r=1;for(;r<=e;)t=this.previousTokenOnChannel(t-1,this.channel),r+=1;return t<0?null:this.tokens[t]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);let t=this.index,r=1;for(;r<e;)this.sync(t+1)&&(t=this.nextTokenOnChannel(t+1,this.channel)),r+=1;return this.tokens[t]}getNumberOfOnChannelTokens(){let e=0;this.fill();for(let t=0;t<this.tokens.length;t++){const r=this.tokens[t];if(r.channel===this.channel&&(e+=1),r.type===i.EOF)break}return e}}class Fe extends de{constructor(e){super(),this.parser=e}enterEveryRule(e){console.log("enter "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}visitTerminal(e){console.log("consume "+e.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}exitEveryRule(e){console.log("exit "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}class De extends Ot{constructor(e){super(),this._input=null,this._errHandler=new Ce,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(e)}reset(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()}match(e){let t=this.getCurrentToken();return t.type===e?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t}matchWildcard(){let e=this.getCurrentToken();return e.type>0?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e}getParseListeners(){return this._parseListeners||[]}addParseListener(e){if(null===e)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(e)}removeParseListener(e){if(null!==this._parseListeners){const t=this._parseListeners.indexOf(e);t>=0&&this._parseListeners.splice(t,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.forEach(function(t){t.enterEveryRule(e),e.enterRule(t)})}}triggerExitRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.slice(0).reverse().forEach(function(t){e.exitRule(t),t.exitEveryRule(e)})}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(e){this._input.tokenSource._factory=e}getATNWithBypassAlts(){const e=this.getSerializedATN();if(null===e)throw"The current parser does not support an ATN with bypass alternatives.";let t=this.bypassAltsAtnCache[e];if(null===t){const r=new _t;r.generateRuleBypassTransitions=!0,t=new kt(r).deserialize(e),this.bypassAltsAtnCache[e]=t}return t}getInputStream(){return this.getTokenStream()}setInputStream(e){this.setTokenStream(e)}getTokenStream(){return this._input}setTokenStream(e){this._input=null,this.reset(),this._input=e}get syntaxErrorsCount(){return this._syntaxErrors}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(e,t,r){r=r||null,null===(t=t||null)&&(t=this.getCurrentToken()),this._syntaxErrors+=1;const n=t.line,i=t.column;this.getErrorListener().syntaxError(this,t,n,i,e,r)}consume(){const e=this.getCurrentToken();e.type!==i.EOF&&this.getInputStream().consume();const t=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||t){let r;r=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(e):this._ctx.addTokenNode(e),r.invokingState=this.state,t&&this._parseListeners.forEach(function(e){r instanceof F||void 0!==r.isErrorNode&&r.isErrorNode()?e.visitErrorNode(r):r instanceof b&&e.visitTerminal(r)})}return e}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(e,t,r){this.state=t,this._ctx=e,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(e,t){e.setAltNumber(t),this.buildParseTrees&&this._ctx!==e&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(e)),this._ctx=e}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(e,t,r,n){this.state=t,this._precedenceStack.push(n),this._ctx=e,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(e,t,r){const n=this._ctx;n.parentCtx=e,n.invokingState=t,n.stop=this._input.LT(-1),this._ctx=e,this._ctx.start=n.start,this.buildParseTrees&&this._ctx.addChild(n),this.triggerEnterRuleEvent()}unrollRecursionContexts(e){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const t=this._ctx,r=this.getParseListeners();if(null!==r&&r.length>0)for(;this._ctx!==e;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=e;t.parentCtx=e,this.buildParseTrees&&null!==e&&e.addChild(t)}getInvokingContext(e){let t=this._ctx;for(;null!==t;){if(t.ruleIndex===e)return t;t=t.parentCtx}return null}precpred(e,t){return t>=this._precedenceStack[this._precedenceStack.length-1]}inContext(e){return!1}isExpectedToken(e){const t=this._interp.atn;let r=this._ctx;const n=t.states[this.state];let s=t.nextTokens(n);if(s.contains(e))return!0;if(!s.contains(i.EPSILON))return!1;for(;null!==r&&r.invokingState>=0&&s.contains(i.EPSILON);){const n=t.states[r.invokingState].transitions[0];if(s=t.nextTokens(n.followState),s.contains(e))return!0;r=r.parentCtx}return!(!s.contains(i.EPSILON)||e!==i.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const e=this._interp.atn,t=e.states[this.state];return e.nextTokens(t)}getRuleIndex(e){const t=this.getRuleIndexMap()[e];return null!==t?t:-1}getRuleInvocationStack(e){null===(e=e||null)&&(e=this._ctx);const t=[];for(;null!==e;){const r=e.ruleIndex;r<0?t.push("n/a"):t.push(this.ruleNames[r]),e=e.parentCtx}return t}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let e=!1;for(let t=0;t<this._interp.decisionToDFA.length;t++){const r=this._interp.decisionToDFA[t];r.states.length>0&&(e&&console.log(),this.printer.println("Decision "+r.decision+":"),this.printer.print(r.toString(this.literalNames,this.symbolicNames)),e=!0)}}getSourceName(){return this._input.getSourceName()}setTrace(e){e?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new Fe(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}De.bypassAltsAtnCache={};class Me extends b{constructor(e){super(),this.parentCtx=null,this.symbol=e}getChild(e){return null}getSymbol(){return this.symbol}getParent(){return this.parentCtx}getPayload(){return this.symbol}getSourceInterval(){if(null===this.symbol)return E.INVALID_INTERVAL;const e=this.symbol.tokenIndex;return new E(e,e)}getChildCount(){return 0}accept(e){return e.visitTerminal(this)}getText(){return this.symbol.text}toString(){return this.symbol.type===i.EOF?"<EOF>":this.symbol.text}}class Ue extends Me{constructor(e){super(e)}isErrorNode(){return!0}accept(e){return e.visitErrorNode(this)}}class He extends U{constructor(e,t){super(e,t),this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(e){this.parentCtx=e.parentCtx,this.invokingState=e.invokingState,this.children=null,this.start=e.start,this.stop=e.stop,e.children&&(this.children=[],e.children.map(function(e){e instanceof Ue&&(this.children.push(e),e.parentCtx=this)},this))}enterRule(e){}exitRule(e){}addChild(e){return null===this.children&&(this.children=[]),this.children.push(e),e}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(e){const t=new Me(e);return this.addChild(t),t.parentCtx=this,t}addErrorNode(e){const t=new Ue(e);return this.addChild(t),t.parentCtx=this,t}getChild(e,t){if(t=t||null,null===this.children||e<0||e>=this.children.length)return null;if(null===t)return this.children[e];for(let r=0;r<this.children.length;r++){const n=this.children[r];if(n instanceof t){if(0===e)return n;e-=1}}return null}getToken(e,t){if(null===this.children||t<0||t>=this.children.length)return null;for(let r=0;r<this.children.length;r++){const n=this.children[r];if(n instanceof b&&n.symbol.type===e){if(0===t)return n;t-=1}}return null}getTokens(e){if(null===this.children)return[];{const t=[];for(let r=0;r<this.children.length;r++){const n=this.children[r];n instanceof b&&n.symbol.type===e&&t.push(n)}return t}}getTypedRuleContext(e,t){return this.getChild(t,e)}getTypedRuleContexts(e){if(null===this.children)return[];{const t=[];for(let r=0;r<this.children.length;r++){const n=this.children[r];n instanceof e&&t.push(n)}return t}}getChildCount(){return null===this.children?0:this.children.length}getSourceInterval(){return null===this.start||null===this.stop?E.INVALID_INTERVAL:new E(this.start.tokenIndex,this.stop.tokenIndex)}}U.EMPTY=new He;class Be{static DEFAULT_PROGRAM_NAME="default";constructor(e){this.tokens=e,this.programs=new Map}getTokenStream(){return this.tokens}insertAfter(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;r="number"==typeof e?e:e.tokenIndex;let i=this.getProgram(n),s=new Ye(this.tokens,r,i.length,t);i.push(s)}insertBefore(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;r="number"==typeof e?e:e.tokenIndex;const i=this.getProgram(n),s=new ze(this.tokens,r,i.length,t);i.push(s)}replaceSingle(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;this.replace(e,e,t,r)}replace(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Be.DEFAULT_PROGRAM_NAME;if("number"!=typeof e&&(e=e.tokenIndex),"number"!=typeof t&&(t=t.tokenIndex),e>t||e<0||t<0||t>=this.tokens.size)throw new RangeError(`replace: range invalid: ${e}..${t}(size=${this.tokens.size})`);let i=this.getProgram(n),s=new qe(this.tokens,e,t,i.length,r);i.push(s)}delete(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;void 0===t&&(t=e),this.replace(e,t,null,r)}getProgram(e){let t=this.programs.get(e);return null==t&&(t=this.initializeProgram(e)),t}initializeProgram(e){const t=[];return this.programs.set(e,t),t}getText(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be.DEFAULT_PROGRAM_NAME;t=e instanceof E?e:new E(0,this.tokens.size-1),"string"==typeof e&&(r=e);const n=this.programs.get(r);let s=t.start,a=t.stop;if(a>this.tokens.size-1&&(a=this.tokens.size-1),s<0&&(s=0),null==n||0===n.length)return this.tokens.getText(new E(s,a));let o=[],l=this.reduceToSingleOperationPerIndex(n),c=s;for(;c<=a&&c<this.tokens.size;){let e=l.get(c);l.delete(c);let t=this.tokens.get(c);null==e?(t.type!==i.EOF&&o.push(String(t.text)),c++):c=e.execute(o)}if(a===this.tokens.size-1)for(const e of l.values())e.index>=this.tokens.size-1&&o.push(e.text.toString());return o.join("")}reduceToSingleOperationPerIndex(e){for(let t=0;t<e.length;t++){let r=e[t];if(null==r)continue;if(!(r instanceof qe))continue;let n=r,i=this.getKindOfOps(e,ze,t);for(let t of i)t.index===n.index?(e[t.instructionIndex]=void 0,n.text=t.text.toString()+(null!=n.text?n.text.toString():"")):t.index>n.index&&t.index<=n.lastIndex&&(e[t.instructionIndex]=void 0);let s=this.getKindOfOps(e,qe,t);for(let t of s){if(t.index>=n.index&&t.lastIndex<=n.lastIndex){e[t.instructionIndex]=void 0;continue}let r=t.lastIndex<n.index||t.index>n.lastIndex;if(null!=t.text||null!=n.text||r){if(!r)throw new Error(`replace op boundaries of ${n} overlap with previous ${t}`)}else e[t.instructionIndex]=void 0,n.index=Math.min(t.index,n.index),n.lastIndex=Math.max(t.lastIndex,n.lastIndex)}}for(let t=0;t<e.length;t++){let r=e[t];if(null==r)continue;if(!(r instanceof ze))continue;let n=r,i=this.getKindOfOps(e,ze,t);for(let t of i)t.index===n.index&&(t instanceof Ye?(n.text=this.catOpText(t.text,n.text),e[t.instructionIndex]=void 0):t instanceof ze&&(n.text=this.catOpText(n.text,t.text),e[t.instructionIndex]=void 0));let s=this.getKindOfOps(e,qe,t);for(let r of s)if(n.index!==r.index){if(n.index>=r.index&&n.index<=r.lastIndex)throw new Error(`insert op ${n} within boundaries of previous ${r}`)}else r.text=this.catOpText(n.text,r.text),e[t]=void 0}let t=new Map;for(let r of e)if(null!=r){if(null!=t.get(r.index))throw new Error("should only be one op per index");t.set(r.index,r)}return t}catOpText(e,t){let r="",n="";return null!=e&&(r=e.toString()),null!=t&&(n=t.toString()),r+n}getKindOfOps(e,t,r){return e.slice(0,r).filter(e=>e&&e instanceof t)}}class Ve{constructor(e,t,r,n){this.tokens=e,this.instructionIndex=r,this.index=t,this.text=void 0===n?"":n}toString(){let e=this.constructor.name;const t=e.indexOf("$");return e=e.substring(t+1,e.length),"<"+e+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}class ze extends Ve{constructor(e,t,r,n){super(e,t,r,n)}execute(e){return this.text&&e.push(this.text.toString()),this.tokens.get(this.index).type!==i.EOF&&e.push(String(this.tokens.get(this.index).text)),this.index+1}}class Ye extends ze{constructor(e,t,r,n){super(e,t+1,r,n)}}class qe extends Ve{constructor(e,t,r,n,i){super(e,t,n,i),this.lastIndex=r}execute(e){return this.text&&e.push(this.text.toString()),this.lastIndex+1}toString(){return null==this.text?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}const Ke={atn:re,dfa:he,context:ce,misc:ue,tree:fe,error:Ne,Token:i,CommonToken:Pt,CharStreams:we,CharStream:ye,InputStream:Le,CommonTokenStream:be,Lexer:Ut,Parser:De,ParserRuleContext:He,Interval:E,IntervalSet:S,LL1Analyzer:$,Utils:Re,TokenStreamRewriter:Be};var We=n.jB,Ge=n.pG,$e=n.zW,je=n.Ay;const Xe=(new je.atn.ATNDeserializer).deserialize([4,0,34,165,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,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,3,1,3,1,4,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,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,14,1,15,1,15,1,16,1,16,1,17,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,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,30,4,30,142,8,30,11,30,12,30,143,1,30,1,30,1,31,1,31,1,31,1,31,5,31,152,8,31,10,31,12,31,155,9,31,1,31,1,31,1,32,1,32,1,33,4,33,162,8,33,11,33,12,33,163,0,0,34,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,1,0,3,2,0,9,9,32,32,2,0,10,10,13,13,7,0,9,10,13,13,32,32,40,41,44,44,91,91,93,93,167,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,1,69,1,0,0,0,3,71,1,0,0,0,5,74,1,0,0,0,7,76,1,0,0,0,9,78,1,0,0,0,11,81,1,0,0,0,13,83,1,0,0,0,15,85,1,0,0,0,17,87,1,0,0,0,19,89,1,0,0,0,21,91,1,0,0,0,23,93,1,0,0,0,25,95,1,0,0,0,27,97,1,0,0,0,29,99,1,0,0,0,31,102,1,0,0,0,33,104,1,0,0,0,35,106,1,0,0,0,37,109,1,0,0,0,39,112,1,0,0,0,41,114,1,0,0,0,43,116,1,0,0,0,45,119,1,0,0,0,47,122,1,0,0,0,49,125,1,0,0,0,51,128,1,0,0,0,53,130,1,0,0,0,55,132,1,0,0,0,57,135,1,0,0,0,59,138,1,0,0,0,61,141,1,0,0,0,63,147,1,0,0,0,65,158,1,0,0,0,67,161,1,0,0,0,69,70,5,44,0,0,70,2,1,0,0,0,71,72,5,45,0,0,72,73,5,62,0,0,73,4,1,0,0,0,74,75,5,40,0,0,75,6,1,0,0,0,76,77,5,41,0,0,77,8,1,0,0,0,78,79,5,58,0,0,79,80,5,58,0,0,80,10,1,0,0,0,81,82,5,46,0,0,82,12,1,0,0,0,83,84,5,91,0,0,84,14,1,0,0,0,85,86,5,93,0,0,86,16,1,0,0,0,87,88,5,126,0,0,88,18,1,0,0,0,89,90,5,33,0,0,90,20,1,0,0,0,91,92,5,45,0,0,92,22,1,0,0,0,93,94,5,43,0,0,94,24,1,0,0,0,95,96,5,38,0,0,96,26,1,0,0,0,97,98,5,42,0,0,98,28,1,0,0,0,99,100,5,46,0,0,100,101,5,42,0,0,101,30,1,0,0,0,102,103,5,47,0,0,103,32,1,0,0,0,104,105,5,37,0,0,105,34,1,0,0,0,106,107,5,60,0,0,107,108,5,60,0,0,108,36,1,0,0,0,109,110,5,62,0,0,110,111,5,62,0,0,111,38,1,0,0,0,112,113,5,60,0,0,113,40,1,0,0,0,114,115,5,62,0,0,115,42,1,0,0,0,116,117,5,60,0,0,117,118,5,61,0,0,118,44,1,0,0,0,119,120,5,62,0,0,120,121,5,61,0,0,121,46,1,0,0,0,122,123,5,61,0,0,123,124,5,61,0,0,124,48,1,0,0,0,125,126,5,33,0,0,126,127,5,61,0,0,127,50,1,0,0,0,128,129,5,94,0,0,129,52,1,0,0,0,130,131,5,124,0,0,131,54,1,0,0,0,132,133,5,38,0,0,133,134,5,38,0,0,134,56,1,0,0,0,135,136,5,124,0,0,136,137,5,124,0,0,137,58,1,0,0,0,138,139,5,61,0,0,139,60,1,0,0,0,140,142,7,0,0,0,141,140,1,0,0,0,142,143,1,0,0,0,143,141,1,0,0,0,143,144,1,0,0,0,144,145,1,0,0,0,145,146,6,30,0,0,146,62,1,0,0,0,147,148,5,47,0,0,148,149,5,47,0,0,149,153,1,0,0,0,150,152,8,1,0,0,151,150,1,0,0,0,152,155,1,0,0,0,153,151,1,0,0,0,153,154,1,0,0,0,154,156,1,0,0,0,155,153,1,0,0,0,156,157,6,31,0,0,157,64,1,0,0,0,158,159,7,1,0,0,159,66,1,0,0,0,160,162,8,2,0,0,161,160,1,0,0,0,162,163,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,68,1,0,0,0,4,0,143,153,163,1,6,0,0]),Je=Xe.decisionToState.map((e,t)=>new je.dfa.DFA(e,t));class Qe extends je.Lexer{static grammarFileName="Dsp.g4";static channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"];static modeNames=["DEFAULT_MODE"];static literalNames=[null,"','","'->'","'('","')'","'::'","'.'","'['","']'","'~'","'!'","'-'","'+'","'&'","'*'","'.*'","'/'","'%'","'<<'","'>>'","'<'","'>'","'<='","'>='","'=='","'!='","'^'","'|'","'&&'","'||'","'='"];static 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,"WHITESPACE","COMMENT","NEWLINE","SYMBOL"];static 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","WHITESPACE","COMMENT","NEWLINE","SYMBOL"];constructor(e){super(e),this._interp=new je.atn.LexerATNSimulator(this,Xe,Je,new je.atn.PredictionContextCache)}}Qe.EOF=je.Token.EOF,Qe.T__0=1,Qe.T__1=2,Qe.T__2=3,Qe.T__3=4,Qe.T__4=5,Qe.T__5=6,Qe.T__6=7,Qe.T__7=8,Qe.T__8=9,Qe.T__9=10,Qe.T__10=11,Qe.T__11=12,Qe.T__12=13,Qe.T__13=14,Qe.T__14=15,Qe.T__15=16,Qe.T__16=17,Qe.T__17=18,Qe.T__18=19,Qe.T__19=20,Qe.T__20=21,Qe.T__21=22,Qe.T__22=23,Qe.T__23=24,Qe.T__24=25,Qe.T__25=26,Qe.T__26=27,Qe.T__27=28,Qe.T__28=29,Qe.T__29=30,Qe.WHITESPACE=31,Qe.COMMENT=32,Qe.NEWLINE=33,Qe.SYMBOL=34;class Ze extends je.tree.ParseTreeVisitor{visitRule_pool(e){return this.visitChildren(e)}visitRule(e){return this.visitChildren(e)}visitSymbol(e){return this.visitChildren(e)}visitParentheses(e){return this.visitChildren(e)}visitSubscript(e){return this.visitChildren(e)}visitBinary(e){return this.visitChildren(e)}visitFunction(e){return this.visitChildren(e)}visitUnary(e){return this.visitChildren(e)}}const ts=(new je.atn.ATNDeserializer).deserialize([4,1,34,132,2,0,7,0,2,1,7,1,2,2,7,2,1,0,5,0,8,8,0,10,0,12,0,11,9,0,1,0,1,0,4,0,15,8,0,11,0,12,0,16,1,0,5,0,20,8,0,10,0,12,0,23,9,0,3,0,25,8,0,1,0,5,0,28,8,0,10,0,12,0,31,9,0,1,0,1,0,1,1,1,1,1,1,1,1,5,1,39,8,1,10,1,12,1,42,9,1,3,1,44,8,1,1,1,1,1,3,1,48,8,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,58,8,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,5,2,107,8,2,10,2,12,2,110,9,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,5,2,119,8,2,10,2,12,2,122,9,2,3,2,124,8,2,1,2,5,2,127,8,2,10,2,12,2,130,9,2,1,2,0,1,4,3,0,2,4,0,6,1,0,9,14,2,0,14,14,16,17,1,0,11,12,1,0,18,19,1,0,20,23,1,0,24,25,157,0,9,1,0,0,0,2,47,1,0,0,0,4,57,1,0,0,0,6,8,5,33,0,0,7,6,1,0,0,0,8,11,1,0,0,0,9,7,1,0,0,0,9,10,1,0,0,0,10,24,1,0,0,0,11,9,1,0,0,0,12,21,3,2,1,0,13,15,5,33,0,0,14,13,1,0,0,0,15,16,1,0,0,0,16,14,1,0,0,0,16,17,1,0,0,0,17,18,1,0,0,0,18,20,3,2,1,0,19,14,1,0,0,0,20,23,1,0,0,0,21,19,1,0,0,0,21,22,1,0,0,0,22,25,1,0,0,0,23,21,1,0,0,0,24,12,1,0,0,0,24,25,1,0,0,0,25,29,1,0,0,0,26,28,5,33,0,0,27,26,1,0,0,0,28,31,1,0,0,0,29,27,1,0,0,0,29,30,1,0,0,0,30,32,1,0,0,0,31,29,1,0,0,0,32,33,5,0,0,1,33,1,1,0,0,0,34,48,3,4,2,0,35,40,3,4,2,0,36,37,5,1,0,0,37,39,3,4,2,0,38,36,1,0,0,0,39,42,1,0,0,0,40,38,1,0,0,0,40,41,1,0,0,0,41,44,1,0,0,0,42,40,1,0,0,0,43,35,1,0,0,0,43,44,1,0,0,0,44,45,1,0,0,0,45,46,5,2,0,0,46,48,3,4,2,0,47,34,1,0,0,0,47,43,1,0,0,0,48,3,1,0,0,0,49,50,6,2,-1,0,50,58,5,34,0,0,51,52,5,3,0,0,52,53,3,4,2,0,53,54,5,4,0,0,54,58,1,0,0,0,55,56,7,0,0,0,56,58,3,4,2,13,57,49,1,0,0,0,57,51,1,0,0,0,57,55,1,0,0,0,58,128,1,0,0,0,59,60,10,17,0,0,60,61,5,5,0,0,61,127,3,4,2,18,62,63,10,16,0,0,63,64,5,6,0,0,64,127,3,4,2,17,65,66,10,12,0,0,66,67,5,15,0,0,67,127,3,4,2,13,68,69,10,11,0,0,69,70,7,1,0,0,70,127,3,4,2,12,71,72,10,10,0,0,72,73,7,2,0,0,73,127,3,4,2,11,74,75,10,9,0,0,75,76,7,3,0,0,76,127,3,4,2,10,77,78,10,8,0,0,78,79,7,4,0,0,79,127,3,4,2,9,80,81,10,7,0,0,81,82,7,5,0,0,82,127,3,4,2,8,83,84,10,6,0,0,84,85,5,13,0,0,85,127,3,4,2,7,86,87,10,5,0,0,87,88,5,26,0,0,88,127,3,4,2,6,89,90,10,4,0,0,90,91,5,27,0,0,91,127,3,4,2,5,92,93,10,3,0,0,93,94,5,28,0,0,94,127,3,4,2,4,95,96,10,2,0,0,96,97,5,29,0,0,97,127,3,4,2,3,98,99,10,1,0,0,99,100,5,30,0,0,100,127,3,4,2,2,101,102,10,15,0,0,102,103,5,7,0,0,103,108,3,4,2,0,104,105,5,1,0,0,105,107,3,4,2,0,106,104,1,0,0,0,107,110,1,0,0,0,108,106,1,0,0,0,108,109,1,0,0,0,109,111,1,0,0,0,110,108,1,0,0,0,111,112,5,8,0,0,112,127,1,0,0,0,113,114,10,14,0,0,114,123,5,3,0,0,115,120,3,4,2,0,116,117,5,1,0,0,117,119,3,4,2,0,118,116,1,0,0,0,119,122,1,0,0,0,120,118,1,0,0,0,120,121,1,0,0,0,121,124,1,0,0,0,122,120,1,0,0,0,123,115,1,0,0,0,123,124,1,0,0,0,124,125,1,0,0,0,125,127,5,4,0,0,126,59,1,0,0,0,126,62,1,0,0,0,126,65,1,0,0,0,126,68,1,0,0,0,126,71,1,0,0,0,126,74,1,0,0,0,126,77,1,0,0,0,126,80,1,0,0,0,126,83,1,0,0,0,126,86,1,0,0,0,126,89,1,0,0,0,126,92,1,0,0,0,126,95,1,0,0,0,126,98,1,0,0,0,126,101,1,0,0,0,126,113,1,0,0,0,127,130,1,0,0,0,128,126,1,0,0,0,128,129,1,0,0,0,129,5,1,0,0,0,130,128,1,0,0,0,14,9,16,21,24,29,40,43,47,57,108,120,123,126,128]),es=ts.decisionToState.map((e,t)=>new je.dfa.DFA(e,t)),ss=new je.atn.PredictionContextCache;class ns extends je.Parser{static grammarFileName="Dsp.g4";static literalNames=[null,"','","'->'","'('","')'","'::'","'.'","'['","']'","'~'","'!'","'-'","'+'","'&'","'*'","'.*'","'/'","'%'","'<<'","'>>'","'<'","'>'","'<='","'>='","'=='","'!='","'^'","'|'","'&&'","'||'","'='"];static 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,"WHITESPACE","COMMENT","NEWLINE","SYMBOL"];static ruleNames=["rule_pool","rule","term"];constructor(e){super(e),this._interp=new je.atn.ParserATNSimulator(this,ts,es,ss),this.ruleNames=ns.ruleNames,this.literalNames=ns.literalNames,this.symbolicNames=ns.symbolicNames}sempred(e,t,r){if(2===t)return this.term_sempred(e,r);throw"No predicate with index:"+t}term_sempred(e,t){switch(t){case 0:return this.precpred(this._ctx,17);case 1:return this.precpred(this._ctx,16);case 2:return this.precpred(this._ctx,12);case 3:return this.precpred(this._ctx,11);case 4:return this.precpred(this._ctx,10);case 5:return this.precpred(this._ctx,9);case 6:return this.precpred(this._ctx,8);case 7:return this.precpred(this._ctx,7);case 8:return this.precpred(this._ctx,6);case 9:return this.precpred(this._ctx,5);case 10:return this.precpred(this._ctx,4);case 11:return this.precpred(this._ctx,3);case 12:return this.precpred(this._ctx,2);case 13:return this.precpred(this._ctx,1);case 14:return this.precpred(this._ctx,15);case 15:return this.precpred(this._ctx,14);default:throw"No predicate with index:"+t}}rule_pool(){let e=new is(this,this._ctx,this.state);this.enterRule(e,0,ns.RULE_rule_pool);var t=0;try{this.enterOuterAlt(e,1),this.state=9,this._errHandler.sync(this);for(var r=this._interp.adaptivePredict(this._input,0,this._ctx);2!=r&&r!=je.atn.ATN.INVALID_ALT_NUMBER;)1===r&&(this.state=6,this.match(ns.NEWLINE)),this.state=11,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,0,this._ctx);if(this.state=24,this._errHandler.sync(this),!(-32&(t=this._input.LA(1)))&&1<<t&32268||34===t)for(this.state=12,this.rule_(),this.state=21,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,2,this._ctx);2!=r&&r!=je.atn.ATN.INVALID_ALT_NUMBER;){if(1===r){this.state=14,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=13,this.match(ns.NEWLINE),this.state=16,this._errHandler.sync(this),t=this._input.LA(1)}while(33===t);this.state=18,this.rule_()}this.state=23,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,2,this._ctx)}for(this.state=29,this._errHandler.sync(this),t=this._input.LA(1);33===t;)this.state=26,this.match(ns.NEWLINE),this.state=31,this._errHandler.sync(this),t=this._input.LA(1);this.state=32,this.match(ns.EOF)}catch(t){if(!(t instanceof je.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rule_(){let e=new rs(this,this._ctx,this.state);this.enterRule(e,2,ns.RULE_rule);var t=0;try{switch(this.state=47,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,7,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=34,this.term(0);break;case 2:if(this.enterOuterAlt(e,2),this.state=43,this._errHandler.sync(this),!((t=this._input.LA(1))-3&-32)&&1<<t-3&2147487681)for(this.state=35,this.term(0),this.state=40,this._errHandler.sync(this),t=this._input.LA(1);1===t;)this.state=36,this.match(ns.T__0),this.state=37,this.term(0),this.state=42,this._errHandler.sync(this),t=this._input.LA(1);this.state=45,this.match(ns.T__1),this.state=46,this.term(0)}}catch(t){if(!(t instanceof je.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}term(e){void 0===e&&(e=0);const t=this._ctx,r=this.state;let n=new os(this,this._ctx,r),i=n;this.enterRecursionRule(n,4,ns.RULE_term,e);var s=0;try{switch(this.enterOuterAlt(n,1),this.state=57,this._errHandler.sync(this),this._input.LA(1)){case 34:n=new as(this,n),this._ctx=n,i=n,this.state=50,this.match(ns.SYMBOL);break;case 3:n=new ls(this,n),this._ctx=n,i=n,this.state=51,this.match(ns.T__2),this.state=52,this.term(0),this.state=53,this.match(ns.T__3);break;case 9:case 10:case 11:case 12:case 13:case 14:n=new ds(this,n),this._ctx=n,i=n,this.state=55,-32&(s=this._input.LA(1))||!(1<<s&32256)?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=56,this.term(13);break;default:throw new je.error.NoViableAltException(this)}this._ctx.stop=this._input.LT(-1),this.state=128,this._errHandler.sync(this);for(var a=this._interp.adaptivePredict(this._input,13,this._ctx);2!=a&&a!=je.atn.ATN.INVALID_ALT_NUMBER;){if(1===a)switch(null!==this._parseListeners&&this.triggerExitRuleEvent(),i=n,this.state=126,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,12,this._ctx)){case 1:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=59,!this.precpred(this._ctx,17))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 17)");this.state=60,this.match(ns.T__4),this.state=61,this.term(18);break;case 2:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=62,!this.precpred(this._ctx,16))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 16)");this.state=63,this.match(ns.T__5),this.state=64,this.term(17);break;case 3:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=65,!this.precpred(this._ctx,12))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 12)");this.state=66,this.match(ns.T__14),this.state=67,this.term(13);break;case 4:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=68,!this.precpred(this._ctx,11))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 11)");this.state=69,-32&(s=this._input.LA(1))||!(1<<s&212992)?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=70,this.term(12);break;case 5:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=71,!this.precpred(this._ctx,10))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 10)");this.state=72,11!==(s=this._input.LA(1))&&12!==s?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=73,this.term(11);break;case 6:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=74,!this.precpred(this._ctx,9))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 9)");this.state=75,18!==(s=this._input.LA(1))&&19!==s?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=76,this.term(10);break;case 7:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=77,!this.precpred(this._ctx,8))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 8)");this.state=78,-32&(s=this._input.LA(1))||!(1<<s&15728640)?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=79,this.term(9);break;case 8:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=80,!this.precpred(this._ctx,7))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 7)");this.state=81,24!==(s=this._input.LA(1))&&25!==s?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=82,this.term(8);break;case 9:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=83,!this.precpred(this._ctx,6))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 6)");this.state=84,this.match(ns.T__12),this.state=85,this.term(7);break;case 10:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=86,!this.precpred(this._ctx,5))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 5)");this.state=87,this.match(ns.T__25),this.state=88,this.term(6);break;case 11:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=89,!this.precpred(this._ctx,4))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 4)");this.state=90,this.match(ns.T__26),this.state=91,this.term(5);break;case 12:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=92,!this.precpred(this._ctx,3))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 3)");this.state=93,this.match(ns.T__27),this.state=94,this.term(4);break;case 13:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=95,!this.precpred(this._ctx,2))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 2)");this.state=96,this.match(ns.T__28),this.state=97,this.term(3);break;case 14:if(n=new cs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=98,!this.precpred(this._ctx,1))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 1)");this.state=99,this.match(ns.T__29),this.state=100,this.term(2);break;case 15:if(n=new hs(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=101,!this.precpred(this._ctx,15))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 15)");for(this.state=102,this.match(ns.T__6),this.state=103,this.term(0),this.state=108,this._errHandler.sync(this),s=this._input.LA(1);1===s;)this.state=104,this.match(ns.T__0),this.state=105,this.term(0),this.state=110,this._errHandler.sync(this),s=this._input.LA(1);this.state=111,this.match(ns.T__7);break;case 16:if(n=new us(this,new os(this,t,r)),this.pushNewRecursionContext(n,4,ns.RULE_term),this.state=113,!this.precpred(this._ctx,14))throw new je.error.FailedPredicateException(this,"this.precpred(this._ctx, 14)");if(this.state=114,this.match(ns.T__2),this.state=123,this._errHandler.sync(this),!((s=this._input.LA(1))-3&-32)&&1<<s-3&2147487681)for(this.state=115,this.term(0),this.state=120,this._errHandler.sync(this),s=this._input.LA(1);1===s;)this.state=116,this.match(ns.T__0),this.state=117,this.term(0),this.state=122,this._errHandler.sync(this),s=this._input.LA(1);this.state=125,this.match(ns.T__3)}this.state=130,this._errHandler.sync(this),a=this._interp.adaptivePredict(this._input,13,this._ctx)}}catch(e){if(!(e instanceof je.error.RecognitionException))throw e;n.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.unrollRecursionContexts(t)}return n}}ns.EOF=je.Token.EOF,ns.T__0=1,ns.T__1=2,ns.T__2=3,ns.T__3=4,ns.T__4=5,ns.T__5=6,ns.T__6=7,ns.T__7=8,ns.T__8=9,ns.T__9=10,ns.T__10=11,ns.T__11=12,ns.T__12=13,ns.T__13=14,ns.T__14=15,ns.T__15=16,ns.T__16=17,ns.T__17=18,ns.T__18=19,ns.T__19=20,ns.T__20=21,ns.T__21=22,ns.T__22=23,ns.T__23=24,ns.T__24=25,ns.T__25=26,ns.T__26=27,ns.T__27=28,ns.T__28=29,ns.T__29=30,ns.WHITESPACE=31,ns.COMMENT=32,ns.NEWLINE=33,ns.SYMBOL=34,ns.RULE_rule_pool=0,ns.RULE_rule=1,ns.RULE_term=2;let is=class extends je.ParserRuleContext{constructor(e,t,r){void 0===t&&(t=null),null==r&&(r=-1),super(t,r),this.parser=e,this.ruleIndex=ns.RULE_rule_pool}EOF(){return this.getToken(ns.EOF,0)}NEWLINE=function(e){return void 0===e&&(e=null),null===e?this.getTokens(ns.NEWLINE):this.getToken(ns.NEWLINE,e)};rule_=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(rs):this.getTypedRuleContext(rs,e)};accept(e){return e instanceof Ze?e.visitRule_pool(this):e.visitChildren(this)}},rs=class extends je.ParserRuleContext{constructor(e,t,r){void 0===t&&(t=null),null==r&&(r=-1),super(t,r),this.parser=e,this.ruleIndex=ns.RULE_rule}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(os):this.getTypedRuleContext(os,e)};accept(e){return e instanceof Ze?e.visitRule(this):e.visitChildren(this)}},os=class extends je.ParserRuleContext{constructor(e,t,r){void 0===t&&(t=null),null==r&&(r=-1),super(t,r),this.parser=e,this.ruleIndex=ns.RULE_term}copyFrom(e){super.copyFrom(e)}},as=class extends os{constructor(e,t){super(e),super.copyFrom(t)}SYMBOL(){return this.getToken(ns.SYMBOL,0)}accept(e){return e instanceof Ze?e.visitSymbol(this):e.visitChildren(this)}};ns.SymbolContext=as;class ls extends os{constructor(e,t){super(e),super.copyFrom(t)}term(){return this.getTypedRuleContext(os,0)}accept(e){return e instanceof Ze?e.visitParentheses(this):e.visitChildren(this)}}ns.ParenthesesContext=ls;let hs=class extends os{constructor(e,t){super(e),super.copyFrom(t)}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(os):this.getTypedRuleContext(os,e)};accept(e){return e instanceof Ze?e.visitSubscript(this):e.visitChildren(this)}};ns.SubscriptContext=hs;let cs=class extends os{constructor(e,t){super(e),super.copyFrom(t)}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(os):this.getTypedRuleContext(os,e)};accept(e){return e instanceof Ze?e.visitBinary(this):e.visitChildren(this)}};ns.BinaryContext=cs;let us=class extends os{constructor(e,t){super(e),super.copyFrom(t)}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(os):this.getTypedRuleContext(os,e)};accept(e){return e instanceof Ze?e.visitFunction(this):e.visitChildren(this)}};ns.FunctionContext=us;let ds=class extends os{constructor(e,t){super(e),super.copyFrom(t)}term(){return this.getTypedRuleContext(os,0)}accept(e){return e instanceof Ze?e.visitUnary(this):e.visitChildren(this)}};ns.UnaryContext=ds,ns.Rule_poolContext=is,ns.RuleContext=rs,ns.TermContext=os;const ps=(new je.atn.ATNDeserializer).deserialize([4,0,10,93,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,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,5,5,64,8,5,10,5,12,5,67,9,5,1,6,4,6,70,8,6,11,6,12,6,71,1,6,1,6,1,7,1,7,1,7,1,7,5,7,80,8,7,10,7,12,7,83,9,7,1,7,1,7,1,8,1,8,1,9,4,9,90,8,9,11,9,12,9,91,0,0,10,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,1,0,3,2,0,9,9,32,32,2,0,10,10,13,13,7,0,9,10,13,13,32,32,40,41,44,44,91,91,93,93,96,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,1,21,1,0,0,0,3,32,1,0,0,0,5,34,1,0,0,0,7,44,1,0,0,0,9,51,1,0,0,0,11,59,1,0,0,0,13,69,1,0,0,0,15,75,1,0,0,0,17,86,1,0,0,0,19,89,1,0,0,0,21,22,5,40,0,0,22,23,5,115,0,0,23,24,5,117,0,0,24,25,5,98,0,0,25,26,5,115,0,0,26,27,5,99,0,0,27,28,5,114,0,0,28,29,5,105,0,0,29,30,5,112,0,0,30,31,5,116,0,0,31,2,1,0,0,0,32,33,5,41,0,0,33,4,1,0,0,0,34,35,5,40,0,0,35,36,5,102,0,0,36,37,5,117,0,0,37,38,5,110,0,0,38,39,5,99,0,0,39,40,5,116,0,0,40,41,5,105,0,0,41,42,5,111,0,0,42,43,5,110,0,0,43,6,1,0,0,0,44,45,5,40,0,0,45,46,5,117,0,0,46,47,5,110,0,0,47,48,5,97,0,0,48,49,5,114,0,0,49,50,5,121,0,0,50,8,1,0,0,0,51,52,5,40,0,0,52,53,5,98,0,0,53,54,5,105,0,0,54,55,5,110,0,0,55,56,5,97,0,0,56,57,5,114,0,0,57,58,5,121,0,0,58,10,1,0,0,0,59,60,5,45,0,0,60,61,5,45,0,0,61,65,1,0,0,0,62,64,5,45,0,0,63,62,1,0,0,0,64,67,1,0,0,0,65,63,1,0,0,0,65,66,1,0,0,0,66,12,1,0,0,0,67,65,1,0,0,0,68,70,7,0,0,0,69,68,1,0,0,0,70,71,1,0,0,0,71,69,1,0,0,0,71,72,1,0,0,0,72,73,1,0,0,0,73,74,6,6,0,0,74,14,1,0,0,0,75,76,5,47,0,0,76,77,5,47,0,0,77,81,1,0,0,0,78,80,8,1,0,0,79,78,1,0,0,0,80,83,1,0,0,0,81,79,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,81,1,0,0,0,84,85,6,7,0,0,85,16,1,0,0,0,86,87,7,1,0,0,87,18,1,0,0,0,88,90,8,2,0,0,89,88,1,0,0,0,90,91,1,0,0,0,91,89,1,0,0,0,91,92,1,0,0,0,92,20,1,0,0,0,5,0,65,71,81,91,1,6,0,0]),gs=ps.decisionToState.map((e,t)=>new je.dfa.DFA(e,t));class fs extends je.Lexer{static grammarFileName="Ds.g4";static channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"];static modeNames=["DEFAULT_MODE"];static literalNames=[null,"'(subscript'","')'","'(function'","'(unary'","'(binary'"];static symbolicNames=[null,null,null,null,null,null,"RULE","WHITESPACE","COMMENT","NEWLINE","SYMBOL"];static ruleNames=["T__0","T__1","T__2","T__3","T__4","RULE","WHITESPACE","COMMENT","NEWLINE","SYMBOL"];constructor(e){super(e),this._interp=new je.atn.LexerATNSimulator(this,ps,gs,new je.atn.PredictionContextCache)}}fs.EOF=je.Token.EOF,fs.T__0=1,fs.T__1=2,fs.T__2=3,fs.T__3=4,fs.T__4=5,fs.RULE=6,fs.WHITESPACE=7,fs.COMMENT=8,fs.NEWLINE=9,fs.SYMBOL=10;class xs extends je.tree.ParseTreeVisitor{visitRule_pool(e){return this.visitChildren(e)}visitRule(e){return this.visitChildren(e)}visitSymbol(e){return this.visitChildren(e)}visitSubscript(e){return this.visitChildren(e)}visitFunction(e){return this.visitChildren(e)}visitUnary(e){return this.visitChildren(e)}visitBinary(e){return this.visitChildren(e)}}const _s=(new je.atn.ATNDeserializer).deserialize([4,1,10,80,2,0,7,0,2,1,7,1,2,2,7,2,1,0,5,0,8,8,0,10,0,12,0,11,9,0,1,0,1,0,4,0,15,8,0,11,0,12,0,16,1,0,5,0,20,8,0,10,0,12,0,23,9,0,3,0,25,8,0,1,0,5,0,28,8,0,10,0,12,0,31,9,0,1,0,1,0,1,1,1,1,4,1,37,8,1,11,1,12,1,38,5,1,41,8,1,10,1,12,1,44,9,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,5,2,53,8,2,10,2,12,2,56,9,2,1,2,1,2,1,2,5,2,61,8,2,10,2,12,2,64,9,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,78,8,2,1,2,0,0,3,0,2,4,0,0,89,0,9,1,0,0,0,2,42,1,0,0,0,4,77,1,0,0,0,6,8,5,9,0,0,7,6,1,0,0,0,8,11,1,0,0,0,9,7,1,0,0,0,9,10,1,0,0,0,10,24,1,0,0,0,11,9,1,0,0,0,12,21,3,2,1,0,13,15,5,9,0,0,14,13,1,0,0,0,15,16,1,0,0,0,16,14,1,0,0,0,16,17,1,0,0,0,17,18,1,0,0,0,18,20,3,2,1,0,19,14,1,0,0,0,20,23,1,0,0,0,21,19,1,0,0,0,21,22,1,0,0,0,22,25,1,0,0,0,23,21,1,0,0,0,24,12,1,0,0,0,24,25,1,0,0,0,25,29,1,0,0,0,26,28,5,9,0,0,27,26,1,0,0,0,28,31,1,0,0,0,29,27,1,0,0,0,29,30,1,0,0,0,30,32,1,0,0,0,31,29,1,0,0,0,32,33,5,0,0,1,33,1,1,0,0,0,34,36,3,4,2,0,35,37,5,9,0,0,36,35,1,0,0,0,37,38,1,0,0,0,38,36,1,0,0,0,38,39,1,0,0,0,39,41,1,0,0,0,40,34,1,0,0,0,41,44,1,0,0,0,42,40,1,0,0,0,42,43,1,0,0,0,43,45,1,0,0,0,44,42,1,0,0,0,45,46,5,6,0,0,46,47,5,9,0,0,47,48,3,4,2,0,48,3,1,0,0,0,49,78,5,10,0,0,50,54,5,1,0,0,51,53,3,4,2,0,52,51,1,0,0,0,53,56,1,0,0,0,54,52,1,0,0,0,54,55,1,0,0,0,55,57,1,0,0,0,56,54,1,0,0,0,57,78,5,2,0,0,58,62,5,3,0,0,59,61,3,4,2,0,60,59,1,0,0,0,61,64,1,0,0,0,62,60,1,0,0,0,62,63,1,0,0,0,63,65,1,0,0,0,64,62,1,0,0,0,65,78,5,2,0,0,66,67,5,4,0,0,67,68,5,10,0,0,68,69,3,4,2,0,69,70,5,2,0,0,70,78,1,0,0,0,71,72,5,5,0,0,72,73,5,10,0,0,73,74,3,4,2,0,74,75,3,4,2,0,75,76,5,2,0,0,76,78,1,0,0,0,77,49,1,0,0,0,77,50,1,0,0,0,77,58,1,0,0,0,77,66,1,0,0,0,77,71,1,0,0,0,78,5,1,0,0,0,10,9,16,21,24,29,38,42,54,62,77]),Ts=_s.decisionToState.map((e,t)=>new je.dfa.DFA(e,t)),ms=new je.atn.PredictionContextCache;class Es extends je.Parser{static grammarFileName="Ds.g4";static literalNames=[null,"'(subscript'","')'","'(function'","'(unary'","'(binary'"];static symbolicNames=[null,null,null,null,null,null,"RULE","WHITESPACE","COMMENT","NEWLINE","SYMBOL"];static ruleNames=["rule_pool","rule","term"];constructor(e){super(e),this._interp=new je.atn.ParserATNSimulator(this,_s,Ts,ms),this.ruleNames=Es.ruleNames,this.literalNames=Es.literalNames,this.symbolicNames=Es.symbolicNames}rule_pool(){let e=new Ss(this,this._ctx,this.state);this.enterRule(e,0,Es.RULE_rule_pool);var t=0;try{this.enterOuterAlt(e,1),this.state=9,this._errHandler.sync(this);for(var r=this._interp.adaptivePredict(this._input,0,this._ctx);2!=r&&r!=je.atn.ATN.INVALID_ALT_NUMBER;)1===r&&(this.state=6,this.match(Es.NEWLINE)),this.state=11,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,0,this._ctx);if(this.state=24,this._errHandler.sync(this),!(-32&(t=this._input.LA(1)))&&1<<t&1146)for(this.state=12,this.rule_(),this.state=21,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,2,this._ctx);2!=r&&r!=je.atn.ATN.INVALID_ALT_NUMBER;){if(1===r){this.state=14,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=13,this.match(Es.NEWLINE),this.state=16,this._errHandler.sync(this),t=this._input.LA(1)}while(9===t);this.state=18,this.rule_()}this.state=23,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,2,this._ctx)}for(this.state=29,this._errHandler.sync(this),t=this._input.LA(1);9===t;)this.state=26,this.match(Es.NEWLINE),this.state=31,this._errHandler.sync(this),t=this._input.LA(1);this.state=32,this.match(Es.EOF)}catch(t){if(!(t instanceof je.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rule_(){let e=new Cs(this,this._ctx,this.state);this.enterRule(e,2,Es.RULE_rule);var t=0;try{for(this.enterOuterAlt(e,1),this.state=42,this._errHandler.sync(this),t=this._input.LA(1);!(-32&t)&&1<<t&1082;){this.state=34,this.term(),this.state=36,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=35,this.match(Es.NEWLINE),this.state=38,this._errHandler.sync(this),t=this._input.LA(1)}while(9===t);this.state=44,this._errHandler.sync(this),t=this._input.LA(1)}this.state=45,this.match(Es.RULE),this.state=46,this.match(Es.NEWLINE),this.state=47,this.term()}catch(t){if(!(t instanceof je.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}term(){let e=new As(this,this._ctx,this.state);this.enterRule(e,4,Es.RULE_term);var t=0;try{switch(this.state=77,this._errHandler.sync(this),this._input.LA(1)){case 10:e=new Ns(this,e),this.enterOuterAlt(e,1),this.state=49,this.match(Es.SYMBOL);break;case 1:for(e=new ys(this,e),this.enterOuterAlt(e,2),this.state=50,this.match(Es.T__0),this.state=54,this._errHandler.sync(this),t=this._input.LA(1);!(-32&t)&&1<<t&1082;)this.state=51,this.term(),this.state=56,this._errHandler.sync(this),t=this._input.LA(1);this.state=57,this.match(Es.T__1);break;case 3:for(e=new Ls(this,e),this.enterOuterAlt(e,3),this.state=58,this.match(Es.T__2),this.state=62,this._errHandler.sync(this),t=this._input.LA(1);!(-32&t)&&1<<t&1082;)this.state=59,this.term(),this.state=64,this._errHandler.sync(this),t=this._input.LA(1);this.state=65,this.match(Es.T__1);break;case 4:e=new ks(this,e),this.enterOuterAlt(e,4),this.state=66,this.match(Es.T__3),this.state=67,this.match(Es.SYMBOL),this.state=68,this.term(),this.state=69,this.match(Es.T__1);break;case 5:e=new Is(this,e),this.enterOuterAlt(e,5),this.state=71,this.match(Es.T__4),this.state=72,this.match(Es.SYMBOL),this.state=73,this.term(),this.state=74,this.term(),this.state=75,this.match(Es.T__1);break;default:throw new je.error.NoViableAltException(this)}}catch(t){if(!(t instanceof je.error.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}}Es.EOF=je.Token.EOF,Es.T__0=1,Es.T__1=2,Es.T__2=3,Es.T__3=4,Es.T__4=5,Es.RULE=6,Es.WHITESPACE=7,Es.COMMENT=8,Es.NEWLINE=9,Es.SYMBOL=10,Es.RULE_rule_pool=0,Es.RULE_rule=1,Es.RULE_term=2;class Ss extends je.ParserRuleContext{constructor(e,t,r){void 0===t&&(t=null),null==r&&(r=-1),super(t,r),this.parser=e,this.ruleIndex=Es.RULE_rule_pool}EOF(){return this.getToken(Es.EOF,0)}NEWLINE=function(e){return void 0===e&&(e=null),null===e?this.getTokens(Es.NEWLINE):this.getToken(Es.NEWLINE,e)};rule_=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(Cs):this.getTypedRuleContext(Cs,e)};accept(e){return e instanceof xs?e.visitRule_pool(this):e.visitChildren(this)}}class Cs extends je.ParserRuleContext{constructor(e,t,r){void 0===t&&(t=null),null==r&&(r=-1),super(t,r),this.parser=e,this.ruleIndex=Es.RULE_rule}RULE(){return this.getToken(Es.RULE,0)}NEWLINE=function(e){return void 0===e&&(e=null),null===e?this.getTokens(Es.NEWLINE):this.getToken(Es.NEWLINE,e)};term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(As):this.getTypedRuleContext(As,e)};accept(e){return e instanceof xs?e.visitRule(this):e.visitChildren(this)}}class As extends je.ParserRuleContext{constructor(e,t,r){void 0===t&&(t=null),null==r&&(r=-1),super(t,r),this.parser=e,this.ruleIndex=Es.RULE_term}copyFrom(e){super.copyFrom(e)}}class Ns extends As{constructor(e,t){super(e),super.copyFrom(t)}SYMBOL(){return this.getToken(Es.SYMBOL,0)}accept(e){return e instanceof xs?e.visitSymbol(this):e.visitChildren(this)}}Es.SymbolContext=Ns;class ys extends As{constructor(e,t){super(e),super.copyFrom(t)}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(As):this.getTypedRuleContext(As,e)};accept(e){return e instanceof xs?e.visitSubscript(this):e.visitChildren(this)}}Es.SubscriptContext=ys;class Ls extends As{constructor(e,t){super(e),super.copyFrom(t)}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(As):this.getTypedRuleContext(As,e)};accept(e){return e instanceof xs?e.visitFunction(this):e.visitChildren(this)}}Es.FunctionContext=Ls;class Is extends As{constructor(e,t){super(e),super.copyFrom(t)}SYMBOL(){return this.getToken(Es.SYMBOL,0)}term=function(e){return void 0===e&&(e=null),null===e?this.getTypedRuleContexts(As):this.getTypedRuleContext(As,e)};accept(e){return e instanceof xs?e.visitBinary(this):e.visitChildren(this)}}Es.BinaryContext=Is;class ks extends As{constructor(e,t){super(e),super.copyFrom(t)}SYMBOL(){return this.getToken(Es.SYMBOL,0)}term(){return this.getTypedRuleContext(As,0)}accept(e){return e instanceof xs?e.visitUnary(this):e.visitChildren(this)}}Es.UnaryContext=ks,Es.Rule_poolContext=Ss,Es.RuleContext=Cs,Es.TermContext=As;class vs extends Ge{syntaxError(e,t,r,n,i,s){throw new Error(`line ${r}:${n} ${i}`)}}class ws extends Ze{visitRule_pool(e){return e.rule_().map(e=>this.visit(e)).join("\n\n")}visitRule(e){const t=e.term().map(e=>this.visit(e));if(1===t.length)return`----\n${t[0]}`;{const e=t.pop(),r=Math.max(...t.map(e=>e.length));return t.push("-".repeat(Math.max(r,4))),t.push(e),t.join("\n")}}visitSymbol(e){return e.SYMBOL().getText()}visitParentheses(e){return this.visit(e.term())}visitSubscript(e){return`(subscript ${e.term().map(e=>this.visit(e)).join(" ")})`}visitFunction(e){return`(function ${e.term().map(e=>this.visit(e)).join(" ")})`}visitUnary(e){return`(unary ${e.getChild(0).getText()} ${this.visit(e.term())})`}visitBinary(e){return`(binary ${e.getChild(1).getText()} ${this.visit(e.term(0))} ${this.visit(e.term(1))})`}}class Rs extends xs{visitRule_pool(e){return e.rule_().map(e=>this.visit(e)).join("\n")}visitRule(e){const t=e.term().map(e=>this.visit(e)),r=t.pop();return t.join(", ")+" -> "+r}visitSymbol(e){return e.SYMBOL().getText()}visitSubscript(e){return`${this.visit(e.term(0))}[${e.term().slice(1).map(e=>this.visit(e)).join(", ")}]`}visitFunction(e){return`${this.visit(e.term(0))}(${e.term().slice(1).map(e=>this.visit(e)).join(", ")})`}visitUnary(e){return`(${e.getChild(1).getText()} ${this.visit(e.term())})`}visitBinary(e){return`(${this.visit(e.term(0))} ${e.getChild(1).getText()} ${this.visit(e.term(1))})`}}function Os(e){const t=new $e(e),r=new Qe(t);r.removeErrorListeners(),r.addErrorListener(new vs);const n=new We(r),i=new ns(n);i.removeErrorListeners(),i.addErrorListener(new vs);const s=i.rule_pool();return(new ws).visit(s)}function Ps(e){const t=new $e(e),r=new fs(t);r.removeErrorListeners(),r.addErrorListener(new vs);const n=new We(r),i=new Es(n);i.removeErrorListeners(),i.addErrorListener(new vs);const s=i.rule_pool();return(new Rs).visit(s)}function varint64read(){let e=0,t=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(15&r)<<28,t=(112&r)>>4,!(128&r))return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,!(128&n))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function varint64write(e,t,r){for(let n=0;n<28;n+=7){const i=e>>>n,s=!(i>>>7==0&&0==t),a=255&(s?128|i:i);if(r.push(a),!s)return}const n=e>>>28&15|(7&t)<<4,i=!!(t>>3);if(r.push(255&(i?128|n:n)),i){for(let e=3;e<31;e+=7){const n=t>>>e,i=!(n>>>7==0),s=255&(i?128|n:n);if(r.push(s),!i)return}r.push(t>>>31&1)}}const TWO_PWR_32_DBL=4294967296;function int64FromString(e){const t="-"===e[0];t&&(e=e.slice(1));const r=1e6;let n=0,i=0;function s(t,s){const a=Number(e.slice(t,s));i*=r,n=n*r+a,n>=TWO_PWR_32_DBL&&(i+=n/TWO_PWR_32_DBL|0,n%=TWO_PWR_32_DBL)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?negate(n,i):newBits(n,i)}function int64ToString(e,t){let r=newBits(e,t);const n=2147483648&r.hi;n&&(r=negate(r.lo,r.hi));const i=uInt64ToString(r.lo,r.hi);return n?"-"+i:i}function uInt64ToString(e,t){if(({lo:e,hi:t}=toUnsigned(e,t)),t<=2097151)return String(TWO_PWR_32_DBL*t+e);const r=16777215&(e>>>24|t<<8),n=t>>16&65535;let i=(16777215&e)+6777216*r+6710656*n,s=r+8147497*n,a=2*n;const o=1e7;return i>=o&&(s+=Math.floor(i/o),i%=o),s>=o&&(a+=Math.floor(s/o),s%=o),a.toString()+decimalFrom1e7WithLeadingZeros(s)+decimalFrom1e7WithLeadingZeros(i)}function toUnsigned(e,t){return{lo:e>>>0,hi:t>>>0}}function newBits(e,t){return{lo:0|e,hi:0|t}}function negate(e,t){return t=~t,e?e=1+~e:t+=1,newBits(e,t)}const decimalFrom1e7WithLeadingZeros=e=>{const t=String(e);return"0000000".slice(t.length)+t};function varint32write(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let r=0;r<9;r++)t.push(127&e|128),e>>=7;t.push(1)}}function varint32read(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;128&e&&t<10;t++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const protoInt64=makeInt64Support();function makeInt64Support(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&(!!globalThis.Deno||"object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),n=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const n="bigint"==typeof e?e:BigInt(e);if(n>r||n<t)throw new Error(`invalid int64: ${e}`);return n},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>i||t<n)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,r)=>(e.setInt32(0,t,!0),e.setInt32(4,r,!0),e.getBigInt64(0,!0)),uDec:(t,r)=>(e.setInt32(0,t,!0),e.setInt32(4,r,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),assertInt64String(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),assertUInt64String(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),assertInt64String(e),int64FromString(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),assertUInt64String(e),int64FromString(e)),dec:(e,t)=>int64ToString(e,t),uDec:(e,t)=>uInt64ToString(e,t)}}function assertInt64String(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function assertUInt64String(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}const symbol=Symbol.for("@bufbuild/protobuf/text-encoding");function getTextEncoding(){if(null==globalThis[symbol]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[symbol]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[symbol]}var WireType;!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(WireType||(WireType={}));const FLOAT32_MAX=34028234663852886e22,FLOAT32_MIN=-34028234663852886e22,UINT32_MAX=4294967295,INT32_MAX=2147483647,INT32_MIN=-2147483648;class BinaryWriter{constructor(e=getTextEncoding().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),r=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],r),r+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(assertUInt32(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return assertInt32(e),varint32write(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){assertFloat32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){assertUInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){assertInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return assertInt32(e),varint32write(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),n=protoInt64.enc(e);return r.setInt32(0,n.lo,!0),r.setInt32(4,n.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),n=protoInt64.uEnc(e);return r.setInt32(0,n.lo,!0),r.setInt32(4,n.hi,!0),this.raw(t)}int64(e){let t=protoInt64.enc(e);return varint64write(t.lo,t.hi,this.buf),this}sint64(e){const t=protoInt64.enc(e),r=t.hi>>31;return varint64write(t.lo<<1^r,(t.hi<<1|t.lo>>>31)^r,this.buf),this}uint64(e){const t=protoInt64.uEnc(e);return varint64write(t.lo,t.hi,this.buf),this}}class BinaryReader{constructor(e,t=getTextEncoding().decodeUtf8){this.decodeUtf8=t,this.varint64=varint64read,this.uint32=varint32read,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,r=7&e;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e,t){let r=this.pos;switch(e){case WireType.Varint:for(;128&this.buf[this.pos++];);break;case WireType.Bit64:this.pos+=4;case WireType.Bit32:this.pos+=4;break;case WireType.LengthDelimited:let r=this.uint32();this.pos+=r;break;case WireType.StartGroup:for(;;){const[e,r]=this.tag();if(r===WireType.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(r,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return protoInt64.dec(...this.varint64())}uint64(){return protoInt64.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(1&e);return e=(e>>>1|(1&t)<<31)^r,t=t>>>1^r,protoInt64.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return protoInt64.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return protoInt64.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}}function assertInt32(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>INT32_MAX||e<INT32_MIN)throw new Error("invalid int32: "+e)}function assertUInt32(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>UINT32_MAX||e<0)throw new Error("invalid uint32: "+e)}function assertFloat32(e){if("string"==typeof e){const t=e;if(e=Number(e),Number.isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>FLOAT32_MAX||e<FLOAT32_MIN))throw new Error("invalid float32: "+e)}var EngineKind;function engineKindFromJSON(e){switch(e){case 0:case"EAGER":return EngineKind.EAGER;case 1:case"LAZY":return EngineKind.LAZY;default:return EngineKind.UNRECOGNIZED}}function engineKindToJSON(e){switch(e){case EngineKind.EAGER:return"EAGER";case EngineKind.LAZY:return"LAZY";case EngineKind.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function createBaseNode(){return{id:"",addr:""}}!function(e){e[e.EAGER=0]="EAGER",e[e.LAZY=1]="LAZY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(EngineKind||(EngineKind={}));const Node={encode:(e,t=new BinaryWriter)=>(""!==e.id&&t.uint32(10).string(e.id),""!==e.addr&&t.uint32(18).string(e.addr),t),decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseNode();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.id=r.string();continue;case 2:if(18!==e)break;i.addr=r.string();continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({id:isSet(e.id)?globalThis.String(e.id):"",addr:isSet(e.addr)?globalThis.String(e.addr):""}),toJSON(e){const t={};return""!==e.id&&(t.id=e.id),""!==e.addr&&(t.addr=e.addr),t},create:e=>Node.fromPartial(e??{}),fromPartial(e){const t=createBaseNode();return t.id=e.id??"",t.addr=e.addr??"",t}};function createBaseJoinRequest(){return{node:void 0}}const JoinRequest={encode:(e,t=new BinaryWriter)=>(void 0!==e.node&&Node.encode(e.node,t.uint32(10).fork()).join(),t),decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseJoinRequest();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.node=Node.decode(r,r.uint32());continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({node:isSet(e.node)?Node.fromJSON(e.node):void 0}),toJSON(e){const t={};return void 0!==e.node&&(t.node=Node.toJSON(e.node)),t},create:e=>JoinRequest.fromPartial(e??{}),fromPartial(e){const t=createBaseJoinRequest();return t.node=void 0!==e.node&&null!==e.node?Node.fromPartial(e.node):void 0,t}};function createBaseJoinResponse(){return{}}const JoinResponse={encode:(e,t=new BinaryWriter)=>t,decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseJoinResponse();for(;r.pos<n;){const e=r.uint32();if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({}),toJSON:e=>({}),create:e=>JoinResponse.fromPartial(e??{}),fromPartial:e=>createBaseJoinResponse()};function createBaseLeaveRequest(){return{node:void 0}}const LeaveRequest={encode:(e,t=new BinaryWriter)=>(void 0!==e.node&&Node.encode(e.node,t.uint32(10).fork()).join(),t),decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseLeaveRequest();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.node=Node.decode(r,r.uint32());continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({node:isSet(e.node)?Node.fromJSON(e.node):void 0}),toJSON(e){const t={};return void 0!==e.node&&(t.node=Node.toJSON(e.node)),t},create:e=>LeaveRequest.fromPartial(e??{}),fromPartial(e){const t=createBaseLeaveRequest();return t.node=void 0!==e.node&&null!==e.node?Node.fromPartial(e.node):void 0,t}};function createBaseLeaveResponse(){return{}}const LeaveResponse={encode:(e,t=new BinaryWriter)=>t,decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseLeaveResponse();for(;r.pos<n;){const e=r.uint32();if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({}),toJSON:e=>({}),create:e=>LeaveResponse.fromPartial(e??{}),fromPartial:e=>createBaseLeaveResponse()};function createBaseListRequest(){return{}}const ListRequest={encode:(e,t=new BinaryWriter)=>t,decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseListRequest();for(;r.pos<n;){const e=r.uint32();if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({}),toJSON:e=>({}),create:e=>ListRequest.fromPartial(e??{}),fromPartial:e=>createBaseListRequest()};function createBaseListResponse(){return{nodes:[]}}const ListResponse={encode(e,t=new BinaryWriter){for(const r of e.nodes)Node.encode(r,t.uint32(10).fork()).join();return t},decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseListResponse();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.nodes.push(Node.decode(r,r.uint32()));continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({nodes:globalThis.Array.isArray(e?.nodes)?e.nodes.map(e=>Node.fromJSON(e)):[]}),toJSON(e){const t={};return e.nodes?.length&&(t.nodes=e.nodes.map(e=>Node.toJSON(e))),t},create:e=>ListResponse.fromPartial(e??{}),fromPartial(e){const t=createBaseListResponse();return t.nodes=e.nodes?.map(e=>Node.fromPartial(e))||[],t}};function createBaseEngineMetaData(){return{id:"",kind:0,input:[],output:[]}}const EngineMetaData={encode(e,t=new BinaryWriter){""!==e.id&&t.uint32(10).string(e.id),0!==e.kind&&t.uint32(16).int32(e.kind);for(const r of e.input)t.uint32(26).string(r);for(const r of e.output)t.uint32(34).string(r);return t},decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseEngineMetaData();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.id=r.string();continue;case 2:if(16!==e)break;i.kind=r.int32();continue;case 3:if(26!==e)break;i.input.push(r.string());continue;case 4:if(34!==e)break;i.output.push(r.string());continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({id:isSet(e.id)?globalThis.String(e.id):"",kind:isSet(e.kind)?engineKindFromJSON(e.kind):0,input:globalThis.Array.isArray(e?.input)?e.input.map(e=>globalThis.String(e)):[],output:globalThis.Array.isArray(e?.output)?e.output.map(e=>globalThis.String(e)):[]}),toJSON(e){const t={};return""!==e.id&&(t.id=e.id),0!==e.kind&&(t.kind=engineKindToJSON(e.kind)),e.input?.length&&(t.input=e.input),e.output?.length&&(t.output=e.output),t},create:e=>EngineMetaData.fromPartial(e??{}),fromPartial(e){const t=createBaseEngineMetaData();return t.id=e.id??"",t.kind=e.kind??0,t.input=e.input?.map(e=>e)||[],t.output=e.output?.map(e=>e)||[],t}};function createBaseMetaDataRequest(){return{}}const MetaDataRequest={encode:(e,t=new BinaryWriter)=>t,decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseMetaDataRequest();for(;r.pos<n;){const e=r.uint32();if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({}),toJSON:e=>({}),create:e=>MetaDataRequest.fromPartial(e??{}),fromPartial:e=>createBaseMetaDataRequest()};function createBaseMetaDataResponse(){return{metadata:void 0}}const MetaDataResponse={encode:(e,t=new BinaryWriter)=>(void 0!==e.metadata&&EngineMetaData.encode(e.metadata,t.uint32(10).fork()).join(),t),decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBaseMetaDataResponse();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.metadata=EngineMetaData.decode(r,r.uint32());continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({metadata:isSet(e.metadata)?EngineMetaData.fromJSON(e.metadata):void 0}),toJSON(e){const t={};return void 0!==e.metadata&&(t.metadata=EngineMetaData.toJSON(e.metadata)),t},create:e=>MetaDataResponse.fromPartial(e??{}),fromPartial(e){const t=createBaseMetaDataResponse();return t.metadata=void 0!==e.metadata&&null!==e.metadata?EngineMetaData.fromPartial(e.metadata):void 0,t}};function createBasePushDataRequest(){return{data:[]}}const PushDataRequest={encode(e,t=new BinaryWriter){for(const r of e.data)t.uint32(10).string(r);return t},decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBasePushDataRequest();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.data.push(r.string());continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({data:globalThis.Array.isArray(e?.data)?e.data.map(e=>globalThis.String(e)):[]}),toJSON(e){const t={};return e.data?.length&&(t.data=e.data),t},create:e=>PushDataRequest.fromPartial(e??{}),fromPartial(e){const t=createBasePushDataRequest();return t.data=e.data?.map(e=>e)||[],t}};function createBasePushDataResponse(){return{}}const PushDataResponse={encode:(e,t=new BinaryWriter)=>t,decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBasePushDataResponse();for(;r.pos<n;){const e=r.uint32();if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({}),toJSON:e=>({}),create:e=>PushDataResponse.fromPartial(e??{}),fromPartial:e=>createBasePushDataResponse()};function createBasePullDataRequest(){return{}}const PullDataRequest={encode:(e,t=new BinaryWriter)=>t,decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBasePullDataRequest();for(;r.pos<n;){const e=r.uint32();if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({}),toJSON:e=>({}),create:e=>PullDataRequest.fromPartial(e??{}),fromPartial:e=>createBasePullDataRequest()};function createBasePullDataResponse(){return{data:[]}}const PullDataResponse={encode(e,t=new BinaryWriter){for(const r of e.data)t.uint32(10).string(r);return t},decode(e,t){const r=e instanceof BinaryReader?e:new BinaryReader(e),n=void 0===t?r.len:r.pos+t,i=createBasePullDataResponse();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:if(10!==e)break;i.data.push(r.string());continue}if(4==(7&e)||0===e)break;r.skip(7&e)}return i},fromJSON:e=>({data:globalThis.Array.isArray(e?.data)?e.data.map(e=>globalThis.String(e)):[]}),toJSON(e){const t={};return e.data?.length&&(t.data=e.data),t},create:e=>PullDataResponse.fromPartial(e??{}),fromPartial(e){const t=createBasePullDataResponse();return t.data=e.data?.map(e=>e)||[],t}},ClusterService={join:{path:"/cn.edu.ustc.kclab.ddss.Cluster/Join",requestStream:!1,responseStream:!1,requestSerialize:e=>Buffer.from(JoinRequest.encode(e).finish()),requestDeserialize:e=>JoinRequest.decode(e),responseSerialize:e=>Buffer.from(JoinResponse.encode(e).finish()),responseDeserialize:e=>JoinResponse.decode(e)},leave:{path:"/cn.edu.ustc.kclab.ddss.Cluster/Leave",requestStream:!1,responseStream:!1,requestSerialize:e=>Buffer.from(LeaveRequest.encode(e).finish()),requestDeserialize:e=>LeaveRequest.decode(e),responseSerialize:e=>Buffer.from(LeaveResponse.encode(e).finish()),responseDeserialize:e=>LeaveResponse.decode(e)},list:{path:"/cn.edu.ustc.kclab.ddss.Cluster/List",requestStream:!1,responseStream:!1,requestSerialize:e=>Buffer.from(ListRequest.encode(e).finish()),requestDeserialize:e=>ListRequest.decode(e),responseSerialize:e=>Buffer.from(ListResponse.encode(e).finish()),responseDeserialize:e=>ListResponse.decode(e)}},ClusterClient=srcExports.makeGenericClientConstructor(ClusterService,"cn.edu.ustc.kclab.ddss.Cluster"),EngineService={metaData:{path:"/cn.edu.ustc.kclab.ddss.Engine/MetaData",requestStream:!1,responseStream:!1,requestSerialize:e=>Buffer.from(MetaDataRequest.encode(e).finish()),requestDeserialize:e=>MetaDataRequest.decode(e),responseSerialize:e=>Buffer.from(MetaDataResponse.encode(e).finish()),responseDeserialize:e=>MetaDataResponse.decode(e)},pushData:{path:"/cn.edu.ustc.kclab.ddss.Engine/PushData",requestStream:!1,responseStream:!1,requestSerialize:e=>Buffer.from(PushDataRequest.encode(e).finish()),requestDeserialize:e=>PushDataRequest.decode(e),responseSerialize:e=>Buffer.from(PushDataResponse.encode(e).finish()),responseDeserialize:e=>PushDataResponse.decode(e)},pullData:{path:"/cn.edu.ustc.kclab.ddss.Engine/PullData",requestStream:!1,responseStream:!1,requestSerialize:e=>Buffer.from(PullDataRequest.encode(e).finish()),requestDeserialize:e=>PullDataRequest.decode(e),responseSerialize:e=>Buffer.from(PullDataResponse.encode(e).finish()),responseDeserialize:e=>PullDataResponse.decode(e)}},EngineClient=srcExports.makeGenericClientConstructor(EngineService,"cn.edu.ustc.kclab.ddss.Engine");function isSet(e){return null!=e}class AtsdsSearchEngine extends o$1{constructor(e=1e3,t=1e4){super(e,t)}input(e){const t=Os(e);return super.add(t)?Ps(t):null}output(e){return super.execute(t=>(e(Ps(t.toString())),!1))}meta(){return{input:["`x"],output:["`x"]}}}class DataManager{data;constructor(){this.data=new Set}addData(e){return!this.data.has(e)&&(this.data.add(e),!0)}getData(){return Array.from(this.data)}}class EagerEngineManager{eagerEngine;onSearchResults;searchInterval;dataManager;isRunning;resolve;constructor(e,t,r=1e3){this.eagerEngine=e,this.onSearchResults=t,this.searchInterval=r,this.dataManager=new DataManager,this.isRunning=!1,this.resolve=()=>{}}start(){this.isRunning||(this.isRunning=!0,this.searchLoop())}stop(){this.isRunning=!1}addData(e,t=!0){const r=this.eagerEngine.input(e);return r&&this.dataManager.addData(r)?(t&&(this.resolve(),this.resolve=()=>{}),r):null}addDataBatch(e){const t=[];for(const r of e){const e=this.addData(r,!1);e&&t.push(e)}return this.resolve(),this.resolve=()=>{},t}getMetaData(){return this.eagerEngine.meta()}getData(){return this.dataManager.getData()}async searchLoop(){for(;this.isRunning;){const e=Date.now(),t=[];this.eagerEngine.output(e=>{this.dataManager.addData(e)&&t.push(e)}),t.length>0&&await this.onSearchResults(t);const r=Date.now()-e,n=Math.max(this.searchInterval-r,0);await new Promise(e=>{this.resolve=e,setTimeout(e,n)})}}}class ClusterManager{nodes;id;addr;constructor(e,t){this.nodes=new Map,this.id=e,this.addr=t}getAllNodes(){return Array.from(this.nodes.values())}getAllNodeInfo(){return this.getAllNodes().map(e=>({id:e.id,addr:e.addr})).concat([{id:this.id,addr:this.addr}])}addNode(e,t){if(this.hasNode(e))return null;const r={id:e,addr:t,client:this.createNodeClient(t)};return this.nodes.set(e,r),r}removeNode(e){if(!this.hasNode(e))return!1;const t=this.nodes.get(e);return t.client.cluster.close(),t.client.engine.close(),this.nodes.delete(e)}hasNode(e){return this.nodes.has(e)}createNodeClient(e){return{cluster:new ClusterClient(e,srcExports.credentials.createInsecure()),engine:new EngineClient(e,srcExports.credentials.createInsecure())}}updateAddr(e){this.addr=e}}class NetworkHandler{server;addr;callbacks;constructor(e,t){this.server=new srcExports.Server,this.addr=e,this.callbacks=t}async start(){this.setupServices();const e=promisify(this.server.bindAsync).bind(this.server),t=await e(this.addr,srcExports.ServerCredentials.createInsecure());return this.addr=`${this.addr.split(":")[0]}:${t}`,this.addr}async stop(){return new Promise(e=>{this.server.tryShutdown(()=>e())})}async callJoin(e,t){const r=promisify(t.cluster.join).bind(t.cluster);await r({node:e})}async callLeave(e,t){const r=promisify(t.cluster.leave).bind(t.cluster);await r({node:e})}async callList(e){const t=promisify(e.cluster.list).bind(e.cluster);return(await t({})).nodes}async callPushData(e,t){const r=promisify(t.engine.pushData).bind(t.engine);await r({data:e})}async callMetaData(e){const t=promisify(e.engine.metaData).bind(e.engine);return(await t({})).metadata}async callPullData(e){const t=promisify(e.engine.pullData).bind(e.engine);return(await t({})).data}setupServices(){this.server.addService(ClusterService,{join:async(e,t)=>{const r=e.request.node;await this.callbacks.onJoin(r),t(null,{})},leave:async(e,t)=>{const r=e.request.node;await this.callbacks.onLeave(r),t(null,{})},list:async(e,t)=>{t(null,{nodes:await this.callbacks.onList()})}}),this.server.addService(EngineService,{pushData:async(e,t)=>{const r=e.request.data;await this.callbacks.onPushData(r),t(null,{})},metaData:async(e,t)=>{t(null,{metadata:await this.callbacks.onMetaData()})},pullData:async(e,t)=>{t(null,{data:await this.callbacks.onPullData()})}})}}class EagerNode{id;addr;clusterManager;engineManager;networkHandler;stdinInterface=null;constructor(e,t,r=randomUUID()){this.id=r,this.addr=t,this.clusterManager=new ClusterManager(r,t),this.engineManager=new EagerEngineManager(e,this.handleSearchResults.bind(this)),this.networkHandler=new NetworkHandler(t,{onJoin:this.handleJoinRequest.bind(this),onLeave:this.handleLeaveRequest.bind(this),onList:this.handleListRequest.bind(this),onPushData:this.handlePushDataRequest.bind(this),onMetaData:this.handleMetaDataRequest.bind(this),onPullData:this.handlePullDataRequest.bind(this)})}async start(){const e=await this.networkHandler.start();this.addr=e,this.clusterManager.updateAddr(e),this.engineManager.start(),this.setupIoHandling(),console.log(`Node started: ${this.id} at ${this.addr}`)}async stop(){await this.leaveCluster(),this.stdinInterface&&this.stdinInterface.close(),this.engineManager.stop(),await this.networkHandler.stop(),console.log(`Node stopped: ${this.id}`)}async joinCluster(e){const t=this.clusterManager.createNodeClient(e),r=await this.networkHandler.callList(t),n={id:this.id,addr:this.addr},i=this.engineManager.getData();for(const e of r)if(e.id!==this.id){const t=this.clusterManager.addNode(e.id,e.addr);if(!t)continue;await this.networkHandler.callJoin(n,t.client),await this.syncDataWithNode(i,t.client),console.log(`Joining node: ${e.id} at ${e.addr}`)}t.cluster.close(),t.engine.close()}async leaveCluster(){const e={id:this.id,addr:this.addr},t=this.clusterManager.getAllNodes();for(const r of t)await this.networkHandler.callLeave(e,r.client),this.clusterManager.removeNode(r.id),console.log(`Leaving node: ${r.id}`)}async handleJoinRequest(e){this.clusterManager.hasNode(e.id)||(this.clusterManager.addNode(e.id,e.addr),console.log(`Node joined: ${e.id} at ${e.addr}`))}async handleLeaveRequest(e){this.clusterManager.hasNode(e.id)&&(this.clusterManager.removeNode(e.id),console.log(`Node left: ${e.id} at ${e.addr}`))}async handleListRequest(){return this.clusterManager.getAllNodeInfo()}async handlePushDataRequest(e){const t=this.engineManager.addDataBatch(e);for(const e of t)console.log(`Data received: ${e}`);return t}async handleMetaDataRequest(){const e=this.engineManager.getMetaData();return{id:this.id,kind:EngineKind.EAGER,input:e.input,output:e.output}}async handlePullDataRequest(){return this.engineManager.getData()}async handleSearchResults(e){if(0===e.length)return;for(const t of e)console.log(`Data found: ${t}`);const t=this.clusterManager.getAllNodes();for(const r of t)await this.networkHandler.callPushData(e,r.client)}async syncDataWithNode(e,t){e.length>0&&await this.networkHandler.callPushData(e,t);const r=await this.networkHandler.callPullData(t);if(r.length>0){const e=this.engineManager.addDataBatch(r);for(const t of e)console.log(`Pulling data: ${t}`)}}setupIoHandling(){this.stdinInterface=createInterface({input:process.stdin,output:process.stdout,terminal:!1}),this.stdinInterface.on("line",async e=>{const t=e.trim();if(0===t.length)return;const r=this.engineManager.addData(t);if(r){console.log(`Data read: ${r}`);const e=this.clusterManager.getAllNodes();for(const t of e)await this.networkHandler.callPushData([r],t.client)}}),process.on("SIGINT",async()=>{console.log("Shutting down..."),await this.stop(),process.exit(0)}),process.on("SIGUSR1",()=>{console.log("=== Cluster Information ==="),console.log(`Current Node: ${this.id} at ${this.addr}`),console.log("Connected Nodes:");const e=this.clusterManager.getAllNodes();e.forEach((e,t)=>{console.log(` ${t+1}. ${e.id} at ${e.addr}`)}),console.log(`Total nodes: ${e.length+1}`),console.log("===========================")}),process.on("SIGUSR2",()=>{console.log("=== Data Information ===");const e=this.engineManager.getData();e.forEach((e,t)=>{console.log(` ${t+1}. ${e}`)}),console.log(`Total data items: ${e.length}`),console.log("========================")})}}function addAddressPrefixForPort(e,t){return/^\d+$/.test(e)?`${t}:${e}`:e}async function main(){(process.argv.length<3||process.argv.length>4)&&(console.error("Usage: main <bind_addr> [<join_addr>]"),process.exit(1));const e=addAddressPrefixForPort(process.argv[2],"0.0.0.0"),t=new AtsdsSearchEngine,r=new EagerNode(t,e);if(await r.start(),4===process.argv.length){const e=addAddressPrefixForPort(process.argv[3],"127.0.0.1");console.log(`Joining cluster at ${e}...`),await r.joinCluster(e)}else console.log("Starting as first node in new cluster...");process.stdin.resume()}import.meta.main&&main();