opnet
Version:
The perfect library for building Bitcoin-based applications.
610 lines (603 loc) • 32.3 kB
JavaScript
import { g as getDefaultExportFromCjs } from './noble-curves.js';
var protobuf_min = {exports: {}};
/*!
* protobuf.js v8.0.0 (c) 2016, daniel wirtz
* compiled tue, 16 dec 2025 22:00:06 utc
* licensed under the bsd-3-clause license
* see: https://github.com/dcodeio/protobuf.js for details
*/
var hasRequiredProtobuf_min;
function requireProtobuf_min () {
if (hasRequiredProtobuf_min) return protobuf_min.exports;
hasRequiredProtobuf_min = 1;
(function (module) {
!(function(d) {
!(function(r2, u, t2) {
var n2 = (function t3(n3) {
var i2 = u[n3];
return i2 || r2[n3][0].call(i2 = u[n3] = { exports: {} }, t3, i2, i2.exports), i2.exports;
})(t2[0]);
n2.util.global.protobuf = n2, module && module.exports && (module.exports = n2);
})({ 1: [function(t2, n2, i2) {
n2.exports = function(t3, n3) {
var i3 = Array(arguments.length - 1), e = 0, r2 = 2, s = true;
for (; r2 < arguments.length; ) i3[e++] = arguments[r2++];
return new Promise(function(r3, u) {
i3[e] = function(t4) {
if (s) if (s = false, t4) u(t4);
else {
for (var n4 = Array(arguments.length - 1), i4 = 0; i4 < n4.length; ) n4[i4++] = arguments[i4];
r3.apply(null, n4);
}
};
try {
t3.apply(n3 || null, i3);
} catch (t4) {
s && (s = false, u(t4));
}
});
};
}, {}], 2: [function(t2, n2, i2) {
i2.length = function(t3) {
var n3 = t3.length;
if (!n3) return 0;
for (var i3 = 0; 1 < --n3 % 4 && "=" == (t3[0 | n3] || ""); ) ++i3;
return Math.ceil(3 * t3.length) / 4 - i3;
};
for (var f = Array(64), o = Array(123), r2 = 0; r2 < 64; ) o[f[r2] = r2 < 26 ? r2 + 65 : r2 < 52 ? r2 + 71 : r2 < 62 ? r2 - 4 : r2 - 59 | 43] = r2++;
i2.encode = function(t3, n3, i3) {
for (var r3, u = null, e = [], s = 0, h = 0; n3 < i3; ) {
var o2 = t3[n3++];
switch (h) {
case 0:
e[s++] = f[o2 >> 2], r3 = (3 & o2) << 4, h = 1;
break;
case 1:
e[s++] = f[r3 | o2 >> 4], r3 = (15 & o2) << 2, h = 2;
break;
case 2:
e[s++] = f[r3 | o2 >> 6], e[s++] = f[63 & o2], h = 0;
}
8191 < s && ((u = u || []).push(String.fromCharCode.apply(String, e)), s = 0);
}
return h && (e[s++] = f[r3], e[s++] = 61, 1 === h && (e[s++] = 61)), u ? (s && u.push(String.fromCharCode.apply(String, e.slice(0, s))), u.join("")) : String.fromCharCode.apply(String, e.slice(0, s));
};
var c = "invalid encoding";
i2.decode = function(t3, n3, i3) {
for (var r3, u = i3, e = 0, s = 0; s < t3.length; ) {
var h = t3.charCodeAt(s++);
if (61 == h && 1 < e) break;
if ((h = o[h]) === d) throw Error(c);
switch (e) {
case 0:
r3 = h, e = 1;
break;
case 1:
n3[i3++] = r3 << 2 | (48 & h) >> 4, r3 = h, e = 2;
break;
case 2:
n3[i3++] = (15 & r3) << 4 | (60 & h) >> 2, r3 = h, e = 3;
break;
case 3:
n3[i3++] = (3 & r3) << 6 | h, e = 0;
}
}
if (1 === e) throw Error(c);
return i3 - u;
}, i2.test = function(t3) {
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t3);
};
}, {}], 3: [function(t2, n2, i2) {
function r2() {
this.t = {};
}
(n2.exports = r2).prototype.on = function(t3, n3, i3) {
return (this.t[t3] || (this.t[t3] = [])).push({ fn: n3, ctx: i3 || this }), this;
}, r2.prototype.off = function(t3, n3) {
if (t3 === d) this.t = {};
else if (n3 === d) this.t[t3] = [];
else for (var i3 = this.t[t3], r3 = 0; r3 < i3.length; ) i3[r3].fn === n3 ? i3.splice(r3, 1) : ++r3;
return this;
}, r2.prototype.emit = function(t3) {
var n3 = this.t[t3];
if (n3) {
for (var i3 = [], r3 = 1; r3 < arguments.length; ) i3.push(arguments[r3++]);
for (r3 = 0; r3 < n3.length; ) n3[r3].fn.apply(n3[r3++].ctx, i3);
}
return this;
};
}, {}], 4: [function(t2, n2, i2) {
function r2(t3) {
function n3(t4, n4, i4, r4) {
var u2 = n4 < 0 ? 1 : 0;
t4(0 === (n4 = u2 ? -n4 : n4) ? 0 < 1 / n4 ? 0 : 2147483648 : isNaN(n4) ? 2143289344 : 34028234663852886e22 < n4 ? (u2 << 31 | 2139095040) >>> 0 : n4 < 11754943508222875e-54 ? (u2 << 31 | Math.round(n4 / 1401298464324817e-60)) >>> 0 : (u2 << 31 | 127 + (t4 = Math.floor(Math.log(n4) / Math.LN2)) << 23 | 8388607 & Math.round(n4 * Math.pow(2, -t4) * 8388608)) >>> 0, i4, r4);
}
function i3(t4, n4, i4) {
t4 = t4(n4, i4), n4 = 2 * (t4 >> 31) + 1, i4 = t4 >>> 23 & 255, t4 &= 8388607;
return 255 == i4 ? t4 ? NaN : 1 / 0 * n4 : 0 == i4 ? 1401298464324817e-60 * n4 * t4 : n4 * Math.pow(2, i4 - 150) * (8388608 + t4);
}
function r3(t4, n4, i4) {
h[0] = t4, n4[i4] = o[0], n4[i4 + 1] = o[1], n4[i4 + 2] = o[2], n4[i4 + 3] = o[3];
}
function u(t4, n4, i4) {
h[0] = t4, n4[i4] = o[3], n4[i4 + 1] = o[2], n4[i4 + 2] = o[1], n4[i4 + 3] = o[0];
}
function e(t4, n4) {
return o[0] = t4[n4], o[1] = t4[n4 + 1], o[2] = t4[n4 + 2], o[3] = t4[n4 + 3], h[0];
}
function s(t4, n4) {
return o[3] = t4[n4], o[2] = t4[n4 + 1], o[1] = t4[n4 + 2], o[0] = t4[n4 + 3], h[0];
}
var h, o, f, c, a;
function l(t4, n4, i4, r4, u2, e2) {
var s2, h2 = r4 < 0 ? 1 : 0;
0 === (r4 = h2 ? -r4 : r4) ? (t4(0, u2, e2 + n4), t4(0 < 1 / r4 ? 0 : 2147483648, u2, e2 + i4)) : isNaN(r4) ? (t4(0, u2, e2 + n4), t4(2146959360, u2, e2 + i4)) : 17976931348623157e292 < r4 ? (t4(0, u2, e2 + n4), t4((h2 << 31 | 2146435072) >>> 0, u2, e2 + i4)) : r4 < 22250738585072014e-324 ? (t4((s2 = r4 / 5e-324) >>> 0, u2, e2 + n4), t4((h2 << 31 | s2 / 4294967296) >>> 0, u2, e2 + i4)) : (t4(4503599627370496 * (s2 = r4 * Math.pow(2, -(r4 = 1024 === (r4 = Math.floor(Math.log(r4) / Math.LN2)) ? 1023 : r4))) >>> 0, u2, e2 + n4), t4((h2 << 31 | r4 + 1023 << 20 | 1048576 * s2 & 1048575) >>> 0, u2, e2 + i4));
}
function v(t4, n4, i4, r4, u2) {
n4 = t4(r4, u2 + n4), t4 = t4(r4, u2 + i4), r4 = 2 * (t4 >> 31) + 1, u2 = t4 >>> 20 & 2047, i4 = 4294967296 * (1048575 & t4) + n4;
return 2047 == u2 ? i4 ? NaN : 1 / 0 * r4 : 0 == u2 ? 5e-324 * r4 * i4 : r4 * Math.pow(2, u2 - 1075) * (i4 + 4503599627370496);
}
function w(t4, n4, i4) {
f[0] = t4, n4[i4] = c[0], n4[i4 + 1] = c[1], n4[i4 + 2] = c[2], n4[i4 + 3] = c[3], n4[i4 + 4] = c[4], n4[i4 + 5] = c[5], n4[i4 + 6] = c[6], n4[i4 + 7] = c[7];
}
function b(t4, n4, i4) {
f[0] = t4, n4[i4] = c[7], n4[i4 + 1] = c[6], n4[i4 + 2] = c[5], n4[i4 + 3] = c[4], n4[i4 + 4] = c[3], n4[i4 + 5] = c[2], n4[i4 + 6] = c[1], n4[i4 + 7] = c[0];
}
function y(t4, n4) {
return c[0] = t4[n4], c[1] = t4[n4 + 1], c[2] = t4[n4 + 2], c[3] = t4[n4 + 3], c[4] = t4[n4 + 4], c[5] = t4[n4 + 5], c[6] = t4[n4 + 6], c[7] = t4[n4 + 7], f[0];
}
function g(t4, n4) {
return c[7] = t4[n4], c[6] = t4[n4 + 1], c[5] = t4[n4 + 2], c[4] = t4[n4 + 3], c[3] = t4[n4 + 4], c[2] = t4[n4 + 5], c[1] = t4[n4 + 6], c[0] = t4[n4 + 7], f[0];
}
return "undefined" != typeof Float32Array ? (h = new Float32Array([-0]), o = new Uint8Array(h.buffer), a = 128 === o[3], t3.writeFloatLE = a ? r3 : u, t3.writeFloatBE = a ? u : r3, t3.readFloatLE = a ? e : s, t3.readFloatBE = a ? s : e) : (t3.writeFloatLE = n3.bind(null, d2), t3.writeFloatBE = n3.bind(null, A), t3.readFloatLE = i3.bind(null, p), t3.readFloatBE = i3.bind(null, m)), "undefined" != typeof Float64Array ? (f = new Float64Array([-0]), c = new Uint8Array(f.buffer), a = 128 === c[7], t3.writeDoubleLE = a ? w : b, t3.writeDoubleBE = a ? b : w, t3.readDoubleLE = a ? y : g, t3.readDoubleBE = a ? g : y) : (t3.writeDoubleLE = l.bind(null, d2, 0, 4), t3.writeDoubleBE = l.bind(null, A, 4, 0), t3.readDoubleLE = v.bind(null, p, 0, 4), t3.readDoubleBE = v.bind(null, m, 4, 0)), t3;
}
function d2(t3, n3, i3) {
n3[i3] = 255 & t3, n3[i3 + 1] = t3 >>> 8 & 255, n3[i3 + 2] = t3 >>> 16 & 255, n3[i3 + 3] = t3 >>> 24;
}
function A(t3, n3, i3) {
n3[i3] = t3 >>> 24, n3[i3 + 1] = t3 >>> 16 & 255, n3[i3 + 2] = t3 >>> 8 & 255, n3[i3 + 3] = 255 & t3;
}
function p(t3, n3) {
return (t3[n3] | t3[n3 + 1] << 8 | t3[n3 + 2] << 16 | t3[n3 + 3] << 24) >>> 0;
}
function m(t3, n3) {
return (t3[n3] << 24 | t3[n3 + 1] << 16 | t3[n3 + 2] << 8 | t3[n3 + 3]) >>> 0;
}
n2.exports = r2(r2);
}, {}], 5: [function(t, n, i) {
function r(t) {
try {
var n = eval("require")(t);
if (n && (n.length || Object.keys(n).length)) return n;
} catch (t2) {
}
return null;
}
n.exports = r;
}, {}], 6: [function(t2, n2, i2) {
n2.exports = function(n3, i3, t3) {
var r2 = t3 || 8192, u = r2 >>> 1, e = null, s = r2;
return function(t4) {
if (t4 < 1 || u < t4) return n3(t4);
r2 < s + t4 && (e = n3(r2), s = 0);
t4 = i3.call(e, s, s += t4);
return 7 & s && (s = 1 + (7 | s)), t4;
};
};
}, {}], 7: [function(t2, n2, i2) {
i2.length = function(t3) {
for (var n3, i3 = 0, r2 = 0; r2 < t3.length; ++r2) (n3 = t3.charCodeAt(r2)) < 128 ? i3 += 1 : n3 < 2048 ? i3 += 2 : 55296 == (64512 & n3) && 56320 == (64512 & t3.charCodeAt(r2 + 1)) ? (++r2, i3 += 4) : i3 += 3;
return i3;
}, i2.read = function(t3, n3, i3) {
if (i3 - n3 < 1) return "";
for (var r2, u = null, e = [], s = 0; n3 < i3; ) (r2 = t3[n3++]) < 128 ? e[s++] = r2 : 191 < r2 && r2 < 224 ? e[s++] = (31 & r2) << 6 | 63 & t3[n3++] : 239 < r2 && r2 < 365 ? (r2 = ((7 & r2) << 18 | (63 & t3[n3++]) << 12 | (63 & t3[n3++]) << 6 | 63 & t3[n3++]) - 65536, e[s++] = 55296 + (r2 >> 10), e[s++] = 56320 + (1023 & r2)) : e[s++] = (15 & r2) << 12 | (63 & t3[n3++]) << 6 | 63 & t3[n3++], 8191 < s && ((u = u || []).push(String.fromCharCode.apply(String, e)), s = 0);
return u ? (s && u.push(String.fromCharCode.apply(String, e.slice(0, s))), u.join("")) : String.fromCharCode.apply(String, e.slice(0, s));
}, i2.write = function(t3, n3, i3) {
for (var r2, u, e = i3, s = 0; s < t3.length; ++s) (r2 = t3.charCodeAt(s)) < 128 ? n3[i3++] = r2 : (r2 < 2048 ? n3[i3++] = r2 >> 6 | 192 : (55296 == (64512 & r2) && 56320 == (64512 & (u = t3.charCodeAt(s + 1))) ? (++s, n3[i3++] = (r2 = 65536 + ((1023 & r2) << 10) + (1023 & u)) >> 18 | 240, n3[i3++] = r2 >> 12 & 63 | 128) : n3[i3++] = r2 >> 12 | 224, n3[i3++] = r2 >> 6 & 63 | 128), n3[i3++] = 63 & r2 | 128);
return i3 - e;
};
}, {}], 8: [function(t2, n2, i2) {
var r2 = i2;
function u() {
r2.util.n(), r2.Writer.n(r2.BufferWriter), r2.Reader.n(r2.BufferReader);
}
r2.build = "minimal", r2.Writer = t2(16), r2.BufferWriter = t2(17), r2.Reader = t2(9), r2.BufferReader = t2(10), r2.util = t2(15), r2.rpc = t2(12), r2.roots = t2(11), r2.configure = u, u();
}, { 10: 10, 11: 11, 12: 12, 15: 15, 16: 16, 17: 17, 9: 9 }], 9: [function(t2, n2, i2) {
n2.exports = o;
var r2, u = t2(15), e = u.LongBits, s = u.utf8;
function h(t3, n3) {
return RangeError("index out of range: " + t3.pos + " + " + (n3 || 1) + " > " + t3.len);
}
function o(t3) {
this.buf = t3, this.pos = 0, this.len = t3.length;
}
function f() {
return u.Buffer ? function(t3) {
return (o.create = function(t4) {
return u.Buffer.isBuffer(t4) ? new r2(t4) : a(t4);
})(t3);
} : a;
}
var c, a = "undefined" != typeof Uint8Array ? function(t3) {
if (t3 instanceof Uint8Array || Array.isArray(t3)) return new o(t3);
throw Error("illegal buffer");
} : function(t3) {
if (Array.isArray(t3)) return new o(t3);
throw Error("illegal buffer");
};
function l() {
var t3 = new e(0, 0), n3 = 0;
if (!(4 < this.len - this.pos)) {
for (; n3 < 3; ++n3) {
if (this.pos >= this.len) throw h(this);
if (t3.lo = (t3.lo | (127 & this.buf[this.pos]) << 7 * n3) >>> 0, this.buf[this.pos++] < 128) return t3;
}
return t3.lo = (t3.lo | (127 & this.buf[this.pos++]) << 7 * n3) >>> 0, t3;
}
for (; n3 < 4; ++n3) if (t3.lo = (t3.lo | (127 & this.buf[this.pos]) << 7 * n3) >>> 0, this.buf[this.pos++] < 128) return t3;
if (t3.lo = (t3.lo | (127 & this.buf[this.pos]) << 28) >>> 0, t3.hi = (t3.hi | (127 & this.buf[this.pos]) >> 4) >>> 0, this.buf[this.pos++] < 128) return t3;
if (n3 = 0, 4 < this.len - this.pos) {
for (; n3 < 5; ++n3) if (t3.hi = (t3.hi | (127 & this.buf[this.pos]) << 7 * n3 + 3) >>> 0, this.buf[this.pos++] < 128) return t3;
} else for (; n3 < 5; ++n3) {
if (this.pos >= this.len) throw h(this);
if (t3.hi = (t3.hi | (127 & this.buf[this.pos]) << 7 * n3 + 3) >>> 0, this.buf[this.pos++] < 128) return t3;
}
throw Error("invalid varint encoding");
}
function v(t3, n3) {
return (t3[n3 - 4] | t3[n3 - 3] << 8 | t3[n3 - 2] << 16 | t3[n3 - 1] << 24) >>> 0;
}
function w() {
if (this.pos + 8 > this.len) throw h(this, 8);
return new e(v(this.buf, this.pos += 4), v(this.buf, this.pos += 4));
}
o.create = f(), o.prototype.i = u.Array.prototype.subarray || u.Array.prototype.slice, o.prototype.uint32 = (c = 4294967295, function() {
if (c = (127 & this.buf[this.pos]) >>> 0, this.buf[this.pos++] < 128 || (c = (c | (127 & this.buf[this.pos]) << 7) >>> 0, this.buf[this.pos++] < 128 || (c = (c | (127 & this.buf[this.pos]) << 14) >>> 0, this.buf[this.pos++] < 128 || (c = (c | (127 & this.buf[this.pos]) << 21) >>> 0, this.buf[this.pos++] < 128 || (c = (c | (15 & this.buf[this.pos]) << 28) >>> 0, this.buf[this.pos++] < 128 || !((this.pos += 5) > this.len)))))) return c;
throw this.pos = this.len, h(this, 10);
}), o.prototype.int32 = function() {
return 0 | this.uint32();
}, o.prototype.sint32 = function() {
var t3 = this.uint32();
return t3 >>> 1 ^ -(1 & t3) | 0;
}, o.prototype.bool = function() {
return 0 !== this.uint32();
}, o.prototype.fixed32 = function() {
if (this.pos + 4 > this.len) throw h(this, 4);
return v(this.buf, this.pos += 4);
}, o.prototype.sfixed32 = function() {
if (this.pos + 4 > this.len) throw h(this, 4);
return 0 | v(this.buf, this.pos += 4);
}, o.prototype.float = function() {
if (this.pos + 4 > this.len) throw h(this, 4);
var t3 = u.float.readFloatLE(this.buf, this.pos);
return this.pos += 4, t3;
}, o.prototype.double = function() {
if (this.pos + 8 > this.len) throw h(this, 4);
var t3 = u.float.readDoubleLE(this.buf, this.pos);
return this.pos += 8, t3;
}, o.prototype.bytes = function() {
var t3 = this.uint32(), n3 = this.pos, i3 = this.pos + t3;
if (i3 > this.len) throw h(this, t3);
return this.pos += t3, Array.isArray(this.buf) ? this.buf.slice(n3, i3) : n3 === i3 ? (t3 = u.Buffer) ? t3.alloc(0) : new this.buf.constructor(0) : this.i.call(this.buf, n3, i3);
}, o.prototype.string = function() {
var t3 = this.bytes();
return s.read(t3, 0, t3.length);
}, o.prototype.skip = function(t3) {
if ("number" == typeof t3) {
if (this.pos + t3 > this.len) throw h(this, t3);
this.pos += t3;
} else do {
if (this.pos >= this.len) throw h(this);
} while (128 & this.buf[this.pos++]);
return this;
}, o.prototype.skipType = function(t3) {
switch (t3) {
case 0:
this.skip();
break;
case 1:
this.skip(8);
break;
case 2:
this.skip(this.uint32());
break;
case 3:
for (; 4 != (t3 = 7 & this.uint32()); ) this.skipType(t3);
break;
case 5:
this.skip(4);
break;
default:
throw Error("invalid wire type " + t3 + " at offset " + this.pos);
}
return this;
}, o.n = function(t3) {
r2 = t3, o.create = f(), r2.n();
var n3 = u.Long ? "toLong" : "toNumber";
u.merge(o.prototype, { int64: function() {
return l.call(this)[n3](false);
}, uint64: function() {
return l.call(this)[n3](true);
}, sint64: function() {
return l.call(this).zzDecode()[n3](false);
}, fixed64: function() {
return w.call(this)[n3](true);
}, sfixed64: function() {
return w.call(this)[n3](false);
} });
};
}, { 15: 15 }], 10: [function(t2, n2, i2) {
n2.exports = e;
var r2 = t2(9), u = ((e.prototype = Object.create(r2.prototype)).constructor = e, t2(15));
function e(t3) {
r2.call(this, t3);
}
e.n = function() {
u.Buffer && (e.prototype.i = u.Buffer.prototype.slice);
}, e.prototype.string = function() {
var t3 = this.uint32();
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + t3, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + t3, this.len));
}, e.n();
}, { 15: 15, 9: 9 }], 11: [function(t2, n2, i2) {
n2.exports = {};
}, {}], 12: [function(t2, n2, i2) {
i2.Service = t2(13);
}, { 13: 13 }], 13: [function(t2, n2, i2) {
n2.exports = r2;
var h = t2(15);
function r2(t3, n3, i3) {
if ("function" != typeof t3) throw TypeError("rpcImpl must be a function");
h.EventEmitter.call(this), this.rpcImpl = t3, this.requestDelimited = !!n3, this.responseDelimited = !!i3;
}
((r2.prototype = Object.create(h.EventEmitter.prototype)).constructor = r2).prototype.rpcCall = function t3(i3, n3, r3, u, e) {
if (!u) throw TypeError("request must be specified");
var s = this;
if (!e) return h.asPromise(t3, s, i3, n3, r3, u);
if (!s.rpcImpl) return setTimeout(function() {
e(Error("already ended"));
}, 0), d;
try {
return s.rpcImpl(i3, n3[s.requestDelimited ? "encodeDelimited" : "encode"](u).finish(), function(t4, n4) {
if (t4) return s.emit("error", t4, i3), e(t4);
if (null === n4) return s.end(true), d;
if (!(n4 instanceof r3)) try {
n4 = r3[s.responseDelimited ? "decodeDelimited" : "decode"](n4);
} catch (t5) {
return s.emit("error", t5, i3), e(t5);
}
return s.emit("data", n4, i3), e(null, n4);
});
} catch (t4) {
return s.emit("error", t4, i3), setTimeout(function() {
e(t4);
}, 0), d;
}
}, r2.prototype.end = function(t3) {
return this.rpcImpl && (t3 || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
};
}, { 15: 15 }], 14: [function(t2, n2, i2) {
n2.exports = u;
var r2 = t2(15);
function u(t3, n3) {
this.lo = t3 >>> 0, this.hi = n3 >>> 0;
}
var e = u.zero = new u(0, 0), s = (e.toNumber = function() {
return 0;
}, e.zzEncode = e.zzDecode = function() {
return this;
}, e.length = function() {
return 1;
}, u.zeroHash = "\0\0\0\0\0\0\0\0", u.fromNumber = function(t3) {
var n3, i3;
return 0 === t3 ? e : (i3 = (t3 = (n3 = t3 < 0) ? -t3 : t3) >>> 0, t3 = (t3 - i3) / 4294967296 >>> 0, n3 && (t3 = ~t3 >>> 0, i3 = ~i3 >>> 0, 4294967295 < ++i3 && (i3 = 0, 4294967295 < ++t3 && (t3 = 0))), new u(i3, t3));
}, u.from = function(t3) {
if ("number" == typeof t3) return u.fromNumber(t3);
if (r2.isString(t3)) {
if (!r2.Long) return u.fromNumber(parseInt(t3, 10));
t3 = r2.Long.fromString(t3);
}
return t3.low || t3.high ? new u(t3.low >>> 0, t3.high >>> 0) : e;
}, u.prototype.toNumber = function(t3) {
var n3;
return !t3 && this.hi >>> 31 ? (t3 = 1 + ~this.lo >>> 0, n3 = ~this.hi >>> 0, -(t3 + 4294967296 * (n3 = t3 ? n3 : n3 + 1 >>> 0))) : this.lo + 4294967296 * this.hi;
}, u.prototype.toLong = function(t3) {
return r2.Long ? new r2.Long(0 | this.lo, 0 | this.hi, !!t3) : { low: 0 | this.lo, high: 0 | this.hi, unsigned: !!t3 };
}, String.prototype.charCodeAt);
u.fromHash = function(t3) {
return "\0\0\0\0\0\0\0\0" === t3 ? e : new u((s.call(t3, 0) | s.call(t3, 1) << 8 | s.call(t3, 2) << 16 | s.call(t3, 3) << 24) >>> 0, (s.call(t3, 4) | s.call(t3, 5) << 8 | s.call(t3, 6) << 16 | s.call(t3, 7) << 24) >>> 0);
}, u.prototype.toHash = function() {
return String.fromCharCode(255 & this.lo, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, 255 & this.hi, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24);
}, u.prototype.zzEncode = function() {
var t3 = this.hi >> 31;
return this.hi = ((this.hi << 1 | this.lo >>> 31) ^ t3) >>> 0, this.lo = (this.lo << 1 ^ t3) >>> 0, this;
}, u.prototype.zzDecode = function() {
var t3 = -(1 & this.lo);
return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ t3) >>> 0, this.hi = (this.hi >>> 1 ^ t3) >>> 0, this;
}, u.prototype.length = function() {
var t3 = this.lo, n3 = (this.lo >>> 28 | this.hi << 4) >>> 0, i3 = this.hi >>> 24;
return 0 == i3 ? 0 == n3 ? t3 < 16384 ? t3 < 128 ? 1 : 2 : t3 < 2097152 ? 3 : 4 : n3 < 16384 ? n3 < 128 ? 5 : 6 : n3 < 2097152 ? 7 : 8 : i3 < 128 ? 9 : 10;
};
}, { 15: 15 }], 15: [function(t2, n2, i2) {
var r2 = i2;
function u(t3, n3, i3) {
for (var r3 = Object.keys(n3), u2 = 0; u2 < r3.length; ++u2) t3[r3[u2]] !== d && i3 || (t3[r3[u2]] = n3[r3[u2]]);
return t3;
}
function e(t3) {
function i3(t4, n3) {
if (!(this instanceof i3)) return new i3(t4, n3);
Object.defineProperty(this, "message", { get: function() {
return t4;
} }), Error.captureStackTrace ? Error.captureStackTrace(this, i3) : Object.defineProperty(this, "stack", { value: Error().stack || "" }), n3 && u(this, n3);
}
return i3.prototype = Object.create(Error.prototype, { constructor: { value: i3, writable: true, enumerable: false, configurable: true }, name: { get: function() {
return t3;
}, set: d, enumerable: false, configurable: true }, toString: { value: function() {
return this.name + ": " + this.message;
}, writable: true, enumerable: false, configurable: true } }), i3;
}
r2.asPromise = t2(1), r2.base64 = t2(2), r2.EventEmitter = t2(3), r2.float = t2(4), r2.inquire = t2(5), r2.utf8 = t2(7), r2.pool = t2(6), r2.LongBits = t2(14), r2.isNode = !!("undefined" != typeof globalThis && globalThis && globalThis.process && globalThis.process.versions && globalThis.process.versions.node), r2.global = r2.isNode && globalThis || "undefined" != typeof window && window || "undefined" != typeof self && self || this, r2.emptyArray = Object.freeze ? Object.freeze([]) : [], r2.emptyObject = Object.freeze ? Object.freeze({}) : {}, r2.isInteger = Number.isInteger || function(t3) {
return "number" == typeof t3 && isFinite(t3) && Math.floor(t3) === t3;
}, r2.isString = function(t3) {
return "string" == typeof t3 || t3 instanceof String;
}, r2.isObject = function(t3) {
return t3 && "object" == typeof t3;
}, r2.isset = r2.isSet = function(t3, n3) {
var i3 = t3[n3];
return null != i3 && t3.hasOwnProperty(n3) && ("object" != typeof i3 || 0 < (Array.isArray(i3) ? i3 : Object.keys(i3)).length);
}, r2.Buffer = (function() {
try {
var t3 = r2.inquire("buffer").Buffer;
return t3.prototype.utf8Write ? t3 : null;
} catch (t4) {
return null;
}
})(), r2.r = null, r2.u = null, r2.newBuffer = function(t3) {
return "number" == typeof t3 ? r2.Buffer ? r2.u(t3) : new r2.Array(t3) : r2.Buffer ? r2.r(t3) : "undefined" == typeof Uint8Array ? t3 : new Uint8Array(t3);
}, r2.Array = "undefined" != typeof Uint8Array ? Uint8Array : Array, r2.Long = r2.global.dcodeIO && r2.global.dcodeIO.Long || r2.global.Long || r2.inquire("long"), r2.key2Re = /^true|false|0|1$/, r2.key32Re = /^-?(?:0|[1-9][0-9]*)$/, r2.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, r2.longToHash = function(t3) {
return t3 ? r2.LongBits.from(t3).toHash() : r2.LongBits.zeroHash;
}, r2.longFromHash = function(t3, n3) {
t3 = r2.LongBits.fromHash(t3);
return r2.Long ? r2.Long.fromBits(t3.lo, t3.hi, n3) : t3.toNumber(!!n3);
}, r2.merge = u, r2.lcFirst = function(t3) {
return (t3[0] || "").toLowerCase() + t3.substring(1);
}, r2.newError = e, r2.ProtocolError = e("ProtocolError"), r2.oneOfGetter = function(t3) {
for (var i3 = {}, n3 = 0; n3 < t3.length; ++n3) i3[t3[n3]] = 1;
return function() {
for (var t4 = Object.keys(this), n4 = t4.length - 1; -1 < n4; --n4) if (1 === i3[t4[n4]] && this[t4[n4]] !== d && null !== this[t4[n4]]) return t4[n4];
};
}, r2.oneOfSetter = function(i3) {
return function(t3) {
for (var n3 = 0; n3 < i3.length; ++n3) i3[n3] !== t3 && delete this[i3[n3]];
};
}, r2.toJSONOptions = { longs: String, enums: String, bytes: String, json: true }, r2.n = function() {
var i3 = r2.Buffer;
i3 ? (r2.r = i3.from !== Uint8Array.from && i3.from || function(t3, n3) {
return new i3(t3, n3);
}, r2.u = i3.allocUnsafe || function(t3) {
return new i3(t3);
}) : r2.r = r2.u = null;
};
}, { 1: 1, 14: 14, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7 }], 16: [function(t2, n2, i2) {
n2.exports = a;
var r2, u = t2(15), e = u.LongBits, s = u.base64, h = u.utf8;
function o(t3, n3, i3) {
this.fn = t3, this.len = n3, this.next = d, this.val = i3;
}
function f() {
}
function c(t3) {
this.head = t3.head, this.tail = t3.tail, this.len = t3.len, this.next = t3.states;
}
function a() {
this.len = 0, this.head = new o(f, 0, 0), this.tail = this.head, this.states = null;
}
function l() {
return u.Buffer ? function() {
return (a.create = function() {
return new r2();
})();
} : function() {
return new a();
};
}
function v(t3, n3, i3) {
n3[i3] = 255 & t3;
}
function w(t3, n3) {
this.len = t3, this.next = d, this.val = n3;
}
function b(t3, n3, i3) {
for (; t3.hi; ) n3[i3++] = 127 & t3.lo | 128, t3.lo = (t3.lo >>> 7 | t3.hi << 25) >>> 0, t3.hi >>>= 7;
for (; 127 < t3.lo; ) n3[i3++] = 127 & t3.lo | 128, t3.lo = t3.lo >>> 7;
n3[i3++] = t3.lo;
}
function y(t3, n3, i3) {
n3[i3] = 255 & t3, n3[i3 + 1] = t3 >>> 8 & 255, n3[i3 + 2] = t3 >>> 16 & 255, n3[i3 + 3] = t3 >>> 24;
}
a.create = l(), a.alloc = function(t3) {
return new u.Array(t3);
}, u.Array !== Array && (a.alloc = u.pool(a.alloc, u.Array.prototype.subarray)), a.prototype.e = function(t3, n3, i3) {
return this.tail = this.tail.next = new o(t3, n3, i3), this.len += n3, this;
}, (w.prototype = Object.create(o.prototype)).fn = function(t3, n3, i3) {
for (; 127 < t3; ) n3[i3++] = 127 & t3 | 128, t3 >>>= 7;
n3[i3] = t3;
}, a.prototype.uint32 = function(t3) {
return this.len += (this.tail = this.tail.next = new w((t3 >>>= 0) < 128 ? 1 : t3 < 16384 ? 2 : t3 < 2097152 ? 3 : t3 < 268435456 ? 4 : 5, t3)).len, this;
}, a.prototype.int32 = function(t3) {
return t3 < 0 ? this.e(b, 10, e.fromNumber(t3)) : this.uint32(t3);
}, a.prototype.sint32 = function(t3) {
return this.uint32((t3 << 1 ^ t3 >> 31) >>> 0);
}, a.prototype.int64 = a.prototype.uint64 = function(t3) {
t3 = e.from(t3);
return this.e(b, t3.length(), t3);
}, a.prototype.sint64 = function(t3) {
t3 = e.from(t3).zzEncode();
return this.e(b, t3.length(), t3);
}, a.prototype.bool = function(t3) {
return this.e(v, 1, t3 ? 1 : 0);
}, a.prototype.sfixed32 = a.prototype.fixed32 = function(t3) {
return this.e(y, 4, t3 >>> 0);
}, a.prototype.sfixed64 = a.prototype.fixed64 = function(t3) {
t3 = e.from(t3);
return this.e(y, 4, t3.lo).e(y, 4, t3.hi);
}, a.prototype.float = function(t3) {
return this.e(u.float.writeFloatLE, 4, t3);
}, a.prototype.double = function(t3) {
return this.e(u.float.writeDoubleLE, 8, t3);
};
var g = u.Array.prototype.set ? function(t3, n3, i3) {
n3.set(t3, i3);
} : function(t3, n3, i3) {
for (var r3 = 0; r3 < t3.length; ++r3) n3[i3 + r3] = t3[r3];
};
a.prototype.bytes = function(t3) {
var n3, i3 = t3.length >>> 0;
return i3 ? (u.isString(t3) && (n3 = a.alloc(i3 = s.length(t3)), s.decode(t3, n3, 0), t3 = n3), this.uint32(i3).e(g, i3, t3)) : this.e(v, 1, 0);
}, a.prototype.string = function(t3) {
var n3 = h.length(t3);
return n3 ? this.uint32(n3).e(h.write, n3, t3) : this.e(v, 1, 0);
}, a.prototype.fork = function() {
return this.states = new c(this), this.head = this.tail = new o(f, 0, 0), this.len = 0, this;
}, a.prototype.reset = function() {
return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new o(f, 0, 0), this.len = 0), this;
}, a.prototype.ldelim = function() {
var t3 = this.head, n3 = this.tail, i3 = this.len;
return this.reset().uint32(i3), i3 && (this.tail.next = t3.next, this.tail = n3, this.len += i3), this;
}, a.prototype.finish = function() {
for (var t3 = this.head.next, n3 = this.constructor.alloc(this.len), i3 = 0; t3; ) t3.fn(t3.val, n3, i3), i3 += t3.len, t3 = t3.next;
return n3;
}, a.n = function(t3) {
r2 = t3, a.create = l(), r2.n();
};
}, { 15: 15 }], 17: [function(t2, n2, i2) {
n2.exports = e;
var r2 = t2(16), u = ((e.prototype = Object.create(r2.prototype)).constructor = e, t2(15));
function e() {
r2.call(this);
}
function s(t3, n3, i3) {
t3.length < 40 ? u.utf8.write(t3, n3, i3) : n3.utf8Write ? n3.utf8Write(t3, i3) : n3.write(t3, i3);
}
e.n = function() {
e.alloc = u.u, e.writeBytesBuffer = u.Buffer && u.Buffer.prototype instanceof Uint8Array && "set" === u.Buffer.prototype.set.name ? function(t3, n3, i3) {
n3.set(t3, i3);
} : function(t3, n3, i3) {
if (t3.copy) t3.copy(n3, i3, 0, t3.length);
else for (var r3 = 0; r3 < t3.length; ) n3[i3++] = t3[r3++];
};
}, e.prototype.bytes = function(t3) {
var n3 = (t3 = u.isString(t3) ? u.r(t3, "base64") : t3).length >>> 0;
return this.uint32(n3), n3 && this.e(e.writeBytesBuffer, n3, t3), this;
}, e.prototype.string = function(t3) {
var n3 = u.Buffer.byteLength(t3);
return this.uint32(n3), n3 && this.e(s, n3, t3), this;
}, e.n();
}, { 15: 15, 16: 16 }] }, {}, [8]);
})();
} (protobuf_min));
return protobuf_min.exports;
}
var protobuf_minExports = requireProtobuf_min();
const protobuf = /*@__PURE__*/getDefaultExportFromCjs(protobuf_minExports);
export { protobuf as p };