var Xh=Object.create;var xo=Object.defineProperty;var ef=Object.getOwnPropertyDescriptor;var tf=Object.getOwnPropertyNames;var nf=Object.getPrototypeOf,rf=Object.prototype.hasOwnProperty;var of=(e,t,r)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ga=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var sf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tf(t))!rf.call(e,i)&&i!==r&&xo(e,i,{get:()=>t[i],enumerable:!(n=ef(t,i))||n.enumerable});return e};var ba=(e,t,r)=>(r=e!=null?Xh(nf(e)):{},sf(t||!e||!e.__esModule?xo(r,"default",{value:e,enumerable:!0}):r,e));var J=(e,t,r)=>of(e,typeof t!="symbol"?t+"":t,r);var Fl=ga((Dl,Bl)=>{var Ml=(function(){var e=function(y,v){var m=236,C=17,E=y,O=r[v],_=null,S=0,R=null,A=[],T={},N=function(U,F){S=E*4+17,_=(function(D){for(var k=new Array(D),j=0;j=7&&Z(U),R==null&&(R=G(E,O,A)),P(R,F)},x=function(U,F){for(var D=-1;D<=7;D+=1)if(!(U+D<=-1||S<=U+D))for(var k=-1;k<=7;k+=1)F+k<=-1||S<=F+k||(0<=D&&D<=6&&(k==0||k==6)||0<=k&&k<=6&&(D==0||D==6)||2<=D&&D<=4&&2<=k&&k<=4?_[U+D][F+k]=!0:_[U+D][F+k]=!1)},I=function(){for(var U=0,F=0,D=0;D<8;D+=1){N(!0,D);var k=i.getLostPoint(T);(D==0||U>k)&&(U=k,F=D)}return F},L=function(){for(var U=8;U>D&1)==1;_[Math.floor(D/3)][D%3+S-8-3]=k}for(var D=0;D<18;D+=1){var k=!U&&(F>>D&1)==1;_[D%3+S-8-3][Math.floor(D/3)]=k}},K=function(U,F){for(var D=O<<3|F,k=i.getBCHTypeInfo(D),j=0;j<15;j+=1){var M=!U&&(k>>j&1)==1;j<6?_[j][8]=M:j<8?_[j+1][8]=M:_[S-15+j][8]=M}for(var j=0;j<15;j+=1){var M=!U&&(k>>j&1)==1;j<8?_[8][S-j-1]=M:j<9?_[8][15-j-1+1]=M:_[8][15-j-1]=M}_[S-8][8]=!U},P=function(U,F){for(var D=-1,k=S-1,j=7,M=0,$=i.getMaskFunction(F),W=S-1;W>0;W-=2)for(W==6&&(W-=1);;){for(var Y=0;Y<2;Y+=1)if(_[k][W-Y]==null){var Q=!1;M>>j&1)==1);var q=$(k,W-Y);q&&(Q=!Q),_[k][W-Y]=Q,j-=1,j==-1&&(M+=1,j=7)}if(k+=D,k<0||S<=k){k-=D,D=-D;break}}},B=function(U,F){for(var D=0,k=0,j=0,M=new Array(F.length),$=new Array(F.length),W=0;W=0?ae.getAt(ue):0}}for(var le=0,q=0;qW*8)throw"code length overflow. ("+j.getLengthInBits()+">"+W*8+")";for(j.getLengthInBits()+4<=W*8&&j.put(0,4);j.getLengthInBits()%8!=0;)j.putBit(!1);for(;!(j.getLengthInBits()>=W*8||(j.put(m,8),j.getLengthInBits()>=W*8));)j.put(C,8);return B(j,k)};T.addData=function(U,F){F=F||"Byte";var D=null;switch(F){case"Numeric":D=p(U);break;case"Alphanumeric":D=d(U);break;case"Byte":D=h(U);break;case"Kanji":D=u(U);break;default:throw"mode:"+F}A.push(D),R=null},T.isDark=function(U,F){if(U<0||S<=U||F<0||S<=F)throw U+","+F;return _[U][F]},T.getModuleCount=function(){return S},T.make=function(){if(E<1){for(var U=1;U<40;U++){for(var F=b.getRSBlocks(U,O),D=o(),k=0;k"u"?U*4:F;var D="";D+='";for(var j=0;j';D+=""}return D+="",D+="
",D},T.createSvgTag=function(U,F,D,k){var j={};typeof arguments[0]=="object"&&(j=arguments[0],U=j.cellSize,F=j.margin,D=j.alt,k=j.title),U=U||2,F=typeof F>"u"?U*4:F,D=typeof D=="string"?{text:D}:D||{},D.text=D.text||null,D.id=D.text?D.id||"qrcode-description":null,k=typeof k=="string"?{text:k}:k||{},k.text=k.text||null,k.id=k.text?k.id||"qrcode-title":null;var M=T.getModuleCount()*U+F*2,$,W,Y,Q,q="",te;for(te="l"+U+",0 0,"+U+" -"+U+",0 0,-"+U+"z ",q+=''+V(k.text)+"":"",q+=D.text?''+V(D.text)+"":"",q+='',q+='"u"?U*4:F;var D=T.getModuleCount()*U+F*2,k=F,j=D-F;return w(D,D,function(M,$){if(k<=M&&M"u"?U*4:F;var k=T.getModuleCount()*U+F*2,j="";return j+="",j};var V=function(U){for(var F="",D=0;D":F+=">";break;case"&":F+="&";break;case'"':F+=""";break;default:F+=k;break}}return F},z=function(U){var F=1;U=typeof U>"u"?F*2:U;var D=T.getModuleCount()*F+U*2,k=U,j=D-U,M,$,W,Y,Q,q={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},te={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},ie="";for(M=0;M=j?te[Q]:q[Q];ie+=` `}return D%2&&U>0?ie.substring(0,ie.length-D-1)+Array(D+1).join("\u2580"):ie.substring(0,ie.length-1)};return T.createASCII=function(U,F){if(U=U||1,U<2)return z(F);U-=1,F=typeof F>"u"?U*2:F;var D=T.getModuleCount()*U+F*2,k=F,j=D-F,M,$,W,Y,Q=Array(U+1).join("\u2588\u2588"),q=Array(U+1).join(" "),te="",ie="";for(M=0;M>>8),O.push(R&255)):O.push(C)}}return O}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},r={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=(function(){var y=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],v=1335,m=7973,C=21522,E={},O=function(_){for(var S=0;_!=0;)S+=1,_>>>=1;return S};return E.getBCHTypeInfo=function(_){for(var S=_<<10;O(S)-O(v)>=0;)S^=v<=0;)S^=m<5&&(R+=3+N-5)}for(var A=0;A=256;)E-=255;return y[E]},C})();function f(y,v){if(typeof y.length>"u")throw y.length+"/"+v;var m=(function(){for(var E=0;E"u")throw"bad rs block @ typeNumber:"+E+"/errorCorrectionLevel:"+O;for(var S=_.length/3,R=[],A=0;A>>7-C%8&1)==1},m.put=function(C,E){for(var O=0;O>>E-O-1&1)==1)},m.getLengthInBits=function(){return v},m.putBit=function(C){var E=Math.floor(v/8);y.length<=E&&y.push(0),C&&(y[E]|=128>>>v%8),v+=1},m},p=function(y){var v=t.MODE_NUMBER,m=y,C={};C.getMode=function(){return v},C.getLength=function(_){return m.length},C.write=function(_){for(var S=m,R=0;R+2>>8&255)*192+(A&255),_.put(A,13),R+=2}if(R>>8)},v.writeBytes=function(m,C,E){C=C||0,E=E||m.length;for(var O=0;O0&&(m+=","),m+=y[C];return m+="]",m},v},s=function(){var y=0,v=0,m=0,C="",E={},O=function(S){C+=String.fromCharCode(_(S&63))},_=function(S){if(!(S<0)){if(S<26)return 65+S;if(S<52)return 97+(S-26);if(S<62)return 48+(S-52);if(S==62)return 43;if(S==63)return 47}throw"n:"+S};return E.writeByte=function(S){for(y=y<<8|S&255,v+=8,m+=1;v>=6;)O(y>>>v-6),v-=6},E.flush=function(){if(v>0&&(O(y<<6-v),y=0,v=0),m%3!=0)for(var S=3-m%3,R=0;R=v.length){if(E==0)return-1;throw"unexpected end of file./"+E}var S=v.charAt(m);if(m+=1,S=="=")return E=0,-1;if(S.match(/^\s$/))continue;C=C<<6|_(S.charCodeAt(0)),E+=6}var R=C>>>E-8&255;return E-=8,R};var _=function(S){if(65<=S&&S<=90)return S-65;if(97<=S&&S<=122)return S-97+26;if(48<=S&&S<=57)return S-48+52;if(S==43)return 62;if(S==47)return 63;throw"c:"+S};return O},g=function(y,v){var m=y,C=v,E=new Array(y*v),O={};O.setPixel=function(A,T,N){E[T*m+A]=N},O.write=function(A){A.writeString("GIF87a"),A.writeShort(m),A.writeShort(C),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(m),A.writeShort(C),A.writeByte(0);var T=2,N=S(T);A.writeByte(T);for(var x=0;N.length-x>255;)A.writeByte(255),A.writeBytes(N,x,255),x+=255;A.writeByte(N.length-x),A.writeBytes(N,x,N.length-x),A.writeByte(0),A.writeString(";")};var _=function(A){var T=A,N=0,x=0,I={};return I.write=function(L,H){if(L>>>H)throw"length over";for(;N+H>=8;)T.writeByte(255&(L<>>=8-N,x=0,N=0;x=L<0&&T.writeByte(x)},I},S=function(A){for(var T=1<>6,128|a&63):a<55296||a>=57344?n.push(224|a>>12,128|a>>6&63,128|a&63):(i++,a=65536+((a&1023)<<10|r.charCodeAt(i)&1023),n.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63))}return n}return t(e)}})();(function(e){typeof define=="function"&&define.amd?define([],e):typeof Dl=="object"&&(Bl.exports=e())})(function(){return Ml})});var jl=ga((Qn,Qi)=>{(function(e,t){typeof Qn=="object"&&typeof Qi=="object"?Qi.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Qn=="object"?Qn["@lightninglabs/lnc-web"]=t():e["@lightninglabs/lnc-web"]=t()})(Qn,()=>(()=>{var e={7289(n,i,a){"use strict";var f=a(6763);(()=>{let b=()=>{let d=new Error("not implemented");return d.code="ENOSYS",d};if(!globalThis.fs){let d="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(h,u){d+=p.decode(u);let c=d.lastIndexOf(` `);return c!=-1&&(f.log(d.substring(0,c)),d=d.substring(c+1)),u.length},write(h,u,c,s,l,g){c===0&&s===u.length&&l===null?g(null,this.writeSync(h,u)):g(b())},chmod(h,u,c){c(b())},chown(h,u,c,s){s(b())},close(h,u){u(b())},fchmod(h,u,c){c(b())},fchown(h,u,c,s){s(b())},fstat(h,u){u(b())},fsync(h,u){u(null)},ftruncate(h,u,c){c(b())},lchown(h,u,c,s){s(b())},link(h,u,c){c(b())},lstat(h,u){u(b())},mkdir(h,u,c){c(b())},open(h,u,c,s){s(b())},read(h,u,c,s,l,g){g(b())},readdir(h,u){u(b())},readlink(h,u){u(b())},rename(h,u,c){c(b())},rmdir(h,u){u(b())},stat(h,u){u(b())},symlink(h,u,c){c(b())},truncate(h,u,c){c(b())},unlink(h,u){u(b())},utimes(h,u,c,s){s(b())}}}if(globalThis.process||(globalThis.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw b()},pid:-1,ppid:-1,umask(){throw b()},cwd(){throw b()},chdir(){throw b()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");let o=new TextEncoder("utf-8"),p=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=y=>{y!==0&&f.warn("exit code:",y)},this._exitPromise=new Promise(y=>{this._resolveExitPromise=y}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;let d=(y,v)=>{this.mem.setUint32(y+0,v,!0),this.mem.setUint32(y+4,Math.floor(v/4294967296),!0)},h=y=>this.mem.getUint32(y+0,!0)+4294967296*this.mem.getInt32(y+4,!0),u=y=>{let v=this.mem.getFloat64(y,!0);if(v===0)return;if(!isNaN(v))return v;let m=this.mem.getUint32(y,!0);return this._values[m]},c=(y,v)=>{if(typeof v=="number"&&v!==0)return isNaN(v)?(this.mem.setUint32(y+4,2146959360,!0),void this.mem.setUint32(y,0,!0)):void this.mem.setFloat64(y,v,!0);if(v===void 0)return void this.mem.setFloat64(y,0,!0);let C=this._ids.get(v);C===void 0&&(C=this._idPool.pop(),C===void 0&&(C=this._values.length),this._values[C]=v,this._goRefCounts[C]=0,this._ids.set(v,C)),this._goRefCounts[C]++;let E=0;switch(typeof v){case"object":v!==null&&(E=1);break;case"string":E=2;break;case"symbol":E=3;break;case"function":E=4}this.mem.setUint32(y+4,2146959360|E,!0),this.mem.setUint32(y,C,!0)},s=y=>{let v=h(y+0),m=h(y+8);return new Uint8Array(this._inst.exports.mem.buffer,v,m)},l=y=>{let v=h(y+0),m=h(y+8),C=new Array(m);for(let E=0;E{let v=h(y+0),m=h(y+8);return p.decode(new DataView(this._inst.exports.mem.buffer,v,m))},w=Date.now()-performance.now();this.importObject={_gotest:{add:(y,v)=>y+v},gojs:{"runtime.wasmExit":y=>{y>>>=0;let v=this.mem.getInt32(y+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(v)},"runtime.wasmWrite":y=>{let v=h((y>>>=0)+8),m=h(y+16),C=this.mem.getInt32(y+24,!0);fs.writeSync(v,new Uint8Array(this._inst.exports.mem.buffer,m,C))},"runtime.resetMemoryDataView":y=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":y=>{d((y>>>=0)+8,1e6*(w+performance.now()))},"runtime.walltime":y=>{y>>>=0;let v=new Date().getTime();d(y+8,v/1e3),this.mem.setInt32(y+16,v%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":y=>{y>>>=0;let v=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(v,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(v);)f.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},h(y+8))),this.mem.setInt32(y+16,v,!0)},"runtime.clearTimeoutEvent":y=>{y>>>=0;let v=this.mem.getInt32(y+8,!0);clearTimeout(this._scheduledTimeouts.get(v)),this._scheduledTimeouts.delete(v)},"runtime.getRandomData":y=>{y>>>=0,crypto.getRandomValues(s(y+8))},"syscall/js.finalizeRef":y=>{y>>>=0;let v=this.mem.getUint32(y+8,!0);if(this._goRefCounts[v]--,this._goRefCounts[v]===0){let m=this._values[v];this._values[v]=null,this._ids.delete(m),this._idPool.push(v)}},"syscall/js.stringVal":y=>{c((y>>>=0)+24,g(y+8))},"syscall/js.valueGet":y=>{y>>>=0;let v=Reflect.get(u(y+8),g(y+16));y=this._inst.exports.getsp()>>>0,c(y+32,v)},"syscall/js.valueSet":y=>{y>>>=0,Reflect.set(u(y+8),g(y+16),u(y+32))},"syscall/js.valueDelete":y=>{y>>>=0,Reflect.deleteProperty(u(y+8),g(y+16))},"syscall/js.valueIndex":y=>{c((y>>>=0)+24,Reflect.get(u(y+8),h(y+16)))},"syscall/js.valueSetIndex":y=>{y>>>=0,Reflect.set(u(y+8),h(y+16),u(y+24))},"syscall/js.valueCall":y=>{y>>>=0;try{let v=u(y+8),m=Reflect.get(v,g(y+16)),C=l(y+32),E=Reflect.apply(m,v,C);y=this._inst.exports.getsp()>>>0,c(y+56,E),this.mem.setUint8(y+64,1)}catch(v){y=this._inst.exports.getsp()>>>0,c(y+56,v),this.mem.setUint8(y+64,0)}},"syscall/js.valueInvoke":y=>{y>>>=0;try{let v=u(y+8),m=l(y+16),C=Reflect.apply(v,void 0,m);y=this._inst.exports.getsp()>>>0,c(y+40,C),this.mem.setUint8(y+48,1)}catch(v){y=this._inst.exports.getsp()>>>0,c(y+40,v),this.mem.setUint8(y+48,0)}},"syscall/js.valueNew":y=>{y>>>=0;try{let v=u(y+8),m=l(y+16),C=Reflect.construct(v,m);y=this._inst.exports.getsp()>>>0,c(y+40,C),this.mem.setUint8(y+48,1)}catch(v){y=this._inst.exports.getsp()>>>0,c(y+40,v),this.mem.setUint8(y+48,0)}},"syscall/js.valueLength":y=>{d((y>>>=0)+16,parseInt(u(y+8).length))},"syscall/js.valuePrepareString":y=>{y>>>=0;let v=o.encode(String(u(y+8)));c(y+16,v),d(y+24,v.length)},"syscall/js.valueLoadString":y=>{let v=u((y>>>=0)+8);s(y+16).set(v)},"syscall/js.valueInstanceOf":y=>{y>>>=0,this.mem.setUint8(y+24,u(y+8)instanceof u(y+16)?1:0)},"syscall/js.copyBytesToGo":y=>{let v=s((y>>>=0)+8),m=u(y+32);if(!(m instanceof Uint8Array||m instanceof Uint8ClampedArray))return void this.mem.setUint8(y+48,0);let C=m.subarray(0,v.length);v.set(C),d(y+40,C.length),this.mem.setUint8(y+48,1)},"syscall/js.copyBytesToJS":y=>{let v=u((y>>>=0)+8),m=s(y+16);if(!(v instanceof Uint8Array||v instanceof Uint8ClampedArray))return void this.mem.setUint8(y+48,0);let C=m.subarray(0,v.length);v.set(C),d(y+40,C.length),this.mem.setUint8(y+48,1)},debug:y=>{f.log(y)}}}}async run(d){if(!(d instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=d,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let h=4096,u=g=>{let w=h,y=o.encode(g+"\0");return new Uint8Array(this.mem.buffer,h,y.length).set(y),h+=y.length,h%8!=0&&(h+=8-h%8),w},c=this.argv.length,s=[];this.argv.forEach(g=>{s.push(u(g))}),s.push(0),Object.keys(this.env).sort().forEach(g=>{s.push(u(`${g}=${this.env[g]}`))}),s.push(0);let l=h;if(s.forEach(g=>{this.mem.setUint32(h,g,!0),this.mem.setUint32(h+4,0,!0),h+=8}),h>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(c,l),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(d){let h=this;return function(){let u={id:d,this:this,args:arguments};return h._pendingEvent=u,h._resume(),u.result}}}})()},3318(n){var i;i=()=>(()=>{"use strict";var a={5804(b,o,p){Object.defineProperty(o,"__esModule",{value:!0});var d=p(2495);o.default=function(h,u){this.faradayServer=h(d.serviceNames.frdrpc.FaradayServer,u)}},3586(b,o,p){var d=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(o,"__esModule",{value:!0}),o.LitApi=o.TaprootAssetsApi=o.FaradayApi=o.PoolApi=o.LoopApi=o.LndApi=void 0;var h=p(728);Object.defineProperty(o,"LndApi",{enumerable:!0,get:function(){return d(h).default}});var u=p(3762);Object.defineProperty(o,"LoopApi",{enumerable:!0,get:function(){return d(u).default}});var c=p(7082);Object.defineProperty(o,"PoolApi",{enumerable:!0,get:function(){return d(c).default}});var s=p(5804);Object.defineProperty(o,"FaradayApi",{enumerable:!0,get:function(){return d(s).default}});var l=p(9147);Object.defineProperty(o,"TaprootAssetsApi",{enumerable:!0,get:function(){return d(l).default}});var g=p(2191);Object.defineProperty(o,"LitApi",{enumerable:!0,get:function(){return d(g).default}})},2191(b,o,p){Object.defineProperty(o,"__esModule",{value:!0});var d=p(2495);o.default=function(h,u){this.autopilot=h(d.serviceNames.litrpc.Autopilot,u),this.firewall=h(d.serviceNames.litrpc.Firewall,u),this.sessions=h(d.serviceNames.litrpc.Sessions,u),this.status=h(d.serviceNames.litrpc.Status,u)}},728(b,o,p){Object.defineProperty(o,"__esModule",{value:!0});var d=p(2495);o.default=function(h,u){this.autopilot=h(d.serviceNames.autopilotrpc.Autopilot,u),this.chainNotifier=h(d.serviceNames.chainrpc.ChainNotifier,u),this.invoices=h(d.serviceNames.invoicesrpc.Invoices,u),this.lightning=h(d.serviceNames.lnrpc.Lightning,u),this.router=h(d.serviceNames.routerrpc.Router,u),this.signer=h(d.serviceNames.signrpc.Signer,u),this.walletKit=h(d.serviceNames.walletrpc.WalletKit,u),this.walletUnlocker=h(d.serviceNames.lnrpc.WalletUnlocker,u),this.watchtower=h(d.serviceNames.watchtowerrpc.Watchtower,u),this.watchtowerClient=h(d.serviceNames.wtclientrpc.WatchtowerClient,u)}},3762(b,o,p){Object.defineProperty(o,"__esModule",{value:!0});var d=p(2495);o.default=function(h,u){this.swapClient=h(d.serviceNames.looprpc.SwapClient,u),this.debug=h(d.serviceNames.looprpc.Debug,u)}},7082(b,o,p){Object.defineProperty(o,"__esModule",{value:!0});var d=p(2495);o.default=function(h,u){this.trader=h(d.serviceNames.poolrpc.Trader,u),this.channelAuctioneer=h(d.serviceNames.poolrpc.ChannelAuctioneer,u),this.hashmail=h(d.serviceNames.poolrpc.HashMail,u)}},9147(b,o,p){Object.defineProperty(o,"__esModule",{value:!0});var d=p(2495);o.default=function(h,u){this.taprootAssets=h(d.serviceNames.taprpc.TaprootAssets,u),this.assetWallet=h(d.serviceNames.assetwalletrpc.AssetWallet,u),this.mint=h(d.serviceNames.mintrpc.Mint,u),this.priceOracle=h(d.serviceNames.priceoraclerpc.PriceOracle,u),this.rfq=h(d.serviceNames.rfqrpc.Rfq,u),this.tapChannels=h(d.serviceNames.tapchannelrpc.TaprootAssetChannels,u),this.tapDev=h(d.serviceNames.tapdevrpc.TapDev,u),this.universe=h(d.serviceNames.universerpc.Universe,u)}},4245(b,o,p){var d=this&&this.__createBinding||(Object.create?function(l,g,w,y){y===void 0&&(y=w),Object.defineProperty(l,y,{enumerable:!0,get:function(){return g[w]}})}:function(l,g,w,y){y===void 0&&(y=w),l[y]=g[w]}),h=this&&this.__exportStar||function(l,g){for(var w in l)w==="default"||Object.prototype.hasOwnProperty.call(g,w)||d(g,l,w)};Object.defineProperty(o,"__esModule",{value:!0}),o.subscriptionMethods=o.TaprootAssetsApi=o.LitApi=o.FaradayApi=o.PoolApi=o.LoopApi=o.LndApi=o.snakeKeysToCamel=o.isObject=o.camelKeysToSnake=void 0,h(p(4578),o);var u=p(1022);Object.defineProperty(o,"camelKeysToSnake",{enumerable:!0,get:function(){return u.camelKeysToSnake}}),Object.defineProperty(o,"isObject",{enumerable:!0,get:function(){return u.isObject}}),Object.defineProperty(o,"snakeKeysToCamel",{enumerable:!0,get:function(){return u.snakeKeysToCamel}});var c=p(3586);Object.defineProperty(o,"LndApi",{enumerable:!0,get:function(){return c.LndApi}}),Object.defineProperty(o,"LoopApi",{enumerable:!0,get:function(){return c.LoopApi}}),Object.defineProperty(o,"PoolApi",{enumerable:!0,get:function(){return c.PoolApi}}),Object.defineProperty(o,"FaradayApi",{enumerable:!0,get:function(){return c.FaradayApi}}),Object.defineProperty(o,"LitApi",{enumerable:!0,get:function(){return c.LitApi}}),Object.defineProperty(o,"TaprootAssetsApi",{enumerable:!0,get:function(){return c.TaprootAssetsApi}});var s=p(2495);Object.defineProperty(o,"subscriptionMethods",{enumerable:!0,get:function(){return s.subscriptionMethods}})},9444(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(5712),o)},1241(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(4376),o)},9926(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(2277),o)},6636(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(8647),o)},8925(b,o){var p,d,h,u;Object.defineProperty(o,"__esModule",{value:!0}),o.CloseRecommendationRequest_Metric=o.EntryType=o.FiatBackend=o.Granularity=void 0,(u=o.Granularity||(o.Granularity={})).UNKNOWN_GRANULARITY="UNKNOWN_GRANULARITY",u.MINUTE="MINUTE",u.FIVE_MINUTES="FIVE_MINUTES",u.FIFTEEN_MINUTES="FIFTEEN_MINUTES",u.THIRTY_MINUTES="THIRTY_MINUTES",u.HOUR="HOUR",u.SIX_HOURS="SIX_HOURS",u.TWELVE_HOURS="TWELVE_HOURS",u.DAY="DAY",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.FiatBackend||(o.FiatBackend={})).UNKNOWN_FIATBACKEND="UNKNOWN_FIATBACKEND",h.COINCAP="COINCAP",h.COINDESK="COINDESK",h.CUSTOM="CUSTOM",h.COINGECKO="COINGECKO",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.EntryType||(o.EntryType={})).UNKNOWN="UNKNOWN",d.LOCAL_CHANNEL_OPEN="LOCAL_CHANNEL_OPEN",d.REMOTE_CHANNEL_OPEN="REMOTE_CHANNEL_OPEN",d.CHANNEL_OPEN_FEE="CHANNEL_OPEN_FEE",d.CHANNEL_CLOSE="CHANNEL_CLOSE",d.RECEIPT="RECEIPT",d.PAYMENT="PAYMENT",d.FEE="FEE",d.CIRCULAR_RECEIPT="CIRCULAR_RECEIPT",d.FORWARD="FORWARD",d.FORWARD_FEE="FORWARD_FEE",d.CIRCULAR_PAYMENT="CIRCULAR_PAYMENT",d.CIRCULAR_FEE="CIRCULAR_FEE",d.SWEEP="SWEEP",d.SWEEP_FEE="SWEEP_FEE",d.CHANNEL_CLOSE_FEE="CHANNEL_CLOSE_FEE",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.CloseRecommendationRequest_Metric||(o.CloseRecommendationRequest_Metric={})).UNKNOWN="UNKNOWN",p.UPTIME="UPTIME",p.REVENUE="REVENUE",p.INCOMING_VOLUME="INCOMING_VOLUME",p.OUTGOING_VOLUME="OUTGOING_VOLUME",p.TOTAL_VOLUME="TOTAL_VOLUME",p.UNRECOGNIZED="UNRECOGNIZED"},8507(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(8925),o)},4578(b,o,p){var d=this&&this.__createBinding||(Object.create?function(P,B,G,V){V===void 0&&(V=G),Object.defineProperty(P,V,{enumerable:!0,get:function(){return B[G]}})}:function(P,B,G,V){V===void 0&&(V=G),P[V]=B[G]}),h=this&&this.__setModuleDefault||(Object.create?function(P,B){Object.defineProperty(P,"default",{enumerable:!0,value:B})}:function(P,B){P.default=B}),u=this&&this.__importStar||function(P){if(P&&P.__esModule)return P;var B={};if(P!=null)for(var G in P)G!=="default"&&Object.prototype.hasOwnProperty.call(P,G)&&d(B,P,G);return h(B,P),B};Object.defineProperty(o,"__esModule",{value:!0}),o.universerpc=o.taprpc=o.tapdevrpc=o.tapchannelrpc=o.rfqrpc=o.priceoraclerpc=o.mintrpc=o.authmailboxrpc=o.assetwalletrpc=o.poolrpc=o.looprpc=o.wtclientrpc=o.watchtowerrpc=o.walletrpc=o.signrpc=o.routerrpc=o.peersrpc=o.lnrpc=o.invoicesrpc=o.chainrpc=o.autopilotrpc=o.litrpc=o.frdrpc=void 0;var c=u(p(8507));o.frdrpc=c;var s=u(p(2844));o.litrpc=s;var l=u(p(9926));o.autopilotrpc=l;var g=u(p(6636));o.chainrpc=g;var w=u(p(8561));o.invoicesrpc=w;var y=u(p(1419));o.lnrpc=y;var v=u(p(1908));o.peersrpc=v;var m=u(p(6534));o.routerrpc=m;var C=u(p(8054));o.signrpc=C;var E=u(p(718));o.walletrpc=E;var O=u(p(5109));o.watchtowerrpc=O;var _=u(p(7685));o.wtclientrpc=_;var S=u(p(7967));o.looprpc=S;var R=u(p(2471));o.poolrpc=R;var A=u(p(9444));o.assetwalletrpc=A;var T=u(p(1241));o.authmailboxrpc=T;var N=u(p(1393));o.mintrpc=N;var x=u(p(2162));o.priceoraclerpc=x;var I=u(p(4386));o.rfqrpc=I;var L=u(p(8933));o.tapchannelrpc=L;var H=u(p(8753));o.tapdevrpc=H;var Z=u(p(5600));o.taprpc=Z;var K=u(p(7164));o.universerpc=K},8561(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(4195),o)},8650(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.ActionState=void 0,(p=o.ActionState||(o.ActionState={})).STATE_UNKNOWN="STATE_UNKNOWN",p.STATE_PENDING="STATE_PENDING",p.STATE_DONE="STATE_DONE",p.STATE_ERROR="STATE_ERROR",p.UNRECOGNIZED="UNRECOGNIZED"},5547(b,o){Object.defineProperty(o,"__esModule",{value:!0})},1199(b,o){var p,d;Object.defineProperty(o,"__esModule",{value:!0}),o.SessionState=o.SessionType=void 0,(d=o.SessionType||(o.SessionType={})).TYPE_MACAROON_READONLY="TYPE_MACAROON_READONLY",d.TYPE_MACAROON_ADMIN="TYPE_MACAROON_ADMIN",d.TYPE_MACAROON_CUSTOM="TYPE_MACAROON_CUSTOM",d.TYPE_UI_PASSWORD="TYPE_UI_PASSWORD",d.TYPE_AUTOPILOT="TYPE_AUTOPILOT",d.TYPE_MACAROON_ACCOUNT="TYPE_MACAROON_ACCOUNT",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.SessionState||(o.SessionState={})).STATE_CREATED="STATE_CREATED",p.STATE_IN_USE="STATE_IN_USE",p.STATE_REVOKED="STATE_REVOKED",p.STATE_EXPIRED="STATE_EXPIRED",p.STATE_RESERVED="STATE_RESERVED",p.UNRECOGNIZED="UNRECOGNIZED"},6440(b,o){Object.defineProperty(o,"__esModule",{value:!0})},2844(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(8650),o),h(p(5547),o),h(p(1199),o),h(p(6440),o)},2277(b,o){Object.defineProperty(o,"__esModule",{value:!0})},8647(b,o){Object.defineProperty(o,"__esModule",{value:!0})},4195(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.LookupModifier=void 0,(p=o.LookupModifier||(o.LookupModifier={})).DEFAULT="DEFAULT",p.HTLC_SET_ONLY="HTLC_SET_ONLY",p.HTLC_SET_BLANK="HTLC_SET_BLANK",p.UNRECOGNIZED="UNRECOGNIZED"},4377(b,o){var p,d,h,u,c,s,l,g,w,y,v,m,C,E,O,_,S,R,A,T,N;Object.defineProperty(o,"__esModule",{value:!0}),o.Failure_FailureCode=o.HTLCAttempt_HTLCStatus=o.Payment_PaymentStatus=o.Invoice_InvoiceState=o.ChannelEventUpdate_UpdateType=o.PendingChannelsResponse_ForceClosedChannel_AnchorState=o.PeerEvent_EventType=o.Peer_SyncType=o.ChannelCloseSummary_ClosureType=o.UpdateFailure=o.FeatureBit=o.PaymentFailureReason=o.InvoiceHTLCState=o.NodeMetricType=o.ResolutionOutcome=o.ResolutionType=o.Initiator=o.CommitmentType=o.AddressType=o.CoinSelectionStrategy=o.OutputScriptType=void 0,(N=o.OutputScriptType||(o.OutputScriptType={})).SCRIPT_TYPE_PUBKEY_HASH="SCRIPT_TYPE_PUBKEY_HASH",N.SCRIPT_TYPE_SCRIPT_HASH="SCRIPT_TYPE_SCRIPT_HASH",N.SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH="SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH",N.SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH="SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH",N.SCRIPT_TYPE_PUBKEY="SCRIPT_TYPE_PUBKEY",N.SCRIPT_TYPE_MULTISIG="SCRIPT_TYPE_MULTISIG",N.SCRIPT_TYPE_NULLDATA="SCRIPT_TYPE_NULLDATA",N.SCRIPT_TYPE_NON_STANDARD="SCRIPT_TYPE_NON_STANDARD",N.SCRIPT_TYPE_WITNESS_UNKNOWN="SCRIPT_TYPE_WITNESS_UNKNOWN",N.SCRIPT_TYPE_WITNESS_V1_TAPROOT="SCRIPT_TYPE_WITNESS_V1_TAPROOT",N.UNRECOGNIZED="UNRECOGNIZED",(T=o.CoinSelectionStrategy||(o.CoinSelectionStrategy={})).STRATEGY_USE_GLOBAL_CONFIG="STRATEGY_USE_GLOBAL_CONFIG",T.STRATEGY_LARGEST="STRATEGY_LARGEST",T.STRATEGY_RANDOM="STRATEGY_RANDOM",T.UNRECOGNIZED="UNRECOGNIZED",(A=o.AddressType||(o.AddressType={})).WITNESS_PUBKEY_HASH="WITNESS_PUBKEY_HASH",A.NESTED_PUBKEY_HASH="NESTED_PUBKEY_HASH",A.UNUSED_WITNESS_PUBKEY_HASH="UNUSED_WITNESS_PUBKEY_HASH",A.UNUSED_NESTED_PUBKEY_HASH="UNUSED_NESTED_PUBKEY_HASH",A.TAPROOT_PUBKEY="TAPROOT_PUBKEY",A.UNUSED_TAPROOT_PUBKEY="UNUSED_TAPROOT_PUBKEY",A.UNRECOGNIZED="UNRECOGNIZED",(R=o.CommitmentType||(o.CommitmentType={})).UNKNOWN_COMMITMENT_TYPE="UNKNOWN_COMMITMENT_TYPE",R.LEGACY="LEGACY",R.STATIC_REMOTE_KEY="STATIC_REMOTE_KEY",R.ANCHORS="ANCHORS",R.SCRIPT_ENFORCED_LEASE="SCRIPT_ENFORCED_LEASE",R.SIMPLE_TAPROOT="SIMPLE_TAPROOT",R.SIMPLE_TAPROOT_OVERLAY="SIMPLE_TAPROOT_OVERLAY",R.UNRECOGNIZED="UNRECOGNIZED",(S=o.Initiator||(o.Initiator={})).INITIATOR_UNKNOWN="INITIATOR_UNKNOWN",S.INITIATOR_LOCAL="INITIATOR_LOCAL",S.INITIATOR_REMOTE="INITIATOR_REMOTE",S.INITIATOR_BOTH="INITIATOR_BOTH",S.UNRECOGNIZED="UNRECOGNIZED",(_=o.ResolutionType||(o.ResolutionType={})).TYPE_UNKNOWN="TYPE_UNKNOWN",_.ANCHOR="ANCHOR",_.INCOMING_HTLC="INCOMING_HTLC",_.OUTGOING_HTLC="OUTGOING_HTLC",_.COMMIT="COMMIT",_.UNRECOGNIZED="UNRECOGNIZED",(O=o.ResolutionOutcome||(o.ResolutionOutcome={})).OUTCOME_UNKNOWN="OUTCOME_UNKNOWN",O.CLAIMED="CLAIMED",O.UNCLAIMED="UNCLAIMED",O.ABANDONED="ABANDONED",O.FIRST_STAGE="FIRST_STAGE",O.TIMEOUT="TIMEOUT",O.UNRECOGNIZED="UNRECOGNIZED",(E=o.NodeMetricType||(o.NodeMetricType={})).UNKNOWN="UNKNOWN",E.BETWEENNESS_CENTRALITY="BETWEENNESS_CENTRALITY",E.UNRECOGNIZED="UNRECOGNIZED",(C=o.InvoiceHTLCState||(o.InvoiceHTLCState={})).ACCEPTED="ACCEPTED",C.SETTLED="SETTLED",C.CANCELED="CANCELED",C.UNRECOGNIZED="UNRECOGNIZED",(m=o.PaymentFailureReason||(o.PaymentFailureReason={})).FAILURE_REASON_NONE="FAILURE_REASON_NONE",m.FAILURE_REASON_TIMEOUT="FAILURE_REASON_TIMEOUT",m.FAILURE_REASON_NO_ROUTE="FAILURE_REASON_NO_ROUTE",m.FAILURE_REASON_ERROR="FAILURE_REASON_ERROR",m.FAILURE_REASON_INCORRECT_PAYMENT_DETAILS="FAILURE_REASON_INCORRECT_PAYMENT_DETAILS",m.FAILURE_REASON_INSUFFICIENT_BALANCE="FAILURE_REASON_INSUFFICIENT_BALANCE",m.FAILURE_REASON_CANCELED="FAILURE_REASON_CANCELED",m.UNRECOGNIZED="UNRECOGNIZED",(v=o.FeatureBit||(o.FeatureBit={})).DATALOSS_PROTECT_REQ="DATALOSS_PROTECT_REQ",v.DATALOSS_PROTECT_OPT="DATALOSS_PROTECT_OPT",v.INITIAL_ROUING_SYNC="INITIAL_ROUING_SYNC",v.UPFRONT_SHUTDOWN_SCRIPT_REQ="UPFRONT_SHUTDOWN_SCRIPT_REQ",v.UPFRONT_SHUTDOWN_SCRIPT_OPT="UPFRONT_SHUTDOWN_SCRIPT_OPT",v.GOSSIP_QUERIES_REQ="GOSSIP_QUERIES_REQ",v.GOSSIP_QUERIES_OPT="GOSSIP_QUERIES_OPT",v.TLV_ONION_REQ="TLV_ONION_REQ",v.TLV_ONION_OPT="TLV_ONION_OPT",v.EXT_GOSSIP_QUERIES_REQ="EXT_GOSSIP_QUERIES_REQ",v.EXT_GOSSIP_QUERIES_OPT="EXT_GOSSIP_QUERIES_OPT",v.STATIC_REMOTE_KEY_REQ="STATIC_REMOTE_KEY_REQ",v.STATIC_REMOTE_KEY_OPT="STATIC_REMOTE_KEY_OPT",v.PAYMENT_ADDR_REQ="PAYMENT_ADDR_REQ",v.PAYMENT_ADDR_OPT="PAYMENT_ADDR_OPT",v.MPP_REQ="MPP_REQ",v.MPP_OPT="MPP_OPT",v.WUMBO_CHANNELS_REQ="WUMBO_CHANNELS_REQ",v.WUMBO_CHANNELS_OPT="WUMBO_CHANNELS_OPT",v.ANCHORS_REQ="ANCHORS_REQ",v.ANCHORS_OPT="ANCHORS_OPT",v.ANCHORS_ZERO_FEE_HTLC_REQ="ANCHORS_ZERO_FEE_HTLC_REQ",v.ANCHORS_ZERO_FEE_HTLC_OPT="ANCHORS_ZERO_FEE_HTLC_OPT",v.ROUTE_BLINDING_REQUIRED="ROUTE_BLINDING_REQUIRED",v.ROUTE_BLINDING_OPTIONAL="ROUTE_BLINDING_OPTIONAL",v.AMP_REQ="AMP_REQ",v.AMP_OPT="AMP_OPT",v.UNRECOGNIZED="UNRECOGNIZED",(y=o.UpdateFailure||(o.UpdateFailure={})).UPDATE_FAILURE_UNKNOWN="UPDATE_FAILURE_UNKNOWN",y.UPDATE_FAILURE_PENDING="UPDATE_FAILURE_PENDING",y.UPDATE_FAILURE_NOT_FOUND="UPDATE_FAILURE_NOT_FOUND",y.UPDATE_FAILURE_INTERNAL_ERR="UPDATE_FAILURE_INTERNAL_ERR",y.UPDATE_FAILURE_INVALID_PARAMETER="UPDATE_FAILURE_INVALID_PARAMETER",y.UNRECOGNIZED="UNRECOGNIZED",(w=o.ChannelCloseSummary_ClosureType||(o.ChannelCloseSummary_ClosureType={})).COOPERATIVE_CLOSE="COOPERATIVE_CLOSE",w.LOCAL_FORCE_CLOSE="LOCAL_FORCE_CLOSE",w.REMOTE_FORCE_CLOSE="REMOTE_FORCE_CLOSE",w.BREACH_CLOSE="BREACH_CLOSE",w.FUNDING_CANCELED="FUNDING_CANCELED",w.ABANDONED="ABANDONED",w.UNRECOGNIZED="UNRECOGNIZED",(g=o.Peer_SyncType||(o.Peer_SyncType={})).UNKNOWN_SYNC="UNKNOWN_SYNC",g.ACTIVE_SYNC="ACTIVE_SYNC",g.PASSIVE_SYNC="PASSIVE_SYNC",g.PINNED_SYNC="PINNED_SYNC",g.UNRECOGNIZED="UNRECOGNIZED",(l=o.PeerEvent_EventType||(o.PeerEvent_EventType={})).PEER_ONLINE="PEER_ONLINE",l.PEER_OFFLINE="PEER_OFFLINE",l.UNRECOGNIZED="UNRECOGNIZED",(s=o.PendingChannelsResponse_ForceClosedChannel_AnchorState||(o.PendingChannelsResponse_ForceClosedChannel_AnchorState={})).LIMBO="LIMBO",s.RECOVERED="RECOVERED",s.LOST="LOST",s.UNRECOGNIZED="UNRECOGNIZED",(c=o.ChannelEventUpdate_UpdateType||(o.ChannelEventUpdate_UpdateType={})).OPEN_CHANNEL="OPEN_CHANNEL",c.CLOSED_CHANNEL="CLOSED_CHANNEL",c.ACTIVE_CHANNEL="ACTIVE_CHANNEL",c.INACTIVE_CHANNEL="INACTIVE_CHANNEL",c.PENDING_OPEN_CHANNEL="PENDING_OPEN_CHANNEL",c.FULLY_RESOLVED_CHANNEL="FULLY_RESOLVED_CHANNEL",c.CHANNEL_FUNDING_TIMEOUT="CHANNEL_FUNDING_TIMEOUT",c.UNRECOGNIZED="UNRECOGNIZED",(u=o.Invoice_InvoiceState||(o.Invoice_InvoiceState={})).OPEN="OPEN",u.SETTLED="SETTLED",u.CANCELED="CANCELED",u.ACCEPTED="ACCEPTED",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.Payment_PaymentStatus||(o.Payment_PaymentStatus={})).UNKNOWN="UNKNOWN",h.IN_FLIGHT="IN_FLIGHT",h.SUCCEEDED="SUCCEEDED",h.FAILED="FAILED",h.INITIATED="INITIATED",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.HTLCAttempt_HTLCStatus||(o.HTLCAttempt_HTLCStatus={})).IN_FLIGHT="IN_FLIGHT",d.SUCCEEDED="SUCCEEDED",d.FAILED="FAILED",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.Failure_FailureCode||(o.Failure_FailureCode={})).RESERVED="RESERVED",p.INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS="INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS",p.INCORRECT_PAYMENT_AMOUNT="INCORRECT_PAYMENT_AMOUNT",p.FINAL_INCORRECT_CLTV_EXPIRY="FINAL_INCORRECT_CLTV_EXPIRY",p.FINAL_INCORRECT_HTLC_AMOUNT="FINAL_INCORRECT_HTLC_AMOUNT",p.FINAL_EXPIRY_TOO_SOON="FINAL_EXPIRY_TOO_SOON",p.INVALID_REALM="INVALID_REALM",p.EXPIRY_TOO_SOON="EXPIRY_TOO_SOON",p.INVALID_ONION_VERSION="INVALID_ONION_VERSION",p.INVALID_ONION_HMAC="INVALID_ONION_HMAC",p.INVALID_ONION_KEY="INVALID_ONION_KEY",p.AMOUNT_BELOW_MINIMUM="AMOUNT_BELOW_MINIMUM",p.FEE_INSUFFICIENT="FEE_INSUFFICIENT",p.INCORRECT_CLTV_EXPIRY="INCORRECT_CLTV_EXPIRY",p.CHANNEL_DISABLED="CHANNEL_DISABLED",p.TEMPORARY_CHANNEL_FAILURE="TEMPORARY_CHANNEL_FAILURE",p.REQUIRED_NODE_FEATURE_MISSING="REQUIRED_NODE_FEATURE_MISSING",p.REQUIRED_CHANNEL_FEATURE_MISSING="REQUIRED_CHANNEL_FEATURE_MISSING",p.UNKNOWN_NEXT_PEER="UNKNOWN_NEXT_PEER",p.TEMPORARY_NODE_FAILURE="TEMPORARY_NODE_FAILURE",p.PERMANENT_NODE_FAILURE="PERMANENT_NODE_FAILURE",p.PERMANENT_CHANNEL_FAILURE="PERMANENT_CHANNEL_FAILURE",p.EXPIRY_TOO_FAR="EXPIRY_TOO_FAR",p.MPP_TIMEOUT="MPP_TIMEOUT",p.INVALID_ONION_PAYLOAD="INVALID_ONION_PAYLOAD",p.INVALID_ONION_BLINDING="INVALID_ONION_BLINDING",p.INTERNAL_FAILURE="INTERNAL_FAILURE",p.UNKNOWN_FAILURE="UNKNOWN_FAILURE",p.UNREADABLE_FAILURE="UNREADABLE_FAILURE",p.UNRECOGNIZED="UNRECOGNIZED"},9353(b,o){var p,d;Object.defineProperty(o,"__esModule",{value:!0}),o.FeatureSet=o.UpdateAction=void 0,(d=o.UpdateAction||(o.UpdateAction={})).ADD="ADD",d.REMOVE="REMOVE",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.FeatureSet||(o.FeatureSet={})).SET_INIT="SET_INIT",p.SET_LEGACY_GLOBAL="SET_LEGACY_GLOBAL",p.SET_NODE_ANN="SET_NODE_ANN",p.SET_INVOICE="SET_INVOICE",p.SET_INVOICE_AMP="SET_INVOICE_AMP",p.UNRECOGNIZED="UNRECOGNIZED"},7543(b,o){var p,d,h,u,c,s;Object.defineProperty(o,"__esModule",{value:!0}),o.HtlcEvent_EventType=o.MissionControlConfig_ProbabilityModel=o.ChanStatusAction=o.ResolveHoldForwardAction=o.PaymentState=o.FailureDetail=void 0,(s=o.FailureDetail||(o.FailureDetail={})).UNKNOWN="UNKNOWN",s.NO_DETAIL="NO_DETAIL",s.ONION_DECODE="ONION_DECODE",s.LINK_NOT_ELIGIBLE="LINK_NOT_ELIGIBLE",s.ON_CHAIN_TIMEOUT="ON_CHAIN_TIMEOUT",s.HTLC_EXCEEDS_MAX="HTLC_EXCEEDS_MAX",s.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",s.INCOMPLETE_FORWARD="INCOMPLETE_FORWARD",s.HTLC_ADD_FAILED="HTLC_ADD_FAILED",s.FORWARDS_DISABLED="FORWARDS_DISABLED",s.INVOICE_CANCELED="INVOICE_CANCELED",s.INVOICE_UNDERPAID="INVOICE_UNDERPAID",s.INVOICE_EXPIRY_TOO_SOON="INVOICE_EXPIRY_TOO_SOON",s.INVOICE_NOT_OPEN="INVOICE_NOT_OPEN",s.MPP_INVOICE_TIMEOUT="MPP_INVOICE_TIMEOUT",s.ADDRESS_MISMATCH="ADDRESS_MISMATCH",s.SET_TOTAL_MISMATCH="SET_TOTAL_MISMATCH",s.SET_TOTAL_TOO_LOW="SET_TOTAL_TOO_LOW",s.SET_OVERPAID="SET_OVERPAID",s.UNKNOWN_INVOICE="UNKNOWN_INVOICE",s.INVALID_KEYSEND="INVALID_KEYSEND",s.MPP_IN_PROGRESS="MPP_IN_PROGRESS",s.CIRCULAR_ROUTE="CIRCULAR_ROUTE",s.UNRECOGNIZED="UNRECOGNIZED",(c=o.PaymentState||(o.PaymentState={})).IN_FLIGHT="IN_FLIGHT",c.SUCCEEDED="SUCCEEDED",c.FAILED_TIMEOUT="FAILED_TIMEOUT",c.FAILED_NO_ROUTE="FAILED_NO_ROUTE",c.FAILED_ERROR="FAILED_ERROR",c.FAILED_INCORRECT_PAYMENT_DETAILS="FAILED_INCORRECT_PAYMENT_DETAILS",c.FAILED_INSUFFICIENT_BALANCE="FAILED_INSUFFICIENT_BALANCE",c.UNRECOGNIZED="UNRECOGNIZED",(u=o.ResolveHoldForwardAction||(o.ResolveHoldForwardAction={})).SETTLE="SETTLE",u.FAIL="FAIL",u.RESUME="RESUME",u.RESUME_MODIFIED="RESUME_MODIFIED",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.ChanStatusAction||(o.ChanStatusAction={})).ENABLE="ENABLE",h.DISABLE="DISABLE",h.AUTO="AUTO",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.MissionControlConfig_ProbabilityModel||(o.MissionControlConfig_ProbabilityModel={})).APRIORI="APRIORI",d.BIMODAL="BIMODAL",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.HtlcEvent_EventType||(o.HtlcEvent_EventType={})).UNKNOWN="UNKNOWN",p.SEND="SEND",p.RECEIVE="RECEIVE",p.FORWARD="FORWARD",p.UNRECOGNIZED="UNRECOGNIZED"},5636(b,o){var p,d;Object.defineProperty(o,"__esModule",{value:!0}),o.MuSig2Version=o.SignMethod=void 0,(d=o.SignMethod||(o.SignMethod={})).SIGN_METHOD_WITNESS_V0="SIGN_METHOD_WITNESS_V0",d.SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086="SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086",d.SIGN_METHOD_TAPROOT_KEY_SPEND="SIGN_METHOD_TAPROOT_KEY_SPEND",d.SIGN_METHOD_TAPROOT_SCRIPT_SPEND="SIGN_METHOD_TAPROOT_SCRIPT_SPEND",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.MuSig2Version||(o.MuSig2Version={})).MUSIG2_VERSION_UNDEFINED="MUSIG2_VERSION_UNDEFINED",p.MUSIG2_VERSION_V040="MUSIG2_VERSION_V040",p.MUSIG2_VERSION_V100RC2="MUSIG2_VERSION_V100RC2",p.UNRECOGNIZED="UNRECOGNIZED"},4219(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.WalletState=void 0,(p=o.WalletState||(o.WalletState={})).NON_EXISTING="NON_EXISTING",p.LOCKED="LOCKED",p.UNLOCKED="UNLOCKED",p.RPC_ACTIVE="RPC_ACTIVE",p.SERVER_ACTIVE="SERVER_ACTIVE",p.WAITING_TO_START="WAITING_TO_START",p.UNRECOGNIZED="UNRECOGNIZED"},5779(b,o){var p,d,h;Object.defineProperty(o,"__esModule",{value:!0}),o.ChangeAddressType=o.WitnessType=o.AddressType=void 0,(h=o.AddressType||(o.AddressType={})).UNKNOWN="UNKNOWN",h.WITNESS_PUBKEY_HASH="WITNESS_PUBKEY_HASH",h.NESTED_WITNESS_PUBKEY_HASH="NESTED_WITNESS_PUBKEY_HASH",h.HYBRID_NESTED_WITNESS_PUBKEY_HASH="HYBRID_NESTED_WITNESS_PUBKEY_HASH",h.TAPROOT_PUBKEY="TAPROOT_PUBKEY",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.WitnessType||(o.WitnessType={})).UNKNOWN_WITNESS="UNKNOWN_WITNESS",d.COMMITMENT_TIME_LOCK="COMMITMENT_TIME_LOCK",d.COMMITMENT_NO_DELAY="COMMITMENT_NO_DELAY",d.COMMITMENT_REVOKE="COMMITMENT_REVOKE",d.HTLC_OFFERED_REVOKE="HTLC_OFFERED_REVOKE",d.HTLC_ACCEPTED_REVOKE="HTLC_ACCEPTED_REVOKE",d.HTLC_OFFERED_TIMEOUT_SECOND_LEVEL="HTLC_OFFERED_TIMEOUT_SECOND_LEVEL",d.HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL="HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL",d.HTLC_OFFERED_REMOTE_TIMEOUT="HTLC_OFFERED_REMOTE_TIMEOUT",d.HTLC_ACCEPTED_REMOTE_SUCCESS="HTLC_ACCEPTED_REMOTE_SUCCESS",d.HTLC_SECOND_LEVEL_REVOKE="HTLC_SECOND_LEVEL_REVOKE",d.WITNESS_KEY_HASH="WITNESS_KEY_HASH",d.NESTED_WITNESS_KEY_HASH="NESTED_WITNESS_KEY_HASH",d.COMMITMENT_ANCHOR="COMMITMENT_ANCHOR",d.COMMITMENT_NO_DELAY_TWEAKLESS="COMMITMENT_NO_DELAY_TWEAKLESS",d.COMMITMENT_TO_REMOTE_CONFIRMED="COMMITMENT_TO_REMOTE_CONFIRMED",d.HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED="HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED",d.HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED="HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED",d.LEASE_COMMITMENT_TIME_LOCK="LEASE_COMMITMENT_TIME_LOCK",d.LEASE_COMMITMENT_TO_REMOTE_CONFIRMED="LEASE_COMMITMENT_TO_REMOTE_CONFIRMED",d.LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL="LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL",d.LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL="LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL",d.TAPROOT_PUB_KEY_SPEND="TAPROOT_PUB_KEY_SPEND",d.TAPROOT_LOCAL_COMMIT_SPEND="TAPROOT_LOCAL_COMMIT_SPEND",d.TAPROOT_REMOTE_COMMIT_SPEND="TAPROOT_REMOTE_COMMIT_SPEND",d.TAPROOT_ANCHOR_SWEEP_SPEND="TAPROOT_ANCHOR_SWEEP_SPEND",d.TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL="TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL",d.TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL="TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL",d.TAPROOT_HTLC_SECOND_LEVEL_REVOKE="TAPROOT_HTLC_SECOND_LEVEL_REVOKE",d.TAPROOT_HTLC_ACCEPTED_REVOKE="TAPROOT_HTLC_ACCEPTED_REVOKE",d.TAPROOT_HTLC_OFFERED_REVOKE="TAPROOT_HTLC_OFFERED_REVOKE",d.TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT="TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT",d.TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT="TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT",d.TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS="TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS",d.TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS="TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS",d.TAPROOT_COMMITMENT_REVOKE="TAPROOT_COMMITMENT_REVOKE",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.ChangeAddressType||(o.ChangeAddressType={})).CHANGE_ADDRESS_TYPE_UNSPECIFIED="CHANGE_ADDRESS_TYPE_UNSPECIFIED",p.CHANGE_ADDRESS_TYPE_P2TR="CHANGE_ADDRESS_TYPE_P2TR",p.UNRECOGNIZED="UNRECOGNIZED"},5577(b,o){Object.defineProperty(o,"__esModule",{value:!0})},4899(b,o){Object.defineProperty(o,"__esModule",{value:!0})},6035(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.PolicyType=void 0,(p=o.PolicyType||(o.PolicyType={})).LEGACY="LEGACY",p.ANCHOR="ANCHOR",p.TAPROOT="TAPROOT",p.UNRECOGNIZED="UNRECOGNIZED"},1419(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(4377),o),h(p(4219),o),h(p(5577),o)},1730(b,o){var p,d,h,u,c,s,l,g,w;Object.defineProperty(o,"__esModule",{value:!0}),o.ListSwapsFilter_SwapTypeFilter=o.StaticAddressLoopInSwapState=o.DepositState=o.AutoReason=o.LiquidityRuleType=o.FailureReason=o.SwapState=o.SwapType=o.AddressType=void 0,(w=o.AddressType||(o.AddressType={})).ADDRESS_TYPE_UNKNOWN="ADDRESS_TYPE_UNKNOWN",w.TAPROOT_PUBKEY="TAPROOT_PUBKEY",w.UNRECOGNIZED="UNRECOGNIZED",(g=o.SwapType||(o.SwapType={})).LOOP_OUT="LOOP_OUT",g.LOOP_IN="LOOP_IN",g.UNRECOGNIZED="UNRECOGNIZED",(l=o.SwapState||(o.SwapState={})).INITIATED="INITIATED",l.PREIMAGE_REVEALED="PREIMAGE_REVEALED",l.HTLC_PUBLISHED="HTLC_PUBLISHED",l.SUCCESS="SUCCESS",l.FAILED="FAILED",l.INVOICE_SETTLED="INVOICE_SETTLED",l.UNRECOGNIZED="UNRECOGNIZED",(s=o.FailureReason||(o.FailureReason={})).FAILURE_REASON_NONE="FAILURE_REASON_NONE",s.FAILURE_REASON_OFFCHAIN="FAILURE_REASON_OFFCHAIN",s.FAILURE_REASON_TIMEOUT="FAILURE_REASON_TIMEOUT",s.FAILURE_REASON_SWEEP_TIMEOUT="FAILURE_REASON_SWEEP_TIMEOUT",s.FAILURE_REASON_INSUFFICIENT_VALUE="FAILURE_REASON_INSUFFICIENT_VALUE",s.FAILURE_REASON_TEMPORARY="FAILURE_REASON_TEMPORARY",s.FAILURE_REASON_INCORRECT_AMOUNT="FAILURE_REASON_INCORRECT_AMOUNT",s.FAILURE_REASON_ABANDONED="FAILURE_REASON_ABANDONED",s.FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE="FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE",s.FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT="FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT",s.UNRECOGNIZED="UNRECOGNIZED",(c=o.LiquidityRuleType||(o.LiquidityRuleType={})).UNKNOWN="UNKNOWN",c.THRESHOLD="THRESHOLD",c.UNRECOGNIZED="UNRECOGNIZED",(u=o.AutoReason||(o.AutoReason={})).AUTO_REASON_UNKNOWN="AUTO_REASON_UNKNOWN",u.AUTO_REASON_BUDGET_NOT_STARTED="AUTO_REASON_BUDGET_NOT_STARTED",u.AUTO_REASON_SWEEP_FEES="AUTO_REASON_SWEEP_FEES",u.AUTO_REASON_BUDGET_ELAPSED="AUTO_REASON_BUDGET_ELAPSED",u.AUTO_REASON_IN_FLIGHT="AUTO_REASON_IN_FLIGHT",u.AUTO_REASON_SWAP_FEE="AUTO_REASON_SWAP_FEE",u.AUTO_REASON_MINER_FEE="AUTO_REASON_MINER_FEE",u.AUTO_REASON_PREPAY="AUTO_REASON_PREPAY",u.AUTO_REASON_FAILURE_BACKOFF="AUTO_REASON_FAILURE_BACKOFF",u.AUTO_REASON_LOOP_OUT="AUTO_REASON_LOOP_OUT",u.AUTO_REASON_LOOP_IN="AUTO_REASON_LOOP_IN",u.AUTO_REASON_LIQUIDITY_OK="AUTO_REASON_LIQUIDITY_OK",u.AUTO_REASON_BUDGET_INSUFFICIENT="AUTO_REASON_BUDGET_INSUFFICIENT",u.AUTO_REASON_FEE_INSUFFICIENT="AUTO_REASON_FEE_INSUFFICIENT",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.DepositState||(o.DepositState={})).UNKNOWN_STATE="UNKNOWN_STATE",h.DEPOSITED="DEPOSITED",h.WITHDRAWING="WITHDRAWING",h.WITHDRAWN="WITHDRAWN",h.LOOPING_IN="LOOPING_IN",h.LOOPED_IN="LOOPED_IN",h.SWEEP_HTLC_TIMEOUT="SWEEP_HTLC_TIMEOUT",h.HTLC_TIMEOUT_SWEPT="HTLC_TIMEOUT_SWEPT",h.PUBLISH_EXPIRED="PUBLISH_EXPIRED",h.WAIT_FOR_EXPIRY_SWEEP="WAIT_FOR_EXPIRY_SWEEP",h.EXPIRED="EXPIRED",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.StaticAddressLoopInSwapState||(o.StaticAddressLoopInSwapState={})).UNKNOWN_STATIC_ADDRESS_SWAP_STATE="UNKNOWN_STATIC_ADDRESS_SWAP_STATE",d.INIT_HTLC="INIT_HTLC",d.SIGN_HTLC_TX="SIGN_HTLC_TX",d.MONITOR_INVOICE_HTLC_TX="MONITOR_INVOICE_HTLC_TX",d.PAYMENT_RECEIVED="PAYMENT_RECEIVED",d.SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT="SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT",d.MONITOR_HTLC_TIMEOUT_SWEEP="MONITOR_HTLC_TIMEOUT_SWEEP",d.HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT="HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT",d.SUCCEEDED="SUCCEEDED",d.SUCCEEDED_TRANSITIONING_FAILED="SUCCEEDED_TRANSITIONING_FAILED",d.UNLOCK_DEPOSITS="UNLOCK_DEPOSITS",d.FAILED_STATIC_ADDRESS_SWAP="FAILED_STATIC_ADDRESS_SWAP",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.ListSwapsFilter_SwapTypeFilter||(o.ListSwapsFilter_SwapTypeFilter={})).ANY="ANY",p.LOOP_OUT="LOOP_OUT",p.LOOP_IN="LOOP_IN",p.UNRECOGNIZED="UNRECOGNIZED"},66(b,o){Object.defineProperty(o,"__esModule",{value:!0})},7967(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(1730),o),h(p(66),o)},1393(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(5398),o)},1908(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(9353),o)},3029(b,o){var p,d,h,u,c,s,l,g,w,y,v,m,C,E;Object.defineProperty(o,"__esModule",{value:!0}),o.InvalidOrder_FailReason=o.AccountDiff_AccountState=o.SubscribeError_Error=o.OrderReject_OrderRejectReason=o.OrderMatchReject_RejectReason=o.DurationBucketState=o.OrderState=o.ChannelConfirmationConstraints=o.ChannelAnnouncementConstraints=o.NodeTier=o.AuctionType=o.OrderChannelType=o.AuctionAccountState=o.ChannelType=void 0,(E=o.ChannelType||(o.ChannelType={})).TWEAKLESS="TWEAKLESS",E.ANCHORS="ANCHORS",E.SCRIPT_ENFORCED_LEASE="SCRIPT_ENFORCED_LEASE",E.UNRECOGNIZED="UNRECOGNIZED",(C=o.AuctionAccountState||(o.AuctionAccountState={})).STATE_PENDING_OPEN="STATE_PENDING_OPEN",C.STATE_OPEN="STATE_OPEN",C.STATE_EXPIRED="STATE_EXPIRED",C.STATE_PENDING_UPDATE="STATE_PENDING_UPDATE",C.STATE_CLOSED="STATE_CLOSED",C.STATE_PENDING_BATCH="STATE_PENDING_BATCH",C.STATE_EXPIRED_PENDING_UPDATE="STATE_EXPIRED_PENDING_UPDATE",C.UNRECOGNIZED="UNRECOGNIZED",(m=o.OrderChannelType||(o.OrderChannelType={})).ORDER_CHANNEL_TYPE_UNKNOWN="ORDER_CHANNEL_TYPE_UNKNOWN",m.ORDER_CHANNEL_TYPE_PEER_DEPENDENT="ORDER_CHANNEL_TYPE_PEER_DEPENDENT",m.ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED="ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED",m.UNRECOGNIZED="UNRECOGNIZED",(v=o.AuctionType||(o.AuctionType={})).AUCTION_TYPE_BTC_INBOUND_LIQUIDITY="AUCTION_TYPE_BTC_INBOUND_LIQUIDITY",v.AUCTION_TYPE_BTC_OUTBOUND_LIQUIDITY="AUCTION_TYPE_BTC_OUTBOUND_LIQUIDITY",v.UNRECOGNIZED="UNRECOGNIZED",(y=o.NodeTier||(o.NodeTier={})).TIER_DEFAULT="TIER_DEFAULT",y.TIER_0="TIER_0",y.TIER_1="TIER_1",y.UNRECOGNIZED="UNRECOGNIZED",(w=o.ChannelAnnouncementConstraints||(o.ChannelAnnouncementConstraints={})).ANNOUNCEMENT_NO_PREFERENCE="ANNOUNCEMENT_NO_PREFERENCE",w.ONLY_ANNOUNCED="ONLY_ANNOUNCED",w.ONLY_UNANNOUNCED="ONLY_UNANNOUNCED",w.UNRECOGNIZED="UNRECOGNIZED",(g=o.ChannelConfirmationConstraints||(o.ChannelConfirmationConstraints={})).CONFIRMATION_NO_PREFERENCE="CONFIRMATION_NO_PREFERENCE",g.ONLY_CONFIRMED="ONLY_CONFIRMED",g.ONLY_ZEROCONF="ONLY_ZEROCONF",g.UNRECOGNIZED="UNRECOGNIZED",(l=o.OrderState||(o.OrderState={})).ORDER_SUBMITTED="ORDER_SUBMITTED",l.ORDER_CLEARED="ORDER_CLEARED",l.ORDER_PARTIALLY_FILLED="ORDER_PARTIALLY_FILLED",l.ORDER_EXECUTED="ORDER_EXECUTED",l.ORDER_CANCELED="ORDER_CANCELED",l.ORDER_EXPIRED="ORDER_EXPIRED",l.ORDER_FAILED="ORDER_FAILED",l.UNRECOGNIZED="UNRECOGNIZED",(s=o.DurationBucketState||(o.DurationBucketState={})).NO_MARKET="NO_MARKET",s.MARKET_CLOSED="MARKET_CLOSED",s.ACCEPTING_ORDERS="ACCEPTING_ORDERS",s.MARKET_OPEN="MARKET_OPEN",s.UNRECOGNIZED="UNRECOGNIZED",(c=o.OrderMatchReject_RejectReason||(o.OrderMatchReject_RejectReason={})).UNKNOWN="UNKNOWN",c.SERVER_MISBEHAVIOR="SERVER_MISBEHAVIOR",c.BATCH_VERSION_MISMATCH="BATCH_VERSION_MISMATCH",c.PARTIAL_REJECT="PARTIAL_REJECT",c.UNRECOGNIZED="UNRECOGNIZED",(u=o.OrderReject_OrderRejectReason||(o.OrderReject_OrderRejectReason={})).DUPLICATE_PEER="DUPLICATE_PEER",u.CHANNEL_FUNDING_FAILED="CHANNEL_FUNDING_FAILED",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.SubscribeError_Error||(o.SubscribeError_Error={})).UNKNOWN="UNKNOWN",h.SERVER_SHUTDOWN="SERVER_SHUTDOWN",h.ACCOUNT_DOES_NOT_EXIST="ACCOUNT_DOES_NOT_EXIST",h.INCOMPLETE_ACCOUNT_RESERVATION="INCOMPLETE_ACCOUNT_RESERVATION",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.AccountDiff_AccountState||(o.AccountDiff_AccountState={})).OUTPUT_RECREATED="OUTPUT_RECREATED",d.OUTPUT_DUST_EXTENDED_OFFCHAIN="OUTPUT_DUST_EXTENDED_OFFCHAIN",d.OUTPUT_DUST_ADDED_TO_FEES="OUTPUT_DUST_ADDED_TO_FEES",d.OUTPUT_FULLY_SPENT="OUTPUT_FULLY_SPENT",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.InvalidOrder_FailReason||(o.InvalidOrder_FailReason={})).INVALID_AMT="INVALID_AMT",p.UNRECOGNIZED="UNRECOGNIZED"},4541(b,o){Object.defineProperty(o,"__esModule",{value:!0})},7521(b,o){var p,d,h,u;Object.defineProperty(o,"__esModule",{value:!0}),o.MatchRejectReason=o.MatchState=o.AccountState=o.AccountVersion=void 0,(u=o.AccountVersion||(o.AccountVersion={})).ACCOUNT_VERSION_LND_DEPENDENT="ACCOUNT_VERSION_LND_DEPENDENT",u.ACCOUNT_VERSION_LEGACY="ACCOUNT_VERSION_LEGACY",u.ACCOUNT_VERSION_TAPROOT="ACCOUNT_VERSION_TAPROOT",u.ACCOUNT_VERSION_TAPROOT_V2="ACCOUNT_VERSION_TAPROOT_V2",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.AccountState||(o.AccountState={})).PENDING_OPEN="PENDING_OPEN",h.PENDING_UPDATE="PENDING_UPDATE",h.OPEN="OPEN",h.EXPIRED="EXPIRED",h.PENDING_CLOSED="PENDING_CLOSED",h.CLOSED="CLOSED",h.RECOVERY_FAILED="RECOVERY_FAILED",h.PENDING_BATCH="PENDING_BATCH",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.MatchState||(o.MatchState={})).PREPARE="PREPARE",d.ACCEPTED="ACCEPTED",d.REJECTED="REJECTED",d.SIGNED="SIGNED",d.FINALIZED="FINALIZED",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.MatchRejectReason||(o.MatchRejectReason={})).NONE="NONE",p.SERVER_MISBEHAVIOR="SERVER_MISBEHAVIOR",p.BATCH_VERSION_MISMATCH="BATCH_VERSION_MISMATCH",p.PARTIAL_REJECT_COLLATERAL="PARTIAL_REJECT_COLLATERAL",p.PARTIAL_REJECT_DUPLICATE_PEER="PARTIAL_REJECT_DUPLICATE_PEER",p.PARTIAL_REJECT_CHANNEL_FUNDING_FAILED="PARTIAL_REJECT_CHANNEL_FUNDING_FAILED",p.UNRECOGNIZED="UNRECOGNIZED"},2471(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(3029),o),h(p(4541),o),h(p(7521),o)},2162(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(9719),o)},4386(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(1380),o)},6534(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(7543),o)},2495(b,o){Object.defineProperty(o,"__esModule",{value:!0}),o.subscriptionMethods=o.serviceNames=void 0,o.serviceNames={frdrpc:{FaradayServer:"frdrpc.FaradayServer"},litrpc:{Firewall:"litrpc.Firewall",Autopilot:"litrpc.Autopilot",Sessions:"litrpc.Sessions",Status:"litrpc.Status"},autopilotrpc:{Autopilot:"autopilotrpc.Autopilot"},chainrpc:{ChainNotifier:"chainrpc.ChainNotifier"},invoicesrpc:{Invoices:"invoicesrpc.Invoices"},lnrpc:{Lightning:"lnrpc.Lightning",State:"lnrpc.State",WalletUnlocker:"lnrpc.WalletUnlocker"},peersrpc:{Peers:"peersrpc.Peers"},routerrpc:{Router:"routerrpc.Router"},signrpc:{Signer:"signrpc.Signer"},walletrpc:{WalletKit:"walletrpc.WalletKit"},watchtowerrpc:{Watchtower:"watchtowerrpc.Watchtower"},wtclientrpc:{WatchtowerClient:"wtclientrpc.WatchtowerClient"},looprpc:{SwapClient:"looprpc.SwapClient",Debug:"looprpc.Debug"},poolrpc:{ChannelAuctioneer:"poolrpc.ChannelAuctioneer",HashMail:"poolrpc.HashMail",Trader:"poolrpc.Trader"},assetwalletrpc:{AssetWallet:"assetwalletrpc.AssetWallet"},authmailboxrpc:{Mailbox:"authmailboxrpc.Mailbox"},mintrpc:{Mint:"mintrpc.Mint"},priceoraclerpc:{PriceOracle:"priceoraclerpc.PriceOracle"},rfqrpc:{Rfq:"rfqrpc.Rfq"},tapchannelrpc:{TaprootAssetChannels:"tapchannelrpc.TaprootAssetChannels"},tapdevrpc:{TapDev:"tapdevrpc.TapDev"},taprpc:{TaprootAssets:"taprpc.TaprootAssets"},universerpc:{Universe:"universerpc.Universe"}},o.subscriptionMethods=["chainrpc.ChainNotifier.RegisterConfirmationsNtfn","chainrpc.ChainNotifier.RegisterSpendNtfn","chainrpc.ChainNotifier.RegisterBlockEpochNtfn","invoicesrpc.Invoices.SubscribeSingleInvoice","invoicesrpc.Invoices.HtlcModifier","lnrpc.Lightning.SubscribeTransactions","lnrpc.Lightning.SubscribePeerEvents","lnrpc.Lightning.SubscribeChannelEvents","lnrpc.Lightning.OpenChannel","lnrpc.Lightning.ChannelAcceptor","lnrpc.Lightning.CloseChannel","lnrpc.Lightning.SendPayment","lnrpc.Lightning.SendToRoute","lnrpc.Lightning.SubscribeInvoices","lnrpc.Lightning.SubscribeChannelGraph","lnrpc.Lightning.SubscribeChannelBackups","lnrpc.Lightning.RegisterRPCMiddleware","lnrpc.Lightning.SubscribeCustomMessages","routerrpc.Router.SendPaymentV2","routerrpc.Router.TrackPaymentV2","routerrpc.Router.TrackPayments","routerrpc.Router.SubscribeHtlcEvents","routerrpc.Router.SendPayment","routerrpc.Router.TrackPayment","routerrpc.Router.HtlcInterceptor","lnrpc.State.SubscribeState","looprpc.SwapClient.Monitor","poolrpc.ChannelAuctioneer.SubscribeBatchAuction","poolrpc.ChannelAuctioneer.SubscribeSidecar","poolrpc.HashMail.RecvStream","authmailboxrpc.Mailbox.ReceiveMessages","lnrpc.Lightning.SubscribeTransactions","lnrpc.Lightning.SubscribePeerEvents","lnrpc.Lightning.SubscribeChannelEvents","lnrpc.Lightning.OpenChannel","lnrpc.Lightning.ChannelAcceptor","lnrpc.Lightning.CloseChannel","lnrpc.Lightning.SendPayment","lnrpc.Lightning.SendToRoute","lnrpc.Lightning.SubscribeInvoices","lnrpc.Lightning.SubscribeChannelGraph","lnrpc.Lightning.SubscribeChannelBackups","lnrpc.Lightning.RegisterRPCMiddleware","lnrpc.Lightning.SubscribeCustomMessages","mintrpc.Mint.SubscribeMintEvents","rfqrpc.Rfq.SubscribeRfqEventNtfns","routerrpc.Router.SendPaymentV2","routerrpc.Router.TrackPaymentV2","routerrpc.Router.TrackPayments","routerrpc.Router.SubscribeHtlcEvents","routerrpc.Router.SendPayment","routerrpc.Router.TrackPayment","routerrpc.Router.HtlcInterceptor","tapchannelrpc.TaprootAssetChannels.SendPayment","tapdevrpc.TapDev.SubscribeSendAssetEventNtfns","tapdevrpc.TapDev.SubscribeReceiveAssetEventNtfns","taprpc.TaprootAssets.SubscribeReceiveEvents","taprpc.TaprootAssets.SubscribeSendEvents"]},8054(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(5636),o)},8933(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(6190),o)},5712(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.CoinSelectType=void 0,(p=o.CoinSelectType||(o.CoinSelectType={})).COIN_SELECT_DEFAULT="COIN_SELECT_DEFAULT",p.COIN_SELECT_BIP86_ONLY="COIN_SELECT_BIP86_ONLY",p.COIN_SELECT_SCRIPT_TREES_ALLOWED="COIN_SELECT_SCRIPT_TREES_ALLOWED",p.UNRECOGNIZED="UNRECOGNIZED"},4376(b,o){Object.defineProperty(o,"__esModule",{value:!0})},5398(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.BatchState=void 0,(p=o.BatchState||(o.BatchState={})).BATCH_STATE_UNKNOWN="BATCH_STATE_UNKNOWN",p.BATCH_STATE_PENDING="BATCH_STATE_PENDING",p.BATCH_STATE_FROZEN="BATCH_STATE_FROZEN",p.BATCH_STATE_COMMITTED="BATCH_STATE_COMMITTED",p.BATCH_STATE_BROADCAST="BATCH_STATE_BROADCAST",p.BATCH_STATE_CONFIRMED="BATCH_STATE_CONFIRMED",p.BATCH_STATE_FINALIZED="BATCH_STATE_FINALIZED",p.BATCH_STATE_SEEDLING_CANCELLED="BATCH_STATE_SEEDLING_CANCELLED",p.BATCH_STATE_SPROUT_CANCELLED="BATCH_STATE_SPROUT_CANCELLED",p.UNRECOGNIZED="UNRECOGNIZED"},9719(b,o){var p,d;Object.defineProperty(o,"__esModule",{value:!0}),o.Intent=o.TransactionType=void 0,(d=o.TransactionType||(o.TransactionType={})).PURCHASE="PURCHASE",d.SALE="SALE",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.Intent||(o.Intent={})).INTENT_UNSPECIFIED="INTENT_UNSPECIFIED",p.INTENT_PAY_INVOICE_HINT="INTENT_PAY_INVOICE_HINT",p.INTENT_PAY_INVOICE="INTENT_PAY_INVOICE",p.INTENT_PAY_INVOICE_QUALIFY="INTENT_PAY_INVOICE_QUALIFY",p.INTENT_RECV_PAYMENT_HINT="INTENT_RECV_PAYMENT_HINT",p.INTENT_RECV_PAYMENT="INTENT_RECV_PAYMENT",p.INTENT_RECV_PAYMENT_QUALIFY="INTENT_RECV_PAYMENT_QUALIFY",p.UNRECOGNIZED="UNRECOGNIZED"},1380(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.QuoteRespStatus=void 0,(p=o.QuoteRespStatus||(o.QuoteRespStatus={})).INVALID_ASSET_RATES="INVALID_ASSET_RATES",p.INVALID_EXPIRY="INVALID_EXPIRY",p.PRICE_ORACLE_QUERY_ERR="PRICE_ORACLE_QUERY_ERR",p.UNRECOGNIZED="UNRECOGNIZED"},6190(b,o){Object.defineProperty(o,"__esModule",{value:!0})},3126(b,o){var p;Object.defineProperty(o,"__esModule",{value:!0}),o.ProofTransferType=void 0,(p=o.ProofTransferType||(o.ProofTransferType={})).PROOF_TRANSFER_TYPE_SEND="PROOF_TRANSFER_TYPE_SEND",p.PROOF_TRANSFER_TYPE_RECEIVE="PROOF_TRANSFER_TYPE_RECEIVE",p.UNRECOGNIZED="UNRECOGNIZED"},8960(b,o){var p,d,h,u,c,s,l,g,w,y;Object.defineProperty(o,"__esModule",{value:!0}),o.ParcelType=o.SendState=o.AddrEventStatus=o.ScriptKeyType=o.AddrVersion=o.ProofDeliveryStatus=o.OutputType=o.AssetVersion=o.AssetMetaType=o.AssetType=void 0,(y=o.AssetType||(o.AssetType={})).NORMAL="NORMAL",y.COLLECTIBLE="COLLECTIBLE",y.UNRECOGNIZED="UNRECOGNIZED",(w=o.AssetMetaType||(o.AssetMetaType={})).META_TYPE_OPAQUE="META_TYPE_OPAQUE",w.META_TYPE_JSON="META_TYPE_JSON",w.UNRECOGNIZED="UNRECOGNIZED",(g=o.AssetVersion||(o.AssetVersion={})).ASSET_VERSION_V0="ASSET_VERSION_V0",g.ASSET_VERSION_V1="ASSET_VERSION_V1",g.UNRECOGNIZED="UNRECOGNIZED",(l=o.OutputType||(o.OutputType={})).OUTPUT_TYPE_SIMPLE="OUTPUT_TYPE_SIMPLE",l.OUTPUT_TYPE_SPLIT_ROOT="OUTPUT_TYPE_SPLIT_ROOT",l.UNRECOGNIZED="UNRECOGNIZED",(s=o.ProofDeliveryStatus||(o.ProofDeliveryStatus={})).PROOF_DELIVERY_STATUS_NOT_APPLICABLE="PROOF_DELIVERY_STATUS_NOT_APPLICABLE",s.PROOF_DELIVERY_STATUS_COMPLETE="PROOF_DELIVERY_STATUS_COMPLETE",s.PROOF_DELIVERY_STATUS_PENDING="PROOF_DELIVERY_STATUS_PENDING",s.UNRECOGNIZED="UNRECOGNIZED",(c=o.AddrVersion||(o.AddrVersion={})).ADDR_VERSION_UNSPECIFIED="ADDR_VERSION_UNSPECIFIED",c.ADDR_VERSION_V0="ADDR_VERSION_V0",c.ADDR_VERSION_V1="ADDR_VERSION_V1",c.ADDR_VERSION_V2="ADDR_VERSION_V2",c.UNRECOGNIZED="UNRECOGNIZED",(u=o.ScriptKeyType||(o.ScriptKeyType={})).SCRIPT_KEY_UNKNOWN="SCRIPT_KEY_UNKNOWN",u.SCRIPT_KEY_BIP86="SCRIPT_KEY_BIP86",u.SCRIPT_KEY_SCRIPT_PATH_EXTERNAL="SCRIPT_KEY_SCRIPT_PATH_EXTERNAL",u.SCRIPT_KEY_BURN="SCRIPT_KEY_BURN",u.SCRIPT_KEY_TOMBSTONE="SCRIPT_KEY_TOMBSTONE",u.SCRIPT_KEY_CHANNEL="SCRIPT_KEY_CHANNEL",u.SCRIPT_KEY_UNIQUE_PEDERSEN="SCRIPT_KEY_UNIQUE_PEDERSEN",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.AddrEventStatus||(o.AddrEventStatus={})).ADDR_EVENT_STATUS_UNKNOWN="ADDR_EVENT_STATUS_UNKNOWN",h.ADDR_EVENT_STATUS_TRANSACTION_DETECTED="ADDR_EVENT_STATUS_TRANSACTION_DETECTED",h.ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED="ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED",h.ADDR_EVENT_STATUS_PROOF_RECEIVED="ADDR_EVENT_STATUS_PROOF_RECEIVED",h.ADDR_EVENT_STATUS_COMPLETED="ADDR_EVENT_STATUS_COMPLETED",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.SendState||(o.SendState={})).SEND_STATE_VIRTUAL_INPUT_SELECT="SEND_STATE_VIRTUAL_INPUT_SELECT",d.SEND_STATE_VIRTUAL_SIGN="SEND_STATE_VIRTUAL_SIGN",d.SEND_STATE_ANCHOR_SIGN="SEND_STATE_ANCHOR_SIGN",d.SEND_STATE_LOG_COMMITMENT="SEND_STATE_LOG_COMMITMENT",d.SEND_STATE_BROADCAST="SEND_STATE_BROADCAST",d.SEND_STATE_WAIT_CONFIRMATION="SEND_STATE_WAIT_CONFIRMATION",d.SEND_STATE_STORE_PROOFS="SEND_STATE_STORE_PROOFS",d.SEND_STATE_TRANSFER_PROOFS="SEND_STATE_TRANSFER_PROOFS",d.SEND_STATE_COMPLETED="SEND_STATE_COMPLETED",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.ParcelType||(o.ParcelType={})).PARCEL_TYPE_ADDRESS="PARCEL_TYPE_ADDRESS",p.PARCEL_TYPE_PRE_SIGNED="PARCEL_TYPE_PRE_SIGNED",p.PARCEL_TYPE_PENDING="PARCEL_TYPE_PENDING",p.PARCEL_TYPE_PRE_ANCHORED="PARCEL_TYPE_PRE_ANCHORED",p.UNRECOGNIZED="UNRECOGNIZED"},5558(b,o){var p,d,h,u,c;Object.defineProperty(o,"__esModule",{value:!0}),o.AssetTypeFilter=o.SortDirection=o.AssetQuerySort=o.UniverseSyncMode=o.ProofType=void 0,(c=o.ProofType||(o.ProofType={})).PROOF_TYPE_UNSPECIFIED="PROOF_TYPE_UNSPECIFIED",c.PROOF_TYPE_ISSUANCE="PROOF_TYPE_ISSUANCE",c.PROOF_TYPE_TRANSFER="PROOF_TYPE_TRANSFER",c.UNRECOGNIZED="UNRECOGNIZED",(u=o.UniverseSyncMode||(o.UniverseSyncMode={})).SYNC_ISSUANCE_ONLY="SYNC_ISSUANCE_ONLY",u.SYNC_FULL="SYNC_FULL",u.UNRECOGNIZED="UNRECOGNIZED",(h=o.AssetQuerySort||(o.AssetQuerySort={})).SORT_BY_NONE="SORT_BY_NONE",h.SORT_BY_ASSET_NAME="SORT_BY_ASSET_NAME",h.SORT_BY_ASSET_ID="SORT_BY_ASSET_ID",h.SORT_BY_ASSET_TYPE="SORT_BY_ASSET_TYPE",h.SORT_BY_TOTAL_SYNCS="SORT_BY_TOTAL_SYNCS",h.SORT_BY_TOTAL_PROOFS="SORT_BY_TOTAL_PROOFS",h.SORT_BY_GENESIS_HEIGHT="SORT_BY_GENESIS_HEIGHT",h.SORT_BY_TOTAL_SUPPLY="SORT_BY_TOTAL_SUPPLY",h.UNRECOGNIZED="UNRECOGNIZED",(d=o.SortDirection||(o.SortDirection={})).SORT_DIRECTION_ASC="SORT_DIRECTION_ASC",d.SORT_DIRECTION_DESC="SORT_DIRECTION_DESC",d.UNRECOGNIZED="UNRECOGNIZED",(p=o.AssetTypeFilter||(o.AssetTypeFilter={})).FILTER_ASSET_NONE="FILTER_ASSET_NONE",p.FILTER_ASSET_NORMAL="FILTER_ASSET_NORMAL",p.FILTER_ASSET_COLLECTIBLE="FILTER_ASSET_COLLECTIBLE",p.UNRECOGNIZED="UNRECOGNIZED"},8753(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(3126),o)},5600(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(8960),o)},7164(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(5558),o)},718(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(5779),o)},5109(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(4899),o)},7685(b,o,p){var d=this&&this.__createBinding||(Object.create?function(u,c,s,l){l===void 0&&(l=s),Object.defineProperty(u,l,{enumerable:!0,get:function(){return c[s]}})}:function(u,c,s,l){l===void 0&&(l=s),u[l]=c[s]}),h=this&&this.__exportStar||function(u,c){for(var s in u)s==="default"||Object.prototype.hasOwnProperty.call(c,s)||d(c,u,s)};Object.defineProperty(o,"__esModule",{value:!0}),h(p(6035),o)},1022(b,o){Object.defineProperty(o,"__esModule",{value:!0}),o.camelKeysToSnake=o.snakeKeysToCamel=o.isObject=void 0;var p=function(d){return Array.isArray(d)};o.isObject=function(d){return d===Object(d)&&!p(d)&&typeof d!="function"},o.snakeKeysToCamel=function(d){if((0,o.isObject)(d)){var h={};return Object.keys(d).forEach(function(u){var c;h[c=u,c.replace(/([-_][a-z])/gi,function(s){return s.toUpperCase().replace("-","").replace("_","")})]=(0,o.snakeKeysToCamel)(d[u])}),h}return p(d)?d.map(function(u){return(0,o.snakeKeysToCamel)(u)}):d},o.camelKeysToSnake=function(d){if((0,o.isObject)(d)){var h={};return Object.keys(d).forEach(function(u){var c;h[c=u,c.replace(/[A-Z]/g,function(s){return"_".concat(s.toLowerCase())})]=(0,o.camelKeysToSnake)(d[u])}),h}return p(d)?d.map(function(u){return(0,o.camelKeysToSnake)(u)}):d}}},f={};return(function b(o){var p=f[o];if(p!==void 0)return p.exports;var d=f[o]={exports:{}};return a[o].call(d.exports,d,d.exports,b),d.exports})(4245)})(),n.exports=i()},4148(n,i,a){"use strict";var f=a(5606),b=a(6763);function o(k){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},o(k)}function p(k,j){for(var M=0;M1?M-1:0),W=1;W1?M-1:0),W=1;W1?M-1:0),W=1;W1?M-1:0),W=1;W"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function g(x,I){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,H){return L.__proto__=H,L},g(x,I)}function w(x){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(I){return I.__proto__||Object.getPrototypeOf(I)},w(x)}function y(x){return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(I){return typeof I}:function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},y(x)}var v=a(537).inspect,m=a(9597).codes.ERR_INVALID_ARG_TYPE;function C(x,I,L){return(L===void 0||L>x.length)&&(L=x.length),x.substring(L-I.length,L)===I}var E="",O="",_="",S="",R={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(x){var I=Object.keys(x),L=Object.create(Object.getPrototypeOf(x));return I.forEach(function(H){L[H]=x[H]}),Object.defineProperty(L,"message",{value:x.message}),L}function T(x){return v(x,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var N=(function(x,I){(function(G,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");G.prototype=Object.create(V&&V.prototype,{constructor:{value:G,writable:!0,configurable:!0}}),Object.defineProperty(G,"prototype",{writable:!1}),V&&g(G,V)})(B,x);var L,H,Z,K,P=(L=B,H=l(),function(){var G,V=w(L);if(H){var z=w(this).constructor;G=Reflect.construct(V,arguments,z)}else G=V.apply(this,arguments);return h(this,G)});function B(G){var V;if((function(q,te){if(!(q instanceof te))throw new TypeError("Cannot call a class as a function")})(this,B),y(G)!=="object"||G===null)throw new m("options","Object",G);var z=G.message,U=G.operator,F=G.stackStartFn,D=G.actual,k=G.expected,j=Error.stackTraceLimit;if(Error.stackTraceLimit=0,z!=null)V=P.call(this,String(z));else if(f.stderr&&f.stderr.isTTY&&(f.stderr&&f.stderr.getColorDepth&&f.stderr.getColorDepth()!==1?(E="\x1B[34m",O="\x1B[32m",S="\x1B[39m",_="\x1B[31m"):(E="",O="",S="",_="")),y(D)==="object"&&D!==null&&y(k)==="object"&&k!==null&&"stack"in D&&D instanceof Error&&"stack"in k&&k instanceof Error&&(D=A(D),k=A(k)),U==="deepStrictEqual"||U==="strictEqual")V=P.call(this,(function(q,te,ie){var ae="",ue="",le=0,me="",Ae=!1,fe=T(q),se=fe.split(` `),he=T(te).split(` `),ce=0,Ie="";if(ie==="strictEqual"&&y(q)==="object"&&y(te)==="object"&&q!==null&&te!==null&&(ie="strictEqualObject"),se.length===1&&he.length===1&&se[0]!==he[0]){var Ze=se[0].length+he[0].length;if(Ze<=10){if(!(y(q)==="object"&&q!==null||y(te)==="object"&&te!==null||q===0&&te===0))return"".concat(R[ie],` `)+"".concat(se[0]," !== ").concat(he[0],` `)}else if(ie!=="strictEqualObject"&&Ze<(f.stderr&&f.stderr.isTTY?f.stderr.columns:80)){for(;se[0][ce]===he[0][ce];)ce++;ce>2&&(Ie=` `.concat((function(ve,Ke){if(Ke=Math.floor(Ke),ve.length==0||Ke==0)return"";var ft=ve.length*Ke;for(Ke=Math.floor(Math.log(Ke)/Math.log(2));Ke;)ve+=ve,Ke--;return ve+ve.substring(0,ft-ve.length)})(" ",ce),"^"),ce=0)}}for(var De=se[se.length-1],Ge=he[he.length-1];De===Ge&&(ce++<2?me=` `.concat(De).concat(me):ae=De,se.pop(),he.pop(),se.length!==0&&he.length!==0);)De=se[se.length-1],Ge=he[he.length-1];var at=Math.max(se.length,he.length);if(at===0){var Se=fe.split(` `);if(Se.length>30)for(Se[26]="".concat(E,"...").concat(S);Se.length>27;)Se.pop();return"".concat(R.notIdentical,` `).concat(Se.join(` `),` `)}ce>3&&(me=` `.concat(E,"...").concat(S).concat(me),Ae=!0),ae!==""&&(me=` `.concat(ae).concat(me),ae="");var ke=0,ze=R[ie]+` `.concat(O,"+ actual").concat(S," ").concat(_,"- expected").concat(S),nt=" ".concat(E,"...").concat(S," Lines skipped");for(ce=0;ce1&&ce>2&&(Ne>4?(ue+=` `.concat(E,"...").concat(S),Ae=!0):Ne>3&&(ue+=` `.concat(he[ce-2]),ke++),ue+=` `.concat(he[ce-1]),ke++),le=ce,ae+=` `.concat(_,"-").concat(S," ").concat(he[ce]),ke++;else if(he.length1&&ce>2&&(Ne>4?(ue+=` `.concat(E,"...").concat(S),Ae=!0):Ne>3&&(ue+=` `.concat(se[ce-2]),ke++),ue+=` `.concat(se[ce-1]),ke++),le=ce,ue+=` `.concat(O,"+").concat(S," ").concat(se[ce]),ke++;else{var We=he[ce],Le=se[ce],Je=Le!==We&&(!C(Le,",")||Le.slice(0,-1)!==We);Je&&C(We,",")&&We.slice(0,-1)===Le&&(Je=!1,Le+=","),Je?(Ne>1&&ce>2&&(Ne>4?(ue+=` `.concat(E,"...").concat(S),Ae=!0):Ne>3&&(ue+=` `.concat(se[ce-2]),ke++),ue+=` `.concat(se[ce-1]),ke++),le=ce,ue+=` `.concat(O,"+").concat(S," ").concat(Le),ae+=` `.concat(_,"-").concat(S," ").concat(We),ke+=2):(ue+=ae,ae="",Ne!==1&&ce!==0||(ue+=` `.concat(Le),ke++))}if(ke>20&&ce30)for($[26]="".concat(E,"...").concat(S);$.length>27;)$.pop();V=$.length===1?P.call(this,"".concat(M," ").concat($[0])):P.call(this,"".concat(M,` `).concat($.join(` `),` `))}else{var W=T(D),Y="",Q=R[U];U==="notDeepEqual"||U==="notEqual"?(W="".concat(R[U],` `).concat(W)).length>1024&&(W="".concat(W.slice(0,1021),"...")):(Y="".concat(T(k)),W.length>512&&(W="".concat(W.slice(0,509),"...")),Y.length>512&&(Y="".concat(Y.slice(0,509),"...")),U==="deepEqual"||U==="equal"?W="".concat(Q,` `).concat(W,` should equal `):Y=" ".concat(U," ").concat(Y)),V=P.call(this,"".concat(W).concat(Y))}return Error.stackTraceLimit=j,V.generatedMessage=!z,Object.defineProperty(u(V),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),V.code="ERR_ASSERTION",V.actual=D,V.expected=k,V.operator=U,Error.captureStackTrace&&Error.captureStackTrace(u(V),F),V.stack,V.name="AssertionError",h(V)}return Z=B,(K=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:I,value:function(G,V){return v(this,o(o({},V),{},{customInspect:!1,depth:0}))}}])&&p(Z.prototype,K),Object.defineProperty(Z,"prototype",{writable:!1}),B})(c(Error),v.custom);n.exports=N},9597(n,i,a){"use strict";function f(s){return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},f(s)}function b(s,l){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,w){return g.__proto__=w,g},b(s,l)}function o(s){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},o(s)}var p,d,h={};function u(s,l,g){g||(g=Error);var w=(function(y){(function(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),Object.defineProperty(_,"prototype",{writable:!1}),S&&b(_,S)})(O,y);var v,m,C,E=(m=O,C=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}})(),function(){var _,S=o(m);if(C){var R=o(this).constructor;_=Reflect.construct(S,arguments,R)}else _=S.apply(this,arguments);return(function(A,T){if(T&&(f(T)==="object"||typeof T=="function"))return T;if(T!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N})(A)})(this,_)});function O(_,S,R){var A;return(function(T,N){if(!(T instanceof N))throw new TypeError("Cannot call a class as a function")})(this,O),A=E.call(this,(function(T,N,x){return typeof l=="string"?l:l(T,N,x)})(_,S,R)),A.code=s,A}return v=O,Object.defineProperty(v,"prototype",{writable:!1}),v})(g);h[s]=w}function c(s,l){if(Array.isArray(s)){var g=s.length;return s=s.map(function(w){return String(w)}),g>2?"one of ".concat(l," ").concat(s.slice(0,g-1).join(", "),", or ")+s[g-1]:g===2?"one of ".concat(l," ").concat(s[0]," or ").concat(s[1]):"of ".concat(l," ").concat(s[0])}return"of ".concat(l," ").concat(String(s))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(s,l,g){var w,y,v,m,C;if(p===void 0&&(p=a(4148)),p(typeof s=="string","'name' must be a string"),typeof l=="string"&&(y="not ",l.substr(0,4)===y)?(w="must not be",l=l.replace(/^not /,"")):w="must be",(function(O,_,S){return(S===void 0||S>O.length)&&(S=O.length),O.substring(S-9,S)===_})(s," argument"))v="The ".concat(s," ").concat(w," ").concat(c(l,"type"));else{var E=(typeof C!="number"&&(C=0),C+1>(m=s).length||m.indexOf(".",C)===-1?"argument":"property");v='The "'.concat(s,'" ').concat(E," ").concat(w," ").concat(c(l,"type"))}return v+". Received type ".concat(f(g))},TypeError),u("ERR_INVALID_ARG_VALUE",function(s,l){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";d===void 0&&(d=a(537));var w=d.inspect(l);return w.length>128&&(w="".concat(w.slice(0,128),"...")),"The argument '".concat(s,"' ").concat(g,". Received ").concat(w)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(s,l,g){var w;return w=g&&g.constructor&&g.constructor.name?"instance of ".concat(g.constructor.name):"type ".concat(f(g)),"Expected ".concat(s,' to be returned from the "').concat(l,'"')+" function but got ".concat(w,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var s=arguments.length,l=new Array(s),g=0;g0,"At least one arg needs to be specified");var w="The ",y=l.length;switch(l=l.map(function(v){return'"'.concat(v,'"')}),y){case 1:w+="".concat(l[0]," argument");break;case 2:w+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:w+=l.slice(0,y-1).join(", "),w+=", and ".concat(l[y-1]," arguments")}return"".concat(w," must be specified")},TypeError),n.exports.codes=h},2299(n,i,a){"use strict";function f(M,$){return(function(W){if(Array.isArray(W))return W})(M)||(function(W,Y){var Q=W==null?null:typeof Symbol<"u"&&W[Symbol.iterator]||W["@@iterator"];if(Q!=null){var q,te,ie,ae,ue=[],le=!0,me=!1;try{if(ie=(Q=Q.call(W)).next,Y===0){if(Object(Q)!==Q)return;le=!1}else for(;!(le=(q=ie.call(Q)).done)&&(ue.push(q.value),ue.length!==Y);le=!0);}catch(Ae){me=!0,te=Ae}finally{try{if(!le&&Q.return!=null&&(ae=Q.return(),Object(ae)!==ae))return}finally{if(me)throw te}}return ue}})(M,$)||(function(W,Y){if(W){if(typeof W=="string")return b(W,Y);var Q=Object.prototype.toString.call(W).slice(8,-1);return Q==="Object"&&W.constructor&&(Q=W.constructor.name),Q==="Map"||Q==="Set"?Array.from(W):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?b(W,Y):void 0}})(M,$)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function b(M,$){($==null||$>M.length)&&($=M.length);for(var W=0,Y=new Array($);W<$;W++)Y[W]=M[W];return Y}function o(M){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},o(M)}var p=/a/g.flags!==void 0,d=function(M){var $=[];return M.forEach(function(W){return $.push(W)}),$},h=function(M){var $=[];return M.forEach(function(W,Y){return $.push([Y,W])}),$},u=Object.is?Object.is:a(7653),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},s=Number.isNaN?Number.isNaN:a(4133);function l(M){return M.call.bind(M)}var g=l(Object.prototype.hasOwnProperty),w=l(Object.prototype.propertyIsEnumerable),y=l(Object.prototype.toString),v=a(537).types,m=v.isAnyArrayBuffer,C=v.isArrayBufferView,E=v.isDate,O=v.isMap,_=v.isRegExp,S=v.isSet,R=v.isNativeError,A=v.isBoxedPrimitive,T=v.isNumberObject,N=v.isStringObject,x=v.isBooleanObject,I=v.isBigIntObject,L=v.isSymbolObject,H=v.isFloat32Array,Z=v.isFloat64Array;function K(M){if(M.length===0||M.length>10)return!0;for(var $=0;$57)return!0}return M.length===10&&M>=Math.pow(2,32)}function P(M){return Object.keys(M).filter(K).concat(c(M).filter(Object.prototype.propertyIsEnumerable.bind(M)))}function B(M,$){if(M===$)return 0;for(var W=M.length,Y=$.length,Q=0,q=Math.min(W,Y);Q-1?b(h):h}},487(n,i,a){"use strict";var f=a(6897),b=a(655),o=a(3126),p=a(2205);n.exports=function(d){var h=o(arguments),u=d.length-(arguments.length-1);return f(h,1+(u>0?u:0),!0)},b?b(n.exports,"apply",{value:p}):n.exports.apply=p},6556(n,i,a){"use strict";var f=a(453),b=a(3126),o=b([f("%String.prototype.indexOf%")]);n.exports=function(p,d){var h=f(p,!!d);return typeof h=="function"&&o(p,".prototype.")>-1?b([h]):h}},6763(n,i,a){var f=a(537),b=a(4148);function o(){return new Date().getTime()}var p,d=Array.prototype.slice,h={};p=a.g!==void 0&&a.g.console?a.g.console:typeof window<"u"&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){p.log.apply(p,arguments)},"info"],[function(){p.log.apply(p,arguments)},"warn"],[function(){p.warn.apply(p,arguments)},"error"],[function(w){h[w]=o()},"time"],[function(w){var y=h[w];if(!y)throw new Error("No such label: "+w);delete h[w];var v=o()-y;p.log(w+": "+v+"ms")},"timeEnd"],[function(){var w=new Error;w.name="Trace",w.message=f.format.apply(null,arguments),p.error(w.stack)},"trace"],[function(w){p.log(f.inspect(w)+` `)},"dir"],[function(w){if(!w){var y=d.call(arguments,1);b.ok(!1,f.format.apply(null,y))}},"assert"]],c=0;c>>8^255&R^99,d[_]=R,h[R]=_;var A=E[_],T=E[A],N=E[T],x=257*E[R]^16843008*R;u[_]=x<<24|x>>>8,c[_]=x<<16|x>>>16,s[_]=x<<8|x>>>24,l[_]=x,x=16843009*N^65537*T^257*A^16843008*_,g[R]=x<<24|x>>>8,w[R]=x<<16|x>>>16,y[R]=x<<8|x>>>24,v[R]=x,_?(_=A^E[E[E[N^A]]],S^=E[E[S]]):_=S=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],C=p.AES=o.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var E=this._keyPriorReset=this._key,O=E.words,_=E.sigBytes/4,S=4*((this._nRounds=_+6)+1),R=this._keySchedule=[],A=0;A6&&A%_==4&&(x=d[x>>>24]<<24|d[x>>>16&255]<<16|d[x>>>8&255]<<8|d[255&x]):(x=d[(x=x<<8|x>>>24)>>>24]<<24|d[x>>>16&255]<<16|d[x>>>8&255]<<8|d[255&x],x^=m[A/_|0]<<24),R[A]=R[A-_]^x);for(var T=this._invKeySchedule=[],N=0;N>>24]]^w[d[x>>>16&255]]^y[d[x>>>8&255]]^v[d[255&x]]}}},encryptBlock:function(E,O){this._doCryptBlock(E,O,this._keySchedule,u,c,s,l,d)},decryptBlock:function(E,O){var _=E[O+1];E[O+1]=E[O+3],E[O+3]=_,this._doCryptBlock(E,O,this._invKeySchedule,g,w,y,v,h),_=E[O+1],E[O+1]=E[O+3],E[O+3]=_},_doCryptBlock:function(E,O,_,S,R,A,T,N){for(var x=this._nRounds,I=E[O]^_[0],L=E[O+1]^_[1],H=E[O+2]^_[2],Z=E[O+3]^_[3],K=4,P=1;P>>24]^R[L>>>16&255]^A[H>>>8&255]^T[255&Z]^_[K++],G=S[L>>>24]^R[H>>>16&255]^A[Z>>>8&255]^T[255&I]^_[K++],V=S[H>>>24]^R[Z>>>16&255]^A[I>>>8&255]^T[255&L]^_[K++],z=S[Z>>>24]^R[I>>>16&255]^A[L>>>8&255]^T[255&H]^_[K++];I=B,L=G,H=V,Z=z}B=(N[I>>>24]<<24|N[L>>>16&255]<<16|N[H>>>8&255]<<8|N[255&Z])^_[K++],G=(N[L>>>24]<<24|N[H>>>16&255]<<16|N[Z>>>8&255]<<8|N[255&I])^_[K++],V=(N[H>>>24]<<24|N[Z>>>16&255]<<16|N[I>>>8&255]<<8|N[255&L])^_[K++],z=(N[Z>>>24]<<24|N[I>>>16&255]<<16|N[L>>>8&255]<<8|N[255&H])^_[K++],E[O]=B,E[O+1]=G,E[O+2]=V,E[O+3]=z},keySize:8});b.AES=o._createHelper(C)})(),f.AES)},3128(n,i,a){var f;n.exports=(f=a(9021),a(754),a(4636),a(9506),a(7165),(function(){var b=f,o=b.lib.BlockCipher,p=b.algo;let d=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var c={pbox:[],sbox:[]};function s(w,y){let v=y>>24&255,m=y>>16&255,C=y>>8&255,E=255&y,O=w.sbox[0][v]+w.sbox[1][m];return O^=w.sbox[2][C],O+=w.sbox[3][E],O}function l(w,y,v){let m,C=y,E=v;for(let O=0;O=E&&(O=0);let _=0,S=0,R=0;for(let A=0;A<18;A+=2)R=l(m,_,S),_=R.left,S=R.right,m.pbox[A]=_,m.pbox[A+1]=S;for(let A=0;A<4;A++)for(let T=0;T<256;T+=2)R=l(m,_,S),_=R.left,S=R.right,m.sbox[A][T]=_,m.sbox[A][T+1]=S})(c,y,v)}},encryptBlock:function(w,y){var v=l(c,w[y],w[y+1]);w[y]=v.left,w[y+1]=v.right},decryptBlock:function(w,y){var v=(function(m,C,E){let O,_=C,S=E;for(let R=17;R>1;--R)_^=m.pbox[R],S=s(m,_)^S,O=_,_=S,S=O;return O=_,_=S,S=O,S^=m.pbox[1],_^=m.pbox[0],{left:_,right:S}})(c,w[y],w[y+1]);w[y]=v.left,w[y+1]=v.right},blockSize:2,keySize:4,ivSize:2});b.Blowfish=o._createHelper(g)})(),f.Blowfish)},7165(n,i,a){var f,b,o,p,d,h,u,c,s,l,g,w,y,v,m,C,E,O,_;n.exports=(f=a(9021),a(9506),void(f.lib.Cipher||(b=f,o=b.lib,p=o.Base,d=o.WordArray,h=o.BufferedBlockAlgorithm,u=b.enc,u.Utf8,c=u.Base64,s=b.algo.EvpKDF,l=o.Cipher=h.extend({cfg:p.extend(),createEncryptor:function(S,R){return this.create(this._ENC_XFORM_MODE,S,R)},createDecryptor:function(S,R){return this.create(this._DEC_XFORM_MODE,S,R)},init:function(S,R,A){this.cfg=this.cfg.extend(A),this._xformMode=S,this._key=R,this.reset()},reset:function(){h.reset.call(this),this._doReset()},process:function(S){return this._append(S),this._process()},finalize:function(S){return S&&this._append(S),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function S(R){return typeof R=="string"?_:E}return function(R){return{encrypt:function(A,T,N){return S(T).encrypt(R,A,T,N)},decrypt:function(A,T,N){return S(T).decrypt(R,A,T,N)}}}})()}),o.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),g=b.mode={},w=o.BlockCipherMode=p.extend({createEncryptor:function(S,R){return this.Encryptor.create(S,R)},createDecryptor:function(S,R){return this.Decryptor.create(S,R)},init:function(S,R){this._cipher=S,this._iv=R}}),y=g.CBC=(function(){var S=w.extend();function R(A,T,N){var x,I=this._iv;I?(x=I,this._iv=void 0):x=this._prevBlock;for(var L=0;L>>2];S.sigBytes-=R}},o.BlockCipher=l.extend({cfg:l.cfg.extend({mode:y,padding:v}),reset:function(){var S;l.reset.call(this);var R=this.cfg,A=R.iv,T=R.mode;this._xformMode==this._ENC_XFORM_MODE?S=T.createEncryptor:(S=T.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==S?this._mode.init(this,A&&A.words):(this._mode=S.call(T,this,A&&A.words),this._mode.__creator=S)},_doProcessBlock:function(S,R){this._mode.processBlock(S,R)},_doFinalize:function(){var S,R=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(R.pad(this._data,this.blockSize),S=this._process(!0)):(S=this._process(!0),R.unpad(S)),S},blockSize:4}),m=o.CipherParams=p.extend({init:function(S){this.mixIn(S)},toString:function(S){return(S||this.formatter).stringify(this)}}),C=(b.format={}).OpenSSL={stringify:function(S){var R=S.ciphertext,A=S.salt;return(A?d.create([1398893684,1701076831]).concat(A).concat(R):R).toString(c)},parse:function(S){var R,A=c.parse(S),T=A.words;return T[0]==1398893684&&T[1]==1701076831&&(R=d.create(T.slice(2,4)),T.splice(0,4),A.sigBytes-=16),m.create({ciphertext:A,salt:R})}},E=o.SerializableCipher=p.extend({cfg:p.extend({format:C}),encrypt:function(S,R,A,T){T=this.cfg.extend(T);var N=S.createEncryptor(A,T),x=N.finalize(R),I=N.cfg;return m.create({ciphertext:x,key:A,iv:I.iv,algorithm:S,mode:I.mode,padding:I.padding,blockSize:S.blockSize,formatter:T.format})},decrypt:function(S,R,A,T){return T=this.cfg.extend(T),R=this._parse(R,T.format),S.createDecryptor(A,T).finalize(R.ciphertext)},_parse:function(S,R){return typeof S=="string"?R.parse(S,this):S}}),O=(b.kdf={}).OpenSSL={execute:function(S,R,A,T,N){if(T||(T=d.random(8)),N)x=s.create({keySize:R+A,hasher:N}).compute(S,T);else var x=s.create({keySize:R+A}).compute(S,T);var I=d.create(x.words.slice(R),4*A);return x.sigBytes=4*R,m.create({key:x,iv:I,salt:T})}},_=o.PasswordBasedCipher=E.extend({cfg:E.cfg.extend({kdf:O}),encrypt:function(S,R,A,T){var N=(T=this.cfg.extend(T)).kdf.execute(A,S.keySize,S.ivSize,T.salt,T.hasher);T.iv=N.iv;var x=E.encrypt.call(this,S,R,N.key,T);return x.mixIn(N),x},decrypt:function(S,R,A,T){T=this.cfg.extend(T),R=this._parse(R,T.format);var N=T.kdf.execute(A,S.keySize,S.ivSize,R.salt,T.hasher);return T.iv=N.iv,E.decrypt.call(this,S,R,N.key,T)}}))))},9021(n,i,a){var f;n.exports=(f=f||(function(b){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&a.g!==void 0&&a.g.crypto&&(o=a.g.crypto),!o)try{o=a(477)}catch{}var p=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},d=Object.create||(function(){function C(){}return function(E){var O;return C.prototype=E,O=new C,C.prototype=null,O}})(),h={},u=h.lib={},c=u.Base={extend:function(C){var E=d(this);return C&&E.mixIn(C),E.hasOwnProperty("init")&&this.init!==E.init||(E.init=function(){E.$super.init.apply(this,arguments)}),E.init.prototype=E,E.$super=this,E},create:function(){var C=this.extend();return C.init.apply(C,arguments),C},init:function(){},mixIn:function(C){for(var E in C)C.hasOwnProperty(E)&&(this[E]=C[E]);C.hasOwnProperty("toString")&&(this.toString=C.toString)},clone:function(){return this.init.prototype.extend(this)}},s=u.WordArray=c.extend({init:function(C,E){C=this.words=C||[],this.sigBytes=E??4*C.length},toString:function(C){return(C||g).stringify(this)},concat:function(C){var E=this.words,O=C.words,_=this.sigBytes,S=C.sigBytes;if(this.clamp(),_%4)for(var R=0;R>>2]>>>24-R%4*8&255;E[_+R>>>2]|=A<<24-(_+R)%4*8}else for(var T=0;T>>2]=O[T>>>2];return this.sigBytes+=S,this},clamp:function(){var C=this.words,E=this.sigBytes;C[E>>>2]&=4294967295<<32-E%4*8,C.length=b.ceil(E/4)},clone:function(){var C=c.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var E=[],O=0;O>>2]>>>24-S%4*8&255;_.push((R>>>4).toString(16)),_.push((15&R).toString(16))}return _.join("")},parse:function(C){for(var E=C.length,O=[],_=0;_>>3]|=parseInt(C.substr(_,2),16)<<24-_%8*4;return new s.init(O,E/2)}},w=l.Latin1={stringify:function(C){for(var E=C.words,O=C.sigBytes,_=[],S=0;S>>2]>>>24-S%4*8&255;_.push(String.fromCharCode(R))}return _.join("")},parse:function(C){for(var E=C.length,O=[],_=0;_>>2]|=(255&C.charCodeAt(_))<<24-_%4*8;return new s.init(O,E)}},y=l.Utf8={stringify:function(C){try{return decodeURIComponent(escape(w.stringify(C)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(C){return w.parse(unescape(encodeURIComponent(C)))}},v=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=y.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var E,O=this._data,_=O.words,S=O.sigBytes,R=this.blockSize,A=S/(4*R),T=(A=C?b.ceil(A):b.max((0|A)-this._minBufferSize,0))*R,N=b.min(4*T,S);if(T){for(var x=0;x>>2]>>>24-s%4*8&255)<<16|(d[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|d[s+2>>>2]>>>24-(s+2)%4*8&255,g=0;g<4&&s+.75*g>>6*(3-g)&63));var w=u.charAt(64);if(w)for(;c.length%4;)c.push(w);return c.join("")},parse:function(p){var d=p.length,h=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var c=0;c>>6-C%4*2;v[m>>>2]|=E<<24-m%4*8,m++}return o.create(v,m)})(p,d,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},f.enc.Base64)},4725(n,i,a){var f,b,o;n.exports=(f=a(9021),o=(b=f).lib.WordArray,b.enc.Base64url={stringify:function(p,d){d===void 0&&(d=!0);var h=p.words,u=p.sigBytes,c=d?this._safe_map:this._map;p.clamp();for(var s=[],l=0;l>>2]>>>24-l%4*8&255)<<16|(h[l+1>>>2]>>>24-(l+1)%4*8&255)<<8|h[l+2>>>2]>>>24-(l+2)%4*8&255,w=0;w<4&&l+.75*w>>6*(3-w)&63));var y=c.charAt(64);if(y)for(;s.length%4;)s.push(y);return s.join("")},parse:function(p,d){d===void 0&&(d=!0);var h=p.length,u=d?this._safe_map:this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var s=0;s>>6-E%4*2;m[C>>>2]|=O<<24-C%4*8,C++}return o.create(m,C)})(p,h,c)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},f.enc.Base64url)},5503(n,i,a){var f;n.exports=(f=a(9021),(function(){var b=f,o=b.lib.WordArray,p=b.enc;function d(h){return h<<8&4278255360|h>>>8&16711935}p.Utf16=p.Utf16BE={stringify:function(h){for(var u=h.words,c=h.sigBytes,s=[],l=0;l>>2]>>>16-l%4*8&65535;s.push(String.fromCharCode(g))}return s.join("")},parse:function(h){for(var u=h.length,c=[],s=0;s>>1]|=h.charCodeAt(s)<<16-s%2*16;return o.create(c,2*u)}},p.Utf16LE={stringify:function(h){for(var u=h.words,c=h.sigBytes,s=[],l=0;l>>2]>>>16-l%4*8&65535);s.push(String.fromCharCode(g))}return s.join("")},parse:function(h){for(var u=h.length,c=[],s=0;s>>1]|=d(h.charCodeAt(s)<<16-s%2*16);return o.create(c,2*u)}}})(),f.enc.Utf16)},9506(n,i,a){var f,b,o,p,d,h,u,c;n.exports=(c=a(9021),a(5471),a(1025),o=(b=(f=c).lib).Base,p=b.WordArray,h=(d=f.algo).MD5,u=d.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:h,iterations:1}),init:function(s){this.cfg=this.cfg.extend(s)},compute:function(s,l){for(var g,w=this.cfg,y=w.hasher.create(),v=p.create(),m=v.words,C=w.keySize,E=w.iterations;m.lengthu&&(d=p.finalize(d)),d.clamp();for(var c=this._oKey=d.clone(),s=this._iKey=d.clone(),l=c.words,g=s.words,w=0;w>>2]|=d[c]<<24-c%4*8;o.call(this,u,h)}else o.apply(this,arguments)};p.prototype=b}})(),f.lib.WordArray)},4636(n,i,a){var f;n.exports=(f=a(9021),(function(b){var o=f,p=o.lib,d=p.WordArray,h=p.Hasher,u=o.algo,c=[];(function(){for(var v=0;v<64;v++)c[v]=4294967296*b.abs(b.sin(v+1))|0})();var s=u.MD5=h.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(v,m){for(var C=0;C<16;C++){var E=m+C,O=v[E];v[E]=16711935&(O<<8|O>>>24)|4278255360&(O<<24|O>>>8)}var _=this._hash.words,S=v[m+0],R=v[m+1],A=v[m+2],T=v[m+3],N=v[m+4],x=v[m+5],I=v[m+6],L=v[m+7],H=v[m+8],Z=v[m+9],K=v[m+10],P=v[m+11],B=v[m+12],G=v[m+13],V=v[m+14],z=v[m+15],U=_[0],F=_[1],D=_[2],k=_[3];U=l(U,F,D,k,S,7,c[0]),k=l(k,U,F,D,R,12,c[1]),D=l(D,k,U,F,A,17,c[2]),F=l(F,D,k,U,T,22,c[3]),U=l(U,F,D,k,N,7,c[4]),k=l(k,U,F,D,x,12,c[5]),D=l(D,k,U,F,I,17,c[6]),F=l(F,D,k,U,L,22,c[7]),U=l(U,F,D,k,H,7,c[8]),k=l(k,U,F,D,Z,12,c[9]),D=l(D,k,U,F,K,17,c[10]),F=l(F,D,k,U,P,22,c[11]),U=l(U,F,D,k,B,7,c[12]),k=l(k,U,F,D,G,12,c[13]),D=l(D,k,U,F,V,17,c[14]),U=g(U,F=l(F,D,k,U,z,22,c[15]),D,k,R,5,c[16]),k=g(k,U,F,D,I,9,c[17]),D=g(D,k,U,F,P,14,c[18]),F=g(F,D,k,U,S,20,c[19]),U=g(U,F,D,k,x,5,c[20]),k=g(k,U,F,D,K,9,c[21]),D=g(D,k,U,F,z,14,c[22]),F=g(F,D,k,U,N,20,c[23]),U=g(U,F,D,k,Z,5,c[24]),k=g(k,U,F,D,V,9,c[25]),D=g(D,k,U,F,T,14,c[26]),F=g(F,D,k,U,H,20,c[27]),U=g(U,F,D,k,G,5,c[28]),k=g(k,U,F,D,A,9,c[29]),D=g(D,k,U,F,L,14,c[30]),U=w(U,F=g(F,D,k,U,B,20,c[31]),D,k,x,4,c[32]),k=w(k,U,F,D,H,11,c[33]),D=w(D,k,U,F,P,16,c[34]),F=w(F,D,k,U,V,23,c[35]),U=w(U,F,D,k,R,4,c[36]),k=w(k,U,F,D,N,11,c[37]),D=w(D,k,U,F,L,16,c[38]),F=w(F,D,k,U,K,23,c[39]),U=w(U,F,D,k,G,4,c[40]),k=w(k,U,F,D,S,11,c[41]),D=w(D,k,U,F,T,16,c[42]),F=w(F,D,k,U,I,23,c[43]),U=w(U,F,D,k,Z,4,c[44]),k=w(k,U,F,D,B,11,c[45]),D=w(D,k,U,F,z,16,c[46]),U=y(U,F=w(F,D,k,U,A,23,c[47]),D,k,S,6,c[48]),k=y(k,U,F,D,L,10,c[49]),D=y(D,k,U,F,V,15,c[50]),F=y(F,D,k,U,x,21,c[51]),U=y(U,F,D,k,B,6,c[52]),k=y(k,U,F,D,T,10,c[53]),D=y(D,k,U,F,K,15,c[54]),F=y(F,D,k,U,R,21,c[55]),U=y(U,F,D,k,H,6,c[56]),k=y(k,U,F,D,z,10,c[57]),D=y(D,k,U,F,I,15,c[58]),F=y(F,D,k,U,G,21,c[59]),U=y(U,F,D,k,N,6,c[60]),k=y(k,U,F,D,P,10,c[61]),D=y(D,k,U,F,A,15,c[62]),F=y(F,D,k,U,Z,21,c[63]),_[0]=_[0]+U|0,_[1]=_[1]+F|0,_[2]=_[2]+D|0,_[3]=_[3]+k|0},_doFinalize:function(){var v=this._data,m=v.words,C=8*this._nDataBytes,E=8*v.sigBytes;m[E>>>5]|=128<<24-E%32;var O=b.floor(C/4294967296),_=C;m[15+(E+64>>>9<<4)]=16711935&(O<<8|O>>>24)|4278255360&(O<<24|O>>>8),m[14+(E+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),v.sigBytes=4*(m.length+1),this._process();for(var S=this._hash,R=S.words,A=0;A<4;A++){var T=R[A];R[A]=16711935&(T<<8|T>>>24)|4278255360&(T<<24|T>>>8)}return S},clone:function(){var v=h.clone.call(this);return v._hash=this._hash.clone(),v}});function l(v,m,C,E,O,_,S){var R=v+(m&C|~m&E)+O+S;return(R<<_|R>>>32-_)+m}function g(v,m,C,E,O,_,S){var R=v+(m&E|C&~E)+O+S;return(R<<_|R>>>32-_)+m}function w(v,m,C,E,O,_,S){var R=v+(m^C^E)+O+S;return(R<<_|R>>>32-_)+m}function y(v,m,C,E,O,_,S){var R=v+(C^(m|~E))+O+S;return(R<<_|R>>>32-_)+m}o.MD5=h._createHelper(s),o.HmacMD5=h._createHmacHelper(s)})(Math),f.MD5)},2169(n,i,a){var f;n.exports=(f=a(9021),a(7165),f.mode.CFB=(function(){var b=f.lib.BlockCipherMode.extend();function o(p,d,h,u){var c,s=this._iv;s?(c=s.slice(0),this._iv=void 0):c=this._prevBlock,u.encryptBlock(c,0);for(var l=0;l>24))d+=16777216;else{var h=d>>16&255,u=d>>8&255,c=255&d;h===255?(h=0,u===255?(u=0,c===255?c=0:++c):++u):++h,d=0,d+=h<<16,d+=u<<8,d+=c}return d}var p=b.Encryptor=b.extend({processBlock:function(d,h){var u=this._cipher,c=u.blockSize,s=this._iv,l=this._counter;s&&(l=this._counter=s.slice(0),this._iv=void 0),(function(y){(y[0]=o(y[0]))===0&&(y[1]=o(y[1]))})(l);var g=l.slice(0);u.encryptBlock(g,0);for(var w=0;w>>2]|=h<<24-u%4*8,b.sigBytes+=h},unpad:function(b){var o=255&b.words[b.sigBytes-1>>>2];b.sigBytes-=o}},f.pad.Ansix923)},4905(n,i,a){var f;n.exports=(f=a(9021),a(7165),f.pad.Iso10126={pad:function(b,o){var p=4*o,d=p-b.sigBytes%p;b.concat(f.lib.WordArray.random(d-1)).concat(f.lib.WordArray.create([d<<24],1))},unpad:function(b){var o=255&b.words[b.sigBytes-1>>>2];b.sigBytes-=o}},f.pad.Iso10126)},482(n,i,a){var f;n.exports=(f=a(9021),a(7165),f.pad.Iso97971={pad:function(b,o){b.concat(f.lib.WordArray.create([2147483648],1)),f.pad.ZeroPadding.pad(b,o)},unpad:function(b){f.pad.ZeroPadding.unpad(b),b.sigBytes--}},f.pad.Iso97971)},8124(n,i,a){var f;n.exports=(f=a(9021),a(7165),f.pad.NoPadding={pad:function(){},unpad:function(){}},f.pad.NoPadding)},2155(n,i,a){var f;n.exports=(f=a(9021),a(7165),f.pad.ZeroPadding={pad:function(b,o){var p=4*o;b.clamp(),b.sigBytes+=p-(b.sigBytes%p||p)},unpad:function(b){var o=b.words,p=b.sigBytes-1;for(p=b.sigBytes-1;p>=0;p--)if(o[p>>>2]>>>24-p%4*8&255){b.sigBytes=p+1;break}}},f.pad.ZeroPadding)},19(n,i,a){var f,b,o,p,d,h,u,c,s;n.exports=(s=a(9021),a(3009),a(1025),o=(b=(f=s).lib).Base,p=b.WordArray,h=(d=f.algo).SHA256,u=d.HMAC,c=d.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:h,iterations:25e4}),init:function(l){this.cfg=this.cfg.extend(l)},compute:function(l,g){for(var w=this.cfg,y=u.create(w.hasher,l),v=p.create(),m=p.create([1]),C=v.words,E=m.words,O=w.keySize,_=w.iterations;C.length>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],y=this._C=[l[2]<<16|l[2]>>>16,4294901760&l[0]|65535&l[1],l[3]<<16|l[3]>>>16,4294901760&l[1]|65535&l[2],l[0]<<16|l[0]>>>16,4294901760&l[2]|65535&l[3],l[1]<<16|l[1]>>>16,4294901760&l[3]|65535&l[0]];this._b=0;for(var v=0;v<4;v++)s.call(this);for(v=0;v<8;v++)y[v]^=w[v+4&7];if(g){var m=g.words,C=m[0],E=m[1],O=16711935&(C<<8|C>>>24)|4278255360&(C<<24|C>>>8),_=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),S=O>>>16|4294901760&_,R=_<<16|65535&O;for(y[0]^=O,y[1]^=S,y[2]^=_,y[3]^=R,y[4]^=O,y[5]^=S,y[6]^=_,y[7]^=R,v=0;v<4;v++)s.call(this)}},_doProcessBlock:function(l,g){var w=this._X;s.call(this),d[0]=w[0]^w[5]>>>16^w[3]<<16,d[1]=w[2]^w[7]>>>16^w[5]<<16,d[2]=w[4]^w[1]>>>16^w[7]<<16,d[3]=w[6]^w[3]>>>16^w[1]<<16;for(var y=0;y<4;y++)d[y]=16711935&(d[y]<<8|d[y]>>>24)|4278255360&(d[y]<<24|d[y]>>>8),l[g+y]^=d[y]},blockSize:4,ivSize:2});function s(){for(var l=this._X,g=this._C,w=0;w<8;w++)h[w]=g[w];for(g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0>>0?1:0)|0,this._b=g[7]>>>0>>0?1:0,w=0;w<8;w++){var y=l[w]+g[w],v=65535&y,m=y>>>16,C=((v*v>>>17)+v*m>>>15)+m*m,E=((4294901760&y)*y|0)+((65535&y)*y|0);u[w]=C^E}l[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,l[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,l[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,l[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,l[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,l[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,l[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,l[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}b.RabbitLegacy=o._createHelper(c)})(),f.RabbitLegacy)},6298(n,i,a){var f;n.exports=(f=a(9021),a(754),a(4636),a(9506),a(7165),(function(){var b=f,o=b.lib.StreamCipher,p=b.algo,d=[],h=[],u=[],c=p.Rabbit=o.extend({_doReset:function(){for(var l=this._key.words,g=this.cfg.iv,w=0;w<4;w++)l[w]=16711935&(l[w]<<8|l[w]>>>24)|4278255360&(l[w]<<24|l[w]>>>8);var y=this._X=[l[0],l[3]<<16|l[2]>>>16,l[1],l[0]<<16|l[3]>>>16,l[2],l[1]<<16|l[0]>>>16,l[3],l[2]<<16|l[1]>>>16],v=this._C=[l[2]<<16|l[2]>>>16,4294901760&l[0]|65535&l[1],l[3]<<16|l[3]>>>16,4294901760&l[1]|65535&l[2],l[0]<<16|l[0]>>>16,4294901760&l[2]|65535&l[3],l[1]<<16|l[1]>>>16,4294901760&l[3]|65535&l[0]];for(this._b=0,w=0;w<4;w++)s.call(this);for(w=0;w<8;w++)v[w]^=y[w+4&7];if(g){var m=g.words,C=m[0],E=m[1],O=16711935&(C<<8|C>>>24)|4278255360&(C<<24|C>>>8),_=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),S=O>>>16|4294901760&_,R=_<<16|65535&O;for(v[0]^=O,v[1]^=S,v[2]^=_,v[3]^=R,v[4]^=O,v[5]^=S,v[6]^=_,v[7]^=R,w=0;w<4;w++)s.call(this)}},_doProcessBlock:function(l,g){var w=this._X;s.call(this),d[0]=w[0]^w[5]>>>16^w[3]<<16,d[1]=w[2]^w[7]>>>16^w[5]<<16,d[2]=w[4]^w[1]>>>16^w[7]<<16,d[3]=w[6]^w[3]>>>16^w[1]<<16;for(var y=0;y<4;y++)d[y]=16711935&(d[y]<<8|d[y]>>>24)|4278255360&(d[y]<<24|d[y]>>>8),l[g+y]^=d[y]},blockSize:4,ivSize:2});function s(){for(var l=this._X,g=this._C,w=0;w<8;w++)h[w]=g[w];for(g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0>>0?1:0)|0,this._b=g[7]>>>0>>0?1:0,w=0;w<8;w++){var y=l[w]+g[w],v=65535&y,m=y>>>16,C=((v*v>>>17)+v*m>>>15)+m*m,E=((4294901760&y)*y|0)+((65535&y)*y|0);u[w]=C^E}l[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,l[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,l[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,l[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,l[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,l[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,l[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,l[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}b.Rabbit=o._createHelper(c)})(),f.Rabbit)},7193(n,i,a){var f;n.exports=(f=a(9021),a(754),a(4636),a(9506),a(7165),(function(){var b=f,o=b.lib.StreamCipher,p=b.algo,d=p.RC4=o.extend({_doReset:function(){for(var c=this._key,s=c.words,l=c.sigBytes,g=this._S=[],w=0;w<256;w++)g[w]=w;w=0;for(var y=0;w<256;w++){var v=w%l,m=s[v>>>2]>>>24-v%4*8&255;y=(y+g[w]+m)%256;var C=g[w];g[w]=g[y],g[y]=C}this._i=this._j=0},_doProcessBlock:function(c,s){c[s]^=h.call(this)},keySize:8,ivSize:0});function h(){for(var c=this._S,s=this._i,l=this._j,g=0,w=0;w<4;w++){l=(l+c[s=(s+1)%256])%256;var y=c[s];c[s]=c[l],c[l]=y,g|=c[(c[s]+c[l])%256]<<24-8*w}return this._i=s,this._j=l,g}b.RC4=o._createHelper(d);var u=p.RC4Drop=d.extend({cfg:d.cfg.extend({drop:192}),_doReset:function(){d._doReset.call(this);for(var c=this.cfg.drop;c>0;c--)h.call(this)}});b.RC4Drop=o._createHelper(u)})(),f.RC4)},8056(n,i,a){var f;n.exports=(f=a(9021),(function(){var b=f,o=b.lib,p=o.WordArray,d=o.Hasher,h=b.algo,u=p.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=p.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),s=p.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=p.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=p.create([0,1518500249,1859775393,2400959708,2840853838]),w=p.create([1352829926,1548603684,1836072691,2053994217,0]),y=h.RIPEMD160=d.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,R){for(var A=0;A<16;A++){var T=R+A,N=S[T];S[T]=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8)}var x,I,L,H,Z,K,P,B,G,V,z,U=this._hash.words,F=g.words,D=w.words,k=u.words,j=c.words,M=s.words,$=l.words;for(K=x=U[0],P=I=U[1],B=L=U[2],G=H=U[3],V=Z=U[4],A=0;A<80;A+=1)z=x+S[R+k[A]]|0,z+=A<16?v(I,L,H)+F[0]:A<32?m(I,L,H)+F[1]:A<48?C(I,L,H)+F[2]:A<64?E(I,L,H)+F[3]:O(I,L,H)+F[4],z=(z=_(z|=0,M[A]))+Z|0,x=Z,Z=H,H=_(L,10),L=I,I=z,z=K+S[R+j[A]]|0,z+=A<16?O(P,B,G)+D[0]:A<32?E(P,B,G)+D[1]:A<48?C(P,B,G)+D[2]:A<64?m(P,B,G)+D[3]:v(P,B,G)+D[4],z=(z=_(z|=0,$[A]))+V|0,K=V,V=G,G=_(B,10),B=P,P=z;z=U[1]+L+G|0,U[1]=U[2]+H+V|0,U[2]=U[3]+Z+K|0,U[3]=U[4]+x+P|0,U[4]=U[0]+I+B|0,U[0]=z},_doFinalize:function(){var S=this._data,R=S.words,A=8*this._nDataBytes,T=8*S.sigBytes;R[T>>>5]|=128<<24-T%32,R[14+(T+64>>>9<<4)]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8),S.sigBytes=4*(R.length+1),this._process();for(var N=this._hash,x=N.words,I=0;I<5;I++){var L=x[I];x[I]=16711935&(L<<8|L>>>24)|4278255360&(L<<24|L>>>8)}return N},clone:function(){var S=d.clone.call(this);return S._hash=this._hash.clone(),S}});function v(S,R,A){return S^R^A}function m(S,R,A){return S&R|~S&A}function C(S,R,A){return(S|~R)^A}function E(S,R,A){return S&A|R&~A}function O(S,R,A){return S^(R|~A)}function _(S,R){return S<>>32-R}b.RIPEMD160=d._createHelper(y),b.HmacRIPEMD160=d._createHmacHelper(y)})(Math),f.RIPEMD160)},5471(n,i,a){var f,b,o,p,d,h,u,c;n.exports=(b=(f=c=a(9021)).lib,o=b.WordArray,p=b.Hasher,d=f.algo,h=[],u=d.SHA1=p.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(s,l){for(var g=this._hash.words,w=g[0],y=g[1],v=g[2],m=g[3],C=g[4],E=0;E<80;E++){if(E<16)h[E]=0|s[l+E];else{var O=h[E-3]^h[E-8]^h[E-14]^h[E-16];h[E]=O<<1|O>>>31}var _=(w<<5|w>>>27)+C+h[E];_+=E<20?1518500249+(y&v|~y&m):E<40?1859775393+(y^v^m):E<60?(y&v|y&m|v&m)-1894007588:(y^v^m)-899497514,C=m,m=v,v=y<<30|y>>>2,y=w,w=_}g[0]=g[0]+w|0,g[1]=g[1]+y|0,g[2]=g[2]+v|0,g[3]=g[3]+m|0,g[4]=g[4]+C|0},_doFinalize:function(){var s=this._data,l=s.words,g=8*this._nDataBytes,w=8*s.sigBytes;return l[w>>>5]|=128<<24-w%32,l[14+(w+64>>>9<<4)]=Math.floor(g/4294967296),l[15+(w+64>>>9<<4)]=g,s.sigBytes=4*l.length,this._process(),this._hash},clone:function(){var s=p.clone.call(this);return s._hash=this._hash.clone(),s}}),f.SHA1=p._createHelper(u),f.HmacSHA1=p._createHmacHelper(u),c.SHA1)},6308(n,i,a){var f,b,o,p,d,h;n.exports=(h=a(9021),a(3009),b=(f=h).lib.WordArray,o=f.algo,p=o.SHA256,d=o.SHA224=p.extend({_doReset:function(){this._hash=new b.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=p._doFinalize.call(this);return u.sigBytes-=4,u}}),f.SHA224=p._createHelper(d),f.HmacSHA224=p._createHmacHelper(d),h.SHA224)},3009(n,i,a){var f;n.exports=(f=a(9021),(function(b){var o=f,p=o.lib,d=p.WordArray,h=p.Hasher,u=o.algo,c=[],s=[];(function(){function w(C){for(var E=b.sqrt(C),O=2;O<=E;O++)if(!(C%O))return!1;return!0}function y(C){return 4294967296*(C-(0|C))|0}for(var v=2,m=0;m<64;)w(v)&&(m<8&&(c[m]=y(b.pow(v,.5))),s[m]=y(b.pow(v,.3333333333333333)),m++),v++})();var l=[],g=u.SHA256=h.extend({_doReset:function(){this._hash=new d.init(c.slice(0))},_doProcessBlock:function(w,y){for(var v=this._hash.words,m=v[0],C=v[1],E=v[2],O=v[3],_=v[4],S=v[5],R=v[6],A=v[7],T=0;T<64;T++){if(T<16)l[T]=0|w[y+T];else{var N=l[T-15],x=(N<<25|N>>>7)^(N<<14|N>>>18)^N>>>3,I=l[T-2],L=(I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10;l[T]=x+l[T-7]+L+l[T-16]}var H=m&C^m&E^C&E,Z=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=A+((_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25))+(_&S^~_&R)+s[T]+l[T];A=R,R=S,S=_,_=O+K|0,O=E,E=C,C=m,m=K+(Z+H)|0}v[0]=v[0]+m|0,v[1]=v[1]+C|0,v[2]=v[2]+E|0,v[3]=v[3]+O|0,v[4]=v[4]+_|0,v[5]=v[5]+S|0,v[6]=v[6]+R|0,v[7]=v[7]+A|0},_doFinalize:function(){var w=this._data,y=w.words,v=8*this._nDataBytes,m=8*w.sigBytes;return y[m>>>5]|=128<<24-m%32,y[14+(m+64>>>9<<4)]=b.floor(v/4294967296),y[15+(m+64>>>9<<4)]=v,w.sigBytes=4*y.length,this._process(),this._hash},clone:function(){var w=h.clone.call(this);return w._hash=this._hash.clone(),w}});o.SHA256=h._createHelper(g),o.HmacSHA256=h._createHmacHelper(g)})(Math),f.SHA256)},5953(n,i,a){var f;n.exports=(f=a(9021),a(3240),(function(b){var o=f,p=o.lib,d=p.WordArray,h=p.Hasher,u=o.x64.Word,c=o.algo,s=[],l=[],g=[];(function(){for(var v=1,m=0,C=0;C<24;C++){s[v+5*m]=(C+1)*(C+2)/2%64;var E=(2*v+3*m)%5;v=m%5,m=E}for(v=0;v<5;v++)for(m=0;m<5;m++)l[v+5*m]=m+(2*v+3*m)%5*5;for(var O=1,_=0;_<24;_++){for(var S=0,R=0,A=0;A<7;A++){if(1&O){var T=(1<>>24)|4278255360&(_<<24|_>>>8),S=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8),(D=C[O]).high^=S,D.low^=_}for(var R=0;R<24;R++){for(var A=0;A<5;A++){for(var T=0,N=0,x=0;x<5;x++)T^=(D=C[A+5*x]).high,N^=D.low;var I=w[A];I.high=T,I.low=N}for(A=0;A<5;A++){var L=w[(A+4)%5],H=w[(A+1)%5],Z=H.high,K=H.low;for(T=L.high^(Z<<1|K>>>31),N=L.low^(K<<1|Z>>>31),x=0;x<5;x++)(D=C[A+5*x]).high^=T,D.low^=N}for(var P=1;P<25;P++){var B=(D=C[P]).high,G=D.low,V=s[P];V<32?(T=B<>>32-V,N=G<>>32-V):(T=G<>>64-V,N=B<>>64-V);var z=w[l[P]];z.high=T,z.low=N}var U=w[0],F=C[0];for(U.high=F.high,U.low=F.low,A=0;A<5;A++)for(x=0;x<5;x++){var D=C[P=A+5*x],k=w[P],j=w[(A+1)%5+5*x],M=w[(A+2)%5+5*x];D.high=k.high^~j.high&M.high,D.low=k.low^~j.low&M.low}D=C[0];var $=g[R];D.high^=$.high,D.low^=$.low}},_doFinalize:function(){var v=this._data,m=v.words,C=(this._nDataBytes,8*v.sigBytes),E=32*this.blockSize;m[C>>>5]|=1<<24-C%32,m[(b.ceil((C+1)/E)*E>>>5)-1]|=128,v.sigBytes=4*m.length,this._process();for(var O=this._state,_=this.cfg.outputLength/8,S=_/8,R=[],A=0;A>>24)|4278255360&(N<<24|N>>>8),x=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8),R.push(x),R.push(N)}return new d.init(R,_)},clone:function(){for(var v=h.clone.call(this),m=v._state=this._state.slice(0),C=0;C<25;C++)m[C]=m[C].clone();return v}});o.SHA3=h._createHelper(y),o.HmacSHA3=h._createHmacHelper(y)})(Math),f.SHA3)},9557(n,i,a){var f,b,o,p,d,h,u,c;n.exports=(c=a(9021),a(3240),a(1380),b=(f=c).x64,o=b.Word,p=b.WordArray,d=f.algo,h=d.SHA512,u=d.SHA384=h.extend({_doReset:function(){this._hash=new p.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var s=h._doFinalize.call(this);return s.sigBytes-=16,s}}),f.SHA384=h._createHelper(u),f.HmacSHA384=h._createHmacHelper(u),c.SHA384)},1380(n,i,a){var f;n.exports=(f=a(9021),a(3240),(function(){var b=f,o=b.lib.Hasher,p=b.x64,d=p.Word,h=p.WordArray,u=b.algo;function c(){return d.create.apply(d,arguments)}var s=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],l=[];(function(){for(var w=0;w<80;w++)l[w]=c()})();var g=u.SHA512=o.extend({_doReset:function(){this._hash=new h.init([new d.init(1779033703,4089235720),new d.init(3144134277,2227873595),new d.init(1013904242,4271175723),new d.init(2773480762,1595750129),new d.init(1359893119,2917565137),new d.init(2600822924,725511199),new d.init(528734635,4215389547),new d.init(1541459225,327033209)])},_doProcessBlock:function(w,y){for(var v=this._hash.words,m=v[0],C=v[1],E=v[2],O=v[3],_=v[4],S=v[5],R=v[6],A=v[7],T=m.high,N=m.low,x=C.high,I=C.low,L=E.high,H=E.low,Z=O.high,K=O.low,P=_.high,B=_.low,G=S.high,V=S.low,z=R.high,U=R.low,F=A.high,D=A.low,k=T,j=N,M=x,$=I,W=L,Y=H,Q=Z,q=K,te=P,ie=B,ae=G,ue=V,le=z,me=U,Ae=F,fe=D,se=0;se<80;se++){var he,ce,Ie=l[se];if(se<16)ce=Ie.high=0|w[y+2*se],he=Ie.low=0|w[y+2*se+1];else{var Ze=l[se-15],De=Ze.high,Ge=Ze.low,at=(De>>>1|Ge<<31)^(De>>>8|Ge<<24)^De>>>7,Se=(Ge>>>1|De<<31)^(Ge>>>8|De<<24)^(Ge>>>7|De<<25),ke=l[se-2],ze=ke.high,nt=ke.low,Ne=(ze>>>19|nt<<13)^(ze<<3|nt>>>29)^ze>>>6,We=(nt>>>19|ze<<13)^(nt<<3|ze>>>29)^(nt>>>6|ze<<26),Le=l[se-7],Je=Le.high,ve=Le.low,Ke=l[se-16],ft=Ke.high,ct=Ke.low;ce=(ce=(ce=at+Je+((he=Se+ve)>>>0>>0?1:0))+Ne+((he+=We)>>>0>>0?1:0))+ft+((he+=ct)>>>0>>0?1:0),Ie.high=ce,Ie.low=he}var Be,Pt=te&ae^~te&le,dt=ie&ue^~ie&me,vr=k&M^k&W^M&W,Bn=j&$^j&Y^$&Y,Er=(k>>>28|j<<4)^(k<<30|j>>>2)^(k<<25|j>>>7),St=(j>>>28|k<<4)^(j<<30|k>>>2)^(j<<25|k>>>7),Fn=(te>>>14|ie<<18)^(te>>>18|ie<<14)^(te<<23|ie>>>9),Qh=(ie>>>14|te<<18)^(ie>>>18|te<<14)^(ie<<23|te>>>9),da=s[se],Jh=da.high,pa=da.low,jn=Ae+Fn+((Be=fe+Qh)>>>0>>0?1:0),ya=St+Bn;Ae=le,fe=me,le=ae,me=ue,ae=te,ue=ie,te=Q+(jn=(jn=(jn=jn+Pt+((Be+=dt)>>>0
>>0?1:0))+Jh+((Be+=pa)>>>0>>0?1:0))+ce+((Be+=he)>>>0>>0?1:0))+((ie=q+Be|0)>>>0>>0?1:0)|0,Q=W,q=Y,W=M,Y=$,M=k,$=j,k=jn+(Er+vr+(ya>>>0>>0?1:0))+((j=Be+ya|0)>>>0>>0?1:0)|0}N=m.low=N+j,m.high=T+k+(N>>>0>>0?1:0),I=C.low=I+$,C.high=x+M+(I>>>0<$>>>0?1:0),H=E.low=H+Y,E.high=L+W+(H>>>0>>0?1:0),K=O.low=K+q,O.high=Z+Q+(K>>>0>>0?1:0),B=_.low=B+ie,_.high=P+te+(B>>>0>>0?1:0),V=S.low=V+ue,S.high=G+ae+(V>>>0>>0?1:0),U=R.low=U+me,R.high=z+le+(U>>>0>>0?1:0),D=A.low=D+fe,A.high=F+Ae+(D>>>0>>0?1:0)},_doFinalize:function(){var w=this._data,y=w.words,v=8*this._nDataBytes,m=8*w.sigBytes;return y[m>>>5]|=128<<24-m%32,y[30+(m+128>>>10<<5)]=Math.floor(v/4294967296),y[31+(m+128>>>10<<5)]=v,w.sigBytes=4*y.length,this._process(),this._hash.toX32()},clone:function(){var w=o.clone.call(this);return w._hash=this._hash.clone(),w},blockSize:32});b.SHA512=o._createHelper(g),b.HmacSHA512=o._createHmacHelper(g)})(),f.SHA512)},7628(n,i,a){var f;n.exports=(f=a(9021),a(754),a(4636),a(9506),a(7165),(function(){var b=f,o=b.lib,p=o.WordArray,d=o.BlockCipher,h=b.algo,u=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],s=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],g=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],w=h.DES=d.extend({_doReset:function(){for(var C=this._key.words,E=[],O=0;O<56;O++){var _=u[O]-1;E[O]=C[_>>>5]>>>31-_%32&1}for(var S=this._subKeys=[],R=0;R<16;R++){var A=S[R]=[],T=s[R];for(O=0;O<24;O++)A[O/6|0]|=E[(c[O]-1+T)%28]<<31-O%6,A[4+(O/6|0)]|=E[28+(c[O+24]-1+T)%28]<<31-O%6;for(A[0]=A[0]<<1|A[0]>>>31,O=1;O<7;O++)A[O]=A[O]>>>4*(O-1)+3;A[7]=A[7]<<5|A[7]>>>27}var N=this._invSubKeys=[];for(O=0;O<16;O++)N[O]=S[15-O]},encryptBlock:function(C,E){this._doCryptBlock(C,E,this._subKeys)},decryptBlock:function(C,E){this._doCryptBlock(C,E,this._invSubKeys)},_doCryptBlock:function(C,E,O){this._lBlock=C[E],this._rBlock=C[E+1],y.call(this,4,252645135),y.call(this,16,65535),v.call(this,2,858993459),v.call(this,8,16711935),y.call(this,1,1431655765);for(var _=0;_<16;_++){for(var S=O[_],R=this._lBlock,A=this._rBlock,T=0,N=0;N<8;N++)T|=l[N][((A^S[N])&g[N])>>>0];this._lBlock=A,this._rBlock=R^T}var x=this._lBlock;this._lBlock=this._rBlock,this._rBlock=x,y.call(this,1,1431655765),v.call(this,8,16711935),v.call(this,2,858993459),y.call(this,16,65535),y.call(this,4,252645135),C[E]=this._lBlock,C[E+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function y(C,E){var O=(this._lBlock>>>C^this._rBlock)&E;this._rBlock^=O,this._lBlock^=O<>>C^this._lBlock)&E;this._lBlock^=O,this._rBlock^=O<192.");var E=C.slice(0,2),O=C.length<4?C.slice(0,2):C.slice(2,4),_=C.length<6?C.slice(0,2):C.slice(4,6);this._des1=w.createEncryptor(p.create(E)),this._des2=w.createEncryptor(p.create(O)),this._des3=w.createEncryptor(p.create(_))},encryptBlock:function(C,E){this._des1.encryptBlock(C,E),this._des2.decryptBlock(C,E),this._des3.encryptBlock(C,E)},decryptBlock:function(C,E){this._des3.decryptBlock(C,E),this._des2.encryptBlock(C,E),this._des1.decryptBlock(C,E)},keySize:6,ivSize:2,blockSize:2});b.TripleDES=d._createHelper(m)})(),f.TripleDES)},3240(n,i,a){var f,b,o,p,d,h;n.exports=(f=a(9021),o=(b=f).lib,p=o.Base,d=o.WordArray,(h=b.x64={}).Word=p.extend({init:function(u,c){this.high=u,this.low=c}}),h.WordArray=p.extend({init:function(u,c){u=this.words=u||[],this.sigBytes=c??8*u.length},toX32:function(){for(var u=this.words,c=u.length,s=[],l=0;l{c!=="%%"&&(h++,c==="%c"&&(u=h))}),p.splice(u,0,d)},i.save=function(p){try{p?i.storage.setItem("debug",p):i.storage.removeItem("debug")}catch{}},i.load=function(){let p;try{p=i.storage.getItem("debug")||i.storage.getItem("DEBUG")}catch{}return!p&&b!==void 0&&"env"in b&&(p=b.env.DEBUG),p},i.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let p;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(p=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(p[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage=(function(){try{return localStorage}catch{}})(),i.destroy=(()=>{let p=!1;return()=>{p||(p=!0,f.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=f.debug||f.log||(()=>{}),n.exports=a(736)(i);let{formatters:o}=n.exports;o.j=function(p){try{return JSON.stringify(p)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}},736(n,i,a){var f=a(6763);n.exports=function(b){function o(h){let u,c,s,l=null;function g(...w){if(!g.enabled)return;let y=g,v=Number(new Date),m=v-(u||v);y.diff=m,y.prev=u,y.curr=v,u=v,w[0]=o.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let C=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(E,O)=>{if(E==="%%")return"%";C++;let _=o.formatters[O];if(typeof _=="function"){let S=w[C];E=_.call(y,S),w.splice(C,1),C--}return E}),o.formatArgs.call(y,w),(y.log||o.log).apply(y,w)}return g.namespace=h,g.useColors=o.useColors(),g.color=o.selectColor(h),g.extend=p,g.destroy=o.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(c!==o.namespaces&&(c=o.namespaces,s=o.enabled(h)),s),set:w=>{l=w}}),typeof o.init=="function"&&o.init(g),g}function p(h,u){let c=o(this.namespace+(u===void 0?":":u)+h);return c.log=this.log,c}function d(h,u){let c=0,s=0,l=-1,g=0;for(;c"-"+u)].join(",");return o.enable(""),h},o.enable=function(h){o.save(h),o.namespaces=h,o.names=[],o.skips=[];let u=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let c of u)c[0]==="-"?o.skips.push(c.slice(1)):o.names.push(c)},o.enabled=function(h){for(let u of o.skips)if(d(h,u))return!1;for(let u of o.names)if(d(h,u))return!0;return!1},o.humanize=a(6585),o.destroy=function(){f.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(b).forEach(h=>{o[h]=b[h]}),o.names=[],o.skips=[],o.formatters={},o.selectColor=function(h){let u=0;for(let c=0;c3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new o("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,g=arguments.length>6&&arguments[6],w=!!p&&p(d,h);if(f)f(d,h,{configurable:l===null&&w?w.configurable:!l,enumerable:c===null&&w?w.enumerable:!c,value:u,writable:s===null&&w?w.writable:!s});else{if(!g&&(c||s||l))throw new b("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");d[h]=u}}},8452(n,i,a){"use strict";var f=a(1189),b=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",o=Object.prototype.toString,p=Array.prototype.concat,d=a(41),h=a(592)(),u=function(s,l,g,w){if(l in s){if(w===!0){if(s[l]===g)return}else if(typeof(y=w)!="function"||o.call(y)!=="[object Function]"||!w())return}var y;h?d(s,l,g,!0):d(s,l,g)},c=function(s,l){var g=arguments.length>2?arguments[2]:{},w=f(l);b&&(w=p.call(w,Object.getOwnPropertySymbols(l)));for(var y=0;y=3&&(u=h),c=p,b.call(c)==="[object Array]"?(function(s,l,g){for(var w=0,y=s.length;w"u"?f:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?f:ArrayBuffer,"%ArrayIteratorPrototype%":T&&N?N([][Symbol.iterator]()):f,"%AsyncFromSyncIteratorPrototype%":f,"%AsyncFunction%":Z,"%AsyncGenerator%":Z,"%AsyncGeneratorFunction%":Z,"%AsyncIteratorPrototype%":Z,"%Atomics%":typeof Atomics>"u"?f:Atomics,"%BigInt%":typeof BigInt>"u"?f:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?f:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?f:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?f:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":p,"%Float16Array%":typeof Float16Array>"u"?f:Float16Array,"%Float32Array%":typeof Float32Array>"u"?f:Float32Array,"%Float64Array%":typeof Float64Array>"u"?f:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?f:FinalizationRegistry,"%Function%":E,"%GeneratorFunction%":Z,"%Int8Array%":typeof Int8Array>"u"?f:Int8Array,"%Int16Array%":typeof Int16Array>"u"?f:Int16Array,"%Int32Array%":typeof Int32Array>"u"?f:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&N?N(N([][Symbol.iterator]())):f,"%JSON%":typeof JSON=="object"?JSON:f,"%Map%":typeof Map>"u"?f:Map,"%MapIteratorPrototype%":typeof Map<"u"&&T&&N?N(new Map()[Symbol.iterator]()):f,"%Math%":Math,"%Number%":Number,"%Object%":b,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?f:Promise,"%Proxy%":typeof Proxy>"u"?f:Proxy,"%RangeError%":d,"%ReferenceError%":h,"%Reflect%":typeof Reflect>"u"?f:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?f:Set,"%SetIteratorPrototype%":typeof Set<"u"&&T&&N?N(new Set()[Symbol.iterator]()):f,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?f:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&N?N(""[Symbol.iterator]()):f,"%Symbol%":T?Symbol:f,"%SyntaxError%":u,"%ThrowTypeError%":A,"%TypedArray%":K,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?f:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?f:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?f:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?f:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?f:WeakMap,"%WeakRef%":typeof WeakRef>"u"?f:WeakRef,"%WeakSet%":typeof WeakSet>"u"?f:WeakSet,"%Function.prototype.call%":H,"%Function.prototype.apply%":L,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":x,"%Math.abs%":l,"%Math.floor%":g,"%Math.max%":w,"%Math.min%":y,"%Math.pow%":v,"%Math.round%":m,"%Math.sign%":C,"%Reflect.getPrototypeOf%":I};if(N)try{null.error}catch(Q){var B=N(N(Q));P["%Error.prototype%"]=B}var G=function Q(q){var te;if(q==="%AsyncFunction%")te=O("async function () {}");else if(q==="%GeneratorFunction%")te=O("function* () {}");else if(q==="%AsyncGeneratorFunction%")te=O("async function* () {}");else if(q==="%AsyncGenerator%"){var ie=Q("%AsyncGeneratorFunction%");ie&&(te=ie.prototype)}else if(q==="%AsyncIteratorPrototype%"){var ae=Q("%AsyncGenerator%");ae&&N&&(te=N(ae.prototype))}return P[q]=te,te},V={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},z=a(6743),U=a(9957),F=z.call(H,Array.prototype.concat),D=z.call(L,Array.prototype.splice),k=z.call(H,String.prototype.replace),j=z.call(H,String.prototype.slice),M=z.call(H,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,Y=function(Q,q){var te,ie=Q;if(U(V,ie)&&(ie="%"+(te=V[ie])[0]+"%"),U(P,ie)){var ae=P[ie];if(ae===Z&&(ae=G(ie)),ae===void 0&&!q)throw new c("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:te,name:ie,value:ae}}throw new u("intrinsic "+Q+" does not exist!")};n.exports=function(Q,q){if(typeof Q!="string"||Q.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof q!="boolean")throw new c('"allowMissing" argument must be a boolean');if(M(/^%?[^%]*%?$/,Q)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var te=(function(De){var Ge=j(De,0,1),at=j(De,-1);if(Ge==="%"&&at!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(at==="%"&&Ge!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var Se=[];return k(De,$,function(ke,ze,nt,Ne){Se[Se.length]=nt?k(Ne,W,"$1"):ze||ke}),Se})(Q),ie=te.length>0?te[0]:"",ae=Y("%"+ie+"%",q),ue=ae.name,le=ae.value,me=!1,Ae=ae.alias;Ae&&(ie=Ae[0],D(te,F([0,1],Ae)));for(var fe=1,se=!0;fe=te.length){var Ze=_(le,he);le=(se=!!Ze)&&"get"in Ze&&!("originalValue"in Ze.get)?Ze.get:le[he]}else se=U(le,he),le=le[he];se&&!me&&(P[ue]=le)}}return le}},1064(n,i,a){"use strict";var f=a(9612);n.exports=f.getPrototypeOf||null},8648(n){"use strict";n.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null},3628(n,i,a){"use strict";var f=a(8648),b=a(1064),o=a(7176);n.exports=f?function(p){return f(p)}:b?function(p){if(!p||typeof p!="object"&&typeof p!="function")throw new TypeError("getProto: not an object");return b(p)}:o?function(p){return o(p)}:null},6549(n){"use strict";n.exports=Object.getOwnPropertyDescriptor},5795(n,i,a){"use strict";var f=a(6549);if(f)try{f([],"length")}catch{f=null}n.exports=f},592(n,i,a){"use strict";var f=a(655),b=function(){return!!f};b.hasArrayLengthDefineBug=function(){if(!f)return null;try{return f([],"length",{value:1}).length!==1}catch{return!0}},n.exports=b},4039(n,i,a){"use strict";var f=typeof Symbol<"u"&&Symbol,b=a(1333);n.exports=function(){return typeof f=="function"&&typeof Symbol=="function"&&typeof f("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&b()}},1333(n){"use strict";n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},a=Symbol("test"),f=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(f)!=="[object Symbol]")return!1;for(var b in i[a]=42,i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var o=Object.getOwnPropertySymbols(i);if(o.length!==1||o[0]!==a||!Object.prototype.propertyIsEnumerable.call(i,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(i,a);if(p.value!==42||p.enumerable!==!0)return!1}return!0}},9092(n,i,a){"use strict";var f=a(1333);n.exports=function(){return f()&&!!Symbol.toStringTag}},9957(n,i,a){"use strict";var f=Function.prototype.call,b=Object.prototype.hasOwnProperty,o=a(6743);n.exports=o.call(f,b)},6698(n){typeof Object.create=="function"?n.exports=function(i,a){a&&(i.super_=a,i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}))}:n.exports=function(i,a){if(a){i.super_=a;var f=function(){};f.prototype=a.prototype,i.prototype=new f,i.prototype.constructor=i}}},7244(n,i,a){"use strict";var f=a(9092)(),b=a(6556)("Object.prototype.toString"),o=function(h){return!(f&&h&&typeof h=="object"&&Symbol.toStringTag in h)&&b(h)==="[object Arguments]"},p=function(h){return!!o(h)||h!==null&&typeof h=="object"&&"length"in h&&typeof h.length=="number"&&h.length>=0&&b(h)!=="[object Array]"&&"callee"in h&&b(h.callee)==="[object Function]"},d=(function(){return o(arguments)})();o.isLegacyArguments=p,n.exports=d?o:p},9600(n){"use strict";var i,a,f=Function.prototype.toString,b=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply;if(typeof b=="function"&&typeof Object.defineProperty=="function")try{i=Object.defineProperty({},"length",{get:function(){throw a}}),a={},b(function(){throw 42},null,i)}catch(g){g!==a&&(b=null)}else b=null;var o=/^\s*class\b/,p=function(g){try{var w=f.call(g);return o.test(w)}catch{return!1}},d=function(g){try{return!p(g)&&(f.call(g),!0)}catch{return!1}},h=Object.prototype.toString,u=typeof Symbol=="function"&&!!Symbol.toStringTag,c=!(0 in[,]),s=function(){return!1};if(typeof document=="object"){var l=document.all;h.call(l)===h.call(document.all)&&(s=function(g){if((c||!g)&&(g===void 0||typeof g=="object"))try{var w=h.call(g);return(w==="[object HTMLAllCollection]"||w==="[object HTML document.all class]"||w==="[object HTMLCollection]"||w==="[object Object]")&&g("")==null}catch{}return!1})}n.exports=b?function(g){if(s(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;try{b(g,null,i)}catch(w){if(w!==a)return!1}return!p(g)&&d(g)}:function(g){if(s(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;if(u)return d(g);if(p(g))return!1;var w=h.call(g);return!(w!=="[object Function]"&&w!=="[object GeneratorFunction]"&&!/^\[object HTML/.test(w))&&d(g)}},8184(n,i,a){"use strict";var f,b=a(6556),o=a(9721)(/^\s*(?:function)?\*/),p=a(9092)(),d=a(3628),h=b("Object.prototype.toString"),u=b("Function.prototype.toString");n.exports=function(c){if(typeof c!="function")return!1;if(o(u(c)))return!0;if(!p)return h(c)==="[object GeneratorFunction]";if(!d)return!1;if(f===void 0){var s=(function(){if(!p)return!1;try{return Function("return function*() {}")()}catch{}})();f=!!s&&d(s)}return d(c)===f}},3003(n){"use strict";n.exports=function(i){return i!=i}},4133(n,i,a){"use strict";var f=a(487),b=a(8452),o=a(3003),p=a(6642),d=a(2464),h=f(p(),Number);b(h,{getPolyfill:p,implementation:o,shim:d}),n.exports=h},6642(n,i,a){"use strict";var f=a(3003);n.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:f}},2464(n,i,a){"use strict";var f=a(8452),b=a(6642);n.exports=function(){var o=b();return f(Number,{isNaN:o},{isNaN:function(){return Number.isNaN!==o}}),o}},4035(n,i,a){"use strict";var f,b=a(6556),o=a(9092)(),p=a(9957),d=a(5795);if(o){var h=b("RegExp.prototype.exec"),u={},c=function(){throw u},s={toString:c,valueOf:c};typeof Symbol.toPrimitive=="symbol"&&(s[Symbol.toPrimitive]=c),f=function(g){if(!g||typeof g!="object")return!1;var w=d(g,"lastIndex");if(!w||!p(w,"value"))return!1;try{h(g,s)}catch(y){return y===u}}}else{var l=b("Object.prototype.toString");f=function(g){return!(!g||typeof g!="object"&&typeof g!="function")&&l(g)==="[object RegExp]"}}n.exports=f},5680(n,i,a){"use strict";var f=a(5767);n.exports=function(b){return!!f(b)}},1514(n){"use strict";n.exports=Math.abs},8968(n){"use strict";n.exports=Math.floor},4459(n){"use strict";n.exports=Number.isNaN||function(i){return i!=i}},6188(n){"use strict";n.exports=Math.max},8002(n){"use strict";n.exports=Math.min},5880(n){"use strict";n.exports=Math.pow},414(n){"use strict";n.exports=Math.round},3093(n,i,a){"use strict";var f=a(4459);n.exports=function(b){return f(b)||b===0?b:b<0?-1:1}},6585(n){var i=1e3,a=60*i,f=60*a,b=24*f,o=7*b;function p(d,h,u,c){var s=h>=1.5*u;return Math.round(d/u)+" "+c+(s?"s":"")}n.exports=function(d,h){h=h||{};var u,c,s=typeof d;if(s==="string"&&d.length>0)return(function(l){if(!((l=String(l)).length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(g){var w=parseFloat(g[1]);switch((g[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*w;case"weeks":case"week":case"w":return w*o;case"days":case"day":case"d":return w*b;case"hours":case"hour":case"hrs":case"hr":case"h":return w*f;case"minutes":case"minute":case"mins":case"min":case"m":return w*a;case"seconds":case"second":case"secs":case"sec":case"s":return w*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}})(d);if(s==="number"&&isFinite(d))return h.long?(u=d,(c=Math.abs(u))>=b?p(u,c,b,"day"):c>=f?p(u,c,f,"hour"):c>=a?p(u,c,a,"minute"):c>=i?p(u,c,i,"second"):u+" ms"):(function(l){var g=Math.abs(l);return g>=b?Math.round(l/b)+"d":g>=f?Math.round(l/f)+"h":g>=a?Math.round(l/a)+"m":g>=i?Math.round(l/i)+"s":l+"ms"})(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))}},9211(n){"use strict";var i=function(a){return a!=a};n.exports=function(a,f){return a===0&&f===0?1/a==1/f:a===f||!(!i(a)||!i(f))}},7653(n,i,a){"use strict";var f=a(8452),b=a(487),o=a(9211),p=a(9394),d=a(6576),h=b(p(),Object);f(h,{getPolyfill:p,implementation:o,shim:d}),n.exports=h},9394(n,i,a){"use strict";var f=a(9211);n.exports=function(){return typeof Object.is=="function"?Object.is:f}},6576(n,i,a){"use strict";var f=a(9394),b=a(8452);n.exports=function(){var o=f();return b(Object,{is:o},{is:function(){return Object.is!==o}}),o}},8875(n,i,a){"use strict";var f;if(!Object.keys){var b=Object.prototype.hasOwnProperty,o=Object.prototype.toString,p=a(1093),d=Object.prototype.propertyIsEnumerable,h=!d.call({toString:null},"toString"),u=d.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(w){var y=w.constructor;return y&&y.prototype===w},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},g=(function(){if(typeof window>"u")return!1;for(var w in window)try{if(!l["$"+w]&&b.call(window,w)&&window[w]!==null&&typeof window[w]=="object")try{s(window[w])}catch{return!0}}catch{return!0}return!1})();f=function(w){var y=w!==null&&typeof w=="object",v=o.call(w)==="[object Function]",m=p(w),C=y&&o.call(w)==="[object String]",E=[];if(!y&&!v&&!m)throw new TypeError("Object.keys called on a non-object");var O=u&&v;if(C&&w.length>0&&!b.call(w,0))for(var _=0;_0)for(var S=0;S"u"||!g)return s(N);try{return s(N)}catch{return!1}})(w),T=0;T=0&&i.call(a.callee)==="[object Function]"),b}},8403(n,i,a){"use strict";var f=a(1189),b=a(1333)(),o=a(6556),p=a(9612),d=o("Array.prototype.push"),h=o("Object.prototype.propertyIsEnumerable"),u=b?p.getOwnPropertySymbols:null;n.exports=function(c,s){if(c==null)throw new TypeError("target must be an object");var l=p(c);if(arguments.length===1)return l;for(var g=1;g1)for(var m=1;m4294967295||h(c)!==c)throw new d("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],l=!0,g=!0;if("length"in u&&p){var w=p(u,"length");w&&!w.configurable&&(l=!1),w&&!w.writable&&(g=!1)}return(l||g||!s)&&(o?b(u,"length",c,!0,!0):b(u,"length",c)),u}},4717(n,i,a){"use strict";var f=this&&this.__awaiter||function(d,h,u,c){return new(u||(u=Promise))(function(s,l){function g(v){try{y(c.next(v))}catch(m){l(m)}}function w(v){try{y(c.throw(v))}catch(m){l(m)}}function y(v){var m;v.done?s(v.value):(m=v.value,m instanceof u?m:new u(function(C){C(m)})).then(g,w)}y((c=c.apply(d,h||[])).next())})},b=this&&this.__generator||function(d,h){var u,c,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=w(0),g.throw=w(1),g.return=w(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(y){return function(v){return(function(m){if(u)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(l=0)),l;)try{if(u=1,c&&(s=2&m[0]?c.return:m[0]?c.throw||((s=c.return)&&s.call(c),0):c.next)&&!(s=s.call(c,m[1])).done)return s;switch(c=0,s&&(m=[2&m[0],s.value]),m[0]){case 0:case 1:s=m;break;case 4:return l.label++,{value:m[1],done:!1};case 5:l.label++,c=m[1],m=[0];continue;case 7:m=l.ops.pop(),l.trys.pop();continue;default:if(!((s=(s=l.trys).length>0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0&&y[y.length-1])||_[0]!==6&&_[0]!==2)){v=0;continue}if(_[0]===3&&(!y||_[1]>y[0]&&_[1]0&&R[R.length-1])||L[0]!==6&&L[0]!==2)){A=0;continue}if(L[0]===3&&(!R||L[1]>R[0]&&L[1]0&&y[y.length-1])||_[0]!==6&&_[0]!==2)){v=0;continue}if(_[0]===3&&(!y||_[1]>y[0]&&_[1]0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0},enumerable:!1,configurable:!0}),d.prototype.removeCredential=function(h){return f(this,void 0,void 0,function(){return b(this,function(u){return this.remove(h),[2]})})},d.prototype.hasCredential=function(h){return this.loadedCredentials.has(h)},d.prototype.clear=function(){this.credentials.clear(),this.save()},Object.defineProperty(d.prototype,"storageKey",{get:function(){return"".concat("lnc-web:").concat(this.namespace)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"loadedCredentials",{get:function(){return this.credentials.size===0&&this.load(),this.credentials},enumerable:!1,configurable:!0}),d.prototype.get=function(h){var u;return(u=this.loadedCredentials.get(h))!==null&&u!==void 0?u:void 0},d.prototype.set=function(h,u){this.credentials.set(h,u),this.save(h)},d.prototype.remove=function(h){this.credentials.delete(h),this.save()},d.prototype.save=function(h){if(globalThis.localStorage!==void 0)if(this.credentials.size!==0){var u=Object.fromEntries(this.credentials.entries()),c=h?" (".concat(h," updated)"):"";o.info("Saving credentials to localStorage".concat(c)),globalThis.localStorage.setItem(this.storageKey,JSON.stringify(u))}else globalThis.localStorage.removeItem(this.storageKey)},d.prototype.load=function(){if(globalThis.localStorage!==void 0){var h=globalThis.localStorage.getItem(this.storageKey);if(h)try{var u=JSON.parse(h);this.credentials=new Map(Object.entries(u)),o.info("loaded credentials from localStorage")}catch(c){o.error("Failed to parse cached credentials for ".concat(this.namespace,":"),c)}}},d})();i.BaseCredentialRepository=p},4279(n,i,a){"use strict";var f,b=this&&this.__extends||(f=function(s,l){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var y in w)Object.prototype.hasOwnProperty.call(w,y)&&(g[y]=w[y])},f(s,l)},function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function g(){this.constructor=s}f(s,l),s.prototype=l===null?Object.create(l):(g.prototype=l.prototype,new g)}),o=this&&this.__awaiter||function(s,l,g,w){return new(g||(g=Promise))(function(y,v){function m(O){try{E(w.next(O))}catch(_){v(_)}}function C(O){try{E(w.throw(O))}catch(_){v(_)}}function E(O){var _;O.done?y(O.value):(_=O.value,_ instanceof g?_:new g(function(S){S(_)})).then(m,C)}E((w=w.apply(s,l||[])).next())})},p=this&&this.__generator||function(s,l){var g,w,y,v={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]},m=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return m.next=C(0),m.throw=C(1),m.return=C(2),typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function C(E){return function(O){return(function(_){if(g)throw new TypeError("Generator is already executing.");for(;m&&(m=0,_[0]&&(v=0)),v;)try{if(g=1,w&&(y=2&_[0]?w.return:_[0]?w.throw||((y=w.return)&&y.call(w),0):w.next)&&!(y=y.call(w,_[1])).done)return y;switch(w=0,y&&(_=[2&_[0],y.value]),_[0]){case 0:case 1:y=_;break;case 4:return v.label++,{value:_[1],done:!1};case 5:v.label++,w=_[1],_=[0];continue;case 7:_=v.ops.pop(),v.trys.pop();continue;default:if(!((y=(y=v.trys).length>0&&y[y.length-1])||_[0]!==6&&_[0]!==2)){v=0;continue}if(_[0]===3&&(!y||_[1]>y[0]&&_[1]0&&y[y.length-1])||_[0]!==6&&_[0]!==2)){v=0;continue}if(_[0]===3&&(!y||_[1]>y[0]&&_[1]0&&u[u.length-1])||y[0]!==6&&y[0]!==2)){c=0;continue}if(y[0]===3&&(!u||y[1]>u[0]&&y[1]0&&u[u.length-1])||y[0]!==6&&y[0]!==2)){c=0;continue}if(y[0]===3&&(!u||y[1]>u[0]&&y[1]0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]h},d.prototype.getOrCreateOriginKey=function(){return f(this,void 0,void 0,function(){var h,u,c,s;return b(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.loadOriginKey()];case 1:return(h=l.sent())&&!this.isExpired(h.expiresAt)?[2,h]:[4,crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["wrapKey","unwrapKey"])];case 2:return u=l.sent(),c=Date.now()+864e5,[4,this.saveOriginKey(u,c)];case 3:return l.sent(),[2,{originKey:u,expiresAt:c}];case 4:throw s=l.sent(),new Error("Failed to get or create origin key: ".concat(s.message));case 5:return[2]}})})},d.prototype.loadOriginKey=function(){return f(this,void 0,void 0,function(){var h,u=this;return b(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,this.withDB(function(s){return new Promise(function(l){var g=s.transaction([u.storeName],"readonly").objectStore(u.storeName).get(u.namespace);g.onsuccess=function(){var w=g.result;w&&w.originKey&&typeof w.originKey=="object"&&!Array.isArray(w.originKey)&&typeof w.expiresAt=="number"&&Number.isFinite(w.expiresAt)?l({originKey:w.originKey,expiresAt:w.expiresAt}):l(void 0)},g.onerror=function(){return l(void 0)}})})];case 1:return[2,c.sent()];case 2:return h=c.sent(),o.error("Failed to load origin key: ".concat(h.message)),[2,void 0];case 3:return[2]}})})},d.prototype.saveOriginKey=function(h,u){return f(this,void 0,void 0,function(){var c,s=this;return b(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,this.withDB(function(g){var w={namespace:s.namespace,originKey:h,expiresAt:u,createdAt:Date.now()};return new Promise(function(y,v){var m=g.transaction([s.storeName],"readwrite").objectStore(s.storeName).put(w);m.onsuccess=function(){return y()},m.onerror=function(){var C;v(new Error("Failed to save origin key: ".concat((C=m.error)===null||C===void 0?void 0:C.message)))}})})];case 1:return l.sent(),[3,3];case 2:throw c=l.sent(),o.error("Failed to save origin key: ".concat(c.message),c),new Error("Failed to save origin key: ".concat(c.message));case 3:return[2]}})})},d.prototype.clearOriginKey=function(){return f(this,void 0,void 0,function(){var h,u=this;return b(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,this.withDB(function(s){return new Promise(function(l,g){var w=s.transaction([u.storeName],"readwrite").objectStore(u.storeName).delete(u.namespace);w.onsuccess=function(){o.info("Origin key cleared",{namespace:u.namespace}),l()},w.onerror=function(){var y;return g(new Error("Failed to clear origin key: ".concat((y=w.error)===null||y===void 0?void 0:y.message)))}})})];case 1:return c.sent(),[3,3];case 2:return h=c.sent(),o.warn("Failed to clear origin key:",h),[3,3];case 3:return[2]}})})},d.prototype.withDB=function(h){return f(this,void 0,void 0,function(){var u;return b(this,function(c){switch(c.label){case 0:return[4,this.openDB()];case 1:u=c.sent(),c.label=2;case 2:return c.trys.push([2,,4,5]),[4,h(u)];case 3:return[2,c.sent()];case 4:return u.close(),[7];case 5:return[2]}})})},d.prototype.openDB=function(){return f(this,void 0,void 0,function(){var h=this;return b(this,function(u){return[2,new Promise(function(c,s){var l=indexedDB.open(h.dbName,h.dbVersion);l.onupgradeneeded=function(g){var w=g.target.result;w.objectStoreNames.contains(h.storeName)||w.createObjectStore(h.storeName,{keyPath:"namespace"}).createIndex("expiresAt","expiresAt",{unique:!1})},l.onsuccess=function(){return c(l.result)},l.onerror=function(){return s(new Error("Failed to open IndexedDB"))}})]})})},d})();i.OriginKeyManager=p},9440(n,i,a){"use strict";var f=this&&this.__awaiter||function(v,m,C,E){return new(C||(C=Promise))(function(O,_){function S(T){try{A(E.next(T))}catch(N){_(N)}}function R(T){try{A(E.throw(T))}catch(N){_(N)}}function A(T){var N;T.done?O(T.value):(N=T.value,N instanceof C?N:new C(function(x){x(N)})).then(S,R)}A((E=E.apply(v,m||[])).next())})},b=this&&this.__generator||function(v,m){var C,E,O,_={label:0,sent:function(){if(1&O[0])throw O[1];return O[1]},trys:[],ops:[]},S=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return S.next=R(0),S.throw=R(1),S.return=R(2),typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function R(A){return function(T){return(function(N){if(C)throw new TypeError("Generator is already executing.");for(;S&&(S=0,N[0]&&(_=0)),_;)try{if(C=1,E&&(O=2&N[0]?E.return:N[0]?E.throw||((O=E.return)&&O.call(E),0):E.next)&&!(O=O.call(E,N[1])).done)return O;switch(E=0,O&&(N=[2&N[0],O.value]),N[0]){case 0:case 1:O=N;break;case 4:return _.label++,{value:N[1],done:!1};case 5:_.label++,E=N[1],N=[0];continue;case 7:N=_.ops.pop(),_.trys.pop();continue;default:if(!((O=(O=_.trys).length>0&&O[O.length-1])||N[0]!==6&&N[0]!==2)){_=0;continue}if(N[0]===3&&(!O||N[1]>O[0]&&N[1]=this.config.maxRefreshes?(g.warn("Maximum refresh count reached"),[2,!1]):Date.now()-m.createdAt>=this.config.maxSessionAgeMs?(g.warn("Maximum session age exceeded"),[2,!1]):[4,this.restoreSessionOrThrow()]:(g.warn("No session data available for refresh"),[2,!1]);case 1:return(C=N.sent())?[4,this.encrypter.encrypt(C)]:(g.warn("Refresh aborted: session could not be restored"),[2,!1]);case 2:return E=N.sent(),S=(_=this.deviceBinder).deriveSessionKey,[4,this.deviceBinder.generateFingerprint()];case 3:return[4,S.apply(_,[N.sent(),m.sessionId])];case 4:return O=N.sent(),[4,this.originKeyManager.getOrCreateOriginKey()];case 5:return R=N.sent(),[4,this.keyWrapper.wrapCredentialsKey(E.credentialsKey,O,R.originKey)];case 6:return A=N.sent(),T={sessionId:m.sessionId,createdAt:m.createdAt,expiresAt:Date.now()+this.config.sessionDurationMs,refreshCount:m.refreshCount+1,encryptedCredentials:E.ciphertextB64,credentialsIV:E.ivB64,device:A.deviceWrap,origin:A.originWrap},this.storage.save(T),[2,!0]}})})},v.prototype.restoreSessionOrThrow=function(){return f(this,void 0,void 0,function(){var m,C,E,O,_,S;return b(this,function(R){switch(R.label){case 0:return g.info("Starting session restoration..."),(m=this.storage.load())?Date.now()>m.expiresAt?(g.info("Session expired"),[2,void 0]):[4,this.deviceBinder.generateFingerprint()]:(g.info("No session data found"),[2,void 0]);case 1:return C=R.sent(),[4,this.deviceBinder.deriveSessionKey(C,m.sessionId)];case 2:return E=R.sent(),[4,this.originKeyManager.loadOriginKey()];case 3:if(!(O=R.sent()))throw new Error("Origin key missing");if(this.originKeyManager.isExpired(O.expiresAt))throw new Error("Origin key expired");return[4,this.keyWrapper.unwrapCredentialsKey({deviceWrap:m.device,originWrap:m.origin},E,O.originKey)];case 4:return _=R.sent(),[4,this.encrypter.decrypt({credentialsKey:_,ciphertextB64:m.encryptedCredentials,ivB64:m.credentialsIV})];case 5:return S=R.sent(),g.info("Session restoration successful!"),[2,S]}})})},v.prototype.generateSecureSessionId=function(){if(crypto.randomUUID)return crypto.randomUUID();var m=new Uint8Array(16);return crypto.getRandomValues(m),Array.from(m,function(C){return C.toString(16).padStart(2,"0")}).join("")},v.prototype.validateConfig=function(m){var C=m?Object.fromEntries(Object.entries(m).filter(function(O){return O[1]!==void 0})):{},E=Object.assign({},w,C);if(!Number.isFinite(E.sessionDurationMs)||E.sessionDurationMs<=0)throw new Error("sessionDurationMs must be a finite positive number");if(!Number.isInteger(E.maxRefreshes)||E.maxRefreshes<0)throw new Error("maxRefreshes must be a non-negative integer");if(typeof E.enableActivityRefresh!="boolean")throw new Error("enableActivityRefresh must be a boolean");if(!Number.isFinite(E.maxSessionAgeMs)||E.maxSessionAgeMs<=0)throw new Error("maxSessionAgeMs must be a finite positive number");if(E.maxSessionAgeMs= sessionDurationMs");return Object.freeze(E)},v})();i.default=y},5673(n,i,a){"use strict";var f=this&&this.__awaiter||function(d,h,u,c){return new(u||(u=Promise))(function(s,l){function g(v){try{y(c.next(v))}catch(m){l(m)}}function w(v){try{y(c.throw(v))}catch(m){l(m)}}function y(v){var m;v.done?s(v.value):(m=v.value,m instanceof u?m:new u(function(C){C(m)})).then(g,w)}y((c=c.apply(d,h||[])).next())})},b=this&&this.__generator||function(d,h){var u,c,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=w(0),g.throw=w(1),g.return=w(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(y){return function(v){return(function(m){if(u)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(l=0)),l;)try{if(u=1,c&&(s=2&m[0]?c.return:m[0]?c.throw||((s=c.return)&&s.call(c),0):c.next)&&!(s=s.call(c,m[1])).done)return s;switch(c=0,s&&(m=[2&m[0],s.value]),m[0]){case 0:case 1:s=m;break;case 4:return l.label++,{value:m[1],done:!1};case 5:l.label++,c=m[1],m=[0];continue;case 7:m=l.ops.pop(),l.trys.pop();continue;default:if(!((s=(s=l.trys).length>0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]=18e5?(o.debug("Refresh suppressed: user inactive "+"for ".concat(Math.round(h/1e3),"s")),[2]):(u=this.sessionManager.sessionTimeRemaining)>0&&u=3&&(o.error("Stopping after repeated failures"),this.stop()),[3,6];case 5:return this.isRefreshing=!1,[7];case 6:return[2]}})})},d.prototype.handleVisibilityChange=function(){this.isRunning&&(document.hidden?this.pauseRefreshTimer():(this.lastActivity=Date.now(),this.resumeRefreshTimer()))},d.prototype.cleanupTimersAndListeners=function(){this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0),this.activityThrottleTimer&&(clearTimeout(this.activityThrottleTimer),this.activityThrottleTimer=void 0),this.activityListeners.forEach(function(h){var u=h.event,c=h.handler;document.removeEventListener(u,c)}),this.activityListeners=[]},d.prototype.getLastActivity=function(){return this.lastActivity},d.prototype.isActive=function(){return this.isRunning},d.prototype.forceRefreshCheck=function(){return f(this,void 0,void 0,function(){return b(this,function(h){switch(h.label){case 0:return this.isRunning?[4,this.checkAndRefreshSession()]:(o.warn("forceRefreshCheck called while not running"),[2,!1]);case 1:return h.sent(),[2,this.isRunning]}})})},d})();i.default=p},7424(n,i,a){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.SessionStorage=void 0;var f=(0,a(9764).createLogger)("SessionStorage"),b="lnc-session:",o=function(d){if(!d||typeof d!="object")return!1;var h=d;return typeof h.keyB64=="string"&&typeof h.ivB64=="string"},p=(function(){function d(h){this._cache=void 0,this._namespace=h}return d.prototype.save=function(h){if(typeof sessionStorage<"u")try{var u="".concat(b).concat(this._namespace);sessionStorage.setItem(u,JSON.stringify(h)),this._cache=h,f.info("Session saved to sessionStorage",{namespace:this._namespace,sessionId:h.sessionId,createdAt:h.createdAt,expiresAt:h.expiresAt,refreshCount:h.refreshCount})}catch(c){throw f.error("Failed to save session data",{namespace:this._namespace,error:c}),c}},d.prototype.load=function(){var h;if(typeof sessionStorage<"u"){if(this._cache!==void 0)return(h=this._cache)!==null&&h!==void 0?h:void 0;try{var u="".concat(b).concat(this._namespace),c=sessionStorage.getItem(u);if(!c)return void(this._cache=null);var s=JSON.parse(c);if(!s||typeof s!="object"||!(g=s)||typeof g.sessionId!="string"||typeof g.createdAt!="number"||typeof g.expiresAt!="number"||typeof g.refreshCount!="number"||typeof g.encryptedCredentials!="string"||typeof g.credentialsIV!="string"||!Number.isFinite(g.createdAt)||!Number.isFinite(g.expiresAt)||g.createdAt<=0||g.expiresAt<=0||g.createdAt>g.expiresAt||!Number.isInteger(g.refreshCount)||g.refreshCount<0||g.sessionId.length===0||!o(g.device)||!o(g.origin))return f.error("Invalid session data",{namespace:this._namespace}),sessionStorage.removeItem(u),void(this._cache=null);var l=s;return this._cache=l,f.info("Session loaded from sessionStorage",{namespace:this._namespace,sessionId:l.sessionId,createdAt:l.createdAt,expiresAt:l.expiresAt,refreshCount:l.refreshCount}),l}catch(w){f.error("Failed to load session data",{namespace:this._namespace,error:w});try{u="".concat(b).concat(this._namespace),sessionStorage.removeItem(u)}catch(y){f.warn("Cleanup failed during error recovery",{namespace:this._namespace,cleanupError:y})}return void(this._cache=null)}var g}},d.prototype.clear=function(){if(typeof sessionStorage<"u")try{var h="".concat(b).concat(this._namespace);sessionStorage.removeItem(h),this._cache=null}catch(u){f.error("Failed to clear session data",{namespace:this._namespace,error:u})}},d.prototype.hasData=function(){return typeof sessionStorage<"u"&&(this._cache===void 0&&this.load(),this._cache!=null)},d})();i.SessionStorage=p},3666(n,i,a){"use strict";var f=this&&this.__awaiter||function(h,u,c,s){return new(c||(c=Promise))(function(l,g){function w(m){try{v(s.next(m))}catch(C){g(C)}}function y(m){try{v(s.throw(m))}catch(C){g(C)}}function v(m){var C;m.done?l(m.value):(C=m.value,C instanceof c?C:new c(function(E){E(C)})).then(w,y)}v((s=s.apply(h,u||[])).next())})},b=this&&this.__generator||function(h,u){var c,s,l,g={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},w=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return w.next=y(0),w.throw=y(1),w.return=y(2),typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function y(v){return function(m){return(function(C){if(c)throw new TypeError("Generator is already executing.");for(;w&&(w=0,C[0]&&(g=0)),g;)try{if(c=1,s&&(l=2&C[0]?s.return:C[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,C[1])).done)return l;switch(s=0,l&&(C=[2&C[0],l.value]),C[0]){case 0:case 1:l=C;break;case 4:return g.label++,{value:C[1],done:!1};case 5:g.label++,s=C[1],C=[0];continue;case 7:C=g.ops.pop(),g.trys.pop();continue;default:if(!((l=(l=g.trys).length>0&&l[l.length-1])||C[0]!==6&&C[0]!==2)){g=0;continue}if(C[0]===3&&(!l||C[1]>l[0]&&C[1]0)throw new Error("Failed to persist credentials: ".concat(c.join(", ")));return[2]}})})},h.prototype.loadCredentialsFromStrategy=function(u){return f(this,void 0,void 0,function(){var c,s,l,g,w,y;return b(this,function(v){switch(v.label){case 0:c=[],s=0,l=p,v.label=1;case 1:if(!(s0)throw new Error("Failed to load credentials: ".concat(c.join(", ")));return[2]}})})},h})();i.AuthenticationCoordinator=d},6041(n,i,a){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CredentialCache=void 0;var f=(0,a(9764).createLogger)("CredentialCache"),b=(function(){function o(){this.cache=new Map}return Object.defineProperty(o.prototype,"size",{get:function(){return this.cache.size},enumerable:!1,configurable:!0}),o.prototype.get=function(p){return this.cache.get(p)},o.prototype.set=function(p,d){this.cache.set(p,d)},o.prototype.has=function(p){return this.cache.has(p)},o.prototype.hasAny=function(){return this.cache.size>0},o.prototype.clear=function(){this.cache.clear(),f.info("Cache cleared")},o.prototype.getAll=function(){return new Map(this.cache)},o.prototype.hydrate=function(p){for(var d=0,h=Object.entries(p);d0&&g[g.length-1])||E[0]!==6&&E[0]!==2)){w=0;continue}if(E[0]===3&&(!g||E[1]>g[0]&&E[1]0&&g[g.length-1])||E[0]!==6&&E[0]!==2)){w=0;continue}if(E[0]===3&&(!g||E[1]>g[0]&&E[1]0&&g[g.length-1])||E[0]!==6&&E[0]!==2)){w=0;continue}if(E[0]===3&&(!g||E[1]>g[0]&&E[1]0?new Date(Date.now()+c):void 0}},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isAutoRefreshActive",{get:function(){var c,s;return(s=(c=this.refreshManager)===null||c===void 0?void 0:c.isActive())!==null&&s!==void 0&&s},enumerable:!1,configurable:!0}),u.prototype.getSessionManager=function(){return this.sessionManager},u.prototype.clearSession=function(){this.sessionManager&&(this.stopRefreshManager(),this.sessionManager.clearSession(),d.info("Session cleared"))},u.prototype.canAutoRestore=function(){return f(this,void 0,void 0,function(){return b(this,function(c){return this.sessionManager&&this.sessionManager.canAutoRestore?[2,this.sessionManager.hasValidSession()]:[2,!1]})})},u.prototype.tryAutoRestore=function(){return f(this,void 0,void 0,function(){var c,s;return b(this,function(l){switch(l.label){case 0:if(!this.sessionManager)return[2,void 0];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.sessionManager.restoreSession()];case 2:return(c=l.sent())&&this.startRefreshManager(),[2,c];case 3:return s=l.sent(),d.error("Session auto-restoration error:",s),[2,void 0];case 4:return[2]}})})},u.prototype.createSession=function(c){return f(this,void 0,void 0,function(){var s;return b(this,function(l){switch(l.label){case 0:if(!this.sessionManager)return d.warn("No session manager available - skipping session creation"),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.sessionManager.createSession(c)];case 2:return l.sent(),this.startRefreshManager(),[3,4];case 3:throw s=l.sent(),d.error("Failed to create session:",s),s;case 4:return[2]}})})},u.prototype.refreshSession=function(){return f(this,void 0,void 0,function(){return b(this,function(c){return this.sessionManager?[2,this.sessionManager.refreshSession()]:[2,!1]})})},u.prototype.getTimeRemaining=function(){return f(this,void 0,void 0,function(){return b(this,function(c){return this.sessionManager?[2,this.sessionManager.sessionTimeRemaining]:[2,0]})})},u.prototype.startRefreshManager=function(){var c;!((c=this.sessionManager)===null||c===void 0)&&c.config.enableActivityRefresh&&this.refreshManager&&!this.refreshManager.isActive()&&(this.refreshManager.start(),d.info("Automatic session refresh started"))},u.prototype.stopRefreshManager=function(){this.refreshManager&&this.refreshManager.isActive()&&(this.refreshManager.stop(),d.info("Automatic session refresh stopped"))},u})();i.SessionCoordinator=h},3581(n,i,a){"use strict";var f=this&&this.__awaiter||function(d,h,u,c){return new(u||(u=Promise))(function(s,l){function g(v){try{y(c.next(v))}catch(m){l(m)}}function w(v){try{y(c.throw(v))}catch(m){l(m)}}function y(v){var m;v.done?s(v.value):(m=v.value,m instanceof u?m:new u(function(C){C(m)})).then(g,w)}y((c=c.apply(d,h||[])).next())})},b=this&&this.__generator||function(d,h){var u,c,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=w(0),g.throw=w(1),g.return=w(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(y){return function(v){return(function(m){if(u)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(l=0)),l;)try{if(u=1,c&&(s=2&m[0]?c.return:m[0]?c.throw||((s=c.return)&&s.call(c),0):c.next)&&!(s=s.call(c,m[1])).done)return s;switch(c=0,s&&(m=[2&m[0],s.value]),m[0]){case 0:case 1:s=m;break;case 4:return l.label++,{value:m[1],done:!1};case 5:l.label++,c=m[1],m=[0];continue;case 7:m=l.ops.pop(),l.trys.pop();continue;default:if(!((s=(s=l.trys).length>0&&s[s.length-1])||m[0]!==6&&m[0]!==2)){l=0;continue}if(m[0]===3&&(!s||m[1]>s[0]&&m[1]0&&h[h.length-1])||w[0]!==6&&w[0]!==2)){u=0;continue}if(w[0]===3&&(!h||w[1]>h[0]&&w[1]20&&(clearInterval(c),h(new Error(o)))},500)})]})})}},5820(n,i,a){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var f=a(5105),b="lnc-web",o=(function(){function p(d,h){this.persisted={salt:"",cipher:"",serverHost:"",localKey:"",remoteKey:"",pairingPhrase:""},this._localKey="",this._remoteKey="",this._pairingPhrase="",this.namespace="default",d&&(this.namespace=d),this._load(),h&&(this.password=h)}return Object.defineProperty(p.prototype,"password",{get:function(){return this._password||""},set:function(d){if(this.persisted.cipher){var h=this.persisted,u=h.cipher,c=h.salt;if(!(0,f.verifyTestCipher)(u,d,c))throw new Error("The password provided is not valid");this._password=d,this._pairingPhrase=this._decrypt(this.persisted.pairingPhrase),this._localKey=this._decrypt(this.persisted.localKey),this._remoteKey=this._decrypt(this.persisted.remoteKey)}else this._password=d,this.persisted.salt=(0,f.generateSalt)(),this.persisted.cipher=(0,f.createTestCipher)(d,this.persisted.salt),this.pairingPhrase&&(this.persisted.pairingPhrase=this._encrypt(this.pairingPhrase)),this.localKey&&(this.persisted.localKey=this._encrypt(this.localKey)),this.remoteKey&&(this.persisted.remoteKey=this._encrypt(this.remoteKey)),this._save(),this.clear(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"serverHost",{get:function(){return this.persisted.serverHost},set:function(d){this.persisted.serverHost=d,this._save()},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"pairingPhrase",{get:function(){return this._pairingPhrase},set:function(d){this._pairingPhrase=d,this._password&&(this.persisted.pairingPhrase=this._encrypt(d),this._save())},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"localKey",{get:function(){return this._localKey},set:function(d){this._localKey=d,this._password&&(this.persisted.localKey=this._encrypt(d),this._save())},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"remoteKey",{get:function(){return this._remoteKey},set:function(d){this._remoteKey=d,this._password&&(this.persisted.remoteKey=this._encrypt(d),this._save())},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"isPaired",{get:function(){return!!this.persisted.remoteKey||!!this.persisted.pairingPhrase},enumerable:!1,configurable:!0}),p.prototype.clear=function(d){if(!d){var h="".concat(b,":").concat(this.namespace);localStorage.removeItem(h),this.persisted={salt:"",cipher:"",serverHost:this.persisted.serverHost,localKey:"",remoteKey:"",pairingPhrase:""}}this._localKey="",this._remoteKey="",this._pairingPhrase="",this._password=void 0},p.prototype._load=function(){if(typeof localStorage<"u")try{var d="".concat(b,":").concat(this.namespace),h=localStorage.getItem(d);if(!h)return;this.persisted=JSON.parse(h)}catch(c){var u=c.message;throw new Error("Failed to load secure data: ".concat(u))}},p.prototype._save=function(){if(typeof localStorage<"u"){var d="".concat(b,":").concat(this.namespace);localStorage.setItem(d,JSON.stringify(this.persisted))}},p.prototype._encrypt=function(d){return d&&this._password?(0,f.encrypt)(d,this._password,this.persisted.salt):""},p.prototype._decrypt=function(d){return d&&this._password?(0,f.decrypt)(d,this._password,this.persisted.salt):""},p})();i.default=o},1389(n,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.arrayBufferToBase64=function(a){for(var f=new Uint8Array(a),b="",o=0;ou)){var l=Object.keys(o).reduce(function(g,w){return u===o[w]?w:g},"??");this._logger.apply(this,f(["[".concat(l,"] ").concat(c)],s,!1))}},h})();i.Logger=d,i.log=d.fromEnv("main"),i.wasmLog=d.fromEnv("wasm")},254(n,i,a){"use strict";var f=this&&this.__assign||function(){return f=Object.assign||function(s){for(var l,g=1,w=arguments.length;g0&&y[y.length-1])||_[0]!==6&&_[0]!==2)){v=0;continue}if(_[0]===3&&(!y||_[1]>y[0]&&_[1]=z)return D;switch(D){case"%s":return String(V[G++]);case"%d":return Number(V[G++]);case"%j":try{return JSON.stringify(V[G++])}catch{return"[Circular]"}default:return D}}),F=V[G];G=3&&(G.depth=arguments[2]),arguments.length>=4&&(G.colors=arguments[3]),m(B)?G.showHidden=B:B&&i._extend(G,B),_(G.showHidden)&&(G.showHidden=!1),_(G.depth)&&(G.depth=2),_(G.colors)&&(G.colors=!1),_(G.customInspect)&&(G.customInspect=!0),G.colors&&(G.stylize=s),g(G,P,G.depth)}function s(P,B){var G=c.styles[B];return G?"\x1B["+c.colors[G][0]+"m"+P+"\x1B["+c.colors[G][1]+"m":P}function l(P,B){return P}function g(P,B,G){if(P.customInspect&&B&&N(B.inspect)&&B.inspect!==i.inspect&&(!B.constructor||B.constructor.prototype!==B)){var V=B.inspect(G,P);return O(V)||(V=g(P,V,G)),V}var z=(function(W,Y){if(_(Y))return W.stylize("undefined","undefined");if(O(Y)){var Q="'"+JSON.stringify(Y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return W.stylize(Q,"string")}return E(Y)?W.stylize(""+Y,"number"):m(Y)?W.stylize(""+Y,"boolean"):C(Y)?W.stylize("null","null"):void 0})(P,B);if(z)return z;var U=Object.keys(B),F=(function(W){var Y={};return W.forEach(function(Q,q){Y[Q]=!0}),Y})(U);if(P.showHidden&&(U=Object.getOwnPropertyNames(B)),T(B)&&(U.indexOf("message")>=0||U.indexOf("description")>=0))return w(B);if(U.length===0){if(N(B)){var D=B.name?": "+B.name:"";return P.stylize("[Function"+D+"]","special")}if(S(B))return P.stylize(RegExp.prototype.toString.call(B),"regexp");if(A(B))return P.stylize(Date.prototype.toString.call(B),"date");if(T(B))return w(B)}var k,j="",M=!1,$=["{","}"];return v(B)&&(M=!0,$=["[","]"]),N(B)&&(j=" [Function"+(B.name?": "+B.name:"")+"]"),S(B)&&(j=" "+RegExp.prototype.toString.call(B)),A(B)&&(j=" "+Date.prototype.toUTCString.call(B)),T(B)&&(j=" "+w(B)),U.length!==0||M&&B.length!=0?G<0?S(B)?P.stylize(RegExp.prototype.toString.call(B),"regexp"):P.stylize("[Object]","special"):(P.seen.push(B),k=M?(function(W,Y,Q,q,te){for(var ie=[],ae=0,ue=Y.length;ae60?Q[0]+(Y===""?"":Y+` `)+" "+W.join(`, `)+" "+Q[1]:Q[0]+Y+" "+W.join(", ")+" "+Q[1]})(k,j,$)):$[0]+j+$[1]}function w(P){return"["+Error.prototype.toString.call(P)+"]"}function y(P,B,G,V,z,U){var F,D,k;if((k=Object.getOwnPropertyDescriptor(B,z)||{value:B[z]}).get?D=k.set?P.stylize("[Getter/Setter]","special"):P.stylize("[Getter]","special"):k.set&&(D=P.stylize("[Setter]","special")),H(V,z)||(F="["+z+"]"),D||(P.seen.indexOf(k.value)<0?(D=C(G)?g(P,k.value,null):g(P,k.value,G-1)).indexOf(` `)>-1&&(D=U?D.split(` `).map(function(j){return" "+j}).join(` `).slice(2):` `+D.split(` `).map(function(j){return" "+j}).join(` `)):D=P.stylize("[Circular]","special")),_(F)){if(U&&z.match(/^\d+$/))return D;(F=JSON.stringify(""+z)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(F=F.slice(1,-1),F=P.stylize(F,"name")):(F=F.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),F=P.stylize(F,"string"))}return F+": "+D}function v(P){return Array.isArray(P)}function m(P){return typeof P=="boolean"}function C(P){return P===null}function E(P){return typeof P=="number"}function O(P){return typeof P=="string"}function _(P){return P===void 0}function S(P){return R(P)&&x(P)==="[object RegExp]"}function R(P){return typeof P=="object"&&P!==null}function A(P){return R(P)&&x(P)==="[object Date]"}function T(P){return R(P)&&(x(P)==="[object Error]"||P instanceof Error)}function N(P){return typeof P=="function"}function x(P){return Object.prototype.toString.call(P)}function I(P){return P<10?"0"+P.toString(10):P.toString(10)}i.debuglog=function(P){if(P=P.toUpperCase(),!d[P])if(h.test(P)){var B=f.pid;d[P]=function(){var G=i.format.apply(i,arguments);b.error("%s %d: %s",P,B,G)}}else d[P]=function(){};return d[P]},i.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},i.types=a(9032),i.isArray=v,i.isBoolean=m,i.isNull=C,i.isNullOrUndefined=function(P){return P==null},i.isNumber=E,i.isString=O,i.isSymbol=function(P){return typeof P=="symbol"},i.isUndefined=_,i.isRegExp=S,i.types.isRegExp=S,i.isObject=R,i.isDate=A,i.types.isDate=A,i.isError=T,i.types.isNativeError=T,i.isFunction=N,i.isPrimitive=function(P){return P===null||typeof P=="boolean"||typeof P=="number"||typeof P=="string"||typeof P=="symbol"||P===void 0},i.isBuffer=a(1135);var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function H(P,B){return Object.prototype.hasOwnProperty.call(P,B)}i.log=function(){var P,B;b.log("%s - %s",(B=[I((P=new Date).getHours()),I(P.getMinutes()),I(P.getSeconds())].join(":"),[P.getDate(),L[P.getMonth()],B].join(" ")),i.format.apply(i,arguments))},i.inherits=a(6698),i._extend=function(P,B){if(!B||!R(B))return P;for(var G=Object.keys(B),V=G.length;V--;)P[G[V]]=B[G[V]];return P};var Z=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function K(P,B){if(!P){var G=new Error("Promise was rejected with a falsy value");G.reason=P,P=G}return B(P)}i.promisify=function(P){if(typeof P!="function")throw new TypeError('The "original" argument must be of type Function');if(Z&&P[Z]){var B;if(typeof(B=P[Z])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(B,Z,{value:B,enumerable:!1,writable:!1,configurable:!0}),B}function B(){for(var G,V,z=new Promise(function(D,k){G=D,V=k}),U=[],F=0;F"u"?a.g:globalThis,l=b(),g=p("String.prototype.slice"),w=p("Array.prototype.indexOf",!0)||function(v,m){for(var C=0;C-1?m:m==="Object"&&(function(C){var E=!1;return f(y,function(O,_){if(!E)try{O(C),E=g(_,1)}catch{}}),E})(v)}return d?(function(C){var E=!1;return f(y,function(O,_){if(!E)try{"$"+O(C)===_&&(E=g(_,1))}catch{}}),E})(v):null}},477(){},9209(n,i,a){"use strict";var f=a(6578),b=typeof globalThis>"u"?a.g:globalThis;n.exports=function(){for(var o=[],p=0;pe.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"");function ui(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Bt(e,t=""){if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw new Error(`${r}expected integer >= 0, got ${e}`)}}function Te(e,t,r=""){let n=ui(e),i=e?.length,a=t!==void 0;if(!n||a&&i!==t){let f=r&&`"${r}" `,b=a?` of length ${t}`:"",o=n?`length=${i}`:`type=${typeof e}`;throw new Error(f+"expected Uint8Array"+b+", got "+o)}return e}function Zr(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash must wrapped by utils.createHasher");Bt(e.outputLen),Bt(e.blockLen)}function Rr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function cf(e,t){Te(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length='+r)}function Zn(...e){for(let t=0;t>>t}var Ga=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",lf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Oe(e){if(Te(e),Ga)return e.toHex();let t="";for(let r=0;r=Tt._0&&e<=Tt._9)return e-Tt._0;if(e>=Tt.A&&e<=Tt.F)return e-(Tt.A-10);if(e>=Tt.a&&e<=Tt.f)return e-(Tt.a-10)}function _e(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Ga)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,a=0;ie(a).update(i).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=i=>e(i),Object.assign(r,t),Object.freeze(r)}function Nn(e=32){let t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");return t.getRandomValues(new Uint8Array(e))}var hf=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function ff(e,t,r){return e&t^~e&r}function df(e,t,r){return e&t^e&r^t&r}var Wo=class{constructor(t,r,n,i){J(this,"blockLen");J(this,"outputLen");J(this,"padOffset");J(this,"isLE");J(this,"buffer");J(this,"view");J(this,"finished",!1);J(this,"length",0);J(this,"pos",0);J(this,"destroyed",!1);this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(t),this.view=Ro(this.buffer)}update(t){Rr(this),Te(t);let{view:r,buffer:n,blockLen:i}=this,a=t.length;for(let f=0;fi-f&&(this.process(n,0),f=0);for(let h=f;hd.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h>>3,l=wt(c,17)^wt(c,19)^c>>>10;Lt[h]=l+Lt[h-7]+s+Lt[h-16]|0}let{A:n,B:i,C:a,D:f,E:b,F:o,G:p,H:d}=this;for(let h=0;h<64;h++){let u=wt(b,6)^wt(b,11)^wt(b,25),c=d+u+ff(b,o,p)+pf[h]+Lt[h]|0,l=(wt(n,2)^wt(n,13)^wt(n,22))+df(n,i,a)|0;d=p,p=o,o=b,b=f+c|0,f=a,a=i,i=n,n=c+l|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,f=f+this.D|0,b=b+this.E|0,o=o+this.F|0,p=p+this.G|0,d=d+this.H|0,this.set(n,i,a,f,b,o,p,d)}roundClean(){Zn(Lt)}destroy(){this.set(0,0,0,0,0,0,0,0),Zn(this.buffer)}},Vo=class extends Ko{constructor(){super(32);J(this,"A",kt[0]|0);J(this,"B",kt[1]|0);J(this,"C",kt[2]|0);J(this,"D",kt[3]|0);J(this,"E",kt[4]|0);J(this,"F",kt[5]|0);J(this,"G",kt[6]|0);J(this,"H",kt[7]|0)}},vt=uf(()=>new Vo,hf(1));var hi=BigInt(0),Zo=BigInt(1);function Ir(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}" `;throw new Error(r+"expected boolean, got type="+typeof e)}return e}function Wa(e){if(typeof e=="bigint"){if(!Or(e))throw new Error("positive bigint expected, got "+e)}else Bt(e);return e}function _r(e){let t=Wa(e).toString(16);return t.length&1?"0"+t:t}function Ka(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?hi:BigInt("0x"+e)}function qn(e){return Ka(Oe(e))}function Va(e){return Ka(Oe(yf(Te(e)).reverse()))}function fi(e,t){Bt(t),e=Wa(e);let r=_e(e.toString(16).padStart(t*2,"0"));if(r.length!==t)throw new Error("number too large");return r}function Za(e,t){return fi(e,t).reverse()}function yf(e){return Uint8Array.from(e)}function gf(e){return Uint8Array.from(e,(t,r)=>{let n=t.charCodeAt(0);if(t.length!==1||n>127)throw new Error(`string contains non-ASCII character "${e[r]}" with code ${n} at position ${r}`);return n})}var Or=e=>typeof e=="bigint"&&hi<=e;function bf(e,t,r){return Or(e)&&Or(t)&&Or(r)&&t<=e&&ehi;e>>=Zo,t+=1);return t}var di=e=>(Zo<new Uint8Array(g),i=Uint8Array.of(),a=Uint8Array.of(0),f=Uint8Array.of(1),b=1e3,o=n(e),p=n(e),d=0,h=()=>{o.fill(1),p.fill(0),d=0},u=(...g)=>r(p,et(o,...g)),c=(g=i)=>{p=u(a,g),o=u(),g.length!==0&&(p=u(f,g),o=u())},s=()=>{if(d++>=b)throw new Error("drbg: tried max amount of iterations");let g=0,w=[];for(;g{h(),c(g);let y;for(;!(y=w(s()));)c();return h(),y}}function pi(e,t={},r={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function n(a,f,b){let o=e[a];if(b&&o===void 0)return;let p=typeof o;if(p!==f||o===null)throw new Error(`param "${a}" is invalid: expected ${f}, got ${p}`)}let i=(a,f)=>Object.entries(a).forEach(([b,o])=>n(b,o,f));i(t,!1),i(r,!0)}function ma(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(i!==void 0)return i;let a=e(r,...n);return t.set(r,a),a}}var tt=BigInt(0),Qe=BigInt(1),tn=BigInt(2),Ya=BigInt(3),qa=BigInt(4),za=BigInt(5),Ef=BigInt(7),Qa=BigInt(8),_f=BigInt(9),Ja=BigInt(16);function pt(e,t){let r=e%t;return r>=tt?r:t+r}function lt(e,t,r){let n=e;for(;t-- >tt;)n*=n,n%=r;return n}function va(e,t){if(e===tt)throw new Error("invert: expected non-zero number");if(t<=tt)throw new Error("invert: expected positive modulus, got "+t);let r=pt(e,t),n=t,i=tt,a=Qe;for(;r!==tt;){let b=n/r,o=n%r,p=i-a*b;n=r,r=o,i=a,a=p}if(n!==Qe)throw new Error("invert: does not exist");return pt(i,t)}function yi(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function Xa(e,t){let r=(e.ORDER+Qe)/qa,n=e.pow(t,r);return yi(e,n,t),n}function Cf(e,t){let r=(e.ORDER-za)/Qa,n=e.mul(t,tn),i=e.pow(n,r),a=e.mul(t,i),f=e.mul(e.mul(a,tn),i),b=e.mul(a,e.sub(f,e.ONE));return yi(e,b,t),b}function Af(e){let t=Yr(e),r=ec(e),n=r(t,t.neg(t.ONE)),i=r(t,n),a=r(t,t.neg(n)),f=(e+Ef)/Ja;return(b,o)=>{let p=b.pow(o,f),d=b.mul(p,n),h=b.mul(p,i),u=b.mul(p,a),c=b.eql(b.sqr(d),o),s=b.eql(b.sqr(h),o);p=b.cmov(p,d,c),d=b.cmov(u,h,s);let l=b.eql(b.sqr(d),o),g=b.cmov(p,d,l);return yi(b,g,o),g}}function ec(e){if(e1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Xa;let a=i.pow(n,t),f=(t+Qe)/tn;return function(o,p){if(o.is0(p))return p;if(Ea(o,p)!==1)throw new Error("Cannot find square root");let d=r,h=o.mul(o.ONE,a),u=o.pow(p,t),c=o.pow(p,f);for(;!o.eql(u,o.ONE);){if(o.is0(u))return o.ZERO;let s=1,l=o.sqr(u);for(;!o.eql(l,o.ONE);)if(s++,l=o.sqr(l),s===d)throw new Error("Cannot find square root");let g=Qe<(n[i]="function",n),t);return pi(e,r),e}function Nf(e,t,r){if(rtt;)r&Qe&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Qe;return n}function tc(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((f,b,o)=>e.is0(b)?f:(n[o]=f,e.mul(f,b)),e.ONE),a=e.inv(i);return t.reduceRight((f,b,o)=>e.is0(b)?f:(n[o]=e.mul(f,n[o]),e.mul(f,b)),a),n}function Ea(e,t){let r=(e.ORDER-Qe)/tn,n=e.pow(t,r),i=e.eql(n,e.ONE),a=e.eql(n,e.ZERO),f=e.eql(n,e.neg(e.ONE));if(!i&&!a&&!f)throw new Error("invalid Legendre symbol result");return i?1:a?0:-1}function xf(e,t){t!==void 0&&Bt(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}var Yo=class{constructor(t,r={}){J(this,"ORDER");J(this,"BITS");J(this,"BYTES");J(this,"isLE");J(this,"ZERO",tt);J(this,"ONE",Qe);J(this,"_lengths");J(this,"_sqrt");J(this,"_mod");if(t<=tt)throw new Error("invalid field: expected ORDER > 0, got "+t);let n;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(n=r.BITS),typeof r.sqrt=="function"&&(this.sqrt=r.sqrt),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=r.allowedLengths?.slice()),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:i,nByteLength:a}=xf(t,n);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=i,this.BYTES=a,this._sqrt=void 0,Object.preventExtensions(this)}create(t){return pt(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof t);return tt<=t&&ti)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+t.length);let p=new Uint8Array(i);p.set(t,a?0:p.length-t.length),t=p}if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let o=a?Va(t):qn(t);if(b&&(o=pt(o,f)),!r&&!this.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o}invertBatch(t){return tc(this,t)}cmov(t,r,n){return n?r:t}};function Yr(e,t={}){return new Yo(e,t)}function nc(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function rc(e){let t=nc(e);return t+Math.ceil(t/2)}function oc(e,t,r=!1){Te(e);let n=e.length,i=nc(t),a=rc(t);if(n<16||n1024)throw new Error("expected "+a+"-1024 bytes of input, got "+n);let f=r?Va(e):qn(e),b=pt(f,t-Qe)+Qe;return r?Za(b,i):fi(b,i)}var An=BigInt(0),nn=BigInt(1);function Pr(e,t){let r=t.negate();return e?r:t}function _a(e,t){let r=tc(e.Fp,t.map(n=>n.Z));return t.map((n,i)=>e.fromAffine(n.toAffine(r[i])))}function ic(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Io(e,t){ic(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e,a=di(e),f=BigInt(e);return{windows:r,windowSize:n,mask:a,maxNumber:i,shiftBy:f}}function Ca(e,t,r){let{windowSize:n,mask:i,maxNumber:a,shiftBy:f}=r,b=Number(e&i),o=e>>f;b>n&&(b-=a,o+=nn);let p=t*n,d=p+Math.abs(b)-1,h=b===0,u=b<0,c=t%2!==0;return{nextN:o,offset:d,isZero:h,isNeg:u,isNegF:c,offsetF:p}}var Po=new WeakMap,sc=new WeakMap;function ko(e){return sc.get(e)||1}function Aa(e){if(e!==An)throw new Error("invalid wNAF")}var qo=class{constructor(t,r){J(this,"BASE");J(this,"ZERO");J(this,"Fn");J(this,"bits");this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,n=this.ZERO){let i=t;for(;r>An;)r&nn&&(n=n.add(i)),i=i.double(),r>>=nn;return n}precomputeWindow(t,r){let{windows:n,windowSize:i}=Io(r,this.bits),a=[],f=t,b=f;for(let o=0;oAn||n>An;)r&nn&&(a=a.add(i)),n&nn&&(f=f.add(i)),i=i.double(),r>>=nn,n>>=nn;return{p1:a,p2:f}}function Sa(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Of(t),t}else return Yr(e,{isLE:r})}function If(e,t,r={},n){if(n===void 0&&(n=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let o of["p","n","h"]){let p=t[o];if(!(typeof p=="bigint"&&p>An))throw new Error(`CURVE.${o} must be positive bigint`)}let i=Sa(t.p,r.Fp,n),a=Sa(t.n,r.Fn,n),b=["Gx","Gy","a","b"];for(let o of b)if(!i.isValid(t[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}function ac(e,t){return function(n){let i=e(n);return{secretKey:i,publicKey:t(i)}}}var kr=class{constructor(t,r){J(this,"oHash");J(this,"iHash");J(this,"blockLen");J(this,"outputLen");J(this,"finished",!1);J(this,"destroyed",!1);if(Zr(t),Te(r,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let a=0;anew kr(e,t).update(r).digest();zn.create=(e,t)=>new kr(e,t);var Ta=(e,t)=>(e+(e>=0?t:-t)/cc)/t;function Pf(e,t,r){let[[n,i],[a,f]]=t,b=Ta(f*e,r),o=Ta(-i*e,r),p=e-b*n-o*a,d=-b*i-o*f,h=p=c||d=c)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:h,k1:p,k2neg:u,k2:d}}function zo(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function Lo(e,t){let r={};for(let n of Object.keys(t))r[n]=e[n]===void 0?t[n]:e[n];return Ir(r.lowS,"lowS"),Ir(r.prehash,"prehash"),r.format!==void 0&&zo(r.format),r}var Qo=class extends Error{constructor(t=""){super(t)}},Ut={Err:Qo,_tlv:{encode:(e,t)=>{let{Err:r}=Ut;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=_r(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let a=n>127?_r(i.length/2|128):"";return _r(e)+a+i+t},decode(e,t){let{Err:r}=Ut,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],a=!!(i&128),f=0;if(!a)f=i;else{let o=i&127;if(!o)throw new r("tlv.decode(long): indefinite length not supported");if(o>4)throw new r("tlv.decode(long): byte length is too big");let p=t.subarray(n,n+o);if(p.length!==o)throw new r("tlv.decode: length bytes not complete");if(p[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let d of p)f=f<<8|d;if(n+=o,f<128)throw new r("tlv.decode(long): not minimal encoding")}let b=t.subarray(n,n+f);if(b.length!==f)throw new r("tlv.decode: wrong value length");return{v:b,l:t.subarray(n+f)}}},_int:{encode(e){let{Err:t}=Ut;if(e{let{X:I,Y:L,Z:H}=N;if(n.eql(H,n.ONE))return{x:I,y:L};let Z=N.is0();x==null&&(x=Z?n.ONE:n.inv(H));let K=n.mul(I,x),P=n.mul(L,x),B=n.mul(H,x);if(Z)return{x:n.ZERO,y:n.ZERO};if(!n.eql(B,n.ONE))throw new Error("invZ was invalid");return{x:K,y:P}}),O=ma(N=>{if(N.is0()){if(t.allowInfinityPoint&&!n.is0(N.Y))return;throw new Error("bad point: ZERO")}let{x,y:I}=N.toAffine();if(!n.isValid(x)||!n.isValid(I))throw new Error("bad point: x or y not field elements");if(!g(x,I))throw new Error("bad point: equation left != right");if(!N.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function _(N,x,I,L,H){return I=new S(n.mul(I.X,N),I.Y,I.Z),x=Pr(L,x),I=Pr(H,I),x.add(I)}let T=class T{constructor(x,I,L){J(this,"X");J(this,"Y");J(this,"Z");this.X=v("x",x),this.Y=v("y",I,!0),this.Z=v("z",L),Object.freeze(this)}static CURVE(){return a}static fromAffine(x){let{x:I,y:L}=x||{};if(!x||!n.isValid(I)||!n.isValid(L))throw new Error("invalid affine point");if(x instanceof T)throw new Error("projective point not allowed");return n.is0(I)&&n.is0(L)?T.ZERO:new T(I,L,n.ONE)}static fromBytes(x){let I=T.fromAffine(s(Te(x,void 0,"point")));return I.assertValidity(),I}static fromHex(x){return T.fromBytes(_e(x))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(x=8,I=!0){return A.createCache(this,x),I||this.multiply(Cr),this}assertValidity(){O(this)}hasEvenY(){let{y:x}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(x)}equals(x){m(x);let{X:I,Y:L,Z:H}=this,{X:Z,Y:K,Z:P}=x,B=n.eql(n.mul(I,P),n.mul(Z,H)),G=n.eql(n.mul(L,P),n.mul(K,H));return B&&G}negate(){return new T(this.X,n.neg(this.Y),this.Z)}double(){let{a:x,b:I}=a,L=n.mul(I,Cr),{X:H,Y:Z,Z:K}=this,P=n.ZERO,B=n.ZERO,G=n.ZERO,V=n.mul(H,H),z=n.mul(Z,Z),U=n.mul(K,K),F=n.mul(H,Z);return F=n.add(F,F),G=n.mul(H,K),G=n.add(G,G),P=n.mul(x,G),B=n.mul(L,U),B=n.add(P,B),P=n.sub(z,B),B=n.add(z,B),B=n.mul(P,B),P=n.mul(F,P),G=n.mul(L,G),U=n.mul(x,U),F=n.sub(V,U),F=n.mul(x,F),F=n.add(F,G),G=n.add(V,V),V=n.add(G,V),V=n.add(V,U),V=n.mul(V,F),B=n.add(B,V),U=n.mul(Z,K),U=n.add(U,U),V=n.mul(U,F),P=n.sub(P,V),G=n.mul(U,z),G=n.add(G,G),G=n.add(G,G),new T(P,B,G)}add(x){m(x);let{X:I,Y:L,Z:H}=this,{X:Z,Y:K,Z:P}=x,B=n.ZERO,G=n.ZERO,V=n.ZERO,z=a.a,U=n.mul(a.b,Cr),F=n.mul(I,Z),D=n.mul(L,K),k=n.mul(H,P),j=n.add(I,L),M=n.add(Z,K);j=n.mul(j,M),M=n.add(F,D),j=n.sub(j,M),M=n.add(I,H);let $=n.add(Z,P);return M=n.mul(M,$),$=n.add(F,k),M=n.sub(M,$),$=n.add(L,H),B=n.add(K,P),$=n.mul($,B),B=n.add(D,k),$=n.sub($,B),V=n.mul(z,M),B=n.mul(U,k),V=n.add(B,V),B=n.sub(D,V),V=n.add(D,V),G=n.mul(B,V),D=n.add(F,F),D=n.add(D,F),k=n.mul(z,k),M=n.mul(U,M),D=n.add(D,k),k=n.sub(F,k),k=n.mul(z,k),M=n.add(M,k),F=n.mul(D,M),G=n.add(G,F),F=n.mul($,M),B=n.mul(j,B),B=n.sub(B,F),F=n.mul(j,D),V=n.mul($,V),V=n.add(V,F),new T(B,G,V)}subtract(x){return this.add(x.negate())}is0(){return this.equals(T.ZERO)}multiply(x){let{endo:I}=t;if(!i.isValidNot0(x))throw new Error("invalid scalar: out of range");let L,H,Z=K=>A.cached(this,K,P=>_a(T,P));if(I){let{k1neg:K,k1:P,k2neg:B,k2:G}=C(x),{p:V,f:z}=Z(P),{p:U,f:F}=Z(G);H=z.add(F),L=_(I.beta,V,U,K,B)}else{let{p:K,f:P}=Z(x);L=K,H=P}return _a(T,[L,H])[0]}multiplyUnsafe(x){let{endo:I}=t,L=this;if(!i.isValid(x))throw new Error("invalid scalar: out of range");if(x===xt||L.is0())return T.ZERO;if(x===En)return L;if(A.hasCache(this))return this.multiply(x);if(I){let{k1neg:H,k1:Z,k2neg:K,k2:P}=C(x),{p1:B,p2:G}=Rf(T,L,Z,P);return _(I.beta,B,G,H,K)}else return A.unsafe(L,x)}toAffine(x){return E(this,x)}isTorsionFree(){let{isTorsionFree:x}=t;return f===En?!0:x?x(T,this):A.unsafe(this,b).is0()}clearCofactor(){let{clearCofactor:x}=t;return f===En?this:x?x(T,this):this.multiplyUnsafe(f)}isSmallOrder(){return this.multiplyUnsafe(f).is0()}toBytes(x=!0){return Ir(x,"isCompressed"),this.assertValidity(),c(T,this,x)}toHex(x=!0){return Oe(this.toBytes(x))}toString(){return``}};J(T,"BASE",new T(a.Gx,a.Gy,n.ONE)),J(T,"ZERO",new T(n.ZERO,n.ONE,n.ZERO)),J(T,"Fp",n),J(T,"Fn",i);let S=T,R=i.BITS,A=new qo(S,t.endo?Math.ceil(R/2):R);return S.BASE.precompute(8),S}function lc(e){return Uint8Array.of(e?2:3)}function uc(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Uf(e,t={}){let{Fn:r}=e,n=t.randomBytes||Nn,i=Object.assign(uc(e.Fp,r),{seed:rc(r.ORDER)});function a(c){try{let s=r.fromBytes(c);return r.isValidNot0(s)}catch{return!1}}function f(c,s){let{publicKey:l,publicKeyUncompressed:g}=i;try{let w=c.length;return s===!0&&w!==l||s===!1&&w!==g?!1:!!e.fromBytes(c)}catch{return!1}}function b(c=n(i.seed)){return oc(Te(c,i.seed,"seed"),r.ORDER)}function o(c,s=!0){return e.BASE.multiply(r.fromBytes(c)).toBytes(s)}function p(c){let{secretKey:s,publicKey:l,publicKeyUncompressed:g}=i;if(!ui(c)||"_lengths"in r&&r._lengths||s===l)return;let w=Te(c,void 0,"key").length;return w===l||w===g}function d(c,s,l=!0){if(p(c)===!0)throw new Error("first arg must be private key");if(p(s)===!1)throw new Error("second arg must be public key");let g=r.fromBytes(c);return e.fromBytes(s).multiply(g).toBytes(l)}let h={isValidSecretKey:a,isValidPublicKey:f,randomSecretKey:b},u=ac(b,o);return Object.freeze({getPublicKey:o,getSharedSecret:d,keygen:u,Point:e,utils:h,lengths:i})}function Mf(e,t,r={}){Zr(t),pi(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes||Nn,i=r.hmac||((x,I)=>zn(t,x,I)),{Fp:a,Fn:f}=e,{ORDER:b,BITS:o}=f,{keygen:p,getPublicKey:d,getSharedSecret:h,utils:u,lengths:c}=Uf(e,r),s={prehash:!0,lowS:typeof r.lowS=="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},l=b*cc>En;return x>I}function w(x,I){if(!f.isValidNot0(I))throw new Error(`invalid signature ${x}: out of range 1..Point.Fn.ORDER`);return I}function y(){if(l)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function v(x,I){zo(I);let L=c.signature,H=I==="compact"?L:I==="recovered"?L+1:void 0;return Te(x,H)}class m{constructor(I,L,H){J(this,"r");J(this,"s");J(this,"recovery");if(this.r=w("r",I),this.s=w("s",L),H!=null){if(y(),![0,1,2,3].includes(H))throw new Error("invalid recovery id");this.recovery=H}Object.freeze(this)}static fromBytes(I,L=s.format){v(I,L);let H;if(L==="der"){let{r:B,s:G}=Ut.toSig(Te(I));return new m(B,G)}L==="recovered"&&(H=I[0],L="compact",I=I.subarray(1));let Z=c.signature/2,K=I.subarray(0,Z),P=I.subarray(Z,Z*2);return new m(f.fromBytes(K),f.fromBytes(P),H)}static fromHex(I,L){return this.fromBytes(_e(I),L)}assertRecovery(){let{recovery:I}=this;if(I==null)throw new Error("invalid recovery id: must be present");return I}addRecoveryBit(I){return new m(this.r,this.s,I)}recoverPublicKey(I){let{r:L,s:H}=this,Z=this.assertRecovery(),K=Z===2||Z===3?L+b:L;if(!a.isValid(K))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let P=a.toBytes(K),B=e.fromBytes(et(lc((Z&1)===0),P)),G=f.inv(K),V=E(Te(I,void 0,"msgHash")),z=f.create(-V*G),U=f.create(H*G),F=e.BASE.multiplyUnsafe(z).add(B.multiplyUnsafe(U));if(F.is0())throw new Error("invalid recovery: point at infinify");return F.assertValidity(),F}hasHighS(){return g(this.s)}toBytes(I=s.format){if(zo(I),I==="der")return _e(Ut.hexFromSig(this));let{r:L,s:H}=this,Z=f.toBytes(L),K=f.toBytes(H);return I==="recovered"?(y(),et(Uint8Array.of(this.assertRecovery()),Z,K)):et(Z,K)}toHex(I){return Oe(this.toBytes(I))}}let C=r.bits2int||function(I){if(I.length>8192)throw new Error("input is too large");let L=qn(I),H=I.length*8-o;return H>0?L>>BigInt(H):L},E=r.bits2int_modN||function(I){return f.create(C(I))},O=di(o);function _(x){return wf("num < 2^"+o,x,xt,O),f.toBytes(x)}function S(x,I){return Te(x,void 0,"message"),I?Te(t(x),void 0,"prehashed message"):x}function R(x,I,L){let{lowS:H,prehash:Z,extraEntropy:K}=Lo(L,s);x=S(x,Z);let P=E(x),B=f.fromBytes(I);if(!f.isValidNot0(B))throw new Error("invalid private key");let G=[_(B),_(P)];if(K!=null&&K!==!1){let F=K===!0?n(c.secretKey):K;G.push(Te(F,void 0,"extraEntropy"))}let V=et(...G),z=P;function U(F){let D=C(F);if(!f.isValidNot0(D))return;let k=f.inv(D),j=e.BASE.multiply(D).toAffine(),M=f.create(j.x);if(M===xt)return;let $=f.create(k*f.create(z+M*B));if($===xt)return;let W=(j.x===M?0:2)|Number(j.y&En),Y=$;return H&&g($)&&(Y=f.neg($),W^=1),new m(M,Y,l?void 0:W)}return{seed:V,k2sig:U}}function A(x,I,L={}){let{seed:H,k2sig:Z}=R(x,I,L);return vf(t.outputLen,f.BYTES,i)(H,Z).toBytes(L.format)}function T(x,I,L,H={}){let{lowS:Z,prehash:K,format:P}=Lo(H,s);if(L=Te(L,void 0,"publicKey"),I=S(I,K),!ui(x)){let B=x instanceof m?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+B)}v(x,P);try{let B=m.fromBytes(x,P),G=e.fromBytes(L);if(Z&&B.hasHighS())return!1;let{r:V,s:z}=B,U=E(I),F=f.inv(z),D=f.create(U*F),k=f.create(V*F),j=e.BASE.multiplyUnsafe(D).add(G.multiplyUnsafe(k));return j.is0()?!1:f.create(j.x)===V}catch{return!1}}function N(x,I,L={}){let{prehash:H}=Lo(L,s);return I=S(I,H),m.fromBytes(x,"recovered").recoverPublicKey(I).toBytes()}return Object.freeze({keygen:p,getPublicKey:d,getSharedSecret:h,utils:u,lengths:c,Point:e,sign:A,verify:T,recoverPublicKey:N,Signature:m,hash:t})}var qr={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Df={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Bf=BigInt(0),Jo=BigInt(2);function Ff(e){let t=qr.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),f=BigInt(23),b=BigInt(44),o=BigInt(88),p=e*e*e%t,d=p*p*e%t,h=lt(d,r,t)*d%t,u=lt(h,r,t)*d%t,c=lt(u,Jo,t)*p%t,s=lt(c,i,t)*c%t,l=lt(s,a,t)*s%t,g=lt(l,b,t)*l%t,w=lt(g,o,t)*g%t,y=lt(w,b,t)*l%t,v=lt(y,r,t)*d%t,m=lt(v,f,t)*s%t,C=lt(m,n,t)*p%t,E=lt(C,Jo,t);if(!Lr.eql(Lr.sqr(E),e))throw new Error("Cannot find square root");return E}var Lr=Yr(qr.p,{sqrt:Ff}),sn=Lf(qr,{Fp:Lr,endo:Df}),gi=Mf(sn,vt),Oa={};function Ur(e,...t){let r=Oa[e];if(r===void 0){let n=vt(gf(e));r=et(n,n),Oa[e]=r}return vt(et(r,...t))}var bi=e=>e.toBytes(!0).slice(1),wi=e=>e%Jo===Bf;function Xo(e){let{Fn:t,BASE:r}=sn,n=t.fromBytes(e),i=r.multiply(n);return{scalar:wi(i.y)?n:t.neg(n),bytes:bi(i)}}function hc(e){let t=Lr;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x \u2265 p");let r=t.create(e*e),n=t.create(r*e+BigInt(7)),i=t.sqrt(n);wi(i)||(i=t.neg(i));let a=sn.fromAffine({x:e,y:i});return a.assertValidity(),a}var Wn=qn;function fc(...e){return sn.Fn.create(Wn(Ur("BIP0340/challenge",...e)))}function Na(e){return Xo(e).bytes}function jf(e,t,r=Nn(32)){let{Fn:n}=sn,i=Te(e,void 0,"message"),{bytes:a,scalar:f}=Xo(t),b=Te(r,32,"auxRand"),o=n.toBytes(f^Wn(Ur("BIP0340/aux",b))),p=Ur("BIP0340/nonce",o,a,i),{bytes:d,scalar:h}=Xo(p),u=fc(d,a,i),c=new Uint8Array(64);if(c.set(d,0),c.set(n.toBytes(n.create(h+u*f)),32),!dc(c,i,a))throw new Error("sign: Invalid signature produced");return c}function dc(e,t,r){let{Fp:n,Fn:i,BASE:a}=sn,f=Te(e,64,"signature"),b=Te(t,void 0,"message"),o=Te(r,32,"publicKey");try{let p=hc(Wn(o)),d=Wn(f.subarray(0,32));if(!n.isValidNot0(d))return!1;let h=Wn(f.subarray(32,64));if(!i.isValidNot0(h))return!1;let u=fc(i.toBytes(d),bi(p),b),c=a.multiplyUnsafe(h).add(p.multiplyUnsafe(i.neg(u))),{x:s,y:l}=c.toAffine();return!(c.is0()||!wi(l)||s!==d)}catch{return!1}}var Hn=(()=>{let r=(n=Nn(48))=>oc(n,qr.n);return{keygen:ac(r,Na),getPublicKey:Na,sign:jf,verify:dc,Point:sn,utils:{randomSecretKey:r,taggedHash:Ur,lift_x:hc,pointToBytes:bi},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();function mi(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Hf(e){if(!mi(e))throw new Error("Uint8Array expected")}function pc(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(r=>typeof r=="string"):t.every(r=>Number.isSafeInteger(r)):!1}function $f(e){if(typeof e!="function")throw new Error("function expected");return!0}function on(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function vi(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function ei(e){if(!Array.isArray(e))throw new Error("array expected")}function Mr(e,t){if(!pc(!0,t))throw new Error(`${e}: array of strings expected`)}function yc(e,t){if(!pc(!1,t))throw new Error(`${e}: array of numbers expected`)}function gc(...e){let t=a=>a,r=(a,f)=>b=>a(f(b)),n=e.map(a=>a.encode).reduceRight(r,t),i=e.map(a=>a.decode).reduce(r,t);return{encode:n,decode:i}}function bc(e){let t=typeof e=="string"?e.split(""):e,r=t.length;Mr("alphabet",t);let n=new Map(t.map((i,a)=>[i,a]));return{encode:i=>(ei(i),i.map(a=>{if(!Number.isSafeInteger(a)||a<0||a>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${a}". Allowed: ${e}`);return t[a]})),decode:i=>(ei(i),i.map(a=>{on("alphabet.decode",a);let f=n.get(a);if(f===void 0)throw new Error(`Unknown letter: "${a}". Allowed: ${e}`);return f}))}}function wc(e=""){return on("join",e),{encode:t=>(Mr("join.decode",t),t.join(e)),decode:t=>(on("join.decode",t),t.split(e))}}function Gf(e,t="="){return vi(e),on("padding",t),{encode(r){for(Mr("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){Mr("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}var mc=(e,t)=>t===0?e:mc(t,e%t),Dr=(e,t)=>e+(t-mc(e,t)),Nr=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function ti(e,t,r,n){if(ei(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(Dr(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${Dr(t,r)}`);let i=0,a=0,f=Nr[t],b=Nr[r]-1,o=[];for(let p of e){if(vi(p),p>=f)throw new Error(`convertRadix2: invalid data word=${p} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=r;a-=r)o.push((i>>a-r&b)>>>0);let d=Nr[a];if(d===void 0)throw new Error("invalid carry");i&=d-1}if(i=i<=t)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&a>0&&o.push(i>>>0),o}function vc(e,t=!1){if(vi(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Dr(8,e)>32||Dr(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!mi(r))throw new Error("radix2.encode input should be Uint8Array");return ti(Array.from(r),8,e,!t)},decode:r=>(yc("radix2.decode",r),Uint8Array.from(ti(r,e,8,t)))}}function xa(e){return $f(e),function(...t){try{return e.apply(null,t)}catch{}}}var Wf=typeof Uint8Array.from([]).toBase64=="function"&&typeof Uint8Array.fromBase64=="function",Kf=(e,t)=>{on("base64",e);let r=/^[A-Za-z0-9=+/]+$/,n="base64";if(e.length>0&&!r.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})},Ft=Wf?{encode(e){return Hf(e),e.toBase64()},decode(e){return Kf(e)}}:gc(vc(6),bc("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Gf(6),wc("")),ni=gc(bc("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),wc("")),Ra=[996825010,642813549,513874426,1027748829,705979059];function $n(e){let t=e>>25,r=(e&33554431)<<5;for(let n=0;n>n&1)===1&&(r^=Ra[n]);return r}function Ia(e,t,r=1){let n=e.length,i=1;for(let a=0;a126)throw new Error(`Invalid prefix (${e})`);i=$n(i)^f>>5}i=$n(i);for(let a=0;ac)throw new TypeError(`Length ${l} exceeds limit ${c}`);let g=h.toLowerCase(),w=Ia(g,u,t);return`${g}1${ni.encode(u)}${w}`}function b(h,u=90){on("bech32.decode input",h);let c=h.length;if(c<8||u!==!1&&c>u)throw new TypeError(`invalid string length: ${c} (${h}). Expected (8..${u})`);let s=h.toLowerCase();if(h!==s&&h!==h.toUpperCase())throw new Error("String must be lowercase or uppercase");let l=s.lastIndexOf("1");if(l===0||l===-1)throw new Error('Letter "1" must be present between prefix and data only');let g=s.slice(0,l),w=s.slice(l+1);if(w.length<6)throw new Error("Data must be at least 6 characters long");let y=ni.decode(w).slice(0,-6),v=Ia(g,y,t);if(!w.endsWith(v))throw new Error(`Invalid checksum in ${h}: expected "${v}"`);return{prefix:g,words:y}}let o=xa(b);function p(h){let{prefix:u,words:c}=b(h,!1);return{prefix:u,words:c,bytes:n(c)}}function d(h,u){return f(h,i(u))}return{encode:f,decode:b,encodeFromBytes:d,decodeToBytes:p,decodeUnsafe:o,fromWords:n,fromWordsUnsafe:a,toWords:i}}var Sn=Vf("bech32");function Zf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Pa(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function Uo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Xe(e,t,r=""){let n=Zf(e),i=e?.length,a=t!==void 0;if(!n||a&&i!==t){let f=r&&`"${r}" `,b=a?` of length ${t}`:"",o=n?`length=${i}`:`type=${typeof e}`;throw new Error(f+"expected Uint8Array"+b+", got "+o)}return e}function Ye(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Tn(...e){for(let t=0;t{function r(n,...i){if(Xe(n,void 0,"key"),!Yf)throw new Error("Non little-endian hardware is not yet supported");if(e.nonceLength!==void 0){let d=i[0];Xe(d,e.varSizeNonce?void 0:e.nonceLength,"nonce")}let a=e.tagLength;a&&i[1]!==void 0&&Xe(i[1],void 0,"AAD");let f=t(n,...i),b=(d,h)=>{if(h!==void 0){if(d!==2)throw new Error("cipher output not supported");Xe(h,void 0,"output")}},o=!1;return{encrypt(d,h){if(o)throw new Error("cannot encrypt() twice with same key + nonce");return o=!0,Xe(d),b(f.encrypt.length,h),f.encrypt(d,h)},decrypt(d,h){if(Xe(d),a&&d.lengthjd,BadgeAward:()=>M2,BadgeDefinition:()=>kd,BlockedRelaysList:()=>yd,BlossomServerList:()=>_d,BookmarkList:()=>fd,Bookmarksets:()=>Rd,Calendar:()=>Zd,CalendarEventRSVP:()=>Yd,ChannelCreation:()=>Mc,ChannelHideMessage:()=>Fc,ChannelMessage:()=>Bc,ChannelMetadata:()=>Dc,ChannelMuteUser:()=>jc,ChatMessage:()=>D2,ClassifiedListing:()=>Gd,ClientAuth:()=>$c,Comment:()=>V2,CommunitiesList:()=>dd,CommunityDefinition:()=>Jd,CommunityPostApproval:()=>ed,Contacts:()=>k2,CreateOrUpdateProduct:()=>Md,CreateOrUpdateStall:()=>Ud,Curationsets:()=>Id,Date:()=>Kd,DirectMessageRelaysList:()=>vd,DraftClassifiedListing:()=>Wd,DraftLong:()=>Bd,Emojisets:()=>Fd,EncryptedDirectMessage:()=>L2,EventDeletion:()=>U2,FavoriteRelays:()=>bd,FileMessage:()=>F2,FileMetadata:()=>K2,FileServerPreference:()=>Ed,Followsets:()=>Od,ForumThread:()=>B2,GenericRepost:()=>Ri,Genericlists:()=>Nd,GiftWrap:()=>Hc,GroupMetadata:()=>Xd,HTTPAuth:()=>Ii,Handlerinformation:()=>Qd,Handlerrecommendation:()=>zd,Highlights:()=>ad,InterestsList:()=>wd,Interestsets:()=>Ld,JobFeedback:()=>rd,JobRequest:()=>td,JobResult:()=>nd,Label:()=>X2,LightningPubRPC:()=>Ad,LiveChatMessage:()=>Z2,LiveEvent:()=>Hd,LongFormArticle:()=>Dd,Metadata:()=>I2,Mutelist:()=>ld,NWCWalletInfo:()=>Cd,NWCWalletRequest:()=>Gc,NWCWalletResponse:()=>Sd,NormalVideo:()=>H2,NostrConnect:()=>Td,OpenTimestamps:()=>G2,Photo:()=>j2,Pinlist:()=>ud,Poll:()=>W2,PollResponse:()=>cd,PrivateDirectMessage:()=>Uc,ProblemTracker:()=>z2,ProfileBadges:()=>Pd,PublicChatsList:()=>pd,Reaction:()=>xi,RecommendRelay:()=>P2,RelayList:()=>hd,RelayReview:()=>qd,Relaysets:()=>xd,Report:()=>Q2,Reporting:()=>J2,Repost:()=>Ni,Seal:()=>Lc,SearchRelaysList:()=>gd,ShortTextNote:()=>kc,ShortVideo:()=>$2,Time:()=>Vd,UserEmojiList:()=>md,UserStatuses:()=>$d,Voice:()=>Y2,VoiceComment:()=>q2,Zap:()=>sd,ZapGoal:()=>od,ZapRequest:()=>id,classifyKind:()=>x2,isAddressableKind:()=>Oi,isEphemeralKind:()=>Pc,isKind:()=>R2,isRegularKind:()=>Ic,isReplaceableKind:()=>Ti});function Ic(e){return e<1e4&&e!==0&&e!==3}function Ti(e){return e===0||e===3||1e4<=e&&e<2e4}function Pc(e){return 2e4<=e&&e<3e4}function Oi(e){return 3e4<=e&&e<4e4}function x2(e){return Ic(e)?"regular":Ti(e)?"replaceable":Pc(e)?"ephemeral":Oi(e)?"parameterized":"unknown"}function R2(e,t){let r=t instanceof Array?t:[t];return Ci(e)&&r.includes(e.kind)||!1}var I2=0,kc=1,P2=2,k2=3,L2=4,U2=5,Ni=6,xi=7,M2=8,D2=9,B2=11,Lc=13,Uc=14,F2=15,Ri=16,j2=20,H2=21,$2=22,Mc=40,Dc=41,Bc=42,Fc=43,jc=44,G2=1040,Hc=1059,W2=1068,K2=1063,V2=1111,Z2=1311,Y2=1222,q2=1244,z2=1971,Q2=1984,J2=1984,X2=1985,ed=4550,td=5999,nd=6999,rd=7e3,od=9041,id=9734,sd=9735,ad=9802,cd=1018,ld=1e4,ud=10001,hd=10002,fd=10003,dd=10004,pd=10005,yd=10006,gd=10007,bd=10012,wd=10015,md=10030,vd=10050,Ed=10096,_d=10063,Cd=13194,Ad=21e3,$c=22242,Gc=23194,Sd=23195,Td=24133,Ii=27235,Od=3e4,Nd=30001,xd=30002,Rd=30003,Id=30004,Pd=30008,kd=30009,Ld=30015,Ud=30017,Md=30018,Dd=30023,Bd=30024,Fd=30030,jd=30078,Hd=30311,$d=30315,Gd=30402,Wd=30403,Kd=31922,Vd=31923,Zd=31924,Yd=31925,qd=31987,zd=31989,Qd=31990,Jd=34550,Xd=39e3;function ep(e,t){if(e.ids&&e.ids.indexOf(t.id)===-1||e.kinds&&e.kinds.indexOf(t.kind)===-1||e.authors&&e.authors.indexOf(t.pubkey)===-1)return!1;for(let r in e)if(r[0]==="#"){let n=r.slice(1),i=e[`#${n}`];if(i&&!t.tags.find(([a,f])=>a===r.slice(1)&&i.indexOf(f)!==-1))return!1}return!(e.since&&t.created_ate.until)}function tp(e,t){for(let r=0;rJr,getInt:()=>Wc,getSubscriptionId:()=>Kc,matchEventId:()=>rp,matchEventKind:()=>ip,matchEventPubkey:()=>op});function Jr(e,t){let r=t.length+3,n=e.indexOf(`"${t}":`)+r,i=e.slice(n).indexOf('"')+n+1;return e.slice(i,i+64)}function Wc(e,t){let r=t.length,n=e.indexOf(`"${t}":`)+r+3,i=e.slice(n),a=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,a),10)}function Kc(e){let t=e.slice(0,22).indexOf('"EVENT"');if(t===-1)return null;let r=e.slice(t+7+1).indexOf('"');if(r===-1)return null;let n=t+7+1+r,i=e.slice(n+1,80).indexOf('"');if(i===-1)return null;let a=n+1+i;return e.slice(n+1,a)}function rp(e,t){return t===Jr(e,"id")}function op(e,t){return t===Jr(e,"pubkey")}function ip(e,t){return t===Wc(e,"kind")}var sp={};xe(sp,{makeAuthEvent:()=>Vc});function Vc(e,t){return{kind:$c,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}var Zc=class extends Error{constructor(e,t){super(`Tried to send message '${e} on a closed connection to ${t}.`),this.name="SendingOnClosedConnection"}},Yc=class{constructor(e,t){J(this,"url");J(this,"_connected",!1);J(this,"onclose",null);J(this,"onnotice",e=>console.debug(`NOTICE from ${this.url}: ${e}`));J(this,"onauth");J(this,"baseEoseTimeout",4400);J(this,"publishTimeout",4400);J(this,"pingFrequency",29e3);J(this,"pingTimeout",2e4);J(this,"resubscribeBackoff",[1e4,1e4,1e4,2e4,2e4,3e4,6e4]);J(this,"openSubs",new Map);J(this,"enablePing");J(this,"enableReconnect");J(this,"idleSince",Date.now());J(this,"ongoingOperations",0);J(this,"reconnectTimeoutHandle");J(this,"pingIntervalHandle");J(this,"reconnectAttempts",0);J(this,"skipReconnection",!1);J(this,"connectionPromise");J(this,"openCountRequests",new Map);J(this,"openEventPublishes",new Map);J(this,"ws");J(this,"challenge");J(this,"authPromise");J(this,"serial",0);J(this,"verifyEvent");J(this,"_WebSocket");this.url=Rc(e),this.verifyEvent=t.verifyEvent,this._WebSocket=t.websocketImplementation||WebSocket,this.enablePing=t.enablePing,this.enableReconnect=t.enableReconnect||!1}static async connect(e,t){let r=new Yc(e,t);return await r.connect(t),r}closeAllSubscriptions(e){for(let[t,r]of this.openSubs)r.close(e);this.openSubs.clear();for(let[t,r]of this.openEventPublishes)r.reject(new Error(e));this.openEventPublishes.clear();for(let[t,r]of this.openCountRequests)r.reject(new Error(e));this.openCountRequests.clear()}get connected(){return this._connected}async reconnect(){let e=this.resubscribeBackoff[Math.min(this.reconnectAttempts,this.resubscribeBackoff.length-1)];this.reconnectAttempts++,this.reconnectTimeoutHandle=setTimeout(async()=>{try{await this.connect()}catch{}},e)}handleHardClose(e){this.pingIntervalHandle&&(clearInterval(this.pingIntervalHandle),this.pingIntervalHandle=void 0),this._connected=!1,this.connectionPromise=void 0,this.idleSince=void 0,this.enableReconnect&&!this.skipReconnection?this.reconnect():(this.onclose?.(),this.closeAllSubscriptions(e))}async connect(e){let t;return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.authPromise=void 0,this.skipReconnection=!1,this.connectionPromise=new Promise((r,n)=>{e?.timeout&&(t=setTimeout(()=>{n("connection timed out"),this.connectionPromise=void 0,this.skipReconnection=!0,this.onclose?.(),this.handleHardClose("relay connection timed out")},e.timeout)),e?.abort&&(e.abort.onabort=n);try{this.ws=new this._WebSocket(this.url)}catch(i){clearTimeout(t),n(i);return}this.ws.onopen=()=>{this.reconnectTimeoutHandle&&(clearTimeout(this.reconnectTimeoutHandle),this.reconnectTimeoutHandle=void 0),clearTimeout(t),this._connected=!0;let i=this.reconnectAttempts>0;this.reconnectAttempts=0;for(let a of this.openSubs.values()){if(a.eosed=!1,i)for(let f=0;fthis.pingpong(),this.pingFrequency)),r()},this.ws.onerror=()=>{clearTimeout(t),n("connection failed"),this.connectionPromise=void 0,this.skipReconnection=!0,this.onclose?.(),this.handleHardClose("relay connection failed")},this.ws.onclose=i=>{clearTimeout(t),n(i.message||"websocket closed"),this.handleHardClose("relay connection closed")},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}waitForPingPong(){return new Promise(e=>{this.ws.once("pong",()=>e(!0)),this.ws.ping()})}waitForDummyReq(){return new Promise((e,t)=>{if(!this.connectionPromise)return t(new Error(`no connection to ${this.url}, can't ping`));try{let r=this.subscribe([{ids:["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"],limit:0}],{label:"",oneose:()=>{e(!0),r.close()},onclose(){e(!0)},eoseTimeout:this.pingTimeout+1e3})}catch(r){t(r)}})}async pingpong(){this.ws?.readyState===1&&(await Promise.any([this.ws&&this.ws.ping&&this.ws.once?this.waitForPingPong():this.waitForDummyReq(),new Promise(t=>setTimeout(()=>t(!1),this.pingTimeout))])||this.ws?.readyState===this._WebSocket.OPEN&&this.ws?.close())}async send(e){if(!this.connectionPromise)throw new Zc(e,this.url);this.connectionPromise.then(()=>{this.ws?.send(e)})}async auth(e){let t=this.challenge;if(!t)throw new Error("can't perform auth, no challenge was received");return this.authPromise?this.authPromise:(this.authPromise=new Promise(async(r,n)=>{try{let i=await e(Vc(this.url,t)),a=setTimeout(()=>{let f=this.openEventPublishes.get(i.id);f&&(f.reject(new Error("auth timed out")),this.openEventPublishes.delete(i.id))},this.publishTimeout);this.openEventPublishes.set(i.id,{resolve:r,reject:n,timeout:a}),this.send('["AUTH",'+JSON.stringify(i)+"]")}catch(i){console.warn("subscribe auth function failed:",i)}}),this.authPromise)}async publish(e){this.idleSince=void 0,this.ongoingOperations++;let t=new Promise((r,n)=>{let i=setTimeout(()=>{let a=this.openEventPublishes.get(e.id);a&&(a.reject(new Error("publish timed out")),this.openEventPublishes.delete(e.id))},this.publishTimeout);this.openEventPublishes.set(e.id,{resolve:r,reject:n,timeout:i})});return this.send('["EVENT",'+JSON.stringify(e)+"]"),this.ongoingOperations--,this.ongoingOperations===0&&(this.idleSince=Date.now()),t}async count(e,t){this.serial++;let r=t?.id||"count:"+this.serial,n=new Promise((i,a)=>{this.openCountRequests.set(r,{resolve:i,reject:a})});return this.send('["COUNT","'+r+'",'+JSON.stringify(e).substring(1)),n}subscribe(e,t){t.label!==""&&(this.idleSince=void 0,this.ongoingOperations++);let r=this.prepareSubscription(e,t);return r.fire(),t.abort&&(t.abort.onabort=()=>r.close(String(t.abort.reason||""))),r}prepareSubscription(e,t){this.serial++;let r=t.id||(t.label?t.label+":":"sub:")+this.serial,n=new ap(this,r,e,t);return this.openSubs.set(r,n),n}close(){this.skipReconnection=!0,this.reconnectTimeoutHandle&&(clearTimeout(this.reconnectTimeoutHandle),this.reconnectTimeoutHandle=void 0),this.pingIntervalHandle&&(clearInterval(this.pingIntervalHandle),this.pingIntervalHandle=void 0),this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,this.idleSince=void 0,this.onclose?.(),this.ws?.readyState===this._WebSocket.OPEN&&this.ws?.close()}_onmessage(e){let t=e.data;if(!t)return;let r=Kc(t);if(r){let n=this.openSubs.get(r);if(!n)return;let i=Jr(t,"id"),a=n.alreadyHaveEvent?.(i);if(n.receivedEvent?.(this,i),a)return}try{let n=JSON.parse(t);switch(n[0]){case"EVENT":{let i=this.openSubs.get(n[1]),a=n[2];this.verifyEvent(a)&&tp(i.filters,a)?i.onevent(a):i.oninvalidevent?.(a),(!i.lastEmitted||i.lastEmitted{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,i)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,this.oneose?.())}close(e="closed by caller"){if(!this.closed&&this.relay.connected){try{this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]")}catch(t){if(!(t instanceof Zc))throw t}this.closed=!0}this.relay.openSubs.delete(this.id),this.relay.ongoingOperations--,this.relay.ongoingOperations===0&&(this.relay.idleSince=Date.now()),this.onclose?.(e)}},qc;try{qc=WebSocket}catch{}var zc=class extends Yc{constructor(e,t){super(e,{verifyEvent:Qr,websocketImplementation:qc,...t})}static async connect(e,t){let r=new zc(e,t);return await r.connect(),r}},cp;try{cp=WebSocket}catch{}var ii={};xe(ii,{BECH32_REGEX:()=>Qc,Bech32MaxSize:()=>Pi,NostrTypeGuard:()=>lp,decode:()=>Xr,decodeNostrURI:()=>hp,encodeBytes:()=>to,naddrEncode:()=>bp,neventEncode:()=>gp,noteEncode:()=>pp,nprofileEncode:()=>yp,npubEncode:()=>dp,nsecEncode:()=>fp});var lp={isNProfile:e=>/^nprofile1[a-z\d]+$/.test(e||""),isNEvent:e=>/^nevent1[a-z\d]+$/.test(e||""),isNAddr:e=>/^naddr1[a-z\d]+$/.test(e||""),isNSec:e=>/^nsec1[a-z\d]{58}$/.test(e||""),isNPub:e=>/^npub1[a-z\d]{58}$/.test(e||""),isNote:e=>/^note1[a-z\d]+$/.test(e||""),isNcryptsec:e=>/^ncryptsec1[a-z\d]+$/.test(e||"")},Pi=5e3,Qc=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function up(e){let t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=e&255,t}function hp(e){try{return e.startsWith("nostr:")&&(e=e.substring(6)),Xr(e)}catch{return{type:"invalid",data:null}}}function Xr(e){let{prefix:t,words:r}=Sn.decode(e,Pi),n=new Uint8Array(Sn.fromWords(r));switch(t){case"nprofile":{let i=Bo(n);if(!i[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(i[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:Oe(i[0][0]),relays:i[1]?i[1].map(a=>Rt.decode(a)):[]}}}case"nevent":{let i=Bo(n);if(!i[0]?.[0])throw new Error("missing TLV 0 for nevent");if(i[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(i[2]&&i[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(i[3]&&i[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:Oe(i[0][0]),relays:i[1]?i[1].map(a=>Rt.decode(a)):[],author:i[2]?.[0]?Oe(i[2][0]):void 0,kind:i[3]?.[0]?parseInt(Oe(i[3][0]),16):void 0}}}case"naddr":{let i=Bo(n);if(!i[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!i[2]?.[0])throw new Error("missing TLV 2 for naddr");if(i[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!i[3]?.[0])throw new Error("missing TLV 3 for naddr");if(i[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:Rt.decode(i[0][0]),pubkey:Oe(i[2][0]),kind:parseInt(Oe(i[3][0]),16),relays:i[1]?i[1].map(a=>Rt.decode(a)):[]}}}case"nsec":return{type:t,data:n};case"npub":case"note":return{type:t,data:Oe(n)};default:throw new Error(`unknown prefix ${t}`)}}function Bo(e){let t={},r=e;for(;r.length>0;){let n=r[0],i=r[1],a=r.slice(2,2+i);if(r=r.slice(2+i),a.lengthut.encode(r))});return eo("nprofile",t)}function gp(e){let t;e.kind!==void 0&&(t=up(e.kind));let r=ki({0:[_e(e.id)],1:(e.relays||[]).map(n=>ut.encode(n)),2:e.author?[_e(e.author)]:[],3:t?[new Uint8Array(t)]:[]});return eo("nevent",r)}function bp(e){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,e.kind,!1);let r=ki({0:[ut.encode(e.identifier)],1:(e.relays||[]).map(n=>ut.encode(n)),2:[_e(e.pubkey)],3:[new Uint8Array(t)]});return eo("naddr",r)}function ki(e){let t=[];return Object.entries(e).reverse().forEach(([r,n])=>{n.forEach(i=>{let a=new Uint8Array(i.length+2);a.set([parseInt(r)],0),a.set([i.length],1),a.set(i,2),t.push(a)})}),et(...t)}var si={};xe(si,{decrypt:()=>wp,encrypt:()=>Jc});function Jc(e,t,r){let n=e instanceof Uint8Array?e:_e(e),i=gi.getSharedSecret(n,_e("02"+t)),a=Xc(i),f=Uint8Array.from(Nn(16)),b=ut.encode(r),o=Tc(a,f).encrypt(b),p=Ft.encode(new Uint8Array(o)),d=Ft.encode(new Uint8Array(f.buffer));return`${p}?iv=${d}`}function wp(e,t,r){let n=e instanceof Uint8Array?e:_e(e),[i,a]=r.split("?iv="),f=gi.getSharedSecret(n,_e("02"+t)),b=Xc(f),o=Ft.decode(a),p=Ft.decode(i),d=Tc(b,o).decrypt(p);return Rt.decode(d)}function Xc(e){return e.slice(1,33)}var mp={};xe(mp,{NIP05_REGEX:()=>Li,isNip05:()=>vp,isValid:()=>Cp,queryProfile:()=>el,searchDomain:()=>_p,useFetchImplementation:()=>Ep});var Li=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,vp=e=>Li.test(e||""),no;try{no=fetch}catch{}function Ep(e){no=e}async function _p(e,t=""){try{let r=`https://${e}/.well-known/nostr.json?name=${t}`,n=await no(r,{redirect:"manual"});if(n.status!==200)throw Error("Wrong response code");return(await n.json()).names}catch{return{}}}async function el(e){let t=e.match(Li);if(!t)return null;let[,r="_",n]=t;try{let i=`https://${n}/.well-known/nostr.json?name=${r}`,a=await no(i,{redirect:"manual"});if(a.status!==200)throw Error("Wrong response code");let f=await a.json(),b=f.names[r];return b?{pubkey:b,relays:f.relays?.[b]}:null}catch{return null}}async function Cp(e,t){let r=await el(t);return r?r.pubkey===e:!1}var Ap={};xe(Ap,{parse:()=>Sp});function Sp(e){let t={reply:void 0,root:void 0,mentions:[],profiles:[],quotes:[]},r,n;for(let i=e.tags.length-1;i>=0;i--){let a=e.tags[i];if(a[0]==="e"&&a[1]){let[f,b,o,p,d]=a,h={id:b,relays:o?[o]:[],author:d};if(p==="root"){t.root=h;continue}if(p==="reply"){t.reply=h;continue}if(p==="mention"){t.mentions.push(h);continue}r?n=h:r=h,t.mentions.push(h);continue}if(a[0]==="q"&&a[1]){let[f,b,o]=a;t.quotes.push({id:b,relays:o?[o]:[]})}if(a[0]==="p"&&a[1]){t.profiles.push({pubkey:a[1],relays:a[2]?[a[2]]:[]});continue}}return t.root||(t.root=n||r||t.reply),t.reply||(t.reply=r||t.root),[t.reply,t.root].forEach(i=>{if(!i)return;let a=t.mentions.indexOf(i);if(a!==-1&&t.mentions.splice(a,1),i.author){let f=t.profiles.find(b=>b.pubkey===i.author);f&&f.relays&&(i.relays||(i.relays=[]),f.relays.forEach(b=>{i.relays?.indexOf(b)===-1&&i.relays.push(b)}),f.relays=i.relays)}}),t.mentions.forEach(i=>{if(i.author){let a=t.profiles.find(f=>f.pubkey===i.author);a&&a.relays&&(i.relays||(i.relays=[]),a.relays.forEach(f=>{i.relays.indexOf(f)===-1&&i.relays.push(f)}),a.relays=i.relays)}}),t}var Tp={};xe(Tp,{fetchRelayInformation:()=>Np,useFetchImplementation:()=>Op});var tl;try{tl=fetch}catch{}function Op(e){tl=e}async function Np(e){return await(await fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()}var xp={};xe(xp,{getPow:()=>Rp,minePow:()=>Pp});function Rp(e){let t=0;for(let r=0;r<64;r+=8){let n=parseInt(e.substring(r,r+8),16);if(n===0)t+=32;else{t+=Math.clz32(n);break}}return t}function Ip(e){let t=0;for(let r=0;r=t){n.id=Oe(f);break}}return n}var kp={};xe(kp,{unwrapEvent:()=>Wp,unwrapManyEvents:()=>Kp,wrapEvent:()=>pl,wrapManyEvents:()=>Gp});var Lp={};xe(Lp,{createRumor:()=>ul,createSeal:()=>hl,createWrap:()=>fl,unwrapEvent:()=>Fi,unwrapManyEvents:()=>dl,wrapEvent:()=>Br,wrapManyEvents:()=>Hp});var Gn={};xe(Gn,{decrypt:()=>Bi,encrypt:()=>Di,getConversationKey:()=>Ui,v2:()=>Fp});var nl=1,rl=65535;function Ui(e,t){let r=gi.getSharedSecret(e,_e("02"+t)).subarray(1,33);return w2(vt,r,ut.encode("nip44-v2"))}function ol(e,t){let r=m2(vt,e,t,76);return{chacha_key:r.subarray(0,32),chacha_nonce:r.subarray(32,44),hmac_key:r.subarray(44,76)}}function Mi(e){if(!Number.isSafeInteger(e)||e<1)throw new Error("expected positive integer");if(e<=32)return 32;let t=1<rl)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t}function Mp(e){let t=ut.encode(e),r=t.length,n=Up(r),i=new Uint8Array(Mi(r)-r);return et(n,t,i)}function Dp(e){let t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(trl||r.length!==t||e.length!==2+Mi(t))throw new Error("invalid padding");return Rt.decode(r)}function il(e,t,r){if(r.length!==32)throw new Error("AAD associated data must be 32 bytes");let n=et(r,t);return zn(vt,e,n)}function Bp(e){if(typeof e!="string")throw new Error("payload must be a valid string");let t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if(e[0]==="#")throw new Error("unknown encryption version");let r;try{r=Ft.decode(e)}catch(a){throw new Error("invalid base64: "+a.message)}let n=r.length;if(n<99||n>65603)throw new Error("invalid data length: "+n);let i=r[0];if(i!==2)throw new Error("unknown encryption version "+i);return{nonce:r.subarray(1,33),ciphertext:r.subarray(33,-32),mac:r.subarray(-32)}}function Di(e,t,r=Nn(32)){let{chacha_key:n,chacha_nonce:i,hmac_key:a}=ol(t,r),f=Mp(e),b=xc(n,i,f),o=il(a,b,r);return Ft.encode(et(new Uint8Array([2]),r,b,o))}function Bi(e,t){let{nonce:r,ciphertext:n,mac:i}=Bp(e),{chacha_key:a,chacha_nonce:f,hmac_key:b}=ol(t,r),o=il(b,n,r);if(!Qf(o,i))throw new Error("invalid MAC");let p=xc(a,f,n);return Dp(p)}var Fp={utils:{getConversationKey:Ui,calcPaddedLen:Mi},encrypt:Di,decrypt:Bi},jp=2880*60,sl=()=>Math.round(Date.now()/1e3),al=()=>Math.round(sl()-Math.random()*jp),cl=(e,t)=>Ui(e,t),ll=(e,t,r)=>Di(JSON.stringify(e),cl(t,r)),Ma=(e,t)=>JSON.parse(Bi(e.content,cl(t,e.pubkey)));function ul(e,t){let r={created_at:sl(),content:"",tags:[],...e,pubkey:On(t)};return r.id=Kn(r),r}function hl(e,t,r){return yt({kind:Lc,content:ll(e,t,r),created_at:al(),tags:[]},t)}function fl(e,t){let r=Si();return yt({kind:Hc,content:ll(e,r,t),created_at:al(),tags:[["p",t]]},r)}function Br(e,t,r){let n=ul(e,t),i=hl(n,t,r);return fl(i,r)}function Hp(e,t,r){if(!r||r.length===0)throw new Error("At least one recipient is required.");let n=On(t),i=[Br(e,t,n)];return r.forEach(a=>{i.push(Br(e,t,a))}),i}function Fi(e,t){let r=Ma(e,t);return Ma(r,t)}function dl(e,t){let r=[];return e.forEach(n=>{r.push(Fi(n,t))}),r.sort((n,i)=>n.created_at-i.created_at),r}function $p(e,t,r,n){let i={created_at:Math.ceil(Date.now()/1e3),kind:Uc,tags:[],content:t};return(Array.isArray(e)?e:[e]).forEach(({publicKey:f,relayUrl:b})=>{i.tags.push(b?["p",f,b]:["p",f])}),n&&i.tags.push(["e",n.eventId,n.relayUrl||"","reply"]),r&&i.tags.push(["subject",r]),i}function pl(e,t,r,n,i){let a=$p(t,r,n,i);return Br(a,e,t.publicKey)}function Gp(e,t,r,n,i){if(!t||t.length===0)throw new Error("At least one recipient is required.");return[{publicKey:On(e)},...t].map(f=>pl(e,f,r,n,i))}var Wp=Fi,Kp=dl,Vp={};xe(Vp,{finishRepostEvent:()=>Zp,getRepostedEvent:()=>Yp,getRepostedEventPointer:()=>yl});function Zp(e,t,r,n){let i,a=[...e.tags??[],["e",t.id,r],["p",t.pubkey]];return t.kind===kc?i=Ni:(i=Ri,a.push(["k",String(t.kind)])),yt({kind:i,tags:a,content:e.content===""||t.tags?.find(f=>f[0]==="-")?"":JSON.stringify(t),created_at:e.created_at},n)}function yl(e){if(![Ni,Ri].includes(e.kind))return;let t,r;for(let n=e.tags.length-1;n>=0&&(t===void 0||r===void 0);n--){let i=e.tags[n];i.length>=2&&(i[0]==="e"&&t===void 0?t=i:i[0]==="p"&&r===void 0&&(r=i))}if(t!==void 0)return{id:t[1],relays:[t[2],r?.[2]].filter(n=>typeof n=="string"),author:r?.[1]}}function Yp(e,{skipVerification:t}={}){let r=yl(e);if(r===void 0||e.content==="")return;let n;try{n=JSON.parse(e.content)}catch{return}if(n.id===r.id&&!(!t&&!Qr(n)))return n}var qp={};xe(qp,{NOSTR_URI_REGEX:()=>ji,parse:()=>Qp,test:()=>zp});var ji=new RegExp(`nostr:(${Qc.source})`);function zp(e){return typeof e=="string"&&new RegExp(`^${ji.source}$`).test(e)}function Qp(e){let t=e.match(new RegExp(`^${ji.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Xr(t[1])}}var Jp={};xe(Jp,{finishReactionEvent:()=>Xp,getReactedEventPointer:()=>e4});function Xp(e,t,r){let n=t.tags.filter(i=>i.length>=2&&(i[0]==="e"||i[0]==="p"));return yt({...e,kind:xi,tags:[...e.tags??[],...n,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function e4(e){if(e.kind!==xi)return;let t,r;for(let n=e.tags.length-1;n>=0&&(t===void 0||r===void 0);n--){let i=e.tags[n];i.length>=2&&(i[0]==="e"&&t===void 0?t=i:i[0]==="p"&&r===void 0&&(r=i))}if(!(t===void 0||r===void 0))return{id:t[1],relays:[t[2],r[2]].filter(n=>n!==void 0),author:r[1]}}var t4={};xe(t4,{parse:()=>r4});var Fo=/\W/m,Da=/[^\w\/] |[^\w\/]$|$|,| /m,n4=42;function*r4(e){let t=[];if(typeof e!="string"){for(let a=0;a=3&&t.push({type:"emoji",shortcode:f[1],url:f[2]})}e=e.content}let r=e.length,n=0,i=0;e:for(;i=0&&fi4,channelHideMessageEvent:()=>c4,channelMessageEvent:()=>a4,channelMetadataEvent:()=>s4,channelMuteUserEvent:()=>l4});var i4=(e,t)=>{let r;if(typeof e.content=="object")r=JSON.stringify(e.content);else if(typeof e.content=="string")r=e.content;else return;return yt({kind:Mc,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},s4=(e,t)=>{let r;if(typeof e.content=="object")r=JSON.stringify(e.content);else if(typeof e.content=="string")r=e.content;else return;return yt({kind:Dc,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},a4=(e,t)=>{let r=[["e",e.channel_create_event_id,e.relay_url,"root"]];return e.reply_to_channel_message_event_id&&r.push(["e",e.reply_to_channel_message_event_id,e.relay_url,"reply"]),yt({kind:Bc,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},c4=(e,t)=>{let r;if(typeof e.content=="object")r=JSON.stringify(e.content);else if(typeof e.content=="string")r=e.content;else return;return yt({kind:Fc,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},l4=(e,t)=>{let r;if(typeof e.content=="object")r=JSON.stringify(e.content);else if(typeof e.content=="string")r=e.content;else return;return yt({kind:jc,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)},u4={};xe(u4,{EMOJI_SHORTCODE_REGEX:()=>gl,matchAll:()=>h4,regex:()=>Hi,replaceAll:()=>f4});var gl=/:(\w+):/,Hi=()=>new RegExp(`\\B${gl.source}\\B`,"g");function*h4(e){let t=e.matchAll(Hi());for(let r of t)try{let[n,i]=r;yield{shortcode:n,name:i,start:r.index,end:r.index+n.length}}catch{}}function f4(e,t){return e.replaceAll(Hi(),(r,n)=>t({shortcode:r,name:n}))}var d4={};xe(d4,{useFetchImplementation:()=>p4,validateGithub:()=>y4});var $i;try{$i=fetch}catch{}function p4(e){$i=e}async function y4(e,t,r){try{return await(await $i(`https://gist.github.com/${t}/${r}/raw`)).text()===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}}var g4={};xe(g4,{makeNwcRequestEvent:()=>w4,parseConnectionString:()=>b4});function b4(e){let{host:t,pathname:r,searchParams:n}=new URL(e),i=r||t,a=n.get("relay"),f=n.get("secret");if(!i||!a||!f)throw new Error("invalid connection string");return{pubkey:i,relay:a,secret:f}}async function w4(e,t,r){let i=Jc(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),a={kind:Gc,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",e]]};return yt(a,t)}var m4={};xe(m4,{normalizeIdentifier:()=>v4});function v4(e){return e=e.trim().toLowerCase(),e=e.normalize("NFKC"),Array.from(e).map(t=>/\p{Letter}/u.test(t)||/\p{Number}/u.test(t)?t:"-").join("")}var E4={};xe(E4,{getSatoshisAmountFromBolt11:()=>O4,getZapEndpoint:()=>C4,makeZapReceipt:()=>T4,makeZapRequest:()=>A4,useFetchImplementation:()=>_4,validateZapRequest:()=>S4});var Gi;try{Gi=fetch}catch{}function _4(e){Gi=e}async function C4(e){try{let t="",{lud06:r,lud16:n}=JSON.parse(e.content);if(n){let[f,b]=n.split("@");t=new URL(`/.well-known/lnurlp/${f}`,`https://${b}`).toString()}else if(r){let{words:f}=Sn.decode(r,1e3),b=Sn.fromWords(f);t=Rt.decode(b)}else return null;let a=await(await Gi(t)).json();if(a.allowsNostr&&a.nostrPubkey)return a.callback}catch{}return null}function A4(e){let t={kind:9734,created_at:Math.round(Date.now()/1e3),content:e.comment||"",tags:[["p","pubkey"in e?e.pubkey:e.event.pubkey],["amount",e.amount.toString()],["relays",...e.relays]]};if("event"in e){if(t.tags.push(["e",e.event.id]),Ti(e.event.kind)){let r=["a",`${e.event.kind}:${e.event.pubkey}:`];t.tags.push(r)}else if(Oi(e.event.kind)){let r=e.event.tags.find(([i,a])=>i==="d"&&a);if(!r)throw new Error("d tag not found or is empty");let n=["a",`${e.event.kind}:${e.event.pubkey}:${r[1]}`];t.tags.push(n)}t.tags.push(["k",e.event.kind.toString()])}return t}function S4(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!Ci(t))return"Zap request is not a valid Nostr event.";if(!Qr(t))return"Invalid signature on zap request.";let r=t.tags.find(([a,f])=>a==="p"&&f);if(!r)return"Zap request doesn't have a 'p' tag.";if(!r[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let n=t.tags.find(([a,f])=>a==="e"&&f);return n&&!n[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":t.tags.find(([a,f])=>a==="relays"&&f)?null:"Zap request doesn't have a 'relays' tag."}function T4({zapRequest:e,preimage:t,bolt11:r,paidAt:n}){let i=JSON.parse(e),a=i.tags.filter(([b])=>b==="e"||b==="p"||b==="a"),f={kind:9735,created_at:Math.round(n.getTime()/1e3),content:"",tags:[...a,["P",i.pubkey],["bolt11",r],["description",e]]};return t&&f.tags.push(["preimage",t]),f}function O4(e){if(e.length<50)return 0;e=e.substring(0,50);let t=e.lastIndexOf("1");if(t===-1)return 0;let r=e.substring(0,t);if(!r.startsWith("lnbc"))return 0;let n=r.substring(4);if(n.length<1)return 0;let i=n[n.length-1],a=i.charCodeAt(0)-48,f=a>=0&&a<=9,b=n.length-1;if(f&&b++,b<1)return 0;let o=parseInt(n.substring(0,b));switch(i){case"m":return o*1e5;case"u":return o*100;case"n":return o/10;case"p":return o/1e4;default:return o*1e8}}var N4={};xe(N4,{Negentropy:()=>wl,NegentropyStorageVector:()=>I4,NegentropySync:()=>P4});var jo=97,Cn=32,bl=16,en={Skip:0,Fingerprint:1,IdList:2},Nt=class{constructor(e){J(this,"_raw");J(this,"length");typeof e=="number"?(this._raw=new Uint8Array(e),this.length=0):e instanceof Uint8Array?(this._raw=new Uint8Array(e),this.length=e.length):(this._raw=new Uint8Array(512),this.length=0)}unwrap(){return this._raw.subarray(0,this.length)}get capacity(){return this._raw.byteLength}extend(e){if(e instanceof Nt&&(e=e.unwrap()),typeof e.length!="number")throw Error("bad length");let t=e.length+this.length;if(this.capacity>>=7;t.reverse();for(let r=0;r4294967295&&(r=1),n.setUint32(f,p&4294967295,!0),t=r,r=0}}negate(){let e=new DataView(this.buf.buffer);for(let r=0;r<8;r++){let n=r*4;e.setUint32(n,~e.getUint32(n,!0))}let t=new Uint8Array(Cn);t[0]=1,this.add(t)}getFingerprint(e){let t=new Nt;return t.extend(this.buf),t.extend(Ot(e)),vt(t.unwrap()).subarray(0,bl)}},I4=class{constructor(){J(this,"items");J(this,"sealed");this.items=[],this.sealed=!1}insert(e,t){if(this.sealed)throw Error("already sealed");let r=_e(t);if(r.byteLength!==Cn)throw Error("bad id size for added item");this.items.push({timestamp:e,id:r})}seal(){if(this.sealed)throw Error("already sealed");this.sealed=!0,this.items.sort(Ho);for(let e=1;e=this.items.length)throw Error("out of range");return this.items[e]}iterate(e,t,r){this._checkSealed(),this._checkBounds(e,t);for(let n=e;nHo(n,r)<0)}fingerprint(e,t){let r=new R4;return r.setToZero(),this.iterate(e,t,n=>(r.add(n.id),!0)),r.getFingerprint(t-e)}_checkSealed(){if(!this.sealed)throw Error("not sealed")}_checkBounds(e,t){if(e>t||t>this.items.length)throw Error("bad range")}_binarySearch(e,t,r,n){let i=r-t;for(;i>0;){let a=t,f=Math.floor(i/2);a+=f,n(e[a])?(t=++a,i-=f+1):i=f}return t}},wl=class{constructor(e,t=6e4){J(this,"storage");J(this,"frameSizeLimit");J(this,"lastTimestampIn");J(this,"lastTimestampOut");if(t<4096)throw Error("frameSizeLimit too small");this.storage=e,this.frameSizeLimit=t,this.lastTimestampIn=0,this.lastTimestampOut=0}_bound(e,t){return{timestamp:e,id:t||new Uint8Array(0)}}initiate(){let e=new Nt;return e.extend(new Uint8Array([jo])),this.splitRange(0,this.storage.size(),this._bound(Number.MAX_VALUE),e),Oe(e.unwrap())}reconcile(e,t,r){let n=new Nt(_e(e));this.lastTimestampIn=this.lastTimestampOut=0;let i=new Nt;i.extend(new Uint8Array([jo]));let a=x4(n);if(a<96||a>111)throw Error("invalid negentropy protocol version byte");if(a!==jo)throw Error("unsupported negentropy protocol version requested: "+(a-96));let f=this.storage.size(),b=this._bound(0),o=0,p=!1;for(;n.length!==0;){let d=new Nt,h=()=>{p&&(p=!1,d.extend(this.encodeBound(b)),d.extend(Ot(en.Skip)))},u=this.decodeBound(n),c=Sr(n),s=o,l=this.storage.findLowerBound(o,f,u);if(c===en.Skip)p=!0;else if(c===en.Fingerprint){let g=xr(n,bl),w=this.storage.fingerprint(s,l);ml(g,w)!==0?(h(),this.splitRange(s,l,u,d)):p=!0}else if(c===en.IdList){let g=Sr(n),w={};for(let y=0;y{let v=y.id,m=Oe(v);return w[m]?delete w[Oe(v)]:t?.(m),!0}),r)for(let y of Object.values(w))r(Oe(y))}else throw Error("unexpected mode");if(this.exceededFrameSizeLimit(i.length+d.length)){let g=this.storage.fingerprint(l,f);i.extend(this.encodeBound(this._bound(Number.MAX_VALUE))),i.extend(Ot(en.Fingerprint)),i.extend(g);break}else i.extend(d);o=l,b=u}return i.length===1?null:Oe(i.unwrap())}splitRange(e,t,r,n){let i=t-e,a=16;if(i(n.extend(f.id),!0));else{let f=Math.floor(i/a),b=i%a,o=e;for(let p=0;p(g===o-1?c=l:s=l,!0)),u=this.getMinimalBound(c,s)}n.extend(this.encodeBound(u)),n.extend(Ot(en.Fingerprint)),n.extend(h)}}}exceededFrameSizeLimit(e){return e>this.frameSizeLimit-200}decodeTimestampIn(e){let t=Sr(e);return t=t===0?Number.MAX_VALUE:t-1,this.lastTimestampIn===Number.MAX_VALUE||t===Number.MAX_VALUE?(this.lastTimestampIn=Number.MAX_VALUE,Number.MAX_VALUE):(t+=this.lastTimestampIn,this.lastTimestampIn=t,t)}decodeBound(e){let t=this.decodeTimestampIn(e),r=Sr(e);if(r>Cn)throw Error("bound key too long");let n=xr(e,r);return{timestamp:t,id:n}}encodeTimestampOut(e){if(e===Number.MAX_VALUE)return this.lastTimestampOut=Number.MAX_VALUE,Ot(0);let t=e;return e-=this.lastTimestampOut,this.lastTimestampOut=t,Ot(e+1)}encodeBound(e){let t=new Nt;return t.extend(this.encodeTimestampOut(e.timestamp)),t.extend(Ot(e.id.length)),t.extend(e.id),t}getMinimalBound(e,t){if(t.timestamp!==e.timestamp)return this._bound(t.timestamp);{let r=0,n=t.id,i=e.id;for(let a=0;at[r])return 1}return e.byteLength>t.byteLength?1:e.byteLength{switch(i[0]){case"NEG-MSG":{i.length<3&&console.warn(`got invalid NEG-MSG from ${this.relay.url}: ${i}`);try{let a=this.neg.reconcile(i[2],this.onhave,this.onneed);a?this.relay.send(`["NEG-MSG", "${this.subscription.id}", "${a}"]`):(this.close(),n.onclose?.())}catch(a){console.error("negentropy reconcile error:",a),n?.onclose?.(`reconcile error: ${a}`)}break}case"NEG-CLOSE":{let a=i[2];console.warn("negentropy error:",a),n.onclose?.(a);break}case"NEG-ERR":n.onclose?.()}}}async start(){let e=this.neg.initiate();this.relay.send(`["NEG-OPEN","${this.subscription.id}",${JSON.stringify(this.filter)},"${e}"]`)}close(){this.relay.send(`["NEG-CLOSE","${this.subscription.id}"]`),this.subscription.close()}},k4={};xe(k4,{getToken:()=>L4,hashPayload:()=>Wi,unpackEventFromToken:()=>El,validateEvent:()=>Ol,validateEventKind:()=>Cl,validateEventMethodTag:()=>Sl,validateEventPayloadTag:()=>Tl,validateEventTimestamp:()=>_l,validateEventUrlTag:()=>Al,validateToken:()=>U4});var vl="Nostr ";async function L4(e,t,r,n=!1,i){let a={kind:Ii,tags:[["u",e],["method",t]],created_at:Math.round(new Date().getTime()/1e3),content:""};i&&a.tags.push(["payload",Wi(i)]);let f=await r(a);return(n?vl:"")+Ft.encode(ut.encode(JSON.stringify(f)))}async function U4(e,t,r){let n=await El(e).catch(a=>{throw a});return await Ol(n,t,r).catch(a=>{throw a})}async function El(e){if(!e)throw new Error("Missing token");e=e.replace(vl,"");let t=Rt.decode(Ft.decode(e));if(!t||t.length===0||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)}function _l(e){return e.created_at?Math.round(new Date().getTime()/1e3)-e.created_at<60:!1}function Cl(e){return e.kind===Ii}function Al(e,t){let r=e.tags.find(n=>n[0]==="u");return r?r.length>0&&r[1]===t:!1}function Sl(e,t){let r=e.tags.find(n=>n[0]==="method");return r?r.length>0&&r[1].toLowerCase()===t.toLowerCase():!1}function Wi(e){let t=vt(ut.encode(JSON.stringify(e)));return Oe(t)}function Tl(e,t){let r=e.tags.find(i=>i[0]==="payload");if(!r)return!1;let n=Wi(t);return r.length>0&&r[1]===n}async function Ol(e,t,r,n){if(!Qr(e))throw new Error("Invalid nostr event, signature invalid");if(!Cl(e))throw new Error("Invalid nostr event, kind invalid");if(!_l(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!Al(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!Sl(e,r))throw new Error("Invalid nostr event, method tag invalid");if(n&&typeof n=="object"&&Object.keys(n).length>0&&!Tl(e,n))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0}var Et=class extends Error{constructor(t,r){super(t),this.code=r}},Fr=class extends Et{},ai=class extends Et{},jr=class extends Et{},Hr=class extends jr{},$r=class extends jr{},Gr=class extends Et{},Wr=class extends Et{},Vn=class extends Et{},ci=class extends Et{},li=class extends Et{};function Tr(e){try{e.indexOf("://")===-1&&(e="wss://"+e);let t=new URL(e);return t.protocol==="http:"?t.protocol="ws:":t.protocol==="https:"&&(t.protocol="wss:"),t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),(t.port==="80"&&t.protocol==="ws:"||t.port==="443"&&t.protocol==="wss:")&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}catch{throw new Error(`Invalid URL: ${e}`)}}var M4=1e3,D4=300*1e3,B4=1e3,Kr=class{constructor(){this.relays=new Map,this.enablePing=!1,this.maxWaitForConnection=3e3}async ensureRelay(t,r){t=Tr(t);let n=this.relays.get(t);n||(n=new zc(t,{enablePing:this.enablePing,enableReconnect:!1}),n.onclose=()=>{this.relays.delete(t)},this.relays.set(t,n));try{await n.connect({timeout:r?.connectionTimeout,abort:r?.abort})}catch(i){throw this.relays.delete(t),i}return n}close(t){t.map(Tr).forEach(r=>{this.relays.get(r)?.close(),this.relays.delete(r)})}subscribe(t,r,n){let i=[],a=new Set;for(let c of t){let s=Tr(c);a.has(s)||(a.add(s),i.push(s))}let f=!1,b=new Map,o=new Set,p=new Set,d=c=>{if(p.has(c))return!0;if(p.add(c),p.size>B4){let s=p.values().next().value;s!==void 0&&p.delete(s)}return!1},h=c=>{if(f)return Promise.resolve();let s=Math.min(M4*2**c,D4);return new Promise(l=>{let g=setTimeout(()=>{o.delete(w),l()},s),w=()=>{clearTimeout(g),o.delete(w),l()};o.add(w)})},u=async c=>{let s=0;for(;!f;){let l;try{l=await this.ensureRelay(c,{connectionTimeout:this.maxWaitForConnection,abort:n.abort})}catch(w){if(f)return;let y=w?.message||String(w);n.ondisconnect?.(c,y),await h(s++);continue}if(f)return;n.onconnect?.(c),s=0;let g=await new Promise(w=>{let y=l.subscribe([r],{eoseTimeout:1,onevent:n.onevent,onclose:w,abort:n.abort,alreadyHaveEvent:d});b.set(c,y)});if(b.delete(c),f)return;n.ondisconnect?.(c,g),await h(s++)}};return i.forEach(c=>{u(c)}),{close(c){f||(f=!0,o.forEach(s=>s()),o.clear(),b.forEach(s=>s.close(c)),b.clear())}}}publish(t,r,n){return t.map(Tr).map(async(i,a,f)=>{if(f.indexOf(i)!==a)return Promise.reject("duplicate url");let b;try{b=await this.ensureRelay(i,{connectionTimeout:this.maxWaitForConnection,abort:n?.abort})}catch(o){return"connection failure: "+String(o)}return b.publish(r)})}listConnectionStatus(){let t=new Map;return this.relays.forEach((r,n)=>t.set(n,r.connected)),t}destroy(){this.relays.forEach(t=>t.close()),this.relays=new Map}},Ba=/^[0-9a-f]{64}$/,jt=class e{static parseWalletConnectUrl(t,r=!1){t=t.replace("nostrwalletconnect://","http://").replace("nostr+walletconnect://","http://").replace("nostrwalletconnect:","http://").replace("nostr+walletconnect:","http://");let n=new URL(t),i=n.searchParams.getAll("relay"),a={walletPubkey:n.host,relayUrls:i},f=n.searchParams.get("secret");f&&(a.secret=f);let b=n.searchParams.get("lud16");if(b&&(a.lud16=b),!a.walletPubkey)throw new Error("Invalid NWC URL: missing wallet pubkey");if(!Ba.test(a.walletPubkey))throw new Error("Invalid NWC URL: invalid wallet pubkey");if(!a.relayUrls?.length)throw new Error("Invalid NWC URL: no relay URLs provided");for(let o of a.relayUrls)try{new URL(o)}catch{throw new Error(`Invalid relay URL: ${o}`)}if(r&&!a.secret)throw new Error("Invalid NWC URL: missing secret parameter");if(a.secret&&!Ba.test(a.secret))throw new Error("Invalid NWC URL: invalid secret");return a}constructor(t){t&&t.nostrWalletConnectUrl&&(t={...e.parseWalletConnectUrl(t.nostrWalletConnectUrl,t.requireSecret),...t}),this.options={...t||{}},this.relayUrls=this.options.relayUrls,this.logger=t?.logger||$a,this.pool=new Kr,this.options.secret&&(this.secret=this.options.secret.toLowerCase().startsWith("nsec")?ii.decode(this.options.secret).data:this.options.secret),this.lud16=this.options.lud16,this.walletPubkey=this.options.walletPubkey.toLowerCase().startsWith("npub")?ii.decode(this.options.walletPubkey).data:this.options.walletPubkey}get nostrWalletConnectUrl(){return this.getNostrWalletConnectUrl()}getNostrWalletConnectUrl(t=!0){let r=`nostr+walletconnect://${this.walletPubkey}?relay=${this.relayUrls.join("&relay=")}&pubkey=${this.publicKey}`;return t&&(r=`${r}&secret=${this.secret}`),this.lud16&&(r=`${r}&lud16=${this.lud16}`),r}get connected(){let t=Array.from(this.pool.listConnectionStatus().values());return!!t.length&&t.includes(!0)}get publicKey(){if(!this.secret)throw new Error("Missing secret key");return On(_e(this.secret))}get encryptionType(){if(!this._encryptionType)throw new Error("Missing encryption or version");return this._encryptionType}getPublicKey(){return Promise.resolve(this.publicKey)}signEvent(t){if(!this.secret)throw new Error("Missing secret key");return Promise.resolve(yt(t,_e(this.secret)))}getEventHash(t){return Kn(t)}close(){return this.pool.close(this.relayUrls)}async encrypt(t,r){if(!this.secret)throw new Error("Missing secret");let n;if(this.encryptionType==="nip04")n=await si.encrypt(this.secret,t,r);else{let i=Gn.getConversationKey(_e(this.secret),t);n=Gn.encrypt(r,i)}return n}async decrypt(t,r){if(!this.secret)throw new Error("Missing secret");let n;if(this.encryptionType==="nip04")n=await si.decrypt(this.secret,t,r);else{let i=Gn.getConversationKey(_e(this.secret),t);n=Gn.decrypt(r,i)}return n}static getAuthorizationUrl(t,r={},n){if(t.indexOf("/#/")>-1)throw new Error("hash router paths not supported");let i=new URL(t);return r.name&&i.searchParams.set("name",r.name),i.searchParams.set("pubkey",n),r.returnTo&&i.searchParams.set("return_to",r.returnTo),r.budgetRenewal&&i.searchParams.set("budget_renewal",r.budgetRenewal),r.expiresAt&&i.searchParams.set("expires_at",Math.floor(r.expiresAt.getTime()/1e3).toString()),r.maxAmount&&i.searchParams.set("max_amount",r.maxAmount.toString()),r.requestMethods&&i.searchParams.set("request_methods",r.requestMethods.join(" ")),r.notificationTypes&&i.searchParams.set("notification_types",r.notificationTypes.join(" ")),r.isolated&&i.searchParams.set("isolated","true"),r.metadata&&i.searchParams.set("metadata",JSON.stringify(r.metadata)),i}static fromAuthorizationUrl(t,r={},n){n=n||Oe(Si()),r.name||(r.name=document.location.host);let i=this.getAuthorizationUrl(t,r,On(_e(n))),a=600,f=400,b=window.outerHeight/2+window.screenY-a/2,o=window.outerWidth/2+window.screenX-f/2;return new Promise((p,d)=>{let h=window.open(i.toString(),`${document.title} - Wallet Connect`,`height=${a},width=${f},top=${b},left=${o}`);if(!h){d(new Error("failed to execute window.open"));return}let u=()=>{h&&h.closed&&(clearInterval(s),window.removeEventListener("message",c),d(new Error("Popup closed")))},c=l=>{let g=l.data;if(g&&g.type==="nwc:success"&&l.origin===`${i.protocol}//${i.host}`){if(!g.relayUrls&&g.relayUrl&&(g.relayUrls=[g.relayUrl]),!g.relayUrls){d(new Error("no relayUrls or relayUrl in response"));return}if(!g.walletPubkey){d(new Error("no walletPubkey in response"));return}p(new e({relayUrls:g.relayUrls,walletPubkey:g.walletPubkey,secret:n,lud16:g.lud16})),clearInterval(s),window.removeEventListener("message",c),h&&h.close()}},s=setInterval(u,500);window.addEventListener("message",c)})}async getWalletServiceInfo(){await this._checkConnected();let t=await new Promise((b,o)=>{let p=!1,d=setTimeout(()=>{p||(p=!0,h.close(),o(new Error("no info event (kind 13194) returned from relay")))},1e4),h=this.pool.subscribe(this.relayUrls,{kinds:[13194],limit:1,authors:[this.walletPubkey]},{onevent:u=>{p||(p=!0,clearTimeout(d),h.close(),b(u))}})}),r=t.content,n=t.tags.find(b=>b[0]==="notifications"),i=t.tags.find(b=>b[0]==="v"),a=t.tags.find(b=>b[0]==="encryption"),f=["nip04"];return i&&i[1].includes("1.0")&&f.push("nip44_v2"),a&&(f=a[1].split(" ")),{encryptions:f,capabilities:r.split(/[ |,]/g),notifications:n?.[1]?.split(" ")||[]}}async getInfo(){try{return await this.executeNip47Request("get_info",{},r=>!!r.methods,{replyTimeout:1e4})}catch(t){throw console.error("Failed to request get_info",t),t}}async getBudget(){try{return await this.executeNip47Request("get_budget",{},r=>r!==void 0,{replyTimeout:1e4})}catch(t){throw console.error("Failed to request get_budget",t),t}}async getBalance(){try{return await this.executeNip47Request("get_balance",{},r=>r.balance!==void 0,{replyTimeout:1e4})}catch(t){throw console.error("Failed to request get_balance",t),t}}async payInvoice(t){try{return await this.executeNip47Request("pay_invoice",t,n=>!!n)}catch(r){throw console.error("Failed to request pay_invoice",r),r}}async payKeysend(t){try{return await this.executeNip47Request("pay_keysend",t,n=>!!n.preimage)}catch(r){throw console.error("Failed to request pay_keysend",r),r}}async signMessage(t){try{return await this.executeNip47Request("sign_message",t,n=>n.message===t.message&&!!n.signature)}catch(r){throw console.error("Failed to request sign_message",r),r}}async createConnection(t){try{return await this.executeNip47Request("create_connection",t,n=>!!n.wallet_pubkey)}catch(r){throw console.error("Failed to request create_connection",r),r}}async multiPayInvoice(t){try{return{invoices:await this.executeMultiNip47Request("multi_pay_invoice",t,t.invoices.length,n=>!!n.preimage),errors:[]}}catch(r){throw console.error("Failed to request multi_pay_invoice",r),r}}async multiPayKeysend(t){try{return{keysends:await this.executeMultiNip47Request("multi_pay_keysend",t,t.keysends.length,n=>!!n.preimage),errors:[]}}catch(r){throw console.error("Failed to request multi_pay_keysend",r),r}}async makeInvoice(t){try{if(!t.amount)throw new Error("No amount specified");return await this.executeNip47Request("make_invoice",t,n=>!!n.invoice)}catch(r){throw console.error("Failed to request make_invoice",r),r}}async makeHoldInvoice(t){try{if(!t.amount)throw new Error("No amount specified");if(!t.payment_hash)throw new Error("No payment hash specified");return await this.executeNip47Request("make_hold_invoice",t,n=>!!n.invoice)}catch(r){throw console.error("Failed to request make_hold_invoice",r),r}}async settleHoldInvoice(t){try{return await this.executeNip47Request("settle_hold_invoice",t,n=>!!n)}catch(r){throw console.error("Failed to request settle_hold_invoice",r),r}}async cancelHoldInvoice(t){try{return await this.executeNip47Request("cancel_hold_invoice",t,n=>!!n)}catch(r){throw console.error("Failed to request cancel_hold_invoice",r),r}}async lookupInvoice(t){try{return await this.executeNip47Request("lookup_invoice",t,n=>!!n.invoice)}catch(r){throw console.error("Failed to request lookup_invoice",r),r}}async listTransactions(t){try{return await this.executeNip47Request("list_transactions",t,n=>!!n.transactions,{replyTimeout:1e4})}catch(r){throw console.error("Failed to request list_transactions",r),r}}async subscribeNotifications(t,r){this.logger.debug("checking connection to relays"),await this._checkConnected(),await this._selectEncryptionType(),this.logger.debug("subscribing to relays");let n=this.pool.subscribe(this.relayUrls,{kinds:[...this.encryptionType==="nip04"?[23196]:[23197]],authors:[this.walletPubkey],"#p":[this.publicKey]},{onevent:async i=>{let a;try{a=await this.decrypt(this.walletPubkey,i.content)}catch(b){console.error("failed to decrypt request event content",b);return}let f;try{f=JSON.parse(a)}catch(b){console.error("Failed to parse decrypted event content",b);return}f.notification?(!r||r.indexOf(f.notification_type)>-1)&&t(f):console.error("No notification in response",f)},onconnect:i=>{this.logger.debug("relay connected",i)},ondisconnect:(i,a)=>{this.logger.debug("relay disconnected",i,a)}});return this.logger.debug("subscribed to relays"),()=>{n?.close()}}async executeNip47Request(t,r,n,i){return await this._checkConnected(),await this._selectEncryptionType(),new Promise((a,f)=>{(async()=>{let b={method:t,params:r},o=await this.encrypt(this.walletPubkey,JSON.stringify(b)),p={kind:23194,created_at:Math.floor(Date.now()/1e3),tags:[["p",this.walletPubkey],["v",this.encryptionType==="nip44_v2"?"1.0":"0.0"],["encryption",this.encryptionType]],content:o},d=await this.signEvent(p),h=this.pool.subscribe(this.relayUrls,{kinds:[23195],authors:[this.walletPubkey],"#e":[d.id]},{onevent:async g=>{clearTimeout(c),h.close();let w=await this.decrypt(this.walletPubkey,g.content),y;try{y=JSON.parse(w)}catch{clearTimeout(c),h.close(),f(new Wr("failed to deserialize response","INTERNAL"));return}y.result?n(y.result)?a(y.result):(clearTimeout(c),h.close(),f(new Vn("response from NWC failed validation: "+JSON.stringify(y.result),"INTERNAL"))):(clearTimeout(c),h.close(),f(new ai(y.error?.message||"unknown Error",y.error?.code||"INTERNAL")))}});function u(){h.close(),f(new $r(`reply timeout: event ${d.id}`,"INTERNAL"))}let c=setTimeout(u,i?.replyTimeout||6e4);function s(){h.close(),f(new Hr(`publish timeout: ${d.id}`,"INTERNAL"))}let l=setTimeout(s,i?.publishTimeout||5e3);try{await Promise.any(this.pool.publish(this.relayUrls,d)),clearTimeout(l)}catch(g){clearTimeout(l),f(new Gr(`failed to publish: ${g}`,"INTERNAL"))}})()})}async executeMultiNip47Request(t,r,n,i,a){await this._checkConnected(),await this._selectEncryptionType();let f=[];return new Promise((b,o)=>{(async()=>{let p={method:t,params:r},d=await this.encrypt(this.walletPubkey,JSON.stringify(p)),h={kind:23194,created_at:Math.floor(Date.now()/1e3),tags:[["p",this.walletPubkey],["v",this.encryptionType==="nip44_v2"?"1.0":"0.0"],["encryption",this.encryptionType]],content:d},u=await this.signEvent(h),c=this.pool.subscribe(this.relayUrls,{kinds:[23195],authors:[this.walletPubkey],"#e":[u.id]},{onevent:async y=>{let v=await this.decrypt(this.walletPubkey,y.content),m;try{m=JSON.parse(v)}catch{clearTimeout(l),c.close(),o(new Wr("failed to deserialize response","INTERNAL"))}if(m.result){if(!i(m.result)){clearTimeout(l),c.close(),o(new Vn("Response from NWC failed validation: "+JSON.stringify(m.result),"INTERNAL"));return}let C=y.tags.find(E=>E[0]==="d")?.[1];if(C===void 0){clearTimeout(l),c.close(),o(new Vn("No d tag found in response event","INTERNAL"));return}f.push({...m.result,dTag:C}),f.length===n&&(clearTimeout(l),c.close(),b(f))}else clearTimeout(l),c.close(),o(new ci(m.error?.message,m.error?.code))}});function s(){c.close(),o(new $r(`reply timeout: event ${u.id}`,"INTERNAL"))}let l=setTimeout(s,a?.replyTimeout||6e4);function g(){c.close(),o(new Hr(`Publish timeout: ${u.id}`,"INTERNAL"))}let w=setTimeout(g,a?.publishTimeout||5e3);try{await Promise.any(this.pool.publish(this.relayUrls,u)),clearTimeout(w)}catch(y){clearTimeout(w),o(new Gr(`Failed to publish: ${y}`,"INTERNAL"))}})()})}async _checkConnected(){if(!this.secret)throw new Error("Missing secret key");if(!this.relayUrls)throw new Error("Missing relay url");try{await Promise.any(this.relayUrls.map(t=>this.pool.ensureRelay(t)))}catch(t){throw console.error("failed to connect to any relay",t),new Fr("Failed to connect to "+this.relayUrls.join(","),"OTHER")}}async _selectEncryptionType(){if(!this._encryptionType){let t=await this.getWalletServiceInfo(),r=this._findPreferredEncryptionType(t.encryptions);if(!r)throw new li("no compatible encryption or version found between wallet and client","UNSUPPORTED_ENCRYPTION");r==="nip04"&&console.warn("NIP-04 encryption is about to be deprecated. Please upgrade your wallet service to use NIP-44 instead."),this._encryptionType=r}}_findPreferredEncryptionType(t){return t.includes("nip44_v2")?"nip44_v2":t.includes("nip04")?"nip04":null}},F4={get_info:"getInfo",get_balance:"getBalance",make_invoice:"makeInvoice",pay_invoice:"sendPayment",pay_keysend:"payKeysend",lookup_invoice:"lookupInvoice",list_transactions:"listTransactions",multi_pay_invoice:"sendMultiPayment",multi_pay_keysend:"multiKeysend",sign_message:"signMessage"},Vr=class e{get options(){return this.client.options}static async fromAuthorizationUrl(t,r={},n){let i=await jt.fromAuthorizationUrl(t,r,n);return new e({client:i})}constructor(t){this._enabled=!1,this.client=t?.client||new jt(t),this.subscribers={}}on(t,r){this.subscribers[t]=r}notify(t,r){let n=this.subscribers[t];n&&n(r)}getPublicKey(){return this.client.getPublicKey()}signEvent(t){return this.client.signEvent(t)}async enable(){this._enabled=!0}close(){return this.client.close()}async getInfo(){await this.checkEnabled();let t=["lightning","nostr"],r="Alby JS SDK";try{let n=await this.client.getInfo(),i={methods:n.methods.map(a=>F4[a]),node:{alias:n.alias,pubkey:n.pubkey,color:n.color},supports:t,version:r};return this.notify("getInfo",i),i}catch(n){return console.error("Using minimal getInfo",n),{methods:["sendPayment"],node:{},supports:t,version:r}}}async getBalance(){await this.checkEnabled();let t=await this.client.getBalance(),r={balance:Math.floor(t.balance/1e3),currency:"sats"};return this.notify("getBalance",r),r}async sendPayment(t){await this.checkEnabled();let n={preimage:(await this.client.payInvoice({invoice:t})).preimage};return this.notify("sendPayment",n),n}async sendPaymentAsync(t){return await this.checkEnabled(),this.client.payInvoice({invoice:t}),this.notify("sendPaymentAsync",{}),{}}async keysend(t){await this.checkEnabled();let n={preimage:(await this.client.payKeysend(Fa(t))).preimage};return this.notify("keysend",n),n}async signMessage(t){await this.checkEnabled();let r=await this.client.signMessage({message:t}),n={message:r.message,signature:r.signature};return this.notify("keysend",n),n}async makeInvoice(t){await this.checkEnabled();let r=typeof t=="object"?t:void 0,n=+(r?.amount??t);if(!n)throw new Error("No amount specified");let a={paymentRequest:(await this.client.makeInvoice({amount:n*1e3,description:r?.defaultMemo})).invoice};return this.notify("makeInvoice",a),a}async lookupInvoice(t){await this.checkEnabled();let r=await this.client.lookupInvoice({invoice:t.paymentRequest,payment_hash:t.paymentHash}),n={preimage:r.preimage,paymentRequest:r.invoice,paid:!!r.settled_at};return this.notify("lookupInvoice",n),n}async listTransactions(t){await this.checkEnabled();let n={transactions:(await this.client.listTransactions(t)).transactions.map(j4)};return this.notify("listTransactions",n),n}async sendMultiPayment(t){await this.checkEnabled();let n={payments:(await this.client.multiPayInvoice({invoices:t.map((i,a)=>({invoice:i,id:a.toString()}))})).invoices.map(i=>{let a=t[parseInt(i.dTag)];if(!a)throw new Error("Could not find paymentRequest matching response d tag");return{paymentRequest:a,preimage:i.preimage}}),errors:[]};return this.notify("sendMultiPayment",n),n}async multiKeysend(t){await this.checkEnabled();let n={keysends:(await this.client.multiPayKeysend({keysends:t.map((i,a)=>({...Fa(i),id:a.toString()}))})).keysends.map(i=>{let a=t[parseInt(i.dTag)];if(!a)throw new Error("Could not find keysend matching response d tag");return{keysend:a,preimage:i.preimage}}),errors:[]};return this.notify("multiKeysend",n),n}lnurl(t){throw new Error("Method not implemented.")}request(t,r){throw new Error("Method not implemented.")}verifyMessage(t,r){throw new Error("Method not implemented.")}async checkEnabled(){if(!this._enabled)throw new Error("please call enable() and await the promise before calling this function")}};function j4(e){return{...e,amount:Math.floor(e.amount/1e3),fees_paid:e.fees_paid?Math.floor(e.fees_paid/1e3):0}}function Fa(e){return{amount:+e.amount*1e3,pubkey:e.destination,tlv_records:e.customRecords?Object.entries(e.customRecords).map(t=>({type:parseInt(t[0]),value:af(new TextEncoder().encode(t[1]))})):[]}}var Yn=class{constructor(t){if(this.appSecretKey=t.appSecretKey||Oe(Si()),this.options={...t,appPubkey:On(_e(this.appSecretKey))},!this.options.relayUrls)throw new Error("Missing relay urls");if(!this.options.requestMethods)throw new Error("Missing request methods");this.pool=new Kr,this.logger=t.logger||$a}get connectionUri(){return this.getConnectionUri()}getConnectionUri(t=""){let r=new URLSearchParams({request_methods:this.options.requestMethods.join(" "),...this.options.name?{name:this.options.name}:{},...this.options.icon?{icon:this.options.icon}:{},...this.options.returnTo?{return_to:this.options.returnTo}:{},...this.options.notificationTypes?{notification_types:this.options.notificationTypes.join(" ")}:{},...this.options.maxAmount?{max_amount:this.options.maxAmount.toString()}:{},...this.options.budgetRenewal?{budget_renewal:this.options.budgetRenewal}:{},...this.options.expiresAt?{expires_at:this.options.expiresAt.toString()}:{},...this.options.isolated?{isolated:this.options.isolated.toString()}:{},...this.options.metadata?{metadata:JSON.stringify(this.options.metadata)}:{}});for(let n of this.options.relayUrls)r.append("relay",n);return`nostr+walletauth${t?`+${t}`:""}://${this.options.appPubkey}?${r.toString().replace(/\+/g,"%20")}`}static parseWalletAuthUrl(t){if(!t.startsWith("nostr+walletauth"))throw new Error("Unexpected scheme. Should be nostr+walletauth:// or nostr+walletauth+specificapp://");let r=t.indexOf(":");t=t.substring(r+1),t.startsWith("//")&&(t=t.substring(2)),t="http://"+t;let n=new URL(t),i=n.host;if(i?.length!==64)throw new Error("Incorrect app pubkey found in auth string");let a=n.searchParams.getAll("relay");if(!a)throw new Error("No relay URL found in auth string");let f=n.searchParams.get("request_methods")?.split(" ");if(!f?.length)throw new Error("No request methods found in auth string");let b=n.searchParams.get("notification_types")?.split(" "),o=n.searchParams.get("max_amount"),p=n.searchParams.get("expires_at"),d=n.searchParams.get("metadata");return{name:n.searchParams.get("name")||void 0,icon:n.searchParams.get("icon")||void 0,returnTo:n.searchParams.get("return_to")||void 0,relayUrls:a,appPubkey:i,requestMethods:f,notificationTypes:b,budgetRenewal:n.searchParams.get("budget_renewal"),expiresAt:p?parseInt(p):void 0,maxAmount:o?parseInt(o):void 0,isolated:n.searchParams.get("isolated")==="true",metadata:d?JSON.parse(d):void 0}}async subscribe(t){this.logger.debug("checking connection to relays"),await this._checkConnected(),this.logger.debug("subscribing to info event");let r=this.pool.subscribe(this.options.relayUrls,{kinds:[13194],"#p":[this.options.appPubkey]},{onevent:async n=>{let i=new jt({relayUrls:this.options.relayUrls,secret:this.appSecretKey,walletPubkey:n.pubkey});try{let a=await i.getInfo();i.options.lud16=a.lud16,i.lud16=a.lud16}catch(a){console.error("failed to fetch get_info",a)}t.onSuccess(i),r?.close()},onconnect:n=>{this.logger.debug("relay connected",n)},ondisconnect:(n,i)=>{this.logger.debug("relay disconnected",n,i)}});return{unsub:()=>{r?.close()}}}close(){return this.pool.close(this.options.relayUrls)}async _checkConnected(){if(!this.appSecretKey)throw new Error("Missing secret key");if(!this.options.relayUrls)throw new Error("Missing relay urls");try{await Promise.any(this.options.relayUrls.map(t=>this.pool.ensureRelay(t)))}catch(t){throw console.error("failed to connect to any relay",t),new Fr("Failed to connect to "+this.options.relayUrls.join(","),"OTHER")}}};var H4=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!H4)throw new Error("Non little-endian hardware is not supported");var $o={},ja;function $4(){return ja||(ja=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(A){if(!Number.isSafeInteger(A))throw new Error(`Wrong integer: ${A}`)}e.assertNumber=t;function r(...A){let T=(I,L)=>H=>I(L(H)),N=Array.from(A).reverse().reduce((I,L)=>I?T(I,L.encode):L.encode,void 0),x=A.reduce((I,L)=>I?T(I,L.decode):L.decode,void 0);return{encode:N,decode:x}}function n(A){return{encode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return T.map(N=>{if(t(N),N<0||N>=A.length)throw new Error(`Digit index outside alphabet: ${N} (alphabet: ${A.length})`);return A[N]})},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("alphabet.decode input should be array of strings");return T.map(N=>{if(typeof N!="string")throw new Error(`alphabet.decode: not string element=${N}`);let x=A.indexOf(N);if(x===-1)throw new Error(`Unknown letter: "${N}". Allowed: ${A}`);return x})}}}function i(A=""){if(typeof A!="string")throw new Error("join separator should be string");return{encode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("join.encode input should be array of strings");for(let N of T)if(typeof N!="string")throw new Error(`join.encode: non-string input=${N}`);return T.join(A)},decode:T=>{if(typeof T!="string")throw new Error("join.decode input should be string");return T.split(A)}}}function a(A,T="="){if(t(A),typeof T!="string")throw new Error("padding chr should be string");return{encode(N){if(!Array.isArray(N)||N.length&&typeof N[0]!="string")throw new Error("padding.encode input should be array of strings");for(let x of N)if(typeof x!="string")throw new Error(`padding.encode: non-string input=${x}`);for(;N.length*A%8;)N.push(T);return N},decode(N){if(!Array.isArray(N)||N.length&&typeof N[0]!="string")throw new Error("padding.encode input should be array of strings");for(let I of N)if(typeof I!="string")throw new Error(`padding.decode: non-string input=${I}`);let x=N.length;if(x*A%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;x>0&&N[x-1]===T;x--)if(!((x-1)*A%8))throw new Error("Invalid padding: string has too much padding");return N.slice(0,x)}}}function f(A){if(typeof A!="function")throw new Error("normalize fn should be function");return{encode:T=>T,decode:T=>A(T)}}function b(A,T,N){if(T<2)throw new Error(`convertRadix: wrong from=${T}, base cannot be less than 2`);if(N<2)throw new Error(`convertRadix: wrong to=${N}, base cannot be less than 2`);if(!Array.isArray(A))throw new Error("convertRadix: data should be array");if(!A.length)return[];let x=0,I=[],L=Array.from(A);for(L.forEach(H=>{if(t(H),H<0||H>=T)throw new Error(`Wrong integer: ${H}`)});;){let H=0,Z=!0;for(let K=x;KT?o(T,A%T):A,p=(A,T)=>A+(T-o(A,T));function d(A,T,N,x){if(!Array.isArray(A))throw new Error("convertRadix2: data should be array");if(T<=0||T>32)throw new Error(`convertRadix2: wrong from=${T}`);if(N<=0||N>32)throw new Error(`convertRadix2: wrong to=${N}`);if(p(T,N)>32)throw new Error(`convertRadix2: carry overflow from=${T} to=${N} carryBits=${p(T,N)}`);let I=0,L=0,H=2**N-1,Z=[];for(let K of A){if(t(K),K>=2**T)throw new Error(`convertRadix2: invalid data word=${K} from=${T}`);if(I=I<32)throw new Error(`convertRadix2: carry overflow pos=${L} from=${T}`);for(L+=T;L>=N;L-=N)Z.push((I>>L-N&H)>>>0);I&=2**L-1}if(I=I<=T)throw new Error("Excess padding");if(!x&&I)throw new Error(`Non-zero padding: ${I}`);return x&&L>0&&Z.push(I>>>0),Z}function h(A){return t(A),{encode:T=>{if(!(T instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(T),2**8,A)},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(b(T,A,2**8))}}}function u(A,T=!1){if(t(A),A<=0||A>32)throw new Error("radix2: bits should be in (0..32]");if(p(8,A)>32||p(A,8)>32)throw new Error("radix2: carry overflow");return{encode:N=>{if(!(N instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(N),8,A,!T)},decode:N=>{if(!Array.isArray(N)||N.length&&typeof N[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(d(N,A,8,T))}}}function c(A){if(typeof A!="function")throw new Error("unsafeWrapper fn should be function");return function(...T){try{return A.apply(null,T)}catch{}}}function s(A,T){if(t(A),typeof T!="function")throw new Error("checksum fn should be function");return{encode(N){if(!(N instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let x=T(N).slice(0,A),I=new Uint8Array(N.length+A);return I.set(N),I.set(x,N.length),I},decode(N){if(!(N instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let x=N.slice(0,-A),I=T(x).slice(0,A),L=N.slice(-A);for(let H=0;HA.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=r(u(6),n("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a(6),i("")),e.base64url=r(u(6),n("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),i(""));let l=A=>r(h(58),n(A),i(""));e.base58=l("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=l("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=l("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");let g=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(A){let T="";for(let N=0;Nr(s(4,T=>A(A(T))),e.base58);e.base58check=w;let y=r(n("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),i("")),v=[996825010,642813549,513874426,1027748829,705979059];function m(A){let T=A>>25,N=(A&33554431)<<5;for(let x=0;x>x&1)===1&&(N^=v[x]);return N}function C(A,T,N=1){let x=A.length,I=1;for(let L=0;L126)throw new Error(`Invalid prefix (${A})`);I=m(I)^H>>5}I=m(I);for(let L=0;LV)throw new TypeError(`Length ${z} exceeds limit ${V}`);return B=B.toLowerCase(),`${B}1${y.encode(G)}${C(B,G,T)}`}function Z(B,G=90){if(typeof B!="string")throw new Error(`bech32.decode input should be string, not ${typeof B}`);if(B.length<8||G!==!1&&B.length>G)throw new TypeError(`Wrong string length: ${B.length} (${B}). Expected (8..${G})`);let V=B.toLowerCase();if(B!==V&&B!==B.toUpperCase())throw new Error("String must be lowercase or uppercase");B=V;let z=B.lastIndexOf("1");if(z===0||z===-1)throw new Error('Letter "1" must be present between prefix and data only');let U=B.slice(0,z),F=B.slice(z+1);if(F.length<6)throw new Error("Data must be at least 6 characters long");let D=y.decode(F).slice(0,-6),k=C(U,D,T);if(!F.endsWith(k))throw new Error(`Invalid checksum in ${B}: expected "${k}"`);return{prefix:U,words:D}}let K=c(Z);function P(B){let{prefix:G,words:V}=Z(B,!1);return{prefix:G,words:V,bytes:x(V)}}return{encode:H,decode:Z,decodeToBytes:P,decodeUnsafe:K,fromWords:x,fromWordsUnsafe:L,toWords:I}}e.bech32=E("bech32"),e.bech32m=E("bech32m"),e.utf8={encode:A=>new TextDecoder().decode(A),decode:A=>new TextEncoder().encode(A)},e.hex=r(u(4),n("0123456789abcdef"),i(""),f(A=>{if(typeof A!="string"||A.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof A} with length ${A.length}`);return A.toLowerCase()}));let O={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},_=`Invalid encoding type. Available types: ${Object.keys(O).join(", ")}`,S=(A,T)=>{if(typeof A!="string"||!O.hasOwnProperty(A))throw new TypeError(_);if(!(T instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return O[A].encode(T)};e.bytesToString=S,e.str=e.bytesToString;let R=(A,T)=>{if(!O.hasOwnProperty(A))throw new TypeError(_);if(typeof T!="string")throw new TypeError("stringToBytes() expects string");return O[A].decode(T)};e.stringToBytes=R,e.bytes=e.stringToBytes})($o)),$o}var Go,Ha;function G4(){if(Ha)return Go;Ha=1;let{bech32:e,hex:t,utf8:r}=$4(),n={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},i={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},a={bech32:"tbs",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},f={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},b={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},o=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],p={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},d=BigInt("2100000000000000000"),h=BigInt(1e11),u={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},c={};for(let C=0,E=Object.keys(u);Ct.encode(e.fromWordsUnsafe(C)),16:C=>t.encode(e.fromWordsUnsafe(C)),13:C=>r.encode(e.fromWordsUnsafe(C)),19:C=>t.encode(e.fromWordsUnsafe(C)),23:C=>t.encode(e.fromWordsUnsafe(C)),27:C=>t.encode(e.fromWordsUnsafe(C)),6:g,24:g,3:w,5:y};function l(C){return E=>({tagCode:parseInt(C),words:e.encode("unknown",E,Number.MAX_SAFE_INTEGER)})}function g(C){return C.reverse().reduce((E,O,_)=>E+O*Math.pow(32,_),0)}function w(C){let E=[],O,_,S,R,A,T=e.fromWordsUnsafe(C);for(;T.length>0;)O=t.encode(T.slice(0,33)),_=t.encode(T.slice(33,41)),S=parseInt(t.encode(T.slice(41,45)),16),R=parseInt(t.encode(T.slice(45,49)),16),A=parseInt(t.encode(T.slice(49,51)),16),T=T.slice(51),E.push({pubkey:O,short_channel_id:_,fee_base_msat:S,fee_proportional_millionths:R,cltv_expiry_delta:A});return E}function y(C){let E=C.slice().reverse().map(S=>[!!(S&1),!!(S&2),!!(S&4),!!(S&8),!!(S&16)]).reduce((S,R)=>S.concat(R),[]);for(;E.length{let A;E[R*2]?A="required":E[R*2+1]?A="supported":A="unsupported",O[S]=A});let _=E.slice(o.length*2);return O.extra_bits={start_bit:o.length*2,bits:_,has_required:_.reduce((S,R,A)=>A%2!==0?S||!1:S||R,!1)},O}function v(C,E){let O,_;if(C.slice(-1).match(/^[munp]$/))O=C.slice(-1),_=C.slice(0,-1);else{if(C.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");_=C}if(!_.match(/^\d+$/))throw new Error("Not a valid human readable amount");let S=BigInt(_),R=O?S*h/p[O]:S*h;if(O==="p"&&S%BigInt(10)!==BigInt(0)||R>d)throw new Error("Amount is outside of valid range");return E?R.toString():R}function m(C,E){if(typeof C!="string")throw new Error("Lightning Payment Request must be string");if(C.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");let O=[],_=e.decode(C,Number.MAX_SAFE_INTEGER);C=C.toLowerCase();let S=_.prefix,R=_.words,A=C.slice(S.length+1),T=R.slice(-104);R=R.slice(0,-104);let N=S.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(N&&!N[2]&&(N=S.match(/^ln(\S+)$/)),!N)throw new Error("Not a proper lightning payment request");O.push({name:"lightning_network",letters:"ln"});let x=N[1],I;if(E){if(E.bech32===void 0||E.pubKeyHash===void 0||E.scriptHash===void 0||!Array.isArray(E.validWitnessVersions))throw new Error("Invalid network");I=E}else switch(x){case n.bech32:I=n;break;case i.bech32:I=i;break;case a.bech32:I=a;break;case f.bech32:I=f;break;case b.bech32:I=b;break}if(!I||I.bech32!==x)throw new Error("Unknown coin bech32 prefix");O.push({name:"coin_network",letters:x,value:I});let L=N[2],H;if(L){let U=N[3];H=v(L+U,!0),O.push({name:"amount",letters:N[2]+N[3],value:H})}else H=null;O.push({name:"separator",letters:"1"});let Z=g(R.slice(0,7));R=R.slice(7),O.push({name:"timestamp",letters:A.slice(0,7),value:Z}),A=A.slice(7);let K,P,B,G;for(;R.length>0;){let U=R[0].toString();K=c[U]||"unknown_tag",P=s[U]||l(U),R=R.slice(1),B=g(R.slice(0,2)),R=R.slice(2),G=R.slice(0,B),R=R.slice(B),O.push({name:K,tag:A[0],letters:A.slice(0,3+B),value:P(G)}),A=A.slice(3+B)}O.push({name:"signature",letters:A.slice(0,104),value:t.encode(e.fromWordsUnsafe(T))}),A=A.slice(104),O.push({name:"checksum",letters:A});let V={paymentRequest:C,sections:O,get expiry(){let U=O.find(F=>F.name==="expiry");if(U)return z("timestamp")+U.value},get route_hints(){return O.filter(U=>U.name==="route_hint").map(U=>U.value)}};for(let U in u)U!=="route_hint"&&Object.defineProperty(V,U,{get(){return z(U)}});return V;function z(U){let F=O.find(D=>D.name===U);return F?F.value:void 0}}return Go={decode:m,hrpToMillisat:v},Go}var X5=G4();var Nl=e=>{let t,r=new Set,n=(p,d)=>{let h=typeof p=="function"?p(t):p;if(!Object.is(h,t)){let u=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(c=>c(t,u))}},i=()=>t,b={setState:n,getState:i,getInitialState:()=>o,subscribe:p=>(r.add(p),()=>r.delete(p))},o=t=e(n,i,b);return b},xl=(e=>e?Nl(e):Nl);function W4(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Rl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function K4(e,t){W4(e);let r=t.outputLen;if(e.lengthe instanceof Uint8Array,Ki=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),_t=(e,t)=>e<<32-t|e>>>t,V4=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!V4)throw new Error("Non little-endian hardware is not supported");var Z4=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Y4(e){if(!kl(e))throw new Error("Uint8Array expected");let t="";for(let r=0;re().update(Ll(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Q4(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),a=BigInt(4294967295),f=Number(r>>i&a),b=Number(r&a),o=n?4:0,p=n?0:4;e.setUint32(t+o,f,n),e.setUint32(t+p,b,n)}var qi=class extends Yi{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ki(this.buffer)}update(t){Rl(this);let{view:r,buffer:n,blockLen:i}=this;t=Ll(t);let a=t.length;for(let f=0;fi-f&&(this.process(n,0),f=0);for(let h=f;hd.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;he&t^~e&r,X4=(e,t,r)=>e&t^e&r^t&r,e3=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ht=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$t=new Uint32Array(64),zi=class extends qi{constructor(){super(64,32,8,!1),this.A=Ht[0]|0,this.B=Ht[1]|0,this.C=Ht[2]|0,this.D=Ht[3]|0,this.E=Ht[4]|0,this.F=Ht[5]|0,this.G=Ht[6]|0,this.H=Ht[7]|0}get(){let{A:t,B:r,C:n,D:i,E:a,F:f,G:b,H:o}=this;return[t,r,n,i,a,f,b,o]}set(t,r,n,i,a,f,b,o){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=a|0,this.F=f|0,this.G=b|0,this.H=o|0}process(t,r){for(let h=0;h<16;h++,r+=4)$t[h]=t.getUint32(r,!1);for(let h=16;h<64;h++){let u=$t[h-15],c=$t[h-2],s=_t(u,7)^_t(u,18)^u>>>3,l=_t(c,17)^_t(c,19)^c>>>10;$t[h]=l+$t[h-7]+s+$t[h-16]|0}let{A:n,B:i,C:a,D:f,E:b,F:o,G:p,H:d}=this;for(let h=0;h<64;h++){let u=_t(b,6)^_t(b,11)^_t(b,25),c=d+u+J4(b,o,p)+e3[h]+$t[h]|0,l=(_t(n,2)^_t(n,13)^_t(n,22))+X4(n,i,a)|0;d=p,p=o,o=b,b=f+c|0,f=a,a=i,i=n,n=c+l|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,f=f+this.D|0,b=b+this.E|0,o=o+this.F|0,p=p+this.G|0,d=d+this.H|0,this.set(n,i,a,f,b,o,p,d)}roundClean(){$t.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},t3=z4(()=>new zi),Vi={},Il;function n3(){return Il||(Il=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(A){if(!Number.isSafeInteger(A))throw new Error(`Wrong integer: ${A}`)}e.assertNumber=t;function r(...A){let T=(I,L)=>H=>I(L(H)),N=Array.from(A).reverse().reduce((I,L)=>I?T(I,L.encode):L.encode,void 0),x=A.reduce((I,L)=>I?T(I,L.decode):L.decode,void 0);return{encode:N,decode:x}}function n(A){return{encode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return T.map(N=>{if(t(N),N<0||N>=A.length)throw new Error(`Digit index outside alphabet: ${N} (alphabet: ${A.length})`);return A[N]})},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("alphabet.decode input should be array of strings");return T.map(N=>{if(typeof N!="string")throw new Error(`alphabet.decode: not string element=${N}`);let x=A.indexOf(N);if(x===-1)throw new Error(`Unknown letter: "${N}". Allowed: ${A}`);return x})}}}function i(A=""){if(typeof A!="string")throw new Error("join separator should be string");return{encode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("join.encode input should be array of strings");for(let N of T)if(typeof N!="string")throw new Error(`join.encode: non-string input=${N}`);return T.join(A)},decode:T=>{if(typeof T!="string")throw new Error("join.decode input should be string");return T.split(A)}}}function a(A,T="="){if(t(A),typeof T!="string")throw new Error("padding chr should be string");return{encode(N){if(!Array.isArray(N)||N.length&&typeof N[0]!="string")throw new Error("padding.encode input should be array of strings");for(let x of N)if(typeof x!="string")throw new Error(`padding.encode: non-string input=${x}`);for(;N.length*A%8;)N.push(T);return N},decode(N){if(!Array.isArray(N)||N.length&&typeof N[0]!="string")throw new Error("padding.encode input should be array of strings");for(let I of N)if(typeof I!="string")throw new Error(`padding.decode: non-string input=${I}`);let x=N.length;if(x*A%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;x>0&&N[x-1]===T;x--)if(!((x-1)*A%8))throw new Error("Invalid padding: string has too much padding");return N.slice(0,x)}}}function f(A){if(typeof A!="function")throw new Error("normalize fn should be function");return{encode:T=>T,decode:T=>A(T)}}function b(A,T,N){if(T<2)throw new Error(`convertRadix: wrong from=${T}, base cannot be less than 2`);if(N<2)throw new Error(`convertRadix: wrong to=${N}, base cannot be less than 2`);if(!Array.isArray(A))throw new Error("convertRadix: data should be array");if(!A.length)return[];let x=0,I=[],L=Array.from(A);for(L.forEach(H=>{if(t(H),H<0||H>=T)throw new Error(`Wrong integer: ${H}`)});;){let H=0,Z=!0;for(let K=x;KT?o(T,A%T):A,p=(A,T)=>A+(T-o(A,T));function d(A,T,N,x){if(!Array.isArray(A))throw new Error("convertRadix2: data should be array");if(T<=0||T>32)throw new Error(`convertRadix2: wrong from=${T}`);if(N<=0||N>32)throw new Error(`convertRadix2: wrong to=${N}`);if(p(T,N)>32)throw new Error(`convertRadix2: carry overflow from=${T} to=${N} carryBits=${p(T,N)}`);let I=0,L=0,H=2**N-1,Z=[];for(let K of A){if(t(K),K>=2**T)throw new Error(`convertRadix2: invalid data word=${K} from=${T}`);if(I=I<32)throw new Error(`convertRadix2: carry overflow pos=${L} from=${T}`);for(L+=T;L>=N;L-=N)Z.push((I>>L-N&H)>>>0);I&=2**L-1}if(I=I<=T)throw new Error("Excess padding");if(!x&&I)throw new Error(`Non-zero padding: ${I}`);return x&&L>0&&Z.push(I>>>0),Z}function h(A){return t(A),{encode:T=>{if(!(T instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(T),2**8,A)},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(b(T,A,2**8))}}}function u(A,T=!1){if(t(A),A<=0||A>32)throw new Error("radix2: bits should be in (0..32]");if(p(8,A)>32||p(A,8)>32)throw new Error("radix2: carry overflow");return{encode:N=>{if(!(N instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(N),8,A,!T)},decode:N=>{if(!Array.isArray(N)||N.length&&typeof N[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(d(N,A,8,T))}}}function c(A){if(typeof A!="function")throw new Error("unsafeWrapper fn should be function");return function(...T){try{return A.apply(null,T)}catch{}}}function s(A,T){if(t(A),typeof T!="function")throw new Error("checksum fn should be function");return{encode(N){if(!(N instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let x=T(N).slice(0,A),I=new Uint8Array(N.length+A);return I.set(N),I.set(x,N.length),I},decode(N){if(!(N instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let x=N.slice(0,-A),I=T(x).slice(0,A),L=N.slice(-A);for(let H=0;HA.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=r(u(6),n("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a(6),i("")),e.base64url=r(u(6),n("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),i(""));let l=A=>r(h(58),n(A),i(""));e.base58=l("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=l("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=l("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");let g=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(A){let T="";for(let N=0;Nr(s(4,T=>A(A(T))),e.base58);e.base58check=w;let y=r(n("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),i("")),v=[996825010,642813549,513874426,1027748829,705979059];function m(A){let T=A>>25,N=(A&33554431)<<5;for(let x=0;x>x&1)===1&&(N^=v[x]);return N}function C(A,T,N=1){let x=A.length,I=1;for(let L=0;L126)throw new Error(`Invalid prefix (${A})`);I=m(I)^H>>5}I=m(I);for(let L=0;LV)throw new TypeError(`Length ${z} exceeds limit ${V}`);return B=B.toLowerCase(),`${B}1${y.encode(G)}${C(B,G,T)}`}function Z(B,G=90){if(typeof B!="string")throw new Error(`bech32.decode input should be string, not ${typeof B}`);if(B.length<8||G!==!1&&B.length>G)throw new TypeError(`Wrong string length: ${B.length} (${B}). Expected (8..${G})`);let V=B.toLowerCase();if(B!==V&&B!==B.toUpperCase())throw new Error("String must be lowercase or uppercase");B=V;let z=B.lastIndexOf("1");if(z===0||z===-1)throw new Error('Letter "1" must be present between prefix and data only');let U=B.slice(0,z),F=B.slice(z+1);if(F.length<6)throw new Error("Data must be at least 6 characters long");let D=y.decode(F).slice(0,-6),k=C(U,D,T);if(!F.endsWith(k))throw new Error(`Invalid checksum in ${B}: expected "${k}"`);return{prefix:U,words:D}}let K=c(Z);function P(B){let{prefix:G,words:V}=Z(B,!1);return{prefix:G,words:V,bytes:x(V)}}return{encode:H,decode:Z,decodeToBytes:P,decodeUnsafe:K,fromWords:x,fromWordsUnsafe:L,toWords:I}}e.bech32=E("bech32"),e.bech32m=E("bech32m"),e.utf8={encode:A=>new TextDecoder().decode(A),decode:A=>new TextEncoder().encode(A)},e.hex=r(u(4),n("0123456789abcdef"),i(""),f(A=>{if(typeof A!="string"||A.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof A} with length ${A.length}`);return A.toLowerCase()}));let O={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},_=`Invalid encoding type. Available types: ${Object.keys(O).join(", ")}`,S=(A,T)=>{if(typeof A!="string"||!O.hasOwnProperty(A))throw new TypeError(_);if(!(T instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return O[A].encode(T)};e.bytesToString=S,e.str=e.bytesToString;let R=(A,T)=>{if(!O.hasOwnProperty(A))throw new TypeError(_);if(typeof T!="string")throw new TypeError("stringToBytes() expects string");return O[A].decode(T)};e.stringToBytes=R,e.bytes=e.stringToBytes})(Vi)),Vi}var Zi,Pl;function r3(){if(Pl)return Zi;Pl=1;let{bech32:e,hex:t,utf8:r}=n3(),n={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},i={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},a={bech32:"tbs",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},f={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},b={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},o=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],p={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},d=BigInt("2100000000000000000"),h=BigInt(1e11),u={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},c={};for(let C=0,E=Object.keys(u);Ct.encode(e.fromWordsUnsafe(C)),16:C=>t.encode(e.fromWordsUnsafe(C)),13:C=>r.encode(e.fromWordsUnsafe(C)),19:C=>t.encode(e.fromWordsUnsafe(C)),23:C=>t.encode(e.fromWordsUnsafe(C)),27:C=>t.encode(e.fromWordsUnsafe(C)),6:g,24:g,3:w,5:y};function l(C){return E=>({tagCode:parseInt(C),words:e.encode("unknown",E,Number.MAX_SAFE_INTEGER)})}function g(C){return C.reverse().reduce((E,O,_)=>E+O*Math.pow(32,_),0)}function w(C){let E=[],O,_,S,R,A,T=e.fromWordsUnsafe(C);for(;T.length>0;)O=t.encode(T.slice(0,33)),_=t.encode(T.slice(33,41)),S=parseInt(t.encode(T.slice(41,45)),16),R=parseInt(t.encode(T.slice(45,49)),16),A=parseInt(t.encode(T.slice(49,51)),16),T=T.slice(51),E.push({pubkey:O,short_channel_id:_,fee_base_msat:S,fee_proportional_millionths:R,cltv_expiry_delta:A});return E}function y(C){let E=C.slice().reverse().map(S=>[!!(S&1),!!(S&2),!!(S&4),!!(S&8),!!(S&16)]).reduce((S,R)=>S.concat(R),[]);for(;E.length{let A;E[R*2]?A="required":E[R*2+1]?A="supported":A="unsupported",O[S]=A});let _=E.slice(o.length*2);return O.extra_bits={start_bit:o.length*2,bits:_,has_required:_.reduce((S,R,A)=>A%2!==0?S||!1:S||R,!1)},O}function v(C,E){let O,_;if(C.slice(-1).match(/^[munp]$/))O=C.slice(-1),_=C.slice(0,-1);else{if(C.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");_=C}if(!_.match(/^\d+$/))throw new Error("Not a valid human readable amount");let S=BigInt(_),R=O?S*h/p[O]:S*h;if(O==="p"&&S%BigInt(10)!==BigInt(0)||R>d)throw new Error("Amount is outside of valid range");return E?R.toString():R}function m(C,E){if(typeof C!="string")throw new Error("Lightning Payment Request must be string");if(C.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");let O=[],_=e.decode(C,Number.MAX_SAFE_INTEGER);C=C.toLowerCase();let S=_.prefix,R=_.words,A=C.slice(S.length+1),T=R.slice(-104);R=R.slice(0,-104);let N=S.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(N&&!N[2]&&(N=S.match(/^ln(\S+)$/)),!N)throw new Error("Not a proper lightning payment request");O.push({name:"lightning_network",letters:"ln"});let x=N[1],I;if(E){if(E.bech32===void 0||E.pubKeyHash===void 0||E.scriptHash===void 0||!Array.isArray(E.validWitnessVersions))throw new Error("Invalid network");I=E}else switch(x){case n.bech32:I=n;break;case i.bech32:I=i;break;case a.bech32:I=a;break;case f.bech32:I=f;break;case b.bech32:I=b;break}if(!I||I.bech32!==x)throw new Error("Unknown coin bech32 prefix");O.push({name:"coin_network",letters:x,value:I});let L=N[2],H;if(L){let U=N[3];H=v(L+U,!0),O.push({name:"amount",letters:N[2]+N[3],value:H})}else H=null;O.push({name:"separator",letters:"1"});let Z=g(R.slice(0,7));R=R.slice(7),O.push({name:"timestamp",letters:A.slice(0,7),value:Z}),A=A.slice(7);let K,P,B,G;for(;R.length>0;){let U=R[0].toString();K=c[U]||"unknown_tag",P=s[U]||l(U),R=R.slice(1),B=g(R.slice(0,2)),R=R.slice(2),G=R.slice(0,B),R=R.slice(B),O.push({name:K,tag:A[0],letters:A.slice(0,3+B),value:P(G)}),A=A.slice(3+B)}O.push({name:"signature",letters:A.slice(0,104),value:t.encode(e.fromWordsUnsafe(T))}),A=A.slice(104),O.push({name:"checksum",letters:A});let V={paymentRequest:C,sections:O,get expiry(){let U=O.find(F=>F.name==="expiry");if(U)return z("timestamp")+U.value},get route_hints(){return O.filter(U=>U.name==="route_hint").map(U=>U.value)}};for(let U in u)U!=="route_hint"&&Object.defineProperty(V,U,{get(){return z(U)}});return V;function z(U){let F=O.find(D=>D.name===U);return F?F.value:void 0}}return Zi={decode:m,hrpToMillisat:v},Zi}var o3=r3(),i3=e=>Uint8Array.from(e.match(/.{1,2}/g).map(t=>parseInt(t,16))),s3=e=>{if(!e)return null;try{let t=o3.decode(e);if(!t||!t.sections)return null;let r=t.sections.find(s=>s.name==="payment_hash");if(r?.name!=="payment_hash"||!r.value)return null;let n=r.value,i=0,a=0,f="0",b=t.sections.find(s=>s.name==="amount");b?.name==="amount"&&b.value&&(f=b.value,a=parseInt(b.value),i=parseInt(b.value)/1e3);let o=t.sections.find(s=>s.name==="timestamp");if(o?.name!=="timestamp"||!o.value)return null;let p=o.value,d,h=t.sections.find(s=>s.name==="expiry");h?.name==="expiry"&&(d=h.value);let u=t.sections.find(s=>s.name==="description"),c=u?.name==="description"?u?.value:void 0;return{paymentHash:n,satoshi:i,millisatoshi:a,amountRaw:f,timestamp:p,expiry:d,description:c}}catch{return null}};function a3(e,t){try{if(!/^[0-9a-fA-F]{64}$/.test(e)||!/^[0-9a-fA-F]{64}$/.test(t))return!1;let r=Y4(t3(i3(e)));return t===r}catch{return!1}}var ro=class{constructor(t){if(this.paymentRequest=t.pr,!this.paymentRequest)throw new Error("Invalid payment request");let r=s3(this.paymentRequest);if(!r)throw new Error("Failed to decode payment request");this.paymentHash=r.paymentHash,this.satoshi=r.satoshi,this.millisatoshi=r.millisatoshi,this.amountRaw=r.amountRaw,this.timestamp=r.timestamp,this.expiry=r.expiry,this.createdDate=new Date(this.timestamp*1e3),this.expiryDate=this.expiry?new Date((this.timestamp+this.expiry)*1e3):void 0,this.description=r.description??null,this.verify=t.verify??null,this.preimage=t.preimage??null,this.successAction=t.successAction??null}async isPaid(){if(this.preimage)return this.validatePreimage(this.preimage);if(this.verify)return await this.verifyPayment();throw new Error("Could not verify payment")}validatePreimage(t){return!t||!this.paymentHash?!1:a3(t,this.paymentHash)}async verifyPayment(){try{if(!this.verify)throw new Error("LNURL verify not available");let t=await fetch(this.verify);if(!t.ok)throw new Error(`Verification request failed: ${t.status} ${t.statusText}`);let r=await t.json();return r.preimage&&(this.preimage=r.preimage),r.settled}catch(t){return console.error("Failed to check LNURL-verify",t),!1}}hasExpired(){let{expiryDate:t}=this;return t?t.getTime(){let t="https://getalby.com/api/rates/"+e.toLowerCase()+".json",r=await fetch(t);if(!r.ok)throw new Error(`Failed to fetch rate: ${r.status} ${r.statusText}`);return(await r.json()).rate_float/c3},Ul=async({satoshi:e,currency:t})=>{let r=await l3(t);return Number(e)*r};var To=ba(Fl(),1),Pn=class{constructor(t){this._config=t}async unload(){}},u3=e=>{let t=[];for(let r=0,n=atob(e.replace(/[ \r\n]+$/,""));rba(jl(),1))).default;return Ve=new e,Ve}catch(e){throw console.error(e),new Error("LNC is not available")}}var Hl="ONLY CONNECT TO TRUSTED WEBSITES",_s=class{constructor(t){this.lnc=t}enable(){return Promise.resolve()}async getInfo(){let t=await Ve.lnd.lightning.getInfo();return{methods:["enable","getBalance","getInfo","sendPayment"],version:"1.0",node:{alias:t.alias,pubkey:t.identityPubkey,color:t.color},supports:["lightning"]}}makeInvoice(t){throw new Error("Method not implemented.")}async sendPayment(t){let r=await Ve.lnd.lightning.sendPaymentSync({paymentRequest:t});if(r.paymentError)throw new Error(r.paymentError);if(!r.paymentPreimage)throw new Error("No preimage in response");if(typeof r.paymentPreimage!="string")throw new Error("expected preimage as string");return{preimage:u3(r.paymentPreimage)}}async getBalance(){var t;let r=await Ve.lnd.lightning.channelBalance();return{balance:parseInt(((t=r.localBalance)==null?void 0:t.sat)||"0")}}keysend(t){throw new Error("Method not implemented.")}lnurl(t){throw new Error("Method not implemented.")}lookupInvoice(t){throw new Error("Method not implemented.")}signMessage(t){throw new Error("Method not implemented.")}verifyMessage(t,r){throw new Error("Method not implemented.")}},Cs=class{constructor(t,r){this._instanceUrl=t,this._adminKey=r}enable(){return Promise.resolve()}async getInfo(){return{node:{alias:(await this.requestLnbits("GET","/api/v1/wallet")).name,pubkey:""},methods:["getInfo","getBalance","sendPayment"],version:"1.0",supports:["lightning"]}}async makeInvoice(t){return{paymentRequest:(await this.requestLnbits("POST","/api/v1/payments",{amount:t.amount||t.defaultAmount||+t,memo:t.defaultMemo,out:!1})).payment_request}}async sendPayment(t){let r=await this.requestLnbits("POST","/api/v1/payments",{bolt11:t,out:!0}),n=await this.requestLnbits("GET",`/api/v1/payments/${r.payment_hash}`);if(!n.preimage)throw new Error("No preimage");return{preimage:n.preimage}}async getBalance(){let t=await this.requestLnbits("GET","/api/v1/wallet");return{balance:Math.floor(t.balance/1e3)}}keysend(t){throw new Error("Method not implemented.")}lnurl(t){throw new Error("Method not implemented.")}lookupInvoice(t){throw new Error("Method not implemented.")}signMessage(t){throw new Error("Method not implemented.")}verifyMessage(t,r){throw new Error("Method not implemented.")}async requestLnbits(t,r,n){let i=null,a=new Headers;if(a.append("Accept","application/json"),a.append("Content-Type","application/json"),a.append("X-Api-Key",this._adminKey),t==="POST")i=JSON.stringify(n);else if(n!==void 0)throw new Error("TODO: support args in GET");let f=await fetch(this._instanceUrl+r+"",{method:t,headers:a,body:i});if(!f.ok){let b=await f.json();throw console.error("errBody",b),new Error(b.detail)}return await f.json()}};function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t{setTimeout(r,100)})}catch(t){throw console.error(t),Ve.disconnect(),Ve.credentials.clear(),t}return e}async unload(){Ve.disconnect(),Ve.credentials.clear(),await super.unload()}}},As={showBalance:!0,appName:"Bitcoin Connect",persistConnection:!0},ne=xl((e,t)=>({route:"/start",routeHistory:[],modalOpen:!1,currency:void 0,connected:!1,connecting:!1,error:void 0,alias:void 0,balance:void 0,connectorName:void 0,invoice:void 0,provider:void 0,connector:void 0,connectorConfig:void 0,bitcoinConnectConfig:As,info:void 0,connectNWC:r=>t().connect({connectorName:"NWC",connectorType:"nwc.generic",nwcUrl:r}),connect:async(r,n={redirectTo:"/connected"})=>{e({connecting:!0,error:void 0});try{let i=new h3[r.connectorType](r),a=await i.init(),f;await a.enable();try{f=await a.getInfo()}catch{console.error("Failed to request wallet info")}if(!t().connecting)return;e({connectorConfig:r,connector:i,connected:!0,connecting:!1,info:f,provider:a,connectorName:r.connectorName,route:n.redirectTo});let{bitcoinConnectConfig:b}=t();b.persistConnection!==!1&&window.localStorage.setItem("bc:config",JSON.stringify(r))}catch(i){console.error(i),e({error:i.toString(),connecting:!1}),t().disconnect()}},disconnect:()=>{var r;(r=t().connector)==null||r.unload(),e({connectorConfig:void 0,connector:void 0,connected:!1,connecting:!1,connectorName:void 0,provider:void 0,modalOpen:!1}),window.localStorage.removeItem("bc:config")},pushRoute:r=>{t().route!==r&&e({route:r,routeHistory:[...t().routeHistory,t().route]})},popRoute(){let r=t().routeHistory,n=r.pop()||"/start";e({route:n,routeHistory:r})},clearRouteHistory(){e({route:"/start",routeHistory:[]})},setModalOpen:r=>{e({modalOpen:r})},setBitcoinConnectConfig:r=>{e({bitcoinConnectConfig:Ct({},As,r)});let n=t();n.bitcoinConnectConfig.autoConnect===!1||n.connected||n.connecting||(function(){try{let{hash:i}=window.location;if(i){let a=i.indexOf("?"),f=i.slice(a>0?a:1),b=new URLSearchParams(f),o=b.get("nwc");if(o&&o.startsWith("nostr+walletconnect://")){let{searchParams:p}=new URL(o);p.get("relay")&&p.get("secret")&&(b.delete("nwc"),window.location.hash=i.slice(0,a>0?a+1:1)+b.toString(),ne.getState().connectNWC(o))}}}catch(i){console.error(i)}})()},setError:r=>{e({error:r})},setCurrency:r=>{r?window.localStorage.setItem("bc:currency",r):window.localStorage.removeItem("bc:currency"),e({currency:r})},supports:r=>{let{info:n,provider:i}=t();return!(n==null||!n.methods)&&n.methods.indexOf(r)>-1&&!(i==null||!i.getBalance)}}));function ee(e,t,r,n){var i,a=arguments.length,f=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,t,r,n);else for(var b=e.length-1;b>=0;b--)(i=e[b])&&(f=(a<3?i(f):a>3?i(t,r,f):i(t,r))||f);return a>3&&f&&Object.defineProperty(t,r,f),f}globalThis.window&&((function(){let e=window.localStorage.getItem("bc:config");if(e){let r=JSON.parse(e);ne.getState().connect(r,{redirectTo:"/start"})}let t=window.localStorage.getItem("bc:currency");t&&ne.getState().setCurrency(t)})(),window.addEventListener("webln:enabled",()=>{ne.getState().connecting||ne.getState().connect({connectorName:"Extension",connectorType:"extension.generic"},{redirectTo:"/start"})})),typeof SuppressedError=="function"&&SuppressedError;var po=globalThis,Xs=po.ShadowRoot&&(po.ShadyCSS===void 0||po.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Sh=Symbol(),$l=new WeakMap,Ss=class{constructor(t,r,n){if(this._$cssResult$=!0,n!==Sh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(Xs&&t===void 0){let n=r!==void 0&&r.length===1;n&&(t=$l.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&$l.set(r,t))}return t}toString(){return this.cssText}},Gl=Xs?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let n of t.cssRules)r+=n.cssText;return(n=>new Ss(typeof n=="string"?n:n+"",void 0,Sh))(r)})(e):e,{is:f3,defineProperty:d3,getOwnPropertyDescriptor:p3,getOwnPropertyNames:y3,getOwnPropertySymbols:g3,getPrototypeOf:b3}=Object,Qt=globalThis,Wl=Qt.trustedTypes,w3=Wl?Wl.emptyScript:"",m3=Qt.reactiveElementPolyfillSupport,or=(e,t)=>e,bo={toAttribute(e,t){switch(t){case Boolean:e=e?w3:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},ea=(e,t)=>!f3(e,t),Kl={attribute:!0,type:String,converter:bo,reflect:!1,useDefault:!1,hasChanged:ea};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Qt.litPropertyMetadata??(Qt.litPropertyMetadata=new WeakMap);var hn=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=Kl){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(t,n,r);i!==void 0&&d3(this.prototype,t,i)}}static getPropertyDescriptor(t,r,n){let{get:i,set:a}=p3(this.prototype,t)??{get(){return this[r]},set(f){this[r]=f}};return{get:i,set(f){let b=i?.call(this);a?.call(this,f),this.requestUpdate(t,b,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Kl}static _$Ei(){if(this.hasOwnProperty(or("elementProperties")))return;let t=b3(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(or("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(or("properties"))){let r=this.properties,n=[...y3(r),...g3(r)];for(let i of n)this.createProperty(i,r[i])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let i of n)r.unshift(Gl(i))}else t!==void 0&&r.push(Gl(t));return r}static _$Eu(t,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(Xs)r.adoptedStyleSheets=n.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of n){let a=document.createElement("style"),f=po.litNonce;f!==void 0&&a.setAttribute("nonce",f),a.textContent=i.cssText,r.appendChild(a)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$ET(t,r){let n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){let a=(n.converter?.toAttribute!==void 0?n.converter:bo).toAttribute(r,n.type);this._$Em=t,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(t,r){let n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let a=n.getPropertyOptions(i),f=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:bo;this._$Em=i,this[i]=f.fromAttribute(r,a.type)??this._$Ej?.get(i)??null,this._$Em=null}}requestUpdate(t,r,n){if(t!==void 0){let i=this.constructor,a=this[t];if(n??(n=i.getPropertyOptions(t)),!((n.hasChanged??ea)(a,r)||n.useDefault&&n.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:n,reflect:i,wrapped:a},f){n&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,f??r??this[t]),a!==!0||f!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(r=void 0),this._$AL.set(t,r)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,a]of n){let{wrapped:f}=a,b=this[i];f!==!0||this._$AL.has(i)||b===void 0||this.C(i,void 0,a,b)}}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(t){}firstUpdated(t){}};hn.elementStyles=[],hn.shadowRootOptions={mode:"open"},hn[or("elementProperties")]=new Map,hn[or("finalized")]=new Map,m3?.({ReactiveElement:hn}),(Qt.reactiveElementVersions??(Qt.reactiveElementVersions=[])).push("2.1.0");var ir=globalThis,wo=ir.trustedTypes,Vl=wo?wo.createPolicy("lit-html",{createHTML:e=>e}):void 0,Zl="$lit$",Kt=`lit$${Math.random().toFixed(9).slice(2)}$`,Th="?"+Kt,v3=`<${Th}>`,yn=document,mo=()=>yn.createComment(""),ur=e=>e===null||typeof e!="object"&&typeof e!="function",Ts=Array.isArray,Ji=`[ \f\r]`,Jn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yl=/-->/g,ql=/>/g,an=RegExp(`>|${Ji}(?:([^\\s"'>=/]+)(${Ji}*=${Ji}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),zl=/'/g,Ql=/"/g,Jl=/^(?:script|style|textarea|title)$/i,hr=Symbol.for("lit-noChange"),He=Symbol.for("lit-nothing"),Xl=new WeakMap,dn=yn.createTreeWalker(yn,129);function Oh(e,t){if(!Ts(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vl!==void 0?Vl.createHTML(t):t}var fr=class e{constructor({strings:t,_$litType$:r},n){let i;this.parts=[];let a=0,f=0,b=t.length-1,o=this.parts,[p,d]=((h,u)=>{let c=h.length-1,s=[],l,g=u===2?"":u===3?"":"",w=Jn;for(let y=0;y"?(w=l??Jn,E=-1):C[1]===void 0?E=-2:(E=w.lastIndex-C[2].length,m=C[1],w=C[3]===void 0?an:C[3]==='"'?Ql:zl):w===Ql||w===zl?w=an:w===Yl||w===ql?w=Jn:(w=an,l=void 0);let _=w===an&&h[y+1].startsWith("/>")?" ":"";g+=w===Jn?v+v3:E>=0?(s.push(m),v.slice(0,E)+Zl+v.slice(E)+Kt+_):v+Kt+(E===-2?y:_)}return[Oh(h,g+(h[c]||"")+(u===2?"":u===3?"":"")),s]})(t,r);if(this.el=e.createElement(p,n),dn.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=dn.nextNode())!==null&&o.length0){i.textContent=wo?wo.emptyScript:"";for(let c=0;cTs(n)||typeof n?.[Symbol.iterator]=="function")(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==He&&ur(this._$AH)?this._$AA.nextSibling.data=t:this.T(yn.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=fr.createElement(Oh(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let a=new Os(i,this),f=a.u(this.options);a.p(r),this.T(f),this._$AH=a}}_$AC(t){let r=Xl.get(t.strings);return r===void 0&&Xl.set(t.strings,r=new fr(t)),r}k(t){Ts(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of t)i===r.length?r.push(n=new e(this.O(mo()),this.O(mo()),this,this.options)):n=r[i],n._$AI(a),i++;i2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=He}_$AI(t,r=this,n,i){let a=this.strings,f=!1;if(a===void 0)t=kn(this,t,r,0),f=!ur(t)||t!==this._$AH&&t!==hr,f&&(this._$AH=t);else{let b=t,o,p;for(t=a[0],o=0;o{let r=e.length===1?e[0]:t.reduce((n,i,a)=>n+(f=>{if(f._$cssResult$===!0)return f.cssText;if(typeof f=="number")return f;throw Error("Value passed to 'css' function must be a 'css' function result: "+f+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[a+1],e[0]);return new Eo(r,e,na)},t1=ta?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let n of t.cssRules)r+=n.cssText;return(n=>new Eo(typeof n=="string"?n:n+"",void 0,na))(r)})(e):e,{is:_3,defineProperty:C3,getOwnPropertyDescriptor:A3,getOwnPropertyNames:S3,getOwnPropertySymbols:T3,getPrototypeOf:O3}=Object,Jt=globalThis,n1=Jt.trustedTypes,N3=n1?n1.emptyScript:"",x3=Jt.reactiveElementPolyfillSupport,sr=(e,t)=>e,Ps={toAttribute(e,t){switch(t){case Boolean:e=e?N3:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Nh=(e,t)=>!_3(e,t),r1={attribute:!0,type:String,converter:Ps,reflect:!1,useDefault:!1,hasChanged:Nh};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Jt.litPropertyMetadata??(Jt.litPropertyMetadata=new WeakMap);var Zt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=r1){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(t,n,r);i!==void 0&&C3(this.prototype,t,i)}}static getPropertyDescriptor(t,r,n){let{get:i,set:a}=A3(this.prototype,t)??{get(){return this[r]},set(f){this[r]=f}};return{get:i,set(f){let b=i?.call(this);a?.call(this,f),this.requestUpdate(t,b,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??r1}static _$Ei(){if(this.hasOwnProperty(sr("elementProperties")))return;let t=O3(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(sr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(sr("properties"))){let r=this.properties,n=[...S3(r),...T3(r)];for(let i of n)this.createProperty(i,r[i])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let i of n)r.unshift(t1(i))}else t!==void 0&&r.push(t1(t));return r}static _$Eu(t,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((r,n)=>{if(ta)r.adoptedStyleSheets=n.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of n){let a=document.createElement("style"),f=yo.litNonce;f!==void 0&&a.setAttribute("nonce",f),a.textContent=i.cssText,r.appendChild(a)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$ET(t,r){let n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(i!==void 0&&n.reflect===!0){let a=(n.converter?.toAttribute!==void 0?n.converter:Ps).toAttribute(r,n.type);this._$Em=t,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(t,r){let n=this.constructor,i=n._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let a=n.getPropertyOptions(i),f=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Ps;this._$Em=i,this[i]=f.fromAttribute(r,a.type)??this._$Ej?.get(i)??null,this._$Em=null}}requestUpdate(t,r,n){if(t!==void 0){let i=this.constructor,a=this[t];if(n??(n=i.getPropertyOptions(t)),!((n.hasChanged??Nh)(a,r)||n.useDefault&&n.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:n,reflect:i,wrapped:a},f){n&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,f??r??this[t]),a!==!0||f!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(r=void 0),this._$AL.set(t,r)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,a]of n){let{wrapped:f}=a,b=this[i];f!==!0||this._$AL.has(i)||b===void 0||this.C(i,void 0,a,b)}}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(t){}firstUpdated(t){}};Zt.elementStyles=[],Zt.shadowRootOptions={mode:"open"},Zt[sr("elementProperties")]=new Map,Zt[sr("finalized")]=new Map,x3?.({ReactiveElement:Zt}),(Jt.reactiveElementVersions??(Jt.reactiveElementVersions=[])).push("2.1.0");var ar=globalThis,_o=ar.trustedTypes,o1=_o?_o.createPolicy("lit-html",{createHTML:e=>e}):void 0,xh="$lit$",Yt=`lit$${Math.random().toFixed(9).slice(2)}$`,Rh="?"+Yt,R3=`<${Rh}>`,gn=document,dr=()=>gn.createComment(""),pr=e=>e===null||typeof e!="object"&&typeof e!="function",ks=Array.isArray,Xi=`[ \f\r]`,Xn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,i1=/-->/g,s1=/>/g,cn=RegExp(`>|${Xi}(?:([^\\s"'>=/]+)(${Xi}*=${Xi}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),a1=/'/g,c1=/"/g,Ih=/^(?:script|style|textarea|title)$/i,Ph=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),X=Ph(1),Ee=Ph(2),Un=Symbol.for("lit-noChange"),$e=Symbol.for("lit-nothing"),l1=new WeakMap,pn=gn.createTreeWalker(gn,129);function kh(e,t){if(!ks(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return o1!==void 0?o1.createHTML(t):t}var I3=(e,t)=>{let r=e.length-1,n=[],i,a=t===2?"":t===3?"":"",f=Xn;for(let b=0;b"?(f=i??Xn,h=-1):d[1]===void 0?h=-2:(h=f.lastIndex-d[2].length,p=d[1],f=d[3]===void 0?cn:d[3]==='"'?c1:a1):f===c1||f===a1?f=cn:f===i1||f===s1?f=Xn:(f=cn,i=void 0);let c=f===cn&&e[b+1].startsWith("/>")?" ":"";a+=f===Xn?o+R3:h>=0?(n.push(p),o.slice(0,h)+xh+o.slice(h)+Yt+c):o+Yt+(h===-2?b:c)}return[kh(e,a+(e[r]||"")+(t===2?"":t===3?"":"")),n]},yr=class e{constructor({strings:t,_$litType$:r},n){let i;this.parts=[];let a=0,f=0,b=t.length-1,o=this.parts,[p,d]=I3(t,r);if(this.el=e.createElement(p,n),pn.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=pn.nextNode())!==null&&o.length0){i.textContent=_o?_o.emptyScript:"";for(let c=0;cks(n)||typeof n?.[Symbol.iterator]=="function")(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==$e&&pr(this._$AH)?this._$AA.nextSibling.data=t:this.T(gn.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=yr.createElement(kh(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let a=new Ls(i,this),f=a.u(this.options);a.p(r),this.T(f),this._$AH=a}}_$AC(t){let r=l1.get(t.strings);return r===void 0&&l1.set(t.strings,r=new yr(t)),r}k(t){ks(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of t)i===r.length?r.push(n=new e(this.O(dr()),this.O(dr()),this,this.options)):n=r[i],n._$AI(a),i++;i2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=$e}_$AI(t,r=this,n,i){let a=this.strings,f=!1;if(a===void 0)t=Mn(this,t,r,0),f=!pr(t)||t!==this._$AH&&t!==Un,f&&(this._$AH=t);else{let b=t,o,p;for(t=a[0],o=0;o{let f=a?.renderBefore??i,b=f._$litPart$;if(b===void 0){let o=a?.renderBefore??null;f._$litPart$=b=new gr(i.insertBefore(dr(),o),o,void 0,a??{})}return b._$AI(n),b})(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Un}};Xt._$litElement$=!0,Xt.finalized=!0,cr.litElementHydrateSupport?.({LitElement:Xt});var k3=cr.litElementPolyfillSupport;k3?.({LitElement:Xt}),(cr.litElementVersions??(cr.litElementVersions=[])).push("4.2.0");var pe=e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},L3={attribute:!0,type:String,converter:bo,reflect:!1,hasChanged:ea},U3=(e=L3,t,r)=>{let{kind:n,metadata:i}=r,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),n==="setter"&&((e=Object.create(e)).wrapped=!0),a.set(r.name,e),n==="accessor"){let{name:f}=r;return{set(b){let o=t.get.call(this);t.set.call(this,b),this.requestUpdate(f,o,e)},init(b){return b!==void 0&&this.C(f,void 0,e,b),b}}}if(n==="setter"){let{name:f}=r;return function(b){let o=this[f];t.call(this,b),this.requestUpdate(f,o,e)}}throw Error("Unsupported decorator location: "+n)};function Ue(e){return(t,r)=>typeof r=="object"?U3(e,t,r):((n,i,a)=>{let f=i.hasOwnProperty(a);return i.constructor.createProperty(a,n),f?Object.getOwnPropertyDescriptor(i,a):void 0})(e,t,r)}function ge(e){return Ue({...e,state:!0,attribute:!1})}var u1,h1,br=class extends Xt{updated(t){var r;if(super.updated(t),globalThis.document&&globalThis.document.documentElement.classList.contains("dark")&&(r=this.shadowRoot)!=null&&(r=r.children)!=null&&r.length)for(let n of this.shadowRoot.children)n.classList.contains("dark")||n.classList.add("dark")}_getBrandColorLuminance(){if(!globalThis.window)return 0;let t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,r=window.getComputedStyle(this).getPropertyValue(t?"--bc-color-brand-dark":"--bc-color-brand")||window.getComputedStyle(this).getPropertyValue("--bc-color-brand")||"#196CE7";if(!r.match(/^#[0-9A-F]{6}$/i)){let n=document.createElement("div");n.style.color=r,n.style.display="none",document.body.appendChild(n),r=window.getComputedStyle(n).color,n.remove()}return(function(n){if(n.startsWith("#"))return n=n.slice(1),(.299*parseInt(n.slice(0,2),16)+.587*parseInt(n.slice(2,4),16)+.114*parseInt(n.slice(4,6),16))/255;if(n.startsWith("rgb")||n.startsWith("rgba")){let i=n.match(/\d+(\.\d+)?/g);return(.299*parseFloat(i[0])+.587*parseFloat(i[1])+.114*parseFloat(i[2]))/255}throw new Error("Unsupported luminance: "+n)})(r)}};br.styles=[Oo(u1||(u1=(e=>e)` :host { // global css reset in shadow DOM all: initial; font-variant-numeric: slashed-zero; } // TODO: move to individual components - only needed by a couple of icons .hover-animation:hover .hover-right-up { transform: translateX(2px) translateY(-2px); transition: all 0.3s; } .hover-animation:hover .hover-right { transform: translateX(3px); transition: all 0.3s; } `))];var ye=class extends br{constructor(){super(),this._modalOpen=!1,this._connected=!1,this._connecting=!1,this._connectorName=void 0,this._appName=void 0,this._appIcon=void 0,this._filters=void 0,this._error=void 0,this._connected=ne.getState().connected,this._connecting=ne.getState().connecting,this._connectorName=ne.getState().connectorName,this._appName=ne.getState().bitcoinConnectConfig.appName,this._appIcon=ne.getState().bitcoinConnectConfig.appIcon,this._filters=ne.getState().bitcoinConnectConfig.filters,this._error=ne.getState().error,this._route=ne.getState().route,this._modalOpen=ne.getState().modalOpen,ne.subscribe(t=>{this._connected=t.connected,this._connecting=t.connecting,this._connectorName=t.connectorName,this._appName=t.bitcoinConnectConfig.appName,this._appIcon=t.bitcoinConnectConfig.appIcon,this._filters=t.bitcoinConnectConfig.filters,this._error=t.error,this._route=t.route,this._modalOpen=t.modalOpen})}};ee([ge()],ye.prototype,"_modalOpen",void 0),ee([ge()],ye.prototype,"_connected",void 0),ee([ge()],ye.prototype,"_connecting",void 0),ee([ge()],ye.prototype,"_connectorName",void 0),ee([ge()],ye.prototype,"_appName",void 0),ee([ge()],ye.prototype,"_appIcon",void 0),ee([ge()],ye.prototype,"_filters",void 0),ee([ge()],ye.prototype,"_error",void 0),ee([ge()],ye.prototype,"_route",void 0);var lr=Ee(h1||(h1=(e=>e)` `));function ra(e){return[...e.v,(e.i?"!":"")+e.n].join(":")}function M3(e,t=","){return e.map(ra).join(t)}var Lh=typeof CSS<"u"&&CSS.escape||(e=>e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Co(e){for(var t=9,r=e.length;r--;)t=Math.imul(t^e.charCodeAt(r),1597334677);return"#"+((t^t>>>9)>>>0).toString(36)}function oa(e,t="@media "){return t+Re(e).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function Re(e=[]){return Array.isArray(e)?e:e==null?[]:[e]}function f1(e){return e}function Fs(){}var Me={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Uh(e){return e.match(/[-=:;]/g)?.length||0}function js(e){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(e)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Uh(e),15)<<18}var D3=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function ia({n:e,i:t,v:r=[]},n,i,a){e&&(e=ra({n:e,i:t,v:r})),a=[...Re(a)];for(let f of r){let b=n.theme("screens",f);for(let o of Re(b&&oa(b)||n.v(f)))a.push(o),i|=b?67108864|js(o):f=="dark"?1073741824:o[0]=="@"?js(o):1<<~(/:([a-z-]+)/.test(o)&&~D3.indexOf(RegExp.$1.slice(2,7))||-18)}return{n:e,p:i,r:a,i:t}}var Mh=new Map;function Hs(e){if(e.d){let t=[],r=es(e.r.reduce((n,i)=>i[0]=="@"?(t.push(i),n):i?es(n,a=>es(i,f=>{let b=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(f);if(b){let o=a.indexOf(b[1]);return~o?a.slice(0,o)+b[0]+a.slice(o+b[1].length):ts(a,f)}return ts(f,a)})):n,"&"),n=>ts(n,e.n?"."+Lh(e.n):""));return r&&t.push(r.replace(/:merge\((.+?)\)/g,"$1")),t.reduceRight((n,i)=>i+"{"+n+"}",e.d)}}function es(e,t){return e.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>t(n)+i)}function ts(e,t){return e.replace(/&/g,t)}var d1=new Intl.Collator("en",{numeric:!0});function Dh(e,t){for(var r=0,n=e.length;r>1;0>=Bh(e[i],t)?r=i+1:n=i}return n}function Bh(e,t){let r=e.p&Me.o;return r!=(t.p&Me.o)||r!=Me.b&&r!=Me.o?e.p-t.p||e.o-t.o||d1.compare(p1(e.n),p1(t.n))||d1.compare(y1(e.n),y1(t.n)):0}function p1(e){return(e||"").split(/:/).pop().split("/").pop()||"\0"}function y1(e){return(e||"").replace(/\W/g,t=>String.fromCharCode(127+t.charCodeAt(0)))+"\0"}function ns(e,t){return Math.round(parseInt(e,16)*t)}function qt(e,t={}){if(typeof e=="function")return e(t);let{opacityValue:r="1",opacityVariable:n}=t,i=n?`var(${n})`:r;if(e.includes(""))return e.replace("",i);if(e[0]=="#"&&(e.length==4||e.length==7)){let a=(e.length-1)/3,f=[17,1,.062272][a-1];return`rgba(${[ns(e.substr(1,a),f),ns(e.substr(1+a,a),f),ns(e.substr(1+2*a,a),f),i]})`}return i=="1"?e:i=="0"?"#0000":e.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function Fh(e,t,r,n,i=[]){return(function a(f,{n:b,p:o,r:p=[],i:d},h){let u=[],c="",s=0,l=0;for(let y in f||{}){var g,w;let v=f[y];if(y[0]=="@"){if(!v)continue;if(y[1]=="a"){u.push(...aa(b,o,So(""+v),h,o,p,d,!0));continue}if(y[1]=="l"){for(let m of Re(v))u.push(...a(m,{n:b,p:(g=Me[y[7]],o&~Me.o|g),r:y[7]=="d"?[]:p,i:d},h));continue}if(y[1]=="i"){u.push(...Re(v).map(m=>({p:-1,o:0,r:[],d:y+" "+m})));continue}if(y[1]=="k"){u.push({p:Me.d,o:0,r:[y],d:a(v,{p:Me.d},h).map(Hs).join("")});continue}if(y[1]=="f"){u.push(...Re(v).map(m=>({p:Me.d,o:0,r:[y],d:a(m,{p:Me.d},h).map(Hs).join("")})));continue}}if(typeof v!="object"||Array.isArray(v))y=="label"&&v?b=v+Co(JSON.stringify([o,d,f])):(v||v===0)&&(y=y.replace(/[A-Z]/g,m=>"-"+m.toLowerCase()),l+=1,s=Math.max(s,(w=y)[0]=="-"?0:Uh(w)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(w)?+!!RegExp.$1||-!!RegExp.$2:0)+1),c+=(c?";":"")+Re(v).map(m=>h.s(y,sa(""+m,h.theme)+(d?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let m=o;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(C,E)=>{let O=h.theme("screens",E);return O?(m|=67108864,oa(O,"")):C}),m|=js(y)),u.push(...a(v,{n:b,p:m,r:[...p,y],i:d},h))}else u.push(...a(v,{p:o,r:[...p,y]},h))}return u.unshift({n:b,p:o,o:Math.max(0,15-l)+1.5*Math.min(s||15,15),r:p,d:c}),u.sort(Bh)})(e,ia(t,r,n,i),r)}function sa(e,t){return e.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,a,f="")=>{let b=t(i,f);return typeof b=="function"&&/color|fill|stroke/i.test(i)?qt(b):""+Re(b).filter(o=>Object(o)!==o)})}function jh(e,t){let r,n=[];for(let i of e)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&t}):n.push({...i,n:i.n&&t});return n}function Ao(e,t,r=Me.u,n,i){let a=[];for(let f of e)for(let b of(function(o,p,d,h,u){let c=(function(s,l){let g=Mh.get(s.n);return g?g(s,l):l.r(s.n,s.v[0]=="dark")})(o={...o,i:o.i||u},p);return c?typeof c=="string"?({r:h,p:d}=ia(o,p,d,h),jh(Ao(So(c),p,d,h,o.i),o.n)):Array.isArray(c)?c.map(s=>{var l,g;return{o:0,...s,r:[...Re(h),...Re(s.r)],p:(l=d,g=s.p??d,l&~Me.o|g)}}):Fh(c,o,p,d,h):[{c:ra(o),p:0,o:0,r:[]}]})(f,t,r,n,i))a.splice(Dh(a,b),0,b);return a}function aa(e,t,r,n,i,a,f,b){return jh((b?r.flatMap(o=>Ao([o],n,i,a,f)):Ao(r,n,i,a,f)).map(o=>o.p&Me.o&&(o.n||t==Me.b)?{...o,p:o.p&~Me.o|t,o:0}:o),e)}function B3(e,t,r,n){return Mh.set(e,(i,a)=>{let{n:f,p:b,r:o,i:p}=ia(i,a,t);return r&&aa(f,t,r,a,b,o,p,n)}),e}function rs(e,t,r){if(e[e.length-1]!="("){let n=[],i=!1,a=!1,f="";for(let b of e)if(b!="("&&!/[~@]$/.test(b)){if(b[0]=="!"&&(b=b.slice(1),i=!i),b.endsWith(":")){n[b=="dark:"?"unshift":"push"](b.slice(0,-1));continue}b[0]=="-"&&(b=b.slice(1),a=!a),b.endsWith("-")&&(b=b.slice(0,-1)),b&&b!="&"&&(f+=(f&&"-")+b)}f&&(a&&(f="-"+f),t[0].push({n:f,v:n.filter(F3),i}))}}function F3(e,t,r){return r.indexOf(e)==t}var g1=new Map;function So(e){let t=g1.get(e);if(!t){let r=[],n=[[]],i=0,a=0,f=null,b=0,o=(p,d=0)=>{i!=b&&(r.push(e.slice(i,b+d)),p&&rs(r,n)),i=b+1};for(;b1?h.slice(0,-1)+Co(JSON.stringify([h,u])):h+"("+M3(u)+")",Me.a,u,/@$/.test(h))],n)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(p)&&e[b+1]=="("&&n.unshift([]);else f=e[b+1]=="*"?/^\*\//:/^[\r\n]/}o(!0),g1.set(e,t=n[0])}return t}function re(e,t,r){return[e,$s(t,r)]}function $s(e,t){return typeof e=="function"?e:typeof e=="string"&&/^[\w-]+$/.test(e)?(r,n)=>({[e]:t?t(r,n):Gs(r,1)}):r=>e||{[r[1]]:Gs(r,2)}}function Gs(e,t,r=e.slice(t).find(Boolean)||e.$$||e.input){return e.input[0]=="-"?`calc(${r} * -1)`:r}function oe(e,t,r,n){return[e,j3(t,r,n)]}function j3(e,t,r){let n=typeof t=="string"?(i,a)=>({[t]:r?r(i,a):i._}):t||(({1:i,_:a},f,b)=>({[i||b]:a}));return(i,a)=>{let f=Hh(e||i[1]),b=a.theme(f,i.$$)??zt(i.$$,f,a);if(b!=null)return i._=Gs(i,0,b),n(i,a,f)}}function Fe(e,t={},r){return[e,H3(t,r)]}function H3(e={},t){return(r,n)=>{let{section:i=Hh(r[0]).replace("-","")+"Color"}=e,[a,f]=(r.$$.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1);if(!a)return;let b=n.theme(i,a)||zt(a,i,n);if(!b||typeof b=="object")return;let{opacityVariable:o=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:p=i.replace("Color","Opacity"),property:d=i,selector:h}=e,u=n.theme(p,f||"DEFAULT")||f&&zt(f,p,n),c=t||(({_:l})=>{let g=go(d,l);return h?{[h]:g}:g});r._={value:qt(b,{opacityVariable:o||void 0,opacityValue:u||void 0}),color:l=>qt(b,l),opacityVariable:o||void 0,opacityValue:u||void 0};let s=c(r,n);if(!r.dark){let l=n.d(i,a,b);l&&l!==b&&(r._={value:qt(l,{opacityVariable:o||void 0,opacityValue:u||"1"}),color:g=>qt(l,g),opacityVariable:o||void 0,opacityValue:u||void 0},s={"&":s,[n.v("dark")]:c(r,n)})}return s}}function go(e,t){let r={};return typeof t=="string"?r[e]=t:(t.opacityVariable&&t.value.includes(t.opacityVariable)&&(r[t.opacityVariable]=t.opacityValue||"1"),r[e]=t.value),r}function zt(e,t,r){if(e[0]=="["&&e.slice(-1)=="]"){if(e=wr(sa(e.slice(1,-1),r.theme)),!t)return e;if(!(/color|fill|stroke/i.test(t)&&!/^color:/.test(e)&&!/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(e)||/image/i.test(t)&&!/^image:/.test(e)&&!/^[a-z-]+\(/.test(e)||/weight/i.test(t)&&!/^(number|any):/.test(e)&&!/^\d+$/.test(e)||/position/i.test(t)&&/^(length|size):/.test(e)))return e.replace(/^[a-z-]+:/,"")}}function Hh(e){return e.replace(/-./g,t=>t[1].toUpperCase())}function wr(e){return e.includes("url(")?e.replace(/(.*?)(url\(.*?\))(.*?)/g,(t,r="",n,i="")=>wr(r)+n+wr(i)):e.replace(/(^|[^\\])_+/g,(t,r)=>r+" ".repeat(t.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,t=>t.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function b1({presets:e=[],...t}){let r={darkMode:void 0,darkColor:void 0,preflight:t.preflight!==!1&&[],theme:{},variants:Re(t.variants),rules:Re(t.rules),ignorelist:Re(t.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of Re([...e,{darkMode:t.darkMode,darkColor:t.darkColor,preflight:t.preflight!==!1&&Re(t.preflight),theme:t.theme,hash:t.hash,stringify:t.stringify,finalize:t.finalize}])){let{preflight:i,darkMode:a=r.darkMode,darkColor:f=r.darkColor,theme:b,variants:o,rules:p,ignorelist:d,hash:h=r.hash,stringify:u=r.stringify,finalize:c}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...Re(i)],darkMode:a,darkColor:f,theme:{...r.theme,...b,extend:{...r.theme.extend,...b?.extend}},variants:[...r.variants,...Re(o)],rules:[...r.rules,...Re(p)],ignorelist:[...r.ignorelist,...Re(d)],hash:h,stringify:u,finalize:[...r.finalize,...Re(c)]}}return r}function w1(e,t,r,n,i,a){for(let f of t){let b=r.get(f);b||r.set(f,b=n(f));let o=b(e,i,a);if(o)return o}}function $3(e){var t;return Ws(e[0],typeof(t=e[1])=="function"?t:()=>t)}function G3(e){return Array.isArray(e)?Ws(e[0],$s(e[1],e[2])):Ws(e,$s(void 0,void 0))}function Ws(e,t){return $h(e,(r,n,i,a)=>{let f=n.exec(r);if(f)return f.$$=r.slice(f[0].length),f.dark=a,t(f,i)})}function $h(e,t){let r=Re(e).map(W3);return(n,i,a)=>{for(let f of r){let b=t(n,f,i,a);if(b)return b}}}function W3(e){return typeof e=="string"?RegExp("^"+e+(e.includes("$")||e.slice(-1)=="-"?"":"$")):e}function os(e){let t=e?.cssRules?e:(e&&typeof e!="string"?e:(function(r){let n=document.querySelector(r||'style[data-twind=""]');return n&&n.tagName=="STYLE"||(n=document.createElement("style"),document.head.prepend(n)),n.dataset.twind="claimed",n})(e)).sheet;return{target:t,snapshot(){let r=Array.from(t.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=t.cssRules.length;r--;)t.deleteRule(r)},destroy(){t.ownerNode?.remove()},insert(r,n){try{t.insertRule(r,n)}catch{t.insertRule(":root{}",n)}},resume:Fs}}var Ks={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...rt(4,"rem",4,.5,.5),...rt(12,"rem",4,5),14:"3.5rem",...rt(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:be("blur"),backdropBrightness:be("brightness"),backdropContrast:be("contrast"),backdropGrayscale:be("grayscale"),backdropHueRotate:be("hueRotate"),backdropInvert:be("invert"),backdropOpacity:be("opacity"),backdropSaturate:be("saturate"),backdropSepia:be("sepia"),backgroundColor:be("colors"),backgroundImage:{none:"none"},backgroundOpacity:be("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...rt(200,"",100,0,50),...rt(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:e})=>({DEFAULT:e("colors.gray.200","currentColor"),...e("colors")}),borderOpacity:be("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:be("spacing"),borderWidth:{DEFAULT:"1px",...ht(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:be("colors"),caretColor:be("colors"),accentColor:({theme:e})=>({auto:"auto",...e("colors")}),contrast:{...rt(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:be("borderColor"),divideOpacity:be("borderOpacity"),divideWidth:be("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:e})=>({...e("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({...e("spacing"),...er(2,6),...er(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:be("spacing"),gradientColorStops:be("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:e})=>({...e("spacing"),...er(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:e})=>({...e("spacing"),...er(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...rt(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),maxHeight:({theme:e})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...e("spacing")}),maxWidth:({theme:e,breakpoints:t})=>({...t(e("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...rt(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:be("spacing"),placeholderColor:be("colors"),placeholderOpacity:be("opacity"),outlineColor:be("colors"),outlineOffset:ht(8,"px"),outlineWidth:ht(8,"px"),ringColor:({theme:e})=>({...e("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:be("colors"),ringOffsetWidth:ht(8,"px"),ringOpacity:({theme:e})=>({...e("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...ht(8,"px")},rotate:{...ht(2,"deg"),...ht(12,"deg",3),...ht(180,"deg",45)},saturate:rt(200,"",100,0,50),scale:{...rt(150,"",100,0,50),...rt(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:be("spacing"),scrollPadding:be("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...ht(2,"deg"),...ht(12,"deg",3)},space:be("spacing"),stroke:({theme:e})=>({...e("colors"),none:"none"}),strokeWidth:rt(2),textColor:be("colors"),textDecorationColor:be("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...ht(8,"px")},textUnderlineOffset:{auto:"auto",...ht(8,"px")},textIndent:be("spacing"),textOpacity:be("opacity"),transitionDuration:({theme:e})=>({...e("durations"),DEFAULT:"150ms"}),transitionDelay:be("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:e})=>({...e("spacing"),...er(2,4),full:"100%"}),width:({theme:e})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...e("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...rt(50,"",1,0,10),auto:"auto"}};function er(e,t){let r={};do for(var n=1;nt(e)}var K3={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Ks.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Ks.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}},V3=[re("\\[([-\\w]+):(.+)]",({1:e,2:t},r)=>({"@layer overrides":{"&":{[e]:zt(`[${t}]`,"",r)}}})),re("(group|peer)([~/][^-[]+)?",({input:e},{h:t})=>[{c:t(e)}]),oe("aspect-","aspectRatio"),re("container",(e,{theme:t})=>{let{screens:r=t("screens"),center:n,padding:i}=t("container"),a={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...f("xs")};for(let b in r){let o=r[b];typeof o=="string"&&(a[oa(o)]={"&":{maxWidth:o,...f(b)}})}return a;function f(b){let o=i&&(typeof i=="string"?i:i[b]||i.DEFAULT);if(o)return{paddingRight:o,paddingLeft:o}}}),oe("content-","content",({_:e})=>({"--tw-content":e,content:"var(--tw-content)"})),re("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),re("box-(border|content)","boxSizing",({1:e})=>e+"-box"),re("hidden",{display:"none"}),re("table-(auto|fixed)","tableLayout"),re(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",re("isolate","isolation"),re("object-(contain|cover|fill|none|scale-down)","objectFit"),oe("object-","objectPosition"),re("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",oo),re("overscroll(-[xy])?-(auto|contain|none)",({1:e="",2:t})=>({["overscroll-behavior"+e]:t})),re("(static|fixed|absolute|relative|sticky)","position"),oe("-?inset(-[xy])?(?:$|-)","inset",({1:e,_:t})=>({top:e!="-x"&&t,right:e!="-y"&&t,bottom:e!="-x"&&t,left:e!="-y"&&t})),oe("-?(top|bottom|left|right)(?:$|-)","inset"),re("(visible|collapse)","visibility"),re("invisible",{visibility:"hidden"}),oe("-?z-","zIndex"),re("flex-((row|col)(-reverse)?)","flexDirection",m1),re("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),oe("(flex-(?:grow|shrink))(?:$|-)"),oe("(flex)-"),oe("grow(?:$|-)","flexGrow"),oe("shrink(?:$|-)","flexShrink"),oe("basis-","flexBasis"),oe("-?(order)-"),"-?(order)-(\\d+)",oe("grid-cols-","gridTemplateColumns"),re("grid-cols-(\\d+)","gridTemplateColumns",C1),oe("col-","gridColumn"),re("col-(span)-(\\d+)","gridColumn",_1),oe("col-start-","gridColumnStart"),re("col-start-(auto|\\d+)","gridColumnStart"),oe("col-end-","gridColumnEnd"),re("col-end-(auto|\\d+)","gridColumnEnd"),oe("grid-rows-","gridTemplateRows"),re("grid-rows-(\\d+)","gridTemplateRows",C1),oe("row-","gridRow"),re("row-(span)-(\\d+)","gridRow",_1),oe("row-start-","gridRowStart"),re("row-start-(auto|\\d+)","gridRowStart"),oe("row-end-","gridRowEnd"),re("row-end-(auto|\\d+)","gridRowEnd"),re("grid-flow-((row|col)(-dense)?)","gridAutoFlow",e=>oo(m1(e))),re("grid-flow-(dense)","gridAutoFlow"),oe("auto-cols-","gridAutoColumns"),oe("auto-rows-","gridAutoRows"),oe("gap-x(?:$|-)","gap","columnGap"),oe("gap-y(?:$|-)","gap","rowGap"),oe("gap(?:$|-)","gap"),"(justify-(?:items|self))-",re("justify-","justifyContent",v1),re("(content|items|self)-",e=>({["align-"+e[1]]:v1(e)})),re("(place-(content|items|self))-",({1:e,$$:t})=>({[e]:("wun".includes(t[3])?"space-":"")+t})),oe("p([xytrbl])?(?:$|-)","padding",xn("padding")),oe("-?m([xytrbl])?(?:$|-)","margin",xn("margin")),oe("-?space-(x|y)(?:$|-)","space",({1:e,_:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[e]]:`calc(${t} * calc(1 - var(--tw-space-${e}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[e]]:`calc(${t} * var(--tw-space-${e}-reverse))`}})),re("space-(x|y)-reverse",({1:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${e}-reverse`]:"1"}})),oe("w-","width"),oe("min-w-","minWidth"),oe("max-w-","maxWidth"),oe("h-","height"),oe("min-h-","minHeight"),oe("max-h-","maxHeight"),oe("font-","fontWeight"),oe("font-","fontFamily",({_:e})=>typeof(e=Re(e))[1]=="string"?{fontFamily:gt(e)}:{fontFamily:gt(e[0]),...e[1]}),re("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),re("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),re("italic","fontStyle"),re("not-italic",{fontStyle:"normal"}),re("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:e,2:t="",3:r})=>t=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(t[0])?"numeric-spacing":t?"numeric-figure":e)]:e,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...Vt({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),oe("tracking-","letterSpacing"),oe("leading-","lineHeight"),re("list-(inside|outside)","listStylePosition"),oe("list-","listStyleType"),re("list-","listStyleType"),oe("placeholder-opacity-","placeholderOpacity",({_:e})=>({"&::placeholder":{"--tw-placeholder-opacity":e}})),Fe("placeholder-",{property:"color",selector:"&::placeholder"}),re("text-(left|center|right|justify|start|end)","textAlign"),re("text-(ellipsis|clip)","textOverflow"),oe("text-opacity-","textOpacity","--tw-text-opacity"),Fe("text-",{property:"color"}),oe("text-","fontSize",({_:e})=>typeof e=="string"?{fontSize:e}:{fontSize:e[0],...typeof e[1]=="string"?{lineHeight:e[1]}:e[1]}),oe("indent-","textIndent"),re("(overline|underline|line-through)","textDecorationLine"),re("no-underline",{textDecorationLine:"none"}),oe("underline-offset-","textUnderlineOffset"),Fe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),oe("decoration-","textDecorationThickness"),re("decoration-","textDecorationStyle"),re("(uppercase|lowercase|capitalize)","textTransform"),re("normal-case",{textTransform:"none"}),re("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),re("align-","verticalAlign"),re("whitespace-","whiteSpace"),re("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),re("break-words",{overflowWrap:"break-word"}),re("break-all",{wordBreak:"break-all"}),re("break-keep",{wordBreak:"keep-all"}),Fe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),Fe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),re("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:e})=>`linear-gradient(to ${fn(e," ")},var(--tw-gradient-stops))`),Fe("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-from":e.value,"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),Fe("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-gradient-to":e.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${e.value},var(--tw-gradient-to)`})),Fe("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),re("bg-(fixed|local|scroll)","backgroundAttachment"),re("bg-origin-(border|padding|content)","backgroundOrigin",({1:e})=>e+"-box"),re(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),re("bg-blend-","backgroundBlendMode"),re("bg-clip-(border|padding|content|text)","backgroundClip",({1:e})=>e+(e=="text"?"":"-box")),oe("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),Fe("bg-",{section:"backgroundColor"}),oe("bg-","backgroundImage"),oe("bg-","backgroundPosition"),re("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",oo),oe("bg-","backgroundSize"),oe("rounded(?:$|-)","borderRadius"),oe("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:e,_:t})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[e]||[e,e];return{[`border-${fn(r[0])}-radius`]:t,[`border-${fn(r[1])}-radius`]:t}}),re("border-(collapse|separate)","borderCollapse"),oe("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),re("border-(solid|dashed|dotted|double|none)","borderStyle"),oe("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:e,_:t})=>({...Vt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(e||"-x")]:t,["--tw-border-spacing"+(e||"-y")]:t,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),Fe("border-([xytrbl])-",{section:"borderColor"},xn("border","Color")),Fe("border-"),oe("border-([xytrbl])(?:$|-)","borderWidth",xn("border","Width")),oe("border(?:$|-)","borderWidth"),oe("divide-opacity(?:$|-)","divideOpacity",({_:e})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":e}})),re("divide-(solid|dashed|dotted|double|none)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:e}})),re("divide-([xy]-reverse)",({1:e})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+e]:"1"}})),oe("divide-([xy])(?:$|-)","divideWidth",({1:e,_:t})=>{let r={x:"lr",y:"tb"}[e];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${e}-reverse`]:"0",[`border-${fn(r[0])}Width`]:`calc(${t} * calc(1 - var(--tw-divide-${e}-reverse)))`,[`border-${fn(r[1])}Width`]:`calc(${t} * var(--tw-divide-${e}-reverse))`}}}),Fe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),oe("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),Fe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),oe("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),re("ring-inset",{"--tw-ring-inset":"inset"}),Fe("ring-",{property:"--tw-ring-color"}),oe("ring(?:$|-)","ringWidth",({_:e},{theme:t})=>({...Vt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":t("ringOffsetWidth","","0px"),"--tw-ring-offset-color":qt(t("ringOffsetColor","","#fff")),"--tw-ring-color":qt(t("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":t("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${e} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),Fe("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:e})=>({"--tw-shadow-color":e.value,"--tw-shadow":"var(--tw-shadow-colored)"})),oe("shadow(?:$|-)","boxShadow",({_:e})=>({...Vt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":gt(e),"--tw-shadow-colored":gt(e).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),oe("(opacity)-"),re("mix-blend-","mixBlendMode"),...E1(),...E1("backdrop-"),oe("transition(?:$|-)","transitionProperty",(e,{theme:t})=>({transitionProperty:gt(e),transitionTimingFunction:e._=="none"?void 0:gt(t("transitionTimingFunction","")),transitionDuration:e._=="none"?void 0:gt(t("transitionDuration",""))})),oe("duration(?:$|-)","transitionDuration","transitionDuration",gt),oe("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",gt),oe("delay(?:$|-)","transitionDelay","transitionDelay",gt),oe("animate(?:$|-)","animation",(e,{theme:t,h:r,e:n})=>{let i=gt(e),a=i.split(" "),f=t("keyframes",a[0]);return f?{["@keyframes "+(a[0]=n(r(a[0])))]:f,animation:a.join(" ")}:{animation:i}}),"(transform)-(none)",re("transform",Vs),re("transform-(cpu|gpu)",({1:e})=>({"--tw-transform":Gh(e=="gpu")})),oe("scale(-[xy])?-","scale",({1:e,_:t})=>({["--tw-scale"+(e||"-x")]:t,["--tw-scale"+(e||"-y")]:t,...Vs()})),oe("-?(rotate)-","rotate",is),oe("-?(translate-[xy])-","translate",is),oe("-?(skew-[xy])-","skew",is),re("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",oo),"(appearance)-",oe("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",oe("(cursor)-"),"(cursor)-",re("snap-(none)","scroll-snap-type"),re("snap-(x|y|both)",({1:e})=>({...Vt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":e+" var(--tw-scroll-snap-strictness)"})),re("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),re("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),re("snap-(normal|always)","scroll-snap-stop"),re("scroll-(auto|smooth)","scroll-behavior"),oe("scroll-p([xytrbl])?(?:$|-)","padding",xn("scroll-padding")),oe("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",xn("scroll-margin")),re("touch-(auto|none|manipulation)","touch-action"),re("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:e,2:t,3:r})=>({...Vt({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${t?"pan-x":r?"pan-y":e}`]:e,"touch-action":"var(--tw-touch-action)"})),re("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),re("outline",{outlineStyle:"solid"}),re("outline-(dashed|dotted|double)","outlineStyle"),oe("-?(outline-offset)-"),Fe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),oe("outline-","outlineWidth"),"(pointer-events)-",oe("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:e})=>({x:"horizontal",y:"vertical"})[e]||e||"both"],re("select-(none|text|all|auto)","userSelect"),Fe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),Fe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),oe("stroke-","strokeWidth"),re("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),re("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function oo(e){return(typeof e=="string"?e:e[1]).replace(/-/g," ").trim()}function m1(e){return(typeof e=="string"?e:e[1]).replace("col","column")}function fn(e,t="-"){let r=[];for(let n of e)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(t)}function gt(e){return e&&""+(e._||e)}function v1({$$:e}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[e[3]||""]||"")+e}function xn(e,t=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...go(e+"-"+fn(i[0])+t,n),...go(e+"-"+fn(i[1])+t,n)}:go(e+t,n)}}function E1(e=""){let t=["blur","brightness","contrast","grayscale","hue-rotate","invert",e&&"opacity","saturate","sepia",!e&&"drop-shadow"].filter(Boolean),r={};for(let n of t)r[`--tw-${e}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...Vt(r),[`${e}filter`]:t.map(n=>`var(--tw-${e}${n})`).join(" ")},[`(${e}filter)-(none)`,re(`${e}filter`,r),...t.map(n=>oe(`${n[0]=="h"?"-?":""}(${e}${n})(?:$|-)`,n,({1:i,_:a})=>({[`--tw-${i}`]:Re(a).map(f=>`${n}(${f})`).join(" "),...r})))]}function is({1:e,_:t}){return{["--tw-"+e]:t,...Vs()}}function Vs(){return{...Vt({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Gh()}),transform:"var(--tw-transform)"}}function Gh(e){return[e?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function _1({1:e,2:t}){return`${e} ${t} / ${e} ${t}`}function C1({1:e}){return`repeat(${e},minmax(0,1fr))`}function Vt(e){return{"@layer defaults":{"*,::before,::after":e,"::backdrop":e}}}var Z3=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:e})=>`@media (orientation:${e})`],["contrast-(more|less)",({1:e})=>`@media (prefers-contrast:${e})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:e})=>`&::${e}`],["(marker|selection)",({1:e})=>`& *::${e},&::${e}`],["file","&::file-selector-button"],["(first|last|only)",({1:e})=>`&:${e}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:e,$$:t},r)=>t&&`&[${e}-${r.theme(e,t)||zt(t,"",r)||`${t}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:e,3:t="",4:r,5:n="",6:i=t},{e:a,h:f,v:b})=>{let o=wr(n)||(r[0]=="["?r:b(r.slice(1)));return`${(o.includes("&")?o:"&"+o).replace(/&/g,`:merge(.${a(f(e+i))})`)}${e[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:e})=>`[dir="${e}"] &`],["supports-",({$$:e},t)=>{if(e&&(e=t.theme("supports",e)||zt(e,"",t)),e)return e.includes(":")||(e+=":var(--tw)"),/^\w*\s*\(/.test(e)||(e=`(${e})`),`@supports ${e.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:e},t)=>{if(e&&(e=t.theme("screens",e)||zt(e,"",t)),typeof e=="string")return`@media not all and (min-width:${e})`}],["min-",({$$:e},t)=>(e&&(e=zt(e,"",t)),e&&`@media (min-width:${e})`)],[/^\[(.+)]$/,({1:e})=>/[&@]/.test(e)&&wr(e).replace(/[}]+$/,"").split("{")]],Y3={__proto__:null,slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"}};function q3({disablePreflight:e}={}){return(function({colors:t,disablePreflight:r}={}){return{preflight:r?void 0:K3,theme:{...Ks,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Z3,rules:V3,finalize:n=>n.n&&n.d&&n.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(n.d)?{...n,d:"content:var(--tw-content);"+n.d}:n}})({colors:Y3,disablePreflight:e})}var z3=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function ss(e){return e.shadowRoot||e.attachShadow({mode:"open"})}var as={"brand-light":"var(--bc-color-brand, #196CE7)","brand-dark":"var(--bc-color-brand-dark, var(--bc-color-brand, #3994FF))","brand-button-text-light":"var(--bc-color-brand-button-text)","brand-button-text-dark":"var(--bc-color-brand-button-text-dark, var(--bc-color-brand-button-text))","brand-mixed-light":"color-mix(in srgb, var(--bc-color-brand, #196CE7) var(--bc-brand-mix, 100%), black)","brand-mixed-dark":"color-mix(in srgb, var(--bc-color-brand-dark, var(--bc-color-brand, #3994FF)) var(--bc-brand-mix, 100%), white)","foreground-light":"#000","foreground-dark":"#fff","background-light":"#fff","background-dark":"#000","neutral-primary-light":"#262626","neutral-primary-dark":"#E4E4E4","neutral-secondary-light":"#525252","neutral-secondary-dark":"#A2A2A2","neutral-tertiary-light":"#A2A2A2","neutral-tertiary-dark":"#525252"},Q3={"glass-light":"linear-gradient(180deg, rgba(211, 211, 211, 0.20) 0%, rgba(255, 255, 255, 0.20) 50%);","glass-dark":"linear-gradient(180deg, rgba(211, 211, 211, 0.10) 0%, rgba(0, 0, 0, 0.20) 50%)"},Ce=()=>globalThis.window?(function(e,t=!0){let r=(function(){if(z3)try{let o=os(new CSSStyleSheet);return o.connect=p=>{let d=ss(p);d.adoptedStyleSheets=[...d.adoptedStyleSheets,o.target]},o.disconnect=Fs,o}catch{}let a=document.createElement("style");a.media="not all",document.head.prepend(a);let f=[os(a)],b=new WeakMap;return{get target(){return f[0].target},snapshot(){let o=f.map(p=>p.snapshot());return()=>o.forEach(p=>p())},clear(){f.forEach(o=>o.clear())},destroy(){f.forEach(o=>o.destroy())},insert(o,p,d){f[0].insert(o,p,d);let h=this.target.cssRules[p];f.forEach((u,c)=>c&&u.target.insertRule(h.cssText,p))},resume:(o,p)=>f[0].resume(o,p),connect(o){let p=document.createElement("style");ss(o).appendChild(p);let d=os(p),{cssRules:h}=this.target;for(let u=0;u=0&&f.splice(p,1)}}})(),n=(function(a,f){let b=b1(a),o=(function({theme:c,darkMode:s,darkColor:l=Fs,variants:g,rules:w,hash:y,stringify:v,ignorelist:m,finalize:C}){let E=new Map,O=new Map,_=new Map,S=new Map,R=$h(m,(N,x)=>x.test(N));g.push(["dark",Array.isArray(s)||s=="class"?`${Re(s)[1]||".dark"} &`:typeof s=="string"&&s!="media"?s:"@media (prefers-color-scheme:dark)"]);let A=typeof y=="function"?N=>y(N,Co):y?Co:f1;A!==f1&&C.push(N=>({...N,n:N.n&&A(N.n),d:N.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(x,I)=>"--"+A(I).replace("#",""))}));let T={theme:(function({extend:N={},...x}){let I={},L={get colors(){return H("colors")},theme:H,negative:()=>({}),breakpoints(K){let P={};for(let B in K)typeof K[B]=="string"&&(P["screen-"+B]=K[B]);return P}};return H;function H(K,P,B,G){if(K){if({1:K,2:G}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(K)||[,K],/[.[]/.test(K)){let F=[];K.replace(/\[([^\]]+)\]|([^.[]+)/g,(D,k,j=k)=>F.push(j)),K=F.shift(),B=P,P=F.join("-")}let z=I[K]||Object.assign(Object.assign(I[K]={},Z(x,K)),Z(N,K));if(P==null)return z;P||(P="DEFAULT");let U=z[P]??P.split("-").reduce((F,D)=>F?.[D],z)??B;return G?qt(U,{opacityValue:sa(G,H)}):U}let V={};for(let z of[...Object.keys(x),...Object.keys(N)])V[z]=H(z);return V}function Z(K,P){let B=K[P];return typeof B=="function"&&(B=B(L)),B&&/color|fill|stroke/i.test(P)?(function G(V,z=[]){let U={};for(let F in V){let D=V[F],k=[...z,F];U[k.join("-")]=D,F=="DEFAULT"&&(k=z,U[z.join("-")]=D),typeof D=="object"&&Object.assign(U,G(D,k))}return U})(B):B}})(c),e:Lh,h:A,s:(N,x)=>v(N,x,T),d:(N,x,I)=>l(N,x,T,I),v:N=>(E.has(N)||E.set(N,w1(N,g,O,$3,T)||"&:"+N),E.get(N)),r(N,x){let I=JSON.stringify([N,x]);return _.has(I)||_.set(I,!R(N,T)&&w1(N,w,S,G3,T,x)),_.get(I)},f:N=>C.reduce((x,I)=>I(x,T),N)};return T})(b),p=new Map,d=[],h=new Set;function u(c){let s=o.f(c),l=Hs(s);if(l&&!h.has(l)){h.add(l);let g=Dh(d,c);f.insert(l,g,c),d.splice(g,0,c)}return s.n}return f.resume(c=>p.set(c,c),(c,s)=>{f.insert(c,d.length,s),d.push(s),h.add(c)}),Object.defineProperties(function(c){if(!p.size)for(let l of Re(b.preflight))typeof l=="function"&&(l=l(o)),l&&(typeof l=="string"?aa("",Me.b,So(l),o,Me.b,[],!1,!0):Fh(l,{},o,Me.b)).forEach(u);let s=p.get(c=""+c);if(!s){let l=new Set;for(let g of Ao(So(c),o))l.add(g.c).add(u(g));s=[...l].filter(Boolean).join(" "),p.set(c,s).set(s,s)}return s},Object.getOwnPropertyDescriptors({get target(){return f.target},theme:o.theme,config:b,snapshot(){let c=f.snapshot(),s=new Set(h),l=new Map(p),g=[...d];return()=>{c(),h=s,p=l,d=g}},clear(){f.clear(),h=new Set,p=new Map,d=[]},destroy(){this.clear(),f.destroy()}}))})({...e,hash:e.hash??t},r),i=(function(a){let f=new MutationObserver(b);return{observe(p){f.observe(p,{attributeFilter:["class"],subtree:!0,childList:!0}),o(p),b([{target:p,type:""}])},disconnect(){f.disconnect()}};function b(p){for(let{type:d,target:h}of p)if(d[0]=="a")o(h);else for(let u of h.querySelectorAll("[class]"))o(u);f.takeRecords()}function o(p){let d,h=p.getAttribute?.("class");h&&(function(u,c){return u!=c&&""+u.split(" ").sort()!=""+c.split(" ").sort()})(h,d=a(h))&&p.setAttribute("class",d)}})(n);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(ss(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...f){super(...f),this.tw=n}}}})(b1({darkMode:globalThis.bcDarkMode,theme:{fontFamily:{sans:["Inter","sans-serif"],mono:["Roboto Mono","monospace"]},extend:{borderColor:Ct({},as),backgroundColor:Ct({},as),textColor:Ct({},as),backgroundImage:Ct({},Q3),animation:{darken:"darken 0.2s ease-out forwards","fade-in":"fade-in 0.2s ease-out forwards","slide-up":"slideUp 0.3s ease-out forwards"},keyframes:{darken:{"0%":{opacity:0},"100%":{opacity:.5}},lighten:{"0%":{opacity:.5},"100%":{opacity:0}},"fade-in":{"0%":{opacity:0},"100%":{opacity:1}},"fade-out":{"0%":{opacity:1},"100%":{opacity:0}},slideUp:{from:{transform:"translateY(100%)"},to:{transform:"translateY(0)"}}}}},presets:[q3({})],hash:!1})):J3;function J3(e){return e}var qe="transition-all hover:brightness-90 dark:hover:brightness-110 active:scale-95 cursor-pointer",Zs="hover-animation",Pe="text-brand-mixed-light dark:text-brand-mixed-dark",It="text-foreground-light dark:text-foreground-dark",mr="text-neutral-primary-light dark:text-neutral-primary-dark",de="text-neutral-secondary-light dark:text-neutral-secondary-dark",At="text-neutral-tertiary-light dark:text-neutral-tertiary-dark",bn="border-neutral-secondary-light dark:border-neutral-secondary-dark",ca="border-neutral-tertiary-light dark:border-neutral-tertiary-dark",A1,S1,T1,Ys=e=>e;function Wh(){return X(A1||(A1=Ys`
`),ca)}function X3(e){ne.getState().connected&&e(ne.getState().provider);let t=ne.subscribe(async(r,n)=>{if(r.connected&&!n.connected){if(!r.provider)throw new Error("No provider available");e(r.provider)}});return()=>{t()}}function e5(e){let t=ne.subscribe(async(r,n)=>{!r.connected&&n.connected&&e()});return()=>{t()}}function t5(e){let t=ne.subscribe(async(r,n)=>{!r.modalOpen&&n.modalOpen&&e()});return()=>{t()}}function n5(){return console.warn("Bitcoin Connect: isConnected is deprecated and will be removed in the next major version"),ne.getState().connected}function r5(e={}){ne.getState().setBitcoinConnectConfig(e)}function Kh(){let e=document.createElement("bc-modal"),t=document.createElement("bc-connect");t.setAttribute("closable","closable"),e.appendChild(t),document.body.appendChild(e),ne.getState().setModalOpen(!0)}function o5({invoice:e,paymentMethods:t,onPaid:r,onCancelled:n}){if(document.querySelector("bc-modal"))throw new Error("bc-modal already in DOM");let i=document.createElement("bc-modal"),a=document.createElement("bc-payment");a.setAttribute("closable","closable"),a.setAttribute("invoice",e),t&&a.setAttribute("payment-methods",t),i.appendChild(a);let f=!1,b=p=>{f=!0,r?.(p.detail)};window.addEventListener("bc:onpaid",b);let o=t5(()=>{o(),window.removeEventListener("bc:onpaid",b),f||n==null||n()});return document.body.appendChild(i),ne.getState().setModalOpen(!0),{setPaid:p=>{a.setAttribute("paid","paid"),a.dispatchEvent(new CustomEvent("bc:onpaid",{bubbles:!0,composed:!0,detail:p}))}}}function No(){let e=document.querySelector("bc-modal");e&&document.body.removeChild(e),ne.getState().setModalOpen(!1),ne.getState().clearRouteHistory(),ne.getState().setError(void 0)}function i5(){ne.getState().disconnect()}function s5(){return ne.getState().connectorConfig}var O1,a5=e=>e,Rn=class extends Ce()(ye){constructor(){super(),this._loading=!1,this._loadBalance(),window.addEventListener("bc:balancerefresh",()=>{this._loadBalance()}),this._selectedCurrency=ne.getState().currency,ne.subscribe((e,t)=>{this._selectedCurrency=e.currency,e.currency!==t.currency&&this._convertBalance(),e.connected!==t.connected&&e.connected&&this._loadBalance()})}render(){return X(O1||(O1=a5` ${0} `),Pe,this._balance||"Loading...")}async _convertBalance(){if(this._loading||this._balanceSats===void 0)return;let e=this._selectedCurrency||"sats";if(e==="BTC")this._balance=(this._balanceSats/1e8).toLocaleString(void 0,{minimumFractionDigits:8,useGrouping:!0})+" BTC";else if(e!=="sats"){try{this._loading=!0;let t=await Ul({satoshi:this._balanceSats,currency:e}),r=parseFloat(t.toFixed(2));this._balance=new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(r)}catch(t){console.error(t)}this._loading=!1}else this._balance=this._balanceSats.toLocaleString(void 0,{useGrouping:!0})+" sats"}_loadBalance(){var e=this;(async function(){try{let t=ne.getState().provider;if(t==null||!t.getBalance)return;let r=await t.getBalance();r&&(e._balanceSats=r.balance,e._convertBalance())}catch(t){e._balance="\u26A0\uFE0F",console.error(t)}})()}};ee([ge()],Rn.prototype,"_balance",void 0),ee([ge()],Rn.prototype,"_balanceSats",void 0),ee([ge()],Rn.prototype,"_loading",void 0),ee([ge()],Rn.prototype,"_selectedCurrency",void 0),Rn=ee([pe("bc-balance")],Rn);var N1,c5=e=>e,wn=e=>Ee(N1||(N1=c5` `),e||"w-7 h-7"),x1,R1,I1,P1,k1,L1,U1,M1,ln=e=>e,io=class extends Ce()(ye){constructor(){super(),this.title="Connect Wallet",this._showBalance=void 0,this._showBalance=ne.getState().bitcoinConnectConfig.showBalance&&ne.getState().supports("getBalance"),ne.subscribe(e=>{this._showBalance=e.bitcoinConnectConfig.showBalance&&e.supports("getBalance")})}render(){let e=this._connecting||!this._connected&&this._modalOpen;return X(x1||(x1=ln`
${0} ${0} ${0} ${0}
`),qe,this._onClick,this._connected?"bg-glass-light dark:bg-glass-dark":"",this._connected?Wh():"",e?X(R1||(R1=ln` ${0} `),wn("w-11 h-11 -mr-2 mr-1 -ml-2.5")):this._connected?null:X(I1||(I1=ln`${0}`),lr),e?X(P1||(P1=ln`Connecting...`)):this._connected?X(k1||(k1=ln`Connected`)):X(L1||(L1=ln`${0}`),this.title),this._connected&&this._showBalance?X(U1||(U1=ln` `)):null)}_onClick(){Kh()}};ee([Ue()],io.prototype,"title",void 0),ee([ge()],io.prototype,"_showBalance",void 0),io=ee([pe("bc-button")],io);var l5=Ee(M1||(M1=(e=>e)` `)),D1,B1,F1,j1,H1,$1,In=e=>e,Gt=class extends Ce()(ye){constructor(){super(...arguments),this.title="Pay Now",this.paymentMethods="all",this._waitingForInvoice=!1,this._paid=!1}updated(e){var t;super.updated(e),e.has("invoice")&&this.invoice&&this._waitingForInvoice&&this._launchModal(),e.has("invoice")&&!this.invoice&&(this._waitingForInvoice=!1,this._paid=!1),e.has("preimage")&&this.preimage&&((t=this._setPaid)==null||t.call(this,{preimage:this.preimage}))}render(){let e=!this._paid&&(this._waitingForInvoice||this._modalOpen);return X(D1||(D1=In`
${0} ${0}
`),this._onClick,e?X(B1||(B1=In`${0}`),wn("w-11 h-11 -mr-2 -ml-2.5 ")):this._paid?X(F1||(F1=In`${0}`),l5):X(j1||(j1=In`${0}`),lr),e?X(H1||(H1=In`Loading...`)):X($1||($1=In`${0}`),this._paid?"Paid":this.title))}_onClick(){this._paid||(this._waitingForInvoice=!0,this.invoice&&this._launchModal())}_launchModal(){if(this._waitingForInvoice=!1,!this.invoice)throw new Error("No invoice available");let{setPaid:e}=o5({onPaid:()=>{this._paid=!0},invoice:this.invoice,paymentMethods:this.paymentMethods});this._setPaid=e}};ee([Ue()],Gt.prototype,"title",void 0),ee([Ue()],Gt.prototype,"invoice",void 0),ee([Ue({type:String,attribute:"payment-methods"})],Gt.prototype,"paymentMethods",void 0),ee([Ue({})],Gt.prototype,"preimage",void 0),ee([ge()],Gt.prototype,"_waitingForInvoice",void 0),ee([ge()],Gt.prototype,"_paid",void 0),Gt=ee([pe("bc-pay-button")],Gt);var G1,W1,u5=e=>e,tr=class extends Ce()(br){constructor(){super(...arguments),this.variant="secondary",this.ghost=!1,this.block=!1}render(){let e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,t=window.getComputedStyle(this).getPropertyValue(e?"--bc-color-brand-button-text-dark":"--bc-color-brand-button-text")||window.getComputedStyle(this).getPropertyValue("--bc-color-brand-button-text");return X(G1||(G1=u5``),this.ghost?"":"shadow",qe,this.variant==="primary"?"bg-brand-light dark:bg-brand-dark":"",this.variant==="primary"?t?"text-brand-button-text-light dark:text-brand-button-text-dark":this._getBrandColorLuminance()>.5?"text-black":"text-white":this.variant==="secondary"?`${Pe}`:`${At}`,this.ghost?null:this.variant==="primary"?Wh():this.variant==="secondary"?X(S1||(S1=Ys`
`),"border-brand-mixed-light dark:border-brand-mixed-dark"):X(T1||(T1=Ys`
`),ca),this.block?"w-full":"")}};ee([Ue()],tr.prototype,"variant",void 0),ee([Ue({type:Boolean})],tr.prototype,"ghost",void 0),ee([Ue({type:Boolean})],tr.prototype,"block",void 0),tr=ee([pe("bci-button")],tr);var h5=Ee(W1||(W1=(e=>e)` `)),K1,f5=e=>e,st=class extends Ce()(ye){constructor(t,r,n,i){super(),this._connectorType=t,this._title=r,this._background=n,this._icon=i}render(){return X(K1||(K1=f5``),qe,this._title,this._onClick,this._background,this._icon,de,this._title)}_connect(t){ne.getState().connect(Ct({},t,{connectorName:this._title,connectorType:this._connectorType}))}},V1,Z1=class extends st{constructor(){super("extension.generic","Browser Extensions","#F4F4F4",h5)}_onClick(){this._connect({})}};Z1=ee([pe("bc-extension-connector")],Z1);var Vh=Ee(V1||(V1=(e=>e)` `)),Zh="Alby Hub",Y1,q1=class extends st{constructor(){super("nwc.albyhub",Zh,"#000000",Vh)}async _onClick(){ne.getState().pushRoute("/alby-hub")}};q1=ee([pe("bc-alby-hub-connector")],q1);var d5=Ee(Y1||(Y1=(e=>e)` `)),la="NWC",z1,Q1=class extends st{constructor(){super("nwc.generic",la,"#ffffff",d5)}async _onClick(){ne.getState().pushRoute("/nwc")}};Q1=ee([pe("bc-nwc-connector")],Q1);var p5=Ee(z1||(z1=(e=>e)``)),J1,X1=class extends st{constructor(){super("lnc","Lightning Node Connect","#101727",p5)}async _onClick(){let e=window.prompt("Enter pairing phrase");if(!e)return;let t=await Ah();if(!t)throw new Error("LNC not supported");t.credentials.pairingPhrase=e,this._connect({})}};X1=ee([pe("bc-lnc-connector")],X1);var Yh=Ee(J1||(J1=(e=>e)` `)),qs="LNbits",eu=class extends st{constructor(){super("lnbits",qs,"#673ab7",Yh)}async _onClick(){ne.getState().pushRoute("/lnbits")}};eu=ee([pe("bc-lnbits-connector")],eu);var zs="LNbits NWC Plugin",tu,nu=class extends st{constructor(){super("lnbits",zs,"#673ab7",Yh)}async _onClick(){ne.getState().pushRoute("/lnbits-nwc")}};nu=ee([pe("bc-lnbits-nwc-connector")],nu);var y5=Ee(tu||(tu=(e=>e)` `)),g5="LN Link",ru,ou=class extends st{constructor(){super("nwc.generic",g5,"#ffffff",y5)}async _onClick(){ne.getState().pushRoute("/lnfi")}};ou=ee([pe("bc-lnfi-nwc-connector")],ou);var b5=Ee(ru||(ru=(e=>e)``)),w5="Coinos",iu,su=class extends st{constructor(){super("nwc.coinos",w5,"#ffffff",b5)}async _onClick(){try{var e;let t=ne.getState().bitcoinConnectConfig.providerConfig,r=await jt.fromAuthorizationUrl("https://coinos.io/apps/new",Ct({},(t==null||(e=t.nwc)==null?void 0:e.authorizationUrlOptions)||{},{name:this._appName}));r.close(),await ne.getState().connect({nwcUrl:r.nostrWalletConnectUrl,connectorName:"Coinos",connectorType:"nwc.coinos"})}catch(t){console.error(t),alert(""+t)}}};su=ee([pe("bc-coinos-connector")],su);var m5=Ee(iu||(iu=(e=>e)``)),v5="Flash Wallet",au,cu=class extends st{constructor(){super("nwc.flash",v5,"#000000",m5)}async _onClick(){ne.getState().pushRoute("/flash-wallet")}};cu=ee([pe("bc-flash-connector")],cu);var E5=Ee(au||(au=(e=>e)` `)),Qs="Rizful",lu=class extends st{constructor(){super("nwc.rizful",Qs,"#000000",E5)}async _onClick(){ne.getState().pushRoute("/rizful")}};lu=ee([pe("bc-rizful-connector")],lu);var uu,hu,fu,du,pu,yu,gu,bu,wu,mu,vu,Eu,_u,Cu,ot=e=>e,cs=class extends Ce()(ye){constructor(){super(...arguments),this._showAll=!1}render(){let e=[];return e.push({order:0,result:X(uu||(uu=ot``))}),e.push({order:0,result:X(hu||(hu=ot``))}),e.push({order:0,result:X(fu||(fu=ot``))}),e.push({order:0,result:X(du||(du=ot``))}),this._filters&&this._filters.indexOf("nwc")>-1&&e.push({order:0,result:X(pu||(pu=ot``))}),e.push({order:0,result:X(yu||(yu=ot``))}),e.push({order:0,result:X(gu||(gu=ot``))}),e.push({order:10,result:X(bu||(bu=ot``))}),this._filters&&this._filters.indexOf("nwc")!==-1||(window.webln&&e.push({order:0,result:X(wu||(wu=ot``))}),e.push({order:7,result:X(mu||(mu=ot``))}),e.push({order:9,result:X(vu||(vu=ot``))})),e.sort((t,r)=>t.order-r.order),X(Eu||(Eu=ot`
${0}
${0}
`),this._showAll?"max-h-96 overflow-y-auto":"",(this._showAll?e:e.slice(0,9)).map(t=>t.result),!this._showAll&&e.length>9?X(_u||(_u=ot`
`),qe,de,e.length,this._toggleShowAll,e.length):null)}_toggleShowAll(){this._showAll=!0}};ee([ge()],cs.prototype,"_showAll",void 0),cs=ee([pe("bc-connector-list")],cs);var _5=Ee(Cu||(Cu=(e=>e)` `)),Au,Su,Tu=e=>e;function ua(e){return X(Au||(Au=Tu`
${0} ${0} Disconnect
`),e?X(Su||(Su=Tu`Connected through ${0}`),de,e):null,C5,Zs,_5,At)}function C5(){ne.getState().setModalOpen(!1),setTimeout(()=>{ne.getState().disconnect()},200)}var Ou=e=>String.fromCodePoint(...e.split("").map(t=>127397+t.toUpperCase().charCodeAt(0))),Nu,ls,xu,Ru,Iu,Pu,so=e=>e,ao=(ls=class extends(Nu=Ce()(ye)){constructor(){super(),this._isSwitchingCurrency=!1,this._selectedCurrency=ne.getState().currency,ne.subscribe(e=>{this._selectedCurrency=e.currency})}render(){if(!this._isSwitchingCurrency)return X(xu||(xu=so`
`),qe,this._selectedCurrency||"sats",this._showSelectVisibility);let e=(()=>{let r=[{name:"SATS",value:"sats",flag:"\u20BF"},{name:"BTC",value:"BTC",flag:"\u20BF"},{name:"USD",value:"USD",flag:Ou("US")},{name:"EUR",value:"EUR",flag:"\u{1F1EA}\u{1F1FA}"}];return r.push(...Object.entries({JP:"JPY",CN:"CNY",GB:"GBP",CH:"CHF",IN:"INR",AE:"AED",AF:"AFN",AL:"ALL",DZ:"DZD",AO:"AOA",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BZ:"BZD",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BR:"BRL",BN:"BND",BG:"BGN",BI:"BIF",CV:"CVE",KH:"KHR",CA:"CAD",KY:"KYD",CF:"XAF",CL:"CLP",CO:"COU",KM:"KMF",CD:"CDF",CR:"CRC",CU:"CUC",CW:"ANG",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EG:"EGP",ER:"ERN",ET:"ETB",FJ:"FJD",PF:"XPF",GM:"GMD",GE:"GEL",GH:"GHS",GI:"GIP",GT:"GTQ",GN:"GNF",GY:"GYD",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",ID:"IDR",IR:"XDR",IQ:"IQD",IL:"ILS",JM:"JMD",JO:"JOD",KZ:"KZT",KE:"KES",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LB:"LBP",LR:"LRD",LY:"LYD",MO:"MOP",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",MR:"MRU",MU:"MUR",MX:"MXN",MD:"MDL",MN:"MNT",MA:"MAD",MZ:"MZN",MM:"MMK",NP:"NPR",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",MK:"MKD",NO:"NOK",OM:"OMR",PK:"PKR",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PL:"PLN",QA:"QAR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",WS:"WST",ST:"STN",SA:"SAR",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SB:"SBD",SO:"SOS",ZA:"ZAR",SS:"SSP",LK:"LKR",SD:"SDG",SR:"SRD",SE:"SEK",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB",TO:"TOP",TT:"TTD",TN:"TND",TR:"TRY",TM:"TMT",UG:"UGX",UA:"UAH",UY:"UYU",UZ:"UZS",VU:"VUV",VN:"VND",YE:"YER",ZM:"ZMW",ZW:"ZWL"}).map(([n,i])=>({name:n,value:i,flag:Ou(n)}))),r})(),t=this._selectedCurrency||"sats";return X(Ru||(Ru=so`
${0}
`),e.map(r=>X(Iu||(Iu=so` `),t===r.value?"bg-blue-500 text-white":"",r.value,t===r.value,()=>this._selectCurrency(r.value),r.flag,r.value)))}_showSelectVisibility(){this._isSwitchingCurrency=!0}_selectCurrency(e){ne.getState().setCurrency(e),this._isSwitchingCurrency=!1}},ls.styles=[...Nu.styles,Oo(Pu||(Pu=so` .currencies-list { mask-image: linear-gradient( to bottom, black calc(100% - 96px), transparent 100% ); } /* width */ ::-webkit-scrollbar { width: 6px; height: 18px; } /* Track */ ::-webkit-scrollbar-track { background: #66666666; } /* Handle */ ::-webkit-scrollbar-thumb { background: #888; } /* Handle on hover */ ::-webkit-scrollbar-thumb:hover { background: #555; } `))],ls);ee([ge()],ao.prototype,"_isSwitchingCurrency",void 0),ee([ge()],ao.prototype,"_selectedCurrency",void 0),ao=ee([pe("bc-currency-switcher")],ao);var ku,Lu,Uu,Mu,Du,Bu,nr=e=>e,us=class extends Ce()(ye){constructor(){super(),this._showBalance=void 0,this._showBalance=ne.getState().bitcoinConnectConfig.showBalance&&ne.getState().supports("getBalance"),ne.subscribe(e=>{this._showBalance=e.bitcoinConnectConfig.showBalance&&e.supports("getBalance")})}render(){return X(ku||(ku=nr`
${0}
`),this._connected?X(Lu||(Lu=nr` ${0} ${0} `),X(this._showBalance?Uu||(Uu=nr`Balance `):Mu||(Mu=nr` Wallet Connected`),de),ua(this._connectorName)):X(Du||(Du=nr`

How would you like to connect${0}?

Don't have a bitcoin lightning wallet?

`),mr,this._appName&&this._appName!==As.appName?` to ${this._appName}`:"",mr,qe,Pe,()=>ne.getState().pushRoute("/new-wallet")))}};ee([ge()],us.prototype,"_showBalance",void 0),us=ee([pe("bc-start")],us);var A5=Ee(Bu||(Bu=(e=>e)` `)),Fu,ju,S5=e=>e,hs=class extends Ce()(ye){constructor(){super(...arguments),this._goBack=()=>{ne.getState().popRoute(),ne.getState().setError(void 0)}}render(){return X(Fu||(Fu=S5`
${0}
`),qe,At,this._goBack,A5,mr,this.heading)}};ee([Ue()],hs.prototype,"heading",void 0),hs=ee([pe("bc-navbar")],hs);var Hu=Ee(ju||(ju=(e=>e)` `)),$u,Gu,Wu,Ku=e=>e;function qh(e){let t=`border-t ${ca} ${e?"w-24":"w-full"}`;return X($u||($u=Ku`

${0}
`),t,e?X(Gu||(Gu=Ku` ${0}
`),At,e,t):null)}var T5=Ee(Wu||(Wu=(e=>e)` `)),Vu,O5=e=>e,Zu=class extends Ce()(ye){render(){return X(Vu||(Vu=O5`
How does it work?

Bitcoin Connect is a way to connect to your lightning wallet from any browser.

💾 Your connection is saved in local storage, so next time you visit the site will connect automatically.

💸 Make sure to set budgets and permissions for sites you do not trust.

${0}
Made with love by ${0}
`),Pe,de,de,Zs,Pe,Hu,Zs,Pe,Hu,qh(),At,It,T5)}};Zu=ee([pe("bc-help")],Zu);var Yu,qu,N5=e=>e,ds=class extends Ce()(ye){constructor(){super(...arguments),this._nwcUrl=""}render(){return X(Yu||(Yu=N5`
Enter your Connection Secret below
Connect
`),de,this._nwcUrl,this.nwcUrlChanged,bn,It,this.onConnect)}nwcUrlChanged(e){this._nwcUrl=e.target.value}async onConnect(){this._nwcUrl?await ne.getState().connect({nwcUrl:this._nwcUrl,connectorName:la,connectorType:"nwc.generic"}):ne.getState().setError("Please enter a URL")}};ee([ge()],ds.prototype,"_nwcUrl",void 0),ds=ee([pe("bc-nwc")],ds);var x5=Ee(qu||(qu=(e=>e)` `)),zu,R5=Ee(zu||(zu=(e=>e)``)),Qu,I5=Ee(Qu||(Qu=(e=>e)``)),Ju,Xu,P5=e=>e,e0=class extends Ce()(ye){render(){return X(Ju||(Ju=P5`
Choose how to connect
${0} Alby Cloud ${0} Alby Go ${0} Connection Secret
`),"Connect "+Zh,de,this.onClickAlbyCloud,x5,Pe,this.onClickAlbyGo,I5,Pe,this.onClickConnectionSecret,R5,Pe)}async onClickAlbyCloud(){try{var e;let t=ne.getState().bitcoinConnectConfig.providerConfig,r=await jt.fromAuthorizationUrl("https://my.albyhub.com/apps/new",Ct({},(t==null||(e=t.nwc)==null?void 0:e.authorizationUrlOptions)||{},{name:this._appName}));r.close(),await ne.getState().connect({nwcUrl:r.nostrWalletConnectUrl,connectorName:"Alby Hub",connectorType:"nwc.albyhub"})}catch(t){console.error(t),alert(""+t)}}async onClickConnectionSecret(){ne.getState().pushRoute("/nwc")}async onClickAlbyGo(){ne.getState().pushRoute("/alby-go")}};e0=ee([pe("bc-alby-hub")],e0);var ha=Ee(Xu||(Xu=(e=>e)` `)),t0,fa=Ee(t0||(t0=(e=>e)` `)),n0,r0,o0=e=>e,co=class extends Ce()(ye){constructor(){super(),this._hasCopiedAuthString=!1,this.initAlbyGo()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._unsub)==null||e.call(this)}render(){return X(n0||(n0=o0`
Scan with your camera, QR code scanner app, or from Alby Go -> Send
${0}

Waiting for connection

${0} ${0} ${0}
`),de,wn(`w-7 h-7 ${de}`),de,this.renderQR(),this._copyAuthString,Pe,qe,this._hasCopiedAuthString?ha:fa,this._hasCopiedAuthString?"Copied!":"Copy")}renderQR(){if(!this._authString)return null;let e=this._authString;return setTimeout(()=>{var t;let r=(t=this.shadowRoot)==null?void 0:t.getElementById("qr");if(!r)return void console.error("qr canvas not found");let n=r.getContext("2d");if(!n)return void console.error("could not get context for qr canvas");let i=(0,To.default)(0,"L");i.addData(e),i.make();let a=i.getModuleCount();r.width=4*a,r.height=4*a,i.renderTo2dContext(n,4)},100),X(r0||(r0=o0` `))}_copyAuthString(){this._authString&&(navigator.clipboard.writeText(this._authString),this._hasCopiedAuthString=!0,setTimeout(()=>{this._hasCopiedAuthString=!1},2e3))}async initAlbyGo(){try{var e;let t=(e=ne.getState().bitcoinConnectConfig.providerConfig)==null||(e=e.nwc)==null?void 0:e.authorizationUrlOptions,r=t?.expiresAt,n=t?.requestMethods;n||(n=["get_info","get_balance","get_budget","pay_invoice","list_transactions","lookup_invoice","make_invoice"]);let i=new Yn({name:this._appName,icon:this._appIcon,relayUrls:["wss://relay.getalby.com/v1"],requestMethods:n,notificationTypes:t?.notificationTypes,maxAmount:t?.maxAmount,budgetRenewal:t?.budgetRenewal,expiresAt:r?Math.floor(r.getTime()/1e3):void 0,isolated:t?.isolated,metadata:t?.metadata,returnTo:t?.returnTo});this._authString=i.getConnectionUri("alby"),window.location.href=this._authString;let{unsub:a}=await i.subscribe({onSuccess:async function(f){f.close(),ne.getState().connect({nwcUrl:f.nostrWalletConnectUrl,connectorName:"Alby Hub",connectorType:"nwc.albyhub"})}});this._unsub=a}catch(t){console.error(t),alert(""+t)}}};ee([ge()],co.prototype,"_authString",void 0),ee([ge()],co.prototype,"_hasCopiedAuthString",void 0),co=ee([pe("bc-alby-go")],co);var i0,s0,k5=e=>e,lo=class extends Ce()(ye){constructor(){super(...arguments),this._lnbitsAdminKey="",this._lnbitsUrl=""}render(){return X(i0||(i0=k5`
In LNbits, choose the wallet you want to connect, open it, click on API docs and copy the Admin Key. Paste it below:
LNbits Admin Key
LNbits URL
Connect
`),qs,mr,de,this._lnbitsAdminKey,this._lnbitsAdminKeyChanged,bn,It,de,this._lnbitsUrl,this._lnbitsUrlChanged,bn,It,this.onConnect)}_lnbitsAdminKeyChanged(e){this._lnbitsAdminKey=e.target.value}_lnbitsUrlChanged(e){this._lnbitsUrl=e.target.value}async onConnect(){if(!this._lnbitsAdminKey)return void ne.getState().setError("Please enter your admin key");if(!this._lnbitsUrl)return void ne.getState().setError("Please enter your LNbits instance URL");let e=this._lnbitsUrl;e.endsWith("/")&&(e=e.substring(0,e.length-1)),await ne.getState().connect({lnbitsAdminKey:this._lnbitsAdminKey,lnbitsInstanceUrl:e,connectorName:qs,connectorType:"lnbits"})}};ee([ge()],lo.prototype,"_lnbitsAdminKey",void 0),ee([ge()],lo.prototype,"_lnbitsUrl",void 0),lo=ee([pe("bc-lnbits")],lo);var zh=Ee(s0||(s0=(e=>e)` `)),a0,L5=Ee(a0||(a0=(e=>e)` `)),c0,U5=Ee(c0||(c0=(e=>e)` `)),l0,u0,h0,f0,d0,p0,y0,g0,b0,w0,m0,v0,E0,_0,C0,A0,S0,T0,O0,je=e=>e,Wt=class extends Ce()(ye){constructor(){super(...arguments),this._hasCopiedInvoice=!1,this._isPaying=!1,this._showQR=!1,this.paymentMethods="all"}updated(e){super.updated(e),e.has("paid")&&this.paid&&setTimeout(()=>{No()},3e3)}renderHeading(e){return X(l0||(l0=je`

${0} sats

`),de,Pe,e.satoshi.toLocaleString(void 0,{useGrouping:!0}))}renderPaidState(){return X(u0||(u0=je`

Paid!

${0}
`),Pe,zh)}renderPayingState(){return X(h0||(h0=je`

Paying...

${0}
`),de,wn(`w-48 h-48 ${Pe}`))}renderPaymentConfirmation(){return X(f0||(f0=je` ${0} Confirm Payment ${0} `),this._payInvoice,lr,ua(this._connectorName))}renderWaitingForPayment(){return X(d0||(d0=je`
${0}

Waiting for payment

`),wn(`w-7 h-7 ${Pe}`),de)}renderConnectWalletMobile(){let e=null,t=null,r=null;return this.paymentMethods!=="all"&&this.paymentMethods!=="internal"||(e=X(p0||(p0=je` ${0}Connect Wallet `),this._onClickConnectWallet,lr)),this.paymentMethods!=="all"&&this.paymentMethods!=="external"||(this._showQR||(t=X(y0||(y0=je` ${0} Copy & Display Invoice `),this._copyAndDisplayInvoice,U5)),this._showQR&&(r=this.renderQR())),X(g0||(g0=je`
${0} ${0} ${0}
${0} `),this.paymentMethods==="all"||this.paymentMethods==="external"?X(b0||(b0=je` ${0} Open in a Bitcoin Wallet `),this.invoice,L5):null,e,t,r?X(w0||(w0=je`
${0}
`),r):null)}renderConnectWalletDesktop(){let e=null;this.paymentMethods!=="all"&&this.paymentMethods!=="internal"||(e=X(m0||(m0=je`
${0} Connect Wallet to Pay
`),this.paymentMethods!=="internal"?"mt-8":"",this._onClickConnectWallet,lr));let t=null;this.paymentMethods==="all"&&(t=X(v0||(v0=je`
${0}
`),qh("or")));let r=null;return this.paymentMethods!=="all"&&this.paymentMethods!=="external"||(r=X(E0||(E0=je`

Scan to Pay

${0}
`),this.paymentMethods==="external"?"mt-8":"",de,this.renderQR())),X(_0||(_0=je` ${0} ${0} ${0} `),e,t,r)}renderQR(){if(!this._showQR||!this.invoice)return null;let e=this.invoice;return setTimeout(()=>{var t;let r=(t=this.shadowRoot)==null?void 0:t.getElementById("qr");if(!r)return void console.error("qr canvas not found");let n=r.getContext("2d");if(!n)return void console.error("could not get context for qr canvas");let i=(0,To.default)(0,"L");i.addData(e),i.make();let a=i.getModuleCount();r.width=2*a,r.height=2*a,i.renderTo2dContext(n,2)},100),X(C0||(C0=je` `),this.invoice,this._copyInvoice,Pe,qe,this._hasCopiedInvoice?"Invoice copied to clipboard":"Copy invoice to clipboard",this._hasCopiedInvoice?ha:fa,this._hasCopiedInvoice?"Copied!":"Copy Invoice")}renderMemo(e){return e.description?X(A0||(A0=je`

${0}

`),At,e.description):null}render(){if(!this.invoice)return null;let e;try{e=new ro({pr:this.invoice})}catch(n){return console.error(n),ne.getState().setError(n.message),null}let t=window.innerWidth<600,r;return t||(this._showQR=!0),r=this.paid?this.renderPaidState():this._isPaying?this.renderPayingState():this._connected?this.renderPaymentConfirmation():X(S0||(S0=je` ${0} ${0} `),this.paymentMethods!=="internal"?this.renderWaitingForPayment():null,t?this.renderConnectWalletMobile():this.renderConnectWalletDesktop()),X(T0||(T0=je`
${0} ${0} ${0}
`),this.renderHeading(e),this.renderMemo(e),r)}_onClickConnectWallet(){this.dispatchEvent(new Event("onclickconnectwallet",{bubbles:!0,composed:!0}))}_copyAndDisplayInvoice(){this._copyInvoice(),this._showQR=!0}_copyInvoice(){this.invoice&&(navigator.clipboard.writeText(this.invoice),this._hasCopiedInvoice=!0,setTimeout(()=>{this._hasCopiedInvoice=!1},2e3))}async _payInvoice(){this._isPaying=!0;try{let e=ne.getState().provider;if(!e)throw new Error("No WebLN provider available");if(!this.invoice)throw new Error("No invoice to pay");let t=await e.sendPayment(this.invoice);if(!t.preimage)throw new Error("No preimage in result");this.dispatchEvent(new CustomEvent("bc:onpaid",{bubbles:!0,composed:!0,detail:t})),this.paid=!0}catch(e){console.error(e),ne.getState().setError(e.message)}this._isPaying=!1}};ee([ge()],Wt.prototype,"_hasCopiedInvoice",void 0),ee([ge()],Wt.prototype,"_isPaying",void 0),ee([ge()],Wt.prototype,"_showQR",void 0),ee([Ue({type:String})],Wt.prototype,"invoice",void 0),ee([Ue({type:Boolean})],Wt.prototype,"paid",void 0),ee([Ue({type:String,attribute:"payment-methods"})],Wt.prototype,"paymentMethods",void 0),Wt=ee([pe("bc-send-payment")],Wt);var M5=Ee(O0||(O0=(e=>e)` `)),N0,D5=e=>e,x0=class extends Ce()(ye){render(){return X(N0||(N0=D5`
${0}

To get the best self-custodial bitcoin lightning wallet that can connect to apps, try Alby Hub.

${0}

For a quick setup of a custodial wallet, you can choose between Rizful and Coinos.

`),Vh,de,qe,Pe,M5,de,qe,Pe,qe,Pe)}};x0=ee([pe("bc-new-wallet")],x0);var R0,B5=e=>e,ps=class extends Ce()(ye){constructor(){super(...arguments),this._nwcUrl=""}render(){return X(R0||(R0=B5`
1. Add a new Wallet Connection from LN Node => Generate NWC and copy the Connection Secret.
2. Paste the Connection Secret below:
Connect
`),de,At,de,this._nwcUrl,this.nwcUrlChanged,bn,It,this.onConnect)}nwcUrlChanged(e){this._nwcUrl=e.target.value}async onConnect(){this._nwcUrl?await ne.getState().connect({nwcUrl:this._nwcUrl,connectorName:la,connectorType:"nwc.generic"}):ne.getState().setError("Please enter a URL")}};ee([ge()],ps.prototype,"_nwcUrl",void 0),ps=ee([pe("bc-lnfi")],ps);var I0,F5=e=>e,P0=class extends Ce()(ye){connectedCallback(){super.connectedCallback(),this._timeout=setTimeout(()=>{No(),ne.setState({route:"/start"})},3e3)}disconnectedCallback(){super.disconnectedCallback(),this._timeout&&clearTimeout(this._timeout)}render(){return X(I0||(I0=F5`

Connected!

${0}
`),Pe,zh)}};P0=ee([pe("bc-connected")],P0);var k0,L0,U0=e=>e,uo=class extends Ce()(ye){constructor(){super(),this._hasCopiedAuthString=!1,this.initAlbyGo()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._unsub)==null||e.call(this)}render(){return X(k0||(k0=U0`
Scan with your camera, or by clicking "Send" in the Flash Wallet
${0}

Waiting for connection

${0} ${0} ${0}

Don't have the Flash Wallet app? Download one here

`),de,wn(`w-7 h-7 ${de}`),de,this.renderQR(),this._copyAuthString,Pe,qe,this._hasCopiedAuthString?ha:fa,this._hasCopiedAuthString?"Copied!":"Copy",mr,qe,Pe)}renderQR(){if(!this._authString)return null;let e=this._authString;return setTimeout(()=>{var t;let r=(t=this.shadowRoot)==null?void 0:t.getElementById("qr");if(!r)return void console.error("qr canvas not found");let n=r.getContext("2d");if(!n)return void console.error("could not get context for qr canvas");let i=(0,To.default)(0,"L");i.addData(e),i.make();let a=i.getModuleCount();r.width=4*a,r.height=4*a,i.renderTo2dContext(n,4)},100),X(L0||(L0=U0` `))}_copyAuthString(){this._authString&&(navigator.clipboard.writeText(this._authString),this._hasCopiedAuthString=!0,setTimeout(()=>{this._hasCopiedAuthString=!1},2e3))}async initAlbyGo(){try{var e;let t=(e=ne.getState().bitcoinConnectConfig.providerConfig)==null||(e=e.nwc)==null?void 0:e.authorizationUrlOptions,r=t?.expiresAt,n=t?.requestMethods;n||(n=["get_info","get_balance","get_budget","pay_invoice","list_transactions","lookup_invoice","make_invoice"]);let i=new Yn({name:this._appName,icon:this._appIcon,relayUrls:["wss://nwclay.paywithflash.com"],requestMethods:n,notificationTypes:t?.notificationTypes,maxAmount:t?.maxAmount,budgetRenewal:t?.budgetRenewal,expiresAt:r?Math.floor(r.getTime()/1e3):void 0,isolated:t?.isolated,metadata:t?.metadata,returnTo:t?.returnTo});this._authString=i.connectionUri,window.location.href=this._authString;let{unsub:a}=await i.subscribe({onSuccess:async function(f){f.close(),ne.getState().connect({nwcUrl:f.nostrWalletConnectUrl,connectorName:"Flash Wallet",connectorType:"nwc.flash"})}});this._unsub=a}catch(t){console.error(t),alert(""+t)}}};ee([ge()],uo.prototype,"_authString",void 0),ee([ge()],uo.prototype,"_hasCopiedAuthString",void 0),uo=ee([pe("bc-flash-wallet")],uo);var M0,D0,j5=e=>e,ys=class extends Ce()(ye){constructor(){super(...arguments),this._nwcUrl=""}render(){return X(M0||(M0=j5`
1. In LNBits, go to Plugins and enable the NWC plugin.
2. Create a new connection and update the relay from "nostrclient" to wss://relay.getalby.com/v1, then copy the connection secret.
3. Paste the Connection Secret below.
Enter your Connection Secret below
Connect
`),zs,de,de,de,de,this._nwcUrl,this.nwcUrlChanged,bn,It,this.onConnect)}nwcUrlChanged(e){this._nwcUrl=e.target.value}async onConnect(){this._nwcUrl?await ne.getState().connect({nwcUrl:this._nwcUrl,connectorName:zs,connectorType:"nwc.lnbits"}):ne.getState().setError("Please enter a URL")}};ee([ge()],ys.prototype,"_nwcUrl",void 0),ys=ee([pe("bc-lnbits-nwc")],ys);var H5=Ee(D0||(D0=(e=>e)` `)),Js="Cashu.me",B0=class extends st{constructor(){super("nwc.cashume",Js,"#7f38ca",H5)}async _onClick(){ne.getState().pushRoute("/cashu-me")}};B0=ee([pe("bc-cashu-me-connector")],B0);var F0,$5=e=>e,gs=class extends Ce()(ye){constructor(){super(...arguments),this._nwcUrl=""}render(){return X(F0||(F0=$5`
1. Open Cashu.me , click on the hamburger menu on the top left, then click Settings. Scroll down to Nostr Wallet Connect and enable NWC, and then press the copy button.
2. Keep the Cashu.me browser tab open while using Bitcoin Connect.
3. Paste the Connection Secret below:
Enter your Connection Secret below
Connect
`),Js,de,de,de,de,this._nwcUrl,this.nwcUrlChanged,bn,It,this.onConnect)}nwcUrlChanged(e){this._nwcUrl=e.target.value}async onConnect(){this._nwcUrl?await ne.getState().connect({nwcUrl:this._nwcUrl,connectorName:Js,connectorType:"nwc.cashume"}):ne.getState().setError("Please enter a URL")}};ee([ge()],gs.prototype,"_nwcUrl",void 0),gs=ee([pe("bc-cashu-me")],gs);var j0,G5=e=>e,bs=class extends Ce()(ye){constructor(){super(...arguments),this._nwcUrl=""}render(){return X(j0||(j0=G5`
2. Click on Hamburger Menu -> NWC -> Get NWC codes -> New Connection. Then click Get Connection Code and click Copy Connection Code
3. Paste the Connection Secret below:
Enter your Connection Secret below
Connect
`),Qs,de,de,de,de,this._nwcUrl,this.nwcUrlChanged,bn,It,this.onConnect)}nwcUrlChanged(e){this._nwcUrl=e.target.value}async onConnect(){this._nwcUrl?await ne.getState().connect({nwcUrl:this._nwcUrl,connectorName:Qs,connectorType:"nwc.rizful"}):ne.getState().setError("Please enter a URL")}};ee([ge()],bs.prototype,"_nwcUrl",void 0),bs=ee([pe("bc-rizful")],bs);var H0,$0,G0,W0,K0,V0,Z0,Y0,q0,z0,Q0,J0,X0,it=e=>e,W5={"/start":X(H0||(H0=it``)),"/help":X($0||($0=it``)),"/nwc":X(G0||(G0=it``)),"/lnfi":X(W0||(W0=it``)),"/alby-hub":X(K0||(K0=it``)),"/alby-go":X(V0||(V0=it``)),"/lnbits":X(Z0||(Z0=it``)),"/lnbits-nwc":X(Y0||(Y0=it``)),"/flash-wallet":X(q0||(q0=it``)),"/cashu-me":X(z0||(z0=it``)),"/rizful":X(Q0||(Q0=it``)),"/new-wallet":X(J0||(J0=it``)),"/connected":X(X0||(X0=it``))},eh,th,K5=e=>e,nh=class extends Ce()(ye){render(){return X(eh||(eh=K5`
${0}
`),W5[this._route])}};nh=ee([pe("bc-router-outlet")],nh);var V5=Ee(th||(th=(e=>e)` `)),rh,Z5=Ee(rh||(rh=(e=>e)` `)),oh,ih,sh,ws=e=>e,ho=class extends Ce()(ye){render(){return X(oh||(oh=ws`
${0} ${0}
`),this.showHelp?X(ih||(ih=ws``),qe,At,()=>ne.getState().pushRoute("/help"),Z5):null,this.closable?X(sh||(sh=ws``),qe,At,this._handleClose,V5):null)}_handleClose(){this.dispatchEvent(new Event("onclose",{bubbles:!0,composed:!0}))}};ee([Ue({type:Boolean})],ho.prototype,"closable",void 0),ee([Ue({type:Boolean,attribute:"show-help"})],ho.prototype,"showHelp",void 0),ho=ee([pe("bc-modal-header")],ho);var ah,Y5=e=>e,ch=class extends Ce()(ye){constructor(){super(...arguments),this._handleClose=()=>{No()}}render(){return X(ah||(ah=Y5`
`),this._handleClose,this._handleClose)}};ch=ee([pe("bc-modal")],ch);var lh,uh,q5=e=>e,hh=class extends Ce()(Xt){render(){return X(lh||(lh=q5`
${0}

Connecting to wallet...

${0}
`),wn(`w-20 h-20 ${At} mb-4`),de,ua(void 0))}};hh=ee([pe("bci-connecting")],hh);var z5=Ee(uh||(uh=(e=>e)` `)),fh,Q5=Ee(fh||(fh=(e=>e)` `)),dh,ms,ph,yh,gh,bh,wh,rr=e=>e,vs=(ms=class extends(dh=Ce()(ye)){render(){return X(ph||(ph=rr`
${0}
${0}
${0}
${0}
`),this.closable,Pe,Q5,It,z5,X(this._connecting?yh||(yh=rr``):gh||(gh=rr` `)),this._error?X(bh||(bh=rr`

${0}

`),this._error):null)}},ms.styles=[...dh.styles,Oo(wh||(wh=rr` :host { display: flex; justify-content: center; width: 100%; } `))],ms);ee([Ue({type:Boolean})],vs.prototype,"closable",void 0),vs=ee([pe("bc-connect")],vs);var mh,Es,vh,Eh,_h,Ch,fo=e=>e,un=(Es=class extends(mh=Ce()(ye)){constructor(){super(),this.paymentMethods="all",this._showConnect=!1,ne.subscribe((e,t)=>{e.connected!==t.connected&&e.connected&&(this._showConnect=!1)})}render(){return this._showConnect&&!this.paid?X(vh||(vh=fo` `),!0):X(Eh||(Eh=fo`

Payment Request

${0}
`),this.closable,de,this.invoice,this.paymentMethods,this.paid,this._onClickConnectWallet,this._error?X(_h||(_h=fo`

${0}

`),this._error):null)}_onClickConnectWallet(){this._showConnect=!0}},Es.styles=[...mh.styles,Oo(Ch||(Ch=fo` :host { display: flex; align-items: center; justify-content: center; width: 100%; } `))],Es);ee([Ue({type:Boolean})],un.prototype,"closable",void 0),ee([Ue({type:String})],un.prototype,"invoice",void 0),ee([Ue({type:String,attribute:"payment-methods"})],un.prototype,"paymentMethods",void 0),ee([Ue({type:Boolean})],un.prototype,"paid",void 0),ee([ge()],un.prototype,"_showConnect",void 0),un=ee([pe("bc-payment")],un);export{No as closeModal,i5 as disconnect,s5 as getConnectorConfig,r5 as init,n5 as isConnected,Kh as launchModal,X3 as onConnected,e5 as onDisconnected}; /*! Bundled license information: @lightninglabs/lnc-web/dist/index.js: (*! For license information please see index.js.LICENSE.txt *) @getalby/sdk/dist/esm/index.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *) (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *) @getalby/sdk/dist/esm/index.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) @getalby/sdk/dist/esm/index.js: (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *) @getalby/lightning-tools/dist/esm/index.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *) */