@gardenfi/core 2.1.3-beta.28 → 2.1.3-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -25,7 +25,7 @@
25
25
  OP_CHECKSIGADD
26
26
  OP_2
27
27
  OP_NUMEQUAL
28
- `.trim().replace(/\s+/g," "))}leaves(){return[{version:Hn,output:this.redeemLeaf()},[{version:Hn,output:this.refundLeaf()},{version:Hn,output:this.instantRefundLeaf()}]]}generateMerkleProofFor(t){const r=this.leafHash(1),n=this.leafHash(2),i=this.leafHash(0);switch(t){case 1:{const s=Ef(i,n);return[ie.crypto.taggedHash("TapBranch",Buffer.concat(s))]}case 0:return[n,r];case 2:return[i,r];default:throw new Error(Be.invalidLeaf)}}}function vr(e,t){const r=[];for(let n=0;n<t;n++)r.push(e);return r}class Xl{constructor(){this.cache={}}set(t,r,n,i){const s={txHash:n,timeStamp:Date.now(),btcRedeemUTXO:i};this.cache[`${r}_${t.create_order.create_id}`]=s}get(t,r){return this.cache[`${r}_${t.create_order.create_id}`]||null}remove(t,r){delete this.cache[`${r}_${t.create_order.create_id}`]}}class Jl{constructor(){this.cache={}}set(t,r){this.cache[t]=r}get(t){return this.cache[t]||null}}class Ja{constructor(t,r){this.url=new $.Url(t).endpoint("blocknumbers").endpoint(r)}async fetchBlockNumbers(){try{const t=await xt.get(this.url);return re(t)}catch(t){return M("Failed to fetch block numbers",t)}}}const un={mainnet:{orderbook:"https://api.garden.finance",auth:"https://api.garden.finance/auth",quote:"https://api.garden.finance/quote",info:"https://api.garden.finance/info",evmRelay:"https://api.garden.finance/relayer",starknetRelay:""},testnet:{orderbook:"https://testnet.api.garden.finance",auth:"https://testnet.api.garden.finance/auth",quote:"https://testnet.api.garden.finance/quote",info:"https://testnet.api.garden.finance/info",evmRelay:"https://testnet.api.garden.finance/relayer",starknetRelay:""},localnet:{orderbook:"",auth:"",quote:"",info:"",evmRelay:"",starknetRelay:""}},bs={[$.Network.MAINNET]:"https://starknet-mainnet.public.blastapi.io/rpc/v0_8",[$.Network.TESTNET]:"https://starknet-sepolia.public.blastapi.io/rpc/v0_8"};class Qa{constructor(t){this.quoteUrl=new $.Url(t)}async getQuote(t,r,n=!1,i){try{const s=this.quoteUrl.endpoint("/").addSearchParams({order_pair:t,amount:r.toString(),exact_out:n.toString()}),o=await xt.get(s,{retryCount:0,...i});return o.error?M(o.error):o.result?re(o.result):M("GetQuote: Unexpected error, result is undefined")}catch(s){return M("GetQuote:",String(s))}}async getAttestedQuote(t){try{const r=await xt.post(this.quoteUrl.endpoint("/attested").toString(),{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});return r.error?M(r.error):r.result?re(r.result):M("GetAttestedQuote: Unexpected error, result is undefined")}catch(r){return console.log("error :",r),M("GetAttestedQuote:",String(r))}}async getStrategies(){try{const t=await xt.get(this.quoteUrl.endpoint("/strategies"));if(t.error)return M(t.error);if(!t.result)return M("GetStrategies: Unexpected error, result is undefined");const r={};for(const n of Object.values(t.result)){const i=ga(n.source_chain,n.source_asset.asset,n.dest_chain,n.dest_asset.asset);r[i]={id:n.id,minAmount:n.min_amount,maxAmount:n.max_amount,fee:n.fee}}return re(r)}catch(t){return M("GetStrategies:",String(t))}}}var Za={},Nr={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.testnet=Hr.bitcoin=void 0;Hr.bitcoin={messagePrefix:`Bitcoin Signed Message:
28
+ `.trim().replace(/\s+/g," "))}leaves(){return[{version:Hn,output:this.redeemLeaf()},[{version:Hn,output:this.refundLeaf()},{version:Hn,output:this.instantRefundLeaf()}]]}generateMerkleProofFor(t){const r=this.leafHash(1),n=this.leafHash(2),i=this.leafHash(0);switch(t){case 1:{const s=Ef(i,n);return[ie.crypto.taggedHash("TapBranch",Buffer.concat(s))]}case 0:return[n,r];case 2:return[i,r];default:throw new Error(Be.invalidLeaf)}}}function vr(e,t){const r=[];for(let n=0;n<t;n++)r.push(e);return r}class Xl{constructor(){this.cache={}}set(t,r,n,i){const s={txHash:n,timeStamp:Date.now(),btcRedeemUTXO:i};this.cache[`${r}_${t.create_order.create_id}`]=s}get(t,r){return this.cache[`${r}_${t.create_order.create_id}`]||null}remove(t,r){delete this.cache[`${r}_${t.create_order.create_id}`]}}class Jl{constructor(){this.cache={}}set(t,r){this.cache[t]=r}get(t){return this.cache[t]||null}}class Ja{constructor(t,r){this.url=new $.Url(t).endpoint("blocknumbers").endpoint(r)}async fetchBlockNumbers(){try{const t=await xt.get(this.url);return re(t)}catch(t){return M("Failed to fetch block numbers",t)}}}const un={mainnet:{orderbook:"https://api.garden.finance",auth:"https://api.garden.finance/auth",quote:"https://api.garden.finance/quote",info:"https://api.garden.finance/info",evmRelay:"https://api.garden.finance/relayer",starknetRelay:"https://starknet-relay.garden.finance/"},testnet:{orderbook:"https://testnet.api.garden.finance",auth:"https://testnet.api.garden.finance/auth",quote:"https://testnet.api.garden.finance/quote",info:"https://testnet.api.garden.finance/info",evmRelay:"https://testnet.api.garden.finance/relayer",starknetRelay:""},localnet:{orderbook:"",auth:"",quote:"",info:"",evmRelay:"",starknetRelay:""}},bs={[$.Network.MAINNET]:"https://starknet-mainnet.public.blastapi.io/rpc/v0_8",[$.Network.TESTNET]:"https://starknet-sepolia.public.blastapi.io/rpc/v0_8"};class Qa{constructor(t){this.quoteUrl=new $.Url(t)}async getQuote(t,r,n=!1,i){try{const s=this.quoteUrl.endpoint("/").addSearchParams({order_pair:t,amount:r.toString(),exact_out:n.toString()}),o=await xt.get(s,{retryCount:0,...i});return o.error?M(o.error):o.result?re(o.result):M("GetQuote: Unexpected error, result is undefined")}catch(s){return M("GetQuote:",String(s))}}async getAttestedQuote(t){try{const r=await xt.post(this.quoteUrl.endpoint("/attested").toString(),{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});return r.error?M(r.error):r.result?re(r.result):M("GetAttestedQuote: Unexpected error, result is undefined")}catch(r){return console.log("error :",r),M("GetAttestedQuote:",String(r))}}async getStrategies(){try{const t=await xt.get(this.quoteUrl.endpoint("/strategies"));if(t.error)return M(t.error);if(!t.result)return M("GetStrategies: Unexpected error, result is undefined");const r={};for(const n of Object.values(t.result)){const i=ga(n.source_chain,n.source_asset.asset,n.dest_chain,n.dest_asset.asset);r[i]={id:n.id,minAmount:n.min_amount,maxAmount:n.max_amount,fee:n.fee}}return re(r)}catch(t){return M("GetStrategies:",String(t))}}}var Za={},Nr={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.testnet=Hr.bitcoin=void 0;Hr.bitcoin={messagePrefix:`Bitcoin Signed Message:
29
29
  `,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128};Hr.testnet={messagePrefix:`Bitcoin Signed Message:
30
30
  `,bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239};var ec={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maybe=e.Boolean=e.Array=e.Buffer256bit=e.Network=e.typeforce=void 0,e.typeforce=Ia,e.Network=e.typeforce.compile({messagePrefix:e.typeforce.oneOf(e.typeforce.Buffer,e.typeforce.String),bip32:{public:e.typeforce.UInt32,private:e.typeforce.UInt32},pubKeyHash:e.typeforce.UInt8,scriptHash:e.typeforce.UInt8,wif:e.typeforce.UInt8}),e.Buffer256bit=e.typeforce.BufferN(32),e.Array=e.typeforce.Array,e.Boolean=e.typeforce.Boolean,e.maybe=e.typeforce.maybe})(ec);var ws={exports:{}},gs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=It,n=r.Buffer;function i(o,a){for(var u in o)a[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,a,u){return n(o,a,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,u)},s.alloc=function(o,a,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var h=n(o);return a!==void 0?typeof u=="string"?h.fill(a,u):h.fill(a):h.fill(0),h},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(gs,gs.exports);var Ve=gs.exports,Yi=65536,Ql=4294967295;function Zl(){throw new Error(`Secure random number generation is not supported by this browser.
31
31
  Use Chrome, Firefox or Internet Explorer 11`)}var eh=Ve.Buffer,ei=Gt.crypto||Gt.msCrypto;ei&&ei.getRandomValues?ws.exports=th:ws.exports=Zl;function th(e,t){if(e>Ql)throw new RangeError("requested too many random bytes");var r=eh.allocUnsafe(e);if(e>0)if(e>Yi)for(var n=0;n<e;n+=Yi)ei.getRandomValues(r.slice(n,n+Yi));else ei.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}var rh=ws.exports,_s={exports:{}};typeof Object.create=="function"?_s.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_s.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Re=_s.exports,vs={exports:{}},Ks={exports:{}},Or=typeof Reflect=="object"?Reflect:null,Lo=Or&&typeof Or.apply=="function"?Or.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},Yn;Or&&typeof Or.ownKeys=="function"?Yn=Or.ownKeys:Object.getOwnPropertySymbols?Yn=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Yn=function(t){return Object.getOwnPropertyNames(t)};function nh(e){console&&console.warn&&console.warn(e)}var tc=Number.isNaN||function(t){return t!==t};function se(){se.init.call(this)}Ks.exports=se;Ks.exports.once=ah;se.EventEmitter=se;se.prototype._events=void 0;se.prototype._eventsCount=0;se.prototype._maxListeners=void 0;var No=10;function wi(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(se,"defaultMaxListeners",{enumerable:!0,get:function(){return No},set:function(e){if(typeof e!="number"||e<0||tc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");No=e}});se.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};se.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||tc(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function rc(e){return e._maxListeners===void 0?se.defaultMaxListeners:e._maxListeners}se.prototype.getMaxListeners=function(){return rc(this)};se.prototype.emit=function(t){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=t==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[t];if(u===void 0)return!1;if(typeof u=="function")Lo(u,this,r);else for(var h=u.length,d=ac(u,h),n=0;n<h;++n)Lo(d[n],this,r);return!0};function nc(e,t,r,n){var i,s,o;if(wi(r),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),o===void 0)o=s[t]=r,++e._eventsCount;else if(typeof o=="function"?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=rc(e),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,nh(a)}return e}se.prototype.addListener=function(t,r){return nc(this,t,r,!1)};se.prototype.on=se.prototype.addListener;se.prototype.prependListener=function(t,r){return nc(this,t,r,!0)};function ih(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ic(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=ih.bind(n);return i.listener=r,n.wrapFn=i,i}se.prototype.once=function(t,r){return wi(r),this.on(t,ic(this,t,r)),this};se.prototype.prependOnceListener=function(t,r){return wi(r),this.prependListener(t,ic(this,t,r)),this};se.prototype.removeListener=function(t,r){var n,i,s,o,a;if(wi(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():sh(n,s),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,a||r)}return this};se.prototype.off=se.prototype.removeListener;se.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(t,r[i]);return this};function sc(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?oh(i):ac(i,i.length)}se.prototype.listeners=function(t){return sc(this,t,!0)};se.prototype.rawListeners=function(t){return sc(this,t,!1)};se.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):oc.call(e,t)};se.prototype.listenerCount=oc;function oc(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}se.prototype.eventNames=function(){return this._eventsCount>0?Yn(this._events):[]};function ac(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function sh(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function oh(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function ah(e,t){return new Promise(function(r,n){function i(o){e.removeListener(t,s),n(o)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",i),r([].slice.call(arguments))}cc(e,t,s,{once:!0}),t!=="error"&&ch(e,i,{once:!0})})}function ch(e,t,r){typeof e.on=="function"&&cc(e,"error",t,r)}function cc(e,t,r,n){if(typeof e.on=="function")n.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(s){n.once&&e.removeEventListener(t,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var fc=Ks.exports,uc=fc.EventEmitter;const fh={},uh=Object.freeze(Object.defineProperty({__proto__:null,default:fh},Symbol.toStringTag,{value:"Module"})),Ys=va(uh);var Xi,Ho;function lh(){if(Ho)return Xi;Ho=1;function e(k,I){var B=Object.keys(k);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(k);I&&(R=R.filter(function(U){return Object.getOwnPropertyDescriptor(k,U).enumerable})),B.push.apply(B,R)}return B}function t(k){for(var I=1;I<arguments.length;I++){var B=arguments[I]!=null?arguments[I]:{};I%2?e(Object(B),!0).forEach(function(R){r(k,R,B[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(B)):e(Object(B)).forEach(function(R){Object.defineProperty(k,R,Object.getOwnPropertyDescriptor(B,R))})}return k}function r(k,I,B){return I=o(I),I in k?Object.defineProperty(k,I,{value:B,enumerable:!0,configurable:!0,writable:!0}):k[I]=B,k}function n(k,I){if(!(k instanceof I))throw new TypeError("Cannot call a class as a function")}function i(k,I){for(var B=0;B<I.length;B++){var R=I[B];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(k,o(R.key),R)}}function s(k,I,B){return I&&i(k.prototype,I),Object.defineProperty(k,"prototype",{writable:!1}),k}function o(k){var I=a(k,"string");return typeof I=="symbol"?I:String(I)}function a(k,I){if(typeof k!="object"||k===null)return k;var B=k[Symbol.toPrimitive];if(B!==void 0){var R=B.call(k,I);if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(k)}var u=It,h=u.Buffer,d=Ys,p=d.inspect,v=p&&p.custom||"inspect";function y(k,I,B){h.prototype.copy.call(k,I,B)}return Xi=function(){function k(){n(this,k),this.head=null,this.tail=null,this.length=0}return s(k,[{key:"push",value:function(B){var R={data:B,next:null};this.length>0?this.tail.next=R:this.head=R,this.tail=R,++this.length}},{key:"unshift",value:function(B){var R={data:B,next:this.head};this.length===0&&(this.tail=R),this.head=R,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var R=this.head,U=""+R.data;R=R.next;)U+=B+R.data;return U}},{key:"concat",value:function(B){if(this.length===0)return h.alloc(0);for(var R=h.allocUnsafe(B>>>0),U=this.head,x=0;U;)y(U.data,R,x),x+=U.data.length,U=U.next;return R}},{key:"consume",value:function(B,R){var U;return B<this.head.data.length?(U=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?U=this.shift():U=R?this._getString(B):this._getBuffer(B),U}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var R=this.head,U=1,x=R.data;for(B-=x.length;R=R.next;){var g=R.data,S=B>g.length?g.length:B;if(S===g.length?x+=g:x+=g.slice(0,B),B-=S,B===0){S===g.length?(++U,R.next?this.head=R.next:this.head=this.tail=null):(this.head=R,R.data=g.slice(S));break}++U}return this.length-=U,x}},{key:"_getBuffer",value:function(B){var R=h.allocUnsafe(B),U=this.head,x=1;for(U.data.copy(R),B-=U.data.length;U=U.next;){var g=U.data,S=B>g.length?g.length:B;if(g.copy(R,R.length-B,0,S),B-=S,B===0){S===g.length?(++x,U.next?this.head=U.next:this.head=this.tail=null):(this.head=U,U.data=g.slice(S));break}++x}return this.length-=x,R}},{key:v,value:function(B,R){return p(this,t(t({},R),{},{depth:0,customInspect:!1}))}}]),k}(),Xi}function hh(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Es,this,e)):process.nextTick(Es,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Xn,r):(r._writableState.errorEmitted=!0,process.nextTick(Fo,r,s)):process.nextTick(Fo,r,s):t?(process.nextTick(Xn,r),t(s)):process.nextTick(Xn,r)}),this)}function Fo(e,t){Es(e,t),Xn(e)}function Xn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function dh(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Es(e,t){e.emit("error",t)}function ph(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var lc={destroy:hh,undestroy:dh,errorOrDestroy:ph},pr={};function yh(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var hc={};function et(e,t,r){r||(r=Error);function n(s,o,a){return typeof t=="string"?t:t(s,o,a)}var i=function(s){yh(o,s);function o(a,u,h){return s.call(this,n(a,u,h))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,hc[e]=i}function Mo(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function mh(e,t,r){return e.substr(0,t.length)===t}function bh(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function wh(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}et("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);et("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&mh(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(bh(e," argument"))i="The ".concat(e," ").concat(n," ").concat(Mo(t,"type"));else{var s=wh(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(Mo(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);et("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");et("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});et("ERR_STREAM_PREMATURE_CLOSE","Premature close");et("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});et("ERR_MULTIPLE_CALLBACK","Callback called multiple times");et("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");et("ERR_STREAM_WRITE_AFTER_END","write after end");et("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);et("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);et("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");pr.codes=hc;var gh=pr.codes.ERR_INVALID_OPT_VALUE;function _h(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function vh(e,t,r,n){var i=_h(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new gh(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var dc={getHighWaterMark:vh},Eh=xh;function xh(e,t){if(Ji("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Ji("throwDeprecation"))throw new Error(t);Ji("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Ji(e){try{if(!Gt.localStorage)return!1}catch{return!1}var t=Gt.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Qi,Do;function pc(){if(Do)return Qi;Do=1,Qi=D;function e(A){var T=this;this.next=null,this.entry=null,this.finish=function(){yt(T,A)}}var t;D.WritableState=E;var r={deprecate:Eh},n=uc,i=It.Buffer,s=(typeof Gt<"u"?Gt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(A){return i.from(A)}function a(A){return i.isBuffer(A)||A instanceof s}var u=lc,h=dc,d=h.getHighWaterMark,p=pr.codes,v=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,k=p.ERR_MULTIPLE_CALLBACK,I=p.ERR_STREAM_CANNOT_PIPE,B=p.ERR_STREAM_DESTROYED,R=p.ERR_STREAM_NULL_VALUES,U=p.ERR_STREAM_WRITE_AFTER_END,x=p.ERR_UNKNOWN_ENCODING,g=u.errorOrDestroy;Re(D,n);function S(){}function E(A,T,H){t=t||Fr(),A=A||{},typeof H!="boolean"&&(H=T instanceof t),this.objectMode=!!A.objectMode,H&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=d(this,A,"writableHighWaterMark",H),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var q=A.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Y){ve(T,Y)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}E.prototype.getBuffer=function(){for(var T=this.bufferedRequest,H=[];T;)H.push(T),T=T.next;return H},function(){try{Object.defineProperty(E.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var F;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(T){return F.call(this,T)?!0:this!==D?!1:T&&T._writableState instanceof E}})):F=function(T){return T instanceof this};function D(A){t=t||Fr();var T=this instanceof t;if(!T&&!F.call(D,this))return new D(A);this._writableState=new E(A,this,T),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),n.call(this)}D.prototype.pipe=function(){g(this,new I)};function O(A,T){var H=new U;g(A,H),process.nextTick(T,H)}function K(A,T,H,q){var Y;return H===null?Y=new R:typeof H!="string"&&!T.objectMode&&(Y=new v("chunk",["string","Buffer"],H)),Y?(g(A,Y),process.nextTick(q,Y),!1):!0}D.prototype.write=function(A,T,H){var q=this._writableState,Y=!1,b=!q.objectMode&&a(A);return b&&!i.isBuffer(A)&&(A=o(A)),typeof T=="function"&&(H=T,T=null),b?T="buffer":T||(T=q.defaultEncoding),typeof H!="function"&&(H=S),q.ending?O(this,H):(b||K(this,q,A,H))&&(q.pendingcb++,Y=G(this,q,b,A,T,H)),Y},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&qe(this,A))},D.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new x(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(D.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function C(A,T,H){return!A.objectMode&&A.decodeStrings!==!1&&typeof T=="string"&&(T=i.from(T,H)),T}Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function G(A,T,H,q,Y,b){if(!H){var w=C(T,q,Y);q!==w&&(H=!0,Y="buffer",q=w)}var N=T.objectMode?1:q.length;T.length+=N;var j=T.length<T.highWaterMark;if(j||(T.needDrain=!0),T.writing||T.corked){var ye=T.lastBufferedRequest;T.lastBufferedRequest={chunk:q,encoding:Y,isBuf:H,callback:b,next:null},ye?ye.next=T.lastBufferedRequest:T.bufferedRequest=T.lastBufferedRequest,T.bufferedRequestCount+=1}else V(A,T,!1,N,q,Y,b);return j}function V(A,T,H,q,Y,b,w){T.writelen=q,T.writecb=w,T.writing=!0,T.sync=!0,T.destroyed?T.onwrite(new B("write")):H?A._writev(Y,T.onwrite):A._write(Y,b,T.onwrite),T.sync=!1}function z(A,T,H,q,Y){--T.pendingcb,H?(process.nextTick(Y,q),process.nextTick(We,A,T),A._writableState.errorEmitted=!0,g(A,q)):(Y(q),A._writableState.errorEmitted=!0,g(A,q),We(A,T))}function ee(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}function ve(A,T){var H=A._writableState,q=H.sync,Y=H.writecb;if(typeof Y!="function")throw new k;if(ee(H),T)z(A,H,q,T,Y);else{var b=Bt(H)||A.destroyed;!b&&!H.corked&&!H.bufferProcessing&&H.bufferedRequest&&qe(A,H),q?process.nextTick(ze,A,H,b,Y):ze(A,H,b,Y)}}function ze(A,T,H,q){H||tt(A,T),T.pendingcb--,q(),We(A,T)}function tt(A,T){T.length===0&&T.needDrain&&(T.needDrain=!1,A.emit("drain"))}function qe(A,T){T.bufferProcessing=!0;var H=T.bufferedRequest;if(A._writev&&H&&H.next){var q=T.bufferedRequestCount,Y=new Array(q),b=T.corkedRequestsFree;b.entry=H;for(var w=0,N=!0;H;)Y[w]=H,H.isBuf||(N=!1),H=H.next,w+=1;Y.allBuffers=N,V(A,T,!0,T.length,Y,"",b.finish),T.pendingcb++,T.lastBufferedRequest=null,b.next?(T.corkedRequestsFree=b.next,b.next=null):T.corkedRequestsFree=new e(T),T.bufferedRequestCount=0}else{for(;H;){var j=H.chunk,ye=H.encoding,X=H.callback,ne=T.objectMode?1:j.length;if(V(A,T,!1,ne,j,ye,X),H=H.next,T.bufferedRequestCount--,T.writing)break}H===null&&(T.lastBufferedRequest=null)}T.bufferedRequest=H,T.bufferProcessing=!1}D.prototype._write=function(A,T,H){H(new y("_write()"))},D.prototype._writev=null,D.prototype.end=function(A,T,H){var q=this._writableState;return typeof A=="function"?(H=A,A=null,T=null):typeof T=="function"&&(H=T,T=null),A!=null&&this.write(A,T),q.corked&&(q.corked=1,this.uncork()),q.ending||Pt(this,q,H),this},Object.defineProperty(D.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Bt(A){return A.ending&&A.length===0&&A.bufferedRequest===null&&!A.finished&&!A.writing}function pe(A,T){A._final(function(H){T.pendingcb--,H&&g(A,H),T.prefinished=!0,A.emit("prefinish"),We(A,T)})}function Ee(A,T){!T.prefinished&&!T.finalCalled&&(typeof A._final=="function"&&!T.destroyed?(T.pendingcb++,T.finalCalled=!0,process.nextTick(pe,A,T)):(T.prefinished=!0,A.emit("prefinish")))}function We(A,T){var H=Bt(T);if(H&&(Ee(A,T),T.pendingcb===0&&(T.finished=!0,A.emit("finish"),T.autoDestroy))){var q=A._readableState;(!q||q.autoDestroy&&q.endEmitted)&&A.destroy()}return H}function Pt(A,T,H){T.ending=!0,We(A,T),H&&(T.finished?process.nextTick(H):A.once("finish",H)),T.ended=!0,A.writable=!1}function yt(A,T,H){var q=A.entry;for(A.entry=null;q;){var Y=q.callback;T.pendingcb--,Y(H),q=q.next}T.corkedRequestsFree.next=A}return Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(T){this._writableState&&(this._writableState.destroyed=T)}}),D.prototype.destroy=u.destroy,D.prototype._undestroy=u.undestroy,D.prototype._destroy=function(A,T){T(A)},Qi}var Zi,$o;function Fr(){if($o)return Zi;$o=1;var e=Object.keys||function(h){var d=[];for(var p in h)d.push(p);return d};Zi=o;var t=mc(),r=pc();Re(o,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(h){if(!(this instanceof o))return new o(h);t.call(this,h),r.call(this,h),this.allowHalfOpen=!0,h&&(h.readable===!1&&(this.readable=!1),h.writable===!1&&(this.writable=!1),h.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(u,this)}function u(h){h.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),Zi}var ti={},Xs=Ve.Buffer,jo=Xs.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Sh(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Th(e){var t=Sh(e);if(typeof t!="string"&&(Xs.isEncoding===jo||!jo(e)))throw new Error("Unknown encoding: "+e);return t||e}ti.StringDecoder=En;function En(e){this.encoding=Th(e);var t;switch(this.encoding){case"utf16le":this.text=Oh,this.end=Rh,t=4;break;case"utf8":this.fillLast=Ih,t=4;break;case"base64":this.text=Ch,this.end=Uh,t=3;break;default:this.write=Lh,this.end=Nh;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Xs.allocUnsafe(t)}En.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};En.prototype.end=Ph;En.prototype.text=Bh;En.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function es(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Ah(e,t,r){var n=t.length-1;if(n<r)return 0;var i=es(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=es(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=es(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function kh(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function Ih(e){var t=this.lastTotal-this.lastNeed,r=kh(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Bh(e,t){var r=Ah(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function Ph(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function Oh(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Rh(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Ch(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Uh(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Lh(e){return e.toString(this.encoding)}function Nh(e){return e&&e.length?this.write(e):""}var Go=pr.codes.ERR_STREAM_PREMATURE_CLOSE;function Hh(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function Fh(){}function Mh(e){return e.setHeader&&typeof e.abort=="function"}function yc(e,t,r){if(typeof t=="function")return yc(e,null,t);t||(t={}),r=Hh(r||Fh);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||a()},o=e._writableState&&e._writableState.finished,a=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,h=function(){n=!1,u=!0,i||r.call(e)},d=function(k){r.call(e,k)},p=function(){var k;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(k=new Go),r.call(e,k);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(k=new Go),r.call(e,k)},v=function(){e.req.on("finish",a)};return Mh(e)?(e.on("complete",a),e.on("abort",p),e.req?v():e.on("request",v)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",h),e.on("finish",a),t.error!==!1&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",a),e.removeListener("abort",p),e.removeListener("request",v),e.req&&e.req.removeListener("finish",a),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",a),e.removeListener("end",h),e.removeListener("error",d),e.removeListener("close",p)}}var Js=yc,ts,Vo;function Dh(){if(Vo)return ts;Vo=1;var e;function t(x,g,S){return g=r(g),g in x?Object.defineProperty(x,g,{value:S,enumerable:!0,configurable:!0,writable:!0}):x[g]=S,x}function r(x){var g=n(x,"string");return typeof g=="symbol"?g:String(g)}function n(x,g){if(typeof x!="object"||x===null)return x;var S=x[Symbol.toPrimitive];if(S!==void 0){var E=S.call(x,g);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(x)}var i=Js,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function v(x,g){return{value:x,done:g}}function y(x){var g=x[s];if(g!==null){var S=x[p].read();S!==null&&(x[h]=null,x[s]=null,x[o]=null,g(v(S,!1)))}}function k(x){process.nextTick(y,x)}function I(x,g){return function(S,E){x.then(function(){if(g[u]){S(v(void 0,!0));return}g[d](S,E)},E)}}var B=Object.getPrototypeOf(function(){}),R=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var g=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[u])return Promise.resolve(v(void 0,!0));if(this[p].destroyed)return new Promise(function(O,K){process.nextTick(function(){g[a]?K(g[a]):O(v(void 0,!0))})});var E=this[h],F;if(E)F=new Promise(I(E,this));else{var D=this[p].read();if(D!==null)return Promise.resolve(v(D,!1));F=new Promise(this[d])}return this[h]=F,F}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var g=this;return new Promise(function(S,E){g[p].destroy(null,function(F){if(F){E(F);return}S(v(void 0,!0))})})}),e),B),U=function(g){var S,E=Object.create(R,(S={},t(S,p,{value:g,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,o,{value:null,writable:!0}),t(S,a,{value:null,writable:!0}),t(S,u,{value:g._readableState.endEmitted,writable:!0}),t(S,d,{value:function(D,O){var K=E[p].read();K?(E[h]=null,E[s]=null,E[o]=null,D(v(K,!1))):(E[s]=D,E[o]=O)},writable:!0}),S));return E[h]=null,i(g,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var D=E[o];D!==null&&(E[h]=null,E[s]=null,E[o]=null,D(F)),E[a]=F;return}var O=E[s];O!==null&&(E[h]=null,E[s]=null,E[o]=null,O(v(void 0,!0))),E[u]=!0}),g.on("readable",k.bind(null,E)),E};return ts=U,ts}var rs,zo;function $h(){return zo||(zo=1,rs=function(){throw new Error("Readable.from is not available in the browser")}),rs}var ns,qo;function mc(){if(qo)return ns;qo=1,ns=O;var e;O.ReadableState=D,fc.EventEmitter;var t=function(w,N){return w.listeners(N).length},r=uc,n=It.Buffer,i=(typeof Gt<"u"?Gt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(b){return n.from(b)}function o(b){return n.isBuffer(b)||b instanceof i}var a=Ys,u;a&&a.debuglog?u=a.debuglog("stream"):u=function(){};var h=lh(),d=lc,p=dc,v=p.getHighWaterMark,y=pr.codes,k=y.ERR_INVALID_ARG_TYPE,I=y.ERR_STREAM_PUSH_AFTER_EOF,B=y.ERR_METHOD_NOT_IMPLEMENTED,R=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,U,x,g;Re(O,r);var S=d.errorOrDestroy,E=["error","close","destroy","pause","resume"];function F(b,w,N){if(typeof b.prependListener=="function")return b.prependListener(w,N);!b._events||!b._events[w]?b.on(w,N):Array.isArray(b._events[w])?b._events[w].unshift(N):b._events[w]=[N,b._events[w]]}function D(b,w,N){e=e||Fr(),b=b||{},typeof N!="boolean"&&(N=w instanceof e),this.objectMode=!!b.objectMode,N&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=v(this,b,"readableHighWaterMark",N),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(U||(U=ti.StringDecoder),this.decoder=new U(b.encoding),this.encoding=b.encoding)}function O(b){if(e=e||Fr(),!(this instanceof O))return new O(b);var w=this instanceof e;this._readableState=new D(b,this,w),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),r.call(this)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(w){this._readableState&&(this._readableState.destroyed=w)}}),O.prototype.destroy=d.destroy,O.prototype._undestroy=d.undestroy,O.prototype._destroy=function(b,w){w(b)},O.prototype.push=function(b,w){var N=this._readableState,j;return N.objectMode?j=!0:typeof b=="string"&&(w=w||N.defaultEncoding,w!==N.encoding&&(b=n.from(b,w),w=""),j=!0),K(this,b,w,!1,j)},O.prototype.unshift=function(b){return K(this,b,null,!0,!1)};function K(b,w,N,j,ye){u("readableAddChunk",w);var X=b._readableState;if(w===null)X.reading=!1,ve(b,X);else{var ne;if(ye||(ne=G(X,w)),ne)S(b,ne);else if(X.objectMode||w&&w.length>0)if(typeof w!="string"&&!X.objectMode&&Object.getPrototypeOf(w)!==n.prototype&&(w=s(w)),j)X.endEmitted?S(b,new R):C(b,X,w,!0);else if(X.ended)S(b,new I);else{if(X.destroyed)return!1;X.reading=!1,X.decoder&&!N?(w=X.decoder.write(w),X.objectMode||w.length!==0?C(b,X,w,!1):qe(b,X)):C(b,X,w,!1)}else j||(X.reading=!1,qe(b,X))}return!X.ended&&(X.length<X.highWaterMark||X.length===0)}function C(b,w,N,j){w.flowing&&w.length===0&&!w.sync?(w.awaitDrain=0,b.emit("data",N)):(w.length+=w.objectMode?1:N.length,j?w.buffer.unshift(N):w.buffer.push(N),w.needReadable&&ze(b)),qe(b,w)}function G(b,w){var N;return!o(w)&&typeof w!="string"&&w!==void 0&&!b.objectMode&&(N=new k("chunk",["string","Buffer","Uint8Array"],w)),N}O.prototype.isPaused=function(){return this._readableState.flowing===!1},O.prototype.setEncoding=function(b){U||(U=ti.StringDecoder);var w=new U(b);this._readableState.decoder=w,this._readableState.encoding=this._readableState.decoder.encoding;for(var N=this._readableState.buffer.head,j="";N!==null;)j+=w.write(N.data),N=N.next;return this._readableState.buffer.clear(),j!==""&&this._readableState.buffer.push(j),this._readableState.length=j.length,this};var V=1073741824;function z(b){return b>=V?b=V:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function ee(b,w){return b<=0||w.length===0&&w.ended?0:w.objectMode?1:b!==b?w.flowing&&w.length?w.buffer.head.data.length:w.length:(b>w.highWaterMark&&(w.highWaterMark=z(b)),b<=w.length?b:w.ended?w.length:(w.needReadable=!0,0))}O.prototype.read=function(b){u("read",b),b=parseInt(b,10);var w=this._readableState,N=b;if(b!==0&&(w.emittedReadable=!1),b===0&&w.needReadable&&((w.highWaterMark!==0?w.length>=w.highWaterMark:w.length>0)||w.ended))return u("read: emitReadable",w.length,w.ended),w.length===0&&w.ended?H(this):ze(this),null;if(b=ee(b,w),b===0&&w.ended)return w.length===0&&H(this),null;var j=w.needReadable;u("need readable",j),(w.length===0||w.length-b<w.highWaterMark)&&(j=!0,u("length less than watermark",j)),w.ended||w.reading?(j=!1,u("reading or ended",j)):j&&(u("do read"),w.reading=!0,w.sync=!0,w.length===0&&(w.needReadable=!0),this._read(w.highWaterMark),w.sync=!1,w.reading||(b=ee(N,w)));var ye;return b>0?ye=T(b,w):ye=null,ye===null?(w.needReadable=w.length<=w.highWaterMark,b=0):(w.length-=b,w.awaitDrain=0),w.length===0&&(w.ended||(w.needReadable=!0),N!==b&&w.ended&&H(this)),ye!==null&&this.emit("data",ye),ye};function ve(b,w){if(u("onEofChunk"),!w.ended){if(w.decoder){var N=w.decoder.end();N&&N.length&&(w.buffer.push(N),w.length+=w.objectMode?1:N.length)}w.ended=!0,w.sync?ze(b):(w.needReadable=!1,w.emittedReadable||(w.emittedReadable=!0,tt(b)))}}function ze(b){var w=b._readableState;u("emitReadable",w.needReadable,w.emittedReadable),w.needReadable=!1,w.emittedReadable||(u("emitReadable",w.flowing),w.emittedReadable=!0,process.nextTick(tt,b))}function tt(b){var w=b._readableState;u("emitReadable_",w.destroyed,w.length,w.ended),!w.destroyed&&(w.length||w.ended)&&(b.emit("readable"),w.emittedReadable=!1),w.needReadable=!w.flowing&&!w.ended&&w.length<=w.highWaterMark,A(b)}function qe(b,w){w.readingMore||(w.readingMore=!0,process.nextTick(Bt,b,w))}function Bt(b,w){for(;!w.reading&&!w.ended&&(w.length<w.highWaterMark||w.flowing&&w.length===0);){var N=w.length;if(u("maybeReadMore read 0"),b.read(0),N===w.length)break}w.readingMore=!1}O.prototype._read=function(b){S(this,new B("_read()"))},O.prototype.pipe=function(b,w){var N=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=b;break;case 1:j.pipes=[j.pipes,b];break;default:j.pipes.push(b);break}j.pipesCount+=1,u("pipe count=%d opts=%j",j.pipesCount,w);var ye=(!w||w.end!==!1)&&b!==process.stdout&&b!==process.stderr,X=ye?Ot:Qt;j.endEmitted?process.nextTick(X):N.once("end",X),b.on("unpipe",ne);function ne(l,c){u("onunpipe"),l===N&&c&&c.hasUnpiped===!1&&(c.hasUnpiped=!0,br())}function Ot(){u("onend"),b.end()}var mr=pe(N);b.on("drain",mr);var Gr=!1;function br(){u("cleanup"),b.removeListener("close",Vr),b.removeListener("finish",Je),b.removeListener("drain",mr),b.removeListener("error",Jt),b.removeListener("unpipe",ne),N.removeListener("end",Ot),N.removeListener("end",Qt),N.removeListener("data",Ke),Gr=!0,j.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&mr()}N.on("data",Ke);function Ke(l){u("ondata");var c=b.write(l);u("dest.write",c),c===!1&&((j.pipesCount===1&&j.pipes===b||j.pipesCount>1&&Y(j.pipes,b)!==-1)&&!Gr&&(u("false write response, pause",j.awaitDrain),j.awaitDrain++),N.pause())}function Jt(l){u("onerror",l),Qt(),b.removeListener("error",Jt),t(b,"error")===0&&S(b,l)}F(b,"error",Jt);function Vr(){b.removeListener("finish",Je),Qt()}b.once("close",Vr);function Je(){u("onfinish"),b.removeListener("close",Vr),Qt()}b.once("finish",Je);function Qt(){u("unpipe"),N.unpipe(b)}return b.emit("pipe",N),j.flowing||(u("pipe resume"),N.resume()),b};function pe(b){return function(){var N=b._readableState;u("pipeOnDrain",N.awaitDrain),N.awaitDrain&&N.awaitDrain--,N.awaitDrain===0&&t(b,"data")&&(N.flowing=!0,A(b))}}O.prototype.unpipe=function(b){var w=this._readableState,N={hasUnpiped:!1};if(w.pipesCount===0)return this;if(w.pipesCount===1)return b&&b!==w.pipes?this:(b||(b=w.pipes),w.pipes=null,w.pipesCount=0,w.flowing=!1,b&&b.emit("unpipe",this,N),this);if(!b){var j=w.pipes,ye=w.pipesCount;w.pipes=null,w.pipesCount=0,w.flowing=!1;for(var X=0;X<ye;X++)j[X].emit("unpipe",this,{hasUnpiped:!1});return this}var ne=Y(w.pipes,b);return ne===-1?this:(w.pipes.splice(ne,1),w.pipesCount-=1,w.pipesCount===1&&(w.pipes=w.pipes[0]),b.emit("unpipe",this,N),this)},O.prototype.on=function(b,w){var N=r.prototype.on.call(this,b,w),j=this._readableState;return b==="data"?(j.readableListening=this.listenerCount("readable")>0,j.flowing!==!1&&this.resume()):b==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,u("on readable",j.length,j.reading),j.length?ze(this):j.reading||process.nextTick(We,this)),N},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(b,w){var N=r.prototype.removeListener.call(this,b,w);return b==="readable"&&process.nextTick(Ee,this),N},O.prototype.removeAllListeners=function(b){var w=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&process.nextTick(Ee,this),w};function Ee(b){var w=b._readableState;w.readableListening=b.listenerCount("readable")>0,w.resumeScheduled&&!w.paused?w.flowing=!0:b.listenerCount("data")>0&&b.resume()}function We(b){u("readable nexttick read 0"),b.read(0)}O.prototype.resume=function(){var b=this._readableState;return b.flowing||(u("resume"),b.flowing=!b.readableListening,Pt(this,b)),b.paused=!1,this};function Pt(b,w){w.resumeScheduled||(w.resumeScheduled=!0,process.nextTick(yt,b,w))}function yt(b,w){u("resume",w.reading),w.reading||b.read(0),w.resumeScheduled=!1,b.emit("resume"),A(b),w.flowing&&!w.reading&&b.read(0)}O.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(b){var w=b._readableState;for(u("flow",w.flowing);w.flowing&&b.read()!==null;);}O.prototype.wrap=function(b){var w=this,N=this._readableState,j=!1;b.on("end",function(){if(u("wrapped end"),N.decoder&&!N.ended){var ne=N.decoder.end();ne&&ne.length&&w.push(ne)}w.push(null)}),b.on("data",function(ne){if(u("wrapped data"),N.decoder&&(ne=N.decoder.write(ne)),!(N.objectMode&&ne==null)&&!(!N.objectMode&&(!ne||!ne.length))){var Ot=w.push(ne);Ot||(j=!0,b.pause())}});for(var ye in b)this[ye]===void 0&&typeof b[ye]=="function"&&(this[ye]=function(Ot){return function(){return b[Ot].apply(b,arguments)}}(ye));for(var X=0;X<E.length;X++)b.on(E[X],this.emit.bind(this,E[X]));return this._read=function(ne){u("wrapped _read",ne),j&&(j=!1,b.resume())},this},typeof Symbol=="function"&&(O.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=Dh()),x(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(w){this._readableState&&(this._readableState.flowing=w)}}),O._fromList=T,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function T(b,w){if(w.length===0)return null;var N;return w.objectMode?N=w.buffer.shift():!b||b>=w.length?(w.decoder?N=w.buffer.join(""):w.buffer.length===1?N=w.buffer.first():N=w.buffer.concat(w.length),w.buffer.clear()):N=w.buffer.consume(b,w.decoder),N}function H(b){var w=b._readableState;u("endReadable",w.endEmitted),w.endEmitted||(w.ended=!0,process.nextTick(q,w,b))}function q(b,w){if(u("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,w.readable=!1,w.emit("end"),b.autoDestroy)){var N=w._writableState;(!N||N.autoDestroy&&N.finished)&&w.destroy()}}typeof Symbol=="function"&&(O.from=function(b,w){return g===void 0&&(g=$h()),g(O,b,w)});function Y(b,w){for(var N=0,j=b.length;N<j;N++)if(b[N]===w)return N;return-1}return ns}var bc=kt,gi=pr.codes,jh=gi.ERR_METHOD_NOT_IMPLEMENTED,Gh=gi.ERR_MULTIPLE_CALLBACK,Vh=gi.ERR_TRANSFORM_ALREADY_TRANSFORMING,zh=gi.ERR_TRANSFORM_WITH_LENGTH_0,_i=Fr();Re(kt,_i);function qh(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Gh);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function kt(e){if(!(this instanceof kt))return new kt(e);_i.call(this,e),this._transformState={afterTransform:qh.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Wh)}function Wh(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Wo(e,t,r)}):Wo(this,null,null)}kt.prototype.push=function(e,t){return this._transformState.needTransform=!1,_i.prototype.push.call(this,e,t)};kt.prototype._transform=function(e,t,r){r(new jh("_transform()"))};kt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};kt.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};kt.prototype._destroy=function(e,t){_i.prototype._destroy.call(this,e,function(r){t(r)})};function Wo(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new zh;if(e._transformState.transforming)throw new Vh;return e.push(null)}var Kh=bn,wc=bc;Re(bn,wc);function bn(e){if(!(this instanceof bn))return new bn(e);wc.call(this,e)}bn.prototype._transform=function(e,t,r){r(null,e)};var is;function Yh(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var gc=pr.codes,Xh=gc.ERR_MISSING_ARGS,Jh=gc.ERR_STREAM_DESTROYED;function Ko(e){if(e)throw e}function Qh(e){return e.setHeader&&typeof e.abort=="function"}function Zh(e,t,r,n){n=Yh(n);var i=!1;e.on("close",function(){i=!0}),is===void 0&&(is=Js),is(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Qh(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Jh("pipe"))}}}function Yo(e){e()}function ed(e,t){return e.pipe(t)}function td(e){return!e.length||typeof e[e.length-1]!="function"?Ko:e.pop()}function rd(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=td(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Xh("streams");var i,s=t.map(function(o,a){var u=a<t.length-1,h=a>0;return Zh(o,u,h,function(d){i||(i=d),d&&s.forEach(Yo),!u&&(s.forEach(Yo),n(i))})});return t.reduce(ed)}var nd=rd;(function(e,t){t=e.exports=mc(),t.Stream=t,t.Readable=t,t.Writable=pc(),t.Duplex=Fr(),t.Transform=bc,t.PassThrough=Kh,t.finished=Js,t.pipeline=nd})(vs,vs.exports);var _c=vs.exports,ri=Ve.Buffer,vc=_c.Transform,id=Re;function sd(e,t){if(!ri.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function Kt(e){vc.call(this),this._block=ri.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}id(Kt,vc);Kt.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(i){n=i}r(n)};Kt.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};Kt.prototype.update=function(e,t){if(sd(e,"Data"),this._finalized)throw new Error("Digest already called");ri.isBuffer(e)||(e=ri.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var s=0,o=e.length*8;o>0;++s)this._length[s]+=o,o=this._length[s]/4294967296|0,o>0&&(this._length[s]-=4294967296*o);return this};Kt.prototype._update=function(){throw new Error("_update is not implemented")};Kt.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Kt.prototype._digest=function(){throw new Error("_digest is not implemented")};var od=Kt,ad=Re,Ec=od,cd=Ve.Buffer,fd=new Array(16);function vi(){Ec.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}ad(vi,Ec);vi.prototype._update=function(){for(var e=fd,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,n=this._b,i=this._c,s=this._d;r=Ce(r,n,i,s,e[0],3614090360,7),s=Ce(s,r,n,i,e[1],3905402710,12),i=Ce(i,s,r,n,e[2],606105819,17),n=Ce(n,i,s,r,e[3],3250441966,22),r=Ce(r,n,i,s,e[4],4118548399,7),s=Ce(s,r,n,i,e[5],1200080426,12),i=Ce(i,s,r,n,e[6],2821735955,17),n=Ce(n,i,s,r,e[7],4249261313,22),r=Ce(r,n,i,s,e[8],1770035416,7),s=Ce(s,r,n,i,e[9],2336552879,12),i=Ce(i,s,r,n,e[10],4294925233,17),n=Ce(n,i,s,r,e[11],2304563134,22),r=Ce(r,n,i,s,e[12],1804603682,7),s=Ce(s,r,n,i,e[13],4254626195,12),i=Ce(i,s,r,n,e[14],2792965006,17),n=Ce(n,i,s,r,e[15],1236535329,22),r=Ue(r,n,i,s,e[1],4129170786,5),s=Ue(s,r,n,i,e[6],3225465664,9),i=Ue(i,s,r,n,e[11],643717713,14),n=Ue(n,i,s,r,e[0],3921069994,20),r=Ue(r,n,i,s,e[5],3593408605,5),s=Ue(s,r,n,i,e[10],38016083,9),i=Ue(i,s,r,n,e[15],3634488961,14),n=Ue(n,i,s,r,e[4],3889429448,20),r=Ue(r,n,i,s,e[9],568446438,5),s=Ue(s,r,n,i,e[14],3275163606,9),i=Ue(i,s,r,n,e[3],4107603335,14),n=Ue(n,i,s,r,e[8],1163531501,20),r=Ue(r,n,i,s,e[13],2850285829,5),s=Ue(s,r,n,i,e[2],4243563512,9),i=Ue(i,s,r,n,e[7],1735328473,14),n=Ue(n,i,s,r,e[12],2368359562,20),r=Le(r,n,i,s,e[5],4294588738,4),s=Le(s,r,n,i,e[8],2272392833,11),i=Le(i,s,r,n,e[11],1839030562,16),n=Le(n,i,s,r,e[14],4259657740,23),r=Le(r,n,i,s,e[1],2763975236,4),s=Le(s,r,n,i,e[4],1272893353,11),i=Le(i,s,r,n,e[7],4139469664,16),n=Le(n,i,s,r,e[10],3200236656,23),r=Le(r,n,i,s,e[13],681279174,4),s=Le(s,r,n,i,e[0],3936430074,11),i=Le(i,s,r,n,e[3],3572445317,16),n=Le(n,i,s,r,e[6],76029189,23),r=Le(r,n,i,s,e[9],3654602809,4),s=Le(s,r,n,i,e[12],3873151461,11),i=Le(i,s,r,n,e[15],530742520,16),n=Le(n,i,s,r,e[2],3299628645,23),r=Ne(r,n,i,s,e[0],4096336452,6),s=Ne(s,r,n,i,e[7],1126891415,10),i=Ne(i,s,r,n,e[14],2878612391,15),n=Ne(n,i,s,r,e[5],4237533241,21),r=Ne(r,n,i,s,e[12],1700485571,6),s=Ne(s,r,n,i,e[3],2399980690,10),i=Ne(i,s,r,n,e[10],4293915773,15),n=Ne(n,i,s,r,e[1],2240044497,21),r=Ne(r,n,i,s,e[8],1873313359,6),s=Ne(s,r,n,i,e[15],4264355552,10),i=Ne(i,s,r,n,e[6],2734768916,15),n=Ne(n,i,s,r,e[13],1309151649,21),r=Ne(r,n,i,s,e[4],4149444226,6),s=Ne(s,r,n,i,e[11],3174756917,10),i=Ne(i,s,r,n,e[2],718787259,15),n=Ne(n,i,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0};vi.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=cd.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function Ei(e,t){return e<<t|e>>>32-t}function Ce(e,t,r,n,i,s,o){return Ei(e+(t&r|~t&n)+i+s|0,o)+t|0}function Ue(e,t,r,n,i,s,o){return Ei(e+(t&n|r&~n)+i+s|0,o)+t|0}function Le(e,t,r,n,i,s,o){return Ei(e+(t^r^n)+i+s|0,o)+t|0}function Ne(e,t,r,n,i,s,o){return Ei(e+(r^(t|~n))+i+s|0,o)+t|0}var ud=vi,ni=Ve.Buffer,xc=_c.Transform,ld=Re;function hd(e,t){if(!ni.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function Yt(e){xc.call(this),this._block=ni.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}ld(Yt,xc);Yt.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(i){n=i}r(n)};Yt.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};Yt.prototype.update=function(e,t){if(hd(e,"Data"),this._finalized)throw new Error("Digest already called");ni.isBuffer(e)||(e=ni.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var s=0,o=e.length*8;o>0;++s)this._length[s]+=o,o=this._length[s]/4294967296|0,o>0&&(this._length[s]-=4294967296*o);return this};Yt.prototype._update=function(){throw new Error("_update is not implemented")};Yt.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Yt.prototype._digest=function(){throw new Error("_digest is not implemented")};var dd=Yt,ss=It.Buffer,pd=Re,Sc=dd,yd=new Array(16),Xr=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Jr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Qr=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Zr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],en=[0,1518500249,1859775393,2400959708,2840853838],tn=[1352829926,1548603684,1836072691,2053994217,0];function xi(){Sc.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}pd(xi,Sc);xi.prototype._update=function(){for(var e=yd,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._a|0,u=this._b|0,h=this._c|0,d=this._d|0,p=this._e|0,v=0;v<80;v+=1){var y,k;v<16?(y=Xo(r,n,i,s,o,e[Xr[v]],en[0],Qr[v]),k=ea(a,u,h,d,p,e[Jr[v]],tn[0],Zr[v])):v<32?(y=Jo(r,n,i,s,o,e[Xr[v]],en[1],Qr[v]),k=Zo(a,u,h,d,p,e[Jr[v]],tn[1],Zr[v])):v<48?(y=Qo(r,n,i,s,o,e[Xr[v]],en[2],Qr[v]),k=Qo(a,u,h,d,p,e[Jr[v]],tn[2],Zr[v])):v<64?(y=Zo(r,n,i,s,o,e[Xr[v]],en[3],Qr[v]),k=Jo(a,u,h,d,p,e[Jr[v]],tn[3],Zr[v])):(y=ea(r,n,i,s,o,e[Xr[v]],en[4],Qr[v]),k=Xo(a,u,h,d,p,e[Jr[v]],tn[4],Zr[v])),r=o,o=s,s=ar(i,10),i=n,n=y,a=p,p=d,d=ar(h,10),h=u,u=k}var I=this._b+i+d|0;this._b=this._c+s+p|0,this._c=this._d+o+a|0,this._d=this._e+r+u|0,this._e=this._a+n+h|0,this._a=I};xi.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=ss.alloc?ss.alloc(20):new ss(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};function ar(e,t){return e<<t|e>>>32-t}function Xo(e,t,r,n,i,s,o,a){return ar(e+(t^r^n)+s+o|0,a)+i|0}function Jo(e,t,r,n,i,s,o,a){return ar(e+(t&r|~t&n)+s+o|0,a)+i|0}function Qo(e,t,r,n,i,s,o,a){return ar(e+((t|~r)^n)+s+o|0,a)+i|0}function Zo(e,t,r,n,i,s,o,a){return ar(e+(t&n|r&~n)+s+o|0,a)+i|0}function ea(e,t,r,n,i,s,o,a){return ar(e+(t^(r|~n))+s+o|0,a)+i|0}var md=xi,Tc={exports:{}},Ac=Ve.Buffer;function Si(e,t){this._block=Ac.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Si.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Ac.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,o=0;o<i;){for(var a=s%n,u=Math.min(i-o,n-a),h=0;h<u;h++)r[a+h]=e[o+h];s+=u,o+=u,s%n===0&&this._update(r)}return this._len+=i,this};Si.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Si.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Dr=Si,bd=Re,kc=Dr,wd=Ve.Buffer,gd=[1518500249,1859775393,-1894007588,-899497514],_d=new Array(80);function xn(){this.init(),this._w=_d,kc.call(this,64,56)}bd(xn,kc);xn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vd(e){return e<<5|e>>>27}function Ed(e){return e<<30|e>>>2}function xd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}xn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var u=0;u<80;++u){var h=~~(u/20),d=vd(r)+xd(h,n,i,s)+o+t[u]+gd[h]|0;o=s,s=i,i=Ed(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};xn.prototype._hash=function(){var e=wd.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Sd=xn,Td=Re,Ic=Dr,Ad=Ve.Buffer,kd=[1518500249,1859775393,-1894007588,-899497514],Id=new Array(80);function Sn(){this.init(),this._w=Id,Ic.call(this,64,56)}Td(Sn,Ic);Sn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Bd(e){return e<<1|e>>>31}function Pd(e){return e<<5|e>>>27}function Od(e){return e<<30|e>>>2}function Rd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Sn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=Bd(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var u=0;u<80;++u){var h=~~(u/20),d=Pd(r)+Rd(h,n,i,s)+o+t[u]+kd[h]|0;o=s,s=i,i=Od(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Sn.prototype._hash=function(){var e=Ad.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Cd=Sn,Ud=Re,Bc=Dr,Ld=Ve.Buffer,Nd=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Hd=new Array(64);function Tn(){this.init(),this._w=Hd,Bc.call(this,64,56)}Ud(Tn,Bc);Tn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Fd(e,t,r){return r^e&(t^r)}function Md(e,t,r){return e&t|r&(e|t)}function Dd(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function $d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function jd(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Gd(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Tn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,u=this._g|0,h=this._h|0,d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<64;++d)t[d]=Gd(t[d-2])+t[d-7]+jd(t[d-15])+t[d-16]|0;for(var p=0;p<64;++p){var v=h+$d(o)+Fd(o,a,u)+Nd[p]+t[p]|0,y=Dd(r)+Md(r,n,i)|0;h=u,u=a,a=o,o=s+v|0,s=i,i=n,n=r,r=v+y|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=h+this._h|0};Tn.prototype._hash=function(){var e=Ld.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Pc=Tn,Vd=Re,zd=Pc,qd=Dr,Wd=Ve.Buffer,Kd=new Array(64);function Ti(){this.init(),this._w=Kd,qd.call(this,64,56)}Vd(Ti,zd);Ti.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Ti.prototype._hash=function(){var e=Wd.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Yd=Ti,Xd=Re,Oc=Dr,Jd=Ve.Buffer,ta=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Qd=new Array(160);function An(){this.init(),this._w=Qd,Oc.call(this,128,112)}Xd(An,Oc);An.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function ra(e,t,r){return r^e&(t^r)}function na(e,t,r){return e&t|r&(e|t)}function ia(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sa(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Zd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function e0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function t0(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function r0(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ie(e,t){return e>>>0<t>>>0?1:0}An.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,u=this._gh|0,h=this._hh|0,d=this._al|0,p=this._bl|0,v=this._cl|0,y=this._dl|0,k=this._el|0,I=this._fl|0,B=this._gl|0,R=this._hl|0,U=0;U<32;U+=2)t[U]=e.readInt32BE(U*4),t[U+1]=e.readInt32BE(U*4+4);for(;U<160;U+=2){var x=t[U-30],g=t[U-15*2+1],S=Zd(x,g),E=e0(g,x);x=t[U-2*2],g=t[U-2*2+1];var F=t0(x,g),D=r0(g,x),O=t[U-7*2],K=t[U-7*2+1],C=t[U-16*2],G=t[U-16*2+1],V=E+K|0,z=S+O+Ie(V,E)|0;V=V+D|0,z=z+F+Ie(V,D)|0,V=V+G|0,z=z+C+Ie(V,G)|0,t[U]=z,t[U+1]=V}for(var ee=0;ee<160;ee+=2){z=t[ee],V=t[ee+1];var ve=na(r,n,i),ze=na(d,p,v),tt=ia(r,d),qe=ia(d,r),Bt=sa(o,k),pe=sa(k,o),Ee=ta[ee],We=ta[ee+1],Pt=ra(o,a,u),yt=ra(k,I,B),A=R+pe|0,T=h+Bt+Ie(A,R)|0;A=A+yt|0,T=T+Pt+Ie(A,yt)|0,A=A+We|0,T=T+Ee+Ie(A,We)|0,A=A+V|0,T=T+z+Ie(A,V)|0;var H=qe+ze|0,q=tt+ve+Ie(H,qe)|0;h=u,R=B,u=a,B=I,a=o,I=k,k=y+A|0,o=s+T+Ie(k,y)|0,s=i,y=v,i=n,v=p,n=r,p=d,d=A+H|0,r=T+q+Ie(d,A)|0}this._al=this._al+d|0,this._bl=this._bl+p|0,this._cl=this._cl+v|0,this._dl=this._dl+y|0,this._el=this._el+k|0,this._fl=this._fl+I|0,this._gl=this._gl+B|0,this._hl=this._hl+R|0,this._ah=this._ah+r+Ie(this._al,d)|0,this._bh=this._bh+n+Ie(this._bl,p)|0,this._ch=this._ch+i+Ie(this._cl,v)|0,this._dh=this._dh+s+Ie(this._dl,y)|0,this._eh=this._eh+o+Ie(this._el,k)|0,this._fh=this._fh+a+Ie(this._fl,I)|0,this._gh=this._gh+u+Ie(this._gl,B)|0,this._hh=this._hh+h+Ie(this._hl,R)|0};An.prototype._hash=function(){var e=Jd.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Rc=An,n0=Re,i0=Rc,s0=Dr,o0=Ve.Buffer,a0=new Array(160);function Ai(){this.init(),this._w=a0,s0.call(this,128,112)}n0(Ai,i0);Ai.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ai.prototype._hash=function(){var e=o0.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var c0=Ai,yr=Tc.exports=function(t){t=t.toLowerCase();var r=yr[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};yr.sha=Sd;yr.sha1=Cd;yr.sha224=Yd;yr.sha256=Pc;yr.sha384=c0;yr.sha512=Rc;var f0=Tc.exports,ht=Ve.Buffer,Cc=Ys.Transform,u0=ti.StringDecoder,l0=Re;function it(e){Cc.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}l0(it,Cc);var h0=typeof Uint8Array<"u",d0=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(ht.prototype instanceof Uint8Array||ht.TYPED_ARRAY_SUPPORT);function p0(e,t){if(e instanceof ht)return e;if(typeof e=="string")return ht.from(e,t);if(d0&&ArrayBuffer.isView(e)){if(e.byteLength===0)return ht.alloc(0);var r=ht.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}if(h0&&e instanceof Uint8Array||ht.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return ht.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}it.prototype.update=function(e,t,r){var n=p0(e,t),i=this._update(n);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)};it.prototype.setAutoPadding=function(){};it.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};it.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};it.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};it.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){n=i}finally{r(n)}};it.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};it.prototype._finalOrDigest=function(e){var t=this.__final()||ht.alloc(0);return e&&(t=this._toString(t,e,!0)),t};it.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new u0(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var y0=it,m0=Re,b0=ud,w0=md,g0=f0,Uc=y0;function ki(e){Uc.call(this,"digest"),this._hash=e}m0(ki,Uc);ki.prototype._update=function(e){this._hash.update(e)};ki.prototype._final=function(){return this._hash.digest()};var _0=function(t){return t=t.toLowerCase(),t==="md5"?new b0:t==="rmd160"||t==="ripemd160"?new w0:new ki(g0(t))},Fn=Ve.Buffer;function v0(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var o=e.length,a=e.charAt(0),u=Math.log(o)/Math.log(256),h=Math.log(256)/Math.log(o);function d(y){if((Array.isArray(y)||y instanceof Uint8Array)&&(y=Fn.from(y)),!Fn.isBuffer(y))throw new TypeError("Expected Buffer");if(y.length===0)return"";for(var k=0,I=0,B=0,R=y.length;B!==R&&y[B]===0;)B++,k++;for(var U=(R-B)*h+1>>>0,x=new Uint8Array(U);B!==R;){for(var g=y[B],S=0,E=U-1;(g!==0||S<I)&&E!==-1;E--,S++)g+=256*x[E]>>>0,x[E]=g%o>>>0,g=g/o>>>0;if(g!==0)throw new Error("Non-zero carry");I=S,B++}for(var F=U-I;F!==U&&x[F]===0;)F++;for(var D=a.repeat(k);F<U;++F)D+=e.charAt(x[F]);return D}function p(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return Fn.alloc(0);for(var k=0,I=0,B=0;y[k]===a;)I++,k++;for(var R=(y.length-k)*u+1>>>0,U=new Uint8Array(R);k<y.length;){var x=y.charCodeAt(k);if(x>255)return;var g=t[x];if(g===255)return;for(var S=0,E=R-1;(g!==0||S<B)&&E!==-1;E--,S++)g+=o*U[E]>>>0,U[E]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");B=S,k++}for(var F=R-B;F!==R&&U[F]===0;)F++;var D=Fn.allocUnsafe(I+(R-F));D.fill(0,0,I);for(var O=I;F!==R;)D[O++]=U[F++];return D}function v(y){var k=p(y);if(k)return k;throw new Error("Non-base"+o+" character")}return{encode:d,decodeUnsafe:p,decode:v}}var E0=v0,x0=E0,S0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",T0=x0(S0),os=T0,A0=Ve.Buffer,k0=function(e){function t(s){var o=e(s);return os.encode(A0.concat([s,o],s.length+4))}function r(s){var o=s.slice(0,-4),a=s.slice(-4),u=e(o);if(!(a[0]^u[0]|a[1]^u[1]|a[2]^u[2]|a[3]^u[3]))return o}function n(s){var o=os.decodeUnsafe(s);if(o)return r(o)}function i(s){var o=os.decode(s),a=r(o);if(!a)throw new Error("Invalid checksum");return a}return{encode:t,decode:i,decodeUnsafe:n}},oa=_0,I0=k0;function B0(e){var t=oa("sha256").update(e).digest();return oa("sha256").update(t).digest()}var P0=I0(B0),xs=P0;function Lc(e,t){if(t!==void 0&&e[0]!==t)throw new Error("Invalid network version");if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw new Error("Invalid WIF length");if(e[33]!==1)throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function Ss(e,t,r){var n=new Buffer(r?34:33);return n.writeUInt8(e,0),t.copy(n,1),r&&(n[33]=1),n}function O0(e,t){return Lc(xs.decode(e),t)}function R0(e,t,r){return typeof e=="number"?xs.encode(Ss(e,t,r)):xs.encode(Ss(e.version,e.privateKey,e.compressed))}var C0={decode:O0,decodeRaw:Lc,encode:R0,encodeRaw:Ss},Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.testEcc=void 0;const W=e=>Buffer.from(e,"hex");function U0(e){ue(e.isPoint(W("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),ue(!e.isPoint(W("030000000000000000000000000000000000000000000000000000000000000005"))),ue(e.isPrivate(W("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),ue(e.isPrivate(W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),ue(!e.isPrivate(W("0000000000000000000000000000000000000000000000000000000000000000"))),ue(!e.isPrivate(W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),ue(!e.isPrivate(W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),ue(Buffer.from(e.privateAdd(W("0000000000000000000000000000000000000000000000000000000000000001"),W("0000000000000000000000000000000000000000000000000000000000000000"))).equals(W("0000000000000000000000000000000000000000000000000000000000000001"))),ue(e.privateAdd(W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),W("0000000000000000000000000000000000000000000000000000000000000003"))===null),ue(Buffer.from(e.privateAdd(W("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),W("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(W("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),ue(Buffer.from(e.privateNegate(W("0000000000000000000000000000000000000000000000000000000000000001"))).equals(W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),ue(Buffer.from(e.privateNegate(W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(W("0000000000000000000000000000000000000000000000000000000000000003"))),ue(Buffer.from(e.privateNegate(W("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(W("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),ue(Buffer.from(e.pointCompress(W("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(W("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),ue(Buffer.from(e.pointCompress(W("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(W("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),ue(Buffer.from(e.pointCompress(W("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(W("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),ue(Buffer.from(e.pointCompress(W("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(W("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),ue(Buffer.from(e.pointFromScalar(W("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(W("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),ue(e.xOnlyPointAddTweak(W("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))===null);let t=e.xOnlyPointAddTweak(W("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),W("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));ue(Buffer.from(t.xOnlyPubkey).equals(W("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&t.parity===1),t=e.xOnlyPointAddTweak(W("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),W("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),ue(Buffer.from(t.xOnlyPubkey).equals(W("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&t.parity===0),ue(Buffer.from(e.sign(W("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),W("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(W("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),ue(e.verify(W("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),W("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),W("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),e.signSchnorr&&ue(Buffer.from(e.signSchnorr(W("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),W("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),W("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(W("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),e.verifySchnorr&&ue(e.verifySchnorr(W("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),W("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),W("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}Ii.testEcc=U0;function ue(e){if(!e)throw new Error("ecc library invalid")}Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ECPairFactory=Nr.networks=void 0;const Ts=Hr;Nr.networks=Ts;const je=ec,L0=rh,aa=C0,N0=Ii,as=je.typeforce.maybe(je.typeforce.compile({compressed:je.maybe(je.Boolean),network:je.maybe(je.Network)})),H0=e=>e.length===32?e:e.slice(1,33);function F0(e){(0,N0.testEcc)(e);function t(a){return e.isPoint(a)}function r(a,u){if(je.typeforce(je.Buffer256bit,a),!e.isPrivate(a))throw new TypeError("Private key not in range [1, n)");return je.typeforce(as,u),new o(a,void 0,u)}function n(a,u){return je.typeforce(e.isPoint,a),je.typeforce(as,u),new o(void 0,a,u)}function i(a,u){const h=aa.decode(a),d=h.version;if(je.Array(u)){if(u=u.filter(p=>d===p.wif).pop(),!u)throw new Error("Unknown network version")}else if(u=u||Ts.bitcoin,d!==u.wif)throw new Error("Invalid network version");return r(h.privateKey,{compressed:h.compressed,network:u})}function s(a){je.typeforce(as,a),a===void 0&&(a={});const u=a.rng||L0;let h;do h=u(32),je.typeforce(je.Buffer256bit,h);while(!e.isPrivate(h));return r(h,a)}class o{constructor(u,h,d){wr(this,"__D");wr(this,"__Q");wr(this,"compressed");wr(this,"network");wr(this,"lowR");this.__D=u,this.__Q=h,this.lowR=!1,d===void 0&&(d={}),this.compressed=d.compressed===void 0?!0:d.compressed,this.network=d.network||Ts.bitcoin,h!==void 0&&(this.__Q=Buffer.from(e.pointCompress(h,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const u=e.pointFromScalar(this.__D,this.compressed);this.__Q=Buffer.from(u)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return aa.encode(this.network.wif,this.__D,this.compressed)}tweak(u){return this.privateKey?this.tweakFromPrivateKey(u):this.tweakFromPublicKey(u)}sign(u,h){if(!this.__D)throw new Error("Missing private key");if(h===void 0&&(h=this.lowR),h===!1)return Buffer.from(e.sign(u,this.__D));{let d=e.sign(u,this.__D);const p=Buffer.alloc(32,0);let v=0;for(;d[0]>127;)v++,p.writeUIntLE(v,0,6),d=e.sign(u,this.__D,p);return Buffer.from(d)}}signSchnorr(u){if(!this.privateKey)throw new Error("Missing private key");if(!e.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return Buffer.from(e.signSchnorr(u,this.privateKey))}verify(u,h){return e.verify(u,this.publicKey,h)}verifySchnorr(u,h){if(!e.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return e.verifySchnorr(u,this.publicKey.subarray(1,33),h)}tweakFromPublicKey(u){const h=H0(this.publicKey),d=e.xOnlyPointAddTweak(h,u);if(!d||d.xOnlyPubkey===null)throw new Error("Cannot tweak public key!");const p=Buffer.from([d.parity===0?2:3]);return n(Buffer.concat([p,d.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(u){const d=this.publicKey[0]===3||this.publicKey[0]===4&&(this.publicKey[64]&1)===1?e.privateNegate(this.privateKey):this.privateKey,p=e.privateAdd(d,u);if(!p)throw new Error("Invalid tweaked private key!");return r(Buffer.from(p),{network:this.network,compressed:this.compressed})}}return{isPoint:t,fromPrivateKey:r,fromPublicKey:n,fromWIF:i,makeRandom:s}}Nr.ECPairFactory=F0;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.networks=e.ECPairFactory=e.default=void 0;var t=Nr;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.ECPairFactory}}),Object.defineProperty(e,"ECPairFactory",{enumerable:!0,get:function(){return t.ECPairFactory}}),Object.defineProperty(e,"networks",{enumerable:!0,get:function(){return t.networks}})})(Za);const M0=Lf(Za);class wn extends $.EventBroker{get isInitialized(){return!!this.digestKey}constructor(t,r){super(),this.digestKey=t,this.walletClient=r}static fromDigestKey(t){return new wn(tr(t))}static fromWalletClient(t){return new wn(void 0,t)}async initialize(){if(this.digestKey)return re("Already initialized");const t=await this.deriveDigestKeyFromWalletClient();return t.error?M(t.error):(this.emit("initialized",!0),re("Initialized"))}async deriveDigestKeyFromWalletClient(){if(!this.walletClient)return M("No walletClient found");if(!this.walletClient.account)return M("No account found");try{const t=await this.walletClient.signTypedData({account:this.walletClient.account,types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"}],Data:[{name:"Message",type:"string"},{name:"Version",type:"string"},{name:"Nonce",type:"uint256"}]},domain:{name:"GARDEN FINANCE",version:"1"},primaryType:"Data",message:{Message:"Initialize your account",Version:"1.0.2",Nonce:1n}});return this.digestKey=tr(nt.sha256(t)),this.emit("initialized",!0),re(this.digestKey)}catch(t){return M("Failed to initialize: "+t)}}async getDigestKey(){if(!this.digestKey&&!this.walletClient)return M("No private key or wallet client found");if(!this.digestKey&&this.walletClient){const t=await this.deriveDigestKeyFromWalletClient();if(t.error)return M(t.error)}return this.digestKey?re(this.digestKey):M("No private key found")}async generateSecret(t){const r=await this.signMessage(t);if(r.error)return M(r.error);const n=nt.sha256($.with0x(r.val)),i=nt.sha256(n);return re({secret:n,secretHash:i})}async signMessage(t){if(!this.digestKey){const h=await this.getDigestKey();if(h.error)return M(h.error);this.digestKey=h.val}const r=M0(ir),n="Garden.fi"+t.toString(),i=Buffer.from(n,"utf8"),s=nt.sha256(i),o=Buffer.from(tr(this.digestKey),"hex");if(o.length!==32)return M("Invalid private key length. Expected 32 bytes.");const u=r.fromPrivateKey(o).sign(Buffer.from(tr(s),"hex"));return re(u.toString("hex"))}}const ca=[{inputs:[{internalType:"address",name:"token_",type:"address"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"orderID",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"secretHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Initiated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"orderID",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"secretHash",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"secret",type:"bytes"}],name:"Redeemed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"orderID",type:"bytes32"}],name:"Refunded",type:"event"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"redeemer",type:"address"},{internalType:"uint256",name:"timelock",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"secretHash",type:"bytes32"}],name:"initiate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"redeemer",type:"address"},{internalType:"uint256",name:"timelock",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"secretHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"initiateWithSignature",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"orderID",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"instantRefund",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"redeemer",type:"address"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes32",name:"secretHash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct HTLC.InitWithSig[]",name:"inits",type:"tuple[]"},{components:[{internalType:"bytes32",name:"orderID",type:"bytes32"},{internalType:"bytes",name:"secret",type:"bytes"}],internalType:"struct HTLC.Redeem[]",name:"redeems",type:"tuple[]"},{components:[{internalType:"bytes32",name:"orderID",type:"bytes32"}],internalType:"struct HTLC.Refund[]",name:"refunds",type:"tuple[]"}],name:"multicall",outputs:[{internalType:"bool[]",name:"results",type:"bool[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"orders",outputs:[{internalType:"bool",name:"isFulfilled",type:"bool"},{internalType:"address",name:"initiator",type:"address"},{internalType:"address",name:"redeemer",type:"address"},{internalType:"uint256",name:"initiatedAt",type:"uint256"},{internalType:"uint256",name:"timelock",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderID",type:"bytes32"},{internalType:"bytes",name:"secret",type:"bytes"}],name:"redeem",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"orderID",type:"bytes32"}],name:"refund",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"}];function pt(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Nc="2.26.3";let rn={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${Nc}`};class de extends Error{constructor(t,r={}){var a;const n=(()=>{var u;return r.cause instanceof de?r.cause.details:(u=r.cause)!=null&&u.message?r.cause.message:r.details})(),i=r.cause instanceof de&&r.cause.docsPath||r.docsPath,s=(a=rn.getDocsUrl)==null?void 0:a.call(rn,{...r,docsPath:i}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...rn.version?[`Version: ${rn.version}`]:[]].join(`
package/dist/index.js CHANGED
@@ -6281,7 +6281,7 @@ const Mn = {
6281
6281
  quote: "https://api.garden.finance/quote",
6282
6282
  info: "https://api.garden.finance/info",
6283
6283
  evmRelay: "https://api.garden.finance/relayer",
6284
- starknetRelay: ""
6284
+ starknetRelay: "https://starknet-relay.garden.finance/"
6285
6285
  },
6286
6286
  testnet: {
6287
6287
  orderbook: "https://testnet.api.garden.finance",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/core",
3
- "version": "2.1.3-beta.28",
3
+ "version": "2.1.3-beta.29",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",