@sentio/runtime 2.62.2-rc.7 → 2.62.2
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/lib/chunk-3A7UBKPA.js +26 -0
- package/lib/{chunk-OFR7W4ZG.js.map → chunk-3A7UBKPA.js.map} +1 -1
- package/lib/chunk-AUPVVLD3.js +3 -0
- package/lib/chunk-CJDESLYQ.js +3 -0
- package/lib/{chunk-L2A6JPIQ.js.map → chunk-CJDESLYQ.js.map} +1 -1
- package/lib/chunk-G6HW3DCN.js +3 -0
- package/lib/{chunk-MV6JXS2P.js.map → chunk-G6HW3DCN.js.map} +1 -1
- package/lib/chunk-WHWNPZZ3.js +3 -0
- package/lib/{chunk-6XHWJ2VS.js.map → chunk-WHWNPZZ3.js.map} +1 -1
- package/lib/chunk-XI22N6AJ.js +38 -0
- package/lib/{chunk-CPJKSHSV.js.map → chunk-XI22N6AJ.js.map} +1 -1
- package/lib/chunk-XSQNZQCD.js +117 -0
- package/lib/{chunk-BIFWYVK4.js.map → chunk-XSQNZQCD.js.map} +1 -1
- package/lib/getMachineId-bsd-I6PJXCQT.js +3 -0
- package/lib/{getMachineId-bsd-ZJR2OQTA.js.map → getMachineId-bsd-I6PJXCQT.js.map} +1 -1
- package/lib/getMachineId-darwin-HKHV3WMW.js +4 -0
- package/lib/{getMachineId-darwin-OW6SYINH.js.map → getMachineId-darwin-HKHV3WMW.js.map} +1 -1
- package/lib/getMachineId-linux-I76A7IOE.js +3 -0
- package/lib/{getMachineId-linux-L5XPRJBN.js.map → getMachineId-linux-I76A7IOE.js.map} +1 -1
- package/lib/getMachineId-unsupported-VPOZWIZS.js +3 -0
- package/lib/{getMachineId-unsupported-B3NMIOO3.js.map → getMachineId-unsupported-VPOZWIZS.js.map} +1 -1
- package/lib/getMachineId-win-W5S4EK74.js +3 -0
- package/lib/{getMachineId-win-TT64F63B.js.map → getMachineId-win-W5S4EK74.js.map} +1 -1
- package/lib/index.js +1 -76
- package/lib/index.js.map +1 -1
- package/lib/processor-runner.js +47 -32956
- package/lib/processor-runner.js.map +1 -1
- package/lib/service-worker.js +2 -132
- package/lib/service-worker.js.map +1 -1
- package/lib/test-processor.test.js.map +1 -1
- package/package.json +1 -1
- package/lib/chunk-6XHWJ2VS.js +0 -92
- package/lib/chunk-BIFWYVK4.js +0 -59783
- package/lib/chunk-CPJKSHSV.js +0 -10976
- package/lib/chunk-KVSDPGUI.js +0 -50
- package/lib/chunk-L2A6JPIQ.js +0 -21
- package/lib/chunk-MV6JXS2P.js +0 -1703
- package/lib/chunk-OFR7W4ZG.js +0 -25773
- package/lib/getMachineId-bsd-ZJR2OQTA.js +0 -41
- package/lib/getMachineId-darwin-OW6SYINH.js +0 -41
- package/lib/getMachineId-linux-L5XPRJBN.js +0 -33
- package/lib/getMachineId-unsupported-B3NMIOO3.js +0 -24
- package/lib/getMachineId-win-TT64F63B.js +0 -43
- /package/lib/{chunk-KVSDPGUI.js.map → chunk-AUPVVLD3.js.map} +0 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
2
|
+
import{a as gF,b as yF,c as Cw,d as vF,e as bF,f as _F,g as EF,h as AF,i as Zu,j as xw,k as Ow,n as Xu,q as di,s as ny,t as Iw}from"./chunk-3A7UBKPA.js";import{q as Pw,u as wF}from"./chunk-G6HW3DCN.js";import{a as ie,b as Lt,c as g,d as $u,e as No,f as $r}from"./chunk-AUPVVLD3.js";var dt=g(sy=>{"use strict";sy.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,n)=>{e.push((i,s)=>i!=null?n(i):t(s)),r.apply(this,e)})},"name",{value:r.name})};sy.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);e.pop(),r.apply(this,e).then(n=>t(null,n),t)},"name",{value:r.name})}});var Nw=g((Zde,Rw)=>{"use strict";var fi=ie("constants"),TF=process.cwd,ed=null,CF=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ed||(ed=TF.call(process)),ed};try{process.cwd()}catch{}typeof process.chdir=="function"&&(oy=process.chdir,process.chdir=function(r){ed=null,oy.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,oy));var oy;Rw.exports=xF;function xF(r){fi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=s(r.chown),r.fchown=s(r.fchown),r.lchown=s(r.lchown),r.chmod=n(r.chmod),r.fchmod=n(r.fchmod),r.lchmod=n(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=i(r.chmodSync),r.fchmodSync=i(r.fchmodSync),r.lchmodSync=i(r.lchmodSync),r.stat=a(r.stat),r.fstat=a(r.fstat),r.lstat=a(r.lstat),r.statSync=c(r.statSync),r.fstatSync=c(r.fstatSync),r.lstatSync=c(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(u,d,f){f&&process.nextTick(f)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(u,d,f,h){h&&process.nextTick(h)},r.lchownSync=function(){}),CF==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(u){function d(f,h,m){var p=Date.now(),y=0;u(f,h,function b(E){if(E&&(E.code==="EACCES"||E.code==="EPERM"||E.code==="EBUSY")&&Date.now()-p<6e4){setTimeout(function(){r.stat(h,function(x,S){x&&x.code==="ENOENT"?u(f,h,b):m(E)})},y),y<100&&(y+=10);return}m&&m(E)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d}(r.rename)),r.read=typeof r.read!="function"?r.read:function(u){function d(f,h,m,p,y,b){var E;if(b&&typeof b=="function"){var x=0;E=function(S,M,I){if(S&&S.code==="EAGAIN"&&x<10)return x++,u.call(r,f,h,m,p,y,E);b.apply(this,arguments)}}return u.call(r,f,h,m,p,y,E)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(u){return function(d,f,h,m,p){for(var y=0;;)try{return u.call(r,d,f,h,m,p)}catch(b){if(b.code==="EAGAIN"&&y<10){y++;continue}throw b}}}(r.readSync);function e(u){u.lchmod=function(d,f,h){u.open(d,fi.O_WRONLY|fi.O_SYMLINK,f,function(m,p){if(m){h&&h(m);return}u.fchmod(p,f,function(y){u.close(p,function(b){h&&h(y||b)})})})},u.lchmodSync=function(d,f){var h=u.openSync(d,fi.O_WRONLY|fi.O_SYMLINK,f),m=!0,p;try{p=u.fchmodSync(h,f),m=!1}finally{if(m)try{u.closeSync(h)}catch{}else u.closeSync(h)}return p}}function t(u){fi.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,h,m){u.open(d,fi.O_SYMLINK,function(p,y){if(p){m&&m(p);return}u.futimes(y,f,h,function(b){u.close(y,function(E){m&&m(b||E)})})})},u.lutimesSync=function(d,f,h){var m=u.openSync(d,fi.O_SYMLINK),p,y=!0;try{p=u.futimesSync(m,f,h),y=!1}finally{if(y)try{u.closeSync(m)}catch{}else u.closeSync(m)}return p}):u.futimes&&(u.lutimes=function(d,f,h,m){m&&process.nextTick(m)},u.lutimesSync=function(){})}function n(u){return u&&function(d,f,h){return u.call(r,d,f,function(m){l(m)&&(m=null),h&&h.apply(this,arguments)})}}function i(u){return u&&function(d,f){try{return u.call(r,d,f)}catch(h){if(!l(h))throw h}}}function s(u){return u&&function(d,f,h,m){return u.call(r,d,f,h,function(p){l(p)&&(p=null),m&&m.apply(this,arguments)})}}function o(u){return u&&function(d,f,h){try{return u.call(r,d,f,h)}catch(m){if(!l(m))throw m}}}function a(u){return u&&function(d,f,h){typeof f=="function"&&(h=f,f=null);function m(p,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),h&&h.apply(this,arguments)}return f?u.call(r,d,f,m):u.call(r,d,m)}}function c(u){return u&&function(d,f){var h=f?u.call(r,d,f):u.call(r,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Lw=g((Xde,Dw)=>{"use strict";var Mw=ie("stream").Stream;Dw.exports=OF;function OF(r){return{ReadStream:e,WriteStream:t};function e(n,i){if(!(this instanceof e))return new e(n,i);Mw.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,c=o.length;a<c;a++){var l=o[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}r.open(this.path,this.flags,this.mode,function(u,d){if(u){s.emit("error",u),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(n,i){if(!(this instanceof t))return new t(n,i);Mw.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var c=s[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var qw=g((efe,Fw)=>{"use strict";Fw.exports=PF;var IF=Object.getPrototypeOf||function(r){return r.__proto__};function PF(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:IF(r)};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}});var Do=g((tfe,ly)=>{"use strict";var ze=ie("fs"),kF=Nw(),RF=Lw(),NF=qw(),td=ie("util"),yt,nd;typeof Symbol=="function"&&typeof Symbol.for=="function"?(yt=Symbol.for("graceful-fs.queue"),nd=Symbol.for("graceful-fs.previous")):(yt="___graceful-fs.queue",nd="___graceful-fs.previous");function MF(){}function jw(r,e){Object.defineProperty(r,yt,{get:function(){return e}})}var xs=MF;td.debuglog?xs=td.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(xs=function(){var r=td.format.apply(td,arguments);r="GFS4: "+r.split(/\n/).join(`
|
3
|
+
GFS4: `),console.error(r)});ze[yt]||(Bw=global[yt]||[],jw(ze,Bw),ze.close=function(r){function e(t,n){return r.call(ze,t,function(i){i||Uw(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,nd,{value:r}),e}(ze.close),ze.closeSync=function(r){function e(t){r.apply(ze,arguments),Uw()}return Object.defineProperty(e,nd,{value:r}),e}(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){xs(ze[yt]),ie("assert").equal(ze[yt].length,0)}));var Bw;global[yt]||jw(global,ze[yt]);ly.exports=ay(NF(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(ly.exports=ay(ze),ze.__patched=!0);function ay(r){kF(r),r.gracefulify=ay,r.createReadStream=M,r.createWriteStream=I;var e=r.readFile;r.readFile=t;function t(L,q,C){return typeof q=="function"&&(C=q,q=null),oe(L,q,C);function oe(O,_,T,R){return e(O,_,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?Mo([oe,[O,_,T],F,R||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var n=r.writeFile;r.writeFile=i;function i(L,q,C,oe){return typeof C=="function"&&(oe=C,C=null),O(L,q,C,oe);function O(_,T,R,F,W){return n(_,T,R,function(G){G&&(G.code==="EMFILE"||G.code==="ENFILE")?Mo([O,[_,T,R,F],G,W||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}}var s=r.appendFile;s&&(r.appendFile=o);function o(L,q,C,oe){return typeof C=="function"&&(oe=C,C=null),O(L,q,C,oe);function O(_,T,R,F,W){return s(_,T,R,function(G){G&&(G.code==="EMFILE"||G.code==="ENFILE")?Mo([O,[_,T,R,F],G,W||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}}var a=r.copyFile;a&&(r.copyFile=c);function c(L,q,C,oe){return typeof C=="function"&&(oe=C,C=0),O(L,q,C,oe);function O(_,T,R,F,W){return a(_,T,R,function(G){G&&(G.code==="EMFILE"||G.code==="ENFILE")?Mo([O,[_,T,R,F],G,W||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}}var l=r.readdir;r.readdir=d;var u=/^v[0-5]\./;function d(L,q,C){typeof q=="function"&&(C=q,q=null);var oe=u.test(process.version)?function(T,R,F,W){return l(T,O(T,R,F,W))}:function(T,R,F,W){return l(T,R,O(T,R,F,W))};return oe(L,q,C);function O(_,T,R,F){return function(W,G){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Mo([oe,[_,T,R],W,F||Date.now(),Date.now()]):(G&&G.sort&&G.sort(),typeof R=="function"&&R.call(this,W,G))}}}if(process.version.substr(0,4)==="v0.8"){var f=RF(r);b=f.ReadStream,x=f.WriteStream}var h=r.ReadStream;h&&(b.prototype=Object.create(h.prototype),b.prototype.open=E);var m=r.WriteStream;m&&(x.prototype=Object.create(m.prototype),x.prototype.open=S),Object.defineProperty(r,"ReadStream",{get:function(){return b},set:function(L){b=L},enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:function(){return x},set:function(L){x=L},enumerable:!0,configurable:!0});var p=b;Object.defineProperty(r,"FileReadStream",{get:function(){return p},set:function(L){p=L},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(r,"FileWriteStream",{get:function(){return y},set:function(L){y=L},enumerable:!0,configurable:!0});function b(L,q){return this instanceof b?(h.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function E(){var L=this;z(L.path,L.flags,L.mode,function(q,C){q?(L.autoClose&&L.destroy(),L.emit("error",q)):(L.fd=C,L.emit("open",C),L.read())})}function x(L,q){return this instanceof x?(m.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function S(){var L=this;z(L.path,L.flags,L.mode,function(q,C){q?(L.destroy(),L.emit("error",q)):(L.fd=C,L.emit("open",C))})}function M(L,q){return new r.ReadStream(L,q)}function I(L,q){return new r.WriteStream(L,q)}var B=r.open;r.open=z;function z(L,q,C,oe){return typeof C=="function"&&(oe=C,C=null),O(L,q,C,oe);function O(_,T,R,F,W){return B(_,T,R,function(G,me){G&&(G.code==="EMFILE"||G.code==="ENFILE")?Mo([O,[_,T,R,F],G,W||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}}return r}function Mo(r){xs("ENQUEUE",r[0].name,r[1]),ze[yt].push(r),cy()}var rd;function Uw(){for(var r=Date.now(),e=0;e<ze[yt].length;++e)ze[yt][e].length>2&&(ze[yt][e][3]=r,ze[yt][e][4]=r);cy()}function cy(){if(clearTimeout(rd),rd=void 0,ze[yt].length!==0){var r=ze[yt].shift(),e=r[0],t=r[1],n=r[2],i=r[3],s=r[4];if(i===void 0)xs("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){xs("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,n)}else{var a=Date.now()-s,c=Math.max(s-i,1),l=Math.min(c*1.2,100);a>=l?(xs("RETRY",e.name,t),e.apply(null,t.concat([i]))):ze[yt].push(r)}rd===void 0&&(rd=setTimeout(cy,0))}}});var qt=g(kn=>{"use strict";var zw=dt().fromCallback,Ft=Do(),DF=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof Ft[r]=="function");Object.assign(kn,Ft);DF.forEach(r=>{kn[r]=zw(Ft[r])});kn.exists=function(r,e){return typeof e=="function"?Ft.exists(r,e):new Promise(t=>Ft.exists(r,t))};kn.read=function(r,e,t,n,i,s){return typeof s=="function"?Ft.read(r,e,t,n,i,s):new Promise((o,a)=>{Ft.read(r,e,t,n,i,(c,l,u)=>{if(c)return a(c);o({bytesRead:l,buffer:u})})})};kn.write=function(r,e,...t){return typeof t[t.length-1]=="function"?Ft.write(r,e,...t):new Promise((n,i)=>{Ft.write(r,e,...t,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffer:a})})})};kn.readv=function(r,e,...t){return typeof t[t.length-1]=="function"?Ft.readv(r,e,...t):new Promise((n,i)=>{Ft.readv(r,e,...t,(s,o,a)=>{if(s)return i(s);n({bytesRead:o,buffers:a})})})};kn.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?Ft.writev(r,e,...t):new Promise((n,i)=>{Ft.writev(r,e,...t,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffers:a})})})};typeof Ft.realpath.native=="function"?kn.realpath.native=zw(Ft.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Gw=g((nfe,Hw)=>{"use strict";var LF=ie("path");Hw.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(LF.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var Jw=g((ife,uy)=>{"use strict";var Vw=qt(),{checkPath:Ww}=Gw(),Kw=r=>{let e={mode:511};return typeof r=="number"?r:{...e,...r}.mode};uy.exports.makeDir=async(r,e)=>(Ww(r),Vw.mkdir(r,{mode:Kw(e),recursive:!0}));uy.exports.makeDirSync=(r,e)=>(Ww(r),Vw.mkdirSync(r,{mode:Kw(e),recursive:!0}))});var Ir=g((sfe,Qw)=>{"use strict";var FF=dt().fromPromise,{makeDir:qF,makeDirSync:dy}=Jw(),fy=FF(qF);Qw.exports={mkdirs:fy,mkdirsSync:dy,mkdirp:fy,mkdirpSync:dy,ensureDir:fy,ensureDirSync:dy}});var hi=g((ofe,$w)=>{"use strict";var BF=dt().fromPromise,Yw=qt();function UF(r){return Yw.access(r).then(()=>!0).catch(()=>!1)}$w.exports={pathExists:BF(UF),pathExistsSync:Yw.existsSync}});var hy=g((afe,Zw)=>{"use strict";var Lo=qt(),jF=dt().fromPromise;async function zF(r,e,t){let n=await Lo.open(r,"r+"),i=null;try{await Lo.futimes(n,e,t)}finally{try{await Lo.close(n)}catch(s){i=s}}if(i)throw i}function HF(r,e,t){let n=Lo.openSync(r,"r+");return Lo.futimesSync(n,e,t),Lo.closeSync(n)}Zw.exports={utimesMillis:jF(zF),utimesMillisSync:HF}});var Os=g((cfe,rS)=>{"use strict";var Fo=qt(),ft=ie("path"),Xw=dt().fromPromise;function GF(r,e,t){let n=t.dereference?i=>Fo.stat(i,{bigint:!0}):i=>Fo.lstat(i,{bigint:!0});return Promise.all([n(r),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}function VF(r,e,t){let n,i=t.dereference?o=>Fo.statSync(o,{bigint:!0}):o=>Fo.lstatSync(o,{bigint:!0}),s=i(r);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}async function WF(r,e,t,n){let{srcStat:i,destStat:s}=await GF(r,e,n);if(s){if(zc(i,s)){let o=ft.basename(r),a=ft.basename(e);if(t==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&py(r,e))throw new Error(id(r,e,t));return{srcStat:i,destStat:s}}function KF(r,e,t,n){let{srcStat:i,destStat:s}=VF(r,e,n);if(s){if(zc(i,s)){let o=ft.basename(r),a=ft.basename(e);if(t==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&py(r,e))throw new Error(id(r,e,t));return{srcStat:i,destStat:s}}async function eS(r,e,t,n){let i=ft.resolve(ft.dirname(r)),s=ft.resolve(ft.dirname(t));if(s===i||s===ft.parse(s).root)return;let o;try{o=await Fo.stat(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(zc(e,o))throw new Error(id(r,t,n));return eS(r,e,s,n)}function tS(r,e,t,n){let i=ft.resolve(ft.dirname(r)),s=ft.resolve(ft.dirname(t));if(s===i||s===ft.parse(s).root)return;let o;try{o=Fo.statSync(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(zc(e,o))throw new Error(id(r,t,n));return tS(r,e,s,n)}function zc(r,e){return e.ino&&e.dev&&e.ino===r.ino&&e.dev===r.dev}function py(r,e){let t=ft.resolve(r).split(ft.sep).filter(i=>i),n=ft.resolve(e).split(ft.sep).filter(i=>i);return t.every((i,s)=>n[s]===i)}function id(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}rS.exports={checkPaths:Xw(WF),checkPathsSync:KF,checkParentPaths:Xw(eS),checkParentPathsSync:tS,isSrcSubdir:py,areIdentical:zc}});var aS=g((lfe,oS)=>{"use strict";var It=qt(),Hc=ie("path"),{mkdirs:JF}=Ir(),{pathExists:QF}=hi(),{utimesMillis:YF}=hy(),Gc=Os();async function $F(r,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
4
|
+
|
5
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Gc.checkPaths(r,e,"copy",t);if(await Gc.checkParentPaths(r,n,e,"copy"),!await iS(r,e,t))return;let o=Hc.dirname(e);await QF(o)||await JF(o),await sS(i,r,e,t)}async function iS(r,e,t){return t.filter?t.filter(r,e):!0}async function sS(r,e,t,n){let s=await(n.dereference?It.stat:It.lstat)(e);if(s.isDirectory())return tq(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return ZF(s,r,e,t,n);if(s.isSymbolicLink())return rq(r,e,t,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function ZF(r,e,t,n,i){if(!e)return nS(r,t,n,i);if(i.overwrite)return await It.unlink(n),nS(r,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function nS(r,e,t,n){if(await It.copyFile(e,t),n.preserveTimestamps){XF(r.mode)&&await eq(t,r.mode);let i=await It.stat(e);await YF(t,i.atime,i.mtime)}return It.chmod(t,r.mode)}function XF(r){return(r&128)===0}function eq(r,e){return It.chmod(r,e|128)}async function tq(r,e,t,n,i){e||await It.mkdir(n);let s=[];for await(let o of await It.opendir(t)){let a=Hc.join(t,o.name),c=Hc.join(n,o.name);s.push(iS(a,c,i).then(l=>{if(l)return Gc.checkPaths(a,c,"copy",i).then(({destStat:u})=>sS(u,a,c,i))}))}await Promise.all(s),e||await It.chmod(n,r.mode)}async function rq(r,e,t,n){let i=await It.readlink(e);if(n.dereference&&(i=Hc.resolve(process.cwd(),i)),!r)return It.symlink(i,t);let s=null;try{s=await It.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return It.symlink(i,t);throw o}if(n.dereference&&(s=Hc.resolve(process.cwd(),s)),Gc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Gc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await It.unlink(t),It.symlink(i,t)}oS.exports=$F});var fS=g((ufe,dS)=>{"use strict";var Bt=Do(),Vc=ie("path"),nq=Ir().mkdirsSync,iq=hy().utimesMillisSync,Wc=Os();function sq(r,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
6
|
+
|
7
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Wc.checkPathsSync(r,e,"copy",t);if(Wc.checkParentPathsSync(r,n,e,"copy"),t.filter&&!t.filter(r,e))return;let s=Vc.dirname(e);return Bt.existsSync(s)||nq(s),cS(i,r,e,t)}function cS(r,e,t,n){let s=(n.dereference?Bt.statSync:Bt.lstatSync)(e);if(s.isDirectory())return fq(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return oq(s,r,e,t,n);if(s.isSymbolicLink())return mq(r,e,t,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function oq(r,e,t,n,i){return e?aq(r,t,n,i):lS(r,t,n,i)}function aq(r,e,t,n){if(n.overwrite)return Bt.unlinkSync(t),lS(r,e,t,n);if(n.errorOnExist)throw new Error(`'${t}' already exists`)}function lS(r,e,t,n){return Bt.copyFileSync(e,t),n.preserveTimestamps&&cq(r.mode,e,t),my(t,r.mode)}function cq(r,e,t){return lq(r)&&uq(t,r),dq(e,t)}function lq(r){return(r&128)===0}function uq(r,e){return my(r,e|128)}function my(r,e){return Bt.chmodSync(r,e)}function dq(r,e){let t=Bt.statSync(r);return iq(e,t.atime,t.mtime)}function fq(r,e,t,n,i){return e?uS(t,n,i):hq(r.mode,t,n,i)}function hq(r,e,t,n){return Bt.mkdirSync(t),uS(e,t,n),my(t,r)}function uS(r,e,t){let n=Bt.opendirSync(r);try{let i;for(;(i=n.readSync())!==null;)pq(i.name,r,e,t)}finally{n.closeSync()}}function pq(r,e,t,n){let i=Vc.join(e,r),s=Vc.join(t,r);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=Wc.checkPathsSync(i,s,"copy",n);return cS(o,i,s,n)}function mq(r,e,t,n){let i=Bt.readlinkSync(e);if(n.dereference&&(i=Vc.resolve(process.cwd(),i)),r){let s;try{s=Bt.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Bt.symlinkSync(i,t);throw o}if(n.dereference&&(s=Vc.resolve(process.cwd(),s)),Wc.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Wc.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return gq(i,t)}else return Bt.symlinkSync(i,t)}function gq(r,e){return Bt.unlinkSync(e),Bt.symlinkSync(r,e)}dS.exports=sq});var sd=g((dfe,hS)=>{"use strict";var yq=dt().fromPromise;hS.exports={copy:yq(aS()),copySync:fS()}});var Kc=g((ffe,mS)=>{"use strict";var pS=Do(),vq=dt().fromCallback;function bq(r,e){pS.rm(r,{recursive:!0,force:!0},e)}function _q(r){pS.rmSync(r,{recursive:!0,force:!0})}mS.exports={remove:vq(bq),removeSync:_q}});var wS=g((hfe,AS)=>{"use strict";var Eq=dt().fromPromise,vS=qt(),bS=ie("path"),_S=Ir(),ES=Kc(),gS=Eq(async function(e){let t;try{t=await vS.readdir(e)}catch{return _S.mkdirs(e)}return Promise.all(t.map(n=>ES.remove(bS.join(e,n))))});function yS(r){let e;try{e=vS.readdirSync(r)}catch{return _S.mkdirsSync(r)}e.forEach(t=>{t=bS.join(r,t),ES.removeSync(t)})}AS.exports={emptyDirSync:yS,emptydirSync:yS,emptyDir:gS,emptydir:gS}});var xS=g((pfe,CS)=>{"use strict";var Aq=dt().fromPromise,SS=ie("path"),Rn=qt(),TS=Ir();async function wq(r){let e;try{e=await Rn.stat(r)}catch{}if(e&&e.isFile())return;let t=SS.dirname(r),n=null;try{n=await Rn.stat(t)}catch(i){if(i.code==="ENOENT"){await TS.mkdirs(t),await Rn.writeFile(r,"");return}else throw i}n.isDirectory()?await Rn.writeFile(r,""):await Rn.readdir(t)}function Sq(r){let e;try{e=Rn.statSync(r)}catch{}if(e&&e.isFile())return;let t=SS.dirname(r);try{Rn.statSync(t).isDirectory()||Rn.readdirSync(t)}catch(n){if(n&&n.code==="ENOENT")TS.mkdirsSync(t);else throw n}Rn.writeFileSync(r,"")}CS.exports={createFile:Aq(wq),createFileSync:Sq}});var RS=g((mfe,kS)=>{"use strict";var Tq=dt().fromPromise,OS=ie("path"),pi=qt(),IS=Ir(),{pathExists:Cq}=hi(),{areIdentical:PS}=Os();async function xq(r,e){let t;try{t=await pi.lstat(e)}catch{}let n;try{n=await pi.lstat(r)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(t&&PS(n,t))return;let i=OS.dirname(e);await Cq(i)||await IS.mkdirs(i),await pi.link(r,e)}function Oq(r,e){let t;try{t=pi.lstatSync(e)}catch{}try{let s=pi.lstatSync(r);if(t&&PS(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=OS.dirname(e);return pi.existsSync(n)||IS.mkdirsSync(n),pi.linkSync(r,e)}kS.exports={createLink:Tq(xq),createLinkSync:Oq}});var MS=g((gfe,NS)=>{"use strict";var mi=ie("path"),Jc=qt(),{pathExists:Iq}=hi(),Pq=dt().fromPromise;async function kq(r,e){if(mi.isAbsolute(r)){try{await Jc.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:r}}let t=mi.dirname(e),n=mi.join(t,r);if(await Iq(n))return{toCwd:n,toDst:r};try{await Jc.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:mi.relative(t,r)}}function Rq(r,e){if(mi.isAbsolute(r)){if(!Jc.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}let t=mi.dirname(e),n=mi.join(t,r);if(Jc.existsSync(n))return{toCwd:n,toDst:r};if(!Jc.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:mi.relative(t,r)}}NS.exports={symlinkPaths:Pq(kq),symlinkPathsSync:Rq}});var FS=g((yfe,LS)=>{"use strict";var DS=qt(),Nq=dt().fromPromise;async function Mq(r,e){if(e)return e;let t;try{t=await DS.lstat(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}function Dq(r,e){if(e)return e;let t;try{t=DS.lstatSync(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}LS.exports={symlinkType:Nq(Mq),symlinkTypeSync:Dq}});var jS=g((vfe,US)=>{"use strict";var Lq=dt().fromPromise,qS=ie("path"),Zr=qt(),{mkdirs:Fq,mkdirsSync:qq}=Ir(),{symlinkPaths:Bq,symlinkPathsSync:Uq}=MS(),{symlinkType:jq,symlinkTypeSync:zq}=FS(),{pathExists:Hq}=hi(),{areIdentical:BS}=Os();async function Gq(r,e,t){let n;try{n=await Zr.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let[a,c]=await Promise.all([Zr.stat(r),Zr.stat(e)]);if(BS(a,c))return}let i=await Bq(r,e);r=i.toDst;let s=await jq(i.toCwd,t),o=qS.dirname(e);return await Hq(o)||await Fq(o),Zr.symlink(r,e,s)}function Vq(r,e,t){let n;try{n=Zr.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let a=Zr.statSync(r),c=Zr.statSync(e);if(BS(a,c))return}let i=Uq(r,e);r=i.toDst,t=zq(i.toCwd,t);let s=qS.dirname(e);return Zr.existsSync(s)||qq(s),Zr.symlinkSync(r,e,t)}US.exports={createSymlink:Lq(Gq),createSymlinkSync:Vq}});var QS=g((bfe,JS)=>{"use strict";var{createFile:zS,createFileSync:HS}=xS(),{createLink:GS,createLinkSync:VS}=RS(),{createSymlink:WS,createSymlinkSync:KS}=jS();JS.exports={createFile:zS,createFileSync:HS,ensureFile:zS,ensureFileSync:HS,createLink:GS,createLinkSync:VS,ensureLink:GS,ensureLinkSync:VS,createSymlink:WS,createSymlinkSync:KS,ensureSymlink:WS,ensureSymlinkSync:KS}});var od=g((_fe,YS)=>{"use strict";function Wq(r,{EOL:e=`
|
8
|
+
`,finalEOL:t=!0,replacer:n=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(r,n,i).replace(/\n/g,e)+s}function Kq(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}YS.exports={stringify:Wq,stripBom:Kq}});var eT=g((Efe,XS)=>{"use strict";var qo;try{qo=Do()}catch{qo=ie("fs")}var ad=dt(),{stringify:$S,stripBom:ZS}=od();async function Jq(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||qo,n="throws"in e?e.throws:!0,i=await ad.fromCallback(t.readFile)(r,e);i=ZS(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${r}: ${o.message}`,o;return null}return s}var Qq=ad.fromPromise(Jq);function Yq(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||qo,n="throws"in e?e.throws:!0;try{let i=t.readFileSync(r,e);return i=ZS(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${r}: ${i.message}`,i;return null}}async function $q(r,e,t={}){let n=t.fs||qo,i=$S(e,t);await ad.fromCallback(n.writeFile)(r,i,t)}var Zq=ad.fromPromise($q);function Xq(r,e,t={}){let n=t.fs||qo,i=$S(e,t);return n.writeFileSync(r,i,t)}var e6={readFile:Qq,readFileSync:Yq,writeFile:Zq,writeFileSync:Xq};XS.exports=e6});var rT=g((Afe,tT)=>{"use strict";var cd=eT();tT.exports={readJson:cd.readFile,readJsonSync:cd.readFileSync,writeJson:cd.writeFile,writeJsonSync:cd.writeFileSync}});var ld=g((wfe,sT)=>{"use strict";var t6=dt().fromPromise,gy=qt(),nT=ie("path"),iT=Ir(),r6=hi().pathExists;async function n6(r,e,t="utf-8"){let n=nT.dirname(r);return await r6(n)||await iT.mkdirs(n),gy.writeFile(r,e,t)}function i6(r,...e){let t=nT.dirname(r);gy.existsSync(t)||iT.mkdirsSync(t),gy.writeFileSync(r,...e)}sT.exports={outputFile:t6(n6),outputFileSync:i6}});var aT=g((Sfe,oT)=>{"use strict";var{stringify:s6}=od(),{outputFile:o6}=ld();async function a6(r,e,t={}){let n=s6(e,t);await o6(r,n,t)}oT.exports=a6});var lT=g((Tfe,cT)=>{"use strict";var{stringify:c6}=od(),{outputFileSync:l6}=ld();function u6(r,e,t){let n=c6(e,t);l6(r,n,t)}cT.exports=u6});var dT=g((Cfe,uT)=>{"use strict";var d6=dt().fromPromise,Ut=rT();Ut.outputJson=d6(aT());Ut.outputJsonSync=lT();Ut.outputJSON=Ut.outputJson;Ut.outputJSONSync=Ut.outputJsonSync;Ut.writeJSON=Ut.writeJson;Ut.writeJSONSync=Ut.writeJsonSync;Ut.readJSON=Ut.readJson;Ut.readJSONSync=Ut.readJsonSync;uT.exports=Ut});var gT=g((xfe,mT)=>{"use strict";var f6=qt(),fT=ie("path"),{copy:h6}=sd(),{remove:pT}=Kc(),{mkdirp:p6}=Ir(),{pathExists:m6}=hi(),hT=Os();async function g6(r,e,t={}){let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await hT.checkPaths(r,e,"move",t);await hT.checkParentPaths(r,i,e,"move");let o=fT.dirname(e);return fT.parse(o).root!==o&&await p6(o),y6(r,e,n,s)}async function y6(r,e,t,n){if(!n){if(t)await pT(e);else if(await m6(e))throw new Error("dest already exists.")}try{await f6.rename(r,e)}catch(i){if(i.code!=="EXDEV")throw i;await v6(r,e,t)}}async function v6(r,e,t){return await h6(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),pT(r)}mT.exports=g6});var ET=g((Ofe,_T)=>{"use strict";var vT=Do(),vy=ie("path"),b6=sd().copySync,bT=Kc().removeSync,_6=Ir().mkdirpSync,yT=Os();function E6(r,e,t){t=t||{};let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=yT.checkPathsSync(r,e,"move",t);return yT.checkParentPathsSync(r,i,e,"move"),A6(e)||_6(vy.dirname(e)),w6(r,e,n,s)}function A6(r){let e=vy.dirname(r);return vy.parse(e).root===e}function w6(r,e,t,n){if(n)return yy(r,e,t);if(t)return bT(e),yy(r,e,t);if(vT.existsSync(e))throw new Error("dest already exists.");return yy(r,e,t)}function yy(r,e,t){try{vT.renameSync(r,e)}catch(n){if(n.code!=="EXDEV")throw n;return S6(r,e,t)}}function S6(r,e,t){return b6(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),bT(r)}_T.exports=E6});var wT=g((Ife,AT)=>{"use strict";var T6=dt().fromPromise;AT.exports={move:T6(gT()),moveSync:ET()}});var TT=g((Pfe,ST)=>{"use strict";ST.exports={...qt(),...sd(),...wS(),...QS(),...dT(),...Ir(),...wT(),...ld(),...hi(),...Kc()}});var xT=g(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.Metadata=void 0;ud.Metadata=function(e){let t=new Map,n={set(i,s){if(i=Bo(i),Array.isArray(s))if(s.length===0)t.delete(i);else{for(let o of s)by(i,o);t.set(i,i.endsWith("-bin")?s:[s.join(", ")])}else by(i,s),t.set(i,[s]);return n},append(i,s){i=Bo(i),by(i,s);let o=t.get(i);return o==null&&(o=[],t.set(i,o)),o.push(s),i.endsWith("-bin")||t.set(i,[o.join(", ")]),n},delete(i){i=Bo(i),t.delete(i)},get(i){var s;return i=Bo(i),(s=t.get(i))===null||s===void 0?void 0:s[0]},getAll(i){var s;return i=Bo(i),(s=t.get(i))!==null&&s!==void 0?s:[]},has(i){return i=Bo(i),t.has(i)},[Symbol.iterator](){return t[Symbol.iterator]()}};if(e!=null){let i=x6(e)?e:Object.entries(e);for(let[s,o]of i)n.set(s,o)}return n};function Bo(r){return r.toLowerCase()}function by(r,e){if(!/^[0-9a-z_.-]+$/.test(r))throw new Error(`Metadata key '${r}' contains illegal characters`);if(r.endsWith("-bin")){if(!(e instanceof Uint8Array))throw new Error(`Metadata key '${r}' ends with '-bin', thus it must have binary value`)}else{if(typeof e!="string")throw new Error(`Metadata key '${r}' doesn't end with '-bin', thus it must have string value`);if(!/^[ -~]*$/.test(e))throw new Error(`Metadata value '${e}' of key '${r}' contains illegal characters`)}}function x6(r){return Symbol.iterator in r}});var dd=g(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.Status=void 0;var O6;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(O6=Qc.Status||(Qc.Status={}))});var IT=g(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0})});var kT=g(PT=>{"use strict";Object.defineProperty(PT,"__esModule",{value:!0})});var NT=g(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:!0})});var MT=g(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.composeClientMiddleware=void 0;function I6(r,e){return(t,n)=>e(Object.assign(Object.assign({},t),{next:(i,s)=>r(Object.assign(Object.assign({},t),{request:i}),s)}),n)}fd.composeClientMiddleware=I6});var _y={};$u(_y,{ExtendableError:()=>hd,default:()=>P6});var hd,P6,Ey=Lt(()=>{"use strict";hd=class extends Error{constructor(...e){super(...e);var t=e.length>0&&typeof e[0]=="string"?e[0]:"";(this.name===void 0||this.name==="Error")&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:this.constructor.name,writable:!0}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(this,"stack",{configurable:!0,enumerable:!1,value:"",writable:!0}),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack===""&&(this.stack=new Error(t).stack)}},P6=hd});var DT=g(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.ClientError=void 0;var k6=(Ey(),$r(_y)),R6=dd(),Ay=class r extends k6.ExtendableError{constructor(e,t,n){super(`${e} ${R6.Status[t]}: ${n}`),this.path=e,this.code=t,this.details=n,this.name="ClientError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ClientError",{value:!0})}static[Symbol.hasInstance](e){return this!==r?this.prototype.isPrototypeOf(e):typeof e=="object"&&e!==null&&(e.constructor===r||e["@@nice-grpc:ClientError"]===!0||e.name==="ClientError"&&e["@@nice-grpc"]===!0)}};pd.ClientError=Ay});var FT=g(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0})});var BT=g(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0})});var UT=g(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.composeServerMiddleware=void 0;function N6(r,e){return(t,n)=>r(Object.assign(Object.assign({},t),{next:(i,s)=>e(Object.assign(Object.assign({},t),{request:i}),s)}),n)}md.composeServerMiddleware=N6});var jT=g(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.ServerError=void 0;var M6=(Ey(),$r(_y)),D6=dd(),wy=class r extends M6.ExtendableError{constructor(e,t){super(`${D6.Status[e]}: ${t}`),this.code=e,this.details=t,this.name="ServerError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ServerError",{value:!0})}static[Symbol.hasInstance](e){return this!==r?this.prototype.isPrototypeOf(e):typeof e=="object"&&e!==null&&(e.constructor===r||e["@@nice-grpc:ServerError"]===!0||e.name==="ServerError"&&e["@@nice-grpc"]===!0)}};gd.ServerError=wy});var jt=g(vt=>{"use strict";var L6=vt&&vt.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Pr=vt&&vt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&L6(e,r,t)};Object.defineProperty(vt,"__esModule",{value:!0});Pr(xT(),vt);Pr(dd(),vt);Pr(IT(),vt);Pr(kT(),vt);Pr(NT(),vt);Pr(MT(),vt);Pr(DT(),vt);Pr(FT(),vt);Pr(BT(),vt);Pr(UT(),vt);Pr(jT(),vt)});var ge=g(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=_r.DEFAULT_MAX_SEND_MESSAGE_LENGTH=_r.Propagate=_r.LogVerbosity=_r.Status=void 0;var zT;(function(r){r[r.OK=0]="OK",r[r.CANCELLED=1]="CANCELLED",r[r.UNKNOWN=2]="UNKNOWN",r[r.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",r[r.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",r[r.NOT_FOUND=5]="NOT_FOUND",r[r.ALREADY_EXISTS=6]="ALREADY_EXISTS",r[r.PERMISSION_DENIED=7]="PERMISSION_DENIED",r[r.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",r[r.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",r[r.ABORTED=10]="ABORTED",r[r.OUT_OF_RANGE=11]="OUT_OF_RANGE",r[r.UNIMPLEMENTED=12]="UNIMPLEMENTED",r[r.INTERNAL=13]="INTERNAL",r[r.UNAVAILABLE=14]="UNAVAILABLE",r[r.DATA_LOSS=15]="DATA_LOSS",r[r.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(zT||(_r.Status=zT={}));var HT;(function(r){r[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.ERROR=2]="ERROR",r[r.NONE=3]="NONE"})(HT||(_r.LogVerbosity=HT={}));var GT;(function(r){r[r.DEADLINE=1]="DEADLINE",r[r.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",r[r.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",r[r.CANCELLATION=8]="CANCELLATION",r[r.DEFAULTS=65535]="DEFAULTS"})(GT||(_r.Propagate=GT={}));_r.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;_r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var Sy=g((Kfe,F6)=>{F6.exports={name:"@grpc/grpc-js",version:"1.13.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run generate-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto"},dependencies:{"@grpc/proto-loader":"^0.7.13","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/*.proto","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var Me=g(sr=>{"use strict";var Ty,Cy,xy,Oy;Object.defineProperty(sr,"__esModule",{value:!0});sr.log=sr.setLoggerVerbosity=sr.setLogger=sr.getLogger=void 0;sr.trace=J6;sr.isTracerEnabled=WT;var gi=ge(),q6=ie("process"),B6=Sy().version,U6={error:(r,...e)=>{console.error("E "+r,...e)},info:(r,...e)=>{console.error("I "+r,...e)},debug:(r,...e)=>{console.error("D "+r,...e)}},Is=U6,Uo=gi.LogVerbosity.ERROR,j6=(Cy=(Ty=process.env.GRPC_NODE_VERBOSITY)!==null&&Ty!==void 0?Ty:process.env.GRPC_VERBOSITY)!==null&&Cy!==void 0?Cy:"";switch(j6.toUpperCase()){case"DEBUG":Uo=gi.LogVerbosity.DEBUG;break;case"INFO":Uo=gi.LogVerbosity.INFO;break;case"ERROR":Uo=gi.LogVerbosity.ERROR;break;case"NONE":Uo=gi.LogVerbosity.NONE;break;default:}var z6=()=>Is;sr.getLogger=z6;var H6=r=>{Is=r};sr.setLogger=H6;var G6=r=>{Uo=r};sr.setLoggerVerbosity=G6;var V6=(r,...e)=>{let t;if(r>=Uo){switch(r){case gi.LogVerbosity.DEBUG:t=Is.debug;break;case gi.LogVerbosity.INFO:t=Is.info;break;case gi.LogVerbosity.ERROR:t=Is.error;break}t||(t=Is.error),t&&t.bind(Is)(...e)}};sr.log=V6;var W6=(Oy=(xy=process.env.GRPC_NODE_TRACE)!==null&&xy!==void 0?xy:process.env.GRPC_TRACE)!==null&&Oy!==void 0?Oy:"",Iy=new Set,VT=new Set;for(let r of W6.split(","))r.startsWith("-")?VT.add(r.substring(1)):Iy.add(r);var K6=Iy.has("all");function J6(r,e,t){WT(e)&&(0,sr.log)(r,new Date().toISOString()+" | v"+B6+" "+q6.pid+" | "+e+" | "+t)}function WT(r){return!VT.has(r)&&(K6||Iy.has(r))}});var vd=g(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.getErrorMessage=Q6;yd.getErrorCode=Y6;function Q6(r){return r instanceof Error?r.message:String(r)}function Y6(r){return typeof r=="object"&&r!==null&&"code"in r&&typeof r.code=="number"?r.code:null}});var Pt=g(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.Metadata=void 0;var $6=Me(),Z6=ge(),X6=vd(),eB=/^[0-9a-z_.-]+$/,tB=/^[ -~]*$/;function rB(r){return eB.test(r)}function nB(r){return tB.test(r)}function JT(r){return r.endsWith("-bin")}function iB(r){return!r.startsWith("grpc-")}function bd(r){return r.toLowerCase()}function KT(r,e){if(!rB(r))throw new Error('Metadata key "'+r+'" contains illegal characters');if(e!=null)if(JT(r)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!nB(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var Py=class r{constructor(e={}){this.internalRepr=new Map,this.options=e}set(e,t){e=bd(e),KT(e,t),this.internalRepr.set(e,[t])}add(e,t){e=bd(e),KT(e,t);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[t]):n.push(t)}remove(e){e=bd(e),this.internalRepr.delete(e)}get(e){return e=bd(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,n]of this.internalRepr)if(n.length>0){let i=n[0];e[t]=Buffer.isBuffer(i)?Buffer.from(i):i}return e}clone(){let e=new r(this.options),t=e.internalRepr;for(let[n,i]of this.internalRepr){let s=i.map(o=>Buffer.isBuffer(o)?Buffer.from(o):o);t.set(n,s)}return e}merge(e){for(let[t,n]of e.internalRepr){let i=(this.internalRepr.get(t)||[]).concat(n);this.internalRepr.set(t,i)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,n]of this.internalRepr)e[t]=n.map(sB);return e}toJSON(){let e={};for(let[t,n]of this.internalRepr)e[t]=n;return e}static fromHttp2Headers(e){let t=new r;for(let n of Object.keys(e)){if(n.charAt(0)===":")continue;let i=e[n];try{JT(n)?Array.isArray(i)?i.forEach(s=>{t.add(n,Buffer.from(s,"base64"))}):i!==void 0&&(iB(n)?i.split(",").forEach(s=>{t.add(n,Buffer.from(s.trim(),"base64"))}):t.add(n,Buffer.from(i,"base64"))):Array.isArray(i)?i.forEach(s=>{t.add(n,s)}):i!==void 0&&t.add(n,i)}catch(s){let o=`Failed to add metadata entry ${n}: ${i}. ${(0,X6.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,$6.log)(Z6.LogVerbosity.ERROR,o)}}return t}};_d.Metadata=Py;var sB=r=>Buffer.isBuffer(r)?r.toString("base64"):r});var Ad=g(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.CallCredentials=void 0;var My=Pt();function oB(r){return"getRequestHeaders"in r&&typeof r.getRequestHeaders=="function"}var jo=class r{static createFromMetadataGenerator(e){return new Ry(e)}static createFromGoogleCredential(e){return r.createFromMetadataGenerator((t,n)=>{let i;oB(e)?i=e.getRequestHeaders(t.service_url):i=new Promise((s,o)=>{e.getRequestMetadata(t.service_url,(a,c)=>{if(a){o(a);return}if(!c){o(new Error("Headers not set by metadata plugin"));return}s(c)})}),i.then(s=>{let o=new My.Metadata;for(let a of Object.keys(s))o.add(a,s[a]);n(null,o)},s=>{n(s)})})}static createEmpty(){return new Ny}};Ed.CallCredentials=jo;var ky=class r extends jo{constructor(e){super(),this.creds=e}async generateMetadata(e){let t=new My.Metadata,n=await Promise.all(this.creds.map(i=>i.generateMetadata(e)));for(let i of n)t.merge(i);return t}compose(e){return new r(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof r?this.creds.every((t,n)=>t._equals(e.creds[n])):!1}},Ry=class r extends jo{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,n)=>{this.metadataGenerator(e,(i,s)=>{s!==void 0?t(s):n(i)})})}compose(e){return new ky([this,e])}_equals(e){return this===e?!0:e instanceof r?this.metadataGenerator===e.metadataGenerator:!1}},Ny=class r extends jo{generateMetadata(e){return Promise.resolve(new My.Metadata)}compose(e){return e}_equals(e){return e instanceof r}}});var Ly=g(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.CIPHER_SUITES=void 0;Yc.getDefaultRootsData=cB;var aB=ie("fs");Yc.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var QT=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,Dy=null;function cB(){return QT?(Dy===null&&(Dy=aB.readFileSync(QT)),Dy):null}});var Qt=g(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.parseUri=uB;zo.splitHostPort=dB;zo.combineHostPort=fB;zo.uriToString=hB;var lB=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function uB(r){let e=lB.exec(r);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var YT=/^\d+$/;function dB(r){if(r.startsWith("[")){let e=r.indexOf("]");if(e===-1)return null;let t=r.substring(1,e);if(t.indexOf(":")===-1)return null;if(r.length>e+1)if(r[e+1]===":"){let n=r.substring(e+2);return YT.test(n)?{host:t,port:+n}:null}else return null;else return{host:t}}else{let e=r.split(":");return e.length===2?YT.test(e[1])?{host:e[0],port:+e[1]}:null:{host:r}}}function fB(r){return r.port===void 0?r.host:r.host.includes(":")?`[${r.host}]:${r.port}`:`${r.host}:${r.port}`}function hB(r){let e="";return r.scheme!==void 0&&(e+=r.scheme+":"),r.authority!==void 0&&(e+="//"+r.authority+"/"),e+=r.path,e}});var Xr=g(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.registerResolver=pB;Ps.registerDefaultScheme=mB;Ps.createResolver=gB;Ps.getDefaultAuthority=yB;Ps.mapUriDefaultScheme=vB;var qy=Qt(),Ho={},Fy=null;function pB(r,e){Ho[r]=e}function mB(r){Fy=r}function gB(r,e,t){if(r.scheme!==void 0&&r.scheme in Ho)return new Ho[r.scheme](r,e,t);throw new Error(`No resolver could be created for target ${(0,qy.uriToString)(r)}`)}function yB(r){if(r.scheme!==void 0&&r.scheme in Ho)return Ho[r.scheme].getDefaultAuthority(r);throw new Error(`Invalid target ${(0,qy.uriToString)(r)}`)}function vB(r){return r.scheme===void 0||!(r.scheme in Ho)?Fy!==null?{scheme:Fy,authority:void 0,path:(0,qy.uriToString)(r)}:null:r}});var Xc=g(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.ChannelCredentials=void 0;Zc.createCertificateProviderChannelCredentials=AB;var $c=ie("tls"),Td=Ad(),Uy=Ly(),$T=Qt(),bB=Xr(),_B=Me(),EB=ge();function By(r,e){if(r&&!(r instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var ks=class{compose(e){return new Hy(this,e)}static createSsl(e,t,n,i){var s;if(By(e,"Root certificate"),By(t,"Private key"),By(n,"Certificate chain"),t&&!n)throw new Error("Private key must be given with accompanying certificate chain");if(!t&&n)throw new Error("Certificate chain must be given with accompanying private key");let o=(0,$c.createSecureContext)({ca:(s=e??(0,Uy.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:t??void 0,cert:n??void 0,ciphers:Uy.CIPHER_SUITES});return new wd(o,i??{})}static createFromSecureContext(e,t){return new wd(e,t??{})}static createInsecure(){return new jy}};Zc.ChannelCredentials=ks;var jy=class r extends ks{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof r}_createSecureConnector(e,t,n){return{connect(i){return Promise.resolve({socket:i,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n??Td.CallCredentials.createEmpty(),destroy(){}}}};function ZT(r,e,t,n){var i,s;let o={secureContext:r},a=t;if("grpc.http_connect_target"in n){let d=(0,$T.parseUri)(n["grpc.http_connect_target"]);d&&(a=d)}let c=(0,bB.getDefaultAuthority)(a),l=(0,$T.splitHostPort)(c),u=(i=l?.host)!==null&&i!==void 0?i:c;if(o.host=u,e.checkServerIdentity&&(o.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(o.rejectUnauthorized=e.rejectUnauthorized),o.ALPNProtocols=["h2"],n["grpc.ssl_target_name_override"]){let d=n["grpc.ssl_target_name_override"],f=(s=o.checkServerIdentity)!==null&&s!==void 0?s:$c.checkServerIdentity;o.checkServerIdentity=(h,m)=>f(d,m),o.servername=d}else o.servername=u;return n["grpc-node.tls_enable_trace"]&&(o.enableTrace=!0),o}var zy=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let t=Object.assign({socket:e},this.connectionOptions);return new Promise((n,i)=>{let s=(0,$c.connect)(t,()=>{var o;if((!((o=this.connectionOptions.rejectUnauthorized)!==null&&o!==void 0)||o)&&!s.authorized){i(s.authorizationError);return}n({socket:s,secure:!0})});s.on("error",o=>{i(o)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},wd=class r extends ks{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,n){let i=ZT(this.secureContext,this.verifyOptions,e,t);return new zy(i,n??Td.CallCredentials.createEmpty())}},Sd=class r extends ks{constructor(e,t,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=n,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,n;return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((t=this.verifyOptions)===null||t===void 0?void 0:t.checkServerIdentity)===((n=e.verifyOptions)===null||n===void 0?void 0:n.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,t,n){return this.ref(),new r.SecureConnectorImpl(this,e,t,n??Td.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let 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!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,t;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,$c.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(t=this.latestIdentityUpdate)===null||t===void 0?void 0:t.certificate,ciphers:Uy.CIPHER_SUITES})}catch(n){return(0,_B.log)(EB.LogVerbosity.ERROR,"Failed to createSecureContext with error "+n.message),null}}};Sd.SecureConnectorImpl=class{constructor(r,e,t,n){this.parent=r,this.channelTarget=e,this.options=t,this.callCredentials=n}connect(r){return new Promise((e,t)=>{let n=this.parent.getLatestSecureContext();if(!n){t(new Error("Failed to load credentials"));return}r.closed&&t(new Error("Socket closed while loading credentials"));let i=ZT(n,this.parent.verifyOptions,this.channelTarget,this.options),s=Object.assign({socket:r},i),o=()=>{t(new Error("Socket closed"))},a=l=>{t(l)},c=(0,$c.connect)(s,()=>{var l;if(c.removeListener("close",o),c.removeListener("error",a),(!((l=this.parent.verifyOptions.rejectUnauthorized)!==null&&l!==void 0)||l)&&!c.authorized){t(c.authorizationError);return}e({socket:c,secure:!0})});c.once("close",o),c.once("error",a)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function AB(r,e,t){return new Sd(r,e,t??{})}var Hy=class r extends ks{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let t=this.callCredentials.compose(e);return new r(this.channelCredentials,t)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof r?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,t,n){let i=this.callCredentials.compose(n??Td.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,i)}}});var Rs=g(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.createChildChannelControlHelper=TB;en.registerLoadBalancerType=CB;en.registerDefaultLoadBalancerType=xB;en.createLoadBalancer=OB;en.isLoadBalancerNameRegistered=IB;en.parseLoadBalancingConfig=XT;en.getDefaultConfig=PB;en.selectLbConfigFromList=kB;var wB=Me(),SB=ge();function TB(r,e){var t,n,i,s,o,a,c,l,u,d;return{createSubchannel:(n=(t=e.createSubchannel)===null||t===void 0?void 0:t.bind(e))!==null&&n!==void 0?n:r.createSubchannel.bind(r),updateState:(s=(i=e.updateState)===null||i===void 0?void 0:i.bind(e))!==null&&s!==void 0?s:r.updateState.bind(r),requestReresolution:(a=(o=e.requestReresolution)===null||o===void 0?void 0:o.bind(e))!==null&&a!==void 0?a:r.requestReresolution.bind(r),addChannelzChild:(l=(c=e.addChannelzChild)===null||c===void 0?void 0:c.bind(e))!==null&&l!==void 0?l:r.addChannelzChild.bind(r),removeChannelzChild:(d=(u=e.removeChannelzChild)===null||u===void 0?void 0:u.bind(e))!==null&&d!==void 0?d:r.removeChannelzChild.bind(r)}}var yi={},el=null;function CB(r,e,t){yi[r]={LoadBalancer:e,LoadBalancingConfig:t}}function xB(r){el=r}function OB(r,e){let t=r.getLoadBalancerName();return t in yi?new yi[t].LoadBalancer(e):null}function IB(r){return r in yi}function XT(r){let e=Object.keys(r);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let t=e[0];if(t in yi)try{return yi[t].LoadBalancingConfig.createFromJson(r[t])}catch(n){throw new Error(`${t}: ${n.message}`)}else throw new Error(`Unrecognized load balancing config name ${t}`)}function PB(){if(!el)throw new Error("No default load balancer type registered");return new yi[el].LoadBalancingConfig}function kB(r,e=!1){for(let t of r)try{return XT(t)}catch(n){(0,wB.log)(SB.LogVerbosity.DEBUG,"Config parsing failed with error",n.message);continue}return e&&el?new yi[el].LoadBalancingConfig:null}});var Gy=g(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.validateRetryThrottling=eC;tl.validateServiceConfig=tC;tl.extractAndSelectServiceConfig=jB;var RB=ie("os"),Cd=ge(),xd=/^\d+(\.\d{1,9})?s$/,NB="node";function MB(r){if("service"in r&&r.service!==""){if(typeof r.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof r.service}`);if("method"in r&&r.method!==""){if(typeof r.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof r.service}`);return{service:r.service,method:r.method}}else return{service:r.service}}else{if("method"in r&&r.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function DB(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in r)||typeof r.initialBackoff!="string"||!xd.test(r.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 r)||typeof r.maxBackoff!="string"||!xd.test(r.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 r)||typeof r.backoffMultiplier!="number"||r.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in r&&Array.isArray(r.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(r.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of r.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Cd.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Cd.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:r.maxAttempts,initialBackoff:r.initialBackoff,maxBackoff:r.maxBackoff,backoffMultiplier:r.backoffMultiplier,retryableStatusCodes:r.retryableStatusCodes}}function LB(r){if(!("maxAttempts"in r)||!Number.isInteger(r.maxAttempts)||r.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in r&&(typeof r.hedgingDelay!="string"||!xd.test(r.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 r&&Array.isArray(r.nonFatalStatusCodes))for(let t of r.nonFatalStatusCodes)if(typeof t=="number"){if(!Object.values(Cd.Status).includes(t))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof t=="string"){if(!Object.values(Cd.Status).includes(t.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:r.maxAttempts};return r.hedgingDelay&&(e.hedgingDelay=r.hedgingDelay),r.nonFatalStatusCodes&&(e.nonFatalStatusCodes=r.nonFatalStatusCodes),e}function FB(r){var e;let t={name:[]};if(!("name"in r)||!Array.isArray(r.name))throw new Error("Invalid method config: invalid name array");for(let n of r.name)t.name.push(MB(n));if("waitForReady"in r){if(typeof r.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");t.waitForReady=r.waitForReady}if("timeout"in r)if(typeof r.timeout=="object"){if(!("seconds"in r.timeout)||typeof r.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in r.timeout)||typeof r.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");t.timeout=r.timeout}else if(typeof r.timeout=="string"&&xd.test(r.timeout)){let n=r.timeout.substring(0,r.timeout.length-1).split(".");t.timeout={seconds:n[0]|0,nanos:((e=n[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in r){if(typeof r.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxRequestBytes=r.maxRequestBytes}if("maxResponseBytes"in r){if(typeof r.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");t.maxResponseBytes=r.maxResponseBytes}if("retryPolicy"in r){if("hedgingPolicy"in r)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");t.retryPolicy=DB(r.retryPolicy)}else"hedgingPolicy"in r&&(t.hedgingPolicy=LB(r.hedgingPolicy));return t}function eC(r){if(!("maxTokens"in r)||typeof r.maxTokens!="number"||r.maxTokens<=0||r.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in r)||typeof r.tokenRatio!="number"||r.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+r.maxTokens.toFixed(3),tokenRatio:+r.tokenRatio.toFixed(3)}}function qB(r){if(!(typeof r=="object"&&r!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof r}`);let e=Object.keys(r);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:r[e[0]]}}function tC(r){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in r)if(typeof r.loadBalancingPolicy=="string")e.loadBalancingPolicy=r.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in r)if(Array.isArray(r.loadBalancingConfig))for(let n of r.loadBalancingConfig)e.loadBalancingConfig.push(qB(n));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in r&&Array.isArray(r.methodConfig))for(let n of r.methodConfig)e.methodConfig.push(FB(n));"retryThrottling"in r&&(e.retryThrottling=eC(r.retryThrottling));let t=[];for(let n of e.methodConfig)for(let i of n.name){for(let s of t)if(i.service===s.service&&i.method===s.method)throw new Error(`Invalid service config: duplicate name ${i.service}/${i.method}`);t.push(i)}return e}function BB(r){if(!("serviceConfig"in r))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:tC(r.serviceConfig)};if("clientLanguage"in r)if(Array.isArray(r.clientLanguage)){e.clientLanguage=[];for(let n of r.clientLanguage)if(typeof n=="string")e.clientLanguage.push(n);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in r)if(Array.isArray(r.clientHostname)){e.clientHostname=[];for(let n of r.clientHostname)if(typeof n=="string")e.clientHostname.push(n);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in r)if(typeof r.percentage=="number"&&0<=r.percentage&&r.percentage<=100)e.percentage=r.percentage;else throw new Error("Invalid service config choice: invalid percentage");let t=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let n in r)if(!t.includes(n))throw new Error(`Invalid service config choice: unexpected field ${n}`);return e}function UB(r,e){if(!Array.isArray(r))throw new Error("Invalid service config list");for(let t of r){let n=BB(t);if(!(typeof n.percentage=="number"&&e>n.percentage)){if(Array.isArray(n.clientHostname)){let i=!1;for(let s of n.clientHostname)s===RB.hostname()&&(i=!0);if(!i)continue}if(Array.isArray(n.clientLanguage)){let i=!1;for(let s of n.clientLanguage)s===NB&&(i=!0);if(!i)continue}return n.serviceConfig}}throw new Error("No matching service config found")}function jB(r,e){for(let t of r)if(t.length>0&&t[0].startsWith("grpc_config=")){let n=t.join("").substring(12),i=JSON.parse(n);return UB(i,e)}return null}});var Er=g(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.ConnectivityState=void 0;var rC;(function(r){r[r.IDLE=0]="IDLE",r[r.CONNECTING=1]="CONNECTING",r[r.READY=2]="READY",r[r.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",r[r.SHUTDOWN=4]="SHUTDOWN"})(rC||(Od.ConnectivityState=rC={}))});var bi=g(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.QueuePicker=vi.UnavailablePicker=vi.PickResultType=void 0;var zB=Pt(),HB=ge(),Id;(function(r){r[r.COMPLETE=0]="COMPLETE",r[r.QUEUE=1]="QUEUE",r[r.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",r[r.DROP=3]="DROP"})(Id||(vi.PickResultType=Id={}));var Vy=class{constructor(e){this.status=Object.assign({code:HB.Status.UNAVAILABLE,details:"No connection established",metadata:new zB.Metadata},e)}pick(e){return{pickResultType:Id.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};vi.UnavailablePicker=Vy;var Wy=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:Id.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};vi.QueuePicker=Wy});var rl=g(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.BackoffTimeout=void 0;var GB=ge(),VB=Me(),WB="backoff",KB=1e3,JB=1.6,QB=12e4,YB=.2;function $B(r,e){return Math.random()*(e-r)+r}var Pd=class r{constructor(e,t){this.callback=e,this.initialDelay=KB,this.multiplier=JB,this.maxDelay=QB,this.jitter=YB,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(e){VB.trace(GB.LogVerbosity.DEBUG,WB,"{"+this.id+"} "+e)}runTimer(e){var t,n;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||(n=(t=this.timerId).unref)===null||n===void 0||n.call(t)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+$B(-t,t)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let 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,(t=(e=this.timerId).ref)===null||t===void 0||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)===null||t===void 0||t.call(e)}getEndTime(){return this.endTime}};kd.BackoffTimeout=Pd;Pd.nextId=0});var Nd=g(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.ChildLoadBalancerHandler=void 0;var ZB=Rs(),XB=Er(),e7="child_load_balancer_helper",Ky=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(t){this.parent=t,this.child=null}createSubchannel(t,n){return this.parent.channelControlHelper.createSubchannel(t,n)}updateState(t,n,i){var s;if(this.calledByPendingChild()){if(t===XB.ConnectivityState.CONNECTING)return;(s=this.parent.currentChild)===null||s===void 0||s.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(t,n,i)}requestReresolution(){var t;let n=(t=this.parent.pendingChild)!==null&&t!==void 0?t:this.parent.currentChild;this.child===n&&this.parent.channelControlHelper.requestReresolution()}setChild(t){this.child=t}addChannelzChild(t){this.parent.channelControlHelper.addChannelzChild(t)}removeChannelzChild(t){this.parent.channelControlHelper.removeChannelzChild(t)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,t,n){let i;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,t)){let s=new this.ChildPolicyHelper(this),o=(0,ZB.createLoadBalancer)(t,s);s.setChild(o),this.currentChild===null?(this.currentChild=o,i=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=o,i=this.pendingChild)}else this.pendingChild===null?i=this.currentChild:i=this.pendingChild;this.latestConfig=t,i.updateAddressList(e,t,n)}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 e7}};Rd.ChildLoadBalancerHandler=Ky});var iC=g(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.ResolvingLoadBalancer=void 0;var t7=Rs(),r7=Gy(),Yt=Er(),n7=Xr(),nl=bi(),i7=rl(),Jy=ge(),s7=Pt(),o7=Me(),a7=ge(),c7=Qt(),l7=Nd(),u7="resolving_load_balancer";function nC(r){o7.trace(a7.LogVerbosity.DEBUG,u7,r)}var d7=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function f7(r,e,t,n){for(let i of t.name)switch(n){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===r&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===r&&i.method===e)return!0}return!1}function h7(r,e,t,n){for(let i of t)if(f7(r,e,i,n))return i;return null}function p7(r){return{invoke(e,t){var n,i;let s=e.split("/").filter(c=>c.length>0),o=(n=s[0])!==null&&n!==void 0?n:"",a=(i=s[1])!==null&&i!==void 0?i:"";if(r&&r.methodConfig)for(let c of d7){let l=h7(o,a,r.methodConfig,c);if(l)return{methodConfig:l,pickInformation:{},status:Jy.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:Jy.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var Qy=class{constructor(e,t,n,i,s){this.target=e,this.channelControlHelper=t,this.channelOptions=n,this.onSuccessfulResolution=i,this.onFailedResolution=s,this.latestChildState=Yt.ConnectivityState.IDLE,this.latestChildPicker=new nl.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=Yt.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,n["grpc.service_config"]?this.defaultServiceConfig=(0,r7.validateServiceConfig)(JSON.parse(n["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(Yt.ConnectivityState.IDLE,new nl.QueuePicker(this),null),this.childLoadBalancer=new l7.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?(nC("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(a,c,l)=>{this.latestChildState=a,this.latestChildPicker=c,this.latestChildErrorMessage=l,this.updateState(a,c,l)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,n7.createResolver)(e,{onSuccessfulResolution:(a,c,l,u,d)=>{var f;this.backoffTimeout.stop(),this.backoffTimeout.reset();let h=null;c===null?l===null?(this.previousServiceConfig=null,h=this.defaultServiceConfig):this.previousServiceConfig===null?this.handleResolutionFailure(l):h=this.previousServiceConfig:(h=c,this.previousServiceConfig=c);let m=(f=h?.loadBalancingConfig)!==null&&f!==void 0?f:[],p=(0,t7.selectLbConfigFromList)(m,!0);if(p===null){this.handleResolutionFailure({code:Jy.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new s7.Metadata}),u?.unref();return}this.childLoadBalancer.updateAddressList(a,p,Object.assign(Object.assign({},this.channelOptions),d));let y=h??this.defaultServiceConfig;this.onSuccessfulResolution(y,u??p7(y))},onError:a=>{this.handleResolutionFailure(a)}},n);let o={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new i7.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},o),this.backoffTimeout.unref()}updateResolution(){this.innerResolver.updateResolution(),this.currentState===Yt.ConnectivityState.IDLE&&this.updateState(Yt.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){nC((0,c7.uriToString)(this.target)+" "+Yt.ConnectivityState[this.currentState]+" -> "+Yt.ConnectivityState[e]),e===Yt.ConnectivityState.IDLE&&(t=new nl.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===Yt.ConnectivityState.IDLE&&(this.updateState(Yt.ConnectivityState.TRANSIENT_FAILURE,new nl.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===Yt.ConnectivityState.IDLE||this.currentState===Yt.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=Yt.ConnectivityState.IDLE,this.latestChildPicker=new nl.QueuePicker(this),this.currentState=Yt.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};Md.ResolvingLoadBalancer=Qy});var sC=g(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.recognizedOptions=void 0;il.channelOptionsEqual=m7;il.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};function m7(r,e){let t=Object.keys(r).sort(),n=Object.keys(e).sort();if(t.length!==n.length)return!1;for(let i=0;i<t.length;i+=1)if(t[i]!==n[i]||r[t[i]]!==e[n[i]])return!1;return!0}});var Ar=g(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.EndpointMap=void 0;kr.isTcpSubchannelAddress=ol;kr.subchannelAddressEqual=Dd;kr.subchannelAddressToString=aC;kr.stringToSubchannelAddress=y7;kr.endpointEqual=v7;kr.endpointToString=b7;kr.endpointHasAddress=cC;var oC=ie("net");function ol(r){return"port"in r}function Dd(r,e){return!r&&!e?!0:!r||!e?!1:ol(r)?ol(e)&&r.host===e.host&&r.port===e.port:!ol(e)&&r.path===e.path}function aC(r){return ol(r)?(0,oC.isIPv6)(r.host)?"["+r.host+"]:"+r.port:r.host+":"+r.port:r.path}var g7=443;function y7(r,e){return(0,oC.isIP)(r)?{host:r,port:e??g7}:{path:r}}function v7(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t=0;t<r.addresses.length;t++)if(!Dd(r.addresses[t],e.addresses[t]))return!1;return!0}function b7(r){return"["+r.addresses.map(aC).join(", ")+"]"}function cC(r,e){for(let t of r.addresses)if(Dd(t,e))return!0;return!1}function sl(r,e){if(r.addresses.length!==e.addresses.length)return!1;for(let t of r.addresses){let n=!1;for(let i of e.addresses)if(Dd(t,i)){n=!0;break}if(!n)return!1}return!0}var Yy=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(cC(t.key,e))return t.value}deleteMissing(e){let t=[];for(let n of this.map){let i=!1;for(let s of e)sl(s,n.key)&&(i=!0);i||(t.push(n.value),this.map.delete(n))}return t}get(e){for(let t of this.map)if(sl(e,t.key))return t.value}set(e,t){for(let n of this.map)if(sl(e,n.key)){n.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(sl(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(sl(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};kr.EndpointMap=Yy});var uC={};$u(uC,{OrderedMap:()=>x7});function Go(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$y(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function _7(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ns(){throw new RangeError("Iterator access denied!")}var $y,lC,E7,A7,w7,S7,T7,C7,Nn,x7,dC=Lt(()=>{"use strict";$y=function(r,e){return $y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},$y(r,e)};lC=function(){function r(e,t,n){n===void 0&&(n=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=t,this.l=n}return r.prototype.v=function(){var e=this,t=e.h.h===e;if(t&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(t)return e.h;for(var n=e.h;n.t===e;)e=n,n=e.h;e=n}return e},r.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var t=e.h;t.i===e;)e=t,t=e.h;return e.i!==t?t:e}},r.prototype.T=function(){var e=this.h,t=this.i,n=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=n,n&&(n.h=this),t},r.prototype.I=function(){var e=this.h,t=this.t,n=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=n,n&&(n.h=this),t},r}(),E7=function(r){Go(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.O=1,t}return e.prototype.T=function(){var t=r.prototype.T.call(this);return this.M(),t.M(),t},e.prototype.I=function(){var t=r.prototype.I.call(this);return this.M(),t.M(),t},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e}(lC),A7=function(){function r(e){e===void 0&&(e=0),this.iteratorType=e}return r.prototype.equals=function(e){return this.C===e.C},r}(),w7=function(){function r(){this._=0}return Object.defineProperty(r.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),r.prototype.size=function(){return this._},r.prototype.empty=function(){return this._===0},r}(),S7=function(r){Go(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(w7);T7=function(r){Go(e,r);function e(t,n){t===void 0&&(t=function(s,o){return s<o?-1:s>o?1:0}),n===void 0&&(n=!1);var i=r.call(this)||this;return i.N=void 0,i.g=t,i.enableIndex=n,i.S=n?E7:lC,i.A=new i.S,i}return e.prototype.m=function(t,n){for(var i=this.A;t;){var s=this.g(t.u,n);if(s<0)t=t.i;else if(s>0)i=t,t=t.t;else return t}return i},e.prototype.B=function(t,n){for(var i=this.A;t;){var s=this.g(t.u,n);s<=0?t=t.i:(i=t,t=t.t)}return i},e.prototype.j=function(t,n){for(var i=this.A;t;){var s=this.g(t.u,n);if(s<0)i=t,t=t.i;else if(s>0)t=t.t;else return t}return i},e.prototype.k=function(t,n){for(var i=this.A;t;){var s=this.g(t.u,n);s<0?(i=t,t=t.i):t=t.t}return i},e.prototype.R=function(t){for(;;){var n=t.h;if(n===this.A)return;if(t.l===1){t.l=0;return}if(t===n.t){var i=n.i;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.T():n.T();else if(i.i&&i.i.l===1){i.l=n.l,n.l=0,i.i.l=0,n===this.N?this.N=n.T():n.T();return}else i.t&&i.t.l===1?(i.l=1,i.t.l=0,i.I()):(i.l=1,t=n)}else{var i=n.t;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.I():n.I();else if(i.t&&i.t.l===1){i.l=n.l,n.l=0,i.t.l=0,n===this.N?this.N=n.I():n.I();return}else i.i&&i.i.l===1?(i.l=1,i.i.l=0,i.T()):(i.l=1,t=n)}}},e.prototype.G=function(t){if(this._===1){this.clear();return}for(var n=t;n.t||n.i;){if(n.i)for(n=n.i;n.t;)n=n.t;else n=n.t;var i=t.u;t.u=n.u,n.u=i;var s=t.o;t.o=n.o,n.o=s,t=n}this.A.t===n?this.A.t=n.h:this.A.i===n&&(this.A.i=n.h),this.R(n);var o=n.h;if(n===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h},e.prototype.P=function(t){for(var n=typeof t=="number"?t:void 0,i=typeof t=="function"?t:void 0,s=typeof t>"u"?[]:void 0,o=0,a=this.N,c=[];c.length||a;)if(a)c.push(a),a=a.t;else{if(a=c.pop(),o===n)return a;s&&s.push(a),i&&i(a,o,this),o+=1,a=a.i}return s},e.prototype.q=function(t){for(;;){var n=t.h;if(n.l===0)return;var i=n.h;if(n===i.t){var s=i.i;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,t=i;continue}else if(t===n.i){if(t.l=0,t.t&&(t.t.h=n),t.i&&(t.i.h=i),n.i=t.t,i.t=t.i,t.t=n,t.i=i,i===this.N)this.N=t,this.A.h=t;else{var o=i.h;o.t===i?o.t=t:o.i=t}t.h=i.h,n.h=t,i.h=t,i.l=1}else{n.l=0,i===this.N?this.N=i.I():i.I(),i.l=1;return}}else{var s=i.t;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,t=i;continue}else if(t===n.t){if(t.l=0,t.t&&(t.t.h=i),t.i&&(t.i.h=n),i.i=t.t,n.t=t.i,t.t=i,t.i=n,i===this.N)this.N=t,this.A.h=t;else{var o=i.h;o.t===i?o.t=t:o.i=t}t.h=i.h,n.h=t,i.h=t,i.l=1}else{n.l=0,i===this.N?this.N=i.T():i.T(),i.l=1;return}}this.enableIndex&&(n.M(),i.M(),t.M());return}},e.prototype.D=function(t,n,i){if(this.N===void 0)return this._+=1,this.N=new this.S(t,n,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,o=this.A.t,a=this.g(o.u,t);if(a===0)return o.o=n,this._;if(a>0)o.t=new this.S(t,n),o.t.h=o,s=o.t,this.A.t=s;else{var c=this.A.i,l=this.g(c.u,t);if(l===0)return c.o=n,this._;if(l<0)c.i=new this.S(t,n),c.i.h=c,s=c.i,this.A.i=s;else{if(i!==void 0){var u=i.C;if(u!==this.A){var d=this.g(u.u,t);if(d===0)return u.o=n,this._;if(d>0){var f=u.v(),h=this.g(f.u,t);if(h===0)return f.o=n,this._;h<0&&(s=new this.S(t,n),f.i===void 0?(f.i=s,s.h=f):(u.t=s,s.h=u))}}}if(s===void 0)for(s=this.N;;){var m=this.g(s.u,t);if(m>0){if(s.t===void 0){s.t=new this.S(t,n),s.t.h=s,s=s.t;break}s=s.t}else if(m<0){if(s.i===void 0){s.i=new this.S(t,n),s.i.h=s,s=s.i;break}s=s.i}else return s.o=n,this._}}}if(this.enableIndex)for(var p=s.h;p!==this.A;)p.O+=1,p=p.h;return this.q(s),this._+=1,this._},e.prototype.F=function(t,n){for(;t;){var i=this.g(t.u,n);if(i<0)t=t.i;else if(i>0)t=t.t;else return t}return t||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(t,n){var i=t.C;if(i===this.A&&Ns(),this._===1)return i.u=n,!0;var s=i.p().u;if(i===this.A.t)return this.g(s,n)>0?(i.u=n,!0):!1;var o=i.v().u;return i===this.A.i?this.g(o,n)<0?(i.u=n,!0):!1:this.g(o,n)>=0||this.g(s,n)<=0?!1:(i.u=n,!0)},e.prototype.eraseElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var n=this.P(t);return this.G(n),this._},e.prototype.eraseElementByKey=function(t){if(this._===0)return!1;var n=this.F(this.N,t);return n===this.A?!1:(this.G(n),!0)},e.prototype.eraseElementByIterator=function(t){var n=t.C;n===this.A&&Ns();var i=n.i===void 0,s=t.iteratorType===0;return s?i&&t.next():(!i||n.t===void 0)&&t.next(),this.G(n),t},e.prototype.getHeight=function(){if(this._===0)return 0;function t(n){return n?Math.max(t(n.t),t(n.i))+1:0}return t(this.N)},e}(S7),C7=function(r){Go(e,r);function e(t,n,i){var s=r.call(this,i)||this;return s.C=t,s.A=n,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&Ns(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&Ns(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&Ns(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&Ns(),this.C=this.C.v(),this}),s}return Object.defineProperty(e.prototype,"index",{get:function(){var t=this.C,n=this.A.h;if(t===this.A)return n?n.O-1:0;var i=0;for(t.t&&(i+=t.t.O);t!==n;){var s=t.h;t===s.i&&(i+=1,s.t&&(i+=s.t.O)),t=s}return i},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e}(A7),Nn=function(r){Go(e,r);function e(t,n,i,s){var o=r.call(this,t,n,s)||this;return o.container=i,o}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&Ns();var t=this;return new Proxy([],{get:function(n,i){return i==="0"?t.C.u:i==="1"?t.C.o:(n[0]=t.C.u,n[1]=t.C.o,n[i])},set:function(n,i,s){if(i!=="1")throw new TypeError("prop must be 1");return t.C.o=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e}(C7),x7=function(r){Go(e,r);function e(t,n,i){t===void 0&&(t=[]);var s=r.call(this,n,i)||this,o=s;return t.forEach(function(a){o.setElement(a[0],a[1])}),s}return e.prototype.begin=function(){return new Nn(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Nn(this.A,this.A,this)},e.prototype.rBegin=function(){return new Nn(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Nn(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var t=this.A.t;return[t.u,t.o]}},e.prototype.back=function(){if(this._!==0){var t=this.A.i;return[t.u,t.o]}},e.prototype.lowerBound=function(t){var n=this.m(this.N,t);return new Nn(n,this.A,this)},e.prototype.upperBound=function(t){var n=this.B(this.N,t);return new Nn(n,this.A,this)},e.prototype.reverseLowerBound=function(t){var n=this.j(this.N,t);return new Nn(n,this.A,this)},e.prototype.reverseUpperBound=function(t){var n=this.k(this.N,t);return new Nn(n,this.A,this)},e.prototype.forEach=function(t){this.P(function(n,i,s){t([n.u,n.o],i,s)})},e.prototype.setElement=function(t,n,i){return this.D(t,n,i)},e.prototype.getElementByPos=function(t){if(t<0||t>this._-1)throw new RangeError;var n=this.P(t);return[n.u,n.o]},e.prototype.find=function(t){var n=this.F(this.N,t);return new Nn(n,this.A,this)},e.prototype.getElementByKey=function(t){var n=this.F(this.N,t);return n.o},e.prototype.union=function(t){var n=this;return t.forEach(function(i){n.setElement(i[0],i[1])}),this._},e.prototype[Symbol.iterator]=function(){var t,n,i,s;return _7(this,function(o){switch(o.label){case 0:t=this._,n=this.P(),i=0,o.label=1;case 1:return i<t?(s=n[i],[4,[s.u,s.o]]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2]}})},e}(T7)});var Fd=g(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.registerAdminService=O7;Ld.addAdminServicesToServer=I7;var fC=[];function O7(r,e){fC.push({getServiceDefinition:r,getHandlers:e})}function I7(r){for(let{getServiceDefinition:e,getHandlers:t}of fC)r.addService(e(),t())}});var hC=g(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.ClientDuplexStreamImpl=Rr.ClientWritableStreamImpl=Rr.ClientReadableStreamImpl=Rr.ClientUnaryCallImpl=void 0;Rr.callErrorFromStatus=k7;var P7=ie("events"),rv=ie("stream"),al=ge();function k7(r,e){let t=`${r.code} ${al.Status[r.code]}: ${r.details}`,i=`${new Error(t).stack}
|
9
|
+
for call at
|
10
|
+
${e}`;return Object.assign(new Error(t),r,{stack:i})}var Zy=class extends P7.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(al.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}};Rr.ClientUnaryCallImpl=Zy;var Xy=class extends rv.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(al.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}};Rr.ClientReadableStreamImpl=Xy;var ev=class extends rv.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(al.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_write(e,t,n){var i;let s={callback:n},o=Number(t);Number.isNaN(o)||(s.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(s,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};Rr.ClientWritableStreamImpl=ev;var tv=class extends rv.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(al.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,t;return(t=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?t:"unknown"}_read(e){var t;(t=this.call)===null||t===void 0||t.startRead()}_write(e,t,n){var i;let s={callback:n},o=Number(t);Number.isNaN(o)||(s.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(s,e)}_final(e){var t;(t=this.call)===null||t===void 0||t.halfClose(),e()}};Rr.ClientDuplexStreamImpl=tv});var pC=g(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.InterceptingListenerImpl=void 0;cl.isInterceptingListener=R7;function R7(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var nv=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,t=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextListener.onReceiveStatus(t)})}};cl.InterceptingListenerImpl=nv});var uv=g(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.InterceptingCall=Nr.RequesterBuilder=Nr.ListenerBuilder=Nr.InterceptorConfigurationError=void 0;Nr.getInterceptingCall=L7;var N7=Pt(),mC=pC(),gC=ge(),yC=vd(),ul=class r extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,r)}};Nr.InterceptorConfigurationError=ul;var sv=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}}};Nr.ListenerBuilder=sv;var ov=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}}};Nr.RequesterBuilder=ov;var iv={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveStatus:(r,e)=>{e(r)}},ll={start:(r,e,t)=>{t(r,e)},sendMessage:(r,e)=>{e(r)},halfClose:r=>{r()},cancel:r=>{r()}},av=class{constructor(e,t){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:(n=t.start)!==null&&n!==void 0?n:ll.start,sendMessage:(i=t.sendMessage)!==null&&i!==void 0?i:ll.sendMessage,halfClose:(s=t.halfClose)!==null&&s!==void 0?s:ll.halfClose,cancel:(o=t.cancel)!==null&&o!==void 0?o:ll.cancel}:this.requester=ll}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,t){var n,i,s,o,a,c;let l={onReceiveMetadata:(i=(n=t?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(t))!==null&&i!==void 0?i:u=>{},onReceiveMessage:(o=(s=t?.onReceiveMessage)===null||s===void 0?void 0:s.bind(t))!==null&&o!==void 0?o:u=>{},onReceiveStatus:(c=(a=t?.onReceiveStatus)===null||a===void 0?void 0:a.bind(t))!==null&&c!==void 0?c:u=>{}};this.processingMetadata=!0,this.requester.start(e,l,(u,d)=>{var f,h,m;this.processingMetadata=!1;let p;if((0,mC.isInterceptingListener)(d))p=d;else{let y={onReceiveMetadata:(f=d.onReceiveMetadata)!==null&&f!==void 0?f:iv.onReceiveMetadata,onReceiveMessage:(h=d.onReceiveMessage)!==null&&h!==void 0?h:iv.onReceiveMessage,onReceiveStatus:(m=d.onReceiveStatus)!==null&&m!==void 0?m:iv.onReceiveStatus};p=new mC.InterceptingListenerImpl(y,l)}this.nextCall.start(u,p),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,n),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()})}};Nr.InterceptingCall=av;function M7(r,e,t){var n,i;let s=(n=t.deadline)!==null&&n!==void 0?n:1/0,o=t.host,a=(i=t.parent)!==null&&i!==void 0?i:null,c=t.propagate_flags,l=t.credentials,u=r.createCall(e,s,o,a,c);return l&&u.setCredentials(l),u}var qd=class{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 n;try{n=this.methodDefinition.requestSerialize(t)}catch(i){this.call.cancelWithStatus(gC.Status.INTERNAL,`Request message serialization failure: ${(0,yC.getErrorMessage)(i)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,t){let n=null;this.call.start(e,{onReceiveMetadata:i=>{var s;(s=t?.onReceiveMetadata)===null||s===void 0||s.call(t,i)},onReceiveMessage:i=>{var s;let o;try{o=this.methodDefinition.responseDeserialize(i)}catch(a){n={code:gC.Status.INTERNAL,details:`Response message parsing error: ${(0,yC.getErrorMessage)(a)}`,metadata:new N7.Metadata},this.call.cancelWithStatus(n.code,n.details);return}(s=t?.onReceiveMessage)===null||s===void 0||s.call(t,o)},onReceiveStatus:i=>{var s,o;n?(s=t?.onReceiveStatus)===null||s===void 0||s.call(t,n):(o=t?.onReceiveStatus)===null||o===void 0||o.call(t,i)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}},cv=class extends qd{constructor(e,t){super(e,t)}start(e,t){var n,i;let s=!1,o={onReceiveMetadata:(i=(n=t?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(t))!==null&&i!==void 0?i:a=>{},onReceiveMessage:a=>{var c;s=!0,(c=t?.onReceiveMessage)===null||c===void 0||c.call(t,a)},onReceiveStatus:a=>{var c,l;s||(c=t?.onReceiveMessage)===null||c===void 0||c.call(t,null),(l=t?.onReceiveStatus)===null||l===void 0||l.call(t,a)}};super.start(e,o),this.call.startRead()}},lv=class extends qd{};function D7(r,e,t){let n=M7(r,t.path,e);return t.responseStream?new lv(n,t):new cv(n,t)}function L7(r,e,t,n){if(r.clientInterceptors.length>0&&r.clientInterceptorProviders.length>0)throw new ul("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(r.callInterceptors.length>0&&r.callInterceptorProviders.length>0)throw new ul("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];r.callInterceptors.length>0||r.callInterceptorProviders.length>0?i=[].concat(r.callInterceptors,r.callInterceptorProviders.map(a=>a(e))).filter(a=>a):i=[].concat(r.clientInterceptors,r.clientInterceptorProviders.map(a=>a(e))).filter(a=>a);let s=Object.assign({},t,{method_definition:e});return i.reduceRight((a,c)=>l=>c(l,a),a=>D7(n,a,e))(s)}});var hv=g(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.Client=void 0;var tn=hC(),F7=pv(),q7=Er(),_i=ge(),Vo=Pt(),Bd=uv(),Mr=Symbol(),Wo=Symbol(),Ko=Symbol(),Mn=Symbol();function dv(r){return typeof r=="function"}function Jo(r){var e;return((e=r.stack)===null||e===void 0?void 0:e.split(`
|
11
|
+
`).slice(1).join(`
|
12
|
+
`))||"no stack trace available"}var fv=class{constructor(e,t,n={}){var i,s;if(n=Object.assign({},n),this[Wo]=(i=n.interceptors)!==null&&i!==void 0?i:[],delete n.interceptors,this[Ko]=(s=n.interceptor_providers)!==null&&s!==void 0?s:[],delete n.interceptor_providers,this[Wo].length>0&&this[Ko].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[Mn]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[Mr]=n.channelOverride;else if(n.channelFactoryOverride){let o=n.channelFactoryOverride;delete n.channelFactoryOverride,this[Mr]=o(e,t,n)}else this[Mr]=new F7.ChannelImplementation(e,t,n)}close(){this[Mr].close()}getChannel(){return this[Mr]}waitForReady(e,t){let n=i=>{if(i){t(new Error("Failed to connect before the deadline"));return}let s;try{s=this[Mr].getConnectivityState(!0)}catch{t(new Error("The channel has been closed"));return}if(s===q7.ConnectivityState.READY)t();else try{this[Mr].watchConnectivityState(s,e,n)}catch{t(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,n){if(dv(e))return{metadata:new Vo.Metadata,options:{},callback:e};if(dv(t))return e instanceof Vo.Metadata?{metadata:e,options:{},callback:t}:{metadata:new Vo.Metadata,options:e,callback:t};if(!(e instanceof Vo.Metadata&&t instanceof Object&&dv(n)))throw new Error("Incorrect arguments passed");return{metadata:e,options:t,callback:n}}makeUnaryRequest(e,t,n,i,s,o,a){var c,l;let u=this.checkOptionalUnaryResponseArguments(s,o,a),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:t,responseDeserialize:n},f={argument:i,metadata:u.metadata,call:new tn.ClientUnaryCallImpl,channel:this[Mr],methodDefinition:d,callOptions:u.options,callback:u.callback};this[Mn]&&(f=this[Mn](f));let h=f.call,m={clientInterceptors:this[Wo],clientInterceptorProviders:this[Ko],callInterceptors:(c=f.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},p=(0,Bd.getInterceptingCall)(m,f.methodDefinition,f.callOptions,f.channel);h.call=p;let y=null,b=!1,E=new Error;return p.start(f.metadata,{onReceiveMetadata:x=>{h.emit("metadata",x)},onReceiveMessage(x){y!==null&&p.cancelWithStatus(_i.Status.UNIMPLEMENTED,"Too many responses received"),y=x},onReceiveStatus(x){if(!b){if(b=!0,x.code===_i.Status.OK)if(y===null){let S=Jo(E);f.callback((0,tn.callErrorFromStatus)({code:_i.Status.UNIMPLEMENTED,details:"No message received",metadata:x.metadata},S))}else f.callback(null,y);else{let S=Jo(E);f.callback((0,tn.callErrorFromStatus)(x,S))}E=null,h.emit("status",x)}}}),p.sendMessage(i),p.halfClose(),h}makeClientStreamRequest(e,t,n,i,s,o){var a,c;let l=this.checkOptionalUnaryResponseArguments(i,s,o),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:t,responseDeserialize:n},d={metadata:l.metadata,call:new tn.ClientWritableStreamImpl(t),channel:this[Mr],methodDefinition:u,callOptions:l.options,callback:l.callback};this[Mn]&&(d=this[Mn](d));let f=d.call,h={clientInterceptors:this[Wo],clientInterceptorProviders:this[Ko],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},m=(0,Bd.getInterceptingCall)(h,d.methodDefinition,d.callOptions,d.channel);f.call=m;let p=null,y=!1,b=new Error;return m.start(d.metadata,{onReceiveMetadata:E=>{f.emit("metadata",E)},onReceiveMessage(E){p!==null&&m.cancelWithStatus(_i.Status.UNIMPLEMENTED,"Too many responses received"),p=E,m.startRead()},onReceiveStatus(E){if(!y){if(y=!0,E.code===_i.Status.OK)if(p===null){let x=Jo(b);d.callback((0,tn.callErrorFromStatus)({code:_i.Status.UNIMPLEMENTED,details:"No message received",metadata:E.metadata},x))}else d.callback(null,p);else{let x=Jo(b);d.callback((0,tn.callErrorFromStatus)(E,x))}b=null,f.emit("status",E)}}}),f}checkMetadataAndOptions(e,t){let n,i;return e instanceof Vo.Metadata?(n=e,t?i=t:i={}):(e?i=e:i={},n=new Vo.Metadata),{metadata:n,options:i}}makeServerStreamRequest(e,t,n,i,s,o){var a,c;let l=this.checkMetadataAndOptions(s,o),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:t,responseDeserialize:n},d={argument:i,metadata:l.metadata,call:new tn.ClientReadableStreamImpl(n),channel:this[Mr],methodDefinition:u,callOptions:l.options};this[Mn]&&(d=this[Mn](d));let f=d.call,h={clientInterceptors:this[Wo],clientInterceptorProviders:this[Ko],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},m=(0,Bd.getInterceptingCall)(h,d.methodDefinition,d.callOptions,d.channel);f.call=m;let p=!1,y=new Error;return m.start(d.metadata,{onReceiveMetadata(b){f.emit("metadata",b)},onReceiveMessage(b){f.push(b)},onReceiveStatus(b){if(!p){if(p=!0,f.push(null),b.code!==_i.Status.OK){let E=Jo(y);f.emit("error",(0,tn.callErrorFromStatus)(b,E))}y=null,f.emit("status",b)}}}),m.sendMessage(i),m.halfClose(),f}makeBidiStreamRequest(e,t,n,i,s){var o,a;let c=this.checkMetadataAndOptions(i,s),l={path:e,requestStream:!0,responseStream:!0,requestSerialize:t,responseDeserialize:n},u={metadata:c.metadata,call:new tn.ClientDuplexStreamImpl(t,n),channel:this[Mr],methodDefinition:l,callOptions:c.options};this[Mn]&&(u=this[Mn](u));let d=u.call,f={clientInterceptors:this[Wo],clientInterceptorProviders:this[Ko],callInterceptors:(o=u.callOptions.interceptors)!==null&&o!==void 0?o:[],callInterceptorProviders:(a=u.callOptions.interceptor_providers)!==null&&a!==void 0?a:[]},h=(0,Bd.getInterceptingCall)(f,u.methodDefinition,u.callOptions,u.channel);d.call=h;let m=!1,p=new Error;return h.start(u.metadata,{onReceiveMetadata(y){d.emit("metadata",y)},onReceiveMessage(y){d.push(y)},onReceiveStatus(y){if(!m){if(m=!0,d.push(null),y.code!==_i.Status.OK){let b=Jo(p);d.emit("error",(0,tn.callErrorFromStatus)(y,b))}p=null,d.emit("status",y)}}}),d}};Ud.Client=fv});var gv=g(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.makeClientConstructor=vC;jd.loadPackageDefinition=z7;var dl=hv(),B7={unary:dl.Client.prototype.makeUnaryRequest,server_stream:dl.Client.prototype.makeServerStreamRequest,client_stream:dl.Client.prototype.makeClientStreamRequest,bidi:dl.Client.prototype.makeBidiStreamRequest};function mv(r){return["__proto__","prototype","constructor"].includes(r)}function vC(r,e,t){t||(t={});class n extends dl.Client{}return Object.keys(r).forEach(i=>{if(mv(i))return;let s=r[i],o;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");s.requestStream?s.responseStream?o="bidi":o="client_stream":s.responseStream?o="server_stream":o="unary";let a=s.requestSerialize,c=s.responseDeserialize,l=U7(B7[o],s.path,a,c);n.prototype[i]=l,Object.assign(n.prototype[i],s),s.originalName&&!mv(s.originalName)&&(n.prototype[s.originalName]=n.prototype[i])}),n.service=r,n.serviceName=e,n}function U7(r,e,t,n){return function(...i){return r.call(this,e,t,n,...i)}}function j7(r){return"format"in r}function z7(r){let e={};for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let n=r[t],i=t.split(".");if(i.some(a=>mv(a)))continue;let s=i[i.length-1],o=e;for(let a of i.slice(0,-1))o[a]||(o[a]={}),o=o[a];j7(n)?o[s]=n:o[s]=vC(n,s,{})}return e}});var HC=g((bhe,zC)=>{"use strict";var H7=1/0,G7="[object Symbol]",V7=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,W7=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hd="\\ud800-\\udfff",CC="\\u0300-\\u036f\\ufe20-\\ufe23",xC="\\u20d0-\\u20f0",OC="\\u2700-\\u27bf",IC="a-z\\xdf-\\xf6\\xf8-\\xff",K7="\\xac\\xb1\\xd7\\xf7",J7="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Q7="\\u2000-\\u206f",Y7=" \\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",PC="A-Z\\xc0-\\xd6\\xd8-\\xde",kC="\\ufe0e\\ufe0f",RC=K7+J7+Q7+Y7,vv="['\u2019]",$7="["+Hd+"]",bC="["+RC+"]",zd="["+CC+xC+"]",NC="\\d+",Z7="["+OC+"]",MC="["+IC+"]",DC="[^"+Hd+RC+NC+OC+IC+PC+"]",yv="\\ud83c[\\udffb-\\udfff]",X7="(?:"+zd+"|"+yv+")",LC="[^"+Hd+"]",bv="(?:\\ud83c[\\udde6-\\uddff]){2}",_v="[\\ud800-\\udbff][\\udc00-\\udfff]",Qo="["+PC+"]",FC="\\u200d",_C="(?:"+MC+"|"+DC+")",eU="(?:"+Qo+"|"+DC+")",EC="(?:"+vv+"(?:d|ll|m|re|s|t|ve))?",AC="(?:"+vv+"(?:D|LL|M|RE|S|T|VE))?",qC=X7+"?",BC="["+kC+"]?",tU="(?:"+FC+"(?:"+[LC,bv,_v].join("|")+")"+BC+qC+")*",UC=BC+qC+tU,rU="(?:"+[Z7,bv,_v].join("|")+")"+UC,nU="(?:"+[LC+zd+"?",zd,bv,_v,$7].join("|")+")",iU=RegExp(vv,"g"),sU=RegExp(zd,"g"),oU=RegExp(yv+"(?="+yv+")|"+nU+UC,"g"),aU=RegExp([Qo+"?"+MC+"+"+EC+"(?="+[bC,Qo,"$"].join("|")+")",eU+"+"+AC+"(?="+[bC,Qo+_C,"$"].join("|")+")",Qo+"?"+_C+"+"+EC,Qo+"+"+AC,NC,rU].join("|"),"g"),cU=RegExp("["+FC+Hd+CC+xC+kC+"]"),lU=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,uU={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},dU=typeof global=="object"&&global&&global.Object===Object&&global,fU=typeof self=="object"&&self&&self.Object===Object&&self,hU=dU||fU||Function("return this")();function pU(r,e,t,n){var i=-1,s=r?r.length:0;for(n&&s&&(t=r[++i]);++i<s;)t=e(t,r[i],i,r);return t}function mU(r){return r.split("")}function gU(r){return r.match(V7)||[]}function yU(r){return function(e){return r?.[e]}}var vU=yU(uU);function jC(r){return cU.test(r)}function bU(r){return lU.test(r)}function _U(r){return jC(r)?EU(r):mU(r)}function EU(r){return r.match(oU)||[]}function AU(r){return r.match(aU)||[]}var wU=Object.prototype,SU=wU.toString,wC=hU.Symbol,SC=wC?wC.prototype:void 0,TC=SC?SC.toString:void 0;function TU(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=r[n+e];return s}function CU(r){if(typeof r=="string")return r;if(kU(r))return TC?TC.call(r):"";var e=r+"";return e=="0"&&1/r==-H7?"-0":e}function xU(r,e,t){var n=r.length;return t=t===void 0?n:t,!e&&t>=n?r:TU(r,e,t)}function OU(r){return function(e){e=Gd(e);var t=jC(e)?_U(e):void 0,n=t?t[0]:e.charAt(0),i=t?xU(t,1).join(""):e.slice(1);return n[r]()+i}}function IU(r){return function(e){return pU(LU(MU(e).replace(iU,"")),r,"")}}function PU(r){return!!r&&typeof r=="object"}function kU(r){return typeof r=="symbol"||PU(r)&&SU.call(r)==G7}function Gd(r){return r==null?"":CU(r)}var RU=IU(function(r,e,t){return e=e.toLowerCase(),r+(t?NU(e):e)});function NU(r){return DU(Gd(r).toLowerCase())}function MU(r){return r=Gd(r),r&&r.replace(W7,vU).replace(sU,"")}var DU=OU("toUpperCase");function LU(r,e,t){return r=Gd(r),e=t?void 0:e,e===void 0?bU(r)?AU(r):gU(r):r.match(e)||[]}zC.exports=RU});var VC=g((_he,GC)=>{"use strict";GC.exports=Ev;function Ev(r,e){typeof r=="string"&&(e=r,r=void 0);var t=[];function n(s){if(typeof s!="string"){var o=i();if(Ev.verbose&&console.log("codegen: "+o),o="return "+o,s){for(var a=Object.keys(s),c=new Array(a.length+1),l=new Array(a.length),u=0;u<a.length;)c[u]=a[u],l[u]=s[a[u++]];return c[u]=o,Function.apply(null,c).apply(null,l)}return Function(o)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,s=s.replace(/%([%dfijs])/g,function(m,p){var y=d[f++];switch(p){case"d":case"f":return String(Number(y));case"i":return String(Math.floor(y));case"j":return JSON.stringify(y);case"s":return String(y)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return t.push(s),n}function i(s){return"function "+(s||e||"")+"("+(r&&r.join(",")||"")+`){
|
13
|
+
`+t.join(`
|
14
|
+
`)+`
|
15
|
+
}`}return n.toString=i,n}Ev.verbose=!1});var KC=g((Ehe,WC)=>{"use strict";WC.exports=fl;var FU=gF(),qU=yF(),Av=qU("fs");function fl(r,e,t){return typeof e=="function"?(t=e,e={}):e||(e={}),t?!e.xhr&&Av&&Av.readFile?Av.readFile(r,function(i,s){return i&&typeof XMLHttpRequest<"u"?fl.xhr(r,e,t):i?t(i):t(null,e.binary?s:s.toString("utf8"))}):fl.xhr(r,e,t):FU(fl,this,r,e)}fl.xhr=function(e,t,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){if(i.status!==0&&i.status!==200)return n(Error("status "+i.status));if(t.binary){var o=i.response;if(!o){o=[];for(var a=0;a<i.responseText.length;++a)o.push(i.responseText.charCodeAt(a)&255)}return n(null,typeof Uint8Array<"u"?new Uint8Array(o):o)}return n(null,i.responseText)}},t.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()}});var YC=g(QC=>{"use strict";var Sv=QC,JC=Sv.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},wv=Sv.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var t=e.split("/"),n=JC(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("/")};Sv.resolve=function(e,t,n){return n||(t=wv(t)),JC(t)?t:(n||(e=wv(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?wv(e+"/"+t):t)}});var $o=g((whe,XC)=>{"use strict";XC.exports=be;var Vd=Ai();((be.prototype=Object.create(Vd.prototype)).constructor=be).className="Namespace";var Tv=Ei(),Wd=ht(),BU=Ls(),Ms,Yo,Ds;be.fromJSON=function(e,t){return new be(e,t.options).addJSON(t.nested)};function $C(r,e){if(r&&r.length){for(var t={},n=0;n<r.length;++n)t[r[n].name]=r[n].toJSON(e);return t}}be.arrayToJSON=$C;be.isReservedId=function(e,t){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!="string"&&e[n][0]<=t&&e[n][1]>t)return!0}return!1};be.isReservedName=function(e,t){if(e){for(var n=0;n<e.length;++n)if(e[n]===t)return!0}return!1};function be(r,e){Vd.call(this,r,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function ZC(r){r._nestedArray=null,r._lookupCache={};for(var e=r;e=e.parent;)e._lookupCache={};return r}Object.defineProperty(be.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=Wd.toArray(this.nested))}});be.prototype.toJSON=function(e){return Wd.toObject(["options",this.options,"nested",$C(this.nestedArray,e)])};be.prototype.addJSON=function(e){var t=this;if(e)for(var n=Object.keys(e),i=0,s;i<n.length;++i)s=e[n[i]],t.add((s.fields!==void 0?Ms.fromJSON:s.values!==void 0?Ds.fromJSON:s.methods!==void 0?Yo.fromJSON:s.id!==void 0?Tv.fromJSON:be.fromJSON)(n[i],s));return this};be.prototype.get=function(e){return this.nested&&this.nested[e]||null};be.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof Ds)return this.nested[e].values;throw Error("no such enum: "+e)};be.prototype.add=function(e){if(!(e instanceof Tv&&e.extend!==void 0||e instanceof Ms||e instanceof BU||e instanceof Ds||e instanceof Yo||e instanceof be))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof be&&e instanceof be&&!(t instanceof Ms||t instanceof Yo)){for(var n=t.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof Ms||this instanceof Yo||this instanceof Ds||this instanceof Tv||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var s=this;s=s.parent;)s._needsRecursiveFeatureResolution=!0,s._needsRecursiveResolve=!0;return e.onAdd(this),ZC(this)};be.prototype.remove=function(e){if(!(e instanceof Vd))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),ZC(this)};be.prototype.define=function(e,t){if(Wd.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 n=this;e.length>0;){var i=e.shift();if(n.nested&&n.nested[i]){if(n=n.nested[i],!(n instanceof be))throw Error("path conflicts with non-namespace objects")}else n.add(n=new be(i))}return t&&n.addJSON(t),n};be.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 be?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this};be.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,Vd.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};be.prototype.lookup=function(e,t,n){if(typeof t=="boolean"?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),Wd.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var i=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),t);var s=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+i];if(s&&(!t||t.indexOf(s.constructor)>-1)||(s=this._lookupImpl(e,i),s&&(!t||t.indexOf(s.constructor)>-1)))return s;if(n)return null;for(var o=this;o.parent;){if(s=o.parent._lookupImpl(e,i),s&&(!t||t.indexOf(s.constructor)>-1))return s;o=o.parent}return null};be.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var n=this.get(e[0]),i=null;if(n)e.length===1?i=n:n instanceof be&&(e=e.slice(1),i=n._lookupImpl(e,e.join(".")));else for(var s=0;s<this.nestedArray.length;++s)this._nestedArray[s]instanceof be&&(n=this._nestedArray[s]._lookupImpl(e,t))&&(i=n);return this._lookupCache[t]=i,i};be.prototype.lookupType=function(e){var t=this.lookup(e,[Ms]);if(!t)throw Error("no such type: "+e);return t};be.prototype.lookupEnum=function(e){var t=this.lookup(e,[Ds]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t};be.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[Ms,Ds]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t};be.prototype.lookupService=function(e){var t=this.lookup(e,[Yo]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t};be._configure=function(r,e,t){Ms=r,Yo=e,Ds=t}});var Kd=g((She,ex)=>{"use strict";ex.exports=Dn;var Cv=Ei();((Dn.prototype=Object.create(Cv.prototype)).constructor=Dn).className="MapField";var UU=Fs(),hl=ht();function Dn(r,e,t,n,i,s){if(Cv.call(this,r,e,n,void 0,void 0,i,s),!hl.isString(t))throw TypeError("keyType must be a string");this.keyType=t,this.resolvedKeyType=null,this.map=!0}Dn.fromJSON=function(e,t){return new Dn(e,t.id,t.keyType,t.type,t.options,t.comment)};Dn.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return hl.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};Dn.prototype.resolve=function(){if(this.resolved)return this;if(UU.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return Cv.prototype.resolve.call(this)};Dn.d=function(e,t,n){return typeof n=="function"?n=hl.decorateType(n).name:n&&typeof n=="object"&&(n=hl.decorateEnum(n).name),function(s,o){hl.decorateType(s.constructor).add(new Dn(o,e,t,n))}}});var Jd=g((The,tx)=>{"use strict";tx.exports=qs;var xv=Ai();((qs.prototype=Object.create(xv.prototype)).constructor=qs).className="Method";var Zo=ht();function qs(r,e,t,n,i,s,o,a,c){if(Zo.isObject(i)?(o=i,i=s=void 0):Zo.isObject(s)&&(o=s,s=void 0),!(e===void 0||Zo.isString(e)))throw TypeError("type must be a string");if(!Zo.isString(t))throw TypeError("requestType must be a string");if(!Zo.isString(n))throw TypeError("responseType must be a string");xv.call(this,r,o),this.type=e||"rpc",this.requestType=t,this.requestStream=i?!0:void 0,this.responseType=n,this.responseStream=s?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=c}qs.fromJSON=function(e,t){return new qs(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)};qs.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Zo.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])};qs.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),xv.prototype.resolve.call(this))}});var Qd=g((Che,nx)=>{"use strict";nx.exports=or;var Ln=$o();((or.prototype=Object.create(Ln.prototype)).constructor=or).className="Service";var Ov=Jd(),pl=ht(),jU=_F();function or(r,e){Ln.call(this,r,e),this.methods={},this._methodsArray=null}or.fromJSON=function(e,t){var n=new or(e,t.options);if(t.methods)for(var i=Object.keys(t.methods),s=0;s<i.length;++s)n.add(Ov.fromJSON(i[s],t.methods[i[s]]));return t.nested&&n.addJSON(t.nested),t.edition&&(n._edition=t.edition),n.comment=t.comment,n._defaultEdition="proto3",n};or.prototype.toJSON=function(e){var t=Ln.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return pl.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",Ln.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])};Object.defineProperty(or.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=pl.toArray(this.methods))}});function rx(r){return r._methodsArray=null,r}or.prototype.get=function(e){return this.methods[e]||Ln.prototype.get.call(this,e)};or.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Ln.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this};or.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Ln.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this};or.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof Ov?(this.methods[e.name]=e,e.parent=this,rx(this)):Ln.prototype.add.call(this,e)};or.prototype.remove=function(e){if(e instanceof Ov){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,rx(this)}return Ln.prototype.remove.call(this,e)};or.prototype.create=function(e,t,n){for(var i=new jU.Service(e,t,n),s=0,o;s<this.methodsArray.length;++s){var a=pl.lcFirst((o=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[a]=pl.codegen(["r","c"],pl.isReserved(a)?a+"_":a)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return i}});var Yd=g((xhe,ix)=>{"use strict";ix.exports=rn;var zU=Cw();function rn(r){if(r)for(var e=Object.keys(r),t=0;t<e.length;++t)this[e[t]]=r[e[t]]}rn.create=function(e){return this.$type.create(e)};rn.encode=function(e,t){return this.$type.encode(e,t)};rn.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)};rn.decode=function(e){return this.$type.decode(e)};rn.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};rn.verify=function(e){return this.$type.verify(e)};rn.fromObject=function(e){return this.$type.fromObject(e)};rn.toObject=function(e,t){return this.$type.toObject(e,t)};rn.prototype.toJSON=function(){return this.$type.toObject(this,zU.toJSONOptions)}});var Iv=g((Ohe,ox)=>{"use strict";ox.exports=VU;var HU=Dr(),Fn=Fs(),sx=ht();function GU(r){return"missing required '"+r.name+"'"}function VU(r){for(var e=sx.codegen(["r","l","e"],r.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(r.fieldsArray.filter(function(a){return a.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),t=0;t<r.fieldsArray.length;++t){var n=r._fieldsArray[t].resolve(),i=n.resolvedType instanceof HU?"int32":n.type,s="m"+sx.safeProp(n.name);e("case %i: {",n.id),n.map?(e("if(%s===util.emptyObject)",s)("%s={}",s)("var c2 = r.uint32()+r.pos"),Fn.defaults[n.keyType]!==void 0?e("k=%j",Fn.defaults[n.keyType]):e("k=null"),Fn.defaults[i]!==void 0?e("value=%j",Fn.defaults[i]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",n.keyType)("case 2:"),Fn.basic[i]===void 0?e("value=types[%i].decode(r,r.uint32())",t):e("value=r.%s()",i),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),Fn.long[n.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',s):e("%s[k]=value",s)):n.repeated?(e("if(!(%s&&%s.length))",s,s)("%s=[]",s),Fn.packed[i]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",s,i)("}else"),Fn.basic[i]===void 0?e(n.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",s,t):e("%s.push(r.%s())",s,i)):Fn.basic[i]===void 0?e(n.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",s,t):e("%s=r.%s()",s,i),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),t=0;t<r._fieldsArray.length;++t){var o=r._fieldsArray[t];o.required&&e("if(!m.hasOwnProperty(%j))",o.name)("throw util.ProtocolError(%j,{instance:m})",GU(o))}return e("return m")}});var Rv=g((Ihe,ax)=>{"use strict";ax.exports=JU;var WU=Dr(),Pv=ht();function wr(r,e){return r.name+": "+e+(r.repeated&&e!=="array"?"[]":r.map&&e!=="object"?"{k:"+r.keyType+"}":"")+" expected"}function kv(r,e,t,n){if(e.resolvedType)if(e.resolvedType instanceof WU){r("switch(%s){",n)("default:")("return%j",wr(e,"enum value"));for(var i=Object.keys(e.resolvedType.values),s=0;s<i.length;++s)r("case %i:",e.resolvedType.values[i[s]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",t,n)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",n)("return%j",wr(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",wr(e,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',n)("return%j",wr(e,"number"));break;case"bool":r('if(typeof %s!=="boolean")',n)("return%j",wr(e,"boolean"));break;case"string":r("if(!util.isString(%s))",n)("return%j",wr(e,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",wr(e,"buffer"));break}return r}function KU(r,e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.key32Re.test(%s))",t)("return%j",wr(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.key64Re.test(%s))",t)("return%j",wr(e,"integer|Long key"));break;case"bool":r("if(!util.key2Re.test(%s))",t)("return%j",wr(e,"boolean key"));break}return r}function JU(r){var e=Pv.codegen(["m"],r.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),t=r.oneofsArray,n={};t.length&&e("var p={}");for(var i=0;i<r.fieldsArray.length;++i){var s=r._fieldsArray[i].resolve(),o="m"+Pv.safeProp(s.name);if(s.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",o,s.name),s.map)e("if(!util.isObject(%s))",o)("return%j",wr(s,"object"))("var k=Object.keys(%s)",o)("for(var i=0;i<k.length;++i){"),KU(e,s,"k[i]"),kv(e,s,i,o+"[k[i]]")("}");else if(s.repeated)e("if(!Array.isArray(%s))",o)("return%j",wr(s,"array"))("for(var i=0;i<%s.length;++i){",o),kv(e,s,i,o+"[i]")("}");else{if(s.partOf){var a=Pv.safeProp(s.partOf.name);n[s.partOf.name]===1&&e("if(p%s===1)",a)("return%j",s.partOf.name+": multiple values"),n[s.partOf.name]=1,e("p%s=1",a)}kv(e,s,i,o)}s.optional&&e("}")}return e("return null")}});var Dv=g(lx=>{"use strict";var cx=lx,ml=Dr(),nn=ht();function Nv(r,e,t,n){var i=!1;if(e.resolvedType)if(e.resolvedType instanceof ml){r("switch(d%s){",n);for(var s=e.resolvedType.values,o=Object.keys(s),a=0;a<o.length;++a)s[o[a]]===e.typeDefault&&!i&&(r("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),e.repeated||r("break"),i=!0),r("case%j:",o[a])("case %i:",s[o[a]])("m%s=%j",n,s[o[a]])("break");r("}")}else r('if(typeof d%s!=="object")',n)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,t,n);else{var c=!1;switch(e.type){case"double":case"float":r("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":r("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":r("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":r('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":r("m%s=String(d%s)",n,n);break;case"bool":r("m%s=Boolean(d%s)",n,n);break}}return r}cx.fromObject=function(e){var t=e.fieldsArray,n=nn.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var i=0;i<t.length;++i){var s=t[i].resolve(),o=nn.safeProp(s.name);s.map?(n("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),Nv(n,s,i,o+"[ks[i]]")("}")("}")):s.repeated?(n("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),Nv(n,s,i,o+"[i]")("}")("}")):(s.resolvedType instanceof ml||n("if(d%s!=null){",o),Nv(n,s,i,o),s.resolvedType instanceof ml||n("}"))}return n("return m")};function Mv(r,e,t,n){if(e.resolvedType)e.resolvedType instanceof ml?r("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,t,n,n,t,n,n):r("d%s=types[%i].toObject(m%s,o)",n,t,n);else{var i=!1;switch(e.type){case"double":case"float":r("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("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",n,n,n,n,i?"true":"",n);break;case"bytes":r("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",n,n,n,n,n);break;default:r("d%s=m%s",n,n);break}}return r}cx.toObject=function(e){var t=e.fieldsArray.slice().sort(nn.compareFieldsById);if(!t.length)return nn.codegen()("return {}");for(var n=nn.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],s=[],o=[],a=0;a<t.length;++a)t[a].partOf||(t[a].resolve().repeated?i:t[a].map?s:o).push(t[a]);if(i.length){for(n("if(o.arrays||o.defaults){"),a=0;a<i.length;++a)n("d%s=[]",nn.safeProp(i[a].name));n("}")}if(s.length){for(n("if(o.objects||o.defaults){"),a=0;a<s.length;++a)n("d%s={}",nn.safeProp(s[a].name));n("}")}if(o.length){for(n("if(o.defaults){"),a=0;a<o.length;++a){var c=o[a],l=nn.safeProp(c.name);if(c.resolvedType instanceof ml)n("d%s=o.enums===String?%j:%j",l,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var u="["+Array.prototype.slice.call(c.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%s",l,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else n("d%s=%j",l,c.typeDefault)}n("}")}var d=!1;for(a=0;a<t.length;++a){var c=t[a],f=e._fieldsArray.indexOf(c),l=nn.safeProp(c.name);c.map?(d||(d=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),Mv(n,c,f,l+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),Mv(n,c,f,l+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",l,c.name),Mv(n,c,f,l),c.partOf&&n("if(o.oneofs)")("d%s=%j",nn.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}});var Lv=g(ux=>{"use strict";var QU=ux,YU=Yd();QU[".google.protobuf.Any"]={fromObject:function(r){if(r&&r["@type"]){var e=r["@type"].substring(r["@type"].lastIndexOf("/")+1),t=this.lookup(e);if(t){var n=r["@type"].charAt(0)==="."?r["@type"].slice(1):r["@type"];return n.indexOf("/")===-1&&(n="/"+n),this.create({type_url:n,value:t.encode(t.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,e){var t="type.googleapis.com/",n="",i="";if(e&&e.json&&r.type_url&&r.value){i=r.type_url.substring(r.type_url.lastIndexOf("/")+1),n=r.type_url.substring(0,r.type_url.lastIndexOf("/")+1);var s=this.lookup(i);s&&(r=s.decode(r.value))}if(!(r instanceof this.ctor)&&r instanceof YU){var o=r.$type.toObject(r,e),a=r.$type.fullName[0]==="."?r.$type.fullName.slice(1):r.$type.fullName;return n===""&&(n=t),i=n+a,o["@type"]=i,o}return this.toObject(r,e)}}});var Xd=g((Rhe,fx)=>{"use strict";fx.exports=Re;var Sr=$o();((Re.prototype=Object.create(Sr.prototype)).constructor=Re).className="Type";var $U=Dr(),Bv=Ls(),$d=Ei(),ZU=Kd(),XU=Qd(),Fv=Yd(),qv=bF(),e8=vF(),kt=ht(),t8=Uv(),r8=Iv(),n8=Rv(),dx=Dv(),i8=Lv();function Re(r,e){Sr.call(this,r,e),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}Object.defineProperties(Re.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),e=0;e<r.length;++e){var t=this.fields[r[e]],n=t.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=t}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=kt.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=kt.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Re.generateConstructor(this)())},set:function(r){var e=r.prototype;e instanceof Fv||((r.prototype=new Fv).constructor=r,kt.merge(r.prototype,e)),r.$type=r.prototype.$type=this,kt.merge(r,Fv,!0),this._ctor=r;for(var t=0;t<this.fieldsArray.length;++t)this._fieldsArray[t].resolve();var n={};for(t=0;t<this.oneofsArray.length;++t)n[this._oneofsArray[t].resolve().name]={get:kt.oneOfGetter(this._oneofsArray[t].oneof),set:kt.oneOfSetter(this._oneofsArray[t].oneof)};t&&Object.defineProperties(r.prototype,n)}}});Re.generateConstructor=function(e){for(var t=kt.codegen(["p"],e.name),n=0,i;n<e.fieldsArray.length;++n)(i=e._fieldsArray[n]).map?t("this%s={}",kt.safeProp(i.name)):i.repeated&&t("this%s=[]",kt.safeProp(i.name));return t("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]]")};function Zd(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Re.fromJSON=function(e,t){var n=new Re(e,t.options);n.extensions=t.extensions,n.reserved=t.reserved;for(var i=Object.keys(t.fields),s=0;s<i.length;++s)n.add((typeof t.fields[i[s]].keyType<"u"?ZU.fromJSON:$d.fromJSON)(i[s],t.fields[i[s]]));if(t.oneofs)for(i=Object.keys(t.oneofs),s=0;s<i.length;++s)n.add(Bv.fromJSON(i[s],t.oneofs[i[s]]));if(t.nested)for(i=Object.keys(t.nested),s=0;s<i.length;++s){var o=t.nested[i[s]];n.add((o.id!==void 0?$d.fromJSON:o.fields!==void 0?Re.fromJSON:o.values!==void 0?$U.fromJSON:o.methods!==void 0?XU.fromJSON:Sr.fromJSON)(i[s],o))}return t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),t.group&&(n.group=!0),t.comment&&(n.comment=t.comment),t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n};Re.prototype.toJSON=function(e){var t=Sr.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return kt.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"oneofs",Sr.arrayToJSON(this.oneofsArray,e),"fields",Sr.arrayToJSON(this.fieldsArray.filter(function(i){return!i.declaringField}),e)||{},"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",t&&t.nested||void 0,"comment",n?this.comment:void 0])};Re.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Sr.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();return this};Re.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Sr.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this};Re.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null};Re.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof $d&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),Zd(this)}return e instanceof Bv?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),Zd(this)):Sr.prototype.add.call(this,e)};Re.prototype.remove=function(e){if(e instanceof $d&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),Zd(this)}if(e instanceof Bv){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),Zd(this)}return Sr.prototype.remove.call(this,e)};Re.prototype.isReservedId=function(e){return Sr.isReservedId(this.reserved,e)};Re.prototype.isReservedName=function(e){return Sr.isReservedName(this.reserved,e)};Re.prototype.create=function(e){return new this.ctor(e)};Re.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=t8(this)({Writer:e8,types:t,util:kt}),this.decode=r8(this)({Reader:qv,types:t,util:kt}),this.verify=n8(this)({types:t,util:kt}),this.fromObject=dx.fromObject(this)({types:t,util:kt}),this.toObject=dx.toObject(this)({types:t,util:kt});var i=i8[e];if(i){var s=Object.create(this);s.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(s),s.toObject=this.toObject,this.toObject=i.toObject.bind(s)}return this};Re.prototype.encode=function(e,t){return this.setup().encode(e,t)};Re.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()};Re.prototype.decode=function(e,t){return this.setup().decode(e,t)};Re.prototype.decodeDelimited=function(e){return e instanceof qv||(e=qv.create(e)),this.decode(e,e.uint32())};Re.prototype.verify=function(e){return this.setup().verify(e)};Re.prototype.fromObject=function(e){return this.setup().fromObject(e)};Re.prototype.toObject=function(e,t){return this.setup().toObject(e,t)};Re.d=function(e){return function(n){kt.decorateType(n,e)}}});var nf=g((Nhe,mx)=>{"use strict";mx.exports=ar;var rf=$o();((ar.prototype=Object.create(rf.prototype)).constructor=ar).className="Root";var ef=Ei(),jv=Dr(),s8=Ls(),wi=ht(),zv,Hv,gl;function ar(r){rf.call(this,"",r),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}ar.fromJSON=function(e,t){return t||(t=new ar),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()};ar.prototype.resolvePath=wi.path.resolve;ar.prototype.fetch=wi.fetch;function px(){}ar.prototype.load=function r(e,t,n){typeof t=="function"&&(n=t,t=void 0);var i=this;if(!n)return wi.asPromise(r,i,e,t);var s=n===px;function o(h,m){if(n){if(s)throw h;m&&m.resolveAll();var p=n;n=null,p(h,m)}}function a(h){var m=h.lastIndexOf("google/protobuf/");if(m>-1){var p=h.substring(m);if(p in gl)return p}return null}function c(h,m){try{if(wi.isString(m)&&m.charAt(0)==="{"&&(m=JSON.parse(m)),!wi.isString(m))i.setOptions(m.options).addJSON(m.nested);else{Hv.filename=h;var p=Hv(m,i,t),y,b=0;if(p.imports)for(;b<p.imports.length;++b)(y=a(p.imports[b])||i.resolvePath(h,p.imports[b]))&&l(y);if(p.weakImports)for(b=0;b<p.weakImports.length;++b)(y=a(p.weakImports[b])||i.resolvePath(h,p.weakImports[b]))&&l(y,!0)}}catch(E){o(E)}!s&&!u&&o(null,i)}function l(h,m){if(h=a(h)||h,!(i.files.indexOf(h)>-1)){if(i.files.push(h),h in gl){s?c(h,gl[h]):(++u,setTimeout(function(){--u,c(h,gl[h])}));return}if(s){var p;try{p=wi.fs.readFileSync(h).toString("utf8")}catch(y){m||o(y);return}c(h,p)}else++u,i.fetch(h,function(y,b){if(--u,!!n){if(y){m?u||o(null,i):o(y);return}c(h,b)}})}}var u=0;wi.isString(e)&&(e=[e]);for(var d=0,f;d<e.length;++d)(f=i.resolvePath("",e[d]))&&l(f);return s?(i.resolveAll(),i):(u||o(null,i),i)};ar.prototype.loadSync=function(e,t){if(!wi.isNode)throw Error("not supported");return this.load(e,t,px)};ar.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 rf.prototype.resolveAll.call(this)};var tf=/^[A-Z]/;function hx(r,e){var t=e.parent.lookup(e.extend);if(t){var n=new ef(e.fullName,e.id,e.type,e.rule,void 0,e.options);return t.get(n.name)||(n.declaringField=e,e.extensionField=n,t.add(n)),!0}return!1}ar.prototype._handleAdd=function(e){if(e instanceof ef)e.extend!==void 0&&!e.extensionField&&(hx(this,e)||this.deferred.push(e));else if(e instanceof jv)tf.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof s8)){if(e instanceof zv)for(var t=0;t<this.deferred.length;)hx(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);tf.test(e.name)&&(e.parent[e.name]=e)}(e instanceof zv||e instanceof jv||e instanceof ef)&&(this._fullyQualifiedObjects[e.fullName]=e)};ar.prototype._handleRemove=function(e){if(e instanceof ef){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof jv)tf.test(e.name)&&delete e.parent[e.name];else if(e instanceof rf){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);tf.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};ar._configure=function(r,e,t){zv=r,Hv=e,gl=t}});var ht=g((Mhe,yx)=>{"use strict";var Ke=yx.exports=Cw(),gx=EF(),Gv,Vv;Ke.codegen=VC();Ke.fetch=KC();Ke.path=YC();Ke.fs=Ke.inquire("fs");Ke.toArray=function(e){if(e){for(var t=Object.keys(e),n=new Array(t.length),i=0;i<t.length;)n[i]=e[t[i++]];return n}return[]};Ke.toObject=function(e){for(var t={},n=0;n<e.length;){var i=e[n++],s=e[n++];s!==void 0&&(t[i]=s)}return t};var o8=/\\/g,a8=/"/g;Ke.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)};Ke.safeProp=function(e){return!/^[$\w_]+$/.test(e)||Ke.isReserved(e)?'["'+e.replace(o8,"\\\\").replace(a8,'\\"')+'"]':"."+e};Ke.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c8=/_([a-z])/g;Ke.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c8,function(t,n){return n.toUpperCase()})};Ke.compareFieldsById=function(e,t){return e.id-t.id};Ke.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(Ke.decorateRoot.remove(e.$type),e.$type.name=t,Ke.decorateRoot.add(e.$type)),e.$type;Gv||(Gv=Xd());var n=new Gv(t||e.name);return Ke.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var l8=0;Ke.decorateEnum=function(e){if(e.$type)return e.$type;Vv||(Vv=Dr());var t=new Vv("Enum"+l8++,e);return Ke.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t};Ke.setProperty=function(e,t,n,i){function s(o,a,c){var l=a.shift();if(l==="__proto__"||l==="prototype")return o;if(a.length>0)o[l]=s(o[l]||{},a,c);else{var u=o[l];if(u&&i)return o;u&&(c=[].concat(u).concat(c)),o[l]=c}return o}if(typeof e!="object")throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return t=t.split("."),s(e,t,n)};Object.defineProperty(Ke,"decorateRoot",{get:function(){return gx.decorated||(gx.decorated=new(nf()))}})});var Fs=g(vx=>{"use strict";var yl=vx,u8=ht(),d8=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function vl(r,e){var t=0,n={};for(e|=0;t<r.length;)n[d8[t+e]]=r[t++];return n}yl.basic=vl([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);yl.defaults=vl([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",u8.emptyArray,null]);yl.long=vl([0,0,0,1,1],7);yl.mapKey=vl([0,0,0,5,5,0,0,0,1,1,0,2],2);yl.packed=vl([1,5,0,0,0,5,5,0,0,0,1,1,0])});var Ei=g((Lhe,_x)=>{"use strict";_x.exports=pt;var _l=Ai();((pt.prototype=Object.create(_l.prototype)).constructor=pt).className="Field";var bx=Dr(),Wv=Fs(),Xe=ht(),bl,f8=/^required|optional|repeated$/;pt.fromJSON=function(e,t){var n=new pt(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n};function pt(r,e,t,n,i,s,o){if(Xe.isObject(n)?(o=i,s=n,n=i=void 0):Xe.isObject(i)&&(o=s,s=i,i=void 0),_l.call(this,r,s),!Xe.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Xe.isString(t))throw TypeError("type must be a string");if(n!==void 0&&!f8.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(i!==void 0&&!Xe.isString(i))throw TypeError("extend must be a string");n==="proto3_optional"&&(n="optional"),this.rule=n&&n!=="optional"?n:void 0,this.type=t,this.id=e,this.extend=i||void 0,this.repeated=n==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Xe.Long?Wv.long[t]!==void 0:!1,this.bytes=t==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=o}Object.defineProperty(pt.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(pt.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(pt.prototype,"delimited",{get:function(){return this.resolvedType instanceof bl&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(pt.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(pt.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});pt.prototype.setOption=function(e,t,n){return _l.prototype.setOption.call(this,e,t,n)};pt.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return Xe.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])};pt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=Wv.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof bl?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&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof bx&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof bx)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Xe.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;Xe.base64.test(this.typeDefault)?Xe.base64.decode(this.typeDefault,e=Xe.newBuffer(Xe.base64.length(this.typeDefault)),0):Xe.utf8.write(this.typeDefault,e=Xe.newBuffer(Xe.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Xe.emptyObject:this.repeated?this.defaultValue=Xe.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof bl&&(this.parent.ctor.prototype[this.name]=this.defaultValue),_l.prototype.resolve.call(this)};pt.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var t={};if(this.rule==="required"&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&Wv.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof bl&&n.group&&(t.message_encoding="DELIMITED")}return this.getOption("packed")===!0?t.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(t.repeated_field_encoding="EXPANDED"),t};pt.prototype._resolveFeatures=function(e){return _l.prototype._resolveFeatures.call(this,this._edition||e)};pt.d=function(e,t,n,i){return typeof t=="function"?t=Xe.decorateType(t).name:t&&typeof t=="object"&&(t=Xe.decorateEnum(t).name),function(o,a){Xe.decorateType(o.constructor).add(new pt(a,e,t,n,{default:i}))}};pt._configure=function(e){bl=e}});var Ls=g((Fhe,wx)=>{"use strict";wx.exports=cr;var of=Ai();((cr.prototype=Object.create(of.prototype)).constructor=cr).className="OneOf";var Ex=Ei(),sf=ht();function cr(r,e,t,n){if(Array.isArray(e)||(t=e,e=void 0),of.call(this,r,t),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=n}cr.fromJSON=function(e,t){return new cr(e,t.oneof,t.options,t.comment)};cr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return sf.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])};function Ax(r){if(r.parent)for(var e=0;e<r.fieldsArray.length;++e)r.fieldsArray[e].parent||r.parent.add(r.fieldsArray[e])}cr.prototype.add=function(e){if(!(e instanceof Ex))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,Ax(this),this};cr.prototype.remove=function(e){if(!(e instanceof Ex))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this};cr.prototype.onAdd=function(e){of.prototype.onAdd.call(this,e);for(var t=this,n=0;n<this.oneof.length;++n){var i=e.get(this.oneof[n]);i&&!i.partOf&&(i.partOf=t,t.fieldsArray.push(i))}Ax(this)};cr.prototype.onRemove=function(e){for(var t=0,n;t<this.fieldsArray.length;++t)(n=this.fieldsArray[t]).parent&&n.parent.remove(n);of.prototype.onRemove.call(this,e)};Object.defineProperty(cr.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var r=this.fieldsArray[0];return r.options!=null&&r.options.proto3_optional===!0}});cr.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(i,s){sf.decorateType(i.constructor).add(new cr(s,e)),Object.defineProperty(i,s,{get:sf.oneOfGetter(e),set:sf.oneOfSetter(e)})}}});var Ai=g((qhe,Sx)=>{"use strict";Sx.exports=bt;bt.className="ReflectionObject";var h8=Ls(),El=ht(),af,p8={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},m8={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},g8={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function bt(r,e){if(!El.isString(r))throw TypeError("name must be a string");if(e&&!El.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=r,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(bt.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],e=this.parent;e;)r.unshift(e.name),e=e.parent;return r.join(".")}}});bt.prototype.toJSON=function(){throw Error()};bt.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof af&&t._handleAdd(this)};bt.prototype.onRemove=function(e){var t=e.root;t instanceof af&&t._handleRemove(this),this.parent=null,this.resolved=!1};bt.prototype.resolve=function(){return this.resolved?this:(this.root instanceof af&&(this.resolved=!0),this)};bt.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};bt.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")t=Object.assign({},m8);else if(e==="proto3")t=Object.assign({},g8);else if(e==="2023")t=Object.assign({},p8);else throw new Error("Unknown edition: "+e);this._features=Object.assign(t,n||{}),this._featuresResolved=!0;return}if(this.partOf instanceof h8){var i=Object.assign({},this.partOf._features);this._features=Object.assign(i,n||{})}else if(!this.declaringField)if(this.parent){var s=Object.assign({},this.parent._features);this._features=Object.assign(s,n||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};bt.prototype._inferLegacyProtoFeatures=function(){return{}};bt.prototype.getOption=function(e){if(this.options)return this.options[e]};bt.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?El.setProperty(this.options,e,t,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this};bt.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var s=i.find(function(c){return Object.prototype.hasOwnProperty.call(c,e)});if(s){var o=s[e];El.setProperty(o,n,t)}else s={},s[e]=El.setProperty({},n,t),i.push(s)}else{var a={};a[e]=t,i.push(a)}return this};bt.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),i=0;i<n.length;++i)this.setOption(n[i],e[n[i]],t);return this};bt.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e};bt.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};bt._configure=function(r){af=r}});var Dr=g((Bhe,Cx)=>{"use strict";Cx.exports=Lr;var Kv=Ai();((Lr.prototype=Object.create(Kv.prototype)).constructor=Lr).className="Enum";var Tx=$o(),cf=ht();function Lr(r,e,t,n,i,s){if(Kv.call(this,r,t),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.valuesOptions=s,this._valuesFeatures={},this.reserved=void 0,e)for(var o=Object.keys(e),a=0;a<o.length;++a)typeof e[o[a]]=="number"&&(this.valuesById[this.values[o[a]]=e[o[a]]]=o[a])}Lr.prototype._resolveFeatures=function(e){return e=this._edition||e,Kv.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(t=>{var n=Object.assign({},this._features);this._valuesFeatures[t]=Object.assign(n,this.valuesOptions&&this.valuesOptions[t]&&this.valuesOptions[t].features)}),this};Lr.fromJSON=function(e,t){var n=new Lr(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n};Lr.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return cf.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])};Lr.prototype.add=function(e,t,n,i){if(!cf.isString(e))throw TypeError("name must be a string");if(!cf.isInteger(t))throw TypeError("id must be an integer");if(this.values[e]!==void 0)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(this.valuesById[t]!==void 0){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&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=i||null),this.comments[e]=n||null,this};Lr.prototype.remove=function(e){if(!cf.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(t==null)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};Lr.prototype.isReservedId=function(e){return Tx.isReservedId(this.reserved,e)};Lr.prototype.isReservedName=function(e){return Tx.isReservedName(this.reserved,e)}});var Uv=g((Uhe,Ox)=>{"use strict";Ox.exports=v8;var y8=Dr(),Jv=Fs(),Qv=ht();function xx(r,e,t,n){return e.delimited?r("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",t,n,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):r("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",t,n,(e.id<<3|2)>>>0)}function v8(r){for(var e=Qv.codegen(["m","w"],r.name+"$encode")("if(!w)")("w=Writer.create()"),t,n,i=r.fieldsArray.slice().sort(Qv.compareFieldsById),t=0;t<i.length;++t){var s=i[t].resolve(),o=r._fieldsArray.indexOf(s),a=s.resolvedType instanceof y8?"int32":s.type,c=Jv.basic[a];n="m"+Qv.safeProp(s.name),s.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,s.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(s.id<<3|2)>>>0,8|Jv.mapKey[s.keyType],s.keyType),c===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",o,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,a,n),e("}")("}")):s.repeated?(e("if(%s!=null&&%s.length){",n,n),s.packed&&Jv.packed[a]!==void 0?e("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),c===void 0?xx(e,s,o,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(s.id<<3|c)>>>0,a,n)),e("}")):(s.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,s.name),c===void 0?xx(e,s,o,n):e("w.uint32(%i).%s(%s)",(s.id<<3|c)>>>0,a,n))}return e("return w")}});var Px=g((jhe,Ix)=>{"use strict";var _e=Ix.exports=AF();_e.build="light";function b8(r,e,t){return typeof e=="function"?(t=e,e=new _e.Root):e||(e=new _e.Root),e.load(r,t)}_e.load=b8;function _8(r,e){return e||(e=new _e.Root),e.loadSync(r)}_e.loadSync=_8;_e.encoder=Uv();_e.decoder=Iv();_e.verifier=Rv();_e.converter=Dv();_e.ReflectionObject=Ai();_e.Namespace=$o();_e.Root=nf();_e.Enum=Dr();_e.Type=Xd();_e.Field=Ei();_e.OneOf=Ls();_e.MapField=Kd();_e.Service=Qd();_e.Method=Jd();_e.Message=Yd();_e.wrappers=Lv();_e.types=Fs();_e.util=ht();_e.ReflectionObject._configure(_e.Root);_e.Namespace._configure(_e.Type,_e.Service,_e.Enum);_e.Root._configure(_e.Type);_e.Field._configure(_e.Type)});var $v=g((zhe,Nx)=>{"use strict";Nx.exports=Rx;var Yv=/[\s{}=;:[\],'"()<>]/g,E8=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,A8=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,w8=/^ *[*/]+ */,S8=/^\s*\*?\/*/,T8=/\n/g,C8=/\s/,x8=/\\(.?)/g,O8={0:"\0",r:"\r",n:`
|
16
|
+
`,t:" "};function kx(r){return r.replace(x8,function(e,t){switch(t){case"\\":case"":return t;default:return O8[t]||""}})}Rx.unescape=kx;function Rx(r,e){r=r.toString();var t=0,n=r.length,i=1,s=0,o={},a=[],c=null;function l(S){return Error("illegal "+S+" (line "+i+")")}function u(){var S=c==="'"?A8:E8;S.lastIndex=t-1;var M=S.exec(r);if(!M)throw l("string");return t=S.lastIndex,y(c),c=null,kx(M[1])}function d(S){return r.charAt(S)}function f(S,M,I){var B={type:r.charAt(S++),lineEmpty:!1,leading:I},z;e?z=2:z=3;var L=S-z,q;do if(--L<0||(q=r.charAt(L))===`
|
17
|
+
`){B.lineEmpty=!0;break}while(q===" "||q===" ");for(var C=r.substring(S,M).split(T8),oe=0;oe<C.length;++oe)C[oe]=C[oe].replace(e?S8:w8,"").trim();B.text=C.join(`
|
18
|
+
`).trim(),o[i]=B,s=i}function h(S){var M=m(S),I=r.substring(S,M),B=/^\s*\/\//.test(I);return B}function m(S){for(var M=S;M<n&&d(M)!==`
|
19
|
+
`;)M++;return M}function p(){if(a.length>0)return a.shift();if(c)return u();var S,M,I,B,z,L=t===0;do{if(t===n)return null;for(S=!1;C8.test(I=d(t));)if(I===`
|
20
|
+
`&&(L=!0,++i),++t===n)return null;if(d(t)==="/"){if(++t===n)throw l("comment");if(d(t)==="/")if(e){if(B=t,z=!1,h(t-1)){z=!0;do if(t=m(t),t===n||(t++,!L))break;while(h(t))}else t=Math.min(n,m(t)+1);z&&(f(B,t,L),L=!0),i++,S=!0}else{for(z=d(B=t+1)==="/";d(++t)!==`
|
21
|
+
`;)if(t===n)return null;++t,z&&(f(B,t-1,L),L=!0),++i,S=!0}else if((I=d(t))==="*"){B=t+1,z=e||d(B)==="*";do{if(I===`
|
22
|
+
`&&++i,++t===n)throw l("comment");M=I,I=d(t)}while(M!=="*"||I!=="/");++t,z&&(f(B,t-2,L),L=!0),S=!0}else return"/"}}while(S);var q=t;Yv.lastIndex=0;var C=Yv.test(d(q++));if(!C)for(;q<n&&!Yv.test(d(q));)++q;var oe=r.substring(t,t=q);return(oe==='"'||oe==="'")&&(c=oe),oe}function y(S){a.push(S)}function b(){if(!a.length){var S=p();if(S===null)return null;y(S)}return a[0]}function E(S,M){var I=b(),B=I===S;if(B)return p(),!0;if(!M)throw l("token '"+I+"', '"+S+"' expected");return!1}function x(S){var M=null,I;return S===void 0?(I=o[i-1],delete o[i-1],I&&(e||I.type==="*"||I.lineEmpty)&&(M=I.leading?I.text:null)):(s<S&&b(),I=o[S],delete o[S],I&&!I.lineEmpty&&(e||I.type==="/")&&(M=I.leading?null:I.text)),M}return Object.defineProperty({next:p,peek:b,push:y,skip:E,cmnt:x},"line",{get:function(){return i}})}});var Bx=g((Hhe,qx)=>{"use strict";qx.exports=qn;qn.filename=null;qn.defaults={keepCase:!1};var I8=$v(),Mx=nf(),Dx=Xd(),Lx=Ei(),P8=Kd(),Fx=Ls(),k8=Dr(),R8=Qd(),N8=Jd(),M8=Ai(),D8=Fs(),Zv=ht(),L8=/^[1-9][0-9]*$/,F8=/^-?[1-9][0-9]*$/,q8=/^0[x][0-9a-fA-F]+$/,B8=/^-?0[x][0-9a-fA-F]+$/,U8=/^0[0-7]+$/,j8=/^-?0[0-7]+$/,z8=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,sn=/^[a-zA-Z_][a-zA-Z_0-9]*$/,on=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function qn(r,e,t){e instanceof Mx||(t=e,e=new Mx),t||(t=qn.defaults);var n=t.preferTrailingComment||!1,i=I8(r,t.alternateCommentMode||!1),s=i.next,o=i.push,a=i.peek,c=i.skip,l=i.cmnt,u=!0,d,f,h,m="proto2",p=e,y=[],b={},E=t.keepCase?function(k){return k}:Zv.camelCase;function x(){y.forEach(k=>{k._edition=m,Object.keys(b).forEach(N=>{k.getOption(N)===void 0&&k.setOption(N,b[N],!0)})})}function S(k,N,D){var X=qn.filename;return D||(qn.filename=null),Error("illegal "+(N||"token")+" '"+k+"' ("+(X?X+", ":"")+"line "+i.line+")")}function M(){var k=[],N;do{if((N=s())!=='"'&&N!=="'")throw S(N);k.push(s()),c(N),N=a()}while(N==='"'||N==="'");return k.join("")}function I(k){var N=s();switch(N){case"'":case'"':return o(N),M();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return z(N,!0)}catch{if(k&&on.test(N))return N;throw S(N,"value")}}function B(k,N){var D,X;do if(N&&((D=a())==='"'||D==="'")){var Y=M();if(k.push(Y),m>=2023)throw S(Y,"id")}else try{k.push([X=L(s()),c("to",!0)?L(s()):X])}catch(Be){if(N&&on.test(D)&&m>=2023)k.push(D);else throw Be}while(c(",",!0));var ce={options:void 0};ce.setOption=function(Be,Ot){this.options===void 0&&(this.options={}),this.options[Be]=Ot},T(ce,function(Ot){if(Ot==="option")ue(ce,Ot),c(";");else throw S(Ot)},function(){ut(ce)})}function z(k,N){var D=1;switch(k.charAt(0)==="-"&&(D=-1,k=k.substring(1)),k){case"inf":case"INF":case"Inf":return D*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(L8.test(k))return D*parseInt(k,10);if(q8.test(k))return D*parseInt(k,16);if(U8.test(k))return D*parseInt(k,8);if(z8.test(k))return D*parseFloat(k);throw S(k,"number",N)}function L(k,N){switch(k){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!N&&k.charAt(0)==="-")throw S(k,"id");if(F8.test(k))return parseInt(k,10);if(B8.test(k))return parseInt(k,16);if(j8.test(k))return parseInt(k,8);throw S(k,"id")}function q(){if(d!==void 0)throw S("package");if(d=s(),!on.test(d))throw S(d,"name");p=p.define(d),c(";")}function C(){var k=a(),N;switch(k){case"weak":N=h||(h=[]),s();break;case"public":s();default:N=f||(f=[]);break}k=M(),c(";"),N.push(k)}function oe(){if(c("="),m=M(),m<2023)throw S(m,"syntax");c(";")}function O(){if(c("="),m=M(),!["2023"].includes(m))throw S(m,"edition");c(";")}function _(k,N){switch(N){case"option":return ue(k,N),c(";"),!0;case"message":return R(k,N),!0;case"enum":return Se(k,N),!0;case"service":return Bc(k,N),!0;case"extend":return ui(k,N),!0}return!1}function T(k,N,D){var X=i.line;if(k&&(typeof k.comment!="string"&&(k.comment=l()),k.filename=qn.filename),c("{",!0)){for(var Y;(Y=s())!=="}";)N(Y);c(";",!0)}else D&&D(),c(";"),k&&(typeof k.comment!="string"||n)&&(k.comment=l(X)||k.comment)}function R(k,N){if(!sn.test(N=s()))throw S(N,"type name");var D=new Dx(N);T(D,function(Y){if(!_(D,Y))switch(Y){case"map":G(D,Y);break;case"required":if(m!=="proto2")throw S(Y);case"repeated":F(D,Y);break;case"optional":if(m==="proto3")F(D,"proto3_optional");else{if(m!=="proto2")throw S(Y);F(D,"optional")}break;case"oneof":me(D,Y);break;case"extensions":B(D.extensions||(D.extensions=[]));break;case"reserved":B(D.reserved||(D.reserved=[]),!0);break;default:if(m==="proto2"||!on.test(Y))throw S(Y);o(Y),F(D,"optional");break}}),k.add(D),k===p&&y.push(D)}function F(k,N,D){var X=s();if(X==="group"){W(k,N);return}for(;X.endsWith(".")||a().startsWith(".");)X+=s();if(!on.test(X))throw S(X,"type");var Y=s();if(!sn.test(Y))throw S(Y,"name");Y=E(Y),c("=");var ce=new Lx(Y,L(s()),X,N,D);if(T(ce,function(Dt){if(Dt==="option")ue(ce,Dt),c(";");else throw S(Dt)},function(){ut(ce)}),N==="proto3_optional"){var Be=new Fx("_"+Y);ce.setOption("proto3_optional",!0),Be.add(ce),k.add(Be)}else k.add(ce);k===p&&y.push(ce)}function W(k,N){if(m>=2023)throw S("group");var D=s();if(!sn.test(D))throw S(D,"name");var X=Zv.lcFirst(D);D===X&&(D=Zv.ucFirst(D)),c("=");var Y=L(s()),ce=new Dx(D);ce.group=!0;var Be=new Lx(X,Y,D,N);Be.filename=qn.filename,T(ce,function(Dt){switch(Dt){case"option":ue(ce,Dt),c(";");break;case"required":case"repeated":F(ce,Dt);break;case"optional":m==="proto3"?F(ce,"proto3_optional"):F(ce,"optional");break;case"message":R(ce,Dt);break;case"enum":Se(ce,Dt);break;case"reserved":B(ce.reserved||(ce.reserved=[]),!0);break;default:throw S(Dt)}}),k.add(ce).add(Be)}function G(k){c("<");var N=s();if(D8.mapKey[N]===void 0)throw S(N,"type");c(",");var D=s();if(!on.test(D))throw S(D,"type");c(">");var X=s();if(!sn.test(X))throw S(X,"name");c("=");var Y=new P8(E(X),L(s()),N,D);T(Y,function(Be){if(Be==="option")ue(Y,Be),c(";");else throw S(Be)},function(){ut(Y)}),k.add(Y)}function me(k,N){if(!sn.test(N=s()))throw S(N,"name");var D=new Fx(E(N));T(D,function(Y){Y==="option"?(ue(D,Y),c(";")):(o(Y),F(D,"optional"))}),k.add(D)}function Se(k,N){if(!sn.test(N=s()))throw S(N,"name");var D=new k8(N);T(D,function(Y){switch(Y){case"option":ue(D,Y),c(";");break;case"reserved":B(D.reserved||(D.reserved=[]),!0),D.reserved===void 0&&(D.reserved=[]);break;default:Ee(D,Y)}}),k.add(D),k===p&&y.push(D)}function Ee(k,N){if(!sn.test(N))throw S(N,"name");c("=");var D=L(s(),!0),X={options:void 0};X.getOption=function(Y){return this.options[Y]},X.setOption=function(Y,ce){M8.prototype.setOption.call(X,Y,ce)},X.setParsedOption=function(){},T(X,function(ce){if(ce==="option")ue(X,ce),c(";");else throw S(ce)},function(){ut(X)}),k.add(N,D,X.comment,X.parsedOptions||X.options)}function ue(k,N){var D,X,Y=!0;for(N==="option"&&(N=s());N!=="=";){if(N==="("){var ce=s();c(")"),N="("+ce+")"}if(Y){if(Y=!1,N.includes(".")&&!N.includes("(")){var Be=N.split(".");D=Be[0]+".",N=Be[1];continue}D=N}else X=X?X+=N:N;N=s()}var Ot=X?D.concat(X):D,Dt=qe(k,Ot);X=X&&X[0]==="."?X.slice(1):X,D=D&&D[D.length-1]==="."?D.slice(0,-1):D,We(k,D,Dt,X)}function qe(k,N){if(c("{",!0)){for(var D={};!c("}",!0);){if(!sn.test(Ze=s()))throw S(Ze,"name");if(Ze===null)throw S(Ze,"end of input");var X,Y=Ze;if(c(":",!0),a()==="{")X=qe(k,N+"."+Ze);else if(a()==="["){X=[];var ce;if(c("[",!0)){do ce=I(!0),X.push(ce);while(c(",",!0));c("]"),typeof ce<"u"&&Te(k,N+"."+Ze,ce)}}else X=I(!0),Te(k,N+"."+Ze,X);var Be=D[Y];Be&&(X=[].concat(Be).concat(X)),D[Y]=X,c(",",!0),c(";",!0)}return D}var Ot=I(!0);return Te(k,N,Ot),Ot}function Te(k,N,D){if(p===k&&/^features\./.test(N)){b[N]=D;return}k.setOption&&k.setOption(N,D)}function We(k,N,D,X){k.setParsedOption&&k.setParsedOption(N,D,X)}function ut(k){if(c("[",!0)){do ue(k,"option");while(c(",",!0));c("]")}return k}function Bc(k,N){if(!sn.test(N=s()))throw S(N,"service name");var D=new R8(N);T(D,function(Y){if(!_(D,Y))if(Y==="rpc")Pn(D,Y);else throw S(Y)}),k.add(D),k===p&&y.push(D)}function Pn(k,N){var D=l(),X=N;if(!sn.test(N=s()))throw S(N,"name");var Y=N,ce,Be,Ot,Dt;if(c("("),c("stream",!0)&&(Be=!0),!on.test(N=s())||(ce=N,c(")"),c("returns"),c("("),c("stream",!0)&&(Dt=!0),!on.test(N=s())))throw S(N);Ot=N,c(")");var Yu=new N8(Y,X,ce,Ot,Be,Dt);Yu.comment=D,T(Yu,function(ry){if(ry==="option")ue(Yu,ry),c(";");else throw S(ry)}),k.add(Yu)}function ui(k,N){if(!on.test(N=s()))throw S(N,"reference");var D=N;T(null,function(Y){switch(Y){case"required":case"repeated":F(k,Y,D);break;case"optional":m==="proto3"?F(k,"proto3_optional",D):F(k,"optional",D);break;default:if(m==="proto2"||!on.test(Y))throw S(Y);o(Y),F(k,"optional",D);break}})}for(var Ze;(Ze=s())!==null;)switch(Ze){case"package":if(!u)throw S(Ze);q();break;case"import":if(!u)throw S(Ze);C();break;case"syntax":if(!u)throw S(Ze);oe();break;case"edition":if(!u)throw S(Ze);O();break;case"option":ue(p,Ze),c(";",!0);break;default:if(_(p,Ze)){u=!1;continue}throw S(Ze)}return x(),qn.filename=null,{package:d,imports:f,weakImports:h,root:e}}});var zx=g((Ghe,jx)=>{"use strict";jx.exports=Fr;var H8=/\/|\./;function Fr(r,e){H8.test(r)||(r="google/protobuf/"+r+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),Fr[r]=e}Fr("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var Ux;Fr("duration",{Duration:Ux={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});Fr("timestamp",{Timestamp:Ux});Fr("empty",{Empty:{fields:{}}});Fr("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}}}});Fr("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}}}});Fr("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});Fr.get=function(e){return Fr[e]||null}});var Gx=g((Vhe,Hx)=>{"use strict";var Si=Hx.exports=Px();Si.build="full";Si.tokenize=$v();Si.parse=Bx();Si.common=zx();Si.Root._configure(Si.Type,Si.parse,Si.common)});var lf=g((Whe,Vx)=>{"use strict";Vx.exports=Gx()});var Xv=g((Khe,G8)=>{G8.exports={nested:{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}}}}}}}}});var Zx=g((fe,$x)=>{"use strict";var lr=lf();$x.exports=fe=lr.descriptor=lr.Root.fromJSON(Xv()).lookup(".google.protobuf");var Wx=lr.Namespace,Al=lr.Root,Bn=lr.Enum,an=lr.Type,Ti=lr.Field,V8=lr.MapField,uf=lr.OneOf,wl=lr.Service,df=lr.Method;Al.fromDescriptor=function(e){typeof e.length=="number"&&(e=fe.FileDescriptorSet.decode(e));var t=new Al;if(e.file)for(var n,i,s=0,o;s<e.file.length;++s){i=t,(n=e.file[s]).package&&n.package.length&&(i=t.define(n.package));var a=tj(n);if(n.name&&n.name.length&&t.files.push(i.filename=n.name),n.messageType)for(o=0;o<n.messageType.length;++o)i.add(an.fromDescriptor(n.messageType[o],a));if(n.enumType)for(o=0;o<n.enumType.length;++o)i.add(Bn.fromDescriptor(n.enumType[o],a));if(n.extension)for(o=0;o<n.extension.length;++o)i.add(Ti.fromDescriptor(n.extension[o],a));if(n.service)for(o=0;o<n.service.length;++o)i.add(wl.fromDescriptor(n.service[o],a));var c=Xo(n.options,fe.FileOptions);if(c){var l=Object.keys(c);for(o=0;o<l.length;++o)i.setOption(l[o],c[l[o]])}}return t.resolveAll()};Al.prototype.toDescriptor=function(e){var t=fe.FileDescriptorSet.create();return Kx(this,t.file,e),t};function Kx(r,e,t){var n=fe.FileDescriptorProto.create({name:r.filename||(r.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});rj(t,n),r instanceof Al||(n.package=r.fullName.substring(1));for(var i=0,s;i<r.nestedArray.length;++i)(s=r._nestedArray[i])instanceof an?n.messageType.push(s.toDescriptor(t)):s instanceof Bn?n.enumType.push(s.toDescriptor()):s instanceof Ti?n.extension.push(s.toDescriptor(t)):s instanceof wl?n.service.push(s.toDescriptor()):s instanceof Wx&&Kx(s,e,t);n.options=ea(r.options,fe.FileOptions),n.messageType.length+n.enumType.length+n.extension.length+n.service.length&&e.push(n)}var W8=0;an.fromDescriptor=function(e,t,n){typeof e.length=="number"&&(e=fe.DescriptorProto.decode(e));var i=new an(e.name.length?e.name:"Type"+W8++,Xo(e.options,fe.MessageOptions)),s;if(n||(i._edition=t),e.oneofDecl)for(s=0;s<e.oneofDecl.length;++s)i.add(uf.fromDescriptor(e.oneofDecl[s]));if(e.field)for(s=0;s<e.field.length;++s){var o=Ti.fromDescriptor(e.field[s],t,!0);i.add(o),e.field[s].hasOwnProperty("oneofIndex")&&i.oneofsArray[e.field[s].oneofIndex].add(o)}if(e.extension)for(s=0;s<e.extension.length;++s)i.add(Ti.fromDescriptor(e.extension[s],t,!0));if(e.nestedType)for(s=0;s<e.nestedType.length;++s)i.add(an.fromDescriptor(e.nestedType[s],t,!0)),e.nestedType[s].options&&e.nestedType[s].options.mapEntry&&i.setOption("map_entry",!0);if(e.enumType)for(s=0;s<e.enumType.length;++s)i.add(Bn.fromDescriptor(e.enumType[s],t,!0));if(e.extensionRange&&e.extensionRange.length)for(i.extensions=[],s=0;s<e.extensionRange.length;++s)i.extensions.push([e.extensionRange[s].start,e.extensionRange[s].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(i.reserved=[],e.reservedRange)for(s=0;s<e.reservedRange.length;++s)i.reserved.push([e.reservedRange[s].start,e.reservedRange[s].end]);if(e.reservedName)for(s=0;s<e.reservedName.length;++s)i.reserved.push(e.reservedName[s])}return i};an.prototype.toDescriptor=function(e){var t=fe.DescriptorProto.create({name:this.name}),n;for(n=0;n<this.fieldsArray.length;++n){var i;if(t.field.push(i=this._fieldsArray[n].toDescriptor(e)),this._fieldsArray[n]instanceof V8){var s=eb(this._fieldsArray[n].keyType,this._fieldsArray[n].resolvedKeyType,!1),o=eb(this._fieldsArray[n].type,this._fieldsArray[n].resolvedType,!1),a=o===11||o===14?this._fieldsArray[n].resolvedType&&Yx(this.parent,this._fieldsArray[n].resolvedType)||this._fieldsArray[n].type:void 0;t.nestedType.push(fe.DescriptorProto.create({name:i.typeName,field:[fe.FieldDescriptorProto.create({name:"key",number:1,label:1,type:s}),fe.FieldDescriptorProto.create({name:"value",number:2,label:1,type:o,typeName:a})],options:fe.MessageOptions.create({mapEntry:!0})}))}}for(n=0;n<this.oneofsArray.length;++n)t.oneofDecl.push(this._oneofsArray[n].toDescriptor());for(n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof Ti?t.field.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof an?t.nestedType.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof Bn&&t.enumType.push(this._nestedArray[n].toDescriptor());if(this.extensions)for(n=0;n<this.extensions.length;++n)t.extensionRange.push(fe.DescriptorProto.ExtensionRange.create({start:this.extensions[n][0],end:this.extensions[n][1]}));if(this.reserved)for(n=0;n<this.reserved.length;++n)typeof this.reserved[n]=="string"?t.reservedName.push(this.reserved[n]):t.reservedRange.push(fe.DescriptorProto.ReservedRange.create({start:this.reserved[n][0],end:this.reserved[n][1]}));return t.options=ea(this.options,fe.MessageOptions),t};var K8=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;Ti.fromDescriptor=function(e,t,n){if(typeof e.length=="number"&&(e=fe.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i;e.typeName&&e.typeName.length?i=e.typeName:i=Z8(e.type);var s;switch(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 o=e.extendee;e.extendee!==void 0&&(o=o.length?o:void 0);var a=new Ti(e.name.length?e.name:"field"+e.number,e.number,i,s,o);if(n||(a._edition=t),a.options=Xo(e.options,fe.FieldOptions),e.proto3_optional&&(a.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:var l=K8.exec(c);l&&(c=parseInt(c));break}a.setOption("default",c)}return X8(e.type)&&(t==="proto3"?e.options&&!e.options.packed&&a.setOption("packed",!1):(!t||t==="proto2")&&e.options&&e.options.packed&&a.setOption("packed",!0)),a};Ti.prototype.toDescriptor=function(e){var t=fe.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)t.type=11,t.typeName=lr.util.ucFirst(this.name),t.label=3;else{switch(t.type=eb(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:t.typeName=this.resolvedType?Yx(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?t.label=3:this.required&&e==="proto2"?t.label=2:t.label=1}if(t.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&(t.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(t.options=ea(this.options,fe.FieldOptions),this.options.default!=null&&(t.defaultValue=String(this.options.default)),this.options.proto3_optional&&(t.proto3_optional=!0)),e==="proto3"?this.packed||((t.options||(t.options=fe.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((t.options||(t.options=fe.FieldOptions.create())).packed=!0),t};var J8=0;Bn.fromDescriptor=function(e,t,n){typeof e.length=="number"&&(e=fe.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var s=0;s<e.value.length;++s){var o=e.value[s].name,a=e.value[s].number||0;i[o&&o.length?o:"NAME"+a]=a}var c=new Bn(e.name&&e.name.length?e.name:"Enum"+J8++,i,Xo(e.options,fe.EnumOptions));return n||(c._edition=t),c};Bn.prototype.toDescriptor=function(){for(var e=[],t=0,n=Object.keys(this.values);t<n.length;++t)e.push(fe.EnumValueDescriptorProto.create({name:n[t],number:this.values[n[t]]}));return fe.EnumDescriptorProto.create({name:this.name,value:e,options:ea(this.options,fe.EnumOptions)})};var Q8=0;uf.fromDescriptor=function(e){return typeof e.length=="number"&&(e=fe.OneofDescriptorProto.decode(e)),new uf(e.name&&e.name.length?e.name:"oneof"+Q8++)};uf.prototype.toDescriptor=function(){return fe.OneofDescriptorProto.create({name:this.name})};var Y8=0;wl.fromDescriptor=function(e,t,n){typeof e.length=="number"&&(e=fe.ServiceDescriptorProto.decode(e));var i=new wl(e.name&&e.name.length?e.name:"Service"+Y8++,Xo(e.options,fe.ServiceOptions));if(n||(i._edition=t),e.method)for(var s=0;s<e.method.length;++s)i.add(df.fromDescriptor(e.method[s]));return i};wl.prototype.toDescriptor=function(){for(var e=[],t=0;t<this.methodsArray.length;++t)e.push(this._methodsArray[t].toDescriptor());return fe.ServiceDescriptorProto.create({name:this.name,method:e,options:ea(this.options,fe.ServiceOptions)})};var $8=0;df.fromDescriptor=function(e){return typeof e.length=="number"&&(e=fe.MethodDescriptorProto.decode(e)),new df(e.name&&e.name.length?e.name:"Method"+$8++,"rpc",e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,Xo(e.options,fe.MethodOptions))};df.prototype.toDescriptor=function(){return fe.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:ea(this.options,fe.MethodOptions)})};function Z8(r){switch(r){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: "+r)}function X8(r){switch(r){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}function eb(r,e,t){switch(r){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(e instanceof Bn)return 14;if(e instanceof an)return t?10:11;throw Error("illegal type: "+r)}function Jx(r,e){for(var t={},n=0,i,s;n<e.fieldsArray.length;++n)if((s=(i=e._fieldsArray[n]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(r,s)){var o=ej(s);i.resolvedType instanceof an?t[o]=Jx(r[s],i.resolvedType):i.resolvedType instanceof Bn?t[o]=i.resolvedType.valuesById[r[s]]:t[o]=r[s]}return t}function Xo(r,e){if(r)return Jx(e.toObject(r),e)}function Qx(r,e){for(var t={},n=Object.keys(r),i=0;i<n.length;++i){var s=n[i],o=lr.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(e.fields,o)){var a=e.fields[o];a.resolvedType instanceof an?t[o]=Qx(r[s],a.resolvedType):t[o]=r[s],a.repeated&&!Array.isArray(t[o])&&(t[o]=[t[o]])}}return t}function ea(r,e){if(r)return e.fromObject(Qx(r,e))}function Yx(r,e){var t=r.fullName.split("."),n=e.fullName.split("."),i=0,s=0,o=n.length-1;if(!(r instanceof Al)&&e instanceof Wx)for(;i<t.length&&s<o&&t[i]===n[s];){var a=e.lookup(t[i++],!0);if(a!==null&&a!==e)break;++s}else for(;i<t.length&&s<o&&t[i]===n[s];++i,++s);return n.slice(s).join(".")}function ej(r){return r.substring(0,1)+r.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return"_"+t.toLowerCase()})}function tj(r){if(r.syntax==="editions")switch(r.edition){case fe.Edition.EDITION_2023:return"2023";default:throw new Error("Unsupported edition "+r.edition)}return r.syntax==="proto3"?"proto3":"proto2"}function rj(r,e){if(r)if(r==="proto2"||r==="proto3")e.syntax=r;else switch(e.syntax="editions",r){case"2023":e.edition=fe.Edition.EDITION_2023;break;default:throw new Error("Unsupported edition "+r)}}});var Xx=g((Jhe,nj)=>{nj.exports={nested:{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}}}}}}}}});var eO=g((Qhe,ij)=>{ij.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var tO=g((Yhe,sj)=>{sj.exports={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}}}}}}}}}});var sO=g(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.addCommonProtos=Ci.loadProtosWithOptionsSync=Ci.loadProtosWithOptions=void 0;var rO=ie("fs"),nO=ie("path"),ta=lf();function iO(r,e){let t=r.resolvePath;r.resolvePath=(n,i)=>{if(nO.isAbsolute(i))return i;for(let s of e){let o=nO.join(s,i);try{return rO.accessSync(o,rO.constants.R_OK),o}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${e}`),t(n,i)}}async function oj(r,e){let t=new ta.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));iO(t,e.includeDirs)}let n=await t.load(r,e);return n.resolveAll(),n}Ci.loadProtosWithOptions=oj;function aj(r,e){let t=new ta.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");iO(t,e.includeDirs)}let n=t.loadSync(r,e);return n.resolveAll(),n}Ci.loadProtosWithOptionsSync=aj;function cj(){let r=Xx(),e=Xv(),t=eO(),n=tO();ta.common("api",r.nested.google.nested.protobuf.nested),ta.common("descriptor",e.nested.google.nested.protobuf.nested),ta.common("source_context",t.nested.google.nested.protobuf.nested),ta.common("type",n.nested.google.nested.protobuf.nested)}Ci.addCommonProtos=cj});var rb=g((aO,tb)=>{"use strict";var oO=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=null;try{e=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 t(O,_,T){this.low=O|0,this.high=_|0,this.unsigned=!!T}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0});function n(O){return(O&&O.__isLong__)===!0}function i(O){var _=Math.clz32(O&-O);return O?31-_:_}t.isLong=n;var s={},o={};function a(O,_){var T,R,F;return _?(O>>>=0,(F=0<=O&&O<256)&&(R=o[O],R)?R:(T=l(O,0,!0),F&&(o[O]=T),T)):(O|=0,(F=-128<=O&&O<128)&&(R=s[O],R)?R:(T=l(O,O<0?-1:0,!1),F&&(s[O]=T),T))}t.fromInt=a;function c(O,_){if(isNaN(O))return _?S:x;if(_){if(O<0)return S;if(O>=y)return L}else{if(O<=-b)return q;if(O+1>=b)return z}return O<0?c(-O,_).neg():l(O%p|0,O/p|0,_)}t.fromNumber=c;function l(O,_,T){return new t(O,_,T)}t.fromBits=l;var u=Math.pow;function d(O,_,T){if(O.length===0)throw Error("empty string");if(typeof _=="number"?(T=_,_=!1):_=!!_,O==="NaN"||O==="Infinity"||O==="+Infinity"||O==="-Infinity")return _?S:x;if(T=T||10,T<2||36<T)throw RangeError("radix");var R;if((R=O.indexOf("-"))>0)throw Error("interior hyphen");if(R===0)return d(O.substring(1),_,T).neg();for(var F=c(u(T,8)),W=x,G=0;G<O.length;G+=8){var me=Math.min(8,O.length-G),Se=parseInt(O.substring(G,G+me),T);if(me<8){var Ee=c(u(T,me));W=W.mul(Ee).add(c(Se))}else W=W.mul(F),W=W.add(c(Se))}return W.unsigned=_,W}t.fromString=d;function f(O,_){return typeof O=="number"?c(O,_):typeof O=="string"?d(O,_):l(O.low,O.high,typeof _=="boolean"?_:O.unsigned)}t.fromValue=f;var h=65536,m=1<<24,p=h*h,y=p*p,b=y/2,E=a(m),x=a(0);t.ZERO=x;var S=a(0,!0);t.UZERO=S;var M=a(1);t.ONE=M;var I=a(1,!0);t.UONE=I;var B=a(-1);t.NEG_ONE=B;var z=l(-1,2147483647,!1);t.MAX_VALUE=z;var L=l(-1,-1,!0);t.MAX_UNSIGNED_VALUE=L;var q=l(0,-2147483648,!1);t.MIN_VALUE=q;var C=t.prototype;C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},C.toString=function(_){if(_=_||10,_<2||36<_)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(q)){var T=c(_),R=this.div(T),F=R.mul(T).sub(this);return R.toString(_)+F.toInt().toString(_)}else return"-"+this.neg().toString(_);for(var W=c(u(_,6),this.unsigned),G=this,me="";;){var Se=G.div(W),Ee=G.sub(Se.mul(W)).toInt()>>>0,ue=Ee.toString(_);if(G=Se,G.isZero())return ue+me;for(;ue.length<6;)ue="0"+ue;me=""+ue+me}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(q)?64:this.neg().getNumBitsAbs();for(var _=this.high!=0?this.high:this.low,T=31;T>0&&!(_&1<<T);T--);return this.high!=0?T+33:T+1},C.isZero=function(){return this.high===0&&this.low===0},C.eqz=C.isZero,C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return(this.low&1)===1},C.isEven=function(){return(this.low&1)===0},C.equals=function(_){return n(_)||(_=f(_)),this.unsigned!==_.unsigned&&this.high>>>31===1&&_.high>>>31===1?!1:this.high===_.high&&this.low===_.low},C.eq=C.equals,C.notEquals=function(_){return!this.eq(_)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(_){return this.comp(_)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(_){return this.comp(_)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(_){return this.comp(_)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(_){return this.comp(_)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(_){if(n(_)||(_=f(_)),this.eq(_))return 0;var T=this.isNegative(),R=_.isNegative();return T&&!R?-1:!T&&R?1:this.unsigned?_.high>>>0>this.high>>>0||_.high===this.high&&_.low>>>0>this.low>>>0?-1:1:this.sub(_).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(q)?q:this.not().add(M)},C.neg=C.negate,C.add=function(_){n(_)||(_=f(_));var T=this.high>>>16,R=this.high&65535,F=this.low>>>16,W=this.low&65535,G=_.high>>>16,me=_.high&65535,Se=_.low>>>16,Ee=_.low&65535,ue=0,qe=0,Te=0,We=0;return We+=W+Ee,Te+=We>>>16,We&=65535,Te+=F+Se,qe+=Te>>>16,Te&=65535,qe+=R+me,ue+=qe>>>16,qe&=65535,ue+=T+G,ue&=65535,l(Te<<16|We,ue<<16|qe,this.unsigned)},C.subtract=function(_){return n(_)||(_=f(_)),this.add(_.neg())},C.sub=C.subtract,C.multiply=function(_){if(this.isZero())return this;if(n(_)||(_=f(_)),e){var T=e.mul(this.low,this.high,_.low,_.high);return l(T,e.get_high(),this.unsigned)}if(_.isZero())return this.unsigned?S:x;if(this.eq(q))return _.isOdd()?q:x;if(_.eq(q))return this.isOdd()?q:x;if(this.isNegative())return _.isNegative()?this.neg().mul(_.neg()):this.neg().mul(_).neg();if(_.isNegative())return this.mul(_.neg()).neg();if(this.lt(E)&&_.lt(E))return c(this.toNumber()*_.toNumber(),this.unsigned);var R=this.high>>>16,F=this.high&65535,W=this.low>>>16,G=this.low&65535,me=_.high>>>16,Se=_.high&65535,Ee=_.low>>>16,ue=_.low&65535,qe=0,Te=0,We=0,ut=0;return ut+=G*ue,We+=ut>>>16,ut&=65535,We+=W*ue,Te+=We>>>16,We&=65535,We+=G*Ee,Te+=We>>>16,We&=65535,Te+=F*ue,qe+=Te>>>16,Te&=65535,Te+=W*Ee,qe+=Te>>>16,Te&=65535,Te+=G*Se,qe+=Te>>>16,Te&=65535,qe+=R*ue+F*Ee+W*Se+G*me,qe&=65535,l(We<<16|ut,qe<<16|Te,this.unsigned)},C.mul=C.multiply,C.divide=function(_){if(n(_)||(_=f(_)),_.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&_.low===-1&&_.high===-1)return this;var T=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,_.low,_.high);return l(T,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?S:x;var R,F,W;if(this.unsigned){if(_.unsigned||(_=_.toUnsigned()),_.gt(this))return S;if(_.gt(this.shru(1)))return I;W=S}else{if(this.eq(q)){if(_.eq(M)||_.eq(B))return q;if(_.eq(q))return M;var G=this.shr(1);return R=G.div(_).shl(1),R.eq(x)?_.isNegative()?M:B:(F=this.sub(_.mul(R)),W=R.add(F.div(_)),W)}else if(_.eq(q))return this.unsigned?S:x;if(this.isNegative())return _.isNegative()?this.neg().div(_.neg()):this.neg().div(_).neg();if(_.isNegative())return this.div(_.neg()).neg();W=x}for(F=this;F.gte(_);){R=Math.max(1,Math.floor(F.toNumber()/_.toNumber()));for(var me=Math.ceil(Math.log(R)/Math.LN2),Se=me<=48?1:u(2,me-48),Ee=c(R),ue=Ee.mul(_);ue.isNegative()||ue.gt(F);)R-=Se,Ee=c(R,this.unsigned),ue=Ee.mul(_);Ee.isZero()&&(Ee=M),W=W.add(Ee),F=F.sub(ue)}return W},C.div=C.divide,C.modulo=function(_){if(n(_)||(_=f(_)),e){var T=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,_.low,_.high);return l(T,e.get_high(),this.unsigned)}return this.sub(this.div(_).mul(_))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return l(~this.low,~this.high,this.unsigned)},C.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},C.clz=C.countLeadingZeros,C.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},C.ctz=C.countTrailingZeros,C.and=function(_){return n(_)||(_=f(_)),l(this.low&_.low,this.high&_.high,this.unsigned)},C.or=function(_){return n(_)||(_=f(_)),l(this.low|_.low,this.high|_.high,this.unsigned)},C.xor=function(_){return n(_)||(_=f(_)),l(this.low^_.low,this.high^_.high,this.unsigned)},C.shiftLeft=function(_){return n(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?l(this.low<<_,this.high<<_|this.low>>>32-_,this.unsigned):l(0,this.low<<_-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(_){return n(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?l(this.low>>>_|this.high<<32-_,this.high>>_,this.unsigned):l(this.high>>_-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(_){return n(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?l(this.low>>>_|this.high<<32-_,this.high>>>_,this.unsigned):_===32?l(this.high,0,this.unsigned):l(this.high>>>_-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.rotateLeft=function(_){var T;return n(_)&&(_=_.toInt()),(_&=63)===0?this:_===32?l(this.high,this.low,this.unsigned):_<32?(T=32-_,l(this.low<<_|this.high>>>T,this.high<<_|this.low>>>T,this.unsigned)):(_-=32,T=32-_,l(this.high<<_|this.low>>>T,this.low<<_|this.high>>>T,this.unsigned))},C.rotl=C.rotateLeft,C.rotateRight=function(_){var T;return n(_)&&(_=_.toInt()),(_&=63)===0?this:_===32?l(this.high,this.low,this.unsigned):_<32?(T=32-_,l(this.high<<T|this.low>>>_,this.low<<T|this.high>>>_,this.unsigned)):(_-=32,T=32-_,l(this.low<<T|this.high>>>_,this.high<<T|this.low>>>_,this.unsigned))},C.rotr=C.rotateRight,C.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},C.toBytes=function(_){return _?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var _=this.high,T=this.low;return[T&255,T>>>8&255,T>>>16&255,T>>>24,_&255,_>>>8&255,_>>>16&255,_>>>24]},C.toBytesBE=function(){var _=this.high,T=this.low;return[_>>>24,_>>>16&255,_>>>8&255,_&255,T>>>24,T>>>16&255,T>>>8&255,T&255]},t.fromBytes=function(_,T,R){return R?t.fromBytesLE(_,T):t.fromBytesBE(_,T)},t.fromBytesLE=function(_,T){return new t(_[0]|_[1]<<8|_[2]<<16|_[3]<<24,_[4]|_[5]<<8|_[6]<<16|_[7]<<24,T)},t.fromBytesBE=function(_,T){return new t(_[4]<<24|_[5]<<16|_[6]<<8|_[7],_[0]<<24|_[1]<<16|_[2]<<8|_[3],T)};var oe=t;return r.default=oe,"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return oO}):typeof tb=="object"&&typeof aO=="object"&&(tb.exports=oO)});var pO=g(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.loadFileDescriptorSetFromObject=ot.loadFileDescriptorSetFromBuffer=ot.fromJSON=ot.loadSync=ot.load=ot.IdempotencyLevel=ot.isAnyExtension=ot.Long=void 0;var lj=HC(),cn=lf(),ib=Zx(),sb=sO(),uj=rb();ot.Long=uj;function dj(r){return"@type"in r&&typeof r["@type"]=="string"}ot.isAnyExtension=dj;var uO;(function(r){r.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",r.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",r.IDEMPOTENT="IDEMPOTENT"})(uO=ot.IdempotencyLevel||(ot.IdempotencyLevel={}));var dO={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function fj(r,e){return r===""?e:r+"."+e}function hj(r){return r instanceof cn.Service||r instanceof cn.Type||r instanceof cn.Enum}function pj(r){return r instanceof cn.Namespace||r instanceof cn.Root}function fO(r,e){let t=fj(e,r.name);return hj(r)?[[t,r]]:pj(r)&&typeof r.nested<"u"?Object.keys(r.nested).map(n=>fO(r.nested[n],t)).reduce((n,i)=>n.concat(i),[]):[]}function cO(r,e){return function(n){return r.toObject(r.decode(n),e)}}function lO(r){return function(t){if(Array.isArray(t))throw new Error(`Failed to serialize message: expected object with ${r.name} structure, got array instead`);let n=r.fromObject(t);return r.encode(n).finish()}}function mj(r){return(r||[]).reduce((e,t)=>{for(let[n,i]of Object.entries(t))switch(n){case"uninterpreted_option":e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[n]=i}return e},{deprecated:!1,idempotency_level:uO.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function gj(r,e,t,n){let i=r.resolvedRequestType,s=r.resolvedResponseType;return{path:"/"+e+"/"+r.name,requestStream:!!r.requestStream,responseStream:!!r.responseStream,requestSerialize:lO(i),requestDeserialize:cO(i,t),responseSerialize:lO(s),responseDeserialize:cO(s,t),originalName:lj(r.name),requestType:nb(i,n),responseType:nb(s,n),options:mj(r.parsedOptions)}}function yj(r,e,t,n){let i={};for(let s of r.methodsArray)i[s.name]=gj(s,e,t,n);return i}function nb(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:t.$type.toObject(t,dO),fileDescriptorProtos:e}}function vj(r,e){let t=r.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:t.$type.toObject(t,dO),fileDescriptorProtos:e}}function bj(r,e,t,n){if(r instanceof cn.Service)return yj(r,e,t,n);if(r instanceof cn.Type)return nb(r,n);if(r instanceof cn.Enum)return vj(r,n);throw new Error("Type mismatch in reflection object handling")}function ff(r,e){let t={};r.resolveAll();let i=r.toDescriptor("proto3").file.map(s=>Buffer.from(ib.FileDescriptorProto.encode(s).finish()));for(let[s,o]of fO(r,""))t[s]=bj(o,s,e,i);return t}function hO(r,e){e=e||{};let t=cn.Root.fromDescriptor(r);return t.resolveAll(),ff(t,e)}function _j(r,e){return(0,sb.loadProtosWithOptions)(r,e).then(t=>ff(t,e))}ot.load=_j;function Ej(r,e){let t=(0,sb.loadProtosWithOptionsSync)(r,e);return ff(t,e)}ot.loadSync=Ej;function Aj(r,e){e=e||{};let t=cn.Root.fromJSON(r);return t.resolveAll(),ff(t,e)}ot.fromJSON=Aj;function wj(r,e){let t=ib.FileDescriptorSet.decode(r);return hO(t,e)}ot.loadFileDescriptorSetFromBuffer=wj;function Sj(r,e){let t=ib.FileDescriptorSet.fromObject(r);return hO(t,e)}ot.loadFileDescriptorSetFromObject=Sj;(0,sb.addCommonProtos)()});var Us=g(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.registerChannelzSocket=De.registerChannelzServer=De.registerChannelzSubchannel=De.registerChannelzChannel=De.ChannelzCallTrackerStub=De.ChannelzCallTracker=De.ChannelzChildrenTrackerStub=De.ChannelzChildrenTracker=De.ChannelzTrace=De.ChannelzTraceStub=void 0;De.unregisterChannelzRef=Ij;De.getChannelzHandlers=AO;De.getChannelzServiceDefinition=wO;De.setup=Uj;var pf=ie("net"),Bs=(dC(),$r(uC)),Sl=Er(),Tl=ge(),Tj=Ar(),Cj=Fd(),xj=gv();function ob(r){return{channel_id:r.id,name:r.name}}function db(r){return{subchannel_id:r.id,name:r.name}}function Oj(r){return{server_id:r.id}}function yf(r){return{socket_id:r.id,name:r.name}}var mO=32,fb=100,ab=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:ln(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};De.ChannelzTraceStub=ab;var cb=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,n){let i=new Date;this.events.push({description:t,severity:e,timestamp:i,childChannel:n?.kind==="channel"?n:void 0,childSubchannel:n?.kind==="subchannel"?n:void 0}),this.events.length>=mO*2&&(this.events=this.events.slice(mO)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:ln(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:ln(e.timestamp),channel_ref:e.childChannel?ob(e.childChannel):null,subchannel_ref:e.childSubchannel?db(e.childSubchannel):null}))}}};De.ChannelzTrace=cb;var mf=class{constructor(){this.channelChildren=new Bs.OrderedMap,this.subchannelChildren=new Bs.OrderedMap,this.socketChildren=new Bs.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],n=t.find(e.id);n.equals(t.end())?t.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],n=t.getElementByKey(e.id);n!==void 0&&(n.count-=1,n.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};De.ChannelzChildrenTracker=mf;var lb=class extends mf{refChild(){}unrefChild(){}};De.ChannelzChildrenTrackerStub=lb;var gf=class{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}};De.ChannelzCallTracker=gf;var ub=class extends gf{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};De.ChannelzCallTrackerStub=ub;var Un={channel:new Bs.OrderedMap,subchannel:new Bs.OrderedMap,server:new Bs.OrderedMap,socket:new Bs.OrderedMap},vf=r=>{let e=1;function t(){return e++}let n=Un[r];return(i,s,o)=>{let a=t(),c={id:a,name:i,kind:r};return o&&n.setElement(a,{ref:c,getInfo:s}),c}};De.registerChannelzChannel=vf("channel");De.registerChannelzSubchannel=vf("subchannel");De.registerChannelzServer=vf("server");De.registerChannelzSocket=vf("socket");function Ij(r){Un[r.kind].eraseElementByKey(r.id)}function Pj(r){let e=Number.parseInt(r,16);return[e/256|0,e%256]}function gO(r){if(r==="")return[];let e=r.split(":").map(n=>Pj(n));return[].concat(...e)}function kj(r){return(0,pf.isIPv6)(r)&&r.toLowerCase().startsWith("::ffff:")&&(0,pf.isIPv4)(r.substring(7))}function yO(r){return Buffer.from(Uint8Array.from(r.split(".").map(e=>Number.parseInt(e))))}function Rj(r){if((0,pf.isIPv4)(r))return yO(r);if(kj(r))return yO(r.substring(7));if((0,pf.isIPv6)(r)){let e,t,n=r.indexOf("::");n===-1?(e=r,t=""):(e=r.substring(0,n),t=r.substring(n+2));let i=Buffer.from(gO(e)),s=Buffer.from(gO(t)),o=Buffer.alloc(16-i.length-s.length,0);return Buffer.concat([i,o,s])}else return null}function bO(r){switch(r){case Sl.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Sl.ConnectivityState.IDLE:return{state:"IDLE"};case Sl.ConnectivityState.READY:return{state:"READY"};case Sl.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Sl.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function ln(r){if(!r)return null;let e=r.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function _O(r){let e=r.getInfo(),t=[],n=[];return e.children.channels.forEach(i=>{t.push(ob(i[1].ref))}),e.children.subchannels.forEach(i=>{n.push(db(i[1].ref))}),{ref:ob(r.ref),data:{target:e.target,state:bO(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:ln(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:t,subchannel_ref:n}}function Nj(r,e){let t=parseInt(r.request.channel_id,10),n=Un.channel.getElementByKey(t);if(n===void 0){e({code:Tl.Status.NOT_FOUND,details:"No channel data found for id "+t});return}e(null,{channel:_O(n)})}function Mj(r,e){let t=parseInt(r.request.max_results,10)||fb,n=[],i=parseInt(r.request.start_channel_id,10),s=Un.channel,o;for(o=s.lowerBound(i);!o.equals(s.end())&&n.length<t;o=o.next())n.push(_O(o.pointer[1]));e(null,{channel:n,end:o.equals(s.end())})}function EO(r){let e=r.getInfo(),t=[];return e.listenerChildren.sockets.forEach(n=>{t.push(yf(n[1].ref))}),{ref:Oj(r.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:ln(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:t}}function Dj(r,e){let t=parseInt(r.request.server_id,10),i=Un.server.getElementByKey(t);if(i===void 0){e({code:Tl.Status.NOT_FOUND,details:"No server data found for id "+t});return}e(null,{server:EO(i)})}function Lj(r,e){let t=parseInt(r.request.max_results,10)||fb,n=parseInt(r.request.start_server_id,10),i=Un.server,s=[],o;for(o=i.lowerBound(n);!o.equals(i.end())&&s.length<t;o=o.next())s.push(EO(o.pointer[1]));e(null,{server:s,end:o.equals(i.end())})}function Fj(r,e){let t=parseInt(r.request.subchannel_id,10),n=Un.subchannel.getElementByKey(t);if(n===void 0){e({code:Tl.Status.NOT_FOUND,details:"No subchannel data found for id "+t});return}let i=n.getInfo(),s=[];i.children.sockets.forEach(a=>{s.push(yf(a[1].ref))});let o={ref:db(n.ref),data:{target:i.target,state:bO(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:ln(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:s};e(null,{subchannel:o})}function vO(r){var e;return(0,Tj.isTcpSubchannelAddress)(r)?{address:"tcpip_address",tcpip_address:{ip_address:(e=Rj(r.host))!==null&&e!==void 0?e:void 0,port:r.port}}:{address:"uds_address",uds_address:{filename:r.path}}}function qj(r,e){var t,n,i,s,o;let a=parseInt(r.request.socket_id,10),c=Un.socket.getElementByKey(a);if(c===void 0){e({code:Tl.Status.NOT_FOUND,details:"No socket data found for id "+a});return}let l=c.getInfo(),u=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(t=l.security.cipherSuiteStandardName)!==null&&t!==void 0?t:void 0,other_name:(n=l.security.cipherSuiteOtherName)!==null&&n!==void 0?n:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(s=l.security.remoteCertificate)!==null&&s!==void 0?s:void 0}}:null,d={ref:yf(c.ref),local:l.localAddress?vO(l.localAddress):null,remote:l.remoteAddress?vO(l.remoteAddress):null,remote_name:(o=l.remoteName)!==null&&o!==void 0?o:void 0,security:u,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:ln(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:ln(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:ln(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:ln(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};e(null,{socket:d})}function Bj(r,e){let t=parseInt(r.request.server_id,10),n=Un.server.getElementByKey(t);if(n===void 0){e({code:Tl.Status.NOT_FOUND,details:"No server data found for id "+t});return}let i=parseInt(r.request.start_socket_id,10),s=parseInt(r.request.max_results,10)||fb,a=n.getInfo().sessionChildren.sockets,c=[],l;for(l=a.lowerBound(i);!l.equals(a.end())&&c.length<s;l=l.next())c.push(yf(l.pointer[1].ref));e(null,{socket_ref:c,end:l.equals(a.end())})}function AO(){return{GetChannel:Nj,GetTopChannels:Mj,GetServer:Dj,GetServers:Lj,GetSubchannel:Fj,GetSocket:qj,GetServerSockets:Bj}}var hf=null;function wO(){if(hf)return hf;let r=pO().loadSync,e=r("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return hf=(0,xj.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,hf}function Uj(){(0,Cj.registerAdminService)(wO,AO)}});var SO=g(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.Subchannel=void 0;var Ie=Er(),jj=rl(),hb=Me(),bf=ge(),zj=Qt(),Hj=Ar(),un=Us(),Gj="subchannel",Vj=~(1<<31),pb=class{constructor(e,t,n,i,s){var o;this.channelTarget=e,this.subchannelAddress=t,this.options=n,this.connector=s,this.connectivityState=Ie.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0;let a={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new jj.BackoffTimeout(()=>{this.handleBackoffTimer()},a),this.backoffTimeout.unref(),this.subchannelAddressString=(0,Hj.subchannelAddressToString)(t),this.keepaliveTime=(o=n["grpc.keepalive_time_ms"])!==null&&o!==void 0?o:-1,n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new un.ChannelzTraceStub,this.callTracker=new un.ChannelzCallTrackerStub,this.childrenTracker=new un.ChannelzChildrenTrackerStub,this.streamTracker=new un.ChannelzCallTrackerStub):(this.channelzTrace=new un.ChannelzTrace,this.callTracker=new un.ChannelzCallTracker,this.childrenTracker=new un.ChannelzChildrenTracker,this.streamTracker=new un.ChannelzCallTracker),this.channelzRef=(0,un.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(n,void 0,2)),this.secureConnector=i._createSecureConnector(e,n)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){hb.trace(bf.LogVerbosity.DEBUG,Gj,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){hb.trace(bf.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([Ie.ConnectivityState.TRANSIENT_FAILURE],Ie.ConnectivityState.CONNECTING):this.transitionToState([Ie.ConnectivityState.TRANSIENT_FAILURE],Ie.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let t=Math.min(this.keepaliveTime,Vj);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(t=>{this.transitionToState([Ie.ConnectivityState.CONNECTING],Ie.ConnectivityState.READY)?(this.transport=t,this.channelzEnabled&&this.childrenTracker.refChild(t.getChannelzRef()),t.addDisconnectListener(n=>{this.transitionToState([Ie.ConnectivityState.READY],Ie.ConnectivityState.IDLE),n&&this.keepaliveTime>0&&(this.keepaliveTime*=2,hb.log(bf.LogVerbosity.ERROR,`Connection to ${(0,zj.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([Ie.ConnectivityState.CONNECTING],Ie.ConnectivityState.TRANSIENT_FAILURE,`${t}`)})}transitionToState(e,t,n){var i,s;if(e.indexOf(this.connectivityState)===-1)return!1;n?this.trace(Ie.ConnectivityState[this.connectivityState]+" -> "+Ie.ConnectivityState[t]+' with error "'+n+'"'):this.trace(Ie.ConnectivityState[this.connectivityState]+" -> "+Ie.ConnectivityState[t]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+Ie.ConnectivityState[t]);let o=this.connectivityState;switch(this.connectivityState=t,t){case Ie.ConnectivityState.READY:this.stopBackoff();break;case Ie.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case Ie.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case Ie.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${t}`)}for(let a of this.stateListeners)a(this,o,t,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,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,un.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([Ie.ConnectivityState.CONNECTING,Ie.ConnectivityState.READY],Ie.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,n,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:o=>{o.code===bf.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):s={},this.transport.createCall(e,t,n,i,s)}startConnecting(){process.nextTick(()=>{this.transitionToState([Ie.ConnectivityState.IDLE],Ie.ConnectivityState.CONNECTING)||this.connectivityState===Ie.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([Ie.ConnectivityState.TRANSIENT_FAILURE],Ie.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()}};_f.Subchannel=pb});var TO=g(Ef=>{"use strict";var mb;Object.defineProperty(Ef,"__esModule",{value:!0});Ef.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Ef.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((mb=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&mb!==void 0?mb:"false")==="true"});var _b=g(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.DEFAULT_PORT=void 0;js.setup=Zj;var CO=Xr(),gb=ie("dns"),Wj=Gy(),yb=ge(),vb=Pt(),Kj=Me(),Jj=ge(),xi=Qt(),xO=ie("net"),Qj=rl(),OO=TO(),Yj="dns_resolver";function dn(r){Kj.trace(Jj.LogVerbosity.DEBUG,Yj,r)}js.DEFAULT_PORT=443;var $j=3e4,bb=class{constructor(e,t,n){var i,s,o;this.target=e,this.listener=t,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfig=null,this.latestServiceConfigError=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new gb.promises.Resolver,dn("Resolver constructed for target "+(0,xi.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let a=(0,xi.splitHostPort)(e.path);a===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,xO.isIPv4)(a.host)||(0,xO.isIPv6)(a.host)?(this.ipResult=[{addresses:[{host:a.host,port:(i=a.port)!==null&&i!==void 0?i:js.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=a.host,this.port=(s=a.port)!==null&&s!==void 0?s:js.DEFAULT_PORT),this.percentage=Math.random()*100,n["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:yb.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,xi.uriToString)(this.target)}`,metadata:new vb.Metadata};let c={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoff=new Qj.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(o=n["grpc.dns_min_time_between_resolutions_ms"])!==null&&o!==void 0?o:$j,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(dn("Returning IP address for target "+(0,xi.uriToString)(this.target)),setImmediate(()=>{this.listener.onSuccessfulResolution(this.ipResult,null,null,null,{})}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)dn("Failed to parse DNS address "+(0,xi.uriToString)(this.target)),setImmediate(()=>{this.listener.onError({code:yb.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,xi.uriToString)(this.target)}`,metadata:new vb.Metadata})}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;dn("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(t=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.backoff.reset(),this.backoff.stop(),this.latestLookupResult=t.map(i=>({addresses:[i]}));let n="["+t.map(i=>i.host+":"+i.port).join(",")+"]";if(dn("Resolved addresses for target "+(0,xi.uriToString)(this.target)+": "+n),this.latestLookupResult.length===0){this.listener.onError(this.defaultResolutionError);return}this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})},t=>{this.pendingLookupPromise!==null&&(dn("Resolution error for target "+(0,xi.uriToString)(this.target)+": "+t.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener.onError(this.defaultResolutionError))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(t=>{if(this.pendingTxtPromise!==null){this.pendingTxtPromise=null;try{this.latestServiceConfig=(0,Wj.extractAndSelectServiceConfig)(t,this.percentage)}catch(n){this.latestServiceConfigError={code:yb.Status.UNAVAILABLE,details:`Parsing service config failed with error ${n.message}`,metadata:new vb.Metadata}}this.latestLookupResult!==null&&this.listener.onSuccessfulResolution(this.latestLookupResult,this.latestServiceConfig,this.latestServiceConfigError,null,{})}},t=>{}))}}async lookup(e){if(OO.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){dn("Using alternative DNS resolver.");let n=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(n.every(i=>i.status==="rejected"))throw new Error(n[0].reason);return n.reduce((i,s)=>s.status==="fulfilled"?[...i,...s.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await gb.promises.lookup(e,{all:!0})).map(n=>({host:n.address,port:+this.port}))}async resolveTxt(e){return OO.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(dn("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):gb.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)===null||t===void 0||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?dn('resolution update delayed by "min time between resolutions" rate limit'):dn("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.latestServiceConfig=null,this.latestServiceConfigError=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function Zj(){(0,CO.registerResolver)("dns",bb),(0,CO.registerDefaultScheme)("dns")}});var Eb=g(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.parseCIDR=kO;Ol.mapProxyName=c9;Ol.getProxiedConnection=l9;var Cl=Me(),ra=ge(),PO=ie("net"),Xj=ie("http"),e9=Me(),IO=Ar(),xl=Qt(),t9=ie("url"),r9=_b(),n9="proxy";function na(r){e9.trace(ra.LogVerbosity.DEBUG,n9,r)}function i9(){let r="",e="";if(process.env.grpc_proxy)e="grpc_proxy",r=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",r=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",r=process.env.http_proxy;else return{};let t;try{t=new t9.URL(r)}catch{return(0,Cl.log)(ra.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(t.protocol!=="http:")return(0,Cl.log)(ra.LogVerbosity.ERROR,`"${t.protocol}" scheme not supported in proxy URI`),{};let n=null;t.username&&(t.password?((0,Cl.log)(ra.LogVerbosity.INFO,"userinfo found in proxy URI"),n=decodeURIComponent(`${t.username}:${t.password}`)):n=t.username);let i=t.hostname,s=t.port;s===""&&(s="80");let o={address:`${i}:${s}`};return n&&(o.creds=n),na("Proxy server "+o.address+" set by environment variable "+e),o}function s9(){let r=process.env.no_grpc_proxy,e="no_grpc_proxy";return r||(r=process.env.no_proxy,e="no_proxy"),r?(na("No proxy server list set by environment variable "+e),r.split(",")):[]}function kO(r){let e=r.split("/");if(e.length!==2)return null;let t=parseInt(e[1],10);return!(0,PO.isIPv4)(e[0])||Number.isNaN(t)||t<0||t>32?null:{ip:RO(e[0]),prefixLength:t}}function RO(r){return r.split(".").reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function o9(r,e){let t=r.ip,n=-1<<32-r.prefixLength;return(RO(e)&n)===(t&n)}function a9(r){for(let e of s9()){let t=kO(e);if((0,PO.isIPv4)(r)&&t&&o9(t,r))return!0;if(r.endsWith(e))return!0}return!1}function c9(r,e){var t;let n={target:r,extraOptions:{}};if(((t=e["grpc.enable_http_proxy"])!==null&&t!==void 0?t:1)===0||r.scheme==="unix")return n;let i=i9();if(!i.address)return n;let s=(0,xl.splitHostPort)(r.path);if(!s)return n;let o=s.host;if(a9(o))return na("Not using proxy for target in no_proxy list: "+(0,xl.uriToString)(r)),n;let a={"grpc.http_connect_target":(0,xl.uriToString)(r)};return i.creds&&(a["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:a}}function l9(r,e){var t;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let n=e["grpc.http_connect_target"],i=(0,xl.parseUri)(n);if(i===null)return Promise.resolve(null);let s=(0,xl.splitHostPort)(i.path);if(s===null)return Promise.resolve(null);let o=`${s.host}:${(t=s.port)!==null&&t!==void 0?t:r9.DEFAULT_PORT}`,a={method:"CONNECT",path:o},c={Host:o};(0,IO.isTcpSubchannelAddress)(r)?(a.host=r.host,a.port=r.port):a.socketPath=r.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),a.headers=c;let l=(0,IO.subchannelAddressToString)(r);return na("Using proxy "+l+" to connect to "+a.path),new Promise((u,d)=>{let f=Xj.request(a);f.once("connect",(h,m,p)=>{f.removeAllListeners(),m.removeAllListeners(),h.statusCode===200?(na("Successfully connected to "+a.path+" through proxy "+l),p.length>0&&m.unshift(p),na("Successfully established a plaintext connection to "+a.path+" through proxy "+l),u(m)):((0,Cl.log)(ra.LogVerbosity.ERROR,"Failed to connect to "+a.path+" through proxy "+l+" with status "+h.statusCode),d())}),f.once("error",h=>{f.removeAllListeners(),(0,Cl.log)(ra.LogVerbosity.ERROR,"Failed to connect to proxy "+l+" with error "+h.message),d()}),f.end()})}});var wb=g(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.StreamDecoder=void 0;var fn;(function(r){r[r.NO_DATA=0]="NO_DATA",r[r.READING_SIZE=1]="READING_SIZE",r[r.READING_MESSAGE=2]="READING_MESSAGE"})(fn||(fn={}));var Ab=class{constructor(e){this.maxReadMessageLength=e,this.readState=fn.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let t=0,n,i=[];for(;t<e.length;)switch(this.readState){case fn.NO_DATA:this.readCompressFlag=e.slice(t,t+1),t+=1,this.readState=fn.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case fn.READING_SIZE:if(n=Math.min(e.length-t,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,t,t+n),this.readSizeRemaining-=n,t+=n,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&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=fn.READING_MESSAGE;else{let s=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=fn.NO_DATA,i.push(s)}}break;case fn.READING_MESSAGE:if(n=Math.min(e.length-t,this.readMessageRemaining),this.readPartialMessage.push(e.slice(t,t+n)),this.readMessageRemaining-=n,t+=n,this.readMessageRemaining===0){let s=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),o=Buffer.concat(s,this.readMessageSize+5);this.readState=fn.NO_DATA,i.push(o)}break;default:throw new Error("Unexpected read state")}return i}};Af.StreamDecoder=Ab});var NO=g(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.Http2SubchannelCall=void 0;var jn=ie("http2"),u9=ie("os"),Pe=ge(),zn=Pt(),d9=wb(),f9=Me(),h9=ge(),p9="subchannel_call";function m9(r){for(let[e,t]of Object.entries(u9.constants.errno))if(t===r)return e;return"Unknown system error "+r}function Sb(r){let e=`Received HTTP status code ${r}`,t;switch(r){case 400:t=Pe.Status.INTERNAL;break;case 401:t=Pe.Status.UNAUTHENTICATED;break;case 403:t=Pe.Status.PERMISSION_DENIED;break;case 404:t=Pe.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:t=Pe.Status.UNAVAILABLE;break;default:t=Pe.Status.UNKNOWN}return{code:t,details:e,metadata:new zn.Metadata}}var Tb=class{constructor(e,t,n,i,s){var o;this.http2Stream=e,this.callEventTracker=t,this.listener=n,this.transport=i,this.callId=s,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;let a=(o=i.getOptions()["grpc.max_receive_message_length"])!==null&&o!==void 0?o:Pe.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new d9.StreamDecoder(a),e.on("response",(c,l)=>{let u="";for(let d of Object.keys(c))u+=" "+d+": "+c[d]+`
|
23
|
+
`;if(this.trace(`Received server headers:
|
24
|
+
`+u),this.httpStatusCode=c[":status"],l&jn.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(c);else{let d;try{d=zn.Metadata.fromHttp2Headers(c)}catch(f){this.endCall({code:Pe.Status.UNKNOWN,details:f.message,metadata:new zn.Metadata});return}this.listener.onReceiveMetadata(d)}}),e.on("trailers",c=>{this.handleTrailers(c)}),e.on("data",c=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+c.length);let l;try{l=this.decoder.write(c)}catch(u){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let d=Sb(this.httpStatusCode);this.cancelWithStatus(d.code,d.details)}else this.cancelWithStatus(Pe.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of l)this.trace("parsed message of length "+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var c;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((c=this.finalStatus)===null||c===void 0?void 0:c.code)===Pe.Status.OK)return;let l,u="";switch(e.rstCode){case jn.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let d=Sb(this.httpStatusCode);l=d.code,u=d.details}else l=Pe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case jn.constants.NGHTTP2_REFUSED_STREAM:l=Pe.Status.UNAVAILABLE,u="Stream refused by server";break;case jn.constants.NGHTTP2_CANCEL:this.connectionDropped?(l=Pe.Status.UNAVAILABLE,u="Connection dropped"):(l=Pe.Status.CANCELLED,u="Call cancelled");break;case jn.constants.NGHTTP2_ENHANCE_YOUR_CALM:l=Pe.Status.RESOURCE_EXHAUSTED,u="Bandwidth exhausted or memory limit exceeded";break;case jn.constants.NGHTTP2_INADEQUATE_SECURITY:l=Pe.Status.PERMISSION_DENIED,u="Protocol not secure enough";break;case jn.constants.NGHTTP2_INTERNAL_ERROR:l=Pe.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(l=Pe.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:l=Pe.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:l,details:u,metadata:new zn.Metadata,rstCode:e.rstCode})})}),e.on("error",c=>{c.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+c.message+" code="+c.code+" errno="+m9(c.errno)+" syscall="+c.syscall),this.internalError=c),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:Pe.Status.UNAVAILABLE,details:"Connection dropped",metadata:new zn.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){f9.trace(h9.LogVerbosity.DEBUG,p9,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===Pe.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==Pe.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!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="";for(let o of Object.keys(e))t+=" "+o+": "+e[o]+`
|
25
|
+
`;this.trace(`Received server trailers:
|
26
|
+
`+t);let n;try{n=zn.Metadata.fromHttp2Headers(e)}catch{n=new zn.Metadata}let i=n.getMap(),s;if(typeof i["grpc-status"]=="string"){let o=Number(i["grpc-status"]);this.trace("received status code "+o+" from server"),n.remove("grpc-status");let a="";if(typeof i["grpc-message"]=="string"){try{a=decodeURI(i["grpc-message"])}catch{a=i["grpc-message"]}n.remove("grpc-message"),this.trace('received status details string "'+a+'" from server')}s={code:o,details:a,metadata:n}}else this.httpStatusCode?(s=Sb(this.httpStatusCode),s.metadata=n):s={code:Pe.Status.UNKNOWN,details:"No status information received",metadata:n};this.endCall(s)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let t;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===Pe.Status.OK?t=jn.constants.NGHTTP2_NO_ERROR:t=jn.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+t),this.http2Stream.close(t)}}cancelWithStatus(e,t){this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),this.endCall({code:e,details:t,metadata:new zn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==Pe.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace("write() called with message of length "+t.length);let n=i=>{process.nextTick(()=>{var s;let o=Pe.Status.UNAVAILABLE;i?.code==="ERR_STREAM_WRITE_AFTER_END"&&(o=Pe.Status.INTERNAL),i&&this.cancelWithStatus(o,`Write error: ${i.message}`),(s=e.callback)===null||s===void 0||s.call(e)})};this.trace("sending data chunk of length "+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,n)}catch(i){this.endCall({code:Pe.Status.UNAVAILABLE,details:`Write failed with error ${i.message}`,metadata:new zn.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};wf.Http2SubchannelCall=Tb});var xb=g(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});Cb.getNextCallNumber=y9;var g9=0;function y9(){return g9++}});var MO=g(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.Http2SubchannelConnector=void 0;var Rb=ie("http2"),Sf=Us(),Il=ge(),v9=Eb(),ia=Me(),b9=Xr(),Tf=Ar(),Ob=Qt(),_9=ie("net"),E9=NO(),A9=xb(),Ib="transport",w9="transport_flowctrl",S9=Sy().version,{HTTP2_HEADER_AUTHORITY:T9,HTTP2_HEADER_CONTENT_TYPE:C9,HTTP2_HEADER_METHOD:x9,HTTP2_HEADER_PATH:O9,HTTP2_HEADER_TE:I9,HTTP2_HEADER_USER_AGENT:P9}=Rb.constants,k9=2e4,R9=Buffer.from("too_many_pings","ascii"),Pb=class{constructor(e,t,n,i){this.session=e,this.options=n,this.remoteName=i,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,Tf.subchannelAddressToString)(t),n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new Sf.ChannelzCallTrackerStub):this.streamTracker=new Sf.ChannelzCallTracker,this.channelzRef=(0,Sf.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[n["grpc.primary_user_agent"],`grpc-node-js/${S9}`,n["grpc.secondary_user_agent"]].filter(s=>s).join(" "),"grpc.keepalive_time_ms"in n?this.keepaliveTimeMs=n["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in n?this.keepaliveTimeoutMs=n["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=k9,"grpc.keepalive_permit_without_calls"in n?this.keepaliveWithoutCalls=n["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(s,o,a)=>{let c=!1;s===Rb.constants.NGHTTP2_ENHANCE_YOUR_CALM&&a&&a.equals(R9)&&(c=!0),this.trace("connection closed by GOAWAY with code "+s+" and data "+a?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",s=>{this.trace("connection closed with error "+s.message),this.handleDisconnect()}),e.socket.once("close",s=>{this.trace("connection closed. hadError="+s),this.handleDisconnect()}),ia.isTracerEnabled(Ib)&&(e.on("remoteSettings",s=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))}),e.on("localSettings",s=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer()}getChannelzInfo(){var e,t,n;let i=this.session.socket,s=i.remoteAddress?(0,Tf.stringToSubchannelAddress)(i.remoteAddress,i.remotePort):null,o=i.localAddress?(0,Tf.stringToSubchannelAddress)(i.localAddress,i.localPort):null,a;if(this.session.encrypted){let l=i,u=l.getCipher(),d=l.getCertificate(),f=l.getPeerCertificate();a={cipherSuiteStandardName:(e=u.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:d&&"raw"in d?d.raw:null,remoteCertificate:f&&"raw"in f?f.raw:null}}else a=null;return{remoteAddress:s,localAddress:o,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:(t=this.session.state.localWindowSize)!==null&&t!==void 0?t:null,remoteFlowControlWindow:(n=this.session.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(e){ia.trace(Il.LogVerbosity.DEBUG,Ib,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){ia.trace(Il.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){ia.trace(Il.LogVerbosity.DEBUG,w9,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){ia.trace(Il.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(let 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()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}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),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e);let n="";try{this.session.ping((s,o,a)=>{this.clearKeepaliveTimeout(),s?(this.keepaliveTrace("Ping failed with error "+s.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(n="Ping returned false")}catch(i){n=(i instanceof Error?i.message:"")||"Unknown error"}n&&(this.keepaliveTrace("Ping send failed: "+n),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),(t=(e=this.keepaliveTimer).unref)===null||t===void 0||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,n,i,s){let o=e.toHttp2Headers();o[T9]=t,o[P9]=this.userAgent,o[C9]="application/grpc",o[x9]="POST",o[O9]=n,o[I9]="trailers";let a;try{a=this.session.request(o)}catch(u){throw this.handleDisconnect(),u}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);let c,l;return this.channelzEnabled?(this.streamTracker.addCallStarted(),c={addMessageSent:()=>{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=s.addMessageSent)===null||u===void 0||u.call(s)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=s.addMessageReceived)===null||u===void 0||u.call(s)},onCallEnd:u=>{var d;(d=s.onCallEnd)===null||d===void 0||d.call(s,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=s.onStreamEnd)===null||d===void 0||d.call(s,u)}}):c={addMessageSent:()=>{var u;(u=s.addMessageSent)===null||u===void 0||u.call(s)},addMessageReceived:()=>{var u;(u=s.addMessageReceived)===null||u===void 0||u.call(s)},onCallEnd:u=>{var d;(d=s.onCallEnd)===null||d===void 0||d.call(s,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;(d=s.onStreamEnd)===null||d===void 0||d.call(s,u)}},l=new E9.Http2SubchannelCall(a,c,i,this,(0,A9.getNextCallNumber)()),this.addActiveCall(l),l}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}shutdown(){this.session.close(),(0,Sf.unregisterChannelzRef)(this.channelzRef)}},kb=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ia.trace(Il.LogVerbosity.DEBUG,Ib,(0,Ob.uriToString)(this.channelTarget)+" "+e)}createSession(e,t,n){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((i,s)=>{let o=null,a=this.channelTarget;if("grpc.http_connect_target"in n){let y=(0,Ob.parseUri)(n["grpc.http_connect_target"]);y&&(a=y,o=(0,Ob.uriToString)(y))}let c=e.secure?"https":"http",l=(0,b9.getDefaultAuthority)(a),u=()=>{var y;(y=this.session)===null||y===void 0||y.destroy(),this.session=null,setImmediate(()=>{p||(p=!0,s(`${m.trim()} (${new Date().toISOString()})`))})},d=y=>{var b;(b=this.session)===null||b===void 0||b.destroy(),m=y.message,this.trace("connection failed with error "+m),p||(p=!0,s(`${m} (${new Date().toISOString()})`))},f={createConnection:(y,b)=>e.socket};n["grpc-node.flow_control_window"]!==void 0&&(f.settings={initialWindowSize:n["grpc-node.flow_control_window"]});let h=Rb.connect(`${c}://${l}`,f);this.session=h;let m="Failed to connect",p=!1;h.unref(),h.once("remoteSettings",()=>{h.removeAllListeners(),e.socket.removeListener("close",u),e.socket.removeListener("error",d),i(new Pb(h,t,n,o)),this.session=null}),h.once("close",u),h.once("error",d),e.socket.once("close",u),e.socket.once("error",d)})}tcpConnect(e,t){return(0,v9.getProxiedConnection)(e,t).then(n=>n||new Promise((i,s)=>{let o=()=>{s(new Error("Socket closed"))},a=l=>{s(l)},c=_9.connect(e,()=>{c.removeListener("close",o),c.removeListener("error",a),i(c)});c.once("close",o),c.once("error",a)}))}async connect(e,t,n){if(this.isShutdown)return Promise.reject();let i=null,s=null,o=(0,Tf.subchannelAddressToString)(e);try{return this.trace(o+" Waiting for secureConnector to be ready"),await t.waitForReady(),this.trace(o+" secureConnector is ready"),i=await this.tcpConnect(e,n),i.setNoDelay(),this.trace(o+" Established TCP connection"),s=await t.connect(i),this.trace(o+" Established secure connection"),this.createSession(s,e,n)}catch(a){throw i?.destroy(),s?.socket.destroy(),a}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};Cf.Http2SubchannelConnector=kb});var DO=g(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.SubchannelPool=void 0;kl.getSubchannelPool=U9;var N9=sC(),M9=SO(),D9=Ar(),L9=Qt(),F9=MO(),q9=1e4,Pl=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let i=this.pool[t].filter(s=>!s.subchannel.unrefIfOneRef());i.length>0&&(e=!1),this.pool[t]=i}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},q9),(t=(e=this.cleanupTimer).unref)===null||t===void 0||t.call(e))}getOrCreateSubchannel(e,t,n,i){this.ensureCleanupTask();let s=(0,L9.uriToString)(e);if(s in this.pool){let a=this.pool[s];for(let c of a)if((0,D9.subchannelAddressEqual)(t,c.subchannelAddress)&&(0,N9.channelOptionsEqual)(n,c.channelArguments)&&i._equals(c.channelCredentials))return c.subchannel}let o=new M9.Subchannel(e,t,n,i,new F9.Http2SubchannelConnector(e));return s in this.pool||(this.pool[s]=[]),this.pool[s].push({subchannelAddress:t,channelArguments:n,channelCredentials:i,subchannel:o}),o.ref(),o}};kl.SubchannelPool=Pl;var B9=new Pl;function U9(r){return r?B9:new Pl}});var Mb=g(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.FilterStackFactory=sa.FilterStack=void 0;var xf=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let n=0;n<this.filters.length;n++)t=this.filters[n].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let n=this.filters.length-1;n>=0;n--)t=this.filters[n].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let n=0;n<this.filters.length;n++)t=this.filters[n].sendMessage(t);return t}receiveMessage(e){let t=e;for(let n=this.filters.length-1;n>=0;n--)t=this.filters[n].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let n=this.filters.length-1;n>=0;n--)t=this.filters[n].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};sa.FilterStack=xf;var Nb=class r{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new r([...this.factories])}createFilter(){return new xf(this.factories.map(e=>e.createFilter()))}};sa.FilterStackFactory=Nb});var Db=g(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.CompressionAlgorithms=void 0;var LO;(function(r){r[r.identity=0]="identity",r[r.deflate=1]="deflate",r[r.gzip=2]="gzip"})(LO||(Of.CompressionAlgorithms=LO={}))});var Fb=g(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.BaseFilter=void 0;var Lb=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};If.BaseFilter=Lb});var BO=g(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.CompressionFilterFactory=ca.CompressionFilter=void 0;var Pf=ie("zlib"),qO=Db(),oa=ge(),j9=Fb(),z9=Me(),H9=r=>typeof r=="number"&&typeof qO.CompressionAlgorithms[r]=="string",aa=class{async writeMessage(e,t){let n=e;t&&(n=await this.compressMessage(n));let i=Buffer.allocUnsafe(n.length+5);return i.writeUInt8(t?1:0,0),i.writeUInt32BE(n.length,1),n.copy(i,5),i}async readMessage(e){let t=e.readUInt8(0)===1,n=e.slice(5);return t&&(n=await this.decompressMessage(n)),n}},zs=class extends aa{async compressMessage(e){return e}async writeMessage(e,t){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},qb=class extends aa{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,n)=>{Pf.deflate(e,(i,s)=>{i?n(i):t(s)})})}decompressMessage(e){return new Promise((t,n)=>{let i=0,s=[],o=Pf.createInflate();o.on("data",a=>{s.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(o.destroy(),n({code:oa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{t(Buffer.concat(s))}),o.write(e),o.end()})}},Bb=class extends aa{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((t,n)=>{Pf.gzip(e,(i,s)=>{i?n(i):t(s)})})}decompressMessage(e){return new Promise((t,n)=>{let i=0,s=[],o=Pf.createGunzip();o.on("data",a=>{s.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(o.destroy(),n({code:oa.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{t(Buffer.concat(s))}),o.write(e),o.end()})}},Ub=class extends aa{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 FO(r,e){switch(r){case"identity":return new zs;case"deflate":return new qb(e);case"gzip":return new Bb(e);default:return new Ub(r)}}var kf=class extends j9.BaseFilter{constructor(e,t){var n,i,s;super(),this.sharedFilterConfig=t,this.sendCompression=new zs,this.receiveCompression=new zs,this.currentCompressionAlgorithm="identity";let o=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(n=e["grpc.max_receive_message_length"])!==null&&n!==void 0?n:oa.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=e["grpc.max_send_message_length"])!==null&&i!==void 0?i:oa.DEFAULT_MAX_SEND_MESSAGE_LENGTH,o!==void 0)if(H9(o)){let a=qO.CompressionAlgorithms[o],c=(s=t.serverSupportedEncodingHeader)===null||s===void 0?void 0:s.split(",");(!c||c.includes(a))&&(this.currentCompressionAlgorithm=a,this.sendCompression=FO(this.currentCompressionAlgorithm,-1))}else z9.log(oa.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${o}`)}async sendMetadata(e){let t=await e;return t.set("grpc-accept-encoding","identity,deflate,gzip"),t.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?t.remove("grpc-encoding"):t.set("grpc-encoding",this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get("grpc-encoding");if(t.length>0){let i=t[0];typeof i=="string"&&(this.receiveCompression=FO(i,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let n=e.get("grpc-accept-encoding")[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new zs,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var t;let n=await e;if(this.maxSendMessageLength!==-1&&n.message.length>this.maxSendMessageLength)throw{code:oa.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof zs?i=!1:i=(((t=n.flags)!==null&&t!==void 0?t:0)&2)===0,{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};ca.CompressionFilter=kf;var jb=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new kf(this.options,this.sharedFilterConfig)}};ca.CompressionFilterFactory=jb});var Rl=g(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.minDeadline=G9;Hs.getDeadlineTimeoutString=W9;Hs.getRelativeTimeout=J9;Hs.deadlineToString=Q9;Hs.formatDateDifference=Y9;function G9(...r){let e=1/0;for(let t of r){let n=t instanceof Date?t.getTime():t;n<e&&(e=n)}return e}var V9=[["m",1],["S",1e3],["M",60*1e3],["H",60*60*1e3]];function W9(r){let e=new Date().getTime();r instanceof Date&&(r=r.getTime());let t=Math.max(r-e,0);for(let[n,i]of V9){let s=t/i;if(s<1e8)return String(Math.ceil(s))+n}throw new Error("Deadline is too far in the future")}var K9=2147483647;function J9(r){let e=r instanceof Date?r.getTime():r,t=new Date().getTime(),n=e-t;return n<0?0:n>K9?1/0:n}function Q9(r){if(r instanceof Date)return r.toISOString();{let e=new Date(r);return Number.isNaN(e.getTime())?""+r:e.toISOString()}}function Y9(r,e){return((e.getTime()-r.getTime())/1e3).toFixed(3)+"s"}});var Rf=g(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});zb.restrictControlPlaneStatusCode=Z9;var hn=ge(),$9=[hn.Status.OK,hn.Status.INVALID_ARGUMENT,hn.Status.NOT_FOUND,hn.Status.ALREADY_EXISTS,hn.Status.FAILED_PRECONDITION,hn.Status.ABORTED,hn.Status.OUT_OF_RANGE,hn.Status.DATA_LOSS];function Z9(r,e){return $9.includes(r)?{code:hn.Status.INTERNAL,details:`Invalid status from control plane: ${r} ${hn.Status[r]} ${e}`}:{code:r,details:e}}});var zO=g(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.LoadBalancingCall=void 0;var UO=Er(),Nf=ge(),jO=Rl(),Mf=Pt(),Nl=bi(),X9=Qt(),e4=Me(),Hb=Rf(),t4=ie("http2"),r4="load_balancing_call",Gb=class{constructor(e,t,n,i,s,o,a){var c,l;this.channel=e,this.callConfig=t,this.methodName=n,this.host=i,this.credentials=s,this.deadline=o,this.callNumber=a,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;let u=this.methodName.split("/"),d="";u.length>=2&&(d=u[1]);let f=(l=(c=(0,X9.splitHostPort)(this.host))===null||c===void 0?void 0:c.host)!==null&&l!==void 0?l:"localhost";this.serviceUrl=`https://${f}/${d}`,this.startTime=new Date}getDeadlineInfo(){var e,t;let n=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&n.push("wait_for_ready"),n.push(`LB pick: ${(0,jO.formatDateDifference)(this.startTime,this.childStartTime)}`)),n.push(...this.child.getDeadlineInfo()),n):(!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady&&n.push("wait_for_ready"),n.push("Waiting for LB pick"),n)}trace(e){e4.trace(Nf.LogVerbosity.DEBUG,r4,"["+this.callNumber+"] "+e)}outputStatus(e,t){var n,i;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let s=Object.assign(Object.assign({},e),{progress:t});(n=this.listener)===null||n===void 0||n.onReceiveStatus(s),(i=this.onCallEnded)===null||i===void 0||i.call(this,s.code)}}doPick(){var e,t;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let n=this.metadata.clone(),i=this.channel.doPick(n,this.callConfig.pickInformation),s=i.subchannel?"("+i.subchannel.getChannelzRef().id+") "+i.subchannel.getAddress():""+i.subchannel;switch(this.trace("Pick result: "+Nl.PickResultType[i.pickResultType]+" subchannel: "+s+" status: "+((e=i.status)===null||e===void 0?void 0:e.code)+" "+((t=i.status)===null||t===void 0?void 0:t.details)),i.pickResultType){case Nl.PickResultType.COMPLETE:this.credentials.compose(i.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(l=>{var u;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(n.merge(l),n.get("authorization").length>1&&this.outputStatus({code:Nf.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new Mf.Metadata},"PROCESSED"),i.subchannel.getConnectivityState()!==UO.ConnectivityState.READY){this.trace("Picked subchannel "+s+" has state "+UO.ConnectivityState[i.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&n.set("grpc-timeout",(0,jO.getDeadlineTimeoutString)(this.deadline));try{this.child=i.subchannel.getRealSubchannel().createCall(n,this.host,this.methodName,{onReceiveMetadata:d=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(d)},onReceiveMessage:d=>{this.trace("Received message"),this.listener.onReceiveMessage(d)},onReceiveStatus:d=>{this.trace("Received status"),d.rstCode===t4.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(d,"REFUSED"):this.outputStatus(d,"PROCESSED")}}),this.childStartTime=new Date}catch(d){this.trace("Failed to start call on picked subchannel "+s+" with error "+d.message),this.outputStatus({code:Nf.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+d.message,metadata:new Mf.Metadata},"NOT_STARTED");return}(u=i.onCallStarted)===null||u===void 0||u.call(i),this.onCallEnded=i.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()},l=>{let{code:u,details:d}=(0,Hb.restrictControlPlaneStatusCode)(typeof l.code=="number"?l.code:Nf.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${l.message}`);this.outputStatus({code:u,details:d,metadata:new Mf.Metadata},"PROCESSED")});break;case Nl.PickResultType.DROP:let{code:a,details:c}=(0,Hb.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:a,details:c,metadata:i.status.metadata},"DROP")});break;case Nl.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:l,details:u}=(0,Hb.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:l,details:u,metadata:i.status.metadata},"PROCESSED")})}break;case Nl.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var n;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new Mf.Metadata},"PROCESSED")}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?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}};Df.LoadBalancingCall=Gb});var GO=g(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.ResolvingCall=void 0;var n4=Ad(),Gs=ge(),Vs=Rl(),HO=Pt(),i4=Me(),s4=Rf(),o4="resolving_call",Vb=class{constructor(e,t,n,i,s){this.channel=e,this.method=t,this.filterStackFactory=i,this.callNumber=s,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=n4.CallCredentials.createEmpty(),this.deadline=n.deadline,this.host=n.host,n.parentCall&&(n.flags&Gs.Propagate.CANCELLATION&&n.parentCall.on("cancelled",()=>{this.cancelWithStatus(Gs.Status.CANCELLED,"Cancelled by parent call")}),n.flags&Gs.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+n.parentCall.getDeadline()),this.deadline=(0,Vs.minDeadline)(this.deadline,n.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){i4.trace(Gs.LogVerbosity.DEBUG,o4,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,Vs.deadlineToString)(this.deadline));let e=(0,Vs.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(Gs.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let n=[],i=new Date;n.push(`Deadline exceeded after ${(0,Vs.formatDateDifference)(this.deadlineStartTime,i)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&n.push(`name resolution: ${(0,Vs.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&n.push(`metadata filters: ${(0,Vs.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):n.push("waiting for metadata filters")):n.push("waiting for name resolution"),this.child&&n.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(Gs.Status.DEADLINE_EXCEEDED,n.join(","))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+t.code+' details="'+t.details+'"'),this.statusWatchers.forEach(n=>n(t)),process.nextTick(()=>{var n;(n=this.listener)===null||n===void 0||n.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(i=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,i.message),this.pendingHalfClose&&n.halfClose()},i=>{this.cancelWithStatus(i.code,i.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==Gs.Status.OK){let{code:n,details:i}=(0,s4.restrictControlPlaneStatusCode)(t.status,"Failed to route call to method "+this.method);this.outputStatus({code:n,details:i,metadata:new HO.Metadata});return}if(t.methodConfig.timeout){let n=new Date;n.setSeconds(n.getSeconds()+t.methodConfig.timeout.seconds),n.setMilliseconds(n.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,Vs.minDeadline)(this.deadline,n),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(n=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(n,{onReceiveMetadata:i=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(i))},onReceiveMessage:i=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(i).then(s=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(s),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},s=>{this.cancelWithStatus(s.code,s.details)})},onReceiveStatus:i=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=i:this.outputStatus(i)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},n=>{this.outputStatus(n)})}reportResolverError(e){var t;!((t=this.metadata)===null||t===void 0)&&t.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var n;this.trace("cancelWithStatus code: "+e+' details: "'+t+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new HO.Metadata})}getPeer(){var e,t;return(t=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&t!==void 0?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}};Lf.ResolvingCall=Vb});var VO=g(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.RetryingCall=Oi.MessageBufferTracker=Oi.RetryThrottler=void 0;var Ff=ge(),a4=Rl(),c4=Pt(),l4=Me(),u4="retrying_call",Kb=class{constructor(e,t,n){this.maxTokens=e,this.tokenRatio=t,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=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}};Oi.RetryThrottler=Kb;var Jb=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){var n;let i=(n=this.allocatedPerCall.get(t))!==null&&n!==void 0?n:0;return this.limitPerCall-i<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,i+e),this.totalAllocated+=e,!0)}free(e,t){var n;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let i=(n=this.allocatedPerCall.get(t))!==null&&n!==void 0?n:0;if(i<e)throw new Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${i}`);this.allocatedPerCall.set(t,i-e)}freeAll(e){var t;let n=(t=this.allocatedPerCall.get(e))!==null&&t!==void 0?t:0;if(this.totalAllocated<n)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${n} > total allocated ${this.totalAllocated}`);this.totalAllocated-=n,this.allocatedPerCall.delete(e)}};Oi.MessageBufferTracker=Jb;var Wb="grpc-previous-rpc-attempts",d4=5,Qb=class{constructor(e,t,n,i,s,o,a,c,l){var u;this.channel=e,this.callConfig=t,this.methodName=n,this.host=i,this.credentials=s,this.deadline=o,this.callNumber=a,this.bufferTracker=c,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;let d=(u=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&u!==void 0?u:d4;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state="RETRY";let f=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(f.initialBackoff.substring(0,f.initialBackoff.length-1)),this.maxAttempts=Math.min(f.maxAttempts,d)}else t.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,d)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,a4.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){l4.trace(Ff.LogVerbosity.DEBUG,u4,"["+this.callNumber+"] "+e)}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;(t=this.listener)===null||t===void 0||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 c4.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var t;return(t=this.writeBuffer[e-this.writeBufferOffset])!==null&&t!==void 0?t:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let n=this.getBufferEntry(t);n.allocated&&this.bufferTracker.free(n.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var t,n;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(n=(t=this.callConfig).onCommitted)===null||n===void 0||n.call(t),this.committedCallIndex=e;for(let i=0;i<this.underlyingCalls.length;i++)i!==e&&this.underlyingCalls[i].state!=="COMPLETED"&&(this.underlyingCalls[i].state="COMPLETED",this.underlyingCalls[i].call.cancelWithStatus(Ff.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,t=-1;for(let[n,i]of this.underlyingCalls.entries())i.state==="ACTIVE"&&i.nextMessageToSend>e&&(e=i.nextMessageToSend,t=n);t===-1?this.state="TRANSPARENT_ONLY":this.commitCall(t)}isStatusCodeInList(e,t){return e.some(n=>{var i;return n===t||n.toString().toLowerCase()===((i=Ff.Status[t])===null||i===void 0?void 0:i.toLowerCase())})}getNextRetryBackoffMs(){var e;let t=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!t)return 0;let n=Math.random()*this.nextRetryBackoffSec*1e3,i=Number(t.maxBackoff.substring(0,t.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*t.backoffMultiplier,i),n}maybeRetryCall(e,t){if(this.state!=="RETRY"){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",t(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var i,s;if(this.state!=="RETRY"){t(!1);return}!((s=(i=this.retryThrottler)===null||i===void 0?void 0:i.canRetryCall())!==null&&s!==void 0)||s?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),t(!1))},n)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)t?.state==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,t,n){var i,s,o;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(t),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((i=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&i!==void 0?i:[],e.code)){(s=this.retryThrottler)===null||s===void 0||s.addCallFailed();let a;if(n===null)a=0;else if(n<0){this.state="TRANSPARENT_ONLY",this.commitCall(t),this.reportStatus(e);return}else a=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},a)}else this.commitCall(t),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((o=this.retryThrottler)===null||o===void 0||o.addCallFailed(),this.maybeRetryCall(n,a=>{a||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get("grpc-retry-pushback-ms");if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,t){var n;if(this.underlyingCalls[t].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[t].call.getCallNumber()+"] in state "+this.underlyingCalls[t].state),this.underlyingCalls[t].state="COMPLETED",e.code===Ff.Status.OK){(n=this.retryThrottler)===null||n===void 0||n.addCallSucceeded(),this.commitCall(t),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(t),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,t,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(t),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,t,i);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t,n;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let i=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let s=(e=i.hedgingDelay)!==null&&e!==void 0?e:"0s",o=Number(s.substring(0,s.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},o*1e3),(n=(t=this.hedgingTimer).unref)===null||n===void 0||n.call(t)}startNewAttempt(){let 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);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,i=this.initialMetadata.clone();n>0&&i.set(Wb,`${n}`);let s=!1;e.start(i,{onReceiveMetadata:o=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(t),s=!0,n>0&&o.set(Wb,`${n}`),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMetadata(o)},onReceiveMessage:o=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(t),this.underlyingCalls[t].state==="ACTIVE"&&this.listener.onReceiveMessage(o)},onReceiveStatus:o=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!s&&n>0&&o.metadata.set(Wb,`${n}`),this.handleChildStatus(o,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){var t,n;let i=this.underlyingCalls[e],s=i.nextMessageToSend;(n=(t=this.getBufferEntry(s)).callback)===null||n===void 0||n.call(t),this.clearSentMessages(),i.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state!=="COMPLETED"&&this.getBufferEntry(t.nextMessageToSend)){let n=this.getBufferEntry(t.nextMessageToSend);switch(n.entryType){case"MESSAGE":t.call.sendMessageWithContext({callback:i=>{this.handleChildWriteCompleted(e)}},n.message.message);break;case"HALF_CLOSE":t.nextMessageToSend+=1,t.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,t){var n;this.trace("write() called with message of length "+t.length);let i={message:t,flags:e.flags},s=this.getNextBufferIndex(),o={entryType:"MESSAGE",message:i,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(o),o.allocated){(n=e.callback)===null||n===void 0||n.call(e);for(let[a,c]of this.underlyingCalls.entries())c.state==="ACTIVE"&&c.nextMessageToSend===s&&c.call.sendMessageWithContext({callback:l=>{this.handleChildWriteCompleted(a)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let a=this.underlyingCalls[this.committedCallIndex];o.callback=e.callback,a.state==="ACTIVE"&&a.nextMessageToSend===s&&a.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(this.committedCallIndex)}},t)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let t of this.underlyingCalls)t?.state==="ACTIVE"&&t.nextMessageToSend===e&&(t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}};Oi.RetryingCall=Qb});var Bf=g(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.BaseSubchannelWrapper=void 0;var Yb=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,e.addHealthStateWatcher(t=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let 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()}unref(){this.child.unref()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(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()}};qf.BaseSubchannelWrapper=Yb});var i_=g(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.InternalChannel=Ws.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var f4=Xc(),h4=iC(),p4=DO(),Xb=bi(),m4=Pt(),Ii=ge(),g4=Mb(),y4=BO(),WO=Xr(),Uf=Me(),v4=Eb(),jf=Qt(),Tr=Er(),Ml=Us(),b4=zO(),_4=Rl(),E4=GO(),$b=xb(),A4=Rf(),Zb=VO(),w4=Bf(),S4=2147483647,T4=1e3,C4=30*60*1e3,zf=new Map,x4=1<<24,O4=1<<20,e_=class extends w4.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(n,i,s,o)=>{t.throttleKeepalive(o)}}ref(){this.refCount===0&&(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))}},t_=class{pick(e){return{pickResultType:Xb.PickResultType.DROP,status:{code:Ii.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new m4.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};Ws.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var r_=class{constructor(e){this.target=e,this.trace=new Ml.ChannelzTrace,this.callTracker=new Ml.ChannelzCallTracker,this.childrenTracker=new Ml.ChannelzChildrenTracker,this.state=Tr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},n_=class{constructor(e,t,n){var i,s,o,a,c,l;if(this.credentials=t,this.options=n,this.connectivityState=Tr.ConnectivityState.IDLE,this.currentPicker=new Xb.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),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof f4.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new r_(e);let u=(0,jf.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let d=(0,WO.mapUriDefaultScheme)(u);if(d===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,Ml.registerChannelzChannel)(e,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,WO.getDefaultAuthority)(d);let f=(0,v4.mapProxyName)(d,n);this.target=f.target,this.options=Object.assign({},this.options,f.extraOptions),this.subchannelPool=(0,p4.getSubchannelPool)(((i=this.options["grpc.use_local_subchannel_pool"])!==null&&i!==void 0?i:0)===0),this.retryBufferTracker=new Zb.MessageBufferTracker((s=this.options["grpc.retry_buffer_size"])!==null&&s!==void 0?s:x4,(o=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&o!==void 0?o:O4),this.keepaliveTime=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:-1,this.idleTimeoutMs=Math.max((c=this.options["grpc.client_idle_timeout_ms"])!==null&&c!==void 0?c:C4,T4);let h={createSubchannel:(p,y)=>{let b={};for(let[S,M]of Object.entries(y))S.startsWith(Ws.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(b[S]=M);let E=this.subchannelPool.getOrCreateSubchannel(this.target,p,b,this.credentials);return E.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",E.getChannelzRef()),new e_(E,this)},updateState:(p,y)=>{this.currentPicker=y;let b=this.pickQueue.slice();this.pickQueue=[],b.length>0&&this.callRefTimerUnref();for(let E of b)E.doPick();this.updateState(p)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:p=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(p)},removeChannelzChild:p=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(p)}};this.resolvingLoadBalancer=new h4.ResolvingLoadBalancer(this.target,h,this.options,(p,y)=>{var b;p.retryThrottling?zf.set(this.getTarget(),new Zb.RetryThrottler(p.retryThrottling.maxTokens,p.retryThrottling.tokenRatio,zf.get(this.getTarget()))):zf.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(b=this.configSelector)===null||b===void 0||b.unref(),this.configSelector=y,this.currentResolutionError=null,process.nextTick(()=>{let E=this.configSelectionQueue;this.configSelectionQueue=[],E.length>0&&this.callRefTimerUnref();for(let x of E)x.getConfig()})},p=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+p.code+' and details "'+p.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,A4.restrictControlPlaneStatusCode)(p.code,p.details)),{metadata:p.metadata}));let y=this.configSelectionQueue;this.configSelectionQueue=[],y.length>0&&this.callRefTimerUnref();for(let b of y)b.reportResolverError(p)}),this.filterStackFactory=new g4.FilterStackFactory([new y4.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(n,void 0,2));let m=new Error;(0,Uf.isTracerEnabled)("channel_stacktrace")&&(0,Uf.trace)(Ii.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
|
27
|
+
`+((l=m.stack)===null||l===void 0?void 0:l.substring(m.stack.indexOf(`
|
28
|
+
`)+1))),this.lastActivityTimestamp=new Date}trace(e,t){(0,Uf.trace)(t??Ii.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,jf.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,t,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},S4)),!((t=(e=this.callRefTimer).hasRef)===null||t===void 0)&&t.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(n=this.callRefTimer).ref)===null||i===void 0||i.call(n))}callRefTimerUnref(){var e,t,n;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(t=this.callRefTimer)===null||t===void 0?void 0:t.unref)===null||n===void 0||n.call(t))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(n=>n===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,Uf.trace)(Ii.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,jf.uriToString)(this.target)+" "+Tr.ConnectivityState[this.connectivityState]+" -> "+Tr.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Tr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let n of t)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==Tr.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let 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!==Tr.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(Tr.ConnectivityState.IDLE),this.currentPicker=new Xb.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var t,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let s=new Date().valueOf()-this.lastActivityTimestamp.valueOf();s>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-s)},e),(n=(t=this.idleTimer).unref)===null||n===void 0||n.call(t)}maybeStartIdleTimer(){this.connectivityState!==Tr.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===Ii.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,n,i,s){let o=(0,$b.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+o+'] method="'+t+'"'),new b4.LoadBalancingCall(this,e,t,n,i,s,o)}createRetryingCall(e,t,n,i,s){let o=(0,$b.getNextCallNumber)();return this.trace("createRetryingCall ["+o+'] method="'+t+'"'),new Zb.RetryingCall(this,e,t,n,i,s,o,this.retryBufferTracker,zf.get(this.getTarget()))}createResolvingCall(e,t,n,i,s){let o=(0,$b.getNextCallNumber)();this.trace("createResolvingCall ["+o+'] method="'+e+'", deadline='+(0,_4.deadlineToString)(t));let a={deadline:t,flags:s??Ii.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new E4.ResolvingCall(this,e,a,this.filterStackFactory.clone(),o);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Tr.ConnectivityState.SHUTDOWN),this.currentPicker=new t_;for(let t of this.configSelectionQueue)t.cancelWithStatus(Ii.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let t of this.pickQueue)t.cancelWithStatus(Ii.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Ml.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,jf.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,n){if(this.connectivityState===Tr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(t!==1/0){let o=t instanceof Date?t:new Date(t),a=new Date;if(t===-1/0||o<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(s),n(new Error("Deadline passed without connectivity state change"))},o.getTime()-a.getTime())}let s={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(s)}getChannelzRef(){return this.channelzRef}createCall(e,t,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Tr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,t,n,i,s)}getOptions(){return this.options}};Ws.InternalChannel=n_});var pv=g(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.ChannelImplementation=void 0;var I4=Xc(),P4=i_(),s_=class{constructor(e,t,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(t instanceof I4.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new P4.InternalChannel(e,t,n)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,n){this.internalChannel.watchConnectivityState(e,t,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof t=="number"||t instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,t,n,i,s)}};Hf.ChannelImplementation=s_});var JO=g(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.ServerDuplexStreamImpl=qr.ServerWritableStreamImpl=qr.ServerReadableStreamImpl=qr.ServerUnaryCallImpl=void 0;qr.serverErrorToStatus=f_;var k4=ie("events"),u_=ie("stream"),d_=ge(),KO=Pt();function f_(r,e){var t;let n={code:d_.Status.UNKNOWN,details:"message"in r?r.message:"Unknown Error",metadata:(t=e??r.metadata)!==null&&t!==void 0?t:null};return"code"in r&&typeof r.code=="number"&&Number.isInteger(r.code)&&(n.code=r.code,"details"in r&&typeof r.details=="string"&&(n.details=r.details)),n}var o_=class extends k4.EventEmitter{constructor(e,t,n,i){super(),this.path=e,this.call=t,this.metadata=n,this.request=i,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()}};qr.ServerUnaryCallImpl=o_;var a_=class extends u_.Readable{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,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()}};qr.ServerReadableStreamImpl=a_;var c_=class extends u_.Writable{constructor(e,t,n,i){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.request=i,this.pendingStatus={code:d_.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new KO.Metadata,this.on("error",s=>{this.pendingStatus=f_(s),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()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};qr.ServerWritableStreamImpl=c_;var l_=class extends u_.Duplex{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.pendingStatus={code:d_.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new KO.Metadata,this.on("error",i=>{this.pendingStatus=f_(i),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()}_read(e){this.call.startRead()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){var t;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(t=this.pendingStatus.metadata)!==null&&t!==void 0?t:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};qr.ServerDuplexStreamImpl=l_});var Gf=g(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.ServerCredentials=void 0;la.createCertificateProviderServerCredentials=R4;la.createServerCredentialsWithInterceptors=N4;var h_=Ly(),Ks=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=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(let t of this.watchers)t(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new p_}static createSsl(e,t,n=!1){var i;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(t))throw new TypeError("keyCertPairs must be an array");if(typeof n!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let s=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);s.push(c.cert_chain),o.push(c.private_key)}return new m_({requestCert:n,ciphers:h_.CIPHER_SUITES},{ca:(i=e??(0,h_.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:s,key:o})}};la.ServerCredentials=Ks;var p_=class r extends Ks{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof r}},m_=class r extends Ks{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(e){if(this===e)return!0;if(!(e instanceof r))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++){let n=this.options.cert[t],i=e.options.cert[t];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)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++){let n=this.options.key[t],i=e.options.key[t];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},g_=class r extends Ks{constructor(e,t,n){super({requestCert:t!==null,rejectUnauthorized:n,ciphers:h_.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=t,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;this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)===null||t===void 0||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof r?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function R4(r,e,t){return new g_(r,e,t)}var y_=class r extends Ks{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof r)||!this.childCredentials._equals(e.childCredentials)||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()}};function N4(r,e){return new y_(r,e)}});var T_=g(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.BaseServerInterceptingCall=Cr.ServerInterceptingCall=Cr.ResponderBuilder=Cr.ServerListenerBuilder=void 0;Cr.isInterceptingServerListener=D4;Cr.getServerInterceptingCall=U4;var b_=Pt(),$t=ge(),ua=ie("http2"),QO=vd(),YO=ie("zlib"),M4=wb(),eI=Me(),tI="server_call";function Js(r){eI.trace($t.LogVerbosity.DEBUG,tI,r)}var __=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}}};Cr.ServerListenerBuilder=__;function D4(r){return r.onReceiveMetadata!==void 0&&r.onReceiveMetadata.length===1}var E_=class{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,t=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(t),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,t=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=t,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(t),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()}},A_=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}}};Cr.ResponderBuilder=A_;var Vf={onReceiveMetadata:(r,e)=>{e(r)},onReceiveMessage:(r,e)=>{e(r)},onReceiveHalfClose:r=>{r()},onCancel:()=>{}},Wf={start:r=>{r()},sendMetadata:(r,e)=>{e(r)},sendMessage:(r,e)=>{e(r)},sendStatus:(r,e)=>{e(r)}},w_=class{constructor(e,t){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(n=t?.start)!==null&&n!==void 0?n:Wf.start,sendMetadata:(i=t?.sendMetadata)!==null&&i!==void 0?i:Wf.sendMetadata,sendMessage:(s=t?.sendMessage)!==null&&s!==void 0?s:Wf.sendMessage,sendStatus:(o=t?.sendStatus)!==null&&o!==void 0?o:Wf.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 n,i,s,o;let a={onReceiveMetadata:(n=t?.onReceiveMetadata)!==null&&n!==void 0?n:Vf.onReceiveMetadata,onReceiveMessage:(i=t?.onReceiveMessage)!==null&&i!==void 0?i:Vf.onReceiveMessage,onReceiveHalfClose:(s=t?.onReceiveHalfClose)!==null&&s!==void 0?s:Vf.onReceiveHalfClose,onCancel:(o=t?.onCancel)!==null&&o!==void 0?o:Vf.onCancel},c=new E_(a,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,t=>{this.processingMetadata=!1,this.nextCall.sendMetadata(t),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,t){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new b_.Metadata),this.responder.sendMessage(e,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.pendingMessageCallback=t):this.nextCall.sendMessage(n,t)})}sendStatus(e){this.responder.sendStatus(e,t=>{this.processingMetadata||this.processingMessage?this.pendingStatus=t:this.nextCall.sendStatus(t)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}};Cr.ServerInterceptingCall=w_;var rI="grpc-accept-encoding",S_="grpc-encoding",$O="grpc-message",ZO="grpc-status",v_="grpc-timeout",L4=/(\d{1,8})\s*([HMSmun])/,F4={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},q4={[rI]:"identity,deflate,gzip",[S_]:"identity"},XO={[ua.constants.HTTP2_HEADER_STATUS]:ua.constants.HTTP_STATUS_OK,[ua.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},B4={waitForTrailers:!0},Kf=class{constructor(e,t,n,i,s){var o;this.stream=e,this.callEventTracker=n,this.handler=i,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.stream.once("error",u=>{}),this.stream.once("close",()=>{var u;Js("Request to method "+((u=this.handler)===null||u===void 0?void 0:u.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",u=>{this.handleDataFrame(u)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in s&&(this.maxSendMessageSize=s["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in s&&(this.maxReceiveMessageSize=s["grpc.max_receive_message_length"]),this.host=(o=t[":authority"])!==null&&o!==void 0?o:t.host,this.decoder=new M4.StreamDecoder(this.maxReceiveMessageSize);let a=b_.Metadata.fromHttp2Headers(t);eI.isTracerEnabled(tI)&&Js("Request to "+this.handler.path+" received headers "+JSON.stringify(a.toJSON()));let c=a.get(v_);c.length>0&&this.handleTimeoutHeader(c[0]);let l=a.get(S_);l.length>0&&(this.incomingEncoding=l[0]),a.remove(v_),a.remove(S_),a.remove(rI),a.remove(ua.constants.HTTP2_HEADER_ACCEPT_ENCODING),a.remove(ua.constants.HTTP2_HEADER_TE),a.remove(ua.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=a}handleTimeoutHeader(e){let t=e.toString().match(L4);if(t===null){let s={code:$t.Status.INTERNAL,details:`Invalid ${v_} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(s)});return}let n=+t[1]*F4[t[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let s={code:$t.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(s)},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;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new b_.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),n=t.byteLength,i=Buffer.allocUnsafe(n+5);return i.writeUInt8(0,0),i.writeUInt32BE(n,1),t.copy(i,5),i}decompressMessage(e,t){let n=e.subarray(5);if(t==="identity")return n;if(t==="deflate"||t==="gzip"){let i;return t==="deflate"?i=YO.createInflate():i=YO.createGunzip(),new Promise((s,o)=>{let a=0,c=[];i.on("data",l=>{c.push(l),a+=l.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(i.destroy(),o({code:$t.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{s(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:$t.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let n=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(e.compressedMessage,n)}catch(s){this.sendStatus(s);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(s){this.sendStatus({code:$t.Status.INTERNAL,details:`Error deserializing request: ${s.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;Js("Request to "+this.handler.path+" received data frame of size "+e.length);let n;try{n=this.decoder.write(e)}catch(i){this.sendStatus({code:$t.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let s={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(s),this.decompressAndMaybePush(s),(t=this.callEventTracker)===null||t===void 0||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Js("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},XO),q4),t);this.stream.respond(n,B4)}sendMessage(e,t){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:$t.Status.INTERNAL,details:`Error serializing response: ${(0,QO.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:$t.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Js("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var s;if(i){this.sendStatus({code:$t.Status.INTERNAL,details:`Error writing message: ${(0,QO.getErrorMessage)(i)}`,metadata:null});return}(s=this.callEventTracker)===null||s===void 0||s.addMessageSent(),t()})}sendStatus(e){var t,n;if(!this.checkCancelled())if(Js("Request to method "+((t=this.handler)===null||t===void 0?void 0:t.path)+" ended with status code: "+$t.Status[e.code]+" details: "+e.details),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{var i;this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign({[ZO]:e.code,[$O]:encodeURI(e.details)},(i=e.metadata)===null||i===void 0?void 0:i.toHttp2Headers());this.stream.sendTrailers(s),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let i=Object.assign(Object.assign({[ZO]:e.code,[$O]:encodeURI(e.details)},XO),(n=e.metadata)===null||n===void 0?void 0:n.toHttp2Headers());this.stream.respond(i,{endStream:!0}),this.notifyOnCancel()}}startRead(){Js("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let t=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return t?.remoteAddress?t.remotePort?`${t.remoteAddress}:${t.remotePort}`:t.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}};Cr.BaseServerInterceptingCall=Kf;function U4(r,e,t,n,i,s){let o={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},a=new Kf(e,t,n,i,s);return r.reduce((c,l)=>l(o,c),a)}});var lI=g(ki=>{"use strict";var j4=ki&&ki.__runInitializers||function(r,e,t){for(var n=arguments.length>2,i=0;i<e.length;i++)t=n?e[i].call(r,t):e[i].call(r);return n?t:void 0},z4=ki&&ki.__esDecorate||function(r,e,t,n,i,s){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&r?n.static?r:r.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,h=t.length-1;h>=0;h--){var m={};for(var p in n)m[p]=p==="access"?{}:n[p];for(var p in n.access)m.access[p]=n.access[p];m.addInitializer=function(b){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(b||null))};var y=(0,t[h])(a==="accessor"?{get:u.get,set:u.set}:u[c],m);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(d=o(y.get))&&(u.get=d),(d=o(y.set))&&(u.set=d),(d=o(y.init))&&i.unshift(d)}else(d=o(y))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(ki,"__esModule",{value:!0});ki.Server=void 0;var Zt=ie("http2"),H4=ie("util"),Je=ge(),ha=JO(),C_=Gf(),nI=Xr(),fa=Me(),Pi=Ar(),Br=Qt(),at=Us(),iI=T_(),da=~(1<<31),x_=~(1<<31),G4=2e4,sI=~(1<<31),{HTTP2_HEADER_PATH:oI}=Zt.constants,V4="server",aI=Buffer.from("max_age");function cI(r){fa.trace(Je.LogVerbosity.DEBUG,"server_call",r)}function W4(){}function K4(r){return function(e,t){return H4.deprecate(e,r)}}function O_(r){return{code:Je.Status.UNIMPLEMENTED,details:`The server does not implement the method ${r}`}}function J4(r,e){let t=O_(e);switch(r){case"unary":return(n,i)=>{i(t,null)};case"clientStream":return(n,i)=>{i(t,null)};case"serverStream":return n=>{n.emit("error",t)};case"bidi":return n=>{n.emit("error",t)};default:throw new Error(`Invalid handlerType ${r}`)}}var Q4=(()=>{var r;let e=[],t;return r=class{constructor(i){var s,o,a,c,l,u;this.boundPorts=(j4(this,e),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=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new at.ChannelzTraceStub,this.callTracker=new at.ChannelzCallTrackerStub,this.listenerChildrenTracker=new at.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new at.ChannelzChildrenTrackerStub):(this.channelzTrace=new at.ChannelzTrace,this.callTracker=new at.ChannelzCallTracker,this.listenerChildrenTracker=new at.ChannelzChildrenTracker,this.sessionChildrenTracker=new at.ChannelzChildrenTracker),this.channelzRef=(0,at.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(s=this.options["grpc.max_connection_age_ms"])!==null&&s!==void 0?s:da,this.maxConnectionAgeGraceMs=(o=this.options["grpc.max_connection_age_grace_ms"])!==null&&o!==void 0?o:da,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:x_,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:G4,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:sI,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=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var s,o,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Pi.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Pi.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let m=l,p=m.getCipher(),y=m.getCertificate(),b=m.getPeerCertificate();f={cipherSuiteStandardName:(s=p.standardName)!==null&&s!==void 0?s:null,cipherSuiteOtherName:p.standardName?null:p.name,localCertificate:y&&"raw"in y?y.raw:null,remoteCertificate:b&&"raw"in b?b.raw:null}}else f=null;return{remoteAddress:u,localAddress:d,security:f,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(o=i.state.localWindowSize)!==null&&o!==void 0?o:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){fa.trace(Je.LogVerbosity.DEBUG,V4,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){fa.trace(Je.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,s){if(i===null||typeof i!="object"||s===null||typeof s!="object")throw new Error("addService() requires two objects as arguments");let o=Object.keys(i);if(o.length===0)throw new Error("Cannot add an empty service to a server");o.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=s[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=s[c.originalName]),u!==void 0?d=u.bind(s):d=J4(l,a),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,l)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(o=>{let a=i[o];this.unregister(a.path)})}bind(i,s){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,at.registerChannelzSocket)((0,Pi.subchannelAddressToString)(i),()=>({localAddress:i,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(i){(0,at.unregisterChannelzRef)(i)}createHttp2Server(i){let s;if(i._isSecure()){let o=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),o),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),s=Zt.createSecureServer(c),s.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),s.on("secureConnection",d=>{d.on("error",f=>{this.trace("An incoming TLS connection closed with error: "+f.message)})});let u=d=>{if(d){let f=s;try{f.setSecureContext(d)}catch(h){fa.log(Je.LogVerbosity.ERROR,"Failed to set secure context with error "+h.message),d=null}}l=d!==null,this.trace("Post-update credentials valid: "+l)};i._addWatcher(u),s.on("close",()=>{i._removeWatcher(u)})}else s=Zt.createServer(this.commonServerOptions);return s.setTimeout(0,W4),this._setupHandlers(s,i._getInterceptors()),s}bindOneAddress(i,s){this.trace("Attempting to bind "+(0,Pi.subchannelAddressToString)(i));let o=this.createHttp2Server(s.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Pi.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};o.once("error",l),o.listen(i,()=>{let u=o.address(),d;typeof u=="string"?d={path:u}:d={host:u.address,port:u.port};let f=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(o,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),s.listeningServers.add(o),this.trace("Successfully bound "+(0,Pi.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),o.removeListener("error",l)})})}async bindManyPorts(i,s){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Pi.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let o=await this.bindOneAddress(i[0],s);if(o.error){let a=await this.bindManyPorts(i.slice(1),s);return Object.assign(Object.assign({},a),{errors:[o.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Pi.isTcpSubchannelAddress)(u)?{host:u.host,port:o.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,s))),l=[o,...c];return{count:l.filter(u=>u.error===void 0).length,port:o.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let o=await Promise.all(i.map(a=>this.bindOneAddress(a,s)));return{count:o.filter(a=>a.error===void 0).length,port:o[0].port,errors:o.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,s){let o=await this.bindManyPorts(i,s);if(o.count>0)return o.count<i.length&&fa.log(Je.LogVerbosity.INFO,`WARNING Only ${o.count} addresses added out of total ${i.length} resolved`),o.port;{let a=`No address added out of total ${i.length} resolved`;throw fa.log(Je.LogVerbosity.ERROR,a),new Error(`${a} errors: [${o.errors.join(",")}]`)}}resolvePort(i){return new Promise((s,o)=>{let a={onSuccessfulResolution:(l,u,d)=>{a.onSuccessfulResolution=()=>{};let f=[].concat(...l.map(h=>h.addresses));if(f.length===0){o(new Error(`No addresses resolved for port ${i}`));return}s(f)},onError:l=>{o(new Error(l.details))}};(0,nI.createResolver)(i,a,this.options).updateResolution()})}async bindPort(i,s){let o=await this.resolvePort(i);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(o,s);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let s=(0,Br.parseUri)(i);if(s===null)throw new Error(`Could not parse port "${i}"`);let o=(0,nI.mapUriDefaultScheme)(s);if(o===null)throw new Error(`Could not get a default scheme for port "${i}"`);return o}bindAsync(i,s,o){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(s===null||!(s instanceof C_.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof o!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,h)=>{process.nextTick(()=>o(f,h))},l=this.boundPorts.get((0,Br.uriToString)(a));if(l){if(!s._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>o(null,f),f=>o(f,0)):c(null,l.portNumber);return}l={mapKey:(0,Br.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:s,listeningServers:new Set};let u=(0,Br.splitHostPort)(a.path),d=this.bindPort(a,l);l.completionPromise=d,u?.port===0?d.then(f=>{let h={scheme:a.scheme,authority:a.authority,path:(0,Br.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,Br.uriToString)(h),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),o(null,f)},f=>{o(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,o(null,f)},f=>{o(f,0)}))}registerInjectorToChannelz(){return(0,at.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(i,s,o=!1){if(i===null||!(i instanceof C_.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(s);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:s,sessions:c,ownsChannelzRef:o}),{injectConnection:l=>{a.emit("connection",l)},drain:l=>{var u,d;for(let f of c)this.closeSession(f);(d=(u=setTimeout(()=>{for(let f of c)f.destroy(Zt.constants.NGHTTP2_CANCEL)},l)).unref)===null||d===void 0||d.call(u)},destroy:()=>{this.closeServer(a);for(let l of c)this.closeSession(l)}}}createConnectionInjector(i){if(i===null||!(i instanceof C_.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let s=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,s,!0)}closeServer(i,s){this.trace("Closing server with address "+JSON.stringify(i.address()));let o=this.http2Servers.get(i);i.close(()=>{o&&o.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(o.channelzRef),(0,at.unregisterChannelzRef)(o.channelzRef)),this.http2Servers.delete(i),s?.()})}closeSession(i,s){var o;this.trace("Closing session initiated by "+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,at.unregisterChannelzRef)(a.ref)),s?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let s of i.listeningServers){let o=this.http2Servers.get(s);if(this.closeServer(s,()=>{i.listeningServers.delete(s)}),o)for(let a of o.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let s=this.normalizePort(i),o=(0,Br.splitHostPort)(s.path);if(o?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,Br.uriToString)(s));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,Br.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,s){var o,a;this.trace("drain port="+i+" graceTimeMs="+s);let c=this.normalizePort(i),l=(0,Br.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Br.uriToString)(c));if(!u)return;let d=new Set;for(let f of u.listeningServers){let h=this.http2Servers.get(f);if(h)for(let m of h.sessions)d.add(m),this.closeSession(m,()=>{d.delete(m)})}(a=(o=setTimeout(()=>{for(let f of d)f.destroy(Zt.constants.NGHTTP2_CANCEL)},s)).unref)===null||a===void 0||a.call(o)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,s)=>{this.closeSession(s),s.destroy(Zt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,at.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,s,o,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:s,serialize:o,deserialize:a,type:c,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var s;let o=l=>{(0,at.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&o()}this.shutdown=!0;for(let[l,u]of this.http2Servers.entries()){a++;let d=u.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),c()});for(let f of u.sessions.keys()){a++;let h=(s=f.socket)===null||s===void 0?void 0:s.remoteAddress;this.trace("Waiting for session "+h+" to close"),this.closeSession(f,()=>{this.trace("Session "+h+" finished closing"),c()})}}a===0&&o()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,s){let o=s[Zt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof o!="string"||!o.startsWith("application/grpc")?(i.respond({[Zt.constants.HTTP2_HEADER_STATUS]:Zt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){cI("Received call to method "+i+" at address "+this.serverAddressString);let s=this.handlers.get(i);return s===void 0?(cI("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):s}_respondWithError(i,s,o=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:Je.Status.INTERNAL,"grpc-message":i.details,[Zt.constants.HTTP2_HEADER_STATUS]:Zt.constants.HTTP_STATUS_OK,[Zt.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());s.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),o?.streamTracker.addCallFailed()}_channelzHandler(i,s,o){this.onStreamOpened(s);let a=this.sessions.get(s.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(s,o)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=o[oI],l=this._retrieveHandler(c);if(!l){this._respondWithError(O_(c),s,a);return}let u={addMessageSent:()=>{a&&(a.messagesSent+=1,a.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{a&&(a.messagesReceived+=1,a.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===Je.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,iI.getServerInterceptingCall)([...i,...this.interceptors],s,o,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:Je.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,s,o){if(this.onStreamOpened(s),this._verifyContentType(s,o)!==!0)return;let a=o[oI],c=this._retrieveHandler(a);if(!c){this._respondWithError(O_(a),s,null);return}let l=(0,iI.getServerInterceptingCall)([...i,...this.interceptors],s,o,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:Je.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,s){let{type:o}=s;if(o==="unary")Y4(i,s);else if(o==="clientStream")$4(i,s);else if(o==="serverStream")Z4(i,s);else if(o==="bidi")X4(i,s);else return!1;return!0}_setupHandlers(i,s){if(i===null)return;let o=i.address(),a="null";o&&(typeof o=="string"?a=o:a=o.address+":"+o.port),this.serverAddressString=a;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",c.bind(this,s)),i.on("session",l)}_sessionHandler(i){return s=>{var o,a;(o=this.http2Servers.get(i))===null||o===void 0||o.sessions.add(s);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==da){let b=this.maxConnectionAgeMs/10,E=Math.random()*b*2-b;c=setTimeout(()=>{var x,S;d=!0,this.trace("Connection dropped by max connection age: "+((x=s.socket)===null||x===void 0?void 0:x.remoteAddress));try{s.goaway(Zt.constants.NGHTTP2_NO_ERROR,~(1<<31),aI)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==da&&(l=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(S=l.unref)===null||S===void 0||S.call(l))},this.maxConnectionAgeMs+E),(a=c.unref)===null||a===void 0||a.call(c)}let h=()=>{u&&(clearTimeout(u),u=null)},m=()=>!s.destroyed&&this.keepaliveTimeMs<x_&&this.keepaliveTimeMs>0,p,y=()=>{var b;m()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{h(),p()},this.keepaliveTimeMs),(b=u.unref)===null||b===void 0||b.call(u))};p=()=>{var b;if(!m())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let E="";try{s.ping((S,M,I)=>{h(),S?(this.keepaliveTrace("Ping failed with error: "+S.message),d=!0,s.close()):(this.keepaliveTrace("Received ping response"),y())})||(E="Ping returned false")}catch(x){E=(x instanceof Error?x.message:"")||"Unknown error"}if(E){this.keepaliveTrace("Ping send failed: "+E),this.trace("Connection dropped due to ping send error: "+E),d=!0,s.close();return}u=setTimeout(()=>{h(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,s.close()},this.keepaliveTimeoutMs),(b=u.unref)===null||b===void 0||b.call(u)},y(),s.on("close",()=>{var b,E;d||this.trace(`Connection dropped by client ${(b=s.socket)===null||b===void 0?void 0:b.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),h(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(s)),(E=this.http2Servers.get(i))===null||E===void 0||E.sessions.delete(s)})}}_channelzSessionHandler(i){return s=>{var o,a,c,l;let u=(0,at.registerChannelzSocket)((a=(o=s.socket)===null||o===void 0?void 0:o.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,s),this.channelzEnabled),d={ref:u,streamTracker:new at.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(s),this.sessions.set(s,d);let f=`${s.socket.remoteAddress}:${s.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(u);let h=null,m=null,p=null,y=!1,b=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==da){let I=this.maxConnectionAgeMs/10,B=Math.random()*I*2-I;h=setTimeout(()=>{var z;y=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{s.goaway(Zt.constants.NGHTTP2_NO_ERROR,~(1<<31),aI)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==da&&(m=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(z=m.unref)===null||z===void 0||z.call(m))},this.maxConnectionAgeMs+B),(l=h.unref)===null||l===void 0||l.call(h)}let E=()=>{p&&(clearTimeout(p),p=null)},x=()=>!s.destroyed&&this.keepaliveTimeMs<x_&&this.keepaliveTimeMs>0,S,M=()=>{var I;x()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),p=setTimeout(()=>{E(),S()},this.keepaliveTimeMs),(I=p.unref)===null||I===void 0||I.call(p))};S=()=>{var I;if(!x())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let B="";try{s.ping((L,q,C)=>{E(),L?(this.keepaliveTrace("Ping failed with error: "+L.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+L.message+" return in "+q),y=!0,s.close()):(this.keepaliveTrace("Received ping response"),M())})||(B="Ping returned false")}catch(z){B=(z instanceof Error?z.message:"")||"Unknown error"}if(B){this.keepaliveTrace("Ping send failed: "+B),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+B),y=!0,s.close();return}d.keepAlivesSent+=1,p=setTimeout(()=>{E(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),y=!0,s.close()},this.keepaliveTimeoutMs),(I=p.unref)===null||I===void 0||I.call(p)},M(),s.on("close",()=>{var I;y||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,at.unregisterChannelzRef)(u),h&&clearTimeout(h),m&&clearTimeout(m),E(),b!==null&&(clearTimeout(b.timeout),this.sessionIdleTimeouts.delete(s)),(I=this.http2Servers.get(i))===null||I===void 0||I.sessions.delete(s),this.sessions.delete(s)})}}enableIdleTimeout(i){var s,o;if(this.sessionIdleTimeout>=sI)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(o=(s=a.timeout).unref)===null||o===void 0||o.call(s),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,s){let{socket:o}=s,a=i.sessionIdleTimeouts.get(s);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+o?.remoteAddress+":"+o?.remotePort+" last idle at "+a.lastIdle),i.closeSession(s)):a.timeout.refresh())}onStreamOpened(i){let s=i.session,o=this.sessionIdleTimeouts.get(s);o&&(o.activeStreams+=1,i.once("close",o.onClose))}onStreamClose(i){var s,o;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress)+":"+((o=i.socket)===null||o===void 0?void 0:o.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[K4("Calling start() is no longer necessary. It can be safely omitted.")],z4(r,null,t,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:n},null,e),n&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),r})();ki.Server=Q4;async function Y4(r,e){let t;function n(o,a,c,l){if(o){r.sendStatus((0,ha.serverErrorToStatus)(o,c));return}r.sendMessage(a,()=>{r.sendStatus({code:Je.Status.OK,details:"OK",metadata:c??null})})}let i,s=null;r.start({onReceiveMetadata(o){i=o,r.startRead()},onReceiveMessage(o){if(s){r.sendStatus({code:Je.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=o,r.startRead()},onReceiveHalfClose(){if(!s){r.sendStatus({code:Je.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new ha.ServerWritableStreamImpl(e.path,r,i,s);try{e.func(t,n)}catch(o){r.sendStatus({code:Je.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"))}})}function $4(r,e){let t;function n(i,s,o,a){if(i){r.sendStatus((0,ha.serverErrorToStatus)(i,o));return}r.sendMessage(s,()=>{r.sendStatus({code:Je.Status.OK,details:"OK",metadata:o??null})})}r.start({onReceiveMetadata(i){t=new ha.ServerDuplexStreamImpl(e.path,r,i);try{e.func(t,n)}catch(s){r.sendStatus({code:Je.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(i){t.push(i)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function Z4(r,e){let t,n,i=null;r.start({onReceiveMetadata(s){n=s,r.startRead()},onReceiveMessage(s){if(i){r.sendStatus({code:Je.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=s,r.startRead()},onReceiveHalfClose(){if(!i){r.sendStatus({code:Je.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}t=new ha.ServerWritableStreamImpl(e.path,r,n,i);try{e.func(t)}catch(s){r.sendStatus({code:Je.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}function X4(r,e){let t;r.start({onReceiveMetadata(n){t=new ha.ServerDuplexStreamImpl(e.path,r,n);try{e.func(t)}catch(i){r.sendStatus({code:Je.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(n){t.push(n)},onReceiveHalfClose(){t.push(null)},onCancel(){t&&(t.cancelled=!0,t.emit("cancelled","cancelled"),t.destroy())}})}});var uI=g(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.StatusBuilder=void 0;var I_=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(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};Jf.StatusBuilder=I_});var P_=g(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.msToDuration=e5;pa.durationToMs=t5;pa.isDuration=r5;pa.parseDuration=i5;function e5(r){return{seconds:r/1e3|0,nanos:r%1e3*1e6|0}}function t5(r){return r.seconds*1e3+r.nanos/1e6|0}function r5(r){return typeof r.seconds=="number"&&typeof r.nanos=="number"}var n5=/^(\d+)(?:\.(\d+))?s$/;function i5(r){let e=r.match(n5);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}});var Qf=g(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.LeafLoadBalancer=pn.PickFirstLoadBalancer=pn.PickFirstLoadBalancingConfig=void 0;pn.shuffled=pI;pn.setup=d5;var k_=Rs(),et=Er(),Qs=bi(),dI=Ar(),s5=Me(),o5=ge(),fI=Ar(),hI=ie("net"),a5="pick_first";function Dl(r){s5.trace(o5.LogVerbosity.DEBUG,a5,r)}var Ll="pick_first",c5=250,ma=class r{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return Ll}toJsonObject(){return{[Ll]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new r(e.shuffleAddressList===!0)}};pn.PickFirstLoadBalancingConfig=ma;var R_=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Qs.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function pI(r){let e=r.slice();for(let t=e.length-1;t>1;t--){let n=Math.floor(Math.random()*(t+1)),i=e[t];e[t]=e[n],e[n]=i}return e}function l5(r){if(r.length===0)return[];let e=[],t=[],n=[],i=(0,fI.isTcpSubchannelAddress)(r[0])&&(0,hI.isIPv6)(r[0].host);for(let a of r)(0,fI.isTcpSubchannelAddress)(a)&&(0,hI.isIPv6)(a.host)?t.push(a):n.push(a);let s=i?t:n,o=i?n:t;for(let a=0;a<Math.max(s.length,o.length);a++)a<s.length&&e.push(s[a]),a<o.length&&e.push(o[a]);return e}var mI="grpc-node.internal.pick-first.report_health_status",Fl=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=et.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(t,n,i,s,o)=>{this.onSubchannelStateUpdate(t,n,i,o)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},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()){let t=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(et.ConnectivityState.TRANSIENT_FAILURE,new Qs.UnavailablePicker({details:t}),t)}else this.updateState(et.ConnectivityState.READY,new R_(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let t=`No connection established. Last error: ${this.lastError}`;this.updateState(et.ConnectivityState.TRANSIENT_FAILURE,new Qs.UnavailablePicker({details:t}),t)}else if(this.children.length===0)this.updateState(et.ConnectivityState.IDLE,new Qs.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let t=`No connection established. Last error: ${this.lastError}`;this.updateState(et.ConnectivityState.TRANSIENT_FAILURE,new Qs.UnavailablePicker({details:t}),t)}else this.updateState(et.ConnectivityState.CONNECTING,new Qs.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,n,i){var s;if(!((s=this.currentPick)===null||s===void 0)&&s.realSubchannelEquals(e)){n!==et.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[o,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===et.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===et.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),o===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(o+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,n]of this.children.entries())if(t>=e){let i=n.subchannel.getConnectivityState();if(i===et.ConnectivityState.IDLE||i===et.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===et.ConnectivityState.IDLE&&(Dl("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[e])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},c5),(n=(t=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(t)}pickSubchannel(e){Dl("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,t,n){Dl(et.ConnectivityState[this.currentState]+" -> "+et.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}resetSubchannelList(){for(let 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,t){Dl("connectToAddressList(["+e.map(i=>(0,dI.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,t),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===et.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===et.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,n){if(!(t instanceof ma))return;this.reportHealthStatus=n[mI],t.getShuffleAddressList()&&(e=pI(e));let i=[].concat(...e.map(o=>o.addresses));Dl("updateAddressList(["+i.map(o=>(0,dI.subchannelAddressToString)(o))+"])"),i.length===0&&(this.lastError="No addresses resolved");let s=l5(i);this.latestAddressList=s,this.latestOptions=n,this.connectToAddressList(s,n)}exitIdle(){this.currentState===et.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return Ll}};pn.PickFirstLoadBalancer=Fl;var u5=new ma(!1),N_=class{constructor(e,t,n){this.endpoint=e,this.options=n,this.latestState=et.ConnectivityState.IDLE;let i=(0,k_.createChildChannelControlHelper)(t,{updateState:(s,o,a)=>{this.latestState=s,this.latestPicker=o,t.updateState(s,o,a)}});this.pickFirstBalancer=new Fl(i),this.latestPicker=new Qs.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList([this.endpoint],u5,Object.assign(Object.assign({},this.options),{[mI]:!0}))}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==et.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};pn.LeafLoadBalancer=N_;function d5(){(0,k_.registerLoadBalancerType)(Ll,Fl,ma),(0,k_.registerDefaultLoadBalancerType)(Ll)}});var gI=g($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.FileWatcherCertificateProvider=void 0;var f5=ie("fs"),h5=Me(),p5=ge(),m5=ie("util"),g5="certificate_provider";function Yf(r){h5.trace(p5.LogVerbosity.DEBUG,g5,r)}var M_=(0,m5.promisify)(f5.readFile),D_=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,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");Yf("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?M_(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?M_(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?M_(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,n])=>{if(this.refreshTimer){Yf("File watcher read certificates certificate "+e.status+", privateKey "+t.status+", CA certificate "+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&t.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,n.status==="fulfilled"?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),Yf("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),Yf("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};$f.FileWatcherCertificateProvider=D_});var F_=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=$.createCertificateProviderChannelCredentials=$.FileWatcherCertificateProvider=$.createCertificateProviderServerCredentials=$.createServerCredentialsWithInterceptors=$.BaseSubchannelWrapper=$.registerAdminService=$.FilterStackFactory=$.BaseFilter=$.PickResultType=$.QueuePicker=$.UnavailablePicker=$.ChildLoadBalancerHandler=$.EndpointMap=$.endpointHasAddress=$.endpointToString=$.subchannelAddressToString=$.LeafLoadBalancer=$.isLoadBalancerNameRegistered=$.parseLoadBalancingConfig=$.selectLbConfigFromList=$.registerLoadBalancerType=$.createChildChannelControlHelper=$.BackoffTimeout=$.parseDuration=$.durationToMs=$.splitHostPort=$.uriToString=$.createResolver=$.registerResolver=$.log=$.trace=void 0;var yI=Me();Object.defineProperty($,"trace",{enumerable:!0,get:function(){return yI.trace}});Object.defineProperty($,"log",{enumerable:!0,get:function(){return yI.log}});var vI=Xr();Object.defineProperty($,"registerResolver",{enumerable:!0,get:function(){return vI.registerResolver}});Object.defineProperty($,"createResolver",{enumerable:!0,get:function(){return vI.createResolver}});var bI=Qt();Object.defineProperty($,"uriToString",{enumerable:!0,get:function(){return bI.uriToString}});Object.defineProperty($,"splitHostPort",{enumerable:!0,get:function(){return bI.splitHostPort}});var _I=P_();Object.defineProperty($,"durationToMs",{enumerable:!0,get:function(){return _I.durationToMs}});Object.defineProperty($,"parseDuration",{enumerable:!0,get:function(){return _I.parseDuration}});var y5=rl();Object.defineProperty($,"BackoffTimeout",{enumerable:!0,get:function(){return y5.BackoffTimeout}});var ql=Rs();Object.defineProperty($,"createChildChannelControlHelper",{enumerable:!0,get:function(){return ql.createChildChannelControlHelper}});Object.defineProperty($,"registerLoadBalancerType",{enumerable:!0,get:function(){return ql.registerLoadBalancerType}});Object.defineProperty($,"selectLbConfigFromList",{enumerable:!0,get:function(){return ql.selectLbConfigFromList}});Object.defineProperty($,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return ql.parseLoadBalancingConfig}});Object.defineProperty($,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return ql.isLoadBalancerNameRegistered}});var v5=Qf();Object.defineProperty($,"LeafLoadBalancer",{enumerable:!0,get:function(){return v5.LeafLoadBalancer}});var Zf=Ar();Object.defineProperty($,"subchannelAddressToString",{enumerable:!0,get:function(){return Zf.subchannelAddressToString}});Object.defineProperty($,"endpointToString",{enumerable:!0,get:function(){return Zf.endpointToString}});Object.defineProperty($,"endpointHasAddress",{enumerable:!0,get:function(){return Zf.endpointHasAddress}});Object.defineProperty($,"EndpointMap",{enumerable:!0,get:function(){return Zf.EndpointMap}});var b5=Nd();Object.defineProperty($,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return b5.ChildLoadBalancerHandler}});var L_=bi();Object.defineProperty($,"UnavailablePicker",{enumerable:!0,get:function(){return L_.UnavailablePicker}});Object.defineProperty($,"QueuePicker",{enumerable:!0,get:function(){return L_.QueuePicker}});Object.defineProperty($,"PickResultType",{enumerable:!0,get:function(){return L_.PickResultType}});var _5=Fb();Object.defineProperty($,"BaseFilter",{enumerable:!0,get:function(){return _5.BaseFilter}});var E5=Mb();Object.defineProperty($,"FilterStackFactory",{enumerable:!0,get:function(){return E5.FilterStackFactory}});var A5=Fd();Object.defineProperty($,"registerAdminService",{enumerable:!0,get:function(){return A5.registerAdminService}});var w5=Bf();Object.defineProperty($,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return w5.BaseSubchannelWrapper}});var EI=Gf();Object.defineProperty($,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return EI.createServerCredentialsWithInterceptors}});Object.defineProperty($,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return EI.createCertificateProviderServerCredentials}});var S5=gI();Object.defineProperty($,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return S5.FileWatcherCertificateProvider}});var T5=Xc();Object.defineProperty($,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return T5.createCertificateProviderChannelCredentials}});var C5=i_();Object.defineProperty($,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return C5.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var AI=g(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.setup=O5;var x5=Xr(),q_=class{constructor(e,t,n){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let i;e.authority===""?i="/"+e.path:i=e.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener.onSuccessfulResolution,this.endpoints,null,null,null,{}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function O5(){(0,x5.registerResolver)("unix",q_)}});var xI=g(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.setup=R5;var wI=ie("net"),Xf=ge(),U_=Pt(),SI=Xr(),TI=Qt(),I5=Me(),P5="ip_resolver";function CI(r){I5.trace(Xf.LogVerbosity.DEBUG,P5,r)}var j_="ipv4",z_="ipv6",k5=443,eh=class{constructor(e,t,n){var i;this.listener=t,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,CI("Resolver constructed for target "+(0,TI.uriToString)(e));let s=[];if(!(e.scheme===j_||e.scheme===z_)){this.error={code:Xf.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new U_.Metadata};return}let o=e.path.split(",");for(let a of o){let c=(0,TI.splitHostPort)(a);if(c===null){this.error={code:Xf.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new U_.Metadata};return}if(e.scheme===j_&&!(0,wI.isIPv4)(c.host)||e.scheme===z_&&!(0,wI.isIPv6)(c.host)){this.error={code:Xf.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new U_.Metadata};return}s.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:k5})}this.endpoints=s.map(a=>({addresses:[a]})),CI("Parsed "+e.scheme+" address list "+s)}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener.onError(this.error):this.listener.onSuccessfulResolution(this.endpoints,null,null,null,{})}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function R5(){(0,SI.registerResolver)(j_,eh),(0,SI.registerResolver)(z_,eh)}});var kI=g(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.RoundRobinLoadBalancer=void 0;Bl.setup=F5;var PI=Rs(),zt=Er(),G_=bi(),N5=Me(),M5=ge(),OI=Ar(),D5=Qf(),L5="round_robin";function II(r){N5.trace(M5.LogVerbosity.DEBUG,L5,r)}var th="round_robin",V_=class r{getLoadBalancerName(){return th}constructor(){}toJsonObject(){return{[th]:{}}}static createFromJson(e){return new r}},W_=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let 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}},rh=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=zt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,PI.createChildChannelControlHelper)(e,{updateState:(t,n,i)=>{this.currentState===zt.ConnectivityState.READY&&t!==zt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),i&&(this.lastError=i),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(zt.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===zt.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(i=>(0,OI.endpointEqual)(i.getEndpoint(),n)),t<0&&(t=0)}this.updateState(zt.ConnectivityState.READY,new W_(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),t),null)}else if(this.countChildrenWithState(zt.ConnectivityState.CONNECTING)>0)this.updateState(zt.ConnectivityState.CONNECTING,new G_.QueuePicker(this),null);else if(this.countChildrenWithState(zt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(zt.ConnectivityState.TRANSIENT_FAILURE,new G_.UnavailablePicker({details:e}),e)}else this.updateState(zt.ConnectivityState.IDLE,new G_.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===zt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,n){II(zt.ConnectivityState[this.currentState]+" -> "+zt.ConnectivityState[e]),e===zt.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,n)}resetSubchannelList(){for(let e of this.children)e.destroy()}updateAddressList(e,t,n){this.resetSubchannelList(),II("Connect to endpoint list "+e.map(OI.endpointToString)),this.updatesPaused=!0,this.children=e.map(i=>new D5.LeafLoadBalancer(i,this.childChannelControlHelper,n));for(let i of this.children)i.startConnecting();this.updatesPaused=!1,this.calculateAndUpdateState()}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return th}};Bl.RoundRobinLoadBalancer=rh;function F5(){(0,PI.registerLoadBalancerType)(th,rh,V_)}});var MI=g($s=>{"use strict";var K_;Object.defineProperty($s,"__esModule",{value:!0});$s.OutlierDetectionLoadBalancer=$s.OutlierDetectionLoadBalancingConfig=void 0;$s.setup=J5;var q5=Er(),RI=ge(),Ys=P_(),NI=F_(),B5=Rs(),U5=Nd(),j5=bi(),J_=Ar(),z5=Bf(),H5=Me(),G5="outlier_detection";function mt(r){H5.trace(RI.LogVerbosity.DEBUG,G5,r)}var eE="outlier_detection",V5=((K_=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&K_!==void 0?K_:"true")==="true",W5={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},K5={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function ga(r,e,t,n){if(e in r&&r[e]!==void 0&&typeof r[e]!==t){let i=n?`${n}.${e}`:e;throw new Error(`outlier detection config ${i} parse error: expected ${t}, got ${typeof r[e]}`)}}function Q_(r,e,t){let n=t?`${t}.${e}`:e;if(e in r&&r[e]!==void 0){if(!(0,Ys.isDuration)(r[e]))throw new Error(`outlier detection config ${n} parse error: expected Duration, got ${typeof r[e]}`);if(!(r[e].seconds>=0&&r[e].seconds<=315576e6&&r[e].nanos>=0&&r[e].nanos<=999999999))throw new Error(`outlier detection config ${n} parse error: values out of range for non-negative Duaration`)}}function nh(r,e,t){let n=t?`${t}.${e}`:e;if(ga(r,e,"number",t),e in r&&r[e]!==void 0&&!(r[e]>=0&&r[e]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}var Ul=class r{constructor(e,t,n,i,s,o,a){if(this.childPolicy=a,a.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=s?Object.assign(Object.assign({},W5),s):null,this.failurePercentageEjection=o?Object.assign(Object.assign({},K5),o):null}getLoadBalancerName(){return eE}toJsonObject(){var e,t;return{outlier_detection:{interval:(0,Ys.msToDuration)(this.intervalMs),base_ejection_time:(0,Ys.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Ys.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(t=this.failurePercentageEjection)!==null&&t!==void 0?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(Q_(e,"interval"),Q_(e,"base_ejection_time"),Q_(e,"max_ejection_time"),nh(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");ga(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),nh(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),ga(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),ga(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");nh(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),nh(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),ga(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),ga(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");let n=(0,B5.selectLbConfigFromList)(e.child_policy);if(!n)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new r(e.interval?(0,Ys.durationToMs)(e.interval):null,e.base_ejection_time?(0,Ys.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Ys.durationToMs)(e.max_ejection_time):null,(t=e.max_ejection_percent)!==null&&t!==void 0?t:null,e.success_rate_ejection,e.failure_percentage_ejection,n)}};$s.OutlierDetectionLoadBalancingConfig=Ul;var $_=class extends z5.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){let 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}};function Y_(){return{success:0,failure:0}}var Z_=class{constructor(){this.activeBucket=Y_(),this.inactiveBucket=Y_()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=Y_()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},X_=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===j5.PickResultType.COMPLETE){let n=t.subchannel,i=n.getMapEntry();if(i){let s=t.onCallEnded;return this.countCalls&&(s=o=>{var a;o===RI.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(a=t.onCallEnded)===null||a===void 0||a.call(t,o)}),Object.assign(Object.assign({},t),{subchannel:n.getWrappedSubchannel(),onCallEnded:s})}else return Object.assign(Object.assign({},t),{subchannel:n.getWrappedSubchannel()})}else return t}},ih=class{constructor(e){this.entryMap=new J_.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new U5.ChildLoadBalancerHandler((0,NI.createChildChannelControlHelper)(e,{createSubchannel:(t,n)=>{let i=e.createSubchannel(t,n),s=this.entryMap.getForSubchannelAddress(t),o=new $_(i,s);return s?.currentEjectionTimestamp!==null&&o.eject(),s?.subchannelWrappers.push(o),o},updateState:(t,n,i)=>{t===q5.ConnectivityState.READY?e.updateState(t,new X_(n,this.isCountingEnabled()),i):e.updateState(t,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;mt("Running success rate check");let n=t.request_volume,i=0,s=[];for(let[d,f]of this.entryMap.entries()){let h=f.counter.getLastSuccesses(),m=f.counter.getLastFailures();mt("Stats for "+(0,J_.endpointToString)(d)+": successes="+h+" failures="+m+" targetRequestVolume="+n),h+m>=n&&(i+=1,s.push(h/(h+m)))}if(mt("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+s+"]"),i<t.minimum_hosts)return;let o=s.reduce((d,f)=>d+f)/s.length,a=0;for(let d of s){let f=d-o;a+=f*f}let c=a/s.length,l=Math.sqrt(c),u=o-l*(t.stdev_factor/1e3);mt("stdev="+l+" ejectionThreshold="+u);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let h=f.counter.getLastSuccesses(),m=f.counter.getLastFailures();if(h+m<n)continue;let p=h/(h+m);if(mt("Checking candidate "+d+" successRate="+p),p<u){let y=Math.random()*100;mt("Candidate "+d+" randomNumber="+y+" enforcement_percentage="+t.enforcement_percentage),y<t.enforcement_percentage&&(mt("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;mt("Running failure percentage check. threshold="+t.threshold+" request volume threshold="+t.request_volume);let n=0;for(let i of this.entryMap.values()){let s=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();s+o>=t.request_volume&&(n+=1)}if(!(n<t.minimum_hosts))for(let[i,s]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let o=s.counter.getLastSuccesses(),a=s.counter.getLastFailures();if(mt("Candidate successes="+o+" failures="+a),o+a<t.request_volume)continue;if(a*100/(a+o)>t.threshold){let l=Math.random()*100;mt("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+t.enforcement_percentage),l<t.enforcement_percentage&&(mt("Ejecting candidate "+i),this.eject(s,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let n of e.subchannelWrappers)n.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(t=this.ejectionTimer).unref)===null||n===void 0||n.call(t)}runChecks(){let e=new Date;if(mt("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[t,n]of this.entryMap.entries())if(n.currentEjectionTimestamp===null)n.ejectionTimeMultiplier>0&&(n.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),s=this.latestConfig.getMaxEjectionTimeMs(),o=new Date(n.currentEjectionTimestamp.getTime());o.setMilliseconds(o.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,s))),o<new Date&&(mt("Unejecting "+t),this.uneject(n))}}}updateAddressList(e,t,n){if(!(t instanceof Ul))return;mt("Received update with config: "+JSON.stringify(t.toJsonObject(),void 0,2));for(let s of e)this.entryMap.has(s)||(mt("Adding map entry for "+(0,J_.endpointToString)(s)),this.entryMap.set(s,{counter:new Z_,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e);let i=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,i,n),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){mt("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let s=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(s)}else mt("Starting new timer"),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{mt("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let s of this.entryMap.values())this.uneject(s),s.ejectionTimeMultiplier=0}this.latestConfig=t}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return eE}};$s.OutlierDetectionLoadBalancer=ih;function J5(){V5&&(0,NI.registerLoadBalancerType)(eE,ih,Ul)}});var Ri=g(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.experimental=V.ServerInterceptingCall=V.ResponderBuilder=V.ServerListenerBuilder=V.addAdminServicesToServer=V.getChannelzHandlers=V.getChannelzServiceDefinition=V.InterceptorConfigurationError=V.InterceptingCall=V.RequesterBuilder=V.ListenerBuilder=V.StatusBuilder=V.getClientChannel=V.ServerCredentials=V.Server=V.setLogVerbosity=V.setLogger=V.load=V.loadObject=V.CallCredentials=V.ChannelCredentials=V.waitForClientReady=V.closeClient=V.Channel=V.makeGenericClientConstructor=V.makeClientConstructor=V.loadPackageDefinition=V.Client=V.compressionAlgorithms=V.propagate=V.connectivityState=V.status=V.logVerbosity=V.Metadata=V.credentials=void 0;var sh=Ad();Object.defineProperty(V,"CallCredentials",{enumerable:!0,get:function(){return sh.CallCredentials}});var Q5=pv();Object.defineProperty(V,"Channel",{enumerable:!0,get:function(){return Q5.ChannelImplementation}});var Y5=Db();Object.defineProperty(V,"compressionAlgorithms",{enumerable:!0,get:function(){return Y5.CompressionAlgorithms}});var $5=Er();Object.defineProperty(V,"connectivityState",{enumerable:!0,get:function(){return $5.ConnectivityState}});var oh=Xc();Object.defineProperty(V,"ChannelCredentials",{enumerable:!0,get:function(){return oh.ChannelCredentials}});var DI=hv();Object.defineProperty(V,"Client",{enumerable:!0,get:function(){return DI.Client}});var tE=ge();Object.defineProperty(V,"logVerbosity",{enumerable:!0,get:function(){return tE.LogVerbosity}});Object.defineProperty(V,"status",{enumerable:!0,get:function(){return tE.Status}});Object.defineProperty(V,"propagate",{enumerable:!0,get:function(){return tE.Propagate}});var LI=Me(),rE=gv();Object.defineProperty(V,"loadPackageDefinition",{enumerable:!0,get:function(){return rE.loadPackageDefinition}});Object.defineProperty(V,"makeClientConstructor",{enumerable:!0,get:function(){return rE.makeClientConstructor}});Object.defineProperty(V,"makeGenericClientConstructor",{enumerable:!0,get:function(){return rE.makeClientConstructor}});var Z5=Pt();Object.defineProperty(V,"Metadata",{enumerable:!0,get:function(){return Z5.Metadata}});var X5=lI();Object.defineProperty(V,"Server",{enumerable:!0,get:function(){return X5.Server}});var ez=Gf();Object.defineProperty(V,"ServerCredentials",{enumerable:!0,get:function(){return ez.ServerCredentials}});var tz=uI();Object.defineProperty(V,"StatusBuilder",{enumerable:!0,get:function(){return tz.StatusBuilder}});V.credentials={combineChannelCredentials:(r,...e)=>e.reduce((t,n)=>t.compose(n),r),combineCallCredentials:(r,...e)=>e.reduce((t,n)=>t.compose(n),r),createInsecure:oh.ChannelCredentials.createInsecure,createSsl:oh.ChannelCredentials.createSsl,createFromSecureContext:oh.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:sh.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:sh.CallCredentials.createFromGoogleCredential,createEmpty:sh.CallCredentials.createEmpty};var rz=r=>r.close();V.closeClient=rz;var nz=(r,e,t)=>r.waitForReady(e,t);V.waitForClientReady=nz;var iz=(r,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};V.loadObject=iz;var sz=(r,e,t)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};V.load=sz;var oz=r=>{LI.setLogger(r)};V.setLogger=oz;var az=r=>{LI.setLoggerVerbosity(r)};V.setLogVerbosity=az;var cz=r=>DI.Client.prototype.getChannel.call(r);V.getClientChannel=cz;var ah=uv();Object.defineProperty(V,"ListenerBuilder",{enumerable:!0,get:function(){return ah.ListenerBuilder}});Object.defineProperty(V,"RequesterBuilder",{enumerable:!0,get:function(){return ah.RequesterBuilder}});Object.defineProperty(V,"InterceptingCall",{enumerable:!0,get:function(){return ah.InterceptingCall}});Object.defineProperty(V,"InterceptorConfigurationError",{enumerable:!0,get:function(){return ah.InterceptorConfigurationError}});var FI=Us();Object.defineProperty(V,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return FI.getChannelzServiceDefinition}});Object.defineProperty(V,"getChannelzHandlers",{enumerable:!0,get:function(){return FI.getChannelzHandlers}});var lz=Fd();Object.defineProperty(V,"addAdminServicesToServer",{enumerable:!0,get:function(){return lz.addAdminServicesToServer}});var nE=T_();Object.defineProperty(V,"ServerListenerBuilder",{enumerable:!0,get:function(){return nE.ServerListenerBuilder}});Object.defineProperty(V,"ResponderBuilder",{enumerable:!0,get:function(){return nE.ResponderBuilder}});Object.defineProperty(V,"ServerInterceptingCall",{enumerable:!0,get:function(){return nE.ServerInterceptingCall}});var uz=F_();V.experimental=uz;var dz=_b(),fz=AI(),hz=xI(),pz=Qf(),mz=kI(),gz=MI(),yz=Us();dz.setup(),fz.setup(),hz.setup(),pz.setup(),mz.setup(),gz.setup(),yz.setup()});var qI=g(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.fromGrpcJsServiceDefinition=vz;ch.isGrpcJsServiceDefinition=bz;function vz(r){let e={};for(let[t,n]of Object.entries(r))e[t]={path:n.path,requestStream:n.requestStream,responseStream:n.responseStream,requestDeserialize:i=>n.requestDeserialize(Buffer.from(i)),requestSerialize:n.requestSerialize,responseDeserialize:i=>n.responseDeserialize(Buffer.from(i)),responseSerialize:n.responseSerialize,options:{}};return e}function bz(r){return Object.values(r).every(e=>typeof e=="object"&&e!=null&&typeof e.path=="string")}});var BI=g(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.fromTsProtoServiceDefinition=_z;lh.isTsProtoServiceDefinition=Ez;function _z(r){let e={};for(let[t,n]of Object.entries(r.methods)){let i=n.requestType.encode,s=n.requestType.fromPartial,o=n.responseType.encode,a=n.responseType.fromPartial;e[t]={path:`/${r.fullName}/${n.name}`,requestStream:n.requestStream,responseStream:n.responseStream,requestDeserialize:n.requestType.decode,requestSerialize:s!=null?c=>i(s(c)).finish():c=>i(c).finish(),responseDeserialize:n.responseType.decode,responseSerialize:a!=null?c=>o(a(c)).finish():c=>o(c).finish(),options:n.options}}return e}function Ez(r){return"name"in r&&"fullName"in r&&"methods"in r}});var Zs=g(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.normalizeServiceDefinition=Az;jl.toGrpcJsServiceDefinition=wz;jl.toGrpcJsMethodDefinition=zI;var UI=qI(),jI=BI();function Az(r){return(0,UI.isGrpcJsServiceDefinition)(r)?(0,UI.fromGrpcJsServiceDefinition)(r):(0,jI.isTsProtoServiceDefinition)(r)?(0,jI.fromTsProtoServiceDefinition)(r):r}function wz(r){let e={};for(let[t,n]of Object.entries(r))e[t]=zI(n);return e}function zI(r){return{path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,requestDeserialize:r.requestDeserialize,requestSerialize:e=>Buffer.from(r.requestSerialize(e)),responseDeserialize:r.responseDeserialize,responseSerialize:e=>Buffer.from(r.responseSerialize(e))}}});function ur(r){return typeof r=="object"&&r!==null&&r.name==="AbortError"}function Sz(r){if(r.aborted)throw new Ht}function iE(r){if(ur(r))throw r}function Xs(r){if(!ur(r))throw r}var Ht,Hn=Lt(()=>{"use strict";Ht=class extends Error{constructor(){super("The operation has been aborted"),this.message="The operation has been aborted",this.name="AbortError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,this.constructor)}}});function Ur(r,e){return new Promise((t,n)=>{if(r.aborted){n(new Ht);return}let i,s=!1;function o(){s||(s=!0,i?.())}let a=e(c=>{t(c),o()},c=>{n(c),o()});if(!s){let c=()=>{let l=a();l==null?n(new Ht):l.then(()=>{n(new Ht)},u=>{n(u)}),o()};r.addEventListener("abort",c),i=()=>{r.removeEventListener("abort",c)}}})}var eo=Lt(()=>{"use strict";Hn()});function Tz(r,e){if(r.aborted){let t=()=>{};e.then(t,t)}return Ur(r,(t,n)=>(e.then(t,n),()=>{}))}var HI=Lt(()=>{"use strict";eo()});function zl(r,e){return Ur(r,t=>{let n=typeof e=="number"?e:e.getTime()-Date.now(),i=setTimeout(t,n);return()=>{clearTimeout(i)}})}var uh=Lt(()=>{"use strict";eo()});function Cz(r){return Ur(r,()=>()=>{})}var GI=Lt(()=>{"use strict";eo()});function xz(r,e,t,n){return Ur(r,i=>{let s,o=!1;return s=Oz(e,t,(...c)=>{i(c.length>1?c:c[0]),o=!0,s?.()},n),o&&s(),()=>{o=!0,s?.()}})}function Oz(r,e,t,n){if(kz(r))return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n);if(Pz(r))return r.on(e,t),()=>r.off(e,t);if(Iz(r))return r.addListener(e,t),()=>r.removeListener(e,t);throw new Error("Invalid event target")}function Iz(r){return ya(r.addListener)&&ya(r.removeListener)}function Pz(r){return ya(r.on)&&ya(r.off)}function kz(r){return ya(r.addEventListener)&&ya(r.removeEventListener)}var ya,VI=Lt(()=>{"use strict";eo();ya=r=>typeof r=="function"});function Rz(r,e){return new Promise((t,n)=>{if(r.aborted){n(new Ht);return}let i=new AbortController,s=e(i.signal);if(s.length===0){t([]);return}let o=()=>{i.abort()};r.addEventListener("abort",o);let a,c=new Array(s.length),l=0;function u(){l+=1,l===s.length&&(r.removeEventListener("abort",o),a!=null?n(a.reason):t(c))}for(let[d,f]of s.entries())f.then(h=>{c[d]=h,u()},h=>{i.abort(),(a==null||!ur(h)&&ur(a.reason))&&(a={reason:h}),u()})})}var WI=Lt(()=>{"use strict";Hn()});function Nz(r,e){return new Promise((t,n)=>{if(r.aborted){n(new Ht);return}let i=new AbortController,s=e(i.signal),o=()=>{i.abort()};r.addEventListener("abort",o);let a=0;function c(u){i.abort(),a+=1,a===s.length&&(r.removeEventListener("abort",o),u.status==="fulfilled"?t(u.value):n(u.reason))}let l;for(let u of s)u.then(d=>{l==null&&(l={status:"fulfilled",value:d}),c(l)},d=>{(l==null||!ur(d)&&(l.status==="fulfilled"||ur(l.reason)))&&(l={status:"rejected",reason:d}),c(l)})})}var KI=Lt(()=>{"use strict";Hn()});async function Mz(r,e,t={}){let{baseMs:n=1e3,maxDelayMs:i=3e4,onError:s,maxAttempts:o=1/0}=t,a=0,c=()=>{a=-1};for(;;)try{return await e(r,a,c)}catch(l){if(iE(l),a>=o)throw l;let u;if(a===-1)u=0;else{let d=Math.min(i,Math.pow(2,a)*n);u=Math.round(d*(1+Math.random())/2)}s&&s(l,a,u),u!==0&&await zl(r,u),a+=1}}var JI=Lt(()=>{"use strict";uh();Hn()});function Dz(r,e){if(r.aborted)return Promise.reject(new Ht);let t=[],n=new AbortController,i=n.signal,s=()=>{n.abort()};r.addEventListener("abort",s);let o=()=>{r.removeEventListener("abort",s)},a=new Set,c=()=>{for(let d of a)d.abort()};i.addEventListener("abort",c);let l=()=>{i.removeEventListener("abort",c)},u=new Promise((d,f)=>{let h,m;p(y=>e(y,{defer(b){t.push(b)},fork:p})).join().then(y=>{n.abort(),h={value:y}},y=>{n.abort(),(!ur(y)||m==null)&&(m={error:y})});function p(y){if(i.aborted)return{abort(){},async join(){throw new Ht}};let b=new AbortController,E=b.signal,x=y(E),S={abort(){b.abort()},join:()=>x};return a.add(S),x.catch(Xs).catch(M=>{m={error:M},n.abort()}).finally(()=>{a.delete(S),a.size===0&&(m!=null?f(m.error):d(h.value))}),S}});return u=u.finally(()=>{o(),l();let d=Promise.resolve();for(let f=t.length-1;f>=0;f--)d=d.finally(t[f]);return d}),u}var QI=Lt(()=>{"use strict";Hn()});function Lz(r){let e=new AbortController,t=r(e.signal).catch(Xs);return()=>(e.abort(),t)}var YI=Lt(()=>{"use strict";Hn()});function Fz(r,e,t={}){let{baseMs:n=1e3,onError:i,maxAttempts:s=1/0}=t;return Ur(r,(o,a)=>{let c=new AbortController,l=!1,u=new Map;function d(m){c.abort(),u.clear(),o(m)}function f(m,p){if(u.delete(p),l&&u.size===0){a(m);return}if(!ur(m)&&i)try{i(m,p)}catch(y){c.abort(),u.clear(),a(y)}}async function h(m){for(let p=0;;p++){let y=e(m,p);if(u.set(p,y),y.then(d,x=>f(x,p)),p+1>=s)break;let b=Math.pow(2,p)*n,E=Math.round(b*(1+Math.random())/2);await zl(m,E)}l=!0}return h(c.signal).catch(Xs),()=>{c.abort()}})}var $I=Lt(()=>{"use strict";Hn();uh();eo()});var Ni={};$u(Ni,{AbortError:()=>Ht,abortable:()=>Tz,all:()=>Rz,catchAbortError:()=>Xs,delay:()=>zl,execute:()=>Ur,forever:()=>Cz,isAbortError:()=>ur,proactiveRetry:()=>Fz,race:()=>Nz,rethrowAbortError:()=>iE,retry:()=>Mz,run:()=>Lz,spawn:()=>Dz,throwIfAborted:()=>Sz,waitForEvent:()=>xz});var Mi=Lt(()=>{"use strict";HI();Hn();uh();eo();GI();VI();WI();KI();JI();QI();YI();$I()});var gn=g(mn=>{"use strict";var qz=mn&&mn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Bz=mn&&mn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Uz=mn&&mn.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&qz(t,e,n[i]);return Bz(t,e),t}}();Object.defineProperty(mn,"__esModule",{value:!0});mn.convertMetadataToGrpcJs=Hz;mn.convertMetadataFromGrpcJs=Gz;var jz=Uz(Ri()),zz=jt();function Hz(r){let e=new jz.Metadata;for(let[t,n]of r)for(let i of n)e.add(t,typeof i=="string"?i:Buffer.from(i));return e}function Gz(r){let e=(0,zz.Metadata)();for(let t of Object.keys(r.getMap())){let n=r.get(t);e.set(t,n)}return e}});var Gn=g(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});sE.isAsyncIterable=Vz;function Vz(r){return r!=null&&Symbol.asyncIterator in r}});var Hl=g(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.readableToAsyncIterable=Kz;var ZI=!1;function Wz(r){if(ZI)return!0;let e=r&&typeof r=="object"&&"errored"in r&&"errorEmitted"in r&&"endEmitted"in r&&"closeEmitted"in r&&typeof r.errorEmitted=="boolean"&&typeof r.endEmitted=="boolean"&&typeof r.closeEmitted=="boolean";return ZI=e,e}async function*Kz(r){let e=XI;function t(c){this===r?(e(),e=XI):e=c}let n=r._readableState;if(!Wz(n))throw new Error("nice-grpc: _readableState members incompatible");let i=n.errored,s=n.errorEmitted,o=n.endEmitted,a=n.closeEmitted;for(r.on("readable",t).on("error",function(c){i=c,s=!0,t.call(this)}).on("end",function(){o=!0,t.call(this)}).on("close",function(){a=!0,t.call(this)});;){let c=r.destroyed?null:r.read();if(c!==null)yield c;else{if(s)throw i;if(o)break;if(a)break;await new Promise(t)}}}var XI=()=>{}});var Gl=g(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});aE.createCallContext=Jz;var eP=jt(),tP=gn();function Jz(r){let e=new AbortController,t={signal:e.signal,cancel(){e.abort()}},n=(0,eP.Metadata)(),i=(0,eP.Metadata)();r.cancelled?(t.cancel?.(),t.cancel=void 0):(r.on("close",()=>{t.cancel=void 0}),r.on("finish",()=>{t.cancel=void 0}),r.on("cancelled",()=>{t.cancel?.(),t.cancel=void 0}));let s=!1;return{context:{metadata:(0,tP.convertMetadataFromGrpcJs)(r.metadata),peer:r.getPeer(),header:n,sendHeader(){s||(Qz(n)||r.sendMetadata((0,tP.convertMetadataToGrpcJs)(n)),s=!0)},trailer:i,signal:t.signal},maybeCancel:t}}function Qz(r){for(let e of r)return!1;return!0}});var Vl=g(cE=>{"use strict";Object.defineProperty(cE,"__esModule",{value:!0});cE.createErrorStatusObject=Zz;var rP=Ri(),Yz=(Mi(),$r(Ni)),$z=jt();function Zz(r,e,t){return e instanceof $z.ServerError?{code:e.code,details:e.details,metadata:t}:(0,Yz.isAbortError)(e)?{code:rP.status.CANCELLED,details:"The operation was cancelled",metadata:t}:(process.emitWarning(`${r}: Uncaught error in server implementation method. Server methods should only throw ServerError or AbortError. ${e instanceof Error?e.stack:e}`),{code:rP.status.UNKNOWN,details:"Unknown server error occurred",metadata:t})}});var sP=g(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.createBidiStreamingMethodHandler=nH;var nP=(Mi(),$r(Ni)),iP=gn(),Xz=Gn(),eH=Hl(),tH=Gl(),rH=Vl();function nH(r,e,t){let n={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*i(o,a){if(!(0,Xz.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");yield*e(o,a)}let s=t==null?i:(o,a)=>t({method:n,requestStream:!0,request:o,responseStream:!0,next:i},a);return o=>{let{context:a,maybeCancel:c}=(0,tH.createCallContext)(o);Promise.resolve().then(async()=>{let u=s((0,eH.readableToAsyncIterable)(o),a)[Symbol.asyncIterator]();try{let d=await u.next();for(;;){if(!d.done){try{a.sendHeader(),o.write(d.value)||await(0,nP.waitForEvent)(a.signal,o,"drain")}catch(f){d=(0,nP.isAbortError)(f)?await u.return():await u.throw(f);continue}d=await u.next();continue}if(d.value!=null){d=await u.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method"));continue}break}}finally{c.cancel=void 0,a.sendHeader()}}).then(()=>{o.end((0,iP.convertMetadataToGrpcJs)(a.trailer))},l=>{o.emit("error",(0,rH.createErrorStatusObject)(r.path,l,(0,iP.convertMetadataToGrpcJs)(a.trailer)))})}}});var aP=g(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});uE.createClientStreamingMethodHandler=cH;var oP=gn(),iH=Gn(),sH=Hl(),oH=Gl(),aH=Vl();function cH(r,e,t){let n={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*i(o,a){if(!(0,iH.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");return await e(o,a)}let s=t==null?i:(o,a)=>t({method:n,requestStream:!0,request:o,responseStream:!1,next:i},a);return(o,a)=>{let{context:c,maybeCancel:l}=(0,oH.createCallContext)(o);Promise.resolve().then(async()=>{let d=s((0,sH.readableToAsyncIterable)(o),c)[Symbol.asyncIterator]();try{let f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return f.value}}finally{l.cancel=void 0,c.sendHeader()}}).then(u=>{a(null,u,(0,oP.convertMetadataToGrpcJs)(c.trailer))},u=>{a((0,aH.createErrorStatusObject)(r.path,u,(0,oP.convertMetadataToGrpcJs)(c.trailer)))})}}});var uP=g(dE=>{"use strict";Object.defineProperty(dE,"__esModule",{value:!0});dE.createServerStreamingMethodHandler=fH;var cP=(Mi(),$r(Ni)),lP=gn(),lH=Gn(),uH=Gl(),dH=Vl();function fH(r,e,t){let n={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*i(o,a){if((0,lH.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");yield*e(o,a)}let s=t==null?i:(o,a)=>t({method:n,requestStream:!1,request:o,responseStream:!0,next:i},a);return o=>{let{context:a,maybeCancel:c}=(0,uH.createCallContext)(o);Promise.resolve().then(async()=>{let u=s(o.request,a)[Symbol.asyncIterator]();try{let d=await u.next();for(;;){if(!d.done){try{a.sendHeader(),o.write(d.value)||await(0,cP.waitForEvent)(a.signal,o,"drain")}catch(f){d=(0,cP.isAbortError)(f)?await u.return():await u.throw(f);continue}d=await u.next();continue}if(d.value!=null){d=await u.throw(new Error("A middleware returned a message, but expected to return void for server streaming method"));continue}break}}finally{c.cancel=void 0,a.sendHeader()}}).then(()=>{o.end((0,lP.convertMetadataToGrpcJs)(a.trailer))},l=>{o.emit("error",(0,dH.createErrorStatusObject)(r.path,l,(0,lP.convertMetadataToGrpcJs)(a.trailer)))})}}});var fP=g(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.createUnaryMethodHandler=gH;var dP=gn(),hH=Gn(),pH=Gl(),mH=Vl();function gH(r,e,t){let n={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*i(o,a){if((0,hH.isAsyncIterable)(o))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");return await e(o,a)}let s=t==null?i:(o,a)=>t({method:n,requestStream:!1,request:o,responseStream:!1,next:i},a);return(o,a)=>{let{context:c,maybeCancel:l}=(0,pH.createCallContext)(o);Promise.resolve().then(async()=>{let d=s(o.request,c)[Symbol.asyncIterator]();try{let f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return f.value}}finally{l.cancel=void 0,c.sendHeader()}}).then(u=>{a(null,u,(0,dP.convertMetadataToGrpcJs)(c.trailer))},u=>{a((0,mH.createErrorStatusObject)(r.path,u,(0,dP.convertMetadataToGrpcJs)(c.trailer)))})}}});var yP=g(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.createServer=EH;var hP=Ri(),pP=jt(),mP=Zs(),yH=sP(),vH=aP(),bH=uP(),_H=fP();function EH(r={}){return gP(r)}function gP(r,e){let t=[],n;function i(s){return{with(o){return i(s==null?o:(0,pP.composeServerMiddleware)(s,o))},add(o,a){if(n!=null)throw new Error("server.add() must be used before listen()");t.push({definition:(0,mP.normalizeServiceDefinition)(o),middleware:s,implementation:a})}}}return{use(s){if(n!=null)throw new Error("server.use() must be used before listen()");if(t.length>0)throw new Error("server.use() must be used before adding any services");return gP(r,e==null?s:(0,pP.composeServerMiddleware)(e,s))},...i(e),async listen(s,o){if(n!=null)throw new Error("server.listen() has already been called");n=new hP.Server(r);for(let{definition:c,middleware:l,implementation:u}of t){let d={};for(let[f,h]of Object.entries(c)){let m=u[f].bind(u);h.requestStream?h.responseStream?d[f]=(0,yH.createBidiStreamingMethodHandler)(h,m,l):d[f]=(0,vH.createClientStreamingMethodHandler)(h,m,l):h.responseStream?d[f]=(0,bH.createServerStreamingMethodHandler)(h,m,l):d[f]=(0,_H.createUnaryMethodHandler)(h,m,l)}n.addService((0,mP.toGrpcJsServiceDefinition)(c),d)}return await new Promise((c,l)=>{n.bindAsync(s,o??hP.ServerCredentials.createInsecure(),(u,d)=>{u!=null?(n=void 0,l(u)):c(d)})})},async shutdown(){n!=null&&(await new Promise((s,o)=>{n.tryShutdown(a=>{a!=null?o(a):s()})}),n=void 0)},forceShutdown(){n!=null&&(n.forceShutdown(),n=void 0)}}}});var bP=g(vP=>{"use strict";Object.defineProperty(vP,"__esModule",{value:!0})});var _P=g(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.createChannel=wH;fh.waitForChannelReady=SH;var dh=Ri(),AH=new Set(["http","https"]);function wH(r,e,t={}){let n=/^(?:([^:]+):\/\/)?(.*?)(?::(\d+))?$/.exec(r);if(n==null)throw new Error(`Invalid address: '${r}'`);let[,i,s,o]=n,a=!i||AH.has(i),c=e?._isSecure()||i?.includes("https");e??(e=c?dh.ChannelCredentials.createSsl():dh.ChannelCredentials.createInsecure()),o??(o=c?"443":"80");let l=a?`${s}:${o}`:r;return new dh.Channel(l,e,t)}async function SH(r,e){for(;;){let t=r.getConnectivityState(!0);if(t===dh.connectivityState.READY)return;await new Promise((n,i)=>{r.watchConnectivityState(t,e,s=>{s!=null?i(s):n()})})}}});var Wl=g(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.wrapClientError=xH;var TH=jt(),CH=Ri();function xH(r,e){return OH(r)?new TH.ClientError(e,r.code,r.details):r}function OH(r){return typeof r=="object"&&r!==null&&typeof r.code=="number"&&typeof r.details=="string"&&r.metadata instanceof CH.Metadata}});var EP=g(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE.createBidiStreamingMethod=MH;var hh=(Mi(),$r(Ni)),IH=jt(),PH=Zs(),mE=gn(),kH=Gn(),RH=Hl(),NH=Wl();function MH(r,e,t,n){let i=(0,PH.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,l){if(!(0,kH.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");let{metadata:u=(0,IH.Metadata)(),onHeader:d,onTrailer:f}=l,h=l.signal??new AbortController().signal,m=new AbortController,p=e.makeBidiStreamRequest(i.path,i.requestSerialize,i.responseDeserialize,(0,mE.convertMetadataToGrpcJs)(u));p.on("metadata",E=>{d?.((0,mE.convertMetadataFromGrpcJs)(E))}),p.on("status",E=>{f?.((0,mE.convertMetadataFromGrpcJs)(E.metadata))});let y;DH(m.signal,c,p).then(()=>{p.end()},E=>{(0,hh.isAbortError)(E)||(y=E,p.cancel())});let b=()=>{m.abort(),p.cancel()};h.addEventListener("abort",b);try{yield*(0,RH.readableToAsyncIterable)(p)}catch(E){throw(0,NH.wrapClientError)(E,r.path)}finally{if(m.abort(),h.removeEventListener("abort",b),(0,hh.throwIfAborted)(h),p.cancel(),y)throw y}}let a=t==null?o:(c,l)=>t({method:s,requestStream:!0,request:c,responseStream:!0,next:o},l);return(c,l)=>{let d=a(c,{...n,...l})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let f=await d.next();return f.done&&f.value!=null?await d.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method")):f},return(){return d.return()},throw(f){return d.throw(f)}}}}}}async function DH(r,e,t){for await(let n of e)(0,hh.throwIfAborted)(r),t.write(n)||await(0,hh.waitForEvent)(r,t,"drain")}});var AP=g(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});vE.createClientStreamingMethod=UH;var ph=(Mi(),$r(Ni)),LH=jt(),FH=Zs(),yE=gn(),qH=Gn(),BH=Wl();function UH(r,e,t,n){let i=(0,FH.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,l){if(!(0,qH.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");let{metadata:u=(0,LH.Metadata)(),signal:d=new AbortController().signal,onHeader:f,onTrailer:h}=l;return await(0,ph.execute)(d,(m,p)=>{let y=new AbortController,b=e.makeClientStreamRequest(i.path,i.requestSerialize,i.responseDeserialize,(0,yE.convertMetadataToGrpcJs)(u),(E,x)=>{y.abort(),E!=null?p((0,BH.wrapClientError)(E,r.path)):m(x)});return b.on("metadata",E=>{f?.((0,yE.convertMetadataFromGrpcJs)(E))}),b.on("status",E=>{h?.((0,yE.convertMetadataFromGrpcJs)(E.metadata))}),jH(y.signal,c,b).then(()=>{b.end()},E=>{(0,ph.isAbortError)(E)||(p(E),b.cancel())}),()=>{y.abort(),b.cancel()}})}let a=t==null?o:(c,l)=>t({method:s,requestStream:!0,request:c,responseStream:!1,next:o},l);return async(c,l)=>{let d=a(c,{...n,...l})[Symbol.asyncIterator](),f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return f.value}}}async function jH(r,e,t){for await(let n of e)(0,ph.throwIfAborted)(r),t.write(n)||await(0,ph.waitForEvent)(r,t,"drain")}});var wP=g(_E=>{"use strict";Object.defineProperty(_E,"__esModule",{value:!0});_E.createServerStreamingMethod=JH;var zH=(Mi(),$r(Ni)),HH=jt(),GH=Zs(),bE=gn(),VH=Gn(),WH=Hl(),KH=Wl();function JH(r,e,t,n){let i=(0,GH.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,l){if((0,VH.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");let{metadata:u=(0,HH.Metadata)(),onHeader:d,onTrailer:f}=l,h=l.signal??new AbortController().signal,m=e.makeServerStreamRequest(i.path,i.requestSerialize,i.responseDeserialize,c,(0,bE.convertMetadataToGrpcJs)(u));m.on("metadata",y=>{d?.((0,bE.convertMetadataFromGrpcJs)(y))}),m.on("status",y=>{f?.((0,bE.convertMetadataFromGrpcJs)(y.metadata))});let p=()=>{m.cancel()};h.addEventListener("abort",p);try{yield*(0,WH.readableToAsyncIterable)(m)}catch(y){throw(0,KH.wrapClientError)(y,r.path)}finally{h.removeEventListener("abort",p),(0,zH.throwIfAborted)(h),m.cancel()}}let a=t==null?o:(c,l)=>t({method:s,requestStream:!1,request:c,responseStream:!0,next:o},l);return(c,l)=>{let d=a(c,{...n,...l})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){let f=await d.next();return f.done&&f.value!=null?await d.throw(new Error("A middleware returned a message, but expected to return void for server streaming method")):f},return(){return d.return()},throw(f){return d.throw(f)}}}}}}});var SP=g(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.createUnaryMethod=eG;var QH=(Mi(),$r(Ni)),YH=jt(),$H=Zs(),EE=gn(),ZH=Gn(),XH=Wl();function eG(r,e,t,n){let i=(0,$H.toGrpcJsMethodDefinition)(r),s={path:r.path,requestStream:r.requestStream,responseStream:r.responseStream,options:r.options};async function*o(c,l){if((0,ZH.isAsyncIterable)(c))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");let{metadata:u=(0,YH.Metadata)(),signal:d=new AbortController().signal,onHeader:f,onTrailer:h}=l;return await(0,QH.execute)(d,(m,p)=>{let y=e.makeUnaryRequest(i.path,i.requestSerialize,i.responseDeserialize,c,(0,EE.convertMetadataToGrpcJs)(u),(b,E)=>{b!=null?p((0,XH.wrapClientError)(b,r.path)):m(E)});return y.on("metadata",b=>{f?.((0,EE.convertMetadataFromGrpcJs)(b))}),y.on("status",b=>{h?.((0,EE.convertMetadataFromGrpcJs)(b.metadata))}),()=>{y.cancel()}})}let a=t==null?o:(c,l)=>t({method:s,requestStream:!1,request:c,responseStream:!1,next:o},l);return async(c,l)=>{let d=a(c,{...n,...l})[Symbol.asyncIterator](),f=await d.next();for(;;){if(!f.done){f=await d.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(f.value==null){f=await d.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return f.value}}}});var xP=g(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.createClientFactory=TP;mh.createClient=cG;var tG=Ri(),rG=jt(),nG=Zs(),iG=EP(),sG=AP(),oG=wP(),aG=SP();function TP(){return CP()}function cG(r,e,t){return TP().create(r,e,t)}function CP(r){return{use(e){return CP(r==null?e:(0,rG.composeClientMiddleware)(r,e))},create(e,t,n={}){let i=(0,tG.makeClientConstructor)({},""),s=new i("",null,{channelOverride:t}),o={},a=Object.entries((0,nG.normalizeServiceDefinition)(e));for(let[c,l]of a){let u={...n["*"],...n[c]};l.requestStream?l.responseStream?o[c]=(0,iG.createBidiStreamingMethod)(l,s,r,u):o[c]=(0,sG.createClientStreamingMethod)(l,s,r,u):l.responseStream?o[c]=(0,oG.createServerStreamingMethod)(l,s,r,u):o[c]=(0,aG.createUnaryMethod)(l,s,r,u)}return o}}}});var IP=g(OP=>{"use strict";Object.defineProperty(OP,"__esModule",{value:!0})});var RP=g(ct=>{"use strict";var lG=ct&&ct.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Kl=ct&&ct.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&lG(e,r,t)};Object.defineProperty(ct,"__esModule",{value:!0});ct.ChannelCredentials=ct.Channel=ct.waitForChannelReady=ct.createChannel=void 0;Kl(jt(),ct);Kl(yP(),ct);Kl(bP(),ct);var PP=_P();Object.defineProperty(ct,"createChannel",{enumerable:!0,get:function(){return PP.createChannel}});Object.defineProperty(ct,"waitForChannelReady",{enumerable:!0,get:function(){return PP.waitForChannelReady}});var kP=Ri();Object.defineProperty(ct,"Channel",{enumerable:!0,get:function(){return kP.Channel}});Object.defineProperty(ct,"ChannelCredentials",{enumerable:!0,get:function(){return kP.ChannelCredentials}});Kl(xP(),ct);Kl(IP(),ct)});var Jl=g(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.messageTypeRegistry=void 0;gh.messageTypeRegistry=new Map});var DP=g(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.Duration=Vn.protobufPackage=void 0;var va=Zu(),uG=Jl(),NP=rb();Vn.protobufPackage="google.protobuf";function MP(){return{$type:"google.protobuf.Duration",seconds:0,nanos:0}}Vn.Duration={$type:"google.protobuf.Duration",encode(r,e=va.Writer.create()){return r.seconds!==0&&e.uint32(8).int64(r.seconds),r.nanos!==0&&e.uint32(16).int32(r.nanos),e},decode(r,e){let t=r instanceof va.Reader?r:va.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=MP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==8)break;i.seconds=dG(t.int64());continue;case 2:if(s!==16)break;i.nanos=t.int32();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return Vn.Duration.fromPartial(r??{})},fromPartial(r){var e,t;let n=MP();return n.seconds=(e=r.seconds)!==null&&e!==void 0?e:0,n.nanos=(t=r.nanos)!==null&&t!==void 0?t:0,n}};uG.messageTypeRegistry.set(Vn.Duration.$type,Vn.Duration);function dG(r){if(r.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return r.toNumber()}va.util.Long!==NP&&(va.util.Long=NP,va.configure())});var SE=g(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.LocalizedMessage=U.Help_Link=U.Help=U.ResourceInfo=U.RequestInfo=U.BadRequest_FieldViolation=U.BadRequest=U.PreconditionFailure_Violation=U.PreconditionFailure=U.ErrorInfo_MetadataEntry=U.ErrorInfo=U.QuotaFailure_Violation=U.QuotaFailure=U.DebugInfo=U.RetryInfo=U.protobufPackage=void 0;var ae=Zu(),Gt=Jl(),wE=DP();U.protobufPackage="google.rpc";function LP(){return{$type:"google.rpc.RetryInfo",retryDelay:void 0}}U.RetryInfo={$type:"google.rpc.RetryInfo",encode(r,e=ae.Writer.create()){return r.retryDelay!==void 0&&wE.Duration.encode(r.retryDelay,e.uint32(10).fork()).ldelim(),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=LP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.retryDelay=wE.Duration.decode(t,t.uint32());continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.RetryInfo.fromPartial(r??{})},fromPartial(r){let e=LP();return e.retryDelay=r.retryDelay!==void 0&&r.retryDelay!==null?wE.Duration.fromPartial(r.retryDelay):void 0,e}};Gt.messageTypeRegistry.set(U.RetryInfo.$type,U.RetryInfo);function FP(){return{$type:"google.rpc.DebugInfo",stackEntries:[],detail:""}}U.DebugInfo={$type:"google.rpc.DebugInfo",encode(r,e=ae.Writer.create()){for(let t of r.stackEntries)e.uint32(10).string(t);return r.detail!==""&&e.uint32(18).string(r.detail),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=FP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.stackEntries.push(t.string());continue;case 2:if(s!==18)break;i.detail=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.DebugInfo.fromPartial(r??{})},fromPartial(r){var e,t;let n=FP();return n.stackEntries=((e=r.stackEntries)===null||e===void 0?void 0:e.map(i=>i))||[],n.detail=(t=r.detail)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.DebugInfo.$type,U.DebugInfo);function qP(){return{$type:"google.rpc.QuotaFailure",violations:[]}}U.QuotaFailure={$type:"google.rpc.QuotaFailure",encode(r,e=ae.Writer.create()){for(let t of r.violations)U.QuotaFailure_Violation.encode(t,e.uint32(10).fork()).ldelim();return e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=qP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.violations.push(U.QuotaFailure_Violation.decode(t,t.uint32()));continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.QuotaFailure.fromPartial(r??{})},fromPartial(r){var e;let t=qP();return t.violations=((e=r.violations)===null||e===void 0?void 0:e.map(n=>U.QuotaFailure_Violation.fromPartial(n)))||[],t}};Gt.messageTypeRegistry.set(U.QuotaFailure.$type,U.QuotaFailure);function BP(){return{$type:"google.rpc.QuotaFailure.Violation",subject:"",description:""}}U.QuotaFailure_Violation={$type:"google.rpc.QuotaFailure.Violation",encode(r,e=ae.Writer.create()){return r.subject!==""&&e.uint32(10).string(r.subject),r.description!==""&&e.uint32(18).string(r.description),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=BP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.subject=t.string();continue;case 2:if(s!==18)break;i.description=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.QuotaFailure_Violation.fromPartial(r??{})},fromPartial(r){var e,t;let n=BP();return n.subject=(e=r.subject)!==null&&e!==void 0?e:"",n.description=(t=r.description)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.QuotaFailure_Violation.$type,U.QuotaFailure_Violation);function UP(){return{$type:"google.rpc.ErrorInfo",reason:"",domain:"",metadata:{}}}U.ErrorInfo={$type:"google.rpc.ErrorInfo",encode(r,e=ae.Writer.create()){return r.reason!==""&&e.uint32(10).string(r.reason),r.domain!==""&&e.uint32(18).string(r.domain),Object.entries(r.metadata).forEach(([t,n])=>{U.ErrorInfo_MetadataEntry.encode({$type:"google.rpc.ErrorInfo.MetadataEntry",key:t,value:n},e.uint32(26).fork()).ldelim()}),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=UP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.reason=t.string();continue;case 2:if(s!==18)break;i.domain=t.string();continue;case 3:if(s!==26)break;let o=U.ErrorInfo_MetadataEntry.decode(t,t.uint32());o.value!==void 0&&(i.metadata[o.key]=o.value);continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.ErrorInfo.fromPartial(r??{})},fromPartial(r){var e,t,n;let i=UP();return i.reason=(e=r.reason)!==null&&e!==void 0?e:"",i.domain=(t=r.domain)!==null&&t!==void 0?t:"",i.metadata=Object.entries((n=r.metadata)!==null&&n!==void 0?n:{}).reduce((s,[o,a])=>(a!==void 0&&(s[o]=globalThis.String(a)),s),{}),i}};Gt.messageTypeRegistry.set(U.ErrorInfo.$type,U.ErrorInfo);function jP(){return{$type:"google.rpc.ErrorInfo.MetadataEntry",key:"",value:""}}U.ErrorInfo_MetadataEntry={$type:"google.rpc.ErrorInfo.MetadataEntry",encode(r,e=ae.Writer.create()){return r.key!==""&&e.uint32(10).string(r.key),r.value!==""&&e.uint32(18).string(r.value),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=jP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.key=t.string();continue;case 2:if(s!==18)break;i.value=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.ErrorInfo_MetadataEntry.fromPartial(r??{})},fromPartial(r){var e,t;let n=jP();return n.key=(e=r.key)!==null&&e!==void 0?e:"",n.value=(t=r.value)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.ErrorInfo_MetadataEntry.$type,U.ErrorInfo_MetadataEntry);function zP(){return{$type:"google.rpc.PreconditionFailure",violations:[]}}U.PreconditionFailure={$type:"google.rpc.PreconditionFailure",encode(r,e=ae.Writer.create()){for(let t of r.violations)U.PreconditionFailure_Violation.encode(t,e.uint32(10).fork()).ldelim();return e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=zP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.violations.push(U.PreconditionFailure_Violation.decode(t,t.uint32()));continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.PreconditionFailure.fromPartial(r??{})},fromPartial(r){var e;let t=zP();return t.violations=((e=r.violations)===null||e===void 0?void 0:e.map(n=>U.PreconditionFailure_Violation.fromPartial(n)))||[],t}};Gt.messageTypeRegistry.set(U.PreconditionFailure.$type,U.PreconditionFailure);function HP(){return{$type:"google.rpc.PreconditionFailure.Violation",type:"",subject:"",description:""}}U.PreconditionFailure_Violation={$type:"google.rpc.PreconditionFailure.Violation",encode(r,e=ae.Writer.create()){return r.type!==""&&e.uint32(10).string(r.type),r.subject!==""&&e.uint32(18).string(r.subject),r.description!==""&&e.uint32(26).string(r.description),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=HP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.type=t.string();continue;case 2:if(s!==18)break;i.subject=t.string();continue;case 3:if(s!==26)break;i.description=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.PreconditionFailure_Violation.fromPartial(r??{})},fromPartial(r){var e,t,n;let i=HP();return i.type=(e=r.type)!==null&&e!==void 0?e:"",i.subject=(t=r.subject)!==null&&t!==void 0?t:"",i.description=(n=r.description)!==null&&n!==void 0?n:"",i}};Gt.messageTypeRegistry.set(U.PreconditionFailure_Violation.$type,U.PreconditionFailure_Violation);function GP(){return{$type:"google.rpc.BadRequest",fieldViolations:[]}}U.BadRequest={$type:"google.rpc.BadRequest",encode(r,e=ae.Writer.create()){for(let t of r.fieldViolations)U.BadRequest_FieldViolation.encode(t,e.uint32(10).fork()).ldelim();return e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=GP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.fieldViolations.push(U.BadRequest_FieldViolation.decode(t,t.uint32()));continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.BadRequest.fromPartial(r??{})},fromPartial(r){var e;let t=GP();return t.fieldViolations=((e=r.fieldViolations)===null||e===void 0?void 0:e.map(n=>U.BadRequest_FieldViolation.fromPartial(n)))||[],t}};Gt.messageTypeRegistry.set(U.BadRequest.$type,U.BadRequest);function VP(){return{$type:"google.rpc.BadRequest.FieldViolation",field:"",description:""}}U.BadRequest_FieldViolation={$type:"google.rpc.BadRequest.FieldViolation",encode(r,e=ae.Writer.create()){return r.field!==""&&e.uint32(10).string(r.field),r.description!==""&&e.uint32(18).string(r.description),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=VP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.field=t.string();continue;case 2:if(s!==18)break;i.description=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.BadRequest_FieldViolation.fromPartial(r??{})},fromPartial(r){var e,t;let n=VP();return n.field=(e=r.field)!==null&&e!==void 0?e:"",n.description=(t=r.description)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.BadRequest_FieldViolation.$type,U.BadRequest_FieldViolation);function WP(){return{$type:"google.rpc.RequestInfo",requestId:"",servingData:""}}U.RequestInfo={$type:"google.rpc.RequestInfo",encode(r,e=ae.Writer.create()){return r.requestId!==""&&e.uint32(10).string(r.requestId),r.servingData!==""&&e.uint32(18).string(r.servingData),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=WP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.requestId=t.string();continue;case 2:if(s!==18)break;i.servingData=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.RequestInfo.fromPartial(r??{})},fromPartial(r){var e,t;let n=WP();return n.requestId=(e=r.requestId)!==null&&e!==void 0?e:"",n.servingData=(t=r.servingData)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.RequestInfo.$type,U.RequestInfo);function KP(){return{$type:"google.rpc.ResourceInfo",resourceType:"",resourceName:"",owner:"",description:""}}U.ResourceInfo={$type:"google.rpc.ResourceInfo",encode(r,e=ae.Writer.create()){return r.resourceType!==""&&e.uint32(10).string(r.resourceType),r.resourceName!==""&&e.uint32(18).string(r.resourceName),r.owner!==""&&e.uint32(26).string(r.owner),r.description!==""&&e.uint32(34).string(r.description),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=KP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.resourceType=t.string();continue;case 2:if(s!==18)break;i.resourceName=t.string();continue;case 3:if(s!==26)break;i.owner=t.string();continue;case 4:if(s!==34)break;i.description=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.ResourceInfo.fromPartial(r??{})},fromPartial(r){var e,t,n,i;let s=KP();return s.resourceType=(e=r.resourceType)!==null&&e!==void 0?e:"",s.resourceName=(t=r.resourceName)!==null&&t!==void 0?t:"",s.owner=(n=r.owner)!==null&&n!==void 0?n:"",s.description=(i=r.description)!==null&&i!==void 0?i:"",s}};Gt.messageTypeRegistry.set(U.ResourceInfo.$type,U.ResourceInfo);function JP(){return{$type:"google.rpc.Help",links:[]}}U.Help={$type:"google.rpc.Help",encode(r,e=ae.Writer.create()){for(let t of r.links)U.Help_Link.encode(t,e.uint32(10).fork()).ldelim();return e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=JP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.links.push(U.Help_Link.decode(t,t.uint32()));continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.Help.fromPartial(r??{})},fromPartial(r){var e;let t=JP();return t.links=((e=r.links)===null||e===void 0?void 0:e.map(n=>U.Help_Link.fromPartial(n)))||[],t}};Gt.messageTypeRegistry.set(U.Help.$type,U.Help);function QP(){return{$type:"google.rpc.Help.Link",description:"",url:""}}U.Help_Link={$type:"google.rpc.Help.Link",encode(r,e=ae.Writer.create()){return r.description!==""&&e.uint32(10).string(r.description),r.url!==""&&e.uint32(18).string(r.url),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=QP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.description=t.string();continue;case 2:if(s!==18)break;i.url=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.Help_Link.fromPartial(r??{})},fromPartial(r){var e,t;let n=QP();return n.description=(e=r.description)!==null&&e!==void 0?e:"",n.url=(t=r.url)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.Help_Link.$type,U.Help_Link);function YP(){return{$type:"google.rpc.LocalizedMessage",locale:"",message:""}}U.LocalizedMessage={$type:"google.rpc.LocalizedMessage",encode(r,e=ae.Writer.create()){return r.locale!==""&&e.uint32(10).string(r.locale),r.message!==""&&e.uint32(18).string(r.message),e},decode(r,e){let t=r instanceof ae.Reader?r:ae.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=YP();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.locale=t.string();continue;case 2:if(s!==18)break;i.message=t.string();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return U.LocalizedMessage.fromPartial(r??{})},fromPartial(r){var e,t;let n=YP();return n.locale=(e=r.locale)!==null&&e!==void 0?e:"",n.message=(t=r.message)!==null&&t!==void 0?t:"",n}};Gt.messageTypeRegistry.set(U.LocalizedMessage.$type,U.LocalizedMessage)});var yh=g(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Any=Wn.protobufPackage=void 0;var TE=Zu(),fG=Jl();Wn.protobufPackage="google.protobuf";function $P(){return{$type:"google.protobuf.Any",typeUrl:"",value:new Uint8Array(0)}}Wn.Any={$type:"google.protobuf.Any",encode(r,e=TE.Writer.create()){return r.typeUrl!==""&&e.uint32(10).string(r.typeUrl),r.value.length!==0&&e.uint32(18).bytes(r.value),e},decode(r,e){let t=r instanceof TE.Reader?r:TE.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=$P();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==10)break;i.typeUrl=t.string();continue;case 2:if(s!==18)break;i.value=t.bytes();continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return Wn.Any.fromPartial(r??{})},fromPartial(r){var e,t;let n=$P();return n.typeUrl=(e=r.typeUrl)!==null&&e!==void 0?e:"",n.value=(t=r.value)!==null&&t!==void 0?t:new Uint8Array(0),n}};fG.messageTypeRegistry.set(Wn.Any.$type,Wn.Any)});var xE=g(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.RichServerError=void 0;var hG=jt(),CE=class extends hG.ServerError{constructor(e,t,n=[]){super(e,t),this.name="RichServerError",this.extra=n}};vh.RichServerError=CE});var OE=g(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.encodeErrorDetails=ba.decodeErrorDetails=void 0;var dr=SE(),ZP=yh(),XP=[dr.RetryInfo,dr.DebugInfo,dr.QuotaFailure,dr.QuotaFailure_Violation,dr.ErrorInfo,dr.PreconditionFailure,dr.PreconditionFailure_Violation,dr.BadRequest,dr.BadRequest_FieldViolation,dr.RequestInfo,dr.ResourceInfo,dr.Help,dr.LocalizedMessage];function pG(r){return r.map(e=>{let t=XP.find(n=>e.typeUrl.endsWith(`/${n.$type}`));return t==null?e:t.decode(e.value)})}ba.decodeErrorDetails=pG;function mG(r){return r.map(e=>{if(e.$type===ZP.Any.$type)return e;let t=XP.find(n=>n.$type===e.$type);if(t==null)throw new Error(`Unknown error details type: ${e.$type}`);return ZP.Any.fromPartial({typeUrl:`type.googleapis.com/${e.$type}`,value:t.encode(e).finish()})})}ba.encodeErrorDetails=mG});var kE=g(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.Status=Kn.protobufPackage=void 0;var IE=Zu(),gG=Jl(),PE=yh();Kn.protobufPackage="google.rpc";function ek(){return{$type:"google.rpc.Status",code:0,message:"",details:[]}}Kn.Status={$type:"google.rpc.Status",encode(r,e=IE.Writer.create()){r.code!==0&&e.uint32(8).int32(r.code),r.message!==""&&e.uint32(18).string(r.message);for(let t of r.details)PE.Any.encode(t,e.uint32(26).fork()).ldelim();return e},decode(r,e){let t=r instanceof IE.Reader?r:IE.Reader.create(r),n=e===void 0?t.len:t.pos+e,i=ek();for(;t.pos<n;){let s=t.uint32();switch(s>>>3){case 1:if(s!==8)break;i.code=t.int32();continue;case 2:if(s!==18)break;i.message=t.string();continue;case 3:if(s!==26)break;i.details.push(PE.Any.decode(t,t.uint32()));continue}if((s&7)===4||s===0)break;t.skipType(s&7)}return i},create(r){return Kn.Status.fromPartial(r??{})},fromPartial(r){var e,t,n;let i=ek();return i.code=(e=r.code)!==null&&e!==void 0?e:0,i.message=(t=r.message)!==null&&t!==void 0?t:"",i.details=((n=r.details)===null||n===void 0?void 0:n.map(s=>PE.Any.fromPartial(s)))||[],i}};gG.messageTypeRegistry.set(Kn.Status.$type,Kn.Status)});var rk=g(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.errorDetailsServerMiddleware=void 0;var yG=OE(),tk=kE(),vG=xE(),bG=async function*(e,t){try{return yield*e.next(e.request,t)}catch(n){if(n instanceof vG.RichServerError){let i=tk.Status.fromPartial({code:n.code,message:n.details,details:(0,yG.encodeErrorDetails)(n.extra)});t.trailer.set("grpc-status-details-bin",tk.Status.encode(i).finish())}throw n}};bh.errorDetailsServerMiddleware=bG});var NE=g(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.RichClientError=void 0;var _G=jt(),RE=class extends _G.ClientError{constructor(e,t,n,i){super(e,t,n),this.name="RichClientError",this.extra=i}};_h.RichClientError=RE});var nk=g(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.errorDetailsClientMiddleware=void 0;var EG=jt(),AG=OE(),wG=kE(),SG=NE(),TG=async function*(e,t){let n;try{return yield*e.next(e.request,{...t,onTrailer(i){var s;let o=i.get("grpc-status-details-bin");o!=null&&(n=wG.Status.decode(o)),(s=t.onTrailer)===null||s===void 0||s.call(t,i)}})}catch(i){throw n!=null&&i instanceof EG.ClientError?new SG.RichClientError(i.path,i.code,i.details,(0,AG.decodeErrorDetails)(n.details)):i}};Eh.errorDetailsClientMiddleware=TG});var ik=g(_t=>{"use strict";var CG=_t&&_t.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),xG=_t&&_t.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&CG(e,r,t)};Object.defineProperty(_t,"__esModule",{value:!0});_t.errorDetailsClientMiddleware=_t.RichClientError=_t.errorDetailsServerMiddleware=_t.RichServerError=_t.Any=void 0;xG(SE(),_t);var OG=yh();Object.defineProperty(_t,"Any",{enumerable:!0,get:function(){return OG.Any}});var IG=xE();Object.defineProperty(_t,"RichServerError",{enumerable:!0,get:function(){return IG.RichServerError}});var PG=rk();Object.defineProperty(_t,"errorDetailsServerMiddleware",{enumerable:!0,get:function(){return PG.errorDetailsServerMiddleware}});var kG=NE();Object.defineProperty(_t,"RichClientError",{enumerable:!0,get:function(){return kG.RichClientError}});var RG=nk();Object.defineProperty(_t,"errorDetailsClientMiddleware",{enumerable:!0,get:function(){return RG.errorDetailsClientMiddleware}})});var Ce=g(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.isFunction=void 0;function qG(r){return typeof r=="function"}wh.isFunction=qG});var Di=g(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.createErrorClass=void 0;function BG(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Sh.createErrorClass=BG});var LE=g(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.UnsubscriptionError=void 0;var UG=Di();Th.UnsubscriptionError=UG.createErrorClass(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
29
|
+
`+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
30
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}})});var Jn=g(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.arrRemove=void 0;function jG(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}Ch.arrRemove=jG});var fr=g(Xt=>{"use strict";var yk=Xt&&Xt.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vk=Xt&&Xt.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},bk=Xt&&Xt.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.isSubscription=Xt.EMPTY_SUBSCRIPTION=Xt.Subscription=void 0;var Yl=Ce(),FE=LE(),_k=Jn(),qE=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=yk(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(p){e={error:p}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(Yl.isFunction(u))try{u()}catch(p){s=p instanceof FE.UnsubscriptionError?p.errors:[p]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=yk(d),h=f.next();!h.done;h=f.next()){var m=h.value;try{Ek(m)}catch(p){s=s??[],p instanceof FE.UnsubscriptionError?s=bk(bk([],vk(s)),vk(p.errors)):s.push(p)}}}catch(p){n={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}if(s)throw new FE.UnsubscriptionError(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Ek(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&_k.arrRemove(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&_k.arrRemove(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();Xt.Subscription=qE;Xt.EMPTY_SUBSCRIPTION=qE.EMPTY;function zG(r){return r instanceof qE||r&&"closed"in r&&Yl.isFunction(r.remove)&&Yl.isFunction(r.add)&&Yl.isFunction(r.unsubscribe)}Xt.isSubscription=zG;function Ek(r){Yl.isFunction(r)?r():r.unsubscribe()}});var Sa=g(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.config=void 0;xh.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var BE=g(yn=>{"use strict";var Ak=yn&&yn.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},wk=yn&&yn.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(yn,"__esModule",{value:!0});yn.timeoutProvider=void 0;yn.timeoutProvider={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=yn.timeoutProvider.delegate;return i?.setTimeout?i.setTimeout.apply(i,wk([r,e],Ak(t))):setTimeout.apply(void 0,wk([r,e],Ak(t)))},clearTimeout:function(r){var e=yn.timeoutProvider.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0}});var UE=g(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.reportUnhandledError=void 0;var HG=Sa(),GG=BE();function VG(r){GG.timeoutProvider.setTimeout(function(){var e=HG.config.onUnhandledError;if(e)e(r);else throw r})}Oh.reportUnhandledError=VG});var Et=g(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.noop=void 0;function WG(){}Ih.noop=WG});var Sk=g(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.createNotification=vn.nextNotification=vn.errorNotification=vn.COMPLETE_NOTIFICATION=void 0;vn.COMPLETE_NOTIFICATION=function(){return Ph("C",void 0,void 0)}();function KG(r){return Ph("E",void 0,r)}vn.errorNotification=KG;function JG(r){return Ph("N",r,void 0)}vn.nextNotification=JG;function Ph(r,e,t){return{kind:r,value:e,error:t}}vn.createNotification=Ph});var kh=g(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.captureError=Ta.errorContext=void 0;var Tk=Sa(),ro=null;function QG(r){if(Tk.config.useDeprecatedSynchronousErrorHandling){var e=!ro;if(e&&(ro={errorThrown:!1,error:null}),r(),e){var t=ro,n=t.errorThrown,i=t.error;if(ro=null,n)throw i}}else r()}Ta.errorContext=QG;function YG(r){Tk.config.useDeprecatedSynchronousErrorHandling&&ro&&(ro.errorThrown=!0,ro.error=r)}Ta.captureError=YG});var Ca=g(jr=>{"use strict";var Ok=jr&&jr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(jr,"__esModule",{value:!0});jr.EMPTY_OBSERVER=jr.SafeSubscriber=jr.Subscriber=void 0;var $G=Ce(),Ck=fr(),GE=Sa(),ZG=UE(),xk=Et(),jE=Sk(),XG=BE(),eV=kh(),Ik=function(r){Ok(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Ck.isSubscription(t)&&t.add(n)):n.destination=jr.EMPTY_OBSERVER,n}return e.create=function(t,n,i){return new Pk(t,n,i)},e.prototype.next=function(t){this.isStopped?HE(jE.nextNotification(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?HE(jE.errorNotification(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?HE(jE.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ck.Subscription);jr.Subscriber=Ik;var tV=Function.prototype.bind;function zE(r,e){return tV.call(r,e)}var rV=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){Rh(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Rh(n)}else Rh(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Rh(t)}},r}(),Pk=function(r){Ok(e,r);function e(t,n,i){var s=r.call(this)||this,o;if($G.isFunction(t)||!t)o={next:t??void 0,error:n??void 0,complete:i??void 0};else{var a;s&&GE.config.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&zE(t.next,a),error:t.error&&zE(t.error,a),complete:t.complete&&zE(t.complete,a)}):o=t}return s.destination=new rV(o),s}return e}(Ik);jr.SafeSubscriber=Pk;function Rh(r){GE.config.useDeprecatedSynchronousErrorHandling?eV.captureError(r):ZG.reportUnhandledError(r)}function nV(r){throw r}function HE(r,e){var t=GE.config.onStoppedNotification;t&&XG.timeoutProvider.setTimeout(function(){return t(r,e)})}jr.EMPTY_OBSERVER={closed:!0,next:xk.noop,error:nV,complete:xk.noop}});var $l=g(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.observable=void 0;Nh.observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()});var At=g(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.identity=void 0;function iV(r){return r}Mh.identity=iV});var Zl=g(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.pipeFromArray=xa.pipe=void 0;var sV=At();function oV(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return kk(r)}xa.pipe=oV;function kk(r){return r.length===0?sV.identity:r.length===1?r[0]:function(t){return r.reduce(function(n,i){return i(n)},t)}}xa.pipeFromArray=kk});var ke=g(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.Observable=void 0;var WE=Ca(),aV=fr(),cV=$l(),lV=Zl(),uV=Sa(),VE=Ce(),dV=kh(),fV=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=pV(e)?e:new WE.SafeSubscriber(e,t,n);return dV.errorContext(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Rk(t),new t(function(i,s){var o=new WE.SafeSubscriber({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[cV.observable]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return lV.pipeFromArray(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Rk(e),new e(function(n,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},r.create=function(e){return new r(e)},r}();Dh.Observable=fV;function Rk(r){var e;return(e=r??uV.config.Promise)!==null&&e!==void 0?e:Promise}function hV(r){return r&&VE.isFunction(r.next)&&VE.isFunction(r.error)&&VE.isFunction(r.complete)}function pV(r){return r&&r instanceof WE.Subscriber||hV(r)&&aV.isSubscription(r)}});var K=g(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.operate=Oa.hasLift=void 0;var mV=Ce();function Nk(r){return mV.isFunction(r?.lift)}Oa.hasLift=Nk;function gV(r){return function(e){if(Nk(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}Oa.operate=gV});var te=g(Li=>{"use strict";var yV=Li&&Li.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Li,"__esModule",{value:!0});Li.OperatorSubscriber=Li.createOperatorSubscriber=void 0;var vV=Ca();function bV(r,e,t,n,i){return new Mk(r,e,t,n,i)}Li.createOperatorSubscriber=bV;var Mk=function(r){yV(e,r);function e(t,n,i,s,o,a){var c=r.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(l){try{n(l)}catch(u){t.error(u)}}:r.prototype._next,c._error=s?function(l){try{s(l)}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=i?function(){try{i()}catch(l){t.error(l)}finally{this.unsubscribe()}}:r.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(vV.Subscriber);Li.OperatorSubscriber=Mk});var KE=g(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.refCount=void 0;var _V=K(),EV=te();function AV(){return _V.operate(function(r,e){var t=null;r._refCount++;var n=EV.createOperatorSubscriber(e,void 0,void 0,void 0,function(){if(!r||r._refCount<=0||0<--r._refCount){t=null;return}var i=r._connection,s=t;t=null,i&&(!s||i===s)&&i.unsubscribe(),e.unsubscribe()});r.subscribe(n),n.closed||(t=r.connect())})}Lh.refCount=AV});var Xl=g(Ia=>{"use strict";var wV=Ia&&Ia.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.ConnectableObservable=void 0;var SV=ke(),Dk=fr(),TV=KE(),CV=te(),xV=K(),OV=function(r){wV(e,r);function e(t,n){var i=r.call(this)||this;return i.source=t,i.subjectFactory=n,i._subject=null,i._refCount=0,i._connection=null,xV.hasLift(t)&&(i.lift=t.lift),i}return e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,t?.unsubscribe()},e.prototype.connect=function(){var t=this,n=this._connection;if(!n){n=this._connection=new Dk.Subscription;var i=this.getSubject();n.add(this.source.subscribe(CV.createOperatorSubscriber(i,void 0,function(){t._teardown(),i.complete()},function(s){t._teardown(),i.error(s)},function(){return t._teardown()}))),n.closed&&(this._connection=null,n=Dk.Subscription.EMPTY)}return n},e.prototype.refCount=function(){return TV.refCount()(this)},e}(SV.Observable);Ia.ConnectableObservable=OV});var Lk=g(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.performanceTimestampProvider=void 0;eu.performanceTimestampProvider={now:function(){return(eu.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var JE=g(zr=>{"use strict";var Fk=zr&&zr.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},qk=zr&&zr.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(zr,"__esModule",{value:!0});zr.animationFrameProvider=void 0;var IV=fr();zr.animationFrameProvider={schedule:function(r){var e=requestAnimationFrame,t=cancelAnimationFrame,n=zr.animationFrameProvider.delegate;n&&(e=n.requestAnimationFrame,t=n.cancelAnimationFrame);var i=e(function(s){t=void 0,r(s)});return new IV.Subscription(function(){return t?.(i)})},requestAnimationFrame:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=zr.animationFrameProvider.delegate;return(t?.requestAnimationFrame||requestAnimationFrame).apply(void 0,qk([],Fk(r)))},cancelAnimationFrame:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=zr.animationFrameProvider.delegate;return(t?.cancelAnimationFrame||cancelAnimationFrame).apply(void 0,qk([],Fk(r)))},delegate:void 0}});var jk=g(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.animationFrames=void 0;var PV=ke(),kV=Lk(),Bk=JE();function RV(r){return r?Uk(r):NV}Fh.animationFrames=RV;function Uk(r){return new PV.Observable(function(e){var t=r||kV.performanceTimestampProvider,n=t.now(),i=0,s=function(){e.closed||(i=Bk.animationFrameProvider.requestAnimationFrame(function(o){i=0;var a=t.now();e.next({timestamp:r?a:o,elapsed:a-n}),s()}))};return s(),function(){i&&Bk.animationFrameProvider.cancelAnimationFrame(i)}})}var NV=Uk()});var QE=g(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.ObjectUnsubscribedError=void 0;var MV=Di();qh.ObjectUnsubscribedError=MV.createErrorClass(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var wt=g(bn=>{"use strict";var Hk=bn&&bn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),DV=bn&&bn.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(bn,"__esModule",{value:!0});bn.AnonymousSubject=bn.Subject=void 0;var zk=ke(),$E=fr(),LV=QE(),FV=Jn(),YE=kh(),Gk=function(r){Hk(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new ZE(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new LV.ObjectUnsubscribedError},e.prototype.next=function(t){var n=this;YE.errorContext(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=DV(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;YE.errorContext(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;YE.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?$E.EMPTY_SUBSCRIPTION:(this.currentObservers=null,a.push(t),new $E.Subscription(function(){n.currentObservers=null,FV.arrRemove(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new zk.Observable;return t.source=this,t},e.create=function(t,n){return new ZE(t,n)},e}(zk.Observable);bn.Subject=Gk;var ZE=function(r){Hk(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:$E.EMPTY_SUBSCRIPTION},e}(Gk);bn.AnonymousSubject=ZE});var XE=g(Pa=>{"use strict";var qV=Pa&&Pa.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.BehaviorSubject=void 0;var BV=wt(),UV=function(r){qV(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,s=t._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(BV.Subject);Pa.BehaviorSubject=UV});var Bh=g(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.dateTimestampProvider=void 0;tu.dateTimestampProvider={now:function(){return(tu.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var Uh=g(ka=>{"use strict";var jV=ka&&ka.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(ka,"__esModule",{value:!0});ka.ReplaySubject=void 0;var zV=wt(),HV=Bh(),GV=function(r){jV(e,r);function e(t,n,i){t===void 0&&(t=1/0),n===void 0&&(n=1/0),i===void 0&&(i=HV.dateTimestampProvider);var s=r.call(this)||this;return s._bufferSize=t,s._windowTime=n,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,n),s}return e.prototype.next=function(t){var n=this,i=n.isStopped,s=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;i||(s.push(t),!o&&s.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),i=this,s=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),c=0;c<a.length&&!t.closed;c+=s?1:2)t.next(a[c]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,i=t._timestampProvider,s=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<s.length&&s.splice(0,s.length-a),!o){for(var c=i.now(),l=0,u=1;u<s.length&&s[u]<=c;u+=2)l=u;l&&s.splice(0,l+1)}},e}(zV.Subject);ka.ReplaySubject=GV});var jh=g(Ra=>{"use strict";var VV=Ra&&Ra.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Ra,"__esModule",{value:!0});Ra.AsyncSubject=void 0;var WV=wt(),KV=function(r){VV(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n._hasValue,o=n._value,a=n.thrownError,c=n.isStopped,l=n._isComplete;i?t.error(a):(c||l)&&(s&&t.next(o),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var t=this,n=t._hasValue,i=t._value,s=t._isComplete;s||(this._isComplete=!0,n&&r.prototype.next.call(this,i),r.prototype.complete.call(this))},e}(WV.Subject);Ra.AsyncSubject=KV});var Vk=g(Na=>{"use strict";var JV=Na&&Na.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Na,"__esModule",{value:!0});Na.Action=void 0;var QV=fr(),YV=function(r){JV(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e}(QV.Subscription);Na.Action=YV});var Jk=g(_n=>{"use strict";var Wk=_n&&_n.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},Kk=_n&&_n.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(_n,"__esModule",{value:!0});_n.intervalProvider=void 0;_n.intervalProvider={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=_n.intervalProvider.delegate;return i?.setInterval?i.setInterval.apply(i,Kk([r,e],Wk(t))):setInterval.apply(void 0,Kk([r,e],Wk(t)))},clearInterval:function(r){var e=_n.intervalProvider.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0}});var Da=g(Ma=>{"use strict";var $V=Ma&&Ma.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Ma,"__esModule",{value:!0});Ma.AsyncAction=void 0;var ZV=Vk(),Qk=Jk(),XV=Jn(),eW=function(r){$V(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(t,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),Qk.intervalProvider.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Qk.intervalProvider.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var i=!1,s;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,XV.arrRemove(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(ZV.Action);Ma.AsyncAction=eW});var $k=g(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.TestTools=La.Immediate=void 0;var tW=1,e1,zh={};function Yk(r){return r in zh?(delete zh[r],!0):!1}La.Immediate={setImmediate:function(r){var e=tW++;return zh[e]=!0,e1||(e1=Promise.resolve()),e1.then(function(){return Yk(e)&&r()}),e},clearImmediate:function(r){Yk(r)}};La.TestTools={pending:function(){return Object.keys(zh).length}}});var Xk=g(En=>{"use strict";var rW=En&&En.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},nW=En&&En.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(En,"__esModule",{value:!0});En.immediateProvider=void 0;var Zk=$k(),iW=Zk.Immediate.setImmediate,sW=Zk.Immediate.clearImmediate;En.immediateProvider={setImmediate:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=En.immediateProvider.delegate;return(t?.setImmediate||iW).apply(void 0,nW([],rW(r)))},clearImmediate:function(r){var e=En.immediateProvider.delegate;return(e?.clearImmediate||sW)(r)},delegate:void 0}});var tR=g(Fa=>{"use strict";var oW=Fa&&Fa.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.AsapAction=void 0;var aW=Da(),eR=Xk(),cW=function(r){oW(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i}return e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!==null&&i>0?r.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t._scheduled||(t._scheduled=eR.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},e.prototype.recycleAsyncId=function(t,n,i){var s;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,t,n,i);var o=t.actions;n!=null&&((s=o[o.length-1])===null||s===void 0?void 0:s.id)!==n&&(eR.immediateProvider.clearImmediate(n),t._scheduled===n&&(t._scheduled=void 0))},e}(aW.AsyncAction);Fa.AsapAction=cW});var t1=g(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.Scheduler=void 0;var lW=Bh(),uW=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=lW.dateTimestampProvider.now,r}();Hh.Scheduler=uW});var Ba=g(qa=>{"use strict";var dW=qa&&qa.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(qa,"__esModule",{value:!0});qa.AsyncScheduler=void 0;var rR=t1(),fW=function(r){dW(e,r);function e(t,n){n===void 0&&(n=rR.Scheduler.now);var i=r.call(this,t,n)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,i){for(;t=n.shift();)t.unsubscribe();throw i}},e}(rR.Scheduler);qa.AsyncScheduler=fW});var nR=g(Ua=>{"use strict";var hW=Ua&&Ua.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Ua,"__esModule",{value:!0});Ua.AsapScheduler=void 0;var pW=Ba(),mW=function(r){hW(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,s;t=t||i.shift();do if(s=t.execute(t.state,t.delay))break;while((t=i[0])&&t.id===n&&i.shift());if(this._active=!1,s){for(;(t=i[0])&&t.id===n&&i.shift();)t.unsubscribe();throw s}},e}(pW.AsyncScheduler);Ua.AsapScheduler=mW});var iR=g(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.asap=no.asapScheduler=void 0;var gW=tR(),yW=nR();no.asapScheduler=new yW.AsapScheduler(gW.AsapAction);no.asap=no.asapScheduler});var er=g(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.async=io.asyncScheduler=void 0;var vW=Da(),bW=Ba();io.asyncScheduler=new bW.AsyncScheduler(vW.AsyncAction);io.async=io.asyncScheduler});var sR=g(ja=>{"use strict";var _W=ja&&ja.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(ja,"__esModule",{value:!0});ja.QueueAction=void 0;var EW=Da(),AW=function(r){_W(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),n>0?r.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},e.prototype.execute=function(t,n){return n>0||this.closed?r.prototype.execute.call(this,t,n):this._execute(t,n)},e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?r.prototype.requestAsyncId.call(this,t,n,i):(t.flush(this),0)},e}(EW.AsyncAction);ja.QueueAction=AW});var oR=g(za=>{"use strict";var wW=za&&za.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(za,"__esModule",{value:!0});za.QueueScheduler=void 0;var SW=Ba(),TW=function(r){wW(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(SW.AsyncScheduler);za.QueueScheduler=TW});var aR=g(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.queue=so.queueScheduler=void 0;var CW=sR(),xW=oR();so.queueScheduler=new xW.QueueScheduler(CW.QueueAction);so.queue=so.queueScheduler});var lR=g(Ha=>{"use strict";var OW=Ha&&Ha.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Ha,"__esModule",{value:!0});Ha.AnimationFrameAction=void 0;var IW=Da(),cR=JE(),PW=function(r){OW(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.scheduler=t,i.work=n,i}return e.prototype.requestAsyncId=function(t,n,i){return i===void 0&&(i=0),i!==null&&i>0?r.prototype.requestAsyncId.call(this,t,n,i):(t.actions.push(this),t._scheduled||(t._scheduled=cR.animationFrameProvider.requestAnimationFrame(function(){return t.flush(void 0)})))},e.prototype.recycleAsyncId=function(t,n,i){var s;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,t,n,i);var o=t.actions;n!=null&&((s=o[o.length-1])===null||s===void 0?void 0:s.id)!==n&&(cR.animationFrameProvider.cancelAnimationFrame(n),t._scheduled=void 0)},e}(IW.AsyncAction);Ha.AnimationFrameAction=PW});var uR=g(Ga=>{"use strict";var kW=Ga&&Ga.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.AnimationFrameScheduler=void 0;var RW=Ba(),NW=function(r){kW(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,s;t=t||i.shift();do if(s=t.execute(t.state,t.delay))break;while((t=i[0])&&t.id===n&&i.shift());if(this._active=!1,s){for(;(t=i[0])&&t.id===n&&i.shift();)t.unsubscribe();throw s}},e}(RW.AsyncScheduler);Ga.AnimationFrameScheduler=NW});var dR=g(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.animationFrame=oo.animationFrameScheduler=void 0;var MW=lR(),DW=uR();oo.animationFrameScheduler=new DW.AnimationFrameScheduler(MW.AnimationFrameAction);oo.animationFrame=oo.animationFrameScheduler});var pR=g(Fi=>{"use strict";var fR=Fi&&Fi.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(Fi,"__esModule",{value:!0});Fi.VirtualAction=Fi.VirtualTimeScheduler=void 0;var LW=Da(),FW=fr(),qW=Ba(),BW=function(r){fR(e,r);function e(t,n){t===void 0&&(t=hR),n===void 0&&(n=1/0);var i=r.call(this,t,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var t=this,n=t.actions,i=t.maxFrames,s,o;(o=n[0])&&o.delay<=i&&(n.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=n.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(qW.AsyncScheduler);Fi.VirtualTimeScheduler=BW;var hR=function(r){fR(e,r);function e(t,n,i){i===void 0&&(i=t.index+=1);var s=r.call(this,t,n)||this;return s.scheduler=t,s.work=n,s.index=i,s.active=!0,s.index=t.index=i,s}return e.prototype.schedule=function(t,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return r.prototype.schedule.call(this,t,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(t,n)}else return FW.Subscription.EMPTY},e.prototype.requestAsyncId=function(t,n,i){i===void 0&&(i=0),this.delay=t.frame+i;var s=t.actions;return s.push(this),s.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,n,i){i===void 0&&(i=0)},e.prototype._execute=function(t,n){if(this.active===!0)return r.prototype._execute.call(this,t,n)},e.sortActions=function(t,n){return t.delay===n.delay?t.index===n.index?0:t.index>n.index?1:-1:t.delay>n.delay?1:-1},e}(LW.AsyncAction);Fi.VirtualAction=hR});var Hr=g(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.empty=ao.EMPTY=void 0;var mR=ke();ao.EMPTY=new mR.Observable(function(r){return r.complete()});function UW(r){return r?jW(r):ao.EMPTY}ao.empty=UW;function jW(r){return new mR.Observable(function(e){return r.schedule(function(){return e.complete()})})}});var ru=g(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.isScheduler=void 0;var zW=Ce();function HW(r){return r&&zW.isFunction(r.schedule)}Gh.isScheduler=HW});var tr=g(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.popNumber=qi.popScheduler=qi.popResultSelector=void 0;var GW=Ce(),VW=ru();function r1(r){return r[r.length-1]}function WW(r){return GW.isFunction(r1(r))?r.pop():void 0}qi.popResultSelector=WW;function KW(r){return VW.isScheduler(r1(r))?r.pop():void 0}qi.popScheduler=KW;function JW(r,e){return typeof r1(r)=="number"?r.pop():e}qi.popNumber=JW});var Wh=g(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isArrayLike=void 0;Vh.isArrayLike=function(r){return r&&typeof r.length=="number"&&typeof r!="function"}});var n1=g(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.isPromise=void 0;var QW=Ce();function YW(r){return QW.isFunction(r?.then)}Kh.isPromise=YW});var i1=g(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.isInteropObservable=void 0;var $W=$l(),ZW=Ce();function XW(r){return ZW.isFunction(r[$W.observable])}Jh.isInteropObservable=XW});var s1=g(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.isAsyncIterable=void 0;var eK=Ce();function tK(r){return Symbol.asyncIterator&&eK.isFunction(r?.[Symbol.asyncIterator])}Qh.isAsyncIterable=tK});var o1=g(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.createInvalidObservableTypeError=void 0;function rK(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}Yh.createInvalidObservableTypeError=rK});var a1=g(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.iterator=Va.getSymbolIterator=void 0;function gR(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}Va.getSymbolIterator=gR;Va.iterator=gR()});var c1=g($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.isIterable=void 0;var nK=a1(),iK=Ce();function sK(r){return iK.isFunction(r?.[nK.iterator])}$h.isIterable=sK});var Zh=g(xr=>{"use strict";var oK=xr&&xr.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Wa=xr&&xr.__await||function(r){return this instanceof Wa?(this.v=r,this):new Wa(r)},aK=xr&&xr.__asyncGenerator||function(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){n[f]&&(i[f]=function(h){return new Promise(function(m,p){s.push([f,h,m,p])>1||a(f,h)})})}function a(f,h){try{c(n[f](h))}catch(m){d(s[0][3],m)}}function c(f){f.value instanceof Wa?Promise.resolve(f.value.v).then(l,u):d(s[0][2],f)}function l(f){a("next",f)}function u(f){a("throw",f)}function d(f,h){f(h),s.shift(),s.length&&a(s[0][0],s[0][1])}};Object.defineProperty(xr,"__esModule",{value:!0});xr.isReadableStreamLike=xr.readableStreamLikeToAsyncGenerator=void 0;var cK=Ce();function lK(r){return aK(this,arguments,function(){var t,n,i,s;return oK(this,function(o){switch(o.label){case 0:t=r.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Wa(t.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,Wa(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Wa(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}xr.readableStreamLikeToAsyncGenerator=lK;function uK(r){return cK.isFunction(r?.getReader)}xr.isReadableStreamLike=uK});var le=g(Ue=>{"use strict";var dK=Ue&&Ue.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(d){o(d)}}function c(u){try{l(n.throw(u))}catch(d){o(d)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(r,e||[])).next())})},fK=Ue&&Ue.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},hK=Ue&&Ue.__asyncValues||function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof l1=="function"?l1(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}},l1=Ue&&Ue.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.fromReadableStreamLike=Ue.fromAsyncIterable=Ue.fromIterable=Ue.fromPromise=Ue.fromArrayLike=Ue.fromInteropObservable=Ue.innerFrom=void 0;var pK=Wh(),mK=n1(),Ka=ke(),gK=i1(),yK=s1(),vK=o1(),bK=c1(),yR=Zh(),_K=Ce(),EK=UE(),AK=$l();function wK(r){if(r instanceof Ka.Observable)return r;if(r!=null){if(gK.isInteropObservable(r))return vR(r);if(pK.isArrayLike(r))return bR(r);if(mK.isPromise(r))return _R(r);if(yK.isAsyncIterable(r))return u1(r);if(bK.isIterable(r))return ER(r);if(yR.isReadableStreamLike(r))return AR(r)}throw vK.createInvalidObservableTypeError(r)}Ue.innerFrom=wK;function vR(r){return new Ka.Observable(function(e){var t=r[AK.observable]();if(_K.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}Ue.fromInteropObservable=vR;function bR(r){return new Ka.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}Ue.fromArrayLike=bR;function _R(r){return new Ka.Observable(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,EK.reportUnhandledError)})}Ue.fromPromise=_R;function ER(r){return new Ka.Observable(function(e){var t,n;try{for(var i=l1(r),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}Ue.fromIterable=ER;function u1(r){return new Ka.Observable(function(e){SK(r,e).catch(function(t){return e.error(t)})})}Ue.fromAsyncIterable=u1;function AR(r){return u1(yR.readableStreamLikeToAsyncGenerator(r))}Ue.fromReadableStreamLike=AR;function SK(r,e){var t,n,i,s;return dK(this,void 0,void 0,function(){var o,a;return fK(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=hK(r),c.label=1;case 1:return[4,t.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}});var Qn=g(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.executeSchedule=void 0;function TK(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}Xh.executeSchedule=TK});var nu=g(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.observeOn=void 0;var d1=Qn(),CK=K(),xK=te();function OK(r,e){return e===void 0&&(e=0),CK.operate(function(t,n){t.subscribe(xK.createOperatorSubscriber(n,function(i){return d1.executeSchedule(n,r,function(){return n.next(i)},e)},function(){return d1.executeSchedule(n,r,function(){return n.complete()},e)},function(i){return d1.executeSchedule(n,r,function(){return n.error(i)},e)}))})}ep.observeOn=OK});var iu=g(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.subscribeOn=void 0;var IK=K();function PK(r,e){return e===void 0&&(e=0),IK.operate(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}tp.subscribeOn=PK});var wR=g(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.scheduleObservable=void 0;var kK=le(),RK=nu(),NK=iu();function MK(r,e){return kK.innerFrom(r).pipe(NK.subscribeOn(e),RK.observeOn(e))}rp.scheduleObservable=MK});var SR=g(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.schedulePromise=void 0;var DK=le(),LK=nu(),FK=iu();function qK(r,e){return DK.innerFrom(r).pipe(FK.subscribeOn(e),LK.observeOn(e))}np.schedulePromise=qK});var TR=g(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.scheduleArray=void 0;var BK=ke();function UK(r,e){return new BK.Observable(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}ip.scheduleArray=UK});var f1=g(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.scheduleIterable=void 0;var jK=ke(),zK=a1(),HK=Ce(),CR=Qn();function GK(r,e){return new jK.Observable(function(t){var n;return CR.executeSchedule(t,e,function(){n=r[zK.iterator](),CR.executeSchedule(t,e,function(){var i,s,o;try{i=n.next(),s=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(s)},0,!0)}),function(){return HK.isFunction(n?.return)&&n.return()}})}sp.scheduleIterable=GK});var h1=g(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.scheduleAsyncIterable=void 0;var VK=ke(),xR=Qn();function WK(r,e){if(!r)throw new Error("Iterable cannot be null");return new VK.Observable(function(t){xR.executeSchedule(t,e,function(){var n=r[Symbol.asyncIterator]();xR.executeSchedule(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}op.scheduleAsyncIterable=WK});var OR=g(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.scheduleReadableStreamLike=void 0;var KK=h1(),JK=Zh();function QK(r,e){return KK.scheduleAsyncIterable(JK.readableStreamLikeToAsyncGenerator(r),e)}ap.scheduleReadableStreamLike=QK});var p1=g(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.scheduled=void 0;var YK=wR(),$K=SR(),ZK=TR(),XK=f1(),eJ=h1(),tJ=i1(),rJ=n1(),nJ=Wh(),iJ=c1(),sJ=s1(),oJ=o1(),aJ=Zh(),cJ=OR();function lJ(r,e){if(r!=null){if(tJ.isInteropObservable(r))return YK.scheduleObservable(r,e);if(nJ.isArrayLike(r))return ZK.scheduleArray(r,e);if(rJ.isPromise(r))return $K.schedulePromise(r,e);if(sJ.isAsyncIterable(r))return eJ.scheduleAsyncIterable(r,e);if(iJ.isIterable(r))return XK.scheduleIterable(r,e);if(aJ.isReadableStreamLike(r))return cJ.scheduleReadableStreamLike(r,e)}throw oJ.createInvalidObservableTypeError(r)}cp.scheduled=lJ});var Yn=g(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.from=void 0;var uJ=p1(),dJ=le();function fJ(r,e){return e?uJ.scheduled(r,e):dJ.innerFrom(r)}lp.from=fJ});var dp=g(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.of=void 0;var hJ=tr(),pJ=Yn();function mJ(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=hJ.popScheduler(r);return pJ.from(r,t)}up.of=mJ});var m1=g(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.throwError=void 0;var gJ=ke(),yJ=Ce();function vJ(r,e){var t=yJ.isFunction(r)?r:function(){return r},n=function(i){return i.error(t())};return new gJ.Observable(e?function(i){return e.schedule(n,0,i)}:n)}fp.throwError=vJ});var hp=g($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.observeNotification=$n.Notification=$n.NotificationKind=void 0;var bJ=Hr(),_J=dp(),EJ=m1(),AJ=Ce(),wJ;(function(r){r.NEXT="N",r.ERROR="E",r.COMPLETE="C"})(wJ=$n.NotificationKind||($n.NotificationKind={}));var SJ=function(){function r(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e==="N"}return r.prototype.observe=function(e){return IR(this,e)},r.prototype.do=function(e,t,n){var i=this,s=i.kind,o=i.value,a=i.error;return s==="N"?e?.(o):s==="E"?t?.(a):n?.()},r.prototype.accept=function(e,t,n){var i;return AJ.isFunction((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,t,n)},r.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,i=e.error,s=t==="N"?_J.of(n):t==="E"?EJ.throwError(function(){return i}):t==="C"?bJ.EMPTY:0;if(!s)throw new TypeError("Unexpected notification kind "+t);return s},r.createNext=function(e){return new r("N",e)},r.createError=function(e){return new r("E",void 0,e)},r.createComplete=function(){return r.completeNotification},r.completeNotification=new r("C"),r}();$n.Notification=SJ;function IR(r,e){var t,n,i,s=r,o=s.kind,a=s.value,c=s.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(t=e.next)===null||t===void 0||t.call(e,a):o==="E"?(n=e.error)===null||n===void 0||n.call(e,c):(i=e.complete)===null||i===void 0||i.call(e)}$n.observeNotification=IR});var kR=g(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.isObservable=void 0;var TJ=ke(),PR=Ce();function CJ(r){return!!r&&(r instanceof TJ.Observable||PR.isFunction(r.lift)&&PR.isFunction(r.subscribe))}pp.isObservable=CJ});var Bi=g(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.EmptyError=void 0;var xJ=Di();mp.EmptyError=xJ.createErrorClass(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}})});var RR=g(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.lastValueFrom=void 0;var OJ=Bi();function IJ(r,e){var t=typeof e=="object";return new Promise(function(n,i){var s=!1,o;r.subscribe({next:function(a){o=a,s=!0},error:i,complete:function(){s?n(o):t?n(e.defaultValue):i(new OJ.EmptyError)}})})}gp.lastValueFrom=IJ});var NR=g(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.firstValueFrom=void 0;var PJ=Bi(),kJ=Ca();function RJ(r,e){var t=typeof e=="object";return new Promise(function(n,i){var s=new kJ.SafeSubscriber({next:function(o){n(o),s.unsubscribe()},error:i,complete:function(){t?n(e.defaultValue):i(new PJ.EmptyError)}});r.subscribe(s)})}yp.firstValueFrom=RJ});var g1=g(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.ArgumentOutOfRangeError=void 0;var NJ=Di();vp.ArgumentOutOfRangeError=NJ.createErrorClass(function(r){return function(){r(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var y1=g(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.NotFoundError=void 0;var MJ=Di();bp.NotFoundError=MJ.createErrorClass(function(r){return function(t){r(this),this.name="NotFoundError",this.message=t}})});var v1=g(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.SequenceError=void 0;var DJ=Di();_p.SequenceError=DJ.createErrorClass(function(r){return function(t){r(this),this.name="SequenceError",this.message=t}})});var Ap=g(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.isValidDate=void 0;function LJ(r){return r instanceof Date&&!isNaN(r)}Ep.isValidDate=LJ});var wp=g(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.timeout=co.TimeoutError=void 0;var FJ=er(),qJ=Ap(),BJ=K(),UJ=le(),jJ=Di(),zJ=te(),HJ=Qn();co.TimeoutError=jJ.createErrorClass(function(r){return function(t){t===void 0&&(t=null),r(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function GJ(r,e){var t=qJ.isValidDate(r)?{first:r}:typeof r=="number"?{each:r}:r,n=t.first,i=t.each,s=t.with,o=s===void 0?VJ:s,a=t.scheduler,c=a===void 0?e??FJ.asyncScheduler:a,l=t.meta,u=l===void 0?null:l;if(n==null&&i==null)throw new TypeError("No timeout provided.");return BJ.operate(function(d,f){var h,m,p=null,y=0,b=function(E){m=HJ.executeSchedule(f,c,function(){try{h.unsubscribe(),UJ.innerFrom(o({meta:u,lastValue:p,seen:y})).subscribe(f)}catch(x){f.error(x)}},E)};h=d.subscribe(zJ.createOperatorSubscriber(f,function(E){m?.unsubscribe(),y++,f.next(p=E),i>0&&b(i)},void 0,void 0,function(){m?.closed||m?.unsubscribe(),p=null})),!y&&b(n!=null?typeof n=="number"?n:+n-c.now():i)})}co.timeout=GJ;function VJ(r){throw new co.TimeoutError(r)}});var Ui=g(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.map=void 0;var WJ=K(),KJ=te();function JJ(r,e){return WJ.operate(function(t,n){var i=0;t.subscribe(KJ.createOperatorSubscriber(n,function(s){n.next(r.call(e,s,i++))}))})}Sp.map=JJ});var zi=g(ji=>{"use strict";var QJ=ji&&ji.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},YJ=ji&&ji.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(ji,"__esModule",{value:!0});ji.mapOneOrManyArgs=void 0;var $J=Ui(),ZJ=Array.isArray;function XJ(r,e){return ZJ(e)?r.apply(void 0,YJ([],QJ(e))):r(e)}function eQ(r){return $J.map(function(e){return XJ(r,e)})}ji.mapOneOrManyArgs=eQ});var _1=g(Hi=>{"use strict";var tQ=Hi&&Hi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},MR=Hi&&Hi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.bindCallbackInternals=void 0;var rQ=ru(),nQ=ke(),iQ=iu(),sQ=zi(),oQ=nu(),aQ=jh();function b1(r,e,t,n){if(t)if(rQ.isScheduler(t))n=t;else return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return b1(r,e,n).apply(this,i).pipe(sQ.mapOneOrManyArgs(t))};return n?function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return b1(r,e).apply(this,i).pipe(iQ.subscribeOn(n),oQ.observeOn(n))}:function(){for(var i=this,s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var a=new aQ.AsyncSubject,c=!0;return new nQ.Observable(function(l){var u=a.subscribe(l);if(c){c=!1;var d=!1,f=!1;e.apply(i,MR(MR([],tQ(s)),[function(){for(var h=[],m=0;m<arguments.length;m++)h[m]=arguments[m];if(r){var p=h.shift();if(p!=null){a.error(p);return}}a.next(1<h.length?h:h[0]),f=!0,d&&a.complete()}])),f&&a.complete(),d=!0}return u})}}Hi.bindCallbackInternals=b1});var DR=g(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});Tp.bindCallback=void 0;var cQ=_1();function lQ(r,e,t){return cQ.bindCallbackInternals(!1,r,e,t)}Tp.bindCallback=lQ});var LR=g(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.bindNodeCallback=void 0;var uQ=_1();function dQ(r,e,t){return uQ.bindCallbackInternals(!0,r,e,t)}Cp.bindNodeCallback=dQ});var E1=g(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.argsArgArrayOrObject=void 0;var fQ=Array.isArray,hQ=Object.getPrototypeOf,pQ=Object.prototype,mQ=Object.keys;function gQ(r){if(r.length===1){var e=r[0];if(fQ(e))return{args:e,keys:null};if(yQ(e)){var t=mQ(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:r,keys:null}}xp.argsArgArrayOrObject=gQ;function yQ(r){return r&&typeof r=="object"&&hQ(r)===pQ}});var A1=g(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.createObject=void 0;function vQ(r,e){return r.reduce(function(t,n,i){return t[n]=e[i],t},{})}Op.createObject=vQ});var Ip=g(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.combineLatestInit=Ja.combineLatest=void 0;var bQ=ke(),_Q=E1(),BR=Yn(),UR=At(),EQ=zi(),FR=tr(),AQ=A1(),wQ=te(),SQ=Qn();function TQ(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=FR.popScheduler(r),n=FR.popResultSelector(r),i=_Q.argsArgArrayOrObject(r),s=i.args,o=i.keys;if(s.length===0)return BR.from([],t);var a=new bQ.Observable(jR(s,t,o?function(c){return AQ.createObject(o,c)}:UR.identity));return n?a.pipe(EQ.mapOneOrManyArgs(n)):a}Ja.combineLatest=TQ;function jR(r,e,t){return t===void 0&&(t=UR.identity),function(n){qR(e,function(){for(var i=r.length,s=new Array(i),o=i,a=i,c=function(u){qR(e,function(){var d=BR.from(r[u],e),f=!1;d.subscribe(wQ.createOperatorSubscriber(n,function(h){s[u]=h,f||(f=!0,a--),a||n.next(t(s.slice()))},function(){--o||n.complete()}))},n)},l=0;l<i;l++)c(l)},n)}}Ja.combineLatestInit=jR;function qR(r,e,t){r?SQ.executeSchedule(t,r,e):e()}});var kp=g(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.mergeInternals=void 0;var CQ=le(),xQ=Qn(),zR=te();function OQ(r,e,t,n,i,s,o,a){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&e.complete()},h=function(p){return l<n?m(p):c.push(p)},m=function(p){s&&e.next(p),l++;var y=!1;CQ.innerFrom(t(p,u++)).subscribe(zR.createOperatorSubscriber(e,function(b){i?.(b),s?h(b):e.next(b)},function(){y=!0},void 0,function(){if(y)try{l--;for(var b=function(){var E=c.shift();o?xQ.executeSchedule(e,o,function(){return m(E)}):m(E)};c.length&&l<n;)b();f()}catch(E){e.error(E)}}))};return r.subscribe(zR.createOperatorSubscriber(e,h,function(){d=!0,f()})),function(){a?.()}}Pp.mergeInternals=OQ});var Zn=g(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.mergeMap=void 0;var IQ=Ui(),PQ=le(),kQ=K(),RQ=kp(),NQ=Ce();function HR(r,e,t){return t===void 0&&(t=1/0),NQ.isFunction(e)?HR(function(n,i){return IQ.map(function(s,o){return e(n,s,i,o)})(PQ.innerFrom(r(n,i)))},t):(typeof e=="number"&&(t=e),kQ.operate(function(n,i){return RQ.mergeInternals(n,i,r,t)}))}Rp.mergeMap=HR});var su=g(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.mergeAll=void 0;var MQ=Zn(),DQ=At();function LQ(r){return r===void 0&&(r=1/0),MQ.mergeMap(DQ.identity,r)}Np.mergeAll=LQ});var Dp=g(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.concatAll=void 0;var FQ=su();function qQ(){return FQ.mergeAll(1)}Mp.concatAll=qQ});var ou=g(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.concat=void 0;var BQ=Dp(),UQ=tr(),jQ=Yn();function zQ(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return BQ.concatAll()(jQ.from(r,UQ.popScheduler(r)))}Lp.concat=zQ});var au=g(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.defer=void 0;var HQ=ke(),GQ=le();function VQ(r){return new HQ.Observable(function(e){GQ.innerFrom(r()).subscribe(e)})}Fp.defer=VQ});var GR=g(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.connectable=void 0;var WQ=wt(),KQ=ke(),JQ=au(),QQ={connector:function(){return new WQ.Subject},resetOnDisconnect:!0};function YQ(r,e){e===void 0&&(e=QQ);var t=null,n=e.connector,i=e.resetOnDisconnect,s=i===void 0?!0:i,o=n(),a=new KQ.Observable(function(c){return o.subscribe(c)});return a.connect=function(){return(!t||t.closed)&&(t=JQ.defer(function(){return r}).subscribe(o),s&&t.add(function(){return o=n()})),t},a}qp.connectable=YQ});var VR=g(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.forkJoin=void 0;var $Q=ke(),ZQ=E1(),XQ=le(),eY=tr(),tY=te(),rY=zi(),nY=A1();function iY(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=eY.popResultSelector(r),n=ZQ.argsArgArrayOrObject(r),i=n.args,s=n.keys,o=new $Q.Observable(function(a){var c=i.length;if(!c){a.complete();return}for(var l=new Array(c),u=c,d=c,f=function(m){var p=!1;XQ.innerFrom(i[m]).subscribe(tY.createOperatorSubscriber(a,function(y){p||(p=!0,d--),l[m]=y},function(){return u--},void 0,function(){(!u||!p)&&(d||a.next(s?nY.createObject(s,l):l),a.complete())}))},h=0;h<c;h++)f(h)});return t?o.pipe(rY.mapOneOrManyArgs(t)):o}Bp.forkJoin=iY});var KR=g(Qa=>{"use strict";var sY=Qa&&Qa.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s};Object.defineProperty(Qa,"__esModule",{value:!0});Qa.fromEvent=void 0;var oY=le(),aY=ke(),cY=Zn(),lY=Wh(),lo=Ce(),uY=zi(),dY=["addListener","removeListener"],fY=["addEventListener","removeEventListener"],hY=["on","off"];function w1(r,e,t,n){if(lo.isFunction(t)&&(n=t,t=void 0),n)return w1(r,e,t).pipe(uY.mapOneOrManyArgs(n));var i=sY(gY(r)?fY.map(function(a){return function(c){return r[a](e,c,t)}}):pY(r)?dY.map(WR(r,e)):mY(r)?hY.map(WR(r,e)):[],2),s=i[0],o=i[1];if(!s&&lY.isArrayLike(r))return cY.mergeMap(function(a){return w1(a,e,t)})(oY.innerFrom(r));if(!s)throw new TypeError("Invalid event target");return new aY.Observable(function(a){var c=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return a.next(1<l.length?l:l[0])};return s(c),function(){return o(c)}})}Qa.fromEvent=w1;function WR(r,e){return function(t){return function(n){return r[t](e,n)}}}function pY(r){return lo.isFunction(r.addListener)&&lo.isFunction(r.removeListener)}function mY(r){return lo.isFunction(r.on)&&lo.isFunction(r.off)}function gY(r){return lo.isFunction(r.addEventListener)&&lo.isFunction(r.removeEventListener)}});var QR=g(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.fromEventPattern=void 0;var yY=ke(),vY=Ce(),bY=zi();function JR(r,e,t){return t?JR(r,e).pipe(bY.mapOneOrManyArgs(t)):new yY.Observable(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},s=r(i);return vY.isFunction(e)?function(){return e(i,s)}:void 0})}Up.fromEventPattern=JR});var $R=g(Ya=>{"use strict";var _Y=Ya&&Ya.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.generate=void 0;var YR=At(),EY=ru(),AY=au(),wY=f1();function SY(r,e,t,n,i){var s,o,a,c;arguments.length===1?(s=r,c=s.initialState,e=s.condition,t=s.iterate,o=s.resultSelector,a=o===void 0?YR.identity:o,i=s.scheduler):(c=r,!n||EY.isScheduler(n)?(a=YR.identity,i=n):a=n);function l(){var u;return _Y(this,function(d){switch(d.label){case 0:u=c,d.label=1;case 1:return!e||e(u)?[4,a(u)]:[3,4];case 2:d.sent(),d.label=3;case 3:return u=t(u),[3,1];case 4:return[2]}})}return AY.defer(i?function(){return wY.scheduleIterable(l(),i)}:l)}Ya.generate=SY});var ZR=g(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.iif=void 0;var TY=au();function CY(r,e,t){return TY.defer(function(){return r()?e:t})}jp.iif=CY});var Gi=g(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.timer=void 0;var xY=ke(),OY=er(),IY=ru(),PY=Ap();function kY(r,e,t){r===void 0&&(r=0),t===void 0&&(t=OY.async);var n=-1;return e!=null&&(IY.isScheduler(e)?t=e:n=e),new xY.Observable(function(i){var s=PY.isValidDate(r)?+r-t.now():r;s<0&&(s=0);var o=0;return t.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},s)})}zp.timer=kY});var S1=g(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.interval=void 0;var RY=er(),NY=Gi();function MY(r,e){return r===void 0&&(r=0),e===void 0&&(e=RY.asyncScheduler),r<0&&(r=0),NY.timer(r,r,e)}Hp.interval=MY});var eN=g(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.merge=void 0;var DY=su(),LY=le(),FY=Hr(),XR=tr(),qY=Yn();function BY(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=XR.popScheduler(r),n=XR.popNumber(r,1/0),i=r;return i.length?i.length===1?LY.innerFrom(i[0]):DY.mergeAll(n)(qY.from(i,t)):FY.EMPTY}Gp.merge=BY});var T1=g(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.never=uo.NEVER=void 0;var UY=ke(),jY=Et();uo.NEVER=new UY.Observable(jY.noop);function zY(){return uo.NEVER}uo.never=zY});var fo=g(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.argsOrArgArray=void 0;var HY=Array.isArray;function GY(r){return r.length===1&&HY(r[0])?r[0]:r}Vp.argsOrArgArray=GY});var C1=g(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.onErrorResumeNext=void 0;var VY=ke(),WY=fo(),KY=te(),tN=Et(),JY=le();function QY(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=WY.argsOrArgArray(r);return new VY.Observable(function(n){var i=0,s=function(){if(i<t.length){var o=void 0;try{o=JY.innerFrom(t[i++])}catch{s();return}var a=new KY.OperatorSubscriber(n,void 0,tN.noop,tN.noop);o.subscribe(a),a.add(s)}else n.complete()};s()})}Wp.onErrorResumeNext=QY});var rN=g(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.pairs=void 0;var YY=Yn();function $Y(r,e){return YY.from(Object.entries(r),e)}Kp.pairs=$Y});var nN=g(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.not=void 0;function ZY(r,e){return function(t,n){return!r.call(e,t,n)}}Jp.not=ZY});var ho=g(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.filter=void 0;var XY=K(),e$=te();function t$(r,e){return XY.operate(function(t,n){var i=0;t.subscribe(e$.createOperatorSubscriber(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}Qp.filter=t$});var oN=g(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.partition=void 0;var r$=nN(),iN=ho(),sN=le();function n$(r,e,t){return[iN.filter(e,t)(sN.innerFrom(r)),iN.filter(r$.not(e,t))(sN.innerFrom(r))]}Yp.partition=n$});var x1=g($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.raceInit=$a.race=void 0;var i$=ke(),aN=le(),s$=fo(),o$=te();function a$(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r=s$.argsOrArgArray(r),r.length===1?aN.innerFrom(r[0]):new i$.Observable(cN(r))}$a.race=a$;function cN(r){return function(e){for(var t=[],n=function(s){t.push(aN.innerFrom(r[s]).subscribe(o$.createOperatorSubscriber(e,function(o){if(t){for(var a=0;a<t.length;a++)a!==s&&t[a].unsubscribe();t=null}e.next(o)})))},i=0;t&&!e.closed&&i<r.length;i++)n(i)}}$a.raceInit=cN});var lN=g($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.range=void 0;var c$=ke(),l$=Hr();function u$(r,e,t){if(e==null&&(e=r,r=0),e<=0)return l$.EMPTY;var n=e+r;return new c$.Observable(t?function(i){var s=r;return t.schedule(function(){s<n?(i.next(s++),this.schedule()):i.complete()})}:function(i){for(var s=r;s<n&&!i.closed;)i.next(s++);i.complete()})}$p.range=u$});var uN=g(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});Zp.using=void 0;var d$=ke(),f$=le(),h$=Hr();function p$(r,e){return new d$.Observable(function(t){var n=r(),i=e(n),s=i?f$.innerFrom(i):h$.EMPTY;return s.subscribe(t),function(){n&&n.unsubscribe()}})}Zp.using=p$});var Xp=g(Vi=>{"use strict";var m$=Vi&&Vi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},g$=Vi&&Vi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.zip=void 0;var y$=ke(),v$=le(),b$=fo(),_$=Hr(),E$=te(),A$=tr();function w$(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=A$.popResultSelector(r),n=b$.argsOrArgArray(r);return n.length?new y$.Observable(function(i){var s=n.map(function(){return[]}),o=n.map(function(){return!1});i.add(function(){s=o=null});for(var a=function(l){v$.innerFrom(n[l]).subscribe(E$.createOperatorSubscriber(i,function(u){if(s[l].push(u),s.every(function(f){return f.length})){var d=s.map(function(f){return f.shift()});i.next(t?t.apply(void 0,g$([],m$(d))):d),s.some(function(f,h){return!f.length&&o[h]})&&i.complete()}},function(){o[l]=!0,!s[l].length&&i.complete()}))},c=0;!i.closed&&c<n.length;c++)a(c);return function(){s=o=null}}):_$.EMPTY}Vi.zip=w$});var fN=g(dN=>{"use strict";Object.defineProperty(dN,"__esModule",{value:!0})});var O1=g(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.audit=void 0;var S$=K(),T$=le(),hN=te();function C$(r){return S$.operate(function(e,t){var n=!1,i=null,s=null,o=!1,a=function(){if(s?.unsubscribe(),s=null,n){n=!1;var l=i;i=null,t.next(l)}o&&t.complete()},c=function(){s=null,o&&t.complete()};e.subscribe(hN.createOperatorSubscriber(t,function(l){n=!0,i=l,s||T$.innerFrom(r(l)).subscribe(s=hN.createOperatorSubscriber(t,a,c))},function(){o=!0,(!n||!s||s.closed)&&t.complete()}))})}e0.audit=C$});var pN=g(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.auditTime=void 0;var x$=er(),O$=O1(),I$=Gi();function P$(r,e){return e===void 0&&(e=x$.asyncScheduler),O$.audit(function(){return I$.timer(r,e)})}t0.auditTime=P$});var gN=g(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.buffer=void 0;var k$=K(),R$=Et(),mN=te(),N$=le();function M$(r){return k$.operate(function(e,t){var n=[];return e.subscribe(mN.createOperatorSubscriber(t,function(i){return n.push(i)},function(){t.next(n),t.complete()})),N$.innerFrom(r).subscribe(mN.createOperatorSubscriber(t,function(){var i=n;n=[],t.next(i)},R$.noop)),function(){n=null}})}r0.buffer=M$});var yN=g(Za=>{"use strict";var I1=Za&&Za.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Za,"__esModule",{value:!0});Za.bufferCount=void 0;var D$=K(),L$=te(),F$=Jn();function q$(r,e){return e===void 0&&(e=null),e=e??r,D$.operate(function(t,n){var i=[],s=0;t.subscribe(L$.createOperatorSubscriber(n,function(o){var a,c,l,u,d=null;s++%e===0&&i.push([]);try{for(var f=I1(i),h=f.next();!h.done;h=f.next()){var m=h.value;m.push(o),r<=m.length&&(d=d??[],d.push(m))}}catch(b){a={error:b}}finally{try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error}}if(d)try{for(var p=I1(d),y=p.next();!y.done;y=p.next()){var m=y.value;F$.arrRemove(i,m),n.next(m)}}catch(b){l={error:b}}finally{try{y&&!y.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}},function(){var o,a;try{for(var c=I1(i),l=c.next();!l.done;l=c.next()){var u=l.value;n.next(u)}}catch(d){o={error:d}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}n.complete()},void 0,function(){i=null}))})}Za.bufferCount=q$});var bN=g(Xa=>{"use strict";var B$=Xa&&Xa.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Xa,"__esModule",{value:!0});Xa.bufferTime=void 0;var U$=fr(),j$=K(),z$=te(),H$=Jn(),G$=er(),V$=tr(),vN=Qn();function W$(r){for(var e,t,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=(e=V$.popScheduler(n))!==null&&e!==void 0?e:G$.asyncScheduler,o=(t=n[0])!==null&&t!==void 0?t:null,a=n[1]||1/0;return j$.operate(function(c,l){var u=[],d=!1,f=function(p){var y=p.buffer,b=p.subs;b.unsubscribe(),H$.arrRemove(u,p),l.next(y),d&&h()},h=function(){if(u){var p=new U$.Subscription;l.add(p);var y=[],b={buffer:y,subs:p};u.push(b),vN.executeSchedule(p,s,function(){return f(b)},r)}};o!==null&&o>=0?vN.executeSchedule(l,s,h,o,!0):d=!0,h();var m=z$.createOperatorSubscriber(l,function(p){var y,b,E=u.slice();try{for(var x=B$(E),S=x.next();!S.done;S=x.next()){var M=S.value,I=M.buffer;I.push(p),a<=I.length&&f(M)}}catch(B){y={error:B}}finally{try{S&&!S.done&&(b=x.return)&&b.call(x)}finally{if(y)throw y.error}}},function(){for(;u?.length;)l.next(u.shift().buffer);m?.unsubscribe(),l.complete(),l.unsubscribe()},void 0,function(){return u=null});c.subscribe(m)})}Xa.bufferTime=W$});var AN=g(ec=>{"use strict";var K$=ec&&ec.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ec,"__esModule",{value:!0});ec.bufferToggle=void 0;var J$=fr(),Q$=K(),_N=le(),P1=te(),EN=Et(),Y$=Jn();function $$(r,e){return Q$.operate(function(t,n){var i=[];_N.innerFrom(r).subscribe(P1.createOperatorSubscriber(n,function(s){var o=[];i.push(o);var a=new J$.Subscription,c=function(){Y$.arrRemove(i,o),n.next(o),a.unsubscribe()};a.add(_N.innerFrom(e(s)).subscribe(P1.createOperatorSubscriber(n,c,EN.noop)))},EN.noop)),t.subscribe(P1.createOperatorSubscriber(n,function(s){var o,a;try{for(var c=K$(i),l=c.next();!l.done;l=c.next()){var u=l.value;u.push(s)}}catch(d){o={error:d}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}ec.bufferToggle=$$});var SN=g(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.bufferWhen=void 0;var Z$=K(),X$=Et(),wN=te(),eZ=le();function tZ(r){return Z$.operate(function(e,t){var n=null,i=null,s=function(){i?.unsubscribe();var o=n;n=[],o&&t.next(o),eZ.innerFrom(r()).subscribe(i=wN.createOperatorSubscriber(t,s,X$.noop))};s(),e.subscribe(wN.createOperatorSubscriber(t,function(o){return n?.push(o)},function(){n&&t.next(n),t.complete()},void 0,function(){return n=i=null}))})}n0.bufferWhen=tZ});var CN=g(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.catchError=void 0;var rZ=le(),nZ=te(),iZ=K();function TN(r){return iZ.operate(function(e,t){var n=null,i=!1,s;n=e.subscribe(nZ.createOperatorSubscriber(t,void 0,void 0,function(o){s=rZ.innerFrom(r(o,TN(r)(e))),n?(n.unsubscribe(),n=null,s.subscribe(t)):i=!0})),i&&(n.unsubscribe(),n=null,s.subscribe(t))})}i0.catchError=TN});var k1=g(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.scanInternals=void 0;var sZ=te();function oZ(r,e,t,n,i){return function(s,o){var a=t,c=e,l=0;s.subscribe(sZ.createOperatorSubscriber(o,function(u){var d=l++;c=a?r(c,u,d):(a=!0,u),n&&o.next(c)},i&&function(){a&&o.next(c),o.complete()}))}}s0.scanInternals=oZ});var tc=g(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.reduce=void 0;var aZ=k1(),cZ=K();function lZ(r,e){return cZ.operate(aZ.scanInternals(r,e,arguments.length>=2,!1,!0))}o0.reduce=lZ});var R1=g(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.toArray=void 0;var uZ=tc(),dZ=K(),fZ=function(r,e){return r.push(e),r};function hZ(){return dZ.operate(function(r,e){uZ.reduce(fZ,[])(r).subscribe(e)})}a0.toArray=hZ});var N1=g(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});c0.joinAllInternals=void 0;var pZ=At(),mZ=zi(),gZ=Zl(),yZ=Zn(),vZ=R1();function bZ(r,e){return gZ.pipe(vZ.toArray(),yZ.mergeMap(function(t){return r(t)}),e?mZ.mapOneOrManyArgs(e):pZ.identity)}c0.joinAllInternals=bZ});var M1=g(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});l0.combineLatestAll=void 0;var _Z=Ip(),EZ=N1();function AZ(r){return EZ.joinAllInternals(_Z.combineLatest,r)}l0.combineLatestAll=AZ});var xN=g(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});u0.combineAll=void 0;var wZ=M1();u0.combineAll=wZ.combineLatestAll});var kN=g(Wi=>{"use strict";var ON=Wi&&Wi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},IN=Wi&&Wi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.combineLatest=void 0;var SZ=Ip(),TZ=K(),CZ=fo(),xZ=zi(),OZ=Zl(),IZ=tr();function PN(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=IZ.popResultSelector(r);return t?OZ.pipe(PN.apply(void 0,IN([],ON(r))),xZ.mapOneOrManyArgs(t)):TZ.operate(function(n,i){SZ.combineLatestInit(IN([n],ON(CZ.argsOrArgArray(r))))(i)})}Wi.combineLatest=PN});var RN=g(Ki=>{"use strict";var PZ=Ki&&Ki.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},kZ=Ki&&Ki.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.combineLatestWith=void 0;var RZ=kN();function NZ(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return RZ.combineLatest.apply(void 0,kZ([],PZ(r)))}Ki.combineLatestWith=NZ});var D1=g(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});d0.concatMap=void 0;var NN=Zn(),MZ=Ce();function DZ(r,e){return MZ.isFunction(e)?NN.mergeMap(r,e,1):NN.mergeMap(r,1)}d0.concatMap=DZ});var DN=g(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.concatMapTo=void 0;var MN=D1(),LZ=Ce();function FZ(r,e){return LZ.isFunction(e)?MN.concatMap(function(){return r},e):MN.concatMap(function(){return r})}f0.concatMapTo=FZ});var LN=g(Ji=>{"use strict";var qZ=Ji&&Ji.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},BZ=Ji&&Ji.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.concat=void 0;var UZ=K(),jZ=Dp(),zZ=tr(),HZ=Yn();function GZ(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=zZ.popScheduler(r);return UZ.operate(function(n,i){jZ.concatAll()(HZ.from(BZ([n],qZ(r)),t)).subscribe(i)})}Ji.concat=GZ});var FN=g(Qi=>{"use strict";var VZ=Qi&&Qi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},WZ=Qi&&Qi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.concatWith=void 0;var KZ=LN();function JZ(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return KZ.concat.apply(void 0,WZ([],VZ(r)))}Qi.concatWith=JZ});var qN=g(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});h0.fromSubscribable=void 0;var QZ=ke();function YZ(r){return new QZ.Observable(function(e){return r.subscribe(e)})}h0.fromSubscribable=YZ});var m0=g(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});p0.connect=void 0;var $Z=wt(),ZZ=le(),XZ=K(),eX=qN(),tX={connector:function(){return new $Z.Subject}};function rX(r,e){e===void 0&&(e=tX);var t=e.connector;return XZ.operate(function(n,i){var s=t();ZZ.innerFrom(r(eX.fromSubscribable(s))).subscribe(i),i.add(n.subscribe(s))})}p0.connect=rX});var BN=g(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});g0.count=void 0;var nX=tc();function iX(r){return nX.reduce(function(e,t,n){return!r||r(t,n)?e+1:e},0)}g0.count=iX});var jN=g(y0=>{"use strict";Object.defineProperty(y0,"__esModule",{value:!0});y0.debounce=void 0;var sX=K(),oX=Et(),UN=te(),aX=le();function cX(r){return sX.operate(function(e,t){var n=!1,i=null,s=null,o=function(){if(s?.unsubscribe(),s=null,n){n=!1;var a=i;i=null,t.next(a)}};e.subscribe(UN.createOperatorSubscriber(t,function(a){s?.unsubscribe(),n=!0,i=a,s=UN.createOperatorSubscriber(t,o,oX.noop),aX.innerFrom(r(a)).subscribe(s)},function(){o(),t.complete()},void 0,function(){i=s=null}))})}y0.debounce=cX});var zN=g(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});v0.debounceTime=void 0;var lX=er(),uX=K(),dX=te();function fX(r,e){return e===void 0&&(e=lX.asyncScheduler),uX.operate(function(t,n){var i=null,s=null,o=null,a=function(){if(i){i.unsubscribe(),i=null;var l=s;s=null,n.next(l)}};function c(){var l=o+r,u=e.now();if(u<l){i=this.schedule(void 0,l-u),n.add(i);return}a()}t.subscribe(dX.createOperatorSubscriber(n,function(l){s=l,o=e.now(),i||(i=e.schedule(c,r),n.add(i))},function(){a(),n.complete()},void 0,function(){s=i=null}))})}v0.debounceTime=fX});var cu=g(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});b0.defaultIfEmpty=void 0;var hX=K(),pX=te();function mX(r){return hX.operate(function(e,t){var n=!1;e.subscribe(pX.createOperatorSubscriber(t,function(i){n=!0,t.next(i)},function(){n||t.next(r),t.complete()}))})}b0.defaultIfEmpty=mX});var lu=g(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.take=void 0;var gX=Hr(),yX=K(),vX=te();function bX(r){return r<=0?function(){return gX.EMPTY}:yX.operate(function(e,t){var n=0;e.subscribe(vX.createOperatorSubscriber(t,function(i){++n<=r&&(t.next(i),r<=n&&t.complete())}))})}_0.take=bX});var L1=g(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.ignoreElements=void 0;var _X=K(),EX=te(),AX=Et();function wX(){return _X.operate(function(r,e){r.subscribe(EX.createOperatorSubscriber(e,AX.noop))})}E0.ignoreElements=wX});var F1=g(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});A0.mapTo=void 0;var SX=Ui();function TX(r){return SX.map(function(){return r})}A0.mapTo=TX});var q1=g(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.delayWhen=void 0;var CX=ou(),HN=lu(),xX=L1(),OX=F1(),IX=Zn(),PX=le();function GN(r,e){return e?function(t){return CX.concat(e.pipe(HN.take(1),xX.ignoreElements()),t.pipe(GN(r)))}:IX.mergeMap(function(t,n){return PX.innerFrom(r(t,n)).pipe(HN.take(1),OX.mapTo(t))})}w0.delayWhen=GN});var VN=g(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});S0.delay=void 0;var kX=er(),RX=q1(),NX=Gi();function MX(r,e){e===void 0&&(e=kX.asyncScheduler);var t=NX.timer(r,e);return RX.delayWhen(function(){return t})}S0.delay=MX});var WN=g(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});T0.dematerialize=void 0;var DX=hp(),LX=K(),FX=te();function qX(){return LX.operate(function(r,e){r.subscribe(FX.createOperatorSubscriber(e,function(t){return DX.observeNotification(t,e)}))})}T0.dematerialize=qX});var JN=g(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});C0.distinct=void 0;var BX=K(),KN=te(),UX=Et(),jX=le();function zX(r,e){return BX.operate(function(t,n){var i=new Set;t.subscribe(KN.createOperatorSubscriber(n,function(s){var o=r?r(s):s;i.has(o)||(i.add(o),n.next(s))})),e&&jX.innerFrom(e).subscribe(KN.createOperatorSubscriber(n,function(){return i.clear()},UX.noop))})}C0.distinct=zX});var B1=g(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});x0.distinctUntilChanged=void 0;var HX=At(),GX=K(),VX=te();function WX(r,e){return e===void 0&&(e=HX.identity),r=r??KX,GX.operate(function(t,n){var i,s=!0;t.subscribe(VX.createOperatorSubscriber(n,function(o){var a=e(o);(s||!r(i,a))&&(s=!1,i=a,n.next(o))}))})}x0.distinctUntilChanged=WX;function KX(r,e){return r===e}});var QN=g(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.distinctUntilKeyChanged=void 0;var JX=B1();function QX(r,e){return JX.distinctUntilChanged(function(t,n){return e?e(t[r],n[r]):t[r]===n[r]})}O0.distinctUntilKeyChanged=QX});var uu=g(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.throwIfEmpty=void 0;var YX=Bi(),$X=K(),ZX=te();function XX(r){return r===void 0&&(r=eee),$X.operate(function(e,t){var n=!1;e.subscribe(ZX.createOperatorSubscriber(t,function(i){n=!0,t.next(i)},function(){return n?t.complete():t.error(r())}))})}I0.throwIfEmpty=XX;function eee(){return new YX.EmptyError}});var $N=g(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.elementAt=void 0;var YN=g1(),tee=ho(),ree=uu(),nee=cu(),iee=lu();function see(r,e){if(r<0)throw new YN.ArgumentOutOfRangeError;var t=arguments.length>=2;return function(n){return n.pipe(tee.filter(function(i,s){return s===r}),iee.take(1),t?nee.defaultIfEmpty(e):ree.throwIfEmpty(function(){return new YN.ArgumentOutOfRangeError}))}}P0.elementAt=see});var ZN=g(Yi=>{"use strict";var oee=Yi&&Yi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},aee=Yi&&Yi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.endWith=void 0;var cee=ou(),lee=dp();function uee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return cee.concat(t,lee.of.apply(void 0,aee([],oee(r))))}}Yi.endWith=uee});var XN=g(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.every=void 0;var dee=K(),fee=te();function hee(r,e){return dee.operate(function(t,n){var i=0;t.subscribe(fee.createOperatorSubscriber(n,function(s){r.call(e,s,i++,t)||(n.next(!1),n.complete())},function(){n.next(!0),n.complete()}))})}k0.every=hee});var U1=g(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.exhaustMap=void 0;var pee=Ui(),e2=le(),mee=K(),t2=te();function r2(r,e){return e?function(t){return t.pipe(r2(function(n,i){return e2.innerFrom(r(n,i)).pipe(pee.map(function(s,o){return e(n,s,i,o)}))}))}:mee.operate(function(t,n){var i=0,s=null,o=!1;t.subscribe(t2.createOperatorSubscriber(n,function(a){s||(s=t2.createOperatorSubscriber(n,void 0,function(){s=null,o&&n.complete()}),e2.innerFrom(r(a,i++)).subscribe(s))},function(){o=!0,!s&&n.complete()}))})}R0.exhaustMap=r2});var j1=g(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});N0.exhaustAll=void 0;var gee=U1(),yee=At();function vee(){return gee.exhaustMap(yee.identity)}N0.exhaustAll=vee});var n2=g(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.exhaust=void 0;var bee=j1();M0.exhaust=bee.exhaustAll});var i2=g(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.expand=void 0;var _ee=K(),Eee=kp();function Aee(r,e,t){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,_ee.operate(function(n,i){return Eee.mergeInternals(n,i,r,e,void 0,!0,t)})}D0.expand=Aee});var s2=g(L0=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});L0.finalize=void 0;var wee=K();function See(r){return wee.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}L0.finalize=See});var z1=g(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.createFind=rc.find=void 0;var Tee=K(),Cee=te();function xee(r,e){return Tee.operate(o2(r,e,"value"))}rc.find=xee;function o2(r,e,t){var n=t==="index";return function(i,s){var o=0;i.subscribe(Cee.createOperatorSubscriber(s,function(a){var c=o++;r.call(e,a,c,i)&&(s.next(n?c:a),s.complete())},function(){s.next(n?-1:void 0),s.complete()}))}}rc.createFind=o2});var a2=g(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});F0.findIndex=void 0;var Oee=K(),Iee=z1();function Pee(r,e){return Oee.operate(Iee.createFind(r,e,"index"))}F0.findIndex=Pee});var c2=g(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});q0.first=void 0;var kee=Bi(),Ree=ho(),Nee=lu(),Mee=cu(),Dee=uu(),Lee=At();function Fee(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?Ree.filter(function(i,s){return r(i,s,n)}):Lee.identity,Nee.take(1),t?Mee.defaultIfEmpty(e):Dee.throwIfEmpty(function(){return new kee.EmptyError}))}}q0.first=Fee});var u2=g(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.groupBy=void 0;var qee=ke(),Bee=le(),Uee=wt(),jee=K(),l2=te();function zee(r,e,t,n){return jee.operate(function(i,s){var o;!e||typeof e=="function"?o=e:(t=e.duration,o=e.element,n=e.connector);var a=new Map,c=function(m){a.forEach(m),m(s)},l=function(m){return c(function(p){return p.error(m)})},u=0,d=!1,f=new l2.OperatorSubscriber(s,function(m){try{var p=r(m),y=a.get(p);if(!y){a.set(p,y=n?n():new Uee.Subject);var b=h(p,y);if(s.next(b),t){var E=l2.createOperatorSubscriber(y,function(){y.complete(),E?.unsubscribe()},void 0,void 0,function(){return a.delete(p)});f.add(Bee.innerFrom(t(b)).subscribe(E))}}y.next(o?o(m):m)}catch(x){l(x)}},function(){return c(function(m){return m.complete()})},l,function(){return a.clear()},function(){return d=!0,u===0});i.subscribe(f);function h(m,p){var y=new qee.Observable(function(b){u++;var E=p.subscribe(b);return function(){E.unsubscribe(),--u===0&&d&&f.unsubscribe()}});return y.key=m,y}})}B0.groupBy=zee});var d2=g(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.isEmpty=void 0;var Hee=K(),Gee=te();function Vee(){return Hee.operate(function(r,e){r.subscribe(Gee.createOperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}U0.isEmpty=Vee});var H1=g(nc=>{"use strict";var Wee=nc&&nc.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(nc,"__esModule",{value:!0});nc.takeLast=void 0;var Kee=Hr(),Jee=K(),Qee=te();function Yee(r){return r<=0?function(){return Kee.EMPTY}:Jee.operate(function(e,t){var n=[];e.subscribe(Qee.createOperatorSubscriber(t,function(i){n.push(i),r<n.length&&n.shift()},function(){var i,s;try{for(var o=Wee(n),a=o.next();!a.done;a=o.next()){var c=a.value;t.next(c)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}t.complete()},void 0,function(){n=null}))})}nc.takeLast=Yee});var f2=g(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.last=void 0;var $ee=Bi(),Zee=ho(),Xee=H1(),ete=uu(),tte=cu(),rte=At();function nte(r,e){var t=arguments.length>=2;return function(n){return n.pipe(r?Zee.filter(function(i,s){return r(i,s,n)}):rte.identity,Xee.takeLast(1),t?tte.defaultIfEmpty(e):ete.throwIfEmpty(function(){return new $ee.EmptyError}))}}j0.last=nte});var h2=g(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});z0.materialize=void 0;var G1=hp(),ite=K(),ste=te();function ote(){return ite.operate(function(r,e){r.subscribe(ste.createOperatorSubscriber(e,function(t){e.next(G1.Notification.createNext(t))},function(){e.next(G1.Notification.createComplete()),e.complete()},function(t){e.next(G1.Notification.createError(t)),e.complete()}))})}z0.materialize=ote});var p2=g(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.max=void 0;var ate=tc(),cte=Ce();function lte(r){return ate.reduce(cte.isFunction(r)?function(e,t){return r(e,t)>0?e:t}:function(e,t){return e>t?e:t})}H0.max=lte});var m2=g(G0=>{"use strict";Object.defineProperty(G0,"__esModule",{value:!0});G0.flatMap=void 0;var ute=Zn();G0.flatMap=ute.mergeMap});var y2=g(V0=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});V0.mergeMapTo=void 0;var g2=Zn(),dte=Ce();function fte(r,e,t){return t===void 0&&(t=1/0),dte.isFunction(e)?g2.mergeMap(function(){return r},e,t):(typeof e=="number"&&(t=e),g2.mergeMap(function(){return r},t))}V0.mergeMapTo=fte});var v2=g(W0=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});W0.mergeScan=void 0;var hte=K(),pte=kp();function mte(r,e,t){return t===void 0&&(t=1/0),hte.operate(function(n,i){var s=e;return pte.mergeInternals(n,i,function(o,a){return r(s,o,a)},t,function(o){s=o},!1,void 0,function(){return s=null})})}W0.mergeScan=mte});var _2=g($i=>{"use strict";var gte=$i&&$i.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},yte=$i&&$i.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty($i,"__esModule",{value:!0});$i.merge=void 0;var vte=K(),bte=fo(),_te=su(),b2=tr(),Ete=Yn();function Ate(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=b2.popScheduler(r),n=b2.popNumber(r,1/0);return r=bte.argsOrArgArray(r),vte.operate(function(i,s){_te.mergeAll(n)(Ete.from(yte([i],gte(r)),t)).subscribe(s)})}$i.merge=Ate});var E2=g(Zi=>{"use strict";var wte=Zi&&Zi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},Ste=Zi&&Zi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.mergeWith=void 0;var Tte=_2();function Cte(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Tte.merge.apply(void 0,Ste([],wte(r)))}Zi.mergeWith=Cte});var A2=g(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});K0.min=void 0;var xte=tc(),Ote=Ce();function Ite(r){return xte.reduce(Ote.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})}K0.min=Ite});var Q0=g(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});J0.multicast=void 0;var Pte=Xl(),w2=Ce(),kte=m0();function Rte(r,e){var t=w2.isFunction(r)?r:function(){return r};return w2.isFunction(e)?kte.connect(e,{connector:t}):function(n){return new Pte.ConnectableObservable(n,t)}}J0.multicast=Rte});var T2=g(An=>{"use strict";var Nte=An&&An.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},Mte=An&&An.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(An,"__esModule",{value:!0});An.onErrorResumeNext=An.onErrorResumeNextWith=void 0;var Dte=fo(),Lte=C1();function S2(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Dte.argsOrArgArray(r);return function(n){return Lte.onErrorResumeNext.apply(void 0,Mte([n],Nte(t)))}}An.onErrorResumeNextWith=S2;An.onErrorResumeNext=S2});var C2=g(Y0=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});Y0.pairwise=void 0;var Fte=K(),qte=te();function Bte(){return Fte.operate(function(r,e){var t,n=!1;r.subscribe(qte.createOperatorSubscriber(e,function(i){var s=t;t=i,n&&e.next([s,i]),n=!0}))})}Y0.pairwise=Bte});var x2=g($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.pluck=void 0;var Ute=Ui();function jte(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=r.length;if(t===0)throw new Error("list of properties cannot be empty.");return Ute.map(function(n){for(var i=n,s=0;s<t;s++){var o=i?.[r[s]];if(typeof o<"u")i=o;else return}return i})}$0.pluck=jte});var O2=g(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.publish=void 0;var zte=wt(),Hte=Q0(),Gte=m0();function Vte(r){return r?function(e){return Gte.connect(r)(e)}:function(e){return Hte.multicast(new zte.Subject)(e)}}Z0.publish=Vte});var I2=g(X0=>{"use strict";Object.defineProperty(X0,"__esModule",{value:!0});X0.publishBehavior=void 0;var Wte=XE(),Kte=Xl();function Jte(r){return function(e){var t=new Wte.BehaviorSubject(r);return new Kte.ConnectableObservable(e,function(){return t})}}X0.publishBehavior=Jte});var P2=g(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.publishLast=void 0;var Qte=jh(),Yte=Xl();function $te(){return function(r){var e=new Qte.AsyncSubject;return new Yte.ConnectableObservable(r,function(){return e})}}em.publishLast=$te});var R2=g(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.publishReplay=void 0;var Zte=Uh(),Xte=Q0(),k2=Ce();function ere(r,e,t,n){t&&!k2.isFunction(t)&&(n=t);var i=k2.isFunction(t)?t:void 0;return function(s){return Xte.multicast(new Zte.ReplaySubject(r,e,n),i)(s)}}tm.publishReplay=ere});var N2=g(Xi=>{"use strict";var tre=Xi&&Xi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},rre=Xi&&Xi.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.raceWith=void 0;var nre=x1(),ire=K(),sre=At();function ore(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?ire.operate(function(t,n){nre.raceInit(rre([t],tre(r)))(n)}):sre.identity}Xi.raceWith=ore});var D2=g(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.repeat=void 0;var are=Hr(),cre=K(),M2=te(),lre=le(),ure=Gi();function dre(r){var e,t=1/0,n;return r!=null&&(typeof r=="object"?(e=r.count,t=e===void 0?1/0:e,n=r.delay):t=r),t<=0?function(){return are.EMPTY}:cre.operate(function(i,s){var o=0,a,c=function(){if(a?.unsubscribe(),a=null,n!=null){var u=typeof n=="number"?ure.timer(n):lre.innerFrom(n(o)),d=M2.createOperatorSubscriber(s,function(){d.unsubscribe(),l()});u.subscribe(d)}else l()},l=function(){var u=!1;a=i.subscribe(M2.createOperatorSubscriber(s,void 0,function(){++o<t?a?c():u=!0:s.complete()})),u&&c()};l()})}rm.repeat=dre});var F2=g(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.repeatWhen=void 0;var fre=le(),hre=wt(),pre=K(),L2=te();function mre(r){return pre.operate(function(e,t){var n,i=!1,s,o=!1,a=!1,c=function(){return a&&o&&(t.complete(),!0)},l=function(){return s||(s=new hre.Subject,fre.innerFrom(r(s)).subscribe(L2.createOperatorSubscriber(t,function(){n?u():i=!0},function(){o=!0,c()}))),s},u=function(){a=!1,n=e.subscribe(L2.createOperatorSubscriber(t,void 0,function(){a=!0,!c()&&l().next()})),i&&(n.unsubscribe(),n=null,i=!1,u())};u()})}nm.repeatWhen=mre});var B2=g(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.retry=void 0;var gre=K(),q2=te(),yre=At(),vre=Gi(),bre=le();function _re(r){r===void 0&&(r=1/0);var e;r&&typeof r=="object"?e=r:e={count:r};var t=e.count,n=t===void 0?1/0:t,i=e.delay,s=e.resetOnSuccess,o=s===void 0?!1:s;return n<=0?yre.identity:gre.operate(function(a,c){var l=0,u,d=function(){var f=!1;u=a.subscribe(q2.createOperatorSubscriber(c,function(h){o&&(l=0),c.next(h)},void 0,function(h){if(l++<n){var m=function(){u?(u.unsubscribe(),u=null,d()):f=!0};if(i!=null){var p=typeof i=="number"?vre.timer(i):bre.innerFrom(i(h,l)),y=q2.createOperatorSubscriber(c,function(){y.unsubscribe(),m()},function(){c.complete()});p.subscribe(y)}else m()}else c.error(h)})),f&&(u.unsubscribe(),u=null,d())};d()})}im.retry=_re});var j2=g(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.retryWhen=void 0;var Ere=le(),Are=wt(),wre=K(),U2=te();function Sre(r){return wre.operate(function(e,t){var n,i=!1,s,o=function(){n=e.subscribe(U2.createOperatorSubscriber(t,void 0,void 0,function(a){s||(s=new Are.Subject,Ere.innerFrom(r(s)).subscribe(U2.createOperatorSubscriber(t,function(){return n?o():i=!0}))),s&&s.next(a)})),i&&(n.unsubscribe(),n=null,i=!1,o())};o()})}sm.retryWhen=Sre});var V1=g(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.sample=void 0;var Tre=le(),Cre=K(),xre=Et(),z2=te();function Ore(r){return Cre.operate(function(e,t){var n=!1,i=null;e.subscribe(z2.createOperatorSubscriber(t,function(s){n=!0,i=s})),Tre.innerFrom(r).subscribe(z2.createOperatorSubscriber(t,function(){if(n){n=!1;var s=i;i=null,t.next(s)}},xre.noop))})}om.sample=Ore});var H2=g(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.sampleTime=void 0;var Ire=er(),Pre=V1(),kre=S1();function Rre(r,e){return e===void 0&&(e=Ire.asyncScheduler),Pre.sample(kre.interval(r,e))}am.sampleTime=Rre});var G2=g(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.scan=void 0;var Nre=K(),Mre=k1();function Dre(r,e){return Nre.operate(Mre.scanInternals(r,e,arguments.length>=2,!0))}cm.scan=Dre});var W2=g(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.sequenceEqual=void 0;var Lre=K(),Fre=te(),qre=le();function Bre(r,e){return e===void 0&&(e=function(t,n){return t===n}),Lre.operate(function(t,n){var i=V2(),s=V2(),o=function(c){n.next(c),n.complete()},a=function(c,l){var u=Fre.createOperatorSubscriber(n,function(d){var f=l.buffer,h=l.complete;f.length===0?h?o(!1):c.buffer.push(d):!e(d,f.shift())&&o(!1)},function(){c.complete=!0;var d=l.complete,f=l.buffer;d&&o(f.length===0),u?.unsubscribe()});return u};t.subscribe(a(i,s)),qre.innerFrom(r).subscribe(a(s,i))})}lm.sequenceEqual=Bre;function V2(){return{buffer:[],complete:!1}}});var K1=g(es=>{"use strict";var Ure=es&&es.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},jre=es&&es.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(es,"__esModule",{value:!0});es.share=void 0;var K2=le(),zre=wt(),J2=Ca(),Hre=K();function Gre(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new zre.Subject}:e,n=r.resetOnError,i=n===void 0?!0:n,s=r.resetOnComplete,o=s===void 0?!0:s,a=r.resetOnRefCountZero,c=a===void 0?!0:a;return function(l){var u,d,f,h=0,m=!1,p=!1,y=function(){d?.unsubscribe(),d=void 0},b=function(){y(),u=f=void 0,m=p=!1},E=function(){var x=u;b(),x?.unsubscribe()};return Hre.operate(function(x,S){h++,!p&&!m&&y();var M=f=f??t();S.add(function(){h--,h===0&&!p&&!m&&(d=W1(E,c))}),M.subscribe(S),!u&&h>0&&(u=new J2.SafeSubscriber({next:function(I){return M.next(I)},error:function(I){p=!0,y(),d=W1(b,i,I),M.error(I)},complete:function(){m=!0,y(),d=W1(b,o),M.complete()}}),K2.innerFrom(x).subscribe(u))})(l)}}es.share=Gre;function W1(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var i=new J2.SafeSubscriber({next:function(){i.unsubscribe(),r()}});return K2.innerFrom(e.apply(void 0,jre([],Ure(t)))).subscribe(i)}}});var Q2=g(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.shareReplay=void 0;var Vre=Uh(),Wre=K1();function Kre(r,e,t){var n,i,s,o,a=!1;return r&&typeof r=="object"?(n=r.bufferSize,o=n===void 0?1/0:n,i=r.windowTime,e=i===void 0?1/0:i,s=r.refCount,a=s===void 0?!1:s,t=r.scheduler):o=r??1/0,Wre.share({connector:function(){return new Vre.ReplaySubject(o,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}um.shareReplay=Kre});var Y2=g(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.single=void 0;var Jre=Bi(),Qre=v1(),Yre=y1(),$re=K(),Zre=te();function Xre(r){return $re.operate(function(e,t){var n=!1,i,s=!1,o=0;e.subscribe(Zre.createOperatorSubscriber(t,function(a){s=!0,(!r||r(a,o++,e))&&(n&&t.error(new Qre.SequenceError("Too many matching values")),n=!0,i=a)},function(){n?(t.next(i),t.complete()):t.error(s?new Yre.NotFoundError("No matching values"):new Jre.EmptyError)}))})}dm.single=Xre});var $2=g(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.skip=void 0;var ene=ho();function tne(r){return ene.filter(function(e,t){return r<=t})}fm.skip=tne});var Z2=g(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.skipLast=void 0;var rne=At(),nne=K(),ine=te();function sne(r){return r<=0?rne.identity:nne.operate(function(e,t){var n=new Array(r),i=0;return e.subscribe(ine.createOperatorSubscriber(t,function(s){var o=i++;if(o<r)n[o]=s;else{var a=o%r,c=n[a];n[a]=s,t.next(c)}})),function(){n=null}})}hm.skipLast=sne});var eM=g(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.skipUntil=void 0;var one=K(),X2=te(),ane=le(),cne=Et();function lne(r){return one.operate(function(e,t){var n=!1,i=X2.createOperatorSubscriber(t,function(){i?.unsubscribe(),n=!0},cne.noop);ane.innerFrom(r).subscribe(i),e.subscribe(X2.createOperatorSubscriber(t,function(s){return n&&t.next(s)}))})}pm.skipUntil=lne});var tM=g(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.skipWhile=void 0;var une=K(),dne=te();function fne(r){return une.operate(function(e,t){var n=!1,i=0;e.subscribe(dne.createOperatorSubscriber(t,function(s){return(n||(n=!r(s,i++)))&&t.next(s)}))})}mm.skipWhile=fne});var nM=g(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.startWith=void 0;var rM=ou(),hne=tr(),pne=K();function mne(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=hne.popScheduler(r);return pne.operate(function(n,i){(t?rM.concat(r,n,t):rM.concat(r,n)).subscribe(i)})}gm.startWith=mne});var du=g(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.switchMap=void 0;var gne=le(),yne=K(),iM=te();function vne(r,e){return yne.operate(function(t,n){var i=null,s=0,o=!1,a=function(){return o&&!i&&n.complete()};t.subscribe(iM.createOperatorSubscriber(n,function(c){i?.unsubscribe();var l=0,u=s++;gne.innerFrom(r(c,u)).subscribe(i=iM.createOperatorSubscriber(n,function(d){return n.next(e?e(c,d,u,l++):d)},function(){i=null,a()}))},function(){o=!0,a()}))})}ym.switchMap=vne});var sM=g(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.switchAll=void 0;var bne=du(),_ne=At();function Ene(){return bne.switchMap(_ne.identity)}vm.switchAll=Ene});var aM=g(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.switchMapTo=void 0;var oM=du(),Ane=Ce();function wne(r,e){return Ane.isFunction(e)?oM.switchMap(function(){return r},e):oM.switchMap(function(){return r})}bm.switchMapTo=wne});var cM=g(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.switchScan=void 0;var Sne=du(),Tne=K();function Cne(r,e){return Tne.operate(function(t,n){var i=e;return Sne.switchMap(function(s,o){return r(i,s,o)},function(s,o){return i=o,o})(t).subscribe(n),function(){i=null}})}_m.switchScan=Cne});var lM=g(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.takeUntil=void 0;var xne=K(),One=te(),Ine=le(),Pne=Et();function kne(r){return xne.operate(function(e,t){Ine.innerFrom(r).subscribe(One.createOperatorSubscriber(t,function(){return t.complete()},Pne.noop)),!t.closed&&e.subscribe(t)})}Em.takeUntil=kne});var uM=g(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.takeWhile=void 0;var Rne=K(),Nne=te();function Mne(r,e){return e===void 0&&(e=!1),Rne.operate(function(t,n){var i=0;t.subscribe(Nne.createOperatorSubscriber(n,function(s){var o=r(s,i++);(o||e)&&n.next(s),!o&&n.complete()}))})}Am.takeWhile=Mne});var dM=g(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.tap=void 0;var Dne=Ce(),Lne=K(),Fne=te(),qne=At();function Bne(r,e,t){var n=Dne.isFunction(r)||e||t?{next:r,error:e,complete:t}:r;return n?Lne.operate(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(Fne.createOperatorSubscriber(s,function(c){var l;(l=n.next)===null||l===void 0||l.call(n,c),s.next(c)},function(){var c;a=!1,(c=n.complete)===null||c===void 0||c.call(n),s.complete()},function(c){var l;a=!1,(l=n.error)===null||l===void 0||l.call(n,c),s.error(c)},function(){var c,l;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(l=n.finalize)===null||l===void 0||l.call(n)}))}):qne.identity}wm.tap=Bne});var J1=g(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.throttle=void 0;var Une=K(),fM=te(),jne=le();function zne(r,e){return Une.operate(function(t,n){var i=e??{},s=i.leading,o=s===void 0?!0:s,a=i.trailing,c=a===void 0?!1:a,l=!1,u=null,d=null,f=!1,h=function(){d?.unsubscribe(),d=null,c&&(y(),f&&n.complete())},m=function(){d=null,f&&n.complete()},p=function(b){return d=jne.innerFrom(r(b)).subscribe(fM.createOperatorSubscriber(n,h,m))},y=function(){if(l){l=!1;var b=u;u=null,n.next(b),!f&&p(b)}};t.subscribe(fM.createOperatorSubscriber(n,function(b){l=!0,u=b,!(d&&!d.closed)&&(o?y():p(b))},function(){f=!0,!(c&&l&&d&&!d.closed)&&n.complete()}))})}Sm.throttle=zne});var hM=g(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.throttleTime=void 0;var Hne=er(),Gne=J1(),Vne=Gi();function Wne(r,e,t){e===void 0&&(e=Hne.asyncScheduler);var n=Vne.timer(r,e);return Gne.throttle(function(){return n},t)}Tm.throttleTime=Wne});var mM=g(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.TimeInterval=ic.timeInterval=void 0;var Kne=er(),Jne=K(),Qne=te();function Yne(r){return r===void 0&&(r=Kne.asyncScheduler),Jne.operate(function(e,t){var n=r.now();e.subscribe(Qne.createOperatorSubscriber(t,function(i){var s=r.now(),o=s-n;n=s,t.next(new pM(i,o))}))})}ic.timeInterval=Yne;var pM=function(){function r(e,t){this.value=e,this.interval=t}return r}();ic.TimeInterval=pM});var gM=g(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.timeoutWith=void 0;var $ne=er(),Zne=Ap(),Xne=wp();function eie(r,e,t){var n,i,s;if(t=t??$ne.async,Zne.isValidDate(r)?n=r:typeof r=="number"&&(i=r),e)s=function(){return e};else throw new TypeError("No observable provided to switch to");if(n==null&&i==null)throw new TypeError("No timeout provided.");return Xne.timeout({first:n,each:i,scheduler:t,with:s})}Cm.timeoutWith=eie});var yM=g(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.timestamp=void 0;var tie=Bh(),rie=Ui();function nie(r){return r===void 0&&(r=tie.dateTimestampProvider),rie.map(function(e){return{value:e,timestamp:r.now()}})}xm.timestamp=nie});var _M=g(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.window=void 0;var vM=wt(),iie=K(),bM=te(),sie=Et(),oie=le();function aie(r){return iie.operate(function(e,t){var n=new vM.Subject;t.next(n.asObservable());var i=function(s){n.error(s),t.error(s)};return e.subscribe(bM.createOperatorSubscriber(t,function(s){return n?.next(s)},function(){n.complete(),t.complete()},i)),oie.innerFrom(r).subscribe(bM.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new vM.Subject)},sie.noop,i)),function(){n?.unsubscribe(),n=null}})}Om.window=aie});var AM=g(sc=>{"use strict";var cie=sc&&sc.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(sc,"__esModule",{value:!0});sc.windowCount=void 0;var EM=wt(),lie=K(),uie=te();function die(r,e){e===void 0&&(e=0);var t=e>0?e:r;return lie.operate(function(n,i){var s=[new EM.Subject],o=[],a=0;i.next(s[0].asObservable()),n.subscribe(uie.createOperatorSubscriber(i,function(c){var l,u;try{for(var d=cie(s),f=d.next();!f.done;f=d.next()){var h=f.value;h.next(c)}}catch(y){l={error:y}}finally{try{f&&!f.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}var m=a-r+1;if(m>=0&&m%t===0&&s.shift().complete(),++a%t===0){var p=new EM.Subject;s.push(p),i.next(p.asObservable())}},function(){for(;s.length>0;)s.shift().complete();i.complete()},function(c){for(;s.length>0;)s.shift().error(c);i.error(c)},function(){o=null,s=null}))})}sc.windowCount=die});var SM=g(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.windowTime=void 0;var fie=wt(),hie=er(),pie=fr(),mie=K(),gie=te(),yie=Jn(),vie=tr(),wM=Qn();function bie(r){for(var e,t,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=(e=vie.popScheduler(n))!==null&&e!==void 0?e:hie.asyncScheduler,o=(t=n[0])!==null&&t!==void 0?t:null,a=n[1]||1/0;return mie.operate(function(c,l){var u=[],d=!1,f=function(y){var b=y.window,E=y.subs;b.complete(),E.unsubscribe(),yie.arrRemove(u,y),d&&h()},h=function(){if(u){var y=new pie.Subscription;l.add(y);var b=new fie.Subject,E={window:b,subs:y,seen:0};u.push(E),l.next(b.asObservable()),wM.executeSchedule(y,s,function(){return f(E)},r)}};o!==null&&o>=0?wM.executeSchedule(l,s,h,o,!0):d=!0,h();var m=function(y){return u.slice().forEach(y)},p=function(y){m(function(b){var E=b.window;return y(E)}),y(l),l.unsubscribe()};return c.subscribe(gie.createOperatorSubscriber(l,function(y){m(function(b){b.window.next(y),a<=++b.seen&&f(b)})},function(){return p(function(y){return y.complete()})},function(y){return p(function(b){return b.error(y)})})),function(){u=null}})}Im.windowTime=bie});var xM=g(oc=>{"use strict";var _ie=oc&&oc.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(oc,"__esModule",{value:!0});oc.windowToggle=void 0;var Eie=wt(),Aie=fr(),wie=K(),TM=le(),Q1=te(),CM=Et(),Sie=Jn();function Tie(r,e){return wie.operate(function(t,n){var i=[],s=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};TM.innerFrom(r).subscribe(Q1.createOperatorSubscriber(n,function(o){var a=new Eie.Subject;i.push(a);var c=new Aie.Subscription,l=function(){Sie.arrRemove(i,a),a.complete(),c.unsubscribe()},u;try{u=TM.innerFrom(e(o))}catch(d){s(d);return}n.next(a.asObservable()),c.add(u.subscribe(Q1.createOperatorSubscriber(n,l,CM.noop,s)))},CM.noop)),t.subscribe(Q1.createOperatorSubscriber(n,function(o){var a,c,l=i.slice();try{for(var u=_ie(l),d=u.next();!d.done;d=u.next()){var f=d.value;f.next(o)}}catch(h){a={error:h}}finally{try{d&&!d.done&&(c=u.return)&&c.call(u)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},s,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}oc.windowToggle=Tie});var IM=g(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.windowWhen=void 0;var Cie=wt(),xie=K(),OM=te(),Oie=le();function Iie(r){return xie.operate(function(e,t){var n,i,s=function(a){n.error(a),t.error(a)},o=function(){i?.unsubscribe(),n?.complete(),n=new Cie.Subject,t.next(n.asObservable());var a;try{a=Oie.innerFrom(r())}catch(c){s(c);return}a.subscribe(i=OM.createOperatorSubscriber(t,o,o,s))};o(),e.subscribe(OM.createOperatorSubscriber(t,function(a){return n.next(a)},function(){n.complete(),t.complete()},s,function(){i?.unsubscribe(),n=null}))})}Pm.windowWhen=Iie});var NM=g(ts=>{"use strict";var PM=ts&&ts.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},kM=ts&&ts.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(ts,"__esModule",{value:!0});ts.withLatestFrom=void 0;var Pie=K(),RM=te(),kie=le(),Rie=At(),Nie=Et(),Mie=tr();function Die(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Mie.popResultSelector(r);return Pie.operate(function(n,i){for(var s=r.length,o=new Array(s),a=r.map(function(){return!1}),c=!1,l=function(d){kie.innerFrom(r[d]).subscribe(RM.createOperatorSubscriber(i,function(f){o[d]=f,!c&&!a[d]&&(a[d]=!0,(c=a.every(Rie.identity))&&(a=null))},Nie.noop))},u=0;u<s;u++)l(u);n.subscribe(RM.createOperatorSubscriber(i,function(d){if(c){var f=kM([d],PM(o));i.next(t?t.apply(void 0,kM([],PM(f))):f)}}))})}ts.withLatestFrom=Die});var MM=g(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.zipAll=void 0;var Lie=Xp(),Fie=N1();function qie(r){return Fie.joinAllInternals(Lie.zip,r)}km.zipAll=qie});var DM=g(rs=>{"use strict";var Bie=rs&&rs.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},Uie=rs&&rs.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(rs,"__esModule",{value:!0});rs.zip=void 0;var jie=Xp(),zie=K();function Hie(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return zie.operate(function(t,n){jie.zip.apply(void 0,Uie([t],Bie(r))).subscribe(n)})}rs.zip=Hie});var LM=g(ns=>{"use strict";var Gie=ns&&ns.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s},Vie=ns&&ns.__spreadArray||function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r};Object.defineProperty(ns,"__esModule",{value:!0});ns.zipWith=void 0;var Wie=DM();function Kie(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Wie.zip.apply(void 0,Vie([],Gie(r)))}ns.zipWith=Kie});var HM=g(v=>{"use strict";var Jie=v&&v.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Qie=v&&v.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Jie(e,r,t)};Object.defineProperty(v,"__esModule",{value:!0});v.interval=v.iif=v.generate=v.fromEventPattern=v.fromEvent=v.from=v.forkJoin=v.empty=v.defer=v.connectable=v.concat=v.combineLatest=v.bindNodeCallback=v.bindCallback=v.UnsubscriptionError=v.TimeoutError=v.SequenceError=v.ObjectUnsubscribedError=v.NotFoundError=v.EmptyError=v.ArgumentOutOfRangeError=v.firstValueFrom=v.lastValueFrom=v.isObservable=v.identity=v.noop=v.pipe=v.NotificationKind=v.Notification=v.Subscriber=v.Subscription=v.Scheduler=v.VirtualAction=v.VirtualTimeScheduler=v.animationFrameScheduler=v.animationFrame=v.queueScheduler=v.queue=v.asyncScheduler=v.async=v.asapScheduler=v.asap=v.AsyncSubject=v.ReplaySubject=v.BehaviorSubject=v.Subject=v.animationFrames=v.observable=v.ConnectableObservable=v.Observable=void 0;v.filter=v.expand=v.exhaustMap=v.exhaustAll=v.exhaust=v.every=v.endWith=v.elementAt=v.distinctUntilKeyChanged=v.distinctUntilChanged=v.distinct=v.dematerialize=v.delayWhen=v.delay=v.defaultIfEmpty=v.debounceTime=v.debounce=v.count=v.connect=v.concatWith=v.concatMapTo=v.concatMap=v.concatAll=v.combineLatestWith=v.combineLatestAll=v.combineAll=v.catchError=v.bufferWhen=v.bufferToggle=v.bufferTime=v.bufferCount=v.buffer=v.auditTime=v.audit=v.config=v.NEVER=v.EMPTY=v.scheduled=v.zip=v.using=v.timer=v.throwError=v.range=v.race=v.partition=v.pairs=v.onErrorResumeNext=v.of=v.never=v.merge=void 0;v.switchMap=v.switchAll=v.subscribeOn=v.startWith=v.skipWhile=v.skipUntil=v.skipLast=v.skip=v.single=v.shareReplay=v.share=v.sequenceEqual=v.scan=v.sampleTime=v.sample=v.refCount=v.retryWhen=v.retry=v.repeatWhen=v.repeat=v.reduce=v.raceWith=v.publishReplay=v.publishLast=v.publishBehavior=v.publish=v.pluck=v.pairwise=v.onErrorResumeNextWith=v.observeOn=v.multicast=v.min=v.mergeWith=v.mergeScan=v.mergeMapTo=v.mergeMap=v.flatMap=v.mergeAll=v.max=v.materialize=v.mapTo=v.map=v.last=v.isEmpty=v.ignoreElements=v.groupBy=v.first=v.findIndex=v.find=v.finalize=void 0;v.zipWith=v.zipAll=v.withLatestFrom=v.windowWhen=v.windowToggle=v.windowTime=v.windowCount=v.window=v.toArray=v.timestamp=v.timeoutWith=v.timeout=v.timeInterval=v.throwIfEmpty=v.throttleTime=v.throttle=v.tap=v.takeWhile=v.takeUntil=v.takeLast=v.take=v.switchScan=v.switchMapTo=void 0;var Yie=ke();Object.defineProperty(v,"Observable",{enumerable:!0,get:function(){return Yie.Observable}});var $ie=Xl();Object.defineProperty(v,"ConnectableObservable",{enumerable:!0,get:function(){return $ie.ConnectableObservable}});var Zie=$l();Object.defineProperty(v,"observable",{enumerable:!0,get:function(){return Zie.observable}});var Xie=jk();Object.defineProperty(v,"animationFrames",{enumerable:!0,get:function(){return Xie.animationFrames}});var ese=wt();Object.defineProperty(v,"Subject",{enumerable:!0,get:function(){return ese.Subject}});var tse=XE();Object.defineProperty(v,"BehaviorSubject",{enumerable:!0,get:function(){return tse.BehaviorSubject}});var rse=Uh();Object.defineProperty(v,"ReplaySubject",{enumerable:!0,get:function(){return rse.ReplaySubject}});var nse=jh();Object.defineProperty(v,"AsyncSubject",{enumerable:!0,get:function(){return nse.AsyncSubject}});var FM=iR();Object.defineProperty(v,"asap",{enumerable:!0,get:function(){return FM.asap}});Object.defineProperty(v,"asapScheduler",{enumerable:!0,get:function(){return FM.asapScheduler}});var qM=er();Object.defineProperty(v,"async",{enumerable:!0,get:function(){return qM.async}});Object.defineProperty(v,"asyncScheduler",{enumerable:!0,get:function(){return qM.asyncScheduler}});var BM=aR();Object.defineProperty(v,"queue",{enumerable:!0,get:function(){return BM.queue}});Object.defineProperty(v,"queueScheduler",{enumerable:!0,get:function(){return BM.queueScheduler}});var UM=dR();Object.defineProperty(v,"animationFrame",{enumerable:!0,get:function(){return UM.animationFrame}});Object.defineProperty(v,"animationFrameScheduler",{enumerable:!0,get:function(){return UM.animationFrameScheduler}});var jM=pR();Object.defineProperty(v,"VirtualTimeScheduler",{enumerable:!0,get:function(){return jM.VirtualTimeScheduler}});Object.defineProperty(v,"VirtualAction",{enumerable:!0,get:function(){return jM.VirtualAction}});var ise=t1();Object.defineProperty(v,"Scheduler",{enumerable:!0,get:function(){return ise.Scheduler}});var sse=fr();Object.defineProperty(v,"Subscription",{enumerable:!0,get:function(){return sse.Subscription}});var ose=Ca();Object.defineProperty(v,"Subscriber",{enumerable:!0,get:function(){return ose.Subscriber}});var zM=hp();Object.defineProperty(v,"Notification",{enumerable:!0,get:function(){return zM.Notification}});Object.defineProperty(v,"NotificationKind",{enumerable:!0,get:function(){return zM.NotificationKind}});var ase=Zl();Object.defineProperty(v,"pipe",{enumerable:!0,get:function(){return ase.pipe}});var cse=Et();Object.defineProperty(v,"noop",{enumerable:!0,get:function(){return cse.noop}});var lse=At();Object.defineProperty(v,"identity",{enumerable:!0,get:function(){return lse.identity}});var use=kR();Object.defineProperty(v,"isObservable",{enumerable:!0,get:function(){return use.isObservable}});var dse=RR();Object.defineProperty(v,"lastValueFrom",{enumerable:!0,get:function(){return dse.lastValueFrom}});var fse=NR();Object.defineProperty(v,"firstValueFrom",{enumerable:!0,get:function(){return fse.firstValueFrom}});var hse=g1();Object.defineProperty(v,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return hse.ArgumentOutOfRangeError}});var pse=Bi();Object.defineProperty(v,"EmptyError",{enumerable:!0,get:function(){return pse.EmptyError}});var mse=y1();Object.defineProperty(v,"NotFoundError",{enumerable:!0,get:function(){return mse.NotFoundError}});var gse=QE();Object.defineProperty(v,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return gse.ObjectUnsubscribedError}});var yse=v1();Object.defineProperty(v,"SequenceError",{enumerable:!0,get:function(){return yse.SequenceError}});var vse=wp();Object.defineProperty(v,"TimeoutError",{enumerable:!0,get:function(){return vse.TimeoutError}});var bse=LE();Object.defineProperty(v,"UnsubscriptionError",{enumerable:!0,get:function(){return bse.UnsubscriptionError}});var _se=DR();Object.defineProperty(v,"bindCallback",{enumerable:!0,get:function(){return _se.bindCallback}});var Ese=LR();Object.defineProperty(v,"bindNodeCallback",{enumerable:!0,get:function(){return Ese.bindNodeCallback}});var Ase=Ip();Object.defineProperty(v,"combineLatest",{enumerable:!0,get:function(){return Ase.combineLatest}});var wse=ou();Object.defineProperty(v,"concat",{enumerable:!0,get:function(){return wse.concat}});var Sse=GR();Object.defineProperty(v,"connectable",{enumerable:!0,get:function(){return Sse.connectable}});var Tse=au();Object.defineProperty(v,"defer",{enumerable:!0,get:function(){return Tse.defer}});var Cse=Hr();Object.defineProperty(v,"empty",{enumerable:!0,get:function(){return Cse.empty}});var xse=VR();Object.defineProperty(v,"forkJoin",{enumerable:!0,get:function(){return xse.forkJoin}});var Ose=Yn();Object.defineProperty(v,"from",{enumerable:!0,get:function(){return Ose.from}});var Ise=KR();Object.defineProperty(v,"fromEvent",{enumerable:!0,get:function(){return Ise.fromEvent}});var Pse=QR();Object.defineProperty(v,"fromEventPattern",{enumerable:!0,get:function(){return Pse.fromEventPattern}});var kse=$R();Object.defineProperty(v,"generate",{enumerable:!0,get:function(){return kse.generate}});var Rse=ZR();Object.defineProperty(v,"iif",{enumerable:!0,get:function(){return Rse.iif}});var Nse=S1();Object.defineProperty(v,"interval",{enumerable:!0,get:function(){return Nse.interval}});var Mse=eN();Object.defineProperty(v,"merge",{enumerable:!0,get:function(){return Mse.merge}});var Dse=T1();Object.defineProperty(v,"never",{enumerable:!0,get:function(){return Dse.never}});var Lse=dp();Object.defineProperty(v,"of",{enumerable:!0,get:function(){return Lse.of}});var Fse=C1();Object.defineProperty(v,"onErrorResumeNext",{enumerable:!0,get:function(){return Fse.onErrorResumeNext}});var qse=rN();Object.defineProperty(v,"pairs",{enumerable:!0,get:function(){return qse.pairs}});var Bse=oN();Object.defineProperty(v,"partition",{enumerable:!0,get:function(){return Bse.partition}});var Use=x1();Object.defineProperty(v,"race",{enumerable:!0,get:function(){return Use.race}});var jse=lN();Object.defineProperty(v,"range",{enumerable:!0,get:function(){return jse.range}});var zse=m1();Object.defineProperty(v,"throwError",{enumerable:!0,get:function(){return zse.throwError}});var Hse=Gi();Object.defineProperty(v,"timer",{enumerable:!0,get:function(){return Hse.timer}});var Gse=uN();Object.defineProperty(v,"using",{enumerable:!0,get:function(){return Gse.using}});var Vse=Xp();Object.defineProperty(v,"zip",{enumerable:!0,get:function(){return Vse.zip}});var Wse=p1();Object.defineProperty(v,"scheduled",{enumerable:!0,get:function(){return Wse.scheduled}});var Kse=Hr();Object.defineProperty(v,"EMPTY",{enumerable:!0,get:function(){return Kse.EMPTY}});var Jse=T1();Object.defineProperty(v,"NEVER",{enumerable:!0,get:function(){return Jse.NEVER}});Qie(fN(),v);var Qse=Sa();Object.defineProperty(v,"config",{enumerable:!0,get:function(){return Qse.config}});var Yse=O1();Object.defineProperty(v,"audit",{enumerable:!0,get:function(){return Yse.audit}});var $se=pN();Object.defineProperty(v,"auditTime",{enumerable:!0,get:function(){return $se.auditTime}});var Zse=gN();Object.defineProperty(v,"buffer",{enumerable:!0,get:function(){return Zse.buffer}});var Xse=yN();Object.defineProperty(v,"bufferCount",{enumerable:!0,get:function(){return Xse.bufferCount}});var eoe=bN();Object.defineProperty(v,"bufferTime",{enumerable:!0,get:function(){return eoe.bufferTime}});var toe=AN();Object.defineProperty(v,"bufferToggle",{enumerable:!0,get:function(){return toe.bufferToggle}});var roe=SN();Object.defineProperty(v,"bufferWhen",{enumerable:!0,get:function(){return roe.bufferWhen}});var noe=CN();Object.defineProperty(v,"catchError",{enumerable:!0,get:function(){return noe.catchError}});var ioe=xN();Object.defineProperty(v,"combineAll",{enumerable:!0,get:function(){return ioe.combineAll}});var soe=M1();Object.defineProperty(v,"combineLatestAll",{enumerable:!0,get:function(){return soe.combineLatestAll}});var ooe=RN();Object.defineProperty(v,"combineLatestWith",{enumerable:!0,get:function(){return ooe.combineLatestWith}});var aoe=Dp();Object.defineProperty(v,"concatAll",{enumerable:!0,get:function(){return aoe.concatAll}});var coe=D1();Object.defineProperty(v,"concatMap",{enumerable:!0,get:function(){return coe.concatMap}});var loe=DN();Object.defineProperty(v,"concatMapTo",{enumerable:!0,get:function(){return loe.concatMapTo}});var uoe=FN();Object.defineProperty(v,"concatWith",{enumerable:!0,get:function(){return uoe.concatWith}});var doe=m0();Object.defineProperty(v,"connect",{enumerable:!0,get:function(){return doe.connect}});var foe=BN();Object.defineProperty(v,"count",{enumerable:!0,get:function(){return foe.count}});var hoe=jN();Object.defineProperty(v,"debounce",{enumerable:!0,get:function(){return hoe.debounce}});var poe=zN();Object.defineProperty(v,"debounceTime",{enumerable:!0,get:function(){return poe.debounceTime}});var moe=cu();Object.defineProperty(v,"defaultIfEmpty",{enumerable:!0,get:function(){return moe.defaultIfEmpty}});var goe=VN();Object.defineProperty(v,"delay",{enumerable:!0,get:function(){return goe.delay}});var yoe=q1();Object.defineProperty(v,"delayWhen",{enumerable:!0,get:function(){return yoe.delayWhen}});var voe=WN();Object.defineProperty(v,"dematerialize",{enumerable:!0,get:function(){return voe.dematerialize}});var boe=JN();Object.defineProperty(v,"distinct",{enumerable:!0,get:function(){return boe.distinct}});var _oe=B1();Object.defineProperty(v,"distinctUntilChanged",{enumerable:!0,get:function(){return _oe.distinctUntilChanged}});var Eoe=QN();Object.defineProperty(v,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Eoe.distinctUntilKeyChanged}});var Aoe=$N();Object.defineProperty(v,"elementAt",{enumerable:!0,get:function(){return Aoe.elementAt}});var woe=ZN();Object.defineProperty(v,"endWith",{enumerable:!0,get:function(){return woe.endWith}});var Soe=XN();Object.defineProperty(v,"every",{enumerable:!0,get:function(){return Soe.every}});var Toe=n2();Object.defineProperty(v,"exhaust",{enumerable:!0,get:function(){return Toe.exhaust}});var Coe=j1();Object.defineProperty(v,"exhaustAll",{enumerable:!0,get:function(){return Coe.exhaustAll}});var xoe=U1();Object.defineProperty(v,"exhaustMap",{enumerable:!0,get:function(){return xoe.exhaustMap}});var Ooe=i2();Object.defineProperty(v,"expand",{enumerable:!0,get:function(){return Ooe.expand}});var Ioe=ho();Object.defineProperty(v,"filter",{enumerable:!0,get:function(){return Ioe.filter}});var Poe=s2();Object.defineProperty(v,"finalize",{enumerable:!0,get:function(){return Poe.finalize}});var koe=z1();Object.defineProperty(v,"find",{enumerable:!0,get:function(){return koe.find}});var Roe=a2();Object.defineProperty(v,"findIndex",{enumerable:!0,get:function(){return Roe.findIndex}});var Noe=c2();Object.defineProperty(v,"first",{enumerable:!0,get:function(){return Noe.first}});var Moe=u2();Object.defineProperty(v,"groupBy",{enumerable:!0,get:function(){return Moe.groupBy}});var Doe=L1();Object.defineProperty(v,"ignoreElements",{enumerable:!0,get:function(){return Doe.ignoreElements}});var Loe=d2();Object.defineProperty(v,"isEmpty",{enumerable:!0,get:function(){return Loe.isEmpty}});var Foe=f2();Object.defineProperty(v,"last",{enumerable:!0,get:function(){return Foe.last}});var qoe=Ui();Object.defineProperty(v,"map",{enumerable:!0,get:function(){return qoe.map}});var Boe=F1();Object.defineProperty(v,"mapTo",{enumerable:!0,get:function(){return Boe.mapTo}});var Uoe=h2();Object.defineProperty(v,"materialize",{enumerable:!0,get:function(){return Uoe.materialize}});var joe=p2();Object.defineProperty(v,"max",{enumerable:!0,get:function(){return joe.max}});var zoe=su();Object.defineProperty(v,"mergeAll",{enumerable:!0,get:function(){return zoe.mergeAll}});var Hoe=m2();Object.defineProperty(v,"flatMap",{enumerable:!0,get:function(){return Hoe.flatMap}});var Goe=Zn();Object.defineProperty(v,"mergeMap",{enumerable:!0,get:function(){return Goe.mergeMap}});var Voe=y2();Object.defineProperty(v,"mergeMapTo",{enumerable:!0,get:function(){return Voe.mergeMapTo}});var Woe=v2();Object.defineProperty(v,"mergeScan",{enumerable:!0,get:function(){return Woe.mergeScan}});var Koe=E2();Object.defineProperty(v,"mergeWith",{enumerable:!0,get:function(){return Koe.mergeWith}});var Joe=A2();Object.defineProperty(v,"min",{enumerable:!0,get:function(){return Joe.min}});var Qoe=Q0();Object.defineProperty(v,"multicast",{enumerable:!0,get:function(){return Qoe.multicast}});var Yoe=nu();Object.defineProperty(v,"observeOn",{enumerable:!0,get:function(){return Yoe.observeOn}});var $oe=T2();Object.defineProperty(v,"onErrorResumeNextWith",{enumerable:!0,get:function(){return $oe.onErrorResumeNextWith}});var Zoe=C2();Object.defineProperty(v,"pairwise",{enumerable:!0,get:function(){return Zoe.pairwise}});var Xoe=x2();Object.defineProperty(v,"pluck",{enumerable:!0,get:function(){return Xoe.pluck}});var eae=O2();Object.defineProperty(v,"publish",{enumerable:!0,get:function(){return eae.publish}});var tae=I2();Object.defineProperty(v,"publishBehavior",{enumerable:!0,get:function(){return tae.publishBehavior}});var rae=P2();Object.defineProperty(v,"publishLast",{enumerable:!0,get:function(){return rae.publishLast}});var nae=R2();Object.defineProperty(v,"publishReplay",{enumerable:!0,get:function(){return nae.publishReplay}});var iae=N2();Object.defineProperty(v,"raceWith",{enumerable:!0,get:function(){return iae.raceWith}});var sae=tc();Object.defineProperty(v,"reduce",{enumerable:!0,get:function(){return sae.reduce}});var oae=D2();Object.defineProperty(v,"repeat",{enumerable:!0,get:function(){return oae.repeat}});var aae=F2();Object.defineProperty(v,"repeatWhen",{enumerable:!0,get:function(){return aae.repeatWhen}});var cae=B2();Object.defineProperty(v,"retry",{enumerable:!0,get:function(){return cae.retry}});var lae=j2();Object.defineProperty(v,"retryWhen",{enumerable:!0,get:function(){return lae.retryWhen}});var uae=KE();Object.defineProperty(v,"refCount",{enumerable:!0,get:function(){return uae.refCount}});var dae=V1();Object.defineProperty(v,"sample",{enumerable:!0,get:function(){return dae.sample}});var fae=H2();Object.defineProperty(v,"sampleTime",{enumerable:!0,get:function(){return fae.sampleTime}});var hae=G2();Object.defineProperty(v,"scan",{enumerable:!0,get:function(){return hae.scan}});var pae=W2();Object.defineProperty(v,"sequenceEqual",{enumerable:!0,get:function(){return pae.sequenceEqual}});var mae=K1();Object.defineProperty(v,"share",{enumerable:!0,get:function(){return mae.share}});var gae=Q2();Object.defineProperty(v,"shareReplay",{enumerable:!0,get:function(){return gae.shareReplay}});var yae=Y2();Object.defineProperty(v,"single",{enumerable:!0,get:function(){return yae.single}});var vae=$2();Object.defineProperty(v,"skip",{enumerable:!0,get:function(){return vae.skip}});var bae=Z2();Object.defineProperty(v,"skipLast",{enumerable:!0,get:function(){return bae.skipLast}});var _ae=eM();Object.defineProperty(v,"skipUntil",{enumerable:!0,get:function(){return _ae.skipUntil}});var Eae=tM();Object.defineProperty(v,"skipWhile",{enumerable:!0,get:function(){return Eae.skipWhile}});var Aae=nM();Object.defineProperty(v,"startWith",{enumerable:!0,get:function(){return Aae.startWith}});var wae=iu();Object.defineProperty(v,"subscribeOn",{enumerable:!0,get:function(){return wae.subscribeOn}});var Sae=sM();Object.defineProperty(v,"switchAll",{enumerable:!0,get:function(){return Sae.switchAll}});var Tae=du();Object.defineProperty(v,"switchMap",{enumerable:!0,get:function(){return Tae.switchMap}});var Cae=aM();Object.defineProperty(v,"switchMapTo",{enumerable:!0,get:function(){return Cae.switchMapTo}});var xae=cM();Object.defineProperty(v,"switchScan",{enumerable:!0,get:function(){return xae.switchScan}});var Oae=lu();Object.defineProperty(v,"take",{enumerable:!0,get:function(){return Oae.take}});var Iae=H1();Object.defineProperty(v,"takeLast",{enumerable:!0,get:function(){return Iae.takeLast}});var Pae=lM();Object.defineProperty(v,"takeUntil",{enumerable:!0,get:function(){return Pae.takeUntil}});var kae=uM();Object.defineProperty(v,"takeWhile",{enumerable:!0,get:function(){return kae.takeWhile}});var Rae=dM();Object.defineProperty(v,"tap",{enumerable:!0,get:function(){return Rae.tap}});var Nae=J1();Object.defineProperty(v,"throttle",{enumerable:!0,get:function(){return Nae.throttle}});var Mae=hM();Object.defineProperty(v,"throttleTime",{enumerable:!0,get:function(){return Mae.throttleTime}});var Dae=uu();Object.defineProperty(v,"throwIfEmpty",{enumerable:!0,get:function(){return Dae.throwIfEmpty}});var Lae=mM();Object.defineProperty(v,"timeInterval",{enumerable:!0,get:function(){return Lae.timeInterval}});var Fae=wp();Object.defineProperty(v,"timeout",{enumerable:!0,get:function(){return Fae.timeout}});var qae=gM();Object.defineProperty(v,"timeoutWith",{enumerable:!0,get:function(){return qae.timeoutWith}});var Bae=yM();Object.defineProperty(v,"timestamp",{enumerable:!0,get:function(){return Bae.timestamp}});var Uae=R1();Object.defineProperty(v,"toArray",{enumerable:!0,get:function(){return Uae.toArray}});var jae=_M();Object.defineProperty(v,"window",{enumerable:!0,get:function(){return jae.window}});var zae=AM();Object.defineProperty(v,"windowCount",{enumerable:!0,get:function(){return zae.windowCount}});var Hae=SM();Object.defineProperty(v,"windowTime",{enumerable:!0,get:function(){return Hae.windowTime}});var Gae=xM();Object.defineProperty(v,"windowToggle",{enumerable:!0,get:function(){return Gae.windowToggle}});var Vae=IM();Object.defineProperty(v,"windowWhen",{enumerable:!0,get:function(){return Vae.windowWhen}});var Wae=NM();Object.defineProperty(v,"withLatestFrom",{enumerable:!0,get:function(){return Wae.withLatestFrom}});var Kae=MM();Object.defineProperty(v,"zipAll",{enumerable:!0,get:function(){return Kae.zipAll}});var Jae=LM();Object.defineProperty(v,"zipWith",{enumerable:!0,get:function(){return Jae.zipWith}})});var GL=g((XSe,sw)=>{"use strict";var ide=Object.prototype.hasOwnProperty,Jt="~";function Gu(){}Object.create&&(Gu.prototype=Object.create(null),new Gu().__proto__||(Jt=!1));function sde(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function HL(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new sde(t,n||r,i),o=Jt?Jt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function qg(r,e){--r._eventsCount===0?r._events=new Gu:delete r._events[e]}function Nt(){this._events=new Gu,this._eventsCount=0}Nt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)ide.call(t,n)&&e.push(Jt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Nt.prototype.listeners=function(e){var t=Jt?Jt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};Nt.prototype.listenerCount=function(e){var t=Jt?Jt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Nt.prototype.emit=function(e,t,n,i,s,o){var a=Jt?Jt+e:e;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,h;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];c[d].fn.apply(c[d].context,u)}}return!0};Nt.prototype.on=function(e,t,n){return HL(this,e,t,n,!1)};Nt.prototype.once=function(e,t,n){return HL(this,e,t,n,!0)};Nt.prototype.removeListener=function(e,t,n,i){var s=Jt?Jt+e:e;if(!this._events[s])return this;if(!t)return qg(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&qg(this,s);else{for(var a=0,c=[],l=o.length;a<l;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:qg(this,s)}return this};Nt.prototype.removeAllListeners=function(e){var t;return e?(t=Jt?Jt+e:e,this._events[t]&&qg(this,t)):(this._events=new Gu,this._eventsCount=0),this};Nt.prototype.off=Nt.prototype.removeListener;Nt.prototype.addListener=Nt.prototype.on;Nt.prefixed=Jt;Nt.EventEmitter=Nt;typeof sw<"u"&&(sw.exports=Nt)});var uw=g(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.ChainIdToType=ve.ChainTypeToChainId=ve.ChainId=ve.NonEthChainId=ve.BTCChainId=ve.StarknetChainId=ve.CosmosChainId=ve.FuelChainId=ve.SolanaChainId=ve.SuiChainId=ve.AptosChainId=ve.EthChainId=ve.ChainType=void 0;ve.getChainType=ode;ve.isChainType=ade;var On;(function(r){r.SOLANA="solana",r.SUI="sui",r.APTOS="aptos",r.ETH="evm",r.BTC="btc",r.COSMOS="cosmos",r.STARKNET="starknet",r.FUEL="fuel"})(On||(ve.ChainType=On={}));var Bg;(function(r){r.ETHEREUM="1",r.OPTIMISM="10",r.CRONOS="25",r.BSC="56",r.BSC_TESTNET="97",r.UNICHAIN="130",r.POLYGON="137",r.MANTA_PACIFIC="169",r.XLAYER_TESTNET="195",r.XLAYER_MAINNET="196",r.OP_BNB_MAINNET="204",r.SONIC_MAINNET="146",r.SONIC_TESTNET="57054",r.B2_MAINNET="223",r.FRAXTAL="252",r.KUCOIN="321",r.CRONOS_ZKEVM="388",r.ZKSYNC_ERA="324",r.CRONOS_TESTNET="338",r.ASTAR="592",r.DERIVE="957",r.HYPER_EVM="999",r.POLYGON_ZKEVM="1101",r.CONFLUX="1030",r.METIS="1088",r.CORE_MAINNET="1116",r.MOONBEAM="1284",r.UNICHAIN_SEPOLIA="1301",r.SEI="1329",r.SONEIUM_TESTNET="1946",r.SONEIUM_MAINNET="1868",r.SWELL_TESTNET="1924",r.SWELL_MAINNET="1923",r.TAC_TESTNET="2390",r.KARAK="2410",r.BEVM="11501",r.MERLIN_MAINNET="4200",r.MANTLE="5000",r.BASE="8453",r.MEV_COMMIT="8855",r.PLASMA_MAINNET="9745",r.PLASMA_TESTNET="9746",r.MONAD_TESTNET="10143",r.HOLESKY="17000",r.HOODI="560048",r.MODE="34443",r.ARBITRUM="42161",r.HEMI="43111",r.AVALANCHE="43114",r.ZIRCUIT_GARFIELD_TESTNET="48898",r.ZIRCUIT_MAINNET="48900",r.BOB="60808",r.LINEA="59144",r.BERACHAIN="80094",r.BLAST="81457",r.CHILIZ="88888",r.TAIKO="167000",r.KATANA_MAINNET="747474",r.BITLAYER="200901",r.SCROLL="534352",r.ZKLINK_NOVA="810180",r.SEPOLIA="11155111",r.ETHERLINK="42793",r.CORN_MAIZENET="21000000",r.AURORA="1313161554",r.BLAST_SEPOLIA="168587773",r.ABSTRACT="2741",r.CUSTOM="customized"})(Bg||(ve.EthChainId=Bg={}));var Ug;(function(r){r.APTOS_MAINNET="aptos_mainnet",r.APTOS_TESTNET="aptos_testnet",r.APTOS_MOVEMENT_TESTNET="aptos_movement_testnet",r.APTOS_MOVEMENT_MAINNET="aptos_movement_mainnet",r.INITIA_ECHELON="aptos_echelon"})(Ug||(ve.AptosChainId=Ug={}));var jg;(function(r){r.SUI_MAINNET="sui_mainnet",r.SUI_TESTNET="sui_testnet",r.IOTA_MAINNET="iota_mainnet",r.IOTA_TESTNET="iota_testnet"})(jg||(ve.SuiChainId=jg={}));var zg;(function(r){r.SOLANA_MAINNET="sol_mainnet",r.SOLANA_TESTNET="sol_testnet",r.SOLANA_PYTH="sol_pyth"})(zg||(ve.SolanaChainId=zg={}));var Hg;(function(r){r.FUEL_MAINNET="fuel_mainnet",r.FUEL_TESTNET="fuel_testnet"})(Hg||(ve.FuelChainId=Hg={}));var Gg;(function(r){r.INJECTIVE_MAINNET="injective_mainnet",r.INJECTIVE_TESTNET="injective_testnet"})(Gg||(ve.CosmosChainId=Gg={}));var Vg;(function(r){r.STARKNET_MAINNET="starknet_mainnet",r.STARKNET_SEPOLIA="starknet_sepolia"})(Vg||(ve.StarknetChainId=Vg={}));var Wg;(function(r){r.BTC_MAINNET="btc_mainnet",r.BTC_TESTNET="btc_testnet"})(Wg||(ve.BTCChainId=Wg={}));ve.NonEthChainId={...Ug,...jg,...zg,...Hg,...Gg,...Vg,...Wg};ve.ChainId={...Bg,...ve.NonEthChainId};ve.ChainTypeToChainId={[On.SOLANA]:zg,[On.SUI]:jg,[On.COSMOS]:Gg,[On.STARKNET]:Vg,[On.ETH]:Bg,[On.APTOS]:Ug,[On.BTC]:Wg,[On.FUEL]:Hg};ve.ChainIdToType=new Map;for(let[r,e]of Object.entries(ve.ChainTypeToChainId))for(let t of Object.values(e))ve.ChainIdToType.set(t,r);function ode(r){let e=String(r).toLowerCase(),t=ve.ChainIdToType.get(e);if(!t)throw new Error(`Invalid chainType: ${e}`);return t}function ade(r,e){let t=String(r).toLowerCase(),n=ve.ChainIdToType.get(t);return n?n===e:!1}});var dw=g(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.ChainInfo=re.NonEthChainInfo=re.CosmosChainInfo=re.StarknetChainInfo=re.FuelChainInfo=re.SuiChainInfo=re.SolanaChainInfo=re.AptosChainInfo=re.BTCChainInfo=re.EthChainInfo=re.EthVariation=re.ExplorerApiType=void 0;re.getChainExternalUrl=_de;re.getChainBlockscoutUrl=Ede;re.getSuiscanUrl=Ade;re.getChainLogo=Sde;re.getMainnetChain=Tde;var w=uw(),ee;(function(r){r.ETHERSCAN="etherscan",r.ETHERSCAN_V2="etherscan_v2",r.BLOCKSCOUT="blockscout",r.L2_SCAN="l2scan",r.OK_LINK="oklink",r.UNKNOWN="unknown"})(ee||(re.ExplorerApiType=ee={}));var Q;(function(r){r[r.DEFAULT=0]="DEFAULT",r[r.ARBITRUM=1]="ARBITRUM",r[r.OPTIMISM=2]="OPTIMISM",r[r.ZKSYNC=3]="ZKSYNC",r[r.POLYGON_ZKEVM=4]="POLYGON_ZKEVM",r[r.SUBSTRATE=5]="SUBSTRATE"})(Q||(re.EthVariation=Q={}));re.EthChainInfo={[w.EthChainId.ETHEREUM]:{name:"Ethereum",slug:"mainnet",additionalSlugs:["ethereum"],chainId:w.EthChainId.ETHEREUM,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://etherscan.io",explorerApi:"https://api.etherscan.io/v2",blockscoutUrl:"https://eth.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/eth.svg",darkIcon:"https://assets.sentio.xyz/chains/eth-dark.svg"},[w.EthChainId.SEPOLIA]:{name:"Sepolia",slug:"sepolia",chainId:w.EthChainId.SEPOLIA,mainnetChainId:w.EthChainId.ETHEREUM,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x1ef5f52bdbe11af2377c58ecc914a8c72ea807cf",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://sepolia.etherscan.io",explorerApi:"https://api.etherscan.io/v2",blockscoutUrl:"https://eth-sepolia.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/eth.svg",darkIcon:"https://assets.sentio.xyz/chains/eth-dark.svg"},[w.EthChainId.HOLESKY]:{name:"Holesky",slug:"holesky",chainId:w.EthChainId.HOLESKY,mainnetChainId:w.EthChainId.ETHEREUM,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x94373a4919B3240D86eA41593D5eBa789FEF3848",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://holesky.etherscan.io",explorerApi:"https://api.etherscan.io/v2",blockscoutUrl:"https://eth-holesky.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/eth.svg",darkIcon:"https://assets.sentio.xyz/chains/eth-dark.svg"},[w.EthChainId.HOODI]:{name:"Hoodi",slug:"hoodi",chainId:w.EthChainId.HOODI,mainnetChainId:w.EthChainId.ETHEREUM,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://hoodi.etherscan.io",explorerApi:"https://api.etherscan.io/v2",blockscoutUrl:"https://light-hoodi.beaconcha.in",lightIcon:"https://assets.sentio.xyz/chains/eth.svg",darkIcon:"https://assets.sentio.xyz/chains/eth-dark.svg"},[w.EthChainId.BSC]:{name:"Binance Smart Chain",slug:"bsc",chainId:w.EthChainId.BSC,variation:Q.DEFAULT,priceTokenAddress:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",tokenSymbol:"BNB",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://bscscan.com",explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/bnb-chain.svg"},[w.EthChainId.BSC_TESTNET]:{name:"Binance Smart Chain Testnet",slug:"bsc-testnet",chainId:w.EthChainId.BSC_TESTNET,mainnetChainId:w.EthChainId.BSC,variation:Q.DEFAULT,priceTokenAddress:"0xae13d989dac2f0debff460ac112a837c89baa7cd",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xae13d989dac2f0debff460ac112a837c89baa7cd",tokenSymbol:"tBNB",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://testnet.bscscan.com",explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/bnb-chain.svg"},[w.EthChainId.OP_BNB_MAINNET]:{name:"opBNB Mainnet",slug:"opbnb",chainId:w.EthChainId.OP_BNB_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"BNB",tokenDecimals:18,explorerUrl:"https://opbnb.bscscan.com",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/bnb-chain.svg"},[w.EthChainId.POLYGON]:{name:"Polygon",slug:"matic",additionalSlugs:["polygon"],chainId:w.EthChainId.POLYGON,variation:Q.DEFAULT,priceTokenAddress:"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",tokenSymbol:"MATIC",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://polygonscan.com",explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/polygon.svg"},[w.EthChainId.ARBITRUM]:{name:"Arbitrum",slug:"arbitrum-one",additionalSlugs:["arbitrum"],chainId:w.EthChainId.ARBITRUM,variation:Q.ARBITRUM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://arbiscan.io",explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/arbitrum.svg"},[w.EthChainId.AVALANCHE]:{name:"Avalanche",slug:"avalanche",chainId:w.EthChainId.AVALANCHE,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.ETHERSCAN,explorerUrl:"https://snowtrace.io",explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan",lightIcon:"https://assets.sentio.xyz/chains/avalanche.svg"},[w.EthChainId.POLYGON_ZKEVM]:{name:"Polygon zkEVM",chainId:w.EthChainId.POLYGON_ZKEVM,slug:"polygon-zkevm",variation:Q.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.BLOCKSCOUT,explorerUrl:"https://polygon.blockscout.com",explorerApi:"https://polygon.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/polygon.svg"},[w.EthChainId.MOONBEAM]:{name:"Moonbeam",slug:"moonbeam",chainId:w.EthChainId.MOONBEAM,variation:Q.SUBSTRATE,priceTokenAddress:"0xacc15dc74880c9944775448304b263d191c6077f",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xacc15dc74880c9944775448304b263d191c6077f",tokenSymbol:"GLMR",tokenDecimals:18,explorerApiType:ee.ETHERSCAN_V2,explorerUrl:"https://moonscan.io",explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/moonbeam.svg"},[w.EthChainId.ASTAR]:{name:"Astar",slug:"astar",chainId:w.EthChainId.ASTAR,variation:Q.SUBSTRATE,priceTokenAddress:"0xaeaaf0e2c81af264101b9129c00f4440ccf0f720",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xaeaaf0e2c81af264101b9129c00f4440ccf0f720",tokenSymbol:"ASTR",tokenDecimals:18,explorerApiType:ee.BLOCKSCOUT,explorerUrl:"https://astar.blockscout.com",explorerApi:"https://astar.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/astar.svg"},[w.EthChainId.LINEA]:{name:"Linea",slug:"linea",chainId:w.EthChainId.LINEA,variation:Q.DEFAULT,priceTokenAddress:"0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://lineascan.build",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/linea.svg",darkIcon:"https://assets.sentio.xyz/chains/linea-dark.svg"},[w.EthChainId.SCROLL]:{name:"Scroll",slug:"scroll",chainId:w.EthChainId.SCROLL,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x5300000000000000000000000000000000000004",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://scrollscan.com",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/scroll.svg"},[w.EthChainId.TAIKO]:{name:"Taiko Mainnet",slug:"taiko",chainId:w.EthChainId.TAIKO,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xA51894664A773981C6C112C43ce576f315d5b1B6",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://taikoscan.io",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/taiko.svg"},[w.EthChainId.XLAYER_TESTNET]:{name:"X Layer Testnet",slug:"xlayer-sepolia",chainId:w.EthChainId.XLAYER_TESTNET,mainnetChainId:w.EthChainId.XLAYER_MAINNET,variation:Q.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xa749ad81913cdc19881ebeb64631df72be708335",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://www.oklink.com/xlayer-test",explorerApiType:ee.OK_LINK,explorerApi:"https://www.oklink.com/api/v5/explorer",lightIcon:"https://assets.sentio.xyz/chains/x1-logo.png"},[w.EthChainId.CORE_MAINNET]:{name:"Core",slug:"core-mainnet",chainId:w.EthChainId.CORE_MAINNET,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x40375c92d9faf44d2f9db9bd9ba41a3317a2404f",tokenSymbol:"CORE",tokenDecimals:18,explorerApiType:ee.UNKNOWN,explorerUrl:"https://scan.coredao.org",lightIcon:"https://assets.sentio.xyz/chains/core.svg"},[w.EthChainId.XLAYER_MAINNET]:{name:"X Layer Mainnet",slug:"xlayer-mainnet",chainId:w.EthChainId.XLAYER_MAINNET,variation:Q.POLYGON_ZKEVM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x5a77f1443d16ee5761d310e38b62f77f726bc71c",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://www.oklink.com/xlayer",explorerApiType:ee.OK_LINK,explorerApi:"https://www.oklink.com/api/v5/explorer",lightIcon:"https://assets.sentio.xyz/chains/x1-logo.png"},[w.EthChainId.BLAST]:{name:"Blast Mainnet",slug:"blast-mainnet",chainId:w.EthChainId.BLAST,variation:Q.OPTIMISM,priceTokenAddress:"0x4300000000000000000000000000000000000004",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4300000000000000000000000000000000000004",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://blastscan.io",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/blast-logo.png"},[w.EthChainId.BLAST_SEPOLIA]:{name:"Blast Testnet",slug:"blast-testnet",chainId:w.EthChainId.BLAST_SEPOLIA,mainnetChainId:w.EthChainId.BLAST,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000023",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000023",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://sepolia.blastscan.io",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/blast-logo.png"},[w.EthChainId.BASE]:{name:"Base",slug:"base",chainId:w.EthChainId.BASE,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://basescan.org",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/base.svg",darkIcon:"https://assets.sentio.xyz/chains/base_blue.svg"},[w.EthChainId.ZKSYNC_ERA]:{name:"zkSync Era",slug:"zksync-era",chainId:w.EthChainId.ZKSYNC_ERA,variation:Q.ZKSYNC,priceTokenAddress:"0x000000000000000000000000000000000000800A",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.zksync.io",explorerApiType:ee.ETHERSCAN,explorerApi:"https://block-explorer-api.mainnet.zksync.io",lightIcon:"https://assets.sentio.xyz/chains/zksync.svg"},[w.EthChainId.KATANA_MAINNET]:{name:"Katana Mainnet",slug:"katana",chainId:w.EthChainId.KATANA_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://katanascan.com",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/katana.svg"},[w.EthChainId.ZIRCUIT_GARFIELD_TESTNET]:{name:"Zircuit Garfield Testnet",slug:"zircuit-garfield-testnet",chainId:w.EthChainId.ZIRCUIT_GARFIELD_TESTNET,mainnetChainId:w.EthChainId.ZIRCUIT_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.garfield-testnet.zircuit.com",lightIcon:"https://assets.sentio.xyz/chains/zircuit-inverted-icon.svg",darkIcon:"https://assets.sentio.xyz/chains/zircuit-green-icon.svg"},[w.EthChainId.ZIRCUIT_MAINNET]:{name:"Zircuit Mainnet",slug:"zircuit",chainId:w.EthChainId.ZIRCUIT_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.zircuit.com",lightIcon:"https://assets.sentio.xyz/chains/zircuit-inverted-icon.svg",darkIcon:"https://assets.sentio.xyz/chains/zircuit-green-icon.svg"},[w.EthChainId.OPTIMISM]:{name:"Optimism Mainnet",slug:"optimism",chainId:w.EthChainId.OPTIMISM,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://optimistic.etherscan.io",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/optimism.svg"},[w.EthChainId.CRONOS]:{name:"Cronos Mainnet",slug:"cronos",chainId:w.EthChainId.CRONOS,variation:Q.DEFAULT,priceTokenAddress:"0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23",tokenSymbol:"CRO",tokenDecimals:18,explorerUrl:"https://explorer.cronos.org",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/cronos.svg",darkIcon:"https://assets.sentio.xyz/chains/cronos_light.svg"},[w.EthChainId.CRONOS_TESTNET]:{name:"Cronos Testnet",slug:"cronos-testnet",chainId:w.EthChainId.CRONOS_TESTNET,mainnetChainId:w.EthChainId.CRONOS,variation:Q.DEFAULT,priceTokenAddress:"0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4",tokenSymbol:"CRO",tokenDecimals:18,explorerUrl:"https://explorer.cronos.org/testnet",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/cronos.svg",darkIcon:"https://assets.sentio.xyz/chains/cronos_light.svg"},[w.EthChainId.BITLAYER]:{name:"Bitlayer Mainnet",slug:"bitlayer",chainId:w.EthChainId.BITLAYER,variation:Q.DEFAULT,priceTokenAddress:"0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://www.btrscan.com",explorerApiType:ee.ETHERSCAN,explorerApi:"https://api.btrscan.com/scan",lightIcon:"https://assets.sentio.xyz/chains/bitlayer.svg"},[w.EthChainId.MANTA_PACIFIC]:{name:"Manta Pacific",slug:"manta-pacific-mainnet",chainId:w.EthChainId.MANTA_PACIFIC,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://pacific-explorer.manta.network",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://pacific-explorer.manta.network",lightIcon:"https://assets.sentio.xyz/chains/manta.png"},[w.EthChainId.MANTLE]:{name:"Mantle",slug:"mantle",chainId:w.EthChainId.MANTLE,variation:Q.OPTIMISM,priceTokenAddress:"0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8",tokenSymbol:"MNT",tokenDecimals:18,explorerUrl:"https://mantlescan.xyz",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/mantle.svg",darkIcon:"https://assets.sentio.xyz/chains/mantle-white.svg"},[w.EthChainId.B2_MAINNET]:{name:"B2 Mainnet",slug:"b2-mainnet",chainId:w.EthChainId.B2_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://explorer.bsquared.network",explorerApiType:ee.L2_SCAN,explorerApi:"https://explorer.bsquared.network/api",lightIcon:"https://assets.sentio.xyz/chains/b2.svg"},[w.EthChainId.MODE]:{name:"Mode Mainnet",slug:"mode-mainnet",chainId:w.EthChainId.MODE,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://modescan.io",explorerApiType:ee.ETHERSCAN,explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan",lightIcon:"https://assets.sentio.xyz/chains/mode.svg",darkIcon:"https://assets.sentio.xyz/chains/mode-dark.svg"},[w.EthChainId.BOB]:{name:"Bob Mainnet",slug:"bob",chainId:w.EthChainId.BOB,variation:Q.OPTIMISM,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.gobob.xyz",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://explorer.gobob.xyz",lightIcon:"https://assets.sentio.xyz/chains/bob.svg"},[w.EthChainId.FRAXTAL]:{name:"Fraxtal Mainnet",slug:"frax-mainnet",chainId:w.EthChainId.FRAXTAL,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xFC00000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://fraxscan.com",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/fraxtal.svg"},[w.EthChainId.KUCOIN]:{name:"KCC Mainnet",slug:"kucoin",chainId:w.EthChainId.KUCOIN,variation:Q.DEFAULT,priceTokenAddress:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521",tokenSymbol:"KCS",tokenDecimals:18,explorerUrl:"https://scan.kcc.io",explorerApiType:ee.ETHERSCAN,explorerApi:"https://scan.kcc.io",lightIcon:"https://assets.sentio.xyz/chains/kcc.svg"},[w.EthChainId.CONFLUX]:{name:"Conflux eSpace",slug:"conflux-espace",chainId:w.EthChainId.CONFLUX,variation:Q.DEFAULT,priceTokenAddress:"0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b",tokenSymbol:"CFX",tokenDecimals:18,explorerUrl:"https://evm.confluxscan.io",explorerApiType:ee.ETHERSCAN,explorerApi:"https://evmapi.confluxscan.io",lightIcon:"https://assets.sentio.xyz/chains/conflux.svg",darkIcon:"https://assets.sentio.xyz/chains/conflux-white.svg"},[w.EthChainId.METIS]:{name:"Metis",slug:"metis",chainId:w.EthChainId.METIS,variation:Q.DEFAULT,priceTokenAddress:"0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481",tokenSymbol:"METIS",tokenDecimals:18,explorerUrl:"https://explorer.metis.io",explorerApiType:ee.ETHERSCAN,explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/",lightIcon:"https://assets.sentio.xyz/chains/metis.svg"},[w.EthChainId.BEVM]:{name:"BEVM",slug:"bevm",chainId:w.EthChainId.BEVM,variation:Q.SUBSTRATE,priceTokenAddress:"0xB5136FEba197f5fF4B765E5b50c74db717796dcD",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xB5136FEba197f5fF4B765E5b50c74db717796dcD",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://scan.bevm.io",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://scan.bevm.io",lightIcon:"https://assets.sentio.xyz/chains/bevm.svg"},[w.EthChainId.MERLIN_MAINNET]:{name:"Merlin Mainnet",slug:"merlin",chainId:w.EthChainId.MERLIN_MAINNET,variation:Q.POLYGON_ZKEVM,priceTokenAddress:"0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA",tokenSymbol:"BTC",tokenDecimals:18,explorerUrl:"https://scan.merlinchain.io",explorerApiType:ee.L2_SCAN,explorerApi:"https://scan.merlinchain.io/api",lightIcon:"https://assets.sentio.xyz/chains/merlin.png"},[w.EthChainId.CHILIZ]:{name:"Chiliz",slug:"chiliz",chainId:w.EthChainId.CHILIZ,variation:Q.DEFAULT,priceTokenAddress:"0x721EF6871f1c4Efe730Dce047D40D1743B886946",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x721EF6871f1c4Efe730Dce047D40D1743B886946",tokenSymbol:"CHZ",tokenDecimals:18,explorerUrl:"https://chiliscan.com",explorerApiType:ee.ETHERSCAN,explorerApi:"https://api.routescan.io/v2/network/mainnet/evm/88888/etherscan",lightIcon:"https://assets.sentio.xyz/chains/chiliz.svg"},[w.EthChainId.ZKLINK_NOVA]:{name:"zkLink Nova",slug:"zklink-nova",chainId:w.EthChainId.ZKLINK_NOVA,variation:Q.ZKSYNC,priceTokenAddress:"0x000000000000000000000000000000000000800A",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.zklink.io",explorerApiType:ee.ETHERSCAN,explorerApi:"https://explorer-api.zklink.io",lightIcon:"https://assets.sentio.xyz/chains/zklink.svg"},[w.EthChainId.AURORA]:{name:"Aurora",slug:"aurora",chainId:w.EthChainId.AURORA,variation:Q.DEFAULT,priceTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.aurora.dev",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://explorer.aurora.dev",lightIcon:"https://assets.sentio.xyz/chains/aurora.svg"},[w.EthChainId.SONIC_MAINNET]:{name:"Sonic Mainnet",slug:"sonic-mainnet",chainId:w.EthChainId.SONIC_MAINNET,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"S",tokenDecimals:18,explorerUrl:"https://sonicscan.org",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/sonic.svg",darkIcon:"https://assets.sentio.xyz/chains/sonic-dark.svg"},[w.EthChainId.SONIC_TESTNET]:{name:"Sonic Testnet",slug:"sonic-testnet",chainId:w.EthChainId.SONIC_TESTNET,mainnetChainId:w.EthChainId.SONIC_MAINNET,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"S",tokenDecimals:18,explorerUrl:"https://testnet.sonicscan.org",explorerApiType:ee.ETHERSCAN_V2,explorerApi:"https://api.etherscan.io/v2",lightIcon:"https://assets.sentio.xyz/chains/sonic.svg",darkIcon:"https://assets.sentio.xyz/chains/sonic-dark.svg"},[w.EthChainId.SONEIUM_MAINNET]:{name:"Soneium Mainnet",slug:"soneium-mainnet",chainId:w.EthChainId.SONEIUM_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://soneium.blockscout.com",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://soneium.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/soneium.svg"},[w.EthChainId.SONEIUM_TESTNET]:{name:"Soneium Testnet",slug:"soneium-minato",chainId:w.EthChainId.SONEIUM_TESTNET,mainnetChainId:w.EthChainId.SONEIUM_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x728F2745410A56620B50a6E0592743450e08Cac6",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://soneium-minato.blockscout.com",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://soneium-minato.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/soneium.svg"},[w.EthChainId.CRONOS_ZKEVM]:{name:"Cronos zkEVM",slug:"cronos-zkevm",chainId:w.EthChainId.CRONOS_ZKEVM,variation:Q.ZKSYNC,priceTokenAddress:"0x000000000000000000000000000000000000800a",tokenAddress:"0x000000000000000000000000000000000000800a",wrappedTokenAddress:"0xc1bf55ee54e16229d9b369a5502bfe5fc9f20b6d",tokenSymbol:"zkCRO",tokenDecimals:18,explorerUrl:"https://explorer.zkevm.cronos.org",explorerApiType:ee.UNKNOWN,lightIcon:"https://assets.sentio.xyz/chains/cronos.svg",darkIcon:"https://assets.sentio.xyz/chains/cronos_light.svg"},[w.EthChainId.DERIVE]:{name:"Derive Mainnet",slug:"derive-mainnet",chainId:w.EthChainId.DERIVE,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x15CEcd5190A43C7798dD2058308781D0662e678E",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.lyra.finance",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://explorer.lyra.finance",lightIcon:"https://assets.sentio.xyz/chains/derive.svg"},[w.EthChainId.UNICHAIN_SEPOLIA]:{name:"Unichain Sepolia",slug:"unichain-sepolia",chainId:w.EthChainId.UNICHAIN_SEPOLIA,mainnetChainId:w.EthChainId.UNICHAIN,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://unichain-sepolia.blockscout.com",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://unichain-sepolia.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/unichain-testnet.svg"},[w.EthChainId.UNICHAIN]:{name:"Unichain",slug:"unichain-mainnet",chainId:w.EthChainId.UNICHAIN,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://unichain.blockscout.com",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://unichain.blockscout.com",lightIcon:"https://assets.sentio.xyz/chains/unichain.svg"},[w.EthChainId.CORN_MAIZENET]:{name:"Corn Maizenet",slug:"corn-maizenet",chainId:w.EthChainId.CORN_MAIZENET,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"BTCN",tokenDecimals:18,explorerUrl:"https://maizenet-explorer.usecorn.com",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://maizenet-explorer.usecorn.com",lightIcon:"https://assets.sentio.xyz/chains/corn.svg"},[w.EthChainId.KARAK]:{name:"Karak Mainnet",slug:"karak-mainnet",chainId:w.EthChainId.KARAK,variation:Q.DEFAULT,priceTokenAddress:"0x4200000000000000000000000000000000000006",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x4200000000000000000000000000000000000006",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.karak.network",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://explorer.karak.network",lightIcon:"https://assets.sentio.xyz/chains/karak.svg"},[w.EthChainId.SEI]:{name:"Sei Mainnet",slug:"sei",chainId:w.EthChainId.SEI,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://seistream.app",lightIcon:"https://assets.sentio.xyz/chains/sei.svg"},[w.EthChainId.SWELL_MAINNET]:{name:"Swell Mainnet",slug:"swell-mainnet",chainId:w.EthChainId.SWELL_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.swellnetwork.io",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://explorer.swellnetwork.io",lightIcon:"https://assets.sentio.xyz/chains/swell.svg"},[w.EthChainId.SWELL_TESTNET]:{name:"Swell Testnet",slug:"swell-testnet",chainId:w.EthChainId.SWELL_TESTNET,mainnetChainId:w.EthChainId.SWELL_MAINNET,variation:Q.OPTIMISM,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://swell-testnet-explorer.alt.technology",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://swell-testnet-explorer.alt.technology",lightIcon:"https://assets.sentio.xyz/chains/swell.svg"},[w.EthChainId.TAC_TESTNET]:{name:"TAC Testnet",slug:"tac-testnet",chainId:w.EthChainId.TAC_TESTNET,variation:Q.DEFAULT,priceTokenAddress:"0x392D1cCB04d25fCBcA7D4fc0E429Dbc1F9fEe73F",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x392D1cCB04d25fCBcA7D4fc0E429Dbc1F9fEe73F",tokenSymbol:"TAC",tokenDecimals:18,explorerUrl:"https://turin.explorer.tac.build",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://turin.explorer.tac.build",lightIcon:"https://assets.sentio.xyz/chains/tac.svg"},[w.EthChainId.MONAD_TESTNET]:{name:"Monad Testnet",slug:"monad-testnet",chainId:w.EthChainId.MONAD_TESTNET,variation:Q.DEFAULT,priceTokenAddress:"0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",tokenSymbol:"MON",tokenDecimals:18,explorerUrl:"https://testnet.monadexplorer.com",explorerApiType:ee.UNKNOWN,lightIcon:"https://assets.sentio.xyz/chains/monad.svg"},[w.EthChainId.BERACHAIN]:{name:"Berachain",slug:"berachain",chainId:w.EthChainId.BERACHAIN,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"BERA",tokenDecimals:18,explorerUrl:"https://berascan.com",explorerApi:"https://api.etherscan.io/v2",explorerApiType:ee.ETHERSCAN_V2,lightIcon:"https://assets.sentio.xyz/chains/berachain.svg"},[w.EthChainId.HYPER_EVM]:{name:"HyperEVM",slug:"hyperevm",additionalSlugs:["hyper-evm"],chainId:w.EthChainId.HYPER_EVM,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"HYPE",tokenDecimals:18,explorerUrl:"https://hyperevmscan.io",explorerApi:"https://hyperevmscan.io/v2",explorerApiType:ee.ETHERSCAN_V2,lightIcon:"https://assets.sentio.xyz/chains/hype.svg",darkIcon:"https://assets.sentio.xyz/chains/hype-dark.svg"},[w.EthChainId.ETHERLINK]:{name:"Etherlink",slug:"etherlink",chainId:w.EthChainId.ETHERLINK,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0xc9B53AB2679f573e480d01e0f49e2B5CFB7a3EAb",tokenSymbol:"XTZ",tokenDecimals:18,explorerUrl:"https://explorer.etherlink.com",explorerApiType:ee.BLOCKSCOUT,explorerApi:"https://explorer.etherlink.com",lightIcon:"https://assets.sentio.xyz/chains/etherlink.svg"},[w.EthChainId.MEV_COMMIT]:{name:"MEV Commit",slug:"mev-commit",chainId:w.EthChainId.MEV_COMMIT,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://www.mev-commit.xyz",lightIcon:"https://assets.sentio.xyz/chains/mev-commit-dark.svg",darkIcon:"https://assets.sentio.xyz/chains/mev-commit.svg"},[w.EthChainId.HEMI]:{name:"Hemi",slug:"hemi",chainId:w.EthChainId.HEMI,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerApiType:ee.BLOCKSCOUT,explorerUrl:"https://explorer.hemi.xyz",explorerApi:"https://explorer.hemi.xyz",lightIcon:"https://assets.sentio.xyz/chains/hemi.svg",darkIcon:"https://assets.sentio.xyz/chains/hemi.svg"},[w.EthChainId.ABSTRACT]:{name:"Abstract",slug:"abstract",chainId:w.EthChainId.ABSTRACT,variation:Q.DEFAULT,priceTokenAddress:"0x000000000000000000000000000000000000800A",tokenAddress:"0x000000000000000000000000000000000000800A",wrappedTokenAddress:"0x000000000000000000000000000000000000800A",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"https://explorer.mainnet.abs.xyz",lightIcon:"https://assets.sentio.xyz/chains/abstract.svg",darkIcon:"https://assets.sentio.xyz/chains/abstract.svg"},[w.EthChainId.PLASMA_MAINNET]:{name:"Plasma Mainnet",slug:"plasma-mainnet",chainId:w.EthChainId.PLASMA_MAINNET,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x6100E367285b01F48D07953803A2d8dCA5D19873",tokenSymbol:"XPL",tokenDecimals:18,explorerUrl:"https://plasmascan.to",explorerApiType:ee.UNKNOWN,lightIcon:"https://assets.sentio.xyz/chains/plasma.svg",darkIcon:"https://assets.sentio.xyz/chains/plasma-dark.svg"},[w.EthChainId.PLASMA_TESTNET]:{name:"Plasma Testnet",slug:"plasma-testnet",chainId:w.EthChainId.PLASMA_TESTNET,mainnetChainId:w.EthChainId.PLASMA_MAINNET,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x6100E367285b01F48D07953803A2d8dCA5D19873",tokenSymbol:"XPL",tokenDecimals:18,explorerUrl:"https://testnet.plasmascan.to",explorerApiType:ee.UNKNOWN,lightIcon:"https://assets.sentio.xyz/chains/plasma.svg",darkIcon:"https://assets.sentio.xyz/chains/plasma-dark.svg"},[w.EthChainId.CUSTOM]:{name:"Custom",slug:"custom",chainId:w.EthChainId.CUSTOM,variation:Q.DEFAULT,priceTokenAddress:"0x0000000000000000000000000000000000000000",tokenAddress:"0x0000000000000000000000000000000000000000",wrappedTokenAddress:"0x0000000000000000000000000000000000000000",tokenSymbol:"ETH",tokenDecimals:18,explorerUrl:"",lightIcon:"https://assets.sentio.xyz/chains/eth.svg",darkIcon:"https://assets.sentio.xyz/chains/eth-dark.svg"}};function cde(r,e,t){let n=t,i=re.EthChainInfo[r];if(i)return i.explorerApiType===ee.L2_SCAN&&t==="block"&&(n="blocks"),`${i.explorerUrl}/${n}/${e}`}re.BTCChainInfo={[w.BTCChainId.BTC_MAINNET]:{name:"Bitcoin Mainnet",slug:"btc",chainId:w.BTCChainId.BTC_MAINNET,explorerUrl:"https://mempool.space",lightIcon:"https://assets.sentio.xyz/chains/bitcoin.svg"},[w.BTCChainId.BTC_TESTNET]:{name:"Bitcoin Mainnet",slug:"btc-signet",chainId:w.BTCChainId.BTC_TESTNET,explorerUrl:"https://mempool.space/testnet4",lightIcon:"https://assets.sentio.xyz/chains/bitcoin-testnet.svg"}};var lde={block:"block",address:"address",tx:"tx",token:void 0};function ude(r,e,t){let n=re.BTCChainInfo[r]?.explorerUrl,i=lde[t];if(!(!n||!i))return`${n}/${i}/${e}`}re.AptosChainInfo={[w.AptosChainId.APTOS_MAINNET]:{name:"Aptos Mainnet",slug:"aptos",chainId:w.AptosChainId.APTOS_MAINNET,explorerUrl:"https://explorer.aptoslabs.com",suffix:"?network=mainnet",lightIcon:"https://assets.sentio.xyz/chains/aptos.svg",darkIcon:"https://assets.sentio.xyz/chains/aptos-dark.svg"},[w.AptosChainId.APTOS_TESTNET]:{name:"Aptos Testnet",chainId:w.AptosChainId.APTOS_TESTNET,mainnetChainId:w.AptosChainId.APTOS_MAINNET,slug:"aptos-testnet",explorerUrl:"https://explorer.aptoslabs.com",suffix:"?network=testnet",lightIcon:"https://assets.sentio.xyz/chains/aptos.svg",darkIcon:"https://assets.sentio.xyz/chains/aptos-dark.svg"},[w.AptosChainId.APTOS_MOVEMENT_MAINNET]:{name:"Movement Mainnet",slug:"movement",chainId:w.AptosChainId.APTOS_MOVEMENT_MAINNET,explorerUrl:"https://explorer.movementnetwork.xyz",suffix:"?network=mainnet",lightIcon:"https://assets.sentio.xyz/chains/movement.svg",darkIcon:"https://assets.sentio.xyz/chains/movement-dark.svg"},[w.AptosChainId.APTOS_MOVEMENT_TESTNET]:{name:"Movement Testnet",slug:"movement-testnet",chainId:w.AptosChainId.APTOS_MOVEMENT_TESTNET,mainnetChainId:w.AptosChainId.APTOS_MOVEMENT_MAINNET,explorerUrl:"https://explorer.movementnetwork.xyz",suffix:"?network=testnet",lightIcon:"https://assets.sentio.xyz/chains/movement.svg",darkIcon:"https://assets.sentio.xyz/chains/movement-dark.svg"},[w.AptosChainId.INITIA_ECHELON]:{name:"Initia Echelon",slug:"initia-echelon",chainId:w.AptosChainId.INITIA_ECHELON,explorerUrl:"https://scan.initia.xyz/echelon-1",suffix:"",lightIcon:"https://assets.sentio.xyz/chains/initia-echelon.svg"}};var dde={block:"block",address:"account",tx:"txn",token:void 0};function fde(r,e,t){let{explorerUrl:n,suffix:i}=re.AptosChainInfo[r],s=dde[t];if(s)return`${n}/${s}/${e}${i}`}re.SolanaChainInfo={[w.SolanaChainId.SOLANA_MAINNET]:{name:"Solana Mainnet",slug:"solana",chainId:w.SolanaChainId.SOLANA_MAINNET,explorerUrl:"https://solscan.io/",suffix:"",lightIcon:"https://sentio.xyz/solana.svg"},[w.SolanaChainId.SOLANA_TESTNET]:{name:"Solana Testnet",slug:"solana-testnet",chainId:w.SolanaChainId.SOLANA_TESTNET,mainnetChainId:w.SolanaChainId.SOLANA_MAINNET,explorerUrl:"https://solscan.io/",suffix:"?cluster=testnet",lightIcon:"https://sentio.xyz/solana.svg"},[w.SolanaChainId.SOLANA_PYTH]:{name:"Pyth",slug:"pyth",chainId:w.SolanaChainId.SOLANA_PYTH,explorerUrl:"https://solscan.io/",suffix:"?cluster=custom&customUrl=https://pythnet.rpcpool.com",lightIcon:"https://sentio.xyz/pyth.svg"}};var hde={block:"block",address:"address",tx:"tx",token:"token"};function pde(r,e,t){let{explorerUrl:n,suffix:i}=re.SolanaChainInfo[r],s=hde[t];if(s)return`${n}${s}/${e}${i}`}re.SuiChainInfo={[w.SuiChainId.SUI_MAINNET]:{name:"Sui Mainnet",slug:"sui",chainId:w.SuiChainId.SUI_MAINNET,suivisionUrl:"https://suivision.xyz",explorerUrl:"https://suiscan.xyz/mainnet",lightIcon:"https://assets.sentio.xyz/chains/sui.svg",darkIcon:"https://assets.sentio.xyz/chains/sui-dark.svg"},[w.SuiChainId.SUI_TESTNET]:{name:"Sui Testnet",slug:"sui-testnet",chainId:w.SuiChainId.SUI_TESTNET,mainnetChainId:w.SuiChainId.SUI_MAINNET,suivisionUrl:"https://testnet.suivision.xyz",explorerUrl:"https://suiscan.xyz/testnet",lightIcon:"https://assets.sentio.xyz/chains/sui.svg",darkIcon:"https://assets.sentio.xyz/chains/sui-dark.svg"},[w.SuiChainId.IOTA_MAINNET]:{name:"IOTA Mainnet",slug:"iota",chainId:w.SuiChainId.IOTA_MAINNET,suivisionUrl:"",explorerUrl:"https://iotascan.com/mainnet",lightIcon:"https://assets.sentio.xyz/chains/iota.svg",darkIcon:"https://assets.sentio.xyz/chains/iota-dark.svg"},[w.SuiChainId.IOTA_TESTNET]:{name:"IOTA Testnet",slug:"iota-testnet",chainId:w.SuiChainId.IOTA_TESTNET,mainnetChainId:w.SuiChainId.IOTA_MAINNET,suivisionUrl:"",explorerUrl:"https://iotascan.com/testnet",lightIcon:"https://assets.sentio.xyz/chains/iota.svg",darkIcon:"https://assets.sentio.xyz/chains/iota-dark.svg"}};var mde={block:"checkpoint",address:"account",tx:"tx",token:"coin",object:"object"},gde={block:"checkpoint",address:"account",tx:"txblock",token:"coin",object:"object"};function WL(r,e,t){let n=re.SuiChainInfo[r];if(!n||!n.explorerUrl)return;let i=mde[t];if(i)return`${n.explorerUrl}/${i}/${e}`}function yde(r,e,t){let n=re.SuiChainInfo[r];if(!n||!n.suivisionUrl)return;let i=gde[t];if(i)return`${n.suivisionUrl}/${i}/${e}`}re.FuelChainInfo={[w.FuelChainId.FUEL_MAINNET]:{name:"Fuel Mainnet",slug:"fuel",chainId:w.FuelChainId.FUEL_MAINNET,explorerUrl:"https://app.fuel.network",lightIcon:"https://assets.sentio.xyz/chains/fuel.svg"},[w.FuelChainId.FUEL_TESTNET]:{name:"Fuel Testnet",slug:"fuel-testnet",chainId:w.FuelChainId.FUEL_TESTNET,mainnetChainId:w.FuelChainId.FUEL_MAINNET,explorerUrl:"https://app-testnet.fuel.network",lightIcon:"https://assets.sentio.xyz/chains/fuel.svg"}};re.StarknetChainInfo={[w.StarknetChainId.STARKNET_MAINNET]:{name:"Starknet",slug:"starknet",chainId:w.StarknetChainId.STARKNET_MAINNET,explorerUrl:"https://starkscan.co",lightIcon:"https://assets.sentio.xyz/chains/starknet.svg"},[w.StarknetChainId.STARKNET_SEPOLIA]:{name:"Starknet Sepolia",slug:"starknet-sepolia",chainId:w.StarknetChainId.STARKNET_SEPOLIA,explorerUrl:"https://sepolia.starkscan.co",lightIcon:"https://assets.sentio.xyz/chains/starknet.svg"}};re.CosmosChainInfo={[w.CosmosChainId.INJECTIVE_MAINNET]:{name:"Injective",slug:"injective",chainId:w.CosmosChainId.INJECTIVE_MAINNET,explorerUrl:"https://injscan.com/",lightIcon:"https://assets.sentio.xyz/chains/injective.svg"},[w.CosmosChainId.INJECTIVE_TESTNET]:{name:"Injective Testnet",slug:"injective-testnet",chainId:w.CosmosChainId.INJECTIVE_TESTNET,mainnetChainId:w.CosmosChainId.INJECTIVE_MAINNET,explorerUrl:"https://testnet.explorer.injective.network",lightIcon:"https://assets.sentio.xyz/chains/injective.svg"}};re.NonEthChainInfo={...re.BTCChainInfo,...re.AptosChainInfo,...re.SolanaChainInfo,...re.SuiChainInfo,...re.FuelChainInfo,...re.StarknetChainInfo,...re.CosmosChainInfo};re.ChainInfo={...re.EthChainInfo,...re.NonEthChainInfo};var vde={block:"block",address:"account",tx:"tx",token:void 0};function bde(r,e,t){let{explorerUrl:n}=re.FuelChainInfo[r],i=vde[t];if(i)return`${n}/${i}/${e}`}function _de(r,e,t){if(!r||!e||!t)return;let n=r.toString();if(Object.keys(re.EthChainInfo).includes(n))return cde(n,e,t);if(Object.keys(re.BTCChainInfo).includes(n))return ude(n,e,t);if(Object.keys(re.AptosChainInfo).includes(n))return fde(n,e,t);if(Object.keys(re.SolanaChainInfo).includes(n))return pde(n,e,t);if(Object.keys(re.SuiChainInfo).includes(n))return yde(n,e,t)||WL(n,e,t);if(Object.keys(re.FuelChainInfo).includes(n))return bde(n,e,t)}function Ede(r,e,t){if(!r||!e||!t)return;let n=re.EthChainInfo[r];if(n&&n.blockscoutUrl)return`${n.blockscoutUrl}/${t}/${e}`}function Ade(r,e,t){if(!(!r||!e||!t))return WL(r,e,t)}function wde(r,e){let t="https://assets.sentio.xyz/chains/chain-unknown.webp";return r?e&&r?.darkIcon?r.darkIcon:r?.lightIcon?r.lightIcon:t:t}function Sde(r,e){if(!r)return;let t=re.ChainInfo[r.toString()];return wde(t,e)}function Tde(r){let e=re.ChainInfo[r.toString()];return e&&e.mainnetChainId||r}});var KL=g(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});fw.getChainName=xde;var Cde=dw();function xde(r){if(typeof r=="number"&&(r=r.toString()),r){let e=Cde.ChainInfo[r]?.name;if(e)return e}if(typeof r=="string"){let e=r.split("_");if(e.length>1)return e.map(t=>t[0].toUpperCase()+t.slice(1).toLowerCase()).join(" ")}return r||""}});var JL=g(ci=>{"use strict";var Ode=ci&&ci.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),hw=ci&&ci.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ode(e,r,t)};Object.defineProperty(ci,"__esModule",{value:!0});hw(uw(),ci);hw(dw(),ci);hw(KL(),ci)});function kw(r){let e={...Iw.create(),states:ny.create()};return SF(e,r)}function SF(r,e){r.states=r.states||ny.create();for(let t of e)r.counters=Uc(r.counters,t.counters),r.gauges=Uc(r.gauges,t.gauges),r.events=Uc(r.events,t.events),r.exports=Uc(r.exports,t.exports),r.timeseriesResult=Uc(r.timeseriesResult,t.timeseriesResult),r.states={configUpdated:r.states?.configUpdated||t.states?.configUpdated||!1};return r}function Uc(r,e){let t=r||[];if(Array.isArray(e))for(let n of e)t.push(n);return t}function jc(r){return r.message+`
|
31
|
+
`+r.stack}var Kde="user_processor";function iy(r){if(!r.context)throw new Error("null context for eth call");let{chainId:e,address:t,blockTag:n}=r.context;return`${e}|${t}|${n}|${r.calldata}`.toLowerCase()}function Jde(r){let[e,t,n,i,s,o]=r.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/)??[];return{semVer:e,major:parseInt(t),minor:parseInt(n),patch:parseInt(i),prerelease:s,buildmetadata:o}}function Qde(r,e){let{major:t,minor:n,patch:i,prerelease:s}=r,{major:o,minor:a,patch:c,prerelease:l}=e;if(t!==o)return t-o;if(n!==a)return n-a;if(i!==c)return i-c;if(s&&l){let[u,d]=s.split("."),[f,h]=l.split(".");return u!==f?u.localeCompare(f):parseInt(d)-parseInt(h)}else{if(s)return-1;if(l)return 1}return 0}import("node:process").then(r=>r.stdout.write(""));var CT=No(TT(),1);import C6 from"path";var ir=class r{static INSTANCE=new r;concurrency=8;chainQueryAPI="";priceFeedAPI="";chainServer=new Map;batchCount=1};function Rfe(r){let e=C6.resolve(r.chainsConfig),t=CT.default.readJsonSync(e),n=process.env.OVERRIDE_CONCURRENCY?parseInt(process.env.OVERRIDE_CONCURRENCY):void 0,i=process.env.OVERRIDE_BATCH_COUNT?parseInt(process.env.OVERRIDE_BATCH_COUNT):void 0;ir.INSTANCE.concurrency=n??r.concurrency,ir.INSTANCE.batchCount=i??r.batchCount,ir.INSTANCE.chainQueryAPI=r.chainqueryServer,ir.INSTANCE.priceFeedAPI=r.pricefeedServer;for(let[s,o]of Object.entries(t)){let a=o;if(a.ChainServer)ir.INSTANCE.chainServer.set(s,a.ChainServer);else{let c=a.Https?.[0];c?ir.INSTANCE.chainServer.set(s,c):console.error("not valid config for chain",s)}}}import("node:process").then(r=>r.stdout.write(""));var _a={execution:{sequential:!1,forceExactBlockTime:!1}};function sk(){ok(_a.execution)}function ok(r){let e=Reflect.ownKeys(r);for(let t of e){let n=r[t];(n&&typeof n=="object"||typeof n=="function")&&ok(n)}return Object.freeze(r)}import("node:process").then(r=>r.stdout.write(""));wF();import{AsyncLocalStorage as NG}from"node:async_hooks";var ME=()=>Pw.getMeter("processor"),he=class{constructor(e){this.name=e}_counter;value=0;get counter(){return this._counter||(this._counter=ME().createCounter(this.name)),this._counter}add(e,t){this.counter.add(e,t),this.value+=e}get(){return this.value}},Ea=class{constructor(e){this.name=e}_gauge;value=0;get gauge(){return this._gauge||(this._gauge=ME().createGauge(this.name)),this._gauge}record(e,t){this.gauge.record(e,t),this.value=e}get(){return this.value}},Ql=class{constructor(e){this.name=e}_histogram;value=0;get histogram(){return this._histogram||(this._histogram=ME().createHistogram(this.name)),this._histogram}record(e,t){this.histogram.record(e,t),this.value=e}get(){return this.value}},ak={send_counts:{get:new he("store_get_send"),upsert:new he("store_upsert_send"),list:new he("store_list_send"),delete:new he("store_delete_send"),update:new he("store_update_send")},recv_counts:{get:new he("store_get_recv"),upsert:new he("store_upsert_recv"),list:new he("store_list_recv"),delete:new he("store_delete_recv"),update:new he("store_update_recv")},request_times:{get:new he("store_get_time"),upsert:new he("store_upsert_time"),list:new he("store_list_time"),delete:new he("store_delete_time"),update:new he("store_update_time")},request_errors:{get:new he("store_get_error"),upsert:new he("store_upsert_error"),list:new he("store_list_error"),delete:new he("store_delete_error"),update:new he("store_update_error")},batched_total_count:new he("batched_total_count"),batched_request_count:new he("batched_request_count"),unsolved_requests:new Ea("store_unsolved_requests"),stats(){return{send_counts:{get:this.send_counts.get.get(),upsert:this.send_counts.upsert.get(),list:this.send_counts.list.get(),delete:this.send_counts.delete.get()},recv_counts:{get:this.recv_counts.get.get(),upsert:this.recv_counts.upsert.get(),list:this.recv_counts.list.get(),delete:this.recv_counts.delete.get()},request_times:{get:this.request_times.get.get(),upsert:this.request_times.upsert.get(),list:this.request_times.list.get(),delete:this.request_times.delete.get()},request_errors:{get:this.request_errors.get.get(),upsert:this.request_errors.upsert.get(),list:this.request_errors.list.get(),delete:this.request_errors.delete.get()},batched_total_count:this.batched_total_count.get(),batched_request_count:this.batched_request_count.get(),unsolved_requests:this.unsolved_requests.get(),average_request_time:{get:this.request_times.get.get()/this.send_counts.get.get(),upsert:this.request_times.upsert.get()/this.send_counts.upsert.get(),list:this.request_times.list.get()/this.send_counts.list.get()}}}},ck={hit_count:new he("provider_hit_count"),miss_count:new he("provider_miss_count"),queue_size:new Ea("provider_queue_size"),total_duration:new he("provider_total_duration"),total_queued:new he("provider_total_queued"),stats(){return{hit_count:this.hit_count.get(),miss_count:this.miss_count.get(),queue_size:this.queue_size.get(),total_duration:this.total_duration.get(),total_queued:this.total_queued.get(),average_queue_time:this.total_queued.get()/(this.hit_count.get()+this.miss_count.get()),average_duration:this.total_duration.get()/(this.hit_count.get()+this.miss_count.get())}}},to={process_binding_count:new he("process_binding_count"),process_binding_time:new he("process_binding_time"),process_binding_error:new he("process_binding_error"),process_ethcall_count:new he("process_ethcall_count"),process_eventemit_count:new he("process_eventemit_count"),process_metricrecord_count:new he("process_metricrecord_count"),process_pricecall_count:new he("process_pricecall_count"),process_template_count:new he("process_template_count"),process_handler_duration:new Ea("process_handler_duration"),processor_handler_duration:new Ql("processor_handler_duration"),processor_rpc_duration:new Ql("processor_rpc_duration"),processor_rpc_queue_duration:new Ql("processor_rpc_queue_duration"),processor_template_instance_count:new he("process_template_instance_count"),processor_worker_run_time:new he("processor_worker_run_time"),processor_worker_wait_time:new he("processor_worker_wait_time"),processor_worker_queue_size:new Ea("processor_worker_queue_size"),processor_worker_completed:new he("processor_worker_completed"),stats(){return{process_binding_count:this.process_binding_count.get(),process_binding_time:this.process_binding_time.get(),process_binding_error:this.process_binding_error.get(),process_ethcall_count:this.process_ethcall_count.get(),process_eventemit_count:this.process_eventemit_count.get(),process_metricrecord_count:this.process_metricrecord_count.get(),process_pricecall_count:this.process_pricecall_count.get(),process_template_count:this.process_template_count.get(),process_handler_duration:this.process_handler_duration.get(),processor_handler_duration:this.processor_handler_duration.get(),processor_rpc_duration:this.processor_rpc_duration.get(),processor_rpc_queue_duration:this.processor_rpc_queue_duration.get(),processor_template_instance_count:this.processor_template_instance_count.get(),processor_worker_run_time:this.processor_worker_run_time.get(),processor_worker_wait_time:this.processor_worker_wait_time.get(),processor_worker_queue_size:this.processor_worker_queue_size.get(),processor_worker_completed:this.processor_worker_completed.get()}}},lk=new NG;import("node:process").then(r=>r.stdout.write(""));import*as Aa from"node:process";var{request_errors:MG,unsolved_requests:uk,request_times:dk,batched_request_count:DG,batched_total_count:LG,send_counts:fk,recv_counts:FG}=ak,hk=Aa.env.STORE_BATCH_MAX_IDLE?parseInt(Aa.env.STORE_BATCH_MAX_IDLE):1,pk=Aa.env.STORE_BATCH_SIZE?parseInt(Aa.env.STORE_BATCH_SIZE):10,DE=Aa.env.STORE_UPSERT_NO_WAIT==="true",mk=new Error("timeout"),Ah=class{constructor(e){this.processId=e}static opCounter=0n;defers=new Map;statsInterval;pendings=[];newPromise(e,t){return new Promise((n,i)=>{this.defers.set(e,{resolve:n,reject:i,requestType:t}),uk.record(this.defers.size,{processId:this.processId})})}sendRequest(e,t){if(hk>0&&pk>1&&e.upsert)return this.sendUpsertInBatch(e.upsert);let n=Object.keys(e)[0],i=wa.opCounter++,s=this.newPromise(i,n),o=Date.now(),a=[s],c;if(t){let l=new Promise((u,d)=>c=setTimeout(d,t*1e3,mk));a.push(l)}return this.doSend({dbRequest:{...e,opId:i}}),fk[n]?.add(1),n==="upsert"&&DE?(this.pendings.push(s),Promise.resolve({opId:i})):Promise.race(a).then(l=>(dk[n]?.add(Date.now()-o),l)).catch(l=>{throw l===mk&&console.error("db request",n,"op:",i," timeout"),MG[n]?.add(1),l}).finally(()=>{c&&clearTimeout(c)})}result(e){let t=e.opId,n=this.defers.get(t);n&&(n.requestType&&FG[n.requestType]?.add(1),e.error?n.reject(new Error(e.error)):n.resolve(e),this.defers.delete(t)),uk.record(this.defers.size,{processId:this.processId})}error(e,t){let n=t.stack;console.error("process error",e,t,n);let i=Xu.create({states:{error:t?.toString()+(n?`
|
32
|
+
${n}`:"")}});this.doSend({result:i,processId:e})}close(){for(let[e,t]of this.defers)t.reject(new Error("context closed before db response, processId: "+this.processId+" opId: "+e));this.defers.clear(),this.statsInterval&&clearInterval(this.statsInterval)}upsertBatch=void 0;async sendUpsertInBatch(e){if(this.upsertBatch){let{request:t,promise:n}=this.upsertBatch;return t.entity=this.upsertBatch.request.entity.concat(e.entity),t.entityData=this.upsertBatch.request.entityData.concat(e.entityData),t.id=this.upsertBatch.request.id.concat(e.id),t.entity.length>=pk&&this.sendBatch(),DE?{opId:this.upsertBatch.opId}:n}else{let t=wa.opCounter++,n=setTimeout(()=>{this.sendBatch()},hk),i=Date.now(),s=this.newPromise(t,"upsert").finally(()=>{dk.upsert.add(Date.now()-i)});return this.upsertBatch={opId:t,request:e,promise:s,timer:n},DE?(this.pendings.push(s),{opId:this.upsertBatch.opId}):s}}sendBatch(){if(this.upsertBatch){let{request:e,opId:t,timer:n}=this.upsertBatch;clearTimeout(n),this.upsertBatch=void 0,this.doSend({dbRequest:{upsert:e,opId:t}}),fk.upsert?.add(1),DG.add(1),LG.add(e.entity.length)}}async awaitPendings(){await Promise.all(this.pendings)}},wa=class extends Ah{constructor(t,n){super(n);this.subject=t}doSend(t){this.subject.next({...t,processId:this.processId})}},gk=class extends Ah{constructor(t,n){super(t);this.processId=t;this.subject=n}sendTemplateRequest(t){this.subject.next({processId:this.processId,tplRequest:{templates:t}})}sendTimeseriesRequest(t){this.subject.next({processId:this.processId,tsRequest:{data:t}})}doSend(t){console.debug("sending db request, processId ",this.processId,"opId",t.dbRequest?.opId),this.subject.next({...t,processId:this.processId})}};import("node:process").then(r=>r.stdout.write(""));var GM="6.13.1";function Qae(r,e,t){let n=e.split("|").map(s=>s.trim());for(let s=0;s<n.length;s++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}let i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${t}`,i.value=r,i}async function Qe(r){let e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function J(r,e,t){for(let n in e){let i=e[n],s=t?t[n]:null;s&&Qae(i,s,n),Object.defineProperty(r,n,{enumerable:!0,value:i,writable:!1})}}function ac(r){if(r==null)return"null";if(Array.isArray(r))return"[ "+r.map(ac).join(", ")+" ]";if(r instanceof Uint8Array){let e="0123456789abcdef",t="0x";for(let n=0;n<r.length;n++)t+=e[r[n]>>4],t+=e[r[n]&15];return t}if(typeof r=="object"&&typeof r.toJSON=="function")return ac(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"number":return r.toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{ "+e.map(t=>`${ac(t)}: ${ac(r[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function je(r,e){return r&&r.code===e}function cc(r){return je(r,"CALL_EXCEPTION")}function xe(r,e,t){let n=r;{let s=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${ac(t)}`);for(let o in t){if(o==="shortMessage")continue;let a=t[o];s.push(o+"="+ac(a))}}s.push(`code=${e}`),s.push(`version=${GM}`),s.length&&(r+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(r);break;default:i=new Error(r)}return J(i,{code:e}),t&&Object.assign(i,t),i.shortMessage==null&&J(i,{shortMessage:n}),i}function P(r,e,t,n){if(!r)throw xe(e,t,n)}function A(r,e,t,n){P(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}function fu(r,e,t){t==null&&(t=""),t&&(t=": "+t),P(r>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),P(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}var Yae=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken");r.push(e)}catch{}return r},[]);function Y1(r){P(Yae.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}function is(r,e,t){if(t==null&&(t=""),r!==e){let n=t,i="new";t&&(n+=".",i+=" "+t),P(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function WM(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let n=new Uint8Array((r.length-2)/2),i=2;for(let s=0;s<n.length;s++)n[s]=parseInt(r.substring(i,i+2),16),i+=2;return n}A(!1,"invalid BytesLike value",e||"value",r)}function ne(r,e){return WM(r,e,!1)}function He(r,e){return WM(r,e,!0)}function pe(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}function po(r){return pe(r,!0)||r instanceof Uint8Array}var VM="0123456789abcdef";function j(r){let e=ne(r),t="0x";for(let n=0;n<e.length;n++){let i=e[n];t+=VM[(i&240)>>4]+VM[i&15]}return t}function we(r){return"0x"+r.map(e=>j(e).substring(2)).join("")}function wn(r){return pe(r,!0)?(r.length-2)/2:ne(r).length}function Le(r,e,t){let n=ne(r);return t!=null&&t>n.length&&P(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),j(n.slice(e??0,t??n.length))}function KM(r,e,t){let n=ne(r);P(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});let i=new Uint8Array(e);return i.fill(0),t?i.set(n,e-n.length):i.set(n,0),j(i)}function hr(r,e){return KM(r,e,!0)}function $1(r,e){return KM(r,e,!1)}var Rm=BigInt(0),Gr=BigInt(1),lc=9007199254740991;function Z1(r,e){let t=pu(r,"value"),n=BigInt(se(e,"width"));if(P(t>>n===Rm,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-Gr){let i=(Gr<<n)-Gr;return-((~t&i)+Gr)}return t}function hu(r,e){let t=H(r,"value"),n=BigInt(se(e,"width")),i=Gr<<n-Gr;if(t<Rm){t=-t,P(t<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});let s=(Gr<<n)-Gr;return(~t&s)+Gr}else P(t<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}function ss(r,e){let t=pu(r,"value"),n=BigInt(se(e,"bits"));return t&(Gr<<n)-Gr}function H(r,e){switch(typeof r){case"bigint":return r;case"number":return A(Number.isInteger(r),"underflow",e||"value",r),A(r>=-lc&&r<=lc,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){A(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}A(!1,"invalid BigNumberish value",e||"value",r)}function pu(r,e){let t=H(r,e);return P(t>=Rm,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}var JM="0123456789abcdef";function uc(r){if(r instanceof Uint8Array){let e="0x0";for(let t of r)e+=JM[t>>4],e+=JM[t&15];return BigInt(e)}return H(r)}function se(r,e){switch(typeof r){case"bigint":return A(r>=-lc&&r<=lc,"overflow",e||"value",r),Number(r);case"number":return A(Number.isInteger(r),"underflow",e||"value",r),A(r>=-lc&&r<=lc,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return se(BigInt(r),e)}catch(t){A(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}A(!1,"invalid numeric value",e||"value",r)}function X1(r){return se(uc(r))}function rr(r,e){let n=pu(r,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{let i=se(e,"width");for(P(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<i*2;)n="0"+n}return"0x"+n}function tt(r){let e=pu(r,"value");if(e===Rm)return new Uint8Array([]);let t=e.toString(16);t.length%2&&(t="0"+t);let n=new Uint8Array(t.length/2);for(let i=0;i<n.length;i++){let s=i*2;n[i]=parseInt(t.substring(s,s+2),16)}return n}function Sn(r){let e=j(po(r)?r:tt(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}var QM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var qbe=BigInt(0),YM=BigInt(58);function eA(r){let e=ne(r),t=uc(e),n="";for(;t;)n=QM[Number(t%YM)]+n,t/=YM;for(let i=0;i<e.length&&!e[i];i++)n=QM[0]+n;return n}function $M(r){return He(Buffer.from(r,"base64"))}function ZM(r){return Buffer.from(ne(r)).toString("base64")}var mo=class{filter;emitter;#e;constructor(e,t,n){this.#e=t,J(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}};function $ae(r,e,t,n,i){A(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function XM(r,e,t,n,i){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let s=0;for(let o=e+1;o<t.length&&t[o]>>6===2;o++)s++;return s}return r==="OVERRUN"?t.length-e-1:0}function Zae(r,e,t,n,i){return r==="OVERLONG"?(A(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),XM(r,e,t,n,i))}var e3=Object.freeze({error:$ae,ignore:XM,replace:Zae});function Xae(r,e){e==null&&(e=e3.error);let t=ne(r,"bytes"),n=[],i=0;for(;i<t.length;){let s=t[i++];if(!(s>>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,t,n):i+=e("BAD_PREFIX",i-1,t,n);continue}if(i-1+o>=t.length){i+=e("OVERRUN",i-1,t,n);continue}let c=s&(1<<8-o-1)-1;for(let l=0;l<o;l++){let u=t[i];if((u&192)!=128){i+=e("MISSING_CONTINUE",i,t,n),c=null;break}c=c<<6|u&63,i++}if(c!==null){if(c>1114111){i+=e("OUT_OF_RANGE",i-1-o,t,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,t,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,t,n,c);continue}n.push(c)}}return n}function Vt(r,e){A(typeof r=="string","invalid string value","str",r),e!=null&&(Y1(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192),t.push(i&63|128);else if((i&64512)==55296){n++;let s=r.charCodeAt(n);A(n<r.length&&(s&64512)===56320,"invalid surrogate pair","str",r);let o=65536+((i&1023)<<10)+(s&1023);t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(o&63|128)}else t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128)}return new Uint8Array(t)}function ece(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function os(r,e){return ece(Xae(r,e))}import tce from"http";import rce from"https";import{gunzipSync as nce}from"zlib";function Nm(r){async function e(t,n){P(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");let i=t.url.split(":")[0].toLowerCase();P(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),P(i==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=t.method,o=Object.assign({},t.headers),a={method:s,headers:o};r&&r.agent&&(a.agent=r.agent);let c=null;try{c=new AbortController,a.abort=c.signal}catch(d){console.log(d)}let l=(i==="http"?tce:rce).request(t.url,a);l.setTimeout(t.timeout);let u=t.body;return u&&l.write(Buffer.from(u)),l.end(),new Promise((d,f)=>{n&&n.addListener(()=>{c&&c.abort(),f(xe("request cancelled","CANCELLED"))}),l.on("timeout",()=>{let h;if(u)try{h=JSON.parse(Buffer.from(u).toString("utf8"))}catch{}f(xe("request timeout","TIMEOUT",{payload:h}))}),l.once("response",h=>{let m=h.statusCode||0,p=h.statusMessage||"",y=Object.keys(h.headers||{}).reduce((E,x)=>{let S=h.headers[x]||"";return Array.isArray(S)&&(S=S.join(", ")),E[x]=S,E},{}),b=null;h.on("data",E=>{if(n)try{n.checkSignal()}catch(x){return f(x)}if(b==null)b=E;else{let x=new Uint8Array(b.length+E.length);x.set(b,0),x.set(E,b.length),b=x}}),h.on("end",()=>{y["content-encoding"]==="gzip"&&b&&(b=ne(nce(b))),d({statusCode:m,statusMessage:p,headers:y,body:b})}),h.on("error",E=>{E.response={statusCode:m,statusMessage:p,headers:y,body:b},f(E)})}),l.on("error",h=>{f(h)})})}return e}var Zbe=Nm({});var ice=12,sce=250,t3=Nm(),oce=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),ace=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),tA=!1;async function n3(r,e){try{let t=r.match(oce);if(!t)throw new Error("invalid data");return new Xn(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?$M(t[3]):cce(t[3]))}catch{return new Xn(599,"BAD REQUEST (invalid data: URI)",{},null,new pr(r))}}function i3(r){async function e(t,n){try{let i=t.match(ace);if(!i)throw new Error("invalid link");return new pr(`${r}${i[2]}`)}catch{return new Xn(599,"BAD REQUEST (invalid IPFS URI)",{},null,new pr(t))}}return e}var Mm={data:n3,ipfs:i3("https://gateway.ipfs.io/ipfs/")},s3=new WeakMap,Lm=class{#e;#t;constructor(e){this.#e=[],this.#t=!1,s3.set(e,()=>{if(!this.#t){this.#t=!0;for(let t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){P(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){P(!this.cancelled,"cancelled","CANCELLED",{})}};function Dm(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}var pr=class r{#e;#t;#r;#n;#i;#c;#a;#u;#p;#h;#d;#o;#s;#l;#m;get url(){return this.#c}set url(e){this.#c=String(e)}get body(){return this.#a==null?null:new Uint8Array(this.#a)}set body(e){if(e==null)this.#a=void 0,this.#u=void 0;else if(typeof e=="string")this.#a=Vt(e),this.#u="text/plain";else if(e instanceof Uint8Array)this.#a=e,this.#u="application/octet-stream";else if(typeof e=="object")this.#a=Vt(JSON.stringify(e)),this.#u="application/json";else throw new Error("invalid body")}hasBody(){return this.#a!=null}get method(){return this.#n?this.#n:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#n=String(e).toUpperCase()}get headers(){let e=Object.assign({},this.#r);return this.#p&&(e.authorization=`Basic ${ZM(Vt(this.#p))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#u&&(e["content-type"]=this.#u),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#r[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#r={}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let i=t[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#p||null}setCredentials(e,t){A(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#p=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#i}set timeout(e){A(e>=0,"timeout must be non-zero","timeout",e),this.#i=e}get preflightFunc(){return this.#h||null}set preflightFunc(e){this.#h=e}get processFunc(){return this.#d||null}set processFunc(e){this.#d=e}get retryFunc(){return this.#o||null}set retryFunc(e){this.#o=e}get getUrlFunc(){return this.#m||t3}set getUrlFunc(e){this.#m=e}constructor(e){this.#c=String(e),this.#e=!1,this.#t=!0,this.#r={},this.#n="",this.#i=3e5,this.#l={slotInterval:sce,maxAttempts:ice},this.#m=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#a?j(this.#a):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#f(e,t,n,i,s){if(e>=this.#l.maxAttempts)return s.makeServerError("exceeded maximum retry limit");P(r3()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await lce(n);let o=this.clone(),a=(o.url.split(":")[0]||"").toLowerCase();if(a in Mm){let u=await Mm[a](o.url,Dm(i.#s));if(u instanceof Xn){let d=u;if(this.processFunc){Dm(i.#s);try{d=await this.processFunc(o,d)}catch(f){(f.throttle==null||typeof f.stall!="number")&&d.makeServerError("error in post-processing function",f).assertOk()}}return d}o=u}this.preflightFunc&&(o=await this.preflightFunc(o));let c=await this.getUrlFunc(o,Dm(i.#s)),l=new Xn(c.statusCode,c.statusMessage,c.headers,c.body,i);if(l.statusCode===301||l.statusCode===302){try{let u=l.headers.location||"";return o.redirect(u).#f(e+1,t,0,i,l)}catch{}return l}else if(l.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,l,e))){let u=l.headers["retry-after"],d=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof u=="string"&&u.match(/^[1-9][0-9]*$/)&&(d=parseInt(u)),o.clone().#f(e+1,t,d,i,l)}if(this.processFunc){Dm(i.#s);try{l=await this.processFunc(o,l)}catch(u){(u.throttle==null||typeof u.stall!="number")&&l.makeServerError("error in post-processing function",u).assertOk();let d=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return u.stall>=0&&(d=u.stall),o.clone().#f(e+1,t,d,i,l)}}return l}send(){return P(this.#s==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#s=new Lm(this),this.#f(0,r3()+this.timeout,0,this,new Xn(0,"",{},null,this))}cancel(){P(this.#s!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let e=s3.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){let t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();P(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});let i=new r(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,i.#r=Object.assign({},this.#r),this.#a&&(i.#a=new Uint8Array(this.#a)),i.#u=this.#u,i}clone(){let e=new r(this.url);return e.#n=this.#n,this.#a&&(e.#a=this.#a),e.#u=this.#u,e.#r=Object.assign({},this.#r),e.#p=this.#p,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#h=this.#h,e.#d=this.#d,e.#o=this.#o,e.#l=Object.assign({},this.#l),e.#m=this.#m,e}static lockConfig(){tA=!0}static getGateway(e){return Mm[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(tA)throw new Error("gateways locked");Mm[e]=t}static registerGetUrl(e){if(tA)throw new Error("gateways locked");t3=e}static createGetUrlFunc(e){return Nm(e)}static createDataGateway(){return n3}static createIpfsGatewayFunc(e){return i3(e)}},Xn=class r{#e;#t;#r;#n;#i;#c;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#n?j(this.#n):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#r)}get body(){return this.#n==null?null:new Uint8Array(this.#n)}get bodyText(){try{return this.#n==null?"":os(this.#n)}catch{P(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{P(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let i=t[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,i,s){this.#e=e,this.#t=t,this.#r=Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{}),this.#n=i==null?null:new Uint8Array(i),this.#i=s||null,this.#c={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);let i=new r(599,n,this.headers,this.body,this.#i||void 0);return i.#c={message:e,error:t},i}throwThrottleError(e,t){t==null?t=-1:A(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);let n=new Error(e||"throttling requests");throw J(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#n!=null}get request(){return this.#i}ok(){return this.#c.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#c;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{this.#n&&(i=os(this.#n))}catch{}P(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};function r3(){return new Date().getTime()}function cce(r){return Vt(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function lce(r){return new Promise(e=>setTimeout(e,r))}function uce(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function o3(r,e,t){let n=0;for(let i=0;i<t;i++)n=n*256+r[e+i];return n}function a3(r,e,t,n){let i=[];for(;t<e+1+n;){let s=c3(r,t);i.push(s.result),t+=s.consumed,P(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:i}}function c3(r,e){P(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});let t=n=>{P(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){let n=r[e]-247;t(e+1+n);let i=o3(r,e+1,n);return t(e+1+n+i),a3(r,e,e+1+n,n+i)}else if(r[e]>=192){let n=r[e]-192;return t(e+1+n),a3(r,e,e+1,n)}else if(r[e]>=184){let n=r[e]-183;t(e+1+n);let i=o3(r,e+1,n);t(e+1+n+i);let s=j(r.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(r[e]>=128){let n=r[e]-128;t(e+1+n);let i=j(r.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:uce(r[e])}}function dc(r){let e=ne(r,"data"),t=c3(e,0);return A(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}function l3(r){let e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function d3(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(s){n=n.concat(d3(s))}),n.length<=55)return n.unshift(192+n.length),n;let i=l3(n.length);return i.unshift(247+i.length),i.concat(n)}let e=Array.prototype.slice.call(ne(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let t=l3(e.length);return t.unshift(183+t.length),t.concat(e)}var u3="0123456789abcdef";function Tn(r){let e="0x";for(let t of d3(r))e+=u3[t>>4],e+=u3[t&15];return e}var St=32,rA=new Uint8Array(St),dce=["then"],Fm={},p3=new WeakMap;function go(r){return p3.get(r)}function f3(r,e){p3.set(r,e)}function mu(r,e){let t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function nA(r,e,t){return r.indexOf(null)>=0?e.map((n,i)=>n instanceof Cn?nA(go(n),n,t):n):r.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(t&&o instanceof Cn&&(o=nA(go(o),o,t)),n[i]=o),n},{})}var Cn=class r extends Array{#e;constructor(...e){let t=e[0],n=e[1],i=(e[2]||[]).slice(),s=!0;t!==Fm&&(n=e,i=[],s=!1),super(n.length),n.forEach((c,l)=>{this[l]=c});let o=i.reduce((c,l)=>(typeof l=="string"&&c.set(l,(c.get(l)||0)+1),c),new Map);if(f3(this,Object.freeze(n.map((c,l)=>{let u=i[l];return u!=null&&o.get(u)===1?u:null}))),this.#e=[],this.#e==null&&this.#e,!s)return;Object.freeze(this);let a=new Proxy(this,{get:(c,l,u)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){let f=se(l,"%index");if(f<0||f>=this.length)throw new RangeError("out of result range");let h=c[f];return h instanceof Error&&mu(`index ${f}`,h),h}if(dce.indexOf(l)>=0)return Reflect.get(c,l,u);let d=c[l];if(d instanceof Function)return function(...f){return d.apply(this===u?c:this,f)};if(!(l in c))return c.getValue.apply(this===u?c:this,[l])}return Reflect.get(c,l,u)}});return f3(a,go(this)),a}toArray(e){let t=[];return this.forEach((n,i)=>{n instanceof Error&&mu(`index ${i}`,n),e&&n instanceof r&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){let t=go(this);return t.reduce((n,i,s)=>(P(i!=null,`value at index ${s} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),nA(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);let n=go(this),i=[],s=[];for(let o=e;o<t;o++)i.push(this[o]),s.push(n[o]);return new r(Fm,i,s)}filter(e,t){let n=go(this),i=[],s=[];for(let o=0;o<this.length;o++){let a=this[o];a instanceof Error&&mu(`index ${o}`,a),e.call(t,a,o,this)&&(i.push(a),s.push(n[o]))}return new r(Fm,i,s)}map(e,t){let n=[];for(let i=0;i<this.length;i++){let s=this[i];s instanceof Error&&mu(`index ${i}`,s),n.push(e.call(t,s,i,this))}return n}getValue(e){let t=go(this).indexOf(e);if(t===-1)return;let n=this[t];return n instanceof Error&&mu(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new r(Fm,e,t)}};function h3(r){let e=tt(r);return P(e.length<=St,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:St,offset:e.length}),e.length!==St&&(e=He(we([rA.slice(e.length%St),e]))),e}var rt=class{name;type;localName;dynamic;constructor(e,t,n,i){J(this,{name:e,type:t,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){A(!1,e,this.localName,t)}},yo=class{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return we(this.#e)}get length(){return this.#t}#r(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#r(He(e.data))}writeBytes(e){let t=He(e),n=t.length%St;return n&&(t=He(we([t,rA.slice(n)]))),this.#r(t)}writeValue(e){return this.#r(h3(e))}writeUpdatableValue(){let e=this.#e.length;return this.#e.push(rA),this.#t+=St,t=>{this.#e[e]=h3(t)}}},qm=class r{allowLoose;#e;#t;#r;#n;#i;constructor(e,t,n){J(this,{allowLoose:!!t}),this.#e=He(e),this.#r=0,this.#n=null,this.#i=n??1024,this.#t=0}get data(){return j(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#c(e){if(this.#n)return this.#n.#c(e);this.#r+=e,P(this.#i<1||this.#r<=this.#i*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#i} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:He(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#a(e,t,n){let i=Math.ceil(t/St)*St;return this.#t+i>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?i=t:P(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:He(this.#e),length:this.#e.length,offset:this.#t+i})),this.#e.slice(this.#t,this.#t+i)}subReader(e){let t=new r(this.#e.slice(this.#t+e),this.allowLoose,this.#i);return t.#n=this,t}readBytes(e,t){let n=this.#a(0,e,!!t);return this.#c(e),this.#t+=n.length,n.slice(0,e)}readValue(){return uc(this.readBytes(St))}readIndex(){return X1(this.readBytes(St))}};import{createHash as iA,createHmac as k_e,pbkdf2Sync as R_e,randomBytes as N_e}from"crypto";function gu(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function yu(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function m3(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");gu(r.outputLen),gu(r.blockLen)}function ei(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Bm(r,e){yu(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var Um=BigInt(4294967295),g3=BigInt(32);function fce(r,e=!1){return e?{h:Number(r&Um),l:Number(r>>g3&Um)}:{h:Number(r>>g3&Um)|0,l:Number(r&Um)|0}}function y3(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let i=0;i<r.length;i++){let{h:s,l:o}=fce(r[i],e);[t[i],n[i]]=[s,o]}return[t,n]}var v3=(r,e,t)=>r<<t|e>>>32-t,b3=(r,e,t)=>e<<t|r>>>32-t,_3=(r,e,t)=>e<<t-32|r>>>64-t,E3=(r,e,t)=>r<<t-32|e>>>64-t;import*as vu from"node:crypto";var jm=vu&&typeof vu=="object"&&"webcrypto"in vu?vu.webcrypto:void 0;var A3=r=>r instanceof Uint8Array;var w3=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),zm=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Vr=(r,e)=>r<<32-e|r>>>e,hce=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!hce)throw new Error("Non little-endian hardware is not supported");function pce(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function cs(r){if(typeof r=="string"&&(r=pce(r)),!A3(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function S3(...r){let e=new Uint8Array(r.reduce((n,i)=>n+i.length,0)),t=0;return r.forEach(n=>{if(!A3(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}var as=class{clone(){return this._cloneInto()}},q_e={}.toString;function Hm(r){let e=n=>r().update(cs(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function T3(r){let e=(n,i)=>r(i).update(cs(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}function C3(r=32){if(jm&&typeof jm.getRandomValues=="function")return jm.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var[I3,P3,k3]=[[],[],[]],mce=BigInt(0),bu=BigInt(1),gce=BigInt(2),yce=BigInt(7),vce=BigInt(256),bce=BigInt(113);for(let r=0,e=bu,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],I3.push(2*(5*n+t)),P3.push((r+1)*(r+2)/2%64);let i=mce;for(let s=0;s<7;s++)e=(e<<bu^(e>>yce)*bce)%vce,e&gce&&(i^=bu<<(bu<<BigInt(s))-bu);k3.push(i)}var[_ce,Ece]=y3(k3,!0),x3=(r,e,t)=>t>32?_3(r,e,t):v3(r,e,t),O3=(r,e,t)=>t>32?E3(r,e,t):b3(r,e,t);function Ace(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,l=t[c],u=t[c+1],d=x3(l,u,1)^t[a],f=O3(l,u,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=d,r[o+h+1]^=f}let i=r[2],s=r[3];for(let o=0;o<24;o++){let a=P3[o],c=x3(i,s,a),l=O3(i,s,a),u=I3[o];i=r[u],s=r[u+1],r[u]=c,r[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=_ce[n],r[1]^=Ece[n]}t.fill(0)}var Gm=class r extends as{constructor(e,t,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,gu(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=w3(this.state)}keccak(){Ace(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ei(this);let{blockLen:t,state:n}=this;e=cs(e);let i=e.length;for(let s=0;s<i;){let o=Math.min(t-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:i}=this;e[n]^=t,t&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){ei(this,!1),yu(e),this.finish();let t=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,s-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return gu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Bm(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new r(t,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}},ls=(r,e,t)=>Hm(()=>new Gm(e,r,t)),H_e=ls(6,144,224/8),G_e=ls(6,136,256/8),V_e=ls(6,104,384/8),W_e=ls(6,72,512/8),K_e=ls(1,144,224/8),R3=ls(1,136,256/8),J_e=ls(1,104,384/8),Q_e=ls(1,72,512/8),N3=(r,e,t)=>T3((n={})=>new Gm(e,r,n.dkLen===void 0?t:n.dkLen,!0)),Y_e=N3(31,168,128/8),$_e=N3(31,136,256/8);var M3=!1,D3=function(r){return R3(r)},L3=D3;function Oe(r){let e=ne(r,"data");return j(L3(e))}Oe._=D3;Oe.lock=function(){M3=!0};Oe.register=function(r){if(M3)throw new TypeError("keccak256 is locked");L3=r};Object.freeze(Oe);function wce(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),a=Number(t&s),c=n?4:0,l=n?0:4;r.setUint32(e+c,o,n),r.setUint32(e+l,a,n)}var Vm=class extends as{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=zm(this.buffer)}update(e){ei(this);let{view:t,buffer:n,blockLen:i}=this;e=cs(e);let s=e.length;for(let o=0;o<s;){let a=Math.min(i-this.pos,s-o);if(a===i){let c=zm(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ei(this),Bm(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:i,isLE:s}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)t[d]=0;wce(n,i-8,BigInt(this.length*8),s),this.process(n,0);let a=zm(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%t&&e.buffer.set(n),e}};var Sce=(r,e,t)=>r&e^~r&t,Tce=(r,e,t)=>r&e^r&t^e&t,Cce=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),us=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ds=new Uint32Array(64),sA=class extends Vm{constructor(){super(64,32,8,!1),this.A=us[0]|0,this.B=us[1]|0,this.C=us[2]|0,this.D=us[3]|0,this.E=us[4]|0,this.F=us[5]|0,this.G=us[6]|0,this.H=us[7]|0}get(){let{A:e,B:t,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,t,n,i,s,o,a,c]}set(e,t,n,i,s,o,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let d=0;d<16;d++,t+=4)ds[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let f=ds[d-15],h=ds[d-2],m=Vr(f,7)^Vr(f,18)^f>>>3,p=Vr(h,17)^Vr(h,19)^h>>>10;ds[d]=p+ds[d-7]+m+ds[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){let f=Vr(a,6)^Vr(a,11)^Vr(a,25),h=u+f+Sce(a,c,l)+Cce[d]+ds[d]|0,p=(Vr(n,2)^Vr(n,13)^Vr(n,22))+Tce(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){ds.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var F3=Hm(()=>new sA);var Wm=class extends as{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,m3(e);let n=cs(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return ei(this),this.iHash.update(e),this}digestInto(e){ei(this),yu(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},oA=(r,e,t)=>new Wm(r,e).update(t).digest();oA.create=(r,e)=>new Wm(r,e);var q3=function(r){return iA("sha256").update(r).digest()},B3=function(r){return iA("sha512").update(r).digest()},U3=q3,j3=B3,z3=!1,H3=!1;function fs(r){let e=ne(r,"data");return j(U3(e))}fs._=q3;fs.lock=function(){z3=!0};fs.register=function(r){if(z3)throw new Error("sha256 is locked");U3=r};Object.freeze(fs);function Km(r){let e=ne(r,"data");return j(j3(e))}Km._=B3;Km.lock=function(){H3=!0};Km.register=function(r){if(H3)throw new Error("sha512 is locked");j3=r};Object.freeze(fs);var uA={};$u(uA,{bitGet:()=>Nce,bitLen:()=>Rce,bitMask:()=>_u,bitSet:()=>Mce,bytesToHex:()=>vo,bytesToNumberBE:()=>ti,bytesToNumberLE:()=>Ym,concatBytes:()=>fc,createHmacDrbg:()=>lA,ensureBytes:()=>mr,equalBytes:()=>Pce,hexToBytes:()=>bo,hexToNumber:()=>cA,numberToBytesBE:()=>hs,numberToBytesLE:()=>$m,numberToHexUnpadded:()=>W3,numberToVarBytesBE:()=>Ice,utf8ToBytes:()=>kce,validateObject:()=>ps});var V3=BigInt(0),Jm=BigInt(1),xce=BigInt(2),Qm=r=>r instanceof Uint8Array,Oce=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function vo(r){if(!Qm(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=Oce[r[t]];return e}function W3(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function cA(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function bo(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let i=n*2,s=r.slice(i,i+2),o=Number.parseInt(s,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}function ti(r){return cA(vo(r))}function Ym(r){if(!Qm(r))throw new Error("Uint8Array expected");return cA(vo(Uint8Array.from(r).reverse()))}function hs(r,e){return bo(r.toString(16).padStart(e*2,"0"))}function $m(r,e){return hs(r,e).reverse()}function Ice(r){return bo(W3(r))}function mr(r,e,t){let n;if(typeof e=="string")try{n=bo(e)}catch(s){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${s}`)}else if(Qm(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function fc(...r){let e=new Uint8Array(r.reduce((n,i)=>n+i.length,0)),t=0;return r.forEach(n=>{if(!Qm(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function Pce(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function kce(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Rce(r){let e;for(e=0;r>V3;r>>=Jm,e+=1);return e}function Nce(r,e){return r>>BigInt(e)&Jm}var Mce=(r,e,t)=>r|(t?Jm:V3)<<BigInt(e),_u=r=>(xce<<BigInt(r-1))-Jm,aA=r=>new Uint8Array(r),G3=r=>Uint8Array.from(r);function lA(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=aA(r),i=aA(r),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...d)=>t(i,n,...d),c=(d=aA())=>{i=a(G3([0]),d),n=a(),d.length!==0&&(i=a(G3([1]),d),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,f=[];for(;d<e;){n=a();let h=n.slice();f.push(h),d+=n.length}return fc(...f)};return(d,f)=>{o(),c(d);let h;for(;!(h=f(l()));)c();return o(),h}}var Dce={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function ps(r,e,t={}){let n=(i,s,o)=>{let a=Dce[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);let c=r[i];if(!(o&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(t))n(i,s,!0);return r}var lt=BigInt(0),Ve=BigInt(1),_o=BigInt(2),Lce=BigInt(3),dA=BigInt(4),K3=BigInt(5),J3=BigInt(8),Fce=BigInt(9),qce=BigInt(16);function Rt(r,e){let t=r%e;return t>=lt?t:e+t}function Bce(r,e,t){if(t<=lt||e<lt)throw new Error("Expected power/modulo > 0");if(t===Ve)return lt;let n=Ve;for(;e>lt;)e&Ve&&(n=n*r%t),r=r*r%t,e>>=Ve;return n}function gr(r,e,t){let n=r;for(;e-- >lt;)n*=n,n%=t;return n}function Zm(r,e){if(r===lt||e<=lt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=Rt(r,e),n=e,i=lt,s=Ve,o=Ve,a=lt;for(;t!==lt;){let l=n/t,u=n%t,d=i-o*l,f=s-a*l;n=t,t=u,i=o,s=a,o=d,a=f}if(n!==Ve)throw new Error("invert: does not exist");return Rt(i,e)}function Uce(r){let e=(r-Ve)/_o,t,n,i;for(t=r-Ve,n=0;t%_o===lt;t/=_o,n++);for(i=_o;i<r&&Bce(i,e,r)!==r-Ve;i++);if(n===1){let o=(r+Ve)/dA;return function(c,l){let u=c.pow(l,o);if(!c.eql(c.sqr(u),l))throw new Error("Cannot find square root");return u}}let s=(t+Ve)/_o;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let l=n,u=a.pow(a.mul(a.ONE,i),t),d=a.pow(c,s),f=a.pow(c,t);for(;!a.eql(f,a.ONE);){if(a.eql(f,a.ZERO))return a.ZERO;let h=1;for(let p=a.sqr(f);h<l&&!a.eql(p,a.ONE);h++)p=a.sqr(p);let m=a.pow(u,Ve<<BigInt(l-h-1));u=a.sqr(m),d=a.mul(d,m),f=a.mul(f,u),l=h}return d}}function jce(r){if(r%dA===Lce){let e=(r+Ve)/dA;return function(n,i){let s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(r%J3===K3){let e=(r-K3)/J3;return function(n,i){let s=n.mul(i,_o),o=n.pow(s,e),a=n.mul(i,o),c=n.mul(n.mul(a,_o),o),l=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(l),i))throw new Error("Cannot find square root");return l}}return r%qce,Uce(r)}var zce=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function fA(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=zce.reduce((n,i)=>(n[i]="function",n),e);return ps(r,t)}function Hce(r,e,t){if(t<lt)throw new Error("Expected power > 0");if(t===lt)return r.ONE;if(t===Ve)return e;let n=r.ONE,i=e;for(;t>lt;)t&Ve&&(n=r.mul(n,i)),i=r.sqr(i),t>>=Ve;return n}function Gce(r,e){let t=new Array(e.length),n=e.reduce((s,o,a)=>r.is0(o)?s:(t[a]=s,r.mul(s,o)),r.ONE),i=r.inv(n);return e.reduceRight((s,o,a)=>r.is0(o)?s:(t[a]=r.mul(s,t[a]),r.mul(s,o)),i),t}function hA(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function Q3(r,e,t=!1,n={}){if(r<=lt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:i,nByteLength:s}=hA(r,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=jce(r),a=Object.freeze({ORDER:r,BITS:i,BYTES:s,MASK:_u(i),ZERO:lt,ONE:Ve,create:c=>Rt(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return lt<=c&&c<r},is0:c=>c===lt,isOdd:c=>(c&Ve)===Ve,neg:c=>Rt(-c,r),eql:(c,l)=>c===l,sqr:c=>Rt(c*c,r),add:(c,l)=>Rt(c+l,r),sub:(c,l)=>Rt(c-l,r),mul:(c,l)=>Rt(c*l,r),pow:(c,l)=>Hce(a,c,l),div:(c,l)=>Rt(c*Zm(l,r),r),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Zm(c,r),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>Gce(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>t?$m(c,s):hs(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return t?Ym(c):ti(c)}});return Object.freeze(a)}function Y3(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function pA(r){let e=Y3(r);return e+Math.ceil(e/2)}function $3(r,e,t=!1){let n=r.length,i=Y3(e),s=pA(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let o=t?ti(r):Ym(r),a=Rt(o,e-Ve)+Ve;return t?$m(a,i):hs(a,i)}var Wce=BigInt(0),mA=BigInt(1);function Z3(r,e){let t=(i,s)=>{let o=s.negate();return i?o:s},n=i=>{let s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:t,unsafeLadder(i,s){let o=r.ZERO,a=i;for(;s>Wce;)s&mA&&(o=o.add(a)),a=a.double(),s>>=mA;return o},precomputeWindow(i,s){let{windows:o,windowSize:a}=n(s),c=[],l=i,u=l;for(let d=0;d<o;d++){u=l,c.push(u);for(let f=1;f<a;f++)u=u.add(l),c.push(u);l=u.double()}return c},wNAF(i,s,o){let{windows:a,windowSize:c}=n(i),l=r.ZERO,u=r.BASE,d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let m=0;m<a;m++){let p=m*c,y=Number(o&d);o>>=h,y>c&&(y-=f,o+=mA);let b=p,E=p+Math.abs(y)-1,x=m%2!==0,S=y<0;y===0?u=u.add(t(x,s[b])):l=l.add(t(S,s[E]))}return{p:l,f:u}},wNAFCached(i,s,o,a){let c=i._WINDOW_SIZE||1,l=s.get(i);return l||(l=this.precomputeWindow(i,c),c!==1&&s.set(i,a(l))),this.wNAF(c,l,o)}}}function gA(r){return fA(r.Fp),ps(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...hA(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function Kce(r){let e=gA(r);ps(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:Jce,hexToBytes:Qce}=uA,Eo={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=Eo;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Jce(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=Eo,t=typeof r=="string"?Qce(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=Eo._parseInt(t.subarray(2)),{d:o,l:a}=Eo._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(r){let e=l=>Number.parseInt(l[0],16)&8?"00"+l:l,t=l=>{let u=l.toString(16);return u.length&1?`0${u}`:u},n=e(t(r.s)),i=e(t(r.r)),s=n.length/2,o=i.length/2,a=t(s),c=t(o);return`30${t(o+s+4)}02${c}${i}02${a}${n}`}},ri=BigInt(0),Or=BigInt(1),EEe=BigInt(2),X3=BigInt(3),AEe=BigInt(4);function Yce(r){let e=Kce(r),{Fp:t}=e,n=e.toBytes||((m,p,y)=>{let b=p.toAffine();return fc(Uint8Array.from([4]),t.toBytes(b.x),t.toBytes(b.y))}),i=e.fromBytes||(m=>{let p=m.subarray(1),y=t.fromBytes(p.subarray(0,t.BYTES)),b=t.fromBytes(p.subarray(t.BYTES,2*t.BYTES));return{x:y,y:b}});function s(m){let{a:p,b:y}=e,b=t.sqr(m),E=t.mul(b,m);return t.add(t.add(E,t.mul(m,p)),y)}if(!t.eql(t.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(m){return typeof m=="bigint"&&ri<m&&m<e.n}function a(m){if(!o(m))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(m){let{allowedPrivateKeyLengths:p,nByteLength:y,wrapPrivateKey:b,n:E}=e;if(p&&typeof m!="bigint"){if(m instanceof Uint8Array&&(m=vo(m)),typeof m!="string"||!p.includes(m.length))throw new Error("Invalid key");m=m.padStart(y*2,"0")}let x;try{x=typeof m=="bigint"?m:ti(mr("private key",m,y))}catch{throw new Error(`private key must be ${y} bytes, hex or bigint, not ${typeof m}`)}return b&&(x=Rt(x,E)),a(x),x}let l=new Map;function u(m){if(!(m instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(p,y,b){if(this.px=p,this.py=y,this.pz=b,p==null||!t.isValid(p))throw new Error("x required");if(y==null||!t.isValid(y))throw new Error("y required");if(b==null||!t.isValid(b))throw new Error("z required")}static fromAffine(p){let{x:y,y:b}=p||{};if(!p||!t.isValid(y)||!t.isValid(b))throw new Error("invalid affine point");if(p instanceof d)throw new Error("projective point not allowed");let E=x=>t.eql(x,t.ZERO);return E(y)&&E(b)?d.ZERO:new d(y,b,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let y=t.invertBatch(p.map(b=>b.pz));return p.map((b,E)=>b.toAffine(y[E])).map(d.fromAffine)}static fromHex(p){let y=d.fromAffine(i(mr("pointHex",p)));return y.assertValidity(),y}static fromPrivateKey(p){return d.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,l.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y}=this.toAffine();if(!t.isValid(p)||!t.isValid(y))throw new Error("bad point: x or y not FE");let b=t.sqr(y),E=s(p);if(!t.eql(b,E))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(t.isOdd)return!t.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);let{px:y,py:b,pz:E}=this,{px:x,py:S,pz:M}=p,I=t.eql(t.mul(y,M),t.mul(x,E)),B=t.eql(t.mul(b,M),t.mul(S,E));return I&&B}negate(){return new d(this.px,t.neg(this.py),this.pz)}double(){let{a:p,b:y}=e,b=t.mul(y,X3),{px:E,py:x,pz:S}=this,M=t.ZERO,I=t.ZERO,B=t.ZERO,z=t.mul(E,E),L=t.mul(x,x),q=t.mul(S,S),C=t.mul(E,x);return C=t.add(C,C),B=t.mul(E,S),B=t.add(B,B),M=t.mul(p,B),I=t.mul(b,q),I=t.add(M,I),M=t.sub(L,I),I=t.add(L,I),I=t.mul(M,I),M=t.mul(C,M),B=t.mul(b,B),q=t.mul(p,q),C=t.sub(z,q),C=t.mul(p,C),C=t.add(C,B),B=t.add(z,z),z=t.add(B,z),z=t.add(z,q),z=t.mul(z,C),I=t.add(I,z),q=t.mul(x,S),q=t.add(q,q),z=t.mul(q,C),M=t.sub(M,z),B=t.mul(q,L),B=t.add(B,B),B=t.add(B,B),new d(M,I,B)}add(p){u(p);let{px:y,py:b,pz:E}=this,{px:x,py:S,pz:M}=p,I=t.ZERO,B=t.ZERO,z=t.ZERO,L=e.a,q=t.mul(e.b,X3),C=t.mul(y,x),oe=t.mul(b,S),O=t.mul(E,M),_=t.add(y,b),T=t.add(x,S);_=t.mul(_,T),T=t.add(C,oe),_=t.sub(_,T),T=t.add(y,E);let R=t.add(x,M);return T=t.mul(T,R),R=t.add(C,O),T=t.sub(T,R),R=t.add(b,E),I=t.add(S,M),R=t.mul(R,I),I=t.add(oe,O),R=t.sub(R,I),z=t.mul(L,T),I=t.mul(q,O),z=t.add(I,z),I=t.sub(oe,z),z=t.add(oe,z),B=t.mul(I,z),oe=t.add(C,C),oe=t.add(oe,C),O=t.mul(L,O),T=t.mul(q,T),oe=t.add(oe,O),O=t.sub(C,O),O=t.mul(L,O),T=t.add(T,O),C=t.mul(oe,T),B=t.add(B,C),C=t.mul(R,T),I=t.mul(_,I),I=t.sub(I,C),C=t.mul(_,oe),z=t.mul(R,z),z=t.add(z,C),new d(I,B,z)}subtract(p){return this.add(p.negate())}is0(){return this.equals(d.ZERO)}wNAF(p){return h.wNAFCached(this,l,p,y=>{let b=t.invertBatch(y.map(E=>E.pz));return y.map((E,x)=>E.toAffine(b[x])).map(d.fromAffine)})}multiplyUnsafe(p){let y=d.ZERO;if(p===ri)return y;if(a(p),p===Or)return this;let{endo:b}=e;if(!b)return h.unsafeLadder(this,p);let{k1neg:E,k1:x,k2neg:S,k2:M}=b.splitScalar(p),I=y,B=y,z=this;for(;x>ri||M>ri;)x&Or&&(I=I.add(z)),M&Or&&(B=B.add(z)),z=z.double(),x>>=Or,M>>=Or;return E&&(I=I.negate()),S&&(B=B.negate()),B=new d(t.mul(B.px,b.beta),B.py,B.pz),I.add(B)}multiply(p){a(p);let y=p,b,E,{endo:x}=e;if(x){let{k1neg:S,k1:M,k2neg:I,k2:B}=x.splitScalar(y),{p:z,f:L}=this.wNAF(M),{p:q,f:C}=this.wNAF(B);z=h.constTimeNegate(S,z),q=h.constTimeNegate(I,q),q=new d(t.mul(q.px,x.beta),q.py,q.pz),b=z.add(q),E=L.add(C)}else{let{p:S,f:M}=this.wNAF(y);b=S,E=M}return d.normalizeZ([b,E])[0]}multiplyAndAddUnsafe(p,y,b){let E=d.BASE,x=(M,I)=>I===ri||I===Or||!M.equals(E)?M.multiplyUnsafe(I):M.multiply(I),S=x(this,y).add(x(p,b));return S.is0()?void 0:S}toAffine(p){let{px:y,py:b,pz:E}=this,x=this.is0();p==null&&(p=x?t.ONE:t.inv(E));let S=t.mul(y,p),M=t.mul(b,p),I=t.mul(E,p);if(x)return{x:t.ZERO,y:t.ZERO};if(!t.eql(I,t.ONE))throw new Error("invZ was invalid");return{x:S,y:M}}isTorsionFree(){let{h:p,isTorsionFree:y}=e;if(p===Or)return!0;if(y)return y(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:y}=e;return p===Or?this:y?y(d,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(d,this,p)}toHex(p=!0){return vo(this.toRawBytes(p))}}d.BASE=new d(e.Gx,e.Gy,t.ONE),d.ZERO=new d(t.ZERO,t.ONE,t.ZERO);let f=e.nBitLength,h=Z3(d,e.endo?Math.ceil(f/2):f);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function $ce(r){let e=gA(r);return ps(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function eD(r){let e=$ce(r),{Fp:t,n}=e,i=t.BYTES+1,s=2*t.BYTES+1;function o(T){return ri<T&&T<t.ORDER}function a(T){return Rt(T,n)}function c(T){return Zm(T,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Yce({...e,toBytes(T,R,F){let W=R.toAffine(),G=t.toBytes(W.x),me=fc;return F?me(Uint8Array.from([R.hasEvenY()?2:3]),G):me(Uint8Array.from([4]),G,t.toBytes(W.y))},fromBytes(T){let R=T.length,F=T[0],W=T.subarray(1);if(R===i&&(F===2||F===3)){let G=ti(W);if(!o(G))throw new Error("Point is not on curve");let me=d(G),Se=t.sqrt(me),Ee=(Se&Or)===Or;return(F&1)===1!==Ee&&(Se=t.neg(Se)),{x:G,y:Se}}else if(R===s&&F===4){let G=t.fromBytes(W.subarray(0,t.BYTES)),me=t.fromBytes(W.subarray(t.BYTES,2*t.BYTES));return{x:G,y:me}}else throw new Error(`Point of length ${R} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),h=T=>vo(hs(T,e.nByteLength));function m(T){let R=n>>Or;return T>R}function p(T){return m(T)?a(-T):T}let y=(T,R,F)=>ti(T.slice(R,F));class b{constructor(R,F,W){this.r=R,this.s=F,this.recovery=W,this.assertValidity()}static fromCompact(R){let F=e.nByteLength;return R=mr("compactSignature",R,F*2),new b(y(R,0,F),y(R,F,2*F))}static fromDER(R){let{r:F,s:W}=Eo.toSig(mr("DER",R));return new b(F,W)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(R){return new b(this.r,this.s,R)}recoverPublicKey(R){let{r:F,s:W,recovery:G}=this,me=B(mr("msgHash",R));if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");let Se=G===2||G===3?F+e.n:F;if(Se>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let Ee=G&1?"03":"02",ue=l.fromHex(Ee+h(Se)),qe=c(Se),Te=a(-me*qe),We=a(W*qe),ut=l.BASE.multiplyAndAddUnsafe(ue,Te,We);if(!ut)throw new Error("point at infinify");return ut.assertValidity(),ut}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return bo(this.toDERHex())}toDERHex(){return Eo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return bo(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let E={isValidPrivateKey(T){try{return u(T),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let T=pA(e.n);return $3(e.randomBytes(T),e.n)},precompute(T=8,R=l.BASE){return R._setWindowSize(T),R.multiply(BigInt(3)),R}};function x(T,R=!0){return l.fromPrivateKey(T).toRawBytes(R)}function S(T){let R=T instanceof Uint8Array,F=typeof T=="string",W=(R||F)&&T.length;return R?W===i||W===s:F?W===2*i||W===2*s:T instanceof l}function M(T,R,F=!0){if(S(T))throw new Error("first arg must be private key");if(!S(R))throw new Error("second arg must be public key");return l.fromHex(R).multiply(u(T)).toRawBytes(F)}let I=e.bits2int||function(T){let R=ti(T),F=T.length*8-e.nBitLength;return F>0?R>>BigInt(F):R},B=e.bits2int_modN||function(T){return a(I(T))},z=_u(e.nBitLength);function L(T){if(typeof T!="bigint")throw new Error("bigint expected");if(!(ri<=T&&T<z))throw new Error(`bigint expected < 2^${e.nBitLength}`);return hs(T,e.nByteLength)}function q(T,R,F=C){if(["recovered","canonical"].some(Pn=>Pn in F))throw new Error("sign() legacy options not supported");let{hash:W,randomBytes:G}=e,{lowS:me,prehash:Se,extraEntropy:Ee}=F;me==null&&(me=!0),T=mr("msgHash",T),Se&&(T=mr("prehashed msgHash",W(T)));let ue=B(T),qe=u(R),Te=[L(qe),L(ue)];if(Ee!=null){let Pn=Ee===!0?G(t.BYTES):Ee;Te.push(mr("extraEntropy",Pn))}let We=fc(...Te),ut=ue;function Bc(Pn){let ui=I(Pn);if(!f(ui))return;let Ze=c(ui),k=l.BASE.multiply(ui).toAffine(),N=a(k.x);if(N===ri)return;let D=a(Ze*a(ut+N*qe));if(D===ri)return;let X=(k.x===N?0:2)|Number(k.y&Or),Y=D;return me&&m(D)&&(Y=p(D),X^=1),new b(N,Y,X)}return{seed:We,k2sig:Bc}}let C={lowS:e.lowS,prehash:!1},oe={lowS:e.lowS,prehash:!1};function O(T,R,F=C){let{seed:W,k2sig:G}=q(T,R,F),me=e;return lA(me.hash.outputLen,me.nByteLength,me.hmac)(W,G)}l.BASE._setWindowSize(8);function _(T,R,F,W=oe){let G=T;if(R=mr("msgHash",R),F=mr("publicKey",F),"strict"in W)throw new Error("options.strict was renamed to lowS");let{lowS:me,prehash:Se}=W,Ee,ue;try{if(typeof G=="string"||G instanceof Uint8Array)try{Ee=b.fromDER(G)}catch(k){if(!(k instanceof Eo.Err))throw k;Ee=b.fromCompact(G)}else if(typeof G=="object"&&typeof G.r=="bigint"&&typeof G.s=="bigint"){let{r:k,s:N}=G;Ee=new b(k,N)}else throw new Error("PARSE");ue=l.fromHex(F)}catch(k){if(k.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(me&&Ee.hasHighS())return!1;Se&&(R=e.hash(R));let{r:qe,s:Te}=Ee,We=B(R),ut=c(Te),Bc=a(We*ut),Pn=a(qe*ut),ui=l.BASE.multiplyAndAddUnsafe(ue,Bc,Pn)?.toAffine();return ui?a(ui.x)===qe:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:M,sign:O,verify:_,ProjectivePoint:l,Signature:b,utils:E}}function Zce(r){return{hash:r,hmac:(e,...t)=>oA(r,e,S3(...t)),randomBytes:C3}}function tD(r,e){let t=n=>eD({...r,...Zce(n)});return Object.freeze({...t(e),create:t})}var iD=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),rD=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Xce=BigInt(1),yA=BigInt(2),nD=(r,e)=>(r+e/yA)/e;function ele(r){let e=iD,t=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=r*r*r%e,u=l*l*r%e,d=gr(u,t,e)*u%e,f=gr(d,t,e)*u%e,h=gr(f,yA,e)*l%e,m=gr(h,i,e)*h%e,p=gr(m,s,e)*m%e,y=gr(p,a,e)*p%e,b=gr(y,c,e)*y%e,E=gr(b,a,e)*p%e,x=gr(E,t,e)*u%e,S=gr(x,o,e)*m%e,M=gr(S,n,e)*l%e,I=gr(M,yA,e);if(!vA.eql(vA.sqr(I),r))throw new Error("Cannot find square root");return I}var vA=Q3(iD,void 0,void 0,{sqrt:ele}),ni=tD({a:BigInt(0),b:BigInt(7),Fp:vA,n:rD,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=rD,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Xce*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,o=BigInt("0x100000000000000000000000000000000"),a=nD(s*r,e),c=nD(-n*r,e),l=Rt(r-a*t-c*i,e),u=Rt(-a*n-c*s,e),d=l>o,f=u>o;if(d&&(l=e-l),f&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},F3),kEe=BigInt(0);var REe=ni.ProjectivePoint;var ii="0x0000000000000000000000000000000000000000";var Xm="0x0000000000000000000000000000000000000000000000000000000000000000";var sD=BigInt(0),oD=BigInt(1),aD=BigInt(2),cD=BigInt(27),lD=BigInt(28),eg=BigInt(35),hc={};function uD(r){return hr(tt(r),32)}var Wt=class r{#e;#t;#r;#n;get r(){return this.#e}set r(e){A(wn(e)===32,"invalid r","value",e),this.#e=j(e)}get s(){return this.#t}set s(e){A(wn(e)===32,"invalid s","value",e);let t=j(e);A(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#t=t}get v(){return this.#r}set v(e){let t=se(e,"value");A(t===27||t===28,"invalid v","v",e),this.#r=t}get networkV(){return this.#n}get legacyChainId(){let e=this.networkV;return e==null?null:r.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=ne(this.s);return this.yParity&&(e[0]|=128),j(e)}get compactSerialized(){return we([this.r,this.yParityAndS])}get serialized(){return we([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,i){is(e,hc,"Signature"),this.#e=t,this.#t=n,this.#r=i,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let e=new r(hc,this.r,this.s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){let e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){let t=H(e,"v");return t==cD||t==lD?sD:(A(t>=eg,"invalid EIP-155 v","v",e),(t-eg)/aD)}static getChainIdV(e,t){return H(e)*aD+BigInt(35+t-27)}static getNormalizedV(e){let t=H(e);return t===sD||t===cD?27:t===oD||t===lD?28:(A(t>=eg,"invalid v","v",e),t&oD?27:28)}static from(e){function t(l,u){A(l,u,"signature",e)}if(e==null)return new r(hc,Xm,Xm,27);if(typeof e=="string"){let l=ne(e,"signature");if(l.length===64){let u=j(l.slice(0,32)),d=l.slice(32,64),f=d[0]&128?28:27;return d[0]&=127,new r(hc,u,j(d),f)}if(l.length===65){let u=j(l.slice(0,32)),d=l.slice(32,64);t((d[0]&128)===0,"non-canonical s");let f=r.getNormalizedV(l[64]);return new r(hc,u,j(d),f)}t(!1,"invalid raw signature length")}if(e instanceof r)return e.clone();let n=e.r;t(n!=null,"missing r");let i=uD(n),s=function(l,u){if(l!=null)return uD(l);if(u!=null){t(pe(u,32),"invalid yParityAndS");let d=ne(u);return d[0]&=127,j(d)}t(!1,"missing s")}(e.s,e.yParityAndS);t((ne(s)[0]&128)==0,"non-canonical s");let{networkV:o,v:a}=function(l,u,d){if(l!=null){let f=H(l);return{networkV:f>=eg?f:void 0,v:r.getNormalizedV(f)}}if(u!=null)return t(pe(u,32),"invalid yParityAndS"),{v:ne(u)[0]&128?28:27};if(d!=null){switch(se(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new r(hc,i,s,a);return o&&(c.#n=o),t(e.yParity==null||se(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};var ms=class r{#e;constructor(e){A(wn(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=j(e)}get privateKey(){return this.#e}get publicKey(){return r.computePublicKey(this.#e)}get compressedPublicKey(){return r.computePublicKey(this.#e,!0)}sign(e){A(wn(e)===32,"invalid digest length","digest",e);let t=ni.sign(He(e),He(this.#e),{lowS:!0});return Wt.from({r:rr(t.r,32),s:rr(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){let t=r.computePublicKey(e);return j(ni.getSharedSecret(He(this.#e),ne(t),!1))}static computePublicKey(e,t){let n=ne(e,"key");if(n.length===32){let s=ni.getPublicKey(n,!!t);return j(s)}if(n.length===64){let s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}let i=ni.ProjectivePoint.fromHex(n);return j(i.toRawBytes(t))}static recoverPublicKey(e,t){A(wn(e)===32,"invalid digest length","digest",e);let n=Wt.from(t),i=ni.Signature.fromCompact(He(we([n.r,n.s])));i=i.addRecoveryBit(n.yParity);let s=i.recoverPublicKey(He(e));return A(s!=null,"invalid signautre for digest","signature",t),"0x"+s.toHex(!1)}static addPoints(e,t,n){let i=ni.ProjectivePoint.fromHex(r.computePublicKey(e).substring(2)),s=ni.ProjectivePoint.fromHex(r.computePublicKey(t).substring(2));return"0x"+i.add(s).toHex(!!n)}};var tle=BigInt(0),rle=BigInt(36);function dD(r){r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let i=0;i<40;i++)t[i]=e[i].charCodeAt(0);let n=ne(Oe(t));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}var bA={};for(let r=0;r<10;r++)bA[String(r)]=String(r);for(let r=0;r<26;r++)bA[String.fromCharCode(65+r)]=String(10+r);var fD=15;function nle(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>bA[n]).join("");for(;e.length>=fD;){let n=e.substring(0,fD);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}var ile=function(){let r={};for(let e=0;e<36;e++){let t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r}();function sle(r){r=r.toLowerCase();let e=tle;for(let t=0;t<r.length;t++)e=e*rle+ile[r[t]];return e}function de(r){if(A(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);let e=dD(r);return A(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){A(r.substring(2,4)===nle(r),"bad icap checksum","address",r);let e=sle(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return dD("0x"+e)}A(!1,"invalid address","address",r)}function _A(r){let e=de(r.from),n=H(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,de(Le(Oe(Tn([e,n])),12))}function tg(r){return r&&typeof r.getAddress=="function"}async function EA(r,e){let t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&(P(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),A(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),de(t)}function nt(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?de(r):(P(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),EA(r,e.resolveName(r)));if(tg(r))return EA(r,r.getAddress());if(r&&typeof r.then=="function")return EA(r,r);A(!1,"unsupported addressable value","target",r)}var Wr={};function Z(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new Ne(Wr,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function Ae(r,e){return new Ne(Wr,`bytes${e||""}`,r,{size:e})}var hD=Symbol.for("_ethers_typed"),Ne=class r{type;value;#e;_typedSymbol;constructor(e,t,n,i){i==null&&(i=null),is(Wr,e,"Typed"),J(this,{_typedSymbol:hD,type:t,value:n}),this.#e=i,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new r(Wr,e,t)}static uint8(e){return Z(e,8)}static uint16(e){return Z(e,16)}static uint24(e){return Z(e,24)}static uint32(e){return Z(e,32)}static uint40(e){return Z(e,40)}static uint48(e){return Z(e,48)}static uint56(e){return Z(e,56)}static uint64(e){return Z(e,64)}static uint72(e){return Z(e,72)}static uint80(e){return Z(e,80)}static uint88(e){return Z(e,88)}static uint96(e){return Z(e,96)}static uint104(e){return Z(e,104)}static uint112(e){return Z(e,112)}static uint120(e){return Z(e,120)}static uint128(e){return Z(e,128)}static uint136(e){return Z(e,136)}static uint144(e){return Z(e,144)}static uint152(e){return Z(e,152)}static uint160(e){return Z(e,160)}static uint168(e){return Z(e,168)}static uint176(e){return Z(e,176)}static uint184(e){return Z(e,184)}static uint192(e){return Z(e,192)}static uint200(e){return Z(e,200)}static uint208(e){return Z(e,208)}static uint216(e){return Z(e,216)}static uint224(e){return Z(e,224)}static uint232(e){return Z(e,232)}static uint240(e){return Z(e,240)}static uint248(e){return Z(e,248)}static uint256(e){return Z(e,256)}static uint(e){return Z(e,256)}static int8(e){return Z(e,-8)}static int16(e){return Z(e,-16)}static int24(e){return Z(e,-24)}static int32(e){return Z(e,-32)}static int40(e){return Z(e,-40)}static int48(e){return Z(e,-48)}static int56(e){return Z(e,-56)}static int64(e){return Z(e,-64)}static int72(e){return Z(e,-72)}static int80(e){return Z(e,-80)}static int88(e){return Z(e,-88)}static int96(e){return Z(e,-96)}static int104(e){return Z(e,-104)}static int112(e){return Z(e,-112)}static int120(e){return Z(e,-120)}static int128(e){return Z(e,-128)}static int136(e){return Z(e,-136)}static int144(e){return Z(e,-144)}static int152(e){return Z(e,-152)}static int160(e){return Z(e,-160)}static int168(e){return Z(e,-168)}static int176(e){return Z(e,-176)}static int184(e){return Z(e,-184)}static int192(e){return Z(e,-192)}static int200(e){return Z(e,-200)}static int208(e){return Z(e,-208)}static int216(e){return Z(e,-216)}static int224(e){return Z(e,-224)}static int232(e){return Z(e,-232)}static int240(e){return Z(e,-240)}static int248(e){return Z(e,-248)}static int256(e){return Z(e,-256)}static int(e){return Z(e,-256)}static bytes1(e){return Ae(e,1)}static bytes2(e){return Ae(e,2)}static bytes3(e){return Ae(e,3)}static bytes4(e){return Ae(e,4)}static bytes5(e){return Ae(e,5)}static bytes6(e){return Ae(e,6)}static bytes7(e){return Ae(e,7)}static bytes8(e){return Ae(e,8)}static bytes9(e){return Ae(e,9)}static bytes10(e){return Ae(e,10)}static bytes11(e){return Ae(e,11)}static bytes12(e){return Ae(e,12)}static bytes13(e){return Ae(e,13)}static bytes14(e){return Ae(e,14)}static bytes15(e){return Ae(e,15)}static bytes16(e){return Ae(e,16)}static bytes17(e){return Ae(e,17)}static bytes18(e){return Ae(e,18)}static bytes19(e){return Ae(e,19)}static bytes20(e){return Ae(e,20)}static bytes21(e){return Ae(e,21)}static bytes22(e){return Ae(e,22)}static bytes23(e){return Ae(e,23)}static bytes24(e){return Ae(e,24)}static bytes25(e){return Ae(e,25)}static bytes26(e){return Ae(e,26)}static bytes27(e){return Ae(e,27)}static bytes28(e){return Ae(e,28)}static bytes29(e){return Ae(e,29)}static bytes30(e){return Ae(e,30)}static bytes31(e){return Ae(e,31)}static bytes32(e){return Ae(e,32)}static address(e){return new r(Wr,"address",e)}static bool(e){return new r(Wr,"bool",!!e)}static bytes(e){return new r(Wr,"bytes",e)}static string(e){return new r(Wr,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new r(Wr,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===hD}static dereference(e,t){if(r.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};var rg=class extends rt{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Ne.dereference(t,"string");try{n=de(n)}catch(i){return this._throwError(i.message,t)}return e.writeValue(n)}decode(e){return de(rr(e.readValue(),20))}};var ng=class extends rt{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}};function AA(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(l=>{let u=l.localName;return P(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),P(!c[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:t}),c[u]=!0,t[u]})}else A(!1,"invalid tuple value","tuple",t);A(e.length===n.length,"types/value length mismatch","tuple",t);let i=new yo,s=new yo,o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let d=s.length;c.encode(s,u);let f=i.writeUpdatableValue();o.push(h=>{f(h+d)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=r.appendWriter(i);return a+=r.appendWriter(s),a}function wA(r,e){let t=[],n=[],i=r.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=r.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(l){if(je(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(r)}catch(a){if(je(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");t.push(o),n.push(s.localName||null)}),Cn.fromItems(t,n)}var ig=class extends rt{coder;length;constructor(e,t,n){let i=e.type+"["+(t>=0?t:"")+"]",s=t===-1||e.dynamic;super("array",i,n,s),J(this,{coder:e,length:t})}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){let n=Ne.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),fu(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let o=0;o<n.length;o++)s.push(this.coder);return AA(e,s,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),P(t*St<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*St,length:e.dataLength}));let n=[];for(let i=0;i<t;i++)n.push(new ng(this.coder));return wA(e,n)}};var sg=class extends rt{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){let n=Ne.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}};var Eu=class extends rt{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=He(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}},og=class extends Eu{constructor(e){super("bytes",e)}decode(e){return j(super.decode(e))}};var ag=class extends rt{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),J(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=He(Ne.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return j(e.readBytes(this.size))}};var ole=new Uint8Array([]),cg=class extends rt{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(ole)}decode(e){return e.readBytes(0),null}};var ale=BigInt(0),cle=BigInt(1),lle=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),lg=class extends rt{size;signed;constructor(e,t,n){let i=(t?"int":"uint")+e*8;super(i,i,n,!1),J(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=H(Ne.dereference(t,this.type)),i=ss(lle,St*8);if(this.signed){let s=ss(i,this.size*8-1);(n>s||n<-(s+cle))&&this._throwError("value out-of-bounds",t),n=hu(n,8*St)}else(n<ale||n>ss(i,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=ss(e.readValue(),this.size*8);return this.signed&&(t=Z1(t,this.size*8)),t}};var ug=class extends Eu{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Vt(Ne.dereference(t,"string")))}decode(e){return os(super.decode(e))}};var Ao=class extends rt{coders;constructor(e,t){let n=!1,i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});let s="tuple("+i.join(",")+")";super("tuple",s,t,n),J(this,{coders:Object.freeze(e.slice())})}defaultValue(){let e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});let t=this.coders.reduce((n,i)=>{let s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||t[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,t){let n=Ne.dereference(t,"tuple");return AA(e,this.coders,n)}decode(e){return wA(e,this.coders)}};function Kr(r){return Oe(Vt(r))}var ule="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI",pD=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),mD=4;function dle(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),i=1,s=[0,1];for(let M=1;M<n;M++)s.push(i+=t());let o=t(),a=e;e+=o;let c=0,l=0;function u(){return c==0&&(l=l<<8|r[e++],c=8),l>>--c&1}let d=31,f=2**d,h=f>>>1,m=h>>1,p=f-1,y=0;for(let M=0;M<d;M++)y=y<<1|u();let b=[],E=0,x=f;for(;;){let M=Math.floor(((y-E+1)*i-1)/x),I=0,B=n;for(;B-I>1;){let q=I+B>>>1;M<s[q]?B=q:I=q}if(I==0)break;b.push(I);let z=E+Math.floor(x*s[I]/i),L=E+Math.floor(x*s[I+1]/i)-1;for(;!((z^L)&h);)y=y<<1&p|u(),z=z<<1&p,L=L<<1&p|1;for(;z&~L&m;)y=y&h|y<<1&p>>>1|u(),z=z<<1^h,L=(L^h)<<1|h|1;E=z,x=1+L-z}let S=n-4;return b.map(M=>{switch(M-S){case 3:return S+65792+(r[a++]<<16|r[a++]<<8|r[a++]);case 2:return S+256+(r[a++]<<8|r[a++]);case 1:return S+r[a++];default:return M-1}})}function fle(r){let e=0;return()=>r[e++]}function bD(r){return fle(dle(hle(r)))}function hle(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let t=r.length,n=new Uint8Array(6*t>>3);for(let i=0,s=0,o=0,a=0;i<t;i++)a=a<<6|e[r.charCodeAt(i)],o+=6,o>=8&&(n[s++]=a>>(o-=8));return n}function ple(r){return r&1?~r>>1:r>>1}function mle(r,e){let t=Array(r);for(let n=0,i=0;n<r;n++)t[n]=i+=ple(e());return t}function Su(r,e=0){let t=[];for(;;){let n=r(),i=r();if(!i)break;e+=n;for(let s=0;s<i;s++)t.push(e+s);e+=i+1}return t}function _D(r){return Tu(()=>{let e=Su(r);if(e.length)return e})}function ED(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(gle(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(yle(t,r))}return e.flat()}function Tu(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function AD(r,e,t){let n=Array(r).fill().map(()=>[]);for(let i=0;i<e;i++)mle(r,t).forEach((s,o)=>n[o].push(s));return n}function gle(r,e){let t=1+e(),n=e(),i=Tu(e);return AD(i.length,1+r,e).flatMap((o,a)=>{let[c,...l]=o;return Array(i[a]).fill().map((u,d)=>{let f=d*n;return[c+d*t,l.map(h=>h+f)]})})}function yle(r,e){let t=1+e();return AD(t,1+r,e).map(i=>[i[0],i.slice(1)])}function vle(r){let e=[],t=Su(r);return i(n([]),[]),e;function n(s){let o=r(),a=Tu(()=>{let c=Su(r).map(l=>t[l]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let l of o)for(let u of l.Q)i(l,[...a,u],c)}}}function ble(r){return r.toString(16).toUpperCase().padStart(2,"0")}function wD(r){return`{${ble(r)}}`}function _le(r){let e=[];for(let t=0,n=r.length;t<n;){let i=r.codePointAt(t);t+=i<65536?1:2,e.push(i)}return e}function gc(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let i=0;i<t;)n.push(String.fromCodePoint(...r.slice(i,i+=4096)));return n.join("")}function Ele(r,e){let t=r.length,n=t-e.length;for(let i=0;n==0&&i<t;i++)n=r[i]-e[i];return n}var Ale="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g",Cu=44032,fg=4352,hg=4449,pg=4519,SD=19,TD=21,yc=28,mg=TD*yc,wle=SD*mg,Sle=Cu+wle,Tle=fg+SD,Cle=hg+TD,xle=pg+yc;function Au(r){return r>>24&255}function CD(r){return r&16777215}var TA,gD,CA,dg;function Ole(){let r=bD(Ale);TA=new Map(_D(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),gD=new Set(Su(r)),CA=new Map,dg=new Map;for(let[e,t]of ED(r)){if(!gD.has(e)&&t.length==2){let[n,i]=t,s=dg.get(n);s||(s=new Map,dg.set(n,s)),s.set(i,e)}CA.set(e,t.reverse())}}function xD(r){return r>=Cu&&r<Sle}function Ile(r,e){if(r>=fg&&r<Tle&&e>=hg&&e<Cle)return Cu+(r-fg)*mg+(e-hg)*yc;if(xD(r)&&e>pg&&e<xle&&(r-Cu)%yc==0)return r+(e-pg);{let t=dg.get(r);return t&&(t=t.get(e),t)?t:-1}}function OD(r){TA||Ole();let e=[],t=[],n=!1;function i(s){let o=TA.get(s);o&&(n=!0,s|=o),e.push(s)}for(let s of r)for(;;){if(s<128)e.push(s);else if(xD(s)){let o=s-Cu,a=o/mg|0,c=o%mg/yc|0,l=o%yc;i(fg+a),i(hg+c),l>0&&i(pg+l)}else{let o=CA.get(s);o?t.push(...o):i(s)}if(!t.length)break;s=t.pop()}if(n&&e.length>1){let s=Au(e[0]);for(let o=1;o<e.length;o++){let a=Au(e[o]);if(a==0||s<=a){s=a;continue}let c=o-1;for(;;){let l=e[c+1];if(e[c+1]=e[c],e[c]=l,!c||(s=Au(e[--c]),s<=a))break}s=Au(e[o])}}return e}function Ple(r){let e=[],t=[],n=-1,i=0;for(let s of r){let o=Au(s),a=CD(s);if(n==-1)o==0?n=a:e.push(a);else if(i>0&&i>=o)o==0?(e.push(n,...t),t.length=0,n=a):t.push(a),i=o;else{let c=Ile(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(t.push(a),i=o)}}return n>=0&&e.push(n,...t),e}function ID(r){return OD(r).map(CD)}function kle(r){return Ple(OD(r))}var yD=45;var PD=".",kD=65039,RD=1,gg=r=>Array.from(r);function xu(r,e){return r.P.has(e)||r.Q.has(e)}var xA=class extends Array{get is_emoji(){return!0}},OA,ND,So,IA,MD,Rle,mc,SA,pc,wo,vD,PA;function kA(){if(OA)return;let r=bD(ule),e=()=>Su(r),t=()=>new Set(e()),n=(u,d)=>d.forEach(f=>u.add(f));OA=new Map(ED(r)),ND=t(),So=e(),IA=new Set(e().map(u=>So[u])),So=new Set(So),MD=t(),Rle=t();let i=_D(r),s=r(),o=()=>{let u=new Set;return e().forEach(d=>n(u,i[d])),n(u,e()),u};mc=Tu(u=>{let d=Tu(r).map(f=>f+96);if(d.length){let f=u>=s;d[0]-=32,d=gc(d),f&&(d=`Restricted[${d}]`);let h=o(),m=o(),p=!r();return{N:d,P:h,Q:m,M:p,R:f}}}),SA=t(),pc=new Map;let a=e().concat(gg(SA)).sort((u,d)=>u-d);a.forEach((u,d)=>{let f=r(),h=a[d]=f?a[d-f]:{V:[],M:new Map};h.V.push(u),SA.has(u)||pc.set(u,h)});for(let{V:u,M:d}of new Set(pc.values())){let f=[];for(let m of u){let p=mc.filter(b=>xu(b,m)),y=f.find(({G:b})=>p.some(E=>b.has(E)));y||(y={G:new Set,V:[]},f.push(y)),y.V.push(m),n(y.G,p)}let h=f.flatMap(m=>gg(m.G));for(let{G:m,V:p}of f){let y=new Set(h.filter(b=>!m.has(b)));for(let b of p)d.set(b,y)}}wo=new Set;let c=new Set,l=u=>wo.has(u)?c.add(u):wo.add(u);for(let u of mc){for(let d of u.P)l(d);for(let d of u.Q)l(d)}for(let u of wo)!pc.has(u)&&!c.has(u)&&pc.set(u,RD);n(wo,ID(wo)),vD=vle(r).map(u=>xA.from(u)).sort(Ele),PA=new Map;for(let u of vD){let d=[PA];for(let f of u){let h=d.map(m=>{let p=m.get(f);return p||(p=new Map,m.set(f,p)),p});f===kD?d.push(...h):d=h}for(let f of d)f.V=u}}function RA(r){return(DD(r)?"":`${NA(yg([r]))} `)+wD(r)}function NA(r){return`"${r}"\u200E`}function Nle(r){if(r.length>=4&&r[2]==yD&&r[3]==yD)throw new Error(`invalid label extension: "${gc(r.slice(0,4))}"`)}function Mle(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function Dle(r){let e=r[0],t=pD.get(e);if(t)throw wu(`leading ${t}`);let n=r.length,i=-1;for(let s=1;s<n;s++){e=r[s];let o=pD.get(e);if(o){if(i==s)throw wu(`${t} + ${o}`);i=s+1,t=o}}if(i==n)throw wu(`trailing ${t}`)}function yg(r,e=1/0,t=wD){let n=[];Lle(r[0])&&n.push("\u25CC"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let i=0,s=r.length;for(let o=0;o<s;o++){let a=r[o];DD(a)&&(n.push(gc(r.slice(i,o))),n.push(t(a)),i=o+1)}return n.push(gc(r.slice(i,s))),n.join("")}function Lle(r){return kA(),So.has(r)}function DD(r){return kA(),MD.has(r)}function LD(r){return Ule(Fle(r,kle,Hle))}function Fle(r,e,t){if(!r)return[];kA();let n=0;return r.split(PD).map(i=>{let s=_le(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=zle(s,e,t),c=a.length,l;if(!c)throw new Error("empty label");let u=o.output=a.flat();if(Mle(u),!(o.emoji=c>1||a[0].is_emoji)&&u.every(f=>f<128))Nle(u),l="ASCII";else{let f=a.flatMap(h=>h.is_emoji?[]:h);if(!f.length)l="Emoji";else{if(So.has(u[0]))throw wu("leading combining mark");for(let p=1;p<c;p++){let y=a[p];if(!y.is_emoji&&So.has(y[0]))throw wu(`emoji + combining mark: "${gc(a[p-1])} + ${yg([y[0]])}"`)}Dle(u);let h=gg(new Set(f)),[m]=Ble(h);jle(m,f),qle(m,h),l=m.N}}o.type=l}catch(a){o.error=a}return o})}function qle(r,e){let t,n=[];for(let i of e){let s=pc.get(i);if(s===RD)return;if(s){let o=s.M.get(i);if(t=t?t.filter(a=>o.has(a)):gg(o),!t.length)return}else n.push(i)}if(t){for(let i of t)if(n.every(s=>xu(i,s)))throw new Error(`whole-script confusable: ${r.N}/${i.N}`)}}function Ble(r){let e=mc;for(let t of r){let n=e.filter(i=>xu(i,t));if(!n.length)throw mc.some(i=>xu(i,t))?qD(e[0],t):FD(t);if(e=n,n.length==1)break}return e}function Ule(r){return r.map(({input:e,error:t,output:n})=>{if(t){let i=t.message;throw new Error(r.length==1?i:`Invalid label ${NA(yg(e,63))}: ${i}`)}return gc(n)}).join(PD)}function FD(r){return new Error(`disallowed character: ${RA(r)}`)}function qD(r,e){let t=RA(e),n=mc.find(i=>i.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function wu(r){return new Error(`illegal placement: ${r}`)}function jle(r,e){for(let t of e)if(!xu(r,t))throw qD(r,t);if(r.M){let t=ID(e);for(let n=1,i=t.length;n<i;n++)if(IA.has(t[n])){let s=n+1;for(let o;s<i&&IA.has(o=t[s]);s++)for(let a=n;a<s;a++)if(t[a]==o)throw new Error(`duplicate non-spacing marks: ${RA(o)}`);if(s-n>mD)throw new Error(`excessive non-spacing marks: ${NA(yg(t.slice(n-1,s)))} (${s-n}/${mD})`);n=s}}}function zle(r,e,t){let n=[],i=[];for(r=r.slice().reverse();r.length;){let s=Gle(r);if(s)i.length&&(n.push(e(i)),i=[]),n.push(t(s));else{let o=r.pop();if(wo.has(o))i.push(o);else{let a=OA.get(o);if(a)i.push(...a);else if(!ND.has(o))throw FD(o)}}}return i.length&&n.push(e(i)),n}function Hle(r){return r.filter(e=>e!=kD)}function Gle(r,e){let t=PA,n,i=r.length;for(;i&&(t=t.get(r[--i]),!!t);){let{V:s}=t;s&&(n=s,e&&e.push(...r.slice(i).reverse()),r.length=i)}return n}var UD=new Uint8Array(32);UD.fill(0);function BD(r){return A(r.length!==0,"invalid ENS name; empty component","comp",r),r}function jD(r){let e=Vt(zD(r)),t=[];if(r.length===0)return t;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(t.push(BD(e.slice(n,i))),n=i+1);return A(n<e.length,"invalid ENS name; empty component","name",r),t.push(BD(e.slice(n))),t}function zD(r){try{if(r.length===0)throw new Error("empty label");return LD(r)}catch(e){A(!1,`invalid ENS name (${e.message})`,"name",r)}}function vc(r){A(typeof r=="string","invalid ENS name; not a string","name",r),A(r.length,"invalid ENS name (empty label)","name",r);let e=UD,t=jD(r);for(;t.length;)e=Oe(we([e,Oe(t.pop())]));return j(e)}function MA(r,e){let t=e??63;return A(t<=255,"DNS encoded label cannot exceed 255","length",t),j(we(jD(r).map(n=>{A(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);let i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function DA(r,e){return{address:de(r),storageKeys:e.map((t,n)=>(A(pe(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function yr(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?(A(t.length===2,"invalid slot set",`value[${n}]`,t),DA(t[0],t[1])):(A(t!=null&&typeof t=="object","invalid address-slot set","value",r),DA(t.address,t.storageKeys)));A(r!=null&&typeof r=="object","invalid access list","value",r);let e=Object.keys(r).map(t=>{let n=r[t].reduce((i,s)=>(i[s]=!0,i),{});return DA(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}function Vle(r){let e;return typeof r=="string"?e=ms.computePublicKey(r,!1):e=r.publicKey,de(Oe("0x"+e.substring(4)).substring(26))}function HD(r,e){return Vle(ms.recoverPublicKey(r,e))}var gt=BigInt(0),Wle=BigInt(2),Kle=BigInt(27),Jle=BigInt(28),Qle=BigInt(35),Yle=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),LA=4096*32;function GD(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=fs(e).substring(4),"0x"+t}function vg(r){return r==="0x"?null:de(r)}function FA(r,e){try{return yr(r)}catch(t){A(!1,t.message,e,r)}}function Ou(r,e){return r==="0x"?0:se(r,e)}function Ye(r,e){if(r==="0x")return gt;let t=H(r,e);return A(t<=Yle,"value exceeds uint size",e,t),t}function Fe(r,e){let t=H(r,"value"),n=tt(t);return A(n.length<=32,"value too large",`tx.${e}`,t),n}function qA(r){return yr(r).map(e=>[e.address,e.storageKeys])}function $le(r,e){A(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)A(pe(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function Zle(r){let e=dc(r);A(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);let t={type:0,nonce:Ou(e[0],"nonce"),gasPrice:Ye(e[1],"gasPrice"),gasLimit:Ye(e[2],"gasLimit"),to:vg(e[3]),value:Ye(e[4],"value"),data:j(e[5]),chainId:gt};if(e.length===6)return t;let n=Ye(e[6],"v"),i=Ye(e[7],"r"),s=Ye(e[8],"s");if(i===gt&&s===gt)t.chainId=n;else{let o=(n-Qle)/Wle;o<gt&&(o=gt),t.chainId=o,A(o!==gt||n===Kle||n===Jle,"non-canonical legacy v","v",e[6]),t.signature=Wt.from({r:hr(e[7],32),s:hr(e[8],32),v:n})}return t}function Xle(r,e){let t=[Fe(r.nonce,"nonce"),Fe(r.gasPrice||0,"gasPrice"),Fe(r.gasLimit,"gasLimit"),r.to||"0x",Fe(r.value,"value"),r.data],n=gt;if(r.chainId!=gt)n=H(r.chainId,"tx.chainId"),A(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){let s=r.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==gt&&(t.push(tt(n)),t.push("0x"),t.push("0x")),Tn(t);let i=BigInt(27+e.yParity);return n!==gt?i=Wt.getChainIdV(n,e.v):BigInt(e.v)!==i&&A(!1,"tx.chainId/sig.v mismatch","sig",e),t.push(tt(i)),t.push(tt(e.r)),t.push(tt(e.s)),Tn(t)}function BA(r,e){let t;try{if(t=Ou(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{A(!1,"invalid yParity","yParity",e[0])}let n=hr(e[1],32),i=hr(e[2],32),s=Wt.from({r:n,s:i,yParity:t});r.signature=s}function eue(r){let e=dc(ne(r).slice(1));A(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",j(r));let t={type:2,chainId:Ye(e[0],"chainId"),nonce:Ou(e[1],"nonce"),maxPriorityFeePerGas:Ye(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Ye(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ye(e[4],"gasLimit"),to:vg(e[5]),value:Ye(e[6],"value"),data:j(e[7]),accessList:FA(e[8],"accessList")};return e.length===9||BA(t,e.slice(9)),t}function tue(r,e){let t=[Fe(r.chainId,"chainId"),Fe(r.nonce,"nonce"),Fe(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Fe(r.maxFeePerGas||0,"maxFeePerGas"),Fe(r.gasLimit,"gasLimit"),r.to||"0x",Fe(r.value,"value"),r.data,qA(r.accessList||[])];return e&&(t.push(Fe(e.yParity,"yParity")),t.push(tt(e.r)),t.push(tt(e.s))),we(["0x02",Tn(t)])}function rue(r){let e=dc(ne(r).slice(1));A(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",j(r));let t={type:1,chainId:Ye(e[0],"chainId"),nonce:Ou(e[1],"nonce"),gasPrice:Ye(e[2],"gasPrice"),gasLimit:Ye(e[3],"gasLimit"),to:vg(e[4]),value:Ye(e[5],"value"),data:j(e[6]),accessList:FA(e[7],"accessList")};return e.length===8||BA(t,e.slice(8)),t}function nue(r,e){let t=[Fe(r.chainId,"chainId"),Fe(r.nonce,"nonce"),Fe(r.gasPrice||0,"gasPrice"),Fe(r.gasLimit,"gasLimit"),r.to||"0x",Fe(r.value,"value"),r.data,qA(r.accessList||[])];return e&&(t.push(Fe(e.yParity,"recoveryParam")),t.push(tt(e.r)),t.push(tt(e.s))),we(["0x01",Tn(t)])}function iue(r){let e=dc(ne(r).slice(1)),t="3",n=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";let s=e[1],o=e[2],a=e[3];A(Array.isArray(s),"invalid network format: blobs not an array","fields[1]",s),A(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),A(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),A(s.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),A(s.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:s[c],commitment:o[c],proof:a[c]});e=e[0]}A(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",j(r));let i={type:3,chainId:Ye(e[0],"chainId"),nonce:Ou(e[1],"nonce"),maxPriorityFeePerGas:Ye(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Ye(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ye(e[4],"gasLimit"),to:vg(e[5]),value:Ye(e[6],"value"),data:j(e[7]),accessList:FA(e[8],"accessList"),maxFeePerBlobGas:Ye(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(i.blobs=n),A(i.to!=null,`invalid address for transaction type: ${t}`,"data",r),A(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let s=0;s<i.blobVersionedHashes.length;s++)A(pe(i.blobVersionedHashes[s],32),`invalid blobVersionedHash at index ${s}: must be length 32`,"data",r);return e.length===11||BA(i,e.slice(11)),i}function sue(r,e,t){let n=[Fe(r.chainId,"chainId"),Fe(r.nonce,"nonce"),Fe(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Fe(r.maxFeePerGas||0,"maxFeePerGas"),Fe(r.gasLimit,"gasLimit"),r.to||ii,Fe(r.value,"value"),r.data,qA(r.accessList||[]),Fe(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),$le(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(Fe(e.yParity,"yParity")),n.push(tt(e.r)),n.push(tt(e.s)),t)?we(["0x03",Tn([n,t.map(i=>i.data),t.map(i=>i.commitment),t.map(i=>i.proof)])]):we(["0x03",Tn(n)])}var To=class r{#e;#t;#r;#n;#i;#c;#a;#u;#p;#h;#d;#o;#s;#l;#m;#f;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;default:A(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){let e=this.#t;return e==null&&this.type===3?ii:e}set to(e){this.#t=e==null?null:de(e)}get nonce(){return this.#n}set nonce(e){this.#n=se(e,"value")}get gasLimit(){return this.#i}set gasLimit(e){this.#i=H(e)}get gasPrice(){let e=this.#c;return e==null&&(this.type===0||this.type===1)?gt:e}set gasPrice(e){this.#c=e==null?null:H(e,"gasPrice")}get maxPriorityFeePerGas(){let e=this.#a;return e??(this.type===2||this.type===3?gt:null)}set maxPriorityFeePerGas(e){this.#a=e==null?null:H(e,"maxPriorityFeePerGas")}get maxFeePerGas(){let e=this.#u;return e??(this.type===2||this.type===3?gt:null)}set maxFeePerGas(e){this.#u=e==null?null:H(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=j(e)}get value(){return this.#p}set value(e){this.#p=H(e,"value")}get chainId(){return this.#h}set chainId(e){this.#h=H(e)}get signature(){return this.#d||null}set signature(e){this.#d=e==null?null:Wt.from(e)}get accessList(){let e=this.#o||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#o=e==null?null:yr(e)}get maxFeePerBlobGas(){let e=this.#s;return e==null&&this.type===3?gt:e}set maxFeePerBlobGas(e){this.#s=e==null?null:H(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){A(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)A(pe(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#l=e}get blobs(){return this.#f==null?null:this.#f.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#f=null;return}let t=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if(po(s)){P(this.#m,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=ne(s);if(A(o.length<=LA,"blob is too large",`blobs[${i}]`,s),o.length!==LA){let l=new Uint8Array(LA);l.set(o),o=l}let a=this.#m.blobToKzgCommitment(o),c=j(this.#m.computeBlobKzgProof(o,a));t.push({data:j(o),commitment:j(a),proof:c}),n.push(GD(1,a))}else{let o=j(s.commitment);t.push({data:j(s.data),commitment:o,proof:j(s.proof)}),n.push(GD(1,o))}}this.#f=t,this.#l=n}get kzg(){return this.#m}set kzg(e){this.#m=e}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#i=gt,this.#c=null,this.#a=null,this.#u=null,this.#r="0x",this.#p=gt,this.#h=gt,this.#d=null,this.#o=null,this.#s=null,this.#l=null,this.#f=null,this.#m=null}get hash(){return this.signature==null?null:Oe(this.#g(!0,!1))}get unsignedHash(){return Oe(this.unsignedSerialized)}get from(){return this.signature==null?null:HD(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:ms.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}#g(e,t){P(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let n=e?this.signature:null;switch(this.inferType()){case 0:return Xle(this,n);case 1:return nue(this,n);case 2:return tue(this,n);case 3:return sue(this,n,t?this.blobs:null)}P(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#g(!0,!0)}get unsignedSerialized(){return this.#g(!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=this.#s!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&P(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),P(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),P(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let s=[];return this.type!=null?s.push(this.type):t?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return r.from(this)}toJSON(){let e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new r;if(typeof e=="string"){let n=ne(e);if(n[0]>=127)return r.from(Zle(n));switch(n[0]){case 1:return r.from(rue(n));case 2:return r.from(eue(n));case 3:return r.from(iue(n))}P(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let t=new r;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Wt.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&(A(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),A(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(A(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),A(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};var JD=new Uint8Array(32);JD.fill(0);var oue=BigInt(-1),QD=BigInt(0),YD=BigInt(1),aue=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function cue(r){let e=ne(r),t=e.length%32;return t?we([e,JD.slice(t)]):j(e)}var lue=rr(YD,32),uue=rr(QD,32),VD={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},UA=["name","version","chainId","verifyingContract","salt"];function WD(r){return function(e){return A(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}var due={name:WD("name"),version:WD("version"),chainId:function(r){let e=H(r,"domain.chainId");return A(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):Sn(e)},verifyingContract:function(r){try{return de(r).toLowerCase()}catch{}A(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){let e=ne(r,"domain.salt");return A(e.length===32,'invalid domain value "salt"',"domain.salt",r),j(e)}};function jA(r){{let e=r.match(/^(u?)int(\d+)$/);if(e){let t=e[1]==="",n=parseInt(e[2]);A(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);let i=ss(aue,t?n-1:n),s=t?(i+YD)*oue:QD;return function(o){let a=H(o,"value");return A(a>=s&&a<=i,`value out-of-bounds for ${r}`,"value",a),rr(t?hu(a,256):a,32)}}}{let e=r.match(/^bytes(\d+)$/);if(e){let t=parseInt(e[1]);return A(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){let i=ne(n);return A(i.length===t,`invalid length for ${r}`,"value",n),cue(n)}}}switch(r){case"address":return function(e){return hr(de(e),32)};case"bool":return function(e){return e?lue:uue};case"bytes":return function(e){return Oe(e)};case"string":return function(e){return Kr(e)}}return null}function KD(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function bg(r){let e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}var bc=class r{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;let t=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:l,type:u})=>{let{base:d,index:f}=bg(u);return d==="int"&&!e.int&&(d="int256"),d==="uint"&&!e.uint&&(d="uint256"),{name:l,type:d+(f||"")}}),t.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),this.#e=JSON.stringify(s);for(let c in s){let l=new Set;for(let u of s[c]){A(!l.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(c)}`,"types",e),l.add(u.name);let d=bg(u.type).base;A(d!==c,`circular type reference to ${JSON.stringify(d)}`,"types",e),!jA(d)&&(A(n.has(d),`unknown type ${JSON.stringify(d)}`,"types",e),n.get(d).push(c),t.get(c).add(d))}}let o=Array.from(n.keys()).filter(c=>n.get(c).length===0);A(o.length!==0,"missing primary type","types",e),A(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),J(this,{primaryType:o[0]});function a(c,l){A(!l.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),l.add(c);for(let u of t.get(c))if(n.has(u)){a(u,l);for(let d of l)i.get(d).add(u)}l.delete(c)}a(this.primaryType,new Set);for(let[c,l]of i){let u=Array.from(l);u.sort(),this.#t.set(c,KD(c,s[c])+u.map(d=>KD(d,s[d])).join(""))}}getEncoder(e){let t=this.#r.get(e);return t||(t=this.#n(e),this.#r.set(e,t)),t}#n(e){{let i=jA(e);if(i)return i}let t=bg(e).array;if(t){let i=t.prefix,s=this.getEncoder(i);return o=>{A(t.count===-1||t.count===o.length,`array length mismatch; expected length ${t.count}`,"value",o);let a=o.map(s);return this.#t.has(i)&&(a=a.map(Oe)),Oe(we(a))}}let n=this.types[e];if(n){let i=Kr(this.#t.get(e));return s=>{let o=n.map(({name:a,type:c})=>{let l=this.getEncoder(c)(s[a]);return this.#t.has(c)?Oe(l):l});return o.unshift(i),we(o)}}A(!1,`unknown type: ${e}`,"type",e)}encodeType(e){let t=this.#t.get(e);return A(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Oe(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(jA(e))return n(e,t);let i=bg(e).array;if(i)return A(i.count===-1||i.count===t.length,`array length mismatch; expected length ${i.count}`,"value",t),t.map(o=>this._visit(i.prefix,o,n));let s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,t[a],n),o),{});A(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new r(e)}static getPrimaryType(e){return r.from(e).primaryType}static hashStruct(e,t,n){return r.from(t).hashStruct(e,n)}static hashDomain(e){let t=[];for(let n in e){if(e[n]==null)continue;let i=VD[n];A(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:i})}return t.sort((n,i)=>UA.indexOf(n.name)-UA.indexOf(i.name)),r.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return we(["0x1901",r.hashDomain(e),r.from(t).hash(n)])}static hash(e,t,n){return Oe(r.encode(e,t,n))}static async resolveNames(e,t,n,i){e=Object.assign({},e);for(let a in e)e[a]==null&&delete e[a];let s={};e.verifyingContract&&!pe(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");let o=r.from(t);o.visit(n,(a,c)=>(a==="address"&&!pe(c,20)&&(s[c]="0x"),c));for(let a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,t,n){r.hashDomain(e);let i={},s=[];UA.forEach(c=>{let l=e[c];l!=null&&(i[c]=due[c](l),s.push({name:c,type:VD[c]}))});let o=r.from(t);t=o.types;let a=Object.assign({},t);return A(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return j(ne(l));if(c.match(/^u?int/))return H(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return A(typeof l=="string","invalid string","value",l),l}A(!1,"unsupported type","type",c)})}}};function Kt(r){let e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}var fue="external public payable override",hue=Kt(fue.split(" ")),oL="constant external internal payable private public pure view override",pue=Kt(oL.split(" ")),aL="constructor error event fallback function receive struct",cL=Kt(aL.split(" ")),lL="calldata memory storage payable indexed",mue=Kt(lL.split(" ")),gue="tuple returns",yue=[aL,lL,gue,oL].join(" "),vue=Kt(yue.split(" ")),bue={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},_ue=new RegExp("^(\\s*)"),Eue=new RegExp("^([0-9]+)"),Aue=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),uL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),dL=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Jr=class r{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new r(this.#t)}reset(){this.#e=0}#r(e=0,t=0){return new r(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){let t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){let t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=[];for(;this.#e<e.match-1;){let n=this.peek().linkNext;t.push(this.#r(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){let t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;let t=this.peek();return t.type===e?t.text:null}pop(){let e=this.peek();return this.#e++,e}toString(){let e=[];for(let t=this.#e;t<this.#t.length;t++){let n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};function _s(r){let e=[],t=o=>{let a=s<r.length?JSON.stringify(r[s]):"$EOI";throw new Error(`invalid token ${a} at ${s}: ${o}`)},n=[],i=[],s=0;for(;s<r.length;){let o=r.substring(s),a=o.match(_ue);a&&(s+=a[1].length,o=r.substring(s));let c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(c);let l=bue[o[0]]||"";if(l){if(c.type=l,c.text=o[0],s++,l==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(l=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if(l==="COMMA")c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let u=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){let d=e.pop().text;u=d+u,e[e.length-1].value=se(d)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(a=o.match(Aue),a){if(c.text=a[1],s+=c.text.length,vue.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(dL)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(Eue),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Jr(e.map(o=>Object.freeze(o)))}function $D(r,e){let t=[];for(let n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function _g(r,e){if(e.peekKeyword(cL)){let t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function oi(r,e){let t=new Set;for(;;){let n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function fL(r){let e=oi(r,pue);return $D(e,Kt("constant payable nonpayable".split(" "))),$D(e,Kt("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function si(r,e){return r.popParams().map(t=>it.from(t,e))}function hL(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return H(r.pop().text);throw new Error("invalid gas")}return null}function Co(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}var wue=new RegExp(/^(.*)\[([0-9]*)\]$/);function ZD(r){let e=r.match(dL);if(A(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){let t=parseInt(e[2]);A(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){let t=parseInt(e[3]);A(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}var Ge={},nr=Symbol.for("_ethers_internal"),XD="_ParamTypeInternal",eL="_ErrorInternal",tL="_EventInternal",rL="_ConstructorInternal",nL="_FallbackInternal",iL="_FunctionInternal",sL="_StructInternal",it=class r{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,i,s,o,a,c){if(is(e,Ge,"ParamType"),Object.defineProperty(this,nr,{value:XD}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");J(this,{name:t,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){let n=this.name||"";if(this.isArray()){let s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}let i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");let n=this;return e.map(i=>n.arrayChildren.walk(i,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");let n=this;return e.map((i,s)=>n.components[s].walk(i,t))}return t(this.type,e)}#e(e,t,n,i){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,a=t.slice();a.forEach((c,l)=>{o.#e(e,c,n,u=>{a[l]=u})}),i(a);return}if(this.isTuple()){let o=this.components,a;if(Array.isArray(t))a=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,l)=>{o[l].#e(e,c,n,u=>{a[l]=u})}),i(a);return}let s=n(this.type,t);s.then?e.push(async function(){i(await s)}()):i(s)}async walkAsync(e,t){let n=[],i=[e];return this.#e(n,e,t,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,t){if(r.isParamType(e))return e;if(typeof e=="string")try{return r.from(_s(e),t)}catch{A(!1,"invalid param type","obj",e)}else if(e instanceof Jr){let a="",c="",l=null;oi(e,Kt(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",l=e.popParams().map(p=>r.from(p)),a=`tuple(${l.map(p=>p.format()).join(",")})`):(a=ZD(e.popType("TYPE")),c=a);let u=null,d=null;for(;e.length&&e.peekType("BRACKET");){let p=e.pop();u=new r(Ge,"",a,c,null,l,d,u),d=p.value,a+=p.text,c="array",l=null}let f=null;if(oi(e,mue).has("indexed")){if(!t)throw new Error("");f=!0}let m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new r(Ge,m,a,c,f,l,d,u)}let n=e.name;A(!n||typeof n=="string"&&n.match(uL),"invalid name","obj.name",n);let i=e.indexed;i==!0?(A(t,"parameter cannot be indexed","obj.indexed",e.indexed),i=!0):i=!1;let s=e.type,o=s.match(wue);if(o){let a=parseInt(o[2]||"-1"),c=r.from({type:o[1],components:e.components});return new r(Ge,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){let a=e.components!=null?e.components.map(l=>r.from(l)):null;return new r(Ge,n||"",s,"tuple",i,a,null,null)}return s=ZD(e.type),new r(Ge,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[nr]===XD}},bs=class r{type;inputs;constructor(e,t,n){is(e,Ge,"Fragment"),n=Object.freeze(n.slice()),J(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{r.from(JSON.parse(e))}catch{}return r.from(_s(e))}if(e instanceof Jr)switch(e.peekKeyword(cL)){case"constructor":return ys.from(e);case"error":return vr.from(e);case"event":return gs.from(e);case"fallback":case"receive":return Pu.from(e);case"function":return vs.from(e);case"struct":return _c.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return ys.from(e);case"error":return vr.from(e);case"event":return gs.from(e);case"fallback":case"receive":return Pu.from(e);case"function":return vs.from(e);case"struct":return _c.from(e)}P(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}A(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return ys.isFragment(e)}static isError(e){return vr.isFragment(e)}static isEvent(e){return gs.isFragment(e)}static isFunction(e){return vs.isFragment(e)}static isStruct(e){return _c.isFragment(e)}},xo=class extends bs{name;constructor(e,t,n,i){super(e,t,i),A(typeof n=="string"&&n.match(uL),"invalid identifier","name",n),i=Object.freeze(i.slice()),J(this,{name:n})}};function Iu(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}var vr=class r extends xo{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,nr,{value:eL})}get selector(){return Kr(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Iu(e,this.inputs)),t.join(" ")}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")return r.from(_s(e));if(e instanceof Jr){let t=_g("error",e),n=si(e);return Co(e),new r(Ge,t,n)}return new r(Ge,e.name,e.inputs?e.inputs.map(it.from):[])}static isFragment(e){return e&&e[nr]===eL}},gs=class r extends xo{anonymous;constructor(e,t,n,i){super(e,"event",t,n),Object.defineProperty(this,nr,{value:tL}),J(this,{anonymous:i})}get topicHash(){return Kr(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Iu(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(i=>it.from(i)),new r(Ge,e,t,!1).topicHash}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(_s(e))}catch{A(!1,"invalid event fragment","obj",e)}else if(e instanceof Jr){let t=_g("event",e),n=si(e,!0),i=!!oi(e,Kt(["anonymous"])).has("anonymous");return Co(e),new r(Ge,t,n,i)}return new r(Ge,e.name,e.inputs?e.inputs.map(t=>it.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[nr]===tL}},ys=class r extends bs{payable;gas;constructor(e,t,n,i,s){super(e,t,n),Object.defineProperty(this,nr,{value:rL}),J(this,{payable:i,gas:s})}format(e){if(P(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[`constructor${Iu(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(_s(e))}catch{A(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Jr){oi(e,Kt(["constructor"]));let t=si(e),n=!!oi(e,hue).has("payable"),i=hL(e);return Co(e),new r(Ge,"constructor",t,n,i)}return new r(Ge,"constructor",e.inputs?e.inputs.map(it.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[nr]===rL}},Pu=class r extends bs{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,nr,{value:nL}),J(this,{payable:n})}format(e){let t=this.inputs.length===0?"receive":"fallback";if(e==="json"){let n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(_s(e))}catch{A(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Jr){let t=e.toString(),n=e.peekKeyword(Kt(["fallback","receive"]));if(A(n,"type must be fallback or receive","obj",t),e.popKeyword(Kt(["fallback","receive"]))==="receive"){let a=si(e);return A(a.length===0,"receive cannot have arguments","obj.inputs",a),oi(e,Kt(["payable"])),Co(e),new r(Ge,[],!0)}let s=si(e);s.length?A(s.length===1&&s[0].type==="bytes","invalid fallback inputs","obj.inputs",s.map(a=>a.format("minimal")).join(", ")):s=[it.from("bytes")];let o=fL(e);if(A(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),oi(e,Kt(["returns"])).has("returns")){let a=si(e);A(a.length===1&&a[0].type==="bytes","invalid fallback outputs","obj.outputs",a.map(c=>c.format("minimal")).join(", "))}return Co(e),new r(Ge,s,o==="payable")}if(e.type==="receive")return new r(Ge,[],!0);if(e.type==="fallback"){let t=[it.from("bytes")],n=e.stateMutability==="payable";return new r(Ge,t,n)}A(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[nr]===nL}},vs=class r extends xo{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,i,s,o){super(e,"function",t,i),Object.defineProperty(this,nr,{value:iL}),s=Object.freeze(s.slice()),J(this,{constant:n==="view"||n==="pure",gas:o,outputs:s,payable:n==="payable",stateMutability:n})}get selector(){return Kr(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Iu(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Iu(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(i=>it.from(i)),new r(Ge,e,"view",t,[],null).selector}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(_s(e))}catch{A(!1,"invalid function fragment","obj",e)}else if(e instanceof Jr){let n=_g("function",e),i=si(e),s=fL(e),o=[];oi(e,Kt(["returns"])).has("returns")&&(o=si(e));let a=hL(e);return Co(e),new r(Ge,n,s,i,o,a)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new r(Ge,e.name,t,e.inputs?e.inputs.map(it.from):[],e.outputs?e.outputs.map(it.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[nr]===iL}},_c=class r extends xo{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,nr,{value:sL})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return r.from(_s(e))}catch{A(!1,"invalid struct fragment","obj",e)}else if(e instanceof Jr){let t=_g("struct",e),n=si(e);return Co(e),new r(Ge,t,n)}return new r(Ge,e.name,e.inputs?e.inputs.map(it.from):[])}static isFragment(e){return e&&e[nr]===sL}};var Qr=new Map;Qr.set(0,"GENERIC_PANIC");Qr.set(1,"ASSERT_FALSE");Qr.set(17,"OVERFLOW");Qr.set(18,"DIVIDE_BY_ZERO");Qr.set(33,"ENUM_RANGE_ERROR");Qr.set(34,"BAD_STORAGE_DATA");Qr.set(49,"STACK_UNDERFLOW");Qr.set(50,"ARRAY_RANGE_ERROR");Qr.set(65,"OUT_OF_MEMORY");Qr.set(81,"UNINITIALIZED_FUNCTION_CALL");var Sue=new RegExp(/^bytes([0-9]*)$/),Tue=new RegExp(/^(u?int)([0-9]*)$/),zA=null,pL=1024;function Cue(r,e,t,n){let i="missing revert data",s=null,o=null,a=null;if(t){i="execution reverted";let l=ne(t);if(t=j(t),l.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(l.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(j(l.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],l.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(j(l.slice(0,4))==="0x4e487b71")try{let u=Number(n.decode(["uint256"],l.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[u]},s=`Panic due to ${Qr.get(u)||"UNKNOWN"}(${u})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}let c={to:e.to?de(e.to):null,data:e.data||"0x"};return e.from&&(c.from=de(e.from)),xe(i,"CALL_EXCEPTION",{action:r,data:t,reason:s,transaction:c,invocation:o,revert:a})}var ai=class r{#e(e){if(e.isArray())return new ig(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ao(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new rg(e.name);case"bool":return new sg(e.name);case"string":return new ug(e.name);case"bytes":return new og(e.name);case"":return new cg(e.name)}let t=e.type.match(Tue);if(t){let n=parseInt(t[2]||"256");return A(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new lg(n/8,t[1]==="int",e.name)}if(t=e.type.match(Sue),t){let n=parseInt(t[1]);return A(n!==0&&n<=32,"invalid bytes length","param",e),new ag(n,e.name)}A(!1,"invalid type","type",e.type)}getDefaultValue(e){let t=e.map(i=>this.#e(it.from(i)));return new Ao(t,"_").defaultValue()}encode(e,t){fu(t.length,e.length,"types/values length mismatch");let n=e.map(o=>this.#e(it.from(o))),i=new Ao(n,"_"),s=new yo;return i.encode(s,t),s.data}decode(e,t,n){let i=e.map(o=>this.#e(it.from(o)));return new Ao(i,"_").decode(new qm(t,n,pL))}static _setDefaultMaxInflation(e){A(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),pL=e}static defaultAbiCoder(){return zA==null&&(zA=new r),zA}static getBuiltinCallException(e,t,n){return Cue(e,t,n,r.defaultAbiCoder())}};var ku=class{fragment;name;signature;topic;args;constructor(e,t,n){let i=e.name,s=e.format();J(this,{fragment:e,name:i,signature:s,topic:t,args:n})}},Ru=class{fragment;name;args;signature;selector;value;constructor(e,t,n,i){let s=e.name,o=e.format();J(this,{fragment:e,name:s,args:n,signature:o,selector:t,value:i})}},Nu=class{fragment;name;args;signature;selector;constructor(e,t,n){let i=e.name,s=e.format();J(this,{fragment:e,name:i,args:n,signature:s,selector:t})}},Ec=class{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){J(this,{hash:e,_isIndexed:!0})}},mL={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},gL={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&mL[r.toString()]&&(e=mL[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}},Es=class r{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;let n=[];for(let o of t)try{n.push(bs.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}J(this,{fragments:Object.freeze(n)});let i=null,s=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}J(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(A(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=this.#r;break;case"event":c=this.#t;break;case"error":c=this.#e;break;default:return}let l=o.format();c.has(l)||c.set(l,o)}),this.deploy||J(this,{deploy:ys.from("constructor()")}),J(this,{fallback:i,receive:s})}format(e){let t=e?"minimal":"full";return this.fragments.map(i=>i.format(t))}formatJson(){let e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return ai.defaultAbiCoder()}#i(e,t,n){if(pe(e)){let s=e.toLowerCase();for(let o of this.#r.values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){let s=[];for(let[o,a]of this.#r)o.split("(")[0]===e&&s.push(a);if(t){let o=t.length>0?t[t.length-1]:null,a=t.length,c=!0;Ne.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let l=s.length-1;l>=0;l--){let u=s[l].inputs.length;u!==a&&(!c||u!==a-1)&&s.splice(l,1)}for(let l=s.length-1;l>=0;l--){let u=s[l].inputs;for(let d=0;d<t.length;d++)if(Ne.isTyped(t[d])){if(d>=u.length){if(t[d].type==="overrides")continue;s.splice(l,1);break}if(t[d].type!==u[d].baseType){s.splice(l,1);break}}}}if(s.length===1&&t&&t.length!==s[0].inputs.length){let o=t[t.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){let o=s.map(a=>JSON.stringify(a.format())).join(", ");A(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}let i=this.#r.get(vs.from(e).format());return i||null}getFunctionName(e){let t=this.#i(e,null,!1);return A(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#i(e,null,!1)}getFunction(e,t){return this.#i(e,t||null,!0)}forEachFunction(e){let t=Array.from(this.#r.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){let i=t[n];e(this.#r.get(i),n)}}#c(e,t,n){if(pe(e)){let s=e.toLowerCase();for(let o of this.#t.values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){let s=[];for(let[o,a]of this.#t)o.split("(")[0]===e&&s.push(a);if(t){for(let o=s.length-1;o>=0;o--)s[o].inputs.length<t.length&&s.splice(o,1);for(let o=s.length-1;o>=0;o--){let a=s[o].inputs;for(let c=0;c<t.length;c++)if(Ne.isTyped(t[c])&&t[c].type!==a[c].baseType){s.splice(o,1);break}}}if(s.length===0)return null;if(s.length>1&&n){let o=s.map(a=>JSON.stringify(a.format())).join(", ");A(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}let i=this.#t.get(gs.from(e).format());return i||null}getEventName(e){let t=this.#c(e,null,!1);return A(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#c(e,null,!1)}getEvent(e,t){return this.#c(e,t||null,!0)}forEachEvent(e){let t=Array.from(this.#t.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){let i=t[n];e(this.#t.get(i),n)}}getError(e,t){if(pe(e)){let i=e.toLowerCase();if(gL[i])return vr.from(gL[i].signature);for(let s of this.#e.values())if(i===s.selector)return s;return null}if(e.indexOf("(")===-1){let i=[];for(let[s,o]of this.#e)s.split("(")[0]===e&&i.push(o);if(i.length===0)return e==="Error"?vr.from("error Error(string)"):e==="Panic"?vr.from("error Panic(uint256)"):null;if(i.length>1){let s=i.map(o=>JSON.stringify(o.format())).join(", ");A(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=vr.from(e).format(),e==="Error(string)")return vr.from("error Error(string)");if(e==="Panic(uint256)")return vr.from("error Panic(uint256)");let n=this.#e.get(e);return n||null}forEachError(e){let t=Array.from(this.#e.keys());t.sort((n,i)=>n.localeCompare(i));for(let n=0;n<t.length;n++){let i=t[n];e(this.#e.get(i),n)}}_decodeParams(e,t){return this.#n.decode(e,t)}_encodeParams(e,t){return this.#n.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);A(n,"unknown error","fragment",e),e=n}return A(Le(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,Le(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);A(n,"unknown error","fragment",e),e=n}return we([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);A(n,"unknown function","fragment",e),e=n}return A(Le(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,Le(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);A(n,"unknown function","fragment",e),e=n}return we([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){let s=this.getFunction(e);A(s,"unknown function","fragment",e),e=s}let n="invalid length for result data",i=He(t);if(i.length%32===0)try{return this.#n.decode(e.outputs,i)}catch{n="could not decode result data"}P(!1,n,"BAD_DATA",{value:j(i),info:{method:e.name,signature:e.format()}})}makeError(e,t){let n=ne(e,"data"),i=ai.getBuiltinCallException("call",t,n);if(i.message.startsWith("execution reverted (unknown custom error)")){let a=j(n.slice(0,4)),c=this.getError(a);if(c)try{let l=this.#n.decode(c.inputs,n.slice(4));i.revert={name:c.name,signature:c.format(),args:l},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(t);return o&&(i.invocation={method:o.name,signature:o.signature,args:o.args}),i}encodeFunctionResult(e,t){if(typeof e=="string"){let n=this.getFunction(e);A(n,"unknown function","fragment",e),e=n}return j(this.#n.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){let s=this.getEvent(e);A(s,"unknown event","eventFragment",e),e=s}P(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});let n=[];e.anonymous||n.push(e.topicHash);let i=(s,o)=>s.type==="string"?Kr(o):s.type==="bytes"?Oe(j(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=rr(o):s.type.match(/^bytes/)?o=$1(o,32):s.type==="address"&&this.#n.encode(["address"],[o]),hr(j(o),32));for(t.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){A(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?A(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){let o=this.getEvent(e);A(o,"unknown event","eventFragment",e),e=o}let n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),A(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((o,a)=>{let c=t[a];if(o.indexed)if(o.type==="string")n.push(Kr(c));else if(o.type==="bytes")n.push(Oe(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this.#n.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this.#n.encode(i,s),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){let h=this.getEvent(e);A(h,"unknown event","eventFragment",e),e=h}if(n!=null&&!e.anonymous){let h=e.topicHash;A(pe(n[0],32)&&n[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((h,m)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(it.from({type:"bytes32",name:h.name})),o.push(!0)):(i.push(h),o.push(!1)):(s.push(h),o.push(!1))});let a=n!=null?this.#n.decode(i,we(n)):null,c=this.#n.decode(s,t,!0),l=[],u=[],d=0,f=0;return e.inputs.forEach((h,m)=>{let p=null;if(h.indexed)if(a==null)p=new Ec(null);else if(o[m])p=new Ec(a[f++]);else try{p=a[f++]}catch(y){p=y}else try{p=c[d++]}catch(y){p=y}l.push(p),u.push(h.name||null)}),Cn.fromItems(l,u)}parseTransaction(e){let t=ne(e.data,"tx.data"),n=H(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(j(t.slice(0,4)));if(!i)return null;let s=this.#n.decode(i.inputs,t.slice(4));return new Ru(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new ku(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){let t=j(e),n=this.getError(Le(t,0,4));if(!n)return null;let i=this.#n.decode(n.inputs,Le(t,4));return new Nu(n,n.selector,i)}static from(e){return e instanceof r?e:typeof e=="string"?new r(JSON.parse(e)):typeof e.formatJson=="function"?new r(e.formatJson()):typeof e.format=="function"?new r(e.format("json")):new r(e)}};var vL=BigInt(0);function Ac(r){return r??null}function $e(r){return r==null?null:r.toString()}var wc=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){J(this,{gasPrice:Ac(e),maxFeePerGas:Ac(t),maxPriorityFeePerGas:Ac(n)})}toJSON(){let{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:$e(e),maxFeePerGas:$e(t),maxPriorityFeePerGas:$e(n)}}};function ws(r){let e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=j(r.data));let t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let i of t)!(i in r)||r[i]==null||(e[i]=H(r[i],`request.${i}`));let n="type,nonce".split(/,/);for(let i of n)!(i in r)||r[i]==null||(e[i]=se(r[i],`request.${i}`));return r.accessList&&(e.accessList=yr(r.accessList)),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(i=>po(i)?j(i):Object.assign({},i))),e}var Mu=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new As(n,t):n),J(this,{provider:t,hash:Ac(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Ac(e.prevRandao),extraData:e.extraData,baseFeePerGas:Ac(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){let e=this.#e.slice();return e.length===0?[]:(P(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){let{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:l,number:u,parentHash:d,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:m,timestamp:p,transactions:y}=this;return{_type:"Block",baseFeePerGas:$e(e),difficulty:$e(t),extraData:n,gasLimit:$e(i),gasUsed:$e(s),blobGasUsed:$e(this.blobGasUsed),excessBlobGas:$e(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:l,number:u,parentHash:d,timestamp:p,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:m,transactions:y}}[Symbol.iterator](){let e=0,t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{let n=e.toLowerCase();for(let i of this.#e)if(typeof i=="string"){if(i!==n)continue;t=i;break}else{if(i.hash===n)continue;t=i;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){let t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(let n of t)if(n.hash===e)return n;A(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return xue(this)}},Yr=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;let n=Object.freeze(e.topics.slice());J(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){let{address:e,blockHash:t,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:c,transactionIndex:l}}async getBlock(){let e=await this.provider.getBlock(this.blockHash);return P(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){let e=await this.provider.getTransaction(this.transactionHash);return P(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){let e=await this.provider.getTransactionReceipt(this.transactionHash);return P(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Oue(this)}},Oo=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(i=>new Yr(i,t)));let n=vL;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),J(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){let{to:e,from:t,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:l,status:u,root:d}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:$e(this.cumulativeGasUsed),from:t,gasPrice:$e(this.gasPrice),blobGasUsed:$e(this.blobGasUsed),blobGasPrice:$e(this.blobGasPrice),gasUsed:$e(this.gasUsed),hash:i,index:s,logs:l,logsBloom:c,root:d,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){let e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return _L(this)}reorderedEvent(e){return P(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),bL(this,e)}},As=class r{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.#e=-1}toJSON(){let{blockNumber:e,blockHash:t,index:n,hash:i,type:s,to:o,from:a,nonce:c,data:l,signature:u,accessList:d,blobVersionedHashes:f}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:t,blobVersionedHashes:f,chainId:$e(this.chainId),data:l,from:a,gasLimit:$e(this.gasLimit),gasPrice:$e(this.gasPrice),hash:i,maxFeePerGas:$e(this.maxFeePerGas),maxPriorityFeePerGas:$e(this.maxPriorityFeePerGas),maxFeePerBlobGas:$e(this.maxFeePerBlobGas),nonce:c,signature:u,to:o,index:n,type:s,value:$e(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){let n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;let t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:t,blockNumber:n}=await Qe({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){let n=e??1,i=t??0,s=this.#e,o=-1,a=s===-1,c=async()=>{if(a)return null;let{blockNumber:f,nonce:h}=await Qe({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){s=f;return}if(a)return null;let m=await this.getTransaction();if(!(m&&m.blockNumber!=null))for(o===-1&&(o=s-3,o<this.#e&&(o=this.#e));o<=f;){if(a)return null;let p=await this.provider.getBlock(o,!0);if(p==null)return;for(let y of p)if(y===this.hash)return;for(let y=0;y<p.length;y++){let b=await p.getTransaction(y);if(b.from===this.from&&b.nonce===this.nonce){if(a)return null;let E=await this.provider.getTransactionReceipt(b.hash);if(E==null||f-E.blockNumber+1<n)return;let x="replaced";b.data===this.data&&b.to===this.to&&b.value===this.value?x="repriced":b.data==="0x"&&b.from===b.to&&b.value===vL&&(x="cancelled"),P(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:x==="replaced"||x==="cancelled",reason:x,replacement:b.replaceableTransaction(s),hash:b.hash,receipt:E})}}o++}},l=f=>{if(f==null||f.status!==0)return f;P(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:f.to,from:f.from,data:""},receipt:f})},u=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(u);if(u){if(await u.confirmations()>=n)return l(u)}else if(await c(),n===0)return null;return await new Promise((f,h)=>{let m=[],p=()=>{m.forEach(b=>b())};if(m.push(()=>{a=!0}),i>0){let b=setTimeout(()=>{p(),h(xe("wait for transaction timeout","TIMEOUT"))},i);m.push(()=>{clearTimeout(b)})}let y=async b=>{if(await b.confirmations()>=n){p();try{f(l(b))}catch(E){h(E)}}};if(m.push(()=>{this.provider.off(this.hash,y)}),this.provider.on(this.hash,y),s>=0){let b=async()=>{try{await c()}catch(E){if(je(E,"TRANSACTION_REPLACED")){p(),h(E);return}}a||this.provider.once("block",b)};m.push(()=>{this.provider.off("block",b)}),this.provider.once("block",b)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return P(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),_L(this)}reorderedEvent(e){return P(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),P(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),bL(this,e)}replaceableTransaction(e){A(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);let t=new r(this,this.provider);return t.#e=e,t}};function xue(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function bL(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function _L(r){return{orphan:"drop-transaction",tx:r}}function Oue(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}var Sc=class extends Yr{interface;fragment;args;constructor(e,t,n){super(e,e.provider);let i=t.decodeEventLog(n,e.data,e.topics);J(this,{args:i,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},Du=class extends Yr{error;constructor(e,t){super(e,e.provider),J(this,{error:t})}},HA=class extends Oo{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{let t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new Sc(e,this.#e,t)}catch(n){return new Du(e,n)}return e})}},Tc=class extends As{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){let n=await super.wait(e,t);return n==null?null:new HA(this.#e,this.provider,n)}},Lu=class extends mo{log;constructor(e,t,n,i){super(e,t,n),J(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},Eg=class extends Lu{constructor(e,t,n,i,s){super(e,t,n,new Sc(s,e.interface,i));let o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);J(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};var EL=BigInt(0);function wL(r){return r&&typeof r.call=="function"}function SL(r){return r&&typeof r.estimateGas=="function"}function Tg(r){return r&&typeof r.resolveName=="function"}function TL(r){return r&&typeof r.sendTransaction=="function"}function CL(r){if(r!=null){if(Tg(r))return r;if(r.provider)return r.provider}}var GA=class{#e;fragment;constructor(e,t,n){if(J(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");let i=Po(e.runner,"resolveName"),s=Tg(i)?i:null;this.#e=async function(){let o=await Promise.all(t.inputs.map((a,c)=>n[c]==null?null:a.walkAsync(n[c],(u,d)=>u==="address"?Array.isArray(d)?Promise.all(d.map(f=>nt(f,s))):nt(d,s):d)));return e.interface.encodeFilterTopics(t,o)}()}getTopicFilter(){return this.#e}};function Po(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function Io(r){return r==null?null:r.provider||null}async function xL(r,e){let t=Ne.dereference(r,"overrides");A(typeof t=="object","invalid overrides parameter","overrides",r);let n=ws(t);return A(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),A(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Iue(r,e,t){let n=Po(r,"resolveName"),i=Tg(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(t[o],(a,c)=>(c=Ne.dereference(c,a),a==="address"?nt(c,i):c))))}function Pue(r){let e=async function(o){let a=await xL(o,["data"]);a.to=await r.getAddress(),a.from&&(a.from=await nt(a.from,CL(r.runner)));let c=r.interface,l=H(a.value||EL,"overrides.value")===EL,u=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!u&&!l&&A(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),A(c.fallback||u,"cannot send data to receive-only contract","overrides.data",a.data);let d=c.receive||c.fallback&&c.fallback.payable;return A(d||l,"cannot send value to non-payable fallback","overrides.value",a.value),A(c.fallback||u,"cannot send data to receive-only contract","overrides.data",a.data),a},t=async function(o){let a=Po(r.runner,"call");P(wL(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await e(o);try{return await a.call(c)}catch(l){throw cc(l)&&l.data?r.interface.makeError(l.data,c):l}},n=async function(o){let a=r.runner;P(TL(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await a.sendTransaction(await e(o)),l=Io(r.runner);return new Tc(r.interface,l,c)},i=async function(o){let a=Po(r.runner,"estimateGas");return P(SL(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return J(s,{_contract:r,estimateGas:i,populateTransaction:e,send:n,staticCall:t}),s}function kue(r,e){let t=function(...l){let u=r.interface.getFunction(e,l);return P(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:l}}),u},n=async function(...l){let u=t(...l),d={};if(u.inputs.length+1===l.length&&(d=await xL(l.pop()),d.from&&(d.from=await nt(d.from,CL(r.runner)))),u.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let f=await Iue(r.runner,u.inputs,l);return Object.assign({},d,await Qe({to:r.getAddress(),data:r.interface.encodeFunctionData(u,f)}))},i=async function(...l){let u=await a(...l);return u.length===1?u[0]:u},s=async function(...l){let u=r.runner;P(TL(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let d=await u.sendTransaction(await n(...l)),f=Io(r.runner);return new Tc(r.interface,f,d)},o=async function(...l){let u=Po(r.runner,"estimateGas");return P(SL(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await n(...l))},a=async function(...l){let u=Po(r.runner,"call");P(wL(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let d;try{d=await n(...l)}catch(m){let p=l.at(-1).blockTag;throw p&&(m.blockNumber=p),m}let f="0x";try{f=await u.call(d)}catch(m){throw cc(m)&&m.data?r.interface.makeError(m.data,d):m}let h=t(...l);return r.interface.decodeFunctionResult(h,f)},c=async(...l)=>t(...l).constant?await i(...l):await s(...l);return J(c,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let l=r.interface.getFunction(e);return P(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),l}}),c}function Rue(r,e){let t=function(...i){let s=r.interface.getEvent(e,i);return P(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new GA(r,t(...i),i)};return J(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{let i=r.interface.getEvent(e);return P(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}var wg=Symbol.for("_ethersInternal_contract"),OL=new WeakMap;function Nue(r,e){OL.set(r[wg],e)}function br(r){return OL.get(r[wg])}function Mue(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function KA(r,e){let t,n=null;if(Array.isArray(e)){let s=function(o){if(pe(o,32))return o;let a=r.interface.getEvent(o);return A(a,"unknown fragment","name",o),a.topicHash};t=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?t=[null]:typeof e=="string"?pe(e,32)?t=[e]:(n=r.interface.getEvent(e),A(n,"unknown fragment","event",e),t=[n.topicHash]):Mue(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):A(!1,"unknown event name","event",e);t=t.map(s=>{if(s==null)return null;if(Array.isArray(s)){let o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});let i=t.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:t}}async function Fu(r,e){let{subs:t}=br(r);return t.get((await KA(r,e)).tag)||null}async function AL(r,e,t){let n=Io(r.runner);P(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});let{fragment:i,tag:s,topics:o}=await KA(r,t),{addr:a,subs:c}=br(r),l=c.get(s);if(!l){let d={address:a||r,topics:o},f=y=>{let b=i;if(b==null)try{b=r.interface.getEvent(y.topics[0])}catch{}if(b){let E=b,x=i?r.interface.decodeEventLog(i,y.data,y.topics):[];WA(r,t,x,S=>new Eg(r,S,t,E,y))}else WA(r,t,[],E=>new Lu(r,E,t,y))},h=[];l={tag:s,listeners:[],start:()=>{h.length||h.push(n.on(d,f))},stop:async()=>{if(h.length==0)return;let y=h;h=[],await Promise.all(y),n.off(d,f)}},c.set(s,l)}return l}var VA=Promise.resolve();async function Due(r,e,t,n){await VA;let i=await Fu(r,e);if(!i)return!1;let s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{let c=Array.from(t);n&&c.push(n(a?null:o));try{o.call(r,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),br(r).subs.delete(i.tag)),s>0}async function WA(r,e,t,n){try{await VA}catch{}let i=Due(r,e,t,n);return VA=i,await i}var Ag=["then"],Sg=class r{target;interface;runner;filters;[wg];fallback;constructor(e,t,n,i){A(typeof e=="string"||tg(e),"invalid value for Contract target","target",e),n==null&&(n=null);let s=Es.from(t);J(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,wg,{value:{}});let o,a=null,c=null;if(i){let d=Io(n);c=new Tc(this.interface,d,i)}let l=new Map;if(typeof e=="string")if(pe(e))a=e,o=Promise.resolve(e);else{let d=Po(n,"resolveName");if(!Tg(d))throw xe("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=d.resolveName(e).then(f=>{if(f==null)throw xe("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return br(this).addr=f,f})}else o=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return br(this).addr=d,d});Nue(this,{addrPromise:o,addr:a,deployTx:c,subs:l});let u=new Proxy({},{get:(d,f,h)=>{if(typeof f=="symbol"||Ag.indexOf(f)>=0)return Reflect.get(d,f,h);try{return this.getEvent(f)}catch(m){if(!je(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(d,f)=>Ag.indexOf(f)>=0?Reflect.has(d,f):Reflect.has(d,f)||this.interface.hasEvent(String(f))});return J(this,{filters:u}),J(this,{fallback:s.receive||s.fallback?Pue(this):null}),new Proxy(this,{get:(d,f,h)=>{if(typeof f=="symbol"||f in d||Ag.indexOf(f)>=0)return Reflect.get(d,f,h);try{return d.getFunction(f)}catch(m){if(!je(m,"INVALID_ARGUMENT")||m.argument!=="key")throw m}},has:(d,f)=>typeof f=="symbol"||f in d||Ag.indexOf(f)>=0?Reflect.has(d,f):d.interface.hasFunction(f)})}connect(e){return new r(this.target,this.interface,e)}attach(e){return new r(e,this.interface,this.runner)}async getAddress(){return await br(this).addrPromise}async getDeployedCode(){let e=Io(this.runner);P(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){let e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;let n=Io(this.runner);return P(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return br(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),kue(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Rue(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");let{addr:i,addrPromise:s}=br(this),o=i||await s,{fragment:a,topics:c}=await KA(this,e),l={address:o,topics:c,fromBlock:t,toBlock:n},u=Io(this.runner);return P(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(l)).map(d=>{let f=a;if(f==null)try{f=this.interface.getEvent(d.topics[0])}catch{}if(f)try{return new Sc(d,this.interface,f)}catch(h){return new Du(d,h)}return new Yr(d,u)})}async on(e,t){let n=await AL(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){let n=await AL(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await WA(this,e,t,null)}async listenerCount(e){if(e){let i=await Fu(this,e);return i?i.listeners.length:0}let{subs:t}=br(this),n=0;for(let{listeners:i}of t.values())n+=i.length;return n}async listeners(e){if(e){let i=await Fu(this,e);return i?i.listeners.map(({listener:s})=>s):[]}let{subs:t}=br(this),n=[];for(let{listeners:i}of t.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,t){let n=await Fu(this,e);if(!n)return this;if(t){let i=n.listeners.map(({listener:s})=>s).indexOf(t);i>=0&&n.listeners.splice(i,1)}return(t==null||n.listeners.length===0)&&(n.stop(),br(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){let t=await Fu(this,e);if(!t)return this;t.stop(),br(this).subs.delete(t.tag)}else{let{subs:t}=br(this);for(let{tag:n,stop:i}of t.values())i(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends r{constructor(i,s=null){super(i,e,s)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}};function Lue(){return Sg}var xn=class extends Lue(){};function JA(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):A(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}var Cg=class{name;constructor(e){J(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}};var PL=new RegExp("^(ipfs)://(.*)$","i"),IL=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),PL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],Cc=class r{provider;address;name;#e;#t;constructor(e,t,n){J(this,{provider:e,address:t,name:n}),this.#e=null,this.#t=new xn(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(e){if(je(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#r(e,t){t=(t||[]).slice();let n=this.#t.interface;t.unshift(vc(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),P(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[MA(this.name,255),n.encodeFunctionData(i,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{let s=await this.#t[e](...t);return i?n.decodeFunctionResult(i,s)[0]:s}catch(s){if(!je(s,"CALL_EXCEPTION"))throw s}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{let s=await this.#r("addr(bytes32)");return s==null||s===ii?null:s}catch(s){if(je(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648,o=await this.#r("addr(bytes32,uint)",[s]);if(pe(o,20))return de(o)}let t=null;for(let s of this.provider.plugins)if(s instanceof Cg&&s.supportsCoinType(e)){t=s;break}if(t==null)return null;let n=await this.#r("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;let i=await t.decodeAddress(e,n);if(i!=null)return i;P(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){let t=await this.#r("text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){let e=await this.#r("contenthash(bytes32)");if(e==null||e==="0x")return null;let t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let i=t[1]==="e3010170"?"ipfs":"ipns",s=parseInt(t[4],16);if(t[5].length===s*2)return`${i}://${eA("0x"+t[2])}`}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;P(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let e=[{type:"name",value:this.name}];try{let t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<IL.length;n++){let i=t.match(IL[n]);if(i==null)continue;let s=i[1].toLowerCase();switch(s){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{let o=JA(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{let o=s==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:s,value:t});let a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};let c=(i[2]||"").split("/");if(c.length!==2)return e.push({type:`!${s}caip`,value:i[2]||""}),{url:null,linkage:e};let l=c[1],u=new xn(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(s==="erc721"){let p=await u.ownerOf(l);if(a!==p)return e.push({type:"!owner",value:p}),{url:null,linkage:e};e.push({type:"owner",value:p})}else if(s==="erc1155"){let p=await u.balanceOf(a,l);if(!p)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:p.toString()})}let d=await u[o](l);if(d==null||d==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),s==="erc1155"&&(d=d.replace("{id}",rr(l,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=JA(d)),e.push({type:"metadata-url",value:d});let f={},h=await new pr(d).send();h.assertOk();try{f=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{let b=h.body;return b&&e.push({type:"!metadata",value:j(b)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!f)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(f)});let m=f.image;if(typeof m!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!m.match(/^(https:\/\/|data:)/i)){if(m.match(PL)==null)return e.push({type:"!imageUrl-ipfs",value:m}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:m}),m=JA(m)}return e.push({type:"url",value:m}),{linkage:e,url:m}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){let t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return P(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async#n(e,t){let n=await r.getEnsAddress(e);try{let s=await new xn(n,["function resolver(bytes32) view returns (address)"],e).resolver(vc(t),{enableCcipRead:!0});return s===ii?null:s}catch(i){throw i}return null}static async fromName(e,t){let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;let i=await r.#n(e,n);if(i!=null){let s=new r(e,i,t);return n!==t&&!await s.supportsWildcard()?null:s}n=n.split(".").slice(1).join(".")}}};var kL=BigInt(0);function ye(r,e){return function(t){return t==null?e:r(t)}}function xg(r,e){return t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))}}function qu(r,e){return t=>{let n={};for(let i in r){let s=i;if(e&&i in e&&!(s in t)){for(let o of e[i])if(o in t){s=o;break}}try{let o=r[i](t[s]);o!==void 0&&(n[i]=o)}catch(o){let a=o instanceof Error?o.message:"not-an-error";P(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:t})}}return n}}function Fue(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}A(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}function xc(r){return A(pe(r,!0),"invalid data","value",r),r}function Tt(r){return A(pe(r,32),"invalid hash","value",r),r}var que=qu({address:de,blockHash:Tt,blockNumber:se,data:xc,index:se,removed:ye(Fue,!1),topics:xg(Tt),transactionHash:Tt,transactionIndex:se},{index:["logIndex"]});function RL(r){return que(r)}var Bue=qu({hash:ye(Tt),parentHash:Tt,parentBeaconBlockRoot:ye(Tt,null),number:se,timestamp:se,nonce:ye(xc),difficulty:H,gasLimit:H,gasUsed:H,stateRoot:ye(Tt,null),receiptsRoot:ye(Tt,null),blobGasUsed:ye(H,null),excessBlobGas:ye(H,null),miner:ye(de),prevRandao:ye(Tt,null),extraData:xc,baseFeePerGas:ye(H)},{prevRandao:["mixHash"]});function NL(r){let e=Bue(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:QA(t)),e}var Uue=qu({transactionIndex:se,blockNumber:se,transactionHash:Tt,address:de,topics:xg(Tt),data:xc,index:se,blockHash:Tt},{index:["logIndex"]});function jue(r){return Uue(r)}var zue=qu({to:ye(de,null),from:ye(de,null),contractAddress:ye(de,null),index:se,root:ye(j),gasUsed:H,blobGasUsed:ye(H,null),logsBloom:ye(xc),blockHash:Tt,hash:Tt,logs:xg(jue),blockNumber:se,cumulativeGasUsed:H,effectiveGasPrice:ye(H),blobGasPrice:ye(H,null),l1Fee:ye(H,null),status:ye(se),type:ye(se,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function ML(r){return zue(r)}function QA(r){r.to&&H(r.to)===kL&&(r.to="0x0000000000000000000000000000000000000000");let e=qu({hash:Tt,index:ye(se,void 0),type:t=>t==="0x"||t==null?0:se(t),accessList:ye(yr,null),blobVersionedHashes:ye(xg(Tt,!0),null),blockHash:ye(Tt,null),blockNumber:ye(se,null),transactionIndex:ye(se,null),from:de,gasPrice:ye(H),maxPriorityFeePerGas:ye(H),maxFeePerGas:ye(H),maxFeePerBlobGas:ye(H,null),gasLimit:H,to:ye(de,null),value:H,nonce:se,data:xc,creates:ye(de,null),chainId:ye(H,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=_A(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=Wt.from(r.signature):e.signature=Wt.from(r),e.chainId==null){let t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&H(e.blockHash)===kL&&(e.blockHash=null),e}var Hue="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Oc=class r{name;constructor(e){J(this,{name:e})}clone(){return new r(this.name)}},Ic=class r extends Oc{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);let n={effectiveBlock:e};function i(s,o){let a=(t||{})[s];a==null&&(a=o),A(typeof a=="number",`invalud value for ${s}`,"costs",t),n[s]=a}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),J(this,n)}clone(){return new r(this.effectiveBlock,this)}},Pc=class r extends Oc{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),J(this,{address:e||Hue,targetNetwork:t??1})}clone(){return new r(this.address,this.targetNetwork)}};var Bu=class extends Oc{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}};var YA=new Map,Ct=class r{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=H(t),this.#r=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=H(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===H(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===H(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===H(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#r.values())}attachPlugin(e){if(this.#r.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#r.set(e.name,e.clone()),this}getPlugin(e){return this.#r.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){let e=new r(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){let t=this.getPlugin("org.ethers.plugins.network.GasCost")||new Ic,n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){let i=yr(e.accessList);for(let s in i)n+=t.txAccessListAddress+t.txAccessListStorageKey*i[s].storageKeys.length}return n}static from(e){if(Gue(),e==null)return r.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){let t=YA.get(e);if(t)return t();if(typeof e=="bigint")return new r("unknown",e);A(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){A(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);let t=new r(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new Pc(e.ensAddress,e.ensNetwork)),t}A(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));let n=YA.get(e);n&&A(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),YA.set(e,t)}};function DL(r,e){let t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);let n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function LL(r){return new Bu(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let i;try{let[s,o]=await Promise.all([n.send(),e()]);i=s;let a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:DL(a.maxFee,9),maxPriorityFeePerGas:DL(a.maxPriorityFee,9)}}catch(s){P(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}var FL=!1;function Gue(){if(FL)return;FL=!0;function r(e,t,n){let i=function(){let s=new Ct(e,t);return n.ensNetwork!=null&&s.attachPlugin(new Pc(null,n.ensNetwork)),s.attachPlugin(new Ic),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};Ct.register(e,i),Ct.register(t,i),n.altNames&&n.altNames.forEach(s=>{Ct.register(s,i)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[LL("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[LL("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}function $A(r){return JSON.parse(JSON.stringify(r))}var Og=class{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=null,this.#r=4e3,this.#n=-2}get pollingInterval(){return this.#r}set pollingInterval(e){this.#r=e}async#i(){try{let e=await this.#e.getBlockNumber();if(this.#n===-2){this.#n=e;return}if(e!==this.#n){for(let t=this.#n+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#n=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#i.bind(this),this.#r))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#i.bind(this),this.#r),this.#i())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#n=-2)}resume(){this.start()}},Uu=class{#e;#t;#r;constructor(e){this.#e=e,this.#r=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#r||(this.#r=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#r&&(this.#r=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}},Ig=class extends Uu{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){let n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}},Pg=class extends Uu{#e;constructor(e,t){super(e),this.#e=$A(t)}async _poll(e,t){throw new Error("@TODO")}},kg=class extends Uu{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){let n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}},Ss=class{#e;#t;#r;#n;#i;constructor(e,t){this.#e=e,this.#t=$A(t),this.#r=this.#c.bind(this),this.#n=!1,this.#i=-2}async#c(e){if(this.#i===-2)return;let t=$A(this.#t);t.fromBlock=this.#i+1,t.toBlock=e;let n=await this.#e.getLogs(t);if(n.length===0){this.#i<e-60&&(this.#i=e-60);return}for(let i of n)this.#e.emit(this.#t,i),this.#i=i.blockNumber}start(){this.#n||(this.#n=!0,this.#i===-2&&this.#e.getBlockNumber().then(e=>{this.#i=e}),this.#e.on("block",this.#r))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#r))}pause(e){this.stop(),e&&(this.#i=-2)}resume(){this.start()}};var Vue=BigInt(2),Wue=10;function Rg(r){return r&&typeof r.then=="function"}function Ng(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){let i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}var kc=class{name;constructor(e){J(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function Kue(r){return JSON.parse(JSON.stringify(r))}function ew(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function ZA(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if(pe(r,32)){let t=r.toLowerCase();return{type:"transaction",tag:Ng("tx",{hash:t}),hash:t}}if(r.orphan){let t=r;return{type:"orphan",tag:Ng("orphan",t),filter:Kue(t)}}if(r.address||r.topics){let t=r,n={topics:(t.topics||[]).map(i=>i==null?null:Array.isArray(i)?ew(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(t.address){let i=[],s=[],o=a=>{pe(a)?i.push(a):s.push((async()=>{i.push(await nt(a,e))})())};Array.isArray(t.address)?t.address.forEach(o):o(t.address),s.length&&await Promise.all(s),n.address=ew(i.map(a=>a.toLowerCase()))}return{filter:n,tag:Ng("event",n),type:"event"}}A(!1,"unknown ProviderEvent","event",r)}function XA(){return new Date().getTime()}var Jue={cacheTimeout:250,pollingInterval:4e3},ju=class{#e;#t;#r;#n;#i;#c;#a;#u;#p;#h;#d;#o;constructor(e,t){if(this.#o=Object.assign({},Jue,t||{}),e==="any")this.#c=!0,this.#i=null;else if(e){let n=Ct.from(e);this.#c=!1,this.#i=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#c=!1,this.#i=null;this.#u=-1,this.#a=new Map,this.#e=new Map,this.#t=new Map,this.#r=null,this.#n=!1,this.#p=1,this.#h=new Map,this.#d=!1}get pollingInterval(){return this.#o.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#d}set disableCcipRead(e){this.#d=!!e}async#s(e){let t=this.#o.cacheTimeout;if(t<0)return await this._perform(e);let n=Ng(e.method,e),i=this.#a.get(n);return i||(i=this._perform(e),this.#a.set(n,i),setTimeout(()=>{this.#a.get(n)===i&&this.#a.delete(n)},t)),await i}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;let i=e.to.toLowerCase(),s=t.toLowerCase(),o=[];for(let a=0;a<n.length;a++){let c=n[a],l=c.replace("{sender}",i).replace("{data}",s),u=new pr(l);c.indexOf("{data}")===-1&&(u.body={data:s,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:a,urls:n});let d="unknown error",f=await u.send();try{let h=f.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:h}),h.data;h.message&&(d=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:h})}catch{}P(f.statusCode<400||f.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:d}}),o.push(d)}P(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,t){return new Mu(NL(e),this)}_wrapLog(e,t){return new Yr(RL(e),this)}_wrapTransactionReceipt(e,t){return new Oo(ML(e),this)}_wrapTransactionResponse(e,t){return new As(QA(e),this)}_detectNetwork(){P(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){P(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){let e=se(await this.#s({method:"getBlockNumber"}),"%response");return this.#u>=0&&(this.#u=e),e}_getAddress(e){return nt(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(pe(e))return pe(e,32)?e:Sn(e);if(typeof e=="bigint"&&(e=se(e,"blockTag")),typeof e=="number")return e>=0?Sn(e):this.#u>=0?Sn(this.#u+e):this.getBlockNumber().then(t=>Sn(t+e));A(!1,"invalid blockTag","blockTag",e)}_getFilter(e){let t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?ew(c.map(l=>l.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,l,u)=>{let d;switch(c.length){case 0:break;case 1:d=c[0];break;default:c.sort(),d=c}if(n&&(l!=null||u!=null))throw new Error("invalid filter");let f={};return d&&(f.address=d),t.length&&(f.topics=t),l&&(f.fromBlock=l),u&&(f.toBlock=u),n&&(f.blockHash=n),f},s=[];if(e.address)if(Array.isArray(e.address))for(let c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){let t=ws(e),n=[];if(["to","from"].forEach(i=>{if(t[i]==null)return;let s=nt(t[i],this);Rg(s)?n.push(async function(){t[i]=await s}()):t[i]=s}),t.blockTag!=null){let i=this._getBlockTag(t.blockTag);Rg(i)?n.push(async function(){t.blockTag=await i}()):t.blockTag=i}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(this.#i==null){let i=(async()=>{try{let s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw this.#i===i&&(this.#i=null),s}})();return this.#i=i,(await i).clone()}let e=this.#i,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#c?(this.emit("network",n,t),this.#i===e&&(this.#i=Promise.resolve(n))):P(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){let e=await this.getNetwork(),t=async()=>{let{_block:i,gasPrice:s,priorityFee:o}=await Qe({_block:this.#g("latest",!1),gasPrice:(async()=>{try{let u=await this.#s({method:"getGasPrice"});return H(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let u=await this.#s({method:"getPriorityFee"});return H(u,"%response")}catch{}return null})()}),a=null,c=null,l=this._wrapBlock(i,e);return l&&l.baseFeePerGas&&(c=o??BigInt("1000000000"),a=l.baseFeePerGas*Vue+c),new wc(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){let i=new pr(n.url),s=await n.processFunc(t,this,i);return new wc(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Rg(t)&&(t=await t),H(await this.#s({method:"estimateGas",transaction:t}),"%response")}async#l(e,t,n){P(n<Wue,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});let i=ws(e);try{return j(await this._perform({method:"call",transaction:i,blockTag:t}))}catch(s){if(!this.disableCcipRead&&cc(s)&&s.data&&n>=0&&t==="latest"&&i.to!=null&&Le(s.data,0,4)==="0x556f1830"){let o=s.data,a=await nt(i.to,this),c;try{c=Xue(Le(s.data,4))}catch(d){P(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}P(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});let l=await this.ccipReadFetch(i,c.calldata,c.urls);P(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});let u={to:a,data:we([c.selector,Zue([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{let d=await this.#l(u,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:d}),d}}throw s}}async#m(e){let{value:t}=await Qe({network:this.getNetwork(),value:e});return t}async call(e){let{tx:t,blockTag:n}=await Qe({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#m(this.#l(t,n,e.enableCcipRead?0:-1))}async#f(e,t,n){let i=this._getAddress(t),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await this.#m(this.#s(Object.assign(e,{address:i,blockTag:s})))}async getBalance(e,t){return H(await this.#f({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return se(await this.#f({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return j(await this.#f({method:"getCode"},e,t))}async getStorage(e,t,n){let i=H(t,"position");return j(await this.#f({method:"getStorage",position:i},e,n))}async broadcastTransaction(e){let{blockNumber:t,hash:n,network:i}=await Qe({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=To.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(t)}async#g(e,t){if(pe(e,32))return await this.#s({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#s({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){let{network:n,params:i}=await Qe({network:this.getNetwork(),params:this.#g(e,!!t)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){let{network:t,params:n}=await Qe({network:this.getNetwork(),params:this.#s({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){let{network:t,params:n}=await Qe({network:this.getNetwork(),params:this.#s({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){let i=await this.#s({method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){let{result:t}=await Qe({network:this.getNetwork(),result:this.#s({method:"getTransactionResult",hash:e})});return t==null?null:j(t)}async getLogs(e){let t=this._getFilter(e);Rg(t)&&(t=await t);let{network:n,params:i}=await Qe({network:this.getNetwork(),params:this.#s({method:"getLogs",filter:t})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){P(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Cc.fromName(this,e)}async getAvatar(e){let t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){let t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=de(e);let t=vc(e.substring(2).toLowerCase()+".addr.reverse");try{let n=await Cc.getEnsAddress(this),s=await new xn(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(s==null||s===ii)return null;let a=await new xn(s,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(a)!==e?null:a}catch(n){if(je(n,"BAD_DATA")&&n.value==="0x"||je(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){let i=t??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null,c=async l=>{try{let u=await this.getTransactionReceipt(e);if(u!=null&&l-u.blockNumber+1>=i){s(u),a&&(clearTimeout(a),a=null);return}}catch(u){console.log("EEE",u)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(xe("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){P(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){let t=this.#h.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#h.delete(e))}_setTimeout(e,t){t==null&&(t=0);let n=this.#p++,i=()=>{this.#h.delete(n),e()};if(this.paused)this.#h.set(n,{timer:null,func:i,time:t});else{let s=setTimeout(i,t);this.#h.set(n,{timer:s,func:i,time:XA()})}return n}_forEachSubscriber(e){for(let t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new kc(e.type);case"block":{let t=new Og(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new Ig(this,e.type);case"event":return new Ss(this,e.filter);case"transaction":return new kg(this,e.hash);case"orphan":return new Pg(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(let n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#r!=null&&t.pause(this.#r);break}}async#b(e,t){let n=await ZA(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await ZA({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#v(e){let t=await ZA(e,this),n=t.tag,i=this.#e.get(n);return i||(i={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,i)),i}async on(e,t){let n=await this.#v(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async once(e,t){let n=await this.#v(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async emit(e,...t){let n=await this.#b(e,t);if(!n||n.listeners.length===0)return!1;let i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{let a=new mo(this,o?null:s,e);try{s.call(this,...t,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),i>0}async listenerCount(e){if(e){let n=await this.#b(e);return n?n.listeners.length:0}let t=0;for(let{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){let n=await this.#b(e);return n?n.listeners.map(({listener:i})=>i):[]}let t=[];for(let{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:i})=>i));return t}async off(e,t){let n=await this.#b(e);if(!n)return this;if(t){let i=n.listeners.map(({listener:s})=>s).indexOf(t);i>=0&&n.listeners.splice(i,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){let{tag:t,started:n,subscriber:i}=await this.#v(e);n&&i.stop(),this.#e.delete(t)}else for(let[t,{started:n,subscriber:i}]of this.#e)n&&i.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#n}destroy(){this.removeAllListeners();for(let e of this.#h.keys())this._clearTimeout(e);this.#n=!0}get paused(){return this.#r!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#u=-1,this.#r!=null){if(this.#r==!!e)return;P(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#r=!!e;for(let t of this.#h.values())t.timer&&clearTimeout(t.timer),t.time=XA()-t.time}resume(){if(this.#r!=null){this._forEachSubscriber(e=>e.resume()),this.#r=null;for(let e of this.#h.values()){let t=e.time;t<0&&(t=0),e.time=XA(),setTimeout(e.func,t)}}}};function Que(r,e){try{let t=tw(r,e);if(t)return os(t)}catch{}return null}function tw(r,e){if(r==="0x")return null;try{let t=se(Le(r,e,e+32)),n=se(Le(r,t,t+32));return Le(r,t+32,t+32+n)}catch{}return null}function qL(r){let e=tt(r);if(e.length>32)throw new Error("internal; should not happen");let t=new Uint8Array(32);return t.set(e,32-e.length),t}function Yue(r){if(r.length%32===0)return r;let e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}var $ue=new Uint8Array([]);function Zue(r){let e=[],t=0;for(let n=0;n<r.length;n++)e.push($ue),t+=32;for(let n=0;n<r.length;n++){let i=ne(r[n]);e[n]=qL(t),e.push(qL(i.length)),e.push(Yue(i)),t+=32+Math.ceil(i.length/32)*32}return we(e)}var BL="0x0000000000000000000000000000000000000000000000000000000000000000";function Xue(r){let e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};P(wn(r)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let t=Le(r,0,32);P(Le(t,0,12)===Le(BL,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Le(t,12);try{let n=[],i=se(Le(r,32,64)),s=se(Le(r,i,i+32)),o=Le(r,i+32);for(let a=0;a<s;a++){let c=Que(o,a*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{P(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let n=tw(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{P(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}P(Le(r,100,128)===Le(BL,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Le(r,96,100);try{let n=tw(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{P(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function Rc(r,e){if(r.provider)return r.provider;P(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function UL(r,e){let t=ws(e);if(t.to!=null&&(t.to=nt(t.to,r)),t.from!=null){let n=t.from;t.from=Promise.all([r.getAddress(),nt(n,r)]).then(([i,s])=>(A(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else t.from=r.getAddress();return await Qe(t)}var zu=class{provider;constructor(e){J(this,{provider:e||null})}async getNonce(e){return Rc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await UL(this,e)}async populateTransaction(e){let t=Rc(this,"populateTransaction"),n=await UL(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));let i=await this.provider.getNetwork();if(n.chainId!=null){let o=H(n.chainId);A(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;let s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?A(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&A(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){let o=await t.getFeeData();P(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{let o=await t.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){let a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(P(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):P(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Qe(n)}async estimateGas(e){return Rc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Rc(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Rc(this,"resolveName").resolveName(e)}async sendTransaction(e){let t=Rc(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;let i=To.from(n);return await t.broadcastTransaction(await this.signTransaction(i))}};function ede(r){return JSON.parse(JSON.stringify(r))}var Mg=class{#e;#t;#r;#n;#i;#c;constructor(e){this.#e=e,this.#t=null,this.#r=this.#a.bind(this),this.#n=!1,this.#i=null,this.#c=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#a(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(s){if(!je(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}let n=await this.#e.getNetwork();if(this.#i||(this.#i=n),this.#i.chainId!==n.chainId)throw new Error("chaid changed");if(this.#c)return;let i=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,i)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#r)}#u(){let e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#n||(this.#n=!0,this.#a(-2))}stop(){this.#n&&(this.#n=!1,this.#c=!0,this.#u(),this.#e.off("block",this.#r))}pause(e){e&&this.#u(),this.#e.off("block",this.#r)}resume(){this.start()}},Dg=class extends Mg{#e;constructor(e,t){super(e),this.#e=ede(t)}_recover(e){return new Ss(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(let n of t)e.emit(this.#e,e._wrapLog(n,e._network))}},Lg=class extends Mg{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(let n of t)e.emit("pending",n)}};var tde="bigint,boolean,function,number,string,symbol".split(/,/g);function Fg(r){if(r==null||tde.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(Fg);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function rde(r){return new Promise(e=>{setTimeout(e,r)})}function Nc(r){return r&&r.toLowerCase()}function jL(r){return r&&typeof r.pollingInterval=="number"}var zL={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},ko=class extends zu{address;constructor(e,t){super(e),t=de(t),J(this,{address:t})}connect(e){P(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){let t=Fg(e),n=[];if(t.from){let s=t.from;n.push((async()=>{let o=await nt(s,this.provider);A(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=o})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){let s=t.to;n.push((async()=>{t.to=await nt(s,this.provider)})())}n.length&&await Promise.all(n);let i=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(e){let t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((i,s)=>{let o=[1e3,100],a=0,c=async()=>{try{let l=await this.provider.getTransaction(n);if(l!=null){i(l.replaceableTransaction(t));return}}catch(l){if(je(l,"CANCELLED")||je(l,"BAD_DATA")||je(l,"NETWORK_ERROR")){l.info==null&&(l.info={}),l.info.sendTransactionHash=n,s(l);return}if(je(l,"INVALID_ARGUMENT")&&(a++,l.info==null&&(l.info={}),l.info.sendTransactionHash=n,a>10)){s(l);return}this.provider.emit("error",xe("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:l}))}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(e){let t=Fg(e);if(t.from){let i=await nt(t.from,this.provider);A(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=i}else t.from=this.address;let n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){let t=typeof e=="string"?Vt(e):e;return await this.provider.send("personal_sign",[j(t),this.address.toLowerCase()])}async signTypedData(e,t,n){let i=Fg(n),s=await bc.resolveNames(e,t,i,async o=>{let a=await nt(o);return A(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(bc.getPayload(s.domain,t,s.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){let t=typeof e=="string"?Vt(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),j(t)])}},Hu=class extends ju{#e;#t;#r;#n;#i;#c;#a;#u(){if(this.#n)return;let e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;let t=this.#r;for(this.#r=[];t.length;){let n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(s=>s.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{let i=n.length===1?n[0].payload:n.map(s=>s.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{let s=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:s});for(let{resolve:o,reject:a,payload:c}of n){if(this.destroyed){a(xe("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}let l=s.filter(u=>u.id===c.id)[0];if(l==null){let u=xe("missing response for request","BAD_DATA",{value:s,info:{payload:c}});this.emit("error",u),a(u);continue}if("error"in l){a(this.getRpcError(c,l));continue}if(c.method==="eth_call")try{if(j(l.result)==="0x"){a(this.getRpcError(c,l));continue}}catch{}o(l.result)}}catch(s){this.emit("debug",{action:"receiveRpcError",error:s});for(let{reject:o}of n)o(s)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},zL,t||{}),this.#r=[],this.#n=null,this.#c=null,this.#a=null;{let i=null,s=new Promise(o=>{i=o});this.#i={promise:s,resolve:i}}let n=this._getOption("staticNetwork");typeof n=="boolean"?(A(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#c=Ct.from(e))):n&&(A(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#c=n)}_getOption(e){return this.#e[e]}get _network(){return P(this.#c,"network is not available yet","NETWORK_ERROR"),this.#c}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&H(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){let i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}let t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){let e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#c)return this.#c}else return e;return this.#a?await this.#a:this.ready?(this.#a=(async()=>{try{let t=Ct.from(H(await this.send("eth_chainId",[])));return this.#a=null,t}catch(t){throw this.#a=null,t}})(),await this.#a):(this.#a=(async()=>{let t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#a=null}catch(i){throw this.#a=null,this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Ct.from(H(n.result));throw this.getRpcError(t,n)})(),await this.#a)}_start(){this.#i==null||this.#i.resolve==null||(this.#i.resolve(),this.#i=null,(async()=>{for(;this.#c==null&&!this.destroyed;)try{this.#c=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",xe("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await rde(1e3)}this.#u()})())}async _waitUntilReady(){if(this.#i!=null)return await this.#i.promise}_getSubscriber(e){return e.type==="pending"?new Lg(this):e.type==="event"?this._getOption("polling")?new Ss(this,e.filter):new Dg(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new kc("orphan"):super._getSubscriber(e)}get ready(){return this.#i==null}getRpcTransaction(e){let t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let i=n;n==="gasLimit"&&(i="gas"),t[i]=Sn(H(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=j(e[n]))}),e.accessList&&(t.accessList=yr(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Nc(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Nc(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Nc(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Nc(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Nc):e.filter.address=Nc(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){let{method:n}=e,{error:i,headers:s}=t;if(n==="eth_estimateGas"&&i.message){let c=i.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return xe("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}})}if(n==="eth_call"||n==="eth_estimateGas"){let c=nw(i),l=ai.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],c?c.data:null);return l.info={error:i,payload:e,headers:s},l}let o=JSON.stringify(nde(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return xe("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:i}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){let c=e.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return xe("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:i}});if(o.match(/nonce/i)&&o.match(/too low/i))return xe("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:i}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return xe("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:i}});if(o.match(/only replay-protected/i))return xe("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:c,info:{error:i}}})}let a=!!o.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?xe("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):xe("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(xe("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));let n=this.#t++,i=new Promise((s,o)=>{this.#r.push({resolve:s,reject:o,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#u(),i}async getSigner(e){e==null&&(e=0);let t=this.send("eth_accounts",[]);if(typeof e=="number"){let i=await t;if(e>=i.length)throw new Error("no such account");return new ko(this,i[e])}let{accounts:n}=await Qe({network:this.getNetwork(),accounts:t});e=de(e);for(let i of n)if(de(i)===e)return new ko(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new ko(this,t))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(let{payload:e,reject:t}of this.#r)t(xe("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}},rw=class extends Hu{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=zL.pollingInterval),this.#e=n}_getSubscriber(e){let t=super._getSubscriber(e);return jL(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{jL(t)&&(t.pollingInterval=this.#e)})}},Ro=class extends rw{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new pr(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){let t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");let n=await t.send();n.assertOk();let i=n.bodyJson;return Array.isArray(i)||(i=[i]),i.forEach(s=>{let o="error"in s;if(!o)try{j(s.result)==="0x"&&(o=!0)}catch{}if(o){s.headers={};for(let[a,c]of Object.entries(n.headers))a.toLowerCase().includes("sentio")&&(s.headers[a]=c)}}),i}};function nw(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&pe(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(let e in r){let t=nw(r[e]);if(t)return t}return null}if(typeof r=="string")try{return nw(JSON.parse(r))}catch{}return null}function iw(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(let t in r)iw(r[t],e);if(typeof r=="string")try{return iw(JSON.parse(r),e)}catch{}}}function nde(r){let e=[];return iw(r,e),e}var ow=No(GL(),1);var aw=class r extends Error{name="TimeoutError";constructor(e,t){super(e,t),Error.captureStackTrace?.(this,r)}},VL=r=>r.reason??new DOMException("This operation was aborted.","AbortError");function cw(r,e){let{milliseconds:t,fallback:n,message:i,customTimers:s={setTimeout,clearTimeout},signal:o}=e,a,c,u=new Promise((d,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(o?.aborted){f(VL(o));return}if(o&&(c=()=>{f(VL(o))},o.addEventListener("abort",c,{once:!0})),r.then(d,f),t===Number.POSITIVE_INFINITY)return;let h=new aw;a=s.setTimeout(()=>{if(n){try{d(n())}catch(m){f(m)}return}typeof r.cancel=="function"&&r.cancel(),i===!1?d():i instanceof Error?f(i):(h.message=i??`Promise timed out after ${t} milliseconds`,f(h))},t)}).finally(()=>{u.clear(),c&&o&&o.removeEventListener("abort",c)});return u.clear=()=>{s.clearTimeout(a),a=void 0},u}function lw(r,e,t){let n=0,i=r.length;for(;i>0;){let s=Math.trunc(i/2),o=n+s;t(r[o],e)<=0?(n=++o,i-=s+1):i=s}return n}var Vu=class{#e=[];enqueue(e,t){let{priority:n=0,id:i}=t??{},s={priority:n,id:i,run:e};if(this.size===0||this.#e[this.size-1].priority>=n){this.#e.push(s);return}let o=lw(this.#e,s,(a,c)=>c.priority-a.priority);this.#e.splice(o,0,s)}setPriority(e,t){let n=this.#e.findIndex(s=>s.id===e);if(n===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[i]=this.#e.splice(n,1);this.enqueue(i.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Wu=class extends ow.default{#e;#t;#r=0;#n;#i=!1;#c=!1;#a;#u=0;#p=0;#h;#d;#o;#s;#l=0;#m;#f;#g=1n;#b=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Vu,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);if(this.#e=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#n=e.intervalCap,this.#a=e.interval,this.#o=new e.queueClass,this.#s=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#f=e.autoStart===!1,this.#L()}get#v(){return this.#t||this.#r<this.#n}get#w(){return this.#l<this.#m}#S(){this.#l--,this.#l===0&&this.emit("pendingZero"),this.#M(),this.emit("next")}#E(){this.#C(),this.#P(),this.#d=void 0}get#T(){let e=Date.now();if(this.#h===void 0){let t=this.#u-e;if(t<0){if(this.#p>0){let n=e-this.#p;if(n<this.#a)return this.#x(this.#a-n),!0}this.#r=this.#e?this.#l:0}else return this.#x(t),!0}return!1}#x(e){this.#d===void 0&&(this.#d=setTimeout(()=>{this.#E()},e))}#_(){this.#h&&(clearInterval(this.#h),this.#h=void 0)}#F(){this.#d&&(clearTimeout(this.#d),this.#d=void 0)}#M(){if(this.#o.size===0)return this.#_(),this.emit("empty"),this.#l===0&&(this.#F(),this.emit("idle")),!1;let e=!1;if(!this.#f){let t=!this.#T;if(this.#v&&this.#w){let n=this.#o.dequeue();this.#t||(this.#r++,this.#I()),this.emit("active"),this.#p=Date.now(),n(),t&&this.#P(),e=!0}}return e}#P(){this.#t||this.#h!==void 0||(this.#h=setInterval(()=>{this.#C()},this.#a),this.#u=Date.now()+this.#a)}#C(){this.#r===0&&this.#l===0&&this.#h&&this.#_(),this.#r=this.#e?this.#l:0,this.#D(),this.#I()}#D(){for(;this.#M(););}get concurrency(){return this.#m}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#m=e,this.#D()}async#A(e){return new Promise((t,n)=>{e.addEventListener("abort",()=>{n(e.reason)},{once:!0})})}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#o.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#g++).toString(),t={timeout:this.timeout,...t},new Promise((n,i)=>{let s=Symbol(`task-${t.id}`);this.#o.enqueue(async()=>{this.#l++,this.#b.set(s,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});try{try{t.signal?.throwIfAborted()}catch(c){throw this.#t||this.#r--,this.#b.delete(s),c}let o=e({signal:t.signal});t.timeout&&(o=cw(Promise.resolve(o),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#l} running, ${this.#o.size} waiting)`})),t.signal&&(o=Promise.race([o,this.#A(t.signal)]));let a=await o;n(a),this.emit("completed",a)}catch(o){i(o),this.emit("error",o)}finally{this.#b.delete(s),queueMicrotask(()=>{this.#S()})}},t),this.emit("add"),this.#M()})}async addAll(e,t){return Promise.all(e.map(async n=>this.add(n,t)))}start(){return this.#f?(this.#f=!1,this.#D(),this):this}pause(){this.#f=!0}clear(){this.#o=new this.#s,this.#q()}async onEmpty(){this.#o.size!==0&&await this.#O("empty")}async onSizeLessThan(e){this.#o.size<e||await this.#O("next",()=>this.#o.size<e)}async onIdle(){this.#l===0&&this.#o.size===0||await this.#O("idle")}async onPendingZero(){this.#l!==0&&await this.#O("pendingZero")}async onRateLimit(){this.isRateLimited||await this.#O("rateLimit")}async onRateLimitCleared(){this.isRateLimited&&await this.#O("rateLimitCleared")}async onError(){return new Promise((e,t)=>{let n=i=>{this.off("error",n),t(i)};this.on("error",n)})}async#O(e,t){return new Promise(n=>{let i=()=>{t&&!t()||(this.off(e,i),n())};this.on(e,i)})}get size(){return this.#o.size}sizeBy(e){return this.#o.filter(e).length}get pending(){return this.#l}get isPaused(){return this.#f}#L(){this.#t||(this.on("add",()=>{this.#o.size>0&&this.#I()}),this.on("next",()=>{this.#I()}))}#I(){this.#t||this.#c||(this.#c=!0,queueMicrotask(()=>{this.#c=!1,this.#q()}))}#q(){let e=this.#i,t=!this.#t&&this.#r>=this.#n&&this.#o.size>0;t!==e&&(this.#i=t,this.emit(t?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#i}get isSaturated(){return this.#l===this.#m&&this.#o.size>0||this.isRateLimited&&this.#o.size>0}get runningTasks(){return[...this.#b.values()].map(e=>({...e}))}};var eF=No(JL(),1);var Ide=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,YL=new Set,pw=typeof process=="object"&&process?process:{},$L=(r,e,t,n)=>{typeof pw.emitWarning=="function"?pw.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},Kg=globalThis.AbortController,QL=globalThis.AbortSignal;if(typeof Kg>"u"){QL=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},Kg=class{constructor(){e()}signal=new QL;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let r=pw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=!1,$L("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Pde=r=>!YL.has(r),mTe=Symbol("type"),Ts=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),ZL=r=>Ts(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Mc:null:null,Mc=class extends Array{constructor(e){super(e),this.fill(0)}},mw=class r{heap;length;static#e=!1;static create(e){let t=ZL(e);if(!t)return[];r.#e=!0;let n=new r(e,t);return r.#e=!1,n}constructor(e,t){if(!r.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Ku=class r{#e;#t;#r;#n;#i;#c;#a;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#p;#h;#d;#o;#s;#l;#m;#f;#g;#b;#v;#w;#S;#E;#T;#x;#_;#F;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#E,sizes:e.#w,keyMap:e.#d,keyList:e.#o,valList:e.#s,next:e.#l,prev:e.#m,get head(){return e.#f},get tail(){return e.#g},free:e.#b,isBackgroundFetch:t=>e.#y(t),backgroundFetch:(t,n,i,s)=>e.#j(t,n,i,s),moveToTail:t=>e.#B(t),indexes:t=>e.#k(t),rindexes:t=>e.#R(t),isStale:t=>e.#A(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#p}get fetchMethod(){return this.#c}get memoMethod(){return this.#a}get dispose(){return this.#r}get onInsert(){return this.#n}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:h,maxSize:m=0,maxEntrySize:p=0,sizeCalculation:y,fetchMethod:b,memoMethod:E,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:I,ignoreFetchAbort:B,perf:z}=e;if(z!==void 0&&typeof z?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=z??Ide,t!==0&&!Ts(t))throw new TypeError("max option must be a nonnegative integer");let L=t?ZL(t):Array;if(!L)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=p||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#a=E,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=b,this.#x=!!b,this.#d=new Map,this.#o=new Array(t).fill(void 0),this.#s=new Array(t).fill(void 0),this.#l=new L(t),this.#m=new L(t),this.#f=0,this.#g=0,this.#b=mw.create(t),this.#p=0,this.#h=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#n=u),typeof d=="function"?(this.#i=d,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#T=!!this.#r,this.#F=!!this.#n,this.#_=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#t!==0&&!Ts(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ts(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ts(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Ts(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let q="LRU_CACHE_UNBOUNDED";Pde(q)&&(YL.add(q),$L("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,r))}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#M(){let e=new Mc(this.#e),t=new Mc(this.#e);this.#E=e,this.#S=t,this.#D=(s,o,a=this.#u.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#A(s)&&this.#N(this.#o[s],"expire")},o+1);c.unref&&c.unref()}},this.#P=s=>{t[s]=e[s]!==0?this.#u.now():0},this.#C=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=n||i();let l=s.now-c;s.remainingTTL=a-l}};let n=0,i=()=>{let s=this.#u.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#d.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(n||i())-c;return a-l},this.#A=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(n||i())-o>a}}#P=()=>{};#C=()=>{};#D=()=>{};#A=()=>!1;#O(){let e=new Mc(this.#e);this.#h=0,this.#w=e,this.#L=t=>{this.#h-=e[t],e[t]=0},this.#q=(t,n,i,s)=>{if(this.#y(n))return 0;if(!Ts(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Ts(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#I=(t,n,i)=>{if(e[t]=n,this.#t){let s=this.#t-e[t];for(;this.#h>s;)this.#U(!0)}this.#h+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#h)}}#L=e=>{};#I=(e,t,n)=>{};#q=(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#p)for(let t=this.#g;!(!this.#z(t)||((e||!this.#A(t))&&(yield t),t===this.#f));)t=this.#m[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#p)for(let t=this.#f;!(!this.#z(t)||((e||!this.#A(t))&&(yield t),t===this.#g));)t=this.#l[t]}#z(e){return e!==void 0&&this.#d.get(this.#o[e])===e}*entries(){for(let e of this.#k())this.#s[e]!==void 0&&this.#o[e]!==void 0&&!this.#y(this.#s[e])&&(yield[this.#o[e],this.#s[e]])}*rentries(){for(let e of this.#R())this.#s[e]!==void 0&&this.#o[e]!==void 0&&!this.#y(this.#s[e])&&(yield[this.#o[e],this.#s[e]])}*keys(){for(let e of this.#k()){let t=this.#o[e];t!==void 0&&!this.#y(this.#s[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#o[e];t!==void 0&&!this.#y(this.#s[e])&&(yield t)}}*values(){for(let e of this.#k())this.#s[e]!==void 0&&!this.#y(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#R())this.#s[e]!==void 0&&!this.#y(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#k()){let i=this.#s[n],s=this.#y(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#o[n],this))return this.get(this.#o[n],t)}}forEach(e,t=this){for(let n of this.#k()){let i=this.#s[n],s=this.#y(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#o[n],this)}}rforEach(e,t=this){for(let n of this.#R()){let i=this.#s[n],s=this.#y(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#o[n],this)}}purgeStale(){let e=!1;for(let t of this.#R({allowStale:!0}))this.#A(t)&&(this.#N(this.#o[t],"expire"),e=!0);return e}info(e){let t=this.#d.get(e);if(t===void 0)return;let n=this.#s[t],i=this.#y(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#E&&this.#S){let o=this.#E[t],a=this.#S[t];if(o&&a){let c=o-(this.#u.now()-a);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#k({allowStale:!0})){let n=this.#o[t],i=this.#s[t],s=this.#y(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#E&&this.#S){o.ttl=this.#E[t];let a=this.#u.now()-this.#S[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#q(e,t,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#N(e,"set"),this;let d=this.#p===0?void 0:this.#d.get(e);if(d===void 0)d=this.#p===0?this.#g:this.#b.length!==0?this.#b.pop():this.#p===this.#e?this.#U(!1):this.#p,this.#o[d]=e,this.#s[d]=t,this.#d.set(e,d),this.#l[this.#g]=d,this.#m[d]=this.#g,this.#g=d,this.#p++,this.#I(d,u,c),c&&(c.set="add"),l=!1,this.#F&&this.#n?.(t,e,"add");else{this.#B(d);let f=this.#s[d];if(t!==f){if(this.#x&&this.#y(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#T&&this.#r?.(h,e,"set"),this.#_&&this.#v?.push([h,e,"set"]))}else o||(this.#T&&this.#r?.(f,e,"set"),this.#_&&this.#v?.push([f,e,"set"]));if(this.#L(d),this.#I(d,u,c),this.#s[d]=t,c){c.set="replace";let h=f&&this.#y(f)?f.__staleWhileFetching:f;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update");this.#F&&this.onInsert?.(t,e,t===f?"update":"replace")}if(i!==0&&!this.#E&&this.#M(),this.#E&&(l||this.#D(d,i,s),c&&this.#C(c,d)),!o&&this.#_&&this.#v){let f=this.#v,h;for(;h=f?.shift();)this.#i?.(...h)}return this}pop(){try{for(;this.#p;){let e=this.#s[this.#f];if(this.#U(!0),this.#y(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#_&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#U(e){let t=this.#f,n=this.#o[t],i=this.#s[t];return this.#x&&this.#y(i)?i.__abortController.abort(new Error("evicted")):(this.#T||this.#_)&&(this.#T&&this.#r?.(i,n,"evict"),this.#_&&this.#v?.push([i,n,"evict"])),this.#L(t),e&&(this.#o[t]=void 0,this.#s[t]=void 0,this.#b.push(t)),this.#p===1?(this.#f=this.#g=0,this.#b.length=0):this.#f=this.#l[t],this.#d.delete(n),this.#p--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#d.get(e);if(s!==void 0){let o=this.#s[s];if(this.#y(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#C(i,s));else return n&&this.#P(s),i&&(i.has="hit",this.#C(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,i=this.#d.get(e);if(i===void 0||!n&&this.#A(i))return;let s=this.#s[i];return this.#y(s)?s.__staleWhileFetching:s}#j(e,t,n,i){let s=t===void 0?void 0:this.#s[t];if(this.#y(s))return s;let o=new Kg,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:i},l=(p,y=!1)=>{let{aborted:b}=o.signal,E=n.ignoreFetchAbort&&p!==void 0;if(n.status&&(b&&!y?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,E&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),b&&!E&&!y)return d(o.signal.reason);let x=h;return this.#s[t]===h&&(p===void 0?x.__staleWhileFetching!==void 0?this.#s[t]=x.__staleWhileFetching:this.#N(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,p,c.options))),p},u=p=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=p),d(p)),d=p=>{let{aborted:y}=o.signal,b=y&&n.allowStaleOnFetchAbort,E=b||n.allowStaleOnFetchRejection,x=E||n.noDeleteOnFetchRejection,S=h;if(this.#s[t]===h&&(!x||S.__staleWhileFetching===void 0?this.#N(e,"fetch"):b||(this.#s[t]=S.__staleWhileFetching)),E)return n.status&&S.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw p},f=(p,y)=>{let b=this.#c?.(e,s,c);b&&b instanceof Promise&&b.then(E=>p(E===void 0?void 0:E),y),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(p(void 0),n.allowStaleOnFetchAbort&&(p=E=>l(E,!0)))})};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(f).then(l,u),m=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#d.get(e)):this.#s[t]=m,m}#y(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Kg}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:y=!1,status:b,signal:E}=t;if(!this.#x)return b&&(b.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:b});let x={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:m,ignoreFetchAbort:h,status:b,signal:E},S=this.#d.get(e);if(S===void 0){b&&(b.fetch="miss");let M=this.#j(e,S,x,p);return M.__returned=M}else{let M=this.#s[S];if(this.#y(M)){let q=n&&M.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",q&&(b.returnedStale=!0)),q?M.__staleWhileFetching:M.__returned=M}let I=this.#A(S);if(!y&&!I)return b&&(b.fetch="hit"),this.#B(S),i&&this.#P(S),b&&this.#C(b,S),M;let B=this.#j(e,S,x,p),L=B.__staleWhileFetching!==void 0&&n;return b&&(b.fetch=I?"stale":"refresh",L&&I&&(b.returnedStale=!0)),L?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#a;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=n(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#d.get(e);if(a!==void 0){let c=this.#s[a],l=this.#y(c);return o&&this.#C(o,a),this.#A(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||this.#N(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#B(a),i&&this.#P(a),c))}else o&&(o.get="miss")}#H(e,t){this.#m[t]=e,this.#l[e]=t}#B(e){e!==this.#g&&(e===this.#f?this.#f=this.#l[e]:this.#H(this.#m[e],this.#l[e]),this.#H(this.#g,e),this.#g=e)}delete(e){return this.#N(e,"delete")}#N(e,t){let n=!1;if(this.#p!==0){let i=this.#d.get(e);if(i!==void 0)if(n=!0,this.#p===1)this.#G(t);else{this.#L(i);let s=this.#s[i];if(this.#y(s)?s.__abortController.abort(new Error("deleted")):(this.#T||this.#_)&&(this.#T&&this.#r?.(s,e,t),this.#_&&this.#v?.push([s,e,t])),this.#d.delete(e),this.#o[i]=void 0,this.#s[i]=void 0,i===this.#g)this.#g=this.#m[i];else if(i===this.#f)this.#f=this.#l[i];else{let o=this.#m[i];this.#l[o]=this.#l[i];let a=this.#l[i];this.#m[a]=this.#m[i]}this.#p--,this.#b.push(i)}}if(this.#_&&this.#v?.length){let i=this.#v,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#G("delete")}#G(e){for(let t of this.#R({allowStale:!0})){let n=this.#s[t];if(this.#y(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#o[t];this.#T&&this.#r?.(n,i,e),this.#_&&this.#v?.push([n,i,e])}}if(this.#d.clear(),this.#s.fill(void 0),this.#o.fill(void 0),this.#E&&this.#S&&(this.#E.fill(0),this.#S.fill(0)),this.#w&&this.#w.fill(0),this.#f=0,this.#g=0,this.#b.length=0,this.#h=0,this.#p=0,this.#_&&this.#v){let t=this.#v,n;for(;n=t?.shift();)this.#i?.(...n)}}};var{miss_count:kde,hit_count:Rde,queue_size:Nde}=ck,wTe=new Ro("",Ct.from(1)),XL=new Map;function tF(r){r||(r=eF.EthChainId.ETHEREUM);let e=Ct.from(parseInt(r)),t=ir.INSTANCE.chainServer.get(r),n=e.chainId.toString()+"-"+t,i=XL.get(n);if(i)return i;if(t===void 0)throw Error("Provider not found for chain "+e.chainId+", configured chains: "+[...ir.INSTANCE.chainServer.keys()].join(" "));return i=new gw(t,e,ir.INSTANCE.concurrency,ir.INSTANCE.batchCount),XL.set(n,i),i}function Mde(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){let i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}var gw=class extends Ro{executor;#e=new Ku({max:3e5,maxSize:500*1024*1024});#t=new Ku({max:3e5});constructor(e,t,n,i=1){super(e,t,{staticNetwork:t,batchMaxCount:i}),this.executor=new Wu({concurrency:n})}async send(e,t){if(e!=="eth_call"||t.length>2)return await this.executor.add(()=>super.send(e,t));let n=Mde(e,t),i=t[t.length-1],s=this.#e.get(n);if(s)Rde.add(1);else{kde.add(1);let a=lk.getStore(),c=Date.now();s=this.executor.add(()=>{let l=Date.now();to.processor_rpc_queue_duration.record(l-c,{chain_id:this._network.chainId.toString(),handler:a});let u=!0;return super.send(e,t).catch(d=>{throw u=!1,d}).finally(()=>{to.processor_rpc_duration.record(Date.now()-l,{chain_id:this._network.chainId.toString(),handler:a,success:u})})}),Nde.record(this.executor.size),this.#e.set(n,s,{size:n.length}),i==="latest"&&setTimeout(()=>{this.#e.get(n)===s&&this.#e.delete(n)},60*1e3)}let o;try{o=await s}catch(a){if(this.#e.delete(n),a.code==="TIMEOUT"){let c=this.#t.get(n);if(_a.execution.rpcRetryTimes&&c===void 0&&(c=_a.execution.rpcRetryTimes),c)return this.#t.set(n,c-1),this.send(e,t)}throw a}if(!o)throw Error("Unexpected null response");return o}toString(){return"QueuedStaticJsonRpcProvider"}};import("node:process").then(r=>r.stdout.write(""));var Mt=No(RP(),1),qc=No(ik(),1);function Jg(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(d){o(d)}}function c(u){try{l(n.throw(u))}catch(d){o(d)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(r,e||[])).next())})}function rF(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function st(r){return this instanceof st?(this.v=r,this):new st(r)}function Ju(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(m){return Promise.resolve(m).then(h,d)}}function a(h,m){n[h]&&(i[h]=function(p){return new Promise(function(y,b){s.push([h,p,y,b])>1||c(h,p)})},m&&(i[h]=m(i[h])))}function c(h,m){try{l(n[h](m))}catch(p){f(s[0][3],p)}}function l(h){h.value instanceof st?Promise.resolve(h.value.v).then(u,d):f(s[0][2],h)}function u(h){c("next",h)}function d(h){c("throw",h)}function f(h,m){h(m),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Qg(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof rF=="function"?rF(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function nF(r,e,t){if(typeof e>"u")return r;switch(t){case 0:return function(){return r.call(e)};case 1:return function(n){return r.call(e,n)};case 2:return function(n,i){return r.call(e,n,i)};case 3:return function(n,i,s){return r.call(e,n,i,s)};default:return function(){return r.apply(e,arguments)}}}function Cs(r){return Jg(this,void 0,void 0,function*(){return r})}var Dde=r=>typeof r=="number",iF=r=>typeof r=="boolean",li=r=>typeof r=="function",In=r=>r!=null&&Object(r)===r,yw=r=>In(r)&&li(r.then);function vw(r){return In(r)&&Dde(r.length)}function bw(r){return r!=null&&li(r[Symbol.iterator])}function sF(r){return In(r)&&!li(r[Symbol.iterator])&&li(r.next)}function _w(r){return In(r)&&li(r[Symbol.asyncIterator])}function Ew(r){return r!=null&&Object(r)===r&&typeof r.subscribe=="function"}var oF=r=>In(r)&&li(r.pipe)&&li(r._read)&&iF(r.readable)&&In(r._readableState),aF=r=>In(r)&&li(r.end)&&li(r._write)&&iF(r.writable)&&In(r._writableState);function cF(r){let e=Number(r);return isNaN(e)?0:e===0||!isFinite(e)?e:(e>0?1:-1)*Math.floor(Math.abs(e))}var Lde=Math.pow(2,53)-1;function lF(r){let e=cF(r);return Math.min(Math.max(e,0),Lde)}var Dc=class r extends Error{constructor(e="The operation has been aborted"){super(e),Object.setPrototypeOf(this,r.prototype),Error.captureStackTrace(this,this.constructor),this.name="AbortError"}get[Symbol.toStringTag](){return"AbortError"}};function Lc(r){if(r&&r.aborted)throw new Dc}Object.defineProperty(Dc,Symbol.hasInstance,{writable:!0,configurable:!0,value(r){return In(r)&&(r.constructor.name==="AbortError"||r[Symbol.toStringTag]==="AbortError")}});var xt=class r{forEach(e,t,n){var i,s,o,a;return Jg(this,void 0,void 0,function*(){let c=n?new Xg(this,n):this,l=0;try{for(var u=!0,d=Qg(c),f;f=yield d.next(),i=f.done,!i;u=!0){a=f.value,u=!1;let h=a;yield e.call(t,h,l++,n)}}catch(h){s={error:h}}finally{try{!u&&!i&&(o=d.return)&&(yield o.call(d))}finally{if(s)throw s.error}}})}pipe(...e){let t=-1,n=e.length,i=this;for(;++t<n;)i=e[t](r.as(i));return i}static from(e,t=Cs,n){let i=nF(t,n,2);if(bw(e)||_w(e))return new Qu(e,i);if(yw(e))return new $g(e,i);if(Ew(e))return new Zg(e,i);if(vw(e))return new Fc(e,i);if(sF(e))return new Qu({[Symbol.asyncIterator]:()=>e},i);throw new TypeError("Input type not supported")}static as(e){return e instanceof r?e:typeof e=="string"?new Fc([e],Cs):bw(e)||_w(e)?new Qu(e,Cs):yw(e)?new $g(e,Cs):Ew(e)?new Zg(e,Cs):vw(e)?new Fc(e,Cs):new Fc([e],Cs)}};xt.prototype[Symbol.toStringTag]="AsyncIterableX";Object.defineProperty(xt,Symbol.hasInstance,{writable:!0,configurable:!0,value(r){return!!(r&&r[Symbol.toStringTag]==="AsyncIterableX")}});var Fde="value",Aw="error",Yg=class{constructor(){this._ended=!1,this._values=[],this._resolvers=[]}[Symbol.asyncIterator](){return this}write(e){this._push({type:Fde,value:e})}error(e){this._push({type:Aw,error:e})}_push(e){if(this._ended)throw new Error("AsyncSink already ended");if(this._resolvers.length>0){let{resolve:t,reject:n}=this._resolvers.shift();e.type===Aw?n(e.error):t({done:!1,value:e.value})}else this._values.push(e)}next(){if(this._values.length>0){let{type:e,value:t,error:n}=this._values.shift();return e===Aw?Promise.reject(n):Promise.resolve({done:!1,value:t})}return this._ended?Promise.resolve({done:!0}):new Promise((e,t)=>{this._resolvers.push({resolve:e,reject:t})})}end(){for(;this._resolvers.length>0;)this._resolvers.shift().resolve({done:!0});this._ended=!0}},Fc=class extends xt{constructor(e,t){super(),this._source=e,this._selector=t}[Symbol.asyncIterator](){return Ju(this,arguments,function*(){let t=0,n=lF(this._source.length);for(;t<n;)yield yield st(yield st(this._selector(this._source[t],t++)))})}},Qu=class extends xt{constructor(e,t){super(),this._source=e,this._selector=t}[Symbol.asyncIterator](e){return Ju(this,arguments,function*(){var n,i,s,o,a,c,l,u;let d=0;if(e&&this._source instanceof xt)try{for(var f=!0,h=Qg(new Xg(this._source,e)),m;m=yield st(h.next()),n=m.done,!n;f=!0){o=m.value,f=!1;let E=o;yield yield st(yield st(this._selector(E,d++)))}}catch(E){i={error:E}}finally{try{!f&&!n&&(s=h.return)&&(yield st(s.call(h)))}finally{if(i)throw i.error}}else{Lc(e);try{for(var p=!0,y=Qg(this._source),b;b=yield st(y.next()),a=b.done,!a;p=!0){u=b.value,p=!1;let E=u;Lc(e);let x=yield st(this._selector(E,d++));Lc(e),yield yield st(x)}}catch(E){c={error:E}}finally{try{!p&&!a&&(l=y.return)&&(yield st(l.call(y)))}finally{if(c)throw c.error}}}})}},$g=class extends xt{constructor(e,t){super(),this._source=e,this._selector=t}[Symbol.asyncIterator](){return Ju(this,arguments,function*(){let t=yield st(this._source);yield yield st(yield st(this._selector(t,0)))})}},Zg=class extends xt{constructor(e,t){super(),this._observable=e,this._selector=t}[Symbol.asyncIterator](e){return Ju(this,arguments,function*(){Lc(e);let n=new Yg,i=this._observable.subscribe({next(a){n.write(a)},error(a){n.error(a)},complete(){n.end()}});function s(){n.error(new Dc)}e&&e.addEventListener("abort",s);let o=0;try{for(let a;!(a=yield st(n.next())).done;)Lc(e),yield yield st(yield st(this._selector(a.value,o++)))}finally{e&&e.removeEventListener("abort",s),i.unsubscribe()}})}},Xg=class{constructor(e,t){this._source=e,this._signal=t}[Symbol.asyncIterator](){return this._source[Symbol.asyncIterator](this._signal)}};try{(r=>{if(r)return;xt.prototype.pipe=t;let e=(n,i=n._writableState||{objectMode:!0})=>i;function t(...n){let i=-1,s,o=n.length,a=this,c;for(;++i<o;)if(c=n[i],typeof c=="function")a=c(xt.as(a));else if(aF(c))return{end:s=!0}=n[i+1]||{},oF(a)?a.pipe(c,{end:s}):xt.as(a).toNodeStream(e(c)).pipe(c,{end:s});return a}})(typeof window=="object"&&typeof document=="object"&&document.nodeType===9)}catch{}var qde=xt.as,ey=xt.from;var ww=class r extends xt{constructor(e,t){super(),this._source=e,this._signal=t}withAbort(e){return new r(this._source,e)}[Symbol.asyncIterator](){return this._source[Symbol.asyncIterator](this._signal)}};function Sw(r){return function(t){return new ww(t,r)}}var Tw=No(HM(),1);var Bde=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3[]",name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bool",name:"allowFailure",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call3Value[]",name:"calls",type:"tuple[]"}],name:"aggregate3Value",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"getBasefee",outputs:[{internalType:"uint256",name:"basefee",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getChainId",outputs:[{internalType:"uint256",name:"chainid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall3.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall3.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"payable",type:"function"}],Ude=[{name:"Mainnet",chainId:1,url:"https://etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Kovan",chainId:42,url:"https://kovan.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Rinkeby",chainId:4,url:"https://rinkeby.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"G\xF6rli",chainId:5,url:"https://goerli.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Ropsten",chainId:3,url:"https://ropsten.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Sepolia",chainId:11155111,url:"https://sepolia.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Holesky",chainId:17e3,url:"https://holesky.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Xterio Chain",chainId:112358,url:"https://xterscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Xterio Testnet",chainId:1637450,url:"https://testnet.xterscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Optimism",chainId:10,url:"https://optimistic.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Optimism Kovan",chainId:69,url:"https://kovan-optimistic.etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Optimism G\xF6rli",chainId:420,url:"https://blockscout.com/optimism/goerli/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Optimism Sepolia",chainId:11155420,url:"https://optimism-sepolia.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Arbitrum",chainId:42161,url:"https://arbiscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Arbitrum Nova",chainId:42170,url:"https://nova.arbiscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Arbitrum G\xF6rli",chainId:421613,url:"https://goerli-rollup-explorer.arbitrum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Arbitrum Sepolia",chainId:421614,url:"https://sepolia-explorer.arbitrum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Arbitrum Rinkeby",chainId:421611,url:"https://testnet.arbiscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Stylus Testnet",chainId:23011913,url:"https://stylus-testnet-explorer.arbitrum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Polygon",chainId:137,url:"https://polygonscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Mumbai",chainId:80001,url:"https://mumbai.polygonscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Amoy",chainId:80002,url:"https://amoy.polygonscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Polygon zkEVM",chainId:1101,url:"https://zkevm.polygonscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Polygon zkEVM Testnet",chainId:1442,url:"https://testnet-zkevm.polygonscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Cardona zkEVM Testnet",chainId:2442,url:"https://cardona-zkevm.polygonscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Gnosis Chain (xDai)",chainId:100,url:"https://blockscout.com/xdai/mainnet/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Chiado (Gnosis Chain Testnet)",chainId:10200,url:"https://blockscout.chiadochain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Avalanche",chainId:43114,url:"https://snowtrace.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Avalanche Fuji",chainId:43113,url:"https://testnet.snowtrace.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fantom Testnet",chainId:4002,url:"https://testnet.ftmscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fantom Opera",chainId:250,url:"https://ftmscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fantom Sonic",chainId:64240,url:"https://public-sonic.fantom.network/address/0xca11bde05977b3631167028862be2a173976ca11"},{name:"BNB Smart Chain",chainId:56,url:"https://bscscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"BNB Smart Chain Testnet",chainId:97,url:"https://testnet.bscscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"opBNB Testnet",chainId:5611,url:"https://opbnbscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?p=1&tab=Contract"},{name:"opBNB Mainnet",chainId:204,url:"https://mainnet.opbnbscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?p=1&tab=Contract"},{name:"Moonbeam",chainId:1284,url:"https://moonscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Moonriver",chainId:1285,url:"https://moonriver.moonscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Moonbase Alpha Testnet",chainId:1287,url:"https://moonbase.moonscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Palm",chainId:11297108109,url:"https://palm.chainlens.com/contracts/0xca11bde05977b3631167028862be2a173976ca11/sources"},{name:"Palm Testnet",chainId:11297108099,url:"https://testnet.palm.chainlens.com/contracts/0xca11bde05977b3631167028862be2a173976ca11/sources"},{name:"Harmony",chainId:16666e5,url:"https://explorer.harmony.one/address/0xcA11bde05977b3631167028862bE2a173976CA11?activeTab=7"},{name:"Cronos",chainId:25,url:"https://cronoscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Cronos Testnet",chainId:338,url:"https://cronos.org/explorer/testnet3/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Fuse",chainId:122,url:"https://explorer.fuse.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Flare Mainnet",chainId:14,url:"https://flare-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Songbird Canary Network",chainId:19,url:"https://songbird-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Coston Testnet",chainId:16,url:"https://coston-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Coston2 Testnet",chainId:114,url:"https://coston2-explorer.flare.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Boba",chainId:288,url:"https://blockexplorer.boba.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Aurora",chainId:1313161554,url:"https://explorer.mainnet.aurora.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Astar",chainId:592,url:"https://blockscout.com/astar/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Astar zKyoto Testnet",chainId:6038361,url:"https://zkyoto.explorer.startale.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Astar zkEVM",chainId:3776,url:"https://astar-zkevm.explorer.startale.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"OKC",chainId:66,url:"https://www.oklink.com/en/okc/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Heco Chain",chainId:128,url:"https://hecoinfo.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Metis Andromeda",chainId:1088,url:"https://andromeda-explorer.metis.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Metis Goerli",chainId:599,url:"https://goerli.explorer.metisdevops.link/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Metis Sepolia",chainId:59902,url:"https://sepolia-explorer.metisdevops.link/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"RSK",chainId:30,url:"https://explorer.rsk.co/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"RSK Testnet",chainId:31,url:"https://explorer.testnet.rsk.co/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Evmos",chainId:9001,url:"https://evm.evmos.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Evmos Testnet",chainId:9e3,url:"https://evm.evmos.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Thundercore",chainId:108,url:"https://viewblock.io/thundercore/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=code"},{name:"Thundercore Testnet",chainId:18,url:"https://explorer-testnet.thundercore.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Oasis",chainId:42262,url:"https://explorer.emerald.oasis.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Oasis Sapphire",chainId:23294,url:"https://explorer.sapphire.oasis.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Celo",chainId:42220,url:"https://explorer.celo.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Celo Alfajores Testnet",chainId:44787,url:"https://explorer.celo.org/alfajores/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Godwoken",chainId:71402,url:"https://v1.gwscan.com/account/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Godwoken Testnet",chainId:71401,url:"https://gw-explorer.nervosdao.community/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Klaytn",chainId:8217,url:"https://scope.klaytn.com/account/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Klaytn Testnet (Baobab)",chainId:1001,url:"https://baobab.klaytnscope.com/account/0xca11bde05977b3631167028862be2a173976ca11?tabId=contractCode"},{name:"Milkomeda",chainId:2001,url:"https://explorer-mainnet-cardano-evm.c1.milkomeda.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"KCC",chainId:321,url:"https://explorer.kcc.io/en/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Velas",chainId:106,url:"https://evmexplorer.velas.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Telos",chainId:40,url:"https://www.teloscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Step Network",chainId:1234,url:"https://stepscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Canto",chainId:7700,url:"https://tuber.build/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Canto Testnet",chainId:7701,url:"https://testnet.tuber.build/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Iotex",chainId:4689,url:"https://iotexscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#transactions"},{name:"Bitgert",chainId:32520,url:"https://brisescan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Kava",chainId:2222,url:"https://explorer.kava.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Mantle Sepolia Testnet",chainId:5003,url:"https://explorer.sepolia.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Mantle Testnet",chainId:5001,url:"https://explorer.testnet.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Mantle",chainId:5e3,url:"https://explorer.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Shardeum Sphinx",chainId:8082,url:"https://explorer.testnet.mantle.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Base Testnet (Goerli)",chainId:84531,url:"https://goerli.basescan.org/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Base Testnet (Sepolia)",chainId:84532,url:"https://base-sepolia.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Base",chainId:8453,url:"https://basescan.org/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Kroma Testnet (Sepolia)",chainId:2358,url:"https://sepolia.kromascan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"DeFiChain EVM Mainnet",chainId:1130,url:"https://meta.defiscan.live/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DeFiChain EVM Testnet",chainId:1131,url:"https://meta.defiscan.live/address/0xcA11bde05977b3631167028862bE2a173976CA11?network=TestNet"},{name:"Defi Oracle Meta Mainnet",chainId:138,url:"https://blockscout.defi-oracle.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DFK Chain Test",chainId:335,url:"https://subnets-test.avax.network/defi-kingdoms/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DFK Chain",chainId:53935,url:"https://subnets.avax.network/defi-kingdoms/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Neon EVM DevNet",chainId:245022926,url:"https://devnet.neonscan.org/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Linea Sepolia Testnet",chainId:59141,url:"https://sepolia.lineascan.build/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Linea Goerli Testnet",chainId:59140,url:"https://explorer.goerli.linea.build/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Linea Mainnet",chainId:59144,url:"https://lineascan.build/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Hashbit",chainId:11119,url:"https://explorer.hashbit.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin",chainId:57,url:"https://explorer.syscoin.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin Rollux Mainnet",chainId:570,url:"https://explorer.rollux.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin Tannebaum Testnet",chainId:5700,url:"https://tanenbaum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Syscoin Tannebaum Rollux",chainId:57e3,url:"https://rollux.tanenbaum.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Pulsechain v4 Testnet",chainId:943,url:"https://scan.v4.testnet.pulsechain.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Pulsechain Mainnet",chainId:369,url:"https://scan.pulsechain.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Zora Goerli Testnet",chainId:999,url:"https://testnet.explorer.zora.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Zora",chainId:7777777,url:"https://explorer.zora.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Zora Sepolia Testnet",chainId:999999999,url:"https://sepolia.explorer.zora.energy/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Darwinia Crab Network",chainId:44,url:"https://crab.subscan.io/account/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Darwinia Network",chainId:46,url:"https://darwinia.subscan.io/account/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Chain Verse Mainnet",chainId:5555,url:"https://explorer.chainverse.info/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Scroll Alpha Testnet",chainId:534353,url:"https://blockscout.scroll.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Scroll Sepolia Testnet",chainId:534351,url:"https://sepolia.scrollscan.dev/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Scroll",chainId:534352,url:"https://scrollscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Xodex",chainId:2415,url:"https://explorer.xo-dex.com/contracts/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"EOS EVM Testnet",chainId:15557,url:"https://explorer.testnet.evm.eosnetwork.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"EOS EVM",chainId:17777,url:"https://explorer.evm.eosnetwork.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Crossbell",chainId:3737,url:"https://scan.crossbell.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Dogechain",chainId:2e3,url:"https://explorer.dogechain.dog/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"MEVerse Chain Testnet",chainId:4759,url:"https://testnet.meversescan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"MEVerse Chain Mainnet",chainId:7518,url:"https://meversescan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"SKALE Calypso Testnet",chainId:974399131,url:"https://giant-half-dual-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Europa Testnet",chainId:1444673419,url:"https://juicy-low-small-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Nebula Testnet",chainId:37084624,url:"https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Titan Testnet",chainId:1020352220,url:"https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Calypso Hub",chainId:1564830818,url:"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Europa Liquidity Hub",chainId:2046399126,url:"https://elated-tan-skat.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Nebula Gaming Hub",chainId:1482601649,url:"https://green-giddy-denebola.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"SKALE Titan AI Hub",chainId:1350216234,url:"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Ronin Saigon Testnet",chainId:2021,url:"https://saigon-app.roninchain.com/address/ronin:ca11bde05977b3631167028862be2a173976ca11?t=contract"},{name:"Ronin Mainnet",chainId:2020,url:"https://app.roninchain.com/address/ronin:ca11bde05977b3631167028862be2a173976ca11"},{name:"Qitmeer Testnet",chainId:8131,url:"https://testnet-qng.qitmeer.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Qitmeer QNG Mainnet",chainId:813,url:"https://qng.meerscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Q Testnet",chainId:35443,url:"https://explorer.qtestnet.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Q Devnet",chainId:35442,url:"https://explorer.qdevnet.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Q Mainnet",chainId:35441,url:"https://explorer.q.org/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Neon Mainnet",chainId:245022934,url:"https://neonscan.org/address/0xca11bde05977b3631167028862be2a173976ca11#contract"},{name:"LUKSO Testnet",chainId:4201,url:"https://explorer.execution.testnet.lukso.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"LUKSO Mainnet",chainId:42,url:"https://explorer.execution.mainnet.lukso.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Edgeware EdgeEVM",chainId:2021,url:"https://edgscan.live/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts"},{name:"Meter Testnet",chainId:83,url:"https://scan-warringstakes.meter.io/address/0xca11bde05977b3631167028862be2a173976ca11?tab=0&p=1"},{name:"Meter",chainId:82,url:"https://scan.meter.io/address/0xca11bde05977b3631167028862be2a173976ca11?tab=0&p=1"},{name:"Sepolia PGN (Public Goods Network) Testnet",chainId:58008,url:"https://explorer.sepolia.publicgoods.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"PGN (Public Goods Network)",chainId:424,url:"https://explorer.publicgoods.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"ShimmerEVM",chainId:148,url:"https://explorer.evm.shimmer.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Highbury EVM",chainId:710,url:"https://explorer.furya.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Arthera Testnet",chainId:10243,url:"https://explorer-test.arthera.net/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Arthera Mainnet",chainId:10242,url:"https://explorer.arthera.net/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Manta Pacific Mainnet",chainId:169,url:"https://pacific-explorer.manta.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Jolnir (Taiko Testnet)",chainId:167007,url:"https://explorer.jolnir.taiko.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Katla (Taiko A6 Testnet)",chainId:167008,url:"https://explorer.katla.taiko.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Filecoin Mainnet",chainId:314,url:"https://filfox.info/en/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Filecoin Calibration Testnet",chainId:314159,url:"https://calibration.filscan.io/en/tx/0xdbfa261cd7d17bb40479a0493ad6c0fee435859e37aae73aa7e803f3122cc465/"},{name:"Fusion",chainId:32659,url:"https://fsnscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Fusion Testnet",chainId:46688,url:"https://testnet.fsnscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#contract"},{name:"Xai Testnet",chainId:47279324479,url:"https://testnet-explorer.xai-chain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"JFIN Chain",chainId:3501,url:"https://jfinscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"JFIN Chain Testnet",chainId:3502,url:"https://testnet.jfinscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Chiliz Chain",chainId:88888,url:"https://scan.chiliz.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Chiliz Spicy Testnet",chainId:88882,url:"https://testnet.chiliscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11/contract/88882/code"},{name:"CORE",chainId:1116,url:"https://scan.coredao.org/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Core Testnet",chainId:1115,url:"https://scan.test.btcs.network/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Ethereum Classic",chainId:61,url:"https://etc.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Frame Testnet",chainId:68840142,url:"https://explorer.testnet.frame.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Etherlink Mainnet",chainId:42793,url:"https://explorer.etherlink.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Etherlink Testnet",chainId:128123,url:"https://testnet-explorer.etherlink.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"ZetaChain Athens 3 Testnet",chainId:7001,url:"https://explorer.zetachain.com/address/0xca11bde05977b3631167028862be2a173976ca11"},{name:"ZetaChain ",chainId:7e3,url:"https://explorer.zetachain.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"X1 Testnet",chainId:195,url:"https://www.oklink.com/x1-test/address/0xca11bde05977b3631167028862be2a173976ca11/contract"},{name:"Lumiterra Layer3",chainId:94168,url:"https://scan.layerlumi.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"BitTorrent Chain Mainnet",chainId:199,url:"https://bttcscan.com/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"BTT Chain Testnet",chainId:1029,url:"https://testnet.bttcscan.com/address/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Callisto Mainnet",chainId:820,url:"https://explorer.callisto.network/address/0xcA11bde05977b3631167028862bE2a173976CA11/transactions"},{name:"Areon Network Testnet",chainId:462,url:"https://areonscan.com/contracts/0xca11bde05977b3631167028862be2a173976ca11?page=0"},{name:"Areon Network Mainnet",chainId:463,url:"https://areonscan.com/contracts/0xca11bde05977b3631167028862be2a173976ca11"},{name:"zkFair Mainnet",chainId:42766,url:"https://scan.zkfair.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"Mode Mainnet",chainId:34443,url:"https://explorer.mode.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Blast Sepolia",chainId:168587773,url:"https://testnet.blastscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11/contract/168587773/code"},{name:"Blast",chainId:81457,url:"https://blastscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Xai",chainId:660279,url:"https://explorer.xai-chain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11/contracts#address-tabs"},{name:"DOS Chain",chainId:7979,url:"https://doscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"DOS Chain Testnet",chainId:3939,url:"https://test.doscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Tron",chainId:728126428,url:"https://tronscan.org/#/contract/TEazPvZwDjDtFeJupyo7QunvnrnUjPH8ED/code",address:"TEazPvZwDjDtFeJupyo7QunvnrnUjPH8ED"},{name:"zkSync Era",chainId:324,url:"https://explorer.zksync.io/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"zkSync Era Goerli Testnet",chainId:280,url:"https://goerli.explorer.zksync.io/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"zkSync Era Sepolia Testnet",chainId:300,url:"https://sepolia.explorer.zksync.io/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"PlayFi Albireo Testnet",chainId:1612127,url:"https://albireo-explorer.playfi.ai/address/0xF9cda624FBC7e059355ce98a31693d299FACd963#contract",address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},{name:"Fraxtal Mainnet",chainId:252,url:"https://fraxscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Fraxtal Holesky Testnet",chainId:2522,url:"https://holesky.fraxscan.com/address/0xcA11bde05977b3631167028862bE2a173976CA11#code"},{name:"Omax Mainnet",chainId:311,url:"https://omaxray.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Syndicate Frame Chain",chainId:5101,url:"https://explorer-frame.syndicate.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Dela Sepolia",chainId:9393,url:"https://sepolia-delascan.deperp.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"NeoX Testnet",chainId:12227330,url:"https://xt2scan.ngd.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Sanko Testnet",chainId:1992,url:"https://testnet.sankoscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Berachain Testnet (Artio)",chainId:80085,url:"https://artio.beratrail.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Shibarium",chainId:109,url:"https://www.shibariumscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Immutable zkEVM Mainnet",chainId:13371,url:"https://explorer.immutable.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Immutable zkEVM Testnet",chainId:13473,url:"https://explorer.testnet.immutable.com/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"RSS3 VSL Mainnet",chainId:12553,url:"https://scan.rss3.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"RSS3 VSL Sepolia Testnet",chainId:2331,url:"https://scan.testnet.rss3.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Morph Sepolia Testnet",chainId:2710,url:"https://explorer-testnet.morphl2.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"JIBCHAIN L1",chainId:8899,url:"https://exp-l1.jibchain.net/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Haqq Mainnet",chainId:11235,url:"https://explorer.haqq.network/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Zircuit Sepolia Testnet",chainId:48899,url:"https://explorer.zircuit.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?activeTab=3"},{name:"re.al",chainId:111188,url:"https://explorer.re.al/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Merlin Testnet",chainId:686868,url:"https://testnet-scan.merlinchain.io/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"IOTA EVM",chainId:8822,url:"https://iota-evm.blockscout.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Planq",chainId:7070,url:"https://evm.planq.network/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Cyber Testnet",chainId:111557560,url:"https://testnet.cyberscan.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Unit Zero Stagenet",chainId:88819,url:"https://explorer-stagenet.unit0.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Unit Zero Testnet",chainId:88817,url:"https://explorer-testnet.unit0.dev/address/0xcA11bde05977b3631167028862bE2a173976CA11"},{name:"Sei EVM Devnet",chainId:713715,url:"https://seitrace.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Sei EVM Mainnet",chainId:1329,url:"https://seitrace.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?chain=pacific-1&tab=contract"},{name:"Hekla (Taiko A7 Testnet)",chainId:167009,url:"https://explorer.hekla.taiko.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Taiko Mainnet",chainId:167e3,url:"https://taikoscan.io/address/0xca11bde05977b3631167028862be2a173976ca11#code"},{name:"Cyber Mainnet",chainId:7560,url:"https://cyberscan.co/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"DreyerX Mainnet",chainId:23451,url:"https://scan.dreyerx.com/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Sahara Testnet",chainId:313313,url:"https://explorer.saharaa.info/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"BOX Chain",chainId:42299,url:"https://explorerl2new-boxchain-t4zoh9y5dr.t.conduit.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"OX Chain",chainId:6699,url:"https://explorer-ox-chain-2s86s7wp21.t.conduit.xyz/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Conflux Espace",chainId:1030,url:"https://evm.confluxscan.net/address/0xca11bde05977b3631167028862be2a173976ca11?tab=contract-viewer"},{name:"BEVM Testnet",chainId:11503,url:"https://scan-testnet.bevm.io/address/0xcA11bde05977b3631167028862bE2a173976CA11?tab=contract"},{name:"Aura Mainnet",chainId:6322,url:"https://aurascan.io/evm-contracts/0xca11bde05977b3631167028862be2a173976ca11"},{name:"Superposition Testnet",chainId:98985,url:"https://testnet-explorer.superposition.so/address/0xcA11bde05977b3631167028862bE2a173976CA11"}],jde=Object.fromEntries(Ude.map(r=>{let e=r.url.indexOf("0x"),t=e>-1?r.url.slice(e,e+42):"0x"+r.url.slice(-40);return[r.chainId.toString(),t]})),uF=new Es(Bde);function dF(r){return uF.encodeFunctionData("aggregate",[r])}function fF(r){return uF.decodeFunctionResult("aggregate",r).toObject()}function hF(r){return jde[r]}import("node:process").then(r=>r.stdout.write(""));var{process_binding_count:zde,process_binding_time:Hde,process_binding_error:Gde}=to;BigInt.prototype.toJSON=function(){return this.toString()};var pF=class{started=!1;unhandled;loader;shutdownHandler;enablePreprocess;preparedData;enablePartition;constructor(e,t,n){this.loader=e,this.shutdownHandler=n,this.enablePreprocess=process.env.ENABLE_PREPROCESS?process.env.ENABLE_PREPROCESS.toLowerCase()=="true":!1,this.enablePartition=t?.enablePartition==!0}async getConfig(e,t){if(!this.started)throw new Mt.ServerError(Mt.Status.UNAVAILABLE,"Service Not started.");let n=Ow.fromPartial({});return await di.INSTANCE.configure(n),n}async start(e,t){if(this.started)return{};sk();try{await this.loader()}catch(n){throw new Mt.ServerError(Mt.Status.INVALID_ARGUMENT,"Failed to load processor: "+jc(n))}return await di.INSTANCE.start(e),this.started=!0,{}}async stop(e,t){return console.log("Server Shutting down in 5 seconds"),this.shutdownHandler&&setTimeout(this.shutdownHandler,5e3),{}}async processBindings(e,t){let n=this.enablePreprocess?await this.preprocessBindings(e.bindings,{},void 0,t):{ethCallResults:{}},i=[];for(let a of e.bindings){let c=this.processBinding(a,n);_a.execution.sequential&&await c,i.push(c)}let s;try{s=await Promise.all(i),to.process_binding_count.add(e.bindings.length)}catch(a){throw to.process_binding_error.add(e.bindings.length),a}return{result:kw(s)}}async preprocessBindings(e,t,n,i){let s=[];for(let m of e)s.push(this.preprocessBinding(m,t,n,i));let o;try{o=await Promise.all(s)}catch(m){throw m}let a=new Map,c=new Map;for(let m of o)for(let p of m.ethCallParams){let{chainId:y,blockTag:b}=p.context;c.has(y)||c.set(y,tF(y));let E=[y,b].join("|");a.has(E)||a.set(E,[]),a.get(E).push(p)}let l=Date.now(),u=1,d=[],f=[];for(let m of a.values()){let{chainId:p,blockTag:y}=m[0].context,b=hF(p);if(m.length<=u||!b){for(let x of m)d.push(c.get(p).call({to:x.context.address,data:x.calldata,blockTag:y}).then(S=>[iy(x),S]));continue}let E=128;for(let x=0;x<m.length;x+=E){let S=m.slice(x,x+E),M=S.map(B=>({target:B.context.address,callData:B.calldata})),I=dF(M);f.push(c.get(p).call({to:b,data:I,blockTag:y}).then(B=>{let z=fF(B).returnData;if(z.length!=S.length)throw new Error(`multicall result length mismatch, params: ${S.length}, result: ${z.length}`);let L=[];for(let q=0;q<S.length;q++)L.push([iy(S[q]),z[q]]);return L}))}}let h={};try{h=Object.fromEntries(await Promise.all(d));for(let m of await Promise.all(f))h={...h,...Object.fromEntries(m)}}catch(m){console.error(`eth call error: ${m}`)}return{ethCallResults:h}}async preprocessBinding(e,t,n,i){if(!this.started)throw new Mt.ServerError(Mt.Status.UNAVAILABLE,"Service Not started.");if(this.unhandled)throw new qc.RichServerError(Mt.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+jc(this.unhandled),[qc.DebugInfo.fromPartial({detail:this.unhandled.message,stackEntries:this.unhandled.stack?.split(`
|
33
|
+
`)})]);return await di.INSTANCE.preprocessBinding(e,t,n)}async processBinding(e,t,n){if(!this.started)throw new Mt.ServerError(Mt.Status.UNAVAILABLE,"Service Not started.");if(this.unhandled)throw new qc.RichServerError(Mt.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+jc(this.unhandled),[qc.DebugInfo.fromPartial({detail:this.unhandled.message,stackEntries:this.unhandled.stack?.split(`
|
34
|
+
`)})]);let i=await di.INSTANCE.processBinding(e,t,di.INSTANCE.dbContextLocalStorage.getStore());return mF(i,e.handlerType),i}async*processBindingsStream(e,t){if(!this.started)throw new Mt.ServerError(Mt.Status.UNAVAILABLE,"Service Not started.");let n=new Tw.Subject;this.handleRequests(e,n).then(()=>{this.preparedData&&(this.preparedData={ethCallResults:{}}),n.complete()}).catch(i=>{console.error(i),n.error(i)}),yield*ey(n).pipe(Sw(t.signal))}async handlePreprocessRequests(e,t){let n=new ty,i={};for await(let s of e)try{if(s.bindings){let o=s.bindings.bindings,a=n.new(s.processId,t),c=Date.now();this.preprocessBindings(o,i,a,void 0).then(l=>{this.preparedData={ethCallResults:{...this.preparedData?.ethCallResults,...l.ethCallResults}},t.next({processId:s.processId})}).catch(l=>{console.debug(l),a.error(s.processId,l)}).finally(()=>{let l=Date.now()-c;console.debug("preprocessBinding",s.processId," took",l,"ms"),n.delete(s.processId)})}s.dbResult&&n.get(s.processId)?.result(s.dbResult)}catch(o){console.error("unexpect error during handle loop",o)}}async*preprocessBindingsStream(e,t){if(!this.started)throw new Mt.ServerError(Mt.Status.UNAVAILABLE,"Service Not started.");let n=new Tw.Subject;this.handlePreprocessRequests(e,n).then(()=>{n.complete()}).catch(i=>{console.error(i),n.error(i)}),yield*ey(n).pipe(Sw(t.signal))}dbContexts=new ty;async handleRequests(e,t){let n;for await(let i of e)try{i.binding&&(n=i.binding),this.handleRequest(i,n,t)}catch(s){console.error("unexpect error during handle loop",s)}}async handleRequest(e,t,n){if(e.binding){if(zde.add(1),e.binding.handlerType===xw.UNKNOWN){n.next({processId:e.processId,result:Xu.create()});return}if(this.enablePartition)try{let i=await di.INSTANCE.partition(e.binding);n.next({processId:e.processId,partitions:i})}catch(i){console.error("Partition error:",i),n.error(new Error("Partition error: "+jc(i)));return}else this.startProcess(e.processId,e.binding,n)}if(e.start){if(!t){console.error("start request received without binding"),n.error(new Error("start request received without binding"));return}this.startProcess(e.processId,t,n)}if(e.dbResult){let i=this.dbContexts.get(e.processId);try{i?.result(e.dbResult)}catch{n.error(new Error("db result error, process should stop"))}}}startProcess(e,t,n){let i=this.dbContexts.new(e,n),s=Date.now();di.INSTANCE.processBinding(t,this.preparedData,i).then(async o=>{await i.awaitPendings(),n.next({result:o,processId:e}),mF(o,t.handlerType)}).catch(o=>{console.error(o,o.stack),i.error(e,o),Gde.add(1)}).finally(()=>{let o=Date.now()-s;Hde.add(o),this.dbContexts.delete(e)})}};function mF(r,e){for(let t of[r.gauges,r.counters,r.events,r.exports])t.forEach(n=>{n.runtimeInfo={from:e}})}var ty=class{contexts=new Map;get(e){return this.contexts.get(e)}new(e,t){let n=new wa(t,e);return this.contexts.set(e,n),n}delete(e){this.get(e)?.close(),this.contexts.delete(e)}};import("node:process").then(r=>r.stdout.write(""));export{kw as a,SF as b,jc as c,Kde as d,iy as e,Jde as f,Qde as g,TT as h,ir as i,Rfe as j,jt as k,Ri as l,Ni as m,Mi as n,RP as o,ik as p,ey as q,Sw as r,_a as s,sk as t,ak as u,ck as v,to as w,lk as x,mk as y,Ah as z,wa as A,gk as B,HM as C,Ku as D,wTe as E,tF as F,gw as G,pF as H,mF as I};
|
35
|
+
/*! Bundled license information:
|
36
|
+
|
37
|
+
@grpc/proto-loader/build/src/util.js:
|
38
|
+
(**
|
39
|
+
* @license
|
40
|
+
* Copyright 2018 gRPC authors.
|
41
|
+
*
|
42
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
43
|
+
* you may not use this file except in compliance with the License.
|
44
|
+
* You may obtain a copy of the License at
|
45
|
+
*
|
46
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
47
|
+
*
|
48
|
+
* Unless required by applicable law or agreed to in writing, software
|
49
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
50
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
51
|
+
* See the License for the specific language governing permissions and
|
52
|
+
* limitations under the License.
|
53
|
+
*
|
54
|
+
*)
|
55
|
+
|
56
|
+
long/umd/index.js:
|
57
|
+
(**
|
58
|
+
* @license
|
59
|
+
* Copyright 2009 The Closure Library Authors
|
60
|
+
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
61
|
+
*
|
62
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
63
|
+
* you may not use this file except in compliance with the License.
|
64
|
+
* You may obtain a copy of the License at
|
65
|
+
*
|
66
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
67
|
+
*
|
68
|
+
* Unless required by applicable law or agreed to in writing, software
|
69
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
70
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
71
|
+
* See the License for the specific language governing permissions and
|
72
|
+
* limitations under the License.
|
73
|
+
*
|
74
|
+
* SPDX-License-Identifier: Apache-2.0
|
75
|
+
*)
|
76
|
+
|
77
|
+
@grpc/proto-loader/build/src/index.js:
|
78
|
+
(**
|
79
|
+
* @license
|
80
|
+
* Copyright 2018 gRPC authors.
|
81
|
+
*
|
82
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
83
|
+
* you may not use this file except in compliance with the License.
|
84
|
+
* You may obtain a copy of the License at
|
85
|
+
*
|
86
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
87
|
+
*
|
88
|
+
* Unless required by applicable law or agreed to in writing, software
|
89
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
90
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
91
|
+
* See the License for the specific language governing permissions and
|
92
|
+
* limitations under the License.
|
93
|
+
*
|
94
|
+
*)
|
95
|
+
|
96
|
+
@noble/hashes/esm/utils.js:
|
97
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
98
|
+
|
99
|
+
@noble/curves/esm/abstract/utils.js:
|
100
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
101
|
+
|
102
|
+
@noble/curves/esm/abstract/modular.js:
|
103
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
104
|
+
|
105
|
+
@noble/curves/esm/abstract/curve.js:
|
106
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
107
|
+
|
108
|
+
@noble/curves/esm/abstract/weierstrass.js:
|
109
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
110
|
+
|
111
|
+
@noble/curves/esm/_shortw_utils.js:
|
112
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
113
|
+
|
114
|
+
@noble/curves/esm/secp256k1.js:
|
115
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
116
|
+
*/
|
117
|
+
//# sourceMappingURL=chunk-XSQNZQCD.js.map
|