@ckb-ccc/core 1.20.0 → 1.20.1
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/CHANGELOG.md +10 -0
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.mjs +1 -1
- package/dist/{advancedBarrel-CZxkR1dk.d.mts → advancedBarrel-Di0YBlWc.d.mts} +8 -4
- package/dist/{advancedBarrel-CZxkR1dk.d.mts.map → advancedBarrel-Di0YBlWc.d.mts.map} +1 -1
- package/dist/advancedBarrel.d.mts +1 -1
- package/dist/advancedBarrel.mjs +1 -1
- package/dist/{barrel-CqiwnGqc.mjs → barrel-G6e8gZrB.mjs} +3 -3
- package/dist/{barrel-CqiwnGqc.mjs.map → barrel-G6e8gZrB.mjs.map} +1 -1
- package/dist/barrel.d.mts +1 -1
- package/dist/barrel.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{transformers-BJyj6caX.mjs → transformers-DxPrDQko.mjs} +2 -2
- package/dist/{transformers-BJyj6caX.mjs.map → transformers-DxPrDQko.mjs.map} +1 -1
- package/dist.commonjs/advanced.d.ts +1 -1
- package/dist.commonjs/advanced.js +1 -1
- package/dist.commonjs/{advancedBarrel-Czsr2VlG.d.ts → advancedBarrel-B57gAzdK.d.ts} +8 -4
- package/dist.commonjs/{advancedBarrel-Czsr2VlG.d.ts.map → advancedBarrel-B57gAzdK.d.ts.map} +1 -1
- package/dist.commonjs/advancedBarrel.d.ts +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -1
- package/dist.commonjs/{barrel-BCS94_-c.js → barrel-BOCFtFjq.js} +3 -3
- package/dist.commonjs/{barrel-BCS94_-c.js.map → barrel-BOCFtFjq.js.map} +1 -1
- package/dist.commonjs/barrel.d.ts +1 -1
- package/dist.commonjs/barrel.js +1 -1
- package/dist.commonjs/index.d.ts +1 -1
- package/dist.commonjs/index.js +1 -1
- package/dist.commonjs/{transformers-Cue1Z8Up.js → transformers-0FqvcPy2.js} +2 -2
- package/dist.commonjs/{transformers-Cue1Z8Up.js.map → transformers-0FqvcPy2.js.map} +1 -1
- package/package.json +1 -1
- package/src/ckb/transaction.ts +2 -0
- package/src/signer/jsonRpc/signer.ts +61 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-Chgba0Kb.js");let t=require("bech32"),n=require("isomorphic-ws");n=e.n(n);const r=Object.prototype.toString;function i(e,t,n){return e?e.constructor===t||r.call(e)===n:!1}function a(e){return i(e,Uint8Array,`[object Uint8Array]`)}function o(e){return i(e,ArrayBuffer,`[object ArrayBuffer]`)}function s(e){return a(e)||o(e)}function c(e){if(!a(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function l(e){if(!s(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}const u={utf8:new globalThis.TextDecoder(`utf8`)};function d(e,t=`utf8`){return l(e),u[t]??=new globalThis.TextDecoder(t),u[t].decode(e)}function f(e){if(typeof e!=`string`)throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}const p=new globalThis.TextEncoder;function m(e){return f(e),p.encode(e)}function h(e){return e.replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function ee(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=(4-t.length%4)%4;return t+`=`.repeat(n)}const g=65535;function _(e,{urlSafe:t=!1}={}){c(e);let n=``;for(let t=0;t<e.length;t+=g){let r=e.subarray(t,t+g);n+=globalThis.btoa(String.fromCodePoint.apply(void 0,r))}return t?h(n):n}function te(e){return f(e),Uint8Array.from(globalThis.atob(ee(e)),e=>e.codePointAt(0))}const ne=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function v(e){c(e);let t=``;for(let n=0;n<e.length;n++)t+=ne[e[n]];return t}const y={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function re(e){if(f(e),e.length%2!=0)throw Error(`Invalid Hex string length.`);let t=e.length/2,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=y[e[r*2]],i=y[e[r*2+1]];if(t===void 0||i===void 0)throw Error(`Invalid Hex character encountered at position ${r*2}`);n[r]=t<<4|i}return n}const ie=Uint8Array;function b(e,...t){return t.reduce((t,n)=>{let r=x(n);for(let t of r)e.push(t);return t},e)}function ae(...e){return new Uint8Array(b([],...e))}function oe(e,t){let n=x(e);switch(t){case`utf8`:return d(n);case`base64`:return _(n);case`base64url`:return _(n,{urlSafe:!0});case`hex`:return v(n)}}function x(e,t){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e==`string`){if(t!==void 0&&t!==`hex`)return se(e,t);let n=e.startsWith(`0x`)?e.slice(2):e;return re(n.length%2==0?n:`0${n}`)}if(Array.from(e).some(e=>e<0||255<e))throw Error(`Invalid bytes ${JSON.stringify(e)}`);return new Uint8Array(e)}function se(e,t){switch(t){case`utf8`:return m(e);case`base64`:case`base64url`:return te(e)}}function ce(e,t){if(e===t)return!0;let n=x(e),r=x(t);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}var S=class e{constructor(e,t,n){this.encode=e,this.decode=t,this.byteLength=n}encodeOr(e,t){try{return this.encode(e)}catch{return t}}decodeOr(e,t,n){try{return this.decode(e,n)}catch{return t}}static from({encode:t,decode:n,byteLength:r}){return new e(e=>{let n=t(e);if(r!==void 0&&n.byteLength!==r)throw Error(`Codec.encode: expected byte length ${r}, got ${n.byteLength}`);return n},(e,t)=>{let i=x(e);if(r!==void 0&&i.byteLength!==r)throw Error(`Codec.decode: expected byte length ${r}, got ${i.byteLength}`);return n(e,t)},r)}map({inMap:t,outMap:n}){return new e(e=>this.encode(t?t(e):e),(e,t)=>n?n(this.decode(e,t)):this.decode(e,t),this.byteLength)}mapIn(e){return this.map({inMap:e})}mapOut(e){return this.map({outMap:e})}};function le(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}const ue=e=>e?`"${e}" `:``;function C(e,t=``){if(typeof e!=`number`)throw TypeError(ue(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(ue(t)+`expected integer >= 0, got `+e);return e}function de(e,t=``){if(typeof e!=`boolean`)throw TypeError(ue(t)+`expected boolean, got type=`+typeof e);return e}function w(e,t,n=``){if(le(e)&&(t===void 0||e.length===t))return e;t!==void 0&&C(t,`length`);let r=le(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=ue(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}function fe(e){return Uint8Array.from(w(e))}function pe(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(C(e.outputLen),C(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}const me=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},he=(e,t)=>{me(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function ge(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function _e(e,t){w(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function ve(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ye(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function be(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function xe(e,t){return e<<32-t|e>>>t}function Se(e,t){return e<<t|e>>>32-t>>>0}const Ce=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function we(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const T=Ce?e=>e:e=>we(e)>>>0;function Te(e){for(let t=0;t<e.length;t++)e[t]=we(e[t]);return e}const Ee=Ce?e=>e:Te,De=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Oe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ke(e){if(w(e),De)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Oe[e[n]];return t}function Ae(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function je(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(De)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Ae(e.charCodeAt(i)),a=Ae(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function Me(e){let t=globalThis;if(typeof t.scheduler?.yield==`function`){let n=t.scheduler.yield();return e&&n.catch(e),n}return new Promise(e=>t.setTimeout(e,0))}async function Ne(e,t,n,r){if(C(e,`iters`),C(t,`tick`),typeof n!=`function`)throw TypeError(`callback must be a function`);let i=Date.now();for(let a=0;a<e;a++){n(a);let e=Date.now()-i;e>=0&&e<t||(await Me(r),i=Date.now())}}function Pe(e){if(typeof e!=`string`)throw TypeError(`string expected`);let t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{ye(t)}}function Fe(e,t=``){return typeof e==`string`?Pe(e):w(e,void 0,t)}function Ie(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];w(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function Le(e,t,n=`opts`){return he(e,`defaults`),t!==void 0&&he(t,n),Object.assign(Object.create(null),e,t)}function Re(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=Le({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function ze(e=32){C(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Be=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),Ve=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),He=BigInt(2**32-1),Ue=BigInt(32);function We(e,t=!1){return t?{h:Number(e&He),l:Number(e>>Ue&He)}:{h:Number(e>>Ue&He)|0,l:Number(e&He)|0}}function Ge(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=We(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}const Ke=e=>e/2**32|0,qe=e=>e>>>0;function Je(e,t,n,r){let i=Ke(n),a=qe(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}const Ye=(e,t,n)=>e>>>n|t<<32-n,Xe=(e,t,n)=>e<<32-n|t>>>n,Ze=(e,t,n)=>e<<64-n|t>>>n-32,Qe=(e,t,n)=>e>>>n-32|t<<64-n,$e=(e,t)=>t,et=(e,t)=>e;function tt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const nt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),rt=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,E=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),D=new Uint32Array(32);function O(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=D[2*e],l=D[2*e+1],u=D[2*t],d=D[2*t+1],f=D[2*n],p=D[2*n+1],m=D[2*r],h=D[2*r+1],ee=nt(c,u,o);l=rt(ee,l,d,s),c=ee|0;let g=h^l,_=m^c;h=$e(g,_),m=et(g,_),{h:p,l:f}=tt(p,f,h,m),g=d^p,_=u^f,d=Ye(g,_,24),u=Xe(g,_,24),D[2*e]=c,D[2*e+1]=l,D[2*t]=u,D[2*t+1]=d,D[2*n]=f,D[2*n+1]=p,D[2*r]=m,D[2*r+1]=h}function k(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=D[2*e],l=D[2*e+1],u=D[2*t],d=D[2*t+1],f=D[2*n],p=D[2*n+1],m=D[2*r],h=D[2*r+1],ee=nt(c,u,o);l=rt(ee,l,d,s),c=ee|0;let g=h^l,_=m^c;h=Ye(g,_,16),m=Xe(g,_,16),{h:p,l:f}=tt(p,f,h,m),g=d^p,_=u^f,d=Ze(g,_,63),u=Qe(g,_,63),D[2*e]=c,D[2*e+1]=l,D[2*t]=u,D[2*t+1]=d,D[2*n]=f,D[2*n+1]=p,D[2*r]=m,D[2*r+1]=h}function it(e,t={},n,r,i){if(C(n),e<=0||e>n)throw Error(`"dkLen" must be 1..`+n+`, got `+e);let{key:a,salt:o,personalization:s}=t;if(a!==void 0&&(a.length<1||a.length>n))throw Error(`"key" expected to be undefined or of length=1..`+n);o!==void 0&&w(o,r,`salt`),s!==void 0&&w(s,i,`personalization`)}var at=class{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;canXOF=!1;constructor(e,t){C(e),C(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=ve(this.buffer)}update(e){ge(this),w(e);let{blockLen:t,buffer:n,buffer32:r}=this,i=e.length,a=e.byteOffset,o=e.buffer;for(let s=0;s<i;){this.pos===t&&(Ee(r),this.compress(r,0,!1),Ee(r),this.pos=0);let c=Math.min(t-this.pos,i-s),l=a+s;if(c===t&&!(l%4)&&s+c<i){let e=new Uint32Array(o,l,Math.floor((i-s)/4));Ee(e);for(let n=0;s+t<i;n+=r.length,s+=t)this.length+=t,this.compress(e,n,!1);Ee(e);continue}n.set(s===0&&c===i?e:e.subarray(s,s+c),this.pos),this.pos+=c,this.length+=c,s+=c}return this}digestInto(e){if(ge(this),_e(e,this),e.byteOffset&3)throw RangeError(`"output" expected 4-byte aligned byteOffset, got `+e.byteOffset);let{pos:t,buffer32:n}=this;this.finished=!0,this.buffer.fill(0,t),Ee(n),this.compress(n,0,!0),Ee(n);let r=this.get(),i=e===this.buffer?n:ve(e),a=Math.floor(this.outputLen/4);for(let e=0;e<a;e++)i[e]=T(r[e]);let o=this.outputLen%4;if(!o)return;let s=a*4,c=r[a];for(let t=0;t<o;t++)e[s+t]=c>>>8*t}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){let{buffer:t,length:n,finished:r,destroyed:i,outputLen:a,pos:o}=this;return e||=new this.constructor({dkLen:a}),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=r,e.length=n,e.pos=o,e.outputLen=a,e}clone(){return this._cloneInto()}},ot=class extends at{v0l=E[0]|0;v0h=E[1]|0;v1l=E[2]|0;v1h=E[3]|0;v2l=E[4]|0;v2h=E[5]|0;v3l=E[6]|0;v3h=E[7]|0;v4l=E[8]|0;v4h=E[9]|0;v5l=E[10]|0;v5h=E[11]|0;v6l=E[12]|0;v6h=E[13]|0;v7l=E[14]|0;v7h=E[15]|0;constructor(e={}){e=Le({},e);let t=e.dkLen===void 0?64:e.dkLen;super(128,t),it(t,e,64,16,16);let{key:n,personalization:r,salt:i}=e,a=0;if(n!==void 0&&(w(n,void 0,`key`),a=n.length),this.v0l^=this.outputLen|a<<8|16842752,i!==void 0){w(i,void 0,`salt`);let e=ve(fe(i));this.v4l^=T(e[0]),this.v4h^=T(e[1]),this.v5l^=T(e[2]),this.v5h^=T(e[3])}if(r!==void 0){w(r,void 0,`personalization`);let e=ve(fe(r));this.v6l^=T(e[0]),this.v6h^=T(e[1]),this.v7l^=T(e[2]),this.v7h^=T(e[3])}if(n!==void 0){let e=new Uint8Array(this.blockLen);e.set(n),this.update(e),ye(e)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:i,v2h:a,v3l:o,v3h:s,v4l:c,v4h:l,v5l:u,v5h:d,v6l:f,v6h:p,v7l:m,v7h:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.v0l=e|0,this.v0h=t|0,this.v1l=n|0,this.v1h=r|0,this.v2l=i|0,this.v2h=a|0,this.v3l=o|0,this.v3h=s|0,this.v4l=c|0,this.v4h=l|0,this.v5l=u|0,this.v5h=d|0,this.v6l=f|0,this.v6h=p|0,this.v7l=m|0,this.v7h=h|0}compress(e,t,n){let{v0l:r,v0h:i,v1l:a,v1h:o,v2l:s,v2h:c,v3l:l,v3h:u,v4l:d,v4h:f,v5l:p,v5h:m,v6l:h,v6h:ee,v7l:g,v7h:_}=this;D[0]=r,D[1]=i,D[2]=a,D[3]=o,D[4]=s,D[5]=c,D[6]=l,D[7]=u,D[8]=d,D[9]=f,D[10]=p,D[11]=m,D[12]=h,D[13]=ee,D[14]=g,D[15]=_,D.set(E,16);let te=qe(this.length),ne=Ke(this.length);D[24]=E[8]^te,D[25]=E[9]^ne,n&&(D[28]=~D[28],D[29]=~D[29]);let v=0,y=Ve;for(let n=0;n<12;n++)O(0,4,8,12,e,t+2*y[v++]),k(0,4,8,12,e,t+2*y[v++]),O(1,5,9,13,e,t+2*y[v++]),k(1,5,9,13,e,t+2*y[v++]),O(2,6,10,14,e,t+2*y[v++]),k(2,6,10,14,e,t+2*y[v++]),O(3,7,11,15,e,t+2*y[v++]),k(3,7,11,15,e,t+2*y[v++]),O(0,5,10,15,e,t+2*y[v++]),k(0,5,10,15,e,t+2*y[v++]),O(1,6,11,12,e,t+2*y[v++]),k(1,6,11,12,e,t+2*y[v++]),O(2,7,8,13,e,t+2*y[v++]),k(2,7,8,13,e,t+2*y[v++]),O(3,4,9,14,e,t+2*y[v++]),k(3,4,9,14,e,t+2*y[v++]);this.v0l^=D[0]^D[16],this.v0h^=D[1]^D[17],this.v1l^=D[2]^D[18],this.v1h^=D[3]^D[19],this.v2l^=D[4]^D[20],this.v2h^=D[5]^D[21],this.v3l^=D[6]^D[22],this.v3h^=D[7]^D[23],this.v4l^=D[8]^D[24],this.v4h^=D[9]^D[25],this.v5l^=D[10]^D[26],this.v5h^=D[11]^D[27],this.v6l^=D[12]^D[28],this.v6h^=D[13]^D[29],this.v7l^=D[14]^D[30],this.v7h^=D[15]^D[31],ye(D)}destroy(){this.destroyed=!0,ye(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const st=Re(e=>new ot(e));function ct(e){if(!(typeof e==`string`&&e.length%2==0&&e.startsWith(`0x`)))return!1;for(let t=2;t<e.length;t++){let n=e.charAt(t);if(!(`0`<=n&&n<=`9`||`a`<=n&&n<=`f`))return!1}return!0}function A(e){return ct(e)?e:`0x${oe(x(e),`hex`)}`}function lt(e){return ct(e)?ut(e):x(e).length}function ut(e){return Math.floor((e.length-1)/2)}const dt=x(`ckb-default-hash`,`utf8`);var ft=class{constructor(e=32,t=dt){this.hasher=st.create({personalization:t,dkLen:e})}update(e){return this.hasher.update(x(e)),this}digest(){return A(this.hasher.digest())}};function pt(...e){let t=new ft;return e.forEach(e=>t.update(e)),t.digest()}function mt(...e){return pt(...e).slice(0,42)}var j=class{static Base(){class e extends j{static encode(e){throw Error(`encode not implemented, use @ccc.codec to decorate your type`)}static decode(e){throw Error(`decode not implemented, use @ccc.codec to decorate your type`)}static fromBytes(e){throw Error(`fromBytes not implemented, use @ccc.codec to decorate your type`)}static from(e){throw Error(`from not implemented`)}toBytes(){return this.constructor.encode(this)}clone(){return this.constructor.fromBytes(this.toBytes())}eq(e){return this===e||ce(this.toBytes(),(this.constructor?.from(e)??e).toBytes())}hash(){return pt(this.toBytes())}toHex(){return A(this.toBytes())}}return e.encode=void 0,e.decode=void 0,e.fromBytes=void 0,e}static BaseUnion(){class e extends j.Base(){constructor(e){super(),this.inner=e}match(e){let t=e[this.inner.type];return t==null?e._(this.inner):t(this.inner.value)}}return e}};function M(e){return function(t,...n){return t.byteLength=e.byteLength,t.encode===void 0&&(t.encode=function(n){return e.encode(t.from(n))}),t.decode===void 0&&(t.decode=function(n){return t.from(e.decode(x(n)))}),t.fromBytes===void 0&&(t.fromBytes=function(n){return t.from(e.decode(x(n)))}),t}}function ht(e,t=8){let n=gt(e).toString();if(t===0)return n;let r=n.length<=t?`0`:n.slice(0,-t),i=n.slice(-t).padStart(t,`0`).replace(/0*$/,``);return i===``?r:`${r}.${i}`}function gt(e,t=8){if(typeof e==`bigint`)return e;let[n,r]=(typeof e==`number`?e.toFixed(t):e.toString()).split(`.`),i=BigInt(n.padEnd(n.length+t,`0`));return r===void 0?i:i+BigInt(r.slice(0,t).padEnd(t,`0`))}const N=0n,_t=gt(`1`);function vt(e,...t){let n=P(e);return t.forEach(e=>{let t=P(e);t<n&&(n=t)}),n}function yt(e,...t){let n=P(e);return t.forEach(e=>{let t=P(e);t>n&&(n=t)}),n}function P(e){if(typeof e==`bigint`)return e;if(e===`0x`)return BigInt(0);if(typeof e==`string`||typeof e==`number`)return BigInt(e);let t=A(e);return BigInt(t)}function F(e){let t=P(e);if(t<0n)throw Error(`value must be non-negative`);return`0x${t.toString(16)}`}function bt(e,t){return xt(e,t)}function xt(e,t){return St(e,t).reverse()}function St(e,t){let n=P(e);if(n<P(0)){if(t==null)throw Error(`negative number can not be serialized without knowing bytes length`);if(n=(P(1)<<P(8)*P(t))+n,n<0)throw Error(`negative number underflow`)}let r=x(n.toString(16));if(t==null)return r;if(r.length>t)throw Error(`number overflow`);return ae(`00`.repeat(t-r.length),r)}function Ct(e){return wt(e)}function wt(e){return Tt(x(e).map(e=>e).reverse())}function Tt(e){return P(x(e))}function I(e,t=!1){return S.from({byteLength:e,encode:n=>t?bt(n,e):St(n,e),decode:e=>t?Ct(e):Tt(e)})}function Et(e,t=!1){if(e>4)throw Error(`uintNumber: byteLength must be less than or equal to 4`);return I(e,t).map({outMap:e=>Number(e)})}function Dt(e){return S.from({byteLength:e,encode:()=>new Uint8Array(e),decode:()=>{}})}const Ot=S.from({encode:e=>x(e),decode:e=>x(e)}),kt=S.from({encode:e=>x(e),decode:e=>A(e)}),At=Et(1,!0),jt=Et(2,!0),Mt=Et(2),Nt=jt,Pt=Et(4,!0),Ft=Et(4),It=Pt,Lt=I(8,!0),Rt=I(8),zt=Lt,Bt=I(16,!0),Vt=I(16),Ht=Bt,Ut=I(32,!0),Wt=I(32),Gt=Ut,Kt=I(64,!0),qt=I(64),Jt=Kt,Yt=S.from({byteLength:1,encode:e=>x(e?[1]:[0]),decode:e=>x(e)[0]!==0}),Xt=S.from({byteLength:1,encode:e=>x(e),decode:e=>A(e)}),Zt=S.from({byteLength:4,encode:e=>x(e),decode:e=>A(e)}),Qt=S.from({byteLength:8,encode:e=>x(e),decode:e=>A(e)}),$t=S.from({byteLength:16,encode:e=>x(e),decode:e=>A(e)}),en=S.from({byteLength:32,encode:e=>x(e),decode:e=>A(e)});function L(e){return bt(e,4)}function R(e){return Number(Ct(e))}function z(e){return e instanceof Error?e.message:String(e)}function tn(e){let t=e.byteLength;if(t===void 0)throw Error(`fixedItemVec: itemCodec requires a byte length`);return S.from({encode(t){try{let n=[];b(n,L(t.length));for(let r of t)b(n,e.encode(r));return x(n)}catch(e){throw Error(`fixedItemVec - ${z(e)}`,{cause:e})}},decode(n,r){let i=x(n);if(i.byteLength<4)throw Error(`fixedItemVec: too short buffer, expected at least 4 bytes, but got ${i.byteLength}`);let a=4+R(i.subarray(0,4))*t;if(i.byteLength!==a)throw Error(`fixedItemVec: invalid buffer size, expected ${a}, but got ${i.byteLength}`);try{let n=[];for(let o=4;o<a;o+=t)n.push(e.decode(i.subarray(o,o+t),r));return n}catch(e){throw Error(`fixedItemVec - ${z(e)}`,{cause:e})}}})}function nn(e){return S.from({encode(t){try{let n=4+t.length*4,r=[],i=[];for(let a of t){let t=e.encode(a);b(r,L(n)),b(i,t),n+=t.byteLength}return ae(L(r.length+i.length+4),r,i)}catch(e){throw Error(`dynItemVec - ${z(e)}`,{cause:e})}},decode(t,n){let r=x(t);if(r.byteLength<4)throw Error(`dynItemVec: too short buffer, expected at least 4 bytes, but got ${r.byteLength}`);let i=R(r.subarray(0,4));if(i!==r.byteLength)throw Error(`dynItemVec: invalid buffer size, expected ${i}, but got ${r.byteLength}`);if(i===4)return[];let a=(R(r.subarray(4,8))-4)/4,o=Array.from(Array(a),(e,t)=>R(r.subarray(4+t*4,8+t*4)));o.push(i);try{let t=[];for(let i=0;i<o.length-1;i++){let a=o[i],s=o[i+1],c=r.subarray(a,s);t.push(e.decode(c,n))}return t}catch(e){throw Error(`dynItemVec - ${z(e)}`,{cause:e})}}})}function B(e){return e.byteLength===void 0?nn(e):tn(e)}function V(e){return S.from({encode(t){if(t==null)return x([]);try{return e.encode(t)}catch(e){throw Error(`option - ${z(e)}`,{cause:e})}},decode(t,n){if(x(t).byteLength!==0)try{return e.decode(t,n)}catch(e){throw Error(`option - ${z(e)}`,{cause:e})}}})}function rn(e){return S.from({encode(t){try{let n=x(e.encode(t));return ae(L(n.byteLength),n)}catch(e){throw Error(`byteVec - ${z(e)}`,{cause:e})}},decode(t,n){let r=x(t);if(r.byteLength<4)throw Error(`byteVec: too short buffer, expected at least 4 bytes, but got ${r.byteLength}`);let i=R(r.subarray(0,4));if(i!==r.byteLength-4)throw Error(`byteVec: invalid buffer size, expected ${i}, but got ${r.byteLength}`);try{return e.decode(r.subarray(4),n)}catch(e){throw Error(`byteVec - ${z(e)}`,{cause:e})}}})}function an(e){let t=Object.keys(e);return S.from({encode(n){let r=4+t.length*4,i=[],a=[];for(let o of t)try{let t=e[o].encode(n[o]);b(i,L(r)),b(a,t),r+=t.byteLength}catch(e){throw Error(`table.${o} - ${z(e)}`,{cause:e})}return ae(L(i.length+a.length+4),i,a)},decode(n,r){let i=x(n);if(i.byteLength<4)throw Error(`table: too short buffer, expected at least 4 bytes, but got ${i.byteLength}`);let a=R(i.subarray(0,4)),o=(R(i.subarray(4,8))-4)/4;if(a!==i.byteLength)throw Error(`table: invalid buffer size, expected ${a}, but got ${i.byteLength}`);if(o<t.length)throw Error(`table: invalid field count, expected ${t.length}, but got ${o}`);if(o>t.length&&!r?.isExtraFieldIgnored)throw Error(`table: invalid field count, expected ${t.length}, but got ${o}, and extra fields are not allowed in the current configuration. If you want to ignore extra fields, set isExtraFieldIgnored to true.`);let s=t.map((e,t)=>R(i.subarray(4+t*4,8+t*4)));o>t.length?s.push(R(i.subarray(4+t.length*4,8+t.length*4))):s.push(a);let c={};for(let n=0;n<s.length-1;n++){let a=s[n],o=s[n+1],l=t[n],u=e[l],d=i.subarray(a,o);try{Object.assign(c,{[l]:u.decode(d,r)})}catch(e){throw Error(`table.${l} - ${z(e)}`,{cause:e})}}return c}})}function on(e,t){let n=Object.entries(e),r;if(n.length>0){let e=n[0][1].byteLength;e!==void 0&&n.every(([,{byteLength:t}])=>t===e)&&(r=e+4)}function i(e){return`type`in e&&`value`in e?e:e.inner}return S.from({byteLength:r,encode(r){let{type:a,value:o}=i(r),s=a.toString(),c=e[s];if(!c)throw Error(`union: invalid type, expected ${n.map(e=>e[0]).toString()}, but got ${s}`);let l=t?t[s]??-1:n.findIndex(e=>e[0]===s);if(l<0)throw Error(`union: invalid field id ${l} of ${s}`);let u=L(l);try{return ae(u,c.encode(o))}catch(e){throw Error(`union.(${s}) - ${z(e)}`,{cause:e})}},decode(n,r){let i=x(n),a=R(i.subarray(0,4)),o=Object.keys(e),s=t?Object.entries(t).find(([,e])=>e===a)?.[0]:o[a];if(!s){if(!t)throw Error(`union: unknown union field index ${a}, only ${o.toString()} are allowed`);let e=Object.keys(t);throw Error(`union: unknown union field index ${a}, only ${e.toString()} and ${o.toString()} are allowed`)}return{type:s,value:e[s].decode(i.subarray(4),r)}}})}function sn(e){let t=Object.values(e),n=Object.keys(e);return S.from({byteLength:t.reduce((e,t)=>{if(t.byteLength===void 0)throw Error(`struct: all fields must be fixed-size`);return e+t.byteLength},0),encode(t){let r=[];for(let i of n)try{b(r,e[i].encode(t[i]))}catch(e){throw Error(`struct.${i} - ${z(e)}`,{cause:e})}return x(r)},decode(t,n){let r=x(t),i={},a=0;return Object.entries(e).forEach(([e,t])=>{let o=r.subarray(a,a+t.byteLength);try{Object.assign(i,{[e]:t.decode(o,n)})}catch(t){throw Error(`struct.${e} - ${z(t)}`,{cause:t})}a+=t.byteLength}),i}})}function cn(e,t){if(e.byteLength===void 0)throw Error(`array: itemCodec requires a byte length`);let n=e.byteLength*t;return S.from({byteLength:n,encode(t){try{let n=[];for(let r of t)b(n,e.encode(r));return x(n)}catch(e){throw Error(`array - ${z(e)}`,{cause:e})}},decode(t,r){let i=x(t);if(i.byteLength!=n)throw Error(`array: invalid buffer size, expected ${n}, but got ${i.byteLength}`);try{let t=[];for(let n=0;n<i.byteLength;n+=e.byteLength)t.push(e.decode(i.subarray(n,n+e.byteLength),r));return t}catch(e){throw Error(`array - ${z(e)}`,{cause:e})}}})}const ln=V(At),un=B(At),dn=V(Nt),fn=B(Nt),pn=V(It),mn=B(It),hn=V(zt),gn=B(zt),_n=V(Ht),vn=B(Ht),yn=V(Gt),bn=B(Gt),xn=V(Jt),Sn=B(Jt),Cn=rn(kt),wn=V(Cn),Tn=B(Cn),En=V(Yt),Dn=B(Yt),On=V(Xt),kn=B(Xt),An=V(Zt),jn=B(Zt),Mn=V(Qt),Nn=B(Qt),Pn=V($t),Fn=B($t),In=V(en),Ln=B(en),Rn=rn({encode:e=>x(e,`utf8`),decode:e=>oe(e,`utf8`)}),zn=B(Rn),Bn=V(Rn);var Vn=class{constructor(e,t){this.value=e,this.disposer=t}dispose(){return this.disposing??=Promise.resolve().then(()=>this.disposer(this.value)),this.disposing}};const Hn=Symbol.for(`@ckb-ccc/core.Owner`);var Un=class{constructor(){this[Hn]=!0}get isValid(){return this.disposing===void 0}static is(e){return typeof e==`object`&&!!e&&e[Hn]===!0}get value(){if(this.disposing)throw Error(`Cannot access a moved or disposed Owner`);return this.value_}dispose(){return this.disposing??=Promise.resolve().then(()=>this.release(this.value_)),this.disposing}map(e){return new Wn(e(this.value),this.move())}move(){if(this.disposing)throw Error(`Owner has already been moved or disposed`);return this.disposing=Promise.resolve(),new Vn(this.value_,e=>this.release(e))}static moveFrom(e){return e.move()}},Wn=class extends Un{constructor(e,t){super(),this.value_=e,this.source=t}release(){return this.source.dispose()}},Gn=class extends Un{constructor(e,t){super(),this.value_=e,this.disposer=t}release(e){return this.disposer(e)}};function H(e,t){if(t!=null)return e(t)}async function Kn(e,t,n){if(n===void 0){if(e.length===0)throw TypeError(`Reduce of empty array with no initial value`);n=e[0],e=e.slice(1)}return e.reduce((e,n,r,i)=>e.then(e=>Promise.resolve(t(e,n,r,i)).then(t=>t??e)),Promise.resolve(n))}function qn(e){return new Promise(t=>setTimeout(t,Number(P(e))))}function Jn(e){return/webview|wv|ip((?!.*Safari)|(?=.*like Safari))/i.test(e)}function Yn(e){return JSON.stringify(e,(e,t)=>typeof t==`bigint`?F(t):t)}function Xn(e,t){for(e=P(e),t=P(t),e=e<0n?-e:e,t=t<0n?-t:t;t!==N;)[e,t]=[t,e%t];return e}function U(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var W;let G=W=class extends j.Base(){constructor(e,t,n){super(),this.integer=e,this.numerator=t,this.denominator=n}normalizeBase(){return this.denominator===0n?W.from([this.integer,N,P(1)]):this.denominator<0n?W.from([this.integer,-this.numerator,-this.denominator]):this}normalizeCanonical(){let{integer:e,numerator:t,denominator:n}=this.normalizeBase();if(t<0n){let r=(-t+n-1n)/n;e-=r,t+=n*r}let r=Xn(t,n);return t/=r,n/=r,e+=t/n,t%=n,W.from([e,t,n])}get 0(){return this.integer}get 1(){return this.numerator}get 2(){return this.denominator}toNum(){if(this.integer<0n||this.numerator<0n||this.denominator<0n)throw Error(`Negative values in Epoch to Num conversion`);if(this.integer>=P(`0x1000000`)||this.numerator>=P(`0x10000`)||this.denominator>=P(`0x10000`))throw Error(`Integer must be < 2^24, numerator and denominator must be < 2^16`);return this.integer+(this.numerator<<P(24))+(this.denominator<<P(40))}toPackedHex(){return F(this.toNum())}static fromNum(e){let t=P(e);return new W(t&P(`0xffffff`),t>>P(24)&P(`0xffff`),t>>P(40)&P(`0xffff`))}static from(e){return e instanceof W?e:Array.isArray(e)?new W(P(e[0]),P(e[1]),P(e[2])):typeof e==`object`?new W(P(e.integer),P(e.numerator),P(e.denominator)):W.fromNum(e)}clone(){return W.from([this.integer,this.numerator,this.denominator])}static get Genesis(){return W.from([N,N,N])}static get OneNervosDaoCycle(){return W.from([P(180),N,P(1)])}compare(e){if(this===e)return 0;let t=this.normalizeBase(),n=W.from(e).normalizeBase(),r=(t.integer*t.denominator+t.numerator)*n.denominator,i=(n.integer*n.denominator+n.numerator)*t.denominator;return r>i?1:r<i?-1:0}lt(e){return this.compare(e)<0}le(e){return this.compare(e)<=0}eq(e){return this.compare(e)===0}ge(e){return this.compare(e)>=0}gt(e){return this.compare(e)>0}add(e){let t=this.normalizeBase(),n=W.from(e).normalizeBase(),r=t.integer+n.integer,i,a;return t.denominator===n.denominator?(i=t.numerator+n.numerator,a=t.denominator):(i=t.numerator*n.denominator+n.numerator*t.denominator,a=t.denominator*n.denominator),W.from([r,i,a]).normalizeCanonical()}sub(e){let{integer:t,numerator:n,denominator:r}=W.from(e);return this.add(W.from([-t,-n,r]))}toUnix(e,t=P(144e5)){let{integer:n,numerator:r,denominator:i}=this.sub(e.epoch);return e.timestamp+t*n+t*r/i}};G=W=U([M(sn({padding:Dt(1),denominator:I(2),numerator:I(2),integer:I(3)}))],G);function Zn(e){return G.from(e)}function Qn(e){return G.fromNum(e)}function $n(e){return G.from(e).toPackedHex()}const er=P(1e7),tr=P(1e3);function nr([e,t]){return[P(e),P(t)]}var rr=class e{constructor(e,t){this.cellDep=e,this.type=t}static from(t){return t instanceof e?t:new e(Q.from(t.cellDep),H(K.from,t.type))}},ir=class e{constructor(e,t,n){this.codeHash=e,this.hashType=t,this.cellDeps=n}static from(t){return t instanceof e?t:new e(A(t.codeHash),Tr(t.hashType),t.cellDeps.map(e=>rr.from(e)))}},ar=class e{constructor(e,t,n,r,i,a,o){this.transaction=e,this.status=t,this.cycles=n,this.blockHash=r,this.blockNumber=i,this.txIndex=a,this.reason=o}static from(t){return t instanceof e?t:new e($.from(t.transaction),t.status,H(P,t.cycles),H(A,t.blockHash),H(P,t.blockNumber),H(P,t.txIndex),t.reason)}clone(){return new e(this.transaction.clone(),this.status,this.cycles,this.blockHash,this.blockNumber,this.txIndex,this.reason)}},or=class e{constructor(e,t,n,r,i,a,o){this.script=e,this.scriptLenRange=t,this.outputData=n,this.outputDataSearchMode=r,this.outputDataLenRange=i,this.outputCapacityRange=a,this.blockRange=o}static from(t){return t instanceof e?t:new e(H(K.from,t.script),H(nr,t.scriptLenRange),H(A,t.outputData),t.outputDataSearchMode??void 0,H(nr,t.outputDataLenRange),H(nr,t.outputCapacityRange),H(nr,t.blockRange))}},sr=class e{constructor(e,t,n,r,i){this.script=e,this.scriptType=t,this.scriptSearchMode=n,this.filter=r,this.withData=i}static from(t){return t instanceof e?t:new e(K.from(t.script),t.scriptType,t.scriptSearchMode,H(or.from,t.filter),t.withData??void 0)}},cr=class e{constructor(e,t,n,r,i){this.script=e,this.scriptType=t,this.scriptSearchMode=n,this.filter=r,this.groupByTransaction=i}static from(t){return t instanceof e?t:new e(K.from(t.script),t.scriptType,t.scriptSearchMode,H(or.from,t.filter),t.groupByTransaction??void 0)}},lr=class e{constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.compactTarget=e,this.dao=t,this.epoch=n,this.extraHash=r,this.hash=i,this.nonce=a,this.number=o,this.parentHash=s,this.proposalsHash=c,this.timestamp=l,this.transactionsRoot=u,this.version=d}static from(t){return t instanceof e?t:new e(P(t.compactTarget),{c:P(t.dao.c),ar:P(t.dao.ar),s:P(t.dao.s),u:P(t.dao.u)},G.from(t.epoch),A(t.extraHash),A(t.hash),P(t.nonce),P(t.number),A(t.parentHash),A(t.proposalsHash),P(t.timestamp),A(t.transactionsRoot),P(t.version))}},ur=class e{constructor(e,t){this.header=e,this.proposals=t}static from(t){return t instanceof e?t:new e(lr.from(t.header),t.proposals.map(A))}},dr=class e{constructor(e,t,n,r){this.header=e,this.proposals=t,this.transactions=n,this.uncles=r}static from(t){return t instanceof e?t:new e(lr.from(t.header),t.proposals.map(A),t.transactions.map($.from),t.uncles.map(ur.from))}},fr=class extends Error{constructor(e){super(`Client request error ${e.message}`),this.code=e.code,this.data=e.data}},pr=class extends fr{constructor(e,t){super(e),this.outPoint=J.from(t)}},mr=class extends fr{constructor(e,t,n,r,i,a){super(e),this.source=t,this.errorCode=r,this.scriptHashType=i,this.sourceIndex=P(n),this.scriptCodeHash=A(a)}},hr=class extends fr{constructor(e,t){super(e),this.txHash=A(t)}},gr=class extends fr{constructor(e,t,n){super(e),this.currentFee=P(t),this.leastFee=P(n)}},_r=class extends fr{constructor(e){let t=P(e).toString();super({message:`Wait transaction timeout ${t}ms`,data:JSON.stringify({timeout:t})})}},vr=class extends fr{constructor(e,t){let n=P(e).toString(),r=P(t).toString();super({message:`Max fee rate exceeded limit ${n}, actual ${r}. Developer might forgot to complete transaction fee before sending. See https://api.ckbccc.com/classes/_ckb_ccc_core.index.ccc.Transaction.html#completeFeeBy.`,data:JSON.stringify({limit:n,actual:r})})}};let yr=function(e){return e.NervosDao=`NervosDao`,e.Secp256k1Blake160=`Secp256k1Blake160`,e.Secp256k1Multisig=`Secp256k1Multisig`,e.Secp256k1MultisigV2Beta=`Secp256k1MultisigV2Beta`,e.Secp256k1MultisigV2=`Secp256k1MultisigV2`,e.AnyoneCanPay=`AnyoneCanPay`,e.TypeId=`TypeId`,e.SUdt=`SUdt`,e.XUdt=`XUdt`,e.JoyId=`JoyId`,e.COTA=`COTA`,e.PWLock=`PWLock`,e.OmniLock=`OmniLock`,e.NostrLock=`NostrLock`,e.UniqueType=`UniqueType`,e.DidCkb=`DidCkb`,e.AlwaysSuccess=`AlwaysSuccess`,e.InputTypeProxyLock=`InputTypeProxyLock`,e.OutputTypeProxyLock=`OutputTypeProxyLock`,e.LockProxyLock=`LockProxyLock`,e.SingleUseLock=`SingleUseLock`,e.TypeBurnLock=`TypeBurnLock`,e.EasyToDiscoverType=`EasyToDiscoverType`,e.TimeLock=`TimeLock`,e}({});const br={type:1,data:0,data1:2,data2:4},xr={1:`type`,0:`data`,2:`data1`,4:`data2`},Sr=Object.keys(br);var Cr;const wr=S.from({byteLength:1,encode:Er,decode:Dr});function Tr(e){let t=(()=>{if(typeof e==`number`)return xr[e];if(typeof e==`bigint`)return xr[Number(e)];if(Sr.includes(e))return e})();if(t===void 0)throw Error(`Invalid hash type ${e}`);return t}function Er(e){return x([br[Tr(e)]])}function Dr(e){return xr[x(e)[0]]}let K=Cr=class extends j.Base(){constructor(e,t,n){super(),this.codeHash=e,this.hashType=t,this.args=n}get occupiedSize(){return 33+x(this.args).length}clone(){return Cr.from({codeHash:this.codeHash,hashType:this.hashType,args:this.args})}eq(e){return e=Cr.from(e),this.args===e.args&&this.codeHash===e.codeHash&&this.hashType===e.hashType}static from(e){return e instanceof Cr?e:new Cr(A(e.codeHash),Tr(e.hashType),A(e.args))}static async fromKnownScript(e,t,n){let r=await e.getKnownScript(t);return Cr.from({codeHash:r.codeHash,hashType:r.hashType,args:A(n)})}};K=Cr=U([M(an({codeHash:en,hashType:wr,args:Cn}))],K);const Or=V(K),kr=B(K),Ar={code:0,depGroup:1},jr={0:`code`,1:`depGroup`},Mr=Object.keys(Ar);var Nr=class extends Error{constructor(e,t){let n=P(e),r=t?.isForChange??!1;super(`Insufficient CKB, need ${ht(n)} extra CKB${r?` for the change cell`:``}`),this.amount=n,this.isForChange=r}},Pr=class extends Error{constructor(e,t){let n=P(e),r=K.from(t);super(`Insufficient coin, need ${n} extra coin`),this.amount=n,this.type=r}},Fr,Ir,Lr,Rr,zr,Br,q;const Vr=2n**32n-2n;function Hr(e){try{let t=P(e);return t<0n||t>Vr?void 0:Number(t)}catch{return}}function Ur(e){let t=Hr(e);if(t===void 0)throw Error(`Index ${e} must be a valid array index between 0 and ${Vr}`);return t}const Wr=S.from({byteLength:1,encode:Kr,decode:qr});function Gr(e){let t=typeof e==`number`?jr[e]:typeof e==`bigint`?jr[Number(e)]:e;if(t===void 0)throw Error(`Invalid dep type ${e}`);return t}function Kr(e){return x([Ar[Gr(e)]])}function qr(e){return jr[x(e)[0]]}let J=Fr=class extends j.Base(){constructor(e,t){super(),this.txHash=e,this.index=t}static from(e){return e instanceof Fr?e:new Fr(A(e.txHash),P(e.index))}clone(){return Fr.from({txHash:this.txHash,index:this.index})}eq(e){return e=Fr.from(e),this.txHash===e.txHash&&this.index===e.index}};J=Fr=U([M(sn({txHash:en,index:It}))],J);let Y=Ir=class extends j.Base(){constructor(e,t,n){super(),this.capacity=e,this.lock=t,this.type=n}get occupiedSize(){return 8+this.lock.occupiedSize+(this.type?.occupiedSize??0)}static from(e,t){let n=e instanceof Ir?e:new Ir(P(e.capacity??0),K.from(e.lock),H(K.from,e.type));return t!=null&&(n.capacity=yt(n.capacity,gt(n.occupiedSize+x(t).length))),n}clone(){return Ir.from({capacity:this.capacity,lock:this.lock.clone(),type:this.type?.clone()})}};Y=Ir=U([M(an({capacity:zt,lock:K,type:Or}))],Y);const Jr=B(Y);var X=class e{constructor(e,t,n){this.cellOutput=e,this.outputData=t,this.outPoint=n}static from(t){if(t instanceof e)return t.cellOutput=Y.from(t.cellOutput,t.outputData),t;let n=A(t.outputData??`0x`);return new e(Y.from(t.cellOutput,n),n,H(J.from,t.outPoint??t.previousOutput))}get occupiedSize(){return this.cellOutput.occupiedSize+x(this.outputData).byteLength}get capacityFree(){return this.cellOutput.capacity-gt(this.occupiedSize)}async isNervosDao(e,t){let{type:n}=this.cellOutput,r=await e.getKnownScript(`NervosDao`);if(!n||n.codeHash!==r.codeHash||n.hashType!==r.hashType)return!1;let i=P(this.outputData)!==N;return!t||t===`deposited`&&!i||t===`withdrew`&&i}clone(){return e.from({cellOutput:this.cellOutput.clone(),outputData:this.outputData,outPoint:this.outPoint?.clone()})}},Yr=class e extends X{constructor(e,t,n){super(t,n,e),this.outPoint=e}static from(t){return t instanceof e?(t.cellOutput=Y.from(t.cellOutput,t.outputData),t):new e(J.from(t.outPoint??t.previousOutput),Y.from(t.cellOutput,t.outputData),A(t.outputData??`0x`))}async getDaoProfit(e){if(!await this.isNervosDao(e,`withdrew`))return N;let{depositHeader:t,withdrawHeader:n}=await this.getNervosDaoInfo(e);if(!n||!t)throw Error(`Unable to get headers of a Nervos DAO cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return ri(this.capacityFree,t,n)}async getNervosDaoInfo(e){if(!await this.isNervosDao(e))return{};if(P(this.outputData)===0n){let t=await e.getCellWithHeader(this.outPoint);if(!t?.header)throw Error(`Unable to get header of a Nervos DAO deposited cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return{depositHeader:t.header}}let[t,n]=await Promise.all([e.getHeaderByNumber(Ct(this.outputData)),e.getCellWithHeader(this.outPoint)]);if(!n?.header||!t)throw Error(`Unable to get headers of a Nervos DAO withdrew cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return{depositHeader:t,withdrawHeader:n.header}}clone(){return e.from({outPoint:this.outPoint.clone(),cellOutput:this.cellOutput.clone(),outputData:this.outputData})}};let Xr=Lr=class extends j.Base(){constructor(e,t,n){super(),this.relative=e,this.metric=t,this.value=n}clone(){return Lr.from({relative:this.relative,metric:this.metric,value:this.value})}static from(e){return e instanceof Lr?e:typeof e==`object`&&`relative`in e?new Lr(e.relative,e.metric,P(e.value)):Lr.fromNum(e)}toNum(){return this.value|(this.relative===`absolute`?N:P(`0x8000000000000000`))|{blockNumber:P(`0x0000000000000000`),epoch:P(`0x2000000000000000`),timestamp:P(`0x4000000000000000`)}[this.metric]}static fromNum(e){let t=P(e),n=t>>P(63)===0n?`absolute`:`relative`,r=[`blockNumber`,`epoch`,`timestamp`][Number(t>>P(61)&P(3))],i=t&P(`0x00ffffffffffffff`);return new Lr(n,r,i)}};Xr=Lr=U([M(zt.mapIn(e=>Xr.from(e).toNum()))],Xr);let Z=Rr=class extends j.Base(){constructor(e,t,n,r){super(),this.previousOutput=e,this.since=t,this.cellOutput=n,this.outputData=r}static from(e){return e instanceof Rr?e:new Rr(J.from(`previousOutput`in e?e.previousOutput:e.outPoint),Xr.from(e.since??0).toNum(),H(Y.from,e.cellOutput),H(A,e.outputData))}async getCell(e){if(await this.completeExtraInfos(e),!this.cellOutput||!this.outputData)throw Error(`Unable to complete input`);return Yr.from({outPoint:this.previousOutput,cellOutput:this.cellOutput,outputData:this.outputData})}async completeExtraInfos(e){if(this.cellOutput&&this.outputData)return;let t=await e.getCell(this.previousOutput);t&&(this.cellOutput=t.cellOutput,this.outputData=t.outputData)}async getExtraCapacity(e){return(await this.getCell(e)).getDaoProfit(e)}clone(){return Rr.from({previousOutput:this.previousOutput.clone(),since:this.since,cellOutput:this.cellOutput?.clone(),outputData:this.outputData})}};Z=Rr=U([M(sn({since:Xr,previousOutput:J}).mapIn(e=>Z.from(e)))],Z);const Zr=B(Z);let Q=zr=class extends j.Base(){constructor(e,t){super(),this.outPoint=e,this.depType=t}static from(e){return e instanceof zr?e:new zr(J.from(e.outPoint),Gr(e.depType))}clone(){return zr.from({outPoint:this.outPoint.clone(),depType:this.depType})}};Q=zr=U([M(sn({outPoint:J,depType:Wr}))],Q);const Qr=B(Q);let $r=Br=class extends j.Base(){constructor(e,t,n){super(),this.lock=e,this.inputType=t,this.outputType=n}static from(e){return e instanceof Br?e:new Br(H(A,e.lock),H(A,e.inputType),H(A,e.outputType))}};$r=Br=U([M(an({lock:wn,inputType:wn,outputType:wn}))],$r);function ei(e){let t=x(e).subarray(0,16);return t.length===0?N:Ct(t)}const ti=an({version:It,cellDeps:Qr,headerDeps:Ln,inputs:Zr,outputs:Jr,outputsData:Tn});let $=q=class extends j.Base(){constructor(e,t,n,r,i,a,o){super(),this.version=e,this.cellDeps=t,this.headerDeps=n,this.inputs=r,this.outputs=i,this.outputsData=a,this.witnesses=o}static default(){return q.from({})}copy(e){if(e===this)return;let t=q.from(e);this.version=t.version,this.cellDeps=t.cellDeps,this.headerDeps=t.headerDeps,this.inputs=t.inputs,this.outputs=t.outputs,this.outputsData=t.outputsData,this.witnesses=t.witnesses}clone(){return q.from({version:this.version,cellDeps:this.cellDeps.map(e=>e.clone()),headerDeps:this.headerDeps.map(e=>e),inputs:this.inputs.map(e=>e.clone()),outputs:this.outputs.map(e=>e.clone()),outputsData:this.outputsData.map(e=>e),witnesses:this.witnesses.map(e=>e)})}static from(e){if(e instanceof q)return e.outputs.forEach((t,n)=>{e.outputs[n]=Y.from(t,e.outputsData[n]??`0x`)}),e;let t=e.outputs?.map((t,n)=>Y.from(t,e.outputsData?.[n]??[]))??[],n=t.map((t,n)=>A(e.outputsData?.[n]??`0x`));return e.outputsData!=null&&n.length<e.outputsData.length&&n.push(...e.outputsData.slice(n.length).map(e=>A(e))),new q(P(e.version??0),e.cellDeps?.map(e=>Q.from(e))??[],e.headerDeps?.map(A)??[],e.inputs?.map(e=>Z.from(e))??[],t,n,e.witnesses?.map(A)??[])}static fromLumosSkeleton(e){return q.from({version:0n,cellDeps:e.cellDeps.toArray(),headerDeps:e.headerDeps.toArray(),inputs:e.inputs.toArray().map((t,n)=>{if(!t.outPoint)throw Error(`outPoint is required in input`);return Z.from({previousOutput:t.outPoint,since:e.inputSinces.get(n,`0x0`),cellOutput:t.cellOutput,outputData:t.data})}),outputs:e.outputs.toArray().map(e=>e.cellOutput),outputsData:e.outputs.toArray().map(e=>e.data),witnesses:e.witnesses.toArray()})}stringify(){return JSON.stringify(this,(e,t)=>typeof t==`bigint`?F(t):t)}rawToBytes(){return ti.encode(this)}hash(){return pt(this.rawToBytes())}hashFull(){return pt(this.toBytes())}static hashWitnessToHasher(e,t){let n=x(A(e));t.update(bt(n.length,8)),t.update(n)}async getSignHashInfo(e,t,n=new ft){let r=K.from(e),i=-1;n.update(this.hash());for(let e=0;e<this.witnesses.length;e+=1){let a=this.inputs[e];if(a){let{cellOutput:n}=await a.getCell(t);if(!r.eq(n.lock))continue;i===-1&&(i=e)}if(i===-1)return;q.hashWitnessToHasher(this.witnesses[e],n)}if(i!==-1)return{message:n.digest(),position:i}}async findInputIndexByLockId(e,t){let n=K.from({...e,args:`0x`});for(let e=0;e<this.inputs.length;e+=1){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.codeHash===r.lock.codeHash&&n.hashType===r.lock.hashType)return e}}async findInputIndexByLock(e,t){let n=K.from(e);for(let e=0;e<this.inputs.length;e+=1){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.eq(r.lock))return e}}async findLastInputIndexByLock(e,t){let n=K.from(e);for(let e=this.inputs.length-1;e>=0;--e){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.eq(r.lock))return e}}addCellDeps(...e){e.flat().forEach(e=>{let t=Q.from(e);this.cellDeps.some(e=>e.eq(t))||this.cellDeps.push(t)})}addCellDepsAtStart(...e){e.flat().forEach(e=>{let t=Q.from(e);this.cellDeps.some(e=>e.eq(t))||this.cellDeps.unshift(t)})}async addCellDepInfos(e,...t){this.addCellDeps(await e.getCellDeps(...t))}async addCellDepsOfKnownScripts(e,...t){await Promise.all(t.flat().map(async t=>this.addCellDepInfos(e,(await e.getKnownScript(t)).cellDeps)))}setOutputDataAt(e,t){this.setOutputData(e,t)}setOutputData(e,t){let n=Ur(e);if(n>=this.outputs.length)throw Error(`Index ${e} is out of bounds for outputs of length ${this.outputs.length}`);this.outputsData.length<n&&this.outputsData.push(...Array.from(Array(n-this.outputsData.length),()=>`0x`));let r=A(t);this.outputs[n]=Y.from(this.outputs[n],r),this.outputsData[n]=r}getOutputData(e){let t=Hr(e);return t!==void 0&&t<this.outputs.length?this.outputsData[t]??`0x`:void 0}getInput(e){let t=Hr(e);return t===void 0?void 0:this.inputs[t]}addInput(e){return this.witnesses.length>this.inputs.length&&this.witnesses.splice(this.inputs.length,0,`0x`),this.inputs.push(Z.from(e))}getOutput(e){let t=Hr(e);if(!(t===void 0||t>=this.outputs.length))return X.from({cellOutput:this.outputs[t],outputData:this.outputsData[t]??`0x`})}get outputCells(){let{outputs:e,outputsData:t}=this;function*n(){for(let n=0;n<e.length;n++)yield X.from({cellOutput:e[n],outputData:t[n]??`0x`})}return n()}addOutput(e,t){let n=`cellOutput`in e?X.from(e):X.from({cellOutput:e,outputData:t}),r=this.outputs.push(n.cellOutput);return this.setOutputData(r-1,n.outputData),r}setOutput(e,t,n){let r=Ur(e);if(r>this.outputs.length)throw Error(`Index ${e} is out of bounds for outputs of length ${this.outputs.length}`);let i=`cellOutput`in t?X.from(t):X.from({cellOutput:t,outputData:n});r===this.outputs.length?this.addOutput(i):(this.outputs[r]=i.cellOutput,this.setOutputData(r,i.outputData))}setInput(e,t){let n=Ur(e);if(n>this.inputs.length)throw Error(`Index ${e} is out of bounds for inputs of length ${this.inputs.length}`);n===this.inputs.length?this.addInput(t):this.inputs[n]=Z.from(t)}getWitness(e){let t=Hr(e);return t===void 0?void 0:this.witnesses[t]}getWitnessArgs(e){try{return this.getWitnessArgsUnsafe(e)}catch{return}}getWitnessArgsUnsafe(e){let t=this.getWitness(e);return t&&t!==`0x`?$r.fromBytes(t):void 0}setWitnessArgs(e,t){this.setWitness(e,$r.from(t).toBytes())}setWitness(e,t){let n=Ur(e);this.witnesses.length<n&&this.witnesses.push(...Array.from(Array(n-this.witnesses.length),()=>`0x`)),this.witnesses[n]=A(t)}getWitnessArgsAt(e){return this.getWitnessArgs(e)}getWitnessArgsAtUnsafe(e){return this.getWitnessArgsUnsafe(e)}setWitnessArgsAt(e,t){this.setWitnessArgs(e,t)}setWitnessAt(e,t){this.setWitness(e,t)}async prepareSighashAllWitness(e,t,n){let r=await this.findInputIndexByLock(e,n);if(r===void 0)return;let i=this.getWitnessArgs(r)??$r.from({});i.lock=A(Array.from(Array(t),()=>0)),this.setWitnessArgs(r,i)}async getInputsCapacityExtra(e){return Kn(this.inputs,async(t,n)=>t+await n.getExtraCapacity(e),N)}async getInputsCapacity(e){return await Kn(this.inputs,async(t,n)=>{let{cellOutput:{capacity:r}}=await n.getCell(e);return t+r},N)+await this.getInputsCapacityExtra(e)}getOutputsCapacity(){return this.outputs.reduce((e,{capacity:t})=>e+t,N)}async getInputsUdtBalance(e,t){return Kn(this.inputs,async(n,r)=>{let{cellOutput:i,outputData:a}=await r.getCell(e);if(i.type?.eq(t))return n+ei(a)},N)}getOutputsUdtBalance(e){return this.outputs.reduce((t,n,r)=>n.type?.eq(e)?t+ei(this.outputsData[r]):t,N)}async completeInputs(e,t,n,r){let i=[],a=r,o=!1;for await(let r of e.findCells(t,!0)){if(this.inputs.some(({previousOutput:e})=>e.eq(r.outPoint)))continue;let e=i.push(r),t=await Promise.resolve(n(a,r,e-1,i));if(t===void 0){o=!0;break}a=t}return i.forEach(e=>this.addInput(e)),o?{addedCount:i.length}:{addedCount:i.length,accumulated:a}}async completeInputsByCapacity(e,t,n){let r=this.getOutputsCapacity()+P(t??0),i=await this.getInputsCapacity(e.client);if(i>=r)return 0;let{addedCount:a,accumulated:o}=await this.completeInputs(e,n??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},(e,{cellOutput:{capacity:t}})=>{let n=e+t;return n>=r?void 0:n},i);if(o===void 0)return a;throw new Nr(r-o)}async completeInputsAll(e,t){let{addedCount:n}=await this.completeInputs(e,t??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},(e,{cellOutput:{capacity:t}})=>e+t,N);return n}async completeInputsByUdt(e,t,n){let r=this.getOutputsUdtBalance(t)+P(n??0);if(r===0n)return 0;let[i,a]=await Kn(this.inputs,async([n,r],i)=>{let{cellOutput:a,outputData:o}=await i.getCell(e.client);if(a.type?.eq(t))return[n+ei(o),r+1]},[N,0]);if(i===r||i>=r&&a>=2)return 0;let{addedCount:o,accumulated:s}=await this.completeInputs(e,{script:t,outputDataLenRange:[16,P(`0xffffffff`)]},(e,{outputData:t},n,i)=>{let o=e+ei(t);return o===r||o>=r&&a+i.length>=2?void 0:o},i);if(s===void 0||s>=r)return o;throw new Pr(r-s,t)}async completeInputsAddOne(e,t){let{addedCount:n,accumulated:r}=await this.completeInputs(e,t??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},()=>void 0,!0);if(r===void 0)return n;throw Error(`Insufficient CKB, need at least one new cell`)}async completeInputsAtLeastOne(e,t){return this.inputs.length>0?0:this.completeInputsAddOne(e,t)}async getFee(e){return await this.getInputsCapacity(e)-this.getOutputsCapacity()}async getFeeRate(e){return await this.getFee(e)*P(1e3)/P(this.toBytes().length+4)}estimateFee(e){return(P(this.toBytes().length+4)*P(e)+P(999))/P(1e3)}async completeFee(e,t,n,r,i){let a=n??await e.client.getFeeRate(i?.feeRateBlockRange,i);await this.getInputsCapacity(e.client);let o=N,s=N,c=0,l=this;for(;;){c+=await(async()=>{if(!(i?.shouldAddInputs??!0))return 0;try{return await l.completeInputsByCapacity(e,o+s,r)}catch(e){throw e instanceof Nr&&s!==0n?new Nr(e.amount,{isForChange:!0}):e}})(),l=await e.prepareTransaction(l);let n=await l.getFee(e.client);if(n<o+s)throw new Nr(o+s-n,{isForChange:s!==N});if(o===0n&&(o=l.estimateFee(a)),n===o)return this.copy(l),[c,!1];let u=l.clone(),d=P(await Promise.resolve(t(u,n-o)));if(d>0n){s=d;continue}if(await u.getFee(e.client)!==o)throw Error(`The change function doesn't use all available capacity`);u=await e.prepareTransaction(u);let f=u.estimateFee(a);if(o>f)throw Error(`The change function removed existed transaction data`);if(o===f)return this.copy(u),[c,!0];o=f}}completeFeeChangeToLock(e,t,n,r,i){let a=K.from(t);return this.completeFee(e,(e,t)=>{let n=Y.from({capacity:0,lock:a}),r=gt(n.occupiedSize);return t<r?r:(n.capacity=t,e.addOutput(n),0)},n,r,i)}async completeFeeBy(e,t,n,r){let{script:i}=await e.getRecommendedAddressObj();return this.completeFeeChangeToLock(e,i,t,n,r)}completeFeeChangeToOutput(e,t,n,r,i){let a=Number(P(t));if(!this.outputs[a])throw Error(`Non-existed output to change`);return this.completeFee(e,(e,t)=>(e.outputs[a].capacity+=t,0),n,r,i)}};$=q=U([M(an({raw:ti,witnesses:Tn}).mapIn(e=>{let t=$.from(e);return{raw:t,witnesses:t.witnesses}}).mapOut(e=>$.from({...e.raw,witnesses:e.witnesses})))],$);async function ni(e,t){if(e.outputs.length<=64)return!1;let{codeHash:n,hashType:r}=await t.getKnownScript(`NervosDao`),i=K.from({codeHash:n,hashType:r,args:`0x`});if(e.outputs.some(e=>e.type?.eq(i)))return!0;for(let n of e.inputs)if(await n.completeExtraInfos(t),n.cellOutput?.type?.eq(i))return!0;return!1}function ri(e,t,n){let r=lr.from(t),i=lr.from(n),a=P(e);return a*i.dao.ar/r.dao.ar-a}function ii(e,t){let n=lr.from(e).epoch.normalizeBase(),r=lr.from(t).epoch.normalizeBase(),i=P(180),a=(r.integer-n.integer)%i,o=r.integer;return(a!==0n||n.numerator*r.denominator<r.numerator*n.denominator)&&(o+=-a+i),G.from([o,n.numerator,n.denominator])}const ai=P(5e5);function oi(e,t,n){if(!t)return!0;let r=A(e),i=A(t);return!(n===`exact`&&r!==i||n===`prefix`&&!r.startsWith(i)||n===`partial`&&r.search(i)===-1)}function si(e,t,n){if(!t)return!0;if(!e)return!1;let r=K.from(e),i=K.from(t);return r.codeHash!==i.codeHash||r.hashType!==i.hashType?!1:oi(r.args,i?.args,n)}function ci(e,t){if(!t)return!0;let n=P(e),[r,i]=nr(t);return r<=n&&n<i}function li(e,t){return!t||ci(e?x(K.from(e).args).length+33:0,t)}function ui(e,t){let n=sr.from(e),r=Yr.from(t);return!(n.scriptType===`lock`&&(!si(r.cellOutput.lock,n.script,n.scriptSearchMode)||!si(r.cellOutput.type,n.filter?.script,`prefix`)||!li(r.cellOutput.type,n.filter?.scriptLenRange))||n.scriptType===`type`&&(!si(r.cellOutput.type,n.script,n.scriptSearchMode)||!si(r.cellOutput.lock,n.filter?.script,`prefix`)||!li(r.cellOutput.lock,n.filter?.scriptLenRange))||!oi(r.outputData,n.filter?.outputData,n.filter?.outputDataSearchMode??`prefix`)||!ci(x(r.outputData).length,n.filter?.outputDataLenRange)||!ci(r.cellOutput.capacity,n.filter?.outputCapacityRange))}var di=class extends Map{constructor(e){if(super(),this.capacity=e,this.lru=new Set,!Number.isInteger(e)||e<1)throw Error(`Capacity must be a positive integer`)}get(e){if(super.has(e))return this.lru.delete(e),this.lru.add(e),super.get(e)}set(e,t){if(super.set(e,t),this.lru.delete(e),this.lru.add(e),this.lru.size>this.capacity){let e=this.lru.keys().next().value;this.delete(e)}return this}delete(e){return super.delete(e)?(this.lru.delete(e),!0):!1}clear(){super.clear(),this.lru.clear()}};const fi=Object.freeze({NervosDao:{codeHash:`0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c`,index:2},depType:`code`}}]},Secp256k1Blake160:{codeHash:`0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}}]},Secp256k1Multisig:{codeHash:`0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:1},depType:`depGroup`}}]},Secp256k1MultisigV2Beta:{codeHash:`0xd1a9f877aed3f5e07cb9c52b61ab96d06f250ae6883cc7f0a2423db0976fc821`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x44be4f4feda80c0e41783ab10e191df3b2bb5c3731b0970c916dbec385dcdc60`,index:0},depType:`depGroup`}}]},Secp256k1MultisigV2:{codeHash:`0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738`,index:0},depType:`depGroup`}}]},AnyoneCanPay:{codeHash:`0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x4153a2014952d7cac45f285ce9a7c5c0c0e1b21f2d378b82ac1433cb11c25c4d`,index:0},depType:`depGroup`}}]},TypeId:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,cellDeps:[]},SUdt:{codeHash:`0x5e7a36a77e68eecc013dfa2fe6a23f3b6c344b04005808694ae6dd45eea4cfd5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xc7813f6a415144643970c2e88e0bb6ca6a8edc5dd7c1022746f628284a9936d5`,index:0},depType:`code`}}]},XUdt:{codeHash:`0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xc07844ce21b38e4b071dd0e1ee3b0e27afd8d7532491327f39b786343f558ab7`,index:0},depType:`code`}}]},JoyId:{codeHash:`0xd00c84f0ec8fd441c38bc3f87a371f547190f2fcff88e642bc5bf54b9e318323`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x2d1f2d4d1514ccc3bb4f04f5437a5ae30d00636ee57cedd2c70ab3ea75b62adc`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xc086090432098835ec542a1b94bdd1b842c5aa1ccd1616873fe77f4a04044417`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:2},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x165b225c6fbed7e655b024384d9083de3243375f9893706f4452858ecd694e96`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:3},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xafb8408d0094ab944e6286aac750b9bb854ac0bcb66dfe5c60559744a700e70c`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:4},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x773bf0647be24b4e18ef44068fd069b9de5549c4b86be227779ceb9179598ec4`}}]},COTA:{codeHash:`0x1122a4fb54697cf2e6e3a96c9d80fd398a936559b90954c6e88eb7ba0cf652df`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xabaa25237554f0d6c586dc010e7e85e6870bcfd9fb8773257ecacfbe1fd738a0`,index:0},depType:`depGroup`}}]},PWLock:{codeHash:`0xbf43c3602455798c1a61a596e0d95278864c552fafe231c063b3fabf97a8febc`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0x1d60cb8f4666e039f418ea94730b1a8c5aa0bf2f7781474406387462924d15d4`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x42ade2f25eb938b5dbfd3d8f07b8b07aa593d848e7ff14bdfbbea5aeb6175261`}}]},OmniLock:{codeHash:`0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0xc76edf469816aa22f416503c38d0b533d2a018e253e379f134c3985b3472c842`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x855508fe0f0ca25b935b070452ecaee48f6c9f1d66cd15f046616b99e948236a`}}]},NostrLock:{codeHash:`0x641a89ad2f77721b803cd50d01351c1f308444072d5fa20088567196c0574c68`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x99b116dd1e4f1fa903b70112ae672c18bb34241d3d03a9ad555cd2a611be7327`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xfad8cb75eb0bb01718e2336002064568bc05887af107f74ed5dd501829e192f8`}}]},UniqueType:{codeHash:`0x2c8c11c985da60b0a330c61a85507416d6382c130ba67f0c47ab071e00aec628`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x67524c01c0cb5492e499c7c7e406f2f9d823e162d6b0cf432eacde0c9808c2ad`,index:0},depType:`code`}}]},DidCkb:{codeHash:`0x4a06164dc34dccade5afe3e847a97b6db743e79f5477fa3295acf02849c5984a`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe2f74c56cdc610d2b9fe898a96a80118845f5278605d7f9ad535dad69ae015bf`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,args:`0x55573ef6d78e3ca75170ff476176732309a8b31efe94320a954ded3d75c2cb18`,hashType:`type`}}]},AlwaysSuccess:{codeHash:`0x3b521cc4b552f109d092d8cc468a8048acb53c5952dbe769d2b2f9cf6e47f7f1`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:0},depType:`code`}}]},InputTypeProxyLock:{codeHash:`0x5123908965c711b0ffd8aec642f1ede329649bda1ebdca6bd24124d3796f768a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:1},depType:`code`}}]},OutputTypeProxyLock:{codeHash:`0x2df53b592db3ae3685b7787adcfef0332a611edb83ca3feca435809964c3aff2`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:2},depType:`code`}}]},LockProxyLock:{codeHash:`0x5d41e32e224c15f152b7e6529100ebeac83b162f5f692a5365774dad2c1a1d02`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:3},depType:`code`}}]},SingleUseLock:{codeHash:`0x8290467a512e5b9a6b816469b0edabba1f4ac474e28ffdd604c2a7c76446bbaf`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:4},depType:`code`}}]},TypeBurnLock:{codeHash:`0xff78bae0abf17d7a404c0be0f9ad9c9185b3f88dcc60403453d5ba8e1f22f53a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:5},depType:`code`}}]},EasyToDiscoverType:{codeHash:`0xaba4430cc7110d699007095430a1faa72973edf2322ddbfd4d1d219cacf237af`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb0ed754fb27d67fd8388c97fed914fb7998eceaa01f3e6f967e498de1ba0ac9b`,index:0},depType:`code`}}]},TimeLock:{codeHash:`0x6fac4b2e89360a1e692efcddcb3a28656d8446549fb83da6d896db8b714f4451`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb0ed754fb27d67fd8388c97fed914fb7998eceaa01f3e6f967e498de1ba0ac9b`,index:1},depType:`code`}}]}});var pi=class{constructor(e,t=3e4){this.url=e,this.timeout=t}async request(e){let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{return await(await fetch(this.url,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:t.signal})).json()}finally{clearTimeout(n)}}},mi=class e{constructor(e,t=3e4){this.url=e,this.timeout=t,this.ongoing=new Map,this.disposed=!1}static open(t,n=3e4){return new Gn(new e(t,n),e=>e.dispose())}request(e){if(this.disposed)return Promise.reject(Error(`Cannot use a disposed JsonRpcTransportWebSocket`));let[t,r]=(()=>{if(this.socket&&this.socket.readyState!==this.socket.CLOSING&&this.socket.readyState!==this.socket.CLOSED&&this.openSocket)return[this.socket,this.openSocket];let e=new n.default(this.url),t=({data:e})=>{let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t||typeof t.id!=`number`&&typeof t.id!=`string`)return;let n=t.id,r=this.ongoing.get(n);if(!r)return;let[i,a,o]=r;clearTimeout(o),this.ongoing.delete(n),i(t)},r=()=>{this.ongoing.forEach(([e,t,n])=>{clearTimeout(n),t(Error(`Connection closed`))}),this.ongoing.clear()};return e.onclose=r,e.onerror=r,e.onmessage=t,this.socket=e,this.openSocket=new Promise(t=>{e.readyState===e.OPEN?t(e):e.onopen=()=>{t(e)}}),[e,this.openSocket]})();return new Promise((n,i)=>{let a=[n,i,setTimeout(()=>{this.ongoing.delete(e.id),t.close(),i(Error(`Request timeout`))},this.timeout)];this.ongoing.set(e.id,a),r.then(t=>{this.ongoing.has(e.id)&&(t.readyState===t.CLOSED||t.readyState===t.CLOSING?(clearTimeout(a[2]),this.ongoing.delete(e.id),i(Error(`Connection closed`))):t.send(JSON.stringify(e)))}).catch(t=>{clearTimeout(a[2]),this.ongoing.delete(e.id),i(t)})})}async dispose(){this.disposed=!0;let e=this.socket;e&&e.readyState!==e.CLOSED&&await new Promise(t=>{e.addEventListener(`close`,()=>t(),{once:!0}),e.close()})}};function hi(e,t){return e.startsWith(`wss://`)||e.startsWith(`ws://`)?mi.open(e,t?.timeout):new Gn(new pi(e,t?.timeout),()=>{})}var gi=class e{static hashTypeFrom(e){return Tr(e)}static hashTypeTo(e){return e}static depTypeFrom(e){switch(Gr(e)){case`code`:return`code`;case`depGroup`:return`dep_group`}}static depTypeTo(e){switch(e){case`code`:return`code`;case`dep_group`:return`depGroup`}}static scriptFrom(t){let n=K.from(t);return{code_hash:n.codeHash,hash_type:e.hashTypeFrom(n.hashType),args:n.args}}static scriptTo(t){return K.from({codeHash:t.code_hash,hashType:e.hashTypeTo(t.hash_type),args:t.args})}static outPointFrom(e){let t=J.from(e);return{index:F(t.index),tx_hash:t.txHash}}static outPointTo(e){return J.from({index:e.index,txHash:e.tx_hash})}static cellInputFrom(t){let n=Z.from(t);return{previous_output:e.outPointFrom(n.previousOutput),since:F(n.since)}}static cellInputTo(t){return Z.from({previousOutput:e.outPointTo(t.previous_output),since:t.since})}static cellOutputFrom(t,n){let r=Y.from(t,n);return{capacity:F(r.capacity),lock:e.scriptFrom(r.lock),type:H(e.scriptFrom,r.type)}}static cellOutputTo(t){return Y.from({capacity:t.capacity,lock:e.scriptTo(t.lock),type:H(e.scriptTo,t.type)})}static cellDepFrom(t){return{out_point:e.outPointFrom(t.outPoint),dep_type:e.depTypeFrom(t.depType)}}static cellDepTo(t){return Q.from({outPoint:e.outPointTo(t.out_point),depType:e.depTypeTo(t.dep_type)})}static transactionFrom(t){let n=$.from(t);return{version:F(n.version),cell_deps:n.cellDeps.map(t=>e.cellDepFrom(t)),header_deps:n.headerDeps,inputs:n.inputs.map(t=>e.cellInputFrom(t)),outputs:n.outputs.map(t=>e.cellOutputFrom(t)),outputs_data:n.outputsData,witnesses:n.witnesses}}static transactionTo(t){return $.from({version:t.version,cellDeps:t.cell_deps.map(t=>e.cellDepTo(t)),headerDeps:t.header_deps,inputs:t.inputs.map(t=>e.cellInputTo(t)),outputs:t.outputs.map(t=>e.cellOutputTo(t)),outputsData:t.outputs_data,witnesses:t.witnesses})}static transactionResponseTo({cycles:t,tx_status:{status:n,block_number:r,block_hash:i,tx_index:a,reason:o},transaction:s}){if(s!=null)return ar.from({transaction:e.transactionTo(s),status:n,cycles:H(P,t),blockHash:H(A,i),blockNumber:H(P,r),txIndex:H(P,a),reason:o})}static blockHeaderTo(e){let t=x(e.dao);return{compactTarget:P(e.compact_target),dao:{c:wt(t.subarray(0,8)),ar:wt(t.subarray(8,16)),s:wt(t.subarray(16,24)),u:wt(t.subarray(24,32))},epoch:G.fromNum(e.epoch),extraHash:e.extra_hash,hash:e.hash,nonce:P(e.nonce),number:P(e.number),parentHash:e.parent_hash,proposalsHash:e.proposals_hash,timestamp:P(e.timestamp),transactionsRoot:e.transactions_root,version:P(e.version)}}static blockUncleTo(t){return{header:e.blockHeaderTo(t.header),proposals:t.proposals}}static blockTo(t){return{header:e.blockHeaderTo(t.header),proposals:t.proposals,transactions:t.transactions.map(t=>e.transactionTo(t)),uncles:t.uncles.map(t=>e.blockUncleTo(t))}}static rangeFrom([e,t]){return[F(e),F(t)]}static indexerSearchKeyFilterFrom(t){return{script:H(e.scriptFrom,t.script),script_len_range:H(e.rangeFrom,t.scriptLenRange),output_data:t.outputData,output_data_filter_mode:t.outputDataSearchMode,output_data_len_range:H(e.rangeFrom,t.outputDataLenRange),output_capacity_range:H(e.rangeFrom,t.outputCapacityRange),block_range:H(e.rangeFrom,t.blockRange)}}static indexerSearchKeyFrom(t){let n=sr.from(t);return{script:e.scriptFrom(n.script),script_type:n.scriptType,script_search_mode:n.scriptSearchMode,filter:H(e.indexerSearchKeyFilterFrom,n.filter),with_data:n.withData}}static findCellsResponseTo({last_cursor:t,objects:n}){return{lastCursor:t,cells:n.map(t=>Yr.from({outPoint:e.outPointTo(t.out_point),cellOutput:e.cellOutputTo(t.output),outputData:t.output_data??`0x`}))}}static indexerSearchKeyTransactionFrom(t){let n=cr.from(t);return{script:e.scriptFrom(n.script),script_type:n.scriptType,script_search_mode:n.scriptSearchMode,filter:H(e.indexerSearchKeyFilterFrom,n.filter),group_by_transaction:n.groupByTransaction}}static findTransactionsResponseTo({last_cursor:e,objects:t}){return t.length===0?{lastCursor:e,transactions:[]}:`io_index`in t[0]?{lastCursor:e,transactions:t.map(e=>({txHash:e.tx_hash,blockNumber:P(e.block_number),txIndex:P(e.tx_index),cellIndex:P(e.io_index),isInput:e.io_type===`input`}))}:{lastCursor:e,transactions:t.map(e=>({txHash:e.tx_hash,blockNumber:P(e.block_number),txIndex:P(e.tx_index),cells:e.cells.map(([e,t])=>({isInput:e===`input`,cellIndex:P(t)}))}))}}};const _i=Object.freeze({NervosDao:{codeHash:`0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x8f8c79eb6671709633fe6a46de93c0fedc9c1b8a6527a18d3983879542635c9f`,index:2},depType:`code`}}]},Secp256k1Blake160:{codeHash:`0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}}]},Secp256k1Multisig:{codeHash:`0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:1},depType:`depGroup`}}]},Secp256k1MultisigV2Beta:{codeHash:`0x765b3ed6ae264b335d07e73ac332bf2c0f38f8d3340ed521cb447b4c42dd5f09`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf2013f123b2cb745e3fdf5c935a3925647496f88090503eef58332a9245b4172`,index:0},depType:`depGroup`}}]},Secp256k1MultisigV2:{codeHash:`0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x2eefdeb21f3a3edf697c28a52601b4419806ed60bb427420455cc29a090b26d5`,index:0},depType:`depGroup`}}]},AnyoneCanPay:{codeHash:`0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6`,index:0},depType:`depGroup`}}]},TypeId:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,cellDeps:[]},SUdt:{codeHash:`0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe12877ebd2c3c364dc46c5c992bcfaf4fee33fa13eebdf82c591fc9825aab769`,index:0},depType:`code`}}]},XUdt:{codeHash:`0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xbf6fb538763efec2a70a6a3dcb7242787087e1030c4e7d86585bc63a9d337f5f`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x44ec8b96663e06cc94c8c468a4d46d7d9af69eaf418f6390c9f11bb763dda0ae`}}]},JoyId:{codeHash:`0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x4a596d31dc35e88fb1591debbf680b04a44b4a434e3a94453c21ea8950ffb4d9`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x1c9fc299ba0570d077b4d7fb9acff1ccc0de69d369942d82678bae937c44ec30`}},{cellDep:{outPoint:{txHash:`0x4a596d31dc35e88fb1591debbf680b04a44b4a434e3a94453c21ea8950ffb4d9`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x27f0d3ccdc2fcd52ae31fbacad5f86b97bc147d7093e4807cd6e3d21c1fe6841`}},{cellDep:{outPoint:{txHash:`0xf2c9dbfe7438a8c622558da8fa912d36755271ea469d3a25cb8d3373d35c8638`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x0ac15fe5b2d059ec39de03f2d3159d5463abb918a1a07a9fa00d2b9c61d89ef3`}},{cellDep:{outPoint:{txHash:`0x95ecf9b41701b45d431657a67bbfa3f07ef7ceb53bf87097f3674e1a4a19ce62`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xc7bafc5550ccad7cea32c27764f5df6aca4de547da65e3e67fa08477a1af7f5e`}},{cellDep:{outPoint:{txHash:`0x8b3255491f3c4dcc1cfca33d5c6bcaec5409efe4bbda243900f9580c47e0242e`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x71decef9ca8725e64ec99a5521790d16b8d5daadb4989b45dd6ab51806a8c0e4`}}]},COTA:{codeHash:`0x89cd8003a0eaf8e65e0c31525b7d1d5c1becefd2ea75bb4cff87810ae37764d8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x636a786001f87cb615acfcf408be0f9a1f077001f0bbc75ca54eadfe7e221713`,index:0},depType:`depGroup`}}]},PWLock:{codeHash:`0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0x57a62003daeab9d54aa29b944fc3b451213a5ebdf2e232216a3cfed0dde61b38`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xf6d90bfe3041d0fd7e01c45770241697f5f837974bd6ae1672a7ec0f9f523268`}}]},OmniLock:{codeHash:`0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0xec18bf0d857c981c3d1f4e17999b9b90c484b303378e94de1a57b0872f5d4602`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x761f51fc9cd6a504c32c6ae64b3746594d1af27629b427c5ccf6c9a725a89144`}}]},NostrLock:{codeHash:`0x6ae5ee0cb887b2df5a9a18137315b9bdc55be8d52637b2de0624092d5f0c91d5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xa2a434dcdbe280b9ed75bb7d6c7d68186a842456aba0fc506657dc5ed7c01d68`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x8dc56c6f35f0c535e23ded1629b1f20535477a1b43e59f14617d11e32c50e0aa`}}]},UniqueType:{codeHash:`0x8e341bcfec6393dcd41e635733ff2dca00a6af546949f70c57a706c0f344df8b`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xff91b063c78ed06f10a1ed436122bd7d671f9a72ef5f5fa28d05252c17cf4cef`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xe04976b67600fd25ac50305f77b33aee2c12e3c18e63ece9119e5b32117884b5`}}]},DidCkb:{codeHash:`0x510150477b10d6ab551a509b71265f3164e9fd4137fcb5a4322f49f03092c7c5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x0e7a830e2d5ebd05cd45a55f93f94559edea0ef1237b7233f49f7facfb3d6a6c`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,args:`0x3c27695173b888ed44ddf36f901789014384ad6c05a9137f3db9a0779c141c35`,hashType:`type`}}]},AlwaysSuccess:{codeHash:`0x3b521cc4b552f109d092d8cc468a8048acb53c5952dbe769d2b2f9cf6e47f7f1`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:0},depType:`code`}}]},InputTypeProxyLock:{codeHash:`0x5123908965c711b0ffd8aec642f1ede329649bda1ebdca6bd24124d3796f768a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:1},depType:`code`}}]},OutputTypeProxyLock:{codeHash:`0x2df53b592db3ae3685b7787adcfef0332a611edb83ca3feca435809964c3aff2`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:2},depType:`code`}}]},LockProxyLock:{codeHash:`0x5d41e32e224c15f152b7e6529100ebeac83b162f5f692a5365774dad2c1a1d02`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:3},depType:`code`}}]},SingleUseLock:{codeHash:`0x8290467a512e5b9a6b816469b0edabba1f4ac474e28ffdd604c2a7c76446bbaf`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:4},depType:`code`}}]},TypeBurnLock:{codeHash:`0xff78bae0abf17d7a404c0be0f9ad9c9185b3f88dcc60403453d5ba8e1f22f53a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:5},depType:`code`}}]},EasyToDiscoverType:{codeHash:`0xaba4430cc7110d699007095430a1faa72973edf2322ddbfd4d1d219cacf237af`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x1b4ffcad55ecd36ffb2715b6816b83da73851f1a24fe594f263c4f34dad90792`,index:0},depType:`code`}}]},TimeLock:{codeHash:`0x6fac4b2e89360a1e692efcddcb3a28656d8446549fb83da6d896db8b714f4451`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x1b4ffcad55ecd36ffb2715b6816b83da73851f1a24fe594f263c4f34dad90792`,index:1},depType:`code`}}]}});function vi(e){try{let{words:n,prefix:r}=t.bech32m.decode(e,xi),i=t.bech32m.fromWords(n),a=i[0],o=i.slice(1);if(a===0)return{prefix:r,format:0,payload:o}}catch{}try{let{prefix:n,words:r}=t.bech32.decode(e,xi),i=t.bech32.fromWords(r),a=i[0],o=i.slice(1);if([2,4,1].includes(a))return{prefix:n,format:a,payload:o}}catch{}throw Error(`Unknown address format ${e}`)}async function yi(e,t,n,r){if(t===0){if(n.length<33)throw Error(`Invalid full address without enough payload ${A(n)}`);return{script:{codeHash:n.slice(0,32),hashType:Dr(n.slice(32,33)),args:n.slice(33)},prefix:e}}if(t===2){if(n.length<32)throw Error(`Invalid full data address without enough payload ${A(n)}`);return{script:{codeHash:n.slice(0,32),hashType:`data`,args:n.slice(32)},prefix:e}}if(t===4){if(n.length<32)throw Error(`Invalid full type address without enough payload ${A(n)}`);return{script:{codeHash:n.slice(0,32),hashType:`type`,args:n.slice(32)},prefix:e}}if(n.length!==21)throw Error(`Invalid short address without enough payload ${A(n)}`);let i=[`Secp256k1Blake160`,`Secp256k1Multisig`,`AnyoneCanPay`][n[0]];if(i===void 0)throw Error(`Invalid short address with unknown script ${A(n)}`);return{script:await K.fromKnownScript(r,i,n.slice(1)),prefix:e}}let bi=function(e){return e[e.Full=0]=`Full`,e[e.Short=1]=`Short`,e[e.FullData=2]=`FullData`,e[e.FullType=4]=`FullType`,e}({});const xi=1023;var Si=class{static infoFrom(e){return{type:e.type,sign_type:e.signType,name:e.name,icon:e.icon}}static infoTo(e){return{type:e.type,signType:e.sign_type,name:e.name,icon:e.icon}}static messageFrom(e){return typeof e==`string`?{type:`string`,value:e}:{type:`bytes`,value:A(e)}}static messageTo(e){if(!Ci(e)||typeof e.value!=`string`)throw Error(`Invalid signer message`);if(e.type===`string`)return e.value;if(e.type===`bytes`)return x(e.value);throw Error(`Invalid signer message type`)}};function Ci(e){return typeof e==`object`&&!!e}Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return br}}),Object.defineProperty(exports,"$n",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"$r",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(exports,"An",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"Ar",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,"Bn",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,"Br",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"Cr",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,"Dr",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"Er",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(exports,"Fn",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"Fr",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(exports,"Gn",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"Gr",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(exports,"Hn",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"Hr",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(exports,"In",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"Ir",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"Jn",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"Jr",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"Kn",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,"Kr",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(exports,"Ln",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"Lr",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(exports,"Mn",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"Mr",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(exports,"Nn",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"Nr",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"Or",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ri}}),Object.defineProperty(exports,"Pn",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"Pr",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(exports,"Qn",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"Qr",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return ni}}),Object.defineProperty(exports,"Rn",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"Rr",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"Sr",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"Un",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"Ur",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return Mn}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,"Vn",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,"Vr",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"Wn",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,"Wr",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,"Xn",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"Xr",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(exports,"Yn",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"Yr",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(exports,"Zn",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"Zr",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return si}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"_r",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"ar",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,"br",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return hi}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,"cr",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,"dr",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,"er",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return un}}),Object.defineProperty(exports,"fr",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,"gr",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(exports,"hr",{enumerable:!0,get:function(){return 20}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,"ir",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"jn",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,"jr",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(exports,"kn",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"kr",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,"lr",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,"mr",{enumerable:!0,get:function(){return 32}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return xi}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"nr",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return _i}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,"or",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return di}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,"pr",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"qn",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,"qr",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,"rr",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return gi}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"sr",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Si}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,"tr",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return pi}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,"ur",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return li}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"vr",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return er}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"wr",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"xr",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Yr}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"yr",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(exports,"zn",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"zr",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return In}});
|
|
2
|
-
//# sourceMappingURL=transformers-
|
|
1
|
+
const e=require("./rolldown-runtime-Chgba0Kb.js");let t=require("bech32"),n=require("isomorphic-ws");n=e.n(n);const r=Object.prototype.toString;function i(e,t,n){return e?e.constructor===t||r.call(e)===n:!1}function a(e){return i(e,Uint8Array,`[object Uint8Array]`)}function o(e){return i(e,ArrayBuffer,`[object ArrayBuffer]`)}function s(e){return a(e)||o(e)}function c(e){if(!a(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function l(e){if(!s(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}const u={utf8:new globalThis.TextDecoder(`utf8`)};function d(e,t=`utf8`){return l(e),u[t]??=new globalThis.TextDecoder(t),u[t].decode(e)}function f(e){if(typeof e!=`string`)throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}const p=new globalThis.TextEncoder;function m(e){return f(e),p.encode(e)}function h(e){return e.replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function ee(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=(4-t.length%4)%4;return t+`=`.repeat(n)}const g=65535;function _(e,{urlSafe:t=!1}={}){c(e);let n=``;for(let t=0;t<e.length;t+=g){let r=e.subarray(t,t+g);n+=globalThis.btoa(String.fromCodePoint.apply(void 0,r))}return t?h(n):n}function te(e){return f(e),Uint8Array.from(globalThis.atob(ee(e)),e=>e.codePointAt(0))}const ne=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function v(e){c(e);let t=``;for(let n=0;n<e.length;n++)t+=ne[e[n]];return t}const y={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function re(e){if(f(e),e.length%2!=0)throw Error(`Invalid Hex string length.`);let t=e.length/2,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=y[e[r*2]],i=y[e[r*2+1]];if(t===void 0||i===void 0)throw Error(`Invalid Hex character encountered at position ${r*2}`);n[r]=t<<4|i}return n}const ie=Uint8Array;function b(e,...t){return t.reduce((t,n)=>{let r=x(n);for(let t of r)e.push(t);return t},e)}function ae(...e){return new Uint8Array(b([],...e))}function oe(e,t){let n=x(e);switch(t){case`utf8`:return d(n);case`base64`:return _(n);case`base64url`:return _(n,{urlSafe:!0});case`hex`:return v(n)}}function x(e,t){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(typeof e==`string`){if(t!==void 0&&t!==`hex`)return se(e,t);let n=e.startsWith(`0x`)?e.slice(2):e;return re(n.length%2==0?n:`0${n}`)}if(Array.from(e).some(e=>e<0||255<e))throw Error(`Invalid bytes ${JSON.stringify(e)}`);return new Uint8Array(e)}function se(e,t){switch(t){case`utf8`:return m(e);case`base64`:case`base64url`:return te(e)}}function ce(e,t){if(e===t)return!0;let n=x(e),r=x(t);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}var S=class e{constructor(e,t,n){this.encode=e,this.decode=t,this.byteLength=n}encodeOr(e,t){try{return this.encode(e)}catch{return t}}decodeOr(e,t,n){try{return this.decode(e,n)}catch{return t}}static from({encode:t,decode:n,byteLength:r}){return new e(e=>{let n=t(e);if(r!==void 0&&n.byteLength!==r)throw Error(`Codec.encode: expected byte length ${r}, got ${n.byteLength}`);return n},(e,t)=>{let i=x(e);if(r!==void 0&&i.byteLength!==r)throw Error(`Codec.decode: expected byte length ${r}, got ${i.byteLength}`);return n(e,t)},r)}map({inMap:t,outMap:n}){return new e(e=>this.encode(t?t(e):e),(e,t)=>n?n(this.decode(e,t)):this.decode(e,t),this.byteLength)}mapIn(e){return this.map({inMap:e})}mapOut(e){return this.map({outMap:e})}};function le(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}const ue=e=>e?`"${e}" `:``;function C(e,t=``){if(typeof e!=`number`)throw TypeError(ue(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(ue(t)+`expected integer >= 0, got `+e);return e}function de(e,t=``){if(typeof e!=`boolean`)throw TypeError(ue(t)+`expected boolean, got type=`+typeof e);return e}function w(e,t,n=``){if(le(e)&&(t===void 0||e.length===t))return e;t!==void 0&&C(t,`length`);let r=le(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=ue(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}function fe(e){return Uint8Array.from(w(e))}function pe(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(C(e.outputLen),C(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}const me=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},he=(e,t)=>{me(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function ge(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function _e(e,t){w(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function ve(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ye(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function be(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function xe(e,t){return e<<32-t|e>>>t}function Se(e,t){return e<<t|e>>>32-t>>>0}const Ce=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function we(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const T=Ce?e=>e:e=>we(e)>>>0;function Te(e){for(let t=0;t<e.length;t++)e[t]=we(e[t]);return e}const Ee=Ce?e=>e:Te,De=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Oe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ke(e){if(w(e),De)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Oe[e[n]];return t}function Ae(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function je(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(De)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Ae(e.charCodeAt(i)),a=Ae(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function Me(e){let t=globalThis;if(typeof t.scheduler?.yield==`function`){let n=t.scheduler.yield();return e&&n.catch(e),n}return new Promise(e=>t.setTimeout(e,0))}async function Ne(e,t,n,r){if(C(e,`iters`),C(t,`tick`),typeof n!=`function`)throw TypeError(`callback must be a function`);let i=Date.now();for(let a=0;a<e;a++){n(a);let e=Date.now()-i;e>=0&&e<t||(await Me(r),i=Date.now())}}function Pe(e){if(typeof e!=`string`)throw TypeError(`string expected`);let t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{ye(t)}}function Fe(e,t=``){return typeof e==`string`?Pe(e):w(e,void 0,t)}function Ie(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];w(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function Le(e,t,n=`opts`){return he(e,`defaults`),t!==void 0&&he(t,n),Object.assign(Object.create(null),e,t)}function Re(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=Le({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function ze(e=32){C(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Be=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),Ve=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),He=BigInt(2**32-1),Ue=BigInt(32);function We(e,t=!1){return t?{h:Number(e&He),l:Number(e>>Ue&He)}:{h:Number(e>>Ue&He)|0,l:Number(e&He)|0}}function Ge(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=We(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}const Ke=e=>e/2**32|0,qe=e=>e>>>0;function Je(e,t,n,r){let i=Ke(n),a=qe(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}const Ye=(e,t,n)=>e>>>n|t<<32-n,Xe=(e,t,n)=>e<<32-n|t>>>n,Ze=(e,t,n)=>e<<64-n|t>>>n-32,Qe=(e,t,n)=>e>>>n-32|t<<64-n,$e=(e,t)=>t,et=(e,t)=>e;function tt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const nt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),rt=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,E=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),D=new Uint32Array(32);function O(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=D[2*e],l=D[2*e+1],u=D[2*t],d=D[2*t+1],f=D[2*n],p=D[2*n+1],m=D[2*r],h=D[2*r+1],ee=nt(c,u,o);l=rt(ee,l,d,s),c=ee|0;let g=h^l,_=m^c;h=$e(g,_),m=et(g,_),{h:p,l:f}=tt(p,f,h,m),g=d^p,_=u^f,d=Ye(g,_,24),u=Xe(g,_,24),D[2*e]=c,D[2*e+1]=l,D[2*t]=u,D[2*t+1]=d,D[2*n]=f,D[2*n+1]=p,D[2*r]=m,D[2*r+1]=h}function k(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=D[2*e],l=D[2*e+1],u=D[2*t],d=D[2*t+1],f=D[2*n],p=D[2*n+1],m=D[2*r],h=D[2*r+1],ee=nt(c,u,o);l=rt(ee,l,d,s),c=ee|0;let g=h^l,_=m^c;h=Ye(g,_,16),m=Xe(g,_,16),{h:p,l:f}=tt(p,f,h,m),g=d^p,_=u^f,d=Ze(g,_,63),u=Qe(g,_,63),D[2*e]=c,D[2*e+1]=l,D[2*t]=u,D[2*t+1]=d,D[2*n]=f,D[2*n+1]=p,D[2*r]=m,D[2*r+1]=h}function it(e,t={},n,r,i){if(C(n),e<=0||e>n)throw Error(`"dkLen" must be 1..`+n+`, got `+e);let{key:a,salt:o,personalization:s}=t;if(a!==void 0&&(a.length<1||a.length>n))throw Error(`"key" expected to be undefined or of length=1..`+n);o!==void 0&&w(o,r,`salt`),s!==void 0&&w(s,i,`personalization`)}var at=class{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;canXOF=!1;constructor(e,t){C(e),C(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=ve(this.buffer)}update(e){ge(this),w(e);let{blockLen:t,buffer:n,buffer32:r}=this,i=e.length,a=e.byteOffset,o=e.buffer;for(let s=0;s<i;){this.pos===t&&(Ee(r),this.compress(r,0,!1),Ee(r),this.pos=0);let c=Math.min(t-this.pos,i-s),l=a+s;if(c===t&&!(l%4)&&s+c<i){let e=new Uint32Array(o,l,Math.floor((i-s)/4));Ee(e);for(let n=0;s+t<i;n+=r.length,s+=t)this.length+=t,this.compress(e,n,!1);Ee(e);continue}n.set(s===0&&c===i?e:e.subarray(s,s+c),this.pos),this.pos+=c,this.length+=c,s+=c}return this}digestInto(e){if(ge(this),_e(e,this),e.byteOffset&3)throw RangeError(`"output" expected 4-byte aligned byteOffset, got `+e.byteOffset);let{pos:t,buffer32:n}=this;this.finished=!0,this.buffer.fill(0,t),Ee(n),this.compress(n,0,!0),Ee(n);let r=this.get(),i=e===this.buffer?n:ve(e),a=Math.floor(this.outputLen/4);for(let e=0;e<a;e++)i[e]=T(r[e]);let o=this.outputLen%4;if(!o)return;let s=a*4,c=r[a];for(let t=0;t<o;t++)e[s+t]=c>>>8*t}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){let{buffer:t,length:n,finished:r,destroyed:i,outputLen:a,pos:o}=this;return e||=new this.constructor({dkLen:a}),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=r,e.length=n,e.pos=o,e.outputLen=a,e}clone(){return this._cloneInto()}},ot=class extends at{v0l=E[0]|0;v0h=E[1]|0;v1l=E[2]|0;v1h=E[3]|0;v2l=E[4]|0;v2h=E[5]|0;v3l=E[6]|0;v3h=E[7]|0;v4l=E[8]|0;v4h=E[9]|0;v5l=E[10]|0;v5h=E[11]|0;v6l=E[12]|0;v6h=E[13]|0;v7l=E[14]|0;v7h=E[15]|0;constructor(e={}){e=Le({},e);let t=e.dkLen===void 0?64:e.dkLen;super(128,t),it(t,e,64,16,16);let{key:n,personalization:r,salt:i}=e,a=0;if(n!==void 0&&(w(n,void 0,`key`),a=n.length),this.v0l^=this.outputLen|a<<8|16842752,i!==void 0){w(i,void 0,`salt`);let e=ve(fe(i));this.v4l^=T(e[0]),this.v4h^=T(e[1]),this.v5l^=T(e[2]),this.v5h^=T(e[3])}if(r!==void 0){w(r,void 0,`personalization`);let e=ve(fe(r));this.v6l^=T(e[0]),this.v6h^=T(e[1]),this.v7l^=T(e[2]),this.v7h^=T(e[3])}if(n!==void 0){let e=new Uint8Array(this.blockLen);e.set(n),this.update(e),ye(e)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:i,v2h:a,v3l:o,v3h:s,v4l:c,v4h:l,v5l:u,v5h:d,v6l:f,v6h:p,v7l:m,v7h:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.v0l=e|0,this.v0h=t|0,this.v1l=n|0,this.v1h=r|0,this.v2l=i|0,this.v2h=a|0,this.v3l=o|0,this.v3h=s|0,this.v4l=c|0,this.v4h=l|0,this.v5l=u|0,this.v5h=d|0,this.v6l=f|0,this.v6h=p|0,this.v7l=m|0,this.v7h=h|0}compress(e,t,n){let{v0l:r,v0h:i,v1l:a,v1h:o,v2l:s,v2h:c,v3l:l,v3h:u,v4l:d,v4h:f,v5l:p,v5h:m,v6l:h,v6h:ee,v7l:g,v7h:_}=this;D[0]=r,D[1]=i,D[2]=a,D[3]=o,D[4]=s,D[5]=c,D[6]=l,D[7]=u,D[8]=d,D[9]=f,D[10]=p,D[11]=m,D[12]=h,D[13]=ee,D[14]=g,D[15]=_,D.set(E,16);let te=qe(this.length),ne=Ke(this.length);D[24]=E[8]^te,D[25]=E[9]^ne,n&&(D[28]=~D[28],D[29]=~D[29]);let v=0,y=Ve;for(let n=0;n<12;n++)O(0,4,8,12,e,t+2*y[v++]),k(0,4,8,12,e,t+2*y[v++]),O(1,5,9,13,e,t+2*y[v++]),k(1,5,9,13,e,t+2*y[v++]),O(2,6,10,14,e,t+2*y[v++]),k(2,6,10,14,e,t+2*y[v++]),O(3,7,11,15,e,t+2*y[v++]),k(3,7,11,15,e,t+2*y[v++]),O(0,5,10,15,e,t+2*y[v++]),k(0,5,10,15,e,t+2*y[v++]),O(1,6,11,12,e,t+2*y[v++]),k(1,6,11,12,e,t+2*y[v++]),O(2,7,8,13,e,t+2*y[v++]),k(2,7,8,13,e,t+2*y[v++]),O(3,4,9,14,e,t+2*y[v++]),k(3,4,9,14,e,t+2*y[v++]);this.v0l^=D[0]^D[16],this.v0h^=D[1]^D[17],this.v1l^=D[2]^D[18],this.v1h^=D[3]^D[19],this.v2l^=D[4]^D[20],this.v2h^=D[5]^D[21],this.v3l^=D[6]^D[22],this.v3h^=D[7]^D[23],this.v4l^=D[8]^D[24],this.v4h^=D[9]^D[25],this.v5l^=D[10]^D[26],this.v5h^=D[11]^D[27],this.v6l^=D[12]^D[28],this.v6h^=D[13]^D[29],this.v7l^=D[14]^D[30],this.v7h^=D[15]^D[31],ye(D)}destroy(){this.destroyed=!0,ye(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const st=Re(e=>new ot(e));function ct(e){if(!(typeof e==`string`&&e.length%2==0&&e.startsWith(`0x`)))return!1;for(let t=2;t<e.length;t++){let n=e.charAt(t);if(!(`0`<=n&&n<=`9`||`a`<=n&&n<=`f`))return!1}return!0}function A(e){return ct(e)?e:`0x${oe(x(e),`hex`)}`}function lt(e){return ct(e)?ut(e):x(e).length}function ut(e){return Math.floor((e.length-1)/2)}const dt=x(`ckb-default-hash`,`utf8`);var ft=class{constructor(e=32,t=dt){this.hasher=st.create({personalization:t,dkLen:e})}update(e){return this.hasher.update(x(e)),this}digest(){return A(this.hasher.digest())}};function pt(...e){let t=new ft;return e.forEach(e=>t.update(e)),t.digest()}function mt(...e){return pt(...e).slice(0,42)}var j=class{static Base(){class e extends j{static encode(e){throw Error(`encode not implemented, use @ccc.codec to decorate your type`)}static decode(e){throw Error(`decode not implemented, use @ccc.codec to decorate your type`)}static fromBytes(e){throw Error(`fromBytes not implemented, use @ccc.codec to decorate your type`)}static from(e){throw Error(`from not implemented`)}toBytes(){return this.constructor.encode(this)}clone(){return this.constructor.fromBytes(this.toBytes())}eq(e){return this===e||ce(this.toBytes(),(this.constructor?.from(e)??e).toBytes())}hash(){return pt(this.toBytes())}toHex(){return A(this.toBytes())}}return e.encode=void 0,e.decode=void 0,e.fromBytes=void 0,e}static BaseUnion(){class e extends j.Base(){constructor(e){super(),this.inner=e}match(e){let t=e[this.inner.type];return t==null?e._(this.inner):t(this.inner.value)}}return e}};function M(e){return function(t,...n){return t.byteLength=e.byteLength,t.encode===void 0&&(t.encode=function(n){return e.encode(t.from(n))}),t.decode===void 0&&(t.decode=function(n){return t.from(e.decode(x(n)))}),t.fromBytes===void 0&&(t.fromBytes=function(n){return t.from(e.decode(x(n)))}),t}}function ht(e,t=8){let n=gt(e).toString();if(t===0)return n;let r=n.length<=t?`0`:n.slice(0,-t),i=n.slice(-t).padStart(t,`0`).replace(/0*$/,``);return i===``?r:`${r}.${i}`}function gt(e,t=8){if(typeof e==`bigint`)return e;let[n,r]=(typeof e==`number`?e.toFixed(t):e.toString()).split(`.`),i=BigInt(n.padEnd(n.length+t,`0`));return r===void 0?i:i+BigInt(r.slice(0,t).padEnd(t,`0`))}const N=0n,_t=gt(`1`);function vt(e,...t){let n=P(e);return t.forEach(e=>{let t=P(e);t<n&&(n=t)}),n}function yt(e,...t){let n=P(e);return t.forEach(e=>{let t=P(e);t>n&&(n=t)}),n}function P(e){if(typeof e==`bigint`)return e;if(e===`0x`)return BigInt(0);if(typeof e==`string`||typeof e==`number`)return BigInt(e);let t=A(e);return BigInt(t)}function F(e){let t=P(e);if(t<0n)throw Error(`value must be non-negative`);return`0x${t.toString(16)}`}function bt(e,t){return xt(e,t)}function xt(e,t){return St(e,t).reverse()}function St(e,t){let n=P(e);if(n<P(0)){if(t==null)throw Error(`negative number can not be serialized without knowing bytes length`);if(n=(P(1)<<P(8)*P(t))+n,n<0)throw Error(`negative number underflow`)}let r=x(n.toString(16));if(t==null)return r;if(r.length>t)throw Error(`number overflow`);return ae(`00`.repeat(t-r.length),r)}function Ct(e){return wt(e)}function wt(e){return Tt(x(e).map(e=>e).reverse())}function Tt(e){return P(x(e))}function I(e,t=!1){return S.from({byteLength:e,encode:n=>t?bt(n,e):St(n,e),decode:e=>t?Ct(e):Tt(e)})}function Et(e,t=!1){if(e>4)throw Error(`uintNumber: byteLength must be less than or equal to 4`);return I(e,t).map({outMap:e=>Number(e)})}function Dt(e){return S.from({byteLength:e,encode:()=>new Uint8Array(e),decode:()=>{}})}const Ot=S.from({encode:e=>x(e),decode:e=>x(e)}),kt=S.from({encode:e=>x(e),decode:e=>A(e)}),At=Et(1,!0),jt=Et(2,!0),Mt=Et(2),Nt=jt,Pt=Et(4,!0),Ft=Et(4),It=Pt,Lt=I(8,!0),Rt=I(8),zt=Lt,Bt=I(16,!0),Vt=I(16),Ht=Bt,Ut=I(32,!0),Wt=I(32),Gt=Ut,Kt=I(64,!0),qt=I(64),Jt=Kt,Yt=S.from({byteLength:1,encode:e=>x(e?[1]:[0]),decode:e=>x(e)[0]!==0}),Xt=S.from({byteLength:1,encode:e=>x(e),decode:e=>A(e)}),Zt=S.from({byteLength:4,encode:e=>x(e),decode:e=>A(e)}),Qt=S.from({byteLength:8,encode:e=>x(e),decode:e=>A(e)}),$t=S.from({byteLength:16,encode:e=>x(e),decode:e=>A(e)}),en=S.from({byteLength:32,encode:e=>x(e),decode:e=>A(e)});function L(e){return bt(e,4)}function R(e){return Number(Ct(e))}function z(e){return e instanceof Error?e.message:String(e)}function tn(e){let t=e.byteLength;if(t===void 0)throw Error(`fixedItemVec: itemCodec requires a byte length`);return S.from({encode(t){try{let n=[];b(n,L(t.length));for(let r of t)b(n,e.encode(r));return x(n)}catch(e){throw Error(`fixedItemVec - ${z(e)}`,{cause:e})}},decode(n,r){let i=x(n);if(i.byteLength<4)throw Error(`fixedItemVec: too short buffer, expected at least 4 bytes, but got ${i.byteLength}`);let a=4+R(i.subarray(0,4))*t;if(i.byteLength!==a)throw Error(`fixedItemVec: invalid buffer size, expected ${a}, but got ${i.byteLength}`);try{let n=[];for(let o=4;o<a;o+=t)n.push(e.decode(i.subarray(o,o+t),r));return n}catch(e){throw Error(`fixedItemVec - ${z(e)}`,{cause:e})}}})}function nn(e){return S.from({encode(t){try{let n=4+t.length*4,r=[],i=[];for(let a of t){let t=e.encode(a);b(r,L(n)),b(i,t),n+=t.byteLength}return ae(L(r.length+i.length+4),r,i)}catch(e){throw Error(`dynItemVec - ${z(e)}`,{cause:e})}},decode(t,n){let r=x(t);if(r.byteLength<4)throw Error(`dynItemVec: too short buffer, expected at least 4 bytes, but got ${r.byteLength}`);let i=R(r.subarray(0,4));if(i!==r.byteLength)throw Error(`dynItemVec: invalid buffer size, expected ${i}, but got ${r.byteLength}`);if(i===4)return[];let a=(R(r.subarray(4,8))-4)/4,o=Array.from(Array(a),(e,t)=>R(r.subarray(4+t*4,8+t*4)));o.push(i);try{let t=[];for(let i=0;i<o.length-1;i++){let a=o[i],s=o[i+1],c=r.subarray(a,s);t.push(e.decode(c,n))}return t}catch(e){throw Error(`dynItemVec - ${z(e)}`,{cause:e})}}})}function B(e){return e.byteLength===void 0?nn(e):tn(e)}function V(e){return S.from({encode(t){if(t==null)return x([]);try{return e.encode(t)}catch(e){throw Error(`option - ${z(e)}`,{cause:e})}},decode(t,n){if(x(t).byteLength!==0)try{return e.decode(t,n)}catch(e){throw Error(`option - ${z(e)}`,{cause:e})}}})}function rn(e){return S.from({encode(t){try{let n=x(e.encode(t));return ae(L(n.byteLength),n)}catch(e){throw Error(`byteVec - ${z(e)}`,{cause:e})}},decode(t,n){let r=x(t);if(r.byteLength<4)throw Error(`byteVec: too short buffer, expected at least 4 bytes, but got ${r.byteLength}`);let i=R(r.subarray(0,4));if(i!==r.byteLength-4)throw Error(`byteVec: invalid buffer size, expected ${i}, but got ${r.byteLength}`);try{return e.decode(r.subarray(4),n)}catch(e){throw Error(`byteVec - ${z(e)}`,{cause:e})}}})}function an(e){let t=Object.keys(e);return S.from({encode(n){let r=4+t.length*4,i=[],a=[];for(let o of t)try{let t=e[o].encode(n[o]);b(i,L(r)),b(a,t),r+=t.byteLength}catch(e){throw Error(`table.${o} - ${z(e)}`,{cause:e})}return ae(L(i.length+a.length+4),i,a)},decode(n,r){let i=x(n);if(i.byteLength<4)throw Error(`table: too short buffer, expected at least 4 bytes, but got ${i.byteLength}`);let a=R(i.subarray(0,4)),o=(R(i.subarray(4,8))-4)/4;if(a!==i.byteLength)throw Error(`table: invalid buffer size, expected ${a}, but got ${i.byteLength}`);if(o<t.length)throw Error(`table: invalid field count, expected ${t.length}, but got ${o}`);if(o>t.length&&!r?.isExtraFieldIgnored)throw Error(`table: invalid field count, expected ${t.length}, but got ${o}, and extra fields are not allowed in the current configuration. If you want to ignore extra fields, set isExtraFieldIgnored to true.`);let s=t.map((e,t)=>R(i.subarray(4+t*4,8+t*4)));o>t.length?s.push(R(i.subarray(4+t.length*4,8+t.length*4))):s.push(a);let c={};for(let n=0;n<s.length-1;n++){let a=s[n],o=s[n+1],l=t[n],u=e[l],d=i.subarray(a,o);try{Object.assign(c,{[l]:u.decode(d,r)})}catch(e){throw Error(`table.${l} - ${z(e)}`,{cause:e})}}return c}})}function on(e,t){let n=Object.entries(e),r;if(n.length>0){let e=n[0][1].byteLength;e!==void 0&&n.every(([,{byteLength:t}])=>t===e)&&(r=e+4)}function i(e){return`type`in e&&`value`in e?e:e.inner}return S.from({byteLength:r,encode(r){let{type:a,value:o}=i(r),s=a.toString(),c=e[s];if(!c)throw Error(`union: invalid type, expected ${n.map(e=>e[0]).toString()}, but got ${s}`);let l=t?t[s]??-1:n.findIndex(e=>e[0]===s);if(l<0)throw Error(`union: invalid field id ${l} of ${s}`);let u=L(l);try{return ae(u,c.encode(o))}catch(e){throw Error(`union.(${s}) - ${z(e)}`,{cause:e})}},decode(n,r){let i=x(n),a=R(i.subarray(0,4)),o=Object.keys(e),s=t?Object.entries(t).find(([,e])=>e===a)?.[0]:o[a];if(!s){if(!t)throw Error(`union: unknown union field index ${a}, only ${o.toString()} are allowed`);let e=Object.keys(t);throw Error(`union: unknown union field index ${a}, only ${e.toString()} and ${o.toString()} are allowed`)}return{type:s,value:e[s].decode(i.subarray(4),r)}}})}function sn(e){let t=Object.values(e),n=Object.keys(e);return S.from({byteLength:t.reduce((e,t)=>{if(t.byteLength===void 0)throw Error(`struct: all fields must be fixed-size`);return e+t.byteLength},0),encode(t){let r=[];for(let i of n)try{b(r,e[i].encode(t[i]))}catch(e){throw Error(`struct.${i} - ${z(e)}`,{cause:e})}return x(r)},decode(t,n){let r=x(t),i={},a=0;return Object.entries(e).forEach(([e,t])=>{let o=r.subarray(a,a+t.byteLength);try{Object.assign(i,{[e]:t.decode(o,n)})}catch(t){throw Error(`struct.${e} - ${z(t)}`,{cause:t})}a+=t.byteLength}),i}})}function cn(e,t){if(e.byteLength===void 0)throw Error(`array: itemCodec requires a byte length`);let n=e.byteLength*t;return S.from({byteLength:n,encode(t){try{let n=[];for(let r of t)b(n,e.encode(r));return x(n)}catch(e){throw Error(`array - ${z(e)}`,{cause:e})}},decode(t,r){let i=x(t);if(i.byteLength!=n)throw Error(`array: invalid buffer size, expected ${n}, but got ${i.byteLength}`);try{let t=[];for(let n=0;n<i.byteLength;n+=e.byteLength)t.push(e.decode(i.subarray(n,n+e.byteLength),r));return t}catch(e){throw Error(`array - ${z(e)}`,{cause:e})}}})}const ln=V(At),un=B(At),dn=V(Nt),fn=B(Nt),pn=V(It),mn=B(It),hn=V(zt),gn=B(zt),_n=V(Ht),vn=B(Ht),yn=V(Gt),bn=B(Gt),xn=V(Jt),Sn=B(Jt),Cn=rn(kt),wn=V(Cn),Tn=B(Cn),En=V(Yt),Dn=B(Yt),On=V(Xt),kn=B(Xt),An=V(Zt),jn=B(Zt),Mn=V(Qt),Nn=B(Qt),Pn=V($t),Fn=B($t),In=V(en),Ln=B(en),Rn=rn({encode:e=>x(e,`utf8`),decode:e=>oe(e,`utf8`)}),zn=B(Rn),Bn=V(Rn);var Vn=class{constructor(e,t){this.value=e,this.disposer=t}dispose(){return this.disposing??=Promise.resolve().then(()=>this.disposer(this.value)),this.disposing}};const Hn=Symbol.for(`@ckb-ccc/core.Owner`);var Un=class{constructor(){this[Hn]=!0}get isValid(){return this.disposing===void 0}static is(e){return typeof e==`object`&&!!e&&e[Hn]===!0}get value(){if(this.disposing)throw Error(`Cannot access a moved or disposed Owner`);return this.value_}dispose(){return this.disposing??=Promise.resolve().then(()=>this.release(this.value_)),this.disposing}map(e){return new Wn(e(this.value),this.move())}move(){if(this.disposing)throw Error(`Owner has already been moved or disposed`);return this.disposing=Promise.resolve(),new Vn(this.value_,e=>this.release(e))}static moveFrom(e){return e.move()}},Wn=class extends Un{constructor(e,t){super(),this.value_=e,this.source=t}release(){return this.source.dispose()}},Gn=class extends Un{constructor(e,t){super(),this.value_=e,this.disposer=t}release(e){return this.disposer(e)}};function H(e,t){if(t!=null)return e(t)}async function Kn(e,t,n){if(n===void 0){if(e.length===0)throw TypeError(`Reduce of empty array with no initial value`);n=e[0],e=e.slice(1)}return e.reduce((e,n,r,i)=>e.then(e=>Promise.resolve(t(e,n,r,i)).then(t=>t??e)),Promise.resolve(n))}function qn(e){return new Promise(t=>setTimeout(t,Number(P(e))))}function Jn(e){return/webview|wv|ip((?!.*Safari)|(?=.*like Safari))/i.test(e)}function Yn(e){return JSON.stringify(e,(e,t)=>typeof t==`bigint`?F(t):t)}function Xn(e,t){for(e=P(e),t=P(t),e=e<0n?-e:e,t=t<0n?-t:t;t!==N;)[e,t]=[t,e%t];return e}function U(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var W;let G=W=class extends j.Base(){constructor(e,t,n){super(),this.integer=e,this.numerator=t,this.denominator=n}normalizeBase(){return this.denominator===0n?W.from([this.integer,N,P(1)]):this.denominator<0n?W.from([this.integer,-this.numerator,-this.denominator]):this}normalizeCanonical(){let{integer:e,numerator:t,denominator:n}=this.normalizeBase();if(t<0n){let r=(-t+n-1n)/n;e-=r,t+=n*r}let r=Xn(t,n);return t/=r,n/=r,e+=t/n,t%=n,W.from([e,t,n])}get 0(){return this.integer}get 1(){return this.numerator}get 2(){return this.denominator}toNum(){if(this.integer<0n||this.numerator<0n||this.denominator<0n)throw Error(`Negative values in Epoch to Num conversion`);if(this.integer>=P(`0x1000000`)||this.numerator>=P(`0x10000`)||this.denominator>=P(`0x10000`))throw Error(`Integer must be < 2^24, numerator and denominator must be < 2^16`);return this.integer+(this.numerator<<P(24))+(this.denominator<<P(40))}toPackedHex(){return F(this.toNum())}static fromNum(e){let t=P(e);return new W(t&P(`0xffffff`),t>>P(24)&P(`0xffff`),t>>P(40)&P(`0xffff`))}static from(e){return e instanceof W?e:Array.isArray(e)?new W(P(e[0]),P(e[1]),P(e[2])):typeof e==`object`?new W(P(e.integer),P(e.numerator),P(e.denominator)):W.fromNum(e)}clone(){return W.from([this.integer,this.numerator,this.denominator])}static get Genesis(){return W.from([N,N,N])}static get OneNervosDaoCycle(){return W.from([P(180),N,P(1)])}compare(e){if(this===e)return 0;let t=this.normalizeBase(),n=W.from(e).normalizeBase(),r=(t.integer*t.denominator+t.numerator)*n.denominator,i=(n.integer*n.denominator+n.numerator)*t.denominator;return r>i?1:r<i?-1:0}lt(e){return this.compare(e)<0}le(e){return this.compare(e)<=0}eq(e){return this.compare(e)===0}ge(e){return this.compare(e)>=0}gt(e){return this.compare(e)>0}add(e){let t=this.normalizeBase(),n=W.from(e).normalizeBase(),r=t.integer+n.integer,i,a;return t.denominator===n.denominator?(i=t.numerator+n.numerator,a=t.denominator):(i=t.numerator*n.denominator+n.numerator*t.denominator,a=t.denominator*n.denominator),W.from([r,i,a]).normalizeCanonical()}sub(e){let{integer:t,numerator:n,denominator:r}=W.from(e);return this.add(W.from([-t,-n,r]))}toUnix(e,t=P(144e5)){let{integer:n,numerator:r,denominator:i}=this.sub(e.epoch);return e.timestamp+t*n+t*r/i}};G=W=U([M(sn({padding:Dt(1),denominator:I(2),numerator:I(2),integer:I(3)}))],G);function Zn(e){return G.from(e)}function Qn(e){return G.fromNum(e)}function $n(e){return G.from(e).toPackedHex()}const er=P(1e7),tr=P(1e3);function nr([e,t]){return[P(e),P(t)]}var rr=class e{constructor(e,t){this.cellDep=e,this.type=t}static from(t){return t instanceof e?t:new e(Q.from(t.cellDep),H(K.from,t.type))}},ir=class e{constructor(e,t,n){this.codeHash=e,this.hashType=t,this.cellDeps=n}static from(t){return t instanceof e?t:new e(A(t.codeHash),Tr(t.hashType),t.cellDeps.map(e=>rr.from(e)))}},ar=class e{constructor(e,t,n,r,i,a,o){this.transaction=e,this.status=t,this.cycles=n,this.blockHash=r,this.blockNumber=i,this.txIndex=a,this.reason=o}static from(t){return t instanceof e?t:new e($.from(t.transaction),t.status,H(P,t.cycles),H(A,t.blockHash),H(P,t.blockNumber),H(P,t.txIndex),t.reason)}clone(){return new e(this.transaction.clone(),this.status,this.cycles,this.blockHash,this.blockNumber,this.txIndex,this.reason)}},or=class e{constructor(e,t,n,r,i,a,o){this.script=e,this.scriptLenRange=t,this.outputData=n,this.outputDataSearchMode=r,this.outputDataLenRange=i,this.outputCapacityRange=a,this.blockRange=o}static from(t){return t instanceof e?t:new e(H(K.from,t.script),H(nr,t.scriptLenRange),H(A,t.outputData),t.outputDataSearchMode??void 0,H(nr,t.outputDataLenRange),H(nr,t.outputCapacityRange),H(nr,t.blockRange))}},sr=class e{constructor(e,t,n,r,i){this.script=e,this.scriptType=t,this.scriptSearchMode=n,this.filter=r,this.withData=i}static from(t){return t instanceof e?t:new e(K.from(t.script),t.scriptType,t.scriptSearchMode,H(or.from,t.filter),t.withData??void 0)}},cr=class e{constructor(e,t,n,r,i){this.script=e,this.scriptType=t,this.scriptSearchMode=n,this.filter=r,this.groupByTransaction=i}static from(t){return t instanceof e?t:new e(K.from(t.script),t.scriptType,t.scriptSearchMode,H(or.from,t.filter),t.groupByTransaction??void 0)}},lr=class e{constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.compactTarget=e,this.dao=t,this.epoch=n,this.extraHash=r,this.hash=i,this.nonce=a,this.number=o,this.parentHash=s,this.proposalsHash=c,this.timestamp=l,this.transactionsRoot=u,this.version=d}static from(t){return t instanceof e?t:new e(P(t.compactTarget),{c:P(t.dao.c),ar:P(t.dao.ar),s:P(t.dao.s),u:P(t.dao.u)},G.from(t.epoch),A(t.extraHash),A(t.hash),P(t.nonce),P(t.number),A(t.parentHash),A(t.proposalsHash),P(t.timestamp),A(t.transactionsRoot),P(t.version))}},ur=class e{constructor(e,t){this.header=e,this.proposals=t}static from(t){return t instanceof e?t:new e(lr.from(t.header),t.proposals.map(A))}},dr=class e{constructor(e,t,n,r){this.header=e,this.proposals=t,this.transactions=n,this.uncles=r}static from(t){return t instanceof e?t:new e(lr.from(t.header),t.proposals.map(A),t.transactions.map($.from),t.uncles.map(ur.from))}},fr=class extends Error{constructor(e){super(`Client request error ${e.message}`),this.code=e.code,this.data=e.data}},pr=class extends fr{constructor(e,t){super(e),this.outPoint=J.from(t)}},mr=class extends fr{constructor(e,t,n,r,i,a){super(e),this.source=t,this.errorCode=r,this.scriptHashType=i,this.sourceIndex=P(n),this.scriptCodeHash=A(a)}},hr=class extends fr{constructor(e,t){super(e),this.txHash=A(t)}},gr=class extends fr{constructor(e,t,n){super(e),this.currentFee=P(t),this.leastFee=P(n)}},_r=class extends fr{constructor(e){let t=P(e).toString();super({message:`Wait transaction timeout ${t}ms`,data:JSON.stringify({timeout:t})})}},vr=class extends fr{constructor(e,t){let n=P(e).toString(),r=P(t).toString();super({message:`Max fee rate exceeded limit ${n}, actual ${r}. Developer might forgot to complete transaction fee before sending. See https://api.ckbccc.com/classes/_ckb_ccc_core.index.ccc.Transaction.html#completeFeeBy.`,data:JSON.stringify({limit:n,actual:r})})}};let yr=function(e){return e.NervosDao=`NervosDao`,e.Secp256k1Blake160=`Secp256k1Blake160`,e.Secp256k1Multisig=`Secp256k1Multisig`,e.Secp256k1MultisigV2Beta=`Secp256k1MultisigV2Beta`,e.Secp256k1MultisigV2=`Secp256k1MultisigV2`,e.AnyoneCanPay=`AnyoneCanPay`,e.TypeId=`TypeId`,e.SUdt=`SUdt`,e.XUdt=`XUdt`,e.JoyId=`JoyId`,e.COTA=`COTA`,e.PWLock=`PWLock`,e.OmniLock=`OmniLock`,e.NostrLock=`NostrLock`,e.UniqueType=`UniqueType`,e.DidCkb=`DidCkb`,e.AlwaysSuccess=`AlwaysSuccess`,e.InputTypeProxyLock=`InputTypeProxyLock`,e.OutputTypeProxyLock=`OutputTypeProxyLock`,e.LockProxyLock=`LockProxyLock`,e.SingleUseLock=`SingleUseLock`,e.TypeBurnLock=`TypeBurnLock`,e.EasyToDiscoverType=`EasyToDiscoverType`,e.TimeLock=`TimeLock`,e}({});const br={type:1,data:0,data1:2,data2:4},xr={1:`type`,0:`data`,2:`data1`,4:`data2`},Sr=Object.keys(br);var Cr;const wr=S.from({byteLength:1,encode:Er,decode:Dr});function Tr(e){let t=(()=>{if(typeof e==`number`)return xr[e];if(typeof e==`bigint`)return xr[Number(e)];if(Sr.includes(e))return e})();if(t===void 0)throw Error(`Invalid hash type ${e}`);return t}function Er(e){return x([br[Tr(e)]])}function Dr(e){return xr[x(e)[0]]}let K=Cr=class extends j.Base(){constructor(e,t,n){super(),this.codeHash=e,this.hashType=t,this.args=n}get occupiedSize(){return 33+x(this.args).length}clone(){return Cr.from({codeHash:this.codeHash,hashType:this.hashType,args:this.args})}eq(e){return e=Cr.from(e),this.args===e.args&&this.codeHash===e.codeHash&&this.hashType===e.hashType}static from(e){return e instanceof Cr?e:new Cr(A(e.codeHash),Tr(e.hashType),A(e.args))}static async fromKnownScript(e,t,n){let r=await e.getKnownScript(t);return Cr.from({codeHash:r.codeHash,hashType:r.hashType,args:A(n)})}};K=Cr=U([M(an({codeHash:en,hashType:wr,args:Cn}))],K);const Or=V(K),kr=B(K),Ar={code:0,depGroup:1},jr={0:`code`,1:`depGroup`},Mr=Object.keys(Ar);var Nr=class extends Error{constructor(e,t){let n=P(e),r=t?.isForChange??!1;super(`Insufficient CKB, need ${ht(n)} extra CKB${r?` for the change cell`:``}`),this.amount=n,this.isForChange=r}},Pr=class extends Error{constructor(e,t){let n=P(e),r=K.from(t);super(`Insufficient coin, need ${n} extra coin`),this.amount=n,this.type=r}},Fr,Ir,Lr,Rr,zr,Br,q;const Vr=2n**32n-2n;function Hr(e){try{let t=P(e);return t<0n||t>Vr?void 0:Number(t)}catch{return}}function Ur(e){let t=Hr(e);if(t===void 0)throw Error(`Index ${e} must be a valid array index between 0 and ${Vr}`);return t}const Wr=S.from({byteLength:1,encode:Kr,decode:qr});function Gr(e){let t=typeof e==`number`?jr[e]:typeof e==`bigint`?jr[Number(e)]:e;if(t===void 0)throw Error(`Invalid dep type ${e}`);return t}function Kr(e){return x([Ar[Gr(e)]])}function qr(e){return jr[x(e)[0]]}let J=Fr=class extends j.Base(){constructor(e,t){super(),this.txHash=e,this.index=t}static from(e){return e instanceof Fr?e:new Fr(A(e.txHash),P(e.index))}clone(){return Fr.from({txHash:this.txHash,index:this.index})}eq(e){return e=Fr.from(e),this.txHash===e.txHash&&this.index===e.index}};J=Fr=U([M(sn({txHash:en,index:It}))],J);let Y=Ir=class extends j.Base(){constructor(e,t,n){super(),this.capacity=e,this.lock=t,this.type=n}get occupiedSize(){return 8+this.lock.occupiedSize+(this.type?.occupiedSize??0)}static from(e,t){let n=e instanceof Ir?e:new Ir(P(e.capacity??0),K.from(e.lock),H(K.from,e.type));return t!=null&&(n.capacity=yt(n.capacity,gt(n.occupiedSize+x(t).length))),n}clone(){return Ir.from({capacity:this.capacity,lock:this.lock.clone(),type:this.type?.clone()})}};Y=Ir=U([M(an({capacity:zt,lock:K,type:Or}))],Y);const Jr=B(Y);var X=class e{constructor(e,t,n){this.cellOutput=e,this.outputData=t,this.outPoint=n}static from(t){if(t instanceof e)return t.cellOutput=Y.from(t.cellOutput,t.outputData),t;let n=A(t.outputData??`0x`);return new e(Y.from(t.cellOutput,n),n,H(J.from,t.outPoint??t.previousOutput))}get occupiedSize(){return this.cellOutput.occupiedSize+x(this.outputData).byteLength}get capacityFree(){return this.cellOutput.capacity-gt(this.occupiedSize)}async isNervosDao(e,t){let{type:n}=this.cellOutput,r=await e.getKnownScript(`NervosDao`);if(!n||n.codeHash!==r.codeHash||n.hashType!==r.hashType)return!1;let i=P(this.outputData)!==N;return!t||t===`deposited`&&!i||t===`withdrew`&&i}clone(){return e.from({cellOutput:this.cellOutput.clone(),outputData:this.outputData,outPoint:this.outPoint?.clone()})}},Yr=class e extends X{constructor(e,t,n){super(t,n,e),this.outPoint=e}static from(t){return t instanceof e?(t.cellOutput=Y.from(t.cellOutput,t.outputData),t):new e(J.from(t.outPoint??t.previousOutput),Y.from(t.cellOutput,t.outputData),A(t.outputData??`0x`))}async getDaoProfit(e){if(!await this.isNervosDao(e,`withdrew`))return N;let{depositHeader:t,withdrawHeader:n}=await this.getNervosDaoInfo(e);if(!n||!t)throw Error(`Unable to get headers of a Nervos DAO cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return ri(this.capacityFree,t,n)}async getNervosDaoInfo(e){if(!await this.isNervosDao(e))return{};if(P(this.outputData)===0n){let t=await e.getCellWithHeader(this.outPoint);if(!t?.header)throw Error(`Unable to get header of a Nervos DAO deposited cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return{depositHeader:t.header}}let[t,n]=await Promise.all([e.getHeaderByNumber(Ct(this.outputData)),e.getCellWithHeader(this.outPoint)]);if(!n?.header||!t)throw Error(`Unable to get headers of a Nervos DAO withdrew cell ${this.outPoint.txHash}:${this.outPoint.index.toString()}`);return{depositHeader:t,withdrawHeader:n.header}}clone(){return e.from({outPoint:this.outPoint.clone(),cellOutput:this.cellOutput.clone(),outputData:this.outputData})}};let Xr=Lr=class extends j.Base(){constructor(e,t,n){super(),this.relative=e,this.metric=t,this.value=n}clone(){return Lr.from({relative:this.relative,metric:this.metric,value:this.value})}static from(e){return e instanceof Lr?e:typeof e==`object`&&`relative`in e?new Lr(e.relative,e.metric,P(e.value)):Lr.fromNum(e)}toNum(){return this.value|(this.relative===`absolute`?N:P(`0x8000000000000000`))|{blockNumber:P(`0x0000000000000000`),epoch:P(`0x2000000000000000`),timestamp:P(`0x4000000000000000`)}[this.metric]}static fromNum(e){let t=P(e),n=t>>P(63)===0n?`absolute`:`relative`,r=[`blockNumber`,`epoch`,`timestamp`][Number(t>>P(61)&P(3))],i=t&P(`0x00ffffffffffffff`);return new Lr(n,r,i)}};Xr=Lr=U([M(zt.mapIn(e=>Xr.from(e).toNum()))],Xr);let Z=Rr=class extends j.Base(){constructor(e,t,n,r){super(),this.previousOutput=e,this.since=t,this.cellOutput=n,this.outputData=r}static from(e){return e instanceof Rr?e:new Rr(J.from(`previousOutput`in e?e.previousOutput:e.outPoint),Xr.from(e.since??0).toNum(),H(Y.from,e.cellOutput),H(A,e.outputData))}async getCell(e){if(await this.completeExtraInfos(e),!this.cellOutput||!this.outputData)throw Error(`Unable to complete input`);return Yr.from({outPoint:this.previousOutput,cellOutput:this.cellOutput,outputData:this.outputData})}async completeExtraInfos(e){if(this.cellOutput&&this.outputData)return;let t=await e.getCell(this.previousOutput);t&&(this.cellOutput=t.cellOutput,this.outputData=t.outputData)}async getExtraCapacity(e){return(await this.getCell(e)).getDaoProfit(e)}clone(){return Rr.from({previousOutput:this.previousOutput.clone(),since:this.since,cellOutput:this.cellOutput?.clone(),outputData:this.outputData})}};Z=Rr=U([M(sn({since:Xr,previousOutput:J}).mapIn(e=>Z.from(e)))],Z);const Zr=B(Z);let Q=zr=class extends j.Base(){constructor(e,t){super(),this.outPoint=e,this.depType=t}static from(e){return e instanceof zr?e:new zr(J.from(e.outPoint),Gr(e.depType))}clone(){return zr.from({outPoint:this.outPoint.clone(),depType:this.depType})}};Q=zr=U([M(sn({outPoint:J,depType:Wr}))],Q);const Qr=B(Q);let $r=Br=class extends j.Base(){constructor(e,t,n){super(),this.lock=e,this.inputType=t,this.outputType=n}static from(e){return e instanceof Br?e:new Br(H(A,e.lock),H(A,e.inputType),H(A,e.outputType))}};$r=Br=U([M(an({lock:wn,inputType:wn,outputType:wn}))],$r);function ei(e){let t=x(e).subarray(0,16);return t.length===0?N:Ct(t)}const ti=an({version:It,cellDeps:Qr,headerDeps:Ln,inputs:Zr,outputs:Jr,outputsData:Tn});let $=q=class extends j.Base(){constructor(e,t,n,r,i,a,o){super(),this.version=e,this.cellDeps=t,this.headerDeps=n,this.inputs=r,this.outputs=i,this.outputsData=a,this.witnesses=o}static default(){return q.from({})}copy(e){if(e===this)return;let t=q.from(e);this.version=t.version,this.cellDeps=t.cellDeps,this.headerDeps=t.headerDeps,this.inputs=t.inputs,this.outputs=t.outputs,this.outputsData=t.outputsData,this.witnesses=t.witnesses}clone(){return q.from({version:this.version,cellDeps:this.cellDeps.map(e=>e.clone()),headerDeps:this.headerDeps.map(e=>e),inputs:this.inputs.map(e=>e.clone()),outputs:this.outputs.map(e=>e.clone()),outputsData:this.outputsData.map(e=>e),witnesses:this.witnesses.map(e=>e)})}static from(e){if(e instanceof q)return e.outputs.forEach((t,n)=>{e.outputs[n]=Y.from(t,e.outputsData[n]??`0x`)}),e;let t=e.outputs?.map((t,n)=>Y.from(t,e.outputsData?.[n]??[]))??[],n=t.map((t,n)=>A(e.outputsData?.[n]??`0x`));return e.outputsData!=null&&n.length<e.outputsData.length&&n.push(...e.outputsData.slice(n.length).map(e=>A(e))),new q(P(e.version??0),e.cellDeps?.map(e=>Q.from(e))??[],e.headerDeps?.map(A)??[],e.inputs?.map(e=>Z.from(e))??[],t,n,e.witnesses?.map(A)??[])}static fromLumosSkeleton(e){return q.from({version:0n,cellDeps:e.cellDeps.toArray(),headerDeps:e.headerDeps.toArray(),inputs:e.inputs.toArray().map((t,n)=>{if(!t.outPoint)throw Error(`outPoint is required in input`);return Z.from({previousOutput:t.outPoint,since:e.inputSinces.get(n,`0x0`),cellOutput:t.cellOutput,outputData:t.data})}),outputs:e.outputs.toArray().map(e=>e.cellOutput),outputsData:e.outputs.toArray().map(e=>e.data),witnesses:e.witnesses.toArray()})}stringify(){return JSON.stringify(this,(e,t)=>typeof t==`bigint`?F(t):t)}rawToBytes(){return ti.encode(this)}hash(){return pt(this.rawToBytes())}hashFull(){return pt(this.toBytes())}static hashWitnessToHasher(e,t){let n=x(A(e));t.update(bt(n.length,8)),t.update(n)}async getSignHashInfo(e,t,n=new ft){let r=K.from(e),i=-1;n.update(this.hash());for(let e=0;e<this.witnesses.length;e+=1){let a=this.inputs[e];if(a){let{cellOutput:n}=await a.getCell(t);if(!r.eq(n.lock))continue;i===-1&&(i=e)}if(i===-1)return;q.hashWitnessToHasher(this.witnesses[e],n)}if(i!==-1)return{message:n.digest(),position:i}}async findInputIndexByLockId(e,t){let n=K.from({...e,args:`0x`});for(let e=0;e<this.inputs.length;e+=1){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.codeHash===r.lock.codeHash&&n.hashType===r.lock.hashType)return e}}async findInputIndexByLock(e,t){let n=K.from(e);for(let e=0;e<this.inputs.length;e+=1){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.eq(r.lock))return e}}async findLastInputIndexByLock(e,t){let n=K.from(e);for(let e=this.inputs.length-1;e>=0;--e){let{cellOutput:r}=await this.inputs[e].getCell(t);if(n.eq(r.lock))return e}}addCellDeps(...e){e.flat().forEach(e=>{let t=Q.from(e);this.cellDeps.some(e=>e.eq(t))||this.cellDeps.push(t)})}addCellDepsAtStart(...e){e.flat().forEach(e=>{let t=Q.from(e);this.cellDeps.some(e=>e.eq(t))||this.cellDeps.unshift(t)})}async addCellDepInfos(e,...t){this.addCellDeps(await e.getCellDeps(...t))}async addCellDepsOfKnownScripts(e,...t){await Promise.all(t.flat().map(async t=>this.addCellDepInfos(e,(await e.getKnownScript(t)).cellDeps)))}setOutputDataAt(e,t){this.setOutputData(e,t)}setOutputData(e,t){let n=Ur(e);if(n>=this.outputs.length)throw Error(`Index ${e} is out of bounds for outputs of length ${this.outputs.length}`);this.outputsData.length<n&&this.outputsData.push(...Array.from(Array(n-this.outputsData.length),()=>`0x`));let r=A(t);this.outputs[n]=Y.from(this.outputs[n],r),this.outputsData[n]=r}getOutputData(e){let t=Hr(e);return t!==void 0&&t<this.outputs.length?this.outputsData[t]??`0x`:void 0}getInput(e){let t=Hr(e);return t===void 0?void 0:this.inputs[t]}addInput(e){return this.witnesses.length>this.inputs.length&&this.witnesses.splice(this.inputs.length,0,`0x`),this.inputs.push(Z.from(e))}getOutput(e){let t=Hr(e);if(!(t===void 0||t>=this.outputs.length))return X.from({cellOutput:this.outputs[t],outputData:this.outputsData[t]??`0x`})}get outputCells(){let{outputs:e,outputsData:t}=this;function*n(){for(let n=0;n<e.length;n++)yield X.from({cellOutput:e[n],outputData:t[n]??`0x`})}return n()}addOutput(e,t){let n=`cellOutput`in e?X.from(e):X.from({cellOutput:e,outputData:t}),r=this.outputs.push(n.cellOutput);return this.setOutputData(r-1,n.outputData),r}setOutput(e,t,n){let r=Ur(e);if(r>this.outputs.length)throw Error(`Index ${e} is out of bounds for outputs of length ${this.outputs.length}`);let i=`cellOutput`in t?X.from(t):X.from({cellOutput:t,outputData:n});r===this.outputs.length?this.addOutput(i):(this.outputs[r]=i.cellOutput,this.setOutputData(r,i.outputData))}setInput(e,t){let n=Ur(e);if(n>this.inputs.length)throw Error(`Index ${e} is out of bounds for inputs of length ${this.inputs.length}`);n===this.inputs.length?this.addInput(t):this.inputs[n]=Z.from(t)}getWitness(e){let t=Hr(e);return t===void 0?void 0:this.witnesses[t]}getWitnessArgs(e){try{return this.getWitnessArgsUnsafe(e)}catch{return}}getWitnessArgsUnsafe(e){let t=this.getWitness(e);return t&&t!==`0x`?$r.fromBytes(t):void 0}setWitnessArgs(e,t){this.setWitness(e,$r.from(t).toBytes())}setWitness(e,t){let n=Ur(e);this.witnesses.length<n&&this.witnesses.push(...Array.from(Array(n-this.witnesses.length),()=>`0x`)),this.witnesses[n]=A(t)}getWitnessArgsAt(e){return this.getWitnessArgs(e)}getWitnessArgsAtUnsafe(e){return this.getWitnessArgsUnsafe(e)}setWitnessArgsAt(e,t){this.setWitnessArgs(e,t)}setWitnessAt(e,t){this.setWitness(e,t)}async prepareSighashAllWitness(e,t,n){let r=await this.findInputIndexByLock(e,n);if(r===void 0)return;let i=this.getWitnessArgs(r)??$r.from({});i.lock=A(Array.from(Array(t),()=>0)),this.setWitnessArgs(r,i)}async getInputsCapacityExtra(e){return Kn(this.inputs,async(t,n)=>t+await n.getExtraCapacity(e),N)}async getInputsCapacity(e){return await Kn(this.inputs,async(t,n)=>{let{cellOutput:{capacity:r}}=await n.getCell(e);return t+r},N)+await this.getInputsCapacityExtra(e)}getOutputsCapacity(){return this.outputs.reduce((e,{capacity:t})=>e+t,N)}async getInputsUdtBalance(e,t){return Kn(this.inputs,async(n,r)=>{let{cellOutput:i,outputData:a}=await r.getCell(e);if(i.type?.eq(t))return n+ei(a)},N)}getOutputsUdtBalance(e){return this.outputs.reduce((t,n,r)=>n.type?.eq(e)?t+ei(this.outputsData[r]):t,N)}async completeInputs(e,t,n,r){let i=[],a=r,o=!1;for await(let r of e.findCells(t,!0)){if(this.inputs.some(({previousOutput:e})=>e.eq(r.outPoint)))continue;let e=i.push(r),t=await Promise.resolve(n(a,r,e-1,i));if(t===void 0){o=!0;break}a=t}return i.forEach(e=>this.addInput(e)),o?{addedCount:i.length}:{addedCount:i.length,accumulated:a}}async completeInputsByCapacity(e,t,n){let r=this.getOutputsCapacity()+P(t??0),i=await this.getInputsCapacity(e.client);if(i>=r)return 0;let{addedCount:a,accumulated:o}=await this.completeInputs(e,n??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},(e,{cellOutput:{capacity:t}})=>{let n=e+t;return n>=r?void 0:n},i);if(o===void 0)return a;throw new Nr(r-o)}async completeInputsAll(e,t){let{addedCount:n}=await this.completeInputs(e,t??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},(e,{cellOutput:{capacity:t}})=>e+t,N);return n}async completeInputsByUdt(e,t,n){let r=K.from(t).occupiedSize,i=this.getOutputsUdtBalance(t)+P(n??0);if(i===0n)return 0;let[a,o]=await Kn(this.inputs,async([n,r],i)=>{let{cellOutput:a,outputData:o}=await i.getCell(e.client);if(a.type?.eq(t))return[n+ei(o),r+1]},[N,0]);if(a===i||a>=i&&o>=2)return 0;let{addedCount:s,accumulated:c}=await this.completeInputs(e,{script:t,scriptLenRange:[r,r+1],outputDataLenRange:[16,P(`0xffffffff`)]},(e,{outputData:t},n,r)=>{let a=e+ei(t);return a===i||a>=i&&o+r.length>=2?void 0:a},a);if(c===void 0||c>=i)return s;throw new Pr(i-c,t)}async completeInputsAddOne(e,t){let{addedCount:n,accumulated:r}=await this.completeInputs(e,t??{scriptLenRange:[0,1],outputDataLenRange:[0,1]},()=>void 0,!0);if(r===void 0)return n;throw Error(`Insufficient CKB, need at least one new cell`)}async completeInputsAtLeastOne(e,t){return this.inputs.length>0?0:this.completeInputsAddOne(e,t)}async getFee(e){return await this.getInputsCapacity(e)-this.getOutputsCapacity()}async getFeeRate(e){return await this.getFee(e)*P(1e3)/P(this.toBytes().length+4)}estimateFee(e){return(P(this.toBytes().length+4)*P(e)+P(999))/P(1e3)}async completeFee(e,t,n,r,i){let a=n??await e.client.getFeeRate(i?.feeRateBlockRange,i);await this.getInputsCapacity(e.client);let o=N,s=N,c=0,l=this;for(;;){c+=await(async()=>{if(!(i?.shouldAddInputs??!0))return 0;try{return await l.completeInputsByCapacity(e,o+s,r)}catch(e){throw e instanceof Nr&&s!==0n?new Nr(e.amount,{isForChange:!0}):e}})(),l=await e.prepareTransaction(l);let n=await l.getFee(e.client);if(n<o+s)throw new Nr(o+s-n,{isForChange:s!==N});if(o===0n&&(o=l.estimateFee(a)),n===o)return this.copy(l),[c,!1];let u=l.clone(),d=P(await Promise.resolve(t(u,n-o)));if(d>0n){s=d;continue}if(await u.getFee(e.client)!==o)throw Error(`The change function doesn't use all available capacity`);u=await e.prepareTransaction(u);let f=u.estimateFee(a);if(o>f)throw Error(`The change function removed existed transaction data`);if(o===f)return this.copy(u),[c,!0];o=f}}completeFeeChangeToLock(e,t,n,r,i){let a=K.from(t);return this.completeFee(e,(e,t)=>{let n=Y.from({capacity:0,lock:a}),r=gt(n.occupiedSize);return t<r?r:(n.capacity=t,e.addOutput(n),0)},n,r,i)}async completeFeeBy(e,t,n,r){let{script:i}=await e.getRecommendedAddressObj();return this.completeFeeChangeToLock(e,i,t,n,r)}completeFeeChangeToOutput(e,t,n,r,i){let a=Number(P(t));if(!this.outputs[a])throw Error(`Non-existed output to change`);return this.completeFee(e,(e,t)=>(e.outputs[a].capacity+=t,0),n,r,i)}};$=q=U([M(an({raw:ti,witnesses:Tn}).mapIn(e=>{let t=$.from(e);return{raw:t,witnesses:t.witnesses}}).mapOut(e=>$.from({...e.raw,witnesses:e.witnesses})))],$);async function ni(e,t){if(e.outputs.length<=64)return!1;let{codeHash:n,hashType:r}=await t.getKnownScript(`NervosDao`),i=K.from({codeHash:n,hashType:r,args:`0x`});if(e.outputs.some(e=>e.type?.eq(i)))return!0;for(let n of e.inputs)if(await n.completeExtraInfos(t),n.cellOutput?.type?.eq(i))return!0;return!1}function ri(e,t,n){let r=lr.from(t),i=lr.from(n),a=P(e);return a*i.dao.ar/r.dao.ar-a}function ii(e,t){let n=lr.from(e).epoch.normalizeBase(),r=lr.from(t).epoch.normalizeBase(),i=P(180),a=(r.integer-n.integer)%i,o=r.integer;return(a!==0n||n.numerator*r.denominator<r.numerator*n.denominator)&&(o+=-a+i),G.from([o,n.numerator,n.denominator])}const ai=P(5e5);function oi(e,t,n){if(!t)return!0;let r=A(e),i=A(t);return!(n===`exact`&&r!==i||n===`prefix`&&!r.startsWith(i)||n===`partial`&&r.search(i)===-1)}function si(e,t,n){if(!t)return!0;if(!e)return!1;let r=K.from(e),i=K.from(t);return r.codeHash!==i.codeHash||r.hashType!==i.hashType?!1:oi(r.args,i?.args,n)}function ci(e,t){if(!t)return!0;let n=P(e),[r,i]=nr(t);return r<=n&&n<i}function li(e,t){return!t||ci(e?x(K.from(e).args).length+33:0,t)}function ui(e,t){let n=sr.from(e),r=Yr.from(t);return!(n.scriptType===`lock`&&(!si(r.cellOutput.lock,n.script,n.scriptSearchMode)||!si(r.cellOutput.type,n.filter?.script,`prefix`)||!li(r.cellOutput.type,n.filter?.scriptLenRange))||n.scriptType===`type`&&(!si(r.cellOutput.type,n.script,n.scriptSearchMode)||!si(r.cellOutput.lock,n.filter?.script,`prefix`)||!li(r.cellOutput.lock,n.filter?.scriptLenRange))||!oi(r.outputData,n.filter?.outputData,n.filter?.outputDataSearchMode??`prefix`)||!ci(x(r.outputData).length,n.filter?.outputDataLenRange)||!ci(r.cellOutput.capacity,n.filter?.outputCapacityRange))}var di=class extends Map{constructor(e){if(super(),this.capacity=e,this.lru=new Set,!Number.isInteger(e)||e<1)throw Error(`Capacity must be a positive integer`)}get(e){if(super.has(e))return this.lru.delete(e),this.lru.add(e),super.get(e)}set(e,t){if(super.set(e,t),this.lru.delete(e),this.lru.add(e),this.lru.size>this.capacity){let e=this.lru.keys().next().value;this.delete(e)}return this}delete(e){return super.delete(e)?(this.lru.delete(e),!0):!1}clear(){super.clear(),this.lru.clear()}};const fi=Object.freeze({NervosDao:{codeHash:`0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c`,index:2},depType:`code`}}]},Secp256k1Blake160:{codeHash:`0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}}]},Secp256k1Multisig:{codeHash:`0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:1},depType:`depGroup`}}]},Secp256k1MultisigV2Beta:{codeHash:`0xd1a9f877aed3f5e07cb9c52b61ab96d06f250ae6883cc7f0a2423db0976fc821`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x44be4f4feda80c0e41783ab10e191df3b2bb5c3731b0970c916dbec385dcdc60`,index:0},depType:`depGroup`}}]},Secp256k1MultisigV2:{codeHash:`0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738`,index:0},depType:`depGroup`}}]},AnyoneCanPay:{codeHash:`0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x4153a2014952d7cac45f285ce9a7c5c0c0e1b21f2d378b82ac1433cb11c25c4d`,index:0},depType:`depGroup`}}]},TypeId:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,cellDeps:[]},SUdt:{codeHash:`0x5e7a36a77e68eecc013dfa2fe6a23f3b6c344b04005808694ae6dd45eea4cfd5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xc7813f6a415144643970c2e88e0bb6ca6a8edc5dd7c1022746f628284a9936d5`,index:0},depType:`code`}}]},XUdt:{codeHash:`0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xc07844ce21b38e4b071dd0e1ee3b0e27afd8d7532491327f39b786343f558ab7`,index:0},depType:`code`}}]},JoyId:{codeHash:`0xd00c84f0ec8fd441c38bc3f87a371f547190f2fcff88e642bc5bf54b9e318323`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x2d1f2d4d1514ccc3bb4f04f5437a5ae30d00636ee57cedd2c70ab3ea75b62adc`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xc086090432098835ec542a1b94bdd1b842c5aa1ccd1616873fe77f4a04044417`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:2},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x165b225c6fbed7e655b024384d9083de3243375f9893706f4452858ecd694e96`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:3},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xafb8408d0094ab944e6286aac750b9bb854ac0bcb66dfe5c60559744a700e70c`}},{cellDep:{outPoint:{txHash:`0x8a605a4402cadda69fa64fd25cbbd74058e3eb86a7a72aee3d25df278564d31b`,index:4},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x773bf0647be24b4e18ef44068fd069b9de5549c4b86be227779ceb9179598ec4`}}]},COTA:{codeHash:`0x1122a4fb54697cf2e6e3a96c9d80fd398a936559b90954c6e88eb7ba0cf652df`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xabaa25237554f0d6c586dc010e7e85e6870bcfd9fb8773257ecacfbe1fd738a0`,index:0},depType:`depGroup`}}]},PWLock:{codeHash:`0xbf43c3602455798c1a61a596e0d95278864c552fafe231c063b3fabf97a8febc`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0x1d60cb8f4666e039f418ea94730b1a8c5aa0bf2f7781474406387462924d15d4`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x42ade2f25eb938b5dbfd3d8f07b8b07aa593d848e7ff14bdfbbea5aeb6175261`}}]},OmniLock:{codeHash:`0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0xc76edf469816aa22f416503c38d0b533d2a018e253e379f134c3985b3472c842`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x855508fe0f0ca25b935b070452ecaee48f6c9f1d66cd15f046616b99e948236a`}}]},NostrLock:{codeHash:`0x641a89ad2f77721b803cd50d01351c1f308444072d5fa20088567196c0574c68`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x99b116dd1e4f1fa903b70112ae672c18bb34241d3d03a9ad555cd2a611be7327`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xfad8cb75eb0bb01718e2336002064568bc05887af107f74ed5dd501829e192f8`}}]},UniqueType:{codeHash:`0x2c8c11c985da60b0a330c61a85507416d6382c130ba67f0c47ab071e00aec628`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x67524c01c0cb5492e499c7c7e406f2f9d823e162d6b0cf432eacde0c9808c2ad`,index:0},depType:`code`}}]},DidCkb:{codeHash:`0x4a06164dc34dccade5afe3e847a97b6db743e79f5477fa3295acf02849c5984a`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe2f74c56cdc610d2b9fe898a96a80118845f5278605d7f9ad535dad69ae015bf`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,args:`0x55573ef6d78e3ca75170ff476176732309a8b31efe94320a954ded3d75c2cb18`,hashType:`type`}}]},AlwaysSuccess:{codeHash:`0x3b521cc4b552f109d092d8cc468a8048acb53c5952dbe769d2b2f9cf6e47f7f1`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:0},depType:`code`}}]},InputTypeProxyLock:{codeHash:`0x5123908965c711b0ffd8aec642f1ede329649bda1ebdca6bd24124d3796f768a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:1},depType:`code`}}]},OutputTypeProxyLock:{codeHash:`0x2df53b592db3ae3685b7787adcfef0332a611edb83ca3feca435809964c3aff2`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:2},depType:`code`}}]},LockProxyLock:{codeHash:`0x5d41e32e224c15f152b7e6529100ebeac83b162f5f692a5365774dad2c1a1d02`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:3},depType:`code`}}]},SingleUseLock:{codeHash:`0x8290467a512e5b9a6b816469b0edabba1f4ac474e28ffdd604c2a7c76446bbaf`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:4},depType:`code`}}]},TypeBurnLock:{codeHash:`0xff78bae0abf17d7a404c0be0f9ad9c9185b3f88dcc60403453d5ba8e1f22f53a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x10d63a996157d32c01078058000052674ca58d15f921bec7f1dcdac2160eb66b`,index:5},depType:`code`}}]},EasyToDiscoverType:{codeHash:`0xaba4430cc7110d699007095430a1faa72973edf2322ddbfd4d1d219cacf237af`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb0ed754fb27d67fd8388c97fed914fb7998eceaa01f3e6f967e498de1ba0ac9b`,index:0},depType:`code`}}]},TimeLock:{codeHash:`0x6fac4b2e89360a1e692efcddcb3a28656d8446549fb83da6d896db8b714f4451`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb0ed754fb27d67fd8388c97fed914fb7998eceaa01f3e6f967e498de1ba0ac9b`,index:1},depType:`code`}}]}});var pi=class{constructor(e,t=3e4){this.url=e,this.timeout=t}async request(e){let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{return await(await fetch(this.url,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:t.signal})).json()}finally{clearTimeout(n)}}},mi=class e{constructor(e,t=3e4){this.url=e,this.timeout=t,this.ongoing=new Map,this.disposed=!1}static open(t,n=3e4){return new Gn(new e(t,n),e=>e.dispose())}request(e){if(this.disposed)return Promise.reject(Error(`Cannot use a disposed JsonRpcTransportWebSocket`));let[t,r]=(()=>{if(this.socket&&this.socket.readyState!==this.socket.CLOSING&&this.socket.readyState!==this.socket.CLOSED&&this.openSocket)return[this.socket,this.openSocket];let e=new n.default(this.url),t=({data:e})=>{let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t||typeof t.id!=`number`&&typeof t.id!=`string`)return;let n=t.id,r=this.ongoing.get(n);if(!r)return;let[i,a,o]=r;clearTimeout(o),this.ongoing.delete(n),i(t)},r=()=>{this.ongoing.forEach(([e,t,n])=>{clearTimeout(n),t(Error(`Connection closed`))}),this.ongoing.clear()};return e.onclose=r,e.onerror=r,e.onmessage=t,this.socket=e,this.openSocket=new Promise(t=>{e.readyState===e.OPEN?t(e):e.onopen=()=>{t(e)}}),[e,this.openSocket]})();return new Promise((n,i)=>{let a=[n,i,setTimeout(()=>{this.ongoing.delete(e.id),t.close(),i(Error(`Request timeout`))},this.timeout)];this.ongoing.set(e.id,a),r.then(t=>{this.ongoing.has(e.id)&&(t.readyState===t.CLOSED||t.readyState===t.CLOSING?(clearTimeout(a[2]),this.ongoing.delete(e.id),i(Error(`Connection closed`))):t.send(JSON.stringify(e)))}).catch(t=>{clearTimeout(a[2]),this.ongoing.delete(e.id),i(t)})})}async dispose(){this.disposed=!0;let e=this.socket;e&&e.readyState!==e.CLOSED&&await new Promise(t=>{e.addEventListener(`close`,()=>t(),{once:!0}),e.close()})}};function hi(e,t){return e.startsWith(`wss://`)||e.startsWith(`ws://`)?mi.open(e,t?.timeout):new Gn(new pi(e,t?.timeout),()=>{})}var gi=class e{static hashTypeFrom(e){return Tr(e)}static hashTypeTo(e){return e}static depTypeFrom(e){switch(Gr(e)){case`code`:return`code`;case`depGroup`:return`dep_group`}}static depTypeTo(e){switch(e){case`code`:return`code`;case`dep_group`:return`depGroup`}}static scriptFrom(t){let n=K.from(t);return{code_hash:n.codeHash,hash_type:e.hashTypeFrom(n.hashType),args:n.args}}static scriptTo(t){return K.from({codeHash:t.code_hash,hashType:e.hashTypeTo(t.hash_type),args:t.args})}static outPointFrom(e){let t=J.from(e);return{index:F(t.index),tx_hash:t.txHash}}static outPointTo(e){return J.from({index:e.index,txHash:e.tx_hash})}static cellInputFrom(t){let n=Z.from(t);return{previous_output:e.outPointFrom(n.previousOutput),since:F(n.since)}}static cellInputTo(t){return Z.from({previousOutput:e.outPointTo(t.previous_output),since:t.since})}static cellOutputFrom(t,n){let r=Y.from(t,n);return{capacity:F(r.capacity),lock:e.scriptFrom(r.lock),type:H(e.scriptFrom,r.type)}}static cellOutputTo(t){return Y.from({capacity:t.capacity,lock:e.scriptTo(t.lock),type:H(e.scriptTo,t.type)})}static cellDepFrom(t){return{out_point:e.outPointFrom(t.outPoint),dep_type:e.depTypeFrom(t.depType)}}static cellDepTo(t){return Q.from({outPoint:e.outPointTo(t.out_point),depType:e.depTypeTo(t.dep_type)})}static transactionFrom(t){let n=$.from(t);return{version:F(n.version),cell_deps:n.cellDeps.map(t=>e.cellDepFrom(t)),header_deps:n.headerDeps,inputs:n.inputs.map(t=>e.cellInputFrom(t)),outputs:n.outputs.map(t=>e.cellOutputFrom(t)),outputs_data:n.outputsData,witnesses:n.witnesses}}static transactionTo(t){return $.from({version:t.version,cellDeps:t.cell_deps.map(t=>e.cellDepTo(t)),headerDeps:t.header_deps,inputs:t.inputs.map(t=>e.cellInputTo(t)),outputs:t.outputs.map(t=>e.cellOutputTo(t)),outputsData:t.outputs_data,witnesses:t.witnesses})}static transactionResponseTo({cycles:t,tx_status:{status:n,block_number:r,block_hash:i,tx_index:a,reason:o},transaction:s}){if(s!=null)return ar.from({transaction:e.transactionTo(s),status:n,cycles:H(P,t),blockHash:H(A,i),blockNumber:H(P,r),txIndex:H(P,a),reason:o})}static blockHeaderTo(e){let t=x(e.dao);return{compactTarget:P(e.compact_target),dao:{c:wt(t.subarray(0,8)),ar:wt(t.subarray(8,16)),s:wt(t.subarray(16,24)),u:wt(t.subarray(24,32))},epoch:G.fromNum(e.epoch),extraHash:e.extra_hash,hash:e.hash,nonce:P(e.nonce),number:P(e.number),parentHash:e.parent_hash,proposalsHash:e.proposals_hash,timestamp:P(e.timestamp),transactionsRoot:e.transactions_root,version:P(e.version)}}static blockUncleTo(t){return{header:e.blockHeaderTo(t.header),proposals:t.proposals}}static blockTo(t){return{header:e.blockHeaderTo(t.header),proposals:t.proposals,transactions:t.transactions.map(t=>e.transactionTo(t)),uncles:t.uncles.map(t=>e.blockUncleTo(t))}}static rangeFrom([e,t]){return[F(e),F(t)]}static indexerSearchKeyFilterFrom(t){return{script:H(e.scriptFrom,t.script),script_len_range:H(e.rangeFrom,t.scriptLenRange),output_data:t.outputData,output_data_filter_mode:t.outputDataSearchMode,output_data_len_range:H(e.rangeFrom,t.outputDataLenRange),output_capacity_range:H(e.rangeFrom,t.outputCapacityRange),block_range:H(e.rangeFrom,t.blockRange)}}static indexerSearchKeyFrom(t){let n=sr.from(t);return{script:e.scriptFrom(n.script),script_type:n.scriptType,script_search_mode:n.scriptSearchMode,filter:H(e.indexerSearchKeyFilterFrom,n.filter),with_data:n.withData}}static findCellsResponseTo({last_cursor:t,objects:n}){return{lastCursor:t,cells:n.map(t=>Yr.from({outPoint:e.outPointTo(t.out_point),cellOutput:e.cellOutputTo(t.output),outputData:t.output_data??`0x`}))}}static indexerSearchKeyTransactionFrom(t){let n=cr.from(t);return{script:e.scriptFrom(n.script),script_type:n.scriptType,script_search_mode:n.scriptSearchMode,filter:H(e.indexerSearchKeyFilterFrom,n.filter),group_by_transaction:n.groupByTransaction}}static findTransactionsResponseTo({last_cursor:e,objects:t}){return t.length===0?{lastCursor:e,transactions:[]}:`io_index`in t[0]?{lastCursor:e,transactions:t.map(e=>({txHash:e.tx_hash,blockNumber:P(e.block_number),txIndex:P(e.tx_index),cellIndex:P(e.io_index),isInput:e.io_type===`input`}))}:{lastCursor:e,transactions:t.map(e=>({txHash:e.tx_hash,blockNumber:P(e.block_number),txIndex:P(e.tx_index),cells:e.cells.map(([e,t])=>({isInput:e===`input`,cellIndex:P(t)}))}))}}};const _i=Object.freeze({NervosDao:{codeHash:`0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x8f8c79eb6671709633fe6a46de93c0fedc9c1b8a6527a18d3983879542635c9f`,index:2},depType:`code`}}]},Secp256k1Blake160:{codeHash:`0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}}]},Secp256k1Multisig:{codeHash:`0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:1},depType:`depGroup`}}]},Secp256k1MultisigV2Beta:{codeHash:`0x765b3ed6ae264b335d07e73ac332bf2c0f38f8d3340ed521cb447b4c42dd5f09`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf2013f123b2cb745e3fdf5c935a3925647496f88090503eef58332a9245b4172`,index:0},depType:`depGroup`}}]},Secp256k1MultisigV2:{codeHash:`0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x2eefdeb21f3a3edf697c28a52601b4419806ed60bb427420455cc29a090b26d5`,index:0},depType:`depGroup`}}]},AnyoneCanPay:{codeHash:`0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6`,index:0},depType:`depGroup`}}]},TypeId:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,cellDeps:[]},SUdt:{codeHash:`0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xe12877ebd2c3c364dc46c5c992bcfaf4fee33fa13eebdf82c591fc9825aab769`,index:0},depType:`code`}}]},XUdt:{codeHash:`0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xbf6fb538763efec2a70a6a3dcb7242787087e1030c4e7d86585bc63a9d337f5f`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x44ec8b96663e06cc94c8c468a4d46d7d9af69eaf418f6390c9f11bb763dda0ae`}}]},JoyId:{codeHash:`0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x4a596d31dc35e88fb1591debbf680b04a44b4a434e3a94453c21ea8950ffb4d9`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x1c9fc299ba0570d077b4d7fb9acff1ccc0de69d369942d82678bae937c44ec30`}},{cellDep:{outPoint:{txHash:`0x4a596d31dc35e88fb1591debbf680b04a44b4a434e3a94453c21ea8950ffb4d9`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x27f0d3ccdc2fcd52ae31fbacad5f86b97bc147d7093e4807cd6e3d21c1fe6841`}},{cellDep:{outPoint:{txHash:`0xf2c9dbfe7438a8c622558da8fa912d36755271ea469d3a25cb8d3373d35c8638`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x0ac15fe5b2d059ec39de03f2d3159d5463abb918a1a07a9fa00d2b9c61d89ef3`}},{cellDep:{outPoint:{txHash:`0x95ecf9b41701b45d431657a67bbfa3f07ef7ceb53bf87097f3674e1a4a19ce62`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xc7bafc5550ccad7cea32c27764f5df6aca4de547da65e3e67fa08477a1af7f5e`}},{cellDep:{outPoint:{txHash:`0x8b3255491f3c4dcc1cfca33d5c6bcaec5409efe4bbda243900f9580c47e0242e`,index:1},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x71decef9ca8725e64ec99a5521790d16b8d5daadb4989b45dd6ab51806a8c0e4`}}]},COTA:{codeHash:`0x89cd8003a0eaf8e65e0c31525b7d1d5c1becefd2ea75bb4cff87810ae37764d8`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x636a786001f87cb615acfcf408be0f9a1f077001f0bbc75ca54eadfe7e221713`,index:0},depType:`depGroup`}}]},PWLock:{codeHash:`0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0x57a62003daeab9d54aa29b944fc3b451213a5ebdf2e232216a3cfed0dde61b38`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xf6d90bfe3041d0fd7e01c45770241697f5f837974bd6ae1672a7ec0f9f523268`}}]},OmniLock:{codeHash:`0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37`,index:0},depType:`depGroup`}},{cellDep:{outPoint:{txHash:`0xec18bf0d857c981c3d1f4e17999b9b90c484b303378e94de1a57b0872f5d4602`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x761f51fc9cd6a504c32c6ae64b3746594d1af27629b427c5ccf6c9a725a89144`}}]},NostrLock:{codeHash:`0x6ae5ee0cb887b2df5a9a18137315b9bdc55be8d52637b2de0624092d5f0c91d5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xa2a434dcdbe280b9ed75bb7d6c7d68186a842456aba0fc506657dc5ed7c01d68`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0x8dc56c6f35f0c535e23ded1629b1f20535477a1b43e59f14617d11e32c50e0aa`}}]},UniqueType:{codeHash:`0x8e341bcfec6393dcd41e635733ff2dca00a6af546949f70c57a706c0f344df8b`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0xff91b063c78ed06f10a1ed436122bd7d671f9a72ef5f5fa28d05252c17cf4cef`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,hashType:`type`,args:`0xe04976b67600fd25ac50305f77b33aee2c12e3c18e63ece9119e5b32117884b5`}}]},DidCkb:{codeHash:`0x510150477b10d6ab551a509b71265f3164e9fd4137fcb5a4322f49f03092c7c5`,hashType:`type`,cellDeps:[{cellDep:{outPoint:{txHash:`0x0e7a830e2d5ebd05cd45a55f93f94559edea0ef1237b7233f49f7facfb3d6a6c`,index:0},depType:`code`},type:{codeHash:`0x00000000000000000000000000000000000000000000000000545950455f4944`,args:`0x3c27695173b888ed44ddf36f901789014384ad6c05a9137f3db9a0779c141c35`,hashType:`type`}}]},AlwaysSuccess:{codeHash:`0x3b521cc4b552f109d092d8cc468a8048acb53c5952dbe769d2b2f9cf6e47f7f1`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:0},depType:`code`}}]},InputTypeProxyLock:{codeHash:`0x5123908965c711b0ffd8aec642f1ede329649bda1ebdca6bd24124d3796f768a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:1},depType:`code`}}]},OutputTypeProxyLock:{codeHash:`0x2df53b592db3ae3685b7787adcfef0332a611edb83ca3feca435809964c3aff2`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:2},depType:`code`}}]},LockProxyLock:{codeHash:`0x5d41e32e224c15f152b7e6529100ebeac83b162f5f692a5365774dad2c1a1d02`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:3},depType:`code`}}]},SingleUseLock:{codeHash:`0x8290467a512e5b9a6b816469b0edabba1f4ac474e28ffdd604c2a7c76446bbaf`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:4},depType:`code`}}]},TypeBurnLock:{codeHash:`0xff78bae0abf17d7a404c0be0f9ad9c9185b3f88dcc60403453d5ba8e1f22f53a`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0xb4f171c9c9caf7401f54a8e56225ae21d95032150a87a4678eac3f66a3137b93`,index:5},depType:`code`}}]},EasyToDiscoverType:{codeHash:`0xaba4430cc7110d699007095430a1faa72973edf2322ddbfd4d1d219cacf237af`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x1b4ffcad55ecd36ffb2715b6816b83da73851f1a24fe594f263c4f34dad90792`,index:0},depType:`code`}}]},TimeLock:{codeHash:`0x6fac4b2e89360a1e692efcddcb3a28656d8446549fb83da6d896db8b714f4451`,hashType:`data1`,cellDeps:[{cellDep:{outPoint:{txHash:`0x1b4ffcad55ecd36ffb2715b6816b83da73851f1a24fe594f263c4f34dad90792`,index:1},depType:`code`}}]}});function vi(e){try{let{words:n,prefix:r}=t.bech32m.decode(e,xi),i=t.bech32m.fromWords(n),a=i[0],o=i.slice(1);if(a===0)return{prefix:r,format:0,payload:o}}catch{}try{let{prefix:n,words:r}=t.bech32.decode(e,xi),i=t.bech32.fromWords(r),a=i[0],o=i.slice(1);if([2,4,1].includes(a))return{prefix:n,format:a,payload:o}}catch{}throw Error(`Unknown address format ${e}`)}async function yi(e,t,n,r){if(t===0){if(n.length<33)throw Error(`Invalid full address without enough payload ${A(n)}`);return{script:{codeHash:n.slice(0,32),hashType:Dr(n.slice(32,33)),args:n.slice(33)},prefix:e}}if(t===2){if(n.length<32)throw Error(`Invalid full data address without enough payload ${A(n)}`);return{script:{codeHash:n.slice(0,32),hashType:`data`,args:n.slice(32)},prefix:e}}if(t===4){if(n.length<32)throw Error(`Invalid full type address without enough payload ${A(n)}`);return{script:{codeHash:n.slice(0,32),hashType:`type`,args:n.slice(32)},prefix:e}}if(n.length!==21)throw Error(`Invalid short address without enough payload ${A(n)}`);let i=[`Secp256k1Blake160`,`Secp256k1Multisig`,`AnyoneCanPay`][n[0]];if(i===void 0)throw Error(`Invalid short address with unknown script ${A(n)}`);return{script:await K.fromKnownScript(r,i,n.slice(1)),prefix:e}}let bi=function(e){return e[e.Full=0]=`Full`,e[e.Short=1]=`Short`,e[e.FullData=2]=`FullData`,e[e.FullType=4]=`FullType`,e}({});const xi=1023;var Si=class{static infoFrom(e){return{type:e.type,sign_type:e.signType,name:e.name,icon:e.icon}}static infoTo(e){return{type:e.type,signType:e.sign_type,name:e.name,icon:e.icon}}static messageFrom(e){return typeof e==`string`?{type:`string`,value:e}:{type:`bytes`,value:A(e)}}static messageTo(e){if(!Ci(e)||typeof e.value!=`string`)throw Error(`Invalid signer message`);if(e.type===`string`)return e.value;if(e.type===`bytes`)return x(e.value);throw Error(`Invalid signer message type`)}};function Ci(e){return typeof e==`object`&&!!e}Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return br}}),Object.defineProperty(exports,"$n",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"$r",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(exports,"An",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,"Ar",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,"Bn",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,"Br",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(exports,"Cr",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,"Dr",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(exports,"Er",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(exports,"Fn",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,"Fr",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return En}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(exports,"Gn",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,"Gr",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return On}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(exports,"Hn",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(exports,"Hr",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(exports,"In",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(exports,"Ir",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return Dn}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,"Jn",{enumerable:!0,get:function(){return At}}),Object.defineProperty(exports,"Jr",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"Kn",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,"Kr",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(exports,"Ln",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(exports,"Lr",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(exports,"Mn",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,"Mr",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(exports,"Nn",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,"Nr",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,"Or",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ri}}),Object.defineProperty(exports,"Pn",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,"Pr",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(exports,"Qn",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,"Qr",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return ni}}),Object.defineProperty(exports,"Rn",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,"Rr",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(exports,"Sr",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return en}}),Object.defineProperty(exports,"Tr",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,"Un",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(exports,"Ur",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return Mn}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(exports,"Vn",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(exports,"Vr",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return An}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,"Wn",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(exports,"Wr",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,"Xn",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"Xr",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(exports,"Yn",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"Yr",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(exports,"Zn",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"Zr",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return si}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"_r",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(exports,"ar",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return on}}),Object.defineProperty(exports,"br",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return hi}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(exports,"cr",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(exports,"dr",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,"er",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return un}}),Object.defineProperty(exports,"fr",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,"gr",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(exports,"hr",{enumerable:!0,get:function(){return 20}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(exports,"ir",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"jn",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,"jr",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(exports,"kn",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(exports,"kr",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(exports,"lr",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(exports,"mr",{enumerable:!0,get:function(){return 32}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return xi}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,"nr",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return _i}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(exports,"or",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return di}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,"pr",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,"qn",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,"qr",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,"rr",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return gi}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(exports,"sr",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Si}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(exports,"tr",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return pi}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,"ur",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return li}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,"vr",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return er}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(exports,"wr",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"xr",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Yr}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return an}}),Object.defineProperty(exports,"yr",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(exports,"zn",{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,"zr",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return In}});
|
|
2
|
+
//# sourceMappingURL=transformers-0FqvcPy2.js.map
|