@wormhole-foundation/wormhole-connect 1.1.3-beta.2-development → 1.1.3-beta.3-development

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.
Files changed (102) hide show
  1. package/dist/assets/{ccip-CuVLQT8d.js → ccip-DIYM0gy6.js} +1 -1
  2. package/dist/assets/{evm-Dc3QdSOA.js → evm-Y-JIomWz.js} +4 -4
  3. package/dist/assets/{index-EVjhBEXw.js → index--B3_-qch.js} +2 -2
  4. package/dist/assets/{index-BJGeA_ds.js → index-C1YrzzPV.js} +1 -1
  5. package/dist/assets/{index-BIssGeVa.js → index-sR4FP7OJ.js} +1 -1
  6. package/dist/assets/{index.es-BObgTr8H.js → index.es-CRUh0v3x.js} +2 -2
  7. package/dist/main.js +4 -4
  8. package/lib/{algorand-CLoiUadv.mjs → algorand-D_QRI-bg.mjs} +3 -3
  9. package/lib/{algorand-BAFj4ZGa.js → algorand-wRfrbOd6.js} +1 -1
  10. package/lib/{aptos-C45UOjMk.mjs → aptos-39dGPUrb.mjs} +3 -3
  11. package/lib/{aptos-CHkHb9Wn.js → aptos-BYA8pulJ.js} +1 -1
  12. package/lib/{aptos-B0EUzhLn.mjs → aptos-D8si2udZ.mjs} +1 -1
  13. package/lib/{aptos-DLBpR9Uw.js → aptos-j2PEnEen.js} +2 -2
  14. package/lib/{ccip-D6nl66Of.mjs → ccip-CAsSiarY.mjs} +1 -1
  15. package/lib/{ccip-DwcFzOh0.js → ccip-D2DyQ2dl.js} +1 -1
  16. package/lib/{cosmos-BEyKk7pN.js → cosmos--SblITfP.js} +11 -11
  17. package/lib/{cosmos-Bc34YeqV.mjs → cosmos-5QBTeSdf.mjs} +5 -5
  18. package/lib/{cosmwasm-BBIEjp_6.mjs → cosmwasm-BvDytCXd.mjs} +3545 -3545
  19. package/lib/{cosmwasm-DPmjLuio.js → cosmwasm-qpOclFcW.js} +3 -3
  20. package/lib/{events-D9h1HjEa.mjs → events-Cq1VEeNf.mjs} +1 -1
  21. package/lib/{events-B2ZyXE4l.js → events-DSOd4gvB.js} +1 -1
  22. package/lib/{evm--fmrvZiP.js → evm-C-UXATlx.js} +4 -4
  23. package/lib/{evm-sG77B7Ln.mjs → evm-CEwMJ8_A.mjs} +6 -6
  24. package/lib/{evm-D6zAQuRU.js → evm-DG7I4Frq.js} +1 -1
  25. package/lib/{evm-DsRkB-Yc.mjs → evm-DMvzqxcS.mjs} +7 -7
  26. package/lib/{index-DinZIMWa.mjs → index-74c6g32z.mjs} +225 -225
  27. package/lib/{index-DWJ5r15M.mjs → index-7zA9RXv7.mjs} +19853 -19856
  28. package/lib/{index-Cpjj11xV.mjs → index-B8T2NaoX.mjs} +45 -45
  29. package/lib/{index-DPtc-UxP.mjs → index-B8ULFzIF.mjs} +6 -6
  30. package/lib/{index-B7Optu6I.js → index-B9Hz7aqe.js} +1 -1
  31. package/lib/{index-jydTi-hN.mjs → index-BHWO1nl8.mjs} +2 -2
  32. package/lib/{index-ByOoS9NO.js → index-BLp_eTrc.js} +1 -1
  33. package/lib/{index-CvdPwRnL.js → index-BQtbCwXd.js} +1 -1
  34. package/lib/{index-CEovIwuS.js → index-BU_DiszY.js} +92 -92
  35. package/lib/{index-XMIcJZyr.js → index-BbxY_HAX.js} +16 -16
  36. package/lib/{index-CY9fp7fB.mjs → index-Beu3v0JF.mjs} +15 -15
  37. package/lib/{index-D4u8CUKC.mjs → index-BhXfWaSE.mjs} +3 -3
  38. package/lib/{index-B9gBvn5a.mjs → index-BjeY05EL.mjs} +801 -802
  39. package/lib/{index-BT10pzLw.mjs → index-BoUKkFOJ.mjs} +1 -1
  40. package/lib/{index-CVaT6qZW.js → index-C6PC2n3L.js} +1 -1
  41. package/lib/{index-BYnoX4S7.mjs → index-CAqvcaXu.mjs} +15 -15
  42. package/lib/{index-DGq7mQyb.mjs → index-CDHEzcRs.mjs} +10 -10
  43. package/lib/{index-U1A3Ir4_.js → index-CFV9DDDi.js} +1 -1
  44. package/lib/{index-CQY-qyc8.mjs → index-CHNFj7US.mjs} +2 -2
  45. package/lib/{index-DrDopLyp.mjs → index-CIbRMQ53.mjs} +2 -2
  46. package/lib/{index-BFWViYNu.mjs → index-COFRyIUZ.mjs} +7 -7
  47. package/lib/{index-BJ9DGQK7.js → index-CREWpYSc.js} +1 -1
  48. package/lib/{index-CL7evJIB.js → index-CV_U2daN.js} +1 -1
  49. package/lib/{index-CNe0Pean.js → index-CxgmuQ6m.js} +1 -1
  50. package/lib/{index-DugvE6YD.mjs → index-D-p3qNTZ.mjs} +30 -30
  51. package/lib/{index-Cb5M1Ban.mjs → index-D9X9k3PB.mjs} +1 -1
  52. package/lib/{index-IC9ubiMJ.mjs → index-DJghGbqc.mjs} +3 -3
  53. package/lib/{index-Bx7B-3Uk.js → index-DP78DD_7.js} +1 -1
  54. package/lib/{index-OldEBluq.js → index-D_iRGURG.js} +1 -1
  55. package/lib/{index-PcZU5a1K.js → index-DcOE-jqI.js} +1 -1
  56. package/lib/{index-BO1rJrRP.mjs → index-DefP3AL4.mjs} +9 -9
  57. package/lib/{index-C96ibHXm.js → index-DgKzux63.js} +1 -1
  58. package/lib/{index-D_3BlFSH.js → index-DhjRrhjF.js} +1 -1
  59. package/lib/{index-CyPbCf5y.js → index-DhvcbRay.js} +1 -1
  60. package/lib/{index-C010ECjb.js → index-DjAPVIrd.js} +1 -1
  61. package/lib/{index-CaQpF1dj.js → index-Dpwwqt_Y.js} +1 -1
  62. package/lib/{index-Bl8-vKcf.js → index-DqRdsXVl.js} +1 -1
  63. package/lib/{index-jgZQQCfy.mjs → index-DuVadmtW.mjs} +18 -18
  64. package/lib/{index--8OR2IWG.mjs → index-SSdHQ2f1.mjs} +2 -2
  65. package/lib/{index-B_vsKDJm.js → index-X48SyxVx.js} +1 -1
  66. package/lib/{index-DdhKN5Tn.mjs → index-evqr6zVJ.mjs} +2 -2
  67. package/lib/{index-BxxpLnjr.mjs → index-hY0mf_OS.mjs} +26 -26
  68. package/lib/{index-mE3wnazE.js → index-oE-cAvjh.js} +1 -1
  69. package/lib/{index-Ci0O-yiU.js → index-oRg2LZn2.js} +1 -1
  70. package/lib/{index-D0RnzOoN.js → index-pIxA5tC9.js} +1 -1
  71. package/lib/{index-CnElB0dt.mjs → index-vZrnrwrk.mjs} +2 -2
  72. package/lib/{index.es-DbGYkQrs.js → index.es-CwS3KgtR.js} +2 -2
  73. package/lib/{index.es-DV6jIgX3.mjs → index.es-De3BB9Gs.mjs} +5 -5
  74. package/lib/index.js +1 -1
  75. package/lib/index.mjs +1 -1
  76. package/lib/{keccak-BvCC2Kx2.js → keccak-B1lZAzij.js} +1 -1
  77. package/lib/{keccak-C0uJwxei.mjs → keccak-BIkgLtG3.mjs} +1 -1
  78. package/lib/{libsodium-wrappers-BS68glUg.mjs → libsodium-wrappers-BVHsOzCM.mjs} +1 -1
  79. package/lib/{libsodium-wrappers-yq_uVk2-.js → libsodium-wrappers-G-nqImEg.js} +1 -1
  80. package/lib/{pako.esm-DZDXjYQj.js → pako.esm-Bp8XA5UR.js} +1 -1
  81. package/lib/{pako.esm-CWQc3qGc.mjs → pako.esm-CuMQ9lDX.mjs} +2 -2
  82. package/lib/{pbkdf2-DbRuCUvp.js → pbkdf2-DvmY7GlQ.js} +1 -1
  83. package/lib/{pbkdf2-B3V9L7S5.mjs → pbkdf2-QaxjQpDb.mjs} +1 -1
  84. package/lib/{sei-D3Eq9BDV.js → sei-B9drTJKa.js} +1 -1
  85. package/lib/{sei-Bty4vIw4.mjs → sei-DgoF7Bn_.mjs} +3 -3
  86. package/lib/{signer-Dw6nmaHE.js → signer-BEIw02y1.js} +1 -1
  87. package/lib/{signer-zHoIaQqc.mjs → signer-DNX7OGg4.mjs} +1 -1
  88. package/lib/solana-BRb7NfyR.js +1 -0
  89. package/lib/{solana-C-e817Or.mjs → solana-CoAz_ENY.mjs} +4 -4
  90. package/lib/solana-D2xBFYbL.mjs +16 -0
  91. package/lib/{solana-9m57XHRZ.js → solana-iqc7Fvik.js} +1 -1
  92. package/lib/{solanaEmbed.esm-ByzcN6RA.mjs → solanaEmbed.esm-D-2IZyVE.mjs} +3 -3
  93. package/lib/{solanaEmbed.esm-DBOgwSJE.js → solanaEmbed.esm-DjEXAVdT.js} +1 -1
  94. package/lib/{sui-B3dbw4a7.js → sui-CLKF35u2.js} +2 -2
  95. package/lib/{sui-CKgX0Mjn.mjs → sui-C_RZoPbB.mjs} +4 -4
  96. package/lib/{sui-rey0HjGu.mjs → sui-CrvrUATE.mjs} +1 -1
  97. package/lib/{sui-lQcSerf0.js → sui-qNwHoAbu.js} +1 -1
  98. package/lib/{unsignedTransaction-DcJyFS5R.js → unsignedTransaction-CJyRAIyq.js} +1 -1
  99. package/lib/{unsignedTransaction-sTI31PuJ.mjs → unsignedTransaction-XgGjCBSt.mjs} +2 -2
  100. package/package.json +1 -1
  101. package/lib/solana-CV7qftfl.mjs +0 -16
  102. package/lib/solana-GdBZhG_3.js +0 -1
@@ -1 +1 @@
1
- "use strict";const index=require("./index-CEovIwuS.js"),pbkdf2=require("./pbkdf2-DbRuCUvp.js"),index$1=require("./index-pIqiKD22.js"),Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Id=new Uint8Array(new Array(16).fill(0).map((i,t)=>t)),Pi=Id.map(i=>(9*i+5)%16);let idxL=[Id],idxR=[Pi];for(let i=0;i<4;i++)for(let t of[idxL,idxR])t.push(t[i].map(n=>Rho[n]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>new Uint8Array(i)),shiftsL=idxL.map((i,t)=>i.map(n=>shifts[t][n])),shiftsR=idxR.map((i,t)=>i.map(n=>shifts[t][n])),Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function f(i,t,n,e){return i===0?t^n^e:i===1?t&n|~t&e:i===2?(t|~n)^e:i===3?t&e|n&~e:t^(n|~e)}const R_BUF=new Uint32Array(16);class RIPEMD160 extends index.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:e,h3:r,h4:o}=this;return[t,n,e,r,o]}set(t,n,e,r,o){this.h0=t|0,this.h1=n|0,this.h2=e|0,this.h3=r|0,this.h4=o|0}process(t,n){for(let d=0;d<16;d++,n+=4)R_BUF[d]=t.getUint32(n,!0);let e=this.h0|0,r=e,o=this.h1|0,u=o,s=this.h2|0,c=s,h=this.h3|0,l=h,a=this.h4|0,p=a;for(let d=0;d<5;d++){const y=4-d,_=Kl[d],b=Kr[d],$=idxL[d],m=idxR[d],w=shiftsL[d],P=shiftsR[d];for(let v=0;v<16;v++){const O=index.rotl(e+f(d,o,s,h)+R_BUF[$[v]]+_,w[v])+a|0;e=a,a=h,h=index.rotl(s,10)|0,s=o,o=O}for(let v=0;v<16;v++){const O=index.rotl(r+f(y,u,c,l)+R_BUF[m[v]]+b,P[v])+p|0;r=p,p=l,l=index.rotl(c,10)|0,c=u,u=O}}this.set(this.h1+s+l|0,this.h2+h+p|0,this.h3+a+r|0,this.h4+e+u|0,this.h0+o+c|0)}roundClean(){R_BUF.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const ripemd160=index.wrapConstructor(()=>new RIPEMD160),ripemd160$1=Object.freeze(Object.defineProperty({__proto__:null,RIPEMD160,ripemd160},Symbol.toStringTag,{value:"Module"}));var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(var z=0;z<ALPHABET.length;z++){var x=ALPHABET.charAt(z);if(ALPHABET_MAP[x]!==void 0)throw new TypeError(x+" is ambiguous");ALPHABET_MAP[x]=z}function polymodStep(i){var t=i>>25;return(i&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function prefixChk(i){for(var t=1,n=0;n<i.length;++n){var e=i.charCodeAt(n);if(e<33||e>126)return"Invalid prefix ("+i+")";t=polymodStep(t)^e>>5}for(t=polymodStep(t),n=0;n<i.length;++n){var r=i.charCodeAt(n);t=polymodStep(t)^r&31}return t}function encode(i,t,n){if(n=n||90,i.length+7+t.length>n)throw new TypeError("Exceeds length limit");i=i.toLowerCase();var e=prefixChk(i);if(typeof e=="string")throw new Error(e);for(var r=i+"1",o=0;o<t.length;++o){var u=t[o];if(u>>5)throw new Error("Non 5-bit word");e=polymodStep(e)^u,r+=ALPHABET.charAt(u)}for(o=0;o<6;++o)e=polymodStep(e);for(e^=1,o=0;o<6;++o){var s=e>>(5-o)*5&31;r+=ALPHABET.charAt(s)}return r}function __decode(i,t){if(t=t||90,i.length<8)return i+" too short";if(i.length>t)return"Exceeds length limit";var n=i.toLowerCase(),e=i.toUpperCase();if(i!==n&&i!==e)return"Mixed-case string "+i;i=n;var r=i.lastIndexOf("1");if(r===-1)return"No separator character for "+i;if(r===0)return"Missing prefix for "+i;var o=i.slice(0,r),u=i.slice(r+1);if(u.length<6)return"Data too short";var s=prefixChk(o);if(typeof s=="string")return s;for(var c=[],h=0;h<u.length;++h){var l=u.charAt(h),a=ALPHABET_MAP[l];if(a===void 0)return"Unknown character "+l;s=polymodStep(s)^a,!(h+6>=u.length)&&c.push(a)}return s!==1?"Invalid checksum for "+i:{prefix:o,words:c}}function decodeUnsafe(){var i=__decode.apply(null,arguments);if(typeof i=="object")return i}function decode(i){var t=__decode.apply(null,arguments);if(typeof t=="object")return t;throw new Error(t)}function convert(i,t,n,e){for(var r=0,o=0,u=(1<<n)-1,s=[],c=0;c<i.length;++c)for(r=r<<t|i[c],o+=t;o>=n;)o-=n,s.push(r>>o&u);if(e)o>0&&s.push(r<<n-o&u);else{if(o>=t)return"Excess padding";if(r<<n-o&u)return"Non-zero padding"}return s}function toWordsUnsafe(i){var t=convert(i,8,5,!0);if(Array.isArray(t))return t}function toWords(i){var t=convert(i,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)}function fromWordsUnsafe(i){var t=convert(i,5,8,!1);if(Array.isArray(t))return t}function fromWords(i){var t=convert(i,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}var bech32={decodeUnsafe,decode,encode,toWordsUnsafe,toWords,fromWordsUnsafe,fromWords};const require$$1$1=index.getAugmentedNamespace(pbkdf2.pbkdf2$1),require$$1=index.getAugmentedNamespace(index.sha512$1),require$$0$2=index.getAugmentedNamespace(index.sha256$1),require$$0$1=index.getAugmentedNamespace(index.sha3),require$$0=index.getAugmentedNamespace(ripemd160$1);var build={},indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(i,t){for(var n=new Array(arguments.length-1),e=0,r=2,o=!0;r<arguments.length;)n[e++]=arguments[r++];return new Promise(function(s,c){n[e]=function(l){if(o)if(o=!1,l)c(l);else{for(var a=new Array(arguments.length-1),p=0;p<a.length;)a[p++]=arguments[p];s.apply(null,a)}};try{i.apply(t||null,n)}catch(h){o&&(o=!1,c(h))}})}var base64$1={};(function(i){var t=i;t.length=function(s){var c=s.length;if(!c)return 0;for(var h=0;--c%4>1&&s.charAt(c)==="=";)++h;return Math.ceil(s.length*3)/4-h};for(var n=new Array(64),e=new Array(123),r=0;r<64;)e[n[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;t.encode=function(s,c,h){for(var l=null,a=[],p=0,d=0,y;c<h;){var _=s[c++];switch(d){case 0:a[p++]=n[_>>2],y=(_&3)<<4,d=1;break;case 1:a[p++]=n[y|_>>4],y=(_&15)<<2,d=2;break;case 2:a[p++]=n[y|_>>6],a[p++]=n[_&63],d=0;break}p>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,a)),p=0)}return d&&(a[p++]=n[y],a[p++]=61,d===1&&(a[p++]=61)),l?(p&&l.push(String.fromCharCode.apply(String,a.slice(0,p))),l.join("")):String.fromCharCode.apply(String,a.slice(0,p))};var o="invalid encoding";t.decode=function(s,c,h){for(var l=h,a=0,p,d=0;d<s.length;){var y=s.charCodeAt(d++);if(y===61&&a>1)break;if((y=e[y])===void 0)throw Error(o);switch(a){case 0:p=y,a=1;break;case 1:c[h++]=p<<2|(y&48)>>4,p=y,a=2;break;case 2:c[h++]=(p&15)<<4|(y&60)>>2,p=y,a=3;break;case 3:c[h++]=(p&3)<<6|y,a=0;break}}if(a===1)throw Error(o);return h-l},t.test=function(s){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(t,n,e){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:n,ctx:e||this}),this};EventEmitter.prototype.off=function(t,n){if(t===void 0)this._listeners={};else if(n===void 0)this._listeners[t]=[];else for(var e=this._listeners[t],r=0;r<e.length;)e[r].fn===n?e.splice(r,1):++r;return this};EventEmitter.prototype.emit=function(t){var n=this._listeners[t];if(n){for(var e=[],r=1;r<arguments.length;)e.push(arguments[r++]);for(r=0;r<n.length;)n[r].fn.apply(n[r++].ctx,e)}return this};var float=factory(factory);function factory(i){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),e=n[3]===128;function r(c,h,l){t[0]=c,h[l]=n[0],h[l+1]=n[1],h[l+2]=n[2],h[l+3]=n[3]}function o(c,h,l){t[0]=c,h[l]=n[3],h[l+1]=n[2],h[l+2]=n[1],h[l+3]=n[0]}i.writeFloatLE=e?r:o,i.writeFloatBE=e?o:r;function u(c,h){return n[0]=c[h],n[1]=c[h+1],n[2]=c[h+2],n[3]=c[h+3],t[0]}function s(c,h){return n[3]=c[h],n[2]=c[h+1],n[1]=c[h+2],n[0]=c[h+3],t[0]}i.readFloatLE=e?u:s,i.readFloatBE=e?s:u}():function(){function t(e,r,o,u){var s=r<0?1:0;if(s&&(r=-r),r===0)e(1/r>0?0:2147483648,o,u);else if(isNaN(r))e(2143289344,o,u);else if(r>34028234663852886e22)e((s<<31|2139095040)>>>0,o,u);else if(r<11754943508222875e-54)e((s<<31|Math.round(r/1401298464324817e-60))>>>0,o,u);else{var c=Math.floor(Math.log(r)/Math.LN2),h=Math.round(r*Math.pow(2,-c)*8388608)&8388607;e((s<<31|c+127<<23|h)>>>0,o,u)}}i.writeFloatLE=t.bind(null,writeUintLE),i.writeFloatBE=t.bind(null,writeUintBE);function n(e,r,o){var u=e(r,o),s=(u>>31)*2+1,c=u>>>23&255,h=u&8388607;return c===255?h?NaN:s*(1/0):c===0?s*1401298464324817e-60*h:s*Math.pow(2,c-150)*(h+8388608)}i.readFloatLE=n.bind(null,readUintLE),i.readFloatBE=n.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),e=n[7]===128;function r(c,h,l){t[0]=c,h[l]=n[0],h[l+1]=n[1],h[l+2]=n[2],h[l+3]=n[3],h[l+4]=n[4],h[l+5]=n[5],h[l+6]=n[6],h[l+7]=n[7]}function o(c,h,l){t[0]=c,h[l]=n[7],h[l+1]=n[6],h[l+2]=n[5],h[l+3]=n[4],h[l+4]=n[3],h[l+5]=n[2],h[l+6]=n[1],h[l+7]=n[0]}i.writeDoubleLE=e?r:o,i.writeDoubleBE=e?o:r;function u(c,h){return n[0]=c[h],n[1]=c[h+1],n[2]=c[h+2],n[3]=c[h+3],n[4]=c[h+4],n[5]=c[h+5],n[6]=c[h+6],n[7]=c[h+7],t[0]}function s(c,h){return n[7]=c[h],n[6]=c[h+1],n[5]=c[h+2],n[4]=c[h+3],n[3]=c[h+4],n[2]=c[h+5],n[1]=c[h+6],n[0]=c[h+7],t[0]}i.readDoubleLE=e?u:s,i.readDoubleBE=e?s:u}():function(){function t(e,r,o,u,s,c){var h=u<0?1:0;if(h&&(u=-u),u===0)e(0,s,c+r),e(1/u>0?0:2147483648,s,c+o);else if(isNaN(u))e(0,s,c+r),e(2146959360,s,c+o);else if(u>17976931348623157e292)e(0,s,c+r),e((h<<31|2146435072)>>>0,s,c+o);else{var l;if(u<22250738585072014e-324)l=u/5e-324,e(l>>>0,s,c+r),e((h<<31|l/4294967296)>>>0,s,c+o);else{var a=Math.floor(Math.log(u)/Math.LN2);a===1024&&(a=1023),l=u*Math.pow(2,-a),e(l*4503599627370496>>>0,s,c+r),e((h<<31|a+1023<<20|l*1048576&1048575)>>>0,s,c+o)}}}i.writeDoubleLE=t.bind(null,writeUintLE,0,4),i.writeDoubleBE=t.bind(null,writeUintBE,4,0);function n(e,r,o,u,s){var c=e(u,s+r),h=e(u,s+o),l=(h>>31)*2+1,a=h>>>20&2047,p=4294967296*(h&1048575)+c;return a===2047?p?NaN:l*(1/0):a===0?l*5e-324*p:l*Math.pow(2,a-1075)*(p+4503599627370496)}i.readDoubleLE=n.bind(null,readUintLE,0,4),i.readDoubleBE=n.bind(null,readUintBE,4,0)}(),i}function writeUintLE(i,t,n){t[n]=i&255,t[n+1]=i>>>8&255,t[n+2]=i>>>16&255,t[n+3]=i>>>24}function writeUintBE(i,t,n){t[n]=i>>>24,t[n+1]=i>>>16&255,t[n+2]=i>>>8&255,t[n+3]=i&255}function readUintLE(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16|i[t+3]<<24)>>>0}function readUintBE(i,t){return(i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(i){}return null}var utf8$2={};(function(i){var t=i;t.length=function(e){for(var r=0,o=0,u=0;u<e.length;++u)o=e.charCodeAt(u),o<128?r+=1:o<2048?r+=2:(o&64512)===55296&&(e.charCodeAt(u+1)&64512)===56320?(++u,r+=4):r+=3;return r},t.read=function(e,r,o){var u=o-r;if(u<1)return"";for(var s=null,c=[],h=0,l;r<o;)l=e[r++],l<128?c[h++]=l:l>191&&l<224?c[h++]=(l&31)<<6|e[r++]&63:l>239&&l<365?(l=((l&7)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,c[h++]=55296+(l>>10),c[h++]=56320+(l&1023)):c[h++]=(l&15)<<12|(e[r++]&63)<<6|e[r++]&63,h>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,c)),h=0);return s?(h&&s.push(String.fromCharCode.apply(String,c.slice(0,h))),s.join("")):String.fromCharCode.apply(String,c.slice(0,h))},t.write=function(e,r,o){for(var u=o,s,c,h=0;h<e.length;++h)s=e.charCodeAt(h),s<128?r[o++]=s:s<2048?(r[o++]=s>>6|192,r[o++]=s&63|128):(s&64512)===55296&&((c=e.charCodeAt(h+1))&64512)===56320?(s=65536+((s&1023)<<10)+(c&1023),++h,r[o++]=s>>18|240,r[o++]=s>>12&63|128,r[o++]=s>>6&63|128,r[o++]=s&63|128):(r[o++]=s>>12|224,r[o++]=s>>6&63|128,r[o++]=s&63|128);return o-u}})(utf8$2);var pool_1=pool;function pool(i,t,n){var e=n||8192,r=e>>>1,o=null,u=e;return function(c){if(c<1||c>r)return i(c);u+c>e&&(o=i(e),u=0);var h=t.call(o,u,u+=c);return u&7&&(u=(u|7)+1),h}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var i=requireMinimal();function t(o,u){this.lo=o>>>0,this.hi=u>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var e=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(u){if(u===0)return n;var s=u<0;s&&(u=-u);var c=u>>>0,h=(u-c)/4294967296>>>0;return s&&(h=~h>>>0,c=~c>>>0,++c>4294967295&&(c=0,++h>4294967295&&(h=0))),new t(c,h)},t.from=function(u){if(typeof u=="number")return t.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return t.fromNumber(parseInt(u,10));return u.low||u.high?new t(u.low>>>0,u.high>>>0):n},t.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var s=~this.lo+1>>>0,c=~this.hi>>>0;return s||(c=c+1>>>0),-(s+c*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var r=String.prototype.charCodeAt;return t.fromHash=function(u){return u===e?n:new t((r.call(u,0)|r.call(u,1)<<8|r.call(u,2)<<16|r.call(u,3)<<24)>>>0,(r.call(u,4)|r.call(u,5)<<8|r.call(u,6)<<16|r.call(u,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},t.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},t.prototype.length=function(){var u=this.lo,s=(this.lo>>>28|this.hi<<4)>>>0,c=this.hi>>>24;return c===0?s===0?u<16384?u<128?1:2:u<2097152?3:4:s<16384?s<128?5:6:s<2097152?7:8:c<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(i){var t=i;t.asPromise=aspromise,t.base64=base64$1,t.EventEmitter=eventemitter,t.float=float,t.inquire=inquire_1,t.utf8=utf8$2,t.pool=pool_1,t.LongBits=requireLongbits(),t.isNode=!!(typeof index.commonjsGlobal<"u"&&index.commonjsGlobal&&index.commonjsGlobal.process&&index.commonjsGlobal.process.versions&&index.commonjsGlobal.process.versions.node),t.global=t.isNode&&index.commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||index.commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o},t.isString=function(o){return typeof o=="string"||o instanceof String},t.isObject=function(o){return o&&typeof o=="object"},t.isset=t.isSet=function(o,u){var s=o[u];return s!=null&&o.hasOwnProperty(u)?typeof s!="object"||(Array.isArray(s)?s.length:Object.keys(s).length)>0:!1},t.Buffer=function(){try{var r=t.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(o){return typeof o=="number"?t.Buffer?t._Buffer_allocUnsafe(o):new t.Array(o):t.Buffer?t._Buffer_from(o):typeof Uint8Array>"u"?o:new Uint8Array(o)},t.Array=typeof Uint8Array<"u"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(o){return o?t.LongBits.from(o).toHash():t.LongBits.zeroHash},t.longFromHash=function(o,u){var s=t.LongBits.fromHash(o);return t.Long?t.Long.fromBits(s.lo,s.hi,u):s.toNumber(!!u)};function n(r,o,u){for(var s=Object.keys(o),c=0;c<s.length;++c)(r[s[c]]===void 0||!u)&&(r[s[c]]=o[s[c]]);return r}t.merge=n,t.lcFirst=function(o){return o.charAt(0).toLowerCase()+o.substring(1)};function e(r){function o(u,s){if(!(this instanceof o))return new o(u,s);Object.defineProperty(this,"message",{get:function(){return u}}),Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:new Error().stack||""}),s&&n(this,s)}return(o.prototype=Object.create(Error.prototype)).constructor=o,Object.defineProperty(o.prototype,"name",{get:function(){return r}}),o.prototype.toString=function(){return this.name+": "+this.message},o}t.newError=e,t.ProtocolError=e("ProtocolError"),t.oneOfGetter=function(o){for(var u={},s=0;s<o.length;++s)u[o[s]]=1;return function(){for(var c=Object.keys(this),h=c.length-1;h>-1;--h)if(u[c[h]]===1&&this[c[h]]!==void 0&&this[c[h]]!==null)return c[h]}},t.oneOfSetter=function(o){return function(u){for(var s=0;s<o.length;++s)o[s]!==u&&delete this[o[s]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var r=t.Buffer;if(!r){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=r.from!==Uint8Array.from&&r.from||function(u,s){return new r(u,s)},t._Buffer_allocUnsafe=r.allocUnsafe||function(u){return new r(u)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(i,t,n){this.fn=i,this.len=t,this.next=void 0,this.val=n}function noop$1(){}function State(i){this.head=i.head,this.tail=i.tail,this.len=i.len,this.next=i.states}function Writer$1(){this.len=0,this.head=new Op(noop$1,0,0),this.tail=this.head,this.states=null}var create$1=function i(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1();Writer$1.alloc=function i(t){return new util$4.Array(t)};util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray));Writer$1.prototype._push=function i(t,n,e){return this.tail=this.tail.next=new Op(t,n,e),this.len+=n,this};function writeByte(i,t,n){t[n]=i&255}function writeVarint32(i,t,n){for(;i>127;)t[n++]=i&127|128,i>>>=7;t[n]=i}function VarintOp(i,t){this.len=i,this.next=void 0,this.val=t}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function i(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};Writer$1.prototype.int32=function i(t){return t<0?this._push(writeVarint64,10,LongBits$1.fromNumber(t)):this.uint32(t)};Writer$1.prototype.sint32=function i(t){return this.uint32((t<<1^t>>31)>>>0)};function writeVarint64(i,t,n){for(;i.hi;)t[n++]=i.lo&127|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;for(;i.lo>127;)t[n++]=i.lo&127|128,i.lo=i.lo>>>7;t[n++]=i.lo}Writer$1.prototype.uint64=function i(t){var n=LongBits$1.from(t);return this._push(writeVarint64,n.length(),n)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function i(t){var n=LongBits$1.from(t).zzEncode();return this._push(writeVarint64,n.length(),n)};Writer$1.prototype.bool=function i(t){return this._push(writeByte,1,t?1:0)};function writeFixed32(i,t,n){t[n]=i&255,t[n+1]=i>>>8&255,t[n+2]=i>>>16&255,t[n+3]=i>>>24}Writer$1.prototype.fixed32=function i(t){return this._push(writeFixed32,4,t>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function i(t){var n=LongBits$1.from(t);return this._push(writeFixed32,4,n.lo)._push(writeFixed32,4,n.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function i(t){return this._push(util$4.float.writeFloatLE,4,t)};Writer$1.prototype.double=function i(t){return this._push(util$4.float.writeDoubleLE,8,t)};var writeBytes=util$4.Array.prototype.set?function i(t,n,e){n.set(t,e)}:function i(t,n,e){for(var r=0;r<t.length;++r)n[e+r]=t[r]};Writer$1.prototype.bytes=function i(t){var n=t.length>>>0;if(!n)return this._push(writeByte,1,0);if(util$4.isString(t)){var e=Writer$1.alloc(n=base64.length(t));base64.decode(t,e,0),t=e}return this.uint32(n)._push(writeBytes,n,t)};Writer$1.prototype.string=function i(t){var n=utf8$1.length(t);return n?this.uint32(n)._push(utf8$1.write,n,t):this._push(writeByte,1,0)};Writer$1.prototype.fork=function i(){return this.states=new State(this),this.head=this.tail=new Op(noop$1,0,0),this.len=0,this};Writer$1.prototype.reset=function i(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop$1,0,0),this.len=0),this};Writer$1.prototype.ldelim=function i(){var t=this.head,n=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=n,this.len+=e),this};Writer$1.prototype.finish=function i(){for(var t=this.head.next,n=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,n,e),e+=t.len,t=t.next;return n};Writer$1._configure=function(i){BufferWriter$1=i,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(t,n,e){n.set(t,e)}:function(t,n,e){if(t.copy)t.copy(n,e,0,t.length);else for(var r=0;r<t.length;)n[e++]=t[r++]}};BufferWriter.prototype.bytes=function i(t){util$3.isString(t)&&(t=util$3._Buffer_from(t,"base64"));var n=t.length>>>0;return this.uint32(n),n&&this._push(BufferWriter.writeBytesBuffer,n,t),this};function writeStringBuffer(i,t,n){i.length<40?util$3.utf8.write(i,t,n):t.utf8Write?t.utf8Write(i,n):t.write(i,n)}BufferWriter.prototype.string=function i(t){var n=util$3.Buffer.byteLength(t);return this.uint32(n),n&&this._push(writeStringBuffer,n,t),this};BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(i,t){return RangeError("index out of range: "+i.pos+" + "+(t||1)+" > "+i.len)}function Reader$1(i){this.buf=i,this.pos=0,this.len=i.length}var create_array=typeof Uint8Array<"u"?function i(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")}:function i(t){if(Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")},create=function i(){return util$2.Buffer?function(n){return(Reader$1.create=function(r){return util$2.Buffer.isBuffer(r)?new BufferReader$1(r):create_array(r)})(n)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice;Reader$1.prototype.uint32=function i(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}();Reader$1.prototype.int32=function i(){return this.uint32()|0};Reader$1.prototype.sint32=function i(){var t=this.uint32();return t>>>1^-(t&1)|0};function readLongVarint(){var i=new LongBits(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(i.lo=(i.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return i;if(i.lo=(i.lo|(this.buf[this.pos]&127)<<28)>>>0,i.hi=(i.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return i;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(i.lo=(i.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return i}return i.lo=(i.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,i}if(this.len-this.pos>4){for(;t<5;++t)if(i.hi=(i.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return i}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(i.hi=(i.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return i}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function i(){return this.uint32()!==0};function readFixed32_end(i,t){return(i[t-4]|i[t-3]<<8|i[t-2]<<16|i[t-1]<<24)>>>0}Reader$1.prototype.fixed32=function i(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function i(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function i(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};Reader$1.prototype.double=function i(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};Reader$1.prototype.bytes=function i(){var t=this.uint32(),n=this.pos,e=this.pos+t;if(e>this.len)throw indexOutOfRange(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,e):n===e?new this.buf.constructor(0):this._slice.call(this.buf,n,e)};Reader$1.prototype.string=function i(){var t=this.bytes();return utf8.read(t,0,t.length)};Reader$1.prototype.skip=function i(t){if(typeof t=="number"){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(i){switch(i){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(i=this.uint32()&7)!==4;)this.skipType(i);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+i+" at offset "+this.pos)}return this};Reader$1._configure=function(i){BufferReader$1=i,Reader$1.create=create(),BufferReader$1._configure();var t=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(i){Reader.call(this,i)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)};BufferReader.prototype.string=function i(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(i,t,n){if(typeof i!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=i,this.requestDelimited=!!t,this.responseDelimited=!!n}Service.prototype.rpcCall=function i(t,n,e,r,o){if(!r)throw TypeError("request must be specified");var u=this;if(!o)return util.asPromise(i,u,t,n,e,r);if(!u.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return u.rpcImpl(t,n[u.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(c,h){if(c)return u.emit("error",c,t),o(c);if(h===null){u.end(!0);return}if(!(h instanceof e))try{h=e[u.responseDelimited?"decodeDelimited":"decode"](h)}catch(l){return u.emit("error",l,t),o(l)}return u.emit("data",h,t),o(null,h)})}catch(s){u.emit("error",s,t),setTimeout(function(){o(s)},0);return}};Service.prototype.end=function i(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(i){var t=i;t.Service=service})(rpc);var roots={};(function(i){var t=i;t.build="minimal",t.Writer=writer,t.BufferWriter=writer_buffer,t.Reader=reader,t.BufferReader=reader_buffer,t.util=requireMinimal(),t.rpc=rpc,t.roots=roots,t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})(indexMinimal);var minimal=indexMinimal,$protobuf=minimal,$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$root=$protobuf.roots.default||($protobuf.roots.default={});$root.ics23=function(){var i={};return i.HashOp=function(){var t={},n=Object.create(t);return n[t[0]="NO_HASH"]=0,n[t[1]="SHA256"]=1,n[t[2]="SHA512"]=2,n[t[3]="KECCAK"]=3,n[t[4]="RIPEMD160"]=4,n[t[5]="BITCOIN"]=5,n[t[6]="SHA512_256"]=6,n}(),i.LengthOp=function(){var t={},n=Object.create(t);return n[t[0]="NO_PREFIX"]=0,n[t[1]="VAR_PROTO"]=1,n[t[2]="VAR_RLP"]=2,n[t[3]="FIXED32_BIG"]=3,n[t[4]="FIXED32_LITTLE"]=4,n[t[5]="FIXED64_BIG"]=5,n[t[6]="FIXED64_LITTLE"]=6,n[t[7]="REQUIRE_32_BYTES"]=7,n[t[8]="REQUIRE_64_BYTES"]=8,n}(),i.ExistenceProof=function(){function t(n){if(this.path=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.value=$util.newBuffer([]),t.prototype.leaf=null,t.prototype.path=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.value!=null&&e.hasOwnProperty("value")&&r.uint32(18).bytes(e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&$root.ics23.LeafOp.encode(e.leaf,r.uint32(26).fork()).ldelim(),e.path!=null&&e.path.length)for(var o=0;o<e.path.length;++o)$root.ics23.InnerOp.encode(e.path[o],r.uint32(34).fork()).ldelim();return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.ExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.value=e.bytes();break;case 3:u.leaf=$root.ics23.LeafOp.decode(e,e.uint32());break;case 4:u.path&&u.path.length||(u.path=[]),u.path.push($root.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.value!=null&&e.hasOwnProperty("value")&&!(e.value&&typeof e.value.length=="number"||$util.isString(e.value)))return"value: buffer expected";if(e.leaf!=null&&e.hasOwnProperty("leaf")){var r=$root.ics23.LeafOp.verify(e.leaf);if(r)return"leaf."+r}if(e.path!=null&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var o=0;o<e.path.length;++o){var r=$root.ics23.InnerOp.verify(e.path[o]);if(r)return"path."+r}}return null},t.fromObject=function(e){if(e instanceof $root.ics23.ExistenceProof)return e;var r=new $root.ics23.ExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.value!=null&&(typeof e.value=="string"?$util.base64.decode(e.value,r.value=$util.newBuffer($util.base64.length(e.value)),0):e.value.length&&(r.value=e.value)),e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".ics23.ExistenceProof.leaf: object expected");r.leaf=$root.ics23.LeafOp.fromObject(e.leaf)}if(e.path){if(!Array.isArray(e.path))throw TypeError(".ics23.ExistenceProof.path: array expected");r.path=[];for(var o=0;o<e.path.length;++o){if(typeof e.path[o]!="object")throw TypeError(".ics23.ExistenceProof.path: object expected");r.path[o]=$root.ics23.InnerOp.fromObject(e.path[o])}}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.path=[]),r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),r.bytes===String?o.value="":(o.value=[],r.bytes!==Array&&(o.value=$util.newBuffer(o.value))),o.leaf=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.value!=null&&e.hasOwnProperty("value")&&(o.value=r.bytes===String?$util.base64.encode(e.value,0,e.value.length):r.bytes===Array?Array.prototype.slice.call(e.value):e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&(o.leaf=$root.ics23.LeafOp.toObject(e.leaf,r)),e.path&&e.path.length){o.path=[];for(var u=0;u<e.path.length;++u)o.path[u]=$root.ics23.InnerOp.toObject(e.path[u],r)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.NonExistenceProof=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.left=null,t.prototype.right=null,t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.left!=null&&e.hasOwnProperty("left")&&$root.ics23.ExistenceProof.encode(e.left,r.uint32(18).fork()).ldelim(),e.right!=null&&e.hasOwnProperty("right")&&$root.ics23.ExistenceProof.encode(e.right,r.uint32(26).fork()).ldelim(),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.NonExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.left=$root.ics23.ExistenceProof.decode(e,e.uint32());break;case 3:u.right=$root.ics23.ExistenceProof.decode(e,e.uint32());break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.left!=null&&e.hasOwnProperty("left")){var r=$root.ics23.ExistenceProof.verify(e.left);if(r)return"left."+r}if(e.right!=null&&e.hasOwnProperty("right")){var r=$root.ics23.ExistenceProof.verify(e.right);if(r)return"right."+r}return null},t.fromObject=function(e){if(e instanceof $root.ics23.NonExistenceProof)return e;var r=new $root.ics23.NonExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.left!=null){if(typeof e.left!="object")throw TypeError(".ics23.NonExistenceProof.left: object expected");r.left=$root.ics23.ExistenceProof.fromObject(e.left)}if(e.right!=null){if(typeof e.right!="object")throw TypeError(".ics23.NonExistenceProof.right: object expected");r.right=$root.ics23.ExistenceProof.fromObject(e.right)}return r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),o.left=null,o.right=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.left!=null&&e.hasOwnProperty("left")&&(o.left=$root.ics23.ExistenceProof.toObject(e.left,r)),e.right!=null&&e.hasOwnProperty("right")&&(o.right=$root.ics23.ExistenceProof.toObject(e.right,r)),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CommitmentProof=function(){function t(e){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)e[r[o]]!=null&&(this[r[o]]=e[r[o]])}t.prototype.exist=null,t.prototype.nonexist=null,t.prototype.batch=null,t.prototype.compressed=null;var n;return Object.defineProperty(t.prototype,"proof",{get:$util.oneOfGetter(n=["exist","nonexist","batch","compressed"]),set:$util.oneOfSetter(n)}),t.create=function(r){return new t(r)},t.encode=function(r,o){return o||(o=$Writer.create()),r.exist!=null&&r.hasOwnProperty("exist")&&$root.ics23.ExistenceProof.encode(r.exist,o.uint32(10).fork()).ldelim(),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&$root.ics23.NonExistenceProof.encode(r.nonexist,o.uint32(18).fork()).ldelim(),r.batch!=null&&r.hasOwnProperty("batch")&&$root.ics23.BatchProof.encode(r.batch,o.uint32(26).fork()).ldelim(),r.compressed!=null&&r.hasOwnProperty("compressed")&&$root.ics23.CompressedBatchProof.encode(r.compressed,o.uint32(34).fork()).ldelim(),o},t.encodeDelimited=function(r,o){return this.encode(r,o).ldelim()},t.decode=function(r,o){r instanceof $Reader||(r=$Reader.create(r));for(var u=o===void 0?r.len:r.pos+o,s=new $root.ics23.CommitmentProof;r.pos<u;){var c=r.uint32();switch(c>>>3){case 1:s.exist=$root.ics23.ExistenceProof.decode(r,r.uint32());break;case 2:s.nonexist=$root.ics23.NonExistenceProof.decode(r,r.uint32());break;case 3:s.batch=$root.ics23.BatchProof.decode(r,r.uint32());break;case 4:s.compressed=$root.ics23.CompressedBatchProof.decode(r,r.uint32());break;default:r.skipType(c&7);break}}return s},t.decodeDelimited=function(r){return r instanceof $Reader||(r=new $Reader(r)),this.decode(r,r.uint32())},t.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var o={};if(r.exist!=null&&r.hasOwnProperty("exist")){o.proof=1;{var u=$root.ics23.ExistenceProof.verify(r.exist);if(u)return"exist."+u}}if(r.nonexist!=null&&r.hasOwnProperty("nonexist")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.NonExistenceProof.verify(r.nonexist);if(u)return"nonexist."+u}}if(r.batch!=null&&r.hasOwnProperty("batch")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.BatchProof.verify(r.batch);if(u)return"batch."+u}}if(r.compressed!=null&&r.hasOwnProperty("compressed")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.CompressedBatchProof.verify(r.compressed);if(u)return"compressed."+u}}return null},t.fromObject=function(r){if(r instanceof $root.ics23.CommitmentProof)return r;var o=new $root.ics23.CommitmentProof;if(r.exist!=null){if(typeof r.exist!="object")throw TypeError(".ics23.CommitmentProof.exist: object expected");o.exist=$root.ics23.ExistenceProof.fromObject(r.exist)}if(r.nonexist!=null){if(typeof r.nonexist!="object")throw TypeError(".ics23.CommitmentProof.nonexist: object expected");o.nonexist=$root.ics23.NonExistenceProof.fromObject(r.nonexist)}if(r.batch!=null){if(typeof r.batch!="object")throw TypeError(".ics23.CommitmentProof.batch: object expected");o.batch=$root.ics23.BatchProof.fromObject(r.batch)}if(r.compressed!=null){if(typeof r.compressed!="object")throw TypeError(".ics23.CommitmentProof.compressed: object expected");o.compressed=$root.ics23.CompressedBatchProof.fromObject(r.compressed)}return o},t.toObject=function(r,o){o||(o={});var u={};return r.exist!=null&&r.hasOwnProperty("exist")&&(u.exist=$root.ics23.ExistenceProof.toObject(r.exist,o),o.oneofs&&(u.proof="exist")),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&(u.nonexist=$root.ics23.NonExistenceProof.toObject(r.nonexist,o),o.oneofs&&(u.proof="nonexist")),r.batch!=null&&r.hasOwnProperty("batch")&&(u.batch=$root.ics23.BatchProof.toObject(r.batch,o),o.oneofs&&(u.proof="batch")),r.compressed!=null&&r.hasOwnProperty("compressed")&&(u.compressed=$root.ics23.CompressedBatchProof.toObject(r.compressed,o),o.oneofs&&(u.proof="compressed")),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.LeafOp=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.hash=0,t.prototype.prehashKey=0,t.prototype.prehashValue=0,t.prototype.length=0,t.prototype.prefix=$util.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.hash!=null&&e.hasOwnProperty("hash")&&r.uint32(8).int32(e.hash),e.prehashKey!=null&&e.hasOwnProperty("prehashKey")&&r.uint32(16).int32(e.prehashKey),e.prehashValue!=null&&e.hasOwnProperty("prehashValue")&&r.uint32(24).int32(e.prehashValue),e.length!=null&&e.hasOwnProperty("length")&&r.uint32(32).int32(e.length),e.prefix!=null&&e.hasOwnProperty("prefix")&&r.uint32(42).bytes(e.prefix),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.LeafOp;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.hash=e.int32();break;case 2:u.prehashKey=e.int32();break;case 3:u.prehashValue=e.int32();break;case 4:u.length=e.int32();break;case 5:u.prefix=e.bytes();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.hash!=null&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(e.prehashKey!=null&&e.hasOwnProperty("prehashKey"))switch(e.prehashKey){default:return"prehashKey: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(e.prehashValue!=null&&e.hasOwnProperty("prehashValue"))switch(e.prehashValue){default:return"prehashValue: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(e.length!=null&&e.hasOwnProperty("length"))switch(e.length){default:return"length: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return e.prefix!=null&&e.hasOwnProperty("prefix")&&!(e.prefix&&typeof e.prefix.length=="number"||$util.isString(e.prefix))?"prefix: buffer expected":null},t.fromObject=function(e){if(e instanceof $root.ics23.LeafOp)return e;var r=new $root.ics23.LeafOp;switch(e.hash){case"NO_HASH":case 0:r.hash=0;break;case"SHA256":case 1:r.hash=1;break;case"SHA512":case 2:r.hash=2;break;case"KECCAK":case 3:r.hash=3;break;case"RIPEMD160":case 4:r.hash=4;break;case"BITCOIN":case 5:r.hash=5;break;case"SHA512_256":case 6:r.hash=6;break}switch(e.prehashKey){case"NO_HASH":case 0:r.prehashKey=0;break;case"SHA256":case 1:r.prehashKey=1;break;case"SHA512":case 2:r.prehashKey=2;break;case"KECCAK":case 3:r.prehashKey=3;break;case"RIPEMD160":case 4:r.prehashKey=4;break;case"BITCOIN":case 5:r.prehashKey=5;break;case"SHA512_256":case 6:r.prehashKey=6;break}switch(e.prehashValue){case"NO_HASH":case 0:r.prehashValue=0;break;case"SHA256":case 1:r.prehashValue=1;break;case"SHA512":case 2:r.prehashValue=2;break;case"KECCAK":case 3:r.prehashValue=3;break;case"RIPEMD160":case 4:r.prehashValue=4;break;case"BITCOIN":case 5:r.prehashValue=5;break;case"SHA512_256":case 6:r.prehashValue=6;break}switch(e.length){case"NO_PREFIX":case 0:r.length=0;break;case"VAR_PROTO":case 1:r.length=1;break;case"VAR_RLP":case 2:r.length=2;break;case"FIXED32_BIG":case 3:r.length=3;break;case"FIXED32_LITTLE":case 4:r.length=4;break;case"FIXED64_BIG":case 5:r.length=5;break;case"FIXED64_LITTLE":case 6:r.length=6;break;case"REQUIRE_32_BYTES":case 7:r.length=7;break;case"REQUIRE_64_BYTES":case 8:r.length=8;break}return e.prefix!=null&&(typeof e.prefix=="string"?$util.base64.decode(e.prefix,r.prefix=$util.newBuffer($util.base64.length(e.prefix)),0):e.prefix.length&&(r.prefix=e.prefix)),r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.hash=r.enums===String?"NO_HASH":0,o.prehashKey=r.enums===String?"NO_HASH":0,o.prehashValue=r.enums===String?"NO_HASH":0,o.length=r.enums===String?"NO_PREFIX":0,r.bytes===String?o.prefix="":(o.prefix=[],r.bytes!==Array&&(o.prefix=$util.newBuffer(o.prefix)))),e.hash!=null&&e.hasOwnProperty("hash")&&(o.hash=r.enums===String?$root.ics23.HashOp[e.hash]:e.hash),e.prehashKey!=null&&e.hasOwnProperty("prehashKey")&&(o.prehashKey=r.enums===String?$root.ics23.HashOp[e.prehashKey]:e.prehashKey),e.prehashValue!=null&&e.hasOwnProperty("prehashValue")&&(o.prehashValue=r.enums===String?$root.ics23.HashOp[e.prehashValue]:e.prehashValue),e.length!=null&&e.hasOwnProperty("length")&&(o.length=r.enums===String?$root.ics23.LengthOp[e.length]:e.length),e.prefix!=null&&e.hasOwnProperty("prefix")&&(o.prefix=r.bytes===String?$util.base64.encode(e.prefix,0,e.prefix.length):r.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.InnerOp=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.hash=0,t.prototype.prefix=$util.newBuffer([]),t.prototype.suffix=$util.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.hash!=null&&e.hasOwnProperty("hash")&&r.uint32(8).int32(e.hash),e.prefix!=null&&e.hasOwnProperty("prefix")&&r.uint32(18).bytes(e.prefix),e.suffix!=null&&e.hasOwnProperty("suffix")&&r.uint32(26).bytes(e.suffix),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.InnerOp;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.hash=e.int32();break;case 2:u.prefix=e.bytes();break;case 3:u.suffix=e.bytes();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.hash!=null&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}return e.prefix!=null&&e.hasOwnProperty("prefix")&&!(e.prefix&&typeof e.prefix.length=="number"||$util.isString(e.prefix))?"prefix: buffer expected":e.suffix!=null&&e.hasOwnProperty("suffix")&&!(e.suffix&&typeof e.suffix.length=="number"||$util.isString(e.suffix))?"suffix: buffer expected":null},t.fromObject=function(e){if(e instanceof $root.ics23.InnerOp)return e;var r=new $root.ics23.InnerOp;switch(e.hash){case"NO_HASH":case 0:r.hash=0;break;case"SHA256":case 1:r.hash=1;break;case"SHA512":case 2:r.hash=2;break;case"KECCAK":case 3:r.hash=3;break;case"RIPEMD160":case 4:r.hash=4;break;case"BITCOIN":case 5:r.hash=5;break;case"SHA512_256":case 6:r.hash=6;break}return e.prefix!=null&&(typeof e.prefix=="string"?$util.base64.decode(e.prefix,r.prefix=$util.newBuffer($util.base64.length(e.prefix)),0):e.prefix.length&&(r.prefix=e.prefix)),e.suffix!=null&&(typeof e.suffix=="string"?$util.base64.decode(e.suffix,r.suffix=$util.newBuffer($util.base64.length(e.suffix)),0):e.suffix.length&&(r.suffix=e.suffix)),r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.hash=r.enums===String?"NO_HASH":0,r.bytes===String?o.prefix="":(o.prefix=[],r.bytes!==Array&&(o.prefix=$util.newBuffer(o.prefix))),r.bytes===String?o.suffix="":(o.suffix=[],r.bytes!==Array&&(o.suffix=$util.newBuffer(o.suffix)))),e.hash!=null&&e.hasOwnProperty("hash")&&(o.hash=r.enums===String?$root.ics23.HashOp[e.hash]:e.hash),e.prefix!=null&&e.hasOwnProperty("prefix")&&(o.prefix=r.bytes===String?$util.base64.encode(e.prefix,0,e.prefix.length):r.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),e.suffix!=null&&e.hasOwnProperty("suffix")&&(o.suffix=r.bytes===String?$util.base64.encode(e.suffix,0,e.suffix.length):r.bytes===Array?Array.prototype.slice.call(e.suffix):e.suffix),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.ProofSpec=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.leafSpec=null,t.prototype.innerSpec=null,t.prototype.maxDepth=0,t.prototype.minDepth=0,t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.leafSpec!=null&&e.hasOwnProperty("leafSpec")&&$root.ics23.LeafOp.encode(e.leafSpec,r.uint32(10).fork()).ldelim(),e.innerSpec!=null&&e.hasOwnProperty("innerSpec")&&$root.ics23.InnerSpec.encode(e.innerSpec,r.uint32(18).fork()).ldelim(),e.maxDepth!=null&&e.hasOwnProperty("maxDepth")&&r.uint32(24).int32(e.maxDepth),e.minDepth!=null&&e.hasOwnProperty("minDepth")&&r.uint32(32).int32(e.minDepth),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.ProofSpec;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.leafSpec=$root.ics23.LeafOp.decode(e,e.uint32());break;case 2:u.innerSpec=$root.ics23.InnerSpec.decode(e,e.uint32());break;case 3:u.maxDepth=e.int32();break;case 4:u.minDepth=e.int32();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.leafSpec!=null&&e.hasOwnProperty("leafSpec")){var r=$root.ics23.LeafOp.verify(e.leafSpec);if(r)return"leafSpec."+r}if(e.innerSpec!=null&&e.hasOwnProperty("innerSpec")){var r=$root.ics23.InnerSpec.verify(e.innerSpec);if(r)return"innerSpec."+r}return e.maxDepth!=null&&e.hasOwnProperty("maxDepth")&&!$util.isInteger(e.maxDepth)?"maxDepth: integer expected":e.minDepth!=null&&e.hasOwnProperty("minDepth")&&!$util.isInteger(e.minDepth)?"minDepth: integer expected":null},t.fromObject=function(e){if(e instanceof $root.ics23.ProofSpec)return e;var r=new $root.ics23.ProofSpec;if(e.leafSpec!=null){if(typeof e.leafSpec!="object")throw TypeError(".ics23.ProofSpec.leafSpec: object expected");r.leafSpec=$root.ics23.LeafOp.fromObject(e.leafSpec)}if(e.innerSpec!=null){if(typeof e.innerSpec!="object")throw TypeError(".ics23.ProofSpec.innerSpec: object expected");r.innerSpec=$root.ics23.InnerSpec.fromObject(e.innerSpec)}return e.maxDepth!=null&&(r.maxDepth=e.maxDepth|0),e.minDepth!=null&&(r.minDepth=e.minDepth|0),r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.leafSpec=null,o.innerSpec=null,o.maxDepth=0,o.minDepth=0),e.leafSpec!=null&&e.hasOwnProperty("leafSpec")&&(o.leafSpec=$root.ics23.LeafOp.toObject(e.leafSpec,r)),e.innerSpec!=null&&e.hasOwnProperty("innerSpec")&&(o.innerSpec=$root.ics23.InnerSpec.toObject(e.innerSpec,r)),e.maxDepth!=null&&e.hasOwnProperty("maxDepth")&&(o.maxDepth=e.maxDepth),e.minDepth!=null&&e.hasOwnProperty("minDepth")&&(o.minDepth=e.minDepth),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.InnerSpec=function(){function t(n){if(this.childOrder=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.childOrder=$util.emptyArray,t.prototype.childSize=0,t.prototype.minPrefixLength=0,t.prototype.maxPrefixLength=0,t.prototype.emptyChild=$util.newBuffer([]),t.prototype.hash=0,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.childOrder!=null&&e.childOrder.length){r.uint32(10).fork();for(var o=0;o<e.childOrder.length;++o)r.int32(e.childOrder[o]);r.ldelim()}return e.childSize!=null&&e.hasOwnProperty("childSize")&&r.uint32(16).int32(e.childSize),e.minPrefixLength!=null&&e.hasOwnProperty("minPrefixLength")&&r.uint32(24).int32(e.minPrefixLength),e.maxPrefixLength!=null&&e.hasOwnProperty("maxPrefixLength")&&r.uint32(32).int32(e.maxPrefixLength),e.emptyChild!=null&&e.hasOwnProperty("emptyChild")&&r.uint32(42).bytes(e.emptyChild),e.hash!=null&&e.hasOwnProperty("hash")&&r.uint32(48).int32(e.hash),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.InnerSpec;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:if(u.childOrder&&u.childOrder.length||(u.childOrder=[]),(s&7)===2)for(var c=e.uint32()+e.pos;e.pos<c;)u.childOrder.push(e.int32());else u.childOrder.push(e.int32());break;case 2:u.childSize=e.int32();break;case 3:u.minPrefixLength=e.int32();break;case 4:u.maxPrefixLength=e.int32();break;case 5:u.emptyChild=e.bytes();break;case 6:u.hash=e.int32();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.childOrder!=null&&e.hasOwnProperty("childOrder")){if(!Array.isArray(e.childOrder))return"childOrder: array expected";for(var r=0;r<e.childOrder.length;++r)if(!$util.isInteger(e.childOrder[r]))return"childOrder: integer[] expected"}if(e.childSize!=null&&e.hasOwnProperty("childSize")&&!$util.isInteger(e.childSize))return"childSize: integer expected";if(e.minPrefixLength!=null&&e.hasOwnProperty("minPrefixLength")&&!$util.isInteger(e.minPrefixLength))return"minPrefixLength: integer expected";if(e.maxPrefixLength!=null&&e.hasOwnProperty("maxPrefixLength")&&!$util.isInteger(e.maxPrefixLength))return"maxPrefixLength: integer expected";if(e.emptyChild!=null&&e.hasOwnProperty("emptyChild")&&!(e.emptyChild&&typeof e.emptyChild.length=="number"||$util.isString(e.emptyChild)))return"emptyChild: buffer expected";if(e.hash!=null&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}return null},t.fromObject=function(e){if(e instanceof $root.ics23.InnerSpec)return e;var r=new $root.ics23.InnerSpec;if(e.childOrder){if(!Array.isArray(e.childOrder))throw TypeError(".ics23.InnerSpec.childOrder: array expected");r.childOrder=[];for(var o=0;o<e.childOrder.length;++o)r.childOrder[o]=e.childOrder[o]|0}switch(e.childSize!=null&&(r.childSize=e.childSize|0),e.minPrefixLength!=null&&(r.minPrefixLength=e.minPrefixLength|0),e.maxPrefixLength!=null&&(r.maxPrefixLength=e.maxPrefixLength|0),e.emptyChild!=null&&(typeof e.emptyChild=="string"?$util.base64.decode(e.emptyChild,r.emptyChild=$util.newBuffer($util.base64.length(e.emptyChild)),0):e.emptyChild.length&&(r.emptyChild=e.emptyChild)),e.hash){case"NO_HASH":case 0:r.hash=0;break;case"SHA256":case 1:r.hash=1;break;case"SHA512":case 2:r.hash=2;break;case"KECCAK":case 3:r.hash=3;break;case"RIPEMD160":case 4:r.hash=4;break;case"BITCOIN":case 5:r.hash=5;break;case"SHA512_256":case 6:r.hash=6;break}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.childOrder=[]),r.defaults&&(o.childSize=0,o.minPrefixLength=0,o.maxPrefixLength=0,r.bytes===String?o.emptyChild="":(o.emptyChild=[],r.bytes!==Array&&(o.emptyChild=$util.newBuffer(o.emptyChild))),o.hash=r.enums===String?"NO_HASH":0),e.childOrder&&e.childOrder.length){o.childOrder=[];for(var u=0;u<e.childOrder.length;++u)o.childOrder[u]=e.childOrder[u]}return e.childSize!=null&&e.hasOwnProperty("childSize")&&(o.childSize=e.childSize),e.minPrefixLength!=null&&e.hasOwnProperty("minPrefixLength")&&(o.minPrefixLength=e.minPrefixLength),e.maxPrefixLength!=null&&e.hasOwnProperty("maxPrefixLength")&&(o.maxPrefixLength=e.maxPrefixLength),e.emptyChild!=null&&e.hasOwnProperty("emptyChild")&&(o.emptyChild=r.bytes===String?$util.base64.encode(e.emptyChild,0,e.emptyChild.length):r.bytes===Array?Array.prototype.slice.call(e.emptyChild):e.emptyChild),e.hash!=null&&e.hasOwnProperty("hash")&&(o.hash=r.enums===String?$root.ics23.HashOp[e.hash]:e.hash),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.BatchProof=function(){function t(n){if(this.entries=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.entries=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.entries!=null&&e.entries.length)for(var o=0;o<e.entries.length;++o)$root.ics23.BatchEntry.encode(e.entries[o],r.uint32(10).fork()).ldelim();return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.BatchProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.entries&&u.entries.length||(u.entries=[]),u.entries.push($root.ics23.BatchEntry.decode(e,e.uint32()));break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.entries!=null&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var r=0;r<e.entries.length;++r){var o=$root.ics23.BatchEntry.verify(e.entries[r]);if(o)return"entries."+o}}return null},t.fromObject=function(e){if(e instanceof $root.ics23.BatchProof)return e;var r=new $root.ics23.BatchProof;if(e.entries){if(!Array.isArray(e.entries))throw TypeError(".ics23.BatchProof.entries: array expected");r.entries=[];for(var o=0;o<e.entries.length;++o){if(typeof e.entries[o]!="object")throw TypeError(".ics23.BatchProof.entries: object expected");r.entries[o]=$root.ics23.BatchEntry.fromObject(e.entries[o])}}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.entries=[]),e.entries&&e.entries.length){o.entries=[];for(var u=0;u<e.entries.length;++u)o.entries[u]=$root.ics23.BatchEntry.toObject(e.entries[u],r)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.BatchEntry=function(){function t(e){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)e[r[o]]!=null&&(this[r[o]]=e[r[o]])}t.prototype.exist=null,t.prototype.nonexist=null;var n;return Object.defineProperty(t.prototype,"proof",{get:$util.oneOfGetter(n=["exist","nonexist"]),set:$util.oneOfSetter(n)}),t.create=function(r){return new t(r)},t.encode=function(r,o){return o||(o=$Writer.create()),r.exist!=null&&r.hasOwnProperty("exist")&&$root.ics23.ExistenceProof.encode(r.exist,o.uint32(10).fork()).ldelim(),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&$root.ics23.NonExistenceProof.encode(r.nonexist,o.uint32(18).fork()).ldelim(),o},t.encodeDelimited=function(r,o){return this.encode(r,o).ldelim()},t.decode=function(r,o){r instanceof $Reader||(r=$Reader.create(r));for(var u=o===void 0?r.len:r.pos+o,s=new $root.ics23.BatchEntry;r.pos<u;){var c=r.uint32();switch(c>>>3){case 1:s.exist=$root.ics23.ExistenceProof.decode(r,r.uint32());break;case 2:s.nonexist=$root.ics23.NonExistenceProof.decode(r,r.uint32());break;default:r.skipType(c&7);break}}return s},t.decodeDelimited=function(r){return r instanceof $Reader||(r=new $Reader(r)),this.decode(r,r.uint32())},t.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var o={};if(r.exist!=null&&r.hasOwnProperty("exist")){o.proof=1;{var u=$root.ics23.ExistenceProof.verify(r.exist);if(u)return"exist."+u}}if(r.nonexist!=null&&r.hasOwnProperty("nonexist")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.NonExistenceProof.verify(r.nonexist);if(u)return"nonexist."+u}}return null},t.fromObject=function(r){if(r instanceof $root.ics23.BatchEntry)return r;var o=new $root.ics23.BatchEntry;if(r.exist!=null){if(typeof r.exist!="object")throw TypeError(".ics23.BatchEntry.exist: object expected");o.exist=$root.ics23.ExistenceProof.fromObject(r.exist)}if(r.nonexist!=null){if(typeof r.nonexist!="object")throw TypeError(".ics23.BatchEntry.nonexist: object expected");o.nonexist=$root.ics23.NonExistenceProof.fromObject(r.nonexist)}return o},t.toObject=function(r,o){o||(o={});var u={};return r.exist!=null&&r.hasOwnProperty("exist")&&(u.exist=$root.ics23.ExistenceProof.toObject(r.exist,o),o.oneofs&&(u.proof="exist")),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&(u.nonexist=$root.ics23.NonExistenceProof.toObject(r.nonexist,o),o.oneofs&&(u.proof="nonexist")),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedBatchProof=function(){function t(n){if(this.entries=[],this.lookupInners=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.entries=$util.emptyArray,t.prototype.lookupInners=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.entries!=null&&e.entries.length)for(var o=0;o<e.entries.length;++o)$root.ics23.CompressedBatchEntry.encode(e.entries[o],r.uint32(10).fork()).ldelim();if(e.lookupInners!=null&&e.lookupInners.length)for(var o=0;o<e.lookupInners.length;++o)$root.ics23.InnerOp.encode(e.lookupInners[o],r.uint32(18).fork()).ldelim();return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.CompressedBatchProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.entries&&u.entries.length||(u.entries=[]),u.entries.push($root.ics23.CompressedBatchEntry.decode(e,e.uint32()));break;case 2:u.lookupInners&&u.lookupInners.length||(u.lookupInners=[]),u.lookupInners.push($root.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.entries!=null&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var r=0;r<e.entries.length;++r){var o=$root.ics23.CompressedBatchEntry.verify(e.entries[r]);if(o)return"entries."+o}}if(e.lookupInners!=null&&e.hasOwnProperty("lookupInners")){if(!Array.isArray(e.lookupInners))return"lookupInners: array expected";for(var r=0;r<e.lookupInners.length;++r){var o=$root.ics23.InnerOp.verify(e.lookupInners[r]);if(o)return"lookupInners."+o}}return null},t.fromObject=function(e){if(e instanceof $root.ics23.CompressedBatchProof)return e;var r=new $root.ics23.CompressedBatchProof;if(e.entries){if(!Array.isArray(e.entries))throw TypeError(".ics23.CompressedBatchProof.entries: array expected");r.entries=[];for(var o=0;o<e.entries.length;++o){if(typeof e.entries[o]!="object")throw TypeError(".ics23.CompressedBatchProof.entries: object expected");r.entries[o]=$root.ics23.CompressedBatchEntry.fromObject(e.entries[o])}}if(e.lookupInners){if(!Array.isArray(e.lookupInners))throw TypeError(".ics23.CompressedBatchProof.lookupInners: array expected");r.lookupInners=[];for(var o=0;o<e.lookupInners.length;++o){if(typeof e.lookupInners[o]!="object")throw TypeError(".ics23.CompressedBatchProof.lookupInners: object expected");r.lookupInners[o]=$root.ics23.InnerOp.fromObject(e.lookupInners[o])}}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.entries=[],o.lookupInners=[]),e.entries&&e.entries.length){o.entries=[];for(var u=0;u<e.entries.length;++u)o.entries[u]=$root.ics23.CompressedBatchEntry.toObject(e.entries[u],r)}if(e.lookupInners&&e.lookupInners.length){o.lookupInners=[];for(var u=0;u<e.lookupInners.length;++u)o.lookupInners[u]=$root.ics23.InnerOp.toObject(e.lookupInners[u],r)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedBatchEntry=function(){function t(e){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)e[r[o]]!=null&&(this[r[o]]=e[r[o]])}t.prototype.exist=null,t.prototype.nonexist=null;var n;return Object.defineProperty(t.prototype,"proof",{get:$util.oneOfGetter(n=["exist","nonexist"]),set:$util.oneOfSetter(n)}),t.create=function(r){return new t(r)},t.encode=function(r,o){return o||(o=$Writer.create()),r.exist!=null&&r.hasOwnProperty("exist")&&$root.ics23.CompressedExistenceProof.encode(r.exist,o.uint32(10).fork()).ldelim(),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&$root.ics23.CompressedNonExistenceProof.encode(r.nonexist,o.uint32(18).fork()).ldelim(),o},t.encodeDelimited=function(r,o){return this.encode(r,o).ldelim()},t.decode=function(r,o){r instanceof $Reader||(r=$Reader.create(r));for(var u=o===void 0?r.len:r.pos+o,s=new $root.ics23.CompressedBatchEntry;r.pos<u;){var c=r.uint32();switch(c>>>3){case 1:s.exist=$root.ics23.CompressedExistenceProof.decode(r,r.uint32());break;case 2:s.nonexist=$root.ics23.CompressedNonExistenceProof.decode(r,r.uint32());break;default:r.skipType(c&7);break}}return s},t.decodeDelimited=function(r){return r instanceof $Reader||(r=new $Reader(r)),this.decode(r,r.uint32())},t.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var o={};if(r.exist!=null&&r.hasOwnProperty("exist")){o.proof=1;{var u=$root.ics23.CompressedExistenceProof.verify(r.exist);if(u)return"exist."+u}}if(r.nonexist!=null&&r.hasOwnProperty("nonexist")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.CompressedNonExistenceProof.verify(r.nonexist);if(u)return"nonexist."+u}}return null},t.fromObject=function(r){if(r instanceof $root.ics23.CompressedBatchEntry)return r;var o=new $root.ics23.CompressedBatchEntry;if(r.exist!=null){if(typeof r.exist!="object")throw TypeError(".ics23.CompressedBatchEntry.exist: object expected");o.exist=$root.ics23.CompressedExistenceProof.fromObject(r.exist)}if(r.nonexist!=null){if(typeof r.nonexist!="object")throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected");o.nonexist=$root.ics23.CompressedNonExistenceProof.fromObject(r.nonexist)}return o},t.toObject=function(r,o){o||(o={});var u={};return r.exist!=null&&r.hasOwnProperty("exist")&&(u.exist=$root.ics23.CompressedExistenceProof.toObject(r.exist,o),o.oneofs&&(u.proof="exist")),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&(u.nonexist=$root.ics23.CompressedNonExistenceProof.toObject(r.nonexist,o),o.oneofs&&(u.proof="nonexist")),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedExistenceProof=function(){function t(n){if(this.path=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.value=$util.newBuffer([]),t.prototype.leaf=null,t.prototype.path=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.value!=null&&e.hasOwnProperty("value")&&r.uint32(18).bytes(e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&$root.ics23.LeafOp.encode(e.leaf,r.uint32(26).fork()).ldelim(),e.path!=null&&e.path.length){r.uint32(34).fork();for(var o=0;o<e.path.length;++o)r.int32(e.path[o]);r.ldelim()}return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.CompressedExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.value=e.bytes();break;case 3:u.leaf=$root.ics23.LeafOp.decode(e,e.uint32());break;case 4:if(u.path&&u.path.length||(u.path=[]),(s&7)===2)for(var c=e.uint32()+e.pos;e.pos<c;)u.path.push(e.int32());else u.path.push(e.int32());break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.value!=null&&e.hasOwnProperty("value")&&!(e.value&&typeof e.value.length=="number"||$util.isString(e.value)))return"value: buffer expected";if(e.leaf!=null&&e.hasOwnProperty("leaf")){var r=$root.ics23.LeafOp.verify(e.leaf);if(r)return"leaf."+r}if(e.path!=null&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var o=0;o<e.path.length;++o)if(!$util.isInteger(e.path[o]))return"path: integer[] expected"}return null},t.fromObject=function(e){if(e instanceof $root.ics23.CompressedExistenceProof)return e;var r=new $root.ics23.CompressedExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.value!=null&&(typeof e.value=="string"?$util.base64.decode(e.value,r.value=$util.newBuffer($util.base64.length(e.value)),0):e.value.length&&(r.value=e.value)),e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".ics23.CompressedExistenceProof.leaf: object expected");r.leaf=$root.ics23.LeafOp.fromObject(e.leaf)}if(e.path){if(!Array.isArray(e.path))throw TypeError(".ics23.CompressedExistenceProof.path: array expected");r.path=[];for(var o=0;o<e.path.length;++o)r.path[o]=e.path[o]|0}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.path=[]),r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),r.bytes===String?o.value="":(o.value=[],r.bytes!==Array&&(o.value=$util.newBuffer(o.value))),o.leaf=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.value!=null&&e.hasOwnProperty("value")&&(o.value=r.bytes===String?$util.base64.encode(e.value,0,e.value.length):r.bytes===Array?Array.prototype.slice.call(e.value):e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&(o.leaf=$root.ics23.LeafOp.toObject(e.leaf,r)),e.path&&e.path.length){o.path=[];for(var u=0;u<e.path.length;++u)o.path[u]=e.path[u]}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedNonExistenceProof=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.left=null,t.prototype.right=null,t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.left!=null&&e.hasOwnProperty("left")&&$root.ics23.CompressedExistenceProof.encode(e.left,r.uint32(18).fork()).ldelim(),e.right!=null&&e.hasOwnProperty("right")&&$root.ics23.CompressedExistenceProof.encode(e.right,r.uint32(26).fork()).ldelim(),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.CompressedNonExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.left=$root.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 3:u.right=$root.ics23.CompressedExistenceProof.decode(e,e.uint32());break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.left!=null&&e.hasOwnProperty("left")){var r=$root.ics23.CompressedExistenceProof.verify(e.left);if(r)return"left."+r}if(e.right!=null&&e.hasOwnProperty("right")){var r=$root.ics23.CompressedExistenceProof.verify(e.right);if(r)return"right."+r}return null},t.fromObject=function(e){if(e instanceof $root.ics23.CompressedNonExistenceProof)return e;var r=new $root.ics23.CompressedNonExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.left!=null){if(typeof e.left!="object")throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected");r.left=$root.ics23.CompressedExistenceProof.fromObject(e.left)}if(e.right!=null){if(typeof e.right!="object")throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected");r.right=$root.ics23.CompressedExistenceProof.fromObject(e.right)}return r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),o.left=null,o.right=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.left!=null&&e.hasOwnProperty("left")&&(o.left=$root.ics23.CompressedExistenceProof.toObject(e.left,r)),e.right!=null&&e.hasOwnProperty("right")&&(o.right=$root.ics23.CompressedExistenceProof.toObject(e.right,r)),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i}();var codecimpl=$root,ics23={},compress$1={};Object.defineProperty(compress$1,"__esModule",{value:!0});compress$1.decompress=compress$1.compress=void 0;const codecimpl_1$2=codecimpl;function compress(i){return i.batch?{compressed:compressBatch(i.batch)}:i}compress$1.compress=compress;function decompress(i){return i.compressed?{batch:decompressBatch(i.compressed)}:i}compress$1.decompress=decompress;function compressBatch(i){const t=[],n=[],e=new Map;for(const r of i.entries)if(r.exist){const o={exist:compressExist(r.exist,n,e)};t.push(o)}else if(r.nonexist){const o=r.nonexist,u={nonexist:{key:o.key,left:compressExist(o.left,n,e),right:compressExist(o.right,n,e)}};t.push(u)}else throw new Error("Unexpected batch entry during compress");return{entries:t,lookupInners:n}}function compressExist(i,t,n){if(!i)return;const e=i.path.map(r=>{const o=codecimpl_1$2.ics23.InnerOp.encode(r).finish();let u=n.get(o);return u===void 0&&(u=t.length,t.push(r),n.set(o,u)),u});return{key:i.key,value:i.value,leaf:i.leaf,path:e}}function decompressBatch(i){const t=i.lookupInners;return{entries:i.entries.map(e=>{if(e.exist)return{exist:decompressExist(e.exist,t)};if(e.nonexist){const r=e.nonexist;return{nonexist:{key:r.key,left:decompressExist(r.left,t),right:decompressExist(r.right,t)}}}else throw new Error("Unexpected batch entry during compress")})}}function decompressExist(i,t){if(!i)return;const{key:n,value:e,leaf:r,path:o}=i,u=(o||[]).map(s=>t[s]);return{key:n,value:e,leaf:r,path:u}}var proofs={},ops={};Object.defineProperty(ops,"__esModule",{value:!0});ops.doHash=ops.applyInner=ops.applyLeaf=void 0;const ripemd160_1=require$$0,sha256_1=require$$0$2,sha512_1=require$$1,codecimpl_1$1=codecimpl;function applyLeaf(i,t,n){if(t.length===0)throw new Error("Missing key");if(n.length===0)throw new Error("Missing value");const e=prepareLeafData(ensureHash(i.prehashKey),ensureLength(i.length),t),r=prepareLeafData(ensureHash(i.prehashValue),ensureLength(i.length),n),o=new Uint8Array([...ensureBytes(i.prefix),...e,...r]);return doHash(ensureHash(i.hash),o)}ops.applyLeaf=applyLeaf;function applyInner(i,t){if(t.length===0)throw new Error("Inner op needs child value");const n=new Uint8Array([...ensureBytes(i.prefix),...t,...ensureBytes(i.suffix)]);return doHash(ensureHash(i.hash),n)}ops.applyInner=applyInner;function ensure(i,t){return i??t}const ensureHash=i=>ensure(i,codecimpl_1$1.ics23.HashOp.NO_HASH),ensureLength=i=>ensure(i,codecimpl_1$1.ics23.LengthOp.NO_PREFIX),ensureBytes=i=>ensure(i,new Uint8Array([]));function prepareLeafData(i,t,n){const e=doHashOrNoop(i,n);return doLengthOp(t,e)}function doHashOrNoop(i,t){return i===codecimpl_1$1.ics23.HashOp.NO_HASH?t:doHash(i,t)}function doHash(i,t){switch(i){case codecimpl_1$1.ics23.HashOp.SHA256:return(0,sha256_1.sha256)(t);case codecimpl_1$1.ics23.HashOp.SHA512:return(0,sha512_1.sha512)(t);case codecimpl_1$1.ics23.HashOp.RIPEMD160:return(0,ripemd160_1.ripemd160)(t);case codecimpl_1$1.ics23.HashOp.BITCOIN:return(0,ripemd160_1.ripemd160)((0,sha256_1.sha256)(t));case codecimpl_1$1.ics23.HashOp.SHA512_256:return(0,sha512_1.sha512_256)(t)}throw new Error(`Unsupported hashop: ${i}`)}ops.doHash=doHash;function doLengthOp(i,t){switch(i){case codecimpl_1$1.ics23.LengthOp.NO_PREFIX:return t;case codecimpl_1$1.ics23.LengthOp.VAR_PROTO:return new Uint8Array([...encodeVarintProto(t.length),...t]);case codecimpl_1$1.ics23.LengthOp.REQUIRE_32_BYTES:if(t.length!==32)throw new Error(`Length is ${t.length}, not 32 bytes`);return t;case codecimpl_1$1.ics23.LengthOp.REQUIRE_64_BYTES:if(t.length!==64)throw new Error(`Length is ${t.length}, not 64 bytes`);return t;case codecimpl_1$1.ics23.LengthOp.FIXED32_LITTLE:return new Uint8Array([...encodeFixed32Le(t.length),...t])}throw new Error(`Unsupported lengthop: ${i}`)}function encodeVarintProto(i){let t=[],n=i;for(;n>=128;){const e=n%128+128;t=[...t,e],n=n/128}return t=[...t,n],new Uint8Array(t)}function encodeFixed32Le(i){const t=new Uint8Array(4);let n=i;for(let e=t.length;e>0;e--)t[Math.abs(e-t.length)]=n%256,n=Math.floor(n/256);return t}var specs={};Object.defineProperty(specs,"__esModule",{value:!0});specs.bytesBefore=specs.ensureBytesBefore=specs.bytesEqual=specs.ensureBytesEqual=specs.ensureInner=specs.ensureLeaf=void 0;function ensureLeaf(i,t){if(i.hash!==t.hash)throw new Error(`Unexpected hashOp: ${i.hash}`);if(i.prehashKey!==t.prehashKey)throw new Error(`Unexpected prehashKey: ${i.prehashKey}`);if(i.prehashValue!==t.prehashValue)throw new Error(`Unexpected prehashValue: ${i.prehashValue}`);if(i.length!==t.length)throw new Error(`Unexpected length op: ${i.length}`);ensurePrefix(i.prefix,t.prefix)}specs.ensureLeaf=ensureLeaf;function ensureInner(i,t,n){if(i.hash!==n.hash)throw new Error(`Unexpected hashOp: ${i.hash}`);if(!i.prefix)throw new Error("No prefix set for inner node");if(hasPrefix(i.prefix,t))throw new Error("Inner node has leaf prefix");if(i.prefix.length<(n.minPrefixLength||0))throw new Error(`Prefix too short: ${i.prefix.length} bytes`);const e=(n.childOrder.length-1)*n.childSize;if(i.prefix.length>(n.maxPrefixLength||0)+e)throw new Error(`Prefix too long: ${i.prefix.length} bytes`)}specs.ensureInner=ensureInner;function ensurePrefix(i,t){if(!(!t||t.length===0)){if(!i)throw new Error("Target bytes missing");ensureBytesEqual(t,i.slice(0,t.length))}}function ensureBytesEqual(i,t){if(i.length!==t.length)throw new Error(`Different lengths ${i.length} vs ${t.length}`);for(let n=0;n<i.length;n++)if(i[n]!==t[n])throw new Error(`Arrays differ at index ${n}: ${i[n]} vs ${t[n]}`)}specs.ensureBytesEqual=ensureBytesEqual;function bytesEqual(i,t){if(i.length!==t.length)return!1;for(let n=0;n<i.length;n++)if(i[n]!==t[n])return!1;return!0}specs.bytesEqual=bytesEqual;function hasPrefix(i,t){if(!t||t.length===0||!i||i.length<=t.length)return!1;for(let n=0;n<t.length;n++)if(i[n]!==t[n])return!1;throw!0}function ensureBytesBefore(i,t){if(!bytesBefore(i,t))throw new Error("first is after last")}specs.ensureBytesBefore=ensureBytesBefore;function bytesBefore(i,t){const n=i.length<t.length?i.length:t.length;for(let e=0;e<n;e++){if(i[e]<t[e])return!0;if(i[e]>t[e])return!1}return i.length<t.length}specs.bytesBefore=bytesBefore;Object.defineProperty(proofs,"__esModule",{value:!0});proofs.ensureLeftNeighbor=proofs.ensureSpec=proofs.calculateExistenceRoot=proofs.verifyNonExistence=proofs.verifyExistence=proofs.smtSpec=proofs.tendermintSpec=proofs.iavlSpec=void 0;const codecimpl_1=codecimpl,ops_1=ops,specs_1$1=specs;proofs.iavlSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:codecimpl_1.ics23.HashOp.SHA256,prehashValue:codecimpl_1.ics23.HashOp.SHA256,prehashKey:codecimpl_1.ics23.HashOp.NO_HASH,length:codecimpl_1.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:4,maxPrefixLength:12,childSize:33,hash:codecimpl_1.ics23.HashOp.SHA256}};proofs.tendermintSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:codecimpl_1.ics23.HashOp.SHA256,prehashValue:codecimpl_1.ics23.HashOp.SHA256,prehashKey:codecimpl_1.ics23.HashOp.NO_HASH,length:codecimpl_1.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:1,maxPrefixLength:1,childSize:32,hash:codecimpl_1.ics23.HashOp.SHA256}};proofs.smtSpec={leafSpec:{hash:codecimpl_1.ics23.HashOp.SHA256,prehashKey:codecimpl_1.ics23.HashOp.NO_HASH,prehashValue:codecimpl_1.ics23.HashOp.SHA256,length:codecimpl_1.ics23.LengthOp.NO_PREFIX,prefix:Uint8Array.from([0])},innerSpec:{childOrder:[0,1],childSize:32,minPrefixLength:1,maxPrefixLength:1,emptyChild:new Uint8Array(32),hash:codecimpl_1.ics23.HashOp.SHA256},maxDepth:256};function verifyExistence(i,t,n,e,r){ensureSpec(i,t);const o=calculateExistenceRoot(i);(0,specs_1$1.ensureBytesEqual)(o,n),(0,specs_1$1.ensureBytesEqual)(e,i.key),(0,specs_1$1.ensureBytesEqual)(r,i.value)}proofs.verifyExistence=verifyExistence;function verifyNonExistence(i,t,n,e){let r,o;if(i.left&&(verifyExistence(i.left,t,n,i.left.key,i.left.value),r=i.left.key),i.right&&(verifyExistence(i.right,t,n,i.right.key,i.right.value),o=i.right.key),!r&&!o)throw new Error("neither left nor right proof defined");if(r&&(0,specs_1$1.ensureBytesBefore)(r,e),o&&(0,specs_1$1.ensureBytesBefore)(e,o),!t.innerSpec)throw new Error("no inner spec");r?o?ensureLeftNeighbor(t.innerSpec,i.left.path,i.right.path):ensureRightMost(t.innerSpec,i.left.path):ensureLeftMost(t.innerSpec,i.right.path)}proofs.verifyNonExistence=verifyNonExistence;function calculateExistenceRoot(i){if(!i.key||!i.value)throw new Error("Existence proof needs key and value set");if(!i.leaf)throw new Error("Existence proof must start with a leaf operation");const t=i.path||[];let n=(0,ops_1.applyLeaf)(i.leaf,i.key,i.value);for(const e of t)n=(0,ops_1.applyInner)(e,n);return n}proofs.calculateExistenceRoot=calculateExistenceRoot;function ensureSpec(i,t){if(!i.leaf)throw new Error("Existence proof must start with a leaf operation");if(!t.leafSpec)throw new Error("Spec must include leafSpec");if(!t.innerSpec)throw new Error("Spec must include innerSpec");(0,specs_1$1.ensureLeaf)(i.leaf,t.leafSpec);const n=i.path||[];if(t.minDepth&&n.length<t.minDepth)throw new Error(`Too few inner nodes ${n.length}`);if(t.maxDepth&&n.length>t.maxDepth)throw new Error(`Too many inner nodes ${n.length}`);for(const e of n)(0,specs_1$1.ensureInner)(e,t.leafSpec.prefix,t.innerSpec)}proofs.ensureSpec=ensureSpec;function ensureLeftMost(i,t){const{minPrefix:n,maxPrefix:e,suffix:r}=getPadding(i,0);for(const o of t)if(!hasPadding(o,n,e,r))throw new Error("Step not leftmost")}function ensureRightMost(i,t){const n=i.childOrder.length-1,{minPrefix:e,maxPrefix:r,suffix:o}=getPadding(i,n);for(const u of t)if(!hasPadding(u,e,r,o))throw new Error("Step not leftmost")}function ensureLeftNeighbor(i,t,n){const e=[...t],r=[...n];let o=e.pop(),u=r.pop();for(;(0,specs_1$1.bytesEqual)(o.prefix,u.prefix)&&(0,specs_1$1.bytesEqual)(o.suffix,u.suffix);)o=e.pop(),u=r.pop();if(!isLeftStep(i,o,u))throw new Error("Not left neightbor at first divergent step");ensureRightMost(i,e),ensureLeftMost(i,r)}proofs.ensureLeftNeighbor=ensureLeftNeighbor;function isLeftStep(i,t,n){const e=orderFromPadding(i,t);return orderFromPadding(i,n)===e+1}function orderFromPadding(i,t){for(let n=0;n<i.childOrder.length;n++){const{minPrefix:e,maxPrefix:r,suffix:o}=getPadding(i,n);if(hasPadding(t,e,r,o))return n}throw new Error("Cannot find any valid spacing for this node")}function hasPadding(i,t,n,e){return(i.prefix||[]).length<t||(i.prefix||[]).length>n?!1:(i.suffix||[]).length===e}function getPadding(i,t){const n=getPosition(i.childOrder,t),e=n*i.childSize,r=e+i.minPrefixLength,o=e+i.maxPrefixLength,u=(i.childOrder.length-1-n)*i.childSize;return{minPrefix:r,maxPrefix:o,suffix:u}}function getPosition(i,t){if(t<0||t>=i.length)throw new Error(`Invalid branch: ${t}`);return i.findIndex(n=>n===t)}Object.defineProperty(ics23,"__esModule",{value:!0});ics23.batchVerifyNonMembership=ics23.batchVerifyMembership=ics23.verifyNonMembership=ics23.verifyMembership=void 0;const compress_1=compress$1,proofs_1=proofs,specs_1=specs;function verifyMembership(i,t,n,e,r){const o=(0,compress_1.decompress)(i),u=getExistForKey(o,e);if(!u)return!1;try{return(0,proofs_1.verifyExistence)(u,t,n,e,r),!0}catch{return!1}}ics23.verifyMembership=verifyMembership;function verifyNonMembership(i,t,n,e){const r=(0,compress_1.decompress)(i),o=getNonExistForKey(r,e);if(!o)return!1;try{return(0,proofs_1.verifyNonExistence)(o,t,n,e),!0}catch{return!1}}ics23.verifyNonMembership=verifyNonMembership;function batchVerifyMembership(i,t,n,e){const r=(0,compress_1.decompress)(i);for(const[o,u]of e.entries())if(!verifyMembership(r,t,n,o,u))return!1;return!0}ics23.batchVerifyMembership=batchVerifyMembership;function batchVerifyNonMembership(i,t,n,e){const r=(0,compress_1.decompress)(i);for(const o of e)if(!verifyNonMembership(r,t,n,o))return!1;return!0}ics23.batchVerifyNonMembership=batchVerifyNonMembership;function getExistForKey(i,t){const n=e=>!!e&&(0,specs_1.bytesEqual)(t,e.key);if(n(i.exist))return i.exist;if(i.batch)return i.batch.entries.map(e=>e.exist||null).find(n)}function getNonExistForKey(i,t){const n=e=>!!e&&(!e.left||(0,specs_1.bytesBefore)(e.left.key,t))&&(!e.right||(0,specs_1.bytesBefore)(t,e.right.key));if(n(i.nonexist))return i.nonexist;if(i.batch)return i.batch.entries.map(e=>e.nonexist||null).find(n)}(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.verifyNonExistence=i.verifyExistence=i.tendermintSpec=i.iavlSpec=i.calculateExistenceRoot=i.verifyNonMembership=i.verifyMembership=i.ics23=void 0;var t=codecimpl;Object.defineProperty(i,"ics23",{enumerable:!0,get:function(){return t.ics23}});var n=ics23;Object.defineProperty(i,"verifyMembership",{enumerable:!0,get:function(){return n.verifyMembership}}),Object.defineProperty(i,"verifyNonMembership",{enumerable:!0,get:function(){return n.verifyNonMembership}});var e=proofs;Object.defineProperty(i,"calculateExistenceRoot",{enumerable:!0,get:function(){return e.calculateExistenceRoot}}),Object.defineProperty(i,"iavlSpec",{enumerable:!0,get:function(){return e.iavlSpec}}),Object.defineProperty(i,"tendermintSpec",{enumerable:!0,get:function(){return e.tendermintSpec}}),Object.defineProperty(i,"verifyExistence",{enumerable:!0,get:function(){return e.verifyExistence}}),Object.defineProperty(i,"verifyNonExistence",{enumerable:!0,get:function(){return e.verifyNonExistence}})})(build);var xstream={},ponyfill$1={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=t;function t(n){var e,r=n.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{e=r.for("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}})(ponyfill$1);var ponyfill=ponyfill$1,implementation_browser={exports:{}};typeof self<"u"?implementation_browser.exports=self:typeof window<"u"?implementation_browser.exports=window:implementation_browser.exports=Function("return this")();var implementation_browserExports=implementation_browser.exports,implementation$1=implementation_browserExports,polyfill$1=function i(){return typeof index.commonjsGlobal!="object"||!index.commonjsGlobal||index.commonjsGlobal.Math!==Math||index.commonjsGlobal.Array!==Array?implementation$1:index.commonjsGlobal},define=index$1.defineProperties_1,gOPD=index$1.gopd,getPolyfill$1=polyfill$1,shim$1=function i(){var t=getPolyfill$1();if(define.supportsDescriptors){var n=gOPD(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},defineProperties=index$1.defineProperties_1,implementation=implementation_browserExports,getPolyfill=polyfill$1,shim=shim$1,polyfill=getPolyfill(),getGlobal=function(){return polyfill};defineProperties(getGlobal,{getPolyfill,implementation,shim});var globalthis=getGlobal,__extends=index.commonjsGlobal&&index.commonjsGlobal.__extends||function(){var i=function(t,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)r.hasOwnProperty(o)&&(e[o]=r[o])},i(t,n)};return function(t,n){i(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}}();Object.defineProperty(xstream,"__esModule",{value:!0});xstream.NO_IL=xstream.NO=xstream.MemoryStream=xstream.Stream=void 0;var ponyfill_1=ponyfill,globalthis_1=globalthis,$$observable=ponyfill_1.default(globalthis_1.getPolyfill()),NO={};xstream.NO=NO;function noop(){}function cp(i){for(var t=i.length,n=Array(t),e=0;e<t;++e)n[e]=i[e];return n}function and(i,t){return function(e){return i(e)&&t(e)}}function _try(i,t,n){try{return i.f(t)}catch(e){return n._e(e),NO}}var NO_IL={_n:noop,_e:noop,_c:noop};xstream.NO_IL=NO_IL;function internalizeProducer(i){i._start=function(n){n.next=n._n,n.error=n._e,n.complete=n._c,this.start(n)},i._stop=i.stop}var StreamSub=function(){function i(t,n){this._stream=t,this._listener=n}return i.prototype.unsubscribe=function(){this._stream._remove(this._listener)},i}(),Observer=function(){function i(t){this._listener=t}return i.prototype.next=function(t){this._listener._n(t)},i.prototype.error=function(t){this._listener._e(t)},i.prototype.complete=function(){this._listener._c()},i}(),FromObservable=function(){function i(t){this.type="fromObservable",this.ins=t,this.active=!1}return i.prototype._start=function(t){this.out=t,this.active=!0,this._sub=this.ins.subscribe(new Observer(t)),this.active||this._sub.unsubscribe()},i.prototype._stop=function(){this._sub&&this._sub.unsubscribe(),this.active=!1},i}(),Merge=function(){function i(t){this.type="merge",this.insArr=t,this.out=NO,this.ac=0}return i.prototype._start=function(t){this.out=t;var n=this.insArr,e=n.length;this.ac=e;for(var r=0;r<e;r++)n[r]._add(this)},i.prototype._stop=function(){for(var t=this.insArr,n=t.length,e=0;e<n;e++)t[e]._remove(this);this.out=NO},i.prototype._n=function(t){var n=this.out;n!==NO&&n._n(t)},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){if(--this.ac<=0){var t=this.out;if(t===NO)return;t._c()}},i}(),CombineListener=function(){function i(t,n,e){this.i=t,this.out=n,this.p=e,e.ils.push(this)}return i.prototype._n=function(t){var n=this.p,e=this.out;if(e!==NO&&n.up(t,this.i)){var r=cp(n.vals);e._n(r)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.p;t.out!==NO&&--t.Nc===0&&t.out._c()},i}(),Combine=function(){function i(t){this.type="combine",this.insArr=t,this.out=NO,this.ils=[],this.Nc=this.Nn=0,this.vals=[]}return i.prototype.up=function(t,n){var e=this.vals[n],r=this.Nn?e===NO?--this.Nn:this.Nn:0;return this.vals[n]=t,r===0},i.prototype._start=function(t){this.out=t;var n=this.insArr,e=this.Nc=this.Nn=n.length,r=this.vals=new Array(e);if(e===0)t._n([]),t._c();else for(var o=0;o<e;o++)r[o]=NO,n[o]._add(new CombineListener(o,t,this))},i.prototype._stop=function(){for(var t=this.insArr,n=t.length,e=this.ils,r=0;r<n;r++)t[r]._remove(e[r]);this.out=NO,this.ils=[],this.vals=[]},i}(),FromArray=function(){function i(t){this.type="fromArray",this.a=t}return i.prototype._start=function(t){for(var n=this.a,e=0,r=n.length;e<r;e++)t._n(n[e]);t._c()},i.prototype._stop=function(){},i}(),FromPromise=function(){function i(t){this.type="fromPromise",this.on=!1,this.p=t}return i.prototype._start=function(t){var n=this;this.on=!0,this.p.then(function(e){n.on&&(t._n(e),t._c())},function(e){t._e(e)}).then(noop,function(e){setTimeout(function(){throw e})})},i.prototype._stop=function(){this.on=!1},i}(),Periodic=function(){function i(t){this.type="periodic",this.period=t,this.intervalID=-1,this.i=0}return i.prototype._start=function(t){var n=this;function e(){t._n(n.i++)}this.intervalID=setInterval(e,this.period)},i.prototype._stop=function(){this.intervalID!==-1&&clearInterval(this.intervalID),this.intervalID=-1,this.i=0},i}(),Debug=function(){function i(t,n){this.type="debug",this.ins=t,this.out=NO,this.s=noop,this.l="",typeof n=="string"?this.l=n:typeof n=="function"&&(this.s=n)}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=this.s,r=this.l;if(e!==noop)try{e(t)}catch(o){n._e(o)}else r?console.log(r+":",t):console.log(t);n._n(t)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Drop=function(){function i(t,n){this.type="drop",this.ins=n,this.out=NO,this.max=t,this.dropped=0}return i.prototype._start=function(t){this.out=t,this.dropped=0,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;n!==NO&&this.dropped++>=this.max&&n._n(t)},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),EndWhenListener=function(){function i(t,n){this.out=t,this.op=n}return i.prototype._n=function(){this.op.end()},i.prototype._e=function(t){this.out._e(t)},i.prototype._c=function(){this.op.end()},i}(),EndWhen=function(){function i(t,n){this.type="endWhen",this.ins=n,this.out=NO,this.o=t,this.oil=NO_IL}return i.prototype._start=function(t){this.out=t,this.o._add(this.oil=new EndWhenListener(t,this)),this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=NO,this.oil=NO_IL},i.prototype.end=function(){var t=this.out;t!==NO&&t._c()},i.prototype._n=function(t){var n=this.out;n!==NO&&n._n(t)},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){this.end()},i}(),Filter=function(){function i(t,n){this.type="filter",this.ins=n,this.out=NO,this.f=t}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=_try(this,t,n);e===NO||!e||n._n(t)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),FlattenListener=function(){function i(t,n){this.out=t,this.op=n}return i.prototype._n=function(t){this.out._n(t)},i.prototype._e=function(t){this.out._e(t)},i.prototype._c=function(){this.op.inner=NO,this.op.less()},i}(),Flatten=function(){function i(t){this.type="flatten",this.ins=t,this.out=NO,this.open=!0,this.inner=NO,this.il=NO_IL}return i.prototype._start=function(t){this.out=t,this.open=!0,this.inner=NO,this.il=NO_IL,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.inner!==NO&&this.inner._remove(this.il),this.out=NO,this.open=!0,this.inner=NO,this.il=NO_IL},i.prototype.less=function(){var t=this.out;t!==NO&&!this.open&&this.inner===NO&&t._c()},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=this,r=e.inner,o=e.il;r!==NO&&o!==NO_IL&&r._remove(o),(this.inner=t)._add(this.il=new FlattenListener(n,this))}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){this.open=!1,this.less()},i}(),Fold=function(){function i(t,n,e){var r=this;this.type="fold",this.ins=e,this.out=NO,this.f=function(o){return t(r.acc,o)},this.acc=this.seed=n}return i.prototype._start=function(t){this.out=t,this.acc=this.seed,t._n(this.acc),this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO,this.acc=this.seed},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=_try(this,t,n);e!==NO&&n._n(this.acc=e)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Last=function(){function i(t){this.type="last",this.ins=t,this.out=NO,this.has=!1,this.val=NO}return i.prototype._start=function(t){this.out=t,this.has=!1,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO,this.val=NO},i.prototype._n=function(t){this.has=!0,this.val=t},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&(this.has?(t._n(this.val),t._c()):t._e(new Error("last() failed because input stream completed")))},i}(),MapOp=function(){function i(t,n){this.type="map",this.ins=n,this.out=NO,this.f=t}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=_try(this,t,n);e!==NO&&n._n(e)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Remember=function(){function i(t){this.type="remember",this.ins=t,this.out=NO}return i.prototype._start=function(t){this.out=t,this.ins._add(t)},i.prototype._stop=function(){this.ins._remove(this.out),this.out=NO},i}(),ReplaceError=function(){function i(t,n){this.type="replaceError",this.ins=n,this.out=NO,this.f=t}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;n!==NO&&n._n(t)},i.prototype._e=function(t){var n=this.out;if(n!==NO)try{this.ins._remove(this),(this.ins=this.f(t))._add(this)}catch(e){n._e(e)}},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),StartWith=function(){function i(t,n){this.type="startWith",this.ins=t,this.out=NO,this.val=n}return i.prototype._start=function(t){this.out=t,this.out._n(this.val),this.ins._add(t)},i.prototype._stop=function(){this.ins._remove(this.out),this.out=NO},i}(),Take=function(){function i(t,n){this.type="take",this.ins=n,this.out=NO,this.max=t,this.taken=0}return i.prototype._start=function(t){this.out=t,this.taken=0,this.max<=0?t._c():this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=++this.taken;e<this.max?n._n(t):e===this.max&&(n._n(t),n._c())}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Stream=function(){function i(t){this._prod=t||NO,this._ils=[],this._stopID=NO,this._dl=NO,this._d=!1,this._target=null,this._err=NO}return i.prototype._n=function(t){var n=this._ils,e=n.length;if(this._d&&this._dl._n(t),e==1)n[0]._n(t);else{if(e==0)return;for(var r=cp(n),o=0;o<e;o++)r[o]._n(t)}},i.prototype._e=function(t){if(this._err===NO){this._err=t;var n=this._ils,e=n.length;if(this._x(),this._d&&this._dl._e(t),e==1)n[0]._e(t);else{if(e==0)return;for(var r=cp(n),o=0;o<e;o++)r[o]._e(t)}if(!this._d&&e==0)throw this._err}},i.prototype._c=function(){var t=this._ils,n=t.length;if(this._x(),this._d&&this._dl._c(),n==1)t[0]._c();else{if(n==0)return;for(var e=cp(t),r=0;r<n;r++)e[r]._c()}},i.prototype._x=function(){this._ils.length!==0&&(this._prod!==NO&&this._prod._stop(),this._err=NO,this._ils=[])},i.prototype._stopNow=function(){this._prod._stop(),this._err=NO,this._stopID=NO},i.prototype._add=function(t){var n=this._target;if(n)return n._add(t);var e=this._ils;if(e.push(t),!(e.length>1))if(this._stopID!==NO)clearTimeout(this._stopID),this._stopID=NO;else{var r=this._prod;r!==NO&&r._start(this)}},i.prototype._remove=function(t){var n=this,e=this._target;if(e)return e._remove(t);var r=this._ils,o=r.indexOf(t);o>-1&&(r.splice(o,1),this._prod!==NO&&r.length<=0?(this._err=NO,this._stopID=setTimeout(function(){return n._stopNow()})):r.length===1&&this._pruneCycles())},i.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},i.prototype._hasNoSinks=function(t,n){if(n.indexOf(t)!==-1)return!0;if(t.out===this)return!0;if(t.out&&t.out!==NO)return this._hasNoSinks(t.out,n.concat(t));if(t._ils){for(var e=0,r=t._ils.length;e<r;e++)if(!this._hasNoSinks(t._ils[e],n.concat(t)))return!1;return!0}else return!1},i.prototype.ctor=function(){return this instanceof MemoryStream?MemoryStream:i},i.prototype.addListener=function(t){t._n=t.next||noop,t._e=t.error||noop,t._c=t.complete||noop,this._add(t)},i.prototype.removeListener=function(t){this._remove(t)},i.prototype.subscribe=function(t){return this.addListener(t),new StreamSub(this,t)},i.prototype[$$observable]=function(){return this},i.create=function(t){if(t){if(typeof t.start!="function"||typeof t.stop!="function")throw new Error("producer requires both start and stop functions");internalizeProducer(t)}return new i(t)},i.createWithMemory=function(t){return t&&internalizeProducer(t),new MemoryStream(t)},i.never=function(){return new i({_start:noop,_stop:noop})},i.empty=function(){return new i({_start:function(t){t._c()},_stop:noop})},i.throw=function(t){return new i({_start:function(n){n._e(t)},_stop:noop})},i.from=function(t){if(typeof t[$$observable]=="function")return i.fromObservable(t);if(typeof t.then=="function")return i.fromPromise(t);if(Array.isArray(t))return i.fromArray(t);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")},i.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i.fromArray(t)},i.fromArray=function(t){return new i(new FromArray(t))},i.fromPromise=function(t){return new i(new FromPromise(t))},i.fromObservable=function(t){if(t.endWhen!==void 0)return t;var n=typeof t[$$observable]=="function"?t[$$observable]():t;return new i(new FromObservable(n))},i.periodic=function(t){return new i(new Periodic(t))},i.prototype._map=function(t){return new(this.ctor())(new MapOp(t,this))},i.prototype.map=function(t){return this._map(t)},i.prototype.mapTo=function(t){var n=this.map(function(){return t}),e=n._prod;return e.type="mapTo",n},i.prototype.filter=function(t){var n=this._prod;return n instanceof Filter?new i(new Filter(and(n.f,t),n.ins)):new i(new Filter(t,this))},i.prototype.take=function(t){return new(this.ctor())(new Take(t,this))},i.prototype.drop=function(t){return new i(new Drop(t,this))},i.prototype.last=function(){return new i(new Last(this))},i.prototype.startWith=function(t){return new MemoryStream(new StartWith(this,t))},i.prototype.endWhen=function(t){return new(this.ctor())(new EndWhen(t,this))},i.prototype.fold=function(t,n){return new MemoryStream(new Fold(t,n,this))},i.prototype.replaceError=function(t){return new(this.ctor())(new ReplaceError(t,this))},i.prototype.flatten=function(){return new i(new Flatten(this))},i.prototype.compose=function(t){return t(this)},i.prototype.remember=function(){return new MemoryStream(new Remember(this))},i.prototype.debug=function(t){return new(this.ctor())(new Debug(this,t))},i.prototype.imitate=function(t){if(t instanceof MemoryStream)throw new Error("A MemoryStream was given to imitate(), but it only supports a Stream. Read more about this restriction here: https://github.com/staltz/xstream#faq");this._target=t;for(var n=this._ils,e=n.length,r=0;r<e;r++)t._add(n[r]);this._ils=[]},i.prototype.shamefullySendNext=function(t){this._n(t)},i.prototype.shamefullySendError=function(t){this._e(t)},i.prototype.shamefullySendComplete=function(){this._c()},i.prototype.setDebugListener=function(t){t?(this._d=!0,t._n=t.next||noop,t._e=t.error||noop,t._c=t.complete||noop,this._dl=t):(this._d=!1,this._dl=NO)},i.merge=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new i(new Merge(n))},i.combine=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new i(new Combine(n))},i}();xstream.Stream=Stream;var MemoryStream=function(i){__extends(t,i);function t(n){var e=i.call(this,n)||this;return e._has=!1,e}return t.prototype._n=function(n){this._v=n,this._has=!0,i.prototype._n.call(this,n)},t.prototype._add=function(n){var e=this._target;if(e)return e._add(n);var r=this._ils;if(r.push(n),r.length>1){this._has&&n._n(this._v);return}if(this._stopID!==NO)this._has&&n._n(this._v),clearTimeout(this._stopID),this._stopID=NO;else if(this._has)n._n(this._v);else{var o=this._prod;o!==NO&&o._start(this)}},t.prototype._stopNow=function(){this._has=!1,i.prototype._stopNow.call(this)},t.prototype._x=function(){this._has=!1,i.prototype._x.call(this)},t.prototype.map=function(n){return this._map(n)},t.prototype.mapTo=function(n){return i.prototype.mapTo.call(this,n)},t.prototype.take=function(n){return i.prototype.take.call(this,n)},t.prototype.endWhen=function(n){return i.prototype.endWhen.call(this,n)},t.prototype.replaceError=function(n){return i.prototype.replaceError.call(this,n)},t.prototype.remember=function(){return this},t.prototype.debug=function(n){return i.prototype.debug.call(this,n)},t}(Stream);xstream.MemoryStream=MemoryStream;var xs=Stream;xstream.default=xs;var ws=null;typeof WebSocket<"u"?ws=WebSocket:typeof MozWebSocket<"u"?ws=MozWebSocket:typeof index.commonjsGlobal<"u"?ws=index.commonjsGlobal.WebSocket||index.commonjsGlobal.MozWebSocket:typeof window<"u"?ws=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ws=self.WebSocket||self.MozWebSocket);var browser=ws;const require$$14=index.getAugmentedNamespace(index.pako_esm);exports.aspromise=aspromise;exports.base64=base64$1;exports.bech32=bech32;exports.browser=browser;exports.build=build;exports.eventemitter=eventemitter;exports.float=float;exports.inquire_1=inquire_1;exports.minimal=minimal;exports.pool_1=pool_1;exports.require$$0=require$$0$2;exports.require$$0$1=require$$0$1;exports.require$$0$2=require$$0;exports.require$$1=require$$1$1;exports.require$$1$1=require$$1;exports.require$$14=require$$14;exports.utf8=utf8$2;exports.xstream=xstream;
1
+ "use strict";const index=require("./index-BU_DiszY.js"),pbkdf2=require("./pbkdf2-DvmY7GlQ.js"),index$1=require("./index-pIqiKD22.js"),Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Id=new Uint8Array(new Array(16).fill(0).map((i,t)=>t)),Pi=Id.map(i=>(9*i+5)%16);let idxL=[Id],idxR=[Pi];for(let i=0;i<4;i++)for(let t of[idxL,idxR])t.push(t[i].map(n=>Rho[n]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>new Uint8Array(i)),shiftsL=idxL.map((i,t)=>i.map(n=>shifts[t][n])),shiftsR=idxR.map((i,t)=>i.map(n=>shifts[t][n])),Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function f(i,t,n,e){return i===0?t^n^e:i===1?t&n|~t&e:i===2?(t|~n)^e:i===3?t&e|n&~e:t^(n|~e)}const R_BUF=new Uint32Array(16);class RIPEMD160 extends index.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:e,h3:r,h4:o}=this;return[t,n,e,r,o]}set(t,n,e,r,o){this.h0=t|0,this.h1=n|0,this.h2=e|0,this.h3=r|0,this.h4=o|0}process(t,n){for(let d=0;d<16;d++,n+=4)R_BUF[d]=t.getUint32(n,!0);let e=this.h0|0,r=e,o=this.h1|0,u=o,s=this.h2|0,c=s,h=this.h3|0,l=h,a=this.h4|0,p=a;for(let d=0;d<5;d++){const y=4-d,_=Kl[d],b=Kr[d],$=idxL[d],m=idxR[d],w=shiftsL[d],P=shiftsR[d];for(let v=0;v<16;v++){const O=index.rotl(e+f(d,o,s,h)+R_BUF[$[v]]+_,w[v])+a|0;e=a,a=h,h=index.rotl(s,10)|0,s=o,o=O}for(let v=0;v<16;v++){const O=index.rotl(r+f(y,u,c,l)+R_BUF[m[v]]+b,P[v])+p|0;r=p,p=l,l=index.rotl(c,10)|0,c=u,u=O}}this.set(this.h1+s+l|0,this.h2+h+p|0,this.h3+a+r|0,this.h4+e+u|0,this.h0+o+c|0)}roundClean(){R_BUF.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const ripemd160=index.wrapConstructor(()=>new RIPEMD160),ripemd160$1=Object.freeze(Object.defineProperty({__proto__:null,RIPEMD160,ripemd160},Symbol.toStringTag,{value:"Module"}));var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(var z=0;z<ALPHABET.length;z++){var x=ALPHABET.charAt(z);if(ALPHABET_MAP[x]!==void 0)throw new TypeError(x+" is ambiguous");ALPHABET_MAP[x]=z}function polymodStep(i){var t=i>>25;return(i&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function prefixChk(i){for(var t=1,n=0;n<i.length;++n){var e=i.charCodeAt(n);if(e<33||e>126)return"Invalid prefix ("+i+")";t=polymodStep(t)^e>>5}for(t=polymodStep(t),n=0;n<i.length;++n){var r=i.charCodeAt(n);t=polymodStep(t)^r&31}return t}function encode(i,t,n){if(n=n||90,i.length+7+t.length>n)throw new TypeError("Exceeds length limit");i=i.toLowerCase();var e=prefixChk(i);if(typeof e=="string")throw new Error(e);for(var r=i+"1",o=0;o<t.length;++o){var u=t[o];if(u>>5)throw new Error("Non 5-bit word");e=polymodStep(e)^u,r+=ALPHABET.charAt(u)}for(o=0;o<6;++o)e=polymodStep(e);for(e^=1,o=0;o<6;++o){var s=e>>(5-o)*5&31;r+=ALPHABET.charAt(s)}return r}function __decode(i,t){if(t=t||90,i.length<8)return i+" too short";if(i.length>t)return"Exceeds length limit";var n=i.toLowerCase(),e=i.toUpperCase();if(i!==n&&i!==e)return"Mixed-case string "+i;i=n;var r=i.lastIndexOf("1");if(r===-1)return"No separator character for "+i;if(r===0)return"Missing prefix for "+i;var o=i.slice(0,r),u=i.slice(r+1);if(u.length<6)return"Data too short";var s=prefixChk(o);if(typeof s=="string")return s;for(var c=[],h=0;h<u.length;++h){var l=u.charAt(h),a=ALPHABET_MAP[l];if(a===void 0)return"Unknown character "+l;s=polymodStep(s)^a,!(h+6>=u.length)&&c.push(a)}return s!==1?"Invalid checksum for "+i:{prefix:o,words:c}}function decodeUnsafe(){var i=__decode.apply(null,arguments);if(typeof i=="object")return i}function decode(i){var t=__decode.apply(null,arguments);if(typeof t=="object")return t;throw new Error(t)}function convert(i,t,n,e){for(var r=0,o=0,u=(1<<n)-1,s=[],c=0;c<i.length;++c)for(r=r<<t|i[c],o+=t;o>=n;)o-=n,s.push(r>>o&u);if(e)o>0&&s.push(r<<n-o&u);else{if(o>=t)return"Excess padding";if(r<<n-o&u)return"Non-zero padding"}return s}function toWordsUnsafe(i){var t=convert(i,8,5,!0);if(Array.isArray(t))return t}function toWords(i){var t=convert(i,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)}function fromWordsUnsafe(i){var t=convert(i,5,8,!1);if(Array.isArray(t))return t}function fromWords(i){var t=convert(i,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}var bech32={decodeUnsafe,decode,encode,toWordsUnsafe,toWords,fromWordsUnsafe,fromWords};const require$$1$1=index.getAugmentedNamespace(pbkdf2.pbkdf2$1),require$$1=index.getAugmentedNamespace(index.sha512$1),require$$0$2=index.getAugmentedNamespace(index.sha256$1),require$$0$1=index.getAugmentedNamespace(index.sha3),require$$0=index.getAugmentedNamespace(ripemd160$1);var build={},indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(i,t){for(var n=new Array(arguments.length-1),e=0,r=2,o=!0;r<arguments.length;)n[e++]=arguments[r++];return new Promise(function(s,c){n[e]=function(l){if(o)if(o=!1,l)c(l);else{for(var a=new Array(arguments.length-1),p=0;p<a.length;)a[p++]=arguments[p];s.apply(null,a)}};try{i.apply(t||null,n)}catch(h){o&&(o=!1,c(h))}})}var base64$1={};(function(i){var t=i;t.length=function(s){var c=s.length;if(!c)return 0;for(var h=0;--c%4>1&&s.charAt(c)==="=";)++h;return Math.ceil(s.length*3)/4-h};for(var n=new Array(64),e=new Array(123),r=0;r<64;)e[n[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;t.encode=function(s,c,h){for(var l=null,a=[],p=0,d=0,y;c<h;){var _=s[c++];switch(d){case 0:a[p++]=n[_>>2],y=(_&3)<<4,d=1;break;case 1:a[p++]=n[y|_>>4],y=(_&15)<<2,d=2;break;case 2:a[p++]=n[y|_>>6],a[p++]=n[_&63],d=0;break}p>8191&&((l||(l=[])).push(String.fromCharCode.apply(String,a)),p=0)}return d&&(a[p++]=n[y],a[p++]=61,d===1&&(a[p++]=61)),l?(p&&l.push(String.fromCharCode.apply(String,a.slice(0,p))),l.join("")):String.fromCharCode.apply(String,a.slice(0,p))};var o="invalid encoding";t.decode=function(s,c,h){for(var l=h,a=0,p,d=0;d<s.length;){var y=s.charCodeAt(d++);if(y===61&&a>1)break;if((y=e[y])===void 0)throw Error(o);switch(a){case 0:p=y,a=1;break;case 1:c[h++]=p<<2|(y&48)>>4,p=y,a=2;break;case 2:c[h++]=(p&15)<<4|(y&60)>>2,p=y,a=3;break;case 3:c[h++]=(p&3)<<6|y,a=0;break}}if(a===1)throw Error(o);return h-l},t.test=function(s){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(t,n,e){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:n,ctx:e||this}),this};EventEmitter.prototype.off=function(t,n){if(t===void 0)this._listeners={};else if(n===void 0)this._listeners[t]=[];else for(var e=this._listeners[t],r=0;r<e.length;)e[r].fn===n?e.splice(r,1):++r;return this};EventEmitter.prototype.emit=function(t){var n=this._listeners[t];if(n){for(var e=[],r=1;r<arguments.length;)e.push(arguments[r++]);for(r=0;r<n.length;)n[r].fn.apply(n[r++].ctx,e)}return this};var float=factory(factory);function factory(i){return typeof Float32Array<"u"?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),e=n[3]===128;function r(c,h,l){t[0]=c,h[l]=n[0],h[l+1]=n[1],h[l+2]=n[2],h[l+3]=n[3]}function o(c,h,l){t[0]=c,h[l]=n[3],h[l+1]=n[2],h[l+2]=n[1],h[l+3]=n[0]}i.writeFloatLE=e?r:o,i.writeFloatBE=e?o:r;function u(c,h){return n[0]=c[h],n[1]=c[h+1],n[2]=c[h+2],n[3]=c[h+3],t[0]}function s(c,h){return n[3]=c[h],n[2]=c[h+1],n[1]=c[h+2],n[0]=c[h+3],t[0]}i.readFloatLE=e?u:s,i.readFloatBE=e?s:u}():function(){function t(e,r,o,u){var s=r<0?1:0;if(s&&(r=-r),r===0)e(1/r>0?0:2147483648,o,u);else if(isNaN(r))e(2143289344,o,u);else if(r>34028234663852886e22)e((s<<31|2139095040)>>>0,o,u);else if(r<11754943508222875e-54)e((s<<31|Math.round(r/1401298464324817e-60))>>>0,o,u);else{var c=Math.floor(Math.log(r)/Math.LN2),h=Math.round(r*Math.pow(2,-c)*8388608)&8388607;e((s<<31|c+127<<23|h)>>>0,o,u)}}i.writeFloatLE=t.bind(null,writeUintLE),i.writeFloatBE=t.bind(null,writeUintBE);function n(e,r,o){var u=e(r,o),s=(u>>31)*2+1,c=u>>>23&255,h=u&8388607;return c===255?h?NaN:s*(1/0):c===0?s*1401298464324817e-60*h:s*Math.pow(2,c-150)*(h+8388608)}i.readFloatLE=n.bind(null,readUintLE),i.readFloatBE=n.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),e=n[7]===128;function r(c,h,l){t[0]=c,h[l]=n[0],h[l+1]=n[1],h[l+2]=n[2],h[l+3]=n[3],h[l+4]=n[4],h[l+5]=n[5],h[l+6]=n[6],h[l+7]=n[7]}function o(c,h,l){t[0]=c,h[l]=n[7],h[l+1]=n[6],h[l+2]=n[5],h[l+3]=n[4],h[l+4]=n[3],h[l+5]=n[2],h[l+6]=n[1],h[l+7]=n[0]}i.writeDoubleLE=e?r:o,i.writeDoubleBE=e?o:r;function u(c,h){return n[0]=c[h],n[1]=c[h+1],n[2]=c[h+2],n[3]=c[h+3],n[4]=c[h+4],n[5]=c[h+5],n[6]=c[h+6],n[7]=c[h+7],t[0]}function s(c,h){return n[7]=c[h],n[6]=c[h+1],n[5]=c[h+2],n[4]=c[h+3],n[3]=c[h+4],n[2]=c[h+5],n[1]=c[h+6],n[0]=c[h+7],t[0]}i.readDoubleLE=e?u:s,i.readDoubleBE=e?s:u}():function(){function t(e,r,o,u,s,c){var h=u<0?1:0;if(h&&(u=-u),u===0)e(0,s,c+r),e(1/u>0?0:2147483648,s,c+o);else if(isNaN(u))e(0,s,c+r),e(2146959360,s,c+o);else if(u>17976931348623157e292)e(0,s,c+r),e((h<<31|2146435072)>>>0,s,c+o);else{var l;if(u<22250738585072014e-324)l=u/5e-324,e(l>>>0,s,c+r),e((h<<31|l/4294967296)>>>0,s,c+o);else{var a=Math.floor(Math.log(u)/Math.LN2);a===1024&&(a=1023),l=u*Math.pow(2,-a),e(l*4503599627370496>>>0,s,c+r),e((h<<31|a+1023<<20|l*1048576&1048575)>>>0,s,c+o)}}}i.writeDoubleLE=t.bind(null,writeUintLE,0,4),i.writeDoubleBE=t.bind(null,writeUintBE,4,0);function n(e,r,o,u,s){var c=e(u,s+r),h=e(u,s+o),l=(h>>31)*2+1,a=h>>>20&2047,p=4294967296*(h&1048575)+c;return a===2047?p?NaN:l*(1/0):a===0?l*5e-324*p:l*Math.pow(2,a-1075)*(p+4503599627370496)}i.readDoubleLE=n.bind(null,readUintLE,0,4),i.readDoubleBE=n.bind(null,readUintBE,4,0)}(),i}function writeUintLE(i,t,n){t[n]=i&255,t[n+1]=i>>>8&255,t[n+2]=i>>>16&255,t[n+3]=i>>>24}function writeUintBE(i,t,n){t[n]=i>>>24,t[n+1]=i>>>16&255,t[n+2]=i>>>8&255,t[n+3]=i&255}function readUintLE(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16|i[t+3]<<24)>>>0}function readUintBE(i,t){return(i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(i){}return null}var utf8$2={};(function(i){var t=i;t.length=function(e){for(var r=0,o=0,u=0;u<e.length;++u)o=e.charCodeAt(u),o<128?r+=1:o<2048?r+=2:(o&64512)===55296&&(e.charCodeAt(u+1)&64512)===56320?(++u,r+=4):r+=3;return r},t.read=function(e,r,o){var u=o-r;if(u<1)return"";for(var s=null,c=[],h=0,l;r<o;)l=e[r++],l<128?c[h++]=l:l>191&&l<224?c[h++]=(l&31)<<6|e[r++]&63:l>239&&l<365?(l=((l&7)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,c[h++]=55296+(l>>10),c[h++]=56320+(l&1023)):c[h++]=(l&15)<<12|(e[r++]&63)<<6|e[r++]&63,h>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,c)),h=0);return s?(h&&s.push(String.fromCharCode.apply(String,c.slice(0,h))),s.join("")):String.fromCharCode.apply(String,c.slice(0,h))},t.write=function(e,r,o){for(var u=o,s,c,h=0;h<e.length;++h)s=e.charCodeAt(h),s<128?r[o++]=s:s<2048?(r[o++]=s>>6|192,r[o++]=s&63|128):(s&64512)===55296&&((c=e.charCodeAt(h+1))&64512)===56320?(s=65536+((s&1023)<<10)+(c&1023),++h,r[o++]=s>>18|240,r[o++]=s>>12&63|128,r[o++]=s>>6&63|128,r[o++]=s&63|128):(r[o++]=s>>12|224,r[o++]=s>>6&63|128,r[o++]=s&63|128);return o-u}})(utf8$2);var pool_1=pool;function pool(i,t,n){var e=n||8192,r=e>>>1,o=null,u=e;return function(c){if(c<1||c>r)return i(c);u+c>e&&(o=i(e),u=0);var h=t.call(o,u,u+=c);return u&7&&(u=(u|7)+1),h}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var i=requireMinimal();function t(o,u){this.lo=o>>>0,this.hi=u>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var e=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(u){if(u===0)return n;var s=u<0;s&&(u=-u);var c=u>>>0,h=(u-c)/4294967296>>>0;return s&&(h=~h>>>0,c=~c>>>0,++c>4294967295&&(c=0,++h>4294967295&&(h=0))),new t(c,h)},t.from=function(u){if(typeof u=="number")return t.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return t.fromNumber(parseInt(u,10));return u.low||u.high?new t(u.low>>>0,u.high>>>0):n},t.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var s=~this.lo+1>>>0,c=~this.hi>>>0;return s||(c=c+1>>>0),-(s+c*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var r=String.prototype.charCodeAt;return t.fromHash=function(u){return u===e?n:new t((r.call(u,0)|r.call(u,1)<<8|r.call(u,2)<<16|r.call(u,3)<<24)>>>0,(r.call(u,4)|r.call(u,5)<<8|r.call(u,6)<<16|r.call(u,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},t.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},t.prototype.length=function(){var u=this.lo,s=(this.lo>>>28|this.hi<<4)>>>0,c=this.hi>>>24;return c===0?s===0?u<16384?u<128?1:2:u<2097152?3:4:s<16384?s<128?5:6:s<2097152?7:8:c<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(i){var t=i;t.asPromise=aspromise,t.base64=base64$1,t.EventEmitter=eventemitter,t.float=float,t.inquire=inquire_1,t.utf8=utf8$2,t.pool=pool_1,t.LongBits=requireLongbits(),t.isNode=!!(typeof index.commonjsGlobal<"u"&&index.commonjsGlobal&&index.commonjsGlobal.process&&index.commonjsGlobal.process.versions&&index.commonjsGlobal.process.versions.node),t.global=t.isNode&&index.commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||index.commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o},t.isString=function(o){return typeof o=="string"||o instanceof String},t.isObject=function(o){return o&&typeof o=="object"},t.isset=t.isSet=function(o,u){var s=o[u];return s!=null&&o.hasOwnProperty(u)?typeof s!="object"||(Array.isArray(s)?s.length:Object.keys(s).length)>0:!1},t.Buffer=function(){try{var r=t.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(o){return typeof o=="number"?t.Buffer?t._Buffer_allocUnsafe(o):new t.Array(o):t.Buffer?t._Buffer_from(o):typeof Uint8Array>"u"?o:new Uint8Array(o)},t.Array=typeof Uint8Array<"u"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(o){return o?t.LongBits.from(o).toHash():t.LongBits.zeroHash},t.longFromHash=function(o,u){var s=t.LongBits.fromHash(o);return t.Long?t.Long.fromBits(s.lo,s.hi,u):s.toNumber(!!u)};function n(r,o,u){for(var s=Object.keys(o),c=0;c<s.length;++c)(r[s[c]]===void 0||!u)&&(r[s[c]]=o[s[c]]);return r}t.merge=n,t.lcFirst=function(o){return o.charAt(0).toLowerCase()+o.substring(1)};function e(r){function o(u,s){if(!(this instanceof o))return new o(u,s);Object.defineProperty(this,"message",{get:function(){return u}}),Error.captureStackTrace?Error.captureStackTrace(this,o):Object.defineProperty(this,"stack",{value:new Error().stack||""}),s&&n(this,s)}return(o.prototype=Object.create(Error.prototype)).constructor=o,Object.defineProperty(o.prototype,"name",{get:function(){return r}}),o.prototype.toString=function(){return this.name+": "+this.message},o}t.newError=e,t.ProtocolError=e("ProtocolError"),t.oneOfGetter=function(o){for(var u={},s=0;s<o.length;++s)u[o[s]]=1;return function(){for(var c=Object.keys(this),h=c.length-1;h>-1;--h)if(u[c[h]]===1&&this[c[h]]!==void 0&&this[c[h]]!==null)return c[h]}},t.oneOfSetter=function(o){return function(u){for(var s=0;s<o.length;++s)o[s]!==u&&delete this[o[s]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var r=t.Buffer;if(!r){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=r.from!==Uint8Array.from&&r.from||function(u,s){return new r(u,s)},t._Buffer_allocUnsafe=r.allocUnsafe||function(u){return new r(u)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(i,t,n){this.fn=i,this.len=t,this.next=void 0,this.val=n}function noop$1(){}function State(i){this.head=i.head,this.tail=i.tail,this.len=i.len,this.next=i.states}function Writer$1(){this.len=0,this.head=new Op(noop$1,0,0),this.tail=this.head,this.states=null}var create$1=function i(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1();Writer$1.alloc=function i(t){return new util$4.Array(t)};util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray));Writer$1.prototype._push=function i(t,n,e){return this.tail=this.tail.next=new Op(t,n,e),this.len+=n,this};function writeByte(i,t,n){t[n]=i&255}function writeVarint32(i,t,n){for(;i>127;)t[n++]=i&127|128,i>>>=7;t[n]=i}function VarintOp(i,t){this.len=i,this.next=void 0,this.val=t}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function i(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};Writer$1.prototype.int32=function i(t){return t<0?this._push(writeVarint64,10,LongBits$1.fromNumber(t)):this.uint32(t)};Writer$1.prototype.sint32=function i(t){return this.uint32((t<<1^t>>31)>>>0)};function writeVarint64(i,t,n){for(;i.hi;)t[n++]=i.lo&127|128,i.lo=(i.lo>>>7|i.hi<<25)>>>0,i.hi>>>=7;for(;i.lo>127;)t[n++]=i.lo&127|128,i.lo=i.lo>>>7;t[n++]=i.lo}Writer$1.prototype.uint64=function i(t){var n=LongBits$1.from(t);return this._push(writeVarint64,n.length(),n)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function i(t){var n=LongBits$1.from(t).zzEncode();return this._push(writeVarint64,n.length(),n)};Writer$1.prototype.bool=function i(t){return this._push(writeByte,1,t?1:0)};function writeFixed32(i,t,n){t[n]=i&255,t[n+1]=i>>>8&255,t[n+2]=i>>>16&255,t[n+3]=i>>>24}Writer$1.prototype.fixed32=function i(t){return this._push(writeFixed32,4,t>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function i(t){var n=LongBits$1.from(t);return this._push(writeFixed32,4,n.lo)._push(writeFixed32,4,n.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function i(t){return this._push(util$4.float.writeFloatLE,4,t)};Writer$1.prototype.double=function i(t){return this._push(util$4.float.writeDoubleLE,8,t)};var writeBytes=util$4.Array.prototype.set?function i(t,n,e){n.set(t,e)}:function i(t,n,e){for(var r=0;r<t.length;++r)n[e+r]=t[r]};Writer$1.prototype.bytes=function i(t){var n=t.length>>>0;if(!n)return this._push(writeByte,1,0);if(util$4.isString(t)){var e=Writer$1.alloc(n=base64.length(t));base64.decode(t,e,0),t=e}return this.uint32(n)._push(writeBytes,n,t)};Writer$1.prototype.string=function i(t){var n=utf8$1.length(t);return n?this.uint32(n)._push(utf8$1.write,n,t):this._push(writeByte,1,0)};Writer$1.prototype.fork=function i(){return this.states=new State(this),this.head=this.tail=new Op(noop$1,0,0),this.len=0,this};Writer$1.prototype.reset=function i(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop$1,0,0),this.len=0),this};Writer$1.prototype.ldelim=function i(){var t=this.head,n=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=n,this.len+=e),this};Writer$1.prototype.finish=function i(){for(var t=this.head.next,n=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,n,e),e+=t.len,t=t.next;return n};Writer$1._configure=function(i){BufferWriter$1=i,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(t,n,e){n.set(t,e)}:function(t,n,e){if(t.copy)t.copy(n,e,0,t.length);else for(var r=0;r<t.length;)n[e++]=t[r++]}};BufferWriter.prototype.bytes=function i(t){util$3.isString(t)&&(t=util$3._Buffer_from(t,"base64"));var n=t.length>>>0;return this.uint32(n),n&&this._push(BufferWriter.writeBytesBuffer,n,t),this};function writeStringBuffer(i,t,n){i.length<40?util$3.utf8.write(i,t,n):t.utf8Write?t.utf8Write(i,n):t.write(i,n)}BufferWriter.prototype.string=function i(t){var n=util$3.Buffer.byteLength(t);return this.uint32(n),n&&this._push(writeStringBuffer,n,t),this};BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(i,t){return RangeError("index out of range: "+i.pos+" + "+(t||1)+" > "+i.len)}function Reader$1(i){this.buf=i,this.pos=0,this.len=i.length}var create_array=typeof Uint8Array<"u"?function i(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")}:function i(t){if(Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")},create=function i(){return util$2.Buffer?function(n){return(Reader$1.create=function(r){return util$2.Buffer.isBuffer(r)?new BufferReader$1(r):create_array(r)})(n)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice;Reader$1.prototype.uint32=function i(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}();Reader$1.prototype.int32=function i(){return this.uint32()|0};Reader$1.prototype.sint32=function i(){var t=this.uint32();return t>>>1^-(t&1)|0};function readLongVarint(){var i=new LongBits(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(i.lo=(i.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return i;if(i.lo=(i.lo|(this.buf[this.pos]&127)<<28)>>>0,i.hi=(i.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return i;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(i.lo=(i.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return i}return i.lo=(i.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,i}if(this.len-this.pos>4){for(;t<5;++t)if(i.hi=(i.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return i}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(i.hi=(i.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return i}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function i(){return this.uint32()!==0};function readFixed32_end(i,t){return(i[t-4]|i[t-3]<<8|i[t-2]<<16|i[t-1]<<24)>>>0}Reader$1.prototype.fixed32=function i(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function i(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function i(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};Reader$1.prototype.double=function i(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};Reader$1.prototype.bytes=function i(){var t=this.uint32(),n=this.pos,e=this.pos+t;if(e>this.len)throw indexOutOfRange(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,e):n===e?new this.buf.constructor(0):this._slice.call(this.buf,n,e)};Reader$1.prototype.string=function i(){var t=this.bytes();return utf8.read(t,0,t.length)};Reader$1.prototype.skip=function i(t){if(typeof t=="number"){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(i){switch(i){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(i=this.uint32()&7)!==4;)this.skipType(i);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+i+" at offset "+this.pos)}return this};Reader$1._configure=function(i){BufferReader$1=i,Reader$1.create=create(),BufferReader$1._configure();var t=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(i){Reader.call(this,i)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)};BufferReader.prototype.string=function i(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(i,t,n){if(typeof i!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=i,this.requestDelimited=!!t,this.responseDelimited=!!n}Service.prototype.rpcCall=function i(t,n,e,r,o){if(!r)throw TypeError("request must be specified");var u=this;if(!o)return util.asPromise(i,u,t,n,e,r);if(!u.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return u.rpcImpl(t,n[u.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(c,h){if(c)return u.emit("error",c,t),o(c);if(h===null){u.end(!0);return}if(!(h instanceof e))try{h=e[u.responseDelimited?"decodeDelimited":"decode"](h)}catch(l){return u.emit("error",l,t),o(l)}return u.emit("data",h,t),o(null,h)})}catch(s){u.emit("error",s,t),setTimeout(function(){o(s)},0);return}};Service.prototype.end=function i(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(i){var t=i;t.Service=service})(rpc);var roots={};(function(i){var t=i;t.build="minimal",t.Writer=writer,t.BufferWriter=writer_buffer,t.Reader=reader,t.BufferReader=reader_buffer,t.util=requireMinimal(),t.rpc=rpc,t.roots=roots,t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})(indexMinimal);var minimal=indexMinimal,$protobuf=minimal,$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$root=$protobuf.roots.default||($protobuf.roots.default={});$root.ics23=function(){var i={};return i.HashOp=function(){var t={},n=Object.create(t);return n[t[0]="NO_HASH"]=0,n[t[1]="SHA256"]=1,n[t[2]="SHA512"]=2,n[t[3]="KECCAK"]=3,n[t[4]="RIPEMD160"]=4,n[t[5]="BITCOIN"]=5,n[t[6]="SHA512_256"]=6,n}(),i.LengthOp=function(){var t={},n=Object.create(t);return n[t[0]="NO_PREFIX"]=0,n[t[1]="VAR_PROTO"]=1,n[t[2]="VAR_RLP"]=2,n[t[3]="FIXED32_BIG"]=3,n[t[4]="FIXED32_LITTLE"]=4,n[t[5]="FIXED64_BIG"]=5,n[t[6]="FIXED64_LITTLE"]=6,n[t[7]="REQUIRE_32_BYTES"]=7,n[t[8]="REQUIRE_64_BYTES"]=8,n}(),i.ExistenceProof=function(){function t(n){if(this.path=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.value=$util.newBuffer([]),t.prototype.leaf=null,t.prototype.path=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.value!=null&&e.hasOwnProperty("value")&&r.uint32(18).bytes(e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&$root.ics23.LeafOp.encode(e.leaf,r.uint32(26).fork()).ldelim(),e.path!=null&&e.path.length)for(var o=0;o<e.path.length;++o)$root.ics23.InnerOp.encode(e.path[o],r.uint32(34).fork()).ldelim();return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.ExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.value=e.bytes();break;case 3:u.leaf=$root.ics23.LeafOp.decode(e,e.uint32());break;case 4:u.path&&u.path.length||(u.path=[]),u.path.push($root.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.value!=null&&e.hasOwnProperty("value")&&!(e.value&&typeof e.value.length=="number"||$util.isString(e.value)))return"value: buffer expected";if(e.leaf!=null&&e.hasOwnProperty("leaf")){var r=$root.ics23.LeafOp.verify(e.leaf);if(r)return"leaf."+r}if(e.path!=null&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var o=0;o<e.path.length;++o){var r=$root.ics23.InnerOp.verify(e.path[o]);if(r)return"path."+r}}return null},t.fromObject=function(e){if(e instanceof $root.ics23.ExistenceProof)return e;var r=new $root.ics23.ExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.value!=null&&(typeof e.value=="string"?$util.base64.decode(e.value,r.value=$util.newBuffer($util.base64.length(e.value)),0):e.value.length&&(r.value=e.value)),e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".ics23.ExistenceProof.leaf: object expected");r.leaf=$root.ics23.LeafOp.fromObject(e.leaf)}if(e.path){if(!Array.isArray(e.path))throw TypeError(".ics23.ExistenceProof.path: array expected");r.path=[];for(var o=0;o<e.path.length;++o){if(typeof e.path[o]!="object")throw TypeError(".ics23.ExistenceProof.path: object expected");r.path[o]=$root.ics23.InnerOp.fromObject(e.path[o])}}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.path=[]),r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),r.bytes===String?o.value="":(o.value=[],r.bytes!==Array&&(o.value=$util.newBuffer(o.value))),o.leaf=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.value!=null&&e.hasOwnProperty("value")&&(o.value=r.bytes===String?$util.base64.encode(e.value,0,e.value.length):r.bytes===Array?Array.prototype.slice.call(e.value):e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&(o.leaf=$root.ics23.LeafOp.toObject(e.leaf,r)),e.path&&e.path.length){o.path=[];for(var u=0;u<e.path.length;++u)o.path[u]=$root.ics23.InnerOp.toObject(e.path[u],r)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.NonExistenceProof=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.left=null,t.prototype.right=null,t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.left!=null&&e.hasOwnProperty("left")&&$root.ics23.ExistenceProof.encode(e.left,r.uint32(18).fork()).ldelim(),e.right!=null&&e.hasOwnProperty("right")&&$root.ics23.ExistenceProof.encode(e.right,r.uint32(26).fork()).ldelim(),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.NonExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.left=$root.ics23.ExistenceProof.decode(e,e.uint32());break;case 3:u.right=$root.ics23.ExistenceProof.decode(e,e.uint32());break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.left!=null&&e.hasOwnProperty("left")){var r=$root.ics23.ExistenceProof.verify(e.left);if(r)return"left."+r}if(e.right!=null&&e.hasOwnProperty("right")){var r=$root.ics23.ExistenceProof.verify(e.right);if(r)return"right."+r}return null},t.fromObject=function(e){if(e instanceof $root.ics23.NonExistenceProof)return e;var r=new $root.ics23.NonExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.left!=null){if(typeof e.left!="object")throw TypeError(".ics23.NonExistenceProof.left: object expected");r.left=$root.ics23.ExistenceProof.fromObject(e.left)}if(e.right!=null){if(typeof e.right!="object")throw TypeError(".ics23.NonExistenceProof.right: object expected");r.right=$root.ics23.ExistenceProof.fromObject(e.right)}return r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),o.left=null,o.right=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.left!=null&&e.hasOwnProperty("left")&&(o.left=$root.ics23.ExistenceProof.toObject(e.left,r)),e.right!=null&&e.hasOwnProperty("right")&&(o.right=$root.ics23.ExistenceProof.toObject(e.right,r)),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CommitmentProof=function(){function t(e){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)e[r[o]]!=null&&(this[r[o]]=e[r[o]])}t.prototype.exist=null,t.prototype.nonexist=null,t.prototype.batch=null,t.prototype.compressed=null;var n;return Object.defineProperty(t.prototype,"proof",{get:$util.oneOfGetter(n=["exist","nonexist","batch","compressed"]),set:$util.oneOfSetter(n)}),t.create=function(r){return new t(r)},t.encode=function(r,o){return o||(o=$Writer.create()),r.exist!=null&&r.hasOwnProperty("exist")&&$root.ics23.ExistenceProof.encode(r.exist,o.uint32(10).fork()).ldelim(),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&$root.ics23.NonExistenceProof.encode(r.nonexist,o.uint32(18).fork()).ldelim(),r.batch!=null&&r.hasOwnProperty("batch")&&$root.ics23.BatchProof.encode(r.batch,o.uint32(26).fork()).ldelim(),r.compressed!=null&&r.hasOwnProperty("compressed")&&$root.ics23.CompressedBatchProof.encode(r.compressed,o.uint32(34).fork()).ldelim(),o},t.encodeDelimited=function(r,o){return this.encode(r,o).ldelim()},t.decode=function(r,o){r instanceof $Reader||(r=$Reader.create(r));for(var u=o===void 0?r.len:r.pos+o,s=new $root.ics23.CommitmentProof;r.pos<u;){var c=r.uint32();switch(c>>>3){case 1:s.exist=$root.ics23.ExistenceProof.decode(r,r.uint32());break;case 2:s.nonexist=$root.ics23.NonExistenceProof.decode(r,r.uint32());break;case 3:s.batch=$root.ics23.BatchProof.decode(r,r.uint32());break;case 4:s.compressed=$root.ics23.CompressedBatchProof.decode(r,r.uint32());break;default:r.skipType(c&7);break}}return s},t.decodeDelimited=function(r){return r instanceof $Reader||(r=new $Reader(r)),this.decode(r,r.uint32())},t.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var o={};if(r.exist!=null&&r.hasOwnProperty("exist")){o.proof=1;{var u=$root.ics23.ExistenceProof.verify(r.exist);if(u)return"exist."+u}}if(r.nonexist!=null&&r.hasOwnProperty("nonexist")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.NonExistenceProof.verify(r.nonexist);if(u)return"nonexist."+u}}if(r.batch!=null&&r.hasOwnProperty("batch")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.BatchProof.verify(r.batch);if(u)return"batch."+u}}if(r.compressed!=null&&r.hasOwnProperty("compressed")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.CompressedBatchProof.verify(r.compressed);if(u)return"compressed."+u}}return null},t.fromObject=function(r){if(r instanceof $root.ics23.CommitmentProof)return r;var o=new $root.ics23.CommitmentProof;if(r.exist!=null){if(typeof r.exist!="object")throw TypeError(".ics23.CommitmentProof.exist: object expected");o.exist=$root.ics23.ExistenceProof.fromObject(r.exist)}if(r.nonexist!=null){if(typeof r.nonexist!="object")throw TypeError(".ics23.CommitmentProof.nonexist: object expected");o.nonexist=$root.ics23.NonExistenceProof.fromObject(r.nonexist)}if(r.batch!=null){if(typeof r.batch!="object")throw TypeError(".ics23.CommitmentProof.batch: object expected");o.batch=$root.ics23.BatchProof.fromObject(r.batch)}if(r.compressed!=null){if(typeof r.compressed!="object")throw TypeError(".ics23.CommitmentProof.compressed: object expected");o.compressed=$root.ics23.CompressedBatchProof.fromObject(r.compressed)}return o},t.toObject=function(r,o){o||(o={});var u={};return r.exist!=null&&r.hasOwnProperty("exist")&&(u.exist=$root.ics23.ExistenceProof.toObject(r.exist,o),o.oneofs&&(u.proof="exist")),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&(u.nonexist=$root.ics23.NonExistenceProof.toObject(r.nonexist,o),o.oneofs&&(u.proof="nonexist")),r.batch!=null&&r.hasOwnProperty("batch")&&(u.batch=$root.ics23.BatchProof.toObject(r.batch,o),o.oneofs&&(u.proof="batch")),r.compressed!=null&&r.hasOwnProperty("compressed")&&(u.compressed=$root.ics23.CompressedBatchProof.toObject(r.compressed,o),o.oneofs&&(u.proof="compressed")),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.LeafOp=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.hash=0,t.prototype.prehashKey=0,t.prototype.prehashValue=0,t.prototype.length=0,t.prototype.prefix=$util.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.hash!=null&&e.hasOwnProperty("hash")&&r.uint32(8).int32(e.hash),e.prehashKey!=null&&e.hasOwnProperty("prehashKey")&&r.uint32(16).int32(e.prehashKey),e.prehashValue!=null&&e.hasOwnProperty("prehashValue")&&r.uint32(24).int32(e.prehashValue),e.length!=null&&e.hasOwnProperty("length")&&r.uint32(32).int32(e.length),e.prefix!=null&&e.hasOwnProperty("prefix")&&r.uint32(42).bytes(e.prefix),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.LeafOp;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.hash=e.int32();break;case 2:u.prehashKey=e.int32();break;case 3:u.prehashValue=e.int32();break;case 4:u.length=e.int32();break;case 5:u.prefix=e.bytes();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.hash!=null&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(e.prehashKey!=null&&e.hasOwnProperty("prehashKey"))switch(e.prehashKey){default:return"prehashKey: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(e.prehashValue!=null&&e.hasOwnProperty("prehashValue"))switch(e.prehashValue){default:return"prehashValue: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}if(e.length!=null&&e.hasOwnProperty("length"))switch(e.length){default:return"length: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return e.prefix!=null&&e.hasOwnProperty("prefix")&&!(e.prefix&&typeof e.prefix.length=="number"||$util.isString(e.prefix))?"prefix: buffer expected":null},t.fromObject=function(e){if(e instanceof $root.ics23.LeafOp)return e;var r=new $root.ics23.LeafOp;switch(e.hash){case"NO_HASH":case 0:r.hash=0;break;case"SHA256":case 1:r.hash=1;break;case"SHA512":case 2:r.hash=2;break;case"KECCAK":case 3:r.hash=3;break;case"RIPEMD160":case 4:r.hash=4;break;case"BITCOIN":case 5:r.hash=5;break;case"SHA512_256":case 6:r.hash=6;break}switch(e.prehashKey){case"NO_HASH":case 0:r.prehashKey=0;break;case"SHA256":case 1:r.prehashKey=1;break;case"SHA512":case 2:r.prehashKey=2;break;case"KECCAK":case 3:r.prehashKey=3;break;case"RIPEMD160":case 4:r.prehashKey=4;break;case"BITCOIN":case 5:r.prehashKey=5;break;case"SHA512_256":case 6:r.prehashKey=6;break}switch(e.prehashValue){case"NO_HASH":case 0:r.prehashValue=0;break;case"SHA256":case 1:r.prehashValue=1;break;case"SHA512":case 2:r.prehashValue=2;break;case"KECCAK":case 3:r.prehashValue=3;break;case"RIPEMD160":case 4:r.prehashValue=4;break;case"BITCOIN":case 5:r.prehashValue=5;break;case"SHA512_256":case 6:r.prehashValue=6;break}switch(e.length){case"NO_PREFIX":case 0:r.length=0;break;case"VAR_PROTO":case 1:r.length=1;break;case"VAR_RLP":case 2:r.length=2;break;case"FIXED32_BIG":case 3:r.length=3;break;case"FIXED32_LITTLE":case 4:r.length=4;break;case"FIXED64_BIG":case 5:r.length=5;break;case"FIXED64_LITTLE":case 6:r.length=6;break;case"REQUIRE_32_BYTES":case 7:r.length=7;break;case"REQUIRE_64_BYTES":case 8:r.length=8;break}return e.prefix!=null&&(typeof e.prefix=="string"?$util.base64.decode(e.prefix,r.prefix=$util.newBuffer($util.base64.length(e.prefix)),0):e.prefix.length&&(r.prefix=e.prefix)),r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.hash=r.enums===String?"NO_HASH":0,o.prehashKey=r.enums===String?"NO_HASH":0,o.prehashValue=r.enums===String?"NO_HASH":0,o.length=r.enums===String?"NO_PREFIX":0,r.bytes===String?o.prefix="":(o.prefix=[],r.bytes!==Array&&(o.prefix=$util.newBuffer(o.prefix)))),e.hash!=null&&e.hasOwnProperty("hash")&&(o.hash=r.enums===String?$root.ics23.HashOp[e.hash]:e.hash),e.prehashKey!=null&&e.hasOwnProperty("prehashKey")&&(o.prehashKey=r.enums===String?$root.ics23.HashOp[e.prehashKey]:e.prehashKey),e.prehashValue!=null&&e.hasOwnProperty("prehashValue")&&(o.prehashValue=r.enums===String?$root.ics23.HashOp[e.prehashValue]:e.prehashValue),e.length!=null&&e.hasOwnProperty("length")&&(o.length=r.enums===String?$root.ics23.LengthOp[e.length]:e.length),e.prefix!=null&&e.hasOwnProperty("prefix")&&(o.prefix=r.bytes===String?$util.base64.encode(e.prefix,0,e.prefix.length):r.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.InnerOp=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.hash=0,t.prototype.prefix=$util.newBuffer([]),t.prototype.suffix=$util.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.hash!=null&&e.hasOwnProperty("hash")&&r.uint32(8).int32(e.hash),e.prefix!=null&&e.hasOwnProperty("prefix")&&r.uint32(18).bytes(e.prefix),e.suffix!=null&&e.hasOwnProperty("suffix")&&r.uint32(26).bytes(e.suffix),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.InnerOp;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.hash=e.int32();break;case 2:u.prefix=e.bytes();break;case 3:u.suffix=e.bytes();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.hash!=null&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}return e.prefix!=null&&e.hasOwnProperty("prefix")&&!(e.prefix&&typeof e.prefix.length=="number"||$util.isString(e.prefix))?"prefix: buffer expected":e.suffix!=null&&e.hasOwnProperty("suffix")&&!(e.suffix&&typeof e.suffix.length=="number"||$util.isString(e.suffix))?"suffix: buffer expected":null},t.fromObject=function(e){if(e instanceof $root.ics23.InnerOp)return e;var r=new $root.ics23.InnerOp;switch(e.hash){case"NO_HASH":case 0:r.hash=0;break;case"SHA256":case 1:r.hash=1;break;case"SHA512":case 2:r.hash=2;break;case"KECCAK":case 3:r.hash=3;break;case"RIPEMD160":case 4:r.hash=4;break;case"BITCOIN":case 5:r.hash=5;break;case"SHA512_256":case 6:r.hash=6;break}return e.prefix!=null&&(typeof e.prefix=="string"?$util.base64.decode(e.prefix,r.prefix=$util.newBuffer($util.base64.length(e.prefix)),0):e.prefix.length&&(r.prefix=e.prefix)),e.suffix!=null&&(typeof e.suffix=="string"?$util.base64.decode(e.suffix,r.suffix=$util.newBuffer($util.base64.length(e.suffix)),0):e.suffix.length&&(r.suffix=e.suffix)),r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.hash=r.enums===String?"NO_HASH":0,r.bytes===String?o.prefix="":(o.prefix=[],r.bytes!==Array&&(o.prefix=$util.newBuffer(o.prefix))),r.bytes===String?o.suffix="":(o.suffix=[],r.bytes!==Array&&(o.suffix=$util.newBuffer(o.suffix)))),e.hash!=null&&e.hasOwnProperty("hash")&&(o.hash=r.enums===String?$root.ics23.HashOp[e.hash]:e.hash),e.prefix!=null&&e.hasOwnProperty("prefix")&&(o.prefix=r.bytes===String?$util.base64.encode(e.prefix,0,e.prefix.length):r.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),e.suffix!=null&&e.hasOwnProperty("suffix")&&(o.suffix=r.bytes===String?$util.base64.encode(e.suffix,0,e.suffix.length):r.bytes===Array?Array.prototype.slice.call(e.suffix):e.suffix),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.ProofSpec=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.leafSpec=null,t.prototype.innerSpec=null,t.prototype.maxDepth=0,t.prototype.minDepth=0,t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.leafSpec!=null&&e.hasOwnProperty("leafSpec")&&$root.ics23.LeafOp.encode(e.leafSpec,r.uint32(10).fork()).ldelim(),e.innerSpec!=null&&e.hasOwnProperty("innerSpec")&&$root.ics23.InnerSpec.encode(e.innerSpec,r.uint32(18).fork()).ldelim(),e.maxDepth!=null&&e.hasOwnProperty("maxDepth")&&r.uint32(24).int32(e.maxDepth),e.minDepth!=null&&e.hasOwnProperty("minDepth")&&r.uint32(32).int32(e.minDepth),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.ProofSpec;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.leafSpec=$root.ics23.LeafOp.decode(e,e.uint32());break;case 2:u.innerSpec=$root.ics23.InnerSpec.decode(e,e.uint32());break;case 3:u.maxDepth=e.int32();break;case 4:u.minDepth=e.int32();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.leafSpec!=null&&e.hasOwnProperty("leafSpec")){var r=$root.ics23.LeafOp.verify(e.leafSpec);if(r)return"leafSpec."+r}if(e.innerSpec!=null&&e.hasOwnProperty("innerSpec")){var r=$root.ics23.InnerSpec.verify(e.innerSpec);if(r)return"innerSpec."+r}return e.maxDepth!=null&&e.hasOwnProperty("maxDepth")&&!$util.isInteger(e.maxDepth)?"maxDepth: integer expected":e.minDepth!=null&&e.hasOwnProperty("minDepth")&&!$util.isInteger(e.minDepth)?"minDepth: integer expected":null},t.fromObject=function(e){if(e instanceof $root.ics23.ProofSpec)return e;var r=new $root.ics23.ProofSpec;if(e.leafSpec!=null){if(typeof e.leafSpec!="object")throw TypeError(".ics23.ProofSpec.leafSpec: object expected");r.leafSpec=$root.ics23.LeafOp.fromObject(e.leafSpec)}if(e.innerSpec!=null){if(typeof e.innerSpec!="object")throw TypeError(".ics23.ProofSpec.innerSpec: object expected");r.innerSpec=$root.ics23.InnerSpec.fromObject(e.innerSpec)}return e.maxDepth!=null&&(r.maxDepth=e.maxDepth|0),e.minDepth!=null&&(r.minDepth=e.minDepth|0),r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(o.leafSpec=null,o.innerSpec=null,o.maxDepth=0,o.minDepth=0),e.leafSpec!=null&&e.hasOwnProperty("leafSpec")&&(o.leafSpec=$root.ics23.LeafOp.toObject(e.leafSpec,r)),e.innerSpec!=null&&e.hasOwnProperty("innerSpec")&&(o.innerSpec=$root.ics23.InnerSpec.toObject(e.innerSpec,r)),e.maxDepth!=null&&e.hasOwnProperty("maxDepth")&&(o.maxDepth=e.maxDepth),e.minDepth!=null&&e.hasOwnProperty("minDepth")&&(o.minDepth=e.minDepth),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.InnerSpec=function(){function t(n){if(this.childOrder=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.childOrder=$util.emptyArray,t.prototype.childSize=0,t.prototype.minPrefixLength=0,t.prototype.maxPrefixLength=0,t.prototype.emptyChild=$util.newBuffer([]),t.prototype.hash=0,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.childOrder!=null&&e.childOrder.length){r.uint32(10).fork();for(var o=0;o<e.childOrder.length;++o)r.int32(e.childOrder[o]);r.ldelim()}return e.childSize!=null&&e.hasOwnProperty("childSize")&&r.uint32(16).int32(e.childSize),e.minPrefixLength!=null&&e.hasOwnProperty("minPrefixLength")&&r.uint32(24).int32(e.minPrefixLength),e.maxPrefixLength!=null&&e.hasOwnProperty("maxPrefixLength")&&r.uint32(32).int32(e.maxPrefixLength),e.emptyChild!=null&&e.hasOwnProperty("emptyChild")&&r.uint32(42).bytes(e.emptyChild),e.hash!=null&&e.hasOwnProperty("hash")&&r.uint32(48).int32(e.hash),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.InnerSpec;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:if(u.childOrder&&u.childOrder.length||(u.childOrder=[]),(s&7)===2)for(var c=e.uint32()+e.pos;e.pos<c;)u.childOrder.push(e.int32());else u.childOrder.push(e.int32());break;case 2:u.childSize=e.int32();break;case 3:u.minPrefixLength=e.int32();break;case 4:u.maxPrefixLength=e.int32();break;case 5:u.emptyChild=e.bytes();break;case 6:u.hash=e.int32();break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.childOrder!=null&&e.hasOwnProperty("childOrder")){if(!Array.isArray(e.childOrder))return"childOrder: array expected";for(var r=0;r<e.childOrder.length;++r)if(!$util.isInteger(e.childOrder[r]))return"childOrder: integer[] expected"}if(e.childSize!=null&&e.hasOwnProperty("childSize")&&!$util.isInteger(e.childSize))return"childSize: integer expected";if(e.minPrefixLength!=null&&e.hasOwnProperty("minPrefixLength")&&!$util.isInteger(e.minPrefixLength))return"minPrefixLength: integer expected";if(e.maxPrefixLength!=null&&e.hasOwnProperty("maxPrefixLength")&&!$util.isInteger(e.maxPrefixLength))return"maxPrefixLength: integer expected";if(e.emptyChild!=null&&e.hasOwnProperty("emptyChild")&&!(e.emptyChild&&typeof e.emptyChild.length=="number"||$util.isString(e.emptyChild)))return"emptyChild: buffer expected";if(e.hash!=null&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:break}return null},t.fromObject=function(e){if(e instanceof $root.ics23.InnerSpec)return e;var r=new $root.ics23.InnerSpec;if(e.childOrder){if(!Array.isArray(e.childOrder))throw TypeError(".ics23.InnerSpec.childOrder: array expected");r.childOrder=[];for(var o=0;o<e.childOrder.length;++o)r.childOrder[o]=e.childOrder[o]|0}switch(e.childSize!=null&&(r.childSize=e.childSize|0),e.minPrefixLength!=null&&(r.minPrefixLength=e.minPrefixLength|0),e.maxPrefixLength!=null&&(r.maxPrefixLength=e.maxPrefixLength|0),e.emptyChild!=null&&(typeof e.emptyChild=="string"?$util.base64.decode(e.emptyChild,r.emptyChild=$util.newBuffer($util.base64.length(e.emptyChild)),0):e.emptyChild.length&&(r.emptyChild=e.emptyChild)),e.hash){case"NO_HASH":case 0:r.hash=0;break;case"SHA256":case 1:r.hash=1;break;case"SHA512":case 2:r.hash=2;break;case"KECCAK":case 3:r.hash=3;break;case"RIPEMD160":case 4:r.hash=4;break;case"BITCOIN":case 5:r.hash=5;break;case"SHA512_256":case 6:r.hash=6;break}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.childOrder=[]),r.defaults&&(o.childSize=0,o.minPrefixLength=0,o.maxPrefixLength=0,r.bytes===String?o.emptyChild="":(o.emptyChild=[],r.bytes!==Array&&(o.emptyChild=$util.newBuffer(o.emptyChild))),o.hash=r.enums===String?"NO_HASH":0),e.childOrder&&e.childOrder.length){o.childOrder=[];for(var u=0;u<e.childOrder.length;++u)o.childOrder[u]=e.childOrder[u]}return e.childSize!=null&&e.hasOwnProperty("childSize")&&(o.childSize=e.childSize),e.minPrefixLength!=null&&e.hasOwnProperty("minPrefixLength")&&(o.minPrefixLength=e.minPrefixLength),e.maxPrefixLength!=null&&e.hasOwnProperty("maxPrefixLength")&&(o.maxPrefixLength=e.maxPrefixLength),e.emptyChild!=null&&e.hasOwnProperty("emptyChild")&&(o.emptyChild=r.bytes===String?$util.base64.encode(e.emptyChild,0,e.emptyChild.length):r.bytes===Array?Array.prototype.slice.call(e.emptyChild):e.emptyChild),e.hash!=null&&e.hasOwnProperty("hash")&&(o.hash=r.enums===String?$root.ics23.HashOp[e.hash]:e.hash),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.BatchProof=function(){function t(n){if(this.entries=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.entries=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.entries!=null&&e.entries.length)for(var o=0;o<e.entries.length;++o)$root.ics23.BatchEntry.encode(e.entries[o],r.uint32(10).fork()).ldelim();return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.BatchProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.entries&&u.entries.length||(u.entries=[]),u.entries.push($root.ics23.BatchEntry.decode(e,e.uint32()));break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.entries!=null&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var r=0;r<e.entries.length;++r){var o=$root.ics23.BatchEntry.verify(e.entries[r]);if(o)return"entries."+o}}return null},t.fromObject=function(e){if(e instanceof $root.ics23.BatchProof)return e;var r=new $root.ics23.BatchProof;if(e.entries){if(!Array.isArray(e.entries))throw TypeError(".ics23.BatchProof.entries: array expected");r.entries=[];for(var o=0;o<e.entries.length;++o){if(typeof e.entries[o]!="object")throw TypeError(".ics23.BatchProof.entries: object expected");r.entries[o]=$root.ics23.BatchEntry.fromObject(e.entries[o])}}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.entries=[]),e.entries&&e.entries.length){o.entries=[];for(var u=0;u<e.entries.length;++u)o.entries[u]=$root.ics23.BatchEntry.toObject(e.entries[u],r)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.BatchEntry=function(){function t(e){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)e[r[o]]!=null&&(this[r[o]]=e[r[o]])}t.prototype.exist=null,t.prototype.nonexist=null;var n;return Object.defineProperty(t.prototype,"proof",{get:$util.oneOfGetter(n=["exist","nonexist"]),set:$util.oneOfSetter(n)}),t.create=function(r){return new t(r)},t.encode=function(r,o){return o||(o=$Writer.create()),r.exist!=null&&r.hasOwnProperty("exist")&&$root.ics23.ExistenceProof.encode(r.exist,o.uint32(10).fork()).ldelim(),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&$root.ics23.NonExistenceProof.encode(r.nonexist,o.uint32(18).fork()).ldelim(),o},t.encodeDelimited=function(r,o){return this.encode(r,o).ldelim()},t.decode=function(r,o){r instanceof $Reader||(r=$Reader.create(r));for(var u=o===void 0?r.len:r.pos+o,s=new $root.ics23.BatchEntry;r.pos<u;){var c=r.uint32();switch(c>>>3){case 1:s.exist=$root.ics23.ExistenceProof.decode(r,r.uint32());break;case 2:s.nonexist=$root.ics23.NonExistenceProof.decode(r,r.uint32());break;default:r.skipType(c&7);break}}return s},t.decodeDelimited=function(r){return r instanceof $Reader||(r=new $Reader(r)),this.decode(r,r.uint32())},t.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var o={};if(r.exist!=null&&r.hasOwnProperty("exist")){o.proof=1;{var u=$root.ics23.ExistenceProof.verify(r.exist);if(u)return"exist."+u}}if(r.nonexist!=null&&r.hasOwnProperty("nonexist")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.NonExistenceProof.verify(r.nonexist);if(u)return"nonexist."+u}}return null},t.fromObject=function(r){if(r instanceof $root.ics23.BatchEntry)return r;var o=new $root.ics23.BatchEntry;if(r.exist!=null){if(typeof r.exist!="object")throw TypeError(".ics23.BatchEntry.exist: object expected");o.exist=$root.ics23.ExistenceProof.fromObject(r.exist)}if(r.nonexist!=null){if(typeof r.nonexist!="object")throw TypeError(".ics23.BatchEntry.nonexist: object expected");o.nonexist=$root.ics23.NonExistenceProof.fromObject(r.nonexist)}return o},t.toObject=function(r,o){o||(o={});var u={};return r.exist!=null&&r.hasOwnProperty("exist")&&(u.exist=$root.ics23.ExistenceProof.toObject(r.exist,o),o.oneofs&&(u.proof="exist")),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&(u.nonexist=$root.ics23.NonExistenceProof.toObject(r.nonexist,o),o.oneofs&&(u.proof="nonexist")),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedBatchProof=function(){function t(n){if(this.entries=[],this.lookupInners=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.entries=$util.emptyArray,t.prototype.lookupInners=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.entries!=null&&e.entries.length)for(var o=0;o<e.entries.length;++o)$root.ics23.CompressedBatchEntry.encode(e.entries[o],r.uint32(10).fork()).ldelim();if(e.lookupInners!=null&&e.lookupInners.length)for(var o=0;o<e.lookupInners.length;++o)$root.ics23.InnerOp.encode(e.lookupInners[o],r.uint32(18).fork()).ldelim();return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.CompressedBatchProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.entries&&u.entries.length||(u.entries=[]),u.entries.push($root.ics23.CompressedBatchEntry.decode(e,e.uint32()));break;case 2:u.lookupInners&&u.lookupInners.length||(u.lookupInners=[]),u.lookupInners.push($root.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.entries!=null&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var r=0;r<e.entries.length;++r){var o=$root.ics23.CompressedBatchEntry.verify(e.entries[r]);if(o)return"entries."+o}}if(e.lookupInners!=null&&e.hasOwnProperty("lookupInners")){if(!Array.isArray(e.lookupInners))return"lookupInners: array expected";for(var r=0;r<e.lookupInners.length;++r){var o=$root.ics23.InnerOp.verify(e.lookupInners[r]);if(o)return"lookupInners."+o}}return null},t.fromObject=function(e){if(e instanceof $root.ics23.CompressedBatchProof)return e;var r=new $root.ics23.CompressedBatchProof;if(e.entries){if(!Array.isArray(e.entries))throw TypeError(".ics23.CompressedBatchProof.entries: array expected");r.entries=[];for(var o=0;o<e.entries.length;++o){if(typeof e.entries[o]!="object")throw TypeError(".ics23.CompressedBatchProof.entries: object expected");r.entries[o]=$root.ics23.CompressedBatchEntry.fromObject(e.entries[o])}}if(e.lookupInners){if(!Array.isArray(e.lookupInners))throw TypeError(".ics23.CompressedBatchProof.lookupInners: array expected");r.lookupInners=[];for(var o=0;o<e.lookupInners.length;++o){if(typeof e.lookupInners[o]!="object")throw TypeError(".ics23.CompressedBatchProof.lookupInners: object expected");r.lookupInners[o]=$root.ics23.InnerOp.fromObject(e.lookupInners[o])}}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.entries=[],o.lookupInners=[]),e.entries&&e.entries.length){o.entries=[];for(var u=0;u<e.entries.length;++u)o.entries[u]=$root.ics23.CompressedBatchEntry.toObject(e.entries[u],r)}if(e.lookupInners&&e.lookupInners.length){o.lookupInners=[];for(var u=0;u<e.lookupInners.length;++u)o.lookupInners[u]=$root.ics23.InnerOp.toObject(e.lookupInners[u],r)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedBatchEntry=function(){function t(e){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)e[r[o]]!=null&&(this[r[o]]=e[r[o]])}t.prototype.exist=null,t.prototype.nonexist=null;var n;return Object.defineProperty(t.prototype,"proof",{get:$util.oneOfGetter(n=["exist","nonexist"]),set:$util.oneOfSetter(n)}),t.create=function(r){return new t(r)},t.encode=function(r,o){return o||(o=$Writer.create()),r.exist!=null&&r.hasOwnProperty("exist")&&$root.ics23.CompressedExistenceProof.encode(r.exist,o.uint32(10).fork()).ldelim(),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&$root.ics23.CompressedNonExistenceProof.encode(r.nonexist,o.uint32(18).fork()).ldelim(),o},t.encodeDelimited=function(r,o){return this.encode(r,o).ldelim()},t.decode=function(r,o){r instanceof $Reader||(r=$Reader.create(r));for(var u=o===void 0?r.len:r.pos+o,s=new $root.ics23.CompressedBatchEntry;r.pos<u;){var c=r.uint32();switch(c>>>3){case 1:s.exist=$root.ics23.CompressedExistenceProof.decode(r,r.uint32());break;case 2:s.nonexist=$root.ics23.CompressedNonExistenceProof.decode(r,r.uint32());break;default:r.skipType(c&7);break}}return s},t.decodeDelimited=function(r){return r instanceof $Reader||(r=new $Reader(r)),this.decode(r,r.uint32())},t.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var o={};if(r.exist!=null&&r.hasOwnProperty("exist")){o.proof=1;{var u=$root.ics23.CompressedExistenceProof.verify(r.exist);if(u)return"exist."+u}}if(r.nonexist!=null&&r.hasOwnProperty("nonexist")){if(o.proof===1)return"proof: multiple values";o.proof=1;{var u=$root.ics23.CompressedNonExistenceProof.verify(r.nonexist);if(u)return"nonexist."+u}}return null},t.fromObject=function(r){if(r instanceof $root.ics23.CompressedBatchEntry)return r;var o=new $root.ics23.CompressedBatchEntry;if(r.exist!=null){if(typeof r.exist!="object")throw TypeError(".ics23.CompressedBatchEntry.exist: object expected");o.exist=$root.ics23.CompressedExistenceProof.fromObject(r.exist)}if(r.nonexist!=null){if(typeof r.nonexist!="object")throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected");o.nonexist=$root.ics23.CompressedNonExistenceProof.fromObject(r.nonexist)}return o},t.toObject=function(r,o){o||(o={});var u={};return r.exist!=null&&r.hasOwnProperty("exist")&&(u.exist=$root.ics23.CompressedExistenceProof.toObject(r.exist,o),o.oneofs&&(u.proof="exist")),r.nonexist!=null&&r.hasOwnProperty("nonexist")&&(u.nonexist=$root.ics23.CompressedNonExistenceProof.toObject(r.nonexist,o),o.oneofs&&(u.proof="nonexist")),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedExistenceProof=function(){function t(n){if(this.path=[],n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.value=$util.newBuffer([]),t.prototype.leaf=null,t.prototype.path=$util.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,r){if(r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.value!=null&&e.hasOwnProperty("value")&&r.uint32(18).bytes(e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&$root.ics23.LeafOp.encode(e.leaf,r.uint32(26).fork()).ldelim(),e.path!=null&&e.path.length){r.uint32(34).fork();for(var o=0;o<e.path.length;++o)r.int32(e.path[o]);r.ldelim()}return r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.CompressedExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.value=e.bytes();break;case 3:u.leaf=$root.ics23.LeafOp.decode(e,e.uint32());break;case 4:if(u.path&&u.path.length||(u.path=[]),(s&7)===2)for(var c=e.uint32()+e.pos;e.pos<c;)u.path.push(e.int32());else u.path.push(e.int32());break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.value!=null&&e.hasOwnProperty("value")&&!(e.value&&typeof e.value.length=="number"||$util.isString(e.value)))return"value: buffer expected";if(e.leaf!=null&&e.hasOwnProperty("leaf")){var r=$root.ics23.LeafOp.verify(e.leaf);if(r)return"leaf."+r}if(e.path!=null&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var o=0;o<e.path.length;++o)if(!$util.isInteger(e.path[o]))return"path: integer[] expected"}return null},t.fromObject=function(e){if(e instanceof $root.ics23.CompressedExistenceProof)return e;var r=new $root.ics23.CompressedExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.value!=null&&(typeof e.value=="string"?$util.base64.decode(e.value,r.value=$util.newBuffer($util.base64.length(e.value)),0):e.value.length&&(r.value=e.value)),e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".ics23.CompressedExistenceProof.leaf: object expected");r.leaf=$root.ics23.LeafOp.fromObject(e.leaf)}if(e.path){if(!Array.isArray(e.path))throw TypeError(".ics23.CompressedExistenceProof.path: array expected");r.path=[];for(var o=0;o<e.path.length;++o)r.path[o]=e.path[o]|0}return r},t.toObject=function(e,r){r||(r={});var o={};if((r.arrays||r.defaults)&&(o.path=[]),r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),r.bytes===String?o.value="":(o.value=[],r.bytes!==Array&&(o.value=$util.newBuffer(o.value))),o.leaf=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.value!=null&&e.hasOwnProperty("value")&&(o.value=r.bytes===String?$util.base64.encode(e.value,0,e.value.length):r.bytes===Array?Array.prototype.slice.call(e.value):e.value),e.leaf!=null&&e.hasOwnProperty("leaf")&&(o.leaf=$root.ics23.LeafOp.toObject(e.leaf,r)),e.path&&e.path.length){o.path=[];for(var u=0;u<e.path.length;++u)o.path[u]=e.path[u]}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i.CompressedNonExistenceProof=function(){function t(n){if(n)for(var e=Object.keys(n),r=0;r<e.length;++r)n[e[r]]!=null&&(this[e[r]]=n[e[r]])}return t.prototype.key=$util.newBuffer([]),t.prototype.left=null,t.prototype.right=null,t.create=function(e){return new t(e)},t.encode=function(e,r){return r||(r=$Writer.create()),e.key!=null&&e.hasOwnProperty("key")&&r.uint32(10).bytes(e.key),e.left!=null&&e.hasOwnProperty("left")&&$root.ics23.CompressedExistenceProof.encode(e.left,r.uint32(18).fork()).ldelim(),e.right!=null&&e.hasOwnProperty("right")&&$root.ics23.CompressedExistenceProof.encode(e.right,r.uint32(26).fork()).ldelim(),r},t.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},t.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var o=r===void 0?e.len:e.pos+r,u=new $root.ics23.CompressedNonExistenceProof;e.pos<o;){var s=e.uint32();switch(s>>>3){case 1:u.key=e.bytes();break;case 2:u.left=$root.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 3:u.right=$root.ics23.CompressedExistenceProof.decode(e,e.uint32());break;default:e.skipType(s&7);break}}return u},t.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.key!=null&&e.hasOwnProperty("key")&&!(e.key&&typeof e.key.length=="number"||$util.isString(e.key)))return"key: buffer expected";if(e.left!=null&&e.hasOwnProperty("left")){var r=$root.ics23.CompressedExistenceProof.verify(e.left);if(r)return"left."+r}if(e.right!=null&&e.hasOwnProperty("right")){var r=$root.ics23.CompressedExistenceProof.verify(e.right);if(r)return"right."+r}return null},t.fromObject=function(e){if(e instanceof $root.ics23.CompressedNonExistenceProof)return e;var r=new $root.ics23.CompressedNonExistenceProof;if(e.key!=null&&(typeof e.key=="string"?$util.base64.decode(e.key,r.key=$util.newBuffer($util.base64.length(e.key)),0):e.key.length&&(r.key=e.key)),e.left!=null){if(typeof e.left!="object")throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected");r.left=$root.ics23.CompressedExistenceProof.fromObject(e.left)}if(e.right!=null){if(typeof e.right!="object")throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected");r.right=$root.ics23.CompressedExistenceProof.fromObject(e.right)}return r},t.toObject=function(e,r){r||(r={});var o={};return r.defaults&&(r.bytes===String?o.key="":(o.key=[],r.bytes!==Array&&(o.key=$util.newBuffer(o.key))),o.left=null,o.right=null),e.key!=null&&e.hasOwnProperty("key")&&(o.key=r.bytes===String?$util.base64.encode(e.key,0,e.key.length):r.bytes===Array?Array.prototype.slice.call(e.key):e.key),e.left!=null&&e.hasOwnProperty("left")&&(o.left=$root.ics23.CompressedExistenceProof.toObject(e.left,r)),e.right!=null&&e.hasOwnProperty("right")&&(o.right=$root.ics23.CompressedExistenceProof.toObject(e.right,r)),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},t}(),i}();var codecimpl=$root,ics23={},compress$1={};Object.defineProperty(compress$1,"__esModule",{value:!0});compress$1.decompress=compress$1.compress=void 0;const codecimpl_1$2=codecimpl;function compress(i){return i.batch?{compressed:compressBatch(i.batch)}:i}compress$1.compress=compress;function decompress(i){return i.compressed?{batch:decompressBatch(i.compressed)}:i}compress$1.decompress=decompress;function compressBatch(i){const t=[],n=[],e=new Map;for(const r of i.entries)if(r.exist){const o={exist:compressExist(r.exist,n,e)};t.push(o)}else if(r.nonexist){const o=r.nonexist,u={nonexist:{key:o.key,left:compressExist(o.left,n,e),right:compressExist(o.right,n,e)}};t.push(u)}else throw new Error("Unexpected batch entry during compress");return{entries:t,lookupInners:n}}function compressExist(i,t,n){if(!i)return;const e=i.path.map(r=>{const o=codecimpl_1$2.ics23.InnerOp.encode(r).finish();let u=n.get(o);return u===void 0&&(u=t.length,t.push(r),n.set(o,u)),u});return{key:i.key,value:i.value,leaf:i.leaf,path:e}}function decompressBatch(i){const t=i.lookupInners;return{entries:i.entries.map(e=>{if(e.exist)return{exist:decompressExist(e.exist,t)};if(e.nonexist){const r=e.nonexist;return{nonexist:{key:r.key,left:decompressExist(r.left,t),right:decompressExist(r.right,t)}}}else throw new Error("Unexpected batch entry during compress")})}}function decompressExist(i,t){if(!i)return;const{key:n,value:e,leaf:r,path:o}=i,u=(o||[]).map(s=>t[s]);return{key:n,value:e,leaf:r,path:u}}var proofs={},ops={};Object.defineProperty(ops,"__esModule",{value:!0});ops.doHash=ops.applyInner=ops.applyLeaf=void 0;const ripemd160_1=require$$0,sha256_1=require$$0$2,sha512_1=require$$1,codecimpl_1$1=codecimpl;function applyLeaf(i,t,n){if(t.length===0)throw new Error("Missing key");if(n.length===0)throw new Error("Missing value");const e=prepareLeafData(ensureHash(i.prehashKey),ensureLength(i.length),t),r=prepareLeafData(ensureHash(i.prehashValue),ensureLength(i.length),n),o=new Uint8Array([...ensureBytes(i.prefix),...e,...r]);return doHash(ensureHash(i.hash),o)}ops.applyLeaf=applyLeaf;function applyInner(i,t){if(t.length===0)throw new Error("Inner op needs child value");const n=new Uint8Array([...ensureBytes(i.prefix),...t,...ensureBytes(i.suffix)]);return doHash(ensureHash(i.hash),n)}ops.applyInner=applyInner;function ensure(i,t){return i??t}const ensureHash=i=>ensure(i,codecimpl_1$1.ics23.HashOp.NO_HASH),ensureLength=i=>ensure(i,codecimpl_1$1.ics23.LengthOp.NO_PREFIX),ensureBytes=i=>ensure(i,new Uint8Array([]));function prepareLeafData(i,t,n){const e=doHashOrNoop(i,n);return doLengthOp(t,e)}function doHashOrNoop(i,t){return i===codecimpl_1$1.ics23.HashOp.NO_HASH?t:doHash(i,t)}function doHash(i,t){switch(i){case codecimpl_1$1.ics23.HashOp.SHA256:return(0,sha256_1.sha256)(t);case codecimpl_1$1.ics23.HashOp.SHA512:return(0,sha512_1.sha512)(t);case codecimpl_1$1.ics23.HashOp.RIPEMD160:return(0,ripemd160_1.ripemd160)(t);case codecimpl_1$1.ics23.HashOp.BITCOIN:return(0,ripemd160_1.ripemd160)((0,sha256_1.sha256)(t));case codecimpl_1$1.ics23.HashOp.SHA512_256:return(0,sha512_1.sha512_256)(t)}throw new Error(`Unsupported hashop: ${i}`)}ops.doHash=doHash;function doLengthOp(i,t){switch(i){case codecimpl_1$1.ics23.LengthOp.NO_PREFIX:return t;case codecimpl_1$1.ics23.LengthOp.VAR_PROTO:return new Uint8Array([...encodeVarintProto(t.length),...t]);case codecimpl_1$1.ics23.LengthOp.REQUIRE_32_BYTES:if(t.length!==32)throw new Error(`Length is ${t.length}, not 32 bytes`);return t;case codecimpl_1$1.ics23.LengthOp.REQUIRE_64_BYTES:if(t.length!==64)throw new Error(`Length is ${t.length}, not 64 bytes`);return t;case codecimpl_1$1.ics23.LengthOp.FIXED32_LITTLE:return new Uint8Array([...encodeFixed32Le(t.length),...t])}throw new Error(`Unsupported lengthop: ${i}`)}function encodeVarintProto(i){let t=[],n=i;for(;n>=128;){const e=n%128+128;t=[...t,e],n=n/128}return t=[...t,n],new Uint8Array(t)}function encodeFixed32Le(i){const t=new Uint8Array(4);let n=i;for(let e=t.length;e>0;e--)t[Math.abs(e-t.length)]=n%256,n=Math.floor(n/256);return t}var specs={};Object.defineProperty(specs,"__esModule",{value:!0});specs.bytesBefore=specs.ensureBytesBefore=specs.bytesEqual=specs.ensureBytesEqual=specs.ensureInner=specs.ensureLeaf=void 0;function ensureLeaf(i,t){if(i.hash!==t.hash)throw new Error(`Unexpected hashOp: ${i.hash}`);if(i.prehashKey!==t.prehashKey)throw new Error(`Unexpected prehashKey: ${i.prehashKey}`);if(i.prehashValue!==t.prehashValue)throw new Error(`Unexpected prehashValue: ${i.prehashValue}`);if(i.length!==t.length)throw new Error(`Unexpected length op: ${i.length}`);ensurePrefix(i.prefix,t.prefix)}specs.ensureLeaf=ensureLeaf;function ensureInner(i,t,n){if(i.hash!==n.hash)throw new Error(`Unexpected hashOp: ${i.hash}`);if(!i.prefix)throw new Error("No prefix set for inner node");if(hasPrefix(i.prefix,t))throw new Error("Inner node has leaf prefix");if(i.prefix.length<(n.minPrefixLength||0))throw new Error(`Prefix too short: ${i.prefix.length} bytes`);const e=(n.childOrder.length-1)*n.childSize;if(i.prefix.length>(n.maxPrefixLength||0)+e)throw new Error(`Prefix too long: ${i.prefix.length} bytes`)}specs.ensureInner=ensureInner;function ensurePrefix(i,t){if(!(!t||t.length===0)){if(!i)throw new Error("Target bytes missing");ensureBytesEqual(t,i.slice(0,t.length))}}function ensureBytesEqual(i,t){if(i.length!==t.length)throw new Error(`Different lengths ${i.length} vs ${t.length}`);for(let n=0;n<i.length;n++)if(i[n]!==t[n])throw new Error(`Arrays differ at index ${n}: ${i[n]} vs ${t[n]}`)}specs.ensureBytesEqual=ensureBytesEqual;function bytesEqual(i,t){if(i.length!==t.length)return!1;for(let n=0;n<i.length;n++)if(i[n]!==t[n])return!1;return!0}specs.bytesEqual=bytesEqual;function hasPrefix(i,t){if(!t||t.length===0||!i||i.length<=t.length)return!1;for(let n=0;n<t.length;n++)if(i[n]!==t[n])return!1;throw!0}function ensureBytesBefore(i,t){if(!bytesBefore(i,t))throw new Error("first is after last")}specs.ensureBytesBefore=ensureBytesBefore;function bytesBefore(i,t){const n=i.length<t.length?i.length:t.length;for(let e=0;e<n;e++){if(i[e]<t[e])return!0;if(i[e]>t[e])return!1}return i.length<t.length}specs.bytesBefore=bytesBefore;Object.defineProperty(proofs,"__esModule",{value:!0});proofs.ensureLeftNeighbor=proofs.ensureSpec=proofs.calculateExistenceRoot=proofs.verifyNonExistence=proofs.verifyExistence=proofs.smtSpec=proofs.tendermintSpec=proofs.iavlSpec=void 0;const codecimpl_1=codecimpl,ops_1=ops,specs_1$1=specs;proofs.iavlSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:codecimpl_1.ics23.HashOp.SHA256,prehashValue:codecimpl_1.ics23.HashOp.SHA256,prehashKey:codecimpl_1.ics23.HashOp.NO_HASH,length:codecimpl_1.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:4,maxPrefixLength:12,childSize:33,hash:codecimpl_1.ics23.HashOp.SHA256}};proofs.tendermintSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:codecimpl_1.ics23.HashOp.SHA256,prehashValue:codecimpl_1.ics23.HashOp.SHA256,prehashKey:codecimpl_1.ics23.HashOp.NO_HASH,length:codecimpl_1.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:1,maxPrefixLength:1,childSize:32,hash:codecimpl_1.ics23.HashOp.SHA256}};proofs.smtSpec={leafSpec:{hash:codecimpl_1.ics23.HashOp.SHA256,prehashKey:codecimpl_1.ics23.HashOp.NO_HASH,prehashValue:codecimpl_1.ics23.HashOp.SHA256,length:codecimpl_1.ics23.LengthOp.NO_PREFIX,prefix:Uint8Array.from([0])},innerSpec:{childOrder:[0,1],childSize:32,minPrefixLength:1,maxPrefixLength:1,emptyChild:new Uint8Array(32),hash:codecimpl_1.ics23.HashOp.SHA256},maxDepth:256};function verifyExistence(i,t,n,e,r){ensureSpec(i,t);const o=calculateExistenceRoot(i);(0,specs_1$1.ensureBytesEqual)(o,n),(0,specs_1$1.ensureBytesEqual)(e,i.key),(0,specs_1$1.ensureBytesEqual)(r,i.value)}proofs.verifyExistence=verifyExistence;function verifyNonExistence(i,t,n,e){let r,o;if(i.left&&(verifyExistence(i.left,t,n,i.left.key,i.left.value),r=i.left.key),i.right&&(verifyExistence(i.right,t,n,i.right.key,i.right.value),o=i.right.key),!r&&!o)throw new Error("neither left nor right proof defined");if(r&&(0,specs_1$1.ensureBytesBefore)(r,e),o&&(0,specs_1$1.ensureBytesBefore)(e,o),!t.innerSpec)throw new Error("no inner spec");r?o?ensureLeftNeighbor(t.innerSpec,i.left.path,i.right.path):ensureRightMost(t.innerSpec,i.left.path):ensureLeftMost(t.innerSpec,i.right.path)}proofs.verifyNonExistence=verifyNonExistence;function calculateExistenceRoot(i){if(!i.key||!i.value)throw new Error("Existence proof needs key and value set");if(!i.leaf)throw new Error("Existence proof must start with a leaf operation");const t=i.path||[];let n=(0,ops_1.applyLeaf)(i.leaf,i.key,i.value);for(const e of t)n=(0,ops_1.applyInner)(e,n);return n}proofs.calculateExistenceRoot=calculateExistenceRoot;function ensureSpec(i,t){if(!i.leaf)throw new Error("Existence proof must start with a leaf operation");if(!t.leafSpec)throw new Error("Spec must include leafSpec");if(!t.innerSpec)throw new Error("Spec must include innerSpec");(0,specs_1$1.ensureLeaf)(i.leaf,t.leafSpec);const n=i.path||[];if(t.minDepth&&n.length<t.minDepth)throw new Error(`Too few inner nodes ${n.length}`);if(t.maxDepth&&n.length>t.maxDepth)throw new Error(`Too many inner nodes ${n.length}`);for(const e of n)(0,specs_1$1.ensureInner)(e,t.leafSpec.prefix,t.innerSpec)}proofs.ensureSpec=ensureSpec;function ensureLeftMost(i,t){const{minPrefix:n,maxPrefix:e,suffix:r}=getPadding(i,0);for(const o of t)if(!hasPadding(o,n,e,r))throw new Error("Step not leftmost")}function ensureRightMost(i,t){const n=i.childOrder.length-1,{minPrefix:e,maxPrefix:r,suffix:o}=getPadding(i,n);for(const u of t)if(!hasPadding(u,e,r,o))throw new Error("Step not leftmost")}function ensureLeftNeighbor(i,t,n){const e=[...t],r=[...n];let o=e.pop(),u=r.pop();for(;(0,specs_1$1.bytesEqual)(o.prefix,u.prefix)&&(0,specs_1$1.bytesEqual)(o.suffix,u.suffix);)o=e.pop(),u=r.pop();if(!isLeftStep(i,o,u))throw new Error("Not left neightbor at first divergent step");ensureRightMost(i,e),ensureLeftMost(i,r)}proofs.ensureLeftNeighbor=ensureLeftNeighbor;function isLeftStep(i,t,n){const e=orderFromPadding(i,t);return orderFromPadding(i,n)===e+1}function orderFromPadding(i,t){for(let n=0;n<i.childOrder.length;n++){const{minPrefix:e,maxPrefix:r,suffix:o}=getPadding(i,n);if(hasPadding(t,e,r,o))return n}throw new Error("Cannot find any valid spacing for this node")}function hasPadding(i,t,n,e){return(i.prefix||[]).length<t||(i.prefix||[]).length>n?!1:(i.suffix||[]).length===e}function getPadding(i,t){const n=getPosition(i.childOrder,t),e=n*i.childSize,r=e+i.minPrefixLength,o=e+i.maxPrefixLength,u=(i.childOrder.length-1-n)*i.childSize;return{minPrefix:r,maxPrefix:o,suffix:u}}function getPosition(i,t){if(t<0||t>=i.length)throw new Error(`Invalid branch: ${t}`);return i.findIndex(n=>n===t)}Object.defineProperty(ics23,"__esModule",{value:!0});ics23.batchVerifyNonMembership=ics23.batchVerifyMembership=ics23.verifyNonMembership=ics23.verifyMembership=void 0;const compress_1=compress$1,proofs_1=proofs,specs_1=specs;function verifyMembership(i,t,n,e,r){const o=(0,compress_1.decompress)(i),u=getExistForKey(o,e);if(!u)return!1;try{return(0,proofs_1.verifyExistence)(u,t,n,e,r),!0}catch{return!1}}ics23.verifyMembership=verifyMembership;function verifyNonMembership(i,t,n,e){const r=(0,compress_1.decompress)(i),o=getNonExistForKey(r,e);if(!o)return!1;try{return(0,proofs_1.verifyNonExistence)(o,t,n,e),!0}catch{return!1}}ics23.verifyNonMembership=verifyNonMembership;function batchVerifyMembership(i,t,n,e){const r=(0,compress_1.decompress)(i);for(const[o,u]of e.entries())if(!verifyMembership(r,t,n,o,u))return!1;return!0}ics23.batchVerifyMembership=batchVerifyMembership;function batchVerifyNonMembership(i,t,n,e){const r=(0,compress_1.decompress)(i);for(const o of e)if(!verifyNonMembership(r,t,n,o))return!1;return!0}ics23.batchVerifyNonMembership=batchVerifyNonMembership;function getExistForKey(i,t){const n=e=>!!e&&(0,specs_1.bytesEqual)(t,e.key);if(n(i.exist))return i.exist;if(i.batch)return i.batch.entries.map(e=>e.exist||null).find(n)}function getNonExistForKey(i,t){const n=e=>!!e&&(!e.left||(0,specs_1.bytesBefore)(e.left.key,t))&&(!e.right||(0,specs_1.bytesBefore)(t,e.right.key));if(n(i.nonexist))return i.nonexist;if(i.batch)return i.batch.entries.map(e=>e.nonexist||null).find(n)}(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.verifyNonExistence=i.verifyExistence=i.tendermintSpec=i.iavlSpec=i.calculateExistenceRoot=i.verifyNonMembership=i.verifyMembership=i.ics23=void 0;var t=codecimpl;Object.defineProperty(i,"ics23",{enumerable:!0,get:function(){return t.ics23}});var n=ics23;Object.defineProperty(i,"verifyMembership",{enumerable:!0,get:function(){return n.verifyMembership}}),Object.defineProperty(i,"verifyNonMembership",{enumerable:!0,get:function(){return n.verifyNonMembership}});var e=proofs;Object.defineProperty(i,"calculateExistenceRoot",{enumerable:!0,get:function(){return e.calculateExistenceRoot}}),Object.defineProperty(i,"iavlSpec",{enumerable:!0,get:function(){return e.iavlSpec}}),Object.defineProperty(i,"tendermintSpec",{enumerable:!0,get:function(){return e.tendermintSpec}}),Object.defineProperty(i,"verifyExistence",{enumerable:!0,get:function(){return e.verifyExistence}}),Object.defineProperty(i,"verifyNonExistence",{enumerable:!0,get:function(){return e.verifyNonExistence}})})(build);var xstream={},ponyfill$1={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=t;function t(n){var e,r=n.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{e=r.for("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}})(ponyfill$1);var ponyfill=ponyfill$1,implementation_browser={exports:{}};typeof self<"u"?implementation_browser.exports=self:typeof window<"u"?implementation_browser.exports=window:implementation_browser.exports=Function("return this")();var implementation_browserExports=implementation_browser.exports,implementation$1=implementation_browserExports,polyfill$1=function i(){return typeof index.commonjsGlobal!="object"||!index.commonjsGlobal||index.commonjsGlobal.Math!==Math||index.commonjsGlobal.Array!==Array?implementation$1:index.commonjsGlobal},define=index$1.defineProperties_1,gOPD=index$1.gopd,getPolyfill$1=polyfill$1,shim$1=function i(){var t=getPolyfill$1();if(define.supportsDescriptors){var n=gOPD(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},defineProperties=index$1.defineProperties_1,implementation=implementation_browserExports,getPolyfill=polyfill$1,shim=shim$1,polyfill=getPolyfill(),getGlobal=function(){return polyfill};defineProperties(getGlobal,{getPolyfill,implementation,shim});var globalthis=getGlobal,__extends=index.commonjsGlobal&&index.commonjsGlobal.__extends||function(){var i=function(t,n){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var o in r)r.hasOwnProperty(o)&&(e[o]=r[o])},i(t,n)};return function(t,n){i(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}}();Object.defineProperty(xstream,"__esModule",{value:!0});xstream.NO_IL=xstream.NO=xstream.MemoryStream=xstream.Stream=void 0;var ponyfill_1=ponyfill,globalthis_1=globalthis,$$observable=ponyfill_1.default(globalthis_1.getPolyfill()),NO={};xstream.NO=NO;function noop(){}function cp(i){for(var t=i.length,n=Array(t),e=0;e<t;++e)n[e]=i[e];return n}function and(i,t){return function(e){return i(e)&&t(e)}}function _try(i,t,n){try{return i.f(t)}catch(e){return n._e(e),NO}}var NO_IL={_n:noop,_e:noop,_c:noop};xstream.NO_IL=NO_IL;function internalizeProducer(i){i._start=function(n){n.next=n._n,n.error=n._e,n.complete=n._c,this.start(n)},i._stop=i.stop}var StreamSub=function(){function i(t,n){this._stream=t,this._listener=n}return i.prototype.unsubscribe=function(){this._stream._remove(this._listener)},i}(),Observer=function(){function i(t){this._listener=t}return i.prototype.next=function(t){this._listener._n(t)},i.prototype.error=function(t){this._listener._e(t)},i.prototype.complete=function(){this._listener._c()},i}(),FromObservable=function(){function i(t){this.type="fromObservable",this.ins=t,this.active=!1}return i.prototype._start=function(t){this.out=t,this.active=!0,this._sub=this.ins.subscribe(new Observer(t)),this.active||this._sub.unsubscribe()},i.prototype._stop=function(){this._sub&&this._sub.unsubscribe(),this.active=!1},i}(),Merge=function(){function i(t){this.type="merge",this.insArr=t,this.out=NO,this.ac=0}return i.prototype._start=function(t){this.out=t;var n=this.insArr,e=n.length;this.ac=e;for(var r=0;r<e;r++)n[r]._add(this)},i.prototype._stop=function(){for(var t=this.insArr,n=t.length,e=0;e<n;e++)t[e]._remove(this);this.out=NO},i.prototype._n=function(t){var n=this.out;n!==NO&&n._n(t)},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){if(--this.ac<=0){var t=this.out;if(t===NO)return;t._c()}},i}(),CombineListener=function(){function i(t,n,e){this.i=t,this.out=n,this.p=e,e.ils.push(this)}return i.prototype._n=function(t){var n=this.p,e=this.out;if(e!==NO&&n.up(t,this.i)){var r=cp(n.vals);e._n(r)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.p;t.out!==NO&&--t.Nc===0&&t.out._c()},i}(),Combine=function(){function i(t){this.type="combine",this.insArr=t,this.out=NO,this.ils=[],this.Nc=this.Nn=0,this.vals=[]}return i.prototype.up=function(t,n){var e=this.vals[n],r=this.Nn?e===NO?--this.Nn:this.Nn:0;return this.vals[n]=t,r===0},i.prototype._start=function(t){this.out=t;var n=this.insArr,e=this.Nc=this.Nn=n.length,r=this.vals=new Array(e);if(e===0)t._n([]),t._c();else for(var o=0;o<e;o++)r[o]=NO,n[o]._add(new CombineListener(o,t,this))},i.prototype._stop=function(){for(var t=this.insArr,n=t.length,e=this.ils,r=0;r<n;r++)t[r]._remove(e[r]);this.out=NO,this.ils=[],this.vals=[]},i}(),FromArray=function(){function i(t){this.type="fromArray",this.a=t}return i.prototype._start=function(t){for(var n=this.a,e=0,r=n.length;e<r;e++)t._n(n[e]);t._c()},i.prototype._stop=function(){},i}(),FromPromise=function(){function i(t){this.type="fromPromise",this.on=!1,this.p=t}return i.prototype._start=function(t){var n=this;this.on=!0,this.p.then(function(e){n.on&&(t._n(e),t._c())},function(e){t._e(e)}).then(noop,function(e){setTimeout(function(){throw e})})},i.prototype._stop=function(){this.on=!1},i}(),Periodic=function(){function i(t){this.type="periodic",this.period=t,this.intervalID=-1,this.i=0}return i.prototype._start=function(t){var n=this;function e(){t._n(n.i++)}this.intervalID=setInterval(e,this.period)},i.prototype._stop=function(){this.intervalID!==-1&&clearInterval(this.intervalID),this.intervalID=-1,this.i=0},i}(),Debug=function(){function i(t,n){this.type="debug",this.ins=t,this.out=NO,this.s=noop,this.l="",typeof n=="string"?this.l=n:typeof n=="function"&&(this.s=n)}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=this.s,r=this.l;if(e!==noop)try{e(t)}catch(o){n._e(o)}else r?console.log(r+":",t):console.log(t);n._n(t)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Drop=function(){function i(t,n){this.type="drop",this.ins=n,this.out=NO,this.max=t,this.dropped=0}return i.prototype._start=function(t){this.out=t,this.dropped=0,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;n!==NO&&this.dropped++>=this.max&&n._n(t)},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),EndWhenListener=function(){function i(t,n){this.out=t,this.op=n}return i.prototype._n=function(){this.op.end()},i.prototype._e=function(t){this.out._e(t)},i.prototype._c=function(){this.op.end()},i}(),EndWhen=function(){function i(t,n){this.type="endWhen",this.ins=n,this.out=NO,this.o=t,this.oil=NO_IL}return i.prototype._start=function(t){this.out=t,this.o._add(this.oil=new EndWhenListener(t,this)),this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=NO,this.oil=NO_IL},i.prototype.end=function(){var t=this.out;t!==NO&&t._c()},i.prototype._n=function(t){var n=this.out;n!==NO&&n._n(t)},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){this.end()},i}(),Filter=function(){function i(t,n){this.type="filter",this.ins=n,this.out=NO,this.f=t}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=_try(this,t,n);e===NO||!e||n._n(t)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),FlattenListener=function(){function i(t,n){this.out=t,this.op=n}return i.prototype._n=function(t){this.out._n(t)},i.prototype._e=function(t){this.out._e(t)},i.prototype._c=function(){this.op.inner=NO,this.op.less()},i}(),Flatten=function(){function i(t){this.type="flatten",this.ins=t,this.out=NO,this.open=!0,this.inner=NO,this.il=NO_IL}return i.prototype._start=function(t){this.out=t,this.open=!0,this.inner=NO,this.il=NO_IL,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.inner!==NO&&this.inner._remove(this.il),this.out=NO,this.open=!0,this.inner=NO,this.il=NO_IL},i.prototype.less=function(){var t=this.out;t!==NO&&!this.open&&this.inner===NO&&t._c()},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=this,r=e.inner,o=e.il;r!==NO&&o!==NO_IL&&r._remove(o),(this.inner=t)._add(this.il=new FlattenListener(n,this))}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){this.open=!1,this.less()},i}(),Fold=function(){function i(t,n,e){var r=this;this.type="fold",this.ins=e,this.out=NO,this.f=function(o){return t(r.acc,o)},this.acc=this.seed=n}return i.prototype._start=function(t){this.out=t,this.acc=this.seed,t._n(this.acc),this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO,this.acc=this.seed},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=_try(this,t,n);e!==NO&&n._n(this.acc=e)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Last=function(){function i(t){this.type="last",this.ins=t,this.out=NO,this.has=!1,this.val=NO}return i.prototype._start=function(t){this.out=t,this.has=!1,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO,this.val=NO},i.prototype._n=function(t){this.has=!0,this.val=t},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&(this.has?(t._n(this.val),t._c()):t._e(new Error("last() failed because input stream completed")))},i}(),MapOp=function(){function i(t,n){this.type="map",this.ins=n,this.out=NO,this.f=t}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=_try(this,t,n);e!==NO&&n._n(e)}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Remember=function(){function i(t){this.type="remember",this.ins=t,this.out=NO}return i.prototype._start=function(t){this.out=t,this.ins._add(t)},i.prototype._stop=function(){this.ins._remove(this.out),this.out=NO},i}(),ReplaceError=function(){function i(t,n){this.type="replaceError",this.ins=n,this.out=NO,this.f=t}return i.prototype._start=function(t){this.out=t,this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;n!==NO&&n._n(t)},i.prototype._e=function(t){var n=this.out;if(n!==NO)try{this.ins._remove(this),(this.ins=this.f(t))._add(this)}catch(e){n._e(e)}},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),StartWith=function(){function i(t,n){this.type="startWith",this.ins=t,this.out=NO,this.val=n}return i.prototype._start=function(t){this.out=t,this.out._n(this.val),this.ins._add(t)},i.prototype._stop=function(){this.ins._remove(this.out),this.out=NO},i}(),Take=function(){function i(t,n){this.type="take",this.ins=n,this.out=NO,this.max=t,this.taken=0}return i.prototype._start=function(t){this.out=t,this.taken=0,this.max<=0?t._c():this.ins._add(this)},i.prototype._stop=function(){this.ins._remove(this),this.out=NO},i.prototype._n=function(t){var n=this.out;if(n!==NO){var e=++this.taken;e<this.max?n._n(t):e===this.max&&(n._n(t),n._c())}},i.prototype._e=function(t){var n=this.out;n!==NO&&n._e(t)},i.prototype._c=function(){var t=this.out;t!==NO&&t._c()},i}(),Stream=function(){function i(t){this._prod=t||NO,this._ils=[],this._stopID=NO,this._dl=NO,this._d=!1,this._target=null,this._err=NO}return i.prototype._n=function(t){var n=this._ils,e=n.length;if(this._d&&this._dl._n(t),e==1)n[0]._n(t);else{if(e==0)return;for(var r=cp(n),o=0;o<e;o++)r[o]._n(t)}},i.prototype._e=function(t){if(this._err===NO){this._err=t;var n=this._ils,e=n.length;if(this._x(),this._d&&this._dl._e(t),e==1)n[0]._e(t);else{if(e==0)return;for(var r=cp(n),o=0;o<e;o++)r[o]._e(t)}if(!this._d&&e==0)throw this._err}},i.prototype._c=function(){var t=this._ils,n=t.length;if(this._x(),this._d&&this._dl._c(),n==1)t[0]._c();else{if(n==0)return;for(var e=cp(t),r=0;r<n;r++)e[r]._c()}},i.prototype._x=function(){this._ils.length!==0&&(this._prod!==NO&&this._prod._stop(),this._err=NO,this._ils=[])},i.prototype._stopNow=function(){this._prod._stop(),this._err=NO,this._stopID=NO},i.prototype._add=function(t){var n=this._target;if(n)return n._add(t);var e=this._ils;if(e.push(t),!(e.length>1))if(this._stopID!==NO)clearTimeout(this._stopID),this._stopID=NO;else{var r=this._prod;r!==NO&&r._start(this)}},i.prototype._remove=function(t){var n=this,e=this._target;if(e)return e._remove(t);var r=this._ils,o=r.indexOf(t);o>-1&&(r.splice(o,1),this._prod!==NO&&r.length<=0?(this._err=NO,this._stopID=setTimeout(function(){return n._stopNow()})):r.length===1&&this._pruneCycles())},i.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},i.prototype._hasNoSinks=function(t,n){if(n.indexOf(t)!==-1)return!0;if(t.out===this)return!0;if(t.out&&t.out!==NO)return this._hasNoSinks(t.out,n.concat(t));if(t._ils){for(var e=0,r=t._ils.length;e<r;e++)if(!this._hasNoSinks(t._ils[e],n.concat(t)))return!1;return!0}else return!1},i.prototype.ctor=function(){return this instanceof MemoryStream?MemoryStream:i},i.prototype.addListener=function(t){t._n=t.next||noop,t._e=t.error||noop,t._c=t.complete||noop,this._add(t)},i.prototype.removeListener=function(t){this._remove(t)},i.prototype.subscribe=function(t){return this.addListener(t),new StreamSub(this,t)},i.prototype[$$observable]=function(){return this},i.create=function(t){if(t){if(typeof t.start!="function"||typeof t.stop!="function")throw new Error("producer requires both start and stop functions");internalizeProducer(t)}return new i(t)},i.createWithMemory=function(t){return t&&internalizeProducer(t),new MemoryStream(t)},i.never=function(){return new i({_start:noop,_stop:noop})},i.empty=function(){return new i({_start:function(t){t._c()},_stop:noop})},i.throw=function(t){return new i({_start:function(n){n._e(t)},_stop:noop})},i.from=function(t){if(typeof t[$$observable]=="function")return i.fromObservable(t);if(typeof t.then=="function")return i.fromPromise(t);if(Array.isArray(t))return i.fromArray(t);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")},i.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i.fromArray(t)},i.fromArray=function(t){return new i(new FromArray(t))},i.fromPromise=function(t){return new i(new FromPromise(t))},i.fromObservable=function(t){if(t.endWhen!==void 0)return t;var n=typeof t[$$observable]=="function"?t[$$observable]():t;return new i(new FromObservable(n))},i.periodic=function(t){return new i(new Periodic(t))},i.prototype._map=function(t){return new(this.ctor())(new MapOp(t,this))},i.prototype.map=function(t){return this._map(t)},i.prototype.mapTo=function(t){var n=this.map(function(){return t}),e=n._prod;return e.type="mapTo",n},i.prototype.filter=function(t){var n=this._prod;return n instanceof Filter?new i(new Filter(and(n.f,t),n.ins)):new i(new Filter(t,this))},i.prototype.take=function(t){return new(this.ctor())(new Take(t,this))},i.prototype.drop=function(t){return new i(new Drop(t,this))},i.prototype.last=function(){return new i(new Last(this))},i.prototype.startWith=function(t){return new MemoryStream(new StartWith(this,t))},i.prototype.endWhen=function(t){return new(this.ctor())(new EndWhen(t,this))},i.prototype.fold=function(t,n){return new MemoryStream(new Fold(t,n,this))},i.prototype.replaceError=function(t){return new(this.ctor())(new ReplaceError(t,this))},i.prototype.flatten=function(){return new i(new Flatten(this))},i.prototype.compose=function(t){return t(this)},i.prototype.remember=function(){return new MemoryStream(new Remember(this))},i.prototype.debug=function(t){return new(this.ctor())(new Debug(this,t))},i.prototype.imitate=function(t){if(t instanceof MemoryStream)throw new Error("A MemoryStream was given to imitate(), but it only supports a Stream. Read more about this restriction here: https://github.com/staltz/xstream#faq");this._target=t;for(var n=this._ils,e=n.length,r=0;r<e;r++)t._add(n[r]);this._ils=[]},i.prototype.shamefullySendNext=function(t){this._n(t)},i.prototype.shamefullySendError=function(t){this._e(t)},i.prototype.shamefullySendComplete=function(){this._c()},i.prototype.setDebugListener=function(t){t?(this._d=!0,t._n=t.next||noop,t._e=t.error||noop,t._c=t.complete||noop,this._dl=t):(this._d=!1,this._dl=NO)},i.merge=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new i(new Merge(n))},i.combine=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new i(new Combine(n))},i}();xstream.Stream=Stream;var MemoryStream=function(i){__extends(t,i);function t(n){var e=i.call(this,n)||this;return e._has=!1,e}return t.prototype._n=function(n){this._v=n,this._has=!0,i.prototype._n.call(this,n)},t.prototype._add=function(n){var e=this._target;if(e)return e._add(n);var r=this._ils;if(r.push(n),r.length>1){this._has&&n._n(this._v);return}if(this._stopID!==NO)this._has&&n._n(this._v),clearTimeout(this._stopID),this._stopID=NO;else if(this._has)n._n(this._v);else{var o=this._prod;o!==NO&&o._start(this)}},t.prototype._stopNow=function(){this._has=!1,i.prototype._stopNow.call(this)},t.prototype._x=function(){this._has=!1,i.prototype._x.call(this)},t.prototype.map=function(n){return this._map(n)},t.prototype.mapTo=function(n){return i.prototype.mapTo.call(this,n)},t.prototype.take=function(n){return i.prototype.take.call(this,n)},t.prototype.endWhen=function(n){return i.prototype.endWhen.call(this,n)},t.prototype.replaceError=function(n){return i.prototype.replaceError.call(this,n)},t.prototype.remember=function(){return this},t.prototype.debug=function(n){return i.prototype.debug.call(this,n)},t}(Stream);xstream.MemoryStream=MemoryStream;var xs=Stream;xstream.default=xs;var ws=null;typeof WebSocket<"u"?ws=WebSocket:typeof MozWebSocket<"u"?ws=MozWebSocket:typeof index.commonjsGlobal<"u"?ws=index.commonjsGlobal.WebSocket||index.commonjsGlobal.MozWebSocket:typeof window<"u"?ws=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(ws=self.WebSocket||self.MozWebSocket);var browser=ws;const require$$14=index.getAugmentedNamespace(index.pako_esm);exports.aspromise=aspromise;exports.base64=base64$1;exports.bech32=bech32;exports.browser=browser;exports.build=build;exports.eventemitter=eventemitter;exports.float=float;exports.inquire_1=inquire_1;exports.minimal=minimal;exports.pool_1=pool_1;exports.require$$0=require$$0$2;exports.require$$0$1=require$$0$1;exports.require$$0$2=require$$0;exports.require$$1=require$$1$1;exports.require$$1$1=require$$1;exports.require$$14=require$$14;exports.utf8=utf8$2;exports.xstream=xstream;
@@ -1,5 +1,5 @@
1
- import { bn as HashMD, bo as rotl, bp as wrapConstructor, a1 as getAugmentedNamespace, bq as sha512, br as sha256, bs as sha3, X as commonjsGlobal, bt as pako_esm } from "./index-DWJ5r15M.mjs";
2
- import { a as pbkdf2 } from "./pbkdf2-B3V9L7S5.mjs";
1
+ import { bm as HashMD, bn as rotl, bo as wrapConstructor, a1 as getAugmentedNamespace, bp as sha512, bq as sha256, br as sha3, X as commonjsGlobal, bs as pako_esm } from "./index-7zA9RXv7.mjs";
2
+ import { a as pbkdf2 } from "./pbkdf2-QaxjQpDb.mjs";
3
3
  import { d as defineProperties_1, g as gopd } from "./index-D9OmEohP.mjs";
4
4
  const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]), Id = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((i, t) => t)), Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);
5
5
  let idxL = [Id], idxR = [Pi];
@@ -1 +1 @@
1
- "use strict";const n=require("./index-CEovIwuS.js");function L(i,p,f,l){n.hash(i);const y=n.checkOpts({dkLen:32,asyncTick:10},l),{c:b,dkLen:d,asyncTick:t}=y;if(n.number(b),n.number(d),n.number(t),b<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const e=n.toBytes(p),r=n.toBytes(f),s=new Uint8Array(d),k=n.hmac.create(i,e),o=k._cloneInto().update(r);return{c:b,dkLen:d,asyncTick:t,DK:s,PRF:k,PRFSalt:o}}function g(i,p,f,l,y){return i.destroy(),p.destroy(),l&&l.destroy(),y.fill(0),f}function _(i,p,f,l){const{c:y,dkLen:b,DK:d,PRF:t,PRFSalt:e}=L(i,p,f,l);let r;const s=new Uint8Array(4),k=n.createView(s),o=new Uint8Array(t.outputLen);for(let c=1,w=0;w<b;c++,w+=t.outputLen){const u=d.subarray(w,w+t.outputLen);k.setInt32(0,c,!1),(r=e._cloneInto(r)).update(s).digestInto(o),u.set(o.subarray(0,u.length));for(let I=1;I<y;I++){t._cloneInto(r).update(o).digestInto(o);for(let a=0;a<u.length;a++)u[a]^=o[a]}}return g(t,e,d,r,o)}async function h(i,p,f,l){const{c:y,dkLen:b,asyncTick:d,DK:t,PRF:e,PRFSalt:r}=L(i,p,f,l);let s;const k=new Uint8Array(4),o=n.createView(k),c=new Uint8Array(e.outputLen);for(let w=1,u=0;u<b;w++,u+=e.outputLen){const I=t.subarray(u,u+e.outputLen);o.setInt32(0,w,!1),(s=r._cloneInto(s)).update(k).digestInto(c),I.set(c.subarray(0,I.length)),await n.asyncLoop(y-1,d,()=>{e._cloneInto(s).update(c).digestInto(c);for(let a=0;a<I.length;a++)I[a]^=c[a]})}return g(e,r,t,s,c)}const P=Object.freeze(Object.defineProperty({__proto__:null,pbkdf2:_,pbkdf2Async:h},Symbol.toStringTag,{value:"Module"}));exports.pbkdf2=_;exports.pbkdf2$1=P;
1
+ "use strict";const n=require("./index-BU_DiszY.js");function L(i,p,f,l){n.hash(i);const y=n.checkOpts({dkLen:32,asyncTick:10},l),{c:b,dkLen:d,asyncTick:t}=y;if(n.number(b),n.number(d),n.number(t),b<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const e=n.toBytes(p),r=n.toBytes(f),s=new Uint8Array(d),k=n.hmac.create(i,e),o=k._cloneInto().update(r);return{c:b,dkLen:d,asyncTick:t,DK:s,PRF:k,PRFSalt:o}}function g(i,p,f,l,y){return i.destroy(),p.destroy(),l&&l.destroy(),y.fill(0),f}function _(i,p,f,l){const{c:y,dkLen:b,DK:d,PRF:t,PRFSalt:e}=L(i,p,f,l);let r;const s=new Uint8Array(4),k=n.createView(s),o=new Uint8Array(t.outputLen);for(let c=1,w=0;w<b;c++,w+=t.outputLen){const u=d.subarray(w,w+t.outputLen);k.setInt32(0,c,!1),(r=e._cloneInto(r)).update(s).digestInto(o),u.set(o.subarray(0,u.length));for(let I=1;I<y;I++){t._cloneInto(r).update(o).digestInto(o);for(let a=0;a<u.length;a++)u[a]^=o[a]}}return g(t,e,d,r,o)}async function h(i,p,f,l){const{c:y,dkLen:b,asyncTick:d,DK:t,PRF:e,PRFSalt:r}=L(i,p,f,l);let s;const k=new Uint8Array(4),o=n.createView(k),c=new Uint8Array(e.outputLen);for(let w=1,u=0;u<b;w++,u+=e.outputLen){const I=t.subarray(u,u+e.outputLen);o.setInt32(0,w,!1),(s=r._cloneInto(s)).update(k).digestInto(c),I.set(c.subarray(0,I.length)),await n.asyncLoop(y-1,d,()=>{e._cloneInto(s).update(c).digestInto(c);for(let a=0;a<I.length;a++)I[a]^=c[a]})}return g(e,r,t,s,c)}const P=Object.freeze(Object.defineProperty({__proto__:null,pbkdf2:_,pbkdf2Async:h},Symbol.toStringTag,{value:"Module"}));exports.pbkdf2=_;exports.pbkdf2$1=P;
@@ -1,4 +1,4 @@
1
- import { bu as g, bv as P, bw as F, bx as A, by as I, bz as L, U as R } from "./index-DWJ5r15M.mjs";
1
+ import { bt as g, bu as P, bv as F, bw as A, bx as I, by as L, U as R } from "./index-7zA9RXv7.mjs";
2
2
  function _(u, p, d, i) {
3
3
  F(u);
4
4
  const f = A({ dkLen: 32, asyncTick: 10 }, i), { c: y, dkLen: l, asyncTick: t } = f;