@lodestar/light-client 1.35.0-rc.3 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lightclient.min.mjs +1 -1
- package/package.json +7 -7
package/dist/lightclient.min.mjs
CHANGED
|
@@ -2,7 +2,7 @@ let ki,ug,Ji,go,Bo,Co,Qo,io,xd=(async()=>{function eo(I){return{all:I=I||new Map
|
|
|
2
2
|
|
|
3
3
|
`+I.mark.snippet),B+" "+g):B}function fC(I,A){Error.call(this),this.name="YAMLException",this.reason=I,this.mark=A,this.message=zo(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}fC.prototype=Object.create(Error.prototype),fC.prototype.constructor=fC,fC.prototype.toString=function(I){return this.name+": "+zo(this,I)};var eB=fC,uD=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],RD=["scalar","sequence","mapping"];function GD(I){var A={};return I!==null&&Object.keys(I).forEach(function(g){I[g].forEach(function(B){A[String(B)]=g})}),A}function FD(I,A){if(A=A||{},Object.keys(A).forEach(function(g){if(uD.indexOf(g)===-1)throw new eB('Unknown option "'+g+'" is met in definition of "'+I+'" YAML type.')}),this.options=A,this.tag=I,this.kind=A.kind||null,this.resolve=A.resolve||function(){return!0},this.construct=A.construct||function(g){return g},this.instanceOf=A.instanceOf||null,this.predicate=A.predicate||null,this.represent=A.represent||null,this.representName=A.representName||null,this.defaultStyle=A.defaultStyle||null,this.multi=A.multi||!1,this.styleAliases=GD(A.styleAliases||null),RD.indexOf(this.kind)===-1)throw new eB('Unknown kind "'+this.kind+'" is specified for "'+I+'" YAML type.')}var eI=FD;function vo(I,A){var g=[];return I[A].forEach(function(B){var i=g.length;g.forEach(function(Q,C){Q.tag===B.tag&&Q.kind===B.kind&&Q.multi===B.multi&&(i=C)}),g[i]=B}),g}function kD(){var I={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},A,g;function B(i){i.multi?(I.multi[i.kind].push(i),I.multi.fallback.push(i)):I[i.kind][i.tag]=I.fallback[i.tag]=i}for(A=0,g=arguments.length;A<g;A+=1)arguments[A].forEach(B);return I}function xi(I){return this.extend(I)}xi.prototype.extend=function(I){var A=[],g=[];if(I instanceof eI)g.push(I);else if(Array.isArray(I))g=g.concat(I);else if(I&&(Array.isArray(I.implicit)||Array.isArray(I.explicit)))I.implicit&&(A=A.concat(I.implicit)),I.explicit&&(g=g.concat(I.explicit));else throw new eB("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");A.forEach(function(i){if(!(i instanceof eI))throw new eB("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new eB("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new eB("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),g.forEach(function(i){if(!(i instanceof eI))throw new eB("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var B=Object.create(xi.prototype);return B.implicit=(this.implicit||[]).concat(A),B.explicit=(this.explicit||[]).concat(g),B.compiledImplicit=vo(B,"implicit"),B.compiledExplicit=vo(B,"explicit"),B.compiledTypeMap=kD(B.compiledImplicit,B.compiledExplicit),B};var JD=xi,pD=new eI("tag:yaml.org,2002:str",{kind:"scalar",construct:function(I){return I!==null?I:""}}),HD=new eI("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(I){return I!==null?I:[]}}),MD=new eI("tag:yaml.org,2002:map",{kind:"mapping",construct:function(I){return I!==null?I:{}}}),Wo=new JD({explicit:[pD,HD,MD]});function mD(I){if(I===null)return!0;var A=I.length;return A===1&&I==="~"||A===4&&(I==="null"||I==="Null"||I==="NULL")}function LD(){return null}function KD(I){return I===null}var Xo=new eI("tag:yaml.org,2002:null",{kind:"scalar",resolve:mD,construct:LD,predicate:KD,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function YD(I){if(I===null)return!1;var A=I.length;return A===4&&(I==="true"||I==="True"||I==="TRUE")||A===5&&(I==="false"||I==="False"||I==="FALSE")}function bD(I){return I==="true"||I==="True"||I==="TRUE"}function TD(I){return Object.prototype.toString.call(I)==="[object Boolean]"}var $o=new eI("tag:yaml.org,2002:bool",{kind:"scalar",resolve:YD,construct:bD,predicate:TD,represent:{lowercase:function(I){return I?"true":"false"},uppercase:function(I){return I?"TRUE":"FALSE"},camelcase:function(I){return I?"True":"False"}},defaultStyle:"lowercase"});function qD(I){return 48<=I&&I<=57||65<=I&&I<=70||97<=I&&I<=102}function VD(I){return 48<=I&&I<=55}function jD(I){return 48<=I&&I<=57}function ZD(I){if(I===null)return!1;var A=I.length,g=0,B=!1,i;if(!A)return!1;if(i=I[g],(i==="-"||i==="+")&&(i=I[++g]),i==="0"){if(g+1===A)return!0;if(i=I[++g],i==="b"){for(g++;g<A;g++)if(i=I[g],i!=="_"){if(i!=="0"&&i!=="1")return!1;B=!0}return B&&i!=="_"}if(i==="x"){for(g++;g<A;g++)if(i=I[g],i!=="_"){if(!qD(I.charCodeAt(g)))return!1;B=!0}return B&&i!=="_"}if(i==="o"){for(g++;g<A;g++)if(i=I[g],i!=="_"){if(!VD(I.charCodeAt(g)))return!1;B=!0}return B&&i!=="_"}}if(i==="_")return!1;for(;g<A;g++)if(i=I[g],i!=="_"){if(!jD(I.charCodeAt(g)))return!1;B=!0}return!(!B||i==="_")}function _D(I){var A=I,g=1,B;if(A.indexOf("_")!==-1&&(A=A.replace(/_/g,"")),B=A[0],(B==="-"||B==="+")&&(B==="-"&&(g=-1),A=A.slice(1),B=A[0]),A==="0")return 0;if(B==="0"){if(A[1]==="b")return g*parseInt(A.slice(2),2);if(A[1]==="x")return g*parseInt(A.slice(2),16);if(A[1]==="o")return g*parseInt(A.slice(2),8)}return g*parseInt(A,10)}function PD(I){return Object.prototype.toString.call(I)==="[object Number]"&&I%1===0&&!Oi.isNegativeZero(I)}var OD=new eI("tag:yaml.org,2002:int",{kind:"scalar",resolve:ZD,construct:_D,predicate:PD,represent:{binary:function(I){return I>=0?"0b"+I.toString(2):"-0b"+I.toString(2).slice(1)},octal:function(I){return I>=0?"0o"+I.toString(8):"-0o"+I.toString(8).slice(1)},decimal:function(I){return I.toString(10)},hexadecimal:function(I){return I>=0?"0x"+I.toString(16).toUpperCase():"-0x"+I.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),xD=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function zD(I){return!(I===null||!xD.test(I)||I[I.length-1]==="_")}function vD(I){var A,g;return A=I.replace(/_/g,"").toLowerCase(),g=A[0]==="-"?-1:1,"+-".indexOf(A[0])>=0&&(A=A.slice(1)),A===".inf"?g===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:A===".nan"?NaN:g*parseFloat(A,10)}var WD=/^[-+]?[0-9]+e/;function XD(I,A){var g;if(isNaN(I))switch(A){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===I)switch(A){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===I)switch(A){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Oi.isNegativeZero(I))return"-0.0";return g=I.toString(10),WD.test(g)?g.replace("e",".e"):g}function $D(I){return Object.prototype.toString.call(I)==="[object Number]"&&(I%1!==0||Oi.isNegativeZero(I))}var Ar=new eI("tag:yaml.org,2002:float",{kind:"scalar",resolve:zD,construct:vD,predicate:$D,represent:XD,defaultStyle:"lowercase"}),Ac=Wo.extend({implicit:[Xo,$o,OD,Ar]}),Ic=Ac,Ir=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),gr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function gc(I){return I===null?!1:Ir.exec(I)!==null||gr.exec(I)!==null}function Bc(I){var A,g,B,i,Q,C,e,o=0,c=null,a,f,R;if(A=Ir.exec(I),A===null&&(A=gr.exec(I)),A===null)throw new Error("Date resolve error");if(g=+A[1],B=+A[2]-1,i=+A[3],!A[4])return new Date(Date.UTC(g,B,i));if(Q=+A[4],C=+A[5],e=+A[6],A[7]){for(o=A[7].slice(0,3);o.length<3;)o+="0";o=+o}return A[9]&&(a=+A[10],f=+(A[11]||0),c=(a*60+f)*6e4,A[9]==="-"&&(c=-c)),R=new Date(Date.UTC(g,B,i,Q,C,e,o)),c&&R.setTime(R.getTime()-c),R}function Cc(I){return I.toISOString()}var Qc=new eI("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:gc,construct:Bc,instanceOf:Date,represent:Cc});function ic(I){return I==="<<"||I===null}var ec=new eI("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ic}),zi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
4
4
|
\r`;function tc(I){if(I===null)return!1;var A,g,B=0,i=I.length,Q=zi;for(g=0;g<i;g++)if(A=Q.indexOf(I.charAt(g)),!(A>64)){if(A<0)return!1;B+=6}return B%8===0}function Ec(I){var A,g,B=I.replace(/[\r\n=]/g,""),i=B.length,Q=zi,C=0,e=[];for(A=0;A<i;A++)A%4===0&&A&&(e.push(C>>16&255),e.push(C>>8&255),e.push(C&255)),C=C<<6|Q.indexOf(B.charAt(A));return g=i%4*6,g===0?(e.push(C>>16&255),e.push(C>>8&255),e.push(C&255)):g===18?(e.push(C>>10&255),e.push(C>>2&255)):g===12&&e.push(C>>4&255),new Uint8Array(e)}function oc(I){var A="",g=0,B,i,Q=I.length,C=zi;for(B=0;B<Q;B++)B%3===0&&B&&(A+=C[g>>18&63],A+=C[g>>12&63],A+=C[g>>6&63],A+=C[g&63]),g=(g<<8)+I[B];return i=Q%3,i===0?(A+=C[g>>18&63],A+=C[g>>12&63],A+=C[g>>6&63],A+=C[g&63]):i===2?(A+=C[g>>10&63],A+=C[g>>4&63],A+=C[g<<2&63],A+=C[64]):i===1&&(A+=C[g>>2&63],A+=C[g<<4&63],A+=C[64],A+=C[64]),A}function rc(I){return Object.prototype.toString.call(I)==="[object Uint8Array]"}var nc=new eI("tag:yaml.org,2002:binary",{kind:"scalar",resolve:tc,construct:Ec,predicate:rc,represent:oc}),ac=Object.prototype.hasOwnProperty,sc=Object.prototype.toString;function hc(I){if(I===null)return!0;var A=[],g,B,i,Q,C,e=I;for(g=0,B=e.length;g<B;g+=1){if(i=e[g],C=!1,sc.call(i)!=="[object Object]")return!1;for(Q in i)if(ac.call(i,Q))if(!C)C=!0;else return!1;if(!C)return!1;if(A.indexOf(Q)===-1)A.push(Q);else return!1}return!0}function lc(I){return I!==null?I:[]}var Dc=new eI("tag:yaml.org,2002:omap",{kind:"sequence",resolve:hc,construct:lc}),cc=Object.prototype.toString;function Uc(I){if(I===null)return!0;var A,g,B,i,Q,C=I;for(Q=new Array(C.length),A=0,g=C.length;A<g;A+=1){if(B=C[A],cc.call(B)!=="[object Object]"||(i=Object.keys(B),i.length!==1))return!1;Q[A]=[i[0],B[i[0]]]}return!0}function fc(I){if(I===null)return[];var A,g,B,i,Q,C=I;for(Q=new Array(C.length),A=0,g=C.length;A<g;A+=1)B=C[A],i=Object.keys(B),Q[A]=[i[0],B[i[0]]];return Q}var Sc=new eI("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Uc,construct:fc}),wc=Object.prototype.hasOwnProperty;function yc(I){if(I===null)return!0;var A,g=I;for(A in g)if(wc.call(g,A)&&g[A]!==null)return!1;return!0}function Nc(I){return I!==null?I:{}}var dc=new eI("tag:yaml.org,2002:set",{kind:"mapping",resolve:yc,construct:Nc});Ic.extend({implicit:[Qc,ec],explicit:[nc,Dc,Sc,dc]});function Br(I){return I===48?"\0":I===97?"\x07":I===98?"\b":I===116||I===9?" ":I===110?`
|
|
5
|
-
`:I===118?"\v":I===102?"\f":I===114?"\r":I===101?"\x1B":I===32?" ":I===34?'"':I===47?"/":I===92?"\\":I===78?"\x85":I===95?"\xA0":I===76?"\u2028":I===80?"\u2029":""}for(var uc=new Array(256),Rc=new Array(256),TB=0;TB<256;TB++)uc[TB]=Br(TB)?1:0,Rc[TB]=Br(TB);var Gc=eI,Fc=Wo,kc={float:Ar,null:Xo,bool:$o},lQ={Type:Gc,types:kc};const{Type:Jc}=lQ;function pc(I){return 48<=I&&I<=57||65<=I&&I<=70||97<=I&&I<=102}function Hc(I){return 48<=I&&I<=55}function Mc(I){return 48<=I&&I<=57}function mc(I){if(I===null)return!1;const A=I.length;let g,B=0,i=!1;if(!A)return!1;if(g=I[B],(g==="-"||g==="+")&&(g=I[++B]),g==="0"){if(B+1===A)return!0;if(g=I[++B],g==="b"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(g!=="0"&&g!=="1")return!1;i=!0}return i&&g!=="_"}if(g==="x"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(!pc(I.charCodeAt(B)))return!1;i=!0}return i&&g!=="_"}for(;B<A;B++)if(g=I[B],g!=="_"){if(!Hc(I.charCodeAt(B)))return!1;i=!0}return i&&g!=="_"}if(g==="_")return!1;for(;B<A;B++)if(g=I[B],g!=="_"){if(g===":")break;if(!Mc(I.charCodeAt(B)))return!1;i=!0}return!i||g==="_"?!1:g!==":"?!0:/^(:[0-5]?[0-9])+$/.test(I.slice(B))}function Lc(I){let A=I,g=1,B,i;const Q=[];if(A.indexOf("_")!==-1&&(A=A.replace(/_/g,"")),B=A[0],(B==="-"||B==="+")&&(B==="-"&&(g=-1),A=A.slice(1),B=A[0]),A==="0")return BigInt(0);if(B==="0")return A[1]==="b"||A[1]==="x"?BigInt(A)*BigInt(g):BigInt("0o"+A)*BigInt(g);if(A.indexOf(":")!==-1){for(const C of A.split(":"))Q.unshift(parseInt(C,10));A=BigInt(0),i=BigInt(1);for(const C of Q)A=(BigInt(A)+BigInt(i))*BigInt(C),i=BigInt(i)*BigInt(60);return A*BigInt(g)}return BigInt(A)*BigInt(g)}function Kc(I){return typeof I=="bigint"||typeof I=="number"}const Yc=new Jc("tag:yaml.org,2002:int",{kind:"scalar",resolve:mc,construct:Lc,predicate:Kc,instanceOf:BigInt,represent:{binary:function(I){return I>=0?"0b"+I.toString(2):"-0b"+I.toString(2).slice(1)},octal:function(I){return I>=0?"0"+I.toString(8):"-0"+I.toString(8).slice(1)},decimal:function(I){return I.toString(10)},hexadecimal:function(I){return I>=0?"0x"+I.toString(16).toUpperCase():"-0x"+I.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});Fc.extend({implicit:[lQ.types.null,lQ.types.bool,Yc,lQ.types.float],explicit:[]});const Jg={PRESET_BASE:MI.mainnet,CONFIG_NAME:"mainnet",TERMINAL_TOTAL_DIFFICULTY:BigInt("58750000000000000000000"),TERMINAL_BLOCK_HASH:aA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:16384,MIN_GENESIS_TIME:1606824e3,GENESIS_FORK_VERSION:aA("0x00000000"),GENESIS_DELAY:604800,ALTAIR_FORK_VERSION:aA("0x01000000"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:aA("0x02000000"),BELLATRIX_FORK_EPOCH:144896,CAPELLA_FORK_VERSION:aA("0x03000000"),CAPELLA_FORK_EPOCH:194048,DENEB_FORK_VERSION:aA("0x04000000"),DENEB_FORK_EPOCH:269568,ELECTRA_FORK_VERSION:aA("0x05000000"),ELECTRA_FORK_EPOCH:364032,FULU_FORK_VERSION:aA("0x06000000"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x07000000"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:12,SLOT_DURATION_MS:12e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,SHARD_COMMITTEE_PERIOD:256,ETH1_FOLLOW_DISTANCE:2048,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:4,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:8,CHURN_LIMIT_QUOTIENT:65536,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,DEPOSIT_CONTRACT_ADDRESS:aA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),MAX_REQUEST_BLOCKS:1024,MIN_EPOCHS_FOR_BLOCK_REQUESTS:33024,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:256e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:128e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,BLOB_SCHEDULE:[]},bc={PRESET_BASE:MI.minimal,CONFIG_NAME:"minimal",TERMINAL_TOTAL_DIFFICULTY:BigInt("115792089237316195423570985008687907853269984665640564039457584007913129638912"),TERMINAL_BLOCK_HASH:aA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1578009600,GENESIS_FORK_VERSION:aA("0x00000001"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:aA("0x01000001"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:aA("0x02000001"),BELLATRIX_FORK_EPOCH:1/0,CAPELLA_FORK_VERSION:aA("0x03000001"),CAPELLA_FORK_EPOCH:1/0,DENEB_FORK_VERSION:aA("0x04000001"),DENEB_FORK_EPOCH:1/0,ELECTRA_FORK_VERSION:aA("0x05000001"),ELECTRA_FORK_EPOCH:1/0,FULU_FORK_VERSION:aA("0x06000001"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x07000001"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:6,SLOT_DURATION_MS:6e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,SHARD_COMMITTEE_PERIOD:64,ETH1_FOLLOW_DISTANCE:16,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:2,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:4,CHURN_LIMIT_QUOTIENT:32,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:5,DEPOSIT_NETWORK_ID:5,DEPOSIT_CONTRACT_ADDRESS:aA("0x1234567890123456789012345678901234567890"),MAX_REQUEST_BLOCKS:1024,MIN_EPOCHS_FOR_BLOCK_REQUESTS:272,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:128e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,BLOB_SCHEDULE:[]};let DQ;switch(EQ){case MI.minimal:DQ=bc;break;case MI.mainnet:DQ=Jg;break;default:DQ=Jg}function Tc(I){const A={...DQ,...I};if(I.SLOT_DURATION_MS===void 0&&(A.SLOT_DURATION_MS=A.SECONDS_PER_SLOT*1e3),A.PRESET_BASE!==EQ)throw new Error(`Can only create a config for the active preset: ACTIVE_PRESET=${EQ} PRESET_BASE=${A.PRESET_BASE}`);return A}function pg(I,A){const g=BigInt(1)<<BigInt(I);if(A>=g)throw new Error(`index ${A} too large for depth ${I}`);return g|A}function vi(I,A){const g=A?Number(A).toString(2):"";if(g.length>I)throw new Error("index too large for depth");return`1${g.padStart(I,"0")}`}function Wi(I){if(typeof I=="string"){if(I.length===0)throw new Error(cQ);return I}if(I<1)throw new Error(cQ);return I.toString(2)}const cQ="Invalid gindex";function qc(I){let A;if(typeof I=="string"){if(!I.length)throw new Error(cQ);A=I}else{if(I<1)throw new Error(cQ);A=I.toString(2)}let g=1;const B=()=>{if(g===A.length)return{done:!0,value:void 0};const i=Number(A[g]);return g++,{done:!1,value:i}};return{[Symbol.iterator](){return{next:B}},remainingBitLength(){return A.length-g}}}function ng(I){return BigInt(I.reduce((A,g)=>A+g.toString(2).slice(1),"0b1"))}function Vc(I){return I instanceof Uint8Array||ArrayBuffer.isView(I)&&I.constructor.name==="Uint8Array"}function Cr(I,...A){if(!Vc(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error("Uint8Array expected of length "+A+", got length="+I.length)}function Qr(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function jc(I,A){Cr(I);const g=A.outputLen;if(I.length<g)throw new Error("digestInto() expects output buffer of length at least "+g)}function Xi(I){return new DataView(I.buffer,I.byteOffset,I.byteLength)}function XI(I,A){return I<<32-A|I>>>A}function Zc(I){if(typeof I!="string")throw new Error("utf8ToBytes expected string, got "+typeof I);return new Uint8Array(new TextEncoder().encode(I))}function ir(I){return typeof I=="string"&&(I=Zc(I)),Cr(I),I}let _c=class{clone(){return this._cloneInto()}};function Pc(I){const A=B=>I().update(ir(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}function Oc(I,A,g,B){if(typeof I.setBigUint64=="function")return I.setBigUint64(A,g,B);const i=BigInt(32),Q=BigInt(4294967295),C=Number(g>>i&Q),e=Number(g&Q),o=B?4:0,c=B?0:4;I.setUint32(A+o,C,B),I.setUint32(A+c,e,B)}function xc(I,A,g){return I&A^~I&g}function zc(I,A,g){return I&A^I&g^A&g}class vc extends _c{constructor(A,g,B,i){super(),this.blockLen=A,this.outputLen=g,this.padOffset=B,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(A),this.view=Xi(this.buffer)}update(A){Qr(this);const{view:g,buffer:B,blockLen:i}=this;A=ir(A);const Q=A.length;for(let C=0;C<Q;){const e=Math.min(i-this.pos,Q-C);if(e===i){const o=Xi(A);for(;i<=Q-C;C+=i)this.process(o,C);continue}B.set(A.subarray(C,C+e),this.pos),this.pos+=e,C+=e,this.pos===i&&(this.process(g,0),this.pos=0)}return this.length+=A.length,this.roundClean(),this}digestInto(A){Qr(this),jc(A,this),this.finished=!0;const{buffer:g,view:B,blockLen:i,isLE:Q}=this;let{pos:C}=this;g[C++]=128,this.buffer.subarray(C).fill(0),this.padOffset>i-C&&(this.process(B,0),C=0);for(let f=C;f<i;f++)g[f]=0;Oc(B,i-8,BigInt(this.length*8),Q),this.process(B,0);const e=Xi(A),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,a=this.get();if(c>a.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<c;f++)e.setUint32(4*f,a[f],Q)}digest(){const{buffer:A,outputLen:g}=this;this.digestInto(A);const B=A.slice(0,g);return this.destroy(),B}_cloneInto(A){A||(A=new this.constructor),A.set(...this.get());const{blockLen:g,buffer:B,length:i,finished:Q,destroyed:C,pos:e}=this;return A.length=i,A.pos=e,A.finished=Q,A.destroyed=C,i%g&&A.buffer.set(B),A}}const Wc=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]),Hg=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Mg=new Uint32Array(64);class Xc extends vc{constructor(){super(64,32,8,!1),this.A=Hg[0]|0,this.B=Hg[1]|0,this.C=Hg[2]|0,this.D=Hg[3]|0,this.E=Hg[4]|0,this.F=Hg[5]|0,this.G=Hg[6]|0,this.H=Hg[7]|0}get(){const{A,B:g,C:B,D:i,E:Q,F:C,G:e,H:o}=this;return[A,g,B,i,Q,C,e,o]}set(A,g,B,i,Q,C,e,o){this.A=A|0,this.B=g|0,this.C=B|0,this.D=i|0,this.E=Q|0,this.F=C|0,this.G=e|0,this.H=o|0}process(A,g){for(let f=0;f<16;f++,g+=4)Mg[f]=A.getUint32(g,!1);for(let f=16;f<64;f++){const R=Mg[f-15],y=Mg[f-2],G=XI(R,7)^XI(R,18)^R>>>3,S=XI(y,17)^XI(y,19)^y>>>10;Mg[f]=S+Mg[f-7]+G+Mg[f-16]|0}let{A:B,B:i,C:Q,D:C,E:e,F:o,G:c,H:a}=this;for(let f=0;f<64;f++){const R=XI(e,6)^XI(e,11)^XI(e,25),y=a+R+xc(e,o,c)+Wc[f]+Mg[f]|0,G=(XI(B,2)^XI(B,13)^XI(B,22))+zc(B,i,Q)|0;a=c,c=o,o=e,e=C+y|0,C=Q,Q=i,i=B,B=y+G|0}B=B+this.A|0,i=i+this.B|0,Q=Q+this.C|0,C=C+this.D|0,e=e+this.E|0,o=o+this.F|0,c=c+this.G|0,a=a+this.H|0,this.set(B,i,Q,C,e,o,c,a)}roundClean(){Mg.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const er=Pc(()=>new Xc),qB=[new Uint8Array(32)];function VB(I){if(I>=qB.length)for(let A=qB.length;A<=I;A++)qB[A]=er.create().update(qB[A-1]).update(qB[A-1]).digest();return qB[I]}function SC(I){const A=new Uint8Array(32);return CD(I,A,0),A}function $c(I){return QD(I,0)}const nI=64;function AU(I,A,g,B,i){if(A<1)throw new Error(`Invalid padFor, expect to be greater than 0, got ${A}`);const Q=Math.ceil(Math.log2(A));if(I.length===0){g.set(VB(Q),B);return}if(I.length%32!==0)throw new Error(`Invalid input length, expect to be multiple of 32 bytes, got ${I.length}`);if(A>1&&I.length%nI!==0)throw new Error(`Invalid input length, expect to be multiple of 64 bytes, got ${I.length}, padFor=${A}`);let C=I.length,e=Math.floor(C/2),o=I;for(let c=0;c<Q;c++){const a=I.subarray(0,e);i(o,a),Math.floor(e/32)%2===1&&c<Q-1?(C=e+32,o=I.subarray(0,C),o.set(VB(c+1),e)):(o=a,C=e),e=Math.floor(C/2)}g.set(o.subarray(0,32),B)}function IU(I,A,g,B,i,Q,C){if(g<1)throw new Error(`Invalid padFor, expect to be at least 1, got ${g}`);if(A>I.length)throw new Error(`Invalid blockLimit, expect to be less than or equal blocks.length ${I.length}, got ${A}`);const e=Math.ceil(Math.log2(g));if(A===0){B.set(VB(e),i);return}for(const y of I)if(y.length!==nI)throw new Error(`Invalid block length, expect to be 64 bytes, got ${y.length}`);if(C.length===0||C.length%(4*nI)!==0)throw new Error(`Invalid buffer length, expect to be multiple of 64 bytes, got ${C.length}`);const o=Math.floor(C.length/nI),c=Math.floor(o/2);let a=C,f=C.subarray(0,c*nI),R=A;for(let y=0;y<e;y++){let G=0;const S=Math.floor(R/o);for(let N=0;N<S;N++){for(let w=0;w<o;w++){const J=N*o+w;a.set(I[J],w*nI)}Q(a,f);for(let w=0;w<c;w++)I[G].set(f.subarray(w*nI,(w+1)*nI)),G++}const u=R%o;a=C.subarray(0,u*nI),f=C.subarray(0,Math.floor(a.length/2));for(let N=Math.floor(R/o)*o;N<R;N++)a.set(I[N],N%o*nI);Q(a,f);for(let N=0;N<Math.floor(f.length/nI);N++)I[G].set(f.subarray(N*nI,(N+1)*nI)),G++;f.length%nI!==0&&(I[G].set(f.subarray(f.length-32,f.length),0),I[G].set(VB(y+1),32),G++),R=G,a=C.subarray(0,R*nI),f=C.subarray(0,Math.floor(a.length/2))}B.set(I[0].subarray(0,32),i)}function gU(I,A,g){let B=I.length;const i=Math.pow(2,A)*32;if(A<1)throw new Error(`Invalid nLevel, expect to be greater than 0, got ${A}`);if(B%i!==0)throw new Error(`Invalid input length, expect to be multiple of ${i} for nLevel ${A}, got ${B}`);let Q=Math.floor(B/2),C=I;for(let e=A;e>0;e--){const o=C.subarray(0,Q);g(C,o),C=o,B=Q,Q=Math.floor(B/2)}return C}const $i=new Uint8Array(64),Ae=(I,A)=>er.create().update(I).update(A).digest(),wC=(I,A)=>{if(I.length%64!==0)throw new Error(`Invalid input length ${I.length}`);if(I.length!==A.length*2)throw new Error(`Invalid output length ${A.length}`);const g=Math.floor(I.length/64);for(let B=0;B<g;B++){const i=B*64,Q=I.subarray(i,i+32),C=I.subarray(i+32,i+64),e=Ae(Q,C);A.set(e,B*32)}},BU=new Uint8Array(4*nI);let tB={name:"noble",hashInto:wC,digest64:Ae,digest64Into:(I,A,g)=>{if(I.length!==32||A.length!==32)throw new Error("Invalid input length");if(g.length!==32)throw new Error("Invalid output length");$i.set(I,0),$i.set(A,32),wC($i,g)},digest64HashObjects:(I,A,g)=>{_i(Ae(SC(I),SC(A)),0,g)},merkleizeBlocksBytes(I,A,g,B){AU(I,A,g,B,wC)},merkleizeBlockArray(I,A,g,B,i){IU(I,A,g,B,i,wC,BU)},digestNLevel(I,A){return gU(I,A,wC)},executeHashComputations:I=>{for(let A=I.length-1;A>=0;A--){const g=I[A];if(!g)throw Error(`no hash computations for level ${A}`);for(const B of g)B.dest.applyHash(rD(B.src0,B.src1))}}};function yC(I,A,g,B){tB.merkleizeBlocksBytes(I,A,g,B)}function tr(I,A,g,B,i){tB.merkleizeBlockArray(I,A,g,B,i)}function CU(I){tB.executeHashComputations(I)}const Er=2**32;class Ie{h0;h1;h2;h3;h4;h5;h6;h7;constructor(A,g,B,i,Q,C,e,o){this.h0=A,this.h1=g,this.h2=B,this.h3=i,this.h4=Q,this.h5=C,this.h6=e,this.h7=o}applyHash(A){this.h0=A.h0,this.h1=A.h1,this.h2=A.h2,this.h3=A.h3,this.h4=A.h4,this.h5=A.h5,this.h6=A.h6,this.h7=A.h7}}class jA extends Ie{_left;_right;constructor(A,g){if(super(null,0,0,0,0,0,0,0),this._left=A,this._right=g,!A)throw new Error("Left node is undefined");if(!g)throw new Error("Right node is undefined")}get rootHashObject(){return this.h0===null&&tB.digest64HashObjects(this.left.rootHashObject,this.right.rootHashObject,this),this}get root(){return SC(this.rootHashObject)}get left(){return this._left}get right(){return this._right}isLeaf(){return!1}}class KA extends Ie{get rootHashObject(){return this}get root(){return SC(this)}get left(){throw Error("LeafNode has no left node")}get right(){throw Error("LeafNode has no right node")}static fromRoot(A){return KA.fromHashObject($c(A))}static fromHashObject(A){return new KA(A.h0,A.h1,A.h2,A.h3,A.h4,A.h5,A.h6,A.h7)}static fromZero(){return new KA(0,0,0,0,0,0,0,0)}static fromUint32(A){return new KA(A,0,0,0,0,0,0,0)}clone(){return KA.fromHashObject(this)}isLeaf(){return!0}writeToBytes(A,g,B){A.set(this.root.slice(0,B),g)}getUint(A,g,B){const i=Math.floor(g/4);if(A<4){const Q=g%4*8,C=TI(this,i);return A===1?255&C>>Q:65535&C>>Q}if(A===4)return TI(this,i)>>>0;if(A===8){const Q=TI(this,i),C=TI(this,i+1);return C===0?Q>>>0:C===-1&&Q===-1&&B?1/0:(Q>>>0)+(C>>>0)*Er}throw Error("uintBytes > 8")}getUintBigint(A,g){const B=Math.floor(g/4);if(A<4){const C=g%4*8,e=TI(this,B);return BigInt(A===1?255&e>>C:65535&e>>C)}if(A===4)return BigInt(TI(this,B)>>>0);const i=Math.ceil(A/4);let Q=BigInt(0);for(let C=0;C<i;C++)Q+=BigInt(TI(this,B+C)>>>0)<<BigInt(32*C);return Q}setUint(A,g,B,i){const Q=Math.floor(g/4);if(A<4){const C=g%4*8;let e=TI(this,Q);A===1?(e&=~(255<<C),e|=(255&B)<<C):(e&=~(65535<<C),e|=(65535&B)<<C),lI(this,Q,e)}else if(A===4)lI(this,Q,B);else if(A===8)B===1/0&&i?(lI(this,Q,-1),lI(this,Q+1,-1)):(lI(this,Q,B&4294967295),lI(this,Q+1,B/Er&4294967295));else throw Error("uintBytes > 8")}setUintBigint(A,g,B){const i=Math.floor(g/4);if(A<4){const Q=Number(B),C=g%4*8;let e=TI(this,i);A===1?(e&=~(255<<C),e|=(255&Q)<<C):(e&=~(65535<<C),e|=(65535&Q)<<C),lI(this,i,e)}else if(A===4)lI(this,i,Number(B));else{const Q=i+Math.ceil(A/4);for(let C=i;C<Q;C++)lI(this,C,Number(B&BigInt(4294967295))),B=B>>BigInt(32)}}bitwiseOrUint(A,g,B){const i=Math.floor(g/4);if(A<4){const Q=g%4*8;ge(this,i,B<<Q)}else if(A===4)ge(this,i,B);else{const Q=i+Math.ceil(A/4);for(let C=i;C<Q;C++)ge(this,C,B&4294967295),B>>=32}}}function TI(I,A){if(A===0)return I.h0;if(A===1)return I.h1;if(A===2)return I.h2;if(A===3)return I.h3;if(A===4)return I.h4;if(A===5)return I.h5;if(A===6)return I.h6;if(A===7)return I.h7;throw Error("hIndex > 7")}function lI(I,A,g){if(A===0)I.h0=g;else if(A===1)I.h1=g;else if(A===2)I.h2=g;else if(A===3)I.h3=g;else if(A===4)I.h4=g;else if(A===5)I.h5=g;else if(A===6)I.h6=g;else if(A===7)I.h7=g;else throw Error("hIndex > 7")}function ge(I,A,g){if(A===0)I.h0|=g;else if(A===1)I.h1|=g;else if(A===2)I.h2|=g;else if(A===3)I.h3|=g;else if(A===4)I.h4|=g;else if(A===5)I.h5|=g;else if(A===6)I.h6|=g;else if(A===7)I.h7|=g;else throw Error("hIndex > 7")}class QU{_length;_totalLength;head;tail;pointer;constructor(){this._length=0,this._totalLength=0,this.head={src0:null,src1:null,dest:null,next:null},this.tail=null,this.pointer=null}get length(){return this._length}get totalLength(){return this._totalLength}reset(){this.head.src0=null,this.head.src1=null,this.head.dest=null,this.tail=null,this._length=0,this.pointer=null}push(A,g,B){if(this.tail!==null){let i=this.tail.next;i!==null?(i.src0=A,i.src1=g,i.dest=B):(i={src0:A,src1:g,dest:B,next:null},this.tail.next=i,this._totalLength++),this.tail=i,this._length++;return}this.head.src0=A,this.head.src1=g,this.head.dest=B,this.tail=this.head,this._length=1,this._totalLength===0&&(this._totalLength=1)}clean(){let A=this.tail?.next??null;for(;A!==null&&A.src0!==null;)A.src0=null,A.src1=null,A.dest=null,A=A.next}next(){if(!this.pointer||this.tail===null)return{done:!0,value:void 0};const A=this.pointer,g=A.src0===null;return this.pointer=this.pointer.next,g?{done:!0,value:void 0}:{done:!1,value:A}}[Symbol.iterator](){return this.pointer=this.head,this}toArray(){const A=[];for(const g of this)A.push(g);return A}dump(){const A=[];let g=null;for(g=this.head;g!==null;g=g.next)A.push(g);return A}}class iU{byLevel;constructor(){this.byLevel=[]}reset(){for(const A of this.byLevel)A.reset()}clean(){for(const A of this.byLevel)A.clean()}}function aI(I,A,g){if(I.h0===null){const B=qI(g,A),{left:i,right:Q}=I;B.push(i,Q,I),aI(i,A+1,g),aI(Q,A+1,g)}}function qI(I,A){return I[A]===void 0&&(I[A]=new QU),I[A]}const EB=[KA.fromZero()];function oB(I){if(I>=EB.length){for(let A=EB.length;A<=I;A++)EB[A]=new jA(EB[A-1],EB[A-1]);EB[I].root}return EB[I]}function NC(I,A,g=0,B=null){const i=2**A;if(I.length>i)throw new Error(`nodes.length ${I.length} over maxIndex at depth ${A}`);if(I.length===0)return oB(A);if(A===0){const C=I[0];return B!==null&&aI(C,g,B),C}if(A===1){const C=I[0],e=I.length>1?I[1]:oB(0),o=new jA(C,e);return B!==null&&(aI(C,g+1,B),aI(e,g+1,B),qI(B,g).push(C,e,o)),o}let Q=I.length;for(let C=A;C>0;C--){const e=Q%2,o=Q-e,c=B?g+C-1:null;for(let a=0;a<o;a+=2){const f=I[a],R=I[a+1],y=new jA(f,R);I[a/2]=y,c!==null&&B!==null&&(qI(B,c).push(f,R,y),C===A&&(aI(f,c+1,B),aI(R,c+1,B)))}if(e>0){const a=I[o],f=oB(A-C),R=new jA(a,f);I[o/2]=R,c!==null&&B!==null&&(C===A&&aI(a,c+1,B),qI(B,c).push(a,f,R))}Q=o/2+e}return I[0]}const eU=2**32;function dC(I,A,g,B){const i=EU(A,g,B);return NC(i,I)}function tU(I){const A=new Array(Math.ceil(I.length/4));for(let g=0;g<I.length;g++){const B=Math.floor(g/4),i=A[B]??new KA(0,0,0,0,0,0,0,0),Q=2*(g%4),C=I[g];C===1/0?(lI(i,Q,4294967295),lI(i,Q+1,4294967295)):(lI(i,Q,C&4294967295),lI(i,Q+1,C/eU&4294967295)),A[B]=i}return A}function EU(I,A,g){const B=g-A,i=Math.floor(B/32),Q=new Array(Math.ceil(B/32));for(let e=0;e<i;e++){const o=A+e*32;Q[e]=new KA(I.getInt32(o+0,!0),I.getInt32(o+4,!0),I.getInt32(o+8,!0),I.getInt32(o+12,!0),I.getInt32(o+16,!0),I.getInt32(o+20,!0),I.getInt32(o+24,!0),I.getInt32(o+28,!0))}const C=B%32;if(C>0){const e=new KA(0,0,0,0,0,0,0,0);Q[i]=e;const o=Math.floor(C/4);for(let a=0;a<o;a++)lI(e,a,I.getInt32(A+i*32+a*4,!0));const c=B%4;if(c>0){let a=0;for(let f=0;f<c;f++)a|=I.getUint8(A+B-c+f)<<f*8;lI(e,o,a)}}return Q}function uC(I,A,g,B){const i=g%32,Q=Math.floor(g/32);for(let C=0;C<Q;C++){const e=B[C],o=A+C*32;I.setInt32(o+0,e.h0,!0),I.setInt32(o+4,e.h1,!0),I.setInt32(o+8,e.h2,!0),I.setInt32(o+12,e.h3,!0),I.setInt32(o+16,e.h4,!0),I.setInt32(o+20,e.h5,!0),I.setInt32(o+24,e.h6,!0),I.setInt32(o+28,e.h7,!0)}if(i>0){const C=B[Q],e=Math.floor(i/4);for(let c=0;c<e;c++)I.setInt32(A+Q*32+c*4,TI(C,c),!0);const o=g%4;if(o>0){const c=TI(C,e);for(let a=0;a<o;a++)I.setUint8(A+g-o+a,c>>a*8&255)}}}function oU(I){const A=new Set,g=new Set;let B=I;for(;B.length>1;){A.add(B);const i=B.at(-1),Q=B.substring(0,B.length-1);g.add(Q+(Number(i)^1)),B=Q}return{path:A,branch:g}}function rU(I,A){return I.length?I.map(g=>g.padEnd(A)).sort().map(g=>g.trim()):[]}function nU(I){return I.length?I.sort((A,g)=>{if(A.length<g.length)return 1;if(g.length<A.length)return-1;let B=A.indexOf("0"),i=g.indexOf("0");for(;;){if(B===-1)return-1;if(i===-1||B<i)return 1;if(i<B)return-1;B=A.indexOf("0",B+1),i=g.indexOf("0",i+1)}}):[]}function aU(I){const A=I.slice().sort((B,i)=>B.length-i.length),g=[];A:for(let B=0;B<A.length;B++){const i=A[B];for(let Q=B+1;Q<A.length;Q++)if(A[Q].startsWith(i))continue A;g.push(i)}return g}var mg;(function(I){I[I.InOrder=0]="InOrder",I[I.Decreasing=1]="Decreasing",I[I.Unsorted=2]="Unsorted"})(mg||(mg={}));function Be(I,A=!0,g=mg.InOrder){const B=aU(I),i=new Set(A?B:[]),Q=new Set,C=new Set;let e=1;for(const o of B){o.length>e&&(e=o.length);const{path:c,branch:a}=oU(o);for(const f of c)Q.add(f);for(const f of a)C.add(f)}for(const o of Q)C.delete(o);for(const o of C)i.add(o);switch(g){case mg.InOrder:return rU(Array.from(i),e);case mg.Decreasing:return nU(Array.from(i));case mg.Unsorted:return Array.from(i)}}function or(I,A){const g=A%8,B=Math.floor(A/8),i=I[B];switch(g){case 0:return(i&128)!==0;case 1:return(i&64)!==0;case 2:return(i&32)!==0;case 3:return(i&16)!==0;case 4:return(i&8)!==0;case 5:return(i&4)!==0;case 6:return(i&2)!==0;case 7:return(i&1)!==0;default:throw new Error("unreachable")}}function rr(I){const A=[],g=I.length*8;let B=0,i=0;for(let Q=0;Q<g;Q++){const C=or(I,Q);if(A.push(C),C?i++:B++,i>B){if(Q++,Q+7<g)throw new Error("Invalid descriptor: too many bytes");for(;Q<g;Q++)if(or(I,Q))throw new Error("Invalid descriptor: too many 1 bits");return A}}throw new Error("Invalid descriptor: not enough 1 bits")}function Ce(I,A,g){if(A[g])return[I.root];const B=Ce(I.left,A,g+1),i=Ce(I.right,A,g+B.length*2);return[...B,...i]}function Qe(I,A,g){return I[g.bitIndex++]?KA.fromRoot(A[g.leafIndex++]):new jA(Qe(I,A,g),Qe(I,A,g))}function sU(I,A){return Ce(I,rr(A),0)}function hU(I,A){const g=rr(A);if(g.length!==I.length*2-1)throw new Error("Invalid multiproof: invalid number of leaves");return Qe(g,I,{bitIndex:0,leafIndex:0})}const nr="Invalid tree navigation";function ar(I,A){const g=[];let B=I;for(const i of qc(A))if(i){if(B.isLeaf())throw new Error(nr);g.push(B.left.root),B=B.right}else{if(B.isLeaf())throw new Error(nr);g.push(B.right.root),B=B.left}return[B.root,g.reverse()]}function lU(I,A,g){let B=KA.fromRoot(A);const i=g.slice().reverse();for(;I>1;){const Q=KA.fromRoot(i.pop());I%BigInt(2)===BigInt(0)?B=new jA(B,Q):B=new jA(Q,B),I=I/BigInt(2)}return B}class NI{_rootNode;hook;constructor(A,g){this._rootNode=A,g&&(typeof WeakRef>"u"?this.hook=g:this.hook=new WeakRef(g))}get root(){return this.rootNode.root}get rootNode(){return this._rootNode}set rootNode(A){if(this._rootNode=A,this.hook)if(typeof WeakRef>"u")this.hook(A);else{const g=this.hook.deref();g?g(A):this.hook=void 0}}static createFromProof(A){return new NI(uU(A))}clone(){return new NI(this.rootNode)}getSubtree(A){return new NI(this.getNode(A),g=>this.setNode(A,g))}getNode(A){return RC(this.rootNode,A)}getNodeAtDepth(A,g){return mI(this.rootNode,A,g)}getRoot(A){return this.getNode(A).root}setNode(A,g){this.rootNode=DU(this.rootNode,A,g)}setNodeWithFn(A,g){this.rootNode=cU(this.rootNode,A,g)}setNodeAtDepth(A,g,B){this.rootNode=UU(this.rootNode,A,g,B)}setRoot(A,g){this.setNode(A,KA.fromRoot(g))}getNodesAtDepth(A,g,B){return tI(this.rootNode,A,g,B)}iterateNodesAtDepth(A,g,B){return fU(this.rootNode,A,g,B)}getSingleProof(A){return ar(this.rootNode,A)[1]}getProof(A){return cr(this.rootNode,A)}}function RC(I,A){const g=Wi(A);let B=I;for(let i=1;i<g.length;i++){if(B.isLeaf())throw new Error(`Invalid tree - found leaf at depth ${i}`);B=g[i]==="1"?B.right:B.left}return B}function DU(I,A,g){const B=Wi(A),i=sr(I,B);return hr(B,i,g)}function cU(I,A,g){const B=Wi(A),i=sr(I,B),Q=i.at(-1);if(!Q)throw new Error("Invalid tree - can not find last parent");const C=B.at(-1)==="1"?Q.right:Q.left,e=g(C);return hr(B,i,e)}function sr(I,A){let g=I;const B=[I];for(let i=1;i<A.length-1;i++)A[i]==="1"?g=g.right:g=g.left,B.push(g);return B}function hr(I,A,g){let B=g;for(let i=I.length-1;i>=1;i--)I[i]==="1"?B=new jA(A[i-1].left,B):B=new jA(B,A[i-1].right);return B}function mI(I,A,g){if(A===0)return I;if(A===1)return g===0?I.left:I.right;const B=A-1,i=0;let Q=I;for(let C=B;C>=i;C--)Q=rB(C,g)?Q.left:Q.right;return Q}function UU(I,A,g,B){return GC(I,A,[g],[B])}function GC(I,A,g,B,i=0,Q=null){if(A===0)return B.length>0?B[0]:I;const C=new Array(A),e=new Array(A),o=A-1,c=0;let a=o,f=I;C[o]=I;for(let R=0;R<g.length;R++){const y=g[R];for(let u=a;u>c;u--)f=rB(u,y)?f.left:f.right,C[u-1]=f;if(a=c,(y&1)!==1)if(y+1===g[R+1])f=new jA(B[R],B[R+1]),Q!=null&&qI(Q,A-1+i).push(B[R],B[R+1],f),R++;else{const u=f;f=new jA(B[R],u.right),Q!=null&&qI(Q,A-1+i).push(B[R],u.right,f)}else{const u=f;f=new jA(u.left,B[R]),Q!=null&&qI(Q,A-1+i).push(u.left,B[R],f)}const G=R>=g.length-1,S=G?o:SU(y,g[R+1]);for(let u=c+1;u<=S;u++){const N=A-u-1;if(N<0)throw Error(`Invalid depth ${N}, d=${u}, nodesDepth=${A}`);if(rB(u,y))if(G||u!==S){const w=f;f=new jA(w,C[u].right),Q!=null&&qI(Q,N+i).push(w,C[u].right,f)}else e[u]=f,f=C[u];else{const w=e[u];if(w!==void 0){const J=f;f=new jA(w,J),Q!=null&&qI(Q,N+i).push(w,J,f),e[u]=void 0}else{const J=f;f=new jA(C[u].left,J),Q!=null&&qI(Q,N+i).push(C[u].left,J,f)}}}a=S}return f}function tI(I,A,g,B){if(A===0)return g===0&&B>0?[I]:[];if(A===1)return B===0?[]:B===1?g===0?[I.left]:[I.right]:[I.left,I.right];const i=A-1,Q=0;let C=i,e=I;const o=new Array(A),c=new Array(A),a=new Array(B);o[i]=I;for(let f=0;f<B;f++){for(let R=C;R>=Q;R--){R!==C&&(o[R]=e);const y=rB(R,g+f);c[R]=y,e=y?e.left:e.right}a[f]=e;for(let R=Q;R<=i;R++)if(c[R]===!0){C=R;break}e=o[C]}return a}function*fU(I,A,g,B){const i=g+B,Q=A-1,C=0;let e=Q,o=I;const c=new Array(A),a=new Array(A);c[Q]=I;for(let f=g;f<i;f++){for(let R=e;R>=C;R--){R!==e&&(c[R]=o);const y=rB(R,f);a[R]=y,o=y?o.left:o.right}yield o;for(let R=C;R<=Q;R++)if(a[R]===!0){e=R;break}o=c[e]}}function lr(I,A,g){if(g<0)return oB(A);const B=new Array(A),i=A-1,Q=0;let C=i,e=I;B[i]=I;for(let o=C;o>=Q;o--)e=rB(o,g)?e.left:e.right,B[o-1]=e;C=Q;for(let o=Q;o<=i;o++)rB(o,g)?e=new jA(e,oB(o)):e=new jA(B[o].left,e);return e}const UQ=4294967295,Dr=2**32;function SU(I,A){if(I===A||I<0||A<0)throw Error(`Expect different positive inputs, from=${I} to=${A}`);const g=Math.ceil(Math.log2(I+1)),B=Math.ceil(Math.log2(A+1));if(g!==B)return Math.max(g,B)-1;if(g>32){const i=Math.floor(I/Dr)&UQ,Q=Math.floor(A/Dr)&UQ;return i===Q?ie(I&UQ,A&UQ):32+ie(i,Q)}return ie(I,A)}function rB(I,A){if(I>31){const B=A/4294967296>>>0,i=1<<I-32;return(B&i)!==i}const g=1<<I;return(A&g)!==g}function ie(I,A){const g=I^A;if(g===0)throw Error(`Do not support equal value from=${I} to=${A}`);return(g<0?32:Math.ceil(Math.log2(g+1)))-1}function wU(I,A){const g=new NI(I),B=Be(A.map(e=>e.toString(2)),!1,mg.Decreasing),i=A.slice().sort((e,o)=>e<o?1:-1),Q=i.map(e=>g.getRoot(e)),C=B.map(e=>g.getRoot(e));return[Q,C,i]}function yU(I,A,g){if(I.length!==g.length)throw new Error("Leaves length should equal gindices length");const B=g.map(o=>o.toString(2)),i=Be(B,!1,mg.Decreasing);if(i.length!==A.length)throw new Error("Witnesses length should equal witnesses gindices length");const Q=Math.max(B[0]?.length??0,i[0]?.length??0),C=Object.fromEntries(Array.from({length:Q},(o,c)=>[c+1,{}]));for(let o=0;o<B.length;o++){const c=B[o],a=I[o];C[c.length][c]=KA.fromRoot(a)}for(let o=0;o<i.length;o++){const c=i[o],a=A[o];C[c.length][c]=KA.fromRoot(a)}for(let o=Q;o>1;o--){const c=C[o],a=C[o-1];for(const f of Object.keys(c)){const R=c[f];if(!R)continue;const y=f.at(-1)==="0",G=f.substring(0,f.length-1),S=G+(y?"1":"0"),u=c[S];if(!u)throw new Error(`Sibling not found: ${S}`);const N=y?new jA(R,u):new jA(u,R);a[G]=N,delete c[f],delete c[S]}}const e=C[1][1];if(!e)throw new Error("Internal consistency error: no root found");return e}function ee(I,A,g){if(!g.length||!g[0].startsWith(A))return[[],[]];if(A===g[0])return g.shift(),[[],[I.root]];const[B,i]=ee(I.left,`${A}0`,g),[Q,C]=ee(I.right,`${A}1`,g);return[[i.length].concat(B,Q),i.concat(C)]}function te(I,A){if(!A.length)throw new Error("Proof must contain gt 0 leaves");if(A.length===1)return KA.fromRoot(A[0]);const g=I[0];return new jA(te(I.slice(1,g),A.slice(0,g)),te(I.slice(g),A.slice(g)))}function NU(I,A){return ee(I,"1",Be(A.map(g=>g.toString(2))))}function dU(I,A){return te(I,A)}var ZA;(function(I){I.single="single",I.treeOffset="treeOffset",I.multi="multi",I.compactMulti="compactMulti"})(ZA||(ZA={})),ZA.single,ZA.treeOffset,ZA.multi,ZA.compactMulti;function cr(I,A){switch(A.type){case ZA.single:{const[g,B]=ar(I,A.gindex);return{type:ZA.single,gindex:A.gindex,leaf:g,witnesses:B}}case ZA.treeOffset:{const[g,B]=NU(I,A.gindices);return{type:ZA.treeOffset,offsets:g,leaves:B}}case ZA.multi:{const[g,B,i]=wU(I,A.gindices);return{type:ZA.multi,leaves:g,witnesses:B,gindices:i}}case ZA.compactMulti:{const g=sU(I,A.descriptor);return{type:ZA.compactMulti,leaves:g,descriptor:A.descriptor}}default:throw new Error("Invalid proof type")}}function uU(I){switch(I.type){case ZA.single:return lU(I.gindex,I.leaf,I.witnesses);case ZA.treeOffset:return dU(I.offsets,I.leaves);case ZA.multi:return yU(I.leaves,I.witnesses,I.gindices);case ZA.compactMulti:return hU(I.leaves,I.descriptor);default:throw new Error("Invalid proof type")}}function RU(I,A,g){if(g<0)throw new Error(`Expect count to be non-negative, got ${g}`);return{finalized:(g>0?GU(A,g-1):[]).map(B=>RC(I,B).root),count:g}}function GU(I,A){if(A<0||I<0)throw new Error(`Expect index and depth to be non-negative, got ${A} and ${I}`);const g=Array.from({length:I+1},()=>0);let B=A+1;const i=[];for(;B>0;){const Q=Math.floor(Math.log2(B)),C=2**Q,e=I-Q,o=pg(e,BigInt(g[e]));i.push(o);for(let c=0;c<=Q;c++)g[e+c]+=Math.pow(2,c);B-=C}return i}const Lg=Symbol("ssz_cached_permanent_root");function Ee(I,A,g,B){const i=B&&A.length===32&&g===0?A:B?A.subarray(g,g+32):Uint8Array.prototype.slice.call(A,g,g+32);I[Lg]=i}function FU(I,A){return tB.digest64(I,A)}function ag(I){return I===0?0:Math.ceil(Math.log2(I))}function dI(I,A){return new Function("superClass",`return class ${A} extends superClass {}`)(I)}const oe=new Array(256);class sg{uint8Array;bitLen;constructor(A,g){if(this.uint8Array=A,this.bitLen=g,A.length!==Math.ceil(g/8))throw Error("BitArray uint8Array length does not match bitLen")}static fromBitLen(A){return new sg(new Uint8Array(Math.ceil(A/8)),A)}static fromSingleBit(A,g){const B=sg.fromBitLen(A);return B.set(g,!0),B}static fromBoolArray(A){const g=sg.fromBitLen(A.length);for(let B=0;B<A.length;B++)A[B]===!0&&g.set(B,!0);return g}clone(){return new sg(Uint8Array.prototype.slice.call(this.uint8Array,0),this.bitLen)}get(A){const g=Math.floor(A/8),B=1<<A%8;return(this.uint8Array[g]&B)===B}set(A,g){if(A>=this.bitLen)throw Error(`BitArray set bitIndex ${A} beyond bitLen ${this.bitLen}`);const B=Math.floor(A/8),i=1<<A%8;let Q=this.uint8Array[B];g?(Q|=i,this.uint8Array[B]=Q):(Q&i)===i&&(Q^=i,this.uint8Array[B]=Q)}mergeOrWith(A){if(A.bitLen!==this.bitLen)throw Error("Must merge BitArrays of same bitLen");for(let g=0;g<this.uint8Array.length;g++)this.uint8Array[g]=this.uint8Array[g]|A.uint8Array[g]}intersectValues(A){const g=[];if(A.length!==this.bitLen)throw Error(`Must not intersect values of length ${A.length} != bitLen ${this.bitLen}`);const B=Math.floor(this.bitLen/8),i=this.bitLen%8,Q=this.uint8Array;for(let C=0;C<B;C++){const e=fQ(Q[C]);for(let o=0;o<8;o++)e[o]&&g.push(A[C*8+o])}if(i>0){const C=fQ(Q[B]);for(let e=0;e<i;e++)C[e]&&g.push(A[B*8+e])}return g}getTrueBitIndexes(){const A=[],g=this.uint8Array;for(let B=0,i=g.length;B<i;B++){const Q=fQ(g[B]);for(let C=0;C<8;C++)Q[C]&&A.push(B*8+C)}return A}getSingleTrueBit(){let A=null;const g=this.uint8Array;for(let B=0,i=g.length;B<i;B++){if(g[B]===0)continue;const Q=fQ(g[B]);for(let C=0;C<8;C++)if(Q[C]===!0){if(A!==null)return null;A=B*8+C}}return A===null?null:A}toBoolArray(){const A=new Array(this.bitLen);for(let g=0;g<this.bitLen;g++)A[g]=this.get(g);return A}}function fQ(I){return oe[I]||(oe[I]=kU(I)),oe[I]}function kU(I){const A=I.toString(2),g=A.length,B=new Array(8);for(let i=0;i<8;i++)B[i]=i<g?A[g-i-1]==="1":!1;return B}function nB(I){return I.right.getUint(4,0)}function Ur(I){return I.left}function aB(I,A){return new jA(I,KA.fromUint32(A))}function fr(I,A,g,B=0,i=null){const Q=g!==null?KA.fromUint32(g):I.right,C=new jA(A,Q);return i!==null&&qI(i,B).push(A,Q,C),C}function SQ(I,A,g,B,i){const Q=I.byteLength;for(let C=0;C<A;C++)I.value_serializeToBytes(g,B+C*Q,i[C]);return B+A*Q}function Sr(I,A,g,B,i){const Q=I.byteLength,C=(B-g)/Q;wQ(C,i,!0);const e=new Array(C);for(let o=0;o<C;o++)e[o]=I.value_deserializeFromBytes(A,g+o*Q,g+(o+1)*Q);return e}function re(I,A,g,B,i,Q,C=null){const e=I.byteLength*A,o=Math.ceil(e/32),c=C??tI(Q,g,0,o);return uC(B.dataView,i,e,c),i+e}function wr(I,A,g,B,i,Q){const C=(i-B)/I.byteLength;wQ(C,Q,!0);const e=dC(A,g.dataView,B,i);return Q.isList?aB(e,C):e}function JU(I,A,g){if(!Array.isArray(A))throw Error("JSON is not an array");wQ(A.length,g);const B=new Array(A.length);for(let i=0;i<A.length;i++)B[i]=I.fromJson(A[i]);return B}function pU(I,A,g){const B=g.isList?A.length:g.length,i=new Array(B);for(let Q=0;Q<B;Q++)i[Q]=I.toJson(A[Q]);return i}function HU(I,A){const g=new Array(A.length);for(let B=0;B<A.length;B++)g[B]=I.clone(A[B]);return g}function MU(I,A,g){if(A.length!==g.length)return!1;for(let B=0;B<A.length;B++)if(!I.equals(A[B],g[B]))return!1;return!0}function mU(I,A){const g=new Array(A);for(let B=0;B<A;B++)g[B]=I.defaultValue();return g}function wQ(I,A,g){if(g&&I%1!==0)throw Error("size not multiple of element fixedSize");if(A.isList){if(I>A.limit)throw new Error(`Invalid list length ${I} over limit ${A.limit}`)}else if(I!==A.length)throw new Error(`Incorrect vector length ${I} expected ${A.length}`)}const ne=new Array(256);function yr(I){let A="0x";for(const g of I)ne[g]||(ne[g]=g<16?`0${g.toString(16)}`:g.toString(16)),A+=ne[g];return A}function Nr(I){if(typeof I!="string")throw new Error(`hex argument type ${typeof I} must be of type string`);if(I.startsWith("0x")&&(I=I.slice(2)),I.length%2!==0)throw new Error(`hex string length ${I.length} must be multiple of 2`);const A=I.length/2,g=new Uint8Array(A);for(let B=0;B<A;B++){const i=parseInt(I.slice(B*2,(B+1)*2),16);g[B]=i}return g}function hg(I,A){if(I.length!==A.length)return!1;for(let g=0;g<I.length;g++)if(I[g]!==A[g])return!1;return!0}class jB{serialize(){const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.type.tree_serializeToBytes({uint8Array:A,dataView:g},0,this.node),A}hashTreeRoot(){return this.node.root}createProof(A){return this.type.tree_createProof(this.node,A)}toValue(){return this.type.tree_toValue(this.node)}clone(){return this.type.getView(new NI(this.node))}}class LU extends jB{type;tree;bitArray;constructor(A,g){super(),this.type=A,this.tree=g,this.bitArray=A.tree_toValue(g.rootNode)}get node(){return this.tree.rootNode}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g),this.tree.rootNode=this.type.value_toTree(this.bitArray)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}}const dr=Symbol("ssz_cached_tree_root");class FC extends jB{serializeToBytes(A,g){return this.type.tree_serializeToBytes(A,g,this.node)}hashTreeRoot(){return this.commit(),super.hashTreeRoot()}batchHashTreeRoot(A=new iU){A.reset(),this.commit(0,A.byLevel),A.clean();const g=this.node[dr];if(g)return g;if(CU(A.byLevel),this.node.h0===null)throw Error("Root is not computed by batch");const B=this.node.root;return this.node[dr]=B,B}serialize(){this.commit();const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.serializeToBytes({uint8Array:A,dataView:g},0),A}clone(A){if(A)return this.type.getViewDU(this.node);const g=this.cache;return this.clearCache(),this.type.getViewDU(this.node,g)}}class KU extends FC{type;_rootNode;_bitArray=null;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get bitArray(){return this._bitArray===null&&(this._bitArray=this.type.tree_toValue(this._rootNode)),this._bitArray}commit(A=0,g=null){this._bitArray!==null&&(this._rootNode=this.type.value_toTree(this._bitArray)),g!==null&&this._rootNode.h0===null&&aI(this._rootNode,A,g)}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}clearCache(){this._bitArray=null}}function ur(I){return!I.isBasic}function yQ(I,A,g="",B=0){if(B===0){const e=A.tree_fromProofNode(I);if(e.done)return e.node;I=e.node}const i=A.depth===B;if(I.isLeaf()){if(i){const e=A.getIndexProperty(Rr(g));if(e===null)return I;const o=A.getPropertyType(e);return o.maxChunkCount===1&&ur(o)?o.tree_fromProofNode(I).node:I}return I}if(i){const e=A.getIndexProperty(Rr(g));if(e===null)return I;const o=A.getPropertyType(e);if(!ur(o))throw Error("BranchNode does not map to CompositeType");const c=o.tree_fromProofNode(I);return c.done?c.node:yQ(c.node,o)}const Q=yQ(I.left,A,`${g}0`,B+1),C=yQ(I.right,A,`${g}1`,B+1);return Q===I.left&&C===I.right?I:new jA(Q,C)}function Rr(I){return I===""?0:parseInt(I,2)}class Gr{value_toTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),this.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}tree_toValue(A){const g=new Uint8Array(this.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.tree_serializeToBytes({uint8Array:g,dataView:B},0,A),this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}serialize(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),g}deserialize(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.value_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}}const ae=BigInt(3);class NQ extends Gr{cachePermanentRootStruct;isBasic=!1;blocksBuffer=new Uint8Array(0);constructor(A){super(),this.cachePermanentRootStruct=A}defaultView(){return this.toView(this.defaultValue())}defaultViewDU(){return this.toViewDU(this.defaultValue())}deserializeToView(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getView(new NI(B))}deserializeToViewDU(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getViewDU(B)}toView(A){const g=this.value_toTree(A);return this.getView(new NI(g))}toViewDU(A){const g=this.value_toTree(A);return this.getViewDU(g)}toValueFromView(A){const g=this.commitView(A);return this.tree_toValue(g)}toValueFromViewDU(A){const g=this.commitViewDU(A);return this.tree_toValue(g)}toViewFromViewDU(A){const g=this.commitViewDU(A);return this.getView(new NI(g))}toViewDUFromView(A){const g=this.commitView(A);return this.getViewDU(g)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Lg];if(B)return B}const g=YB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,i=!1){if(this.cachePermanentRootStruct){const C=A[Lg];if(C){g.set(C,B);return}}const Q=this.getBlocksBytes(A);yC(Q,this.maxChunkCount,g,B),this.cachePermanentRootStruct&&Ee(A,g,B,i)}getCachedPermanentRoot(A){return A[Lg]}createFromProof(A,g){const B=NI.createFromProof(A).rootNode,i=yQ(B,this);if(g!==void 0&&!hg(i.root,g))throw new Error("Proof does not match trusted root");return this.getView(new NI(i))}tree_createProof(A,g){const B=this.tree_createProofGindexes(A,g);return cr(A,{type:ZA.treeOffset,gindices:B})}tree_createProofGindexes(A,g){const B=[];for(const i of g){const{type:Q,gindex:C}=this.getPathInfo(i);if(!lg(Q))B.push(C);else{const e=Q.tree_getLeafGindices(C,Q.fixedSize===null?RC(A,C):void 0);for(const o of e)B.push(o)}}return B}getPathInfo(A){const g=[];let B=this;for(const i of A){if(B.isBasic)throw new Error("Invalid path: cannot navigate beyond a basic type");const Q=B.getPropertyGindex(i);Q!==null&&(g.push(Q),B=B.getPropertyType(i))}return{type:B,gindex:ng(g)}}tree_fromProofNode(A){return{node:A,done:!1}}}function lg(I){return!I.isBasic}class Fr extends NQ{isViewMutable=!1;defaultValue(){return new Uint8Array(this.minSize)}getView(A){return this.getViewDU(A.rootNode)}getViewDU(A){return this.tree_toValue(A)}commitView(A){return this.commitViewDU(A)}commitViewDU(A,g=0,B=null){const i=new Uint8Array(this.value_serializedSize(A)),Q=new DataView(i.buffer,i.byteOffset,i.byteLength);this.value_serializeToBytes({uint8Array:i,dataView:Q},0,A);const C=this.tree_deserializeFromBytes({uint8Array:i,dataView:Q},0,i.length);return B!==null&&C.h0===null&&aI(C,g,B),C}cacheOfViewDU(){}toView(A){return A}toViewDU(A){return A}value_serializeToBytes(A,g,B){return A.uint8Array.set(B,g),g+B.length}value_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),Uint8Array.prototype.slice.call(A.uint8Array,g,B)}value_toTree(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}getBlocksBytes(A){if(A.length>this.blocksBuffer.length){const g=Math.ceil(A.length/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return kr(A,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request ByteArray complete data")}getIndexProperty(){throw Error("Must only request ByteArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),i=Math.ceil(B/32),Q=ng([A,pg(this.depth,BigInt(0))]),C=new Array(i);for(let e=0,o=Q;e<i;e++,o++)C[e]=o;return this.isList&&C.push(ng([A,ae])),C}fromJson(A){const g=Nr(A);return this.assertValidSize(g.length),g}toJson(A){return yr(A)}clone(A){return A}equals(A,g){return hg(A,g)}}function kr(I,A){if(I.length>A.length)throw new Error(`data length ${I.length} exceeds blocksBuffer length ${A.length}`);A.set(I);const g=I.length,B=Math.ceil(g/64)*64;return A.subarray(g,B).fill(0),A.subarray(0,B)}class Jr extends NQ{isViewMutable=!0;getView(A){return new LU(this,A)}getViewDU(A){return new KU(this,A)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}getBlocksBytes(A){if(A.uint8Array.length>this.blocksBuffer.length){const g=Math.ceil(A.bitLen/8/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return kr(A.uint8Array,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request BitArray complete data")}getIndexProperty(){throw Error("Must only request BitArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),i=Math.ceil(B/32),Q=ng([A,pg(this.depth,BigInt(0))]),C=new Array(i);for(let e=0,o=Q;e<i;e++,o++)C[e]=o;return this.isList&&C.push(ng([A,ae])),C}fromJson(A){const g=Nr(A),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}toJson(A){return yr(this.serialize(A))}clone(A){return A.clone()}equals(A,g){return A.bitLen===g.bitLen&&hg(A.uint8Array,g.uint8Array)}}class dQ extends Jr{limitBits;typeName;depth;chunkDepth;fixedSize=null;minSize=1;maxSize;maxChunkCount;isList=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBits=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`BitList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBits/8/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=1+this.chunkDepth,this.maxSize=Math.ceil(A/8)+1}static named(A,g){return new(dI(dQ,g.typeName))(A,g)}defaultValue(){return sg.fromBitLen(0)}value_serializedSize(A){return pr(A.bitLen)}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),Hr(A.uint8Array,g,B.bitLen)}value_deserializeFromBytes(A,g,B){const{uint8Array:i,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B);return new sg(i,Q)}tree_serializedSize(A){return pr(nB(A))}tree_serializeToBytes(A,g,B){const i=Ur(B),Q=nB(B),C=Math.ceil(Q/8),e=Math.ceil(C/32),o=tI(i,this.chunkDepth,0,e);return uC(A.dataView,g,C,o),Hr(A.uint8Array,g,Q)}tree_deserializeFromBytes(A,g,B){const{uint8Array:i,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B),C=new DataView(i.buffer,i.byteOffset,i.byteLength),e=dC(this.chunkDepth,C,0,i.length);return aB(e,Q)}tree_getByteLen(A){if(!A)throw new Error("BitListType requires a node to get leaves");return Math.ceil(nB(A)/8)}hashTreeRoot(A){const g=YB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.bitLen,32,6),yC(this.mixInLengthBlockBytes,2,g,B)}deserializeUint8ArrayBitListFromBytes(A,g,B){const{uint8Array:i,bitLen:Q}=YU(A,g,B);if(Q>this.limitBits)throw Error(`bitLen over limit ${Q} > ${this.limitBits}`);return{uint8Array:i,bitLen:Q}}}function YU(I,A,g){if(g>I.length)throw Error(`BitList attempting to read byte ${g} of data length ${I.length}`);const B=I[g-1],i=g-A;if(B===0)throw new Error("Invalid deserialized bitlist, padding bit required");if(B===1){const c=Uint8Array.prototype.slice.call(I,A,g-1),a=(i-1)*8;return{uint8Array:c,bitLen:a}}const Q=Uint8Array.prototype.slice.call(I,A,g),C=B.toString(2).length-1,e=(i-1)*8+C,o=255>>8-C;return Q[i-1]&=o,{uint8Array:Q,bitLen:e}}function pr(I){const A=Math.ceil(I/8);return I%8===0?A+1:A}function Hr(I,A,g){const B=Math.ceil(g/8),i=A+B;return g%8===0?(I[i]=1,i+1):(I[i-1]|=1<<g%8,i)}class $I extends Jr{lengthBits;typeName;chunkCount;depth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;zeroBitsMask;constructor(A,g){if(super(),this.lengthBits=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`BitVector[${A}]`,this.chunkCount=Math.ceil(this.lengthBits/8/32),this.maxChunkCount=this.chunkCount,this.depth=ag(this.chunkCount),this.fixedSize=Math.ceil(this.lengthBits/8),this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.zeroBitsMask=A%8===0?0:255&255<<A%8}static named(A,g){return new(dI($I,g.typeName))(A,g)}defaultValue(){return sg.fromBitLen(this.lengthBits)}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),g+this.fixedSize}value_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),new sg(Uint8Array.prototype.slice.call(A.uint8Array,g,B),this.lengthBits)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const i=tI(B,this.depth,0,this.chunkCount);return uC(A.dataView,g,this.fixedSize,i),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),dC(this.depth,A.dataView,g,B)}tree_getByteLen(){return this.fixedSize}assertValidLength(A,g,B){const i=B-g;if(B-g!==this.fixedSize)throw Error(`Invalid BitVector size ${i} != ${this.fixedSize}`);if(this.zeroBitsMask>0&&(A[B-1]&this.zeroBitsMask)>0)throw Error("BitVector: nonzero bits past length")}}class uQ extends Gr{isBasic=!0;depth=0;maxChunkCount=1;value_serializedSize(){return this.byteLength}tree_serializedSize(){return this.byteLength}assertValidSize(A){if(A!==this.byteLength)throw Error(`BasicType invalid size ${A} expected ${this.byteLength}`)}hashTreeRoot(A){const g=new Uint8Array(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){const i=g.subarray(B,B+32);i.fill(0);const Q=new DataView(i.buffer,i.byteOffset,i.byteLength);this.value_serializeToBytes({uint8Array:i,dataView:Q},0,A)}clone(A){return A}equals(A,g){return A===g}}function se(I){return I.isBasic}class he extends uQ{typeName;byteLength=1;itemsPerChunk=32;fixedSize=1;minSize=1;maxSize=1;constructor(A){super(),this.typeName=A?.typeName??"boolean"}static named(A){return new(dI(he,A.typeName))(A)}defaultValue(){return!1}value_serializeToBytes(A,g,B){return A.uint8Array[g]=B?1:0,g+1}value_deserializeFromBytes(A,g,B){switch(this.assertValidSize(B-g),A.uint8Array[g]){case 1:return!0;case 0:return!1;default:throw new Error(`Boolean: invalid value: ${A.uint8Array[g]}`)}}tree_serializeToBytes(A,g,B){return A.uint8Array[g]=B.getUint(4,0),g+1}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const i=A.uint8Array[g];if(i>1)throw Error(`Boolean: invalid value ${i}`);return KA.fromUint32(i)}tree_getFromNode(A){return A.getUint(4,0)===1}tree_setToNode(A,g){A.setUint(4,0,g?1:0)}tree_getFromPackedNode(A,g){const B=g%this.itemsPerChunk;return A.getUint(1,B)!==0}tree_setToPackedNode(A,g,B){const i=g%this.itemsPerChunk;A.setUint(1,i,B?1:0)}fromJson(A){if(typeof A!="boolean")throw Error(`JSON invalid type ${typeof A} expected boolean`);return A}toJson(A){return A}}class kC extends Fr{limitBytes;typeName;depth;chunkDepth;fixedSize=null;minSize;maxSize;maxChunkCount;isList=!0;blockArray=[];blockBytesLen=0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBytes=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`ByteList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBytes/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=1+this.chunkDepth,this.minSize=0,this.maxSize=this.limitBytes}static named(A,g){return new(dI(kC,g.typeName))(A,g)}value_serializedSize(A){return A.length}tree_serializedSize(A){return nB(A)}tree_serializeToBytes(A,g,B){const i=Ur(B),Q=nB(B),C=Math.ceil(Q/32),e=tI(i,this.chunkDepth,0,C);return uC(A.dataView,g,Q,e),g+Q}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const i=dC(this.chunkDepth,A.dataView,g,B);return aB(i,B-g)}tree_getByteLen(A){if(!A)throw new Error("ByteListType requires a node to get leaves");return nB(A)}hashTreeRoot(A){const g=YB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){if(A.length>this.blockBytesLen){const Q=Math.ceil(A.length/64),C=Math.ceil(this.blockBytesLen/64),e=Q-C,o=new Uint8Array(e*64);for(let c=0;c<e;c++)this.blockArray.push(o.subarray(c*64,(c+1)*64)),this.blockBytesLen+=64}for(let Q=0;Q<A.length;Q+=64){const C=this.blockArray[Q/64];Q+64>A.length&&C.fill(0),C.set(A.subarray(Q,Math.min(Q+64,A.length)))}const i=Math.ceil(A.length/64);tr(this.blockArray,i,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),yC(this.mixInLengthBlockBytes,2,g,B)}assertValidSize(A){if(A>this.limitBytes)throw Error(`ByteList invalid size ${A} limit ${this.limitBytes}`)}}class uI extends Fr{lengthBytes;typeName;depth;chunkDepth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;constructor(A,g){if(super(),this.lengthBytes=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`ByteVector[${A}]`,this.maxChunkCount=Math.ceil(this.lengthBytes/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=this.lengthBytes,this.minSize=this.fixedSize,this.maxSize=this.fixedSize}static named(A,g){return new(dI(uI,g.typeName))(A,g)}value_serializedSize(){return this.fixedSize}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const i=tI(B,this.chunkDepth,0,this.maxChunkCount);return uC(A.dataView,g,this.fixedSize,i),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),dC(this.chunkDepth,A.dataView,g,B)}tree_getByteLen(){return this.lengthBytes}assertValidSize(A){if(A!==this.lengthBytes)throw Error(`ByteVector invalid size ${A} expected ${this.lengthBytes}`)}}const Mr={snake:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1].toLowerCase()}`),constant:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1]}`).toUpperCase(),pascal:I=>(I[0].toUpperCase()+I.slice(1)).replace(/[^0-z]/g,""),camel:I=>I[0].toLowerCase()+I.slice(1),header:I=>I[0].toUpperCase()+I.slice(1).replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}-${A[1]}`),eth2:I=>Mr.snake(I).replace(/(\d)$/,"_$1")};let bU=class extends jB{type;tree;constructor(I,A){super(),this.type=I,this.tree=A}get node(){return this.tree.rootNode}};function TU(I){class A extends bU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(se(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=mI(this.node,this.type.depth,g);return i.tree_getFromNode(Q)},set:function(Q){const C=mI(this.node,this.type.depth,g).clone();i.tree_setToNode(C,Q),this.tree.setNodeAtDepth(this.type.depth,g,C)}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=vi(this.type.depth,g);return i.getView(this.tree.getSubtree(Q))},set:function(Q){const C=i.commitView(Q);this.tree.setNodeAtDepth(this.type.depth,g,C)}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class qU extends FC{type;_rootNode;nodes=[];caches;nodesChanged=new Set;viewsChanged=new Map;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this.nodesPopulated=!1)}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,nodesPopulated:this.nodesPopulated}}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0&&this.viewsChanged.size===0){!B&&g!==null&&aI(this._rootNode,A,g);return}const i=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[a,f]of this.viewsChanged){const R=this.type.fieldsEntries[a].fieldType,y=R.commitViewDU(f,i,Q);this.nodes[a]!==y&&(this.nodes[a]=y,C.push({index:a,node:y}));const G=R.cacheOfViewDU(f);G&&(this.caches[a]=G)}for(const a of this.nodesChanged)C.push({index:a,node:this.nodes[a]});const e=C.sort((a,f)=>a.index-f.index),{indexes:o,nodes:c}=this.parseNodesChanged(e);this._rootNode=GC(this._rootNode,this.type.depth,o,c,A,B?g:null),!B&&g!==null&&aI(this._rootNode,A,g),this.nodesChanged.clear(),this.viewsChanged.clear()}parseNodesChanged(A){const g=A.map(i=>i.index),B=A.map(i=>i.node);return{indexes:g,nodes:B}}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.viewsChanged.clear()}}class VU extends qU{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}serializeToBytes(A,g){this.commit();let B=g,i=g+this.type.fixedEnd;for(let Q=0;Q<this.type.fieldsEntries.length;Q++){const{fieldType:C}=this.type.fieldsEntries[Q];let e=this.nodes[Q];if(e===void 0&&(e=mI(this._rootNode,this.type.depth,Q),this.nodes[Q]=e),C.fixedSize===null){if(A.dataView.setUint32(B,i-g,!0),B+=4,lg(C)){const o=C.getViewDU(e,this.caches[Q]);o.serializeToBytes!==void 0?i=o.serializeToBytes(A,i):i=C.tree_serializeToBytes(A,i,e)}}else B=C.tree_serializeToBytes(A,B,e)}return i}}function jU(I){class A extends VU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(se(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){let Q=this.nodes[g];return Q===void 0&&(Q=mI(this._rootNode,this.type.depth,g),this.nodes[g]=Q),i.tree_getFromNode(Q)},set:function(Q){let C;this.nodesChanged.has(g)?C=this.nodes[g]:(C=(this.nodes[g]??mI(this._rootNode,this.type.depth,g)).clone(),this.nodes[g]=C,this.nodesChanged.add(g)),i.tree_setToNode(C,Q)}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.viewsChanged.get(g);if(Q)return Q;let C=this.nodes[g];C===void 0&&(C=mI(this._rootNode,this.type.depth,g),this.nodes[g]=C);const e=i.getViewDU(C,this.caches[g]);return i.isViewMutable&&this.viewsChanged.set(g,e),e},set:function(Q){this.viewsChanged.set(g,Q)}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class Y extends NQ{fields;opts;typeName;depth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;fieldsEntries;fixedEnd;fieldsGindex;jsonKeyToFieldName;isFixedLen;fieldRangesFixedLen;variableOffsetsPosition;TreeView;TreeViewDU;constructor(A,g){super(g?.cachePermanentRootStruct),this.fields=A,this.opts=g,this.typeName=g?.typeName??mr(A),this.maxChunkCount=Object.keys(A).length,this.depth=ag(this.maxChunkCount),this.fieldsEntries=[];for(const f of Object.keys(A))this.fieldsEntries.push({fieldName:f,fieldType:this.fields[f],jsonKey:OU(f,g?.casingMap,g?.jsonCase),gindex:pg(this.depth,BigInt(this.fieldsEntries.length))});if(this.fieldsEntries.length===0)throw Error("Container must have > 0 fields");this.fieldsGindex={};for(let f=0;f<this.fieldsEntries.length;f++)this.fieldsGindex[this.fieldsEntries[f].fieldName]=pg(this.depth,BigInt(f));this.jsonKeyToFieldName={};for(const{fieldName:f,jsonKey:R}of this.fieldsEntries)this.jsonKeyToFieldName[R]=f;const{minLen:B,maxLen:i,fixedSize:Q}=PU(A);this.minSize=B,this.maxSize=i,this.fixedSize=Q;const{isFixedLen:C,fieldRangesFixedLen:e,variableOffsetsPosition:o,fixedEnd:c}=_U(A);this.isFixedLen=C,this.fieldRangesFixedLen=e,this.variableOffsetsPosition=o,this.fixedEnd=c,this.TreeView=g?.getContainerTreeViewClass?.(this)??TU(this),this.TreeViewDU=g?.getContainerTreeViewDUClass?.(this)??jU(this);const a=this.fieldsEntries.length*32;this.blocksBuffer=new Uint8Array(Math.ceil(a/64)*64)}static named(A,g){return new(dI(Y,g.typeName))(A,g)}defaultValue(){const A={};for(const{fieldName:g,fieldType:B}of this.fieldsEntries)A[g]=B.defaultValue();return A}getView(A){return new this.TreeView(this,A)}getViewDU(A,g){return new this.TreeViewDU(this,A,g)}cacheOfViewDU(A){return A.cache}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}value_serializedSize(A){let g=0;for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q}=this.fieldsEntries[B];g+=Q.fixedSize===null?4+Q.value_serializedSize(A[i]):Q.fixedSize}return g}value_serializeToBytes(A,g,B){let i=g,Q=g+this.fixedEnd;for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:e,fieldType:o}=this.fieldsEntries[C];o.fixedSize===null?(A.dataView.setUint32(i,Q-g,!0),i+=4,Q=o.value_serializeToBytes(A,Q,B[e])):i=o.value_serializeToBytes(A,i,B[e])}return Q}value_deserializeFromBytes(A,g,B){const i=this.getFieldRanges(A.dataView,g,B),Q={};for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:e,fieldType:o}=this.fieldsEntries[C],c=i[C];Q[e]=o.value_deserializeFromBytes(A,g+c.start,g+c.end)}return Q}tree_serializedSize(A){let g=0;const B=tI(A,this.depth,0,this.fieldsEntries.length);for(let i=0;i<this.fieldsEntries.length;i++){const{fieldType:Q}=this.fieldsEntries[i],C=B[i];g+=Q.fixedSize===null?4+Q.tree_serializedSize(C):Q.fixedSize}return g}tree_serializeToBytes(A,g,B){let i=g,Q=g+this.fixedEnd;const C=tI(B,this.depth,0,this.fieldsEntries.length);for(let e=0;e<this.fieldsEntries.length;e++){const{fieldType:o}=this.fieldsEntries[e],c=C[e];o.fixedSize===null?(A.dataView.setUint32(i,Q-g,!0),i+=4,Q=o.tree_serializeToBytes(A,Q,c)):i=o.tree_serializeToBytes(A,i,c)}return Q}tree_deserializeFromBytes(A,g,B){const i=this.getFieldRanges(A.dataView,g,B),Q=new Array(this.fieldsEntries.length);for(let C=0;C<this.fieldsEntries.length;C++){const{fieldType:e}=this.fieldsEntries[C],o=i[C];Q[C]=e.tree_deserializeFromBytes(A,g+o.start,g+o.end)}return NC(Q,this.depth)}getBlocksBytes(A){for(let g=0;g<this.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=this.fieldsEntries[g];i.hashTreeRootInto(A[B],this.blocksBuffer,g*32)}return this.blocksBuffer}getPropertyGindex(A){const g=this.fieldsGindex[A]??this.fieldsGindex[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getPropertyType(A){const g=this.fields[A]??this.fields[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getIndexProperty(A){return A>=this.fieldsEntries.length?null:this.fieldsEntries[A].fieldName}tree_getLeafGindices(A,g){const B=[];for(let i=0;i<this.fieldsEntries.length;i++){const{fieldName:Q,fieldType:C}=this.fieldsEntries[i],e=this.fieldsGindex[Q],o=ng([A,e]);if(C.isBasic)B.push(o);else{const c=C;if(C.fixedSize===null){if(!g)throw new Error("variable type requires tree argument to get leaves");B.push(...c.tree_getLeafGindices(o,RC(g,e)))}else B.push(...c.tree_getLeafGindices(o))}}return B}fromJson(A){if(typeof A!="object")throw Error("JSON must be of type object");if(A===null)throw Error("JSON must not be null");const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q,jsonKey:C}=this.fieldsEntries[B],e=A[C];if(e===void 0)throw Error(`JSON expected key ${C} is undefined`);g[i]=Q.fromJson(e)}return g}toJson(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q,jsonKey:C}=this.fieldsEntries[B];g[C]=Q.toJson(A[i])}return g}clone(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q}=this.fieldsEntries[B];g[i]=Q.clone(A[i])}return g}equals(A,g){for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q}=this.fieldsEntries[B];if(!Q.equals(A[i],g[i]))return!1}return!0}getFieldRanges(A,g,B){if(this.variableOffsetsPosition.length===0){const o=B-g;if(o!==this.fixedEnd)throw Error(`${this.typeName} size ${o} not equal fixed size ${this.fixedEnd}`);return this.fieldRangesFixedLen}const i=ZU(A,g,B,this.fixedEnd,this.variableOffsetsPosition);i.push(B-g);let Q=0,C=0;const e=new Array(this.isFixedLen.length);for(let o=0;o<this.isFixedLen.length;o++)this.isFixedLen[o]?e[o]=this.fieldRangesFixedLen[C++]:(e[o]={start:i[Q],end:i[Q+1]},Q++);return e}}function ZU(I,A,g,B,i){const Q=g-A,C=new Array(i.length);for(let e=0;e<i.length;e++){const o=I.getUint32(A+i[e],!0);if(o>Q)throw new Error(`Offset out of bounds ${o} > ${Q}`);if(e===0){if(o!==B)throw new Error(`First offset must equal to fixedEnd ${o} != ${B}`)}else if(o<C[e-1])throw new Error(`Offsets must be increasing ${o} < ${C[e-1]}`);C[e]=o}return C}function _U(I){const A=[],g=[],B=[];let i=0;for(const Q of Object.values(I))A.push(Q.fixedSize!==null),Q.fixedSize===null?(B.push(i),i+=4):(g.push({start:i,end:i+Q.fixedSize}),i+=Q.fixedSize);return{isFixedLen:A,fieldRangesFixedLen:g,variableOffsetsPosition:B,fixedEnd:i}}function PU(I){let A=0,g=0,B=0;for(const i of Object.values(I))A+=i.minSize,g+=i.maxSize,i.fixedSize===null?(A+=4,g+=4,B=null):B!==null&&(B+=i.fixedSize);return{minLen:A,maxLen:g,fixedSize:B}}function OU(I,A,g){if(A){const B=A[I];if(B===void 0)throw Error(`casingMap[${String(I)}] not defined`);return B}return g?Mr[g](I):I}function mr(I,A="Container"){const g=Object.keys(I).map(B=>`${String(B)}: ${I[B].typeName}`).join(", ");return`${A}({${g}})`}class JC extends Ie{valueToNode;value;constructor(A,g){super(null,0,0,0,0,0,0,0),this.valueToNode=A,this.value=g}get rootHashObject(){if(this.h0===null){const A=this.valueToNode(this.value);super.applyHash(A.rootHashObject)}return this}get root(){return SC(this.rootHashObject)}get left(){return this.valueToNode(this.value).left}get right(){return this.valueToNode(this.value).right}isLeaf(){return!1}}class xU extends jB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get node(){return this.tree.rootNode}}function zU(I){class A extends xU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(i.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return this.tree.rootNode.value[B]},set:function(Q){const C=this.tree.rootNode,e=this.type.clone(C.value);e[B]=Q,this.tree.rootNode=new JC(C.valueToNode,e)}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const{value:Q}=this.tree.rootNode;return i.toView(Q[B])},set:function(Q){const C=this.tree.rootNode,e=this.type.clone(C.value);e[B]=i.toValueFromView(Q),this.tree.rootNode=new JC(C.valueToNode,e)}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class vU extends FC{type;valueChanged=null;_rootNode;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get value(){return this.valueChanged??this._rootNode.value}commit(A,g=null){if(this.valueChanged!==null){const B=this.valueChanged;this.valueChanged=null,this._rootNode=this.type.value_toTree(B)}this._rootNode.h0===null&&g!==null&&this._rootNode.rootHashObject}clearCache(){this.valueChanged=null}}function WU(I){class A extends vU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(i.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return(this.valueChanged||this._rootNode.value)[B]},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value)),this.valueChanged[B]=Q}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.valueChanged||this._rootNode.value;return i.toViewDU(Q[B])},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value));const C=i.toValueFromViewDU(Q);this.valueChanged[B]=C}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class XU extends Y{fields;constructor(A,g){super(A,{typeName:g?.typeName??mr(A,"ContainerNodeStruct"),...g,getContainerTreeViewClass:zU,getContainerTreeViewDUClass:WU}),this.fields=A;for(const{fieldName:B,fieldType:i}of this.fieldsEntries)if(lg(i)&&i.isViewMutable)throw Error(`ContainerNodeStructType field '${String(B)}' ${i.typeName} view is mutable`)}static named(A,g){return new(dI(Y,g.typeName))(A,g)}tree_serializedSize(A){return this.value_serializedSize(A.value)}tree_serializeToBytes(A,g,B){const{value:i}=B;return this.value_serializeToBytes(A,g,i)}tree_deserializeFromBytes(A,g,B){const i=this.value_deserializeFromBytes(A,g,B);return new JC(this.valueToTree.bind(this),i)}getPropertyGindex(){return null}tree_fromProofNode(A){const g=new Uint8Array(super.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);super.tree_serializeToBytes({uint8Array:g,dataView:B},0,A);const i=this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length);return{node:new JC(this.valueToTree.bind(this),i),done:!0}}tree_toValue(A){return A.value}value_toTree(A){return new JC(this.valueToTree.bind(this),A)}valueToTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),super.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}}class Lr extends jB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=Math.floor(A/this.type.itemsPerChunk),B=this.tree.getNodeAtDepth(this.type.depth,g);return this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const i=Math.floor(A/this.type.itemsPerChunk),Q=this.tree.getNodeAtDepth(this.type.depth,i).clone();this.type.elementType.tree_setToPackedNode(Q,A,g),this.tree.setNodeAtDepth(this.type.depth,i,Q)}getAll(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),i=Math.ceil(g/this.type.itemsPerChunk),Q=tI(B,this.type.chunkDepth,0,i);A=A??new Array(g);const C=this.type.itemsPerChunk,e=Math.floor(g/C),o=g%C;for(let c=0;c<e;c++){const a=Q[c];for(let f=0;f<C;f++)A[c*C+f]=this.type.elementType.tree_getFromPackedNode(a,f)}if(o>0){const c=Q[e];for(let a=0;a<o;a++)A[e*C+a]=this.type.elementType.tree_getFromPackedNode(c,a)}return A}}class $U extends Lr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");if(this.type.tree_setLength(this.tree,g+1),g%this.type.itemsPerChunk===0){const B=KA.fromZero();this.type.elementType.tree_setToPackedNode(B,g,A);const i=Math.floor(g/this.type.itemsPerChunk);this.tree.setNodeAtDepth(this.type.depth,i,B)}else this.set(g,A)}}class Kr extends FC{type;_rootNode;nodes;nodesChanged=new Set;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=!1)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=Math.floor(A/this.type.itemsPerChunk);let B=this.nodes[g];return B===void 0&&(B=mI(this._rootNode,this.type.depth,g),this.nodes[g]=B),this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);const B=Math.floor(A/this.type.itemsPerChunk);let i;this.nodesChanged.has(B)?i=this.nodes[B]:(i=(this.nodes[B]??mI(this._rootNode,this.type.depth,B)).clone(),this.nodes[B]=i,this.nodesChanged.add(B)),this.type.elementType.tree_setToPackedNode(i,A,g)}getAll(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);if(!this.nodesPopulated){const Q=this.nodes,C=this.type.tree_getChunksNode(this.node),e=Math.ceil(this._length/this.type.itemsPerChunk);this.nodes=tI(C,this.type.chunkDepth,0,e);for(const o of this.nodesChanged)this.nodes[o]=Q[o];this.nodesPopulated=!0}A=A??new Array(this._length);const g=this.type.itemsPerChunk,B=Math.floor(this._length/g),i=this._length%g;for(let Q=0;Q<B;Q++){const C=this.nodes[Q];for(let e=0;e<g;e++)A[Q*g+e]=this.type.elementType.tree_getFromPackedNode(C,e)}if(i>0){const Q=this.nodes[B];for(let C=0;C<i;C++)A[B*g+C]=this.type.elementType.tree_getFromPackedNode(Q,C)}return A}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0){!B&&g!==null&&aI(this._rootNode,A,g);return}const i=Array.from(this.nodesChanged.keys()).sort((a,f)=>a-f),Q=new Array(i.length);for(let a=0;a<i.length;a++)Q[a]=this.nodes[i[a]];const C=this.type.tree_getChunksNode(this._rootNode),e=A+this.type.tree_chunksNodeOffset(),o=g!=null&&B?g:null,c=GC(C,this.type.chunkDepth,i,Q,e,o);this._rootNode=this.type.tree_setChunksNode(this._rootNode,c,this.dirtyLength?this._length:null,A,B?g:null),!B&&g!==null&&aI(this._rootNode,A,g),this.nodesChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}}class Af extends Kr{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;if(g%this.type.itemsPerChunk===0){const B=Math.floor(g/this.type.itemsPerChunk);this.nodes[B]=oB(0)}this.set(g,A)}sliceTo(A){if(A<0)throw new Error(`Does not support sliceTo() with negative index ${A}`);if(this.commit(),A>=this._length-1)return this;const g=this._rootNode,B=Math.floor(A/this.type.itemsPerChunk),i=this.nodes[B]??mI(g,this.type.depth,B),Q=KA.fromZero();for(let a=B*this.type.itemsPerChunk;a<=A;a++){const f=this.type.elementType.tree_getFromPackedNode(i,a);this.type.elementType.tree_setToPackedNode(Q,a,f)}const C=this.type.tree_getChunksNode(this._rootNode);let e=GC(C,this.type.chunkDepth,[B],[Q]);e=lr(e,this.type.chunkDepth,B);const o=A+1,c=this.type.tree_setChunksNode(g,e,o);return this.type.getViewDU(c)}serializeToBytes(A,g){this.commit();const{nodes:B,nodesPopulated:i}=this.cache,Q=this.type.tree_getChunksNode(this._rootNode);return re(this.type.elementType,this._length,this.type.chunkDepth,A,g,Q,i?B:null)}}class RQ extends NQ{elementType;constructor(A,g){super(g),this.elementType=A}defaultValue(){return mU(this.elementType,this.defaultLen)}getPropertyType(){return this.elementType}getPropertyGindex(A){if(typeof A!="number")throw Error(`Invalid array index: ${A}`);const g=Math.floor(A/this.itemsPerChunk);return pg(this.depth,BigInt(g))}getIndexProperty(A){return A}tree_getLeafGindices(A,g){let B;if(this.isList){if(!g)throw new Error("List type requires tree argument to get leaves");B=this.tree_getLength(g)}else B=this.tree_getLength(null);const i=[];if(lg(this.elementType)){const Q=pg(this.depth,BigInt(0)),C=Q+BigInt(B),e=ng([A,Q]);if(this.elementType.fixedSize===null){if(!g)throw new Error("Array of variable size requires tree argument to get leaves");for(let o=Q,c=e;o<C;o++,c++)i.push(...this.elementType.tree_getLeafGindices(c,RC(g,o)))}else for(let o=0,c=e;o<B;o++,c++)i.push(...this.elementType.tree_getLeafGindices(c))}else{const Q=Math.ceil(B/this.itemsPerChunk),C=ng([A,pg(this.depth,BigInt(0))]),e=C+BigInt(Q);for(let o=C;o<e;o++)i.push(o)}return this.isList&&i.push(ng([A,ae])),i}fromJson(A){return JU(this.elementType,A,this)}toJson(A){return pU(this.elementType,A,this)}clone(A){return HU(this.elementType,A)}equals(A,g){return MU(this.elementType,A,g)}}class LI extends RQ{elementType;limit;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(this.limit*A.byteLength/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=this.limit*A.maxSize}static named(A,g,B){return new(dI(LI,B.typeName))(A,g,B)}getView(A){return new $U(this,A)}getViewDU(A,g){return new Af(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return A.length*this.elementType.byteLength}value_serializeToBytes(A,g,B){return SQ(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Sr(this.elementType,A,g,B,this)}tree_serializedSize(A){return this.tree_getLength(A)*this.elementType.byteLength}tree_serializeToBytes(A,g,B){const i=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return re(this.elementType,Q,this.chunkDepth,A,g,i)}tree_deserializeFromBytes(A,g,B){return wr(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return A.right.getUint(4,0)}tree_setLength(A,g){A.rootNode=aB(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,i=0,Q=null){return fr(A,g,B,i,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Lg];if(B)return B}const g=YB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,i=!1){if(this.cachePermanentRootStruct){const Q=A[Lg];if(Q){g.set(Q,B);return}}super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),yC(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&Ee(A,g,B,i)}getBlocksBytes(A){const g=this.value_serializedSize(A),B=Math.ceil(g/64)*64;g>this.blocksBuffer.length&&(this.blocksBuffer=new Uint8Array(B));const i=this.blocksBuffer.subarray(0,B),Q=i.subarray(0,g),C=new DataView(Q.buffer,Q.byteOffset,Q.byteLength);return SQ(this.elementType,A.length,{uint8Array:Q,dataView:C},0,A),this.blocksBuffer.subarray(g,B).fill(0),i}}class Yr extends jB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=vi(this.type.depth,A),B=this.tree.getSubtree(g);return this.type.elementType.getView(B)}getReadonly(A){const g=vi(this.type.depth,A),B=new NI(this.tree.getNode(g));return this.type.elementType.getView(B)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const i=this.type.elementType.commitView(g);this.tree.setNodeAtDepth(this.type.depth,A,i)}getAllReadonly(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} views, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),i=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.getView(new NI(i[Q]));return A}getAllReadonlyValues(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),i=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.tree_toValue(i[Q]);return A}}class If extends Yr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");this.type.tree_setLength(this.tree,g+1),this.set(g,A)}}function gf(I,A){return I.fixedSize===null?A*(4+I.minSize):A*I.minSize}function br(I,A){return I.fixedSize===null?A*(4+I.maxSize):A*I.maxSize}function Tr(I,A,g){if(I.fixedSize===null){let B=0;for(let i=0;i<A;i++)B+=4+I.value_serializedSize(g[i]);return B}return A*I.fixedSize}function qr(I,A,g,B,i){if(I.fixedSize===null){let Q=B+A*4;for(let C=0;C<A;C++)g.dataView.setUint32(B+C*4,Q-B,!0),Q=I.value_serializeToBytes(g,Q,i[C]);return Q}for(let Q=0;Q<A;Q++)I.value_serializeToBytes(g,B+Q*I.fixedSize,i[Q]);return B+A*I.fixedSize}function Vr(I,A,g,B,i){const Q=_r(I.fixedSize,A.dataView,g,B,i),C=Q.length,e=new Array(C);for(let o=0;o<C;o++){const c=g+Q[o],a=o===C-1?B:g+Q[o+1];e[o]=I.value_deserializeFromBytes(A,c,a)}return e}function jr(I,A,g,B){if(I.fixedSize===null){const i=tI(B,g,0,A);let Q=0;for(let C=0;C<i.length;C++)Q+=4+I.tree_serializedSize(i[C]);return Q}return A*I.fixedSize}function le(I,A,g,B,i,Q,C=null){const e=C??tI(B,g,0,A);if(I.fixedSize===null){let o=Q+A*4;const{dataView:c}=i;for(let a=0;a<e.length;a++)c.setUint32(Q+a*4,o-Q,!0),o=I.tree_serializeToBytes(i,o,e[a]);return o}for(let o=0;o<e.length;o++)Q=I.tree_serializeToBytes(i,Q,e[o]);return Q}function Zr(I,A,g,B,i,Q){const C=_r(I.fixedSize,g.dataView,B,i,Q),e=C.length,o=new Array(e);for(let a=0;a<e;a++){const f=B+C[a],R=a===e-1?i:B+C[a+1];o[a]=I.tree_deserializeFromBytes(g,f,R)}const c=NC(o,A);return Q.isList?aB(c,e):c}function Bf(I,A,g,B){const i=Math.ceil(A/2)*64;if(i>B.length)throw new Error(`blocksBuffer is too small: ${B.length} < ${i}`);const Q=B.subarray(0,i);for(let C=0;C<A;C++)I.hashTreeRootInto(g[C],Q,C*32);return A%2===1&&Q.subarray(A*32,i).fill(0),Q}function _r(I,A,g,B,i){const Q=B-g;let C;if(I===null)C=Cf(A,g,Q);else{if(I===0)throw Error("element fixed length is 0");if(Q%I!==0)throw Error(`size ${Q} is not multiple of element fixedSize ${I}`);const e=Q/I;C=new Uint32Array(e);for(let o=0;o<e;o++)C[o]=o*I}return wQ(C.length,i),C}function Cf(I,A,g){if(g===0)return new Uint32Array(0);const B=I.getUint32(A,!0),i=B;if(B===0)throw Error("First offset must be > 0");if(i%4!==0)throw Error("Offset data length not multiple of 4");const Q=i/4,C=new Uint32Array(Q);C[0]=B;for(let e=1;e<Q;e++){const o=I.getUint32(A+e*4,!0);if(C[e]=o,o>g)throw new Error(`Offset out of bounds ${o} > ${g}`);if(o<C[e-1])throw new Error(`Offsets must be increasing ${o} < ${C[e-1]}`)}return C}function Qf(I){return{finalized:[],count:0,root:FU(VB(I),VB(0))}}class Pr extends FC{type;_rootNode;nodes;caches;viewsChanged=new Map;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=this._length===0)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];B===void 0&&(B=mI(this._rootNode,this.type.depth,A),this.nodes[A]=B);const i=this.type.elementType.getViewDU(B,this.caches[A]);return this.type.elementType.isViewMutable&&this.viewsChanged.set(A,i),i}getReadonly(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];return B===void 0&&(B=mI(this._rootNode,this.type.depth,A),this.nodes[A]=B),this.type.elementType.getViewDU(B,this.caches[A])}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);this.viewsChanged.set(A,g)}getAllReadonly(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} views, got ${A.length}`);this.populateAllOldNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.getReadonly(g);return A}forEach(A){this.populateAllOldNodes();for(let g=0;g<this._length;g++)A(this.getReadonly(g),g)}getAllReadonlyValues(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);this.populateAllNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.type.elementType.tree_toValue(this.nodes[g]);return A}forEachValue(A){this.populateAllNodes();for(let g=0;g<this._length;g++)A(this.type.elementType.tree_toValue(this.nodes[g]),g)}getReadonlyByRange(A,g){if(A<0)throw Error(`Error getting by range, startIndex < 0: ${A}`);if(g<=0)throw Error(`Error getting by range, count <= 0: ${g}`);const B=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;if(A>=B)throw Error(`Error getting by range, startIndex >= length: ${A} >= ${B}`);g=Math.min(g,B-A);let i=!0;for(let C=A;C<A+g;C++)if(this.nodes[C]==null){i=!1;break}if(!i){const C=tI(this._rootNode,this.type.depth,A,g);for(const[e,o]of C.entries())this.nodes[A+e]=o}const Q=new Array(g);for(let C=0;C<g;C++)Q[C]=this.getReadonly(A+C);return Q}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.viewsChanged.size===0){!B&&g!==null&&aI(this._rootNode,A,g);return}const i=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[G,S]of this.viewsChanged){const u=this.type.elementType.commitViewDU(S,i,Q);this.nodes[G]!==u&&(this.nodes[G]=u,C.push({index:G,node:u}));const N=this.type.elementType.cacheOfViewDU(S);N&&(this.caches[G]=N)}const e=C.sort((G,S)=>G.index-S.index),o=e.map(G=>G.index),c=e.map(G=>G.node),a=this.type.tree_getChunksNode(this._rootNode),f=A+this.type.tree_chunksNodeOffset(),R=g!=null&&B?g:null,y=GC(a,this.type.chunkDepth,o,c,f,R);this._rootNode=this.type.tree_setChunksNode(this._rootNode,y,this.dirtyLength?this._length:null,A,g),!B&&g!==null&&aI(this._rootNode,A,g),this.viewsChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.viewsChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}populateAllNodes(){if(this.viewsChanged.size>0)throw Error("Must commit changes before reading all nodes");this.nodesPopulated||(this.nodes=tI(this._rootNode,this.type.depth,0,this.length),this.nodesPopulated=!0)}populateAllOldNodes(){if(!this.nodesPopulated){const A=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;this.nodes=tI(this._rootNode,this.type.depth,0,A),this.nodesPopulated=!0}}}class ef extends Pr{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;this.set(g,A)}sliceTo(A){this.commit();const g=this._rootNode,B=this._length;if(A>=B-1)return this;const i=this.type.tree_getChunksNode(g),Q=lr(i,this.type.chunkDepth,A),C=A+1,e=this.type.tree_setChunksNode(g,Q,C);return this.rootNodeToViewDU(e)}sliceFrom(A){if(this.commit(),this.populateAllNodes(),A<0&&(A+=this.nodes.length),A<=0)return this;let g,B;if(A>=this.nodes.length)g=oB(this.type.chunkDepth),B=0;else{const Q=this.nodes.slice(A);g=NC(Q,this.type.chunkDepth),B=Q.length}const i=this.type.tree_setChunksNode(this._rootNode,g,B);return this.rootNodeToViewDU(i)}toSnapshot(A){if(this.commit(),A<0||A>this._length)throw Error(`Invalid count ${A}, length is ${this._length}`);if(A===0)return Qf(this.type.chunkDepth);const g=this.sliceTo(A-1)._rootNode,B=this.type.tree_getChunksNode(g);return{...RU(B,this.type.chunkDepth,A),root:g.root}}serializeToBytes(A,g){this.commit(),this.populateAllNodes();const B=this.type.tree_getChunksNode(this._rootNode);return le(this.type.elementType,this._length,this.type.chunkDepth,B,A,g,this.nodes)}rootNodeToViewDU(A){return this.type.getViewDU(A)}}class yA extends RQ{elementType;limit;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;blockArray=[];mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.maxChunkCount=this.limit,this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=br(A,this.limit)}static named(A,g,B){return new(dI(yA,B.typeName))(A,g,B)}getView(A){return new If(this,A)}getViewDU(A,g){return new ef(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return Tr(this.elementType,A.length,A)}value_serializeToBytes(A,g,B){return qr(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Vr(this.elementType,A,g,B,this)}tree_serializedSize(A){const g=this.tree_getChunksNode(A),B=this.tree_getLength(A);return jr(this.elementType,B,this.chunkDepth,g)}tree_serializeToBytes(A,g,B){const i=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return le(this.elementType,Q,this.chunkDepth,i,A,g)}tree_deserializeFromBytes(A,g,B){return Zr(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return nB(A)}tree_setLength(A,g){A.rootNode=aB(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,i=0,Q=null){return fr(A,g,B,i,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Lg];if(B)return B}const g=YB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,i=!1){if(this.cachePermanentRootStruct){const C=A[Lg];if(C){g.set(C,B);return}}if(A.length>this.blockArray.length){const C=A.length-this.blockArray.length,e=new Uint8Array(C*64);for(let o=0;o<C;o++)this.blockArray.push(e.subarray(o*64,(o+1)*64))}for(let C=0;C<A.length;C++){const e=this.blockArray[Math.floor(C/2)],o=C%2===0?0:32;this.elementType.hashTreeRootInto(A[C],e,o)}const Q=Math.ceil(A.length/2);A.length%2===1&&this.blockArray[Q-1].fill(0,32),tr(this.blockArray,Q,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),yC(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&Ee(A,g,B,i)}getBlocksBytes(){throw Error("getBlockBytes should not be called for ListCompositeType")}}const tf=BigInt(Number.MAX_SAFE_INTEGER),De=BigInt(2)**BigInt(64),Ef=BigInt(2)**BigInt(128),of=BigInt(2)**BigInt(192),Or=2**32,xr=4294967295;class Ag extends uQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;maxDecimalStr;clipInfinity;setBitwiseOR;constructor(A,g){if(super(),this.byteLength=A,A>8)throw Error("UintNumber byteLength limit is 8");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uint${A*8}`,g?.clipInfinity&&(this.typeName+="Inf"),g?.setBitwiseOR&&(this.typeName+="OR"),this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A,this.maxDecimalStr=(BigInt(2)**BigInt(this.byteLength*8)-BigInt(1)).toString(10),this.clipInfinity=g?.clipInfinity===!0,this.setBitwiseOR=g?.setBitwiseOR===!0}static named(A,g){return new(dI(Ag,g.typeName))(A,g)}defaultValue(){return 0}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,B);break;case 2:A.setUint16(g,B,!0);break;case 4:A.setUint32(g,B,!0);break;case 8:B===1/0?(A.setUint32(g,4294967295),A.setUint32(g+4,4294967295)):(A.setUint32(g,B&4294967295,!0),A.setUint32(g+4,B/Or&4294967295,!0));break}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){switch(this.assertValidSize(B-g),this.byteLength){case 1:return A.getUint8(g);case 2:return A.getUint16(g,!0);case 4:return A.getUint32(g,!0);case 8:{const i=A.getUint32(g,!0),Q=A.getUint32(g+4,!0);return Q===xr&&i===xr&&this.clipInfinity?1/0:Q*Or+i}}}value_toTree(A){const g=KA.fromZero();return g.setUint(this.byteLength,0,A,this.clipInfinity),g}tree_serializeToBytes(A,g,B){const i=B.getUint(this.byteLength,0,this.clipInfinity);return this.value_serializeToBytes(A,g,i),g+this.byteLength}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const i=this.value_deserializeFromBytes(A,g,B),Q=KA.fromZero();return Q.setUint(this.byteLength,0,i,this.clipInfinity),Q}tree_getFromNode(A){return A.getUint(this.byteLength,0,this.clipInfinity)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUint(this.byteLength,B,this.clipInfinity)}tree_setToPackedNode(A,g,B){const i=this.byteLength*(g%this.itemsPerChunk);this.setBitwiseOR?A.bitwiseOrUint(this.byteLength,i,B):A.setUint(this.byteLength,i,B,this.clipInfinity)}fromJson(A){if(typeof A=="number")return A;if(typeof A=="string"){if(this.clipInfinity&&A===this.maxDecimalStr)return 1/0;const g=Number.parseInt(A,10);if(Number.isNaN(g))throw Error("JSON invalid number isNaN");if(g>Number.MAX_SAFE_INTEGER)throw Error("JSON invalid number > MAX_SAFE_INTEGER");return g}if(typeof A=="bigint"){if(A>tf)throw Error("JSON invalid number > MAX_SAFE_INTEGER_BN");return Number(A)}throw Error(`JSON invalid type ${typeof A} expected number`)}toJson(A){return A===1/0?this.maxDecimalStr:A.toString(10)}}class pC extends uQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;constructor(A,g){if(super(),this.byteLength=A,A>32)throw Error("UintBigint byteLength limit is 32");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uintBigint${A*8}`,this.byteLength=A,this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A}static named(A,g){return new(dI(pC,g.typeName))(A,g)}defaultValue(){return BigInt(0)}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,Number(B));break;case 2:A.setUint16(g,Number(B),!0);break;case 4:A.setUint32(g,Number(B),!0);break;case 8:A.setBigUint64(g,B,!0);break;default:for(let i=0;i<this.byteLength;i+=8){i>0&&(B=B/De);const Q=BigInt.asUintN(64,B);A.setBigUint64(g+i,Q,!0)}}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){const i=B-g;if(i!==this.byteLength)throw Error(`Invalid size ${i} expected ${this.byteLength}`);switch(this.byteLength){case 1:return BigInt(A.getUint8(g));case 2:return BigInt(A.getUint16(g,!0));case 4:return BigInt(A.getUint32(g,!0));case 8:return A.getBigUint64(g,!0);case 16:{const Q=A.getBigUint64(g,!0);return A.getBigUint64(g+8,!0)*De+Q}case 32:{const Q=A.getBigUint64(g,!0),C=A.getBigUint64(g+8,!0),e=A.getBigUint64(g+16,!0);return A.getBigUint64(g+24,!0)*of+e*Ef+C*De+Q}}}tree_serializeToBytes(A,g,B){const i=B.getUintBigint(this.byteLength,0);return this.value_serializeToBytes(A,g,i),g+this.byteLength}tree_deserializeFromBytes(A,g,B){const i=B-g;if(i!==this.byteLength)throw Error(`Invalid size ${i} expected ${this.byteLength}`);const Q=this.value_deserializeFromBytes(A,g,B),C=KA.fromZero();return C.setUintBigint(this.byteLength,0,Q),C}tree_getFromNode(A){return A.getUintBigint(this.byteLength,0)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUintBigint(this.byteLength,B)}tree_setToPackedNode(A,g,B){const i=this.byteLength*(g%this.itemsPerChunk);A.setUintBigint(this.byteLength,i,B)}fromJson(A){if(typeof A=="bigint")return A;if(typeof A=="string"||typeof A=="number")return BigInt(A);throw Error(`JSON invalid type ${typeof A} expected bigint`)}toJson(A){return A.toString(10)}}BigInt(2),BigInt(3),BigInt(2),BigInt(3);class GQ extends RQ{elementType;length;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(g*A.byteLength/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=g*A.byteLength,this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(GQ,B.typeName))(A,g,B)}getView(A){return new Lr(this,A)}getViewDU(A,g){return new Kr(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return SQ(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Sr(this.elementType,A,g,B,this)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){return re(this.elementType,this.length,this.depth,A,g,B)}tree_deserializeFromBytes(A,g,B){return wr(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){const g=this.blocksBuffer.subarray(0,this.fixedSize),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return SQ(this.elementType,this.length,{uint8Array:g,dataView:B},0,A),this.blocksBuffer}}class EI extends RQ{elementType;length;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.maxChunkCount=g,this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=A.fixedSize===null?null:g*A.fixedSize,this.minSize=gf(A,g),this.maxSize=br(A,g),this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(EI,B.typeName))(A,g,B)}getView(A){return new Yr(this,A)}getViewDU(A,g){return new Pr(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return Tr(this.elementType,this.length,A)}value_serializeToBytes(A,g,B){return qr(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Vr(this.elementType,A,g,B,this)}tree_serializedSize(A){return jr(this.elementType,this.length,this.depth,A)}tree_serializeToBytes(A,g,B){return le(this.elementType,this.length,this.depth,B,A,g)}tree_deserializeFromBytes(A,g,B){return Zr(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){return Bf(this.elementType,this.length,A,this.blocksBuffer)}}class rf extends LI{constructor(A,g){super(new Ag(8),A,g)}toViewDU(A){const{treeNode:g,leafNodes:B}=this.packedUintNum64sToNode(A);return this.getViewDU(g,{nodes:B,length:A.length,nodesPopulated:!0})}value_toTree(A){const{treeNode:g}=this.packedUintNum64sToNode(A);return g}packedUintNum64sToNode(A){if(A.length>this.limit)throw new Error(`Exceeds limit: ${A.length} > ${this.limit}`);const g=tU(A),B=NC([...g],this.chunkDepth);return{treeNode:aB(B,A.length),leafNodes:g}}}new Uint8Array(64).subarray(32);function HC(I){if(!Number.isSafeInteger(I)||I<0)throw new Error(`positive integer expected, not ${I}`)}function nf(I){if(typeof I!="boolean")throw new Error(`boolean expected, not ${I}`)}function af(I){return I instanceof Uint8Array||I!=null&&typeof I=="object"&&I.constructor.name==="Uint8Array"}function FQ(I,...A){if(!af(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error(`Uint8Array expected of length ${A}, not of length=${I.length}`)}function sf(I){if(typeof I!="function"||typeof I.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");HC(I.outputLen),HC(I.blockLen)}function ce(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function zr(I,A){FQ(I);const g=A.outputLen;if(I.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}const hf={number:HC,bool:nf,bytes:FQ,hash:sf,exists:ce,output:zr},kQ=BigInt(2**32-1),vr=BigInt(32);function lf(I,A=!1){return A?{h:Number(I&kQ),l:Number(I>>vr&kQ)}:{h:Number(I>>vr&kQ)|0,l:Number(I&kQ)|0}}function Df(I,A=!1){let g=new Uint32Array(I.length),B=new Uint32Array(I.length);for(let i=0;i<I.length;i++){const{h:Q,l:C}=lf(I[i],A);[g[i],B[i]]=[Q,C]}return[g,B]}const cf=(I,A,g)=>I<<g|A>>>32-g,Uf=(I,A,g)=>A<<g|I>>>32-g,ff=(I,A,g)=>A<<g-32|I>>>64-g,Sf=(I,A,g)=>I<<g-32|A>>>64-g,wf=I=>new Uint32Array(I.buffer,I.byteOffset,Math.floor(I.byteLength/4)),Wr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,yf=I=>I<<24&4278190080|I<<8&16711680|I>>>8&65280|I>>>24&255;function Xr(I){for(let A=0;A<I.length;A++)I[A]=yf(I[A])}function Nf(I){if(typeof I!="string")throw new Error(`utf8ToBytes expected string, got ${typeof I}`);return new Uint8Array(new TextEncoder().encode(I))}function $r(I){return typeof I=="string"&&(I=Nf(I)),FQ(I),I}class df{clone(){return this._cloneInto()}}function uf(I){const A=B=>I().update($r(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}const An=[],In=[],gn=[],Rf=BigInt(0),MC=BigInt(1),Gf=BigInt(2),Ff=BigInt(7),kf=BigInt(256),Jf=BigInt(113);for(let I=0,A=MC,g=1,B=0;I<24;I++){[g,B]=[B,(2*g+3*B)%5],An.push(2*(5*B+g)),In.push((I+1)*(I+2)/2%64);let i=Rf;for(let Q=0;Q<7;Q++)A=(A<<MC^(A>>Ff)*Jf)%kf,A&Gf&&(i^=MC<<(MC<<BigInt(Q))-MC);gn.push(i)}const[pf,Hf]=Df(gn,!0),Bn=(I,A,g)=>g>32?ff(I,A,g):cf(I,A,g),Cn=(I,A,g)=>g>32?Sf(I,A,g):Uf(I,A,g);function Mf(I,A=24){const g=new Uint32Array(10);for(let B=24-A;B<24;B++){for(let C=0;C<10;C++)g[C]=I[C]^I[C+10]^I[C+20]^I[C+30]^I[C+40];for(let C=0;C<10;C+=2){const e=(C+8)%10,o=(C+2)%10,c=g[o],a=g[o+1],f=Bn(c,a,1)^g[e],R=Cn(c,a,1)^g[e+1];for(let y=0;y<50;y+=10)I[C+y]^=f,I[C+y+1]^=R}let i=I[2],Q=I[3];for(let C=0;C<24;C++){const e=In[C],o=Bn(i,Q,e),c=Cn(i,Q,e),a=An[C];i=I[a],Q=I[a+1],I[a]=o,I[a+1]=c}for(let C=0;C<50;C+=10){for(let e=0;e<10;e++)g[e]=I[C+e];for(let e=0;e<10;e++)I[C+e]^=~g[(e+2)%10]&g[(e+4)%10]}I[0]^=pf[B],I[1]^=Hf[B]}g.fill(0)}class Ue extends df{constructor(A,g,B,i=!1,Q=24){if(super(),this.blockLen=A,this.suffix=g,this.outputLen=B,this.enableXOF=i,this.rounds=Q,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,HC(B),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=wf(this.state)}keccak(){Wr||Xr(this.state32),Mf(this.state32,this.rounds),Wr||Xr(this.state32),this.posOut=0,this.pos=0}update(A){ce(this);const{blockLen:g,state:B}=this;A=$r(A);const i=A.length;for(let Q=0;Q<i;){const C=Math.min(g-this.pos,i-Q);for(let e=0;e<C;e++)B[this.pos++]^=A[Q++];this.pos===g&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:A,suffix:g,pos:B,blockLen:i}=this;A[B]^=g,g&128&&B===i-1&&this.keccak(),A[i-1]^=128,this.keccak()}writeInto(A){ce(this,!1),FQ(A),this.finish();const g=this.state,{blockLen:B}=this;for(let i=0,Q=A.length;i<Q;){this.posOut>=B&&this.keccak();const C=Math.min(B-this.posOut,Q-i);A.set(g.subarray(this.posOut,this.posOut+C),i),this.posOut+=C,i+=C}return A}xofInto(A){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(A)}xof(A){return HC(A),this.xofInto(new Uint8Array(A))}digestInto(A){if(zr(A,this),this.finished)throw new Error("digest() was already called");return this.writeInto(A),this.destroy(),A}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(A){const{blockLen:g,suffix:B,outputLen:i,rounds:Q,enableXOF:C}=this;return A||(A=new Ue(g,B,i,C,Q)),A.state32.set(this.state32),A.pos=this.pos,A.posOut=this.posOut,A.finished=this.finished,A.rounds=Q,A.suffix=B,A.outputLen=i,A.enableXOF=C,A.destroyed=this.destroyed,A}}const mf=(I,A,g)=>uf(()=>new Ue(A,I,g)),Qn=mf(1,136,256/8);function Lf(I){return A=>(hf.bytes(A),I(A))}(()=>{const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,A=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:A&&!I?A("crypto"):void 0,web:I}})();const Kf=(()=>{const I=Lf(Qn);return I.create=Qn.create,I})();class Yf extends uI{constructor(){super(20,{typeName:"ExecutionAddress"})}toJson(A){const g=super.toJson(A);return Tf(g)}}function bf(I){return/^(0x)?[0-9a-f]{40}$/i.test(I)}function Tf(I){if(!bf(I))throw Error(`Invalid address: ${I}`);const A=(I.startsWith("0x")?I.slice(2):I).toLowerCase(),g=A.split(""),B=new Uint8Array(g.length);for(let Q=0;Q<B.length;Q++)B[Q]=A[Q].charCodeAt(0);const i=Kf(B);for(let Q=0;Q<g.length;Q+=2)i[Q>>1]>>4>=8&&(g[Q]=g[Q].toUpperCase()),(i[Q>>1]&15)>=8&&(g[Q+1]=g[Q+1].toUpperCase());return"0x"+g.join("")}const CI=new he,en=new Ag(1),mC=new uI(4),fe=new uI(8),tn=new uI(20),Se=new uI(32),we=new uI(48),ye=new uI(96),En=new Ag(1),on=new Ag(2),Ne=new Ag(4),RA=new Ag(8),de=new Ag(8,{clipInfinity:!0}),ZB=new pC(8),rn=new pC(16),ue=new pC(32),LA=RA,VI=RA,nn=de,an=RA,sB=RA,Re=RA,zA=RA,sn=RA,hn=ZB,ln=ZB,Dn=ue,hB=new uI(32),Ge=RA,cn=mC,Un=mC,Fe=mC,_B=we,JQ=ye,fn=Se,Sn=new Ag(1,{setBitwiseOR:!0}),ke=new Yf,Je=RA,wn=RA,yn=RA,Dg=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:_B,BLSSignature:JQ,BlobIndex:Ge,Boolean:CI,Byte:en,Bytes20:tn,Bytes32:Se,Bytes4:mC,Bytes48:we,Bytes8:fe,Bytes96:ye,ColumnIndex:Je,CommitteeIndex:sB,CustodyIndex:wn,DepositIndex:hn,Domain:fn,DomainType:Un,Epoch:VI,EpochInf:nn,ExecutionAddress:ke,ForkDigest:Fe,Gwei:ln,ParticipationFlags:Sn,Root:hB,RowIndex:yn,Slot:LA,SubcommitteeIndex:Re,SyncPeriod:an,Uint16:on,Uint32:Ne,Uint8:En,UintBn128:rn,UintBn256:ue,UintBn64:ZB,UintNum64:RA,UintNumInf64:de,ValidatorIndex:zA,Version:cn,Wei:Dn,WithdrawalIndex:sn},Symbol.toStringTag,{value:"Module"})),{Boolean:qf,Bytes32:Vf,UintNum64:jf,BLSPubkey:Zf,EpochInf:pQ}=Dg,Nn=2**32,PB=4,_f=48,Pf=32,Of=1,xf={pubkey:Zf,withdrawalCredentials:Vf,effectiveBalance:jf,slashed:qf,activationEligibilityEpoch:pQ,activationEpoch:pQ,exitEpoch:pQ,withdrawableEpoch:pQ};class zf extends XU{constructor(){super(xf,{typeName:"Validator",jsonCase:"eth2"})}value_serializeToBytes({uint8Array:A,dataView:g},B,i){A.set(i.pubkey,B),B+=_f,A.set(i.withdrawalCredentials,B),B+=Pf;const{effectiveBalance:Q,activationEligibilityEpoch:C,activationEpoch:e,exitEpoch:o,withdrawableEpoch:c}=i;return g.setUint32(B,Q&4294967295,!0),B+=PB,g.setUint32(B,Q/Nn&4294967295,!0),B+=PB,A[B]=i.slashed?1:0,B+=Of,B=HQ(g,B,C),B=HQ(g,B,e),B=HQ(g,B,o),B=HQ(g,B,c),B}}function HQ(I,A,g){return g===1/0?(I.setUint32(A,4294967295,!0),A+=PB,I.setUint32(A,4294967295,!0),A+=PB):(I.setUint32(A,g&4294967295,!0),A+=PB,I.setUint32(A,g/Nn&4294967295,!0),A+=PB),A}const dn=new zf,{Bytes32:lB,UintNum64:DI,UintBn64:DB,Slot:Kg,Epoch:LC,CommitteeIndex:un,ValidatorIndex:cB,Root:HA,Version:KC,ForkDigest:Rn,BLSPubkey:Gn,BLSSignature:jI,Domain:vf}=Dg,pe=new $I(c1),KI=new Y({slot:Kg,proposerIndex:cB,parentRoot:HA,stateRoot:HA,bodyRoot:HA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),Fn=new Y({slot:DB,proposerIndex:cB,parentRoot:HA,stateRoot:HA,bodyRoot:HA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),He=new Y({message:KI,signature:jI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),Me=new Y({message:Fn,signature:jI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),qA=new Y({epoch:LC,root:HA},{typeName:"Checkpoint",jsonCase:"eth2"}),me=new Y({epoch:DB,root:HA},{typeName:"Checkpoint",jsonCase:"eth2"}),Le=new dQ(lC),MQ=new LI(cB,lC),Wf=new Y({pubkey:Gn,withdrawalCredentials:lB,amount:DI},{typeName:"DepositMessage",jsonCase:"eth2"}),Ke=new Y({pubkey:Gn,withdrawalCredentials:lB,amount:DI,signature:jI},{typeName:"DepositData",jsonCase:"eth2"}),Xf=new yA(HA,2**fo),$f=new Y({depositData:Ke,blockNumber:DI,index:DI},{typeName:"DepositEvent",jsonCase:"eth2"}),Ig=new Y({depositRoot:HA,depositCount:DI,blockHash:lB},{typeName:"Eth1Data",jsonCase:"eth2"}),Yg=new yA(Ig,ql*SI),A2=new Y({depositRoot:HA,depositCount:DI,blockHash:lB,blockNumber:DI},{typeName:"Eth1DataOrdered",jsonCase:"eth2"}),I2=new Y({timestamp:DI,depositRoot:HA,depositCount:DI},{typeName:"Eth1Block",jsonCase:"eth2"}),bg=new Y({previousVersion:KC,currentVersion:KC,epoch:LC},{typeName:"Fork",jsonCase:"eth2"}),g2=new Y({currentVersion:KC,genesisValidatorsRoot:HA},{typeName:"ForkData",jsonCase:"eth2"}),B2=new Y({forkDigest:Rn,nextForkVersion:KC,nextForkEpoch:LC},{typeName:"ENRForkID",jsonCase:"eth2"}),cg=new EI(HA,Yi),Ug=new EI(HA,Yi),C2=new Y({blockRoots:cg,stateRoots:Ug},{typeName:"HistoricalBatch",jsonCase:"eth2"}),Q2=new Y({blockRoots:HA,stateRoots:HA},{typeName:"HistoricalBatchRoots",jsonCase:"eth2"}),i2=dn,Tg=new yA(dn,DC),qg=new rf(DC),Vg=new EI(lB,Vl),jg=new GQ(DI,jl),Zg=new $I(l1),UB=new Y({slot:Kg,index:un,beaconBlockRoot:HA,source:qA,target:qA},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ye=new Y({slot:DB,index:DB,beaconBlockRoot:HA,source:me,target:me},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),e2=new Y({attestingIndices:MQ,data:UB,signature:jI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),be=new Y({attestingIndices:MQ,data:Ye,signature:jI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),kn=new Y({aggregationBits:Le,data:UB,inclusionDelay:Kg,proposerIndex:cB},{typeName:"PendingAttestation",jsonCase:"eth2"}),t2=new Y({objectRoot:HA,domain:vf},{typeName:"SigningData",jsonCase:"eth2"}),mQ=new Y({aggregationBits:Le,data:UB,signature:jI},{typeName:"Attestation",jsonCase:"eth2"}),E2=mQ,Jn=new Y({attestation1:be,attestation2:be},{typeName:"AttesterSlashing",jsonCase:"eth2"}),pn=new Y({proof:new EI(lB,fo+1),data:Ke},{typeName:"Deposit",jsonCase:"eth2"}),Hn=new Y({signedHeader1:Me,signedHeader2:Me},{typeName:"ProposerSlashing",jsonCase:"eth2"}),Mn=new Y({epoch:LC,validatorIndex:cB},{typeName:"VoluntaryExit",jsonCase:"eth2",cachePermanentRootStruct:!0}),mn=new Y({message:Mn,signature:jI},{typeName:"SignedVoluntaryExit",jsonCase:"eth2"}),vA=new Y({randaoReveal:jI,eth1Data:Ig,graffiti:lB,proposerSlashings:new yA(Hn,Zl),attesterSlashings:new yA(Jn,_l),attestations:new yA(mQ,ho),deposits:new yA(pn,Pl),voluntaryExits:new yA(mn,Ol)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ln=new Y({slot:Kg,proposerIndex:cB,parentRoot:HA,stateRoot:HA,body:vA},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),o2=new Y({message:Ln,signature:jI},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Te=new yA(kn,ho*SI),r2=new Y({genesisTime:DI,genesisValidatorsRoot:HA,slot:Kg,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(HA,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:DI,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochAttestations:Te,currentEpochAttestations:Te,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA},{typeName:"BeaconState",jsonCase:"eth2"}),n2=new Y({validators:MQ,committeeIndex:un,slot:Kg},{typeName:"CommitteeAssignment",jsonCase:"eth2"}),Kn=new Y({aggregatorIndex:cB,aggregate:mQ,selectionProof:jI},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),a2=new Y({message:Kn,signature:jI},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),Yn=new Y({forkDigest:Rn,finalizedRoot:HA,finalizedEpoch:LC,headRoot:HA,headSlot:Kg},{typeName:"Status",jsonCase:"eth2"}),s2=DB,h2=DB,l2=new Y({seqNumber:DB,attnets:pe},{typeName:"Metadata",jsonCase:"eth2"}),D2=new Y({startSlot:Kg,count:DI,step:DI},{typeName:"BeaconBlocksByRangeRequest",jsonCase:"eth2"}),c2=new Y({genesisValidatorsRoot:HA,genesisTime:DI,genesisForkVersion:KC},{typeName:"Genesis",jsonCase:"eth2"}),_g=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:Kn,Attestation:mQ,AttestationData:UB,AttestationDataBigint:Ye,AttestationSubnets:pe,AttesterSlashing:Jn,Balances:qg,BeaconBlock:Ln,BeaconBlockBody:vA,BeaconBlockHeader:KI,BeaconBlockHeaderBigint:Fn,BeaconBlocksByRangeRequest:D2,BeaconState:r2,Checkpoint:qA,CheckpointBigint:me,CommitteeAssignment:n2,CommitteeBits:Le,CommitteeIndices:MQ,Deposit:pn,DepositData:Ke,DepositDataRootList:Xf,DepositEvent:$f,DepositMessage:Wf,ENRForkID:B2,EpochAttestations:Te,Eth1Block:I2,Eth1Data:Ig,Eth1DataOrdered:A2,Eth1DataVotes:Yg,Fork:bg,ForkData:g2,Genesis:c2,Goodbye:s2,HistoricalBatch:C2,HistoricalBatchRoots:Q2,HistoricalBlockRoots:cg,HistoricalStateRoots:Ug,IndexedAttestation:e2,IndexedAttestationBigint:be,JustificationBits:Zg,Metadata:l2,PendingAttestation:kn,Ping:h2,ProposerSlashing:Hn,RandaoMixes:Vg,SignedAggregateAndProof:a2,SignedBeaconBlock:o2,SignedBeaconBlockHeader:He,SignedBeaconBlockHeaderBigint:Me,SignedVoluntaryExit:mn,SigningData:t2,SingleAttestation:E2,Slashings:jg,Status:Yn,Validator:i2,Validators:Tg,VoluntaryExit:Mn},Symbol.toStringTag,{value:"Module"})),{Bytes32:qe,UintNum64:YC,UintBn64:U2,Slot:Pg,SubcommitteeIndex:bn,ValidatorIndex:Ve,Root:OB,BLSPubkey:Tn,BLSSignature:xB,ParticipationFlags:f2}=Dg,qn=new $I(yo),je=new EI(qe,KB),Vn=new EI(qe,f1),jn=new EI(qe,oQ),Zn=new Y({seqNumber:U2,attnets:pe,syncnets:qn},{typeName:"Metadata",jsonCase:"eth2"}),WA=new Y({pubkeys:new EI(Tn,Gg),aggregatePubkey:Tn},{typeName:"SyncCommittee",jsonCase:"eth2"}),S2=new Y({slot:Pg,beaconBlockRoot:OB,validatorIndex:Ve,signature:xB},{typeName:"SyncCommitteeMessage",jsonCase:"eth2"}),_n=new Y({slot:Pg,beaconBlockRoot:OB,subcommitteeIndex:bn,aggregationBits:new $I(Gg/yo),signature:xB},{typeName:"SyncCommitteeContribution",jsonCase:"eth2"}),Pn=new Y({aggregatorIndex:Ve,contribution:_n,selectionProof:xB},{typeName:"ContributionAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),w2=new Y({message:Pn,signature:xB},{typeName:"SignedContributionAndProof",jsonCase:"eth2"}),y2=new Y({slot:Pg,subcommitteeIndex:bn},{typeName:"SyncAggregatorSelectionData",jsonCase:"eth2"}),On=new $I(Gg),cI=new Y({syncCommitteeBits:On,syncCommitteeSignature:xB},{typeName:"SyncCommitteeBits",jsonCase:"eth2"}),gg=new Y({...vA.fields,syncAggregate:cI},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),xn=new Y({slot:Pg,proposerIndex:Ve,parentRoot:OB,stateRoot:OB,body:gg},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),N2=new Y({message:xn,signature:xB},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),RI=new LI(f2,DC),fB=new LI(YC,DC),d2=new Y({genesisTime:YC,genesisValidatorsRoot:OB,slot:Pg,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(OB,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:YC,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA},{typeName:"BeaconState",jsonCase:"eth2"}),SB=new Y({beacon:KI},{typeName:"LightClientHeader",jsonCase:"eth2"}),LQ=new Y({header:SB,currentSyncCommittee:WA,currentSyncCommitteeBranch:Vn},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),zB=new Y({attestedHeader:SB,nextSyncCommittee:WA,nextSyncCommitteeBranch:jn,finalizedHeader:SB,finalityBranch:je,syncAggregate:cI,signatureSlot:Pg},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Ze=new Y({attestedHeader:SB,finalizedHeader:SB,finalityBranch:je,syncAggregate:cI,signatureSlot:Pg},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),u2=new Y({attestedHeader:SB,syncAggregate:cI,signatureSlot:Pg},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),R2=new Y({startPeriod:YC,count:YC},{typeName:"LightClientUpdatesByRange",jsonCase:"eth2"}),G2=new Y({snapshot:LQ,validUpdates:new yA(zB,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),wB=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:xn,BeaconBlockBody:gg,BeaconState:d2,ContributionAndProof:Pn,CurrentSyncCommitteeBranch:Vn,EpochParticipation:RI,FinalityBranch:je,InactivityScores:fB,LightClientBootstrap:LQ,LightClientFinalityUpdate:Ze,LightClientHeader:SB,LightClientOptimisticUpdate:u2,LightClientStore:G2,LightClientUpdate:zB,LightClientUpdatesByRange:R2,Metadata:Zn,NextSyncCommitteeBranch:jn,SignedBeaconBlock:N2,SignedContributionAndProof:w2,SyncAggregate:cI,SyncAggregatorSelectionData:y2,SyncCommittee:WA,SyncCommitteeBits:On,SyncCommitteeContribution:_n,SyncCommitteeMessage:S2,SyncSubnets:qn},Symbol.toStringTag,{value:"Module"}));class vB extends uQ{typeName="string";byteLength=0;fixedSize=0;minSize=0;maxSize=0;defaultValue(){return""}value_serializeToBytes(){throw Error("Not supported in String type")}value_deserializeFromBytes(){throw Error("Not supported in String type")}tree_serializeToBytes(){throw Error("Not supported in String type")}tree_deserializeFromBytes(){throw Error("Not supported in String type")}tree_getFromNode(){throw Error("Not supported in String type")}tree_setToNode(){throw Error("Not supported in String type")}tree_getFromPackedNode(){throw Error("Not supported in String type")}tree_setToPackedNode(){throw Error("Not supported in String type")}fromJson(A){if(typeof A!="string")throw Error(`JSON invalid type ${typeof A} expected string`);return A}toJson(A){return A}}const Og=new vB,{Bytes32:KQ,UintNum64:ZI,Slot:_e,ValidatorIndex:zn,Root:GI,BLSSignature:YQ,UintBn256:Pe,BLSPubkey:vn,ExecutionAddress:Wn}=Dg,Xn=new kC(zl),$n=new yA(Xn,vl),Oe=new Y({parentHash:GI,feeRecipient:Wn,stateRoot:KQ,receiptsRoot:KQ,logsBloom:new uI(Wl),prevRandao:KQ,blockNumber:ZI,gasLimit:ZI,gasUsed:ZI,timestamp:ZI,extraData:new kC(Xl),baseFeePerGas:Pe,blockHash:GI}),xe=new Y({...Oe.fields,transactions:$n},{typeName:"ExecutionPayload",jsonCase:"eth2"}),bC=new Y({...Oe.fields,transactionsRoot:GI},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),Aa=new Y({...gg.fields,executionPayload:xe},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ia=new Y({slot:_e,proposerIndex:zn,parentRoot:GI,stateRoot:GI,body:Aa},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),F2=new Y({message:Ia,signature:YQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),k2=new Y({blockHash:GI,parentHash:GI,totalDifficulty:Pe},{typeName:"PowBlock",jsonCase:"eth2"}),J2=new Y({genesisTime:ZI,genesisValidatorsRoot:GI,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(GI,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:ZI,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:bC},{typeName:"BeaconState",jsonCase:"eth2"}),ga=new Y({...gg.fields,executionPayloadHeader:bC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ze=new Y({slot:_e,proposerIndex:zn,parentRoot:GI,stateRoot:GI,body:ga},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),p2=new Y({message:ze,signature:YQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Ba=new Y({feeRecipient:Wn,gasLimit:ZI,timestamp:ZI,pubkey:vn},{typeName:"ValidatorRegistrationV1",jsonCase:"eth2"}),H2=new Y({message:Ba,signature:YQ},{typeName:"SignedValidatorRegistrationV1",jsonCase:"eth2"}),Ca=new Y({header:bC,value:Pe,pubkey:vn},{typeName:"BuilderBid",jsonCase:"eth2"}),M2=new Y({message:Ca,signature:YQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),ve=new Y({timestamp:ZI,prevRandao:KQ,suggestedFeeRecipient:Og},{typeName:"PayloadAttributes",jsonCase:"eth2"}),TC=new Y({proposerIndex:ZI,proposalSlot:_e,parentBlockNumber:ZI,parentBlockRoot:GI,parentBlockHash:GI},{typeName:"SSEPayloadAttributesCommon",jsonCase:"eth2"}),m2=new Y({...TC.fields,payloadAttributes:ve},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),WB=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Ia,BeaconBlockBody:Aa,BeaconState:J2,BlindedBeaconBlock:ze,BlindedBeaconBlockBody:ga,BuilderBid:Ca,CommonExecutionPayloadType:Oe,ExecutionPayload:xe,ExecutionPayloadHeader:bC,PayloadAttributes:ve,PowBlock:k2,SSEPayloadAttributes:m2,SSEPayloadAttributesCommon:TC,SignedBeaconBlock:F2,SignedBlindedBeaconBlock:p2,SignedBuilderBid:M2,SignedValidatorRegistrationV1:H2,Transaction:Xn,Transactions:$n,ValidatorRegistrationV1:Ba},Symbol.toStringTag,{value:"Module"})),{UintNum64:Qa,Slot:bQ,ValidatorIndex:TQ,WithdrawalIndex:ia,Root:yB,BLSSignature:qQ,BLSPubkey:ea,ExecutionAddress:ta,Gwei:L2,UintBn256:K2,Bytes32:Y2}=Dg,Ea=new EI(Y2,uo),oa=new Y({index:ia,validatorIndex:TQ,address:ta,amount:L2},{typeName:"Withdrawal",jsonCase:"eth2"}),ra=new Y({validatorIndex:TQ,fromBlsPubkey:ea,toExecutionAddress:ta},{typeName:"BLSToExecutionChange",jsonCase:"eth2"}),na=new Y({message:ra,signature:qQ},{typeName:"SignedBLSToExecutionChange",jsonCase:"eth2"}),We=new yA(oa,A1),Xe=new Y({...xe.fields,withdrawals:We},{typeName:"ExecutionPayload",jsonCase:"eth2"}),XB=new Y({...bC.fields,withdrawalsRoot:yB},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),$e=new yA(na,$l),NB=new Y({...gg.fields,executionPayload:Xe,blsToExecutionChanges:$e},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),At=new Y({slot:bQ,proposerIndex:TQ,parentRoot:yB,stateRoot:yB,body:NB},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),b2=new Y({message:At,signature:qQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),aa=new Y({header:XB,value:K2,pubkey:ea},{typeName:"BuilderBid",jsonCase:"eth2"}),T2=new Y({message:aa,signature:qQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),sa=new Y({blockSummaryRoot:yB,stateSummaryRoot:yB},{typeName:"HistoricalSummary",jsonCase:"eth2"}),ha=new yA(sa,Rg,{typeName:"HistoricalSummaries"}),Bg=new Y({genesisTime:Qa,genesisValidatorsRoot:yB,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(yB,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:Qa,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:XB,nextWithdrawalIndex:ia,nextWithdrawalValidatorIndex:TQ,historicalSummaries:ha},{typeName:"BeaconState",jsonCase:"eth2"}),la=new Y({...gg.fields,executionPayloadHeader:XB,blsToExecutionChanges:$e},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),It=new Y({...ze.fields,body:la},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),q2=new Y({message:It,signature:qQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),xg=new Y({beacon:KI,execution:XB,executionBranch:Ea},{typeName:"LightClientHeader",jsonCase:"eth2"}),Da=new Y({header:xg,currentSyncCommittee:WA,currentSyncCommitteeBranch:LQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),ca=new Y({attestedHeader:xg,nextSyncCommittee:WA,nextSyncCommitteeBranch:zB.fields.nextSyncCommitteeBranch,finalizedHeader:xg,finalityBranch:zB.fields.finalityBranch,syncAggregate:cI,signatureSlot:bQ},{typeName:"LightClientUpdate",jsonCase:"eth2"}),V2=new Y({attestedHeader:xg,finalizedHeader:xg,finalityBranch:Ze.fields.finalityBranch,syncAggregate:cI,signatureSlot:bQ},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),j2=new Y({attestedHeader:xg,syncAggregate:cI,signatureSlot:bQ},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),Z2=new Y({snapshot:Da,validUpdates:new yA(ca,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),VQ=new Y({...ve.fields,withdrawals:We},{typeName:"PayloadAttributes",jsonCase:"eth2"}),_2=new Y({...TC.fields,payloadAttributes:VQ},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),qC=Object.freeze(Object.defineProperty({__proto__:null,BLSToExecutionChange:ra,BLSToExecutionChanges:$e,BeaconBlock:At,BeaconBlockBody:NB,BeaconState:Bg,BlindedBeaconBlock:It,BlindedBeaconBlockBody:la,BuilderBid:aa,ExecutionBranch:Ea,ExecutionPayload:Xe,ExecutionPayloadHeader:XB,HistoricalSummaries:ha,HistoricalSummary:sa,LightClientBootstrap:Da,LightClientFinalityUpdate:V2,LightClientHeader:xg,LightClientOptimisticUpdate:j2,LightClientStore:Z2,LightClientUpdate:ca,PayloadAttributes:VQ,SSEPayloadAttributes:_2,SignedBLSToExecutionChange:na,SignedBeaconBlock:b2,SignedBlindedBeaconBlock:q2,SignedBuilderBid:T2,Withdrawal:oa,Withdrawals:We},Symbol.toStringTag,{value:"Module"})),{UintNum64:gt,Slot:jQ,Root:ZQ,BLSSignature:Bt,UintBn64:_Q,UintBn256:P2,Bytes32:PQ,Bytes48:Ct,Bytes96:O2,BLSPubkey:x2,BlobIndex:Ua}=Dg,z2=Ct,v2=O2,W2=PQ,Qt=Ct,$B=Ct,OQ=new uI(Go*I1),fg=new yA(OQ,og),fa=PQ,X2=new yA(fa,og),$2=PQ,Sg=new yA(Qt,og),dB=new yA($B,og),AS=new Y({startSlot:jQ,count:gt},{typeName:"BlobSidecarsByRangeRequest",jsonCase:"eth2"}),IS=new Y({blockRoot:ZQ,index:Ua},{typeName:"BlobIdentifier",jsonCase:"eth2"}),xQ=new Y({...Xe.fields,blobGasUsed:_Q,excessBlobGas:_Q},{typeName:"ExecutionPayload",jsonCase:"eth2"}),AC=new Y({...XB.fields,blobGasUsed:_Q,excessBlobGas:_Q},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),zQ=new Y({...gg.fields,executionPayload:xQ,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:Sg},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),vQ=new Y({...At.fields,body:zQ},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Sa=new Y({message:vQ,signature:Bt},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),wa=new EI(PQ,g1),ya=new Y({index:Ua,blob:OQ,kzgCommitment:Qt,kzgProof:$B,signedBlockHeader:He,kzgCommitmentInclusionProof:wa},{typeName:"BlobSidecar",jsonCase:"eth2"}),gS=new yA(ya,og),Na=new Y({commitments:Sg,proofs:dB,blobs:fg},{typeName:"BlobsBundle",jsonCase:"eth2"}),da=new Y({...gg.fields,executionPayloadHeader:AC,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:Sg},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),it=new Y({...It.fields,body:da},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),BS=new Y({message:it,signature:Bt},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),ua=new Y({header:AC,blobKzgCommitments:Sg,value:P2,pubkey:x2},{typeName:"BuilderBid",jsonCase:"eth2"}),CS=new Y({message:ua,signature:Bt},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),QS=new Y({executionPayload:xQ,blobsBundle:Na},{typeName:"ExecutionPayloadAndBlobsBundle",jsonCase:"eth2"}),iS=new Y({genesisTime:gt,genesisValidatorsRoot:ZQ,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(ZQ,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:gt,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:AC,nextWithdrawalIndex:Bg.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:Bg.fields.nextWithdrawalValidatorIndex,historicalSummaries:Bg.fields.historicalSummaries},{typeName:"BeaconState",jsonCase:"eth2"}),FI=new Y({beacon:KI,execution:AC,executionBranch:xg.fields.executionBranch},{typeName:"LightClientHeader",jsonCase:"eth2"}),Ra=new Y({header:FI,currentSyncCommittee:WA,currentSyncCommitteeBranch:LQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),Ga=new Y({attestedHeader:FI,nextSyncCommittee:WA,nextSyncCommitteeBranch:zB.fields.nextSyncCommitteeBranch,finalizedHeader:FI,finalityBranch:zB.fields.finalityBranch,syncAggregate:cI,signatureSlot:jQ},{typeName:"LightClientUpdate",jsonCase:"eth2"}),eS=new Y({attestedHeader:FI,finalizedHeader:FI,finalityBranch:Ze.fields.finalityBranch,syncAggregate:cI,signatureSlot:jQ},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),tS=new Y({attestedHeader:FI,syncAggregate:cI,signatureSlot:jQ},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),ES=new Y({snapshot:Ra,validUpdates:new yA(Ga,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),Fa=new Y({...VQ.fields,parentBeaconBlockRoot:ZQ},{typeName:"PayloadAttributes",jsonCase:"eth2"}),oS=new Y({...TC.fields,payloadAttributes:Fa},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),rS=new Y({block:vQ,kzgProofs:dB,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),nS=new Y({signedBlock:Sa,kzgProofs:dB,blobs:fg},{typeName:"SignedBlockContents",jsonCase:"eth2"}),WQ=Object.freeze(Object.defineProperty({__proto__:null,BLSFieldElement:W2,BeaconBlock:vQ,BeaconBlockBody:zQ,BeaconState:iS,BlindedBeaconBlock:it,BlindedBeaconBlockBody:da,BlindedBlob:fa,BlindedBlobs:X2,Blob:OQ,BlobIdentifier:IS,BlobKzgCommitments:Sg,BlobSidecar:ya,BlobSidecars:gS,BlobSidecarsByRangeRequest:AS,Blobs:fg,BlobsBundle:Na,BlockContents:rS,BuilderBid:ua,ExecutionPayload:xQ,ExecutionPayloadAndBlobsBundle:QS,ExecutionPayloadHeader:AC,G1Point:z2,G2Point:v2,KZGCommitment:Qt,KZGProof:$B,KZGProofs:dB,KzgCommitmentInclusionProof:wa,LightClientBootstrap:Ra,LightClientFinalityUpdate:eS,LightClientHeader:FI,LightClientOptimisticUpdate:tS,LightClientStore:ES,LightClientUpdate:Ga,PayloadAttributes:Fa,SSEPayloadAttributes:oS,SignedBeaconBlock:Sa,SignedBlindedBeaconBlock:BS,SignedBlockContents:nS,SignedBuilderBid:CS,VersionedHash:$2},Symbol.toStringTag,{value:"Module"})),{Epoch:et,Gwei:VC,UintNum64:XQ,Slot:$Q,Root:tt,BLSSignature:_I,UintBn256:aS,Bytes32:jC,BLSPubkey:IC,DepositIndex:sS,UintBn64:hS,ExecutionAddress:ka,ValidatorIndex:gC,CommitteeIndex:lS}=Dg,Ja=new EI(jC,w1),Et=new EI(jC,kg),pa=new EI(jC,rQ),Ha=new dQ(lC*Ki),Ma=new $I(Ki),ot=new LI(gC,lC*Ki),Ai=new Y({aggregationBits:Ha,data:UB,signature:_I,committeeBits:Ma},{typeName:"Attestation",jsonCase:"eth2"}),DS=new Y({committeeIndex:lS,attesterIndex:gC,data:UB,signature:_I},{typeName:"SingleAttestation",jsonCase:"eth2"}),cS=new Y({attestingIndices:ot,data:UB,signature:_I},{typeName:"IndexedAttestation",jsonCase:"eth2"}),rt=new Y({attestingIndices:ot,data:Ye,signature:_I},{typeName:"IndexedAttestation",jsonCase:"eth2"}),nt=new Y({attestation1:rt,attestation2:rt},{typeName:"AttesterSlashing",jsonCase:"eth2"}),ma=new Y({aggregatorIndex:gC,aggregate:Ai,selectionProof:_I},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),US=new Y({message:ma,signature:_I},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),La=new Y({pubkey:IC,withdrawalCredentials:jC,amount:XQ,signature:_I,index:sS},{typeName:"DepositRequest",jsonCase:"eth2"}),Ka=new yA(La,e1),Ya=new Y({sourceAddress:ka,validatorPubkey:IC,amount:VC},{typeName:"WithdrawalRequest",jsonCase:"eth2"}),ba=new yA(Ya,t1),Ta=new Y({sourceAddress:ka,sourcePubkey:IC,targetPubkey:IC},{typeName:"ConsolidationRequest",jsonCase:"eth2"}),qa=new yA(Ta,i1),ZC=new Y({deposits:Ka,withdrawals:ba,consolidations:qa},{typeName:"ExecutionRequests",jsonCase:"eth2"}),Ii=AC,at=xQ,gi=new Y({randaoReveal:vA.fields.randaoReveal,eth1Data:vA.fields.eth1Data,graffiti:vA.fields.graffiti,proposerSlashings:vA.fields.proposerSlashings,attesterSlashings:new yA(nt,Do),attestations:new yA(Ai,co),deposits:vA.fields.deposits,voluntaryExits:vA.fields.voluntaryExits,syncAggregate:gg.fields.syncAggregate,executionPayload:at,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:zQ.fields.blobKzgCommitments,executionRequests:ZC},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),_C=new Y({...vQ.fields,body:gi},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Bi=new Y({message:_C,signature:_I},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Va=new Y({randaoReveal:vA.fields.randaoReveal,eth1Data:vA.fields.eth1Data,graffiti:vA.fields.graffiti,proposerSlashings:vA.fields.proposerSlashings,attesterSlashings:new yA(nt,Do),attestations:new yA(Ai,co),deposits:vA.fields.deposits,voluntaryExits:vA.fields.voluntaryExits,syncAggregate:cI,executionPayloadHeader:Ii,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:zQ.fields.blobKzgCommitments,executionRequests:ZC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ja=new Y({...it.fields,body:Va},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),fS=new Y({message:ja,signature:_I},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Za=new Y({header:Ii,blobKzgCommitments:Sg,executionRequests:ZC,value:aS,pubkey:IC},{typeName:"BuilderBid",jsonCase:"eth2"}),SS=new Y({message:Za,signature:_I},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),_a=new Y({pubkey:IC,withdrawalCredentials:jC,amount:XQ,signature:_I,slot:$Q},{typeName:"PendingDeposit",jsonCase:"eth2"}),Pa=new yA(_a,B1),Oa=new Y({validatorIndex:gC,amount:VC,withdrawableEpoch:et},{typeName:"PendingPartialWithdrawal",jsonCase:"eth2"}),xa=new yA(Oa,C1),za=new Y({sourceIndex:gC,targetIndex:gC},{typeName:"PendingConsolidation",jsonCase:"eth2"}),va=new yA(za,Q1),PC=new Y({genesisTime:XQ,genesisValidatorsRoot:tt,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(tt,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:XQ,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:Ii,nextWithdrawalIndex:Bg.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:Bg.fields.nextWithdrawalValidatorIndex,historicalSummaries:Bg.fields.historicalSummaries,depositRequestsStartIndex:hS,depositBalanceToConsume:VC,exitBalanceToConsume:VC,earliestExitEpoch:et,consolidationBalanceToConsume:VC,earliestConsolidationEpoch:et,pendingDeposits:Pa,pendingPartialWithdrawals:xa,pendingConsolidations:va},{typeName:"BeaconState",jsonCase:"eth2"}),Wa=new Y({header:FI,currentSyncCommittee:WA,currentSyncCommitteeBranch:Ja},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),Xa=new Y({attestedHeader:FI,nextSyncCommittee:WA,nextSyncCommitteeBranch:pa,finalizedHeader:FI,finalityBranch:Et,syncAggregate:cI,signatureSlot:$Q},{typeName:"LightClientUpdate",jsonCase:"eth2"}),wS=new Y({attestedHeader:FI,finalizedHeader:FI,finalityBranch:Et,syncAggregate:cI,signatureSlot:$Q},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),yS=new Y({attestedHeader:FI,syncAggregate:cI,signatureSlot:$Q},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),NS=new Y({snapshot:Wa,validUpdates:new yA(Xa,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),$a=new Y({...VQ.fields,parentBeaconBlockRoot:tt},{typeName:"PayloadAttributes",jsonCase:"eth2"}),dS=new Y({...TC.fields,payloadAttributes:$a},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),uS=new Y({block:_C,kzgProofs:dB,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),RS=new Y({signedBlock:Bi,kzgProofs:dB,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),st=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:ma,AggregationBits:Ha,Attestation:Ai,AttesterSlashing:nt,AttestingIndices:ot,BeaconBlock:_C,BeaconBlockBody:gi,BeaconState:PC,BlindedBeaconBlock:ja,BlindedBeaconBlockBody:Va,BlockContents:uS,BuilderBid:Za,CommitteeBits:Ma,ConsolidationRequest:Ta,ConsolidationRequests:qa,CurrentSyncCommitteeBranch:Ja,DepositRequest:La,DepositRequests:Ka,ExecutionPayload:at,ExecutionPayloadHeader:Ii,ExecutionRequests:ZC,FinalityBranch:Et,IndexedAttestation:cS,IndexedAttestationBigint:rt,LightClientBootstrap:Wa,LightClientFinalityUpdate:wS,LightClientOptimisticUpdate:yS,LightClientStore:NS,LightClientUpdate:Xa,NextSyncCommitteeBranch:pa,PayloadAttributes:$a,PendingConsolidation:za,PendingConsolidations:va,PendingDeposit:_a,PendingDeposits:Pa,PendingPartialWithdrawal:Oa,PendingPartialWithdrawals:xa,SSEPayloadAttributes:dS,SignedAggregateAndProof:US,SignedBeaconBlock:Bi,SignedBlindedBeaconBlock:fS,SignedBlockContents:RS,SignedBuilderBid:SS,SingleAttestation:DS,WithdrawalRequest:Ya,WithdrawalRequests:ba},Symbol.toStringTag,{value:"Module"})),{Root:GS,ColumnIndex:Ci,RowIndex:FS,Bytes32:kS,Slot:As,UintNum64:Is,ValidatorIndex:JS}=Dg,pS=$B,HS=OQ,MS=new Y({...Zn.fields,custodyGroupCount:Is},{typeName:"Metadata",jsonCase:"eth2"}),mS=new Y({...Yn.fields,earliestAvailableSlot:As},{typeName:"Status",jsonCase:"eth2"}),Qi=new uI(Go*E1),ht=new yA(Qi,og),LS=new yA(ht,LB),KS=new yA(Qi,og*LB),gs=new EI(kS,r1),ii=new yA($B,o1*og),Bs=new GQ(JS,(Tl+1)*SI),BC=new Y({index:Ci,column:ht,kzgCommitments:Sg,kzgProofs:dB,signedBlockHeader:He,kzgCommitmentsInclusionProof:gs},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),YS=new yA(BC,LB),bS=new Y({cell:Qi,kzgProof:$B,columnIndex:Ci,rowIndex:FS},{typeName:"MatrixEntry",jsonCase:"eth2"}),TS=new Y({blockRoot:GS,columns:new LI(Ci,LB)},{typeName:"DataColumnsByRootIdentifier",jsonCase:"eth2"}),qS=new Y({startSlot:As,count:Is,columns:new LI(Ci,LB)},{typeName:"DataColumnSidecarsByRangeRequest",jsonCase:"eth2"}),Cs=_C,VS=Bi,jS=new Y({commitments:Sg,proofs:ii,blobs:fg},{typeName:"BlobsBundle",jsonCase:"eth2"}),Qs=new Y({...PC.fields,proposerLookahead:Bs},{typeName:"BeaconState",jsonCase:"eth2"}),ZS=new Y({block:_C,kzgProofs:ii,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),_S=new Y({signedBlock:Bi,kzgProofs:ii,blobs:fg},{typeName:"SignedBlockContents",jsonCase:"eth2"}),is=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Cs,BeaconState:Qs,Blob:HS,BlobsBundle:jS,BlockContents:ZS,Cell:Qi,DataColumn:ht,DataColumnSidecar:BC,DataColumnSidecars:YS,DataColumnSidecarsByRangeRequest:qS,DataColumns:LS,DataColumnsByRootIdentifier:TS,ExtendedMatrix:KS,KZGProof:pS,KZGProofs:ii,KzgCommitmentsInclusionProof:gs,MatrixEntry:bS,Metadata:MS,ProposerLookahead:Bs,SignedBeaconBlock:VS,SignedBlockContents:_S,Status:mS},Symbol.toStringTag,{value:"Module"})),{Gwei:CC,ExecutionAddress:es,ValidatorIndex:OC,Epoch:lt,BLSSignature:QC,Bytes32:Dt,Root:wg,Slot:ct,Boolean:ts,UintBn64:Es,UintNum64:os}=Dg,Ut=new Y({feeRecipient:es,amount:CC,builderIndex:OC,withdrawableEpoch:lt},{typeName:"BuilderPendingWithdrawal",jsonCase:"eth2"}),rs=new Y({weight:CC,withdrawal:Ut},{typeName:"BuilderPendingPayment",jsonCase:"eth2"}),ei=new Y({beaconBlockRoot:wg,slot:ct,payloadPresent:ts,blobDataAvailable:ts},{typeName:"PayloadAttestationData",jsonCase:"eth2"}),ns=new Y({aggregationBits:new $I(Uo),data:ei,signature:QC},{typeName:"PayloadAttestation",jsonCase:"eth2"}),PS=new Y({validatorIndex:OC,data:ei,signature:QC},{typeName:"PayloadAttestationMessage",jsonCase:"eth2"}),OS=new Y({attestingIndices:new LI(OC,Uo),data:ei,signature:QC},{typeName:"IndexedPayloadAttestation",jsonCase:"eth2"}),ft=new Y({parentBlockHash:Dt,parentBlockRoot:wg,blockHash:Dt,feeRecipient:es,gasLimit:Es,builderIndex:OC,slot:ct,value:CC,blobKzgCommitmentsRoot:wg},{typeName:"ExecutionPayloadBid",jsonCase:"eth2"}),as=new Y({message:ft,signature:QC},{typeName:"SignedExecutionPayloadBid",jsonCase:"eth2"}),ss=new Y({payload:at,executionRequests:ZC,builderIndex:OC,beaconBlockRoot:wg,slot:ct,blobKzgCommitments:Sg,stateRoot:wg},{typeName:"ExecutionPayloadEnvelope",jsonCase:"eth2"}),xS=new Y({message:ss,signature:QC},{typeName:"SignedExecutionPayloadEnvelope",jsonCase:"eth2"}),hs=new Y({randaoReveal:vA.fields.randaoReveal,eth1Data:vA.fields.eth1Data,graffiti:vA.fields.graffiti,proposerSlashings:vA.fields.proposerSlashings,attesterSlashings:gi.fields.attesterSlashings,attestations:gi.fields.attestations,deposits:vA.fields.deposits,voluntaryExits:vA.fields.voluntaryExits,syncAggregate:gg.fields.syncAggregate,blsToExecutionChanges:NB.fields.blsToExecutionChanges,signedExecutionPayloadBid:as,payloadAttestations:new yA(ns,n1)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ls=new Y({...Cs.fields,body:hs},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),zS=new Y({message:ls,signature:QC},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),vS=new Y({genesisTime:os,genesisValidatorsRoot:wg,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(wg,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:os,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadBid:ft,nextWithdrawalIndex:Bg.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:Bg.fields.nextWithdrawalValidatorIndex,historicalSummaries:Bg.fields.historicalSummaries,depositRequestsStartIndex:Es,depositBalanceToConsume:CC,exitBalanceToConsume:CC,earliestExitEpoch:lt,consolidationBalanceToConsume:CC,earliestConsolidationEpoch:lt,pendingDeposits:PC.fields.pendingDeposits,pendingPartialWithdrawals:PC.fields.pendingPartialWithdrawals,pendingConsolidations:PC.fields.pendingConsolidations,proposerLookahead:Qs.fields.proposerLookahead,executionPayloadAvailability:new $I(Yi),builderPendingPayments:new EI(rs,2*SI),builderPendingWithdrawals:new yA(Ut,a1),latestBlockHash:Dt,latestWithdrawalsRoot:wg},{typeName:"BeaconState",jsonCase:"eth2"}),Ds=new Y({index:BC.fields.index,column:BC.fields.column,kzgCommitments:BC.fields.kzgCommitments,kzgProofs:BC.fields.kzgProofs,beaconBlockRoot:wg},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),WS=new yA(Ds,LB),XS=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:ls,BeaconBlockBody:hs,BeaconState:vS,BuilderPendingPayment:rs,BuilderPendingWithdrawal:Ut,DataColumnSidecar:Ds,DataColumnSidecars:WS,ExecutionPayloadBid:ft,ExecutionPayloadEnvelope:ss,IndexedPayloadAttestation:OS,PayloadAttestation:ns,PayloadAttestationData:ei,PayloadAttestationMessage:PS,SignedBeaconBlock:zS,SignedExecutionPayloadBid:as,SignedExecutionPayloadEnvelope:xS},Symbol.toStringTag,{value:"Module"}));var iC;(function(I){I.builder="builder",I.engine="engine"})(iC||(iC={}));const yg={[nA.phase0]:{..._g},[nA.altair]:{..._g,...wB},[nA.bellatrix]:{..._g,...wB,...WB},[nA.capella]:{..._g,...wB,...WB,...qC},[nA.deneb]:{..._g,...wB,...WB,...qC,...WQ},[nA.electra]:{..._g,...wB,...WB,...qC,...WQ,...st},[nA.fulu]:{..._g,...wB,...WB,...qC,...WQ,...st,...is},[nA.gloas]:{..._g,...wB,...WB,...qC,...WQ,...st,...is,...XS}},NA=yg[nA.phase0],PI=yg[nA.altair],cs=yg[nA.bellatrix],Cg=yg[nA.capella],xC=yg[nA.deneb],wI=yg[nA.electra],St=yg[nA.fulu],$S=yg[nA.gloas];function MA(I,A){const g=yg[I];if(g===void 0)throw Error(`SSZ types for fork ${I} are not defined`);return A===void 0?g:g[A]}const kI=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:_B,BLSSignature:JQ,BlobIndex:Ge,Boolean:CI,Byte:en,Bytes20:tn,Bytes32:Se,Bytes4:mC,Bytes48:we,Bytes8:fe,Bytes96:ye,ColumnIndex:Je,CommitteeIndex:sB,CustodyIndex:wn,DepositIndex:hn,Domain:fn,DomainType:Un,Epoch:VI,EpochInf:nn,ExecutionAddress:ke,ForkDigest:Fe,Gwei:ln,ParticipationFlags:Sn,Root:hB,RowIndex:yn,Slot:LA,SubcommitteeIndex:Re,SyncPeriod:an,Uint16:on,Uint32:Ne,Uint8:En,UintBn128:rn,UintBn256:ue,UintBn64:ZB,UintNum64:RA,UintNumInf64:de,ValidatorIndex:zA,Version:cn,Wei:Dn,WithdrawalIndex:sn,altair:PI,bellatrix:cs,capella:Cg,deneb:xC,electra:wI,fulu:St,gloas:$S,phase0:NA,sszTypesFor:MA},Symbol.toStringTag,{value:"Module"}));function Ng(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===kg}function Us(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===kg}function Aw(I){const A={name:nA.phase0,seq:mA.phase0,epoch:h1,version:I.GENESIS_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},g={name:nA.altair,seq:mA.altair,epoch:I.ALTAIR_FORK_EPOCH,version:I.ALTAIR_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},B={name:nA.bellatrix,seq:mA.bellatrix,epoch:I.BELLATRIX_FORK_EPOCH,version:I.BELLATRIX_FORK_VERSION,prevVersion:I.ALTAIR_FORK_VERSION,prevForkName:nA.altair},i={name:nA.capella,seq:mA.capella,epoch:I.CAPELLA_FORK_EPOCH,version:I.CAPELLA_FORK_VERSION,prevVersion:I.BELLATRIX_FORK_VERSION,prevForkName:nA.bellatrix},Q={name:nA.deneb,seq:mA.deneb,epoch:I.DENEB_FORK_EPOCH,version:I.DENEB_FORK_VERSION,prevVersion:I.CAPELLA_FORK_VERSION,prevForkName:nA.capella},C={name:nA.electra,seq:mA.electra,epoch:I.ELECTRA_FORK_EPOCH,version:I.ELECTRA_FORK_VERSION,prevVersion:I.DENEB_FORK_VERSION,prevForkName:nA.deneb},e={name:nA.fulu,seq:mA.fulu,epoch:I.FULU_FORK_EPOCH,version:I.FULU_FORK_VERSION,prevVersion:I.ELECTRA_FORK_VERSION,prevForkName:nA.electra},o={name:nA.gloas,seq:mA.gloas,epoch:I.GLOAS_FORK_EPOCH,version:I.GLOAS_FORK_VERSION,prevVersion:I.FULU_FORK_VERSION,prevForkName:nA.fulu},c={phase0:A,altair:g,bellatrix:B,capella:i,deneb:Q,electra:C,fulu:e,gloas:o},a=Object.values(c),f=Object.values(c).reverse(),R=[...I.BLOB_SCHEDULE].sort((S,u)=>u.EPOCH-S.EPOCH),y=[...a.map(S=>({fork:S.name,epoch:S.epoch})),...I.BLOB_SCHEDULE.map(S=>({fork:f.find(u=>S.EPOCH>=u.epoch)?.name??A.name,epoch:S.EPOCH}))].filter(({epoch:S})=>S!==1/0).sort((S,u)=>S.epoch-u.epoch),G=[...y].reverse();return{forks:c,forksAscendingEpochOrder:a,forksDescendingEpochOrder:f,forkBoundariesAscendingEpochOrder:y,forkBoundariesDescendingEpochOrder:G,getForkInfo(S){const u=Math.floor(Math.max(S,0)/SI);return this.getForkInfoAtEpoch(u)},getForkInfoAtEpoch(S){return c[this.getForkBoundaryAtEpoch(S).fork]},getForkBoundaryAtEpoch(S){S<0&&(S=0);for(const u of G)if(S>=u.epoch)return u;throw Error("Unreachable as phase0 is scheduled at epoch 0")},getForkName(S){return this.getForkInfo(S).name},getForkSeq(S){return this.getForkInfo(S).seq},getForkSeqAtEpoch(S){return this.getForkInfoAtEpoch(S).seq},getForkVersion(S){return this.getForkInfo(S).version},getForkTypes(S){return MA(this.getForkName(S))},getPostBellatrixForkTypes(S){const u=this.getForkName(S);if(!eQ(u))throw Error(`Invalid slot=${S} fork=${u} for post-bellatrix fork types`);return MA(u)},getPostAltairForkTypes(S){const u=this.getForkName(S);if(!Li(u))throw Error(`Invalid slot=${S} fork=${u} for post-altair fork types`);return MA(u)},getPostDenebForkTypes(S){const u=this.getForkName(S);if(!fI(u))throw Error(`Invalid slot=${S} fork=${u} for post-deneb fork types`);return MA(u)},getMaxBlobsPerBlock(S){switch(this.getForkInfoAtEpoch(S).name){case nA.electra:return I.MAX_BLOBS_PER_BLOCK_ELECTRA;case nA.deneb:return I.MAX_BLOBS_PER_BLOCK}return this.getBlobParameters(S).maxBlobsPerBlock},getBlobParameters(S){if(S<I.FULU_FORK_EPOCH)throw Error(`getBlobParameters is not available pre-fulu epoch=${S}`);for(const u of R)if(S>=u.EPOCH)return{epoch:u.EPOCH,maxBlobsPerBlock:u.MAX_BLOBS_PER_BLOCK};return{epoch:I.ELECTRA_FORK_EPOCH,maxBlobsPerBlock:I.MAX_BLOBS_PER_BLOCK_ELECTRA}},getAttestationDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS)},getAggregateDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS)},getSyncMessageDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS)},getSyncContributionDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS)},getProposerReorgCutoffMs(S){return this.getSlotComponentDurationMs(I.PROPOSER_REORG_CUTOFF_BPS)},getSlotComponentDurationMs(S){return Math.round(S*I.SLOT_DURATION_MS/S1)}}}function Iw(I,A){const g=new Map,B=new Map,i=new Map,Q=new Map,{forkBoundariesAscendingEpochOrder:C}=I;for(let e=0;e<C.length;e++){const o=C[e],c=C[e+1],a=o.epoch,f=c!==void 0?c.epoch:1/0;if(a===f)continue;const R=gw(I,A,a),y=ti(R);Q.set(y,a),B.set(a,R),i.set(a,y)}return{genesisValidatorsRoot:A,getDomain(e,o,c){const a=Math.floor((c??e)/SI),f=I.getForkInfo(e),R=a<f.epoch?f.prevForkName:f.name,y=I.forks[R];let G=g.get(y.name);G||(G=new Map,g.set(y.name,G));let S=G.get(o);return S||(S=Ss(o,y.version,A),G.set(o,S)),S},getDomainAtFork(e,o){const c=I.forks[e];let a=g.get(c.name);a||(a=new Map,g.set(c.name,a));let f=a.get(o);return f||(f=Ss(o,c.version,A),a.set(o,f)),f},getDomainForVoluntaryExit(e,o){return e<I.DENEB_FORK_EPOCH*SI?this.getDomain(e,So,o):this.getDomainAtFork(nA.capella,So)},forkDigest2ForkBoundary(e){const o=ti(e),c=Q.get(o);if(c==null)throw Error(`Unknown forkDigest ${o}`);return I.getForkBoundaryAtEpoch(c)},forkDigest2ForkBoundaryOption(e){const o=ti(e),c=Q.get(o);return c==null?null:I.getForkBoundaryAtEpoch(c)},forkBoundary2ForkDigest(e){const o=B.get(e.epoch);if(!o)throw Error(`No precomputed forkDigest for ${e.epoch}`);return o},forkBoundary2ForkDigestHex(e){const o=i.get(e.epoch);if(!o)throw Error(`No precomputed forkDigest for ${e.epoch}`);return ti(o)}}}function Ss(I,A,g){const B=ws(A,g),i=new Uint8Array(32);return i.set(I,0),i.set(B.slice(0,28),4),i}function ws(I,A){const g={currentVersion:I,genesisValidatorsRoot:A};return NA.ForkData.hashTreeRoot(g)}function ti(I){return _1(typeof I=="string"?I:rg(I))}function gw(I,A,g){const B=I.getForkInfoAtEpoch(g),i=ws(B.version,A);if(B.seq<mA.fulu)return i.slice(0,4);const Q=I.getBlobParameters(g);return M1(i,ED(JA.concat([Lo(Q.epoch,8,"le"),Lo(Q.maxBlobsPerBlock,8,"le")]))).slice(0,4)}function wt(I){const A=Tc(I);return{...A,...Aw(A)}}function ys(I,A){const g=wt(I);return{...g,...Iw(g,A)}}let QI;ug=(I=>(I.lightClientOptimisticHeader="light_client_optimistic_header",I.lightClientFinalityHeader="light_client_finality_header",I.statusChange="light_client_status_change",I))(ug||{}),function(I){I.ContentType="content-type",I.Accept="accept",I.Authorization="authorization",I.ExposeHeaders="access-control-expose-headers"}(QI||(QI={}));var JI;(function(I){I.json="application/json",I.ssz="application/octet-stream"})(JI||(JI={}));const Bw=Object.values(JI);function Cw(I,A){return I!==null&&A.includes(I)}function Qw(I){if(!I)return null;const A=I.split(";",1)[0].trim().toLowerCase();return Cw(A,Bw)?A:null}function iw(I,A,{bearerToken:g}){g&&!A.has(QI.Authorization)&&A.set(QI.Authorization,`Bearer ${g}`),(I.username||I.password)&&(A.has(QI.Authorization)||A.set(QI.Authorization,`Basic ${N1(decodeURIComponent(`${I.username}:${I.password}`))}`),I.username="",I.password="")}function yt(...I){const A=new Headers;for(const g of I)if(g)if(Array.isArray(g))for(const[B,i]of g)A.set(B,i);else if(g instanceof Headers)for(const[B,i]of g)A.set(B,i);else for(const[B,i]of Object.entries(g))A.set(B,i);return A}function yI(I,A,g=!0){const B=I[A.toLowerCase()];if(B===void 0&&g)throw Error(`${A} header is required`);return B}class ew extends Headers{getRequired(A){const g=this.get(A);if(g===null)throw Error(`${A} header is required in response`);return g}getOrDefault(A,g){return this.get(A)??g}}var uA;(function(I){I.json="json",I.ssz="ssz"})(uA||(uA={}));function tw(I){switch(I){case JI.json:return uA.json;case JI.ssz:return uA.ssz}}const kA={writeReq:()=>({}),parseReq:()=>{},schema:{}};function eC(I){return{...I,writeReqSsz:()=>{throw Error("Not implemented")},parseReqSsz:()=>{throw Error("Not implemented")},onlySupport:uA.json}}const Ew={toJson:()=>{},fromJson:()=>{},serialize:()=>new Uint8Array,deserialize:()=>{}},VA={toJson:()=>{},fromJson:()=>{},toHeadersObject:()=>({}),fromHeaders:()=>{}},YA={data:Ew,meta:VA,isEmpty:!0};function dA(I,A=1/0){if(lg(I))return new yA(I,A);if(se(I))return new LI(I,A);throw Error(`Unknown type ${I.typeName}`)}function Qg(I){return{toJson:(A,g)=>I(g.version).toJson(A),fromJson:(A,g)=>I(g.version).fromJson(A),serialize:(A,g)=>I(g.version).serialize(A),deserialize:(A,g)=>I(g.version).deserialize(A)}}function ow(I){return{...I,data:{...I.data,serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},onlySupport:uA.json}}const II={data:{toJson:I=>hQ(I,"snake"),fromJson:I=>{if(typeof I!="object"||I===null)throw Error("JSON must be of type object");return hQ(I,"camel")},serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},meta:VA,onlySupport:uA.json};function gI(I){if(I=I.toLowerCase(),!(I in nA))throw Error(`Invalid version ${I}`);return I}function dg(I){if(!Li(I))throw Error(`Invalid fork=${I} for post-altair fork types`);return MA(I)}function pI(I){if(!eQ(I))throw Error(`Invalid fork=${I} for post-bellatrix fork types`);return MA(I)}var IA;(function(I){I[I.Uint=0]="Uint",I[I.UintRequired=1]="UintRequired",I[I.UintArray=2]="UintArray",I[I.String=3]="String",I[I.StringRequired=4]="StringRequired",I[I.StringArray=5]="StringArray",I[I.StringArrayRequired=6]="StringArrayRequired",I[I.UintOrStringRequired=7]="UintOrStringRequired",I[I.UintOrStringArray=8]="UintOrStringArray",I[I.Object=9]="Object",I[I.ObjectArray=10]="ObjectArray",I[I.AnyArray=11]="AnyArray",I[I.Boolean=12]="Boolean"})(IA||(IA={}));function rw(I){return I.method==="GET"||I.req.schema.body===void 0}var zg;(function(I){I.String="String",I.Variable="Variable"})(zg||(zg={}));function nw(I){const A=[];let g=0,B=!1;for(let i=0,Q=I.length;i<Q;i++)switch(I[i]){case"{":{if(B)throw Error(`Invalid path variable not closed: ${I}`);i>g&&A.push({type:zg.String,str:I.slice(g,i)}),g=i+1,B=!0;break}case"}":{if(!B)throw Error(`Invalid path variable not open: ${I}`);if(g===i)throw Error(`Empty variable: ${I}`);A.push({type:zg.Variable,var:I.slice(g,i)}),B=!1,g=i+1;break}}if(B)throw Error(`Invalid path variable not closed: ${I}`);return g<I.length&&A.push({type:zg.String,str:I.slice(g)}),A}function aw(I){const A=nw(I);if(A.length===1&&A[0].type===zg.String)return()=>I;const g=A.map(B=>{switch(B.type){case zg.String:return()=>B.str;case zg.Variable:{const i=B.var;return Q=>Q[i]}}});return function(B){let i="";for(const Q of g)i+=Q(B);return i}}function sw(I){const A=parseInt(I,10);if(!Number.isFinite(A))throw Error(`Invalid uin64 ${I}`);return A}function hw(I){return I.toString(10)}function zC(I){return I?.map(A=>typeof A=="string"?A:hw(A))}function vC(I){return I?.map(A=>typeof A=="string"&&A.startsWith("0x")?A:sw(A))}const Ei=66;function lw(I){if(I===void 0)return;const A=rg(new TextEncoder().encode(I));return A.length>Ei?A.slice(0,Ei):A.length<Ei?A.padEnd(Ei,"0"):A}function Dw(I){if(I!==void 0)try{return new TextDecoder("utf8").decode(aA(I))}catch{return I}}function uB(I){if(I=I.toLowerCase(),I!=="true"&&I!=="false")throw Error(`Invalid boolean ${I}`);return I==="true"}const RB=new Y({version:new vB});RB.fields.version.fromJson=I=>gI(Og.fromJson(I));const WC=new Y({executionOptimistic:CI},{jsonCase:"eth2"}),Nt=new Y({...WC.fields,finalized:CI},{jsonCase:"eth2"});new Y({...WC.fields,...RB.fields},{jsonCase:"eth2"});const Ns=new Y({...Nt.fields,...RB.fields},{jsonCase:"eth2"}),ds=new Y({...WC.fields,dependentRoot:Og},{jsonCase:"eth2"});var lA;(function(I){I.Version="Eth-Consensus-Version",I.ConsensusBlockValue="Eth-Consensus-Block-Value",I.ExecutionPayloadBlinded="Eth-Execution-Payload-Blinded",I.ExecutionPayloadValue="Eth-Execution-Payload-Value",I.Finalized="Eth-Consensus-Finalized",I.DependentRoot="Eth-Consensus-Dependent-Root",I.ExecutionOptimistic="Eth-Execution-Optimistic",I.ExecutionPayloadSource="Eth-Execution-Payload-Source"})(lA||(lA={}));const cw={toJson:I=>WC.toJson(I),fromJson:I=>WC.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[QI.ExposeHeaders]:lA.ExecutionOptimistic}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false"))})},vg={toJson:I=>RB.toJson(I),fromJson:I=>RB.fromJson(I),toHeadersObject:I=>({[lA.Version]:I.version,[QI.ExposeHeaders]:lA.Version}),fromHeaders:I=>({version:gI(I.getRequired(lA.Version))})},AI={toJson:I=>Nt.toJson(I),fromJson:I=>Nt.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[lA.Finalized]:I.finalized.toString(),[QI.ExposeHeaders]:[lA.ExecutionOptimistic,lA.Finalized].toString()}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false")),finalized:uB(I.getOrDefault(lA.Finalized,"false"))})},OI={toJson:I=>Ns.toJson(I),fromJson:I=>Ns.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[lA.Finalized]:I.finalized.toString(),[lA.Version]:I.version,[QI.ExposeHeaders]:[lA.ExecutionOptimistic,lA.Finalized,lA.Version].toString()}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false")),finalized:uB(I.getOrDefault(lA.Finalized,"false")),version:gI(I.getRequired(lA.Version))})},us={toJson:I=>ds.toJson(I),fromJson:I=>ds.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[lA.DependentRoot]:I.dependentRoot,[QI.ExposeHeaders]:[lA.ExecutionOptimistic,lA.DependentRoot].toString()}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false")),dependentRoot:I.getRequired(lA.DependentRoot)})},Rs=new Y({root:hB,canonical:CI,header:NA.SignedBeaconBlockHeader}),Uw=new yA(Rs,1e3),Gs=new Y({root:hB});var Fs;(function(I){I.none="none",I.gossip="gossip",I.consensus="consensus",I.consensusAndEquivocation="consensus_and_equivocation"})(Fs||(Fs={}));const tC={writeReq:({blockId:I})=>({params:{block_id:I.toString()}}),parseReq:({params:I})=>({blockId:I.block_id}),schema:{params:{block_id:IA.StringRequired}}};function fw(I){return{getBlockV2:{url:"/eth/v2/beacon/blocks/{block_id}",method:"GET",req:tC,resp:{data:Qg(A=>kI[A].SignedBeaconBlock),meta:OI}},getBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks/{block_id}",method:"GET",req:tC,resp:{data:Qg(A=>eQ(A)?kI[A].SignedBlindedBeaconBlock:kI[A].SignedBeaconBlock),meta:OI}},getBlockAttestations:{url:"/eth/v1/beacon/blocks/{block_id}/attestations",method:"GET",req:tC,resp:{data:NA.BeaconBlockBody.fields.attestations,meta:AI}},getBlockAttestationsV2:{url:"/eth/v2/beacon/blocks/{block_id}/attestations",method:"GET",req:tC,resp:{data:Qg(A=>kI[A].BeaconBlockBody.fields.attestations),meta:OI}},getBlockHeader:{url:"/eth/v1/beacon/headers/{block_id}",method:"GET",req:tC,resp:{data:Rs,meta:AI}},getBlockHeaders:{url:"/eth/v1/beacon/headers",method:"GET",req:{writeReq:({slot:A,parentRoot:g})=>({query:{slot:A,parent_root:g}}),parseReq:({query:A})=>({slot:A.slot,parentRoot:A.parent_root}),schema:{query:{slot:IA.Uint,parent_root:IA.String}}},resp:{data:Uw,meta:AI}},getBlockRoot:{url:"/eth/v1/beacon/blocks/{block_id}/root",method:"GET",req:tC,resp:{data:Gs,meta:AI}},publishBlock:{url:"/eth/v1/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:fI(B)?MA(B).SignedBlockContents.toJson(A):MA(B).SignedBeaconBlock.toJson(A.signedBlock),headers:{[lA.Version]:I.getForkName(g)}}},parseReqJson:({body:A,headers:g})=>{let B;const i=yI(g,lA.Version,!1);return i!==void 0?B=gI(i):B=I.getForkName(A.signed_block!==void 0?A.signed_block.message.slot:A.message.slot),{signedBlockContents:fI(B)?MA(B).SignedBlockContents.fromJson(A):{signedBlock:kI[B].SignedBeaconBlock.fromJson(A)}}},writeReqSsz:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:fI(B)?MA(B).SignedBlockContents.serialize(A):MA(B).SignedBeaconBlock.serialize(A.signedBlock),headers:{[lA.Version]:I.getForkName(g)}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedBlockContents:fI(B)?MA(B).SignedBlockContents.deserialize(A):{signedBlock:kI[B].SignedBeaconBlock.deserialize(A)}}},schema:{body:IA.Object,headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},publishBlockV2:{url:"/eth/v2/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,i=I.getForkName(B);return{body:fI(i)?MA(i).SignedBlockContents.toJson(A):MA(i).SignedBeaconBlock.toJson(A.signedBlock),headers:{[lA.Version]:i},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlockContents:fI(i)?MA(i).SignedBlockContents.fromJson(A):{signedBlock:kI[i].SignedBeaconBlock.fromJson(A)},broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,i=I.getForkName(B);return{body:fI(i)?MA(i).SignedBlockContents.serialize(A):MA(i).SignedBeaconBlock.serialize(A.signedBlock),headers:{[lA.Version]:i},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlockContents:fI(i)?MA(i).SignedBlockContents.deserialize(A):{signedBlock:kI[i].SignedBeaconBlock.deserialize(A)},broadcastValidation:B.broadcast_validation}},schema:{body:IA.Object,query:{broadcast_validation:IA.String},headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},publishBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:pI(g).SignedBlindedBeaconBlock.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{let B;const i=yI(g,lA.Version,!1);return i!==void 0?B=gI(i):B=I.getForkName(A.message.slot),{signedBlindedBlock:pI(B).SignedBlindedBeaconBlock.fromJson(A)}},writeReqSsz:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:pI(g).SignedBlindedBeaconBlock.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedBlindedBlock:pI(B).SignedBlindedBeaconBlock.deserialize(A)}},schema:{body:IA.Object,headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},publishBlindedBlockV2:{url:"/eth/v2/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:pI(B).SignedBlindedBeaconBlock.toJson(A),headers:{[lA.Version]:B},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlindedBlock:pI(i).SignedBlindedBeaconBlock.fromJson(A),broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:pI(B).SignedBlindedBeaconBlock.serialize(A),headers:{[lA.Version]:B},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlindedBlock:pI(i).SignedBlindedBeaconBlock.deserialize(A),broadcastValidation:B.broadcast_validation}},schema:{body:IA.Object,query:{broadcast_validation:IA.String},headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},getBlobSidecars:{url:"/eth/v1/beacon/blob_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:IA.StringRequired},query:{indices:IA.UintArray}}},resp:{data:xC.BlobSidecars,meta:OI}},getBlobs:{url:"/eth/v1/beacon/blobs/{block_id}",method:"GET",req:{writeReq:({blockId:A,versionedHashes:g})=>({params:{block_id:A.toString()},query:{versioned_hashes:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,versionedHashes:g.versioned_hashes?.map(B=>B.toLowerCase())}),schema:{params:{block_id:IA.StringRequired},query:{versioned_hashes:IA.StringArray}}},resp:{data:xC.Blobs,meta:AI}}}}const Wg=dA(NA.Attestation),oi=dA(wI.SingleAttestation),ks=dA(NA.Attestation),Sw=dA(wI.Attestation),Js=dA(NA.AttesterSlashing),ww=dA(wI.AttesterSlashing),yw=dA(NA.ProposerSlashing),Nw=dA(NA.SignedVoluntaryExit),XC=dA(Cg.SignedBLSToExecutionChange),ri=dA(PI.SyncCommitteeMessage);function dw(I){return{getPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:IA.Uint,committee_index:IA.Uint}}},resp:{data:ks,meta:VA}},getPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:IA.Uint,committee_index:IA.Uint}}},resp:{data:Qg(A=>xA(A)?Sw:ks),meta:vg}},getPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:Js,meta:VA}},getPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:Qg(A=>xA(A)?ww:Js),meta:vg}},getPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"GET",req:kA,resp:{data:yw,meta:VA}},getPoolVoluntaryExits:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"GET",req:kA,resp:{data:Nw,meta:VA}},getPoolBLSToExecutionChanges:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"GET",req:kA,resp:{data:XC,meta:VA}},submitPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>({body:Wg.toJson(A)}),parseReqJson:({body:A})=>({signedAttestations:Wg.fromJson(A)}),writeReqSsz:({signedAttestations:A})=>({body:Wg.serialize(A)}),parseReqSsz:({body:A})=>({signedAttestations:Wg.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},submitPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:xA(g)?oi.toJson(A):Wg.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAttestations:xA(B)?oi.fromJson(A):Wg.fromJson(A)}},writeReqSsz:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:xA(g)?oi.serialize(A):Wg.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAttestations:xA(B)?oi.deserialize(A):Wg.deserialize(A)}},schema:{body:IA.ObjectArray,headers:{[lA.Version]:IA.String}}},resp:YA},submitPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>({body:NA.AttesterSlashing.toJson(A)}),parseReqJson:({body:A})=>({attesterSlashing:NA.AttesterSlashing.fromJson(A)}),writeReqSsz:({attesterSlashing:A})=>({body:NA.AttesterSlashing.serialize(A)}),parseReqSsz:({body:A})=>({attesterSlashing:NA.AttesterSlashing.deserialize(A)}),schema:{body:IA.Object}},resp:YA},submitPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:xA(g)?wI.AttesterSlashing.toJson(A):NA.AttesterSlashing.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{attesterSlashing:xA(B)?wI.AttesterSlashing.fromJson(A):NA.AttesterSlashing.fromJson(A)}},writeReqSsz:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:xA(g)?wI.AttesterSlashing.serialize(A):NA.AttesterSlashing.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{attesterSlashing:xA(B)?wI.AttesterSlashing.deserialize(A):NA.AttesterSlashing.deserialize(A)}},schema:{body:IA.Object,headers:{[lA.Version]:IA.String}}},resp:YA},submitPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"POST",req:{writeReqJson:({proposerSlashing:A})=>({body:NA.ProposerSlashing.toJson(A)}),parseReqJson:({body:A})=>({proposerSlashing:NA.ProposerSlashing.fromJson(A)}),writeReqSsz:({proposerSlashing:A})=>({body:NA.ProposerSlashing.serialize(A)}),parseReqSsz:({body:A})=>({proposerSlashing:NA.ProposerSlashing.deserialize(A)}),schema:{body:IA.Object}},resp:YA},submitPoolVoluntaryExit:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"POST",req:{writeReqJson:({signedVoluntaryExit:A})=>({body:NA.SignedVoluntaryExit.toJson(A)}),parseReqJson:({body:A})=>({signedVoluntaryExit:NA.SignedVoluntaryExit.fromJson(A)}),writeReqSsz:({signedVoluntaryExit:A})=>({body:NA.SignedVoluntaryExit.serialize(A)}),parseReqSsz:({body:A})=>({signedVoluntaryExit:NA.SignedVoluntaryExit.deserialize(A)}),schema:{body:IA.Object}},resp:YA},submitPoolBLSToExecutionChange:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"POST",req:{writeReqJson:({blsToExecutionChanges:A})=>({body:XC.toJson(A)}),parseReqJson:({body:A})=>({blsToExecutionChanges:XC.fromJson(A)}),writeReqSsz:({blsToExecutionChanges:A})=>({body:XC.serialize(A)}),parseReqSsz:({body:A})=>({blsToExecutionChanges:XC.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},submitPoolSyncCommitteeSignatures:{url:"/eth/v1/beacon/pool/sync_committees",method:"POST",req:{writeReqJson:({signatures:A})=>({body:ri.toJson(A)}),parseReqJson:({body:A})=>({signatures:ri.fromJson(A)}),writeReqSsz:({signatures:A})=>({body:ri.serialize(A)}),parseReqSsz:({body:A})=>({signatures:ri.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA}}}const uw=new Y({proposerIndex:zA,total:RA,attestations:RA,syncAggregate:RA,proposerSlashings:RA,attesterSlashings:RA},{jsonCase:"eth2"}),ps=new Y({head:RA,target:RA,source:RA,inclusionDelay:RA,inactivity:RA},{jsonCase:"eth2"}),Rw=new Y({...ps.fields,effectiveBalance:RA},{jsonCase:"eth2"}),Gw=new Y({...ps.fields,validatorIndex:zA},{jsonCase:"eth2"}),Fw=new Y({idealRewards:dA(Rw),totalRewards:dA(Gw)},{jsonCase:"eth2"}),kw=dA(new Y({validatorIndex:zA,reward:RA},{jsonCase:"eth2"}));function Jw(I){return{getBlockRewards:{url:"/eth/v1/beacon/rewards/blocks/{block_id}",method:"GET",req:{writeReq:({blockId:A})=>({params:{block_id:A.toString()}}),parseReq:({params:A})=>({blockId:A.block_id}),schema:{params:{block_id:IA.StringRequired}}},resp:{data:uw,meta:AI}},getAttestationsRewards:{url:"/eth/v1/beacon/rewards/attestations/{epoch}",method:"POST",req:eC({writeReqJson:({epoch:A,validatorIds:g})=>({params:{epoch:A},body:zC(g)||[]}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,validatorIds:vC(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.UintOrStringArray}}),resp:{data:Fw,meta:AI}},getSyncCommitteeRewards:{url:"/eth/v1/beacon/rewards/sync_committee/{block_id}",method:"POST",req:eC({writeReqJson:({blockId:A,validatorIds:g})=>({params:{block_id:A.toString()},body:zC(g)||[]}),parseReqJson:({params:A,body:g})=>({blockId:A.block_id,validatorIds:vC(g)}),schema:{params:{block_id:IA.StringRequired},body:IA.UintOrStringArray}}),resp:{data:kw,meta:AI}}}}const pw=new Y({randao:hB}),Hw=new Y({previousJustified:NA.Checkpoint,currentJustified:NA.Checkpoint,finalized:NA.Checkpoint},{jsonCase:"eth2"}),Hs=new Y({index:zA,balance:RA,status:new vB,validator:NA.Validator}),Mw=new Y({index:zA,pubkey:_B,activationEpoch:RA},{jsonCase:"eth2"}),mw=new Y({index:sB,slot:LA,validators:dA(zA,lC)}),Lw=new Y({index:zA,balance:RA}),Kw=new Y({validators:dA(zA),validatorAggregates:dA(dA(zA))},{jsonCase:"eth2"}),Ms=dA(Hs),Yw=dA(Mw),bw=dA(mw),ms=dA(Lw),GB={writeReq:({stateId:I})=>({params:{state_id:I.toString()}}),parseReq:({params:I})=>({stateId:I.state_id}),schema:{params:{state_id:IA.StringRequired}}};function Tw(I){return{getEpochCommittees:{url:"/eth/v1/beacon/states/{state_id}/committees",method:"GET",req:{writeReq:({stateId:A,epoch:g,index:B,slot:i})=>({params:{state_id:A.toString()},query:{epoch:g,index:B,slot:i}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch,index:g.index,slot:g.slot}),schema:{params:{state_id:IA.StringRequired},query:{slot:IA.Uint,epoch:IA.Uint,index:IA.Uint}}},resp:{data:bw,meta:AI}},getEpochSyncCommittees:{url:"/eth/v1/beacon/states/{state_id}/sync_committees",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:IA.StringRequired},query:{epoch:IA.Uint}}},resp:{data:Kw,meta:AI}},getStateFinalityCheckpoints:{url:"/eth/v1/beacon/states/{state_id}/finality_checkpoints",method:"GET",req:GB,resp:{data:Hw,meta:AI}},getStateFork:{url:"/eth/v1/beacon/states/{state_id}/fork",method:"GET",req:GB,resp:{data:NA.Fork,meta:AI}},getStateRoot:{url:"/eth/v1/beacon/states/{state_id}/root",method:"GET",req:GB,resp:{data:Gs,meta:AI}},getStateRandao:{url:"/eth/v1/beacon/states/{state_id}/randao",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:IA.StringRequired},query:{epoch:IA.Uint}}},resp:{data:pw,meta:AI}},getStateValidator:{url:"/eth/v1/beacon/states/{state_id}/validators/{validator_id}",method:"GET",req:{writeReq:({stateId:A,validatorId:g})=>({params:{state_id:A.toString(),validator_id:g}}),parseReq:({params:A})=>({stateId:A.state_id,validatorId:A.validator_id}),schema:{params:{state_id:IA.StringRequired,validator_id:IA.StringRequired}}},resp:{onlySupport:uA.json,data:Hs,meta:AI}},getStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"GET",req:{writeReq:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},query:{id:g,status:B}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id,statuses:g.status}),schema:{params:{state_id:IA.StringRequired},query:{id:IA.UintOrStringArray,status:IA.StringArray}}},resp:{onlySupport:uA.json,data:Ms,meta:AI}},postStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"POST",req:eC({writeReqJson:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},body:{ids:zC(g),statuses:B}}),parseReqJson:({params:A,body:g={}})=>({stateId:A.state_id,validatorIds:vC(g.ids),statuses:g.statuses??void 0}),schema:{params:{state_id:IA.StringRequired},body:IA.Object}}),resp:{onlySupport:uA.json,data:Ms,meta:AI}},postStateValidatorIdentities:{url:"/eth/v1/beacon/states/{state_id}/validator_identities",method:"POST",req:eC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:zC(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:vC(g)}),schema:{params:{state_id:IA.StringRequired},body:IA.UintOrStringArray}}),resp:{data:Yw,meta:AI}},getStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"GET",req:{writeReq:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},query:{id:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id}),schema:{params:{state_id:IA.StringRequired},query:{id:IA.UintOrStringArray}}},resp:{data:ms,meta:AI}},postStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"POST",req:eC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:zC(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:vC(g)}),schema:{params:{state_id:IA.StringRequired},body:IA.UintOrStringArray}}),resp:{data:ms,meta:AI}},getPendingDeposits:{url:"/eth/v1/beacon/states/{state_id}/pending_deposits",method:"GET",req:GB,resp:{data:wI.PendingDeposits,meta:OI}},getPendingPartialWithdrawals:{url:"/eth/v1/beacon/states/{state_id}/pending_partial_withdrawals",method:"GET",req:GB,resp:{data:wI.PendingPartialWithdrawals,meta:OI}},getPendingConsolidations:{url:"/eth/v1/beacon/states/{state_id}/pending_consolidations",method:"GET",req:GB,resp:{data:wI.PendingConsolidations,meta:OI}},getProposerLookahead:{url:"/eth/v1/beacon/states/{state_id}/proposer_lookahead",method:"GET",req:GB,resp:{data:St.ProposerLookahead,meta:OI}}}}function qw(I){return{getGenesis:{url:"/eth/v1/beacon/genesis",method:"GET",req:kA,resp:{data:NA.Genesis,meta:VA}},...fw(I),...dw(I),...Tw(),...Jw()}}const Vw=new Y({chainId:RA,address:ke},{jsonCase:"eth2"}),jw=dA(NA.Fork);function Zw(I){return{getDepositContract:{url:"/eth/v1/config/deposit_contract",method:"GET",req:kA,resp:{data:Vw,meta:VA}},getForkSchedule:{url:"/eth/v1/config/fork_schedule",method:"GET",req:kA,resp:{data:jw,meta:VA}},getSpec:{url:"/eth/v1/config/spec",method:"GET",req:kA,resp:ow({data:{toJson:A=>A,fromJson:A=>{if(typeof A!="object"||A===null)throw Error("JSON must be of type object");return A}},meta:VA})}}}const oI=new vB,_w=new Y({executionPayloadBlockHash:oI,executionPayloadNumber:RA,executionStatus:oI,slot:LA,blockRoot:oI,parentRoot:oI,stateRoot:oI,targetRoot:oI,timeliness:CI,justifiedEpoch:VI,justifiedRoot:oI,finalizedEpoch:VI,finalizedRoot:oI,unrealizedJustifiedEpoch:VI,unrealizedJustifiedRoot:oI,unrealizedFinalizedEpoch:VI,unrealizedFinalizedRoot:oI,parent:oI,weight:Ne,bestChild:oI,bestDescendant:oI},{jsonCase:"eth2"}),Pw=new Y({slot:LA,root:oI,executionOptimistic:CI},{jsonCase:"eth2"}),Ow=new Y({slot:LA,blockRoot:oI,parentRoot:oI,justifiedEpoch:VI,finalizedEpoch:VI,weight:RA,validity:new vB,executionBlockHash:oI},{jsonCase:"eth2"}),xw=new Y({justifiedCheckpoint:NA.Checkpoint,finalizedCheckpoint:NA.Checkpoint,forkChoiceNodes:dA(Ow)},{jsonCase:"eth2"}),zw=dA(_w),vw=dA(Pw);function Ww(I){return{getDebugChainHeadsV2:{url:"/eth/v2/debug/beacon/heads",method:"GET",req:kA,resp:{data:vw,meta:VA,onlySupport:uA.json}},getDebugForkChoice:{url:"/eth/v1/debug/fork_choice",method:"GET",req:kA,resp:{data:xw,meta:VA,onlySupport:uA.json,transform:{toResponse:A=>({...A}),fromResponse:A=>({data:A})}}},getProtoArrayNodes:{url:"/eth/v0/debug/forkchoice",method:"GET",req:kA,resp:{data:zw,meta:VA,onlySupport:uA.json}},getStateV2:{url:"/eth/v2/debug/beacon/states/{state_id}",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:IA.StringRequired}}},resp:{data:Qg(A=>kI[A].BeaconState),meta:OI},init:{timeoutMs:3e5}},getDebugDataColumnSidecars:{url:"/eth/v1/debug/beacon/data_column_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:IA.StringRequired},query:{indices:IA.UintArray}}},resp:{data:St.DataColumnSidecars,meta:OI}}}}const rI=new vB,Xw=new Y({blockRoot:rI,index:Ge,slot:LA,kzgCommitment:rI,versionedHash:rI},{typeName:"BlobSidecarSSE",jsonCase:"eth2"}),$w=new Y({blockRoot:rI,index:Je,slot:LA,kzgCommitments:new LI(rI,og)},{typeName:"DataColumnSidecarSSE",jsonCase:"eth2"});var fA;(function(I){I.head="head",I.block="block",I.blockGossip="block_gossip",I.attestation="attestation",I.singleAttestation="single_attestation",I.voluntaryExit="voluntary_exit",I.proposerSlashing="proposer_slashing",I.attesterSlashing="attester_slashing",I.blsToExecutionChange="bls_to_execution_change",I.finalizedCheckpoint="finalized_checkpoint",I.chainReorg="chain_reorg",I.contributionAndProof="contribution_and_proof",I.lightClientOptimisticUpdate="light_client_optimistic_update",I.lightClientFinalityUpdate="light_client_finality_update",I.payloadAttributes="payload_attributes",I.blobSidecar="blob_sidecar",I.dataColumnSidecar="data_column_sidecar"})(fA||(fA={})),fA.head+"",fA.head,fA.block+"",fA.block,fA.blockGossip+"",fA.blockGossip,fA.attestation+"",fA.attestation,fA.singleAttestation+"",fA.singleAttestation,fA.voluntaryExit+"",fA.voluntaryExit,fA.proposerSlashing+"",fA.proposerSlashing,fA.attesterSlashing+"",fA.attesterSlashing,fA.blsToExecutionChange+"",fA.blsToExecutionChange,fA.finalizedCheckpoint+"",fA.finalizedCheckpoint,fA.chainReorg+"",fA.chainReorg,fA.contributionAndProof+"",fA.contributionAndProof,fA.lightClientOptimisticUpdate+"",fA.lightClientOptimisticUpdate,fA.lightClientFinalityUpdate+"",fA.lightClientFinalityUpdate,fA.payloadAttributes+"",fA.payloadAttributes,fA.blobSidecar+"",fA.blobSidecar,fA.dataColumnSidecar+"",fA.dataColumnSidecar;function Ay(I){return{eventstream:{url:"/eth/v1/events",method:"GET",req:{writeReq:({topics:A})=>({query:{topics:A}}),parseReq:({query:A})=>({topics:A.topics}),schema:{query:{topics:IA.StringArrayRequired}}},resp:YA}}}function Iy(I){const A=g=>({toJson:({data:B,version:i})=>({data:g(i).toJson(B),version:i}),fromJson:B=>{const{version:i}=RB.fromJson(B);return{data:g(i).fromJson(B.data),version:i}}});return{[fA.head]:new Y({slot:LA,block:rI,state:rI,epochTransition:CI,previousDutyDependentRoot:rI,currentDutyDependentRoot:rI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.block]:new Y({slot:LA,block:rI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.blockGossip]:new Y({slot:LA,block:rI},{jsonCase:"eth2"}),[fA.attestation]:{toJson:g=>{const B=I.getForkName(g.data.slot);return MA(B).Attestation.toJson(g)},fromJson:g=>{const B=I.getForkName(g.data.slot);return MA(B).Attestation.fromJson(g)}},[fA.singleAttestation]:wI.SingleAttestation,[fA.voluntaryExit]:NA.SignedVoluntaryExit,[fA.proposerSlashing]:NA.ProposerSlashing,[fA.attesterSlashing]:{toJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return MA(B).AttesterSlashing.toJson(g)},fromJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return MA(B).AttesterSlashing.fromJson(g)}},[fA.blsToExecutionChange]:Cg.SignedBLSToExecutionChange,[fA.finalizedCheckpoint]:new Y({block:rI,state:rI,epoch:VI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.chainReorg]:new Y({slot:LA,depth:RA,oldHeadBlock:rI,newHeadBlock:rI,oldHeadState:rI,newHeadState:rI,epoch:VI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.contributionAndProof]:PI.SignedContributionAndProof,[fA.payloadAttributes]:A(g=>pI(g).SSEPayloadAttributes),[fA.blobSidecar]:Xw,[fA.dataColumnSidecar]:$w,[fA.lightClientOptimisticUpdate]:A(g=>dg(g).LightClientOptimisticUpdate),[fA.lightClientFinalityUpdate]:A(g=>dg(g).LightClientFinalityUpdate)}}function gy(I){const A=Iy(I);return{toJson:g=>A[g.type].toJson(g.message),fromJson:(g,B)=>A[g].fromJson(B)}}const Ls={...Jg,PRESET_BASE:MI.gnosis,CONFIG_NAME:"gnosis",TERMINAL_TOTAL_DIFFICULTY:BigInt("8626000000000000000000058750000000000000000000"),SECONDS_PER_SLOT:5,SECONDS_PER_ETH1_BLOCK:6,ETH1_FOLLOW_DISTANCE:1024,CHURN_LIMIT_QUOTIENT:4096,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:2,DEPOSIT_CHAIN_ID:100,DEPOSIT_NETWORK_ID:100,DEPOSIT_CONTRACT_ADDRESS:aA("0x0b98057ea310f4d31f2a452b414647007d1645d9"),MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:16384,MIN_GENESIS_TIME:1638968400,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:4096,GENESIS_FORK_VERSION:aA("0x00000064"),GENESIS_DELAY:6e3,ALTAIR_FORK_VERSION:aA("0x01000064"),ALTAIR_FORK_EPOCH:512,BELLATRIX_FORK_VERSION:aA("0x02000064"),BELLATRIX_FORK_EPOCH:385536,CAPELLA_FORK_VERSION:aA("0x03000064"),CAPELLA_FORK_EPOCH:648704,DENEB_FORK_VERSION:aA("0x04000064"),DENEB_FORK_EPOCH:889856,ELECTRA_FORK_VERSION:aA("0x05000064"),ELECTRA_FORK_EPOCH:1337856,FULU_FORK_VERSION:aA("0x06000064"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x07000064"),GLOAS_FORK_EPOCH:1/0,MAX_BLOBS_PER_BLOCK:2,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:2,MAX_BLOBS_PER_BLOCK_ELECTRA:2,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:256,BLOB_SCHEDULE:[]},By={...Ls,CONFIG_NAME:"chiado",TERMINAL_TOTAL_DIFFICULTY:BigInt("231707791542740786049188744689299064356246512"),DEPOSIT_CHAIN_ID:10200,DEPOSIT_NETWORK_ID:10200,DEPOSIT_CONTRACT_ADDRESS:aA("0xb97036A26259B7147018913bD58a774cf91acf25"),MIN_GENESIS_TIME:1665396e3,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:6e3,GENESIS_FORK_VERSION:aA("0x0000006f"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:aA("0x0100006f"),ALTAIR_FORK_EPOCH:90,BELLATRIX_FORK_VERSION:aA("0x0200006f"),BELLATRIX_FORK_EPOCH:180,CAPELLA_FORK_VERSION:aA("0x0300006f"),CAPELLA_FORK_EPOCH:244224,DENEB_FORK_VERSION:aA("0x0400006f"),DENEB_FORK_EPOCH:516608,ELECTRA_FORK_VERSION:aA("0x0500006f"),ELECTRA_FORK_EPOCH:948224,FULU_FORK_VERSION:aA("0x0600006f"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x0700006f"),GLOAS_FORK_EPOCH:1/0,BLOB_SCHEDULE:[]},$C={...Jg,CONFIG_NAME:"ephemery",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1638471600,GENESIS_FORK_VERSION:aA("0x1000101b"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:aA("0x2000101b"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:aA("0x3000101b"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:aA("0x4000101b"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:aA("0x5000101b"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:aA("0x6000101b"),ELECTRA_FORK_EPOCH:10,FULU_FORK_VERSION:aA("0x7000101b"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x8000101b"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:39438e3,DEPOSIT_NETWORK_ID:39438e3,DEPOSIT_CONTRACT_ADDRESS:aA("0x4242424242424242424242424242424242424242"),ETH1_FOLLOW_DISTANCE:12,BLOB_SCHEDULE:[]},Ks=6048e5,dt=Math.floor(Date.now()-$C.MIN_GENESIS_TIME)/Ks,ut={...$C,MIN_GENESIS_TIME:Ks*dt+$C.MIN_GENESIS_TIME,DEPOSIT_CHAIN_ID:$C.DEPOSIT_CHAIN_ID+dt,DEPOSIT_NETWORK_ID:$C.DEPOSIT_NETWORK_ID+dt},Cy={...Jg,CONFIG_NAME:"holesky",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:16384,MIN_GENESIS_TIME:1695902100,GENESIS_DELAY:300,GENESIS_FORK_VERSION:aA("0x01017000"),ALTAIR_FORK_VERSION:aA("0x02017000"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:aA("0x03017000"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:aA("0x04017000"),CAPELLA_FORK_EPOCH:256,DENEB_FORK_VERSION:aA("0x05017000"),DENEB_FORK_EPOCH:29696,ELECTRA_FORK_VERSION:aA("0x06017000"),ELECTRA_FORK_EPOCH:115968,FULU_FORK_VERSION:aA("0x07017000"),FULU_FORK_EPOCH:165120,GLOAS_FORK_VERSION:aA("0x08017000"),GLOAS_FORK_EPOCH:1/0,EJECTION_BALANCE:28e9,DEPOSIT_CHAIN_ID:17e3,DEPOSIT_NETWORK_ID:17e3,DEPOSIT_CONTRACT_ADDRESS:aA("0x4242424242424242424242424242424242424242"),BLOB_SCHEDULE:[{EPOCH:166400,MAX_BLOBS_PER_BLOCK:15},{EPOCH:167936,MAX_BLOBS_PER_BLOCK:21}]},Qy={...Jg,CONFIG_NAME:"hoodi",MIN_GENESIS_TIME:1742212800,GENESIS_DELAY:600,GENESIS_FORK_VERSION:aA("0x10000910"),ALTAIR_FORK_VERSION:aA("0x20000910"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:aA("0x30000910"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:aA("0x40000910"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:aA("0x50000910"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:aA("0x60000910"),ELECTRA_FORK_EPOCH:2048,FULU_FORK_VERSION:aA("0x70000910"),FULU_FORK_EPOCH:50688,GLOAS_FORK_VERSION:aA("0x80000910"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_ETH1_BLOCK:12,DEPOSIT_CHAIN_ID:560048,DEPOSIT_NETWORK_ID:560048,BLOB_SCHEDULE:[{EPOCH:52480,MAX_BLOBS_PER_BLOCK:15},{EPOCH:54016,MAX_BLOBS_PER_BLOCK:21}]},iy={...Jg,CONFIG_NAME:"mainnet",DEPOSIT_CONTRACT_ADDRESS:aA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,MIN_GENESIS_TIME:1606824e3,GENESIS_DELAY:604800},ey={...Jg,CONFIG_NAME:"sepolia",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:1300,MIN_GENESIS_TIME:1655647200,GENESIS_FORK_VERSION:aA("0x90000069"),GENESIS_DELAY:86400,ALTAIR_FORK_VERSION:aA("0x90000070"),ALTAIR_FORK_EPOCH:50,BELLATRIX_FORK_VERSION:aA("0x90000071"),BELLATRIX_FORK_EPOCH:100,TERMINAL_TOTAL_DIFFICULTY:BigInt("17000000000000000"),CAPELLA_FORK_VERSION:aA("0x90000072"),CAPELLA_FORK_EPOCH:56832,DENEB_FORK_VERSION:aA("0x90000073"),DENEB_FORK_EPOCH:132608,ELECTRA_FORK_VERSION:aA("0x90000074"),ELECTRA_FORK_EPOCH:222464,FULU_FORK_VERSION:aA("0x90000075"),FULU_FORK_EPOCH:272640,GLOAS_FORK_VERSION:aA("0x90000076"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:11155111,DEPOSIT_NETWORK_ID:11155111,DEPOSIT_CONTRACT_ADDRESS:aA("0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"),BLOB_SCHEDULE:[{EPOCH:274176,MAX_BLOBS_PER_BLOCK:15},{EPOCH:275712,MAX_BLOBS_PER_BLOCK:21}]},EC={mainnet:iy,gnosis:Ls,sepolia:ey,holesky:Cy,hoodi:Qy,chiado:By,ephemery:ut},ty={mainnet:{genesisTime:1606824023,genesisValidatorsRoot:"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"},gnosis:{genesisTime:1638993340,genesisValidatorsRoot:"0xf5dcb5564e829aab27264b9becd5dfaa017085611224cb3036f573368dbb9d47"},sepolia:{genesisTime:1655733600,genesisValidatorsRoot:"0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078"},holesky:{genesisTime:1695902400,genesisValidatorsRoot:"0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1"},hoodi:{genesisTime:1742213400,genesisValidatorsRoot:"0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"},chiado:{genesisTime:1665396300,genesisValidatorsRoot:"0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e"},ephemery:{genesisTime:ut.MIN_GENESIS_TIME+ut.GENESIS_DELAY,genesisValidatorsRoot:"0x0000000000000000000000000000000000000000000000000000000000000000"}},Ey=new yA(hB,1e4);function oy(I){let A;const g=()=>{if(A===void 0){const B=ty[I.CONFIG_NAME]?.genesisValidatorsRoot;A=ys(I,B?aA(B):D1)}return A};return{getLightClientUpdatesByRange:{url:"/eth/v1/beacon/light_client/updates",method:"GET",req:{writeReq:({startPeriod:B,count:i})=>({query:{start_period:B,count:i}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:IA.UintRequired,count:IA.UintRequired}}},resp:{data:{toJson:(B,i)=>{const Q=[];for(const[C,e]of B.entries())Q.push(dg(i.versions[C]).LightClientUpdate.toJson(e));return Q},fromJson:(B,i)=>{const Q=B,C=[];for(let e=0;e<Q.length;e++){const o=i.versions[e];C.push(dg(o).LightClientUpdate.fromJson(Q[e]))}return C},serialize:(B,i)=>{const Q=[];for(const[C,e]of B.entries()){const o=i.versions[C],c=g(),a=Math.floor(e.attestedHeader.beacon.slot/SI),f=c.forkBoundary2ForkDigest(c.getForkBoundaryAtEpoch(a)),R=dg(o).LightClientUpdate.serialize(e),y=RA.serialize(4+R.length);Q.push(y,f,R)}return JA.concat(Q)},deserialize:B=>{let i=0;const Q=[];for(;i<B.length;){const C=RA.deserialize(B.subarray(i,i+8)),e=Fe.deserialize(B.subarray(i+8,i+12)),{fork:o}=g().forkDigest2ForkBoundary(e);Q.push(dg(o).LightClientUpdate.deserialize(B.subarray(i+12,i+8+C))),i+=8+C}return Q}},meta:{toJson:B=>B,fromJson:B=>B,toHeadersObject:B=>({[lA.Version]:B.versions.join(",")}),fromHeaders:B=>{const i=B.getOrDefault(lA.Version,"");return{versions:i===""?[]:i.split(",")}}},transform:{toResponse:(B,i)=>{const Q=B,C=[];for(let e=0;e<Q.length;e++)C.push({data:Q[e],version:i.versions[e]});return C},fromResponse:B=>{if(!Array.isArray(B))throw Error("JSON is not an array");const i=[],Q={versions:[]};for(const{data:C,version:e}of B)i.push(C),Q.versions.push(gI(e));return{data:i,meta:Q}}}}},getLightClientOptimisticUpdate:{url:"/eth/v1/beacon/light_client/optimistic_update",method:"GET",req:kA,resp:{data:Qg(B=>dg(B).LightClientOptimisticUpdate),meta:vg}},getLightClientFinalityUpdate:{url:"/eth/v1/beacon/light_client/finality_update",method:"GET",req:kA,resp:{data:Qg(B=>dg(B).LightClientFinalityUpdate),meta:vg}},getLightClientBootstrap:{url:"/eth/v1/beacon/light_client/bootstrap/{block_root}",method:"GET",req:{writeReq:({blockRoot:B})=>({params:{block_root:B}}),parseReq:({params:B})=>({blockRoot:B.block_root}),schema:{params:{block_root:IA.StringRequired}}},resp:{data:Qg(B=>dg(B).LightClientBootstrap),meta:vg}},getLightClientCommitteeRoot:{url:"/eth/v0/beacon/light_client/committee_root",method:"GET",req:{writeReq:({startPeriod:B,count:i})=>({query:{start_period:B,count:i}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:IA.UintRequired,count:IA.UintRequired}}},resp:{data:Ey,meta:VA}}}}const ry=new Y({slot:LA,historicalSummaries:Cg.HistoricalSummaries,proof:dA(fe)},{jsonCase:"eth2"});function ny(I){return{writeHeapdump:{url:"/eth/v1/lodestar/write_heapdump",method:"POST",req:{writeReq:({thread:A,dirpath:g})=>({query:{thread:A,dirpath:g}}),parseReq:({query:A})=>({thread:A.thread,dirpath:A.dirpath}),schema:{query:{thread:IA.String,dirpath:IA.String}}},resp:II},writeProfile:{url:"/eth/v1/lodestar/write_profile",method:"POST",req:{writeReq:({thread:A,duration:g,dirpath:B})=>({query:{thread:A,duration:g,dirpath:B}}),parseReq:({query:A})=>({thread:A.thread,duration:A.duration,dirpath:A.dirpath}),schema:{query:{thread:IA.String,duration:IA.Uint,dirpath:IA.String}}},resp:II},getLatestWeakSubjectivityCheckpointEpoch:{url:"/eth/v1/lodestar/ws_epoch",method:"GET",req:kA,resp:II},getSyncChainsDebugState:{url:"/eth/v1/lodestar/sync_chains_debug_state",method:"GET",req:kA,resp:II},getGossipQueueItems:{url:"/eth/v1/lodestar/gossip_queue_items/:gossipType",method:"GET",req:{writeReq:({gossipType:A})=>({params:{gossipType:A}}),parseReq:({params:A})=>({gossipType:A.gossipType}),schema:{params:{gossipType:IA.StringRequired}}},resp:II},getRegenQueueItems:{url:"/eth/v1/lodestar/regen_queue_items",method:"GET",req:kA,resp:II},getBlockProcessorQueueItems:{url:"/eth/v1/lodestar/block_processor_queue_items",method:"GET",req:kA,resp:II},getStateCacheItems:{url:"/eth/v1/lodestar/state_cache_items",method:"GET",req:kA,resp:II},getGossipPeerScoreStats:{url:"/eth/v1/lodestar/gossip_peer_score_stats",method:"GET",req:kA,resp:II},getLodestarPeerScoreStats:{url:"/eth/v1/lodestar/lodestar_peer_score_stats",method:"GET",req:kA,resp:II},runGC:{url:"/eth/v1/lodestar/gc",method:"POST",req:kA,resp:YA},dropStateCache:{url:"/eth/v1/lodestar/drop_state_cache",method:"POST",req:kA,resp:YA},connectPeer:{url:"/eth/v1/lodestar/connect_peer",method:"POST",req:{writeReq:({peerId:A,multiaddrs:g})=>({query:{peerId:A,multiaddr:g}}),parseReq:({query:A})=>({peerId:A.peerId,multiaddrs:A.multiaddr}),schema:{query:{peerId:IA.StringRequired,multiaddr:IA.StringArray}}},resp:YA},disconnectPeer:{url:"/eth/v1/lodestar/disconnect_peer",method:"POST",req:{writeReq:({peerId:A})=>({query:{peerId:A}}),parseReq:({query:A})=>({peerId:A.peerId}),schema:{query:{peerId:IA.StringRequired}}},resp:YA},getPeers:{url:"/eth/v1/lodestar/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:IA.StringArray,direction:IA.StringArray}}},resp:II},getBlacklistedBlocks:{url:"/eth/v1/lodestar/blacklisted_blocks",method:"GET",req:kA,resp:II},getHistoricalSummaries:{url:"/eth/v1/lodestar/states/{state_id}/historical_summaries",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:IA.StringRequired}}},resp:{data:ry,meta:OI}},discv5GetKadValues:{url:"/eth/v1/debug/discv5_kad_values",method:"GET",req:kA,resp:II},dumpDbBucketKeys:{url:"/eth/v1/debug/dump_db_bucket_keys/:bucket",method:"GET",req:{writeReq:({bucket:A})=>({params:{bucket:A}}),parseReq:({params:A})=>({bucket:A.bucket}),schema:{params:{bucket:IA.String}}},resp:II},dumpDbStateIndex:{url:"/eth/v1/debug/dump_db_state_index",method:"GET",req:kA,resp:II}}}const Ys=new Y({peerId:Og,enr:Og,p2pAddresses:dA(Og),discoveryAddresses:dA(Og),metadata:PI.Metadata},{jsonCase:"eth2"}),ay=new Y({disconnected:RA,connecting:RA,connected:RA,disconnecting:RA},{jsonCase:"eth2"}),sy=new Y({headSlot:LA,syncDistance:LA,isSyncing:CI,isOptimistic:CI,elOffline:CI},{jsonCase:"eth2"});var bs;(function(I){I[I.READY=200]="READY",I[I.SYNCING=206]="SYNCING",I[I.NOT_INITIALIZED_OR_ISSUES=503]="NOT_INITIALIZED_OR_ISSUES"})(bs||(bs={}));function hy(I){return{getNetworkIdentity:{url:"/eth/v1/node/identity",method:"GET",req:kA,resp:{onlySupport:uA.json,data:{...II.data,toJson:A=>{const g=Ys.toJson(A),{custodyGroupCount:B}=A.metadata;return g.metadata.custody_group_count=B!==void 0?String(B):void 0,g},fromJson:A=>{const g=Ys.fromJson(A),{metadata:{custody_group_count:B}}=A;return g.metadata.custodyGroupCount=B!==void 0?parseInt(B):void 0,g}},meta:VA}},getPeers:{url:"/eth/v1/node/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:IA.StringArray,direction:IA.StringArray}}},resp:{...II,meta:{toJson:A=>A,fromJson:A=>({count:A.count}),toHeadersObject:()=>({}),fromHeaders:()=>({})},transform:{toResponse:(A,g)=>({data:A,meta:g}),fromResponse:A=>A}}},getPeer:{url:"/eth/v1/node/peers/{peer_id}",method:"GET",req:{writeReq:({peerId:A})=>({params:{peer_id:A}}),parseReq:({params:A})=>({peerId:A.peer_id}),schema:{params:{peer_id:IA.StringRequired}}},resp:II},getPeerCount:{url:"/eth/v1/node/peer_count",method:"GET",req:kA,resp:{data:ay,meta:VA}},getNodeVersion:{url:"/eth/v1/node/version",method:"GET",req:kA,resp:II},getSyncingStatus:{url:"/eth/v1/node/syncing",method:"GET",req:kA,resp:{data:sy,meta:VA}},getHealth:{url:"/eth/v1/node/health",method:"GET",req:{writeReq:({syncingStatus:A})=>({query:{syncing_status:A}}),parseReq:({query:A})=>({syncingStatus:A.syncing_status}),schema:{query:{syncing_status:IA.Uint}}},resp:YA}}}const Xg=new Y({leaves:dA(hB,1e4),descriptor:new kC(2048)});function ly(I){return{getStateProof:{url:"/eth/v0/beacon/proof/state/{state_id}",method:"GET",req:{writeReq:({stateId:A,descriptor:g})=>({params:{state_id:A},query:{format:rg(g)}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,descriptor:aA(g.format)}),schema:{params:{state_id:IA.StringRequired},query:{format:IA.StringRequired}}},resp:{data:{toJson:A=>Xg.toJson(A),fromJson:A=>({...Xg.fromJson(A),type:ZA.compactMulti}),serialize:A=>Xg.serialize(A),deserialize:A=>({...Xg.deserialize(A),type:ZA.compactMulti})},meta:vg}},getBlockProof:{url:"/eth/v0/beacon/proof/block/{block_id}",method:"GET",req:{writeReq:({blockId:A,descriptor:g})=>({params:{block_id:A},query:{format:rg(g)}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,descriptor:aA(g.format)}),schema:{params:{block_id:IA.StringRequired},query:{format:IA.StringRequired}}},resp:{data:{toJson:A=>Xg.toJson(A),fromJson:A=>({...Xg.fromJson(A),type:ZA.compactMulti}),serialize:A=>Xg.serialize(A),deserialize:A=>({...Xg.deserialize(A),type:ZA.compactMulti})},meta:vg}}}}var Ts;(function(I){I.Default="default",I.BuilderAlways="builderalways",I.ExecutionAlways="executionalways",I.MaxProfit="maxprofit",I.BuilderOnly="builderonly",I.ExecutionOnly="executiononly"})(Ts||(Ts={}));const qs=new Y({...RB.fields,executionPayloadBlinded:CI,executionPayloadValue:ZB,consensusBlockValue:ZB},{jsonCase:"eth2"}),Dy=new Y({pubkey:_B,validatorIndex:zA,committeeIndex:sB,committeeLength:RA,committeesAtSlot:RA,validatorCommitteeIndex:RA,slot:LA},{jsonCase:"eth2"}),cy=new Y({slot:LA,validatorIndex:zA,pubkey:_B},{jsonCase:"eth2"}),Uy=new Y({pubkey:_B,validatorIndex:zA,validatorSyncCommitteeIndices:dA(sB)},{jsonCase:"eth2"}),fy=new Y({validatorIndex:zA,committeeIndex:sB,committeesAtSlot:LA,slot:LA,isAggregator:CI},{jsonCase:"eth2"}),Sy=new Y({validatorIndex:zA,syncCommitteeIndices:dA(sB),untilEpoch:VI},{jsonCase:"eth2"}),wy=new Y({validatorIndex:zA,feeRecipient:Og},{jsonCase:"eth2"}),yy=new Y({validatorIndex:zA,slot:LA,selectionProof:JQ},{jsonCase:"eth2"}),Ny=new Y({validatorIndex:zA,slot:LA,subcommitteeIndex:Re,selectionProof:JQ},{jsonCase:"eth2"}),dy=new Y({index:zA,isLive:CI},{jsonCase:"eth2"}),YI=dA(zA),uy=dA(Dy),Ry=dA(cy),Gy=dA(Uy),$g=dA(NA.SignedAggregateAndProof),ni=dA(wI.SignedAggregateAndProof),ai=dA(PI.SignedContributionAndProof),si=dA(fy),hi=dA(Sy),Vs=dA(wy),AQ=dA(yy),IQ=dA(Ny),Fy=dA(dy),li=dA(cs.SignedValidatorRegistrationV1,DC);function ky(I){return{getAttesterDuties:{url:"/eth/v1/validator/duties/attester/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:YI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:YI.deserialize(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.StringArray}},resp:{data:uy,meta:us}},getProposerDuties:{url:"/eth/v1/validator/duties/proposer/{epoch}",method:"GET",req:{writeReq:({epoch:A})=>({params:{epoch:A}}),parseReq:({params:A})=>({epoch:A.epoch}),schema:{params:{epoch:IA.UintRequired}}},resp:{data:Ry,meta:us}},getSyncCommitteeDuties:{url:"/eth/v1/validator/duties/sync/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:YI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:YI.deserialize(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.StringArray}},resp:{data:Gy,meta:cw}},produceBlockV3:{url:"/eth/v3/validator/blocks/{slot}",method:"GET",req:{writeReq:({slot:A,randaoReveal:g,graffiti:B,skipRandaoVerification:i,feeRecipient:Q,builderSelection:C,builderBoostFactor:e,strictFeeRecipientCheck:o,blindedLocal:c})=>({params:{slot:A},query:{randao_reveal:rg(g),graffiti:lw(B),skip_randao_verification:py(i),fee_recipient:Q,builder_selection:C,builder_boost_factor:e?.toString(),strict_fee_recipient_check:o,blinded_local:c}}),parseReq:({params:A,query:g})=>({slot:A.slot,randaoReveal:aA(g.randao_reveal),graffiti:Dw(g.graffiti),skipRandaoVerification:Hy(g.skip_randao_verification),feeRecipient:g.fee_recipient,builderSelection:g.builder_selection,builderBoostFactor:Jy(g.builder_boost_factor),strictFeeRecipientCheck:g.strict_fee_recipient_check,blindedLocal:g.blinded_local}),schema:{params:{slot:IA.UintRequired},query:{randao_reveal:IA.StringRequired,graffiti:IA.String,skip_randao_verification:IA.String,fee_recipient:IA.String,builder_selection:IA.String,builder_boost_factor:IA.String,strict_fee_recipient_check:IA.Boolean,blinded_local:IA.Boolean}}},resp:{data:{toJson(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.toJson(A):fI(B)?MA(B).BlockContents.toJson(A):kI[B].BeaconBlock.toJson(A.block)},fromJson(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.fromJson(A):fI(B)?MA(B).BlockContents.fromJson(A):{block:kI[B].BeaconBlock.fromJson(A)}},serialize(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.serialize(A):fI(B)?MA(B).BlockContents.serialize(A):kI[B].BeaconBlock.serialize(A.block)},deserialize(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.deserialize(A):fI(B)?MA(B).BlockContents.deserialize(A):{block:kI[B].BeaconBlock.deserialize(A)}}},meta:{toJson:A=>({...qs.toJson(A),execution_payload_source:A.executionPayloadSource}),fromJson:A=>{const{executionPayloadBlinded:g,...B}=qs.fromJson(A),i=A.execution_payload_source??(g===!0?iC.builder:iC.engine);return{...B,executionPayloadBlinded:g,executionPayloadSource:i}},toHeadersObject:A=>({[lA.Version]:A.version,[lA.ExecutionPayloadBlinded]:A.executionPayloadBlinded.toString(),[lA.ExecutionPayloadSource]:A.executionPayloadSource.toString(),[lA.ExecutionPayloadValue]:A.executionPayloadValue.toString(),[lA.ConsensusBlockValue]:A.consensusBlockValue.toString()}),fromHeaders:A=>{const g=uB(A.getRequired(lA.ExecutionPayloadBlinded)),B=A.get(lA.ExecutionPayloadSource)??(g===!0?iC.builder:iC.engine);return{version:gI(A.getRequired(lA.Version)),executionPayloadBlinded:g,executionPayloadSource:B,executionPayloadValue:BigInt(A.getRequired(lA.ExecutionPayloadValue)),consensusBlockValue:BigInt(A.getRequired(lA.ConsensusBlockValue))}}}}},produceAttestationData:{url:"/eth/v1/validator/attestation_data",method:"GET",req:{writeReq:({committeeIndex:A,slot:g})=>({query:{slot:g,committee_index:A}}),parseReq:({query:A})=>({committeeIndex:A.committee_index,slot:A.slot}),schema:{query:{slot:IA.UintRequired,committee_index:IA.Uint}}},resp:{data:NA.AttestationData,meta:VA}},produceSyncCommitteeContribution:{url:"/eth/v1/validator/sync_committee_contribution",method:"GET",req:{writeReq:({slot:A,subcommitteeIndex:g,beaconBlockRoot:B})=>({query:{slot:A,subcommittee_index:g,beacon_block_root:sQ(B)}}),parseReq:({query:A})=>({slot:A.slot,subcommitteeIndex:A.subcommittee_index,beaconBlockRoot:aA(A.beacon_block_root)}),schema:{query:{slot:IA.UintRequired,subcommittee_index:IA.UintRequired,beacon_block_root:IA.StringRequired}}},resp:{data:PI.SyncCommitteeContribution,meta:VA}},getAggregatedAttestation:{url:"/eth/v1/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g})=>({query:{attestation_data_root:sQ(A),slot:g}}),parseReq:({query:A})=>({attestationDataRoot:aA(A.attestation_data_root),slot:A.slot}),schema:{query:{attestation_data_root:IA.StringRequired,slot:IA.UintRequired}}},resp:{data:NA.Attestation,meta:VA}},getAggregatedAttestationV2:{url:"/eth/v2/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g,committeeIndex:B})=>({query:{attestation_data_root:rg(A),slot:g,committee_index:B}}),parseReq:({query:A})=>({attestationDataRoot:aA(A.attestation_data_root),slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{attestation_data_root:IA.StringRequired,slot:IA.UintRequired,committee_index:IA.UintRequired}}},resp:{data:Qg(A=>xA(A)?wI.Attestation:NA.Attestation),meta:vg}},publishAggregateAndProofs:{url:"/eth/v1/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>({body:$g.toJson(A)}),parseReqJson:({body:A})=>({signedAggregateAndProofs:$g.fromJson(A)}),writeReqSsz:({signedAggregateAndProofs:A})=>({body:$g.serialize(A)}),parseReqSsz:({body:A})=>({signedAggregateAndProofs:$g.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},publishAggregateAndProofsV2:{url:"/eth/v2/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:xA(g)?ni.toJson(A):$g.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAggregateAndProofs:xA(B)?ni.fromJson(A):$g.fromJson(A)}},writeReqSsz:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:xA(g)?ni.serialize(A):$g.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAggregateAndProofs:xA(B)?ni.deserialize(A):$g.deserialize(A)}},schema:{body:IA.ObjectArray,headers:{[lA.Version]:IA.String}}},resp:YA},publishContributionAndProofs:{url:"/eth/v1/validator/contribution_and_proofs",method:"POST",req:{writeReqJson:({contributionAndProofs:A})=>({body:ai.toJson(A)}),parseReqJson:({body:A})=>({contributionAndProofs:ai.fromJson(A)}),writeReqSsz:({contributionAndProofs:A})=>({body:ai.serialize(A)}),parseReqSsz:({body:A})=>({contributionAndProofs:ai.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},prepareBeaconCommitteeSubnet:{url:"/eth/v1/validator/beacon_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:si.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:si.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:si.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:si.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},prepareSyncCommitteeSubnets:{url:"/eth/v1/validator/sync_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:hi.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:hi.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:hi.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:hi.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},prepareBeaconProposer:{url:"/eth/v1/validator/prepare_beacon_proposer",method:"POST",req:eC({writeReqJson:({proposers:A})=>({body:Vs.toJson(A)}),parseReqJson:({body:A})=>({proposers:Vs.fromJson(A)}),schema:{body:IA.ObjectArray}}),resp:YA},submitBeaconCommitteeSelections:{url:"/eth/v1/validator/beacon_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:AQ.toJson(A)}),parseReqJson:({body:A})=>({selections:AQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:AQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:AQ.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:{data:AQ,meta:VA}},submitSyncCommitteeSelections:{url:"/eth/v1/validator/sync_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:IQ.toJson(A)}),parseReqJson:({body:A})=>({selections:IQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:IQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:IQ.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:{data:IQ,meta:VA}},getLiveness:{url:"/eth/v1/validator/liveness/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:YI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:YI.deserialize(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.StringArray}},resp:{data:Fy,meta:VA}},registerValidator:{url:"/eth/v1/validator/register_validator",method:"POST",req:{writeReqJson:({registrations:A})=>({body:li.toJson(A)}),parseReqJson:({body:A})=>({registrations:li.fromJson(A)}),writeReqSsz:({registrations:A})=>({body:li.serialize(A)}),parseReqSsz:({body:A})=>({registrations:li.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA,init:{requestWireFormat:uA.ssz}}}}function Jy(I){return I!==void 0?BigInt(I):void 0}function py(I){return I===!0?"":void 0}function Hy(I){return I!==void 0&&I===""}class My extends Error{status;operationId;constructor(A,g,B){super(`${B} failed with status ${g}: ${A}`),this.status=g,this.operationId=B}}var Di;(function(I){I[I.CONTINUE=100]="CONTINUE",I[I.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",I[I.PROCESSING=102]="PROCESSING",I[I.OK=200]="OK",I[I.CREATED=201]="CREATED",I[I.ACCEPTED=202]="ACCEPTED",I[I.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",I[I.NO_CONTENT=204]="NO_CONTENT",I[I.RESET_CONTENT=205]="RESET_CONTENT",I[I.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",I[I.MULTI_STATUS=207]="MULTI_STATUS",I[I.ALREADY_REPORTED=208]="ALREADY_REPORTED",I[I.IM_USED=226]="IM_USED",I[I.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",I[I.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",I[I.FOUND=302]="FOUND",I[I.SEE_OTHER=303]="SEE_OTHER",I[I.NOT_MODIFIED=304]="NOT_MODIFIED",I[I.USE_PROXY=305]="USE_PROXY",I[I.SWITCH_PROXY=306]="SWITCH_PROXY",I[I.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",I[I.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",I[I.BAD_REQUEST=400]="BAD_REQUEST",I[I.UNAUTHORIZED=401]="UNAUTHORIZED",I[I.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",I[I.FORBIDDEN=403]="FORBIDDEN",I[I.NOT_FOUND=404]="NOT_FOUND",I[I.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",I[I.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",I[I.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",I[I.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",I[I.CONFLICT=409]="CONFLICT",I[I.GONE=410]="GONE",I[I.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",I[I.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",I[I.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",I[I.URI_TOO_LONG=414]="URI_TOO_LONG",I[I.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",I[I.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",I[I.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",I[I.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",I[I.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",I[I.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",I[I.LOCKED=423]="LOCKED",I[I.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",I[I.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",I[I.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",I[I.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",I[I.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",I[I.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",I[I.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",I[I.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",I[I.BAD_GATEWAY=502]="BAD_GATEWAY",I[I.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",I[I.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",I[I.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",I[I.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",I[I.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",I[I.LOOP_DETECTED=508]="LOOP_DETECTED",I[I.NOT_EXTENDED=510]="NOT_EXTENDED",I[I.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Di||(Di={}));var js,Zs;function _s(){return Zs||(Zs=1,js=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var I={},A=Symbol("test"),g=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(g)!=="[object Symbol]")return!1;var B=42;I[A]=B;for(A in I)return!1;if(typeof Object.keys=="function"&&Object.keys(I).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(I).length!==0)return!1;var i=Object.getOwnPropertySymbols(I);if(i.length!==1||i[0]!==A||!Object.prototype.propertyIsEnumerable.call(I,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var Q=Object.getOwnPropertyDescriptor(I,A);if(Q.value!==B||Q.enumerable!==!0)return!1}return!0}),js}var Rt,Ps;function my(){if(Ps)return Rt;Ps=1;var I=typeof Symbol<"u"&&Symbol,A=_s();return Rt=function(){return typeof I!="function"||typeof Symbol!="function"||typeof I("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:A()},Rt}var Gt,Os;function Ly(){if(Os)return Gt;Os=1;var I={foo:{}},A=Object;return Gt=function(){return{__proto__:I}.foo===I.foo&&!({__proto__:null}instanceof A)},Gt}var Ft,xs;function Ky(){if(xs)return Ft;xs=1;var I="Function.prototype.bind called on incompatible ",A=Object.prototype.toString,g=Math.max,B="[object Function]",i=function(e,o){for(var c=[],a=0;a<e.length;a+=1)c[a]=e[a];for(var f=0;f<o.length;f+=1)c[f+e.length]=o[f];return c},Q=function(e,o){for(var c=[],a=o,f=0;a<e.length;a+=1,f+=1)c[f]=e[a];return c},C=function(e,o){for(var c="",a=0;a<e.length;a+=1)c+=e[a],a+1<e.length&&(c+=o);return c};return Ft=function(e){var o=this;if(typeof o!="function"||A.apply(o)!==B)throw new TypeError(I+o);for(var c=Q(arguments,1),a,f=function(){if(this instanceof a){var u=o.apply(this,i(c,arguments));return Object(u)===u?u:this}return o.apply(e,i(c,arguments))},R=g(0,o.length-c.length),y=[],G=0;G<R;G++)y[G]="$"+G;if(a=Function("binder","return function ("+C(y,",")+"){ return binder.apply(this,arguments); }")(f),o.prototype){var S=function(){};S.prototype=o.prototype,a.prototype=new S,S.prototype=null}return a},Ft}var kt,zs;function Jt(){if(zs)return kt;zs=1;var I=Ky();return kt=Function.prototype.bind||I,kt}var pt,vs;function Yy(){if(vs)return pt;vs=1;var I=Function.prototype.call,A=Object.prototype.hasOwnProperty,g=Jt();return pt=g.call(I,A),pt}var Ht,Ws;function FB(){if(Ws)return Ht;Ws=1;var I,A=SyntaxError,g=Function,B=TypeError,i=function(sA){try{return g('"use strict"; return ('+sA+").constructor;")()}catch{}},Q=Object.getOwnPropertyDescriptor;if(Q)try{Q({},"")}catch{Q=null}var C=function(){throw new B},e=Q?function(){try{return arguments.callee,C}catch{try{return Q(arguments,"callee").get}catch{return C}}}():C,o=my()(),c=Ly()(),a=Object.getPrototypeOf||(c?function(sA){return sA.__proto__}:null),f={},R=typeof Uint8Array>"u"||!a?I:a(Uint8Array),y={"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":o&&a?a([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?I:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?I:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":o&&a?a(a([][Symbol.iterator]())):I,"%JSON%":typeof JSON=="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!o||!a?I:a(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!o||!a?I:a(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":o&&a?a(""[Symbol.iterator]()):I,"%Symbol%":o?Symbol:I,"%SyntaxError%":A,"%ThrowTypeError%":e,"%TypedArray%":R,"%TypeError%":B,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet};if(a)try{null.error}catch(sA){var G=a(a(sA));y["%Error.prototype%"]=G}var S=function sA(eA){var M;if(eA==="%AsyncFunction%")M=i("async function () {}");else if(eA==="%GeneratorFunction%")M=i("function* () {}");else if(eA==="%AsyncGeneratorFunction%")M=i("async function* () {}");else if(eA==="%AsyncGenerator%"){var V=sA("%AsyncGeneratorFunction%");V&&(M=V.prototype)}else if(eA==="%AsyncIteratorPrototype%"){var x=sA("%AsyncGenerator%");x&&a&&(M=a(x.prototype))}return y[eA]=M,M},u={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=Jt(),w=Yy(),J=N.call(Function.call,Array.prototype.concat),H=N.call(Function.apply,Array.prototype.splice),T=N.call(Function.call,String.prototype.replace),m=N.call(Function.call,String.prototype.slice),_=N.call(Function.call,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,oA=function(sA){var eA=m(sA,0,1),M=m(sA,-1);if(eA==="%"&&M!=="%")throw new A("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&eA!=="%")throw new A("invalid intrinsic syntax, expected opening `%`");var V=[];return T(sA,L,function(x,QA,z,iA){V[V.length]=z?T(iA,W,"$1"):QA||x}),V},cA=function(sA,eA){var M=sA,V;if(w(u,M)&&(V=u[M],M="%"+V[0]+"%"),w(y,M)){var x=y[M];if(x===f&&(x=S(M)),typeof x>"u"&&!eA)throw new B("intrinsic "+sA+" exists, but is not available. Please file an issue!");return{alias:V,name:M,value:x}}throw new A("intrinsic "+sA+" does not exist!")};return Ht=function(sA,eA){if(typeof sA!="string"||sA.length===0)throw new B("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof eA!="boolean")throw new B('"allowMissing" argument must be a boolean');if(_(/^%?[^%]*%?$/,sA)===null)throw new A("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=oA(sA),V=M.length>0?M[0]:"",x=cA("%"+V+"%",eA),QA=x.name,z=x.value,iA=!1,AA=x.alias;AA&&(V=AA[0],H(M,J([0,1],AA)));for(var BA=1,K=!0;BA<M.length;BA+=1){var Z=M[BA],j=m(Z,0,1),$=m(Z,-1);if((j==='"'||j==="'"||j==="`"||$==='"'||$==="'"||$==="`")&&j!==$)throw new A("property names with quotes must have matching quotes");if((Z==="constructor"||!K)&&(iA=!0),V+="."+Z,QA="%"+V+"%",w(y,QA))z=y[QA];else if(z!=null){if(!(Z in z)){if(!eA)throw new B("base intrinsic for "+sA+" exists, but the property is not available.");return}if(Q&&BA+1>=M.length){var q=Q(z,Z);K=!!q,K&&"get"in q&&!("originalValue"in q.get)?z=q.get:z=z[Z]}else K=w(z,Z),z=z[Z];K&&!iA&&(y[QA]=z)}}return z},Ht}var Xs={exports:{}},Mt,$s;function A0(){if($s)return Mt;$s=1;var I=FB(),A=I("%Object.defineProperty%",!0),g=function(){if(A)try{return A({},"a",{value:1}),!0}catch{return!1}return!1};return g.hasArrayLengthDefineBug=function(){if(!g())return null;try{return A([],"length",{value:1}).length!==1}catch{return!0}},Mt=g,Mt}var mt,I0;function Lt(){if(I0)return mt;I0=1;var I=FB(),A=I("%Object.getOwnPropertyDescriptor%",!0);if(A)try{A([],"length")}catch{A=null}return mt=A,mt}var Kt,g0;function by(){if(g0)return Kt;g0=1;var I=A0()(),A=FB(),g=I&&A("%Object.defineProperty%",!0);if(g)try{g({},"a",{value:1})}catch{g=!1}var B=A("%SyntaxError%"),i=A("%TypeError%"),Q=Lt();return Kt=function(C,e,o){if(!C||typeof C!="object"&&typeof C!="function")throw new i("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,R=arguments.length>6?arguments[6]:!1,y=!!Q&&Q(C,e);if(g)g(C,e,{configurable:f===null&&y?y.configurable:!f,enumerable:c===null&&y?y.enumerable:!c,value:o,writable:a===null&&y?y.writable:!a});else if(R||!c&&!a&&!f)C[e]=o;else throw new B("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Kt}var Yt,B0;function Ty(){if(B0)return Yt;B0=1;var I=FB(),A=by(),g=A0()(),B=Lt(),i=I("%TypeError%"),Q=I("%Math.floor%");return Yt=function(C,e){if(typeof C!="function")throw new i("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||Q(e)!==e)throw new i("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],c=!0,a=!0;if("length"in C&&B){var f=B(C,"length");f&&!f.configurable&&(c=!1),f&&!f.writable&&(a=!1)}return(c||a||!o)&&(g?A(C,"length",e,!0,!0):A(C,"length",e)),C},Yt}var C0;function Q0(){return C0||(C0=1,function(I){var A=Jt(),g=FB(),B=Ty(),i=g("%TypeError%"),Q=g("%Function.prototype.apply%"),C=g("%Function.prototype.call%"),e=g("%Reflect.apply%",!0)||A.call(C,Q),o=g("%Object.defineProperty%",!0),c=g("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}I.exports=function(f){if(typeof f!="function")throw new i("a function is required");var R=e(A,C,arguments);return B(R,1+c(0,f.length-(arguments.length-1)),!0)};var a=function(){return e(A,Q,arguments)};o?o(I.exports,"apply",{value:a}):I.exports.apply=a}(Xs)),Xs.exports}var bt,i0;function Tt(){if(i0)return bt;i0=1;var I=FB(),A=Q0(),g=A(I("String.prototype.indexOf"));return bt=function(B,i){var Q=I(B,!!i);return typeof Q=="function"&&g(B,".prototype.")>-1?A(Q):Q},bt}const qt=J1(L1);var Vt,e0;function qy(){if(e0)return Vt;e0=1;var I=typeof Map=="function"&&Map.prototype,A=Object.getOwnPropertyDescriptor&&I?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,g=I&&A&&typeof A.get=="function"?A.get:null,B=I&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,Q=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,C=i&&Q&&typeof Q.get=="function"?Q.get:null,e=i&&Set.prototype.forEach,o=typeof WeakMap=="function"&&WeakMap.prototype,c=o?WeakMap.prototype.has:null,a=typeof WeakSet=="function"&&WeakSet.prototype,f=a?WeakSet.prototype.has:null,R=typeof WeakRef=="function"&&WeakRef.prototype,y=R?WeakRef.prototype.deref:null,G=Boolean.prototype.valueOf,S=Object.prototype.toString,u=Function.prototype.toString,N=String.prototype.match,w=String.prototype.slice,J=String.prototype.replace,H=String.prototype.toUpperCase,T=String.prototype.toLowerCase,m=RegExp.prototype.test,_=Array.prototype.concat,L=Array.prototype.join,W=Array.prototype.slice,oA=Math.floor,cA=typeof BigInt=="function"?BigInt.prototype.valueOf:null,sA=Object.getOwnPropertySymbols,eA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,M=typeof Symbol=="function"&&typeof Symbol.iterator=="object",V=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||!0)?Symbol.toStringTag:null,x=Object.prototype.propertyIsEnumerable,QA=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(U){return U.__proto__}:null);function z(U,s){if(U===1/0||U===-1/0||U!==U||U&&U>-1e3&&U<1e3||m.call(/e/,s))return s;var P=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof U=="number"){var X=U<0?-oA(-U):oA(U);if(X!==U){var hA=String(X),E=w.call(s,hA.length+1);return J.call(hA,P,"$&_")+"."+J.call(J.call(E,/([0-9]{3})/g,"$&_"),/_$/,"")}}return J.call(s,P,"$&_")}var iA=qt,AA=iA.custom,BA=k(AA)?AA:null;Vt=function U(s,P,X,hA){var E=P||{};if(EA(E,"quoteStyle")&&E.quoteStyle!=="single"&&E.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(EA(E,"maxStringLength")&&(typeof E.maxStringLength=="number"?E.maxStringLength<0&&E.maxStringLength!==1/0:E.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var D=EA(E,"customInspect")?E.customInspect:!0;if(typeof D!="boolean"&&D!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(EA(E,"indent")&&E.indent!==null&&E.indent!==" "&&!(parseInt(E.indent,10)===E.indent&&E.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(EA(E,"numericSeparator")&&typeof E.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var F=E.numericSeparator;if(typeof s>"u")return"undefined";if(s===null)return"null";if(typeof s=="boolean")return s?"true":"false";if(typeof s=="string")return hI(s,E);if(typeof s=="number"){if(s===0)return 1/0/s>0?"0":"-0";var v=String(s);return F?z(s,v):v}if(typeof s=="bigint"){var GA=String(s)+"n";return F?z(s,GA):GA}var HB=typeof E.depth>"u"?5:E.depth;if(typeof X>"u"&&(X=0),X>=HB&&HB>0&&typeof s=="object")return j(s)?"[Array]":"[Object]";var eg=t(E,X);if(typeof hA>"u")hA=[];else if(wA(hA,s)>=0)return"[Circular]";function UI(hC,Fi,Od){if(Fi&&(hA=W.call(hA),hA.push(Fi)),Od){var fl={depth:E.depth};return EA(E,"quoteStyle")&&(fl.quoteStyle=E.quoteStyle),U(hC,fl,X+1,hA)}return U(hC,E,X+1,hA)}if(typeof s=="function"&&!q(s)){var Ri=DA(s),sl=h(s,UI);return"[Function"+(Ri?": "+Ri:" (anonymous)")+"]"+(sl.length>0?" { "+L.call(sl,", ")+" }":"")}if(k(s)){var hl=M?J.call(String(s),/^(Symbol\(.*\))_[^)]*$/,"$1"):eA.call(s);return typeof s=="object"&&!M?BI(hl):hl}if(PA(s)){for(var CQ="<"+T.call(String(s.nodeName)),vE=s.attributes||[],Gi=0;Gi<vE.length;Gi++)CQ+=" "+vE[Gi].name+"="+K(Z(vE[Gi].value),"double",E);return CQ+=">",s.childNodes&&s.childNodes.length&&(CQ+="..."),CQ+="</"+T.call(String(s.nodeName))+">",CQ}if(j(s)){if(s.length===0)return"[]";var WE=h(s,UI);return eg&&!d(WE)?"["+n(WE,eg)+"]":"[ "+L.call(WE,", ")+" ]"}if(b(s)){var XE=h(s,UI);return!("cause"in Error.prototype)&&"cause"in s&&!x.call(s,"cause")?"{ ["+String(s)+"] "+L.call(_.call("[cause]: "+UI(s.cause),XE),", ")+" }":XE.length===0?"["+String(s)+"]":"{ ["+String(s)+"] "+L.call(XE,", ")+" }"}if(typeof s=="object"&&D){if(BA&&typeof s[BA]=="function"&&iA)return iA(s,{depth:HB-X});if(D!=="symbol"&&typeof s.inspect=="function")return s.inspect()}if(FA(s)){var ll=[];return B&&B.call(s,function(hC,Fi){ll.push(UI(Fi,s,!0)+" => "+UI(hC,s))}),l("Map",g.call(s),ll,eg)}if(XA(s)){var Dl=[];return e&&e.call(s,function(hC){Dl.push(UI(hC,s))}),l("Set",C.call(s),Dl,eg)}if(CA(s))return r("WeakMap");if(bA(s))return r("WeakSet");if(_A(s))return r("WeakRef");if(tA(s))return BI(UI(Number(s)));if(p(s))return BI(UI(cA.call(s)));if(rA(s))return BI(G.call(s));if(O(s))return BI(UI(String(s)));if(typeof window<"u"&&s===window)return"{ [object Window] }";if(s===TA)return"{ [object globalThis] }";if(!$(s)&&!q(s)){var $E=h(s,UI),cl=QA?QA(s)===Object.prototype:s instanceof Object||s.constructor===Object,Ao=s instanceof Object?"":"null prototype",Ul=!cl&&V&&Object(s)===s&&V in s?w.call(UA(s),8,-1):Ao?"Object":"",Pd=cl||typeof s.constructor!="function"?"":s.constructor.name?s.constructor.name+" ":"",Io=Pd+(Ul||Ao?"["+L.call(_.call([],Ul||[],Ao||[]),": ")+"] ":"");return $E.length===0?Io+"{}":eg?Io+"{"+n($E,eg)+"}":Io+"{ "+L.call($E,", ")+" }"}return String(s)};function K(U,s,P){var X=(P.quoteStyle||s)==="double"?'"':"'";return X+U+X}function Z(U){return J.call(String(U),/"/g,""")}function j(U){return UA(U)==="[object Array]"&&(!V||!(typeof U=="object"&&V in U))}function $(U){return UA(U)==="[object Date]"&&(!V||!(typeof U=="object"&&V in U))}function q(U){return UA(U)==="[object RegExp]"&&(!V||!(typeof U=="object"&&V in U))}function b(U){return UA(U)==="[object Error]"&&(!V||!(typeof U=="object"&&V in U))}function O(U){return UA(U)==="[object String]"&&(!V||!(typeof U=="object"&&V in U))}function tA(U){return UA(U)==="[object Number]"&&(!V||!(typeof U=="object"&&V in U))}function rA(U){return UA(U)==="[object Boolean]"&&(!V||!(typeof U=="object"&&V in U))}function k(U){if(M)return U&&typeof U=="object"&&U instanceof Symbol;if(typeof U=="symbol")return!0;if(!U||typeof U!="object"||!eA)return!1;try{return eA.call(U),!0}catch{}return!1}function p(U){if(!U||typeof U!="object"||!cA)return!1;try{return cA.call(U),!0}catch{}return!1}var gA=Object.prototype.hasOwnProperty||function(U){return U in this};function EA(U,s){return gA.call(U,s)}function UA(U){return S.call(U)}function DA(U){if(U.name)return U.name;var s=N.call(u.call(U),/^function\s*([\w$]+)/);return s?s[1]:null}function wA(U,s){if(U.indexOf)return U.indexOf(s);for(var P=0,X=U.length;P<X;P++)if(U[P]===s)return P;return-1}function FA(U){if(!g||!U||typeof U!="object")return!1;try{g.call(U);try{C.call(U)}catch{return!0}return U instanceof Map}catch{}return!1}function CA(U){if(!c||!U||typeof U!="object")return!1;try{c.call(U,c);try{f.call(U,f)}catch{return!0}return U instanceof WeakMap}catch{}return!1}function _A(U){if(!y||!U||typeof U!="object")return!1;try{return y.call(U),!0}catch{}return!1}function XA(U){if(!C||!U||typeof U!="object")return!1;try{C.call(U);try{g.call(U)}catch{return!0}return U instanceof Set}catch{}return!1}function bA(U){if(!f||!U||typeof U!="object")return!1;try{f.call(U,f);try{c.call(U,c)}catch{return!0}return U instanceof WeakSet}catch{}return!1}function PA(U){return!U||typeof U!="object"?!1:typeof HTMLElement<"u"&&U instanceof HTMLElement?!0:typeof U.nodeName=="string"&&typeof U.getAttribute=="function"}function hI(U,s){if(U.length>s.maxStringLength){var P=U.length-s.maxStringLength,X="... "+P+" more character"+(P>1?"s":"");return hI(w.call(U,0,s.maxStringLength),s)+X}var hA=J.call(J.call(U,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,pA);return K(hA,"single",s)}function pA(U){var s=U.charCodeAt(0),P={8:"b",9:"t",10:"n",12:"f",13:"r"}[s];return P?"\\"+P:"\\x"+(s<16?"0":"")+H.call(s.toString(16))}function BI(U){return"Object("+U+")"}function r(U){return U+" { ? }"}function l(U,s,P,X){var hA=X?n(P,X):L.call(P,", ");return U+" ("+s+") {"+hA+"}"}function d(U){for(var s=0;s<U.length;s++)if(wA(U[s],`
|
|
5
|
+
`:I===118?"\v":I===102?"\f":I===114?"\r":I===101?"\x1B":I===32?" ":I===34?'"':I===47?"/":I===92?"\\":I===78?"\x85":I===95?"\xA0":I===76?"\u2028":I===80?"\u2029":""}for(var uc=new Array(256),Rc=new Array(256),TB=0;TB<256;TB++)uc[TB]=Br(TB)?1:0,Rc[TB]=Br(TB);var Gc=eI,Fc=Wo,kc={float:Ar,null:Xo,bool:$o},lQ={Type:Gc,types:kc};const{Type:Jc}=lQ;function pc(I){return 48<=I&&I<=57||65<=I&&I<=70||97<=I&&I<=102}function Hc(I){return 48<=I&&I<=55}function Mc(I){return 48<=I&&I<=57}function mc(I){if(I===null)return!1;const A=I.length;let g,B=0,i=!1;if(!A)return!1;if(g=I[B],(g==="-"||g==="+")&&(g=I[++B]),g==="0"){if(B+1===A)return!0;if(g=I[++B],g==="b"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(g!=="0"&&g!=="1")return!1;i=!0}return i&&g!=="_"}if(g==="x"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(!pc(I.charCodeAt(B)))return!1;i=!0}return i&&g!=="_"}for(;B<A;B++)if(g=I[B],g!=="_"){if(!Hc(I.charCodeAt(B)))return!1;i=!0}return i&&g!=="_"}if(g==="_")return!1;for(;B<A;B++)if(g=I[B],g!=="_"){if(g===":")break;if(!Mc(I.charCodeAt(B)))return!1;i=!0}return!i||g==="_"?!1:g!==":"?!0:/^(:[0-5]?[0-9])+$/.test(I.slice(B))}function Lc(I){let A=I,g=1,B,i;const Q=[];if(A.indexOf("_")!==-1&&(A=A.replace(/_/g,"")),B=A[0],(B==="-"||B==="+")&&(B==="-"&&(g=-1),A=A.slice(1),B=A[0]),A==="0")return BigInt(0);if(B==="0")return A[1]==="b"||A[1]==="x"?BigInt(A)*BigInt(g):BigInt("0o"+A)*BigInt(g);if(A.indexOf(":")!==-1){for(const C of A.split(":"))Q.unshift(parseInt(C,10));A=BigInt(0),i=BigInt(1);for(const C of Q)A=(BigInt(A)+BigInt(i))*BigInt(C),i=BigInt(i)*BigInt(60);return A*BigInt(g)}return BigInt(A)*BigInt(g)}function Kc(I){return typeof I=="bigint"||typeof I=="number"}const Yc=new Jc("tag:yaml.org,2002:int",{kind:"scalar",resolve:mc,construct:Lc,predicate:Kc,instanceOf:BigInt,represent:{binary:function(I){return I>=0?"0b"+I.toString(2):"-0b"+I.toString(2).slice(1)},octal:function(I){return I>=0?"0"+I.toString(8):"-0"+I.toString(8).slice(1)},decimal:function(I){return I.toString(10)},hexadecimal:function(I){return I>=0?"0x"+I.toString(16).toUpperCase():"-0x"+I.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});Fc.extend({implicit:[lQ.types.null,lQ.types.bool,Yc,lQ.types.float],explicit:[]});const Jg={PRESET_BASE:MI.mainnet,CONFIG_NAME:"mainnet",TERMINAL_TOTAL_DIFFICULTY:BigInt("58750000000000000000000"),TERMINAL_BLOCK_HASH:aA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:16384,MIN_GENESIS_TIME:1606824e3,GENESIS_FORK_VERSION:aA("0x00000000"),GENESIS_DELAY:604800,ALTAIR_FORK_VERSION:aA("0x01000000"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:aA("0x02000000"),BELLATRIX_FORK_EPOCH:144896,CAPELLA_FORK_VERSION:aA("0x03000000"),CAPELLA_FORK_EPOCH:194048,DENEB_FORK_VERSION:aA("0x04000000"),DENEB_FORK_EPOCH:269568,ELECTRA_FORK_VERSION:aA("0x05000000"),ELECTRA_FORK_EPOCH:364032,FULU_FORK_VERSION:aA("0x06000000"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x07000000"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:12,SLOT_DURATION_MS:12e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,SHARD_COMMITTEE_PERIOD:256,ETH1_FOLLOW_DISTANCE:2048,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:4,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:8,CHURN_LIMIT_QUOTIENT:65536,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,DEPOSIT_CONTRACT_ADDRESS:aA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),MAX_REQUEST_BLOCKS:1024,MIN_EPOCHS_FOR_BLOCK_REQUESTS:33024,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:256e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:128e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,BLOB_SCHEDULE:[]},bc={PRESET_BASE:MI.minimal,CONFIG_NAME:"minimal",TERMINAL_TOTAL_DIFFICULTY:BigInt("115792089237316195423570985008687907853269984665640564039457584007913129638912"),TERMINAL_BLOCK_HASH:aA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1578009600,GENESIS_FORK_VERSION:aA("0x00000001"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:aA("0x01000001"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:aA("0x02000001"),BELLATRIX_FORK_EPOCH:1/0,CAPELLA_FORK_VERSION:aA("0x03000001"),CAPELLA_FORK_EPOCH:1/0,DENEB_FORK_VERSION:aA("0x04000001"),DENEB_FORK_EPOCH:1/0,ELECTRA_FORK_VERSION:aA("0x05000001"),ELECTRA_FORK_EPOCH:1/0,FULU_FORK_VERSION:aA("0x06000001"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x07000001"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:6,SLOT_DURATION_MS:6e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,SHARD_COMMITTEE_PERIOD:64,ETH1_FOLLOW_DISTANCE:16,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:2,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:4,CHURN_LIMIT_QUOTIENT:32,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:5,DEPOSIT_NETWORK_ID:5,DEPOSIT_CONTRACT_ADDRESS:aA("0x1234567890123456789012345678901234567890"),MAX_REQUEST_BLOCKS:1024,MIN_EPOCHS_FOR_BLOCK_REQUESTS:272,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:128e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,BLOB_SCHEDULE:[]};let DQ;switch(EQ){case MI.minimal:DQ=bc;break;case MI.mainnet:DQ=Jg;break;default:DQ=Jg}function Tc(I){const A={...DQ,...I};if(I.SLOT_DURATION_MS===void 0&&(A.SLOT_DURATION_MS=A.SECONDS_PER_SLOT*1e3),A.PRESET_BASE!==EQ)throw new Error(`Can only create a config for the active preset: ACTIVE_PRESET=${EQ} PRESET_BASE=${A.PRESET_BASE}`);return A}function pg(I,A){const g=BigInt(1)<<BigInt(I);if(A>=g)throw new Error(`index ${A} too large for depth ${I}`);return g|A}function vi(I,A){const g=A?Number(A).toString(2):"";if(g.length>I)throw new Error("index too large for depth");return`1${g.padStart(I,"0")}`}function Wi(I){if(typeof I=="string"){if(I.length===0)throw new Error(cQ);return I}if(I<1)throw new Error(cQ);return I.toString(2)}const cQ="Invalid gindex";function qc(I){let A;if(typeof I=="string"){if(!I.length)throw new Error(cQ);A=I}else{if(I<1)throw new Error(cQ);A=I.toString(2)}let g=1;const B=()=>{if(g===A.length)return{done:!0,value:void 0};const i=Number(A[g]);return g++,{done:!1,value:i}};return{[Symbol.iterator](){return{next:B}},remainingBitLength(){return A.length-g}}}function ng(I){return BigInt(I.reduce((A,g)=>A+g.toString(2).slice(1),"0b1"))}function Vc(I){return I instanceof Uint8Array||ArrayBuffer.isView(I)&&I.constructor.name==="Uint8Array"}function Cr(I,...A){if(!Vc(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error("Uint8Array expected of length "+A+", got length="+I.length)}function Qr(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function jc(I,A){Cr(I);const g=A.outputLen;if(I.length<g)throw new Error("digestInto() expects output buffer of length at least "+g)}function Xi(I){return new DataView(I.buffer,I.byteOffset,I.byteLength)}function XI(I,A){return I<<32-A|I>>>A}function Zc(I){if(typeof I!="string")throw new Error("utf8ToBytes expected string, got "+typeof I);return new Uint8Array(new TextEncoder().encode(I))}function ir(I){return typeof I=="string"&&(I=Zc(I)),Cr(I),I}let _c=class{clone(){return this._cloneInto()}};function Pc(I){const A=B=>I().update(ir(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}function Oc(I,A,g,B){if(typeof I.setBigUint64=="function")return I.setBigUint64(A,g,B);const i=BigInt(32),Q=BigInt(4294967295),C=Number(g>>i&Q),e=Number(g&Q),o=B?4:0,c=B?0:4;I.setUint32(A+o,C,B),I.setUint32(A+c,e,B)}function xc(I,A,g){return I&A^~I&g}function zc(I,A,g){return I&A^I&g^A&g}class vc extends _c{constructor(A,g,B,i){super(),this.blockLen=A,this.outputLen=g,this.padOffset=B,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(A),this.view=Xi(this.buffer)}update(A){Qr(this);const{view:g,buffer:B,blockLen:i}=this;A=ir(A);const Q=A.length;for(let C=0;C<Q;){const e=Math.min(i-this.pos,Q-C);if(e===i){const o=Xi(A);for(;i<=Q-C;C+=i)this.process(o,C);continue}B.set(A.subarray(C,C+e),this.pos),this.pos+=e,C+=e,this.pos===i&&(this.process(g,0),this.pos=0)}return this.length+=A.length,this.roundClean(),this}digestInto(A){Qr(this),jc(A,this),this.finished=!0;const{buffer:g,view:B,blockLen:i,isLE:Q}=this;let{pos:C}=this;g[C++]=128,this.buffer.subarray(C).fill(0),this.padOffset>i-C&&(this.process(B,0),C=0);for(let f=C;f<i;f++)g[f]=0;Oc(B,i-8,BigInt(this.length*8),Q),this.process(B,0);const e=Xi(A),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,a=this.get();if(c>a.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<c;f++)e.setUint32(4*f,a[f],Q)}digest(){const{buffer:A,outputLen:g}=this;this.digestInto(A);const B=A.slice(0,g);return this.destroy(),B}_cloneInto(A){A||(A=new this.constructor),A.set(...this.get());const{blockLen:g,buffer:B,length:i,finished:Q,destroyed:C,pos:e}=this;return A.length=i,A.pos=e,A.finished=Q,A.destroyed=C,i%g&&A.buffer.set(B),A}}const Wc=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]),Hg=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Mg=new Uint32Array(64);class Xc extends vc{constructor(){super(64,32,8,!1),this.A=Hg[0]|0,this.B=Hg[1]|0,this.C=Hg[2]|0,this.D=Hg[3]|0,this.E=Hg[4]|0,this.F=Hg[5]|0,this.G=Hg[6]|0,this.H=Hg[7]|0}get(){const{A,B:g,C:B,D:i,E:Q,F:C,G:e,H:o}=this;return[A,g,B,i,Q,C,e,o]}set(A,g,B,i,Q,C,e,o){this.A=A|0,this.B=g|0,this.C=B|0,this.D=i|0,this.E=Q|0,this.F=C|0,this.G=e|0,this.H=o|0}process(A,g){for(let f=0;f<16;f++,g+=4)Mg[f]=A.getUint32(g,!1);for(let f=16;f<64;f++){const R=Mg[f-15],y=Mg[f-2],G=XI(R,7)^XI(R,18)^R>>>3,S=XI(y,17)^XI(y,19)^y>>>10;Mg[f]=S+Mg[f-7]+G+Mg[f-16]|0}let{A:B,B:i,C:Q,D:C,E:e,F:o,G:c,H:a}=this;for(let f=0;f<64;f++){const R=XI(e,6)^XI(e,11)^XI(e,25),y=a+R+xc(e,o,c)+Wc[f]+Mg[f]|0,G=(XI(B,2)^XI(B,13)^XI(B,22))+zc(B,i,Q)|0;a=c,c=o,o=e,e=C+y|0,C=Q,Q=i,i=B,B=y+G|0}B=B+this.A|0,i=i+this.B|0,Q=Q+this.C|0,C=C+this.D|0,e=e+this.E|0,o=o+this.F|0,c=c+this.G|0,a=a+this.H|0,this.set(B,i,Q,C,e,o,c,a)}roundClean(){Mg.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const er=Pc(()=>new Xc),qB=[new Uint8Array(32)];function VB(I){if(I>=qB.length)for(let A=qB.length;A<=I;A++)qB[A]=er.create().update(qB[A-1]).update(qB[A-1]).digest();return qB[I]}function SC(I){const A=new Uint8Array(32);return CD(I,A,0),A}function $c(I){return QD(I,0)}const nI=64;function AU(I,A,g,B,i){if(A<1)throw new Error(`Invalid padFor, expect to be greater than 0, got ${A}`);const Q=Math.ceil(Math.log2(A));if(I.length===0){g.set(VB(Q),B);return}if(I.length%32!==0)throw new Error(`Invalid input length, expect to be multiple of 32 bytes, got ${I.length}`);if(A>1&&I.length%nI!==0)throw new Error(`Invalid input length, expect to be multiple of 64 bytes, got ${I.length}, padFor=${A}`);let C=I.length,e=Math.floor(C/2),o=I;for(let c=0;c<Q;c++){const a=I.subarray(0,e);i(o,a),Math.floor(e/32)%2===1&&c<Q-1?(C=e+32,o=I.subarray(0,C),o.set(VB(c+1),e)):(o=a,C=e),e=Math.floor(C/2)}g.set(o.subarray(0,32),B)}function IU(I,A,g,B,i,Q,C){if(g<1)throw new Error(`Invalid padFor, expect to be at least 1, got ${g}`);if(A>I.length)throw new Error(`Invalid blockLimit, expect to be less than or equal blocks.length ${I.length}, got ${A}`);const e=Math.ceil(Math.log2(g));if(A===0){B.set(VB(e),i);return}for(const y of I)if(y.length!==nI)throw new Error(`Invalid block length, expect to be 64 bytes, got ${y.length}`);if(C.length===0||C.length%(4*nI)!==0)throw new Error(`Invalid buffer length, expect to be multiple of 64 bytes, got ${C.length}`);const o=Math.floor(C.length/nI),c=Math.floor(o/2);let a=C,f=C.subarray(0,c*nI),R=A;for(let y=0;y<e;y++){let G=0;const S=Math.floor(R/o);for(let N=0;N<S;N++){for(let w=0;w<o;w++){const J=N*o+w;a.set(I[J],w*nI)}Q(a,f);for(let w=0;w<c;w++)I[G].set(f.subarray(w*nI,(w+1)*nI)),G++}const u=R%o;a=C.subarray(0,u*nI),f=C.subarray(0,Math.floor(a.length/2));for(let N=Math.floor(R/o)*o;N<R;N++)a.set(I[N],N%o*nI);Q(a,f);for(let N=0;N<Math.floor(f.length/nI);N++)I[G].set(f.subarray(N*nI,(N+1)*nI)),G++;f.length%nI!==0&&(I[G].set(f.subarray(f.length-32,f.length),0),I[G].set(VB(y+1),32),G++),R=G,a=C.subarray(0,R*nI),f=C.subarray(0,Math.floor(a.length/2))}B.set(I[0].subarray(0,32),i)}function gU(I,A,g){let B=I.length;const i=Math.pow(2,A)*32;if(A<1)throw new Error(`Invalid nLevel, expect to be greater than 0, got ${A}`);if(B%i!==0)throw new Error(`Invalid input length, expect to be multiple of ${i} for nLevel ${A}, got ${B}`);let Q=Math.floor(B/2),C=I;for(let e=A;e>0;e--){const o=C.subarray(0,Q);g(C,o),C=o,B=Q,Q=Math.floor(B/2)}return C}const $i=new Uint8Array(64),Ae=(I,A)=>er.create().update(I).update(A).digest(),wC=(I,A)=>{if(I.length%64!==0)throw new Error(`Invalid input length ${I.length}`);if(I.length!==A.length*2)throw new Error(`Invalid output length ${A.length}`);const g=Math.floor(I.length/64);for(let B=0;B<g;B++){const i=B*64,Q=I.subarray(i,i+32),C=I.subarray(i+32,i+64),e=Ae(Q,C);A.set(e,B*32)}},BU=new Uint8Array(4*nI);let tB={name:"noble",hashInto:wC,digest64:Ae,digest64Into:(I,A,g)=>{if(I.length!==32||A.length!==32)throw new Error("Invalid input length");if(g.length!==32)throw new Error("Invalid output length");$i.set(I,0),$i.set(A,32),wC($i,g)},digest64HashObjects:(I,A,g)=>{_i(Ae(SC(I),SC(A)),0,g)},merkleizeBlocksBytes(I,A,g,B){AU(I,A,g,B,wC)},merkleizeBlockArray(I,A,g,B,i){IU(I,A,g,B,i,wC,BU)},digestNLevel(I,A){return gU(I,A,wC)},executeHashComputations:I=>{for(let A=I.length-1;A>=0;A--){const g=I[A];if(!g)throw Error(`no hash computations for level ${A}`);for(const B of g)B.dest.applyHash(rD(B.src0,B.src1))}}};function yC(I,A,g,B){tB.merkleizeBlocksBytes(I,A,g,B)}function tr(I,A,g,B,i){tB.merkleizeBlockArray(I,A,g,B,i)}function CU(I){tB.executeHashComputations(I)}const Er=2**32;class Ie{h0;h1;h2;h3;h4;h5;h6;h7;constructor(A,g,B,i,Q,C,e,o){this.h0=A,this.h1=g,this.h2=B,this.h3=i,this.h4=Q,this.h5=C,this.h6=e,this.h7=o}applyHash(A){this.h0=A.h0,this.h1=A.h1,this.h2=A.h2,this.h3=A.h3,this.h4=A.h4,this.h5=A.h5,this.h6=A.h6,this.h7=A.h7}}class jA extends Ie{_left;_right;constructor(A,g){if(super(null,0,0,0,0,0,0,0),this._left=A,this._right=g,!A)throw new Error("Left node is undefined");if(!g)throw new Error("Right node is undefined")}get rootHashObject(){return this.h0===null&&tB.digest64HashObjects(this.left.rootHashObject,this.right.rootHashObject,this),this}get root(){return SC(this.rootHashObject)}get left(){return this._left}get right(){return this._right}isLeaf(){return!1}}class KA extends Ie{get rootHashObject(){return this}get root(){return SC(this)}get left(){throw Error("LeafNode has no left node")}get right(){throw Error("LeafNode has no right node")}static fromRoot(A){return KA.fromHashObject($c(A))}static fromHashObject(A){return new KA(A.h0,A.h1,A.h2,A.h3,A.h4,A.h5,A.h6,A.h7)}static fromZero(){return new KA(0,0,0,0,0,0,0,0)}static fromUint32(A){return new KA(A,0,0,0,0,0,0,0)}clone(){return KA.fromHashObject(this)}isLeaf(){return!0}writeToBytes(A,g,B){A.set(this.root.slice(0,B),g)}getUint(A,g,B){const i=Math.floor(g/4);if(A<4){const Q=g%4*8,C=TI(this,i);return A===1?255&C>>Q:65535&C>>Q}if(A===4)return TI(this,i)>>>0;if(A===8){const Q=TI(this,i),C=TI(this,i+1);return C===0?Q>>>0:C===-1&&Q===-1&&B?1/0:(Q>>>0)+(C>>>0)*Er}throw Error("uintBytes > 8")}getUintBigint(A,g){const B=Math.floor(g/4);if(A<4){const C=g%4*8,e=TI(this,B);return BigInt(A===1?255&e>>C:65535&e>>C)}if(A===4)return BigInt(TI(this,B)>>>0);const i=Math.ceil(A/4);let Q=BigInt(0);for(let C=0;C<i;C++)Q+=BigInt(TI(this,B+C)>>>0)<<BigInt(32*C);return Q}setUint(A,g,B,i){const Q=Math.floor(g/4);if(A<4){const C=g%4*8;let e=TI(this,Q);A===1?(e&=~(255<<C),e|=(255&B)<<C):(e&=~(65535<<C),e|=(65535&B)<<C),lI(this,Q,e)}else if(A===4)lI(this,Q,B);else if(A===8)B===1/0&&i?(lI(this,Q,-1),lI(this,Q+1,-1)):(lI(this,Q,B&4294967295),lI(this,Q+1,B/Er&4294967295));else throw Error("uintBytes > 8")}setUintBigint(A,g,B){const i=Math.floor(g/4);if(A<4){const Q=Number(B),C=g%4*8;let e=TI(this,i);A===1?(e&=~(255<<C),e|=(255&Q)<<C):(e&=~(65535<<C),e|=(65535&Q)<<C),lI(this,i,e)}else if(A===4)lI(this,i,Number(B));else{const Q=i+Math.ceil(A/4);for(let C=i;C<Q;C++)lI(this,C,Number(B&BigInt(4294967295))),B=B>>BigInt(32)}}bitwiseOrUint(A,g,B){const i=Math.floor(g/4);if(A<4){const Q=g%4*8;ge(this,i,B<<Q)}else if(A===4)ge(this,i,B);else{const Q=i+Math.ceil(A/4);for(let C=i;C<Q;C++)ge(this,C,B&4294967295),B>>=32}}}function TI(I,A){if(A===0)return I.h0;if(A===1)return I.h1;if(A===2)return I.h2;if(A===3)return I.h3;if(A===4)return I.h4;if(A===5)return I.h5;if(A===6)return I.h6;if(A===7)return I.h7;throw Error("hIndex > 7")}function lI(I,A,g){if(A===0)I.h0=g;else if(A===1)I.h1=g;else if(A===2)I.h2=g;else if(A===3)I.h3=g;else if(A===4)I.h4=g;else if(A===5)I.h5=g;else if(A===6)I.h6=g;else if(A===7)I.h7=g;else throw Error("hIndex > 7")}function ge(I,A,g){if(A===0)I.h0|=g;else if(A===1)I.h1|=g;else if(A===2)I.h2|=g;else if(A===3)I.h3|=g;else if(A===4)I.h4|=g;else if(A===5)I.h5|=g;else if(A===6)I.h6|=g;else if(A===7)I.h7|=g;else throw Error("hIndex > 7")}class QU{_length;_totalLength;head;tail;pointer;constructor(){this._length=0,this._totalLength=0,this.head={src0:null,src1:null,dest:null,next:null},this.tail=null,this.pointer=null}get length(){return this._length}get totalLength(){return this._totalLength}reset(){this.head.src0=null,this.head.src1=null,this.head.dest=null,this.tail=null,this._length=0,this.pointer=null}push(A,g,B){if(this.tail!==null){let i=this.tail.next;i!==null?(i.src0=A,i.src1=g,i.dest=B):(i={src0:A,src1:g,dest:B,next:null},this.tail.next=i,this._totalLength++),this.tail=i,this._length++;return}this.head.src0=A,this.head.src1=g,this.head.dest=B,this.tail=this.head,this._length=1,this._totalLength===0&&(this._totalLength=1)}clean(){let A=this.tail?.next??null;for(;A!==null&&A.src0!==null;)A.src0=null,A.src1=null,A.dest=null,A=A.next}next(){if(!this.pointer||this.tail===null)return{done:!0,value:void 0};const A=this.pointer,g=A.src0===null;return this.pointer=this.pointer.next,g?{done:!0,value:void 0}:{done:!1,value:A}}[Symbol.iterator](){return this.pointer=this.head,this}toArray(){const A=[];for(const g of this)A.push(g);return A}dump(){const A=[];let g=null;for(g=this.head;g!==null;g=g.next)A.push(g);return A}}class iU{byLevel;constructor(){this.byLevel=[]}reset(){for(const A of this.byLevel)A.reset()}clean(){for(const A of this.byLevel)A.clean()}}function aI(I,A,g){if(I.h0===null){const B=qI(g,A),{left:i,right:Q}=I;B.push(i,Q,I),aI(i,A+1,g),aI(Q,A+1,g)}}function qI(I,A){return I[A]===void 0&&(I[A]=new QU),I[A]}const EB=[KA.fromZero()];function oB(I){if(I>=EB.length){for(let A=EB.length;A<=I;A++)EB[A]=new jA(EB[A-1],EB[A-1]);EB[I].root}return EB[I]}function NC(I,A,g=0,B=null){const i=2**A;if(I.length>i)throw new Error(`nodes.length ${I.length} over maxIndex at depth ${A}`);if(I.length===0)return oB(A);if(A===0){const C=I[0];return B!==null&&aI(C,g,B),C}if(A===1){const C=I[0],e=I.length>1?I[1]:oB(0),o=new jA(C,e);return B!==null&&(aI(C,g+1,B),aI(e,g+1,B),qI(B,g).push(C,e,o)),o}let Q=I.length;for(let C=A;C>0;C--){const e=Q%2,o=Q-e,c=B?g+C-1:null;for(let a=0;a<o;a+=2){const f=I[a],R=I[a+1],y=new jA(f,R);I[a/2]=y,c!==null&&B!==null&&(qI(B,c).push(f,R,y),C===A&&(aI(f,c+1,B),aI(R,c+1,B)))}if(e>0){const a=I[o],f=oB(A-C),R=new jA(a,f);I[o/2]=R,c!==null&&B!==null&&(C===A&&aI(a,c+1,B),qI(B,c).push(a,f,R))}Q=o/2+e}return I[0]}const eU=2**32;function dC(I,A,g,B){const i=EU(A,g,B);return NC(i,I)}function tU(I){const A=new Array(Math.ceil(I.length/4));for(let g=0;g<I.length;g++){const B=Math.floor(g/4),i=A[B]??new KA(0,0,0,0,0,0,0,0),Q=2*(g%4),C=I[g];C===1/0?(lI(i,Q,4294967295),lI(i,Q+1,4294967295)):(lI(i,Q,C&4294967295),lI(i,Q+1,C/eU&4294967295)),A[B]=i}return A}function EU(I,A,g){const B=g-A,i=Math.floor(B/32),Q=new Array(Math.ceil(B/32));for(let e=0;e<i;e++){const o=A+e*32;Q[e]=new KA(I.getInt32(o+0,!0),I.getInt32(o+4,!0),I.getInt32(o+8,!0),I.getInt32(o+12,!0),I.getInt32(o+16,!0),I.getInt32(o+20,!0),I.getInt32(o+24,!0),I.getInt32(o+28,!0))}const C=B%32;if(C>0){const e=new KA(0,0,0,0,0,0,0,0);Q[i]=e;const o=Math.floor(C/4);for(let a=0;a<o;a++)lI(e,a,I.getInt32(A+i*32+a*4,!0));const c=B%4;if(c>0){let a=0;for(let f=0;f<c;f++)a|=I.getUint8(A+B-c+f)<<f*8;lI(e,o,a)}}return Q}function uC(I,A,g,B){const i=g%32,Q=Math.floor(g/32);for(let C=0;C<Q;C++){const e=B[C],o=A+C*32;I.setInt32(o+0,e.h0,!0),I.setInt32(o+4,e.h1,!0),I.setInt32(o+8,e.h2,!0),I.setInt32(o+12,e.h3,!0),I.setInt32(o+16,e.h4,!0),I.setInt32(o+20,e.h5,!0),I.setInt32(o+24,e.h6,!0),I.setInt32(o+28,e.h7,!0)}if(i>0){const C=B[Q],e=Math.floor(i/4);for(let c=0;c<e;c++)I.setInt32(A+Q*32+c*4,TI(C,c),!0);const o=g%4;if(o>0){const c=TI(C,e);for(let a=0;a<o;a++)I.setUint8(A+g-o+a,c>>a*8&255)}}}function oU(I){const A=new Set,g=new Set;let B=I;for(;B.length>1;){A.add(B);const i=B.at(-1),Q=B.substring(0,B.length-1);g.add(Q+(Number(i)^1)),B=Q}return{path:A,branch:g}}function rU(I,A){return I.length?I.map(g=>g.padEnd(A)).sort().map(g=>g.trim()):[]}function nU(I){return I.length?I.sort((A,g)=>{if(A.length<g.length)return 1;if(g.length<A.length)return-1;let B=A.indexOf("0"),i=g.indexOf("0");for(;;){if(B===-1)return-1;if(i===-1||B<i)return 1;if(i<B)return-1;B=A.indexOf("0",B+1),i=g.indexOf("0",i+1)}}):[]}function aU(I){const A=I.slice().sort((B,i)=>B.length-i.length),g=[];A:for(let B=0;B<A.length;B++){const i=A[B];for(let Q=B+1;Q<A.length;Q++)if(A[Q].startsWith(i))continue A;g.push(i)}return g}var mg;(function(I){I[I.InOrder=0]="InOrder",I[I.Decreasing=1]="Decreasing",I[I.Unsorted=2]="Unsorted"})(mg||(mg={}));function Be(I,A=!0,g=mg.InOrder){const B=aU(I),i=new Set(A?B:[]),Q=new Set,C=new Set;let e=1;for(const o of B){o.length>e&&(e=o.length);const{path:c,branch:a}=oU(o);for(const f of c)Q.add(f);for(const f of a)C.add(f)}for(const o of Q)C.delete(o);for(const o of C)i.add(o);switch(g){case mg.InOrder:return rU(Array.from(i),e);case mg.Decreasing:return nU(Array.from(i));case mg.Unsorted:return Array.from(i)}}function or(I,A){const g=A%8,B=Math.floor(A/8),i=I[B];switch(g){case 0:return(i&128)!==0;case 1:return(i&64)!==0;case 2:return(i&32)!==0;case 3:return(i&16)!==0;case 4:return(i&8)!==0;case 5:return(i&4)!==0;case 6:return(i&2)!==0;case 7:return(i&1)!==0;default:throw new Error("unreachable")}}function rr(I){const A=[],g=I.length*8;let B=0,i=0;for(let Q=0;Q<g;Q++){const C=or(I,Q);if(A.push(C),C?i++:B++,i>B){if(Q++,Q+7<g)throw new Error("Invalid descriptor: too many bytes");for(;Q<g;Q++)if(or(I,Q))throw new Error("Invalid descriptor: too many 1 bits");return A}}throw new Error("Invalid descriptor: not enough 1 bits")}function Ce(I,A,g){if(A[g])return[I.root];const B=Ce(I.left,A,g+1),i=Ce(I.right,A,g+B.length*2);return[...B,...i]}function Qe(I,A,g){return I[g.bitIndex++]?KA.fromRoot(A[g.leafIndex++]):new jA(Qe(I,A,g),Qe(I,A,g))}function sU(I,A){return Ce(I,rr(A),0)}function hU(I,A){const g=rr(A);if(g.length!==I.length*2-1)throw new Error("Invalid multiproof: invalid number of leaves");return Qe(g,I,{bitIndex:0,leafIndex:0})}const nr="Invalid tree navigation";function ar(I,A){const g=[];let B=I;for(const i of qc(A))if(i){if(B.isLeaf())throw new Error(nr);g.push(B.left.root),B=B.right}else{if(B.isLeaf())throw new Error(nr);g.push(B.right.root),B=B.left}return[B.root,g.reverse()]}function lU(I,A,g){let B=KA.fromRoot(A);const i=g.slice().reverse();for(;I>1;){const Q=KA.fromRoot(i.pop());I%BigInt(2)===BigInt(0)?B=new jA(B,Q):B=new jA(Q,B),I=I/BigInt(2)}return B}class NI{_rootNode;hook;constructor(A,g){this._rootNode=A,g&&(typeof WeakRef>"u"?this.hook=g:this.hook=new WeakRef(g))}get root(){return this.rootNode.root}get rootNode(){return this._rootNode}set rootNode(A){if(this._rootNode=A,this.hook)if(typeof WeakRef>"u")this.hook(A);else{const g=this.hook.deref();g?g(A):this.hook=void 0}}static createFromProof(A){return new NI(uU(A))}clone(){return new NI(this.rootNode)}getSubtree(A){return new NI(this.getNode(A),g=>this.setNode(A,g))}getNode(A){return RC(this.rootNode,A)}getNodeAtDepth(A,g){return mI(this.rootNode,A,g)}getRoot(A){return this.getNode(A).root}setNode(A,g){this.rootNode=DU(this.rootNode,A,g)}setNodeWithFn(A,g){this.rootNode=cU(this.rootNode,A,g)}setNodeAtDepth(A,g,B){this.rootNode=UU(this.rootNode,A,g,B)}setRoot(A,g){this.setNode(A,KA.fromRoot(g))}getNodesAtDepth(A,g,B){return tI(this.rootNode,A,g,B)}iterateNodesAtDepth(A,g,B){return fU(this.rootNode,A,g,B)}getSingleProof(A){return ar(this.rootNode,A)[1]}getProof(A){return cr(this.rootNode,A)}}function RC(I,A){const g=Wi(A);let B=I;for(let i=1;i<g.length;i++){if(B.isLeaf())throw new Error(`Invalid tree - found leaf at depth ${i}`);B=g[i]==="1"?B.right:B.left}return B}function DU(I,A,g){const B=Wi(A),i=sr(I,B);return hr(B,i,g)}function cU(I,A,g){const B=Wi(A),i=sr(I,B),Q=i.at(-1);if(!Q)throw new Error("Invalid tree - can not find last parent");const C=B.at(-1)==="1"?Q.right:Q.left,e=g(C);return hr(B,i,e)}function sr(I,A){let g=I;const B=[I];for(let i=1;i<A.length-1;i++)A[i]==="1"?g=g.right:g=g.left,B.push(g);return B}function hr(I,A,g){let B=g;for(let i=I.length-1;i>=1;i--)I[i]==="1"?B=new jA(A[i-1].left,B):B=new jA(B,A[i-1].right);return B}function mI(I,A,g){if(A===0)return I;if(A===1)return g===0?I.left:I.right;const B=A-1,i=0;let Q=I;for(let C=B;C>=i;C--)Q=rB(C,g)?Q.left:Q.right;return Q}function UU(I,A,g,B){return GC(I,A,[g],[B])}function GC(I,A,g,B,i=0,Q=null){if(A===0)return B.length>0?B[0]:I;const C=new Array(A),e=new Array(A),o=A-1,c=0;let a=o,f=I;C[o]=I;for(let R=0;R<g.length;R++){const y=g[R];for(let u=a;u>c;u--)f=rB(u,y)?f.left:f.right,C[u-1]=f;if(a=c,(y&1)!==1)if(y+1===g[R+1])f=new jA(B[R],B[R+1]),Q!=null&&qI(Q,A-1+i).push(B[R],B[R+1],f),R++;else{const u=f;f=new jA(B[R],u.right),Q!=null&&qI(Q,A-1+i).push(B[R],u.right,f)}else{const u=f;f=new jA(u.left,B[R]),Q!=null&&qI(Q,A-1+i).push(u.left,B[R],f)}const G=R>=g.length-1,S=G?o:SU(y,g[R+1]);for(let u=c+1;u<=S;u++){const N=A-u-1;if(N<0)throw Error(`Invalid depth ${N}, d=${u}, nodesDepth=${A}`);if(rB(u,y))if(G||u!==S){const w=f;f=new jA(w,C[u].right),Q!=null&&qI(Q,N+i).push(w,C[u].right,f)}else e[u]=f,f=C[u];else{const w=e[u];if(w!==void 0){const J=f;f=new jA(w,J),Q!=null&&qI(Q,N+i).push(w,J,f),e[u]=void 0}else{const J=f;f=new jA(C[u].left,J),Q!=null&&qI(Q,N+i).push(C[u].left,J,f)}}}a=S}return f}function tI(I,A,g,B){if(A===0)return g===0&&B>0?[I]:[];if(A===1)return B===0?[]:B===1?g===0?[I.left]:[I.right]:[I.left,I.right];const i=A-1,Q=0;let C=i,e=I;const o=new Array(A),c=new Array(A),a=new Array(B);o[i]=I;for(let f=0;f<B;f++){for(let R=C;R>=Q;R--){R!==C&&(o[R]=e);const y=rB(R,g+f);c[R]=y,e=y?e.left:e.right}a[f]=e;for(let R=Q;R<=i;R++)if(c[R]===!0){C=R;break}e=o[C]}return a}function*fU(I,A,g,B){const i=g+B,Q=A-1,C=0;let e=Q,o=I;const c=new Array(A),a=new Array(A);c[Q]=I;for(let f=g;f<i;f++){for(let R=e;R>=C;R--){R!==e&&(c[R]=o);const y=rB(R,f);a[R]=y,o=y?o.left:o.right}yield o;for(let R=C;R<=Q;R++)if(a[R]===!0){e=R;break}o=c[e]}}function lr(I,A,g){if(g<0)return oB(A);const B=new Array(A),i=A-1,Q=0;let C=i,e=I;B[i]=I;for(let o=C;o>=Q;o--)e=rB(o,g)?e.left:e.right,B[o-1]=e;C=Q;for(let o=Q;o<=i;o++)rB(o,g)?e=new jA(e,oB(o)):e=new jA(B[o].left,e);return e}const UQ=4294967295,Dr=2**32;function SU(I,A){if(I===A||I<0||A<0)throw Error(`Expect different positive inputs, from=${I} to=${A}`);const g=Math.ceil(Math.log2(I+1)),B=Math.ceil(Math.log2(A+1));if(g!==B)return Math.max(g,B)-1;if(g>32){const i=Math.floor(I/Dr)&UQ,Q=Math.floor(A/Dr)&UQ;return i===Q?ie(I&UQ,A&UQ):32+ie(i,Q)}return ie(I,A)}function rB(I,A){if(I>31){const B=A/4294967296>>>0,i=1<<I-32;return(B&i)!==i}const g=1<<I;return(A&g)!==g}function ie(I,A){const g=I^A;if(g===0)throw Error(`Do not support equal value from=${I} to=${A}`);return(g<0?32:Math.ceil(Math.log2(g+1)))-1}function wU(I,A){const g=new NI(I),B=Be(A.map(e=>e.toString(2)),!1,mg.Decreasing),i=A.slice().sort((e,o)=>e<o?1:-1),Q=i.map(e=>g.getRoot(e)),C=B.map(e=>g.getRoot(e));return[Q,C,i]}function yU(I,A,g){if(I.length!==g.length)throw new Error("Leaves length should equal gindices length");const B=g.map(o=>o.toString(2)),i=Be(B,!1,mg.Decreasing);if(i.length!==A.length)throw new Error("Witnesses length should equal witnesses gindices length");const Q=Math.max(B[0]?.length??0,i[0]?.length??0),C=Object.fromEntries(Array.from({length:Q},(o,c)=>[c+1,{}]));for(let o=0;o<B.length;o++){const c=B[o],a=I[o];C[c.length][c]=KA.fromRoot(a)}for(let o=0;o<i.length;o++){const c=i[o],a=A[o];C[c.length][c]=KA.fromRoot(a)}for(let o=Q;o>1;o--){const c=C[o],a=C[o-1];for(const f of Object.keys(c)){const R=c[f];if(!R)continue;const y=f.at(-1)==="0",G=f.substring(0,f.length-1),S=G+(y?"1":"0"),u=c[S];if(!u)throw new Error(`Sibling not found: ${S}`);const N=y?new jA(R,u):new jA(u,R);a[G]=N,delete c[f],delete c[S]}}const e=C[1][1];if(!e)throw new Error("Internal consistency error: no root found");return e}function ee(I,A,g){if(!g.length||!g[0].startsWith(A))return[[],[]];if(A===g[0])return g.shift(),[[],[I.root]];const[B,i]=ee(I.left,`${A}0`,g),[Q,C]=ee(I.right,`${A}1`,g);return[[i.length].concat(B,Q),i.concat(C)]}function te(I,A){if(!A.length)throw new Error("Proof must contain gt 0 leaves");if(A.length===1)return KA.fromRoot(A[0]);const g=I[0];return new jA(te(I.slice(1,g),A.slice(0,g)),te(I.slice(g),A.slice(g)))}function NU(I,A){return ee(I,"1",Be(A.map(g=>g.toString(2))))}function dU(I,A){return te(I,A)}var ZA;(function(I){I.single="single",I.treeOffset="treeOffset",I.multi="multi",I.compactMulti="compactMulti"})(ZA||(ZA={})),ZA.single,ZA.treeOffset,ZA.multi,ZA.compactMulti;function cr(I,A){switch(A.type){case ZA.single:{const[g,B]=ar(I,A.gindex);return{type:ZA.single,gindex:A.gindex,leaf:g,witnesses:B}}case ZA.treeOffset:{const[g,B]=NU(I,A.gindices);return{type:ZA.treeOffset,offsets:g,leaves:B}}case ZA.multi:{const[g,B,i]=wU(I,A.gindices);return{type:ZA.multi,leaves:g,witnesses:B,gindices:i}}case ZA.compactMulti:{const g=sU(I,A.descriptor);return{type:ZA.compactMulti,leaves:g,descriptor:A.descriptor}}default:throw new Error("Invalid proof type")}}function uU(I){switch(I.type){case ZA.single:return lU(I.gindex,I.leaf,I.witnesses);case ZA.treeOffset:return dU(I.offsets,I.leaves);case ZA.multi:return yU(I.leaves,I.witnesses,I.gindices);case ZA.compactMulti:return hU(I.leaves,I.descriptor);default:throw new Error("Invalid proof type")}}function RU(I,A,g){if(g<0)throw new Error(`Expect count to be non-negative, got ${g}`);return{finalized:(g>0?GU(A,g-1):[]).map(B=>RC(I,B).root),count:g}}function GU(I,A){if(A<0||I<0)throw new Error(`Expect index and depth to be non-negative, got ${A} and ${I}`);const g=Array.from({length:I+1},()=>0);let B=A+1;const i=[];for(;B>0;){const Q=Math.floor(Math.log2(B)),C=2**Q,e=I-Q,o=pg(e,BigInt(g[e]));i.push(o);for(let c=0;c<=Q;c++)g[e+c]+=Math.pow(2,c);B-=C}return i}const Lg=Symbol("ssz_cached_permanent_root");function Ee(I,A,g,B){const i=B&&A.length===32&&g===0?A:B?A.subarray(g,g+32):Uint8Array.prototype.slice.call(A,g,g+32);I[Lg]=i}function FU(I,A){return tB.digest64(I,A)}function ag(I){return I===0?0:Math.ceil(Math.log2(I))}function dI(I,A){return new Function("superClass",`return class ${A} extends superClass {}`)(I)}const oe=new Array(256);class sg{uint8Array;bitLen;constructor(A,g){if(this.uint8Array=A,this.bitLen=g,A.length!==Math.ceil(g/8))throw Error("BitArray uint8Array length does not match bitLen")}static fromBitLen(A){return new sg(new Uint8Array(Math.ceil(A/8)),A)}static fromSingleBit(A,g){const B=sg.fromBitLen(A);return B.set(g,!0),B}static fromBoolArray(A){const g=sg.fromBitLen(A.length);for(let B=0;B<A.length;B++)A[B]===!0&&g.set(B,!0);return g}clone(){return new sg(Uint8Array.prototype.slice.call(this.uint8Array,0),this.bitLen)}get(A){const g=Math.floor(A/8),B=1<<A%8;return(this.uint8Array[g]&B)===B}set(A,g){if(A>=this.bitLen)throw Error(`BitArray set bitIndex ${A} beyond bitLen ${this.bitLen}`);const B=Math.floor(A/8),i=1<<A%8;let Q=this.uint8Array[B];g?(Q|=i,this.uint8Array[B]=Q):(Q&i)===i&&(Q^=i,this.uint8Array[B]=Q)}mergeOrWith(A){if(A.bitLen!==this.bitLen)throw Error("Must merge BitArrays of same bitLen");for(let g=0;g<this.uint8Array.length;g++)this.uint8Array[g]=this.uint8Array[g]|A.uint8Array[g]}intersectValues(A){const g=[];if(A.length!==this.bitLen)throw Error(`Must not intersect values of length ${A.length} != bitLen ${this.bitLen}`);const B=Math.floor(this.bitLen/8),i=this.bitLen%8,Q=this.uint8Array;for(let C=0;C<B;C++){const e=fQ(Q[C]);for(let o=0;o<8;o++)e[o]&&g.push(A[C*8+o])}if(i>0){const C=fQ(Q[B]);for(let e=0;e<i;e++)C[e]&&g.push(A[B*8+e])}return g}getTrueBitIndexes(){const A=[],g=this.uint8Array;for(let B=0,i=g.length;B<i;B++){const Q=fQ(g[B]);for(let C=0;C<8;C++)Q[C]&&A.push(B*8+C)}return A}getSingleTrueBit(){let A=null;const g=this.uint8Array;for(let B=0,i=g.length;B<i;B++){if(g[B]===0)continue;const Q=fQ(g[B]);for(let C=0;C<8;C++)if(Q[C]===!0){if(A!==null)return null;A=B*8+C}}return A===null?null:A}toBoolArray(){const A=new Array(this.bitLen);for(let g=0;g<this.bitLen;g++)A[g]=this.get(g);return A}}function fQ(I){return oe[I]||(oe[I]=kU(I)),oe[I]}function kU(I){const A=I.toString(2),g=A.length,B=new Array(8);for(let i=0;i<8;i++)B[i]=i<g?A[g-i-1]==="1":!1;return B}function nB(I){return I.right.getUint(4,0)}function Ur(I){return I.left}function aB(I,A){return new jA(I,KA.fromUint32(A))}function fr(I,A,g,B=0,i=null){const Q=g!==null?KA.fromUint32(g):I.right,C=new jA(A,Q);return i!==null&&qI(i,B).push(A,Q,C),C}function SQ(I,A,g,B,i){const Q=I.byteLength;for(let C=0;C<A;C++)I.value_serializeToBytes(g,B+C*Q,i[C]);return B+A*Q}function Sr(I,A,g,B,i){const Q=I.byteLength,C=(B-g)/Q;wQ(C,i,!0);const e=new Array(C);for(let o=0;o<C;o++)e[o]=I.value_deserializeFromBytes(A,g+o*Q,g+(o+1)*Q);return e}function re(I,A,g,B,i,Q,C=null){const e=I.byteLength*A,o=Math.ceil(e/32),c=C??tI(Q,g,0,o);return uC(B.dataView,i,e,c),i+e}function wr(I,A,g,B,i,Q){const C=(i-B)/I.byteLength;wQ(C,Q,!0);const e=dC(A,g.dataView,B,i);return Q.isList?aB(e,C):e}function JU(I,A,g){if(!Array.isArray(A))throw Error("JSON is not an array");wQ(A.length,g);const B=new Array(A.length);for(let i=0;i<A.length;i++)B[i]=I.fromJson(A[i]);return B}function pU(I,A,g){const B=g.isList?A.length:g.length,i=new Array(B);for(let Q=0;Q<B;Q++)i[Q]=I.toJson(A[Q]);return i}function HU(I,A){const g=new Array(A.length);for(let B=0;B<A.length;B++)g[B]=I.clone(A[B]);return g}function MU(I,A,g){if(A.length!==g.length)return!1;for(let B=0;B<A.length;B++)if(!I.equals(A[B],g[B]))return!1;return!0}function mU(I,A){const g=new Array(A);for(let B=0;B<A;B++)g[B]=I.defaultValue();return g}function wQ(I,A,g){if(g&&I%1!==0)throw Error("size not multiple of element fixedSize");if(A.isList){if(I>A.limit)throw new Error(`Invalid list length ${I} over limit ${A.limit}`)}else if(I!==A.length)throw new Error(`Incorrect vector length ${I} expected ${A.length}`)}const ne=new Array(256);function yr(I){let A="0x";for(const g of I)ne[g]||(ne[g]=g<16?`0${g.toString(16)}`:g.toString(16)),A+=ne[g];return A}function Nr(I){if(typeof I!="string")throw new Error(`hex argument type ${typeof I} must be of type string`);if(I.startsWith("0x")&&(I=I.slice(2)),I.length%2!==0)throw new Error(`hex string length ${I.length} must be multiple of 2`);const A=I.length/2,g=new Uint8Array(A);for(let B=0;B<A;B++){const i=parseInt(I.slice(B*2,(B+1)*2),16);g[B]=i}return g}function hg(I,A){if(I.length!==A.length)return!1;for(let g=0;g<I.length;g++)if(I[g]!==A[g])return!1;return!0}class jB{serialize(){const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.type.tree_serializeToBytes({uint8Array:A,dataView:g},0,this.node),A}hashTreeRoot(){return this.node.root}createProof(A){return this.type.tree_createProof(this.node,A)}toValue(){return this.type.tree_toValue(this.node)}clone(){return this.type.getView(new NI(this.node))}}class LU extends jB{type;tree;bitArray;constructor(A,g){super(),this.type=A,this.tree=g,this.bitArray=A.tree_toValue(g.rootNode)}get node(){return this.tree.rootNode}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g),this.tree.rootNode=this.type.value_toTree(this.bitArray)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}}const dr=Symbol("ssz_cached_tree_root");class FC extends jB{serializeToBytes(A,g){return this.type.tree_serializeToBytes(A,g,this.node)}hashTreeRoot(){return this.commit(),super.hashTreeRoot()}batchHashTreeRoot(A=new iU){A.reset(),this.commit(0,A.byLevel),A.clean();const g=this.node[dr];if(g)return g;if(CU(A.byLevel),this.node.h0===null)throw Error("Root is not computed by batch");const B=this.node.root;return this.node[dr]=B,B}serialize(){this.commit();const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.serializeToBytes({uint8Array:A,dataView:g},0),A}clone(A){if(A)return this.type.getViewDU(this.node);const g=this.cache;return this.clearCache(),this.type.getViewDU(this.node,g)}}class KU extends FC{type;_rootNode;_bitArray=null;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get bitArray(){return this._bitArray===null&&(this._bitArray=this.type.tree_toValue(this._rootNode)),this._bitArray}commit(A=0,g=null){this._bitArray!==null&&(this._rootNode=this.type.value_toTree(this._bitArray)),g!==null&&this._rootNode.h0===null&&aI(this._rootNode,A,g)}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}clearCache(){this._bitArray=null}}function ur(I){return!I.isBasic}function yQ(I,A,g="",B=0){if(B===0){const e=A.tree_fromProofNode(I);if(e.done)return e.node;I=e.node}const i=A.depth===B;if(I.isLeaf()){if(i){const e=A.getIndexProperty(Rr(g));if(e===null)return I;const o=A.getPropertyType(e);return o.maxChunkCount===1&&ur(o)?o.tree_fromProofNode(I).node:I}return I}if(i){const e=A.getIndexProperty(Rr(g));if(e===null)return I;const o=A.getPropertyType(e);if(!ur(o))throw Error("BranchNode does not map to CompositeType");const c=o.tree_fromProofNode(I);return c.done?c.node:yQ(c.node,o)}const Q=yQ(I.left,A,`${g}0`,B+1),C=yQ(I.right,A,`${g}1`,B+1);return Q===I.left&&C===I.right?I:new jA(Q,C)}function Rr(I){return I===""?0:parseInt(I,2)}class Gr{value_toTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),this.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}tree_toValue(A){const g=new Uint8Array(this.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.tree_serializeToBytes({uint8Array:g,dataView:B},0,A),this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}serialize(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),g}deserialize(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.value_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}}const ae=BigInt(3);class NQ extends Gr{cachePermanentRootStruct;isBasic=!1;blocksBuffer=new Uint8Array(0);constructor(A){super(),this.cachePermanentRootStruct=A}defaultView(){return this.toView(this.defaultValue())}defaultViewDU(){return this.toViewDU(this.defaultValue())}deserializeToView(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getView(new NI(B))}deserializeToViewDU(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getViewDU(B)}toView(A){const g=this.value_toTree(A);return this.getView(new NI(g))}toViewDU(A){const g=this.value_toTree(A);return this.getViewDU(g)}toValueFromView(A){const g=this.commitView(A);return this.tree_toValue(g)}toValueFromViewDU(A){const g=this.commitViewDU(A);return this.tree_toValue(g)}toViewFromViewDU(A){const g=this.commitViewDU(A);return this.getView(new NI(g))}toViewDUFromView(A){const g=this.commitView(A);return this.getViewDU(g)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Lg];if(B)return B}const g=YB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,i=!1){if(this.cachePermanentRootStruct){const C=A[Lg];if(C){g.set(C,B);return}}const Q=this.getBlocksBytes(A);yC(Q,this.maxChunkCount,g,B),this.cachePermanentRootStruct&&Ee(A,g,B,i)}getCachedPermanentRoot(A){return A[Lg]}createFromProof(A,g){const B=NI.createFromProof(A).rootNode,i=yQ(B,this);if(g!==void 0&&!hg(i.root,g))throw new Error("Proof does not match trusted root");return this.getView(new NI(i))}tree_createProof(A,g){const B=this.tree_createProofGindexes(A,g);return cr(A,{type:ZA.treeOffset,gindices:B})}tree_createProofGindexes(A,g){const B=[];for(const i of g){const{type:Q,gindex:C}=this.getPathInfo(i);if(!lg(Q))B.push(C);else{const e=Q.tree_getLeafGindices(C,Q.fixedSize===null?RC(A,C):void 0);for(const o of e)B.push(o)}}return B}getPathInfo(A){const g=[];let B=this;for(const i of A){if(B.isBasic)throw new Error("Invalid path: cannot navigate beyond a basic type");const Q=B.getPropertyGindex(i);Q!==null&&(g.push(Q),B=B.getPropertyType(i))}return{type:B,gindex:ng(g)}}tree_fromProofNode(A){return{node:A,done:!1}}}function lg(I){return!I.isBasic}class Fr extends NQ{isViewMutable=!1;defaultValue(){return new Uint8Array(this.minSize)}getView(A){return this.getViewDU(A.rootNode)}getViewDU(A){return this.tree_toValue(A)}commitView(A){return this.commitViewDU(A)}commitViewDU(A,g=0,B=null){const i=new Uint8Array(this.value_serializedSize(A)),Q=new DataView(i.buffer,i.byteOffset,i.byteLength);this.value_serializeToBytes({uint8Array:i,dataView:Q},0,A);const C=this.tree_deserializeFromBytes({uint8Array:i,dataView:Q},0,i.length);return B!==null&&C.h0===null&&aI(C,g,B),C}cacheOfViewDU(){}toView(A){return A}toViewDU(A){return A}value_serializeToBytes(A,g,B){return A.uint8Array.set(B,g),g+B.length}value_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),Uint8Array.prototype.slice.call(A.uint8Array,g,B)}value_toTree(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}getBlocksBytes(A){if(A.length>this.blocksBuffer.length){const g=Math.ceil(A.length/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return kr(A,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request ByteArray complete data")}getIndexProperty(){throw Error("Must only request ByteArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),i=Math.ceil(B/32),Q=ng([A,pg(this.depth,BigInt(0))]),C=new Array(i);for(let e=0,o=Q;e<i;e++,o++)C[e]=o;return this.isList&&C.push(ng([A,ae])),C}fromJson(A){const g=Nr(A);return this.assertValidSize(g.length),g}toJson(A){return yr(A)}clone(A){return A}equals(A,g){return hg(A,g)}}function kr(I,A){if(I.length>A.length)throw new Error(`data length ${I.length} exceeds blocksBuffer length ${A.length}`);A.set(I);const g=I.length,B=Math.ceil(g/64)*64;return A.subarray(g,B).fill(0),A.subarray(0,B)}class Jr extends NQ{isViewMutable=!0;getView(A){return new LU(this,A)}getViewDU(A){return new KU(this,A)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}getBlocksBytes(A){if(A.uint8Array.length>this.blocksBuffer.length){const g=Math.ceil(A.bitLen/8/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return kr(A.uint8Array,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request BitArray complete data")}getIndexProperty(){throw Error("Must only request BitArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),i=Math.ceil(B/32),Q=ng([A,pg(this.depth,BigInt(0))]),C=new Array(i);for(let e=0,o=Q;e<i;e++,o++)C[e]=o;return this.isList&&C.push(ng([A,ae])),C}fromJson(A){const g=Nr(A),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}toJson(A){return yr(this.serialize(A))}clone(A){return A.clone()}equals(A,g){return A.bitLen===g.bitLen&&hg(A.uint8Array,g.uint8Array)}}class dQ extends Jr{limitBits;typeName;depth;chunkDepth;fixedSize=null;minSize=1;maxSize;maxChunkCount;isList=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBits=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`BitList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBits/8/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=1+this.chunkDepth,this.maxSize=Math.ceil(A/8)+1}static named(A,g){return new(dI(dQ,g.typeName))(A,g)}defaultValue(){return sg.fromBitLen(0)}value_serializedSize(A){return pr(A.bitLen)}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),Hr(A.uint8Array,g,B.bitLen)}value_deserializeFromBytes(A,g,B){const{uint8Array:i,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B);return new sg(i,Q)}tree_serializedSize(A){return pr(nB(A))}tree_serializeToBytes(A,g,B){const i=Ur(B),Q=nB(B),C=Math.ceil(Q/8),e=Math.ceil(C/32),o=tI(i,this.chunkDepth,0,e);return uC(A.dataView,g,C,o),Hr(A.uint8Array,g,Q)}tree_deserializeFromBytes(A,g,B){const{uint8Array:i,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B),C=new DataView(i.buffer,i.byteOffset,i.byteLength),e=dC(this.chunkDepth,C,0,i.length);return aB(e,Q)}tree_getByteLen(A){if(!A)throw new Error("BitListType requires a node to get leaves");return Math.ceil(nB(A)/8)}hashTreeRoot(A){const g=YB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.bitLen,32,6),yC(this.mixInLengthBlockBytes,2,g,B)}deserializeUint8ArrayBitListFromBytes(A,g,B){const{uint8Array:i,bitLen:Q}=YU(A,g,B);if(Q>this.limitBits)throw Error(`bitLen over limit ${Q} > ${this.limitBits}`);return{uint8Array:i,bitLen:Q}}}function YU(I,A,g){if(g>I.length)throw Error(`BitList attempting to read byte ${g} of data length ${I.length}`);const B=I[g-1],i=g-A;if(B===0)throw new Error("Invalid deserialized bitlist, padding bit required");if(B===1){const c=Uint8Array.prototype.slice.call(I,A,g-1),a=(i-1)*8;return{uint8Array:c,bitLen:a}}const Q=Uint8Array.prototype.slice.call(I,A,g),C=B.toString(2).length-1,e=(i-1)*8+C,o=255>>8-C;return Q[i-1]&=o,{uint8Array:Q,bitLen:e}}function pr(I){const A=Math.ceil(I/8);return I%8===0?A+1:A}function Hr(I,A,g){const B=Math.ceil(g/8),i=A+B;return g%8===0?(I[i]=1,i+1):(I[i-1]|=1<<g%8,i)}class $I extends Jr{lengthBits;typeName;chunkCount;depth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;zeroBitsMask;constructor(A,g){if(super(),this.lengthBits=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`BitVector[${A}]`,this.chunkCount=Math.ceil(this.lengthBits/8/32),this.maxChunkCount=this.chunkCount,this.depth=ag(this.chunkCount),this.fixedSize=Math.ceil(this.lengthBits/8),this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.zeroBitsMask=A%8===0?0:255&255<<A%8}static named(A,g){return new(dI($I,g.typeName))(A,g)}defaultValue(){return sg.fromBitLen(this.lengthBits)}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),g+this.fixedSize}value_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),new sg(Uint8Array.prototype.slice.call(A.uint8Array,g,B),this.lengthBits)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const i=tI(B,this.depth,0,this.chunkCount);return uC(A.dataView,g,this.fixedSize,i),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),dC(this.depth,A.dataView,g,B)}tree_getByteLen(){return this.fixedSize}assertValidLength(A,g,B){const i=B-g;if(B-g!==this.fixedSize)throw Error(`Invalid BitVector size ${i} != ${this.fixedSize}`);if(this.zeroBitsMask>0&&(A[B-1]&this.zeroBitsMask)>0)throw Error("BitVector: nonzero bits past length")}}class uQ extends Gr{isBasic=!0;depth=0;maxChunkCount=1;value_serializedSize(){return this.byteLength}tree_serializedSize(){return this.byteLength}assertValidSize(A){if(A!==this.byteLength)throw Error(`BasicType invalid size ${A} expected ${this.byteLength}`)}hashTreeRoot(A){const g=new Uint8Array(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){const i=g.subarray(B,B+32);i.fill(0);const Q=new DataView(i.buffer,i.byteOffset,i.byteLength);this.value_serializeToBytes({uint8Array:i,dataView:Q},0,A)}clone(A){return A}equals(A,g){return A===g}}function se(I){return I.isBasic}class he extends uQ{typeName;byteLength=1;itemsPerChunk=32;fixedSize=1;minSize=1;maxSize=1;constructor(A){super(),this.typeName=A?.typeName??"boolean"}static named(A){return new(dI(he,A.typeName))(A)}defaultValue(){return!1}value_serializeToBytes(A,g,B){return A.uint8Array[g]=B?1:0,g+1}value_deserializeFromBytes(A,g,B){switch(this.assertValidSize(B-g),A.uint8Array[g]){case 1:return!0;case 0:return!1;default:throw new Error(`Boolean: invalid value: ${A.uint8Array[g]}`)}}tree_serializeToBytes(A,g,B){return A.uint8Array[g]=B.getUint(4,0),g+1}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const i=A.uint8Array[g];if(i>1)throw Error(`Boolean: invalid value ${i}`);return KA.fromUint32(i)}tree_getFromNode(A){return A.getUint(4,0)===1}tree_setToNode(A,g){A.setUint(4,0,g?1:0)}tree_getFromPackedNode(A,g){const B=g%this.itemsPerChunk;return A.getUint(1,B)!==0}tree_setToPackedNode(A,g,B){const i=g%this.itemsPerChunk;A.setUint(1,i,B?1:0)}fromJson(A){if(typeof A!="boolean")throw Error(`JSON invalid type ${typeof A} expected boolean`);return A}toJson(A){return A}}class kC extends Fr{limitBytes;typeName;depth;chunkDepth;fixedSize=null;minSize;maxSize;maxChunkCount;isList=!0;blockArray=[];blockBytesLen=0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBytes=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`ByteList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBytes/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=1+this.chunkDepth,this.minSize=0,this.maxSize=this.limitBytes}static named(A,g){return new(dI(kC,g.typeName))(A,g)}value_serializedSize(A){return A.length}tree_serializedSize(A){return nB(A)}tree_serializeToBytes(A,g,B){const i=Ur(B),Q=nB(B),C=Math.ceil(Q/32),e=tI(i,this.chunkDepth,0,C);return uC(A.dataView,g,Q,e),g+Q}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const i=dC(this.chunkDepth,A.dataView,g,B);return aB(i,B-g)}tree_getByteLen(A){if(!A)throw new Error("ByteListType requires a node to get leaves");return nB(A)}hashTreeRoot(A){const g=YB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){if(A.length>this.blockBytesLen){const Q=Math.ceil(A.length/64),C=Math.ceil(this.blockBytesLen/64),e=Q-C,o=new Uint8Array(e*64);for(let c=0;c<e;c++)this.blockArray.push(o.subarray(c*64,(c+1)*64)),this.blockBytesLen+=64}for(let Q=0;Q<A.length;Q+=64){const C=this.blockArray[Q/64];Q+64>A.length&&C.fill(0),C.set(A.subarray(Q,Math.min(Q+64,A.length)))}const i=Math.ceil(A.length/64);tr(this.blockArray,i,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),yC(this.mixInLengthBlockBytes,2,g,B)}assertValidSize(A){if(A>this.limitBytes)throw Error(`ByteList invalid size ${A} limit ${this.limitBytes}`)}}class uI extends Fr{lengthBytes;typeName;depth;chunkDepth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;constructor(A,g){if(super(),this.lengthBytes=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`ByteVector[${A}]`,this.maxChunkCount=Math.ceil(this.lengthBytes/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=this.lengthBytes,this.minSize=this.fixedSize,this.maxSize=this.fixedSize}static named(A,g){return new(dI(uI,g.typeName))(A,g)}value_serializedSize(){return this.fixedSize}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const i=tI(B,this.chunkDepth,0,this.maxChunkCount);return uC(A.dataView,g,this.fixedSize,i),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),dC(this.chunkDepth,A.dataView,g,B)}tree_getByteLen(){return this.lengthBytes}assertValidSize(A){if(A!==this.lengthBytes)throw Error(`ByteVector invalid size ${A} expected ${this.lengthBytes}`)}}const Mr={snake:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1].toLowerCase()}`),constant:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1]}`).toUpperCase(),pascal:I=>(I[0].toUpperCase()+I.slice(1)).replace(/[^0-z]/g,""),camel:I=>I[0].toLowerCase()+I.slice(1),header:I=>I[0].toUpperCase()+I.slice(1).replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}-${A[1]}`),eth2:I=>Mr.snake(I).replace(/(\d)$/,"_$1")};let bU=class extends jB{type;tree;constructor(I,A){super(),this.type=I,this.tree=A}get node(){return this.tree.rootNode}};function TU(I){class A extends bU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(se(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=mI(this.node,this.type.depth,g);return i.tree_getFromNode(Q)},set:function(Q){const C=mI(this.node,this.type.depth,g).clone();i.tree_setToNode(C,Q),this.tree.setNodeAtDepth(this.type.depth,g,C)}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=vi(this.type.depth,g);return i.getView(this.tree.getSubtree(Q))},set:function(Q){const C=i.commitView(Q);this.tree.setNodeAtDepth(this.type.depth,g,C)}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class qU extends FC{type;_rootNode;nodes=[];caches;nodesChanged=new Set;viewsChanged=new Map;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this.nodesPopulated=!1)}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,nodesPopulated:this.nodesPopulated}}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0&&this.viewsChanged.size===0){!B&&g!==null&&aI(this._rootNode,A,g);return}const i=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[a,f]of this.viewsChanged){const R=this.type.fieldsEntries[a].fieldType,y=R.commitViewDU(f,i,Q);this.nodes[a]!==y&&(this.nodes[a]=y,C.push({index:a,node:y}));const G=R.cacheOfViewDU(f);G&&(this.caches[a]=G)}for(const a of this.nodesChanged)C.push({index:a,node:this.nodes[a]});const e=C.sort((a,f)=>a.index-f.index),{indexes:o,nodes:c}=this.parseNodesChanged(e);this._rootNode=GC(this._rootNode,this.type.depth,o,c,A,B?g:null),!B&&g!==null&&aI(this._rootNode,A,g),this.nodesChanged.clear(),this.viewsChanged.clear()}parseNodesChanged(A){const g=A.map(i=>i.index),B=A.map(i=>i.node);return{indexes:g,nodes:B}}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.viewsChanged.clear()}}class VU extends qU{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}serializeToBytes(A,g){this.commit();let B=g,i=g+this.type.fixedEnd;for(let Q=0;Q<this.type.fieldsEntries.length;Q++){const{fieldType:C}=this.type.fieldsEntries[Q];let e=this.nodes[Q];if(e===void 0&&(e=mI(this._rootNode,this.type.depth,Q),this.nodes[Q]=e),C.fixedSize===null){if(A.dataView.setUint32(B,i-g,!0),B+=4,lg(C)){const o=C.getViewDU(e,this.caches[Q]);o.serializeToBytes!==void 0?i=o.serializeToBytes(A,i):i=C.tree_serializeToBytes(A,i,e)}}else B=C.tree_serializeToBytes(A,B,e)}return i}}function jU(I){class A extends VU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(se(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){let Q=this.nodes[g];return Q===void 0&&(Q=mI(this._rootNode,this.type.depth,g),this.nodes[g]=Q),i.tree_getFromNode(Q)},set:function(Q){let C;this.nodesChanged.has(g)?C=this.nodes[g]:(C=(this.nodes[g]??mI(this._rootNode,this.type.depth,g)).clone(),this.nodes[g]=C,this.nodesChanged.add(g)),i.tree_setToNode(C,Q)}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.viewsChanged.get(g);if(Q)return Q;let C=this.nodes[g];C===void 0&&(C=mI(this._rootNode,this.type.depth,g),this.nodes[g]=C);const e=i.getViewDU(C,this.caches[g]);return i.isViewMutable&&this.viewsChanged.set(g,e),e},set:function(Q){this.viewsChanged.set(g,Q)}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class Y extends NQ{fields;opts;typeName;depth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;fieldsEntries;fixedEnd;fieldsGindex;jsonKeyToFieldName;isFixedLen;fieldRangesFixedLen;variableOffsetsPosition;TreeView;TreeViewDU;constructor(A,g){super(g?.cachePermanentRootStruct),this.fields=A,this.opts=g,this.typeName=g?.typeName??mr(A),this.maxChunkCount=Object.keys(A).length,this.depth=ag(this.maxChunkCount),this.fieldsEntries=[];for(const f of Object.keys(A))this.fieldsEntries.push({fieldName:f,fieldType:this.fields[f],jsonKey:OU(f,g?.casingMap,g?.jsonCase),gindex:pg(this.depth,BigInt(this.fieldsEntries.length))});if(this.fieldsEntries.length===0)throw Error("Container must have > 0 fields");this.fieldsGindex={};for(let f=0;f<this.fieldsEntries.length;f++)this.fieldsGindex[this.fieldsEntries[f].fieldName]=pg(this.depth,BigInt(f));this.jsonKeyToFieldName={};for(const{fieldName:f,jsonKey:R}of this.fieldsEntries)this.jsonKeyToFieldName[R]=f;const{minLen:B,maxLen:i,fixedSize:Q}=PU(A);this.minSize=B,this.maxSize=i,this.fixedSize=Q;const{isFixedLen:C,fieldRangesFixedLen:e,variableOffsetsPosition:o,fixedEnd:c}=_U(A);this.isFixedLen=C,this.fieldRangesFixedLen=e,this.variableOffsetsPosition=o,this.fixedEnd=c,this.TreeView=g?.getContainerTreeViewClass?.(this)??TU(this),this.TreeViewDU=g?.getContainerTreeViewDUClass?.(this)??jU(this);const a=this.fieldsEntries.length*32;this.blocksBuffer=new Uint8Array(Math.ceil(a/64)*64)}static named(A,g){return new(dI(Y,g.typeName))(A,g)}defaultValue(){const A={};for(const{fieldName:g,fieldType:B}of this.fieldsEntries)A[g]=B.defaultValue();return A}getView(A){return new this.TreeView(this,A)}getViewDU(A,g){return new this.TreeViewDU(this,A,g)}cacheOfViewDU(A){return A.cache}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}value_serializedSize(A){let g=0;for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q}=this.fieldsEntries[B];g+=Q.fixedSize===null?4+Q.value_serializedSize(A[i]):Q.fixedSize}return g}value_serializeToBytes(A,g,B){let i=g,Q=g+this.fixedEnd;for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:e,fieldType:o}=this.fieldsEntries[C];o.fixedSize===null?(A.dataView.setUint32(i,Q-g,!0),i+=4,Q=o.value_serializeToBytes(A,Q,B[e])):i=o.value_serializeToBytes(A,i,B[e])}return Q}value_deserializeFromBytes(A,g,B){const i=this.getFieldRanges(A.dataView,g,B),Q={};for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:e,fieldType:o}=this.fieldsEntries[C],c=i[C];Q[e]=o.value_deserializeFromBytes(A,g+c.start,g+c.end)}return Q}tree_serializedSize(A){let g=0;const B=tI(A,this.depth,0,this.fieldsEntries.length);for(let i=0;i<this.fieldsEntries.length;i++){const{fieldType:Q}=this.fieldsEntries[i],C=B[i];g+=Q.fixedSize===null?4+Q.tree_serializedSize(C):Q.fixedSize}return g}tree_serializeToBytes(A,g,B){let i=g,Q=g+this.fixedEnd;const C=tI(B,this.depth,0,this.fieldsEntries.length);for(let e=0;e<this.fieldsEntries.length;e++){const{fieldType:o}=this.fieldsEntries[e],c=C[e];o.fixedSize===null?(A.dataView.setUint32(i,Q-g,!0),i+=4,Q=o.tree_serializeToBytes(A,Q,c)):i=o.tree_serializeToBytes(A,i,c)}return Q}tree_deserializeFromBytes(A,g,B){const i=this.getFieldRanges(A.dataView,g,B),Q=new Array(this.fieldsEntries.length);for(let C=0;C<this.fieldsEntries.length;C++){const{fieldType:e}=this.fieldsEntries[C],o=i[C];Q[C]=e.tree_deserializeFromBytes(A,g+o.start,g+o.end)}return NC(Q,this.depth)}getBlocksBytes(A){for(let g=0;g<this.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=this.fieldsEntries[g];i.hashTreeRootInto(A[B],this.blocksBuffer,g*32)}return this.blocksBuffer}getPropertyGindex(A){const g=this.fieldsGindex[A]??this.fieldsGindex[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getPropertyType(A){const g=this.fields[A]??this.fields[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getIndexProperty(A){return A>=this.fieldsEntries.length?null:this.fieldsEntries[A].fieldName}tree_getLeafGindices(A,g){const B=[];for(let i=0;i<this.fieldsEntries.length;i++){const{fieldName:Q,fieldType:C}=this.fieldsEntries[i],e=this.fieldsGindex[Q],o=ng([A,e]);if(C.isBasic)B.push(o);else{const c=C;if(C.fixedSize===null){if(!g)throw new Error("variable type requires tree argument to get leaves");B.push(...c.tree_getLeafGindices(o,RC(g,e)))}else B.push(...c.tree_getLeafGindices(o))}}return B}fromJson(A){if(typeof A!="object")throw Error("JSON must be of type object");if(A===null)throw Error("JSON must not be null");const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q,jsonKey:C}=this.fieldsEntries[B],e=A[C];if(e===void 0)throw Error(`JSON expected key ${C} is undefined`);g[i]=Q.fromJson(e)}return g}toJson(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q,jsonKey:C}=this.fieldsEntries[B];g[C]=Q.toJson(A[i])}return g}clone(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q}=this.fieldsEntries[B];g[i]=Q.clone(A[i])}return g}equals(A,g){for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:i,fieldType:Q}=this.fieldsEntries[B];if(!Q.equals(A[i],g[i]))return!1}return!0}getFieldRanges(A,g,B){if(this.variableOffsetsPosition.length===0){const o=B-g;if(o!==this.fixedEnd)throw Error(`${this.typeName} size ${o} not equal fixed size ${this.fixedEnd}`);return this.fieldRangesFixedLen}const i=ZU(A,g,B,this.fixedEnd,this.variableOffsetsPosition);i.push(B-g);let Q=0,C=0;const e=new Array(this.isFixedLen.length);for(let o=0;o<this.isFixedLen.length;o++)this.isFixedLen[o]?e[o]=this.fieldRangesFixedLen[C++]:(e[o]={start:i[Q],end:i[Q+1]},Q++);return e}}function ZU(I,A,g,B,i){const Q=g-A,C=new Array(i.length);for(let e=0;e<i.length;e++){const o=I.getUint32(A+i[e],!0);if(o>Q)throw new Error(`Offset out of bounds ${o} > ${Q}`);if(e===0){if(o!==B)throw new Error(`First offset must equal to fixedEnd ${o} != ${B}`)}else if(o<C[e-1])throw new Error(`Offsets must be increasing ${o} < ${C[e-1]}`);C[e]=o}return C}function _U(I){const A=[],g=[],B=[];let i=0;for(const Q of Object.values(I))A.push(Q.fixedSize!==null),Q.fixedSize===null?(B.push(i),i+=4):(g.push({start:i,end:i+Q.fixedSize}),i+=Q.fixedSize);return{isFixedLen:A,fieldRangesFixedLen:g,variableOffsetsPosition:B,fixedEnd:i}}function PU(I){let A=0,g=0,B=0;for(const i of Object.values(I))A+=i.minSize,g+=i.maxSize,i.fixedSize===null?(A+=4,g+=4,B=null):B!==null&&(B+=i.fixedSize);return{minLen:A,maxLen:g,fixedSize:B}}function OU(I,A,g){if(A){const B=A[I];if(B===void 0)throw Error(`casingMap[${String(I)}] not defined`);return B}return g?Mr[g](I):I}function mr(I,A="Container"){const g=Object.keys(I).map(B=>`${String(B)}: ${I[B].typeName}`).join(", ");return`${A}({${g}})`}class JC extends Ie{valueToNode;value;constructor(A,g){super(null,0,0,0,0,0,0,0),this.valueToNode=A,this.value=g}get rootHashObject(){if(this.h0===null){const A=this.valueToNode(this.value);super.applyHash(A.rootHashObject)}return this}get root(){return SC(this.rootHashObject)}get left(){return this.valueToNode(this.value).left}get right(){return this.valueToNode(this.value).right}isLeaf(){return!1}}class xU extends jB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get node(){return this.tree.rootNode}}function zU(I){class A extends xU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(i.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return this.tree.rootNode.value[B]},set:function(Q){const C=this.tree.rootNode,e=this.type.clone(C.value);e[B]=Q,this.tree.rootNode=new JC(C.valueToNode,e)}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const{value:Q}=this.tree.rootNode;return i.toView(Q[B])},set:function(Q){const C=this.tree.rootNode,e=this.type.clone(C.value);e[B]=i.toValueFromView(Q),this.tree.rootNode=new JC(C.valueToNode,e)}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class vU extends FC{type;valueChanged=null;_rootNode;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get value(){return this.valueChanged??this._rootNode.value}commit(A,g=null){if(this.valueChanged!==null){const B=this.valueChanged;this.valueChanged=null,this._rootNode=this.type.value_toTree(B)}this._rootNode.h0===null&&g!==null&&this._rootNode.rootHashObject}clearCache(){this.valueChanged=null}}function WU(I){class A extends vU{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:i}=I.fieldsEntries[g];if(i.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return(this.valueChanged||this._rootNode.value)[B]},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value)),this.valueChanged[B]=Q}});else if(lg(i))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.valueChanged||this._rootNode.value;return i.toViewDU(Q[B])},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value));const C=i.toValueFromViewDU(Q);this.valueChanged[B]=C}});else throw Error(`Unknown fieldType ${i.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class XU extends Y{fields;constructor(A,g){super(A,{typeName:g?.typeName??mr(A,"ContainerNodeStruct"),...g,getContainerTreeViewClass:zU,getContainerTreeViewDUClass:WU}),this.fields=A;for(const{fieldName:B,fieldType:i}of this.fieldsEntries)if(lg(i)&&i.isViewMutable)throw Error(`ContainerNodeStructType field '${String(B)}' ${i.typeName} view is mutable`)}static named(A,g){return new(dI(Y,g.typeName))(A,g)}tree_serializedSize(A){return this.value_serializedSize(A.value)}tree_serializeToBytes(A,g,B){const{value:i}=B;return this.value_serializeToBytes(A,g,i)}tree_deserializeFromBytes(A,g,B){const i=this.value_deserializeFromBytes(A,g,B);return new JC(this.valueToTree.bind(this),i)}getPropertyGindex(){return null}tree_fromProofNode(A){const g=new Uint8Array(super.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);super.tree_serializeToBytes({uint8Array:g,dataView:B},0,A);const i=this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length);return{node:new JC(this.valueToTree.bind(this),i),done:!0}}tree_toValue(A){return A.value}value_toTree(A){return new JC(this.valueToTree.bind(this),A)}valueToTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),super.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}}class Lr extends jB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=Math.floor(A/this.type.itemsPerChunk),B=this.tree.getNodeAtDepth(this.type.depth,g);return this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const i=Math.floor(A/this.type.itemsPerChunk),Q=this.tree.getNodeAtDepth(this.type.depth,i).clone();this.type.elementType.tree_setToPackedNode(Q,A,g),this.tree.setNodeAtDepth(this.type.depth,i,Q)}getAll(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),i=Math.ceil(g/this.type.itemsPerChunk),Q=tI(B,this.type.chunkDepth,0,i);A=A??new Array(g);const C=this.type.itemsPerChunk,e=Math.floor(g/C),o=g%C;for(let c=0;c<e;c++){const a=Q[c];for(let f=0;f<C;f++)A[c*C+f]=this.type.elementType.tree_getFromPackedNode(a,f)}if(o>0){const c=Q[e];for(let a=0;a<o;a++)A[e*C+a]=this.type.elementType.tree_getFromPackedNode(c,a)}return A}}class $U extends Lr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");if(this.type.tree_setLength(this.tree,g+1),g%this.type.itemsPerChunk===0){const B=KA.fromZero();this.type.elementType.tree_setToPackedNode(B,g,A);const i=Math.floor(g/this.type.itemsPerChunk);this.tree.setNodeAtDepth(this.type.depth,i,B)}else this.set(g,A)}}class Kr extends FC{type;_rootNode;nodes;nodesChanged=new Set;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=!1)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=Math.floor(A/this.type.itemsPerChunk);let B=this.nodes[g];return B===void 0&&(B=mI(this._rootNode,this.type.depth,g),this.nodes[g]=B),this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);const B=Math.floor(A/this.type.itemsPerChunk);let i;this.nodesChanged.has(B)?i=this.nodes[B]:(i=(this.nodes[B]??mI(this._rootNode,this.type.depth,B)).clone(),this.nodes[B]=i,this.nodesChanged.add(B)),this.type.elementType.tree_setToPackedNode(i,A,g)}getAll(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);if(!this.nodesPopulated){const Q=this.nodes,C=this.type.tree_getChunksNode(this.node),e=Math.ceil(this._length/this.type.itemsPerChunk);this.nodes=tI(C,this.type.chunkDepth,0,e);for(const o of this.nodesChanged)this.nodes[o]=Q[o];this.nodesPopulated=!0}A=A??new Array(this._length);const g=this.type.itemsPerChunk,B=Math.floor(this._length/g),i=this._length%g;for(let Q=0;Q<B;Q++){const C=this.nodes[Q];for(let e=0;e<g;e++)A[Q*g+e]=this.type.elementType.tree_getFromPackedNode(C,e)}if(i>0){const Q=this.nodes[B];for(let C=0;C<i;C++)A[B*g+C]=this.type.elementType.tree_getFromPackedNode(Q,C)}return A}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0){!B&&g!==null&&aI(this._rootNode,A,g);return}const i=Array.from(this.nodesChanged.keys()).sort((a,f)=>a-f),Q=new Array(i.length);for(let a=0;a<i.length;a++)Q[a]=this.nodes[i[a]];const C=this.type.tree_getChunksNode(this._rootNode),e=A+this.type.tree_chunksNodeOffset(),o=g!=null&&B?g:null,c=GC(C,this.type.chunkDepth,i,Q,e,o);this._rootNode=this.type.tree_setChunksNode(this._rootNode,c,this.dirtyLength?this._length:null,A,B?g:null),!B&&g!==null&&aI(this._rootNode,A,g),this.nodesChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}}class Af extends Kr{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;if(g%this.type.itemsPerChunk===0){const B=Math.floor(g/this.type.itemsPerChunk);this.nodes[B]=oB(0)}this.set(g,A)}sliceTo(A){if(A<0)throw new Error(`Does not support sliceTo() with negative index ${A}`);if(this.commit(),A>=this._length-1)return this;const g=this._rootNode,B=Math.floor(A/this.type.itemsPerChunk),i=this.nodes[B]??mI(g,this.type.depth,B),Q=KA.fromZero();for(let a=B*this.type.itemsPerChunk;a<=A;a++){const f=this.type.elementType.tree_getFromPackedNode(i,a);this.type.elementType.tree_setToPackedNode(Q,a,f)}const C=this.type.tree_getChunksNode(this._rootNode);let e=GC(C,this.type.chunkDepth,[B],[Q]);e=lr(e,this.type.chunkDepth,B);const o=A+1,c=this.type.tree_setChunksNode(g,e,o);return this.type.getViewDU(c)}serializeToBytes(A,g){this.commit();const{nodes:B,nodesPopulated:i}=this.cache,Q=this.type.tree_getChunksNode(this._rootNode);return re(this.type.elementType,this._length,this.type.chunkDepth,A,g,Q,i?B:null)}}class RQ extends NQ{elementType;constructor(A,g){super(g),this.elementType=A}defaultValue(){return mU(this.elementType,this.defaultLen)}getPropertyType(){return this.elementType}getPropertyGindex(A){if(typeof A!="number")throw Error(`Invalid array index: ${A}`);const g=Math.floor(A/this.itemsPerChunk);return pg(this.depth,BigInt(g))}getIndexProperty(A){return A}tree_getLeafGindices(A,g){let B;if(this.isList){if(!g)throw new Error("List type requires tree argument to get leaves");B=this.tree_getLength(g)}else B=this.tree_getLength(null);const i=[];if(lg(this.elementType)){const Q=pg(this.depth,BigInt(0)),C=Q+BigInt(B),e=ng([A,Q]);if(this.elementType.fixedSize===null){if(!g)throw new Error("Array of variable size requires tree argument to get leaves");for(let o=Q,c=e;o<C;o++,c++)i.push(...this.elementType.tree_getLeafGindices(c,RC(g,o)))}else for(let o=0,c=e;o<B;o++,c++)i.push(...this.elementType.tree_getLeafGindices(c))}else{const Q=Math.ceil(B/this.itemsPerChunk),C=ng([A,pg(this.depth,BigInt(0))]),e=C+BigInt(Q);for(let o=C;o<e;o++)i.push(o)}return this.isList&&i.push(ng([A,ae])),i}fromJson(A){return JU(this.elementType,A,this)}toJson(A){return pU(this.elementType,A,this)}clone(A){return HU(this.elementType,A)}equals(A,g){return MU(this.elementType,A,g)}}class LI extends RQ{elementType;limit;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(this.limit*A.byteLength/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=this.limit*A.maxSize}static named(A,g,B){return new(dI(LI,B.typeName))(A,g,B)}getView(A){return new $U(this,A)}getViewDU(A,g){return new Af(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return A.length*this.elementType.byteLength}value_serializeToBytes(A,g,B){return SQ(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Sr(this.elementType,A,g,B,this)}tree_serializedSize(A){return this.tree_getLength(A)*this.elementType.byteLength}tree_serializeToBytes(A,g,B){const i=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return re(this.elementType,Q,this.chunkDepth,A,g,i)}tree_deserializeFromBytes(A,g,B){return wr(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return A.right.getUint(4,0)}tree_setLength(A,g){A.rootNode=aB(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,i=0,Q=null){return fr(A,g,B,i,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Lg];if(B)return B}const g=YB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,i=!1){if(this.cachePermanentRootStruct){const Q=A[Lg];if(Q){g.set(Q,B);return}}super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),yC(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&Ee(A,g,B,i)}getBlocksBytes(A){const g=this.value_serializedSize(A),B=Math.ceil(g/64)*64;g>this.blocksBuffer.length&&(this.blocksBuffer=new Uint8Array(B));const i=this.blocksBuffer.subarray(0,B),Q=i.subarray(0,g),C=new DataView(Q.buffer,Q.byteOffset,Q.byteLength);return SQ(this.elementType,A.length,{uint8Array:Q,dataView:C},0,A),this.blocksBuffer.subarray(g,B).fill(0),i}}class Yr extends jB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=vi(this.type.depth,A),B=this.tree.getSubtree(g);return this.type.elementType.getView(B)}getReadonly(A){const g=vi(this.type.depth,A),B=new NI(this.tree.getNode(g));return this.type.elementType.getView(B)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const i=this.type.elementType.commitView(g);this.tree.setNodeAtDepth(this.type.depth,A,i)}getAllReadonly(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} views, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),i=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.getView(new NI(i[Q]));return A}getAllReadonlyValues(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),i=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.tree_toValue(i[Q]);return A}}class If extends Yr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");this.type.tree_setLength(this.tree,g+1),this.set(g,A)}}function gf(I,A){return I.fixedSize===null?A*(4+I.minSize):A*I.minSize}function br(I,A){return I.fixedSize===null?A*(4+I.maxSize):A*I.maxSize}function Tr(I,A,g){if(I.fixedSize===null){let B=0;for(let i=0;i<A;i++)B+=4+I.value_serializedSize(g[i]);return B}return A*I.fixedSize}function qr(I,A,g,B,i){if(I.fixedSize===null){let Q=B+A*4;for(let C=0;C<A;C++)g.dataView.setUint32(B+C*4,Q-B,!0),Q=I.value_serializeToBytes(g,Q,i[C]);return Q}for(let Q=0;Q<A;Q++)I.value_serializeToBytes(g,B+Q*I.fixedSize,i[Q]);return B+A*I.fixedSize}function Vr(I,A,g,B,i){const Q=_r(I.fixedSize,A.dataView,g,B,i),C=Q.length,e=new Array(C);for(let o=0;o<C;o++){const c=g+Q[o],a=o===C-1?B:g+Q[o+1];e[o]=I.value_deserializeFromBytes(A,c,a)}return e}function jr(I,A,g,B){if(I.fixedSize===null){const i=tI(B,g,0,A);let Q=0;for(let C=0;C<i.length;C++)Q+=4+I.tree_serializedSize(i[C]);return Q}return A*I.fixedSize}function le(I,A,g,B,i,Q,C=null){const e=C??tI(B,g,0,A);if(I.fixedSize===null){let o=Q+A*4;const{dataView:c}=i;for(let a=0;a<e.length;a++)c.setUint32(Q+a*4,o-Q,!0),o=I.tree_serializeToBytes(i,o,e[a]);return o}for(let o=0;o<e.length;o++)Q=I.tree_serializeToBytes(i,Q,e[o]);return Q}function Zr(I,A,g,B,i,Q){const C=_r(I.fixedSize,g.dataView,B,i,Q),e=C.length,o=new Array(e);for(let a=0;a<e;a++){const f=B+C[a],R=a===e-1?i:B+C[a+1];o[a]=I.tree_deserializeFromBytes(g,f,R)}const c=NC(o,A);return Q.isList?aB(c,e):c}function Bf(I,A,g,B){const i=Math.ceil(A/2)*64;if(i>B.length)throw new Error(`blocksBuffer is too small: ${B.length} < ${i}`);const Q=B.subarray(0,i);for(let C=0;C<A;C++)I.hashTreeRootInto(g[C],Q,C*32);return A%2===1&&Q.subarray(A*32,i).fill(0),Q}function _r(I,A,g,B,i){const Q=B-g;let C;if(I===null)C=Cf(A,g,Q);else{if(I===0)throw Error("element fixed length is 0");if(Q%I!==0)throw Error(`size ${Q} is not multiple of element fixedSize ${I}`);const e=Q/I;C=new Uint32Array(e);for(let o=0;o<e;o++)C[o]=o*I}return wQ(C.length,i),C}function Cf(I,A,g){if(g===0)return new Uint32Array(0);const B=I.getUint32(A,!0),i=B;if(B===0)throw Error("First offset must be > 0");if(i%4!==0)throw Error("Offset data length not multiple of 4");const Q=i/4,C=new Uint32Array(Q);C[0]=B;for(let e=1;e<Q;e++){const o=I.getUint32(A+e*4,!0);if(C[e]=o,o>g)throw new Error(`Offset out of bounds ${o} > ${g}`);if(o<C[e-1])throw new Error(`Offsets must be increasing ${o} < ${C[e-1]}`)}return C}function Qf(I){return{finalized:[],count:0,root:FU(VB(I),VB(0))}}class Pr extends FC{type;_rootNode;nodes;caches;viewsChanged=new Map;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=this._length===0)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];B===void 0&&(B=mI(this._rootNode,this.type.depth,A),this.nodes[A]=B);const i=this.type.elementType.getViewDU(B,this.caches[A]);return this.type.elementType.isViewMutable&&this.viewsChanged.set(A,i),i}getReadonly(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];return B===void 0&&(B=mI(this._rootNode,this.type.depth,A),this.nodes[A]=B),this.type.elementType.getViewDU(B,this.caches[A])}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);this.viewsChanged.set(A,g)}getAllReadonly(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} views, got ${A.length}`);this.populateAllOldNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.getReadonly(g);return A}forEach(A){this.populateAllOldNodes();for(let g=0;g<this._length;g++)A(this.getReadonly(g),g)}getAllReadonlyValues(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);this.populateAllNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.type.elementType.tree_toValue(this.nodes[g]);return A}forEachValue(A){this.populateAllNodes();for(let g=0;g<this._length;g++)A(this.type.elementType.tree_toValue(this.nodes[g]),g)}getReadonlyByRange(A,g){if(A<0)throw Error(`Error getting by range, startIndex < 0: ${A}`);if(g<=0)throw Error(`Error getting by range, count <= 0: ${g}`);const B=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;if(A>=B)throw Error(`Error getting by range, startIndex >= length: ${A} >= ${B}`);g=Math.min(g,B-A);let i=!0;for(let C=A;C<A+g;C++)if(this.nodes[C]==null){i=!1;break}if(!i){const C=tI(this._rootNode,this.type.depth,A,g);for(const[e,o]of C.entries())this.nodes[A+e]=o}const Q=new Array(g);for(let C=0;C<g;C++)Q[C]=this.getReadonly(A+C);return Q}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.viewsChanged.size===0){!B&&g!==null&&aI(this._rootNode,A,g);return}const i=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[G,S]of this.viewsChanged){const u=this.type.elementType.commitViewDU(S,i,Q);this.nodes[G]!==u&&(this.nodes[G]=u,C.push({index:G,node:u}));const N=this.type.elementType.cacheOfViewDU(S);N&&(this.caches[G]=N)}const e=C.sort((G,S)=>G.index-S.index),o=e.map(G=>G.index),c=e.map(G=>G.node),a=this.type.tree_getChunksNode(this._rootNode),f=A+this.type.tree_chunksNodeOffset(),R=g!=null&&B?g:null,y=GC(a,this.type.chunkDepth,o,c,f,R);this._rootNode=this.type.tree_setChunksNode(this._rootNode,y,this.dirtyLength?this._length:null,A,g),!B&&g!==null&&aI(this._rootNode,A,g),this.viewsChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.viewsChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}populateAllNodes(){if(this.viewsChanged.size>0)throw Error("Must commit changes before reading all nodes");this.nodesPopulated||(this.nodes=tI(this._rootNode,this.type.depth,0,this.length),this.nodesPopulated=!0)}populateAllOldNodes(){if(!this.nodesPopulated){const A=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;this.nodes=tI(this._rootNode,this.type.depth,0,A),this.nodesPopulated=!0}}}class ef extends Pr{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;this.set(g,A)}sliceTo(A){this.commit();const g=this._rootNode,B=this._length;if(A>=B-1)return this;const i=this.type.tree_getChunksNode(g),Q=lr(i,this.type.chunkDepth,A),C=A+1,e=this.type.tree_setChunksNode(g,Q,C);return this.rootNodeToViewDU(e)}sliceFrom(A){if(this.commit(),this.populateAllNodes(),A<0&&(A+=this.nodes.length),A<=0)return this;let g,B;if(A>=this.nodes.length)g=oB(this.type.chunkDepth),B=0;else{const Q=this.nodes.slice(A);g=NC(Q,this.type.chunkDepth),B=Q.length}const i=this.type.tree_setChunksNode(this._rootNode,g,B);return this.rootNodeToViewDU(i)}toSnapshot(A){if(this.commit(),A<0||A>this._length)throw Error(`Invalid count ${A}, length is ${this._length}`);if(A===0)return Qf(this.type.chunkDepth);const g=this.sliceTo(A-1)._rootNode,B=this.type.tree_getChunksNode(g);return{...RU(B,this.type.chunkDepth,A),root:g.root}}serializeToBytes(A,g){this.commit(),this.populateAllNodes();const B=this.type.tree_getChunksNode(this._rootNode);return le(this.type.elementType,this._length,this.type.chunkDepth,B,A,g,this.nodes)}rootNodeToViewDU(A){return this.type.getViewDU(A)}}class yA extends RQ{elementType;limit;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;blockArray=[];mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=JA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.maxChunkCount=this.limit,this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=br(A,this.limit)}static named(A,g,B){return new(dI(yA,B.typeName))(A,g,B)}getView(A){return new If(this,A)}getViewDU(A,g){return new ef(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return Tr(this.elementType,A.length,A)}value_serializeToBytes(A,g,B){return qr(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Vr(this.elementType,A,g,B,this)}tree_serializedSize(A){const g=this.tree_getChunksNode(A),B=this.tree_getLength(A);return jr(this.elementType,B,this.chunkDepth,g)}tree_serializeToBytes(A,g,B){const i=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return le(this.elementType,Q,this.chunkDepth,i,A,g)}tree_deserializeFromBytes(A,g,B){return Zr(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return nB(A)}tree_setLength(A,g){A.rootNode=aB(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,i=0,Q=null){return fr(A,g,B,i,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Lg];if(B)return B}const g=YB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,i=!1){if(this.cachePermanentRootStruct){const C=A[Lg];if(C){g.set(C,B);return}}if(A.length>this.blockArray.length){const C=A.length-this.blockArray.length,e=new Uint8Array(C*64);for(let o=0;o<C;o++)this.blockArray.push(e.subarray(o*64,(o+1)*64))}for(let C=0;C<A.length;C++){const e=this.blockArray[Math.floor(C/2)],o=C%2===0?0:32;this.elementType.hashTreeRootInto(A[C],e,o)}const Q=Math.ceil(A.length/2);A.length%2===1&&this.blockArray[Q-1].fill(0,32),tr(this.blockArray,Q,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),yC(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&Ee(A,g,B,i)}getBlocksBytes(){throw Error("getBlockBytes should not be called for ListCompositeType")}}const tf=BigInt(Number.MAX_SAFE_INTEGER),De=BigInt(2)**BigInt(64),Ef=BigInt(2)**BigInt(128),of=BigInt(2)**BigInt(192),Or=2**32,xr=4294967295;class Ag extends uQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;maxDecimalStr;clipInfinity;setBitwiseOR;constructor(A,g){if(super(),this.byteLength=A,A>8)throw Error("UintNumber byteLength limit is 8");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uint${A*8}`,g?.clipInfinity&&(this.typeName+="Inf"),g?.setBitwiseOR&&(this.typeName+="OR"),this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A,this.maxDecimalStr=(BigInt(2)**BigInt(this.byteLength*8)-BigInt(1)).toString(10),this.clipInfinity=g?.clipInfinity===!0,this.setBitwiseOR=g?.setBitwiseOR===!0}static named(A,g){return new(dI(Ag,g.typeName))(A,g)}defaultValue(){return 0}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,B);break;case 2:A.setUint16(g,B,!0);break;case 4:A.setUint32(g,B,!0);break;case 8:B===1/0?(A.setUint32(g,4294967295),A.setUint32(g+4,4294967295)):(A.setUint32(g,B&4294967295,!0),A.setUint32(g+4,B/Or&4294967295,!0));break}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){switch(this.assertValidSize(B-g),this.byteLength){case 1:return A.getUint8(g);case 2:return A.getUint16(g,!0);case 4:return A.getUint32(g,!0);case 8:{const i=A.getUint32(g,!0),Q=A.getUint32(g+4,!0);return Q===xr&&i===xr&&this.clipInfinity?1/0:Q*Or+i}}}value_toTree(A){const g=KA.fromZero();return g.setUint(this.byteLength,0,A,this.clipInfinity),g}tree_serializeToBytes(A,g,B){const i=B.getUint(this.byteLength,0,this.clipInfinity);return this.value_serializeToBytes(A,g,i),g+this.byteLength}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const i=this.value_deserializeFromBytes(A,g,B),Q=KA.fromZero();return Q.setUint(this.byteLength,0,i,this.clipInfinity),Q}tree_getFromNode(A){return A.getUint(this.byteLength,0,this.clipInfinity)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUint(this.byteLength,B,this.clipInfinity)}tree_setToPackedNode(A,g,B){const i=this.byteLength*(g%this.itemsPerChunk);this.setBitwiseOR?A.bitwiseOrUint(this.byteLength,i,B):A.setUint(this.byteLength,i,B,this.clipInfinity)}fromJson(A){if(typeof A=="number")return A;if(typeof A=="string"){if(this.clipInfinity&&A===this.maxDecimalStr)return 1/0;const g=Number.parseInt(A,10);if(Number.isNaN(g))throw Error("JSON invalid number isNaN");if(g>Number.MAX_SAFE_INTEGER)throw Error("JSON invalid number > MAX_SAFE_INTEGER");return g}if(typeof A=="bigint"){if(A>tf)throw Error("JSON invalid number > MAX_SAFE_INTEGER_BN");return Number(A)}throw Error(`JSON invalid type ${typeof A} expected number`)}toJson(A){return A===1/0?this.maxDecimalStr:A.toString(10)}}class pC extends uQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;constructor(A,g){if(super(),this.byteLength=A,A>32)throw Error("UintBigint byteLength limit is 32");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uintBigint${A*8}`,this.byteLength=A,this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A}static named(A,g){return new(dI(pC,g.typeName))(A,g)}defaultValue(){return BigInt(0)}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,Number(B));break;case 2:A.setUint16(g,Number(B),!0);break;case 4:A.setUint32(g,Number(B),!0);break;case 8:A.setBigUint64(g,B,!0);break;default:for(let i=0;i<this.byteLength;i+=8){i>0&&(B=B/De);const Q=BigInt.asUintN(64,B);A.setBigUint64(g+i,Q,!0)}}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){const i=B-g;if(i!==this.byteLength)throw Error(`Invalid size ${i} expected ${this.byteLength}`);switch(this.byteLength){case 1:return BigInt(A.getUint8(g));case 2:return BigInt(A.getUint16(g,!0));case 4:return BigInt(A.getUint32(g,!0));case 8:return A.getBigUint64(g,!0);case 16:{const Q=A.getBigUint64(g,!0);return A.getBigUint64(g+8,!0)*De+Q}case 32:{const Q=A.getBigUint64(g,!0),C=A.getBigUint64(g+8,!0),e=A.getBigUint64(g+16,!0);return A.getBigUint64(g+24,!0)*of+e*Ef+C*De+Q}}}tree_serializeToBytes(A,g,B){const i=B.getUintBigint(this.byteLength,0);return this.value_serializeToBytes(A,g,i),g+this.byteLength}tree_deserializeFromBytes(A,g,B){const i=B-g;if(i!==this.byteLength)throw Error(`Invalid size ${i} expected ${this.byteLength}`);const Q=this.value_deserializeFromBytes(A,g,B),C=KA.fromZero();return C.setUintBigint(this.byteLength,0,Q),C}tree_getFromNode(A){return A.getUintBigint(this.byteLength,0)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUintBigint(this.byteLength,B)}tree_setToPackedNode(A,g,B){const i=this.byteLength*(g%this.itemsPerChunk);A.setUintBigint(this.byteLength,i,B)}fromJson(A){if(typeof A=="bigint")return A;if(typeof A=="string"||typeof A=="number")return BigInt(A);throw Error(`JSON invalid type ${typeof A} expected bigint`)}toJson(A){return A.toString(10)}}BigInt(2),BigInt(3),BigInt(2),BigInt(3);class GQ extends RQ{elementType;length;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(g*A.byteLength/32),this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=g*A.byteLength,this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(GQ,B.typeName))(A,g,B)}getView(A){return new Lr(this,A)}getViewDU(A,g){return new Kr(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return SQ(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Sr(this.elementType,A,g,B,this)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){return re(this.elementType,this.length,this.depth,A,g,B)}tree_deserializeFromBytes(A,g,B){return wr(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){const g=this.blocksBuffer.subarray(0,this.fixedSize),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return SQ(this.elementType,this.length,{uint8Array:g,dataView:B},0,A),this.blocksBuffer}}class EI extends RQ{elementType;length;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.maxChunkCount=g,this.chunkDepth=ag(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=A.fixedSize===null?null:g*A.fixedSize,this.minSize=gf(A,g),this.maxSize=br(A,g),this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(EI,B.typeName))(A,g,B)}getView(A){return new Yr(this,A)}getViewDU(A,g){return new Pr(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return Tr(this.elementType,this.length,A)}value_serializeToBytes(A,g,B){return qr(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return Vr(this.elementType,A,g,B,this)}tree_serializedSize(A){return jr(this.elementType,this.length,this.depth,A)}tree_serializeToBytes(A,g,B){return le(this.elementType,this.length,this.depth,B,A,g)}tree_deserializeFromBytes(A,g,B){return Zr(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){return Bf(this.elementType,this.length,A,this.blocksBuffer)}}class rf extends LI{constructor(A,g){super(new Ag(8),A,g)}toViewDU(A){const{treeNode:g,leafNodes:B}=this.packedUintNum64sToNode(A);return this.getViewDU(g,{nodes:B,length:A.length,nodesPopulated:!0})}value_toTree(A){const{treeNode:g}=this.packedUintNum64sToNode(A);return g}packedUintNum64sToNode(A){if(A.length>this.limit)throw new Error(`Exceeds limit: ${A.length} > ${this.limit}`);const g=tU(A),B=NC([...g],this.chunkDepth);return{treeNode:aB(B,A.length),leafNodes:g}}}new Uint8Array(64).subarray(32);function HC(I){if(!Number.isSafeInteger(I)||I<0)throw new Error(`positive integer expected, not ${I}`)}function nf(I){if(typeof I!="boolean")throw new Error(`boolean expected, not ${I}`)}function af(I){return I instanceof Uint8Array||I!=null&&typeof I=="object"&&I.constructor.name==="Uint8Array"}function FQ(I,...A){if(!af(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error(`Uint8Array expected of length ${A}, not of length=${I.length}`)}function sf(I){if(typeof I!="function"||typeof I.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");HC(I.outputLen),HC(I.blockLen)}function ce(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function zr(I,A){FQ(I);const g=A.outputLen;if(I.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}const hf={number:HC,bool:nf,bytes:FQ,hash:sf,exists:ce,output:zr},kQ=BigInt(2**32-1),vr=BigInt(32);function lf(I,A=!1){return A?{h:Number(I&kQ),l:Number(I>>vr&kQ)}:{h:Number(I>>vr&kQ)|0,l:Number(I&kQ)|0}}function Df(I,A=!1){let g=new Uint32Array(I.length),B=new Uint32Array(I.length);for(let i=0;i<I.length;i++){const{h:Q,l:C}=lf(I[i],A);[g[i],B[i]]=[Q,C]}return[g,B]}const cf=(I,A,g)=>I<<g|A>>>32-g,Uf=(I,A,g)=>A<<g|I>>>32-g,ff=(I,A,g)=>A<<g-32|I>>>64-g,Sf=(I,A,g)=>I<<g-32|A>>>64-g,wf=I=>new Uint32Array(I.buffer,I.byteOffset,Math.floor(I.byteLength/4)),Wr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,yf=I=>I<<24&4278190080|I<<8&16711680|I>>>8&65280|I>>>24&255;function Xr(I){for(let A=0;A<I.length;A++)I[A]=yf(I[A])}function Nf(I){if(typeof I!="string")throw new Error(`utf8ToBytes expected string, got ${typeof I}`);return new Uint8Array(new TextEncoder().encode(I))}function $r(I){return typeof I=="string"&&(I=Nf(I)),FQ(I),I}class df{clone(){return this._cloneInto()}}function uf(I){const A=B=>I().update($r(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}const An=[],In=[],gn=[],Rf=BigInt(0),MC=BigInt(1),Gf=BigInt(2),Ff=BigInt(7),kf=BigInt(256),Jf=BigInt(113);for(let I=0,A=MC,g=1,B=0;I<24;I++){[g,B]=[B,(2*g+3*B)%5],An.push(2*(5*B+g)),In.push((I+1)*(I+2)/2%64);let i=Rf;for(let Q=0;Q<7;Q++)A=(A<<MC^(A>>Ff)*Jf)%kf,A&Gf&&(i^=MC<<(MC<<BigInt(Q))-MC);gn.push(i)}const[pf,Hf]=Df(gn,!0),Bn=(I,A,g)=>g>32?ff(I,A,g):cf(I,A,g),Cn=(I,A,g)=>g>32?Sf(I,A,g):Uf(I,A,g);function Mf(I,A=24){const g=new Uint32Array(10);for(let B=24-A;B<24;B++){for(let C=0;C<10;C++)g[C]=I[C]^I[C+10]^I[C+20]^I[C+30]^I[C+40];for(let C=0;C<10;C+=2){const e=(C+8)%10,o=(C+2)%10,c=g[o],a=g[o+1],f=Bn(c,a,1)^g[e],R=Cn(c,a,1)^g[e+1];for(let y=0;y<50;y+=10)I[C+y]^=f,I[C+y+1]^=R}let i=I[2],Q=I[3];for(let C=0;C<24;C++){const e=In[C],o=Bn(i,Q,e),c=Cn(i,Q,e),a=An[C];i=I[a],Q=I[a+1],I[a]=o,I[a+1]=c}for(let C=0;C<50;C+=10){for(let e=0;e<10;e++)g[e]=I[C+e];for(let e=0;e<10;e++)I[C+e]^=~g[(e+2)%10]&g[(e+4)%10]}I[0]^=pf[B],I[1]^=Hf[B]}g.fill(0)}class Ue extends df{constructor(A,g,B,i=!1,Q=24){if(super(),this.blockLen=A,this.suffix=g,this.outputLen=B,this.enableXOF=i,this.rounds=Q,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,HC(B),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=wf(this.state)}keccak(){Wr||Xr(this.state32),Mf(this.state32,this.rounds),Wr||Xr(this.state32),this.posOut=0,this.pos=0}update(A){ce(this);const{blockLen:g,state:B}=this;A=$r(A);const i=A.length;for(let Q=0;Q<i;){const C=Math.min(g-this.pos,i-Q);for(let e=0;e<C;e++)B[this.pos++]^=A[Q++];this.pos===g&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:A,suffix:g,pos:B,blockLen:i}=this;A[B]^=g,g&128&&B===i-1&&this.keccak(),A[i-1]^=128,this.keccak()}writeInto(A){ce(this,!1),FQ(A),this.finish();const g=this.state,{blockLen:B}=this;for(let i=0,Q=A.length;i<Q;){this.posOut>=B&&this.keccak();const C=Math.min(B-this.posOut,Q-i);A.set(g.subarray(this.posOut,this.posOut+C),i),this.posOut+=C,i+=C}return A}xofInto(A){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(A)}xof(A){return HC(A),this.xofInto(new Uint8Array(A))}digestInto(A){if(zr(A,this),this.finished)throw new Error("digest() was already called");return this.writeInto(A),this.destroy(),A}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(A){const{blockLen:g,suffix:B,outputLen:i,rounds:Q,enableXOF:C}=this;return A||(A=new Ue(g,B,i,C,Q)),A.state32.set(this.state32),A.pos=this.pos,A.posOut=this.posOut,A.finished=this.finished,A.rounds=Q,A.suffix=B,A.outputLen=i,A.enableXOF=C,A.destroyed=this.destroyed,A}}const mf=(I,A,g)=>uf(()=>new Ue(A,I,g)),Qn=mf(1,136,256/8);function Lf(I){return A=>(hf.bytes(A),I(A))}(()=>{const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,A=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:A&&!I?A("crypto"):void 0,web:I}})();const Kf=(()=>{const I=Lf(Qn);return I.create=Qn.create,I})();class Yf extends uI{constructor(){super(20,{typeName:"ExecutionAddress"})}toJson(A){const g=super.toJson(A);return Tf(g)}}function bf(I){return/^(0x)?[0-9a-f]{40}$/i.test(I)}function Tf(I){if(!bf(I))throw Error(`Invalid address: ${I}`);const A=(I.startsWith("0x")?I.slice(2):I).toLowerCase(),g=A.split(""),B=new Uint8Array(g.length);for(let Q=0;Q<B.length;Q++)B[Q]=A[Q].charCodeAt(0);const i=Kf(B);for(let Q=0;Q<g.length;Q+=2)i[Q>>1]>>4>=8&&(g[Q]=g[Q].toUpperCase()),(i[Q>>1]&15)>=8&&(g[Q+1]=g[Q+1].toUpperCase());return"0x"+g.join("")}const CI=new he,en=new Ag(1),mC=new uI(4),fe=new uI(8),tn=new uI(20),Se=new uI(32),we=new uI(48),ye=new uI(96),En=new Ag(1),on=new Ag(2),Ne=new Ag(4),RA=new Ag(8),de=new Ag(8,{clipInfinity:!0}),ZB=new pC(8),rn=new pC(16),ue=new pC(32),LA=RA,VI=RA,nn=de,an=RA,sB=RA,Re=RA,zA=RA,sn=RA,hn=ZB,ln=ZB,Dn=ue,hB=new uI(32),Ge=RA,cn=mC,Un=mC,Fe=mC,_B=we,JQ=ye,fn=Se,Sn=new Ag(1,{setBitwiseOR:!0}),ke=new Yf,Je=RA,wn=RA,yn=RA,Dg=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:_B,BLSSignature:JQ,BlobIndex:Ge,Boolean:CI,Byte:en,Bytes20:tn,Bytes32:Se,Bytes4:mC,Bytes48:we,Bytes8:fe,Bytes96:ye,ColumnIndex:Je,CommitteeIndex:sB,CustodyIndex:wn,DepositIndex:hn,Domain:fn,DomainType:Un,Epoch:VI,EpochInf:nn,ExecutionAddress:ke,ForkDigest:Fe,Gwei:ln,ParticipationFlags:Sn,Root:hB,RowIndex:yn,Slot:LA,SubcommitteeIndex:Re,SyncPeriod:an,Uint16:on,Uint32:Ne,Uint8:En,UintBn128:rn,UintBn256:ue,UintBn64:ZB,UintNum64:RA,UintNumInf64:de,ValidatorIndex:zA,Version:cn,Wei:Dn,WithdrawalIndex:sn},Symbol.toStringTag,{value:"Module"})),{Boolean:qf,Bytes32:Vf,UintNum64:jf,BLSPubkey:Zf,EpochInf:pQ}=Dg,Nn=2**32,PB=4,_f=48,Pf=32,Of=1,xf={pubkey:Zf,withdrawalCredentials:Vf,effectiveBalance:jf,slashed:qf,activationEligibilityEpoch:pQ,activationEpoch:pQ,exitEpoch:pQ,withdrawableEpoch:pQ};class zf extends XU{constructor(){super(xf,{typeName:"Validator",jsonCase:"eth2"})}value_serializeToBytes({uint8Array:A,dataView:g},B,i){A.set(i.pubkey,B),B+=_f,A.set(i.withdrawalCredentials,B),B+=Pf;const{effectiveBalance:Q,activationEligibilityEpoch:C,activationEpoch:e,exitEpoch:o,withdrawableEpoch:c}=i;return g.setUint32(B,Q&4294967295,!0),B+=PB,g.setUint32(B,Q/Nn&4294967295,!0),B+=PB,A[B]=i.slashed?1:0,B+=Of,B=HQ(g,B,C),B=HQ(g,B,e),B=HQ(g,B,o),B=HQ(g,B,c),B}}function HQ(I,A,g){return g===1/0?(I.setUint32(A,4294967295,!0),A+=PB,I.setUint32(A,4294967295,!0),A+=PB):(I.setUint32(A,g&4294967295,!0),A+=PB,I.setUint32(A,g/Nn&4294967295,!0),A+=PB),A}const dn=new zf,{Bytes32:lB,UintNum64:DI,UintBn64:DB,Slot:Kg,Epoch:LC,CommitteeIndex:un,ValidatorIndex:cB,Root:HA,Version:KC,ForkDigest:Rn,BLSPubkey:Gn,BLSSignature:jI,Domain:vf}=Dg,pe=new $I(c1),KI=new Y({slot:Kg,proposerIndex:cB,parentRoot:HA,stateRoot:HA,bodyRoot:HA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),Fn=new Y({slot:DB,proposerIndex:cB,parentRoot:HA,stateRoot:HA,bodyRoot:HA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),He=new Y({message:KI,signature:jI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),Me=new Y({message:Fn,signature:jI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),qA=new Y({epoch:LC,root:HA},{typeName:"Checkpoint",jsonCase:"eth2"}),me=new Y({epoch:DB,root:HA},{typeName:"Checkpoint",jsonCase:"eth2"}),Le=new dQ(lC),MQ=new LI(cB,lC),Wf=new Y({pubkey:Gn,withdrawalCredentials:lB,amount:DI},{typeName:"DepositMessage",jsonCase:"eth2"}),Ke=new Y({pubkey:Gn,withdrawalCredentials:lB,amount:DI,signature:jI},{typeName:"DepositData",jsonCase:"eth2"}),Xf=new yA(HA,2**fo),$f=new Y({depositData:Ke,blockNumber:DI,index:DI},{typeName:"DepositEvent",jsonCase:"eth2"}),Ig=new Y({depositRoot:HA,depositCount:DI,blockHash:lB},{typeName:"Eth1Data",jsonCase:"eth2"}),Yg=new yA(Ig,ql*SI),A2=new Y({depositRoot:HA,depositCount:DI,blockHash:lB,blockNumber:DI},{typeName:"Eth1DataOrdered",jsonCase:"eth2"}),I2=new Y({timestamp:DI,depositRoot:HA,depositCount:DI},{typeName:"Eth1Block",jsonCase:"eth2"}),bg=new Y({previousVersion:KC,currentVersion:KC,epoch:LC},{typeName:"Fork",jsonCase:"eth2"}),g2=new Y({currentVersion:KC,genesisValidatorsRoot:HA},{typeName:"ForkData",jsonCase:"eth2"}),B2=new Y({forkDigest:Rn,nextForkVersion:KC,nextForkEpoch:LC},{typeName:"ENRForkID",jsonCase:"eth2"}),cg=new EI(HA,Yi),Ug=new EI(HA,Yi),C2=new Y({blockRoots:cg,stateRoots:Ug},{typeName:"HistoricalBatch",jsonCase:"eth2"}),Q2=new Y({blockRoots:HA,stateRoots:HA},{typeName:"HistoricalBatchRoots",jsonCase:"eth2"}),i2=dn,Tg=new yA(dn,DC),qg=new rf(DC),Vg=new EI(lB,Vl),jg=new GQ(DI,jl),Zg=new $I(l1),UB=new Y({slot:Kg,index:un,beaconBlockRoot:HA,source:qA,target:qA},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ye=new Y({slot:DB,index:DB,beaconBlockRoot:HA,source:me,target:me},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),e2=new Y({attestingIndices:MQ,data:UB,signature:jI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),be=new Y({attestingIndices:MQ,data:Ye,signature:jI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),kn=new Y({aggregationBits:Le,data:UB,inclusionDelay:Kg,proposerIndex:cB},{typeName:"PendingAttestation",jsonCase:"eth2"}),t2=new Y({objectRoot:HA,domain:vf},{typeName:"SigningData",jsonCase:"eth2"}),mQ=new Y({aggregationBits:Le,data:UB,signature:jI},{typeName:"Attestation",jsonCase:"eth2"}),E2=mQ,Jn=new Y({attestation1:be,attestation2:be},{typeName:"AttesterSlashing",jsonCase:"eth2"}),pn=new Y({proof:new EI(lB,fo+1),data:Ke},{typeName:"Deposit",jsonCase:"eth2"}),Hn=new Y({signedHeader1:Me,signedHeader2:Me},{typeName:"ProposerSlashing",jsonCase:"eth2"}),Mn=new Y({epoch:LC,validatorIndex:cB},{typeName:"VoluntaryExit",jsonCase:"eth2",cachePermanentRootStruct:!0}),mn=new Y({message:Mn,signature:jI},{typeName:"SignedVoluntaryExit",jsonCase:"eth2"}),vA=new Y({randaoReveal:jI,eth1Data:Ig,graffiti:lB,proposerSlashings:new yA(Hn,Zl),attesterSlashings:new yA(Jn,_l),attestations:new yA(mQ,ho),deposits:new yA(pn,Pl),voluntaryExits:new yA(mn,Ol)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ln=new Y({slot:Kg,proposerIndex:cB,parentRoot:HA,stateRoot:HA,body:vA},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),o2=new Y({message:Ln,signature:jI},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Te=new yA(kn,ho*SI),r2=new Y({genesisTime:DI,genesisValidatorsRoot:HA,slot:Kg,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(HA,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:DI,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochAttestations:Te,currentEpochAttestations:Te,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA},{typeName:"BeaconState",jsonCase:"eth2"}),n2=new Y({validators:MQ,committeeIndex:un,slot:Kg},{typeName:"CommitteeAssignment",jsonCase:"eth2"}),Kn=new Y({aggregatorIndex:cB,aggregate:mQ,selectionProof:jI},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),a2=new Y({message:Kn,signature:jI},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),Yn=new Y({forkDigest:Rn,finalizedRoot:HA,finalizedEpoch:LC,headRoot:HA,headSlot:Kg},{typeName:"Status",jsonCase:"eth2"}),s2=DB,h2=DB,l2=new Y({seqNumber:DB,attnets:pe},{typeName:"Metadata",jsonCase:"eth2"}),D2=new Y({startSlot:Kg,count:DI,step:DI},{typeName:"BeaconBlocksByRangeRequest",jsonCase:"eth2"}),c2=new Y({genesisValidatorsRoot:HA,genesisTime:DI,genesisForkVersion:KC},{typeName:"Genesis",jsonCase:"eth2"}),_g=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:Kn,Attestation:mQ,AttestationData:UB,AttestationDataBigint:Ye,AttestationSubnets:pe,AttesterSlashing:Jn,Balances:qg,BeaconBlock:Ln,BeaconBlockBody:vA,BeaconBlockHeader:KI,BeaconBlockHeaderBigint:Fn,BeaconBlocksByRangeRequest:D2,BeaconState:r2,Checkpoint:qA,CheckpointBigint:me,CommitteeAssignment:n2,CommitteeBits:Le,CommitteeIndices:MQ,Deposit:pn,DepositData:Ke,DepositDataRootList:Xf,DepositEvent:$f,DepositMessage:Wf,ENRForkID:B2,EpochAttestations:Te,Eth1Block:I2,Eth1Data:Ig,Eth1DataOrdered:A2,Eth1DataVotes:Yg,Fork:bg,ForkData:g2,Genesis:c2,Goodbye:s2,HistoricalBatch:C2,HistoricalBatchRoots:Q2,HistoricalBlockRoots:cg,HistoricalStateRoots:Ug,IndexedAttestation:e2,IndexedAttestationBigint:be,JustificationBits:Zg,Metadata:l2,PendingAttestation:kn,Ping:h2,ProposerSlashing:Hn,RandaoMixes:Vg,SignedAggregateAndProof:a2,SignedBeaconBlock:o2,SignedBeaconBlockHeader:He,SignedBeaconBlockHeaderBigint:Me,SignedVoluntaryExit:mn,SigningData:t2,SingleAttestation:E2,Slashings:jg,Status:Yn,Validator:i2,Validators:Tg,VoluntaryExit:Mn},Symbol.toStringTag,{value:"Module"})),{Bytes32:qe,UintNum64:YC,UintBn64:U2,Slot:Pg,SubcommitteeIndex:bn,ValidatorIndex:Ve,Root:OB,BLSPubkey:Tn,BLSSignature:xB,ParticipationFlags:f2}=Dg,qn=new $I(yo),je=new EI(qe,KB),Vn=new EI(qe,f1),jn=new EI(qe,oQ),Zn=new Y({seqNumber:U2,attnets:pe,syncnets:qn},{typeName:"Metadata",jsonCase:"eth2"}),WA=new Y({pubkeys:new EI(Tn,Gg),aggregatePubkey:Tn},{typeName:"SyncCommittee",jsonCase:"eth2"}),S2=new Y({slot:Pg,beaconBlockRoot:OB,validatorIndex:Ve,signature:xB},{typeName:"SyncCommitteeMessage",jsonCase:"eth2"}),_n=new Y({slot:Pg,beaconBlockRoot:OB,subcommitteeIndex:bn,aggregationBits:new $I(Gg/yo),signature:xB},{typeName:"SyncCommitteeContribution",jsonCase:"eth2"}),Pn=new Y({aggregatorIndex:Ve,contribution:_n,selectionProof:xB},{typeName:"ContributionAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),w2=new Y({message:Pn,signature:xB},{typeName:"SignedContributionAndProof",jsonCase:"eth2"}),y2=new Y({slot:Pg,subcommitteeIndex:bn},{typeName:"SyncAggregatorSelectionData",jsonCase:"eth2"}),On=new $I(Gg),cI=new Y({syncCommitteeBits:On,syncCommitteeSignature:xB},{typeName:"SyncCommitteeBits",jsonCase:"eth2"}),gg=new Y({...vA.fields,syncAggregate:cI},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),xn=new Y({slot:Pg,proposerIndex:Ve,parentRoot:OB,stateRoot:OB,body:gg},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),N2=new Y({message:xn,signature:xB},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),RI=new LI(f2,DC),fB=new LI(YC,DC),d2=new Y({genesisTime:YC,genesisValidatorsRoot:OB,slot:Pg,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(OB,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:YC,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA},{typeName:"BeaconState",jsonCase:"eth2"}),SB=new Y({beacon:KI},{typeName:"LightClientHeader",jsonCase:"eth2"}),LQ=new Y({header:SB,currentSyncCommittee:WA,currentSyncCommitteeBranch:Vn},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),zB=new Y({attestedHeader:SB,nextSyncCommittee:WA,nextSyncCommitteeBranch:jn,finalizedHeader:SB,finalityBranch:je,syncAggregate:cI,signatureSlot:Pg},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Ze=new Y({attestedHeader:SB,finalizedHeader:SB,finalityBranch:je,syncAggregate:cI,signatureSlot:Pg},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),u2=new Y({attestedHeader:SB,syncAggregate:cI,signatureSlot:Pg},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),R2=new Y({startPeriod:YC,count:YC},{typeName:"LightClientUpdatesByRange",jsonCase:"eth2"}),G2=new Y({snapshot:LQ,validUpdates:new yA(zB,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),wB=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:xn,BeaconBlockBody:gg,BeaconState:d2,ContributionAndProof:Pn,CurrentSyncCommitteeBranch:Vn,EpochParticipation:RI,FinalityBranch:je,InactivityScores:fB,LightClientBootstrap:LQ,LightClientFinalityUpdate:Ze,LightClientHeader:SB,LightClientOptimisticUpdate:u2,LightClientStore:G2,LightClientUpdate:zB,LightClientUpdatesByRange:R2,Metadata:Zn,NextSyncCommitteeBranch:jn,SignedBeaconBlock:N2,SignedContributionAndProof:w2,SyncAggregate:cI,SyncAggregatorSelectionData:y2,SyncCommittee:WA,SyncCommitteeBits:On,SyncCommitteeContribution:_n,SyncCommitteeMessage:S2,SyncSubnets:qn},Symbol.toStringTag,{value:"Module"}));class vB extends uQ{typeName="string";byteLength=0;fixedSize=0;minSize=0;maxSize=0;defaultValue(){return""}value_serializeToBytes(){throw Error("Not supported in String type")}value_deserializeFromBytes(){throw Error("Not supported in String type")}tree_serializeToBytes(){throw Error("Not supported in String type")}tree_deserializeFromBytes(){throw Error("Not supported in String type")}tree_getFromNode(){throw Error("Not supported in String type")}tree_setToNode(){throw Error("Not supported in String type")}tree_getFromPackedNode(){throw Error("Not supported in String type")}tree_setToPackedNode(){throw Error("Not supported in String type")}fromJson(A){if(typeof A!="string")throw Error(`JSON invalid type ${typeof A} expected string`);return A}toJson(A){return A}}const Og=new vB,{Bytes32:KQ,UintNum64:ZI,Slot:_e,ValidatorIndex:zn,Root:GI,BLSSignature:YQ,UintBn256:Pe,BLSPubkey:vn,ExecutionAddress:Wn}=Dg,Xn=new kC(zl),$n=new yA(Xn,vl),Oe=new Y({parentHash:GI,feeRecipient:Wn,stateRoot:KQ,receiptsRoot:KQ,logsBloom:new uI(Wl),prevRandao:KQ,blockNumber:ZI,gasLimit:ZI,gasUsed:ZI,timestamp:ZI,extraData:new kC(Xl),baseFeePerGas:Pe,blockHash:GI}),xe=new Y({...Oe.fields,transactions:$n},{typeName:"ExecutionPayload",jsonCase:"eth2"}),bC=new Y({...Oe.fields,transactionsRoot:GI},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),Aa=new Y({...gg.fields,executionPayload:xe},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ia=new Y({slot:_e,proposerIndex:zn,parentRoot:GI,stateRoot:GI,body:Aa},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),F2=new Y({message:Ia,signature:YQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),k2=new Y({blockHash:GI,parentHash:GI,totalDifficulty:Pe},{typeName:"PowBlock",jsonCase:"eth2"}),J2=new Y({genesisTime:ZI,genesisValidatorsRoot:GI,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(GI,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:ZI,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:bC},{typeName:"BeaconState",jsonCase:"eth2"}),ga=new Y({...gg.fields,executionPayloadHeader:bC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ze=new Y({slot:_e,proposerIndex:zn,parentRoot:GI,stateRoot:GI,body:ga},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),p2=new Y({message:ze,signature:YQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Ba=new Y({feeRecipient:Wn,gasLimit:ZI,timestamp:ZI,pubkey:vn},{typeName:"ValidatorRegistrationV1",jsonCase:"eth2"}),H2=new Y({message:Ba,signature:YQ},{typeName:"SignedValidatorRegistrationV1",jsonCase:"eth2"}),Ca=new Y({header:bC,value:Pe,pubkey:vn},{typeName:"BuilderBid",jsonCase:"eth2"}),M2=new Y({message:Ca,signature:YQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),ve=new Y({timestamp:ZI,prevRandao:KQ,suggestedFeeRecipient:Og},{typeName:"PayloadAttributes",jsonCase:"eth2"}),TC=new Y({proposerIndex:ZI,proposalSlot:_e,parentBlockNumber:ZI,parentBlockRoot:GI,parentBlockHash:GI},{typeName:"SSEPayloadAttributesCommon",jsonCase:"eth2"}),m2=new Y({...TC.fields,payloadAttributes:ve},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),WB=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Ia,BeaconBlockBody:Aa,BeaconState:J2,BlindedBeaconBlock:ze,BlindedBeaconBlockBody:ga,BuilderBid:Ca,CommonExecutionPayloadType:Oe,ExecutionPayload:xe,ExecutionPayloadHeader:bC,PayloadAttributes:ve,PowBlock:k2,SSEPayloadAttributes:m2,SSEPayloadAttributesCommon:TC,SignedBeaconBlock:F2,SignedBlindedBeaconBlock:p2,SignedBuilderBid:M2,SignedValidatorRegistrationV1:H2,Transaction:Xn,Transactions:$n,ValidatorRegistrationV1:Ba},Symbol.toStringTag,{value:"Module"})),{UintNum64:Qa,Slot:bQ,ValidatorIndex:TQ,WithdrawalIndex:ia,Root:yB,BLSSignature:qQ,BLSPubkey:ea,ExecutionAddress:ta,Gwei:L2,UintBn256:K2,Bytes32:Y2}=Dg,Ea=new EI(Y2,uo),oa=new Y({index:ia,validatorIndex:TQ,address:ta,amount:L2},{typeName:"Withdrawal",jsonCase:"eth2"}),ra=new Y({validatorIndex:TQ,fromBlsPubkey:ea,toExecutionAddress:ta},{typeName:"BLSToExecutionChange",jsonCase:"eth2"}),na=new Y({message:ra,signature:qQ},{typeName:"SignedBLSToExecutionChange",jsonCase:"eth2"}),We=new yA(oa,A1),Xe=new Y({...xe.fields,withdrawals:We},{typeName:"ExecutionPayload",jsonCase:"eth2"}),XB=new Y({...bC.fields,withdrawalsRoot:yB},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),$e=new yA(na,$l),NB=new Y({...gg.fields,executionPayload:Xe,blsToExecutionChanges:$e},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),At=new Y({slot:bQ,proposerIndex:TQ,parentRoot:yB,stateRoot:yB,body:NB},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),b2=new Y({message:At,signature:qQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),aa=new Y({header:XB,value:K2,pubkey:ea},{typeName:"BuilderBid",jsonCase:"eth2"}),T2=new Y({message:aa,signature:qQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),sa=new Y({blockSummaryRoot:yB,stateSummaryRoot:yB},{typeName:"HistoricalSummary",jsonCase:"eth2"}),ha=new yA(sa,Rg,{typeName:"HistoricalSummaries"}),Bg=new Y({genesisTime:Qa,genesisValidatorsRoot:yB,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(yB,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:Qa,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:XB,nextWithdrawalIndex:ia,nextWithdrawalValidatorIndex:TQ,historicalSummaries:ha},{typeName:"BeaconState",jsonCase:"eth2"}),la=new Y({...gg.fields,executionPayloadHeader:XB,blsToExecutionChanges:$e},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),It=new Y({...ze.fields,body:la},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),q2=new Y({message:It,signature:qQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),xg=new Y({beacon:KI,execution:XB,executionBranch:Ea},{typeName:"LightClientHeader",jsonCase:"eth2"}),Da=new Y({header:xg,currentSyncCommittee:WA,currentSyncCommitteeBranch:LQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),ca=new Y({attestedHeader:xg,nextSyncCommittee:WA,nextSyncCommitteeBranch:zB.fields.nextSyncCommitteeBranch,finalizedHeader:xg,finalityBranch:zB.fields.finalityBranch,syncAggregate:cI,signatureSlot:bQ},{typeName:"LightClientUpdate",jsonCase:"eth2"}),V2=new Y({attestedHeader:xg,finalizedHeader:xg,finalityBranch:Ze.fields.finalityBranch,syncAggregate:cI,signatureSlot:bQ},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),j2=new Y({attestedHeader:xg,syncAggregate:cI,signatureSlot:bQ},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),Z2=new Y({snapshot:Da,validUpdates:new yA(ca,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),VQ=new Y({...ve.fields,withdrawals:We},{typeName:"PayloadAttributes",jsonCase:"eth2"}),_2=new Y({...TC.fields,payloadAttributes:VQ},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),qC=Object.freeze(Object.defineProperty({__proto__:null,BLSToExecutionChange:ra,BLSToExecutionChanges:$e,BeaconBlock:At,BeaconBlockBody:NB,BeaconState:Bg,BlindedBeaconBlock:It,BlindedBeaconBlockBody:la,BuilderBid:aa,ExecutionBranch:Ea,ExecutionPayload:Xe,ExecutionPayloadHeader:XB,HistoricalSummaries:ha,HistoricalSummary:sa,LightClientBootstrap:Da,LightClientFinalityUpdate:V2,LightClientHeader:xg,LightClientOptimisticUpdate:j2,LightClientStore:Z2,LightClientUpdate:ca,PayloadAttributes:VQ,SSEPayloadAttributes:_2,SignedBLSToExecutionChange:na,SignedBeaconBlock:b2,SignedBlindedBeaconBlock:q2,SignedBuilderBid:T2,Withdrawal:oa,Withdrawals:We},Symbol.toStringTag,{value:"Module"})),{UintNum64:gt,Slot:jQ,Root:ZQ,BLSSignature:Bt,UintBn64:_Q,UintBn256:P2,Bytes32:PQ,Bytes48:Ct,Bytes96:O2,BLSPubkey:x2,BlobIndex:Ua}=Dg,z2=Ct,v2=O2,W2=PQ,Qt=Ct,$B=Ct,OQ=new uI(Go*I1),fg=new yA(OQ,og),fa=PQ,X2=new yA(fa,og),$2=PQ,Sg=new yA(Qt,og),dB=new yA($B,og),AS=new Y({startSlot:jQ,count:gt},{typeName:"BlobSidecarsByRangeRequest",jsonCase:"eth2"}),IS=new Y({blockRoot:ZQ,index:Ua},{typeName:"BlobIdentifier",jsonCase:"eth2"}),xQ=new Y({...Xe.fields,blobGasUsed:_Q,excessBlobGas:_Q},{typeName:"ExecutionPayload",jsonCase:"eth2"}),AC=new Y({...XB.fields,blobGasUsed:_Q,excessBlobGas:_Q},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),zQ=new Y({...gg.fields,executionPayload:xQ,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:Sg},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),vQ=new Y({...At.fields,body:zQ},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Sa=new Y({message:vQ,signature:Bt},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),wa=new EI(PQ,g1),ya=new Y({index:Ua,blob:OQ,kzgCommitment:Qt,kzgProof:$B,signedBlockHeader:He,kzgCommitmentInclusionProof:wa},{typeName:"BlobSidecar",jsonCase:"eth2"}),gS=new yA(ya,og),Na=new Y({commitments:Sg,proofs:dB,blobs:fg},{typeName:"BlobsBundle",jsonCase:"eth2"}),da=new Y({...gg.fields,executionPayloadHeader:AC,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:Sg},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),it=new Y({...It.fields,body:da},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),BS=new Y({message:it,signature:Bt},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),ua=new Y({header:AC,blobKzgCommitments:Sg,value:P2,pubkey:x2},{typeName:"BuilderBid",jsonCase:"eth2"}),CS=new Y({message:ua,signature:Bt},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),QS=new Y({executionPayload:xQ,blobsBundle:Na},{typeName:"ExecutionPayloadAndBlobsBundle",jsonCase:"eth2"}),iS=new Y({genesisTime:gt,genesisValidatorsRoot:ZQ,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(ZQ,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:gt,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:AC,nextWithdrawalIndex:Bg.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:Bg.fields.nextWithdrawalValidatorIndex,historicalSummaries:Bg.fields.historicalSummaries},{typeName:"BeaconState",jsonCase:"eth2"}),FI=new Y({beacon:KI,execution:AC,executionBranch:xg.fields.executionBranch},{typeName:"LightClientHeader",jsonCase:"eth2"}),Ra=new Y({header:FI,currentSyncCommittee:WA,currentSyncCommitteeBranch:LQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),Ga=new Y({attestedHeader:FI,nextSyncCommittee:WA,nextSyncCommitteeBranch:zB.fields.nextSyncCommitteeBranch,finalizedHeader:FI,finalityBranch:zB.fields.finalityBranch,syncAggregate:cI,signatureSlot:jQ},{typeName:"LightClientUpdate",jsonCase:"eth2"}),eS=new Y({attestedHeader:FI,finalizedHeader:FI,finalityBranch:Ze.fields.finalityBranch,syncAggregate:cI,signatureSlot:jQ},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),tS=new Y({attestedHeader:FI,syncAggregate:cI,signatureSlot:jQ},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),ES=new Y({snapshot:Ra,validUpdates:new yA(Ga,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),Fa=new Y({...VQ.fields,parentBeaconBlockRoot:ZQ},{typeName:"PayloadAttributes",jsonCase:"eth2"}),oS=new Y({...TC.fields,payloadAttributes:Fa},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),rS=new Y({block:vQ,kzgProofs:dB,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),nS=new Y({signedBlock:Sa,kzgProofs:dB,blobs:fg},{typeName:"SignedBlockContents",jsonCase:"eth2"}),WQ=Object.freeze(Object.defineProperty({__proto__:null,BLSFieldElement:W2,BeaconBlock:vQ,BeaconBlockBody:zQ,BeaconState:iS,BlindedBeaconBlock:it,BlindedBeaconBlockBody:da,BlindedBlob:fa,BlindedBlobs:X2,Blob:OQ,BlobIdentifier:IS,BlobKzgCommitments:Sg,BlobSidecar:ya,BlobSidecars:gS,BlobSidecarsByRangeRequest:AS,Blobs:fg,BlobsBundle:Na,BlockContents:rS,BuilderBid:ua,ExecutionPayload:xQ,ExecutionPayloadAndBlobsBundle:QS,ExecutionPayloadHeader:AC,G1Point:z2,G2Point:v2,KZGCommitment:Qt,KZGProof:$B,KZGProofs:dB,KzgCommitmentInclusionProof:wa,LightClientBootstrap:Ra,LightClientFinalityUpdate:eS,LightClientHeader:FI,LightClientOptimisticUpdate:tS,LightClientStore:ES,LightClientUpdate:Ga,PayloadAttributes:Fa,SSEPayloadAttributes:oS,SignedBeaconBlock:Sa,SignedBlindedBeaconBlock:BS,SignedBlockContents:nS,SignedBuilderBid:CS,VersionedHash:$2},Symbol.toStringTag,{value:"Module"})),{Epoch:et,Gwei:VC,UintNum64:XQ,Slot:$Q,Root:tt,BLSSignature:_I,UintBn256:aS,Bytes32:jC,BLSPubkey:IC,DepositIndex:sS,UintBn64:hS,ExecutionAddress:ka,ValidatorIndex:gC,CommitteeIndex:lS}=Dg,Ja=new EI(jC,w1),Et=new EI(jC,kg),pa=new EI(jC,rQ),Ha=new dQ(lC*Ki),Ma=new $I(Ki),ot=new LI(gC,lC*Ki),Ai=new Y({aggregationBits:Ha,data:UB,signature:_I,committeeBits:Ma},{typeName:"Attestation",jsonCase:"eth2"}),DS=new Y({committeeIndex:lS,attesterIndex:gC,data:UB,signature:_I},{typeName:"SingleAttestation",jsonCase:"eth2"}),cS=new Y({attestingIndices:ot,data:UB,signature:_I},{typeName:"IndexedAttestation",jsonCase:"eth2"}),rt=new Y({attestingIndices:ot,data:Ye,signature:_I},{typeName:"IndexedAttestation",jsonCase:"eth2"}),nt=new Y({attestation1:rt,attestation2:rt},{typeName:"AttesterSlashing",jsonCase:"eth2"}),ma=new Y({aggregatorIndex:gC,aggregate:Ai,selectionProof:_I},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),US=new Y({message:ma,signature:_I},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),La=new Y({pubkey:IC,withdrawalCredentials:jC,amount:XQ,signature:_I,index:sS},{typeName:"DepositRequest",jsonCase:"eth2"}),Ka=new yA(La,e1),Ya=new Y({sourceAddress:ka,validatorPubkey:IC,amount:VC},{typeName:"WithdrawalRequest",jsonCase:"eth2"}),ba=new yA(Ya,t1),Ta=new Y({sourceAddress:ka,sourcePubkey:IC,targetPubkey:IC},{typeName:"ConsolidationRequest",jsonCase:"eth2"}),qa=new yA(Ta,i1),ZC=new Y({deposits:Ka,withdrawals:ba,consolidations:qa},{typeName:"ExecutionRequests",jsonCase:"eth2"}),Ii=AC,at=xQ,gi=new Y({randaoReveal:vA.fields.randaoReveal,eth1Data:vA.fields.eth1Data,graffiti:vA.fields.graffiti,proposerSlashings:vA.fields.proposerSlashings,attesterSlashings:new yA(nt,Do),attestations:new yA(Ai,co),deposits:vA.fields.deposits,voluntaryExits:vA.fields.voluntaryExits,syncAggregate:gg.fields.syncAggregate,executionPayload:at,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:zQ.fields.blobKzgCommitments,executionRequests:ZC},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),_C=new Y({...vQ.fields,body:gi},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Bi=new Y({message:_C,signature:_I},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Va=new Y({randaoReveal:vA.fields.randaoReveal,eth1Data:vA.fields.eth1Data,graffiti:vA.fields.graffiti,proposerSlashings:vA.fields.proposerSlashings,attesterSlashings:new yA(nt,Do),attestations:new yA(Ai,co),deposits:vA.fields.deposits,voluntaryExits:vA.fields.voluntaryExits,syncAggregate:cI,executionPayloadHeader:Ii,blsToExecutionChanges:NB.fields.blsToExecutionChanges,blobKzgCommitments:zQ.fields.blobKzgCommitments,executionRequests:ZC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ja=new Y({...it.fields,body:Va},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),fS=new Y({message:ja,signature:_I},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Za=new Y({header:Ii,blobKzgCommitments:Sg,executionRequests:ZC,value:aS,pubkey:IC},{typeName:"BuilderBid",jsonCase:"eth2"}),SS=new Y({message:Za,signature:_I},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),_a=new Y({pubkey:IC,withdrawalCredentials:jC,amount:XQ,signature:_I,slot:$Q},{typeName:"PendingDeposit",jsonCase:"eth2"}),Pa=new yA(_a,B1),Oa=new Y({validatorIndex:gC,amount:VC,withdrawableEpoch:et},{typeName:"PendingPartialWithdrawal",jsonCase:"eth2"}),xa=new yA(Oa,C1),za=new Y({sourceIndex:gC,targetIndex:gC},{typeName:"PendingConsolidation",jsonCase:"eth2"}),va=new yA(za,Q1),PC=new Y({genesisTime:XQ,genesisValidatorsRoot:tt,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(tt,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:XQ,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadHeader:Ii,nextWithdrawalIndex:Bg.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:Bg.fields.nextWithdrawalValidatorIndex,historicalSummaries:Bg.fields.historicalSummaries,depositRequestsStartIndex:hS,depositBalanceToConsume:VC,exitBalanceToConsume:VC,earliestExitEpoch:et,consolidationBalanceToConsume:VC,earliestConsolidationEpoch:et,pendingDeposits:Pa,pendingPartialWithdrawals:xa,pendingConsolidations:va},{typeName:"BeaconState",jsonCase:"eth2"}),Wa=new Y({header:FI,currentSyncCommittee:WA,currentSyncCommitteeBranch:Ja},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),Xa=new Y({attestedHeader:FI,nextSyncCommittee:WA,nextSyncCommitteeBranch:pa,finalizedHeader:FI,finalityBranch:Et,syncAggregate:cI,signatureSlot:$Q},{typeName:"LightClientUpdate",jsonCase:"eth2"}),wS=new Y({attestedHeader:FI,finalizedHeader:FI,finalityBranch:Et,syncAggregate:cI,signatureSlot:$Q},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),yS=new Y({attestedHeader:FI,syncAggregate:cI,signatureSlot:$Q},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),NS=new Y({snapshot:Wa,validUpdates:new yA(Xa,Fg*SI)},{typeName:"LightClientStore",jsonCase:"eth2"}),$a=new Y({...VQ.fields,parentBeaconBlockRoot:tt},{typeName:"PayloadAttributes",jsonCase:"eth2"}),dS=new Y({...TC.fields,payloadAttributes:$a},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),uS=new Y({block:_C,kzgProofs:dB,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),RS=new Y({signedBlock:Bi,kzgProofs:dB,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),st=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:ma,AggregationBits:Ha,Attestation:Ai,AttesterSlashing:nt,AttestingIndices:ot,BeaconBlock:_C,BeaconBlockBody:gi,BeaconState:PC,BlindedBeaconBlock:ja,BlindedBeaconBlockBody:Va,BlockContents:uS,BuilderBid:Za,CommitteeBits:Ma,ConsolidationRequest:Ta,ConsolidationRequests:qa,CurrentSyncCommitteeBranch:Ja,DepositRequest:La,DepositRequests:Ka,ExecutionPayload:at,ExecutionPayloadHeader:Ii,ExecutionRequests:ZC,FinalityBranch:Et,IndexedAttestation:cS,IndexedAttestationBigint:rt,LightClientBootstrap:Wa,LightClientFinalityUpdate:wS,LightClientOptimisticUpdate:yS,LightClientStore:NS,LightClientUpdate:Xa,NextSyncCommitteeBranch:pa,PayloadAttributes:$a,PendingConsolidation:za,PendingConsolidations:va,PendingDeposit:_a,PendingDeposits:Pa,PendingPartialWithdrawal:Oa,PendingPartialWithdrawals:xa,SSEPayloadAttributes:dS,SignedAggregateAndProof:US,SignedBeaconBlock:Bi,SignedBlindedBeaconBlock:fS,SignedBlockContents:RS,SignedBuilderBid:SS,SingleAttestation:DS,WithdrawalRequest:Ya,WithdrawalRequests:ba},Symbol.toStringTag,{value:"Module"})),{Root:GS,ColumnIndex:Ci,RowIndex:FS,Bytes32:kS,Slot:As,UintNum64:Is,ValidatorIndex:JS}=Dg,pS=$B,HS=OQ,MS=new Y({...Zn.fields,custodyGroupCount:Is},{typeName:"Metadata",jsonCase:"eth2"}),mS=new Y({...Yn.fields,earliestAvailableSlot:As},{typeName:"Status",jsonCase:"eth2"}),Qi=new uI(Go*E1),ht=new yA(Qi,og),LS=new yA(ht,LB),KS=new yA(Qi,og*LB),gs=new EI(kS,r1),ii=new yA($B,o1*og),Bs=new GQ(JS,(Tl+1)*SI),BC=new Y({index:Ci,column:ht,kzgCommitments:Sg,kzgProofs:dB,signedBlockHeader:He,kzgCommitmentsInclusionProof:gs},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),YS=new yA(BC,LB),bS=new Y({cell:Qi,kzgProof:$B,columnIndex:Ci,rowIndex:FS},{typeName:"MatrixEntry",jsonCase:"eth2"}),TS=new Y({blockRoot:GS,columns:new LI(Ci,LB)},{typeName:"DataColumnsByRootIdentifier",jsonCase:"eth2"}),qS=new Y({startSlot:As,count:Is,columns:new LI(Ci,LB)},{typeName:"DataColumnSidecarsByRangeRequest",jsonCase:"eth2"}),Cs=_C,VS=Bi,jS=new Y({commitments:Sg,proofs:ii,blobs:fg},{typeName:"BlobsBundle",jsonCase:"eth2"}),Qs=new Y({...PC.fields,proposerLookahead:Bs},{typeName:"BeaconState",jsonCase:"eth2"}),ZS=new Y({block:_C,kzgProofs:ii,blobs:fg},{typeName:"BlockContents",jsonCase:"eth2"}),_S=new Y({signedBlock:Bi,kzgProofs:ii,blobs:fg},{typeName:"SignedBlockContents",jsonCase:"eth2"}),is=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Cs,BeaconState:Qs,Blob:HS,BlobsBundle:jS,BlockContents:ZS,Cell:Qi,DataColumn:ht,DataColumnSidecar:BC,DataColumnSidecars:YS,DataColumnSidecarsByRangeRequest:qS,DataColumns:LS,DataColumnsByRootIdentifier:TS,ExtendedMatrix:KS,KZGProof:pS,KZGProofs:ii,KzgCommitmentsInclusionProof:gs,MatrixEntry:bS,Metadata:MS,ProposerLookahead:Bs,SignedBeaconBlock:VS,SignedBlockContents:_S,Status:mS},Symbol.toStringTag,{value:"Module"})),{Gwei:CC,ExecutionAddress:es,ValidatorIndex:OC,Epoch:lt,BLSSignature:QC,Bytes32:Dt,Root:wg,Slot:ct,Boolean:ts,UintBn64:Es,UintNum64:os}=Dg,Ut=new Y({feeRecipient:es,amount:CC,builderIndex:OC,withdrawableEpoch:lt},{typeName:"BuilderPendingWithdrawal",jsonCase:"eth2"}),rs=new Y({weight:CC,withdrawal:Ut},{typeName:"BuilderPendingPayment",jsonCase:"eth2"}),ei=new Y({beaconBlockRoot:wg,slot:ct,payloadPresent:ts,blobDataAvailable:ts},{typeName:"PayloadAttestationData",jsonCase:"eth2"}),ns=new Y({aggregationBits:new $I(Uo),data:ei,signature:QC},{typeName:"PayloadAttestation",jsonCase:"eth2"}),PS=new Y({validatorIndex:OC,data:ei,signature:QC},{typeName:"PayloadAttestationMessage",jsonCase:"eth2"}),OS=new Y({attestingIndices:new LI(OC,Uo),data:ei,signature:QC},{typeName:"IndexedPayloadAttestation",jsonCase:"eth2"}),ft=new Y({parentBlockHash:Dt,parentBlockRoot:wg,blockHash:Dt,feeRecipient:es,gasLimit:Es,builderIndex:OC,slot:ct,value:CC,blobKzgCommitmentsRoot:wg},{typeName:"ExecutionPayloadBid",jsonCase:"eth2"}),as=new Y({message:ft,signature:QC},{typeName:"SignedExecutionPayloadBid",jsonCase:"eth2"}),ss=new Y({payload:at,executionRequests:ZC,builderIndex:OC,beaconBlockRoot:wg,slot:ct,blobKzgCommitments:Sg,stateRoot:wg},{typeName:"ExecutionPayloadEnvelope",jsonCase:"eth2"}),xS=new Y({message:ss,signature:QC},{typeName:"SignedExecutionPayloadEnvelope",jsonCase:"eth2"}),hs=new Y({randaoReveal:vA.fields.randaoReveal,eth1Data:vA.fields.eth1Data,graffiti:vA.fields.graffiti,proposerSlashings:vA.fields.proposerSlashings,attesterSlashings:gi.fields.attesterSlashings,attestations:gi.fields.attestations,deposits:vA.fields.deposits,voluntaryExits:vA.fields.voluntaryExits,syncAggregate:gg.fields.syncAggregate,blsToExecutionChanges:NB.fields.blsToExecutionChanges,signedExecutionPayloadBid:as,payloadAttestations:new yA(ns,n1)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ls=new Y({...Cs.fields,body:hs},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),zS=new Y({message:ls,signature:QC},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),vS=new Y({genesisTime:os,genesisValidatorsRoot:wg,slot:LA,fork:bg,latestBlockHeader:KI,blockRoots:cg,stateRoots:Ug,historicalRoots:new yA(wg,Rg),eth1Data:Ig,eth1DataVotes:Yg,eth1DepositIndex:os,validators:Tg,balances:qg,randaoMixes:Vg,slashings:jg,previousEpochParticipation:RI,currentEpochParticipation:RI,justificationBits:Zg,previousJustifiedCheckpoint:qA,currentJustifiedCheckpoint:qA,finalizedCheckpoint:qA,inactivityScores:fB,currentSyncCommittee:WA,nextSyncCommittee:WA,latestExecutionPayloadBid:ft,nextWithdrawalIndex:Bg.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:Bg.fields.nextWithdrawalValidatorIndex,historicalSummaries:Bg.fields.historicalSummaries,depositRequestsStartIndex:Es,depositBalanceToConsume:CC,exitBalanceToConsume:CC,earliestExitEpoch:lt,consolidationBalanceToConsume:CC,earliestConsolidationEpoch:lt,pendingDeposits:PC.fields.pendingDeposits,pendingPartialWithdrawals:PC.fields.pendingPartialWithdrawals,pendingConsolidations:PC.fields.pendingConsolidations,proposerLookahead:Qs.fields.proposerLookahead,executionPayloadAvailability:new $I(Yi),builderPendingPayments:new EI(rs,2*SI),builderPendingWithdrawals:new yA(Ut,a1),latestBlockHash:Dt,latestWithdrawalsRoot:wg},{typeName:"BeaconState",jsonCase:"eth2"}),Ds=new Y({index:BC.fields.index,column:BC.fields.column,kzgCommitments:BC.fields.kzgCommitments,kzgProofs:BC.fields.kzgProofs,beaconBlockRoot:wg},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),WS=new yA(Ds,LB),XS=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:ls,BeaconBlockBody:hs,BeaconState:vS,BuilderPendingPayment:rs,BuilderPendingWithdrawal:Ut,DataColumnSidecar:Ds,DataColumnSidecars:WS,ExecutionPayloadBid:ft,ExecutionPayloadEnvelope:ss,IndexedPayloadAttestation:OS,PayloadAttestation:ns,PayloadAttestationData:ei,PayloadAttestationMessage:PS,SignedBeaconBlock:zS,SignedExecutionPayloadBid:as,SignedExecutionPayloadEnvelope:xS},Symbol.toStringTag,{value:"Module"}));var iC;(function(I){I.builder="builder",I.engine="engine"})(iC||(iC={}));const yg={[nA.phase0]:{..._g},[nA.altair]:{..._g,...wB},[nA.bellatrix]:{..._g,...wB,...WB},[nA.capella]:{..._g,...wB,...WB,...qC},[nA.deneb]:{..._g,...wB,...WB,...qC,...WQ},[nA.electra]:{..._g,...wB,...WB,...qC,...WQ,...st},[nA.fulu]:{..._g,...wB,...WB,...qC,...WQ,...st,...is},[nA.gloas]:{..._g,...wB,...WB,...qC,...WQ,...st,...is,...XS}},NA=yg[nA.phase0],PI=yg[nA.altair],cs=yg[nA.bellatrix],Cg=yg[nA.capella],xC=yg[nA.deneb],wI=yg[nA.electra],St=yg[nA.fulu],$S=yg[nA.gloas];function MA(I,A){const g=yg[I];if(g===void 0)throw Error(`SSZ types for fork ${I} are not defined`);return A===void 0?g:g[A]}const kI=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:_B,BLSSignature:JQ,BlobIndex:Ge,Boolean:CI,Byte:en,Bytes20:tn,Bytes32:Se,Bytes4:mC,Bytes48:we,Bytes8:fe,Bytes96:ye,ColumnIndex:Je,CommitteeIndex:sB,CustodyIndex:wn,DepositIndex:hn,Domain:fn,DomainType:Un,Epoch:VI,EpochInf:nn,ExecutionAddress:ke,ForkDigest:Fe,Gwei:ln,ParticipationFlags:Sn,Root:hB,RowIndex:yn,Slot:LA,SubcommitteeIndex:Re,SyncPeriod:an,Uint16:on,Uint32:Ne,Uint8:En,UintBn128:rn,UintBn256:ue,UintBn64:ZB,UintNum64:RA,UintNumInf64:de,ValidatorIndex:zA,Version:cn,Wei:Dn,WithdrawalIndex:sn,altair:PI,bellatrix:cs,capella:Cg,deneb:xC,electra:wI,fulu:St,gloas:$S,phase0:NA,sszTypesFor:MA},Symbol.toStringTag,{value:"Module"}));function Ng(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===kg}function Us(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===kg}function Aw(I){const A={name:nA.phase0,seq:mA.phase0,epoch:h1,version:I.GENESIS_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},g={name:nA.altair,seq:mA.altair,epoch:I.ALTAIR_FORK_EPOCH,version:I.ALTAIR_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},B={name:nA.bellatrix,seq:mA.bellatrix,epoch:I.BELLATRIX_FORK_EPOCH,version:I.BELLATRIX_FORK_VERSION,prevVersion:I.ALTAIR_FORK_VERSION,prevForkName:nA.altair},i={name:nA.capella,seq:mA.capella,epoch:I.CAPELLA_FORK_EPOCH,version:I.CAPELLA_FORK_VERSION,prevVersion:I.BELLATRIX_FORK_VERSION,prevForkName:nA.bellatrix},Q={name:nA.deneb,seq:mA.deneb,epoch:I.DENEB_FORK_EPOCH,version:I.DENEB_FORK_VERSION,prevVersion:I.CAPELLA_FORK_VERSION,prevForkName:nA.capella},C={name:nA.electra,seq:mA.electra,epoch:I.ELECTRA_FORK_EPOCH,version:I.ELECTRA_FORK_VERSION,prevVersion:I.DENEB_FORK_VERSION,prevForkName:nA.deneb},e={name:nA.fulu,seq:mA.fulu,epoch:I.FULU_FORK_EPOCH,version:I.FULU_FORK_VERSION,prevVersion:I.ELECTRA_FORK_VERSION,prevForkName:nA.electra},o={name:nA.gloas,seq:mA.gloas,epoch:I.GLOAS_FORK_EPOCH,version:I.GLOAS_FORK_VERSION,prevVersion:I.FULU_FORK_VERSION,prevForkName:nA.fulu},c={phase0:A,altair:g,bellatrix:B,capella:i,deneb:Q,electra:C,fulu:e,gloas:o},a=Object.values(c),f=Object.values(c).reverse(),R=[...I.BLOB_SCHEDULE].sort((S,u)=>u.EPOCH-S.EPOCH),y=[...a.map(S=>({fork:S.name,epoch:S.epoch})),...I.BLOB_SCHEDULE.map(S=>({fork:f.find(u=>S.EPOCH>=u.epoch)?.name??A.name,epoch:S.EPOCH}))].filter(({epoch:S})=>S!==1/0).sort((S,u)=>S.epoch-u.epoch),G=[...y].reverse();return{forks:c,forksAscendingEpochOrder:a,forksDescendingEpochOrder:f,forkBoundariesAscendingEpochOrder:y,forkBoundariesDescendingEpochOrder:G,getForkInfo(S){const u=Math.floor(Math.max(S,0)/SI);return this.getForkInfoAtEpoch(u)},getForkInfoAtEpoch(S){return c[this.getForkBoundaryAtEpoch(S).fork]},getForkBoundaryAtEpoch(S){S<0&&(S=0);for(const u of G)if(S>=u.epoch)return u;throw Error("Unreachable as phase0 is scheduled at epoch 0")},getForkName(S){return this.getForkInfo(S).name},getForkSeq(S){return this.getForkInfo(S).seq},getForkSeqAtEpoch(S){return this.getForkInfoAtEpoch(S).seq},getForkVersion(S){return this.getForkInfo(S).version},getForkTypes(S){return MA(this.getForkName(S))},getPostBellatrixForkTypes(S){const u=this.getForkName(S);if(!eQ(u))throw Error(`Invalid slot=${S} fork=${u} for post-bellatrix fork types`);return MA(u)},getPostAltairForkTypes(S){const u=this.getForkName(S);if(!Li(u))throw Error(`Invalid slot=${S} fork=${u} for post-altair fork types`);return MA(u)},getPostDenebForkTypes(S){const u=this.getForkName(S);if(!fI(u))throw Error(`Invalid slot=${S} fork=${u} for post-deneb fork types`);return MA(u)},getMaxBlobsPerBlock(S){switch(this.getForkInfoAtEpoch(S).name){case nA.electra:return I.MAX_BLOBS_PER_BLOCK_ELECTRA;case nA.deneb:return I.MAX_BLOBS_PER_BLOCK}return this.getBlobParameters(S).maxBlobsPerBlock},getBlobParameters(S){if(S<I.FULU_FORK_EPOCH)throw Error(`getBlobParameters is not available pre-fulu epoch=${S}`);for(const u of R)if(S>=u.EPOCH)return{epoch:u.EPOCH,maxBlobsPerBlock:u.MAX_BLOBS_PER_BLOCK};return{epoch:I.ELECTRA_FORK_EPOCH,maxBlobsPerBlock:I.MAX_BLOBS_PER_BLOCK_ELECTRA}},getAttestationDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS)},getAggregateDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS)},getSyncMessageDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS)},getSyncContributionDueMs(S){return tQ(S)?this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS)},getProposerReorgCutoffMs(S){return this.getSlotComponentDurationMs(I.PROPOSER_REORG_CUTOFF_BPS)},getSlotComponentDurationMs(S){return Math.round(S*I.SLOT_DURATION_MS/S1)}}}function Iw(I,A){const g=new Map,B=new Map,i=new Map,Q=new Map,{forkBoundariesAscendingEpochOrder:C}=I;for(let e=0;e<C.length;e++){const o=C[e],c=C[e+1],a=o.epoch,f=c!==void 0?c.epoch:1/0;if(a===f)continue;const R=gw(I,A,a),y=ti(R);Q.set(y,a),B.set(a,R),i.set(a,y)}return{genesisValidatorsRoot:A,getDomain(e,o,c){const a=Math.floor((c??e)/SI),f=I.getForkInfo(e),R=a<f.epoch?f.prevForkName:f.name,y=I.forks[R];let G=g.get(y.name);G||(G=new Map,g.set(y.name,G));let S=G.get(o);return S||(S=Ss(o,y.version,A),G.set(o,S)),S},getDomainAtFork(e,o){const c=I.forks[e];let a=g.get(c.name);a||(a=new Map,g.set(c.name,a));let f=a.get(o);return f||(f=Ss(o,c.version,A),a.set(o,f)),f},getDomainForVoluntaryExit(e,o){return e<I.DENEB_FORK_EPOCH*SI?this.getDomain(e,So,o):this.getDomainAtFork(nA.capella,So)},forkDigest2ForkBoundary(e){const o=ti(e),c=Q.get(o);if(c==null)throw Error(`Unknown forkDigest ${o}`);return I.getForkBoundaryAtEpoch(c)},forkDigest2ForkBoundaryOption(e){const o=ti(e),c=Q.get(o);return c==null?null:I.getForkBoundaryAtEpoch(c)},forkBoundary2ForkDigest(e){const o=B.get(e.epoch);if(!o)throw Error(`No precomputed forkDigest for ${e.epoch}`);return o},forkBoundary2ForkDigestHex(e){const o=i.get(e.epoch);if(!o)throw Error(`No precomputed forkDigest for ${e.epoch}`);return ti(o)}}}function Ss(I,A,g){const B=ws(A,g),i=new Uint8Array(32);return i.set(I,0),i.set(B.slice(0,28),4),i}function ws(I,A){const g={currentVersion:I,genesisValidatorsRoot:A};return NA.ForkData.hashTreeRoot(g)}function ti(I){return _1(typeof I=="string"?I:rg(I))}function gw(I,A,g){const B=I.getForkInfoAtEpoch(g),i=ws(B.version,A);if(B.seq<mA.fulu)return i.slice(0,4);const Q=I.getBlobParameters(g);return M1(i,ED(JA.concat([Lo(Q.epoch,8,"le"),Lo(Q.maxBlobsPerBlock,8,"le")]))).slice(0,4)}function wt(I){const A=Tc(I);return{...A,...Aw(A)}}function ys(I,A){const g=wt(I);return{...g,...Iw(g,A)}}let QI;ug=(I=>(I.lightClientOptimisticHeader="light_client_optimistic_header",I.lightClientFinalityHeader="light_client_finality_header",I.statusChange="light_client_status_change",I))(ug||{}),function(I){I.ContentType="content-type",I.Accept="accept",I.Authorization="authorization",I.ExposeHeaders="access-control-expose-headers"}(QI||(QI={}));var JI;(function(I){I.json="application/json",I.ssz="application/octet-stream"})(JI||(JI={}));const Bw=Object.values(JI);function Cw(I,A){return I!==null&&A.includes(I)}function Qw(I){if(!I)return null;const A=I.split(";",1)[0].trim().toLowerCase();return Cw(A,Bw)?A:null}function iw(I,A,{bearerToken:g}){g&&!A.has(QI.Authorization)&&A.set(QI.Authorization,`Bearer ${g}`),(I.username||I.password)&&(A.has(QI.Authorization)||A.set(QI.Authorization,`Basic ${N1(decodeURIComponent(`${I.username}:${I.password}`))}`),I.username="",I.password="")}function yt(...I){const A=new Headers;for(const g of I)if(g)if(Array.isArray(g))for(const[B,i]of g)A.set(B,i);else if(g instanceof Headers)for(const[B,i]of g)A.set(B,i);else for(const[B,i]of Object.entries(g))A.set(B,i);return A}function yI(I,A,g=!0){const B=I[A.toLowerCase()];if(B===void 0&&g)throw Error(`${A} header is required`);return B}class ew extends Headers{getRequired(A){const g=this.get(A);if(g===null)throw Error(`${A} header is required in response`);return g}getOrDefault(A,g){return this.get(A)??g}}var uA;(function(I){I.json="json",I.ssz="ssz"})(uA||(uA={}));function tw(I){switch(I){case JI.json:return uA.json;case JI.ssz:return uA.ssz}}const kA={writeReq:()=>({}),parseReq:()=>{},schema:{}};function eC(I){return{...I,writeReqSsz:()=>{throw Error("Not implemented")},parseReqSsz:()=>{throw Error("Not implemented")},onlySupport:uA.json}}const Ew={toJson:()=>{},fromJson:()=>{},serialize:()=>new Uint8Array,deserialize:()=>{}},VA={toJson:()=>{},fromJson:()=>{},toHeadersObject:()=>({}),fromHeaders:()=>{}},YA={data:Ew,meta:VA,isEmpty:!0};function dA(I,A=1/0){if(lg(I))return new yA(I,A);if(se(I))return new LI(I,A);throw Error(`Unknown type ${I.typeName}`)}function Qg(I){return{toJson:(A,g)=>I(g.version).toJson(A),fromJson:(A,g)=>I(g.version).fromJson(A),serialize:(A,g)=>I(g.version).serialize(A),deserialize:(A,g)=>I(g.version).deserialize(A)}}function ow(I){return{...I,data:{...I.data,serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},onlySupport:uA.json}}const II={data:{toJson:I=>hQ(I,"snake"),fromJson:I=>{if(typeof I!="object"||I===null)throw Error("JSON must be of type object");return hQ(I,"camel")},serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},meta:VA,onlySupport:uA.json};function gI(I){if(I=I.toLowerCase(),!(I in nA))throw Error(`Invalid version ${I}`);return I}function dg(I){if(!Li(I))throw Error(`Invalid fork=${I} for post-altair fork types`);return MA(I)}function pI(I){if(!eQ(I))throw Error(`Invalid fork=${I} for post-bellatrix fork types`);return MA(I)}var IA;(function(I){I[I.Uint=0]="Uint",I[I.UintRequired=1]="UintRequired",I[I.UintArray=2]="UintArray",I[I.String=3]="String",I[I.StringRequired=4]="StringRequired",I[I.StringArray=5]="StringArray",I[I.StringArrayRequired=6]="StringArrayRequired",I[I.UintOrStringRequired=7]="UintOrStringRequired",I[I.UintOrStringArray=8]="UintOrStringArray",I[I.Object=9]="Object",I[I.ObjectArray=10]="ObjectArray",I[I.AnyArray=11]="AnyArray",I[I.Boolean=12]="Boolean"})(IA||(IA={}));function rw(I){return I.method==="GET"||I.req.schema.body===void 0}var zg;(function(I){I.String="String",I.Variable="Variable"})(zg||(zg={}));function nw(I){const A=[];let g=0,B=!1;for(let i=0,Q=I.length;i<Q;i++)switch(I[i]){case"{":{if(B)throw Error(`Invalid path variable not closed: ${I}`);i>g&&A.push({type:zg.String,str:I.slice(g,i)}),g=i+1,B=!0;break}case"}":{if(!B)throw Error(`Invalid path variable not open: ${I}`);if(g===i)throw Error(`Empty variable: ${I}`);A.push({type:zg.Variable,var:I.slice(g,i)}),B=!1,g=i+1;break}}if(B)throw Error(`Invalid path variable not closed: ${I}`);return g<I.length&&A.push({type:zg.String,str:I.slice(g)}),A}function aw(I){const A=nw(I);if(A.length===1&&A[0].type===zg.String)return()=>I;const g=A.map(B=>{switch(B.type){case zg.String:return()=>B.str;case zg.Variable:{const i=B.var;return Q=>Q[i]}}});return function(B){let i="";for(const Q of g)i+=Q(B);return i}}function sw(I){const A=parseInt(I,10);if(!Number.isFinite(A))throw Error(`Invalid uin64 ${I}`);return A}function hw(I){return I.toString(10)}function zC(I){return I?.map(A=>typeof A=="string"?A:hw(A))}function vC(I){return I?.map(A=>typeof A=="string"&&A.startsWith("0x")?A:sw(A))}const Ei=66;function lw(I){if(I===void 0)return;const A=rg(new TextEncoder().encode(I));return A.length>Ei?A.slice(0,Ei):A.length<Ei?A.padEnd(Ei,"0"):A}function Dw(I){if(I!==void 0)try{return new TextDecoder("utf8").decode(aA(I))}catch{return I}}function uB(I){if(I=I.toLowerCase(),I!=="true"&&I!=="false")throw Error(`Invalid boolean ${I}`);return I==="true"}const RB=new Y({version:new vB});RB.fields.version.fromJson=I=>gI(Og.fromJson(I));const WC=new Y({executionOptimistic:CI},{jsonCase:"eth2"}),Nt=new Y({...WC.fields,finalized:CI},{jsonCase:"eth2"});new Y({...WC.fields,...RB.fields},{jsonCase:"eth2"});const Ns=new Y({...Nt.fields,...RB.fields},{jsonCase:"eth2"}),ds=new Y({...WC.fields,dependentRoot:Og},{jsonCase:"eth2"});var lA;(function(I){I.Version="Eth-Consensus-Version",I.ConsensusBlockValue="Eth-Consensus-Block-Value",I.ExecutionPayloadBlinded="Eth-Execution-Payload-Blinded",I.ExecutionPayloadValue="Eth-Execution-Payload-Value",I.Finalized="Eth-Consensus-Finalized",I.DependentRoot="Eth-Consensus-Dependent-Root",I.ExecutionOptimistic="Eth-Execution-Optimistic",I.ExecutionPayloadSource="Eth-Execution-Payload-Source"})(lA||(lA={}));const cw={toJson:I=>WC.toJson(I),fromJson:I=>WC.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[QI.ExposeHeaders]:lA.ExecutionOptimistic}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false"))})},vg={toJson:I=>RB.toJson(I),fromJson:I=>RB.fromJson(I),toHeadersObject:I=>({[lA.Version]:I.version,[QI.ExposeHeaders]:lA.Version}),fromHeaders:I=>({version:gI(I.getRequired(lA.Version))})},AI={toJson:I=>Nt.toJson(I),fromJson:I=>Nt.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[lA.Finalized]:I.finalized.toString(),[QI.ExposeHeaders]:[lA.ExecutionOptimistic,lA.Finalized].toString()}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false")),finalized:uB(I.getOrDefault(lA.Finalized,"false"))})},OI={toJson:I=>Ns.toJson(I),fromJson:I=>Ns.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[lA.Finalized]:I.finalized.toString(),[lA.Version]:I.version,[QI.ExposeHeaders]:[lA.ExecutionOptimistic,lA.Finalized,lA.Version].toString()}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false")),finalized:uB(I.getOrDefault(lA.Finalized,"false")),version:gI(I.getRequired(lA.Version))})},us={toJson:I=>ds.toJson(I),fromJson:I=>ds.fromJson(I),toHeadersObject:I=>({[lA.ExecutionOptimistic]:I.executionOptimistic.toString(),[lA.DependentRoot]:I.dependentRoot,[QI.ExposeHeaders]:[lA.ExecutionOptimistic,lA.DependentRoot].toString()}),fromHeaders:I=>({executionOptimistic:uB(I.getOrDefault(lA.ExecutionOptimistic,"false")),dependentRoot:I.getRequired(lA.DependentRoot)})},Rs=new Y({root:hB,canonical:CI,header:NA.SignedBeaconBlockHeader}),Uw=new yA(Rs,1e3),Gs=new Y({root:hB});var Fs;(function(I){I.none="none",I.gossip="gossip",I.consensus="consensus",I.consensusAndEquivocation="consensus_and_equivocation"})(Fs||(Fs={}));const tC={writeReq:({blockId:I})=>({params:{block_id:I.toString()}}),parseReq:({params:I})=>({blockId:I.block_id}),schema:{params:{block_id:IA.StringRequired}}};function fw(I){return{getBlockV2:{url:"/eth/v2/beacon/blocks/{block_id}",method:"GET",req:tC,resp:{data:Qg(A=>kI[A].SignedBeaconBlock),meta:OI}},getBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks/{block_id}",method:"GET",req:tC,resp:{data:Qg(A=>eQ(A)?kI[A].SignedBlindedBeaconBlock:kI[A].SignedBeaconBlock),meta:OI}},getBlockAttestations:{url:"/eth/v1/beacon/blocks/{block_id}/attestations",method:"GET",req:tC,resp:{data:NA.BeaconBlockBody.fields.attestations,meta:AI}},getBlockAttestationsV2:{url:"/eth/v2/beacon/blocks/{block_id}/attestations",method:"GET",req:tC,resp:{data:Qg(A=>kI[A].BeaconBlockBody.fields.attestations),meta:OI}},getBlockHeader:{url:"/eth/v1/beacon/headers/{block_id}",method:"GET",req:tC,resp:{data:Rs,meta:AI}},getBlockHeaders:{url:"/eth/v1/beacon/headers",method:"GET",req:{writeReq:({slot:A,parentRoot:g})=>({query:{slot:A,parent_root:g}}),parseReq:({query:A})=>({slot:A.slot,parentRoot:A.parent_root}),schema:{query:{slot:IA.Uint,parent_root:IA.String}}},resp:{data:Uw,meta:AI}},getBlockRoot:{url:"/eth/v1/beacon/blocks/{block_id}/root",method:"GET",req:tC,resp:{data:Gs,meta:AI}},publishBlock:{url:"/eth/v1/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:fI(B)?MA(B).SignedBlockContents.toJson(A):MA(B).SignedBeaconBlock.toJson(A.signedBlock),headers:{[lA.Version]:I.getForkName(g)}}},parseReqJson:({body:A,headers:g})=>{let B;const i=yI(g,lA.Version,!1);return i!==void 0?B=gI(i):B=I.getForkName(A.signed_block!==void 0?A.signed_block.message.slot:A.message.slot),{signedBlockContents:fI(B)?MA(B).SignedBlockContents.fromJson(A):{signedBlock:kI[B].SignedBeaconBlock.fromJson(A)}}},writeReqSsz:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:fI(B)?MA(B).SignedBlockContents.serialize(A):MA(B).SignedBeaconBlock.serialize(A.signedBlock),headers:{[lA.Version]:I.getForkName(g)}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedBlockContents:fI(B)?MA(B).SignedBlockContents.deserialize(A):{signedBlock:kI[B].SignedBeaconBlock.deserialize(A)}}},schema:{body:IA.Object,headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},publishBlockV2:{url:"/eth/v2/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,i=I.getForkName(B);return{body:fI(i)?MA(i).SignedBlockContents.toJson(A):MA(i).SignedBeaconBlock.toJson(A.signedBlock),headers:{[lA.Version]:i},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlockContents:fI(i)?MA(i).SignedBlockContents.fromJson(A):{signedBlock:kI[i].SignedBeaconBlock.fromJson(A)},broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,i=I.getForkName(B);return{body:fI(i)?MA(i).SignedBlockContents.serialize(A):MA(i).SignedBeaconBlock.serialize(A.signedBlock),headers:{[lA.Version]:i},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlockContents:fI(i)?MA(i).SignedBlockContents.deserialize(A):{signedBlock:kI[i].SignedBeaconBlock.deserialize(A)},broadcastValidation:B.broadcast_validation}},schema:{body:IA.Object,query:{broadcast_validation:IA.String},headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},publishBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:pI(g).SignedBlindedBeaconBlock.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{let B;const i=yI(g,lA.Version,!1);return i!==void 0?B=gI(i):B=I.getForkName(A.message.slot),{signedBlindedBlock:pI(B).SignedBlindedBeaconBlock.fromJson(A)}},writeReqSsz:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:pI(g).SignedBlindedBeaconBlock.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedBlindedBlock:pI(B).SignedBlindedBeaconBlock.deserialize(A)}},schema:{body:IA.Object,headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},publishBlindedBlockV2:{url:"/eth/v2/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:pI(B).SignedBlindedBeaconBlock.toJson(A),headers:{[lA.Version]:B},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlindedBlock:pI(i).SignedBlindedBeaconBlock.fromJson(A),broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:pI(B).SignedBlindedBeaconBlock.serialize(A),headers:{[lA.Version]:B},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const i=gI(yI(g,lA.Version));return{signedBlindedBlock:pI(i).SignedBlindedBeaconBlock.deserialize(A),broadcastValidation:B.broadcast_validation}},schema:{body:IA.Object,query:{broadcast_validation:IA.String},headers:{[lA.Version]:IA.String}}},resp:YA,init:{requestWireFormat:uA.ssz}},getBlobSidecars:{url:"/eth/v1/beacon/blob_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:IA.StringRequired},query:{indices:IA.UintArray}}},resp:{data:xC.BlobSidecars,meta:OI}},getBlobs:{url:"/eth/v1/beacon/blobs/{block_id}",method:"GET",req:{writeReq:({blockId:A,versionedHashes:g})=>({params:{block_id:A.toString()},query:{versioned_hashes:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,versionedHashes:g.versioned_hashes?.map(B=>B.toLowerCase())}),schema:{params:{block_id:IA.StringRequired},query:{versioned_hashes:IA.StringArray}}},resp:{data:xC.Blobs,meta:AI}}}}const Wg=dA(NA.Attestation),oi=dA(wI.SingleAttestation),ks=dA(NA.Attestation),Sw=dA(wI.Attestation),Js=dA(NA.AttesterSlashing),ww=dA(wI.AttesterSlashing),yw=dA(NA.ProposerSlashing),Nw=dA(NA.SignedVoluntaryExit),XC=dA(Cg.SignedBLSToExecutionChange),ri=dA(PI.SyncCommitteeMessage);function dw(I){return{getPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:IA.Uint,committee_index:IA.Uint}}},resp:{data:ks,meta:VA}},getPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:IA.Uint,committee_index:IA.Uint}}},resp:{data:Qg(A=>xA(A)?Sw:ks),meta:vg}},getPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:Js,meta:VA}},getPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:Qg(A=>xA(A)?ww:Js),meta:vg}},getPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"GET",req:kA,resp:{data:yw,meta:VA}},getPoolVoluntaryExits:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"GET",req:kA,resp:{data:Nw,meta:VA}},getPoolBLSToExecutionChanges:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"GET",req:kA,resp:{data:XC,meta:VA}},submitPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>({body:Wg.toJson(A)}),parseReqJson:({body:A})=>({signedAttestations:Wg.fromJson(A)}),writeReqSsz:({signedAttestations:A})=>({body:Wg.serialize(A)}),parseReqSsz:({body:A})=>({signedAttestations:Wg.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},submitPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:xA(g)?oi.toJson(A):Wg.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAttestations:xA(B)?oi.fromJson(A):Wg.fromJson(A)}},writeReqSsz:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:xA(g)?oi.serialize(A):Wg.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAttestations:xA(B)?oi.deserialize(A):Wg.deserialize(A)}},schema:{body:IA.ObjectArray,headers:{[lA.Version]:IA.String}}},resp:YA},submitPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>({body:NA.AttesterSlashing.toJson(A)}),parseReqJson:({body:A})=>({attesterSlashing:NA.AttesterSlashing.fromJson(A)}),writeReqSsz:({attesterSlashing:A})=>({body:NA.AttesterSlashing.serialize(A)}),parseReqSsz:({body:A})=>({attesterSlashing:NA.AttesterSlashing.deserialize(A)}),schema:{body:IA.Object}},resp:YA},submitPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:xA(g)?wI.AttesterSlashing.toJson(A):NA.AttesterSlashing.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{attesterSlashing:xA(B)?wI.AttesterSlashing.fromJson(A):NA.AttesterSlashing.fromJson(A)}},writeReqSsz:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:xA(g)?wI.AttesterSlashing.serialize(A):NA.AttesterSlashing.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{attesterSlashing:xA(B)?wI.AttesterSlashing.deserialize(A):NA.AttesterSlashing.deserialize(A)}},schema:{body:IA.Object,headers:{[lA.Version]:IA.String}}},resp:YA},submitPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"POST",req:{writeReqJson:({proposerSlashing:A})=>({body:NA.ProposerSlashing.toJson(A)}),parseReqJson:({body:A})=>({proposerSlashing:NA.ProposerSlashing.fromJson(A)}),writeReqSsz:({proposerSlashing:A})=>({body:NA.ProposerSlashing.serialize(A)}),parseReqSsz:({body:A})=>({proposerSlashing:NA.ProposerSlashing.deserialize(A)}),schema:{body:IA.Object}},resp:YA},submitPoolVoluntaryExit:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"POST",req:{writeReqJson:({signedVoluntaryExit:A})=>({body:NA.SignedVoluntaryExit.toJson(A)}),parseReqJson:({body:A})=>({signedVoluntaryExit:NA.SignedVoluntaryExit.fromJson(A)}),writeReqSsz:({signedVoluntaryExit:A})=>({body:NA.SignedVoluntaryExit.serialize(A)}),parseReqSsz:({body:A})=>({signedVoluntaryExit:NA.SignedVoluntaryExit.deserialize(A)}),schema:{body:IA.Object}},resp:YA},submitPoolBLSToExecutionChange:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"POST",req:{writeReqJson:({blsToExecutionChanges:A})=>({body:XC.toJson(A)}),parseReqJson:({body:A})=>({blsToExecutionChanges:XC.fromJson(A)}),writeReqSsz:({blsToExecutionChanges:A})=>({body:XC.serialize(A)}),parseReqSsz:({body:A})=>({blsToExecutionChanges:XC.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},submitPoolSyncCommitteeSignatures:{url:"/eth/v1/beacon/pool/sync_committees",method:"POST",req:{writeReqJson:({signatures:A})=>({body:ri.toJson(A)}),parseReqJson:({body:A})=>({signatures:ri.fromJson(A)}),writeReqSsz:({signatures:A})=>({body:ri.serialize(A)}),parseReqSsz:({body:A})=>({signatures:ri.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA}}}const uw=new Y({proposerIndex:zA,total:RA,attestations:RA,syncAggregate:RA,proposerSlashings:RA,attesterSlashings:RA},{jsonCase:"eth2"}),ps=new Y({head:RA,target:RA,source:RA,inclusionDelay:RA,inactivity:RA},{jsonCase:"eth2"}),Rw=new Y({...ps.fields,effectiveBalance:RA},{jsonCase:"eth2"}),Gw=new Y({...ps.fields,validatorIndex:zA},{jsonCase:"eth2"}),Fw=new Y({idealRewards:dA(Rw),totalRewards:dA(Gw)},{jsonCase:"eth2"}),kw=dA(new Y({validatorIndex:zA,reward:RA},{jsonCase:"eth2"}));function Jw(I){return{getBlockRewards:{url:"/eth/v1/beacon/rewards/blocks/{block_id}",method:"GET",req:{writeReq:({blockId:A})=>({params:{block_id:A.toString()}}),parseReq:({params:A})=>({blockId:A.block_id}),schema:{params:{block_id:IA.StringRequired}}},resp:{data:uw,meta:AI}},getAttestationsRewards:{url:"/eth/v1/beacon/rewards/attestations/{epoch}",method:"POST",req:eC({writeReqJson:({epoch:A,validatorIds:g})=>({params:{epoch:A},body:zC(g)||[]}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,validatorIds:vC(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.UintOrStringArray}}),resp:{data:Fw,meta:AI}},getSyncCommitteeRewards:{url:"/eth/v1/beacon/rewards/sync_committee/{block_id}",method:"POST",req:eC({writeReqJson:({blockId:A,validatorIds:g})=>({params:{block_id:A.toString()},body:zC(g)||[]}),parseReqJson:({params:A,body:g})=>({blockId:A.block_id,validatorIds:vC(g)}),schema:{params:{block_id:IA.StringRequired},body:IA.UintOrStringArray}}),resp:{data:kw,meta:AI}}}}const pw=new Y({randao:hB}),Hw=new Y({previousJustified:NA.Checkpoint,currentJustified:NA.Checkpoint,finalized:NA.Checkpoint},{jsonCase:"eth2"}),Hs=new Y({index:zA,balance:RA,status:new vB,validator:NA.Validator}),Mw=new Y({index:zA,pubkey:_B,activationEpoch:RA},{jsonCase:"eth2"}),mw=new Y({index:sB,slot:LA,validators:dA(zA,lC)}),Lw=new Y({index:zA,balance:RA}),Kw=new Y({validators:dA(zA),validatorAggregates:dA(dA(zA))},{jsonCase:"eth2"}),Ms=dA(Hs),Yw=dA(Mw),bw=dA(mw),ms=dA(Lw),GB={writeReq:({stateId:I})=>({params:{state_id:I.toString()}}),parseReq:({params:I})=>({stateId:I.state_id}),schema:{params:{state_id:IA.StringRequired}}};function Tw(I){return{getEpochCommittees:{url:"/eth/v1/beacon/states/{state_id}/committees",method:"GET",req:{writeReq:({stateId:A,epoch:g,index:B,slot:i})=>({params:{state_id:A.toString()},query:{epoch:g,index:B,slot:i}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch,index:g.index,slot:g.slot}),schema:{params:{state_id:IA.StringRequired},query:{slot:IA.Uint,epoch:IA.Uint,index:IA.Uint}}},resp:{data:bw,meta:AI}},getEpochSyncCommittees:{url:"/eth/v1/beacon/states/{state_id}/sync_committees",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:IA.StringRequired},query:{epoch:IA.Uint}}},resp:{data:Kw,meta:AI}},getStateFinalityCheckpoints:{url:"/eth/v1/beacon/states/{state_id}/finality_checkpoints",method:"GET",req:GB,resp:{data:Hw,meta:AI}},getStateFork:{url:"/eth/v1/beacon/states/{state_id}/fork",method:"GET",req:GB,resp:{data:NA.Fork,meta:AI}},getStateRoot:{url:"/eth/v1/beacon/states/{state_id}/root",method:"GET",req:GB,resp:{data:Gs,meta:AI}},getStateRandao:{url:"/eth/v1/beacon/states/{state_id}/randao",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:IA.StringRequired},query:{epoch:IA.Uint}}},resp:{data:pw,meta:AI}},getStateValidator:{url:"/eth/v1/beacon/states/{state_id}/validators/{validator_id}",method:"GET",req:{writeReq:({stateId:A,validatorId:g})=>({params:{state_id:A.toString(),validator_id:g}}),parseReq:({params:A})=>({stateId:A.state_id,validatorId:A.validator_id}),schema:{params:{state_id:IA.StringRequired,validator_id:IA.StringRequired}}},resp:{onlySupport:uA.json,data:Hs,meta:AI}},getStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"GET",req:{writeReq:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},query:{id:g,status:B}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id,statuses:g.status}),schema:{params:{state_id:IA.StringRequired},query:{id:IA.UintOrStringArray,status:IA.StringArray}}},resp:{onlySupport:uA.json,data:Ms,meta:AI}},postStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"POST",req:eC({writeReqJson:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},body:{ids:zC(g),statuses:B}}),parseReqJson:({params:A,body:g={}})=>({stateId:A.state_id,validatorIds:vC(g.ids),statuses:g.statuses??void 0}),schema:{params:{state_id:IA.StringRequired},body:IA.Object}}),resp:{onlySupport:uA.json,data:Ms,meta:AI}},postStateValidatorIdentities:{url:"/eth/v1/beacon/states/{state_id}/validator_identities",method:"POST",req:eC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:zC(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:vC(g)}),schema:{params:{state_id:IA.StringRequired},body:IA.UintOrStringArray}}),resp:{data:Yw,meta:AI}},getStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"GET",req:{writeReq:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},query:{id:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id}),schema:{params:{state_id:IA.StringRequired},query:{id:IA.UintOrStringArray}}},resp:{data:ms,meta:AI}},postStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"POST",req:eC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:zC(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:vC(g)}),schema:{params:{state_id:IA.StringRequired},body:IA.UintOrStringArray}}),resp:{data:ms,meta:AI}},getPendingDeposits:{url:"/eth/v1/beacon/states/{state_id}/pending_deposits",method:"GET",req:GB,resp:{data:wI.PendingDeposits,meta:OI}},getPendingPartialWithdrawals:{url:"/eth/v1/beacon/states/{state_id}/pending_partial_withdrawals",method:"GET",req:GB,resp:{data:wI.PendingPartialWithdrawals,meta:OI}},getPendingConsolidations:{url:"/eth/v1/beacon/states/{state_id}/pending_consolidations",method:"GET",req:GB,resp:{data:wI.PendingConsolidations,meta:OI}},getProposerLookahead:{url:"/eth/v1/beacon/states/{state_id}/proposer_lookahead",method:"GET",req:GB,resp:{data:St.ProposerLookahead,meta:OI}}}}function qw(I){return{getGenesis:{url:"/eth/v1/beacon/genesis",method:"GET",req:kA,resp:{data:NA.Genesis,meta:VA}},...fw(I),...dw(I),...Tw(),...Jw()}}const Vw=new Y({chainId:RA,address:ke},{jsonCase:"eth2"}),jw=dA(NA.Fork);function Zw(I){return{getDepositContract:{url:"/eth/v1/config/deposit_contract",method:"GET",req:kA,resp:{data:Vw,meta:VA}},getForkSchedule:{url:"/eth/v1/config/fork_schedule",method:"GET",req:kA,resp:{data:jw,meta:VA}},getSpec:{url:"/eth/v1/config/spec",method:"GET",req:kA,resp:ow({data:{toJson:A=>A,fromJson:A=>{if(typeof A!="object"||A===null)throw Error("JSON must be of type object");return A}},meta:VA})}}}const oI=new vB,_w=new Y({executionPayloadBlockHash:oI,executionPayloadNumber:RA,executionStatus:oI,slot:LA,blockRoot:oI,parentRoot:oI,stateRoot:oI,targetRoot:oI,timeliness:CI,justifiedEpoch:VI,justifiedRoot:oI,finalizedEpoch:VI,finalizedRoot:oI,unrealizedJustifiedEpoch:VI,unrealizedJustifiedRoot:oI,unrealizedFinalizedEpoch:VI,unrealizedFinalizedRoot:oI,parent:oI,weight:Ne,bestChild:oI,bestDescendant:oI},{jsonCase:"eth2"}),Pw=new Y({slot:LA,root:oI,executionOptimistic:CI},{jsonCase:"eth2"}),Ow=new Y({slot:LA,blockRoot:oI,parentRoot:oI,justifiedEpoch:VI,finalizedEpoch:VI,weight:RA,validity:new vB,executionBlockHash:oI},{jsonCase:"eth2"}),xw=new Y({justifiedCheckpoint:NA.Checkpoint,finalizedCheckpoint:NA.Checkpoint,forkChoiceNodes:dA(Ow)},{jsonCase:"eth2"}),zw=dA(_w),vw=dA(Pw);function Ww(I){return{getDebugChainHeadsV2:{url:"/eth/v2/debug/beacon/heads",method:"GET",req:kA,resp:{data:vw,meta:VA,onlySupport:uA.json}},getDebugForkChoice:{url:"/eth/v1/debug/fork_choice",method:"GET",req:kA,resp:{data:xw,meta:VA,onlySupport:uA.json,transform:{toResponse:A=>({...A}),fromResponse:A=>({data:A})}}},getProtoArrayNodes:{url:"/eth/v0/debug/forkchoice",method:"GET",req:kA,resp:{data:zw,meta:VA,onlySupport:uA.json}},getStateV2:{url:"/eth/v2/debug/beacon/states/{state_id}",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:IA.StringRequired}}},resp:{data:Qg(A=>kI[A].BeaconState),meta:OI},init:{timeoutMs:3e5}},getDebugDataColumnSidecars:{url:"/eth/v1/debug/beacon/data_column_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:IA.StringRequired},query:{indices:IA.UintArray}}},resp:{data:St.DataColumnSidecars,meta:OI}}}}const rI=new vB,Xw=new Y({blockRoot:rI,index:Ge,slot:LA,kzgCommitment:rI,versionedHash:rI},{typeName:"BlobSidecarSSE",jsonCase:"eth2"}),$w=new Y({blockRoot:rI,index:Je,slot:LA,kzgCommitments:new LI(rI,og)},{typeName:"DataColumnSidecarSSE",jsonCase:"eth2"});var fA;(function(I){I.head="head",I.block="block",I.blockGossip="block_gossip",I.attestation="attestation",I.singleAttestation="single_attestation",I.voluntaryExit="voluntary_exit",I.proposerSlashing="proposer_slashing",I.attesterSlashing="attester_slashing",I.blsToExecutionChange="bls_to_execution_change",I.finalizedCheckpoint="finalized_checkpoint",I.chainReorg="chain_reorg",I.contributionAndProof="contribution_and_proof",I.lightClientOptimisticUpdate="light_client_optimistic_update",I.lightClientFinalityUpdate="light_client_finality_update",I.payloadAttributes="payload_attributes",I.blobSidecar="blob_sidecar",I.dataColumnSidecar="data_column_sidecar"})(fA||(fA={})),fA.head+"",fA.head,fA.block+"",fA.block,fA.blockGossip+"",fA.blockGossip,fA.attestation+"",fA.attestation,fA.singleAttestation+"",fA.singleAttestation,fA.voluntaryExit+"",fA.voluntaryExit,fA.proposerSlashing+"",fA.proposerSlashing,fA.attesterSlashing+"",fA.attesterSlashing,fA.blsToExecutionChange+"",fA.blsToExecutionChange,fA.finalizedCheckpoint+"",fA.finalizedCheckpoint,fA.chainReorg+"",fA.chainReorg,fA.contributionAndProof+"",fA.contributionAndProof,fA.lightClientOptimisticUpdate+"",fA.lightClientOptimisticUpdate,fA.lightClientFinalityUpdate+"",fA.lightClientFinalityUpdate,fA.payloadAttributes+"",fA.payloadAttributes,fA.blobSidecar+"",fA.blobSidecar,fA.dataColumnSidecar+"",fA.dataColumnSidecar;function Ay(I){return{eventstream:{url:"/eth/v1/events",method:"GET",req:{writeReq:({topics:A})=>({query:{topics:A}}),parseReq:({query:A})=>({topics:A.topics}),schema:{query:{topics:IA.StringArrayRequired}}},resp:YA}}}function Iy(I){const A=g=>({toJson:({data:B,version:i})=>({data:g(i).toJson(B),version:i}),fromJson:B=>{const{version:i}=RB.fromJson(B);return{data:g(i).fromJson(B.data),version:i}}});return{[fA.head]:new Y({slot:LA,block:rI,state:rI,epochTransition:CI,previousDutyDependentRoot:rI,currentDutyDependentRoot:rI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.block]:new Y({slot:LA,block:rI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.blockGossip]:new Y({slot:LA,block:rI},{jsonCase:"eth2"}),[fA.attestation]:{toJson:g=>{const B=I.getForkName(g.data.slot);return MA(B).Attestation.toJson(g)},fromJson:g=>{const B=I.getForkName(g.data.slot);return MA(B).Attestation.fromJson(g)}},[fA.singleAttestation]:wI.SingleAttestation,[fA.voluntaryExit]:NA.SignedVoluntaryExit,[fA.proposerSlashing]:NA.ProposerSlashing,[fA.attesterSlashing]:{toJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return MA(B).AttesterSlashing.toJson(g)},fromJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return MA(B).AttesterSlashing.fromJson(g)}},[fA.blsToExecutionChange]:Cg.SignedBLSToExecutionChange,[fA.finalizedCheckpoint]:new Y({block:rI,state:rI,epoch:VI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.chainReorg]:new Y({slot:LA,depth:RA,oldHeadBlock:rI,newHeadBlock:rI,oldHeadState:rI,newHeadState:rI,epoch:VI,executionOptimistic:CI},{jsonCase:"eth2"}),[fA.contributionAndProof]:PI.SignedContributionAndProof,[fA.payloadAttributes]:A(g=>pI(g).SSEPayloadAttributes),[fA.blobSidecar]:Xw,[fA.dataColumnSidecar]:$w,[fA.lightClientOptimisticUpdate]:A(g=>dg(g).LightClientOptimisticUpdate),[fA.lightClientFinalityUpdate]:A(g=>dg(g).LightClientFinalityUpdate)}}function gy(I){const A=Iy(I);return{toJson:g=>A[g.type].toJson(g.message),fromJson:(g,B)=>A[g].fromJson(B)}}const Ls={...Jg,PRESET_BASE:MI.gnosis,CONFIG_NAME:"gnosis",TERMINAL_TOTAL_DIFFICULTY:BigInt("8626000000000000000000058750000000000000000000"),SECONDS_PER_SLOT:5,SLOT_DURATION_MS:5e3,SECONDS_PER_ETH1_BLOCK:6,ETH1_FOLLOW_DISTANCE:1024,CHURN_LIMIT_QUOTIENT:4096,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:2,DEPOSIT_CHAIN_ID:100,DEPOSIT_NETWORK_ID:100,DEPOSIT_CONTRACT_ADDRESS:aA("0x0b98057ea310f4d31f2a452b414647007d1645d9"),MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:16384,MIN_GENESIS_TIME:1638968400,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:4096,GENESIS_FORK_VERSION:aA("0x00000064"),GENESIS_DELAY:6e3,ALTAIR_FORK_VERSION:aA("0x01000064"),ALTAIR_FORK_EPOCH:512,BELLATRIX_FORK_VERSION:aA("0x02000064"),BELLATRIX_FORK_EPOCH:385536,CAPELLA_FORK_VERSION:aA("0x03000064"),CAPELLA_FORK_EPOCH:648704,DENEB_FORK_VERSION:aA("0x04000064"),DENEB_FORK_EPOCH:889856,ELECTRA_FORK_VERSION:aA("0x05000064"),ELECTRA_FORK_EPOCH:1337856,FULU_FORK_VERSION:aA("0x06000064"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x07000064"),GLOAS_FORK_EPOCH:1/0,MAX_BLOBS_PER_BLOCK:2,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:2,MAX_BLOBS_PER_BLOCK_ELECTRA:2,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:256,BLOB_SCHEDULE:[]},By={...Ls,CONFIG_NAME:"chiado",TERMINAL_TOTAL_DIFFICULTY:BigInt("231707791542740786049188744689299064356246512"),DEPOSIT_CHAIN_ID:10200,DEPOSIT_NETWORK_ID:10200,DEPOSIT_CONTRACT_ADDRESS:aA("0xb97036A26259B7147018913bD58a774cf91acf25"),MIN_GENESIS_TIME:1665396e3,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:6e3,GENESIS_FORK_VERSION:aA("0x0000006f"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:aA("0x0100006f"),ALTAIR_FORK_EPOCH:90,BELLATRIX_FORK_VERSION:aA("0x0200006f"),BELLATRIX_FORK_EPOCH:180,CAPELLA_FORK_VERSION:aA("0x0300006f"),CAPELLA_FORK_EPOCH:244224,DENEB_FORK_VERSION:aA("0x0400006f"),DENEB_FORK_EPOCH:516608,ELECTRA_FORK_VERSION:aA("0x0500006f"),ELECTRA_FORK_EPOCH:948224,FULU_FORK_VERSION:aA("0x0600006f"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x0700006f"),GLOAS_FORK_EPOCH:1/0,BLOB_SCHEDULE:[]},$C={...Jg,CONFIG_NAME:"ephemery",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1638471600,GENESIS_FORK_VERSION:aA("0x1000101b"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:aA("0x2000101b"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:aA("0x3000101b"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:aA("0x4000101b"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:aA("0x5000101b"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:aA("0x6000101b"),ELECTRA_FORK_EPOCH:10,FULU_FORK_VERSION:aA("0x7000101b"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:aA("0x8000101b"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:39438e3,DEPOSIT_NETWORK_ID:39438e3,DEPOSIT_CONTRACT_ADDRESS:aA("0x4242424242424242424242424242424242424242"),ETH1_FOLLOW_DISTANCE:12,BLOB_SCHEDULE:[]},Ks=6048e5,dt=Math.floor(Date.now()-$C.MIN_GENESIS_TIME)/Ks,ut={...$C,MIN_GENESIS_TIME:Ks*dt+$C.MIN_GENESIS_TIME,DEPOSIT_CHAIN_ID:$C.DEPOSIT_CHAIN_ID+dt,DEPOSIT_NETWORK_ID:$C.DEPOSIT_NETWORK_ID+dt},Cy={...Jg,CONFIG_NAME:"holesky",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:16384,MIN_GENESIS_TIME:1695902100,GENESIS_DELAY:300,GENESIS_FORK_VERSION:aA("0x01017000"),ALTAIR_FORK_VERSION:aA("0x02017000"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:aA("0x03017000"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:aA("0x04017000"),CAPELLA_FORK_EPOCH:256,DENEB_FORK_VERSION:aA("0x05017000"),DENEB_FORK_EPOCH:29696,ELECTRA_FORK_VERSION:aA("0x06017000"),ELECTRA_FORK_EPOCH:115968,FULU_FORK_VERSION:aA("0x07017000"),FULU_FORK_EPOCH:165120,GLOAS_FORK_VERSION:aA("0x08017000"),GLOAS_FORK_EPOCH:1/0,EJECTION_BALANCE:28e9,DEPOSIT_CHAIN_ID:17e3,DEPOSIT_NETWORK_ID:17e3,DEPOSIT_CONTRACT_ADDRESS:aA("0x4242424242424242424242424242424242424242"),BLOB_SCHEDULE:[{EPOCH:166400,MAX_BLOBS_PER_BLOCK:15},{EPOCH:167936,MAX_BLOBS_PER_BLOCK:21}]},Qy={...Jg,CONFIG_NAME:"hoodi",MIN_GENESIS_TIME:1742212800,GENESIS_DELAY:600,GENESIS_FORK_VERSION:aA("0x10000910"),ALTAIR_FORK_VERSION:aA("0x20000910"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:aA("0x30000910"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:aA("0x40000910"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:aA("0x50000910"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:aA("0x60000910"),ELECTRA_FORK_EPOCH:2048,FULU_FORK_VERSION:aA("0x70000910"),FULU_FORK_EPOCH:50688,GLOAS_FORK_VERSION:aA("0x80000910"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_ETH1_BLOCK:12,DEPOSIT_CHAIN_ID:560048,DEPOSIT_NETWORK_ID:560048,BLOB_SCHEDULE:[{EPOCH:52480,MAX_BLOBS_PER_BLOCK:15},{EPOCH:54016,MAX_BLOBS_PER_BLOCK:21}]},iy={...Jg,CONFIG_NAME:"mainnet",DEPOSIT_CONTRACT_ADDRESS:aA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,MIN_GENESIS_TIME:1606824e3,GENESIS_DELAY:604800},ey={...Jg,CONFIG_NAME:"sepolia",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:1300,MIN_GENESIS_TIME:1655647200,GENESIS_FORK_VERSION:aA("0x90000069"),GENESIS_DELAY:86400,ALTAIR_FORK_VERSION:aA("0x90000070"),ALTAIR_FORK_EPOCH:50,BELLATRIX_FORK_VERSION:aA("0x90000071"),BELLATRIX_FORK_EPOCH:100,TERMINAL_TOTAL_DIFFICULTY:BigInt("17000000000000000"),CAPELLA_FORK_VERSION:aA("0x90000072"),CAPELLA_FORK_EPOCH:56832,DENEB_FORK_VERSION:aA("0x90000073"),DENEB_FORK_EPOCH:132608,ELECTRA_FORK_VERSION:aA("0x90000074"),ELECTRA_FORK_EPOCH:222464,FULU_FORK_VERSION:aA("0x90000075"),FULU_FORK_EPOCH:272640,GLOAS_FORK_VERSION:aA("0x90000076"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:11155111,DEPOSIT_NETWORK_ID:11155111,DEPOSIT_CONTRACT_ADDRESS:aA("0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"),BLOB_SCHEDULE:[{EPOCH:274176,MAX_BLOBS_PER_BLOCK:15},{EPOCH:275712,MAX_BLOBS_PER_BLOCK:21}]},EC={mainnet:iy,gnosis:Ls,sepolia:ey,holesky:Cy,hoodi:Qy,chiado:By,ephemery:ut},ty={mainnet:{genesisTime:1606824023,genesisValidatorsRoot:"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"},gnosis:{genesisTime:1638993340,genesisValidatorsRoot:"0xf5dcb5564e829aab27264b9becd5dfaa017085611224cb3036f573368dbb9d47"},sepolia:{genesisTime:1655733600,genesisValidatorsRoot:"0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078"},holesky:{genesisTime:1695902400,genesisValidatorsRoot:"0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1"},hoodi:{genesisTime:1742213400,genesisValidatorsRoot:"0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"},chiado:{genesisTime:1665396300,genesisValidatorsRoot:"0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e"},ephemery:{genesisTime:ut.MIN_GENESIS_TIME+ut.GENESIS_DELAY,genesisValidatorsRoot:"0x0000000000000000000000000000000000000000000000000000000000000000"}},Ey=new yA(hB,1e4);function oy(I){let A;const g=()=>{if(A===void 0){const B=ty[I.CONFIG_NAME]?.genesisValidatorsRoot;A=ys(I,B?aA(B):D1)}return A};return{getLightClientUpdatesByRange:{url:"/eth/v1/beacon/light_client/updates",method:"GET",req:{writeReq:({startPeriod:B,count:i})=>({query:{start_period:B,count:i}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:IA.UintRequired,count:IA.UintRequired}}},resp:{data:{toJson:(B,i)=>{const Q=[];for(const[C,e]of B.entries())Q.push(dg(i.versions[C]).LightClientUpdate.toJson(e));return Q},fromJson:(B,i)=>{const Q=B,C=[];for(let e=0;e<Q.length;e++){const o=i.versions[e];C.push(dg(o).LightClientUpdate.fromJson(Q[e]))}return C},serialize:(B,i)=>{const Q=[];for(const[C,e]of B.entries()){const o=i.versions[C],c=g(),a=Math.floor(e.attestedHeader.beacon.slot/SI),f=c.forkBoundary2ForkDigest(c.getForkBoundaryAtEpoch(a)),R=dg(o).LightClientUpdate.serialize(e),y=RA.serialize(4+R.length);Q.push(y,f,R)}return JA.concat(Q)},deserialize:B=>{let i=0;const Q=[];for(;i<B.length;){const C=RA.deserialize(B.subarray(i,i+8)),e=Fe.deserialize(B.subarray(i+8,i+12)),{fork:o}=g().forkDigest2ForkBoundary(e);Q.push(dg(o).LightClientUpdate.deserialize(B.subarray(i+12,i+8+C))),i+=8+C}return Q}},meta:{toJson:B=>B,fromJson:B=>B,toHeadersObject:B=>({[lA.Version]:B.versions.join(",")}),fromHeaders:B=>{const i=B.getOrDefault(lA.Version,"");return{versions:i===""?[]:i.split(",")}}},transform:{toResponse:(B,i)=>{const Q=B,C=[];for(let e=0;e<Q.length;e++)C.push({data:Q[e],version:i.versions[e]});return C},fromResponse:B=>{if(!Array.isArray(B))throw Error("JSON is not an array");const i=[],Q={versions:[]};for(const{data:C,version:e}of B)i.push(C),Q.versions.push(gI(e));return{data:i,meta:Q}}}}},getLightClientOptimisticUpdate:{url:"/eth/v1/beacon/light_client/optimistic_update",method:"GET",req:kA,resp:{data:Qg(B=>dg(B).LightClientOptimisticUpdate),meta:vg}},getLightClientFinalityUpdate:{url:"/eth/v1/beacon/light_client/finality_update",method:"GET",req:kA,resp:{data:Qg(B=>dg(B).LightClientFinalityUpdate),meta:vg}},getLightClientBootstrap:{url:"/eth/v1/beacon/light_client/bootstrap/{block_root}",method:"GET",req:{writeReq:({blockRoot:B})=>({params:{block_root:B}}),parseReq:({params:B})=>({blockRoot:B.block_root}),schema:{params:{block_root:IA.StringRequired}}},resp:{data:Qg(B=>dg(B).LightClientBootstrap),meta:vg}},getLightClientCommitteeRoot:{url:"/eth/v0/beacon/light_client/committee_root",method:"GET",req:{writeReq:({startPeriod:B,count:i})=>({query:{start_period:B,count:i}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:IA.UintRequired,count:IA.UintRequired}}},resp:{data:Ey,meta:VA}}}}const ry=new Y({slot:LA,historicalSummaries:Cg.HistoricalSummaries,proof:dA(fe)},{jsonCase:"eth2"});function ny(I){return{writeHeapdump:{url:"/eth/v1/lodestar/write_heapdump",method:"POST",req:{writeReq:({thread:A,dirpath:g})=>({query:{thread:A,dirpath:g}}),parseReq:({query:A})=>({thread:A.thread,dirpath:A.dirpath}),schema:{query:{thread:IA.String,dirpath:IA.String}}},resp:II},writeProfile:{url:"/eth/v1/lodestar/write_profile",method:"POST",req:{writeReq:({thread:A,duration:g,dirpath:B})=>({query:{thread:A,duration:g,dirpath:B}}),parseReq:({query:A})=>({thread:A.thread,duration:A.duration,dirpath:A.dirpath}),schema:{query:{thread:IA.String,duration:IA.Uint,dirpath:IA.String}}},resp:II},getLatestWeakSubjectivityCheckpointEpoch:{url:"/eth/v1/lodestar/ws_epoch",method:"GET",req:kA,resp:II},getSyncChainsDebugState:{url:"/eth/v1/lodestar/sync_chains_debug_state",method:"GET",req:kA,resp:II},getGossipQueueItems:{url:"/eth/v1/lodestar/gossip_queue_items/:gossipType",method:"GET",req:{writeReq:({gossipType:A})=>({params:{gossipType:A}}),parseReq:({params:A})=>({gossipType:A.gossipType}),schema:{params:{gossipType:IA.StringRequired}}},resp:II},getRegenQueueItems:{url:"/eth/v1/lodestar/regen_queue_items",method:"GET",req:kA,resp:II},getBlockProcessorQueueItems:{url:"/eth/v1/lodestar/block_processor_queue_items",method:"GET",req:kA,resp:II},getStateCacheItems:{url:"/eth/v1/lodestar/state_cache_items",method:"GET",req:kA,resp:II},getGossipPeerScoreStats:{url:"/eth/v1/lodestar/gossip_peer_score_stats",method:"GET",req:kA,resp:II},getLodestarPeerScoreStats:{url:"/eth/v1/lodestar/lodestar_peer_score_stats",method:"GET",req:kA,resp:II},runGC:{url:"/eth/v1/lodestar/gc",method:"POST",req:kA,resp:YA},dropStateCache:{url:"/eth/v1/lodestar/drop_state_cache",method:"POST",req:kA,resp:YA},connectPeer:{url:"/eth/v1/lodestar/connect_peer",method:"POST",req:{writeReq:({peerId:A,multiaddrs:g})=>({query:{peerId:A,multiaddr:g}}),parseReq:({query:A})=>({peerId:A.peerId,multiaddrs:A.multiaddr}),schema:{query:{peerId:IA.StringRequired,multiaddr:IA.StringArray}}},resp:YA},disconnectPeer:{url:"/eth/v1/lodestar/disconnect_peer",method:"POST",req:{writeReq:({peerId:A})=>({query:{peerId:A}}),parseReq:({query:A})=>({peerId:A.peerId}),schema:{query:{peerId:IA.StringRequired}}},resp:YA},getPeers:{url:"/eth/v1/lodestar/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:IA.StringArray,direction:IA.StringArray}}},resp:II},getBlacklistedBlocks:{url:"/eth/v1/lodestar/blacklisted_blocks",method:"GET",req:kA,resp:II},getHistoricalSummaries:{url:"/eth/v1/lodestar/states/{state_id}/historical_summaries",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:IA.StringRequired}}},resp:{data:ry,meta:OI}},discv5GetKadValues:{url:"/eth/v1/debug/discv5_kad_values",method:"GET",req:kA,resp:II},dumpDbBucketKeys:{url:"/eth/v1/debug/dump_db_bucket_keys/:bucket",method:"GET",req:{writeReq:({bucket:A})=>({params:{bucket:A}}),parseReq:({params:A})=>({bucket:A.bucket}),schema:{params:{bucket:IA.String}}},resp:II},dumpDbStateIndex:{url:"/eth/v1/debug/dump_db_state_index",method:"GET",req:kA,resp:II}}}const Ys=new Y({peerId:Og,enr:Og,p2pAddresses:dA(Og),discoveryAddresses:dA(Og),metadata:PI.Metadata},{jsonCase:"eth2"}),ay=new Y({disconnected:RA,connecting:RA,connected:RA,disconnecting:RA},{jsonCase:"eth2"}),sy=new Y({headSlot:LA,syncDistance:LA,isSyncing:CI,isOptimistic:CI,elOffline:CI},{jsonCase:"eth2"});var bs;(function(I){I[I.READY=200]="READY",I[I.SYNCING=206]="SYNCING",I[I.NOT_INITIALIZED_OR_ISSUES=503]="NOT_INITIALIZED_OR_ISSUES"})(bs||(bs={}));function hy(I){return{getNetworkIdentity:{url:"/eth/v1/node/identity",method:"GET",req:kA,resp:{onlySupport:uA.json,data:{...II.data,toJson:A=>{const g=Ys.toJson(A),{custodyGroupCount:B}=A.metadata;return g.metadata.custody_group_count=B!==void 0?String(B):void 0,g},fromJson:A=>{const g=Ys.fromJson(A),{metadata:{custody_group_count:B}}=A;return g.metadata.custodyGroupCount=B!==void 0?parseInt(B):void 0,g}},meta:VA}},getPeers:{url:"/eth/v1/node/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:IA.StringArray,direction:IA.StringArray}}},resp:{...II,meta:{toJson:A=>A,fromJson:A=>({count:A.count}),toHeadersObject:()=>({}),fromHeaders:()=>({})},transform:{toResponse:(A,g)=>({data:A,meta:g}),fromResponse:A=>A}}},getPeer:{url:"/eth/v1/node/peers/{peer_id}",method:"GET",req:{writeReq:({peerId:A})=>({params:{peer_id:A}}),parseReq:({params:A})=>({peerId:A.peer_id}),schema:{params:{peer_id:IA.StringRequired}}},resp:II},getPeerCount:{url:"/eth/v1/node/peer_count",method:"GET",req:kA,resp:{data:ay,meta:VA}},getNodeVersion:{url:"/eth/v1/node/version",method:"GET",req:kA,resp:II},getSyncingStatus:{url:"/eth/v1/node/syncing",method:"GET",req:kA,resp:{data:sy,meta:VA}},getHealth:{url:"/eth/v1/node/health",method:"GET",req:{writeReq:({syncingStatus:A})=>({query:{syncing_status:A}}),parseReq:({query:A})=>({syncingStatus:A.syncing_status}),schema:{query:{syncing_status:IA.Uint}}},resp:YA}}}const Xg=new Y({leaves:dA(hB,1e4),descriptor:new kC(2048)});function ly(I){return{getStateProof:{url:"/eth/v0/beacon/proof/state/{state_id}",method:"GET",req:{writeReq:({stateId:A,descriptor:g})=>({params:{state_id:A},query:{format:rg(g)}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,descriptor:aA(g.format)}),schema:{params:{state_id:IA.StringRequired},query:{format:IA.StringRequired}}},resp:{data:{toJson:A=>Xg.toJson(A),fromJson:A=>({...Xg.fromJson(A),type:ZA.compactMulti}),serialize:A=>Xg.serialize(A),deserialize:A=>({...Xg.deserialize(A),type:ZA.compactMulti})},meta:vg}},getBlockProof:{url:"/eth/v0/beacon/proof/block/{block_id}",method:"GET",req:{writeReq:({blockId:A,descriptor:g})=>({params:{block_id:A},query:{format:rg(g)}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,descriptor:aA(g.format)}),schema:{params:{block_id:IA.StringRequired},query:{format:IA.StringRequired}}},resp:{data:{toJson:A=>Xg.toJson(A),fromJson:A=>({...Xg.fromJson(A),type:ZA.compactMulti}),serialize:A=>Xg.serialize(A),deserialize:A=>({...Xg.deserialize(A),type:ZA.compactMulti})},meta:vg}}}}var Ts;(function(I){I.Default="default",I.BuilderAlways="builderalways",I.ExecutionAlways="executionalways",I.MaxProfit="maxprofit",I.BuilderOnly="builderonly",I.ExecutionOnly="executiononly"})(Ts||(Ts={}));const qs=new Y({...RB.fields,executionPayloadBlinded:CI,executionPayloadValue:ZB,consensusBlockValue:ZB},{jsonCase:"eth2"}),Dy=new Y({pubkey:_B,validatorIndex:zA,committeeIndex:sB,committeeLength:RA,committeesAtSlot:RA,validatorCommitteeIndex:RA,slot:LA},{jsonCase:"eth2"}),cy=new Y({slot:LA,validatorIndex:zA,pubkey:_B},{jsonCase:"eth2"}),Uy=new Y({pubkey:_B,validatorIndex:zA,validatorSyncCommitteeIndices:dA(sB)},{jsonCase:"eth2"}),fy=new Y({validatorIndex:zA,committeeIndex:sB,committeesAtSlot:LA,slot:LA,isAggregator:CI},{jsonCase:"eth2"}),Sy=new Y({validatorIndex:zA,syncCommitteeIndices:dA(sB),untilEpoch:VI},{jsonCase:"eth2"}),wy=new Y({validatorIndex:zA,feeRecipient:Og},{jsonCase:"eth2"}),yy=new Y({validatorIndex:zA,slot:LA,selectionProof:JQ},{jsonCase:"eth2"}),Ny=new Y({validatorIndex:zA,slot:LA,subcommitteeIndex:Re,selectionProof:JQ},{jsonCase:"eth2"}),dy=new Y({index:zA,isLive:CI},{jsonCase:"eth2"}),YI=dA(zA),uy=dA(Dy),Ry=dA(cy),Gy=dA(Uy),$g=dA(NA.SignedAggregateAndProof),ni=dA(wI.SignedAggregateAndProof),ai=dA(PI.SignedContributionAndProof),si=dA(fy),hi=dA(Sy),Vs=dA(wy),AQ=dA(yy),IQ=dA(Ny),Fy=dA(dy),li=dA(cs.SignedValidatorRegistrationV1,DC);function ky(I){return{getAttesterDuties:{url:"/eth/v1/validator/duties/attester/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:YI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:YI.deserialize(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.StringArray}},resp:{data:uy,meta:us}},getProposerDuties:{url:"/eth/v1/validator/duties/proposer/{epoch}",method:"GET",req:{writeReq:({epoch:A})=>({params:{epoch:A}}),parseReq:({params:A})=>({epoch:A.epoch}),schema:{params:{epoch:IA.UintRequired}}},resp:{data:Ry,meta:us}},getSyncCommitteeDuties:{url:"/eth/v1/validator/duties/sync/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:YI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:YI.deserialize(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.StringArray}},resp:{data:Gy,meta:cw}},produceBlockV3:{url:"/eth/v3/validator/blocks/{slot}",method:"GET",req:{writeReq:({slot:A,randaoReveal:g,graffiti:B,skipRandaoVerification:i,feeRecipient:Q,builderSelection:C,builderBoostFactor:e,strictFeeRecipientCheck:o,blindedLocal:c})=>({params:{slot:A},query:{randao_reveal:rg(g),graffiti:lw(B),skip_randao_verification:py(i),fee_recipient:Q,builder_selection:C,builder_boost_factor:e?.toString(),strict_fee_recipient_check:o,blinded_local:c}}),parseReq:({params:A,query:g})=>({slot:A.slot,randaoReveal:aA(g.randao_reveal),graffiti:Dw(g.graffiti),skipRandaoVerification:Hy(g.skip_randao_verification),feeRecipient:g.fee_recipient,builderSelection:g.builder_selection,builderBoostFactor:Jy(g.builder_boost_factor),strictFeeRecipientCheck:g.strict_fee_recipient_check,blindedLocal:g.blinded_local}),schema:{params:{slot:IA.UintRequired},query:{randao_reveal:IA.StringRequired,graffiti:IA.String,skip_randao_verification:IA.String,fee_recipient:IA.String,builder_selection:IA.String,builder_boost_factor:IA.String,strict_fee_recipient_check:IA.Boolean,blinded_local:IA.Boolean}}},resp:{data:{toJson(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.toJson(A):fI(B)?MA(B).BlockContents.toJson(A):kI[B].BeaconBlock.toJson(A.block)},fromJson(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.fromJson(A):fI(B)?MA(B).BlockContents.fromJson(A):{block:kI[B].BeaconBlock.fromJson(A)}},serialize(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.serialize(A):fI(B)?MA(B).BlockContents.serialize(A):kI[B].BeaconBlock.serialize(A.block)},deserialize(A,{executionPayloadBlinded:g,version:B}){return g?pI(B).BlindedBeaconBlock.deserialize(A):fI(B)?MA(B).BlockContents.deserialize(A):{block:kI[B].BeaconBlock.deserialize(A)}}},meta:{toJson:A=>({...qs.toJson(A),execution_payload_source:A.executionPayloadSource}),fromJson:A=>{const{executionPayloadBlinded:g,...B}=qs.fromJson(A),i=A.execution_payload_source??(g===!0?iC.builder:iC.engine);return{...B,executionPayloadBlinded:g,executionPayloadSource:i}},toHeadersObject:A=>({[lA.Version]:A.version,[lA.ExecutionPayloadBlinded]:A.executionPayloadBlinded.toString(),[lA.ExecutionPayloadSource]:A.executionPayloadSource.toString(),[lA.ExecutionPayloadValue]:A.executionPayloadValue.toString(),[lA.ConsensusBlockValue]:A.consensusBlockValue.toString()}),fromHeaders:A=>{const g=uB(A.getRequired(lA.ExecutionPayloadBlinded)),B=A.get(lA.ExecutionPayloadSource)??(g===!0?iC.builder:iC.engine);return{version:gI(A.getRequired(lA.Version)),executionPayloadBlinded:g,executionPayloadSource:B,executionPayloadValue:BigInt(A.getRequired(lA.ExecutionPayloadValue)),consensusBlockValue:BigInt(A.getRequired(lA.ConsensusBlockValue))}}}}},produceAttestationData:{url:"/eth/v1/validator/attestation_data",method:"GET",req:{writeReq:({committeeIndex:A,slot:g})=>({query:{slot:g,committee_index:A}}),parseReq:({query:A})=>({committeeIndex:A.committee_index,slot:A.slot}),schema:{query:{slot:IA.UintRequired,committee_index:IA.Uint}}},resp:{data:NA.AttestationData,meta:VA}},produceSyncCommitteeContribution:{url:"/eth/v1/validator/sync_committee_contribution",method:"GET",req:{writeReq:({slot:A,subcommitteeIndex:g,beaconBlockRoot:B})=>({query:{slot:A,subcommittee_index:g,beacon_block_root:sQ(B)}}),parseReq:({query:A})=>({slot:A.slot,subcommitteeIndex:A.subcommittee_index,beaconBlockRoot:aA(A.beacon_block_root)}),schema:{query:{slot:IA.UintRequired,subcommittee_index:IA.UintRequired,beacon_block_root:IA.StringRequired}}},resp:{data:PI.SyncCommitteeContribution,meta:VA}},getAggregatedAttestation:{url:"/eth/v1/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g})=>({query:{attestation_data_root:sQ(A),slot:g}}),parseReq:({query:A})=>({attestationDataRoot:aA(A.attestation_data_root),slot:A.slot}),schema:{query:{attestation_data_root:IA.StringRequired,slot:IA.UintRequired}}},resp:{data:NA.Attestation,meta:VA}},getAggregatedAttestationV2:{url:"/eth/v2/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g,committeeIndex:B})=>({query:{attestation_data_root:rg(A),slot:g,committee_index:B}}),parseReq:({query:A})=>({attestationDataRoot:aA(A.attestation_data_root),slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{attestation_data_root:IA.StringRequired,slot:IA.UintRequired,committee_index:IA.UintRequired}}},resp:{data:Qg(A=>xA(A)?wI.Attestation:NA.Attestation),meta:vg}},publishAggregateAndProofs:{url:"/eth/v1/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>({body:$g.toJson(A)}),parseReqJson:({body:A})=>({signedAggregateAndProofs:$g.fromJson(A)}),writeReqSsz:({signedAggregateAndProofs:A})=>({body:$g.serialize(A)}),parseReqSsz:({body:A})=>({signedAggregateAndProofs:$g.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},publishAggregateAndProofsV2:{url:"/eth/v2/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:xA(g)?ni.toJson(A):$g.toJson(A),headers:{[lA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAggregateAndProofs:xA(B)?ni.fromJson(A):$g.fromJson(A)}},writeReqSsz:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:xA(g)?ni.serialize(A):$g.serialize(A),headers:{[lA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=gI(yI(g,lA.Version));return{signedAggregateAndProofs:xA(B)?ni.deserialize(A):$g.deserialize(A)}},schema:{body:IA.ObjectArray,headers:{[lA.Version]:IA.String}}},resp:YA},publishContributionAndProofs:{url:"/eth/v1/validator/contribution_and_proofs",method:"POST",req:{writeReqJson:({contributionAndProofs:A})=>({body:ai.toJson(A)}),parseReqJson:({body:A})=>({contributionAndProofs:ai.fromJson(A)}),writeReqSsz:({contributionAndProofs:A})=>({body:ai.serialize(A)}),parseReqSsz:({body:A})=>({contributionAndProofs:ai.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},prepareBeaconCommitteeSubnet:{url:"/eth/v1/validator/beacon_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:si.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:si.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:si.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:si.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},prepareSyncCommitteeSubnets:{url:"/eth/v1/validator/sync_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:hi.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:hi.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:hi.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:hi.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA},prepareBeaconProposer:{url:"/eth/v1/validator/prepare_beacon_proposer",method:"POST",req:eC({writeReqJson:({proposers:A})=>({body:Vs.toJson(A)}),parseReqJson:({body:A})=>({proposers:Vs.fromJson(A)}),schema:{body:IA.ObjectArray}}),resp:YA},submitBeaconCommitteeSelections:{url:"/eth/v1/validator/beacon_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:AQ.toJson(A)}),parseReqJson:({body:A})=>({selections:AQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:AQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:AQ.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:{data:AQ,meta:VA}},submitSyncCommitteeSelections:{url:"/eth/v1/validator/sync_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:IQ.toJson(A)}),parseReqJson:({body:A})=>({selections:IQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:IQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:IQ.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:{data:IQ,meta:VA}},getLiveness:{url:"/eth/v1/validator/liveness/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:YI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:YI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:YI.deserialize(g)}),schema:{params:{epoch:IA.UintRequired},body:IA.StringArray}},resp:{data:Fy,meta:VA}},registerValidator:{url:"/eth/v1/validator/register_validator",method:"POST",req:{writeReqJson:({registrations:A})=>({body:li.toJson(A)}),parseReqJson:({body:A})=>({registrations:li.fromJson(A)}),writeReqSsz:({registrations:A})=>({body:li.serialize(A)}),parseReqSsz:({body:A})=>({registrations:li.deserialize(A)}),schema:{body:IA.ObjectArray}},resp:YA,init:{requestWireFormat:uA.ssz}}}}function Jy(I){return I!==void 0?BigInt(I):void 0}function py(I){return I===!0?"":void 0}function Hy(I){return I!==void 0&&I===""}class My extends Error{status;operationId;constructor(A,g,B){super(`${B} failed with status ${g}: ${A}`),this.status=g,this.operationId=B}}var Di;(function(I){I[I.CONTINUE=100]="CONTINUE",I[I.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",I[I.PROCESSING=102]="PROCESSING",I[I.OK=200]="OK",I[I.CREATED=201]="CREATED",I[I.ACCEPTED=202]="ACCEPTED",I[I.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",I[I.NO_CONTENT=204]="NO_CONTENT",I[I.RESET_CONTENT=205]="RESET_CONTENT",I[I.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",I[I.MULTI_STATUS=207]="MULTI_STATUS",I[I.ALREADY_REPORTED=208]="ALREADY_REPORTED",I[I.IM_USED=226]="IM_USED",I[I.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",I[I.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",I[I.FOUND=302]="FOUND",I[I.SEE_OTHER=303]="SEE_OTHER",I[I.NOT_MODIFIED=304]="NOT_MODIFIED",I[I.USE_PROXY=305]="USE_PROXY",I[I.SWITCH_PROXY=306]="SWITCH_PROXY",I[I.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",I[I.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",I[I.BAD_REQUEST=400]="BAD_REQUEST",I[I.UNAUTHORIZED=401]="UNAUTHORIZED",I[I.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",I[I.FORBIDDEN=403]="FORBIDDEN",I[I.NOT_FOUND=404]="NOT_FOUND",I[I.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",I[I.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",I[I.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",I[I.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",I[I.CONFLICT=409]="CONFLICT",I[I.GONE=410]="GONE",I[I.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",I[I.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",I[I.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",I[I.URI_TOO_LONG=414]="URI_TOO_LONG",I[I.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",I[I.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",I[I.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",I[I.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",I[I.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",I[I.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",I[I.LOCKED=423]="LOCKED",I[I.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",I[I.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",I[I.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",I[I.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",I[I.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",I[I.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",I[I.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",I[I.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",I[I.BAD_GATEWAY=502]="BAD_GATEWAY",I[I.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",I[I.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",I[I.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",I[I.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",I[I.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",I[I.LOOP_DETECTED=508]="LOOP_DETECTED",I[I.NOT_EXTENDED=510]="NOT_EXTENDED",I[I.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Di||(Di={}));var js,Zs;function _s(){return Zs||(Zs=1,js=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var I={},A=Symbol("test"),g=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(g)!=="[object Symbol]")return!1;var B=42;I[A]=B;for(A in I)return!1;if(typeof Object.keys=="function"&&Object.keys(I).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(I).length!==0)return!1;var i=Object.getOwnPropertySymbols(I);if(i.length!==1||i[0]!==A||!Object.prototype.propertyIsEnumerable.call(I,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var Q=Object.getOwnPropertyDescriptor(I,A);if(Q.value!==B||Q.enumerable!==!0)return!1}return!0}),js}var Rt,Ps;function my(){if(Ps)return Rt;Ps=1;var I=typeof Symbol<"u"&&Symbol,A=_s();return Rt=function(){return typeof I!="function"||typeof Symbol!="function"||typeof I("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:A()},Rt}var Gt,Os;function Ly(){if(Os)return Gt;Os=1;var I={foo:{}},A=Object;return Gt=function(){return{__proto__:I}.foo===I.foo&&!({__proto__:null}instanceof A)},Gt}var Ft,xs;function Ky(){if(xs)return Ft;xs=1;var I="Function.prototype.bind called on incompatible ",A=Object.prototype.toString,g=Math.max,B="[object Function]",i=function(e,o){for(var c=[],a=0;a<e.length;a+=1)c[a]=e[a];for(var f=0;f<o.length;f+=1)c[f+e.length]=o[f];return c},Q=function(e,o){for(var c=[],a=o,f=0;a<e.length;a+=1,f+=1)c[f]=e[a];return c},C=function(e,o){for(var c="",a=0;a<e.length;a+=1)c+=e[a],a+1<e.length&&(c+=o);return c};return Ft=function(e){var o=this;if(typeof o!="function"||A.apply(o)!==B)throw new TypeError(I+o);for(var c=Q(arguments,1),a,f=function(){if(this instanceof a){var u=o.apply(this,i(c,arguments));return Object(u)===u?u:this}return o.apply(e,i(c,arguments))},R=g(0,o.length-c.length),y=[],G=0;G<R;G++)y[G]="$"+G;if(a=Function("binder","return function ("+C(y,",")+"){ return binder.apply(this,arguments); }")(f),o.prototype){var S=function(){};S.prototype=o.prototype,a.prototype=new S,S.prototype=null}return a},Ft}var kt,zs;function Jt(){if(zs)return kt;zs=1;var I=Ky();return kt=Function.prototype.bind||I,kt}var pt,vs;function Yy(){if(vs)return pt;vs=1;var I=Function.prototype.call,A=Object.prototype.hasOwnProperty,g=Jt();return pt=g.call(I,A),pt}var Ht,Ws;function FB(){if(Ws)return Ht;Ws=1;var I,A=SyntaxError,g=Function,B=TypeError,i=function(sA){try{return g('"use strict"; return ('+sA+").constructor;")()}catch{}},Q=Object.getOwnPropertyDescriptor;if(Q)try{Q({},"")}catch{Q=null}var C=function(){throw new B},e=Q?function(){try{return arguments.callee,C}catch{try{return Q(arguments,"callee").get}catch{return C}}}():C,o=my()(),c=Ly()(),a=Object.getPrototypeOf||(c?function(sA){return sA.__proto__}:null),f={},R=typeof Uint8Array>"u"||!a?I:a(Uint8Array),y={"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":o&&a?a([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?I:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?I:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":o&&a?a(a([][Symbol.iterator]())):I,"%JSON%":typeof JSON=="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!o||!a?I:a(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!o||!a?I:a(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":o&&a?a(""[Symbol.iterator]()):I,"%Symbol%":o?Symbol:I,"%SyntaxError%":A,"%ThrowTypeError%":e,"%TypedArray%":R,"%TypeError%":B,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet};if(a)try{null.error}catch(sA){var G=a(a(sA));y["%Error.prototype%"]=G}var S=function sA(eA){var M;if(eA==="%AsyncFunction%")M=i("async function () {}");else if(eA==="%GeneratorFunction%")M=i("function* () {}");else if(eA==="%AsyncGeneratorFunction%")M=i("async function* () {}");else if(eA==="%AsyncGenerator%"){var V=sA("%AsyncGeneratorFunction%");V&&(M=V.prototype)}else if(eA==="%AsyncIteratorPrototype%"){var x=sA("%AsyncGenerator%");x&&a&&(M=a(x.prototype))}return y[eA]=M,M},u={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=Jt(),w=Yy(),J=N.call(Function.call,Array.prototype.concat),H=N.call(Function.apply,Array.prototype.splice),T=N.call(Function.call,String.prototype.replace),m=N.call(Function.call,String.prototype.slice),_=N.call(Function.call,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,oA=function(sA){var eA=m(sA,0,1),M=m(sA,-1);if(eA==="%"&&M!=="%")throw new A("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&eA!=="%")throw new A("invalid intrinsic syntax, expected opening `%`");var V=[];return T(sA,L,function(x,QA,z,iA){V[V.length]=z?T(iA,W,"$1"):QA||x}),V},cA=function(sA,eA){var M=sA,V;if(w(u,M)&&(V=u[M],M="%"+V[0]+"%"),w(y,M)){var x=y[M];if(x===f&&(x=S(M)),typeof x>"u"&&!eA)throw new B("intrinsic "+sA+" exists, but is not available. Please file an issue!");return{alias:V,name:M,value:x}}throw new A("intrinsic "+sA+" does not exist!")};return Ht=function(sA,eA){if(typeof sA!="string"||sA.length===0)throw new B("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof eA!="boolean")throw new B('"allowMissing" argument must be a boolean');if(_(/^%?[^%]*%?$/,sA)===null)throw new A("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=oA(sA),V=M.length>0?M[0]:"",x=cA("%"+V+"%",eA),QA=x.name,z=x.value,iA=!1,AA=x.alias;AA&&(V=AA[0],H(M,J([0,1],AA)));for(var BA=1,K=!0;BA<M.length;BA+=1){var Z=M[BA],j=m(Z,0,1),$=m(Z,-1);if((j==='"'||j==="'"||j==="`"||$==='"'||$==="'"||$==="`")&&j!==$)throw new A("property names with quotes must have matching quotes");if((Z==="constructor"||!K)&&(iA=!0),V+="."+Z,QA="%"+V+"%",w(y,QA))z=y[QA];else if(z!=null){if(!(Z in z)){if(!eA)throw new B("base intrinsic for "+sA+" exists, but the property is not available.");return}if(Q&&BA+1>=M.length){var q=Q(z,Z);K=!!q,K&&"get"in q&&!("originalValue"in q.get)?z=q.get:z=z[Z]}else K=w(z,Z),z=z[Z];K&&!iA&&(y[QA]=z)}}return z},Ht}var Xs={exports:{}},Mt,$s;function A0(){if($s)return Mt;$s=1;var I=FB(),A=I("%Object.defineProperty%",!0),g=function(){if(A)try{return A({},"a",{value:1}),!0}catch{return!1}return!1};return g.hasArrayLengthDefineBug=function(){if(!g())return null;try{return A([],"length",{value:1}).length!==1}catch{return!0}},Mt=g,Mt}var mt,I0;function Lt(){if(I0)return mt;I0=1;var I=FB(),A=I("%Object.getOwnPropertyDescriptor%",!0);if(A)try{A([],"length")}catch{A=null}return mt=A,mt}var Kt,g0;function by(){if(g0)return Kt;g0=1;var I=A0()(),A=FB(),g=I&&A("%Object.defineProperty%",!0);if(g)try{g({},"a",{value:1})}catch{g=!1}var B=A("%SyntaxError%"),i=A("%TypeError%"),Q=Lt();return Kt=function(C,e,o){if(!C||typeof C!="object"&&typeof C!="function")throw new i("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,R=arguments.length>6?arguments[6]:!1,y=!!Q&&Q(C,e);if(g)g(C,e,{configurable:f===null&&y?y.configurable:!f,enumerable:c===null&&y?y.enumerable:!c,value:o,writable:a===null&&y?y.writable:!a});else if(R||!c&&!a&&!f)C[e]=o;else throw new B("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Kt}var Yt,B0;function Ty(){if(B0)return Yt;B0=1;var I=FB(),A=by(),g=A0()(),B=Lt(),i=I("%TypeError%"),Q=I("%Math.floor%");return Yt=function(C,e){if(typeof C!="function")throw new i("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||Q(e)!==e)throw new i("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],c=!0,a=!0;if("length"in C&&B){var f=B(C,"length");f&&!f.configurable&&(c=!1),f&&!f.writable&&(a=!1)}return(c||a||!o)&&(g?A(C,"length",e,!0,!0):A(C,"length",e)),C},Yt}var C0;function Q0(){return C0||(C0=1,function(I){var A=Jt(),g=FB(),B=Ty(),i=g("%TypeError%"),Q=g("%Function.prototype.apply%"),C=g("%Function.prototype.call%"),e=g("%Reflect.apply%",!0)||A.call(C,Q),o=g("%Object.defineProperty%",!0),c=g("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}I.exports=function(f){if(typeof f!="function")throw new i("a function is required");var R=e(A,C,arguments);return B(R,1+c(0,f.length-(arguments.length-1)),!0)};var a=function(){return e(A,Q,arguments)};o?o(I.exports,"apply",{value:a}):I.exports.apply=a}(Xs)),Xs.exports}var bt,i0;function Tt(){if(i0)return bt;i0=1;var I=FB(),A=Q0(),g=A(I("String.prototype.indexOf"));return bt=function(B,i){var Q=I(B,!!i);return typeof Q=="function"&&g(B,".prototype.")>-1?A(Q):Q},bt}const qt=J1(L1);var Vt,e0;function qy(){if(e0)return Vt;e0=1;var I=typeof Map=="function"&&Map.prototype,A=Object.getOwnPropertyDescriptor&&I?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,g=I&&A&&typeof A.get=="function"?A.get:null,B=I&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,Q=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,C=i&&Q&&typeof Q.get=="function"?Q.get:null,e=i&&Set.prototype.forEach,o=typeof WeakMap=="function"&&WeakMap.prototype,c=o?WeakMap.prototype.has:null,a=typeof WeakSet=="function"&&WeakSet.prototype,f=a?WeakSet.prototype.has:null,R=typeof WeakRef=="function"&&WeakRef.prototype,y=R?WeakRef.prototype.deref:null,G=Boolean.prototype.valueOf,S=Object.prototype.toString,u=Function.prototype.toString,N=String.prototype.match,w=String.prototype.slice,J=String.prototype.replace,H=String.prototype.toUpperCase,T=String.prototype.toLowerCase,m=RegExp.prototype.test,_=Array.prototype.concat,L=Array.prototype.join,W=Array.prototype.slice,oA=Math.floor,cA=typeof BigInt=="function"?BigInt.prototype.valueOf:null,sA=Object.getOwnPropertySymbols,eA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,M=typeof Symbol=="function"&&typeof Symbol.iterator=="object",V=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||!0)?Symbol.toStringTag:null,x=Object.prototype.propertyIsEnumerable,QA=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(U){return U.__proto__}:null);function z(U,s){if(U===1/0||U===-1/0||U!==U||U&&U>-1e3&&U<1e3||m.call(/e/,s))return s;var P=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof U=="number"){var X=U<0?-oA(-U):oA(U);if(X!==U){var hA=String(X),E=w.call(s,hA.length+1);return J.call(hA,P,"$&_")+"."+J.call(J.call(E,/([0-9]{3})/g,"$&_"),/_$/,"")}}return J.call(s,P,"$&_")}var iA=qt,AA=iA.custom,BA=k(AA)?AA:null;Vt=function U(s,P,X,hA){var E=P||{};if(EA(E,"quoteStyle")&&E.quoteStyle!=="single"&&E.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(EA(E,"maxStringLength")&&(typeof E.maxStringLength=="number"?E.maxStringLength<0&&E.maxStringLength!==1/0:E.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var D=EA(E,"customInspect")?E.customInspect:!0;if(typeof D!="boolean"&&D!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(EA(E,"indent")&&E.indent!==null&&E.indent!==" "&&!(parseInt(E.indent,10)===E.indent&&E.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(EA(E,"numericSeparator")&&typeof E.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var F=E.numericSeparator;if(typeof s>"u")return"undefined";if(s===null)return"null";if(typeof s=="boolean")return s?"true":"false";if(typeof s=="string")return hI(s,E);if(typeof s=="number"){if(s===0)return 1/0/s>0?"0":"-0";var v=String(s);return F?z(s,v):v}if(typeof s=="bigint"){var GA=String(s)+"n";return F?z(s,GA):GA}var HB=typeof E.depth>"u"?5:E.depth;if(typeof X>"u"&&(X=0),X>=HB&&HB>0&&typeof s=="object")return j(s)?"[Array]":"[Object]";var eg=t(E,X);if(typeof hA>"u")hA=[];else if(wA(hA,s)>=0)return"[Circular]";function UI(hC,Fi,Od){if(Fi&&(hA=W.call(hA),hA.push(Fi)),Od){var fl={depth:E.depth};return EA(E,"quoteStyle")&&(fl.quoteStyle=E.quoteStyle),U(hC,fl,X+1,hA)}return U(hC,E,X+1,hA)}if(typeof s=="function"&&!q(s)){var Ri=DA(s),sl=h(s,UI);return"[Function"+(Ri?": "+Ri:" (anonymous)")+"]"+(sl.length>0?" { "+L.call(sl,", ")+" }":"")}if(k(s)){var hl=M?J.call(String(s),/^(Symbol\(.*\))_[^)]*$/,"$1"):eA.call(s);return typeof s=="object"&&!M?BI(hl):hl}if(PA(s)){for(var CQ="<"+T.call(String(s.nodeName)),vE=s.attributes||[],Gi=0;Gi<vE.length;Gi++)CQ+=" "+vE[Gi].name+"="+K(Z(vE[Gi].value),"double",E);return CQ+=">",s.childNodes&&s.childNodes.length&&(CQ+="..."),CQ+="</"+T.call(String(s.nodeName))+">",CQ}if(j(s)){if(s.length===0)return"[]";var WE=h(s,UI);return eg&&!d(WE)?"["+n(WE,eg)+"]":"[ "+L.call(WE,", ")+" ]"}if(b(s)){var XE=h(s,UI);return!("cause"in Error.prototype)&&"cause"in s&&!x.call(s,"cause")?"{ ["+String(s)+"] "+L.call(_.call("[cause]: "+UI(s.cause),XE),", ")+" }":XE.length===0?"["+String(s)+"]":"{ ["+String(s)+"] "+L.call(XE,", ")+" }"}if(typeof s=="object"&&D){if(BA&&typeof s[BA]=="function"&&iA)return iA(s,{depth:HB-X});if(D!=="symbol"&&typeof s.inspect=="function")return s.inspect()}if(FA(s)){var ll=[];return B&&B.call(s,function(hC,Fi){ll.push(UI(Fi,s,!0)+" => "+UI(hC,s))}),l("Map",g.call(s),ll,eg)}if(XA(s)){var Dl=[];return e&&e.call(s,function(hC){Dl.push(UI(hC,s))}),l("Set",C.call(s),Dl,eg)}if(CA(s))return r("WeakMap");if(bA(s))return r("WeakSet");if(_A(s))return r("WeakRef");if(tA(s))return BI(UI(Number(s)));if(p(s))return BI(UI(cA.call(s)));if(rA(s))return BI(G.call(s));if(O(s))return BI(UI(String(s)));if(typeof window<"u"&&s===window)return"{ [object Window] }";if(s===TA)return"{ [object globalThis] }";if(!$(s)&&!q(s)){var $E=h(s,UI),cl=QA?QA(s)===Object.prototype:s instanceof Object||s.constructor===Object,Ao=s instanceof Object?"":"null prototype",Ul=!cl&&V&&Object(s)===s&&V in s?w.call(UA(s),8,-1):Ao?"Object":"",Pd=cl||typeof s.constructor!="function"?"":s.constructor.name?s.constructor.name+" ":"",Io=Pd+(Ul||Ao?"["+L.call(_.call([],Ul||[],Ao||[]),": ")+"] ":"");return $E.length===0?Io+"{}":eg?Io+"{"+n($E,eg)+"}":Io+"{ "+L.call($E,", ")+" }"}return String(s)};function K(U,s,P){var X=(P.quoteStyle||s)==="double"?'"':"'";return X+U+X}function Z(U){return J.call(String(U),/"/g,""")}function j(U){return UA(U)==="[object Array]"&&(!V||!(typeof U=="object"&&V in U))}function $(U){return UA(U)==="[object Date]"&&(!V||!(typeof U=="object"&&V in U))}function q(U){return UA(U)==="[object RegExp]"&&(!V||!(typeof U=="object"&&V in U))}function b(U){return UA(U)==="[object Error]"&&(!V||!(typeof U=="object"&&V in U))}function O(U){return UA(U)==="[object String]"&&(!V||!(typeof U=="object"&&V in U))}function tA(U){return UA(U)==="[object Number]"&&(!V||!(typeof U=="object"&&V in U))}function rA(U){return UA(U)==="[object Boolean]"&&(!V||!(typeof U=="object"&&V in U))}function k(U){if(M)return U&&typeof U=="object"&&U instanceof Symbol;if(typeof U=="symbol")return!0;if(!U||typeof U!="object"||!eA)return!1;try{return eA.call(U),!0}catch{}return!1}function p(U){if(!U||typeof U!="object"||!cA)return!1;try{return cA.call(U),!0}catch{}return!1}var gA=Object.prototype.hasOwnProperty||function(U){return U in this};function EA(U,s){return gA.call(U,s)}function UA(U){return S.call(U)}function DA(U){if(U.name)return U.name;var s=N.call(u.call(U),/^function\s*([\w$]+)/);return s?s[1]:null}function wA(U,s){if(U.indexOf)return U.indexOf(s);for(var P=0,X=U.length;P<X;P++)if(U[P]===s)return P;return-1}function FA(U){if(!g||!U||typeof U!="object")return!1;try{g.call(U);try{C.call(U)}catch{return!0}return U instanceof Map}catch{}return!1}function CA(U){if(!c||!U||typeof U!="object")return!1;try{c.call(U,c);try{f.call(U,f)}catch{return!0}return U instanceof WeakMap}catch{}return!1}function _A(U){if(!y||!U||typeof U!="object")return!1;try{return y.call(U),!0}catch{}return!1}function XA(U){if(!C||!U||typeof U!="object")return!1;try{C.call(U);try{g.call(U)}catch{return!0}return U instanceof Set}catch{}return!1}function bA(U){if(!f||!U||typeof U!="object")return!1;try{f.call(U,f);try{c.call(U,c)}catch{return!0}return U instanceof WeakSet}catch{}return!1}function PA(U){return!U||typeof U!="object"?!1:typeof HTMLElement<"u"&&U instanceof HTMLElement?!0:typeof U.nodeName=="string"&&typeof U.getAttribute=="function"}function hI(U,s){if(U.length>s.maxStringLength){var P=U.length-s.maxStringLength,X="... "+P+" more character"+(P>1?"s":"");return hI(w.call(U,0,s.maxStringLength),s)+X}var hA=J.call(J.call(U,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,pA);return K(hA,"single",s)}function pA(U){var s=U.charCodeAt(0),P={8:"b",9:"t",10:"n",12:"f",13:"r"}[s];return P?"\\"+P:"\\x"+(s<16?"0":"")+H.call(s.toString(16))}function BI(U){return"Object("+U+")"}function r(U){return U+" { ? }"}function l(U,s,P,X){var hA=X?n(P,X):L.call(P,", ");return U+" ("+s+") {"+hA+"}"}function d(U){for(var s=0;s<U.length;s++)if(wA(U[s],`
|
|
6
6
|
`)>=0)return!1;return!0}function t(U,s){var P;if(U.indent===" ")P=" ";else if(typeof U.indent=="number"&&U.indent>0)P=L.call(Array(U.indent+1)," ");else return null;return{base:P,prev:L.call(Array(s+1),P)}}function n(U,s){if(U.length===0)return"";var P=`
|
|
7
7
|
`+s.prev+s.base;return P+L.call(U,","+P)+`
|
|
8
8
|
`+s.prev}function h(U,s){var P=j(U),X=[];if(P){X.length=U.length;for(var hA=0;hA<U.length;hA++)X[hA]=EA(U,hA)?s(U[hA],U):""}var E=typeof sA=="function"?sA(U):[],D;if(M){D={};for(var F=0;F<E.length;F++)D["$"+E[F]]=E[F]}for(var v in U)EA(U,v)&&(P&&String(Number(v))===v&&v<U.length||M&&D["$"+v]instanceof Symbol||(m.call(/[^\w$]/,v)?X.push(s(v,U)+": "+s(U[v],U)):X.push(v+": "+s(U[v],U))));if(typeof sA=="function")for(var GA=0;GA<E.length;GA++)x.call(U,E[GA])&&X.push("["+s(E[GA])+"]: "+s(U[E[GA]],U));return X}return Vt}var jt,t0;function Vy(){if(t0)return jt;t0=1;var I=FB(),A=Tt(),g=qy(),B=I("%TypeError%"),i=I("%WeakMap%",!0),Q=I("%Map%",!0),C=A("WeakMap.prototype.get",!0),e=A("WeakMap.prototype.set",!0),o=A("WeakMap.prototype.has",!0),c=A("Map.prototype.get",!0),a=A("Map.prototype.set",!0),f=A("Map.prototype.has",!0),R=function(u,N){for(var w=u,J;(J=w.next)!==null;w=J)if(J.key===N)return w.next=J.next,J.next=u.next,u.next=J,J},y=function(u,N){var w=R(u,N);return w&&w.value},G=function(u,N,w){var J=R(u,N);J?J.value=w:u.next={key:N,next:u.next,value:w}},S=function(u,N){return!!R(u,N)};return jt=function(){var u,N,w,J={assert:function(H){if(!J.has(H))throw new B("Side channel does not contain "+g(H))},get:function(H){if(i&&H&&(typeof H=="object"||typeof H=="function")){if(u)return C(u,H)}else if(Q){if(N)return c(N,H)}else if(w)return y(w,H)},has:function(H){if(i&&H&&(typeof H=="object"||typeof H=="function")){if(u)return o(u,H)}else if(Q){if(N)return f(N,H)}else if(w)return S(w,H);return!1},set:function(H,T){i&&H&&(typeof H=="object"||typeof H=="function")?(u||(u=new i),e(u,H,T)):Q?(N||(N=new Q),a(N,H,T)):(w||(w={key:{},next:null}),G(w,H,T))}};return J},jt}var Zt,E0;function _t(){if(E0)return Zt;E0=1;var I=String.prototype.replace,A=/%20/g,g={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Zt={default:g.RFC3986,formatters:{RFC1738:function(B){return I.call(B,A,"+")},RFC3986:function(B){return String(B)}},RFC1738:g.RFC1738,RFC3986:g.RFC3986},Zt}var Pt,o0;function r0(){if(o0)return Pt;o0=1;var I=_t(),A=Object.prototype.hasOwnProperty,g=Array.isArray,B=function(){for(var S=[],u=0;u<256;++u)S.push("%"+((u<16?"0":"")+u.toString(16)).toUpperCase());return S}(),i=function(S){for(;S.length>1;){var u=S.pop(),N=u.obj[u.prop];if(g(N)){for(var w=[],J=0;J<N.length;++J)typeof N[J]<"u"&&w.push(N[J]);u.obj[u.prop]=w}}},Q=function(S,u){for(var N=u&&u.plainObjects?Object.create(null):{},w=0;w<S.length;++w)typeof S[w]<"u"&&(N[w]=S[w]);return N},C=function S(u,N,w){if(!N)return u;if(typeof N!="object"){if(g(u))u.push(N);else if(u&&typeof u=="object")(w&&(w.plainObjects||w.allowPrototypes)||!A.call(Object.prototype,N))&&(u[N]=!0);else return[u,N];return u}if(!u||typeof u!="object")return[u].concat(N);var J=u;return g(u)&&!g(N)&&(J=Q(u,w)),g(u)&&g(N)?(N.forEach(function(H,T){if(A.call(u,T)){var m=u[T];m&&typeof m=="object"&&H&&typeof H=="object"?u[T]=S(m,H,w):u.push(H)}else u[T]=H}),u):Object.keys(N).reduce(function(H,T){var m=N[T];return A.call(H,T)?H[T]=S(H[T],m,w):H[T]=m,H},J)},e=function(S,u){return Object.keys(u).reduce(function(N,w){return N[w]=u[w],N},S)},o=function(S,u,N){var w=S.replace(/\+/g," ");if(N==="iso-8859-1")return w.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(w)}catch{return w}},c=function(S,u,N,w,J){if(S.length===0)return S;var H=S;if(typeof S=="symbol"?H=Symbol.prototype.toString.call(S):typeof S!="string"&&(H=String(S)),N==="iso-8859-1")return escape(H).replace(/%u[0-9a-f]{4}/gi,function(L){return"%26%23"+parseInt(L.slice(2),16)+"%3B"});for(var T="",m=0;m<H.length;++m){var _=H.charCodeAt(m);if(_===45||_===46||_===95||_===126||_>=48&&_<=57||_>=65&&_<=90||_>=97&&_<=122||J===I.RFC1738&&(_===40||_===41)){T+=H.charAt(m);continue}if(_<128){T=T+B[_];continue}if(_<2048){T=T+(B[192|_>>6]+B[128|_&63]);continue}if(_<55296||_>=57344){T=T+(B[224|_>>12]+B[128|_>>6&63]+B[128|_&63]);continue}m+=1,_=65536+((_&1023)<<10|H.charCodeAt(m)&1023),T+=B[240|_>>18]+B[128|_>>12&63]+B[128|_>>6&63]+B[128|_&63]}return T},a=function(S){for(var u=[{obj:{o:S},prop:"o"}],N=[],w=0;w<u.length;++w)for(var J=u[w],H=J.obj[J.prop],T=Object.keys(H),m=0;m<T.length;++m){var _=T[m],L=H[_];typeof L=="object"&&L!==null&&N.indexOf(L)===-1&&(u.push({obj:H,prop:_}),N.push(L))}return i(u),S},f=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},R=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},y=function(S,u){return[].concat(S,u)},G=function(S,u){if(g(S)){for(var N=[],w=0;w<S.length;w+=1)N.push(u(S[w]));return N}return u(S)};return Pt={arrayToObject:Q,assign:e,combine:y,compact:a,decode:o,encode:c,isBuffer:R,isRegExp:f,maybeMap:G,merge:C},Pt}var Ot,n0;function jy(){if(n0)return Ot;n0=1;var I=Vy(),A=r0(),g=_t(),B=Object.prototype.hasOwnProperty,i={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,u){return S+"["+u+"]"},repeat:function(S){return S}},Q=Array.isArray,C=Array.prototype.push,e=function(S,u){C.apply(S,Q(u)?u:[u])},o=Date.prototype.toISOString,c=g.default,a={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:A.encode,encodeValuesOnly:!1,format:c,formatter:g.formatters[c],indices:!1,serializeDate:function(S){return o.call(S)},skipNulls:!1,strictNullHandling:!1},f=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},R={},y=function S(u,N,w,J,H,T,m,_,L,W,oA,cA,sA,eA,M,V){for(var x=u,QA=V,z=0,iA=!1;(QA=QA.get(R))!==void 0&&!iA;){var AA=QA.get(u);if(z+=1,typeof AA<"u"){if(AA===z)throw new RangeError("Cyclic object value");iA=!0}typeof QA.get(R)>"u"&&(z=0)}if(typeof _=="function"?x=_(N,x):x instanceof Date?x=oA(x):w==="comma"&&Q(x)&&(x=A.maybeMap(x,function(k){return k instanceof Date?oA(k):k})),x===null){if(H)return m&&!eA?m(N,a.encoder,M,"key",cA):N;x=""}if(f(x)||A.isBuffer(x)){if(m){var BA=eA?N:m(N,a.encoder,M,"key",cA);return[sA(BA)+"="+sA(m(x,a.encoder,M,"value",cA))]}return[sA(N)+"="+sA(String(x))]}var K=[];if(typeof x>"u")return K;var Z;if(w==="comma"&&Q(x))eA&&m&&(x=A.maybeMap(x,m)),Z=[{value:x.length>0?x.join(",")||null:void 0}];else if(Q(_))Z=_;else{var j=Object.keys(x);Z=L?j.sort(L):j}for(var $=J&&Q(x)&&x.length===1?N+"[]":N,q=0;q<Z.length;++q){var b=Z[q],O=typeof b=="object"&&typeof b.value<"u"?b.value:x[b];if(!(T&&O===null)){var tA=Q(x)?typeof w=="function"?w($,b):$:$+(W?"."+b:"["+b+"]");V.set(u,z);var rA=I();rA.set(R,V),e(K,S(O,tA,w,J,H,T,w==="comma"&&eA&&Q(x)?null:m,_,L,W,oA,cA,sA,eA,M,rA))}}return K},G=function(S){if(!S)return a;if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var u=S.charset||a.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var N=g.default;if(typeof S.format<"u"){if(!B.call(g.formatters,S.format))throw new TypeError("Unknown format option provided.");N=S.format}var w=g.formatters[N],J=a.filter;return(typeof S.filter=="function"||Q(S.filter))&&(J=S.filter),{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:a.addQueryPrefix,allowDots:typeof S.allowDots>"u"?a.allowDots:!!S.allowDots,charset:u,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:a.charsetSentinel,delimiter:typeof S.delimiter>"u"?a.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:a.encode,encoder:typeof S.encoder=="function"?S.encoder:a.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:a.encodeValuesOnly,filter:J,format:N,formatter:w,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:a.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:a.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:a.strictNullHandling}};return Ot=function(S,u){var N=S,w=G(u),J,H;typeof w.filter=="function"?(H=w.filter,N=H("",N)):Q(w.filter)&&(H=w.filter,J=H);var T=[];if(typeof N!="object"||N===null)return"";var m;u&&u.arrayFormat in i?m=u.arrayFormat:u&&"indices"in u?m=u.indices?"indices":"repeat":m="indices";var _=i[m];if(u&&"commaRoundTrip"in u&&typeof u.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var L=_==="comma"&&u&&u.commaRoundTrip;J||(J=Object.keys(N)),w.sort&&J.sort(w.sort);for(var W=I(),oA=0;oA<J.length;++oA){var cA=J[oA];w.skipNulls&&N[cA]===null||e(T,y(N[cA],cA,_,L,w.strictNullHandling,w.skipNulls,w.encode?w.encoder:null,w.filter,w.sort,w.allowDots,w.serializeDate,w.format,w.formatter,w.encodeValuesOnly,w.charset,W))}var sA=T.join(w.delimiter),eA=w.addQueryPrefix===!0?"?":"";return w.charsetSentinel&&(w.charset==="iso-8859-1"?eA+="utf8=%26%2310003%3B&":eA+="utf8=%E2%9C%93&"),sA.length>0?eA+sA:""},Ot}var xt,a0;function Zy(){if(a0)return xt;a0=1;var I=r0(),A=Object.prototype.hasOwnProperty,g=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:I.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(R){return R.replace(/&#(\d+);/g,function(y,G){return String.fromCharCode(parseInt(G,10))})},Q=function(R,y){return R&&typeof R=="string"&&y.comma&&R.indexOf(",")>-1?R.split(","):R},C="utf8=%26%2310003%3B",e="utf8=%E2%9C%93",o=function(R,y){var G={},S=y.ignoreQueryPrefix?R.replace(/^\?/,""):R,u=y.parameterLimit===1/0?void 0:y.parameterLimit,N=S.split(y.delimiter,u),w=-1,J,H=y.charset;if(y.charsetSentinel)for(J=0;J<N.length;++J)N[J].indexOf("utf8=")===0&&(N[J]===e?H="utf-8":N[J]===C&&(H="iso-8859-1"),w=J,J=N.length);for(J=0;J<N.length;++J)if(J!==w){var T=N[J],m=T.indexOf("]="),_=m===-1?T.indexOf("="):m+1,L,W;_===-1?(L=y.decoder(T,B.decoder,H,"key"),W=y.strictNullHandling?null:""):(L=y.decoder(T.slice(0,_),B.decoder,H,"key"),W=I.maybeMap(Q(T.slice(_+1),y),function(oA){return y.decoder(oA,B.decoder,H,"value")})),W&&y.interpretNumericEntities&&H==="iso-8859-1"&&(W=i(W)),T.indexOf("[]=")>-1&&(W=g(W)?[W]:W),A.call(G,L)?G[L]=I.combine(G[L],W):G[L]=W}return G},c=function(R,y,G,S){for(var u=S?y:Q(y,G),N=R.length-1;N>=0;--N){var w,J=R[N];if(J==="[]"&&G.parseArrays)w=[].concat(u);else{w=G.plainObjects?Object.create(null):{};var H=J.charAt(0)==="["&&J.charAt(J.length-1)==="]"?J.slice(1,-1):J,T=parseInt(H,10);!G.parseArrays&&H===""?w={0:u}:!isNaN(T)&&J!==H&&String(T)===H&&T>=0&&G.parseArrays&&T<=G.arrayLimit?(w=[],w[T]=u):H!=="__proto__"&&(w[H]=u)}u=w}return u},a=function(R,y,G,S){if(R){var u=G.allowDots?R.replace(/\.([^.[]+)/g,"[$1]"):R,N=/(\[[^[\]]*])/,w=/(\[[^[\]]*])/g,J=G.depth>0&&N.exec(u),H=J?u.slice(0,J.index):u,T=[];if(H){if(!G.plainObjects&&A.call(Object.prototype,H)&&!G.allowPrototypes)return;T.push(H)}for(var m=0;G.depth>0&&(J=w.exec(u))!==null&&m<G.depth;){if(m+=1,!G.plainObjects&&A.call(Object.prototype,J[1].slice(1,-1))&&!G.allowPrototypes)return;T.push(J[1])}return J&&T.push("["+u.slice(J.index)+"]"),c(T,y,G,S)}},f=function(R){if(!R)return B;if(R.decoder!==null&&R.decoder!==void 0&&typeof R.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof R.charset<"u"&&R.charset!=="utf-8"&&R.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof R.charset>"u"?B.charset:R.charset;return{allowDots:typeof R.allowDots>"u"?B.allowDots:!!R.allowDots,allowPrototypes:typeof R.allowPrototypes=="boolean"?R.allowPrototypes:B.allowPrototypes,allowSparse:typeof R.allowSparse=="boolean"?R.allowSparse:B.allowSparse,arrayLimit:typeof R.arrayLimit=="number"?R.arrayLimit:B.arrayLimit,charset:y,charsetSentinel:typeof R.charsetSentinel=="boolean"?R.charsetSentinel:B.charsetSentinel,comma:typeof R.comma=="boolean"?R.comma:B.comma,decoder:typeof R.decoder=="function"?R.decoder:B.decoder,delimiter:typeof R.delimiter=="string"||I.isRegExp(R.delimiter)?R.delimiter:B.delimiter,depth:typeof R.depth=="number"||R.depth===!1?+R.depth:B.depth,ignoreQueryPrefix:R.ignoreQueryPrefix===!0,interpretNumericEntities:typeof R.interpretNumericEntities=="boolean"?R.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof R.parameterLimit=="number"?R.parameterLimit:B.parameterLimit,parseArrays:R.parseArrays!==!1,plainObjects:typeof R.plainObjects=="boolean"?R.plainObjects:B.plainObjects,strictNullHandling:typeof R.strictNullHandling=="boolean"?R.strictNullHandling:B.strictNullHandling}};return xt=function(R,y){var G=f(y);if(R===""||R===null||typeof R>"u")return G.plainObjects?Object.create(null):{};for(var S=typeof R=="string"?o(R,G):R,u=G.plainObjects?Object.create(null):{},N=Object.keys(S),w=0;w<N.length;++w){var J=N[w],H=a(J,S[J],G,typeof R=="string");u=I.merge(u,H,G)}return G.allowSparse===!0?u:I.compact(u)},xt}var zt,s0;function _y(){if(s0)return zt;s0=1;var I=jy(),A=Zy(),g=_t();return zt={formats:g,parse:A,stringify:I},zt}var Py=_y();function h0(I){return Py.stringify(I,{arrayFormat:"repeat"})}function l0(...I){return I.join("/").replace(/([^:]\/)\/+/g,"$1").replace(/^(\/)+/,"/")}function Oy(I,A,g){const B=new Headers;let i;if(rw(I))i=I.req.writeReq(A);else{const e=I.req.onlySupport??g.requestWireFormat;switch(e){case uA.json:i=I.req.writeReqJson(A),i.body&&(i.body=JSON.stringify(i.body),B.set(QI.ContentType,JI.json));break;case uA.ssz:i=I.req.writeReqSsz(A),i.body&&B.set(QI.ContentType,JI.ssz);break;default:throw Error(`Invalid requestWireFormat: ${e}`)}}const Q=i.query?h0(i.query):"",C=new URL(l0(g.baseUrl,I.urlFormatter(i.params??{}))+(Q?`?${Q}`:""));if(iw(C,B,g),!I.resp.isEmpty)if(I.resp.onlySupport!==void 0)switch(I.resp.onlySupport){case uA.json:B.set(QI.Accept,JI.json);break;case uA.ssz:B.set(QI.Accept,JI.ssz);break}else switch(g.responseWireFormat){case uA.json:B.set(QI.Accept,`${JI.json};q=1,${JI.ssz};q=0.9`);break;case uA.ssz:B.set(QI.Accept,`${JI.ssz};q=1,${JI.json};q=0.9`);break;default:throw Error(`Invalid responseWireFormat: ${g.responseWireFormat}`)}return new Request(C,{...g,method:I.method,headers:yt(B,i.headers,g.headers),body:i.body})}class D0 extends Response{definition;_wireFormat;_rawBody;_errorBody;_meta;_value;constructor(A,g,B){super(g,B),this.definition=A}wireFormat(){if(this._wireFormat===void 0){if(this.definition.resp.isEmpty)return this._wireFormat=null,this._wireFormat;const A=this.headers.get(QI.ContentType);if(A===null){if(this.status===Di.NO_CONTENT)return this._wireFormat=null,this._wireFormat;throw Error("Content-Type header is required in response")}const g=Qw(A);if(g===null)throw Error(`Unsupported response media type: ${A.split(";",1)[0]}`);const B=tw(g),{onlySupport:i}=this.definition.resp;if(i!==void 0&&B!==i)throw Error(`Method only supports ${i.toUpperCase()} responses`);this._wireFormat=B}return this._wireFormat}async rawBody(){if(this.assertOk(),!this._rawBody)switch(this.wireFormat()){case uA.json:this._rawBody={type:uA.json,value:await super.json()};break;case uA.ssz:this._rawBody={type:uA.ssz,value:new Uint8Array(await this.arrayBuffer())};break;default:this._rawBody={}}return this._rawBody}meta(){if(this.assertOk(),!this._meta)switch(this.wireFormat()){case uA.json:{const A=this.resolvedRawBody(),g=this.definition.resp.transform?this.definition.resp.transform.fromResponse(A.value).meta:A.value;this._meta=this.definition.resp.meta.fromJson(g);break}case uA.ssz:this._meta=this.definition.resp.meta.fromHeaders(new ew(this.headers));break}return this._meta}value(){if(this.assertOk(),!this._value){const A=this.resolvedRawBody(),g=this.meta();switch(A.type){case uA.json:{const B=this.definition.resp.transform?this.definition.resp.transform.fromResponse(A.value).data:A.value?.data;this._value=this.definition.resp.data.fromJson(B,g);break}case uA.ssz:this._value=this.definition.resp.data.deserialize(A.value,g);break}}return this._value}ssz(){this.assertOk();const A=this.resolvedRawBody();switch(A.type){case uA.json:return this.definition.resp.data.serialize(this.value(),this.meta());case uA.ssz:return A.value;default:return new Uint8Array}}json(){this.assertOk();const A=this.resolvedRawBody();switch(A.type){case uA.json:return A.value;case uA.ssz:return this.definition.resp.data.toJson(this.value(),this.meta());default:return{}}}assertOk(){if(!this.ok)throw this.error()}error(){return this.ok?null:new My(this.getErrorMessage(),this.status,this.definition.operationId)}async errorBody(){return this._errorBody===void 0&&(this._errorBody=await this.text()),this._errorBody}resolvedRawBody(){if(!this._rawBody)throw Error("rawBody() must be called first");return this._rawBody}resolvedErrorBody(){if(this._errorBody===void 0)throw Error("errorBody() must be called first");return this._errorBody}getErrorMessage(){const A=this.resolvedErrorBody();try{const g=JSON.parse(A);return g.message?g.failures?`${g.message}
|