From 08ac329c1fe4935167c7b7552399936b62cc7a94 Mon Sep 17 00:00:00 2001 From: Jarryd Allison Date: Tue, 15 Oct 2024 08:14:52 -0600 Subject: [PATCH] feat: Update npm build command --- .gitignore | 3 + dist/assets/ccip-D0okC1-o.js | 1 - dist/assets/hooks.module-BBeYFAft.js | 1 - dist/assets/index-Cdw1Pm6b.js | 64 - dist/assets/index-Clf5vl-T.js | 7 - dist/assets/index-CrW_pNDQ.js | 41 - dist/assets/index-DKSdwK6L.js | 1 - dist/assets/index-DUBt2OAj.css | 1 - dist/assets/index-DY4jrsxT.js | 14092 ------------------------- dist/assets/secp256k1-CThcWgWC.js | 1 - dist/assets/w3m-modal-BzJLjRtR.js | 151 - dist/index.html | 4 +- package.json | 3 +- 13 files changed, 7 insertions(+), 14363 deletions(-) delete mode 100644 dist/assets/ccip-D0okC1-o.js delete mode 100644 dist/assets/hooks.module-BBeYFAft.js delete mode 100644 dist/assets/index-Cdw1Pm6b.js delete mode 100644 dist/assets/index-Clf5vl-T.js delete mode 100644 dist/assets/index-CrW_pNDQ.js delete mode 100644 dist/assets/index-DKSdwK6L.js delete mode 100644 dist/assets/index-DUBt2OAj.css delete mode 100644 dist/assets/index-DY4jrsxT.js delete mode 100644 dist/assets/secp256k1-CThcWgWC.js delete mode 100644 dist/assets/w3m-modal-BzJLjRtR.js diff --git a/.gitignore b/.gitignore index c18b3feb..231e0cb6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ /cypress/videos /cypress/screenshots +# dist +/dist + # production /build diff --git a/dist/assets/ccip-D0okC1-o.js b/dist/assets/ccip-D0okC1-o.js deleted file mode 100644 index bbb144da..00000000 --- a/dist/assets/ccip-D0okC1-o.js +++ /dev/null @@ -1 +0,0 @@ -import{a_ as h,a$ as m,b0 as p,b1 as w,b2 as b,b3 as L,b4 as E,b5 as O,b6 as x,b7 as y,b8 as M}from"./index-DY4jrsxT.js";function R(s,e){if(!h(s,{strict:!1}))throw new m({address:s});if(!h(e,{strict:!1}))throw new m({address:e});return s.toLowerCase()===e.toLowerCase()}class $ extends p{constructor({callbackSelector:e,cause:a,data:n,extraData:c,sender:d,urls:t}){var i;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(i=a.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${w(f)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat(),name:"OffchainLookupError"})}}class S extends p{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${b(e)}`],name:"OffchainLookupResponseMalformedError"})}}class A extends p{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}const T="0x556f1830",q={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function G(s,{blockNumber:e,blockTag:a,data:n,to:c}){const{args:d}=L({data:n,abi:[q]}),[t,i,f,r,o]=d,{ccipRead:u}=s,g=u&&typeof(u==null?void 0:u.request)=="function"?u.request:C;try{if(!R(c,t))throw new A({sender:t,to:c});const l=await g({data:f,sender:t,urls:i}),{data:k}=await E(s,{blockNumber:e,blockTag:a,data:O([r,x([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return k}catch(l){throw new $({callbackSelector:r,cause:l,data:n,extraData:o,sender:t,urls:i})}}async function C({data:s,sender:e,urls:a}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d0?this.tail.next=f:this.head=f,this.tail=f,++this.length}},{key:"unshift",value:function(x){var f={data:x,next:this.head};this.length===0&&(this.tail=f),this.head=f,++this.length}},{key:"shift",value:function(){if(this.length!==0){var x=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,x}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(x){if(this.length===0)return"";for(var f=this.head,p=""+f.data;f=f.next;)p+=x+f.data;return p}},{key:"concat",value:function(x){if(this.length===0)return l.alloc(0);for(var f=l.allocUnsafe(x>>>0),p=this.head,y=0;p;)v(p.data,f,y),y+=p.data.length,p=p.next;return f}},{key:"consume",value:function(x,f){var p;return xR.length?R.length:x;if(T===R.length?y+=R:y+=R.slice(0,x),x-=T,x===0){T===R.length?(++p,f.next?this.head=f.next:this.head=this.tail=null):(this.head=f,f.data=R.slice(T));break}++p}return this.length-=p,y}},{key:"_getBuffer",value:function(x){var f=l.allocUnsafe(x),p=this.head,y=1;for(p.data.copy(f),x-=p.data.length;p=p.next;){var R=p.data,T=x>R.length?R.length:x;if(R.copy(f,f.length-x,0,T),x-=T,x===0){T===R.length?(++y,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=R.slice(T));break}++y}return this.length-=y,f}},{key:w,value:function(x,f){return h(this,t(t({},f),{},{depth:0,customInspect:!1}))}}]),m}(),Kt}function zi(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(ar,this,e)):process.nextTick(ar,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(qe,r):(r._writableState.errorEmitted=!0,process.nextTick(xr,r,s)):process.nextTick(xr,r,s):t?(process.nextTick(qe,r),t(s)):process.nextTick(qe,r)}),this)}function xr(e,t){ar(e,t),qe(e)}function qe(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Vi(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ar(e,t){e.emit("error",t)}function Gi(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}var ri={destroy:zi,undestroy:Vi,errorOrDestroy:Gi},ve={};function Ki(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ii={};function X(e,t,r){r||(r=Error);function i(s,u,d){return typeof t=="string"?t:t(s,u,d)}var n=function(s){Ki(u,s);function u(d,b,l){return s.call(this,i(d,b,l))||this}return u}(r);n.prototype.name=r.name,n.prototype.code=e,ii[e]=n}function Er(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Yi(e,t,r){return e.substr(0,t.length)===t}function Xi(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Zi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}X("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);X("ERR_INVALID_ARG_TYPE",function(e,t,r){var i;typeof t=="string"&&Yi(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(Xi(e," argument"))n="The ".concat(e," ").concat(i," ").concat(Er(t,"type"));else{var s=Zi(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(Er(t,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);X("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");X("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});X("ERR_STREAM_PREMATURE_CLOSE","Premature close");X("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});X("ERR_MULTIPLE_CALLBACK","Callback called multiple times");X("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");X("ERR_STREAM_WRITE_AFTER_END","write after end");X("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);X("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);X("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");ve.codes=ii;var Ji=ve.codes.ERR_INVALID_OPT_VALUE;function Qi(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function en(e,t,r,i){var n=Qi(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new Ji(s,n)}return Math.floor(n)}return e.objectMode?16:16*1024}var ni={getHighWaterMark:en},Sr={},tn=rn;function rn(e,t){if(Yt("noDeprecation"))return e;var r=!1;function i(){if(!r){if(Yt("throwDeprecation"))throw new Error(t);Yt("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return i}function Yt(e){try{if(!Sr.localStorage)return!1}catch{return!1}var t=Sr.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Xt,mr;function ai(){if(mr)return Xt;mr=1;var e={};Xt=D;function t(_){var c=this;this.next=null,this.entry=null,this.finish=function(){q(c,_)}}var r;D.WritableState=L;var i={deprecate:tn},n=ti,s=Ge.Buffer,u=(typeof e<"u"?e:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function d(_){return s.from(_)}function b(_){return s.isBuffer(_)||_ instanceof u}var l=ri,S=ni,h=S.getHighWaterMark,w=ve.codes,v=w.ERR_INVALID_ARG_TYPE,m=w.ERR_METHOD_NOT_IMPLEMENTED,A=w.ERR_MULTIPLE_CALLBACK,x=w.ERR_STREAM_CANNOT_PIPE,f=w.ERR_STREAM_DESTROYED,p=w.ERR_STREAM_NULL_VALUES,y=w.ERR_STREAM_WRITE_AFTER_END,R=w.ERR_UNKNOWN_ENCODING,T=l.errorOrDestroy;Q(D,n);function B(){}function L(_,c,E){r=r||Se(),_=_||{},typeof E!="boolean"&&(E=c instanceof r),this.objectMode=!!_.objectMode,E&&(this.objectMode=this.objectMode||!!_.writableObjectMode),this.highWaterMark=h(this,_,"writableHighWaterMark",E),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var M=_.decodeStrings===!1;this.decodeStrings=!M,this.defaultEncoding=_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(P){he(c,P)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}L.prototype.getBuffer=function(){for(var c=this.bufferedRequest,E=[];c;)E.push(c),c=c.next;return E},function(){try{Object.defineProperty(L.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var $;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?($=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(c){return $.call(this,c)?!0:this!==D?!1:c&&c._writableState instanceof L}})):$=function(c){return c instanceof this};function D(_){r=r||Se();var c=this instanceof r;if(!c&&!$.call(D,this))return new D(_);this._writableState=new L(_,this,c),this.writable=!0,_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final)),n.call(this)}D.prototype.pipe=function(){T(this,new x)};function k(_,c){var E=new y;T(_,E),process.nextTick(c,E)}function V(_,c,E,M){var P;return E===null?P=new p:typeof E!="string"&&!c.objectMode&&(P=new v("chunk",["string","Buffer"],E)),P?(T(_,P),process.nextTick(M,P),!1):!0}D.prototype.write=function(_,c,E){var M=this._writableState,P=!1,a=!M.objectMode&&b(_);return a&&!s.isBuffer(_)&&(_=d(_)),typeof c=="function"&&(E=c,c=null),a?c="buffer":c||(c=M.defaultEncoding),typeof E!="function"&&(E=B),M.ending?k(this,E):(a||V(this,M,_,E))&&(M.pendingcb++,P=j(this,M,a,_,c,E)),P},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){var _=this._writableState;_.corked&&(_.corked--,!_.writing&&!_.corked&&!_.bufferProcessing&&_.bufferedRequest&&J(this,_))},D.prototype.setDefaultEncoding=function(c){if(typeof c=="string"&&(c=c.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((c+"").toLowerCase())>-1))throw new R(c);return this._writableState.defaultEncoding=c,this},Object.defineProperty(D.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z(_,c,E){return!_.objectMode&&_.decodeStrings!==!1&&typeof c=="string"&&(c=s.from(c,E)),c}Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function j(_,c,E,M,P,a){if(!E){var o=Z(c,M,P);M!==o&&(E=!0,P="buffer",M=o)}var g=c.objectMode?1:M.length;c.length+=g;var C=c.length */(function(e,t){var r=Ge,i=r.Buffer;function n(u,d){for(var b in u)d[b]=u[b]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=s);function s(u,d,b){return i(u,d,b)}s.prototype=Object.create(i.prototype),n(i,s),s.from=function(u,d,b){if(typeof u=="number")throw new TypeError("Argument must not be a number");return i(u,d,b)},s.alloc=function(u,d,b){if(typeof u!="number")throw new TypeError("Argument must be a number");var l=i(u);return d!==void 0?typeof b=="string"?l.fill(d,b):l.fill(d):l.fill(0),l},s.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return i(u)},s.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(u)}})(or,or.exports);var de=or.exports,Tr;function Ar(){if(Tr)return Jt;Tr=1;var e=de.Buffer,t=e.isEncoding||function(f){switch(f=""+f,f&&f.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(f){if(!f)return"utf8";for(var p;;)switch(f){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return f;default:if(p)return;f=(""+f).toLowerCase(),p=!0}}function i(f){var p=r(f);if(typeof p!="string"&&(e.isEncoding===t||!t(f)))throw new Error("Unknown encoding: "+f);return p||f}Jt.StringDecoder=n;function n(f){this.encoding=i(f);var p;switch(this.encoding){case"utf16le":this.text=h,this.end=w,p=4;break;case"utf8":this.fillLast=b,p=4;break;case"base64":this.text=v,this.end=m,p=3;break;default:this.write=A,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(p)}n.prototype.write=function(f){if(f.length===0)return"";var p,y;if(this.lastNeed){if(p=this.fillLast(f),p===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y>5===6?2:f>>4===14?3:f>>3===30?4:f>>6===2?-1:-2}function u(f,p,y){var R=p.length-1;if(R=0?(T>0&&(f.lastNeed=T-1),T):--R=0?(T>0&&(f.lastNeed=T-2),T):--R=0?(T>0&&(T===2?T=0:f.lastNeed=T-3),T):0))}function d(f,p,y){if((p[0]&192)!==128)return f.lastNeed=0,"�";if(f.lastNeed>1&&p.length>1){if((p[1]&192)!==128)return f.lastNeed=1,"�";if(f.lastNeed>2&&p.length>2&&(p[2]&192)!==128)return f.lastNeed=2,"�"}}function b(f){var p=this.lastTotal-this.lastNeed,y=d(this,f);if(y!==void 0)return y;if(this.lastNeed<=f.length)return f.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);f.copy(this.lastChar,p,0,f.length),this.lastNeed-=f.length}function l(f,p){var y=u(this,f,p);if(!this.lastNeed)return f.toString("utf8",p);this.lastTotal=y;var R=f.length-(y-this.lastNeed);return f.copy(this.lastChar,0,R),f.toString("utf8",p,R)}function S(f){var p=f&&f.length?this.write(f):"";return this.lastNeed?p+"�":p}function h(f,p){if((f.length-p)%2===0){var y=f.toString("utf16le",p);if(y){var R=y.charCodeAt(y.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=f[f.length-2],this.lastChar[1]=f[f.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=f[f.length-1],f.toString("utf16le",p,f.length-1)}function w(f){var p=f&&f.length?this.write(f):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,y)}return p}function v(f,p){var y=(f.length-p)%3;return y===0?f.toString("base64",p):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=f[f.length-1]:(this.lastChar[0]=f[f.length-2],this.lastChar[1]=f[f.length-1]),f.toString("base64",p,f.length-y))}function m(f){var p=f&&f.length?this.write(f):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function A(f){return f.toString(this.encoding)}function x(f){return f&&f.length?this.write(f):""}return Jt}var Cr=ve.codes.ERR_STREAM_PREMATURE_CLOSE;function nn(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n0)if(typeof o!="string"&&!N.objectMode&&Object.getPrototypeOf(o)!==n.prototype&&(o=u(o)),C)N.endEmitted?B(a,new p):Z(a,N,o,!0);else if(N.ended)B(a,new x);else{if(N.destroyed)return!1;N.reading=!1,N.decoder&&!g?(o=N.decoder.write(o),N.objectMode||o.length!==0?Z(a,N,o,!1):J(a,N)):Z(a,N,o,!1)}else C||(N.reading=!1,J(a,N))}return!N.ended&&(N.length=z?a=z:(a--,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a++),a}function ne(a,o){return a<=0||o.length===0&&o.ended?0:o.objectMode?1:a!==a?o.flowing&&o.length?o.buffer.head.data.length:o.length:(a>o.highWaterMark&&(o.highWaterMark=G(a)),a<=o.length?a:o.ended?o.length:(o.needReadable=!0,0))}k.prototype.read=function(a){l("read",a),a=parseInt(a,10);var o=this._readableState,g=a;if(a!==0&&(o.emittedReadable=!1),a===0&&o.needReadable&&((o.highWaterMark!==0?o.length>=o.highWaterMark:o.length>0)||o.ended))return l("read: emitReadable",o.length,o.ended),o.length===0&&o.ended?E(this):K(this),null;if(a=ne(a,o),a===0&&o.ended)return o.length===0&&E(this),null;var C=o.needReadable;l("need readable",C),(o.length===0||o.length-a0?U=c(a,o):U=null,U===null?(o.needReadable=o.length<=o.highWaterMark,a=0):(o.length-=a,o.awaitDrain=0),o.length===0&&(o.ended||(o.needReadable=!0),g!==a&&o.ended&&E(this)),U!==null&&this.emit("data",U),U};function he(a,o){if(l("onEofChunk"),!o.ended){if(o.decoder){var g=o.decoder.end();g&&g.length&&(o.buffer.push(g),o.length+=o.objectMode?1:g.length)}o.ended=!0,o.sync?K(a):(o.needReadable=!1,o.emittedReadable||(o.emittedReadable=!0,ee(a)))}}function K(a){var o=a._readableState;l("emitReadable",o.needReadable,o.emittedReadable),o.needReadable=!1,o.emittedReadable||(l("emitReadable",o.flowing),o.emittedReadable=!0,process.nextTick(ee,a))}function ee(a){var o=a._readableState;l("emitReadable_",o.destroyed,o.length,o.ended),!o.destroyed&&(o.length||o.ended)&&(a.emit("readable"),o.emittedReadable=!1),o.needReadable=!o.flowing&&!o.ended&&o.length<=o.highWaterMark,_(a)}function J(a,o){o.readingMore||(o.readingMore=!0,process.nextTick(ae,a,o))}function ae(a,o){for(;!o.reading&&!o.ended&&(o.length1&&P(C.pipes,a)!==-1)&&!Ce&&(l("false write response, pause",C.awaitDrain),C.awaitDrain++),g.pause())}function we(re){l("onerror",re),ce(),a.removeListener("error",we),r(a,"error")===0&&B(a,re)}$(a,"error",we);function xe(){a.removeListener("finish",Ee),ce()}a.once("close",xe);function Ee(){l("onfinish"),a.removeListener("close",xe),ce()}a.once("finish",Ee);function ce(){l("unpipe"),g.unpipe(a)}return a.emit("pipe",g),C.flowing||(l("pipe resume"),g.resume()),a};function _e(a){return function(){var g=a._readableState;l("pipeOnDrain",g.awaitDrain),g.awaitDrain&&g.awaitDrain--,g.awaitDrain===0&&r(a,"data")&&(g.flowing=!0,_(a))}}k.prototype.unpipe=function(a){var o=this._readableState,g={hasUnpiped:!1};if(o.pipesCount===0)return this;if(o.pipesCount===1)return a&&a!==o.pipes?this:(a||(a=o.pipes),o.pipes=null,o.pipesCount=0,o.flowing=!1,a&&a.emit("unpipe",this,g),this);if(!a){var C=o.pipes,U=o.pipesCount;o.pipes=null,o.pipesCount=0,o.flowing=!1;for(var N=0;N0,C.flowing!==!1&&this.resume()):a==="readable"&&!C.endEmitted&&!C.readableListening&&(C.readableListening=C.needReadable=!0,C.flowing=!1,C.emittedReadable=!1,l("on readable",C.length,C.reading),C.length?K(this):C.reading||process.nextTick(Y,this)),g},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(a,o){var g=i.prototype.removeListener.call(this,a,o);return a==="readable"&&process.nextTick(te,this),g},k.prototype.removeAllListeners=function(a){var o=i.prototype.removeAllListeners.apply(this,arguments);return(a==="readable"||a===void 0)&&process.nextTick(te,this),o};function te(a){var o=a._readableState;o.readableListening=a.listenerCount("readable")>0,o.resumeScheduled&&!o.paused?o.flowing=!0:a.listenerCount("data")>0&&a.resume()}function Y(a){l("readable nexttick read 0"),a.read(0)}k.prototype.resume=function(){var a=this._readableState;return a.flowing||(l("resume"),a.flowing=!a.readableListening,oe(this,a)),a.paused=!1,this};function oe(a,o){o.resumeScheduled||(o.resumeScheduled=!0,process.nextTick(q,a,o))}function q(a,o){l("resume",o.reading),o.reading||a.read(0),o.resumeScheduled=!1,a.emit("resume"),_(a),o.flowing&&!o.reading&&a.read(0)}k.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _(a){var o=a._readableState;for(l("flow",o.flowing);o.flowing&&a.read()!==null;);}k.prototype.wrap=function(a){var o=this,g=this._readableState,C=!1;a.on("end",function(){if(l("wrapped end"),g.decoder&&!g.ended){var O=g.decoder.end();O&&O.length&&o.push(O)}o.push(null)}),a.on("data",function(O){if(l("wrapped data"),g.decoder&&(O=g.decoder.write(O)),!(g.objectMode&&O==null)&&!(!g.objectMode&&(!O||!O.length))){var se=o.push(O);se||(C=!0,a.pause())}});for(var U in a)this[U]===void 0&&typeof a[U]=="function"&&(this[U]=function(se){return function(){return a[se].apply(a,arguments)}}(U));for(var N=0;N=o.length?(o.decoder?g=o.buffer.join(""):o.buffer.length===1?g=o.buffer.first():g=o.buffer.concat(o.length),o.buffer.clear()):g=o.buffer.consume(a,o.decoder),g}function E(a){var o=a._readableState;l("endReadable",o.endEmitted),o.endEmitted||(o.ended=!0,process.nextTick(M,o,a))}function M(a,o){if(l("endReadableNT",a.endEmitted,a.length),!a.endEmitted&&a.length===0&&(a.endEmitted=!0,o.readable=!1,o.emit("end"),a.autoDestroy)){var g=o._writableState;(!g||g.autoDestroy&&g.finished)&&o.destroy()}}typeof Symbol=="function"&&(k.from=function(a,o){return T===void 0&&(T=fn()),T(k,a,o)});function P(a,o){for(var g=0,C=a.length;g0;return wn(u,b,l,function(S){n||(n=S),S&&s.forEach(Pr),!b&&(s.forEach(Pr),i(n))})});return t.reduce(xn)}var mn=Sn;(function(e,t){t=e.exports=si(),t.Stream=t,t.Readable=t,t.Writable=ai(),t.Duplex=Se(),t.Transform=fi,t.PassThrough=pn,t.finished=cr,t.pipeline=mn})(nr,nr.exports);var hi=nr.exports;const{Transform:Rn}=hi;var Tn=e=>class _i extends Rn{constructor(r,i,n,s,u){super(u),this._rate=r,this._capacity=i,this._delimitedSuffix=n,this._hashBitLength=s,this._options=u,this._state=new e,this._state.initialize(r,i),this._finalized=!1}_transform(r,i,n){let s=null;try{this.update(r,i)}catch(u){s=u}n(s)}_flush(r){let i=null;try{this.push(this.digest())}catch(n){i=n}r(i)}update(r,i){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,i)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let i=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(i=i.toString(r)),this._resetState(),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new _i(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:An}=hi;var Cn=e=>class ci extends An{constructor(r,i,n,s){super(s),this._rate=r,this._capacity=i,this._delimitedSuffix=n,this._options=s,this._state=new e,this._state.initialize(r,i),this._finalized=!1}_transform(r,i,n){let s=null;try{this.update(r,i)}catch(u){s=u}n(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,i){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,i)),this._state.absorb(r),this}squeeze(r,i){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(r);return i!==void 0&&(n=n.toString(i)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ci(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const kn=Tn,Bn=Cn;var Mn=function(e){const t=kn(e),r=Bn(e);return function(i,n){switch(typeof i=="string"?i.toLowerCase():i){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+i)}}},di={};const Lr=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];di.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],d=e[5]^e[15]^e[25]^e[35]^e[45],b=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],S=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49];let w=S^(n<<1|s>>>31),v=h^(s<<1|n>>>31);const m=e[0]^w,A=e[1]^v,x=e[10]^w,f=e[11]^v,p=e[20]^w,y=e[21]^v,R=e[30]^w,T=e[31]^v,B=e[40]^w,L=e[41]^v;w=r^(u<<1|d>>>31),v=i^(d<<1|u>>>31);const $=e[2]^w,D=e[3]^v,k=e[12]^w,V=e[13]^v,Z=e[22]^w,j=e[23]^v,z=e[32]^w,G=e[33]^v,ne=e[42]^w,he=e[43]^v;w=n^(b<<1|l>>>31),v=s^(l<<1|b>>>31);const K=e[4]^w,ee=e[5]^v,J=e[14]^w,ae=e[15]^v,_e=e[24]^w,te=e[25]^v,Y=e[34]^w,oe=e[35]^v,q=e[44]^w,_=e[45]^v;w=u^(S<<1|h>>>31),v=d^(h<<1|S>>>31);const c=e[6]^w,E=e[7]^v,M=e[16]^w,P=e[17]^v,a=e[26]^w,o=e[27]^v,g=e[36]^w,C=e[37]^v,U=e[46]^w,N=e[47]^v;w=b^(r<<1|i>>>31),v=l^(i<<1|r>>>31);const O=e[8]^w,se=e[9]^v,pe=e[18]^w,Ce=e[19]^v,Ue=e[28]^w,ke=e[29]^v,we=e[38]^w,xe=e[39]^v,Ee=e[48]^w,ce=e[49]^v,re=m,ie=A,et=f<<4|x>>>28,tt=x<<4|f>>>28,rt=p<<3|y>>>29,it=y<<3|p>>>29,nt=T<<9|R>>>23,at=R<<9|T>>>23,ot=B<<18|L>>>14,st=L<<18|B>>>14,ft=$<<1|D>>>31,lt=D<<1|$>>>31,ut=V<<12|k>>>20,ht=k<<12|V>>>20,_t=Z<<10|j>>>22,ct=j<<10|Z>>>22,dt=G<<13|z>>>19,pt=z<<13|G>>>19,bt=ne<<2|he>>>30,vt=he<<2|ne>>>30,gt=ee<<30|K>>>2,yt=K<<30|ee>>>2,wt=J<<6|ae>>>26,xt=ae<<6|J>>>26,Et=te<<11|_e>>>21,St=_e<<11|te>>>21,mt=Y<<15|oe>>>17,Rt=oe<<15|Y>>>17,Tt=_<<29|q>>>3,At=q<<29|_>>>3,Ct=c<<28|E>>>4,kt=E<<28|c>>>4,Bt=P<<23|M>>>9,Mt=M<<23|P>>>9,Dt=a<<25|o>>>7,Nt=o<<25|a>>>7,Pt=g<<21|C>>>11,Lt=C<<21|g>>>11,Ot=N<<24|U>>>8,It=U<<24|N>>>8,$t=O<<27|se>>>5,Ft=se<<27|O>>>5,Ut=pe<<20|Ce>>>12,Ht=Ce<<20|pe>>>12,qt=ke<<7|Ue>>>25,jt=Ue<<7|ke>>>25,Wt=we<<8|xe>>>24,zt=xe<<8|we>>>24,Vt=Ee<<14|ce>>>18,Gt=ce<<14|Ee>>>18;e[0]=re^~ut&Et,e[1]=ie^~ht&St,e[10]=Ct^~Ut&rt,e[11]=kt^~Ht&it,e[20]=ft^~wt&Dt,e[21]=lt^~xt&Nt,e[30]=$t^~et&_t,e[31]=Ft^~tt&ct,e[40]=gt^~Bt&qt,e[41]=yt^~Mt&jt,e[2]=ut^~Et&Pt,e[3]=ht^~St&Lt,e[12]=Ut^~rt&dt,e[13]=Ht^~it&pt,e[22]=wt^~Dt&Wt,e[23]=xt^~Nt&zt,e[32]=et^~_t&mt,e[33]=tt^~ct&Rt,e[42]=Bt^~qt&nt,e[43]=Mt^~jt&at,e[4]=Et^~Pt&Vt,e[5]=St^~Lt&Gt,e[14]=rt^~dt&Tt,e[15]=it^~pt&At,e[24]=Dt^~Wt&ot,e[25]=Nt^~zt&st,e[34]=_t^~mt&Ot,e[35]=ct^~Rt&It,e[44]=qt^~nt&bt,e[45]=jt^~at&vt,e[6]=Pt^~Vt&re,e[7]=Lt^~Gt&ie,e[16]=dt^~Tt&Ct,e[17]=pt^~At&kt,e[26]=Wt^~ot&ft,e[27]=zt^~st<,e[36]=mt^~Ot&$t,e[37]=Rt^~It&Ft,e[46]=nt^~bt>,e[47]=at^~vt&yt,e[8]=Vt^~re&ut,e[9]=Gt^~ie&ht,e[18]=Tt^~Ct&Ut,e[19]=At^~kt&Ht,e[28]=ot^~ft&wt,e[29]=st^~lt&xt,e[38]=Ot^~$t&et,e[39]=It^~Ft&tt,e[48]=bt^~gt&Bt,e[49]=vt^~yt&Mt,e[0]^=Lr[t*2],e[1]^=Lr[t*2+1]}};const We=di;function Te(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Te.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Te.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(We.p1600(this.state),this.count=0);return t};Te.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Dn=Te,Ka=Mn(Dn),pi={exports:{}},bi=de.Buffer;function Xe(e,t){this._block=bi.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Xe.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=bi.from(e,t));for(var r=this._block,i=this._blockSize,n=e.length,s=this._len,u=0;u=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Xe.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Ae=Xe,Nn=Q,vi=Ae,Pn=de.Buffer,Ln=[1518500249,1859775393,-1894007588,-899497514],On=new Array(80);function Pe(){this.init(),this._w=On,vi.call(this,64,56)}Nn(Pe,vi);Pe.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function In(e){return e<<5|e>>>27}function $n(e){return e<<30|e>>>2}function Fn(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Pe.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,u=this._e|0,d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<80;++d)t[d]=t[d-3]^t[d-8]^t[d-14]^t[d-16];for(var b=0;b<80;++b){var l=~~(b/20),S=In(r)+Fn(l,i,n,s)+u+t[b]+Ln[l]|0;u=s,s=n,n=$n(i),i=r,r=S}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0};Pe.prototype._hash=function(){var e=Pn.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Un=Pe,Hn=Q,gi=Ae,qn=de.Buffer,jn=[1518500249,1859775393,-1894007588,-899497514],Wn=new Array(80);function Le(){this.init(),this._w=Wn,gi.call(this,64,56)}Hn(Le,gi);Le.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function zn(e){return e<<1|e>>>31}function Vn(e){return e<<5|e>>>27}function Gn(e){return e<<30|e>>>2}function Kn(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Le.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,u=this._e|0,d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<80;++d)t[d]=zn(t[d-3]^t[d-8]^t[d-14]^t[d-16]);for(var b=0;b<80;++b){var l=~~(b/20),S=Vn(r)+Kn(l,i,n,s)+u+t[b]+jn[l]|0;u=s,s=n,n=Gn(i),i=r,r=S}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0};Le.prototype._hash=function(){var e=qn.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Yn=Le,Xn=Q,yi=Ae,Zn=de.Buffer,Jn=[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],Qn=new Array(64);function Oe(){this.init(),this._w=Qn,yi.call(this,64,56)}Xn(Oe,yi);Oe.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ea(e,t,r){return r^e&(t^r)}function ta(e,t,r){return e&t|r&(e|t)}function ra(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function ia(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function na(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function aa(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Oe.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,u=this._e|0,d=this._f|0,b=this._g|0,l=this._h|0,S=0;S<16;++S)t[S]=e.readInt32BE(S*4);for(;S<64;++S)t[S]=aa(t[S-2])+t[S-7]+na(t[S-15])+t[S-16]|0;for(var h=0;h<64;++h){var w=l+ia(u)+ea(u,d,b)+Jn[h]+t[h]|0,v=ra(r)+ta(r,i,n)|0;l=b,b=d,d=u,u=s+w|0,s=n,n=i,i=r,r=w+v|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=d+this._f|0,this._g=b+this._g|0,this._h=l+this._h|0};Oe.prototype._hash=function(){var e=Zn.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var wi=Oe,oa=Q,sa=wi,fa=Ae,la=de.Buffer,ua=new Array(64);function Ze(){this.init(),this._w=ua,fa.call(this,64,56)}oa(Ze,sa);Ze.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Ze.prototype._hash=function(){var e=la.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var ha=Ze,_a=Q,xi=Ae,ca=de.Buffer,Or=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],da=new Array(160);function Ie(){this.init(),this._w=da,xi.call(this,128,112)}_a(Ie,xi);Ie.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ir(e,t,r){return r^e&(t^r)}function $r(e,t,r){return e&t|r&(e|t)}function Fr(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Ur(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function pa(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function ba(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function va(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function ga(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function W(e,t){return e>>>0>>0?1:0}Ie.prototype._update=function(e){for(var t=this._w,r=this._ah|0,i=this._bh|0,n=this._ch|0,s=this._dh|0,u=this._eh|0,d=this._fh|0,b=this._gh|0,l=this._hh|0,S=this._al|0,h=this._bl|0,w=this._cl|0,v=this._dl|0,m=this._el|0,A=this._fl|0,x=this._gl|0,f=this._hl|0,p=0;p<32;p+=2)t[p]=e.readInt32BE(p*4),t[p+1]=e.readInt32BE(p*4+4);for(;p<160;p+=2){var y=t[p-30],R=t[p-15*2+1],T=pa(y,R),B=ba(R,y);y=t[p-2*2],R=t[p-2*2+1];var L=va(y,R),$=ga(R,y),D=t[p-7*2],k=t[p-7*2+1],V=t[p-16*2],Z=t[p-16*2+1],j=B+k|0,z=T+D+W(j,B)|0;j=j+$|0,z=z+L+W(j,$)|0,j=j+Z|0,z=z+V+W(j,Z)|0,t[p]=z,t[p+1]=j}for(var G=0;G<160;G+=2){z=t[G],j=t[G+1];var ne=$r(r,i,n),he=$r(S,h,w),K=Fr(r,S),ee=Fr(S,r),J=Ur(u,m),ae=Ur(m,u),_e=Or[G],te=Or[G+1],Y=Ir(u,d,b),oe=Ir(m,A,x),q=f+ae|0,_=l+J+W(q,f)|0;q=q+oe|0,_=_+Y+W(q,oe)|0,q=q+te|0,_=_+_e+W(q,te)|0,q=q+j|0,_=_+z+W(q,j)|0;var c=ee+he|0,E=K+ne+W(c,ee)|0;l=b,f=x,b=d,x=A,d=u,A=m,m=v+q|0,u=s+_+W(m,v)|0,s=n,v=w,n=i,w=h,i=r,h=S,S=q+c|0,r=_+E+W(S,q)|0}this._al=this._al+S|0,this._bl=this._bl+h|0,this._cl=this._cl+w|0,this._dl=this._dl+v|0,this._el=this._el+m|0,this._fl=this._fl+A|0,this._gl=this._gl+x|0,this._hl=this._hl+f|0,this._ah=this._ah+r+W(this._al,S)|0,this._bh=this._bh+i+W(this._bl,h)|0,this._ch=this._ch+n+W(this._cl,w)|0,this._dh=this._dh+s+W(this._dl,v)|0,this._eh=this._eh+u+W(this._el,m)|0,this._fh=this._fh+d+W(this._fl,A)|0,this._gh=this._gh+b+W(this._gl,x)|0,this._hh=this._hh+l+W(this._hl,f)|0};Ie.prototype._hash=function(){var e=ca.allocUnsafe(64);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ei=Ie,ya=Q,wa=Ei,xa=Ae,Ea=de.Buffer,Sa=new Array(160);function Je(){this.init(),this._w=Sa,xa.call(this,128,112)}ya(Je,wa);Je.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Je.prototype._hash=function(){var e=Ea.allocUnsafe(48);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var ma=Je,ge=pi.exports=function(t){t=t.toLowerCase();var r=ge[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};ge.sha=Un;ge.sha1=Yn;ge.sha224=ha;ge.sha256=wi;ge.sha384=ma;ge.sha512=Ei;var Ya=pi.exports;function Si(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t2&&(u.children=arguments.length>3?$e.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)u[s]===void 0&&(u[s]=e.defaultProps[s]);return Be(e,u,i,n,null)}function Be(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++mi,__i:-1,__u:0};return n==null&&F.vnode!=null&&F.vnode(s),s}function Aa(){return{current:null}}function Fe(e){return e.children}function Me(e,t){this.props=e,this.context=t}function me(e,t){if(t==null)return e.__?me(e.__,e.__i+1):null;for(var r;tt&&be.sort(sr));ze.__r=0}function Mi(e,t,r,i,n,s,u,d,b,l,S){var h,w,v,m,A,x=i&&i.__k||Ci,f=t.length;for(r.__d=b,Ca(r,t,x),b=r.__d,h=0;h0?Be(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n).__=e,n.__b=e.__b+1,s=null,(d=n.__i=ka(n,r,u,S))!==-1&&(S--,(s=r[d])&&(s.__u|=131072)),s==null||s.__v===null?(d==-1&&h--,typeof n.type!="function"&&(n.__u|=65536)):d!==u&&(d==u-1?h--:d==u+1?h++:(d>u?h--:h++,n.__u|=65536))):n=e.__k[i]=null;if(S)for(i=0;i(b!=null&&!(131072&b.__u)?1:0))for(;u>=0||d=0){if((b=t[u])&&!(131072&b.__u)&&n==b.key&&s===b.type)return u;u--}if(d2&&(d.children=arguments.length>3?$e.call(arguments,2):r),Be(e.type,d,i||e.key,n||e.ref,null)}function Na(e,t){var r={__c:t="__cC"+Ai++,__:e,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,s;return this.getChildContext||(n=[],(s={})[t]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(u){this.props.value!==u.value&&n.some(function(d){d.__e=!0,hr(d)})},this.sub=function(u){n.push(u);var d=u.componentWillUnmount;u.componentWillUnmount=function(){n&&n.splice(n.indexOf(u),1),d&&d.call(u)}}),i.children}};return r.Provider.__=r.Consumer.contextType=r}$e=Ci.slice,F={__e:function(e,t,r,i){for(var n,s,u;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(e)),u=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),u=n.__d),u)return n.__E=n}catch(d){e=d}throw e}},mi=0,Ri=function(e){return e!=null&&e.constructor==null},Me.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=fe({},this.state),typeof e=="function"&&(e=e(fe({},r),this.props)),e&&fe(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),hr(this))},Me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),hr(this))},Me.prototype.render=Fe,be=[],Ti=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,sr=function(e,t){return e.__v.__b-t.__v.__b},ze.__r=0,dr=0,fr=Wr(!1),lr=Wr(!0),Ai=0;const Pa=Object.freeze(Object.defineProperty({__proto__:null,Component:Me,Fragment:Fe,cloneElement:Da,createContext:Na,createElement:ur,createRef:Aa,h:ur,hydrate:Ii,get isValidElement(){return Ri},get options(){return F},render:Oi,toChildArray:Ni},Symbol.toStringTag,{value:"Module"})),Za=Ve(Pa);var ue,I,ir,zr,Re=0,$i=[],H=F,Vr=H.__b,Gr=H.__r,Kr=H.diffed,Yr=H.__c,Xr=H.unmount,Zr=H.__;function ye(e,t){H.__h&&H.__h(I,e,Re||t),Re=0;var r=I.__H||(I.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Fi(e){return Re=1,Ui(qi,e)}function Ui(e,t,r){var i=ye(ue++,2);if(i.t=e,!i.__c&&(i.__=[r?r(t):qi(void 0,t),function(d){var b=i.__N?i.__N[0]:i.__[0],l=i.t(b,d);b!==l&&(i.__N=[l,i.__[1]],i.__c.setState({}))}],i.__c=I,!I.u)){var n=function(d,b,l){if(!i.__c.__H)return!0;var S=i.__c.__H.__.filter(function(w){return!!w.__c});if(S.every(function(w){return!w.__N}))return!s||s.call(this,d,b,l);var h=!1;return S.forEach(function(w){if(w.__N){var v=w.__[0];w.__=w.__N,w.__N=void 0,v!==w.__[0]&&(h=!0)}}),!(!h&&i.__c.props===d)&&(!s||s.call(this,d,b,l))};I.u=!0;var s=I.shouldComponentUpdate,u=I.componentWillUpdate;I.componentWillUpdate=function(d,b,l){if(this.__e){var S=s;s=void 0,n(d,b,l),s=S}u&&u.call(this,d,b,l)},I.shouldComponentUpdate=n}return i.__N||i.__}function La(e,t){var r=ye(ue++,3);!H.__s&&gr(r.__H,t)&&(r.__=e,r.i=t,I.__H.__h.push(r))}function Hi(e,t){var r=ye(ue++,4);!H.__s&&gr(r.__H,t)&&(r.__=e,r.i=t,I.__h.push(r))}function Oa(e){return Re=5,vr(function(){return{current:e}},[])}function Ia(e,t,r){Re=6,Hi(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function vr(e,t){var r=ye(ue++,7);return gr(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function $a(e,t){return Re=8,vr(function(){return e},t)}function Fa(e){var t=I.context[e.__c],r=ye(ue++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(I)),t.props.value):e.__}function Ua(e,t){H.useDebugValue&&H.useDebugValue(t?t(e):e)}function Ha(e){var t=ye(ue++,10),r=Fi();return t.__=e,I.componentDidCatch||(I.componentDidCatch=function(i,n){t.__&&t.__(i,n),r[1](i)}),[r[0],function(){r[1](void 0)}]}function qa(){var e=ye(ue++,11);if(!e.__){for(var t=I.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function ja(){for(var e;e=$i.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(je),e.__H.__h.forEach(_r),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){I=null,Vr&&Vr(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Zr&&Zr(e,t)},H.__r=function(e){Gr&&Gr(e),ue=0;var t=(I=e.__c).__H;t&&(ir===I?(t.__h=[],I.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(je),t.__h.forEach(_r),t.__h=[],ue=0)),ir=I},H.diffed=function(e){Kr&&Kr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($i.push(t)!==1&&zr===H.requestAnimationFrame||((zr=H.requestAnimationFrame)||Wa)(ja)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),ir=I=null},H.__c=function(e,t){t.some(function(r){try{r.__h.forEach(je),r.__h=r.__h.filter(function(i){return!i.__||_r(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],H.__e(i,r.__v)}}),Yr&&Yr(e,t)},H.unmount=function(e){Xr&&Xr(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(i){try{je(i)}catch(n){t=n}}),r.__H=void 0,t&&H.__e(t,r.__v))};var Jr=typeof requestAnimationFrame=="function";function Wa(e){var t,r=function(){clearTimeout(i),Jr&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);Jr&&(t=requestAnimationFrame(r))}function je(e){var t=I,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),I=t}function _r(e){var t=I;e.__c=e.__(),I=t}function gr(e,t){return!e||e.length!==t.length||t.some(function(r,i){return r!==e[i]})}function qi(e,t){return typeof t=="function"?t(e):t}const za=Object.freeze(Object.defineProperty({__proto__:null,useCallback:$a,useContext:Fa,useDebugValue:Ua,useEffect:La,useErrorBoundary:Ha,useId:qa,useImperativeHandle:Ia,useLayoutEffect:Hi,useMemo:vr,useReducer:Ui,useRef:Oa,useState:Fi},Symbol.toStringTag,{value:"Module"})),Ja=Ve(za);export{Za as a,Ja as b,Ga as c,Ka as j,Xa as r,Ya as s}; diff --git a/dist/assets/index-Cdw1Pm6b.js b/dist/assets/index-Cdw1Pm6b.js deleted file mode 100644 index 2a276007..00000000 --- a/dist/assets/index-Cdw1Pm6b.js +++ /dev/null @@ -1,64 +0,0 @@ -import{p as _,s as x,a as v,r as E,C as c,O as C,i as T,c as m,h as y,A as u,k as A,b,E as d,W as g,S as h,d as I,M as O,R as N}from"./index-DY4jrsxT.js";import{e as k,V as z,Y as D}from"./index-DY4jrsxT.js";const i=_({status:"uninitialized"}),p={state:i,subscribeKey(t,e){return x(i,t,e)},subscribe(t){return v(i,()=>t(i))},_getClient(){if(!i._client)throw new Error("SIWEController client not set");return i._client},async getNonce(t){const n=await this._getClient().getNonce(t);return this.setNonce(n),n},async getSession(){try{const e=await this._getClient().getSession();return e&&(this.setSession(e),this.setStatus("success")),e||void 0}catch{return}},createMessage(t){const n=this._getClient().createMessage(t);return this.setMessage(n),n},async verifyMessage(t){return await this._getClient().verifyMessage(t)},async signIn(){return await this._getClient().signIn()},async signOut(){var e;const t=this._getClient();await t.signOut(),this.setStatus("ready"),this.setSession(void 0),(e=t.onSignOut)==null||e.call(t)},onSignIn(t){var n;const e=this._getClient();(n=e.onSignIn)==null||n.call(e,t)},onSignOut(){var e;const t=this._getClient();(e=t.onSignOut)==null||e.call(t)},async setSIWEClient(t){i._client=E(t),i.session=await this.getSession(),i.status=i.session?"success":"ready",c.setAccountProp("siweStatus",i.status,"eip155"),C.setIsSiweEnabled(t.options.enabled)},setNonce(t){i.nonce=t},setStatus(t){i.status=t,c.setAccountProp("siweStatus",i.status,"eip155")},setMessage(t){i.message=t},setSession(t){i.session=t,i.status=t?"success":"ready",c.setAccountProp("siweStatus",i.status,"eip155")}},R=T` - :host { - display: flex; - justify-content: center; - gap: var(--wui-spacing-2xl); - } - - wui-visual-thumbnail:nth-child(1) { - z-index: 1; - } -`;var U=function(t,e,n,a){var r=arguments.length,s=r<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(r<3?o(s):r>3?o(e,n,s):o(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};let f=class extends y{constructor(){var e,n;super(...arguments),this.dappImageUrl=(e=C.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(n=u.state.connectedWalletInfo)==null?void 0:n.icon}firstUpdated(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return A` - - - `}createAnimation(e,n){e.animate([{transform:"translateX(0px)"},{transform:n}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};f.styles=R;f=U([m("w3m-connecting-siwe")],f);var S=function(t,e,n,a){var r=arguments.length,s=r<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,a);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(r<3?o(s):r>3?o(e,n,s):o(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};let w=class extends y{constructor(){var e;super(...arguments),this.dappName=(e=C.state.metadata)==null?void 0:e.name,this.isSigning=!1,this.isCancelling=!1}render(){return A` - - - - - ${this.dappName??"Dapp"} needs to connect to your wallet - - - Sign this message to prove you own this wallet and proceed. Canceling will disconnect - you. - - - - Cancel - - - ${this.isSigning?"Signing...":"Sign"} - - - `}async onSign(){var e,n,a;this.isSigning=!0,d.sendEvent({event:"CLICK_SIGN_SIWE_MESSAGE",type:"track",properties:{network:((e=c.state.activeCaipNetwork)==null?void 0:e.id)||"",isSmartAccount:u.state.preferredAccountType===g.ACCOUNT_TYPES.SMART_ACCOUNT}});try{p.setStatus("loading");const r=await p.signIn();return p.setStatus("success"),d.sendEvent({event:"SIWE_AUTH_SUCCESS",type:"track",properties:{network:((n=c.state.activeCaipNetwork)==null?void 0:n.id)||"",isSmartAccount:u.state.preferredAccountType===g.ACCOUNT_TYPES.SMART_ACCOUNT}}),r}catch{const o=u.state.preferredAccountType===g.ACCOUNT_TYPES.SMART_ACCOUNT;return o?h.showError("This application might not support Smart Accounts"):h.showError("Signature declined"),p.setStatus("error"),d.sendEvent({event:"SIWE_AUTH_ERROR",type:"track",properties:{network:((a=c.state.activeCaipNetwork)==null?void 0:a.id)||"",isSmartAccount:o}})}finally{this.isSigning=!1}}async onCancel(){var n;this.isCancelling=!0,c.state.activeCaipAddress?(await I.disconnect(),O.close()):N.push("Connect"),this.isCancelling=!1,d.sendEvent({event:"CLICK_CANCEL_SIWE",type:"track",properties:{network:((n=c.state.activeCaipNetwork)==null?void 0:n.id)||"",isSmartAccount:u.state.preferredAccountType===g.ACCOUNT_TYPES.SMART_ACCOUNT}})}};S([b()],w.prototype,"isSigning",void 0);S([b()],w.prototype,"isCancelling",void 0);w=S([m("w3m-connecting-siwe-view")],w);export{p as SIWEController,f as W3mConnectingSiwe,w as W3mConnectingSiweView,k as formatMessage,z as getDidAddress,D as getDidChainId}; diff --git a/dist/assets/index-Clf5vl-T.js b/dist/assets/index-Clf5vl-T.js deleted file mode 100644 index 8c349075..00000000 --- a/dist/assets/index-Clf5vl-T.js +++ /dev/null @@ -1,7 +0,0 @@ -import{aU as al,aS as $,aV as ca,aW as la,aT as cl}from"./index-DY4jrsxT.js";import{s as ll,a as Ke,b as un,r as Mr,j as ul,c as dl}from"./hooks.module-BBeYFAft.js";var ua={},_r={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.walletLogo=void 0;const hl=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};dn.walletLogo=hl;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.LINK_API_URL=void 0;hn.LINK_API_URL="https://www.walletlink.org";var L={},Gs={exports:{}};Gs.exports;(function(t){(function(e,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function i(E,o){E.super_=o;var l=function(){};l.prototype=o.prototype,E.prototype=new l,E.prototype.constructor=E}function s(E,o,l){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(E||0,o||10,l||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=al.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,l){return o.cmp(l)>0?o:l},s.min=function(o,l){return o.cmp(l)<0?o:l},s.prototype._init=function(o,l,f){if(typeof o=="number")return this._initNumber(o,l,f);if(typeof o=="object")return this._initArray(o,l,f);l==="hex"&&(l=16),n(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var p=0;o[0]==="-"&&(p++,this.negative=1),p=0;p-=3)b=o[p]|o[p-1]<<8|o[p-2]<<16,this.words[v]|=b<>>26-S&67108863,S+=24,S>=26&&(S-=26,v++);else if(f==="le")for(p=0,v=0;p>>26-S&67108863,S+=24,S>=26&&(S-=26,v++);return this._strip()};function u(E,o){var l=E.charCodeAt(o);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;n(!1,"Invalid character in "+E)}function h(E,o,l){var f=u(E,l);return l-1>=o&&(f|=u(E,l-1)<<4),f}s.prototype._parseHex=function(o,l,f){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var p=0;p=l;p-=2)S=h(o,l,p)<=18?(v-=18,b+=1,this.words[b]|=S>>>26):v+=8;else{var m=o.length-l;for(p=m%2===0?l+1:l;p=18?(v-=18,b+=1,this.words[b]|=S>>>26):v+=8}this._strip()};function d(E,o,l,f){for(var p=0,v=0,b=Math.min(E.length,l),S=o;S=49?v=m-49+10:m>=17?v=m-17+10:v=m,n(m>=0&&v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=y}catch{s.prototype.inspect=y}else s.prototype.inspect=y;function y(){return(this.red?""}var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],C=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,l){o=o||10,l=l|0||1;var f;if(o===16||o==="hex"){f="";for(var p=0,v=0,b=0;b>>24-p&16777215,p+=2,p>=26&&(p-=26,b--),v!==0||b!==this.length-1?f=_[6-m.length]+m+f:f=m+f}for(v!==0&&(f=v.toString(16)+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var c=M[o],w=C[o];f="";var x=this.clone();for(x.negative=0;!x.isZero();){var A=x.modrn(w).toString(o);x=x.idivn(w),x.isZero()?f=A+f:f=_[c-A.length]+A+f}for(this.isZero()&&(f="0"+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,l){return this.toArrayLike(a,o,l)}),s.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)};var R=function(o,l){return o.allocUnsafe?o.allocUnsafe(l):new o(l)};s.prototype.toArrayLike=function(o,l,f){this._strip();var p=this.byteLength(),v=f||Math.max(1,p);n(p<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var b=R(o,v),S=l==="le"?"LE":"BE";return this["_toArrayLike"+S](b,p),b},s.prototype._toArrayLikeLE=function(o,l){for(var f=0,p=0,v=0,b=0;v>8&255),f>16&255),b===6?(f>24&255),p=0,b=0):(p=S>>>24,b+=2)}if(f=0&&(o[f--]=S>>8&255),f>=0&&(o[f--]=S>>16&255),b===6?(f>=0&&(o[f--]=S>>24&255),p=0,b=0):(p=S>>>24,b+=2)}if(f>=0)for(o[f--]=p;f>=0;)o[f--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var l=o,f=0;return l>=4096&&(f+=13,l>>>=13),l>=64&&(f+=7,l>>>=7),l>=8&&(f+=4,l>>>=4),l>=2&&(f+=2,l>>>=2),f+l},s.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,f=0;return l&8191||(f+=13,l>>>=13),l&127||(f+=7,l>>>=7),l&15||(f+=4,l>>>=4),l&3||(f+=2,l>>>=2),l&1||f++,f},s.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function I(E){for(var o=new Array(E.bitLength()),l=0;l>>p&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var l;this.length>o.length?l=o:l=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var l,f;this.length>o.length?(l=this,f=o):(l=o,f=this);for(var p=0;po.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var l=Math.ceil(o/26)|0,f=o%26;this._expand(l),f>0&&l--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-f),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,l){n(typeof o=="number"&&o>=0);var f=o/26|0,p=o%26;return this._expand(f+1),l?this.words[f]=this.words[f]|1<o.length?(f=this,p=o):(f=o,p=this);for(var v=0,b=0;b>>26;for(;v!==0&&b>>26;if(this.length=f.length,v!==0)this.words[this.length]=v,this.length++;else if(f!==this)for(;bo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,v;f>0?(p=this,v=o):(p=o,v=this);for(var b=0,S=0;S>26,this.words[S]=l&67108863;for(;b!==0&&S>26,this.words[S]=l&67108863;if(b===0&&S>>26,x=m&67108863,A=Math.min(c,o.length-1),B=Math.max(0,c-E.length+1);B<=A;B++){var qe=c-B|0;p=E.words[qe]|0,v=o.words[B]|0,b=p*v+x,w+=b/67108864|0,x=b&67108863}l.words[c]=x|0,m=w|0}return m!==0?l.words[c]=m|0:l.length--,l._strip()}var P=function(o,l,f){var p=o.words,v=l.words,b=f.words,S=0,m,c,w,x=p[0]|0,A=x&8191,B=x>>>13,qe=p[1]|0,G=qe&8191,Z=qe>>>13,Ti=p[2]|0,te=Ti&8191,re=Ti>>>13,xi=p[3]|0,ne=xi&8191,se=xi>>>13,Pi=p[4]|0,ie=Pi&8191,oe=Pi>>>13,Oi=p[5]|0,ae=Oi&8191,ce=Oi>>>13,$i=p[6]|0,le=$i&8191,ue=$i>>>13,Bi=p[7]|0,de=Bi&8191,he=Bi>>>13,Fi=p[8]|0,fe=Fi&8191,ge=Fi>>>13,ji=p[9]|0,pe=ji&8191,me=ji>>>13,Di=v[0]|0,ve=Di&8191,we=Di>>>13,Hi=v[1]|0,ye=Hi&8191,be=Hi>>>13,Ui=v[2]|0,_e=Ui&8191,Ee=Ui>>>13,Vi=v[3]|0,Se=Vi&8191,Me=Vi>>>13,Wi=v[4]|0,Ce=Wi&8191,ke=Wi>>>13,zi=v[5]|0,Re=zi&8191,Ie=zi>>>13,qi=v[6]|0,Ae=qi&8191,Ne=qi>>>13,Ji=v[7]|0,Le=Ji&8191,Te=Ji>>>13,Gi=v[8]|0,xe=Gi&8191,Pe=Gi>>>13,Zi=v[9]|0,Oe=Zi&8191,$e=Zi>>>13;f.negative=o.negative^l.negative,f.length=19,m=Math.imul(A,ve),c=Math.imul(A,we),c=c+Math.imul(B,ve)|0,w=Math.imul(B,we);var rs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(rs>>>26)|0,rs&=67108863,m=Math.imul(G,ve),c=Math.imul(G,we),c=c+Math.imul(Z,ve)|0,w=Math.imul(Z,we),m=m+Math.imul(A,ye)|0,c=c+Math.imul(A,be)|0,c=c+Math.imul(B,ye)|0,w=w+Math.imul(B,be)|0;var ns=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ns>>>26)|0,ns&=67108863,m=Math.imul(te,ve),c=Math.imul(te,we),c=c+Math.imul(re,ve)|0,w=Math.imul(re,we),m=m+Math.imul(G,ye)|0,c=c+Math.imul(G,be)|0,c=c+Math.imul(Z,ye)|0,w=w+Math.imul(Z,be)|0,m=m+Math.imul(A,_e)|0,c=c+Math.imul(A,Ee)|0,c=c+Math.imul(B,_e)|0,w=w+Math.imul(B,Ee)|0;var ss=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ss>>>26)|0,ss&=67108863,m=Math.imul(ne,ve),c=Math.imul(ne,we),c=c+Math.imul(se,ve)|0,w=Math.imul(se,we),m=m+Math.imul(te,ye)|0,c=c+Math.imul(te,be)|0,c=c+Math.imul(re,ye)|0,w=w+Math.imul(re,be)|0,m=m+Math.imul(G,_e)|0,c=c+Math.imul(G,Ee)|0,c=c+Math.imul(Z,_e)|0,w=w+Math.imul(Z,Ee)|0,m=m+Math.imul(A,Se)|0,c=c+Math.imul(A,Me)|0,c=c+Math.imul(B,Se)|0,w=w+Math.imul(B,Me)|0;var is=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(is>>>26)|0,is&=67108863,m=Math.imul(ie,ve),c=Math.imul(ie,we),c=c+Math.imul(oe,ve)|0,w=Math.imul(oe,we),m=m+Math.imul(ne,ye)|0,c=c+Math.imul(ne,be)|0,c=c+Math.imul(se,ye)|0,w=w+Math.imul(se,be)|0,m=m+Math.imul(te,_e)|0,c=c+Math.imul(te,Ee)|0,c=c+Math.imul(re,_e)|0,w=w+Math.imul(re,Ee)|0,m=m+Math.imul(G,Se)|0,c=c+Math.imul(G,Me)|0,c=c+Math.imul(Z,Se)|0,w=w+Math.imul(Z,Me)|0,m=m+Math.imul(A,Ce)|0,c=c+Math.imul(A,ke)|0,c=c+Math.imul(B,Ce)|0,w=w+Math.imul(B,ke)|0;var os=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(os>>>26)|0,os&=67108863,m=Math.imul(ae,ve),c=Math.imul(ae,we),c=c+Math.imul(ce,ve)|0,w=Math.imul(ce,we),m=m+Math.imul(ie,ye)|0,c=c+Math.imul(ie,be)|0,c=c+Math.imul(oe,ye)|0,w=w+Math.imul(oe,be)|0,m=m+Math.imul(ne,_e)|0,c=c+Math.imul(ne,Ee)|0,c=c+Math.imul(se,_e)|0,w=w+Math.imul(se,Ee)|0,m=m+Math.imul(te,Se)|0,c=c+Math.imul(te,Me)|0,c=c+Math.imul(re,Se)|0,w=w+Math.imul(re,Me)|0,m=m+Math.imul(G,Ce)|0,c=c+Math.imul(G,ke)|0,c=c+Math.imul(Z,Ce)|0,w=w+Math.imul(Z,ke)|0,m=m+Math.imul(A,Re)|0,c=c+Math.imul(A,Ie)|0,c=c+Math.imul(B,Re)|0,w=w+Math.imul(B,Ie)|0;var as=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(as>>>26)|0,as&=67108863,m=Math.imul(le,ve),c=Math.imul(le,we),c=c+Math.imul(ue,ve)|0,w=Math.imul(ue,we),m=m+Math.imul(ae,ye)|0,c=c+Math.imul(ae,be)|0,c=c+Math.imul(ce,ye)|0,w=w+Math.imul(ce,be)|0,m=m+Math.imul(ie,_e)|0,c=c+Math.imul(ie,Ee)|0,c=c+Math.imul(oe,_e)|0,w=w+Math.imul(oe,Ee)|0,m=m+Math.imul(ne,Se)|0,c=c+Math.imul(ne,Me)|0,c=c+Math.imul(se,Se)|0,w=w+Math.imul(se,Me)|0,m=m+Math.imul(te,Ce)|0,c=c+Math.imul(te,ke)|0,c=c+Math.imul(re,Ce)|0,w=w+Math.imul(re,ke)|0,m=m+Math.imul(G,Re)|0,c=c+Math.imul(G,Ie)|0,c=c+Math.imul(Z,Re)|0,w=w+Math.imul(Z,Ie)|0,m=m+Math.imul(A,Ae)|0,c=c+Math.imul(A,Ne)|0,c=c+Math.imul(B,Ae)|0,w=w+Math.imul(B,Ne)|0;var cs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(cs>>>26)|0,cs&=67108863,m=Math.imul(de,ve),c=Math.imul(de,we),c=c+Math.imul(he,ve)|0,w=Math.imul(he,we),m=m+Math.imul(le,ye)|0,c=c+Math.imul(le,be)|0,c=c+Math.imul(ue,ye)|0,w=w+Math.imul(ue,be)|0,m=m+Math.imul(ae,_e)|0,c=c+Math.imul(ae,Ee)|0,c=c+Math.imul(ce,_e)|0,w=w+Math.imul(ce,Ee)|0,m=m+Math.imul(ie,Se)|0,c=c+Math.imul(ie,Me)|0,c=c+Math.imul(oe,Se)|0,w=w+Math.imul(oe,Me)|0,m=m+Math.imul(ne,Ce)|0,c=c+Math.imul(ne,ke)|0,c=c+Math.imul(se,Ce)|0,w=w+Math.imul(se,ke)|0,m=m+Math.imul(te,Re)|0,c=c+Math.imul(te,Ie)|0,c=c+Math.imul(re,Re)|0,w=w+Math.imul(re,Ie)|0,m=m+Math.imul(G,Ae)|0,c=c+Math.imul(G,Ne)|0,c=c+Math.imul(Z,Ae)|0,w=w+Math.imul(Z,Ne)|0,m=m+Math.imul(A,Le)|0,c=c+Math.imul(A,Te)|0,c=c+Math.imul(B,Le)|0,w=w+Math.imul(B,Te)|0;var ls=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ls>>>26)|0,ls&=67108863,m=Math.imul(fe,ve),c=Math.imul(fe,we),c=c+Math.imul(ge,ve)|0,w=Math.imul(ge,we),m=m+Math.imul(de,ye)|0,c=c+Math.imul(de,be)|0,c=c+Math.imul(he,ye)|0,w=w+Math.imul(he,be)|0,m=m+Math.imul(le,_e)|0,c=c+Math.imul(le,Ee)|0,c=c+Math.imul(ue,_e)|0,w=w+Math.imul(ue,Ee)|0,m=m+Math.imul(ae,Se)|0,c=c+Math.imul(ae,Me)|0,c=c+Math.imul(ce,Se)|0,w=w+Math.imul(ce,Me)|0,m=m+Math.imul(ie,Ce)|0,c=c+Math.imul(ie,ke)|0,c=c+Math.imul(oe,Ce)|0,w=w+Math.imul(oe,ke)|0,m=m+Math.imul(ne,Re)|0,c=c+Math.imul(ne,Ie)|0,c=c+Math.imul(se,Re)|0,w=w+Math.imul(se,Ie)|0,m=m+Math.imul(te,Ae)|0,c=c+Math.imul(te,Ne)|0,c=c+Math.imul(re,Ae)|0,w=w+Math.imul(re,Ne)|0,m=m+Math.imul(G,Le)|0,c=c+Math.imul(G,Te)|0,c=c+Math.imul(Z,Le)|0,w=w+Math.imul(Z,Te)|0,m=m+Math.imul(A,xe)|0,c=c+Math.imul(A,Pe)|0,c=c+Math.imul(B,xe)|0,w=w+Math.imul(B,Pe)|0;var us=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(us>>>26)|0,us&=67108863,m=Math.imul(pe,ve),c=Math.imul(pe,we),c=c+Math.imul(me,ve)|0,w=Math.imul(me,we),m=m+Math.imul(fe,ye)|0,c=c+Math.imul(fe,be)|0,c=c+Math.imul(ge,ye)|0,w=w+Math.imul(ge,be)|0,m=m+Math.imul(de,_e)|0,c=c+Math.imul(de,Ee)|0,c=c+Math.imul(he,_e)|0,w=w+Math.imul(he,Ee)|0,m=m+Math.imul(le,Se)|0,c=c+Math.imul(le,Me)|0,c=c+Math.imul(ue,Se)|0,w=w+Math.imul(ue,Me)|0,m=m+Math.imul(ae,Ce)|0,c=c+Math.imul(ae,ke)|0,c=c+Math.imul(ce,Ce)|0,w=w+Math.imul(ce,ke)|0,m=m+Math.imul(ie,Re)|0,c=c+Math.imul(ie,Ie)|0,c=c+Math.imul(oe,Re)|0,w=w+Math.imul(oe,Ie)|0,m=m+Math.imul(ne,Ae)|0,c=c+Math.imul(ne,Ne)|0,c=c+Math.imul(se,Ae)|0,w=w+Math.imul(se,Ne)|0,m=m+Math.imul(te,Le)|0,c=c+Math.imul(te,Te)|0,c=c+Math.imul(re,Le)|0,w=w+Math.imul(re,Te)|0,m=m+Math.imul(G,xe)|0,c=c+Math.imul(G,Pe)|0,c=c+Math.imul(Z,xe)|0,w=w+Math.imul(Z,Pe)|0,m=m+Math.imul(A,Oe)|0,c=c+Math.imul(A,$e)|0,c=c+Math.imul(B,Oe)|0,w=w+Math.imul(B,$e)|0;var ds=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ds>>>26)|0,ds&=67108863,m=Math.imul(pe,ye),c=Math.imul(pe,be),c=c+Math.imul(me,ye)|0,w=Math.imul(me,be),m=m+Math.imul(fe,_e)|0,c=c+Math.imul(fe,Ee)|0,c=c+Math.imul(ge,_e)|0,w=w+Math.imul(ge,Ee)|0,m=m+Math.imul(de,Se)|0,c=c+Math.imul(de,Me)|0,c=c+Math.imul(he,Se)|0,w=w+Math.imul(he,Me)|0,m=m+Math.imul(le,Ce)|0,c=c+Math.imul(le,ke)|0,c=c+Math.imul(ue,Ce)|0,w=w+Math.imul(ue,ke)|0,m=m+Math.imul(ae,Re)|0,c=c+Math.imul(ae,Ie)|0,c=c+Math.imul(ce,Re)|0,w=w+Math.imul(ce,Ie)|0,m=m+Math.imul(ie,Ae)|0,c=c+Math.imul(ie,Ne)|0,c=c+Math.imul(oe,Ae)|0,w=w+Math.imul(oe,Ne)|0,m=m+Math.imul(ne,Le)|0,c=c+Math.imul(ne,Te)|0,c=c+Math.imul(se,Le)|0,w=w+Math.imul(se,Te)|0,m=m+Math.imul(te,xe)|0,c=c+Math.imul(te,Pe)|0,c=c+Math.imul(re,xe)|0,w=w+Math.imul(re,Pe)|0,m=m+Math.imul(G,Oe)|0,c=c+Math.imul(G,$e)|0,c=c+Math.imul(Z,Oe)|0,w=w+Math.imul(Z,$e)|0;var hs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(hs>>>26)|0,hs&=67108863,m=Math.imul(pe,_e),c=Math.imul(pe,Ee),c=c+Math.imul(me,_e)|0,w=Math.imul(me,Ee),m=m+Math.imul(fe,Se)|0,c=c+Math.imul(fe,Me)|0,c=c+Math.imul(ge,Se)|0,w=w+Math.imul(ge,Me)|0,m=m+Math.imul(de,Ce)|0,c=c+Math.imul(de,ke)|0,c=c+Math.imul(he,Ce)|0,w=w+Math.imul(he,ke)|0,m=m+Math.imul(le,Re)|0,c=c+Math.imul(le,Ie)|0,c=c+Math.imul(ue,Re)|0,w=w+Math.imul(ue,Ie)|0,m=m+Math.imul(ae,Ae)|0,c=c+Math.imul(ae,Ne)|0,c=c+Math.imul(ce,Ae)|0,w=w+Math.imul(ce,Ne)|0,m=m+Math.imul(ie,Le)|0,c=c+Math.imul(ie,Te)|0,c=c+Math.imul(oe,Le)|0,w=w+Math.imul(oe,Te)|0,m=m+Math.imul(ne,xe)|0,c=c+Math.imul(ne,Pe)|0,c=c+Math.imul(se,xe)|0,w=w+Math.imul(se,Pe)|0,m=m+Math.imul(te,Oe)|0,c=c+Math.imul(te,$e)|0,c=c+Math.imul(re,Oe)|0,w=w+Math.imul(re,$e)|0;var fs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(fs>>>26)|0,fs&=67108863,m=Math.imul(pe,Se),c=Math.imul(pe,Me),c=c+Math.imul(me,Se)|0,w=Math.imul(me,Me),m=m+Math.imul(fe,Ce)|0,c=c+Math.imul(fe,ke)|0,c=c+Math.imul(ge,Ce)|0,w=w+Math.imul(ge,ke)|0,m=m+Math.imul(de,Re)|0,c=c+Math.imul(de,Ie)|0,c=c+Math.imul(he,Re)|0,w=w+Math.imul(he,Ie)|0,m=m+Math.imul(le,Ae)|0,c=c+Math.imul(le,Ne)|0,c=c+Math.imul(ue,Ae)|0,w=w+Math.imul(ue,Ne)|0,m=m+Math.imul(ae,Le)|0,c=c+Math.imul(ae,Te)|0,c=c+Math.imul(ce,Le)|0,w=w+Math.imul(ce,Te)|0,m=m+Math.imul(ie,xe)|0,c=c+Math.imul(ie,Pe)|0,c=c+Math.imul(oe,xe)|0,w=w+Math.imul(oe,Pe)|0,m=m+Math.imul(ne,Oe)|0,c=c+Math.imul(ne,$e)|0,c=c+Math.imul(se,Oe)|0,w=w+Math.imul(se,$e)|0;var gs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(gs>>>26)|0,gs&=67108863,m=Math.imul(pe,Ce),c=Math.imul(pe,ke),c=c+Math.imul(me,Ce)|0,w=Math.imul(me,ke),m=m+Math.imul(fe,Re)|0,c=c+Math.imul(fe,Ie)|0,c=c+Math.imul(ge,Re)|0,w=w+Math.imul(ge,Ie)|0,m=m+Math.imul(de,Ae)|0,c=c+Math.imul(de,Ne)|0,c=c+Math.imul(he,Ae)|0,w=w+Math.imul(he,Ne)|0,m=m+Math.imul(le,Le)|0,c=c+Math.imul(le,Te)|0,c=c+Math.imul(ue,Le)|0,w=w+Math.imul(ue,Te)|0,m=m+Math.imul(ae,xe)|0,c=c+Math.imul(ae,Pe)|0,c=c+Math.imul(ce,xe)|0,w=w+Math.imul(ce,Pe)|0,m=m+Math.imul(ie,Oe)|0,c=c+Math.imul(ie,$e)|0,c=c+Math.imul(oe,Oe)|0,w=w+Math.imul(oe,$e)|0;var ps=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ps>>>26)|0,ps&=67108863,m=Math.imul(pe,Re),c=Math.imul(pe,Ie),c=c+Math.imul(me,Re)|0,w=Math.imul(me,Ie),m=m+Math.imul(fe,Ae)|0,c=c+Math.imul(fe,Ne)|0,c=c+Math.imul(ge,Ae)|0,w=w+Math.imul(ge,Ne)|0,m=m+Math.imul(de,Le)|0,c=c+Math.imul(de,Te)|0,c=c+Math.imul(he,Le)|0,w=w+Math.imul(he,Te)|0,m=m+Math.imul(le,xe)|0,c=c+Math.imul(le,Pe)|0,c=c+Math.imul(ue,xe)|0,w=w+Math.imul(ue,Pe)|0,m=m+Math.imul(ae,Oe)|0,c=c+Math.imul(ae,$e)|0,c=c+Math.imul(ce,Oe)|0,w=w+Math.imul(ce,$e)|0;var ms=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ms>>>26)|0,ms&=67108863,m=Math.imul(pe,Ae),c=Math.imul(pe,Ne),c=c+Math.imul(me,Ae)|0,w=Math.imul(me,Ne),m=m+Math.imul(fe,Le)|0,c=c+Math.imul(fe,Te)|0,c=c+Math.imul(ge,Le)|0,w=w+Math.imul(ge,Te)|0,m=m+Math.imul(de,xe)|0,c=c+Math.imul(de,Pe)|0,c=c+Math.imul(he,xe)|0,w=w+Math.imul(he,Pe)|0,m=m+Math.imul(le,Oe)|0,c=c+Math.imul(le,$e)|0,c=c+Math.imul(ue,Oe)|0,w=w+Math.imul(ue,$e)|0;var vs=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(vs>>>26)|0,vs&=67108863,m=Math.imul(pe,Le),c=Math.imul(pe,Te),c=c+Math.imul(me,Le)|0,w=Math.imul(me,Te),m=m+Math.imul(fe,xe)|0,c=c+Math.imul(fe,Pe)|0,c=c+Math.imul(ge,xe)|0,w=w+Math.imul(ge,Pe)|0,m=m+Math.imul(de,Oe)|0,c=c+Math.imul(de,$e)|0,c=c+Math.imul(he,Oe)|0,w=w+Math.imul(he,$e)|0;var ws=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ws>>>26)|0,ws&=67108863,m=Math.imul(pe,xe),c=Math.imul(pe,Pe),c=c+Math.imul(me,xe)|0,w=Math.imul(me,Pe),m=m+Math.imul(fe,Oe)|0,c=c+Math.imul(fe,$e)|0,c=c+Math.imul(ge,Oe)|0,w=w+Math.imul(ge,$e)|0;var ys=(S+m|0)+((c&8191)<<13)|0;S=(w+(c>>>13)|0)+(ys>>>26)|0,ys&=67108863,m=Math.imul(pe,Oe),c=Math.imul(pe,$e),c=c+Math.imul(me,Oe)|0,w=Math.imul(me,$e);var bs=(S+m|0)+((c&8191)<<13)|0;return S=(w+(c>>>13)|0)+(bs>>>26)|0,bs&=67108863,b[0]=rs,b[1]=ns,b[2]=ss,b[3]=is,b[4]=os,b[5]=as,b[6]=cs,b[7]=ls,b[8]=us,b[9]=ds,b[10]=hs,b[11]=fs,b[12]=gs,b[13]=ps,b[14]=ms,b[15]=vs,b[16]=ws,b[17]=ys,b[18]=bs,S!==0&&(b[19]=S,f.length++),f};Math.imul||(P=T);function k(E,o,l){l.negative=o.negative^E.negative,l.length=E.length+o.length;for(var f=0,p=0,v=0;v>>26)|0,p+=b>>>26,b&=67108863}l.words[v]=S,f=b,b=p}return f!==0?l.words[v]=f:l.length--,l._strip()}function H(E,o,l){return k(E,o,l)}s.prototype.mulTo=function(o,l){var f,p=this.length+o.length;return this.length===10&&o.length===10?f=P(this,o,l):p<63?f=T(this,o,l):p<1024?f=k(this,o,l):f=H(this,o,l),f},s.prototype.mul=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},s.prototype.mulf=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),H(this,o,l)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var l=o<0;l&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var f=0,p=0;p>=26,f+=v/67108864|0,f+=b>>>26,this.words[p]=b&67108863}return f!==0&&(this.words[p]=f,this.length++),l?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var l=I(o);if(l.length===0)return new s(1);for(var f=this,p=0;p=0);var l=o%26,f=(o-l)/26,p=67108863>>>26-l<<26-l,v;if(l!==0){var b=0;for(v=0;v>>26-l}b&&(this.words[v]=b,this.length++)}if(f!==0){for(v=this.length-1;v>=0;v--)this.words[v+f]=this.words[v];for(v=0;v=0);var p;l?p=(l-l%26)/26:p=0;var v=o%26,b=Math.min((o-v)/26,this.length),S=67108863^67108863>>>v<b)for(this.length-=b,c=0;c=0&&(w!==0||c>=p);c--){var x=this.words[c]|0;this.words[c]=w<<26-v|x>>>v,w=x&S}return m&&w!==0&&(m.words[m.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,l,f){return n(this.negative===0),this.iushrn(o,l,f)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var l=o%26,f=(o-l)/26,p=1<=0);var l=o%26,f=(o-l)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(l!==0&&f++,this.length=Math.min(f,this.length),l!==0){var p=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(m/67108864|0),this.words[v+f]=b&67108863}for(;v>26,this.words[v+f]=b&67108863;if(S===0)return this._strip();for(n(S===-1),S=0,v=0;v>26,this.words[v]=b&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,l){var f=this.length-o.length,p=this.clone(),v=o,b=v.words[v.length-1]|0,S=this._countBits(b);f=26-S,f!==0&&(v=v.ushln(f),p.iushln(f),b=v.words[v.length-1]|0);var m=p.length-v.length,c;if(l!=="mod"){c=new s(null),c.length=m+1,c.words=new Array(c.length);for(var w=0;w=0;A--){var B=(p.words[v.length+A]|0)*67108864+(p.words[v.length+A-1]|0);for(B=Math.min(B/b|0,67108863),p._ishlnsubmul(v,B,A);p.negative!==0;)B--,p.negative=0,p._ishlnsubmul(v,1,A),p.isZero()||(p.negative^=1);c&&(c.words[A]=B)}return c&&c._strip(),p._strip(),l!=="div"&&f!==0&&p.iushrn(f),{div:c||null,mod:p}},s.prototype.divmod=function(o,l,f){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var p,v,b;return this.negative!==0&&o.negative===0?(b=this.neg().divmod(o,l),l!=="mod"&&(p=b.div.neg()),l!=="div"&&(v=b.mod.neg(),f&&v.negative!==0&&v.iadd(o)),{div:p,mod:v}):this.negative===0&&o.negative!==0?(b=this.divmod(o.neg(),l),l!=="mod"&&(p=b.div.neg()),{div:p,mod:b.mod}):this.negative&o.negative?(b=this.neg().divmod(o.neg(),l),l!=="div"&&(v=b.mod.neg(),f&&v.negative!==0&&v.isub(o)),{div:b.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,l)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var f=l.div.negative!==0?l.mod.isub(o):l.mod,p=o.ushrn(1),v=o.andln(1),b=f.cmp(p);return b<0||v===1&&b===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},s.prototype.modrn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=(1<<26)%o,p=0,v=this.length-1;v>=0;v--)p=(f*p+(this.words[v]|0))%o;return l?-p:p},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+f*67108864;this.words[p]=v/o|0,f=v%o}return this._strip(),l?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new s(1),v=new s(0),b=new s(0),S=new s(1),m=0;l.isEven()&&f.isEven();)l.iushrn(1),f.iushrn(1),++m;for(var c=f.clone(),w=l.clone();!l.isZero();){for(var x=0,A=1;!(l.words[0]&A)&&x<26;++x,A<<=1);if(x>0)for(l.iushrn(x);x-- >0;)(p.isOdd()||v.isOdd())&&(p.iadd(c),v.isub(w)),p.iushrn(1),v.iushrn(1);for(var B=0,qe=1;!(f.words[0]&qe)&&B<26;++B,qe<<=1);if(B>0)for(f.iushrn(B);B-- >0;)(b.isOdd()||S.isOdd())&&(b.iadd(c),S.isub(w)),b.iushrn(1),S.iushrn(1);l.cmp(f)>=0?(l.isub(f),p.isub(b),v.isub(S)):(f.isub(l),b.isub(p),S.isub(v))}return{a:b,b:S,gcd:f.iushln(m)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new s(1),v=new s(0),b=f.clone();l.cmpn(1)>0&&f.cmpn(1)>0;){for(var S=0,m=1;!(l.words[0]&m)&&S<26;++S,m<<=1);if(S>0)for(l.iushrn(S);S-- >0;)p.isOdd()&&p.iadd(b),p.iushrn(1);for(var c=0,w=1;!(f.words[0]&w)&&c<26;++c,w<<=1);if(c>0)for(f.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(b),v.iushrn(1);l.cmp(f)>=0?(l.isub(f),p.isub(v)):(f.isub(l),v.isub(p))}var x;return l.cmpn(1)===0?x=p:x=v,x.cmpn(0)<0&&x.iadd(o),x},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),f=o.clone();l.negative=0,f.negative=0;for(var p=0;l.isEven()&&f.isEven();p++)l.iushrn(1),f.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;f.isEven();)f.iushrn(1);var v=l.cmp(f);if(v<0){var b=l;l=f,f=b}else if(v===0||f.cmpn(1)===0)break;l.isub(f)}while(!0);return f.iushln(p)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var l=o%26,f=(o-l)/26,p=1<>>26,S&=67108863,this.words[b]=S}return v!==0&&(this.words[b]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var f;if(this.length>1)f=1;else{l&&(o=-o),n(o<=67108863,"Number is too big");var p=this.words[0]|0;f=p===o?0:po.length)return 1;if(this.length=0;f--){var p=this.words[f]|0,v=o.words[f]|0;if(p!==v){pv&&(l=1);break}}return l},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new U(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function O(E,o){this.name=E,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},O.prototype.ireduce=function(o){var l=o,f;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),f=l.bitLength();while(f>this.n);var p=f0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},O.prototype.split=function(o,l){o.iushrn(this.n,0,l)},O.prototype.imulK=function(o){return o.imul(this.k)};function q(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(q,O),q.prototype.split=function(o,l){for(var f=4194303,p=Math.min(o.length,9),v=0;v>>22,b=S}b>>>=22,o.words[v-10]=b,b===0&&o.length>10?o.length-=10:o.length-=9},q.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,f=0;f>>=26,o.words[f]=v,l=p}return l!==0&&(o.words[o.length++]=l),o},s._prime=function(o){if(N[o])return N[o];var l;if(o==="k256")l=new q;else if(o==="p224")l=new Fe;else if(o==="p192")l=new ze;else if(o==="p25519")l=new Y;else throw new Error("Unknown prime "+o);return N[o]=l,l};function U(E){if(typeof E=="string"){var o=s._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}U.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},U.prototype._verify2=function(o,l){n((o.negative|l.negative)===0,"red works only with positives"),n(o.red&&o.red===l.red,"red works only with red numbers")},U.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(g(o,o.umod(this.m)._forceRed(this)),o)},U.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},U.prototype.add=function(o,l){this._verify2(o,l);var f=o.add(l);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},U.prototype.iadd=function(o,l){this._verify2(o,l);var f=o.iadd(l);return f.cmp(this.m)>=0&&f.isub(this.m),f},U.prototype.sub=function(o,l){this._verify2(o,l);var f=o.sub(l);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},U.prototype.isub=function(o,l){this._verify2(o,l);var f=o.isub(l);return f.cmpn(0)<0&&f.iadd(this.m),f},U.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},U.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},U.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},U.prototype.isqr=function(o){return this.imul(o,o.clone())},U.prototype.sqr=function(o){return this.mul(o,o)},U.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(n(l%2===1),l===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(o,f)}for(var p=this.m.subn(1),v=0;!p.isZero()&&p.andln(1)===0;)v++,p.iushrn(1);n(!p.isZero());var b=new s(1).toRed(this),S=b.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);this.pow(c,m).cmp(S)!==0;)c.redIAdd(S);for(var w=this.pow(c,p),x=this.pow(o,p.addn(1).iushrn(1)),A=this.pow(o,p),B=v;A.cmp(b)!==0;){for(var qe=A,G=0;qe.cmp(b)!==0;G++)qe=qe.redSqr();n(G=0;v--){for(var w=l.words[v],x=c-1;x>=0;x--){var A=w>>x&1;if(b!==p[0]&&(b=this.sqr(b)),A===0&&S===0){m=0;continue}S<<=1,S|=A,m++,!(m!==f&&(v!==0||x!==0))&&(b=this.mul(b,p[S]),m=0,S=0)}c=26}return b},U.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},U.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},s.mont=function(o){return new J(o)};function J(E){U.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(J,U),J.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},J.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(l),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),b=v;return v.cmp(this.m)>=0?b=v.isub(this.m):v.cmpn(0)<0&&(b=v.iadd(this.m)),b._forceRed(this)},J.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new s(0)._forceRed(this);var f=o.mul(l),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),b=v;return v.cmp(this.m)>=0?b=v.isub(this.m):v.cmpn(0)<0&&(b=v.iadd(this.m)),b._forceRed(this)},J.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(t,$)})(Gs);var fn=Gs.exports,Cr={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.errorValues=St.standardErrorCodes=void 0;St.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};St.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var gn={},pn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=St,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,M=r){if(_&&Number.isInteger(_)){const C=_.toString();if(g(e.errorValues,C))return e.errorValues[C].message;if(h(_))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const M=_.toString();return!!(e.errorValues[M]||h(_))}t.isValidCode=i;function s(_){var M;if(typeof _=="number")return _;if(a(_))return(M=_.code)!==null&&M!==void 0?M:_.errorCode}t.getErrorCode=s;function a(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function u(_,{shouldIncludeStack:M=!1}={}){const C={};if(_&&typeof _=="object"&&!Array.isArray(_)&&g(_,"code")&&i(_.code)){const R=_;C.code=R.code,R.message&&typeof R.message=="string"?(C.message=R.message,g(R,"data")&&(C.data=R.data)):(C.message=n(C.code),C.data={originalError:d(_)})}else C.code=e.standardErrorCodes.rpc.internal,C.message=y(_,"message")?_.message:r,C.data={originalError:d(_)};return M&&(C.stack=y(_,"stack")?_.stack:void 0),C}t.serialize=u;function h(_){return _>=-32099&&_<=-32e3}function d(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function g(_,M){return Object.prototype.hasOwnProperty.call(_,M)}function y(_,M){return typeof _=="object"&&_!==null&&M in _&&typeof _[M]=="string"}})(pn);Object.defineProperty(gn,"__esModule",{value:!0});gn.standardErrors=void 0;const Ue=St,da=pn;gn.standardErrors={rpc:{parse:t=>rt(Ue.standardErrorCodes.rpc.parse,t),invalidRequest:t=>rt(Ue.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>rt(Ue.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>rt(Ue.standardErrorCodes.rpc.methodNotFound,t),internal:t=>rt(Ue.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return rt(e,t)},invalidInput:t=>rt(Ue.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>rt(Ue.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>rt(Ue.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>rt(Ue.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>rt(Ue.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>rt(Ue.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Wt(Ue.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Wt(Ue.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Wt(Ue.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Wt(Ue.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Wt(Ue.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Wt(Ue.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ga(e,r,n)}}};function rt(t,e){const[r,n]=ha(e);return new fa(t,r||(0,da.getMessageFromCode)(t),n)}function Wt(t,e){const[r,n]=ha(e);return new ga(t,r||(0,da.getMessageFromCode)(t),n)}function ha(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let fa=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},ga=class extends fa{constructor(e,r,n){if(!fl(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function fl(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var mn={},lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.isErrorResponse=void 0;function gl(t){return t.errorMessage!==void 0}lr.isErrorResponse=gl;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.LIB_VERSION=void 0;ur.LIB_VERSION="3.9.3";Object.defineProperty(mn,"__esModule",{value:!0});mn.serializeError=void 0;const pl=lr,ml=ur,vl=St,wl=pn;function yl(t,e){const r=(0,wl.serialize)(bl(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",ml.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=_l(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}mn.serializeError=yl;function bl(t){return typeof t=="string"?{message:t,code:vl.standardErrorCodes.rpc.internal}:(0,pl.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function _l(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=St;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=gn;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=mn;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=pn;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Cr);var je={};Object.defineProperty(je,"__esModule",{value:!0});je.ProviderType=je.RegExpString=je.IntNumber=je.BigIntString=je.AddressString=je.HexString=je.OpaqueType=void 0;function kr(){return t=>t}je.OpaqueType=kr;je.HexString=kr();je.AddressString=kr();je.BigIntString=kr();function El(t){return Math.floor(t)}je.IntNumber=El;je.RegExpString=kr();var Qi;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(Qi||(je.ProviderType=Qi={}));var Sl=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(L,"__esModule",{value:!0});L.isMobileWeb=L.getLocation=L.isInIFrame=L.createQrUrl=L.getFavicon=L.range=L.isBigNumber=L.ensureParsedJSONObject=L.ensureBN=L.ensureRegExpString=L.ensureIntNumber=L.ensureBuffer=L.ensureAddressString=L.ensureEvenLengthHexString=L.ensureHexString=L.isHexString=L.prepend0x=L.strip0x=L.has0xPrefix=L.hexStringFromIntNumber=L.intNumberFromHexString=L.bigIntStringFromBN=L.hexStringFromBuffer=L.hexStringToUint8Array=L.uint8ArrayToHex=L.randomBytesHex=void 0;const kt=Sl(fn),Ht=Cr,ot=je,pa=/^[0-9]*$/,ma=/^[a-f0-9]*$/;function Ml(t){return va(crypto.getRandomValues(new Uint8Array(t)))}L.randomBytesHex=Ml;function va(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}L.uint8ArrayToHex=va;function Cl(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}L.hexStringToUint8Array=Cl;function kl(t,e=!1){const r=t.toString("hex");return(0,ot.HexString)(e?`0x${r}`:r)}L.hexStringFromBuffer=kl;function Rl(t){return(0,ot.BigIntString)(t.toString(10))}L.bigIntStringFromBN=Rl;function Il(t){return(0,ot.IntNumber)(new kt.default(Ir(t,!1),16).toNumber())}L.intNumberFromHexString=Il;function Al(t){return(0,ot.HexString)(`0x${new kt.default(t).toString(16)}`)}L.hexStringFromIntNumber=Al;function Zs(t){return t.startsWith("0x")||t.startsWith("0X")}L.has0xPrefix=Zs;function vn(t){return Zs(t)?t.slice(2):t}L.strip0x=vn;function wa(t){return Zs(t)?`0x${t.slice(2)}`:`0x${t}`}L.prepend0x=wa;function Rr(t){if(typeof t!="string")return!1;const e=vn(t).toLowerCase();return ma.test(e)}L.isHexString=Rr;function ya(t,e=!1){if(typeof t=="string"){const r=vn(t).toLowerCase();if(ma.test(r))return(0,ot.HexString)(e?`0x${r}`:r)}throw Ht.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}L.ensureHexString=ya;function Ir(t,e=!1){let r=ya(t,!1);return r.length%2===1&&(r=(0,ot.HexString)(`0${r}`)),e?(0,ot.HexString)(`0x${r}`):r}L.ensureEvenLengthHexString=Ir;function Nl(t){if(typeof t=="string"){const e=vn(t).toLowerCase();if(Rr(e)&&e.length===40)return(0,ot.AddressString)(wa(e))}throw Ht.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}L.ensureAddressString=Nl;function Ll(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(Rr(t)){const e=Ir(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Ht.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}L.ensureBuffer=Ll;function ba(t){if(typeof t=="number"&&Number.isInteger(t))return(0,ot.IntNumber)(t);if(typeof t=="string"){if(pa.test(t))return(0,ot.IntNumber)(Number(t));if(Rr(t))return(0,ot.IntNumber)(new kt.default(Ir(t,!1),16).toNumber())}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}L.ensureIntNumber=ba;function Tl(t){if(t instanceof RegExp)return(0,ot.RegExpString)(t.toString());throw Ht.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}L.ensureRegExpString=Tl;function xl(t){if(t!==null&&(kt.default.isBN(t)||_a(t)))return new kt.default(t.toString(10),10);if(typeof t=="number")return new kt.default(ba(t));if(typeof t=="string"){if(pa.test(t))return new kt.default(t,10);if(Rr(t))return new kt.default(Ir(t,!1),16)}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}L.ensureBN=xl;function Pl(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Ht.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}L.ensureParsedJSONObject=Pl;function _a(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}L.isBigNumber=_a;function Ol(t,e){return Array.from({length:e-t},(r,n)=>t+n)}L.range=Ol;function $l(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}L.getFavicon=$l;function Bl(t,e,r,n,i,s){const a=n?"parent-id":"id",u=new URLSearchParams({[a]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${u}`}L.createQrUrl=Bl;function Ea(){try{return window.frameElement!==null}catch{return!1}}L.isInIFrame=Ea;function Fl(){try{return Ea()&&window.top?window.top.location:window.location}catch{return window.location}}L.getLocation=Fl;function jl(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}L.isMobileWeb=jl;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.ScopedLocalStorage=void 0;class Dl{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}wn.ScopedLocalStorage=Dl;var rr={},Ar={},Nr={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.EVENTS=void 0;dr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var it={};Object.defineProperty(it,"__esModule",{value:!0});it.RelayAbstract=it.APP_VERSION_KEY=it.LOCAL_STORAGE_ADDRESSES_KEY=it.WALLET_USER_NAME_KEY=void 0;const Ki=Cr;it.WALLET_USER_NAME_KEY="walletUsername";it.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";it.APP_VERSION_KEY="AppVersion";class Hl{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Ki.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Ki.serializeError)(s,e.method);return i})}}it.RelayAbstract=Hl;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.Session=void 0;const Xi=ll,Yi=L,eo="session:id",to="session:secret",ro="session:linked";class Qs{constructor(e,r,n,i){this._storage=e,this._id=r||(0,Yi.randomBytesHex)(16),this._secret=n||(0,Yi.randomBytesHex)(32),this._key=new Xi.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(eo),n=e.getItem(ro),i=e.getItem(to);return r&&i?new Qs(e,r,i,n==="1"):null}static hash(e){return new Xi.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(eo,this._id),this._storage.setItem(to,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(ro,this._linked?"1":"0")}}hr.Session=Qs;var yn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.Cipher=void 0;const zr=L;class Ul{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,zr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),u=16,h=a.slice(a.byteLength-u),d=a.slice(0,a.byteLength-u),g=new Uint8Array(h),y=new Uint8Array(d),_=new Uint8Array([...n,...g,...y]);return(0,zr.uint8ArrayToHex)(_)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,zr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,zr.hexStringToUint8Array)(e),u=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),g=new Uint8Array([...d,...h]),y={name:"AES-GCM",iv:new Uint8Array(u)};try{const _=await window.crypto.subtle.decrypt(y,s,g),M=new TextDecoder;n(M.decode(_))}catch(_){i(_)}})()})}}bn.Cipher=Ul;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.WalletLinkHTTP=void 0;class Vl{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}_n.WalletLinkHTTP=Vl;var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.WalletLinkWebSocket=nr.ConnectionState=void 0;var Kt;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Kt||(nr.ConnectionState=Kt={}));class Wl{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Kt.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Kt.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Kt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,u;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(u=this.incomingDataListener)===null||u===void 0||u.call(this,h)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Kt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}nr.WalletLinkWebSocket=Wl;Object.defineProperty(yn,"__esModule",{value:!0});yn.WalletLinkConnection=void 0;const zt=je,zl=bn,ht=dr,no=it,qt=hr,ql=_n,qr=nr,so=1e4,Jl=6e4;class Gl{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=u=>{if(!u)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>u.JsonRpcUrl&&this.handleChainUpdated(d,u.JsonRpcUrl)]]).forEach((d,g)=>{const y=u[g];y!==void 0&&d(y)})},this.handleDestroyed=u=>{var h,d;u==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:qt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async u=>{var h,d;try{const g=await this.cipher.decrypt(u);(h=this.listener)===null||h===void 0||h.accountUpdated(g)}catch{(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(u,h)=>{var d,g;try{const y=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(u,y)}catch{(g=this.diagnostic)===null||g===void 0||g.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:u})}},this.handleWalletUsernameUpdated=async u=>{this.handleMetadataUpdated(no.WALLET_USER_NAME_KEY,u)},this.handleAppVersionUpdated=async u=>{this.handleMetadataUpdated(no.APP_VERSION_KEY,u)},this.handleChainUpdated=async(u,h)=>{var d,g;try{const y=await this.cipher.decrypt(u),_=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(y,_)}catch{(g=this.diagnostic)===null||g===void 0||g.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new zl.Cipher(e.secret),this.diagnostic=i,this.listener=n;const a=new qr.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async u=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.CONNECTED_STATE_CHANGE,{state:u,sessionIdHash:qt.Session.hash(e.id)});let d=!1;switch(u){case qr.ConnectionState.DISCONNECTED:if(!this.destroyed){const g=async()=>{await new Promise(y=>setTimeout(y,5e3)),this.destroyed||a.connect().catch(()=>{g()})};g()}break;case qr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},so),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case qr.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(u=>{var h,d,g;switch(u.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const y=u.type==="IsLinkedOK"?u.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.LINKED,{sessionIdHash:qt.Session.hash(e.id),linked:y,type:u.type,onlineGuests:u.onlineGuests}),this.linked=y||u.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:qt.Session.hash(e.id),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.handleSessionMetadataUpdated(u.metadata);break}case"Event":{this.handleIncomingEvent(u);break}}u.id!==void 0&&((g=this.requestResolutions.get(u.id))===null||g===void 0||g(u))}),this.ws=a,this.http=new ql.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.STARTED_CONNECTING,{sessionIdHash:qt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.DISCONNECTED,{sessionIdHash:qt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>so*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=Jl){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}yn.WalletLinkConnection=Gl;var Lr={},Tr={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Zl=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.injectCssReset=void 0;const Ql=Zl(Ks);function Kl(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Ql.default)),document.documentElement.appendChild(t)}Tr.injectCssReset=Kl;var En={},Sn={},sr={},Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.CloseIcon=void 0;const io=Ke;function Xl(t){return(0,io.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,io.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Mn.CloseIcon=Xl;var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.CoinbaseWalletRound=void 0;const Jr=Ke;function Yl(t){return(0,Jr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Jr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Jr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,Jr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}Cn.CoinbaseWalletRound=Yl;var kn={};Object.defineProperty(kn,"__esModule",{value:!0});kn.QRCodeIcon=void 0;const mr=Ke;function eu(t){return(0,mr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,mr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,mr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,mr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,mr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}kn.QRCodeIcon=eu;var Rn={};function Sa(t){this.mode=et.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Sa.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=wt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=K.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var u=0;u<2;u++)if(this.modules[n][a-u]==null){var h=!1;s>>i&1)==1);var d=K.getMask(e,n,a-u);d&&(h=!h),this.modules[n][a-u]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};wt.PAD0=236;wt.PAD1=17;wt.createData=function(t,e,r){for(var n=vt.getRSBlocks(t,e),i=new Ma,s=0;su*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+u*8+")");for(i.getLengthInBits()+4<=u*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=u*8||(i.put(wt.PAD0,8),i.getLengthInBits()>=u*8));)i.put(wt.PAD1,8);return wt.createBytes(i,n)};wt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),a=new Array(e.length),u=0;u=0?M.get(C):0}}for(var R=0,g=0;g=0;)e^=K.G15<=0;)e^=K.G18<>>=1;return e},getPatternPosition:function(t){return K.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Mt.PATTERN000:return(e+r)%2==0;case Mt.PATTERN001:return e%2==0;case Mt.PATTERN010:return r%3==0;case Mt.PATTERN011:return(e+r)%3==0;case Mt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Mt.PATTERN101:return e*r%2+e*r%3==0;case Mt.PATTERN110:return(e*r%2+e*r%3)%2==0;case Mt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Xt([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return He.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ve=0;Ve<8;Ve++)He.EXP_TABLE[Ve]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var _s=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Ca(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Rt.L;case"M":return Rt.M;case"Q":return Rt.Q;case"H":return Rt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var g=i(h),y=1,_=0,M=0,C=_s.length;M<=C;M++){var R=_s[M];if(!R)throw new Error("Content too long: expected "+_+" but got "+g);switch(d){case"L":_=R[0];break;case"M":_=R[1];break;case"Q":_=R[2];break;case"H":_=R[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(g<=_)break;y++}if(y>_s.length)throw new Error("Content too long");return y}function i(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),u=r(this.options.ecl);this.qrcode=new wt(a,u),this.qrcode.addData(s),this.qrcode.make()}Ca.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r -`:"",a=e.width,u=e.height,h=r.length,d=a/(h+2*e.padding),g=u/(h+2*e.padding),y=typeof e.join<"u"?!!e.join:!1,_=typeof e.swap<"u"?!!e.swap:!1,M=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,C=typeof e.predefined<"u"?!!e.predefined:!1,R=C?i+''+s:"",I=i+''+s,T="",P="",k=0;k'+s:T+=i+''+s}}y&&(T=i+'');let U="";if(this.options.image!==void 0&&this.options.image.svg){const E=a*this.options.image.width/100,o=u*this.options.image.height/100,l=a/2-E/2,f=u/2-o/2;U+=``,U+=this.options.image.svg+s,U+=""}var J="";switch(t.container){case"svg":M&&(J+=''+s),J+=''+s,J+=R+I+T,J+=U,J+="";break;case"svg-viewbox":M&&(J+=''+s),J+=''+s,J+=R+I+T,J+=U,J+="";break;case"g":J+=''+s,J+=R+I+T,J+=U,J+="";break;default:J+=(R+I+T+U).replace(/^\s+/,"");break}return J};var tu=Ca,ru=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.QRCode=void 0;const nu=Ke,oo=un,su=ru(tu),iu=t=>{const[e,r]=(0,oo.useState)("");return(0,oo.useEffect)(()=>{var n,i;const s=new su.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),a=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,nu.h)("img",{src:e,alt:"QR Code"}):null};Rn.QRCode=iu;var In={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var ou=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(In,"__esModule",{value:!0});In.Spinner=void 0;const Gr=Ke,au=ou(Xs),cu=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Gr.h)("div",{class:"-cbwsdk-spinner"},(0,Gr.h)("style",null,au.default),(0,Gr.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Gr.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};In.Spinner=cu;var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var ka=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sr,"__esModule",{value:!0});sr.CoinbaseWalletSteps=sr.ConnectContent=void 0;const Ft=ka(Mr),W=Ke,lu=L,uu=ur,du=Mn,hu=Cn,fu=kn,gu=Rn,pu=In,mu=ka(Ys),Es={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Ra},vu=t=>t==="light"?"#FFFFFF":"#0A0B0D";function wu(t){const{theme:e}=t,r=(0,lu.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=Es.steps;return(0,W.h)("div",{"data-testid":"connect-content",className:(0,Ft.default)("-cbwsdk-connect-content",e)},(0,W.h)("style",null,mu.default),(0,W.h)("div",{className:"-cbwsdk-connect-content-header"},(0,W.h)("h2",{className:(0,Ft.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,W.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,W.h)(du.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,W.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,W.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,W.h)(yu,{title:Es.title,description:Es.description,theme:e})),(0,W.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,W.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,W.h)(gu.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,W.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:uu.LIB_VERSION}),(0,W.h)("input",{type:"hidden",value:r})),(0,W.h)(n,{theme:e}),!t.isConnected&&(0,W.h)("div",{"data-testid":"connecting-spinner",className:(0,Ft.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,W.h)(pu.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,W.h)("p",null,"Connecting...")))))}sr.ConnectContent=wu;function yu({title:t,description:e,theme:r}){return(0,W.h)("div",{className:(0,Ft.default)("-cbwsdk-connect-item",r)},(0,W.h)("div",null,(0,W.h)(hu.CoinbaseWalletRound,null)),(0,W.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,W.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,W.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function Ra({theme:t}){return(0,W.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,W.h)("li",{className:(0,Ft.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,W.h)("li",{className:(0,Ft.default)("-cbwsdk-wallet-steps-item",t)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,W.h)("span",null,"Tap ",(0,W.h)("strong",null,"Scan")," "),(0,W.h)("span",{className:(0,Ft.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,W.h)(fu.QRCodeIcon,{fill:vu(t)})))))}sr.CoinbaseWalletSteps=Ra;var An={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ArrowLeftIcon=void 0;const ao=Ke;function bu(t){return(0,ao.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,ao.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Nn.ArrowLeftIcon=bu;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.LaptopIcon=void 0;const Ss=Ke;function _u(t){return(0,Ss.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ss.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ss.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Ln.LaptopIcon=_u;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SafeIcon=void 0;const co=Ke;function Eu(t){return(0,co.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,co.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Tn.SafeIcon=Eu;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Ia=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(An,"__esModule",{value:!0});An.TryExtensionContent=void 0;const Nt=Ia(Mr),Be=Ke,Ms=un,Su=Nn,Mu=Ln,Cu=Tn,ku=Ia(ei);function Ru({theme:t}){const[e,r]=(0,Ms.useState)(!1),n=(0,Ms.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ms.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension",t)},(0,Be.h)("style",null,ku.default),(0,Be.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Be.h)("h3",{class:(0,Nt.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Be.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Be.h)("button",{class:(0,Nt.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Be.h)("div",null,!e&&(0,Be.h)(Su.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Be.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Be.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Be.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Be.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Be.h)("span",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Be.h)(Mu.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Be.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Be.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Be.h)("span",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Be.h)(Cu.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}An.TryExtensionContent=Ru;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Aa=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ConnectDialog=void 0;const Cs=Aa(Mr),Lt=Ke,ks=un,Iu=sr,Au=An,Nu=Aa(ti),Lu=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,ks.useState)(!e),[s,a]=(0,ks.useState)(!e);(0,ks.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!e)},10)];return e?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[e]);const u=r?"dark":"light";return(0,Lt.h)("div",{class:(0,Cs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Lt.h)("style",null,Nu.default),(0,Lt.h)("div",{class:(0,Cs.default)("-cbwsdk-connect-dialog-backdrop",u,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Lt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Lt.h)("div",{class:(0,Cs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Lt.h)(Iu.ConnectContent,{theme:u,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Lt.h)(Au.TryExtensionContent,{theme:u}))))};Sn.ConnectDialog=Lu;Object.defineProperty(En,"__esModule",{value:!0});En.LinkFlow=void 0;const Rs=Ke,Tu=Sn;class xu{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,Rs.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Rs.render)((0,Rs.h)(Tu.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}En.LinkFlow=xu;var ri={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=$&&$.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Mr),n=Ke,i=un,s=e(ni),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",u="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(_){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=_.darkMode}attach(_){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",_.appendChild(this.root),this.render()}presentItem(_){const M=this.nextItemKey++;return this.items.set(M,_),this.render(),()=>{this.items.delete(M),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([_,M])=>(0,n.h)(t.SnackbarInstance,Object.assign({},M,{key:_}))))),this.root)}}t.Snackbar=h;const d=y=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},y.children));t.SnackbarContainer=d;const g=({autoExpand:y,message:_,menuItems:M})=>{const[C,R]=(0,i.useState)(!0),[I,T]=(0,i.useState)(y??!1);(0,i.useEffect)(()=>{const k=[window.setTimeout(()=>{R(!1)},1),window.setTimeout(()=>{T(!0)},1e4)];return()=>{k.forEach(window.clearTimeout)}});const P=()=>{T(!I)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",C&&"-cbwsdk-snackbar-instance-hidden",I&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:P},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!I&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:u,class:"-gear-icon",title:"Expand"}))),M&&M.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},M.map((k,H)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",k.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:k.onClick,key:H},(0,n.h)("svg",{width:k.svgWidth,height:k.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":k.defaultFillRule,"clip-rule":k.defaultClipRule,d:k.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",k.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},k.info)))))};t.SnackbarInstance=g})(ri);Object.defineProperty(Lr,"__esModule",{value:!0});Lr.WalletLinkRelayUI=void 0;const Pu=Tr,Ou=En,$u=ri;class Bu{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new $u.Snackbar({darkMode:e.darkMode}),this.linkFlow=new Ou.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,Pu.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Lr.WalletLinkRelayUI=Bu;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.WalletLinkRelay=void 0;const Jt=Cr,Fu=je,Q=L,Tt=dr,lo=it,Ct=hr,ju=yn,xt=lr,Du=Lr;class Et extends lo.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var u;this.isLinked=a;const h=this.storage.getItem(lo.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const d=h.split(" "),g=this.storage.getItem("IsStandaloneSigning")==="true";if(d[0]!==""&&!a&&this.session.linked&&!g){this.isUnlinkedErrorState=!0;const y=this.getSessionIdHash();(u=this.diagnostic)===null||u===void 0||u.log(Tt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:y})}}},this.metadataUpdated=(a,u)=>{this.storage.setItem(a,u)},this.chainUpdated=(a,u)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===u||(this.chainCallbackParams={chainId:a,jsonRpcUrl:u},this.chainCallback&&this.chainCallback(a,u))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Et.accountRequestCallbackIds.size>0&&(Array.from(Et.accountRequestCallbackIds.values()).forEach(u=>{const h={type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:u}))}),Et.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const e=Ct.Session.load(this.storage)||new Ct.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new ju.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,u=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:e});return i.connect(),{session:e,ui:u,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;const n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(Tt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Ct.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ct.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:u}=this.subscribe();this._session=s,this.connection=u,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Q.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Q.hexStringFromBuffer)(e,!0),signature:(0,Q.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Q.bigIntStringFromBN)(e.weiValue),data:(0,Q.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,Q.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Q.bigIntStringFromBN)(e.weiValue),data:(0,Q.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,Q.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,Q.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,Q.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Q.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,Q.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return{promise:new Promise((a,u)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,xt.isErrorResponse)(h))return u(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof Du.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;const i={type:"WEB3_REQUEST",id:e,request:r},s=Ct.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Tt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ct.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(Tt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ct.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Et.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Et.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Jt.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Q.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),(0,xt.isErrorResponse)(u))return a(new Error(u.errorMessage));s(u)}),this.ui.inlineAccountsResponse()){const u=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Jt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}Et.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:"selectProvider",params:{providerOptions:e}},n=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,u)=>{this.relayEventManager.callbacks.set(n,g=>{if((0,xt.isErrorResponse)(g))return u(new Error(g.errorMessage));a(g)});const h=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Fu.ProviderType.Unselected}})},d=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:g}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:d,onCancel:h,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,a){const u={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const d=(0,Q.randomBytesHex)(8),g=_=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,u.method,_),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload}));const y=new Promise((_,M)=>{this.relayEventManager.callbacks.set(d,I=>{if(h==null||h(),(0,xt.isErrorResponse)(I))return M(new Error(I.errorMessage));_(I)});const C=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!1}})},R=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:R,onCancel:C,type:e,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,u)});return{cancel:g,promise:y}}addEthereumChain(e,r,n,i,s,a){const u={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const d=(0,Q.randomBytesHex)(8),g=_=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,u.method,_),h==null||h()};return this.ui.inlineAddEthereumChain(e)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload})),{promise:new Promise((_,M)=>{this.relayEventManager.callbacks.set(d,I=>{if(h==null||h(),(0,xt.isErrorResponse)(I))return M(new Error(I.errorMessage));_(I)});const C=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:I}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:C,onApprove:R,chainId:u.params.chainId,rpcUrls:u.params.rpcUrls,blockExplorerUrls:u.params.blockExplorerUrls,chainName:u.params.chainName,iconUrls:u.params.iconUrls,nativeCurrency:u.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,u)}),cancel:g}}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,Q.randomBytesHex)(8),s=u=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,u)};return{promise:new Promise((u,h)=>{this.relayEventManager.callbacks.set(i,y=>{if((0,xt.isErrorResponse)(y)&&y.errorCode)return h(Jt.standardErrors.provider.custom({code:y.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,xt.isErrorResponse)(y))return h(new Error(y.errorMessage));u(y)});const d=y=>{var _;if(y){const M=(_=(0,Jt.getErrorCode)(y))!==null&&_!==void 0?_:Jt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",y instanceof Error?y:Jt.standardErrors.provider.unsupportedChain(e),M)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},g=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:y}}})};this.ui.switchEthereumChain({onCancel:d,onApprove:g,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Ct.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Nr.WalletLinkRelay=Et;Et.accountRequestCallbackIds=new Set;var xr={},xn={},Na={};(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,u)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(ri,t)})(Na);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var La=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xn,"__esModule",{value:!0});xn.RedirectDialog=void 0;const Hu=La(Mr),mt=Ke,Uu=Tr,Vu=Na,Wu=La(si);class zu{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Uu.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,mt.render)(null,this.root),e&&(0,mt.render)((0,mt.h)(qu,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}xn.RedirectDialog=zu;const qu=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,mt.h)(Vu.SnackbarContainer,{darkMode:r},(0,mt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,mt.h)("style",null,Wu.default),(0,mt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,mt.h)("div",{class:(0,Hu.default)("-cbwsdk-redirect-dialog-box",s)},(0,mt.h)("p",null,t),(0,mt.h)("button",{onClick:n},e))))};Object.defineProperty(xr,"__esModule",{value:!0});xr.MobileRelayUI=void 0;const Ju=xn;class Gu{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Ju.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}xr.MobileRelayUI=Gu;Object.defineProperty(Ar,"__esModule",{value:!0});Ar.MobileRelay=void 0;const Zu=L,Qu=Nr,Ku=xr;class Xu extends Qu.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const e=(0,Zu.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof Ku.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}Ar.MobileRelay=Xu;const Yu=ul,ed=fn;function Ta(t){return Buffer.allocUnsafe(t).fill(0)}function xa(t,e,r){const n=Ta(e);return t=Pn(t),r?t.length"u")throw new Error("Not an array?");if(r=Fa(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(pt(t,e[s]));if(r==="dynamic"){var a=pt("uint256",e.length);i.unshift(a)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([pt("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,jt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Yt(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return jt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Yt(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Pt(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Yt(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Pt(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=uo(t),n=Pt(e),n<0)throw new Error("Supplied ufixed is negative");return pt("uint256",n.mul(new $t(2).pow(new $t(r[1]))))}else if(t.startsWith("fixed"))return r=uo(t),pt("int256",Pt(e).mul(new $t(2).pow(new $t(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function id(t){return t==="string"||t==="bytes"||Fa(t)==="dynamic"}function od(t){return t.lastIndexOf("]")===t.length-1}function ad(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var a=Ba(t[s]),u=e[s],h=pt(a,u);id(a)?(r.push(pt("uint256",i)),n.push(h),i+=h.length):r.push(h)}return Buffer.concat(r.concat(n))}function ja(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(jt.setLengthRight(u,r))}else if(a.startsWith("uint")){if(r=Yt(a),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Pt(u),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=Yt(a),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Pt(u),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function cd(t,e){return jt.keccak(ja(t,e))}var ld={rawEncode:ad,solidityPack:ja,soliditySHA3:cd};const lt=$a,br=ld,Da={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Is={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const a=(u,h,d)=>{if(r[h]!==void 0)return["bytes32",d==null?"0x0000000000000000000000000000000000000000000000000000000000000000":lt.keccak(this.encodeData(h,d,r,n))];if(d===void 0)throw new Error(`missing value for field ${u} of type ${h}`);if(h==="bytes")return["bytes32",lt.keccak(d)];if(h==="string")return typeof d=="string"&&(d=Buffer.from(d,"utf8")),["bytes32",lt.keccak(d)];if(h.lastIndexOf("]")===h.length-1){const g=h.slice(0,h.lastIndexOf("[")),y=d.map(_=>a(u,g,_));return["bytes32",lt.keccak(br.rawEncode(y.map(([_])=>_),y.map(([,_])=>_)))]}return[h,d]};for(const u of r[t]){const[h,d]=a(u.name,u.type,e[u.name]);i.push(h),s.push(d)}}else for(const a of r[t]){let u=e[a.name];if(u!==void 0)if(a.type==="bytes")i.push("bytes32"),u=lt.keccak(u),s.push(u);else if(a.type==="string")i.push("bytes32"),typeof u=="string"&&(u=Buffer.from(u,"utf8")),u=lt.keccak(u),s.push(u);else if(r[a.type]!==void 0)i.push("bytes32"),u=lt.keccak(this.encodeData(a.type,u,r,n)),s.push(u);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(u)}}return br.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:a,type:u})=>u+" "+a).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return lt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return lt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Da.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),lt.keccak(Buffer.concat(n))}};var ud={TYPED_MESSAGE_SCHEMA:Da,TypedDataUtils:Is,hashForSignTypedDataLegacy:function(t){return dd(t.data)},hashForSignTypedData_v3:function(t){return Is.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Is.hash(t.data)}};function dd(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?lt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return br.soliditySHA3(["bytes32","bytes32"],[br.soliditySHA3(new Array(t.length).fill("string"),i),br.soliditySHA3(n,r)])}var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.filterFromParam=ir.FilterPolyfill=void 0;const Qt=je,Ge=L,hd=5*60*1e3,Ot={jsonrpc:"2.0",id:0};class fd{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Qt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){const r=Ha(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ge.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Ge.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Ge.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Ge.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Ge.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Zr())}async getFilterLogs(e){const r=(0,Ge.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_getLogs",params:[ho(n)]})):Zr()}makeFilterId(){return(0,Qt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return Zr();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return Qr();console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_getLogs",params:[ho(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const u=a.result.map(d=>(0,Ge.intNumberFromHexString)(d.blockNumber||"0x0")),h=Math.max(...u);if(h&&h>n){const d=(0,Qt.IntNumber)(h+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${d}`),this.cursors.set(e,d)}}return a}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return Zr();const n=await this.getCurrentBlockHeight();if(r>n)return Qr();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Ge.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Qt.IntNumber)(a))))).filter(a=>!!a),s=(0,Qt.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Ot),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Qr())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},hd);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_blockNumber",params:[]}));return(0,Ge.intNumberFromHexString)((0,Ge.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Ot),{method:"eth_getBlockByNumber",params:[(0,Ge.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ge.ensureHexString)(r.result.hash):null}}ir.FilterPolyfill=fd;function Ha(t){return{fromBlock:fo(t.fromBlock),toBlock:fo(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}ir.filterFromParam=Ha;function ho(t){const e={fromBlock:go(t.fromBlock),toBlock:go(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function fo(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Qt.IntNumber)(0);if((0,Ge.isHexString)(t))return(0,Ge.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function go(t){return t==="latest"?t:(0,Ge.hexStringFromIntNumber)(t)}function Zr(){return Object.assign(Object.assign({},Ot),{error:{code:-32e3,message:"filter not found"}})}function Qr(){return Object.assign(Object.assign({},Ot),{result:[]})}var On={},Ua={},$n={},ii=gd;function gd(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const po=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(a,u){if(e.multiArgs){const h=new Array(arguments.length-1);for(let d=1;d{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):po(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?po(s,e):s}return n},Pr={},Or={};Object.defineProperty(Or,"__esModule",{value:!0});const md=ca;function mo(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function vd(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const u=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw u.context=a,u}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")mo(s,this,r);else{const a=s.length,u=vd(s);for(let h=0;ht+e,vo=["sync","latest"];class Sd extends bd.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*_d,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){vo.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return vo.map(e=>this.listenerCount(e)).reduce(Ed)}_shouldUseNewBlock(e){const r=this._currentBlock;if(!r)return!0;const n=wo(e),i=wo(r);return this._usePastBlocks&&ni}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Pr.BaseBlockTracker=Sd;function wo(t){return Number.parseInt(t,16)}var Va={},Wa={},We={};class za extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...a}=e,{path:u}=e,h=u.length===0?i:`At path: ${u.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Md(t){return at(t)&&typeof t[Symbol.iterator]=="function"}function at(t){return typeof t=="object"&&t!=null}function yo(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function De(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Cd(t){const{done:e,value:r}=t.next();return e?void 0:r}function kd(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:a}=r,{refinement:u,message:h=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${De(n)}\``}=t;return{value:n,type:a,refinement:u,key:i[i.length-1],path:i,branch:s,...t,message:h}}function*Hs(t,e,r,n){Md(t)||(t=[t]);for(const i of t){const s=kd(i,e,r,n);s&&(yield s)}}function*oi(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:a=!1}=r,u={path:n,branch:i};if(s&&(t=e.coercer(t,u),a&&e.type!=="type"&&at(e.schema)&&at(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let h="valid";for(const d of e.validator(t,u))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,g,y]of e.entries(t,u)){const _=oi(g,y,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,g],coerce:s,mask:a,message:r.message});for(const M of _)M[0]?(h=M[0].refinement!=null?"not_refined":"not_valid",yield[M[0],void 0]):s&&(g=M[1],d===void 0?t=g:t instanceof Map?t.set(d,g):t instanceof Set?t.add(g):at(t)&&(g!==void 0||d in t)&&(t[d]=g))}if(h!=="not_valid")for(const d of e.refiner(t,u))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,t])}class ee{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:u=function*(){}}=e;this.type=r,this.schema=n,this.entries=u,this.coercer=a,i?this.validator=(h,d)=>{const g=i(h,d);return Hs(g,d,this,h)}:this.validator=()=>[],s?this.refiner=(h,d)=>{const g=s(h,d);return Hs(g,d,this,h)}:this.refiner=()=>[]}assert(e,r){return qa(e,this,r)}create(e,r){return Ja(e,this,r)}is(e){return ai(e,this)}mask(e,r){return Ga(e,this,r)}validate(e,r={}){return fr(e,this,r)}}function qa(t,e,r){const n=fr(t,e,{message:r});if(n[0])throw n[0]}function Ja(t,e,r){const n=fr(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ga(t,e,r){const n=fr(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ai(t,e){return!fr(t,e)[0]}function fr(t,e,r={}){const n=oi(t,e,r),i=Cd(n);return i[0]?[new za(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function Rd(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Br(n):$r(n)}function Xe(t,e){return new ee({type:t,schema:null,validator:e})}function Id(t,e){return new ee({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Ad(t){return new ee({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Nd(t){let e;return new ee({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Ld(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Br(n);default:return $r(n)}}function Td(t){const e=t instanceof ee,r=e?{...t.schema}:{...t};for(const n in r)r[n]=Za(r[n]);return e&&t.type==="type"?Br(r):$r(r)}function xd(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];switch(t.type){case"type":return Br(n);default:return $r(n)}}function Pd(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Xe(t,e)}function Od(){return Xe("any",()=>!0)}function $d(t){return new ee({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${De(e)}`}})}function Bd(){return Xe("bigint",t=>typeof t=="bigint")}function Fd(){return Xe("boolean",t=>typeof t=="boolean")}function jd(){return Xe("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${De(t)}`)}function Dd(t){const e={},r=t.map(n=>De(n)).join();for(const n of t)e[n]=n;return new ee({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${De(n)}`}})}function Hd(){return Xe("func",t=>typeof t=="function"||`Expected a function, but received: ${De(t)}`)}function Ud(t){return Xe("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${De(e)}`)}function Vd(){return Xe("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${De(t)}`)}function Wd(t){return new ee({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function zd(t){const e=De(t),r=typeof t;return new ee({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${De(n)}`}})}function qd(t,e){return new ee({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${De(r)}`}})}function ci(){return Xe("never",()=>!1)}function Jd(t){return new ee({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Gd(){return Xe("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${De(t)}`)}function $r(t){const e=t?Object.keys(t):[],r=ci();return new ee({type:"object",schema:t||null,*entries(n){if(t&&at(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return at(n)||`Expected an object, but received: ${De(n)}`},coercer(n){return at(n)?{...n}:n}})}function Za(t){return new ee({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Zd(t,e){return new ee({type:"record",schema:null,*entries(r){if(at(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return at(r)||`Expected an object, but received: ${De(r)}`}})}function Qd(){return Xe("regexp",t=>t instanceof RegExp)}function Kd(t){return new ee({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${De(e)}`}})}function Qa(){return Xe("string",t=>typeof t=="string"||`Expected a string, but received: ${De(t)}`)}function Xd(t){const e=ci();return new ee({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new ee({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...a]=oi(r,s,n),[u]=a;if(u[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${De(r)}`,...i]}})}function Ka(){return Xe("unknown",()=>!0)}function li(t,e,r){return new ee({...t,coercer:(n,i)=>ai(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function eh(t,e,r={}){return li(t,Ka(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&yo(n)&&yo(i)){const s={...n};let a=!1;for(const u in i)s[u]===void 0&&(s[u]=i[u],a=!0);if(a)return s}return n})}function th(t){return li(t,Qa(),e=>e.trim())}function rh(t){return Ut(t,"empty",e=>{const r=Xa(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function Xa(t){return t instanceof Map||t instanceof Set?t.size:t.length}function nh(t,e,r={}){const{exclusive:n}=r;return Ut(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function ih(t){return Ut(t,"nonempty",e=>Xa(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function oh(t,e){return Ut(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function ah(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Ut(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return e<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return e<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function Ut(t,e,r){return new ee({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),a=Hs(s,i,t,n);for(const u of a)yield{...u,refinement:e}}})}const ch=Object.freeze(Object.defineProperty({__proto__:null,Struct:ee,StructError:za,any:Od,array:$d,assert:qa,assign:Rd,bigint:Bd,boolean:Fd,coerce:li,create:Ja,date:jd,defaulted:eh,define:Xe,deprecated:Id,dynamic:Ad,empty:rh,enums:Dd,func:Hd,instance:Ud,integer:Vd,intersection:Wd,is:ai,lazy:Nd,literal:zd,map:qd,mask:Ga,max:nh,min:sh,never:ci,nonempty:ih,nullable:Jd,number:Gd,object:$r,omit:Ld,optional:Za,partial:Td,pattern:oh,pick:xd,record:Zd,refine:Ut,regexp:Qd,set:Kd,size:ah,string:Qa,struct:Pd,trimmed:th,tuple:Xd,type:Br,union:Yd,unknown:Ka,validate:fr},Symbol.toStringTag,{value:"Module"})),Vt=la(ch);Object.defineProperty(We,"__esModule",{value:!0});We.assertExhaustive=We.assertStruct=We.assert=We.AssertionError=void 0;const lh=Vt;function uh(t){return typeof t=="object"&&t!==null&&"message"in t}function dh(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function hh(t){const e=uh(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Ya(t,e){return dh(t)?new t({message:e}):t({message:e})}class ui extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}We.AssertionError=ui;function fh(t,e="Assertion failed.",r=ui){if(!t)throw e instanceof Error?e:Ya(r,e)}We.assert=fh;function gh(t,e,r="Assertion failed",n=ui){try{(0,lh.assert)(t,e)}catch(i){throw Ya(n,`${r}: ${hh(i)}.`)}}We.assertStruct=gh;function ph(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}We.assertExhaustive=ph;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.base64=void 0;const mh=Vt,vh=We,wh=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,vh.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let u;return i?u=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):u=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,mh.pattern)(t,u)};Fr.base64=wh;var z={},jr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Vt,r=We;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(d){return(0,e.is)(d,t.HexStruct)}t.isHexString=n;function i(d){return(0,e.is)(d,t.StrictHexStruct)}t.isStrictHexString=i;function s(d){(0,r.assert)(n(d),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function a(d){(0,r.assert)(i(d),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=a;function u(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}t.add0x=u;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}t.remove0x=h})(jr);Object.defineProperty(z,"__esModule",{value:!0});z.createDataView=z.concatBytes=z.valueToBytes=z.stringToBytes=z.numberToBytes=z.signedBigIntToBytes=z.bigIntToBytes=z.hexToBytes=z.bytesToString=z.bytesToNumber=z.bytesToSignedBigInt=z.bytesToBigInt=z.bytesToHex=z.assertIsBytes=z.isBytes=void 0;const tt=We,Us=jr,bo=48,_o=58,Eo=87;function yh(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const bh=yh();function di(t){return t instanceof Uint8Array}z.isBytes=di;function gr(t){(0,tt.assert)(di(t),"Value must be a Uint8Array.")}z.assertIsBytes=gr;function ec(t){if(gr(t),t.length===0)return"0x";const e=bh(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Bn(e)}z.bigIntToBytes=rc;function Mh(t,e){(0,tt.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function Ch(t,e){(0,tt.assert)(typeof t=="bigint","Value must be a bigint."),(0,tt.assert)(typeof e=="number","Byte length must be a number."),(0,tt.assert)(e>0,"Byte length must be greater than 0."),(0,tt.assert)(Mh(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}z.signedBigIntToBytes=Ch;function nc(t){(0,tt.assert)(typeof t=="number","Value must be a number."),(0,tt.assert)(t>=0,"Value must be a non-negative number."),(0,tt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Bn(e)}z.numberToBytes=nc;function sc(t){return(0,tt.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}z.stringToBytes=sc;function ic(t){if(typeof t=="bigint")return rc(t);if(typeof t=="number")return nc(t);if(typeof t=="string")return t.startsWith("0x")?Bn(t):sc(t);if(di(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}z.valueToBytes=ic;function kh(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Ze(this,ct,"f").get(e)}has(e){return Ze(this,ct,"f").has(e)}keys(){return Ze(this,ct,"f").keys()}values(){return Ze(this,ct,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}or.FrozenMap=hi;class fi{constructor(e){ft.set(this,void 0),cc(this,ft,new Set(e),"f"),Object.freeze(this)}get size(){return Ze(this,ft,"f").size}[(ft=new WeakMap,Symbol.iterator)](){return Ze(this,ft,"f")[Symbol.iterator]()}entries(){return Ze(this,ft,"f").entries()}forEach(e,r){return Ze(this,ft,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ze(this,ft,"f").has(e)}keys(){return Ze(this,ft,"f").keys()}values(){return Ze(this,ft,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}or.FrozenSet=fi;Object.freeze(hi);Object.freeze(hi.prototype);Object.freeze(fi);Object.freeze(fi.prototype);var lc={};Object.defineProperty(lc,"__esModule",{value:!0});var uc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const e=Vt,r=We,n=()=>(0,e.define)("finite number",N=>(0,e.is)(N,(0,e.number)())&&Number.isFinite(N));t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),n(),(0,e.string)(),(0,e.array)((0,e.lazy)(()=>t.UnsafeJsonStruct)),(0,e.record)((0,e.string)(),(0,e.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,e.define)("Json",(N,O)=>{function q(Fe,ze){const U=[...ze.validator(Fe,O)];return U.length>0?U:!0}try{const Fe=q(N,t.UnsafeJsonStruct);return Fe!==!0?Fe:q(JSON.parse(JSON.stringify(N)),t.UnsafeJsonStruct)}catch(Fe){return Fe instanceof RangeError?"Circular reference detected":!1}});function i(N){return(0,e.is)(N,t.JsonStruct)}t.isValidJson=i;function s(N){(0,r.assertStruct)(N,t.JsonStruct,"Invalid JSON value");const O=JSON.stringify(N);return new TextEncoder().encode(O).byteLength}t.getJsonSize=s,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function a(N){return(0,e.is)(N,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=a;function u(N,O){(0,r.assertStruct)(N,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",O)}t.assertIsJsonRpcNotification=u;function h(N){return(0,e.is)(N,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=h;function d(N,O){(0,r.assertStruct)(N,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",O)}t.assertIsJsonRpcRequest=d,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function g(N){return(0,e.is)(N,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=g;function y(N,O){(0,r.assertStruct)(N,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",O)}t.assertIsPendingJsonRpcResponse=y;function _(N){return(0,e.is)(N,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=_;function M(N,O){(0,r.assertStruct)(N,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",O)}t.assertIsJsonRpcResponse=M;function C(N){return(0,e.is)(N,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function R(N,O){(0,r.assertStruct)(N,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",O)}t.assertIsJsonRpcSuccess=R;function I(N){return(0,e.is)(N,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=I;function T(N,O){(0,r.assertStruct)(N,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",O)}t.assertIsJsonRpcFailure=T;function P(N){return(0,e.is)(N,t.JsonRpcErrorStruct)}t.isJsonRpcError=P;function k(N,O){(0,r.assertStruct)(N,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",O)}t.assertIsJsonRpcError=k;function H(N){const{permitEmptyString:O,permitFractions:q,permitNull:Fe}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},N);return Y=>!!(typeof Y=="number"&&(q||Number.isInteger(Y))||typeof Y=="string"&&(O||Y.length>0)||Fe&&Y===null)}t.getJsonRpcIdValidator=H})(uc);var dc={};Object.defineProperty(dc,"__esModule",{value:!0});var ar={},Vs={exports:{}},As,Mo;function Fh(){if(Mo)return As;Mo=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;As=function(g,y){y=y||{};var _=typeof g;if(_==="string"&&g.length>0)return a(g);if(_==="number"&&isFinite(g))return y.long?h(g):u(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function a(g){if(g=String(g),!(g.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(y){var _=parseFloat(y[1]),M=(y[2]||"ms").toLowerCase();switch(M){case"years":case"year":case"yrs":case"yr":case"y":return _*s;case"weeks":case"week":case"w":return _*i;case"days":case"day":case"d":return _*n;case"hours":case"hour":case"hrs":case"hr":case"h":return _*r;case"minutes":case"minute":case"mins":case"min":case"m":return _*e;case"seconds":case"second":case"secs":case"sec":case"s":return _*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}}}function u(g){var y=Math.abs(g);return y>=n?Math.round(g/n)+"d":y>=r?Math.round(g/r)+"h":y>=e?Math.round(g/e)+"m":y>=t?Math.round(g/t)+"s":g+"ms"}function h(g){var y=Math.abs(g);return y>=n?d(g,y,n,"day"):y>=r?d(g,y,r,"hour"):y>=e?d(g,y,e,"minute"):y>=t?d(g,y,t,"second"):g+" ms"}function d(g,y,_,M){var C=y>=_*1.5;return Math.round(g/_)+" "+M+(C?"s":"")}return As}function jh(t){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=i,r.enabled=a,r.humanize=Fh(),r.destroy=d,Object.keys(t).forEach(g=>{r[g]=t[g]}),r.names=[],r.skips=[],r.formatters={};function e(g){let y=0;for(let _=0;_{if(O==="%%")return"%";H++;const Fe=r.formatters[q];if(typeof Fe=="function"){const ze=I[H];O=Fe.call(T,ze),I.splice(H,1),H--}return O}),r.formatArgs.call(T,I),(T.log||r.log).apply(T,I)}return R.namespace=g,R.useColors=r.useColors(),R.color=r.selectColor(g),R.extend=n,R.destroy=r.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(M!==r.namespaces&&(M=r.namespaces,C=r.enabled(g)),C),set:I=>{_=I}}),typeof r.init=="function"&&r.init(R),R}function n(g,y){const _=r(this.namespace+(typeof y>"u"?":":y)+g);return _.log=this.log,_}function i(g){r.save(g),r.namespaces=g,r.names=[],r.skips=[];let y;const _=(typeof g=="string"?g:"").split(/[\s,]+/),M=_.length;for(y=0;y"-"+y)].join(",");return r.enable(""),g}function a(g){if(g[g.length-1]==="*")return!0;let y,_;for(y=0,_=r.skips.length;y<_;y++)if(r.skips[y].test(g))return!1;for(y=0,_=r.names.length;y<_;y++)if(r.names[y].test(g))return!0;return!1}function u(g){return g.toString().substring(2,g.toString().length-2).replace(/\.\*\?$/,"*")}function h(g){return g instanceof Error?g.stack||g.message:g}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Dh=jh;(function(t,e){var r={};e.formatArgs=i,e.save=s,e.load=a,e.useColors=n,e.storage=u(),e.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.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"];function n(){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 d;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&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const g="color: "+this.color;d.splice(1,0,g,"color: inherit");let y=0,_=0;d[0].replace(/%[a-zA-Z%]/g,M=>{M!=="%%"&&(y++,M==="%c"&&(_=y))}),d.splice(_,0,g)}e.log=console.debug||console.log||(()=>{});function s(d){try{d?e.storage.setItem("debug",d):e.storage.removeItem("debug")}catch{}}function a(){let d;try{d=e.storage.getItem("debug")}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=r.DEBUG),d}function u(){try{return localStorage}catch{}}t.exports=Dh(e);const{formatters:h}=t.exports;h.j=function(d){try{return JSON.stringify(d)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}})(Vs,Vs.exports);var Hh=Vs.exports,Uh=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.createModuleLogger=ar.createProjectLogger=void 0;const Vh=Uh(Hh),Wh=(0,Vh.default)("metamask");function zh(t){return Wh.extend(t)}ar.createProjectLogger=zh;function qh(t,e){return t.extend(e)}ar.createModuleLogger=qh;var hc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(d){return Array.isArray(d)&&d.length>0}t.isNonEmptyArray=e;function r(d){return d==null}t.isNullOrUndefined=r;function n(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}t.isObject=n;const i=(d,g)=>Object.hasOwnProperty.call(d,g);t.hasProperty=i,function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(d){if(typeof d!="object"||d===null)return!1;try{let g=d;for(;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(d)===g}catch{return!1}}t.isPlainObject=s;function a(d){return d.charCodeAt(0)<=127}t.isASCII=a;function u(d){var g;return d.split("").reduce((_,M)=>a(M)?_+1:_+2,0)+((g=d.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&g!==void 0?g:[]).length}t.calculateStringSize=u;function h(d){return d.toString().length}t.calculateNumberSize=h})(hc);var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.hexToBigInt=bt.hexToNumber=bt.bigIntToHex=bt.numberToHex=void 0;const er=We,Er=jr,Jh=t=>((0,er.assert)(typeof t=="number","Value must be a number."),(0,er.assert)(t>=0,"Value must be a non-negative number."),(0,er.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Er.add0x)(t.toString(16)));bt.numberToHex=Jh;const Gh=t=>((0,er.assert)(typeof t=="bigint","Value must be a bigint."),(0,er.assert)(t>=0,"Value must be a non-negative bigint."),(0,Er.add0x)(t.toString(16)));bt.bigIntToHex=Gh;const Zh=t=>{(0,Er.assertIsHexString)(t);const e=parseInt(t,16);return(0,er.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};bt.hexToNumber=Zh;const Qh=t=>((0,Er.assertIsHexString)(t),BigInt((0,Er.add0x)(t)));bt.hexToBigInt=Qh;var fc={};Object.defineProperty(fc,"__esModule",{value:!0});var gc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!e(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(gc);var pc={};Object.defineProperty(pc,"__esModule",{value:!0});var mc={},Ws={exports:{}};const Kh="2.0.0",vc=256,Xh=Number.MAX_SAFE_INTEGER||9007199254740991,Yh=16,ef=vc-6,tf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Dn={MAX_LENGTH:vc,MAX_SAFE_COMPONENT_LENGTH:Yh,MAX_SAFE_BUILD_LENGTH:ef,MAX_SAFE_INTEGER:Xh,RELEASE_TYPES:tf,SEMVER_SPEC_VERSION:Kh,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ns={};const rf=typeof process=="object"&&Ns&&Ns.NODE_DEBUG&&/\bsemver\b/i.test(Ns.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Hn=rf;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Dn,s=Hn;e=t.exports={};const a=e.re=[],u=e.safeRe=[],h=e.src=[],d=e.t={};let g=0;const y="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[y,n]],M=R=>{for(const[I,T]of _)R=R.split(`${I}*`).join(`${I}{0,${T}}`).split(`${I}+`).join(`${I}{1,${T}}`);return R},C=(R,I,T)=>{const P=M(I),k=g++;s(R,k,I),d[R]=k,h[k]=I,a[k]=new RegExp(I,T?"g":void 0),u[k]=new RegExp(P,T?"g":void 0)};C("NUMERICIDENTIFIER","0|[1-9]\\d*"),C("NUMERICIDENTIFIERLOOSE","\\d+"),C("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),C("MAINVERSION",`(${h[d.NUMERICIDENTIFIER]})\\.(${h[d.NUMERICIDENTIFIER]})\\.(${h[d.NUMERICIDENTIFIER]})`),C("MAINVERSIONLOOSE",`(${h[d.NUMERICIDENTIFIERLOOSE]})\\.(${h[d.NUMERICIDENTIFIERLOOSE]})\\.(${h[d.NUMERICIDENTIFIERLOOSE]})`),C("PRERELEASEIDENTIFIER",`(?:${h[d.NUMERICIDENTIFIER]}|${h[d.NONNUMERICIDENTIFIER]})`),C("PRERELEASEIDENTIFIERLOOSE",`(?:${h[d.NUMERICIDENTIFIERLOOSE]}|${h[d.NONNUMERICIDENTIFIER]})`),C("PRERELEASE",`(?:-(${h[d.PRERELEASEIDENTIFIER]}(?:\\.${h[d.PRERELEASEIDENTIFIER]})*))`),C("PRERELEASELOOSE",`(?:-?(${h[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[d.PRERELEASEIDENTIFIERLOOSE]})*))`),C("BUILDIDENTIFIER",`${y}+`),C("BUILD",`(?:\\+(${h[d.BUILDIDENTIFIER]}(?:\\.${h[d.BUILDIDENTIFIER]})*))`),C("FULLPLAIN",`v?${h[d.MAINVERSION]}${h[d.PRERELEASE]}?${h[d.BUILD]}?`),C("FULL",`^${h[d.FULLPLAIN]}$`),C("LOOSEPLAIN",`[v=\\s]*${h[d.MAINVERSIONLOOSE]}${h[d.PRERELEASELOOSE]}?${h[d.BUILD]}?`),C("LOOSE",`^${h[d.LOOSEPLAIN]}$`),C("GTLT","((?:<|>)?=?)"),C("XRANGEIDENTIFIERLOOSE",`${h[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),C("XRANGEIDENTIFIER",`${h[d.NUMERICIDENTIFIER]}|x|X|\\*`),C("XRANGEPLAIN",`[v=\\s]*(${h[d.XRANGEIDENTIFIER]})(?:\\.(${h[d.XRANGEIDENTIFIER]})(?:\\.(${h[d.XRANGEIDENTIFIER]})(?:${h[d.PRERELEASE]})?${h[d.BUILD]}?)?)?`),C("XRANGEPLAINLOOSE",`[v=\\s]*(${h[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[d.XRANGEIDENTIFIERLOOSE]})(?:${h[d.PRERELEASELOOSE]})?${h[d.BUILD]}?)?)?`),C("XRANGE",`^${h[d.GTLT]}\\s*${h[d.XRANGEPLAIN]}$`),C("XRANGELOOSE",`^${h[d.GTLT]}\\s*${h[d.XRANGEPLAINLOOSE]}$`),C("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),C("COERCE",`${h[d.COERCEPLAIN]}(?:$|[^\\d])`),C("COERCEFULL",h[d.COERCEPLAIN]+`(?:${h[d.PRERELEASE]})?(?:${h[d.BUILD]})?(?:$|[^\\d])`),C("COERCERTL",h[d.COERCE],!0),C("COERCERTLFULL",h[d.COERCEFULL],!0),C("LONETILDE","(?:~>?)"),C("TILDETRIM",`(\\s*)${h[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",C("TILDE",`^${h[d.LONETILDE]}${h[d.XRANGEPLAIN]}$`),C("TILDELOOSE",`^${h[d.LONETILDE]}${h[d.XRANGEPLAINLOOSE]}$`),C("LONECARET","(?:\\^)"),C("CARETTRIM",`(\\s*)${h[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",C("CARET",`^${h[d.LONECARET]}${h[d.XRANGEPLAIN]}$`),C("CARETLOOSE",`^${h[d.LONECARET]}${h[d.XRANGEPLAINLOOSE]}$`),C("COMPARATORLOOSE",`^${h[d.GTLT]}\\s*(${h[d.LOOSEPLAIN]})$|^$`),C("COMPARATOR",`^${h[d.GTLT]}\\s*(${h[d.FULLPLAIN]})$|^$`),C("COMPARATORTRIM",`(\\s*)${h[d.GTLT]}\\s*(${h[d.LOOSEPLAIN]}|${h[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",C("HYPHENRANGE",`^\\s*(${h[d.XRANGEPLAIN]})\\s+-\\s+(${h[d.XRANGEPLAIN]})\\s*$`),C("HYPHENRANGELOOSE",`^\\s*(${h[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[d.XRANGEPLAINLOOSE]})\\s*$`),C("STAR","(<|>)?=?\\s*\\*"),C("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),C("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ws,Ws.exports);var Dr=Ws.exports;const nf=Object.freeze({loose:!0}),sf=Object.freeze({}),of=t=>t?typeof t!="object"?nf:t:sf;var gi=of;const Co=/^[0-9]+$/,wc=(t,e)=>{const r=Co.test(t),n=Co.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:twc(e,t);var yc={compareIdentifiers:wc,rcompareIdentifiers:af};const Kr=Hn,{MAX_LENGTH:ko,MAX_SAFE_INTEGER:Xr}=Dn,{safeRe:Ro,t:Io}=Dr,cf=gi,{compareIdentifiers:Gt}=yc;let lf=class gt{constructor(e,r){if(r=cf(r),e instanceof gt){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ko)throw new TypeError(`version is longer than ${ko} characters`);Kr("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?Ro[Io.LOOSE]:Ro[Io.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Xr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Xr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Xr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Gt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Qe=lf;const Ao=Qe,uf=(t,e,r=!1)=>{if(t instanceof Ao)return t;try{return new Ao(t,e)}catch(n){if(!r)return null;throw n}};var pr=uf;const df=pr,hf=(t,e)=>{const r=df(t,e);return r?r.version:null};var ff=hf;const gf=pr,pf=(t,e)=>{const r=gf(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var mf=pf;const No=Qe,vf=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new No(t instanceof No?t.version:t,r).inc(e,n,i).version}catch{return null}};var wf=vf;const Lo=pr,yf=(t,e)=>{const r=Lo(t,null,!0),n=Lo(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,u=s?n:r,h=!!a.prerelease.length;if(!!u.prerelease.length&&!h)return!u.patch&&!u.minor?"major":a.patch?"patch":a.minor?"minor":"major";const g=h?"pre":"";return r.major!==n.major?g+"major":r.minor!==n.minor?g+"minor":r.patch!==n.patch?g+"patch":"prerelease"};var bf=yf;const _f=Qe,Ef=(t,e)=>new _f(t,e).major;var Sf=Ef;const Mf=Qe,Cf=(t,e)=>new Mf(t,e).minor;var kf=Cf;const Rf=Qe,If=(t,e)=>new Rf(t,e).patch;var Af=If;const Nf=pr,Lf=(t,e)=>{const r=Nf(t,e);return r&&r.prerelease.length?r.prerelease:null};var Tf=Lf;const To=Qe,xf=(t,e,r)=>new To(t,r).compare(new To(e,r));var ut=xf;const Pf=ut,Of=(t,e,r)=>Pf(e,t,r);var $f=Of;const Bf=ut,Ff=(t,e)=>Bf(t,e,!0);var jf=Ff;const xo=Qe,Df=(t,e,r)=>{const n=new xo(t,r),i=new xo(e,r);return n.compare(i)||n.compareBuild(i)};var pi=Df;const Hf=pi,Uf=(t,e)=>t.sort((r,n)=>Hf(r,n,e));var Vf=Uf;const Wf=pi,zf=(t,e)=>t.sort((r,n)=>Wf(n,r,e));var qf=zf;const Jf=ut,Gf=(t,e,r)=>Jf(t,e,r)>0;var Un=Gf;const Zf=ut,Qf=(t,e,r)=>Zf(t,e,r)<0;var mi=Qf;const Kf=ut,Xf=(t,e,r)=>Kf(t,e,r)===0;var bc=Xf;const Yf=ut,e0=(t,e,r)=>Yf(t,e,r)!==0;var _c=e0;const t0=ut,r0=(t,e,r)=>t0(t,e,r)>=0;var vi=r0;const n0=ut,s0=(t,e,r)=>n0(t,e,r)<=0;var wi=s0;const i0=bc,o0=_c,a0=Un,c0=vi,l0=mi,u0=wi,d0=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return i0(t,r,n);case"!=":return o0(t,r,n);case">":return a0(t,r,n);case">=":return c0(t,r,n);case"<":return l0(t,r,n);case"<=":return u0(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Ec=d0;const h0=Qe,f0=pr,{safeRe:Yr,t:en}=Dr,g0=(t,e)=>{if(t instanceof h0)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Yr[en.COERCEFULL]:Yr[en.COERCE]);else{const h=e.includePrerelease?Yr[en.COERCERTLFULL]:Yr[en.COERCERTL];let d;for(;(d=h.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),h.lastIndex=d.index+d[1].length+d[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",u=e.includePrerelease&&r[6]?`+${r[6]}`:"";return f0(`${n}.${i}.${s}${a}${u}`,e)};var p0=g0;class m0{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}}var v0=m0,Ls,Po;function dt(){if(Po)return Ls;Po=1;const t=/\s+/g;class e{constructor(l,f){if(f=i(f),l instanceof e)return l.loose===!!f.loose&&l.includePrerelease===!!f.includePrerelease?l:new e(l.raw,f);if(l instanceof s)return this.raw=l.value,this.set=[[l]],this.formatted=void 0,this;if(this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease,this.raw=l.trim().replace(t," "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(v=>!R(v[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&I(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let l=0;l0&&(this.formatted+="||");const f=this.set[l];for(let p=0;p0&&(this.formatted+=" "),this.formatted+=f[p].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(l){const p=((this.options.includePrerelease&&M)|(this.options.loose&&C))+":"+l,v=n.get(p);if(v)return v;const b=this.options.loose,S=b?h[d.HYPHENRANGELOOSE]:h[d.HYPHENRANGE];l=l.replace(S,J(this.options.includePrerelease)),a("hyphen replace",l),l=l.replace(h[d.COMPARATORTRIM],g),a("comparator trim",l),l=l.replace(h[d.TILDETRIM],y),a("tilde trim",l),l=l.replace(h[d.CARETTRIM],_),a("caret trim",l);let m=l.split(" ").map(A=>P(A,this.options)).join(" ").split(/\s+/).map(A=>U(A,this.options));b&&(m=m.filter(A=>(a("loose invalid filter",A,this.options),!!A.match(h[d.COMPARATORLOOSE])))),a("range list",m);const c=new Map,w=m.map(A=>new s(A,this.options));for(const A of w){if(R(A))return[A];c.set(A.value,A)}c.size>1&&c.has("")&&c.delete("");const x=[...c.values()];return n.set(p,x),x}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Range is required");return this.set.some(p=>T(p,f)&&l.set.some(v=>T(v,f)&&p.every(b=>v.every(S=>b.intersects(S,f)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new u(l,this.options)}catch{return!1}for(let f=0;fo.value==="<0.0.0-0",I=o=>o.value==="",T=(o,l)=>{let f=!0;const p=o.slice();let v=p.pop();for(;f&&p.length;)f=p.every(b=>v.intersects(b,l)),v=p.pop();return f},P=(o,l)=>(a("comp",o,l),o=O(o,l),a("caret",o),o=H(o,l),a("tildes",o),o=Fe(o,l),a("xrange",o),o=Y(o,l),a("stars",o),o),k=o=>!o||o.toLowerCase()==="x"||o==="*",H=(o,l)=>o.trim().split(/\s+/).map(f=>N(f,l)).join(" "),N=(o,l)=>{const f=l.loose?h[d.TILDELOOSE]:h[d.TILDE];return o.replace(f,(p,v,b,S,m)=>{a("tilde",o,p,v,b,S,m);let c;return k(v)?c="":k(b)?c=`>=${v}.0.0 <${+v+1}.0.0-0`:k(S)?c=`>=${v}.${b}.0 <${v}.${+b+1}.0-0`:m?(a("replaceTilde pr",m),c=`>=${v}.${b}.${S}-${m} <${v}.${+b+1}.0-0`):c=`>=${v}.${b}.${S} <${v}.${+b+1}.0-0`,a("tilde return",c),c})},O=(o,l)=>o.trim().split(/\s+/).map(f=>q(f,l)).join(" "),q=(o,l)=>{a("caret",o,l);const f=l.loose?h[d.CARETLOOSE]:h[d.CARET],p=l.includePrerelease?"-0":"";return o.replace(f,(v,b,S,m,c)=>{a("caret",o,v,b,S,m,c);let w;return k(b)?w="":k(S)?w=`>=${b}.0.0${p} <${+b+1}.0.0-0`:k(m)?b==="0"?w=`>=${b}.${S}.0${p} <${b}.${+S+1}.0-0`:w=`>=${b}.${S}.0${p} <${+b+1}.0.0-0`:c?(a("replaceCaret pr",c),b==="0"?S==="0"?w=`>=${b}.${S}.${m}-${c} <${b}.${S}.${+m+1}-0`:w=`>=${b}.${S}.${m}-${c} <${b}.${+S+1}.0-0`:w=`>=${b}.${S}.${m}-${c} <${+b+1}.0.0-0`):(a("no pr"),b==="0"?S==="0"?w=`>=${b}.${S}.${m}${p} <${b}.${S}.${+m+1}-0`:w=`>=${b}.${S}.${m}${p} <${b}.${+S+1}.0-0`:w=`>=${b}.${S}.${m} <${+b+1}.0.0-0`),a("caret return",w),w})},Fe=(o,l)=>(a("replaceXRanges",o,l),o.split(/\s+/).map(f=>ze(f,l)).join(" ")),ze=(o,l)=>{o=o.trim();const f=l.loose?h[d.XRANGELOOSE]:h[d.XRANGE];return o.replace(f,(p,v,b,S,m,c)=>{a("xRange",o,p,v,b,S,m,c);const w=k(b),x=w||k(S),A=x||k(m),B=A;return v==="="&&B&&(v=""),c=l.includePrerelease?"-0":"",w?v===">"||v==="<"?p="<0.0.0-0":p="*":v&&B?(x&&(S=0),m=0,v===">"?(v=">=",x?(b=+b+1,S=0,m=0):(S=+S+1,m=0)):v==="<="&&(v="<",x?b=+b+1:S=+S+1),v==="<"&&(c="-0"),p=`${v+b}.${S}.${m}${c}`):x?p=`>=${b}.0.0${c} <${+b+1}.0.0-0`:A&&(p=`>=${b}.${S}.0${c} <${b}.${+S+1}.0-0`),a("xRange return",p),p})},Y=(o,l)=>(a("replaceStars",o,l),o.trim().replace(h[d.STAR],"")),U=(o,l)=>(a("replaceGTE0",o,l),o.trim().replace(h[l.includePrerelease?d.GTE0PRE:d.GTE0],"")),J=o=>(l,f,p,v,b,S,m,c,w,x,A,B)=>(k(p)?f="":k(v)?f=`>=${p}.0.0${o?"-0":""}`:k(b)?f=`>=${p}.${v}.0${o?"-0":""}`:S?f=`>=${f}`:f=`>=${f}${o?"-0":""}`,k(w)?c="":k(x)?c=`<${+w+1}.0.0-0`:k(A)?c=`<${w}.${+x+1}.0-0`:B?c=`<=${w}.${x}.${A}-${B}`:o?c=`<${w}.${x}.${+A+1}-0`:c=`<=${c}`,`${f} ${c}`.trim()),E=(o,l,f)=>{for(let p=0;p0){const v=o[p].semver;if(v.major===l.major&&v.minor===l.minor&&v.patch===l.patch)return!0}return!1}return!0};return Ls}var Ts,Oo;function Vn(){if(Oo)return Ts;Oo=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(g,y){if(y=r(y),g instanceof e){if(g.loose===!!y.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),a("comparator",g,y),this.options=y,this.loose=!!y.loose,this.parse(g),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(g){const y=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=g.match(y);if(!_)throw new TypeError(`Invalid comparator: ${g}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new u(_[2],this.options.loose):this.semver=t}toString(){return this.value}test(g){if(a("Comparator.test",g,this.options.loose),this.semver===t||g===t)return!0;if(typeof g=="string")try{g=new u(g,this.options)}catch{return!1}return s(g,this.operator,this.semver,this.options)}intersects(g,y){if(!(g instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(g.value,y).test(this.value):g.operator===""?g.value===""?!0:new h(this.value,y).test(g.semver):(y=r(y),y.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&g.operator.startsWith(">")||this.operator.startsWith("<")&&g.operator.startsWith("<")||this.semver.version===g.semver.version&&this.operator.includes("=")&&g.operator.includes("=")||s(this.semver,"<",g.semver,y)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||s(this.semver,">",g.semver,y)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}Ts=e;const r=gi,{safeRe:n,t:i}=Dr,s=Ec,a=Hn,u=Qe,h=dt();return Ts}const w0=dt(),y0=(t,e,r)=>{try{e=new w0(e,r)}catch{return!1}return e.test(t)};var Wn=y0;const b0=dt(),_0=(t,e)=>new b0(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var E0=_0;const S0=Qe,M0=dt(),C0=(t,e,r)=>{let n=null,i=null,s=null;try{s=new M0(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new S0(n,r))}),n};var k0=C0;const R0=Qe,I0=dt(),A0=(t,e,r)=>{let n=null,i=null,s=null;try{s=new I0(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new R0(n,r))}),n};var N0=A0;const xs=Qe,L0=dt(),$o=Un,T0=(t,e)=>{t=new L0(t,e);let r=new xs("0.0.0");if(t.test(r)||(r=new xs("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const u=new xs(a.semver.version);switch(a.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!s||$o(u,s))&&(s=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||$o(r,s))&&(r=s)}return r&&t.test(r)?r:null};var x0=T0;const P0=dt(),O0=(t,e)=>{try{return new P0(t,e).range||"*"}catch{return null}};var $0=O0;const B0=Qe,Sc=Vn(),{ANY:F0}=Sc,j0=dt(),D0=Wn,Bo=Un,Fo=mi,H0=wi,U0=vi,V0=(t,e,r,n)=>{t=new B0(t,n),e=new j0(e,n);let i,s,a,u,h;switch(r){case">":i=Bo,s=H0,a=Fo,u=">",h=">=";break;case"<":i=Fo,s=U0,a=Bo,u="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(D0(t,e,n))return!1;for(let d=0;d{M.semver===F0&&(M=new Sc(">=0.0.0")),y=y||M,_=_||M,i(M.semver,y.semver,n)?y=M:a(M.semver,_.semver,n)&&(_=M)}),y.operator===u||y.operator===h||(!_.operator||_.operator===u)&&s(t,_.semver))return!1;if(_.operator===h&&a(t,_.semver))return!1}return!0};var yi=V0;const W0=yi,z0=(t,e,r)=>W0(t,e,">",r);var q0=z0;const J0=yi,G0=(t,e,r)=>J0(t,e,"<",r);var Z0=G0;const jo=dt(),Q0=(t,e,r)=>(t=new jo(t,r),e=new jo(e,r),t.intersects(e,r));var K0=Q0;const X0=Wn,Y0=ut;var e1=(t,e,r)=>{const n=[];let i=null,s=null;const a=t.sort((g,y)=>Y0(g,y,r));for(const g of a)X0(g,e,r)?(s=g,i||(i=g)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const u=[];for(const[g,y]of n)g===y?u.push(g):!y&&g===a[0]?u.push("*"):y?g===a[0]?u.push(`<=${y}`):u.push(`${g} - ${y}`):u.push(`>=${g}`);const h=u.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return h.length{if(t===e)return!0;t=new Do(t,r),e=new Do(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const a=n1(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},r1=[new bi(">=0.0.0-0")],Ho=[new bi(">=0.0.0")],n1=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ps){if(e.length===1&&e[0].semver===Ps)return!0;r.includePrerelease?t=r1:t=Ho}if(e.length===1&&e[0].semver===Ps){if(r.includePrerelease)return!0;e=Ho}const n=new Set;let i,s;for(const M of t)M.operator===">"||M.operator===">="?i=Uo(i,M,r):M.operator==="<"||M.operator==="<="?s=Vo(s,M,r):n.add(M.semver);if(n.size>1)return null;let a;if(i&&s){if(a=_i(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const M of n){if(i&&!vr(M,String(i),r)||s&&!vr(M,String(s),r))return null;for(const C of e)if(!vr(M,String(C),r))return!1;return!0}let u,h,d,g,y=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&s.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const M of e){if(g=g||M.operator===">"||M.operator===">=",d=d||M.operator==="<"||M.operator==="<=",i){if(_&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===_.major&&M.semver.minor===_.minor&&M.semver.patch===_.patch&&(_=!1),M.operator===">"||M.operator===">="){if(u=Uo(i,M,r),u===M&&u!==i)return!1}else if(i.operator===">="&&!vr(i.semver,String(M),r))return!1}if(s){if(y&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===y.major&&M.semver.minor===y.minor&&M.semver.patch===y.patch&&(y=!1),M.operator==="<"||M.operator==="<="){if(h=Vo(s,M,r),h===M&&h!==s)return!1}else if(s.operator==="<="&&!vr(s.semver,String(M),r))return!1}if(!M.operator&&(s||i)&&a!==0)return!1}return!(i&&d&&!s&&a!==0||s&&g&&!i&&a!==0||_||y)},Uo=(t,e,r)=>{if(!t)return e;const n=_i(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Vo=(t,e,r)=>{if(!t)return e;const n=_i(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var s1=t1;const Os=Dr,Wo=Dn,i1=Qe,zo=yc,o1=pr,a1=ff,c1=mf,l1=wf,u1=bf,d1=Sf,h1=kf,f1=Af,g1=Tf,p1=ut,m1=$f,v1=jf,w1=pi,y1=Vf,b1=qf,_1=Un,E1=mi,S1=bc,M1=_c,C1=vi,k1=wi,R1=Ec,I1=p0,A1=Vn(),N1=dt(),L1=Wn,T1=E0,x1=k0,P1=N0,O1=x0,$1=$0,B1=yi,F1=q0,j1=Z0,D1=K0,H1=e1,U1=s1;var V1={parse:o1,valid:a1,clean:c1,inc:l1,diff:u1,major:d1,minor:h1,patch:f1,prerelease:g1,compare:p1,rcompare:m1,compareLoose:v1,compareBuild:w1,sort:y1,rsort:b1,gt:_1,lt:E1,eq:S1,neq:M1,gte:C1,lte:k1,cmp:R1,coerce:I1,Comparator:A1,Range:N1,satisfies:L1,toComparators:T1,maxSatisfying:x1,minSatisfying:P1,minVersion:O1,validRange:$1,outside:B1,gtr:F1,ltr:j1,intersects:D1,simplifyRange:H1,subset:U1,SemVer:i1,re:Os.re,src:Os.src,tokens:Os.t,SEMVER_SPEC_VERSION:Wo.SEMVER_SPEC_VERSION,RELEASE_TYPES:Wo.RELEASE_TYPES,compareIdentifiers:zo.compareIdentifiers,rcompareIdentifiers:zo.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=V1,r=Vt,n=We;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",y=>(0,e.valid)(y)===null?`Expected SemVer version, got "${y}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",y=>(0,e.validRange)(y)===null?`Expected SemVer range, got "${y}"`:!0);function i(y){return(0,r.is)(y,t.VersionStruct)}t.isValidSemVerVersion=i;function s(y){return(0,r.is)(y,t.VersionRangeStruct)}t.isValidSemVerRange=s;function a(y){(0,n.assertStruct)(y,t.VersionStruct)}t.assertIsSemVerVersion=a;function u(y){(0,n.assertStruct)(y,t.VersionRangeStruct)}t.assertIsSemVerRange=u;function h(y,_){return(0,e.gt)(y,_)}t.gtVersion=h;function d(y,_){return(0,e.gtr)(y,_)}t.gtRange=d;function g(y,_){return(0,e.satisfies)(y,_,{includePrerelease:!0})}t.satisfiesVersionRange=g})(mc);(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,u)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(We,t),r(Fr,t),r(z,t),r(Fn,t),r(yt,t),r(or,t),r(lc,t),r(jr,t),r(uc,t),r(dc,t),r(ar,t),r(hc,t),r(bt,t),r(fc,t),r(gc,t),r(pc,t),r(mc,t)})(Wa);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Wa;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Va);var Mc=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});$n.PollingBlockTracker=void 0;const W1=Mc(ii),z1=Mc(pd),q1=Pr,qo=Va,Jo=(0,qo.createModuleLogger)(qo.projectLogger,"polling-block-tracker"),J1=(0,W1.default)(),G1=1e3;class Z1 extends q1.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*G1,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Go(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: -${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Go(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:J1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Jo("Making request",e);const r=await(0,z1.default)(n=>this._provider.sendAsync(e,n))();if(Jo("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: -${r.error.message}`);return r.result}}$n.PollingBlockTracker=Z1;function Go(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var zn={},Q1=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zn,"__esModule",{value:!0});zn.SubscribeBlockTracker=void 0;const K1=Q1(ii),X1=Pr,Y1=(0,K1.default)();class eg extends X1.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:Y1(),method:e,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}zn.SubscribeBlockTracker=eg;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r($n,t),r(zn,t)})(Ua);var Ei={},qn={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.getUniqueId=void 0;const Cc=4294967295;let $s=Math.floor(Math.random()*Cc);function tg(){return $s=($s+1)%Cc,$s}Hr.getUniqueId=tg;Object.defineProperty(qn,"__esModule",{value:!0});qn.createIdRemapMiddleware=void 0;const rg=Hr;function ng(){return(t,e,r,n)=>{const i=t.id,s=rg.getUniqueId();t.id=s,e.id=s,r(a=>{t.id=i,e.id=i,a()})}}qn.createIdRemapMiddleware=ng;var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.createAsyncMiddleware=void 0;function sg(t){return async(e,r,n,i)=>{let s;const a=new Promise(g=>{s=g});let u=null,h=!1;const d=async()=>{h=!0,n(g=>{u=g,s()}),await a};try{await t(e,r,d),h?(await a,u(null)):i(null)}catch(g){u?u(g):i(g)}}}Jn.createAsyncMiddleware=sg;var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createScaffoldMiddleware=void 0;function ig(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}Gn.createScaffoldMiddleware=ig;var Ur={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});const og=ca;function Zo(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function ag(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const u=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw u.context=a,u}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")Zo(s,this,r);else{const a=s.length,u=ag(s);for(let h=0;h"u"&&(n=Ic()),zs(t,"",0,[],void 0,0,n);var i;try{Bt.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Nc(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Dt.length!==0;){var s=Dt.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function tr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),Dt.push([n,r,e,i])):Bt.push([e,r,t]):(n[r]=t,Dt.push([n,r,e]))}function zs(t,e,r,n,i,s,a){s+=1;var u;if(typeof t=="object"&&t!==null){for(u=0;ua.depthLimit){tr(on,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){tr(on,t,e,i);return}if(n.push(t),Array.isArray(t))for(u=0;ue?1:0}function Ac(t,e,r,n){typeof n>"u"&&(n=Ic());var i=qs(t,"",0,[],void 0,0,n)||t,s;try{Bt.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Nc(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Dt.length!==0;){var a=Dt.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function qs(t,e,r,n,i,s,a){s+=1;var u;if(typeof t=="object"&&t!==null){for(u=0;ua.depthLimit){tr(on,t,e,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){tr(on,t,e,i);return}if(n.push(t),Array.isArray(t))for(u=0;u0)for(var n=0;n=1e3&&t<=4999}function gg(t,e){if(e!=="[Circular]")return e}var Mi={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.errorCodes=void 0;At.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=At,r=It,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(_,M=i){if(Number.isInteger(_)){const C=_.toString();if(y(e.errorValues,C))return e.errorValues[C].message;if(d(_))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=a;function u(_){if(!Number.isInteger(_))return!1;const M=_.toString();return!!(e.errorValues[M]||d(_))}t.isValidCode=u;function h(_,{fallbackError:M=s,shouldIncludeStack:C=!1}={}){var R,I;if(!M||!Number.isInteger(M.code)||typeof M.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(_ instanceof r.EthereumRpcError)return _.serialize();const T={};if(_&&typeof _=="object"&&!Array.isArray(_)&&y(_,"code")&&u(_.code)){const k=_;T.code=k.code,k.message&&typeof k.message=="string"?(T.message=k.message,y(k,"data")&&(T.data=k.data)):(T.message=a(T.code),T.data={originalError:g(_)})}else{T.code=M.code;const k=(R=_)===null||R===void 0?void 0:R.message;T.message=k&&typeof k=="string"?k:M.message,T.data={originalError:g(_)}}const P=(I=_)===null||I===void 0?void 0:I.stack;return C&&_&&P&&typeof P=="string"&&(T.stack=P),T}t.serializeError=h;function d(_){return _>=-32099&&_<=-32e3}function g(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function y(_,M){return Object.prototype.hasOwnProperty.call(_,M)}})(Mi);var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ethErrors=void 0;const Ci=It,Tc=Mi,Je=At;Zn.ethErrors={rpc:{parse:t=>nt(Je.errorCodes.rpc.parse,t),invalidRequest:t=>nt(Je.errorCodes.rpc.invalidRequest,t),invalidParams:t=>nt(Je.errorCodes.rpc.invalidParams,t),methodNotFound:t=>nt(Je.errorCodes.rpc.methodNotFound,t),internal:t=>nt(Je.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return nt(e,t)},invalidInput:t=>nt(Je.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>nt(Je.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>nt(Je.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>nt(Je.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>nt(Je.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>nt(Je.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>wr(Je.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>wr(Je.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>wr(Je.errorCodes.provider.unsupportedMethod,t),disconnected:t=>wr(Je.errorCodes.provider.disconnected,t),chainDisconnected:t=>wr(Je.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Ci.EthereumProviderError(e,r,n)}}};function nt(t,e){const[r,n]=xc(e);return new Ci.EthereumRpcError(t,r||Tc.getMessageFromCode(t),n)}function wr(t,e){const[r,n]=xc(e);return new Ci.EthereumProviderError(t,r||Tc.getMessageFromCode(t),n)}function xc(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=It;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=Mi;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Zn;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=At;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(kc);var pg=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.JsonRpcEngine=void 0;const mg=pg(Si),st=kc;class _t extends mg.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,a,u]=await _t._runAllMiddleware(e,r,this._middleware);return a?(await _t._runReturnHandlers(u),i(s)):n(async h=>{try{await _t._runReturnHandlers(u)}catch(d){return h(d)}return h()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const a=new st.EthereumRpcError(st.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof e.method!="string"){const a=new st.EthereumRpcError(st.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(a,{id:e.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=st.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await _t._runAllMiddleware(e,r,this._middleware);if(_t._checkForCompletion(e,r,i),await _t._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,a=!1;for(const u of n)if([s,a]=await _t._runMiddleware(e,r,u,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const a=h=>{const d=h||r.error;d&&(r.error=st.serializeError(d)),s([d,!0])},u=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request: -${Bs(e)}`,{request:e})),i.push(h)),s([null,!1]))};try{n(e,r,u,a)}catch(h){a(h)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: -${Bs(e)}`,{request:e});if(!n)throw new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: -${Bs(e)}`,{request:e})}}Ur.JsonRpcEngine=_t;function Bs(t){return JSON.stringify(t,null,2)}var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.mergeMiddleware=void 0;const vg=Ur;function wg(t){const e=new vg.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}Qn.mergeMiddleware=wg;(function(t){var e=$&&$.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$&&$.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(qn,t),r(Jn,t),r(Gn,t),r(Hr,t),r(Ur,t),r(Qn,t)})(Ei);var Pc={},ki={},Js=function(t,e){return Js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Js(t,e)};function Oc(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Js(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var an=function(){return an=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;u--)(a=t[u])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Fc(t,e){return function(r,n){e(r,n,t)}}function yg(t,e,r,n,i,s){function a(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var u=n.kind,h=u==="getter"?"get":u==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,g=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),y,_=!1,M=r.length-1;M>=0;M--){var C={};for(var R in n)C[R]=R==="access"?{}:n[R];for(var R in n.access)C.access[R]=n.access[R];C.addInitializer=function(T){if(_)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(T||null))};var I=(0,r[M])(u==="accessor"?{get:g.get,set:g.set}:g[h],C);if(u==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(y=a(I.get))&&(g.get=y),(y=a(I.set))&&(g.set=y),(y=a(I.init))&&i.unshift(y)}else(y=a(I))&&(u==="field"?i.unshift(y):g[h]=y)}d&&Object.defineProperty(d,n.name,g),_=!0}function bg(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ri(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function Vc(){for(var t=[],e=0;e1||h(M,R)})},C&&(i[M]=C(i[M])))}function h(M,C){try{d(n[M](C))}catch(R){_(s[0][3],R)}}function d(M){M.value instanceof cr?Promise.resolve(M.value.v).then(g,y):_(s[0][2],M)}function g(M){h("next",M)}function y(M){h("throw",M)}function _(M,C){M(C),s.shift(),s.length&&h(s[0][0],s[0][1])}}function Jc(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(a){return(r=!r)?{value:cr(t[i](a)),done:!1}:s?s(a):a}:s}}function Gc(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof cn=="function"?cn(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(u,h){a=t[s](a),i(u,h,a.done,a.value)})}}function i(s,a,u,h){Promise.resolve(h).then(function(d){s({value:d,done:u})},a)}}function Zc(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Sg=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function Qc(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Kn(e,t,r);return Sg(e,t),e}function Kc(t){return t&&t.__esModule?t:{default:t}}function Xc(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Yc(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function el(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function tl(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Mg=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function rl(t){function e(s){t.error=t.hasError?new Mg(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(a){return e(a),i()})}else n|=1}catch(a){e(a)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}const Cg={__extends:Oc,__assign:an,__rest:$c,__decorate:Bc,__param:Fc,__metadata:jc,__awaiter:Dc,__generator:Hc,__createBinding:Kn,__exportStar:Uc,__values:cn,__read:Ri,__spread:Vc,__spreadArrays:Wc,__spreadArray:zc,__await:cr,__asyncGenerator:qc,__asyncDelegator:Jc,__asyncValues:Gc,__makeTemplateObject:Zc,__importStar:Qc,__importDefault:Kc,__classPrivateFieldGet:Xc,__classPrivateFieldSet:Yc,__classPrivateFieldIn:el,__addDisposableResource:tl,__disposeResources:rl},kg=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:tl,get __assign(){return an},__asyncDelegator:Jc,__asyncGenerator:qc,__asyncValues:Gc,__await:cr,__awaiter:Dc,__classPrivateFieldGet:Xc,__classPrivateFieldIn:el,__classPrivateFieldSet:Yc,__createBinding:Kn,__decorate:Bc,__disposeResources:rl,__esDecorate:yg,__exportStar:Uc,__extends:Oc,__generator:Hc,__importDefault:Kc,__importStar:Qc,__makeTemplateObject:Zc,__metadata:jc,__param:Fc,__propKey:_g,__read:Ri,__rest:$c,__runInitializers:bg,__setFunctionName:Eg,__spread:Vc,__spreadArray:zc,__spreadArrays:Wc,__values:cn,default:Cg},Symbol.toStringTag,{value:"Module"})),Ii=la(kg);var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});var Qo=Ii,Rg=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Qo.__awaiter(this,void 0,void 0,function(){var r,n,i;return Qo.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();Xn.default=Rg;Object.defineProperty(ki,"__esModule",{value:!0});var Ko=Ii,Ig=Xn,Ag=function(){function t(){this._semaphore=new Ig.default(1)}return t.prototype.acquire=function(){return Ko.__awaiter(this,void 0,void 0,function(){var e,r;return Ko.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();ki.default=Ag;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.withTimeout=void 0;var tn=Ii;function Ng(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return tn.__awaiter(n,void 0,void 0,function(){var a,u,h;return tn.__generator(this,function(d){switch(d.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},e),[4,t.acquire()];case 1:return u=d.sent(),a?(h=Array.isArray(u)?u[1]:u,h()):i(u),[2]}})})})},runExclusive:function(i){return tn.__awaiter(this,void 0,void 0,function(){var s,a;return tn.__generator(this,function(u){switch(u.label){case 0:s=function(){},u.label=1;case 1:return u.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=u.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,u.sent()];case 4:return s=a,[4,i()];case 5:return[2,u.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Yn.withTimeout=Ng;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=ki;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Xn;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Yn;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Pc);var Lg=xg,Tg=Object.prototype.hasOwnProperty;function xg(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((a,u)=>{e.multiArgs?i.push((...d)=>{e.errorFirst?d[0]?u(d):(d.shift(),a(d)):a(d)}):e.errorFirst?i.push((d,g)=>{d?u(d):a(g)}):i.push(a),Reflect.apply(t,this===r?n:this,i)})},Yo=new WeakMap;var Fg=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(a,u)=>{let h=Yo.get(a);if(h||(h={},Yo.set(a,h)),u in h)return h[u];const d=C=>typeof C=="string"||typeof u=="symbol"?u===C:C.test(u),g=Reflect.getOwnPropertyDescriptor(a,u),y=g===void 0||g.writable||g.configurable,M=(e.include?e.include.some(d):!e.exclude.some(d))&&y;return h[u]=M,M},i=new WeakMap,s=new Proxy(t,{apply(a,u,h){const d=i.get(a);if(d)return Reflect.apply(d,u,h);const g=e.excludeMain?a:Xo(a,e,s,a);return i.set(a,g),Reflect.apply(g,u,h)},get(a,u){const h=a[u];if(!n(a,u)||h===Function.prototype[u])return h;const d=i.get(h);if(d)return d;if(typeof h=="function"){const g=Xo(h,e,s,a);return i.set(h,g),g}return h}});return s};const jg=Or.default;let Dg=class extends jg{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Ai=Dg;const Hg=Ai;let Ug=class extends Hg{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var Vg=Ug,Wr={minBlockRef:Wg,maxBlockRef:zg,sortBlockRefs:Ni,bnToHex:qg,blockRefIsNumber:Jg,hexToInt:ln,incrementHexInt:Gg,intToHex:nl,unsafeRandomBytes:Zg};function Wg(...t){return Ni(t)[0]}function zg(...t){const e=Ni(t);return e[e.length-1]}function Ni(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:ln(e)-ln(r))}function qg(t){return"0x"+t.toString(16)}function Jg(t){return t&&!["earliest","latest","pending"].includes(t)}function ln(t){return t==null?t:Number.parseInt(t,16)}function Gg(t){if(t==null)return t;const e=ln(t);return nl(e+1)}function nl(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Zg(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=ep(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=Yg(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),u=(await this._fetchLogs(s)).filter(h=>this.matchLog(h));this.addResults(u)}async _fetchLogs(e){return await Kg(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(rn(this.params.fromBlock)>=rn(e.blockNumber)||tp(this.params.toBlock)&&rn(this.params.toBlock)<=rn(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=e.topics[s];if(!a)return!1;a=a.toLowerCase();let u=Array.isArray(i)?i:[i];return u.includes(null)?!0:(u=u.map(g=>g.toLowerCase()),u.includes(a))})}};var np=rp,Li=sp;async function sp({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=ta(e),s=ta(r)-n+1,a=Array(s).fill().map((h,d)=>n+d).map(ip);let u=await Promise.all(a.map(h=>ap(t,"eth_getBlockByNumber",[h,!1])));return u=u.filter(h=>h!==null),u}function ta(t){return t==null?t:Number.parseInt(t,16)}function ip(t){return t==null?t:"0x"+t.toString(16)}function op(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function ap(t,e,r){for(let n=0;n<3;n++)try{return await op(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const cp=Ai,lp=Li,{incrementHexInt:up}=Wr;let dp=class extends cp{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=up(e),a=(await lp({provider:this.provider,fromBlock:i,toBlock:n})).map(u=>u.hash);this.addResults(a)}};var hp=dp;const fp=Ai,gp=Li,{incrementHexInt:pp}=Wr;let mp=class extends fp{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=pp(e),i=await gp({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var vp=mp;const wp=Pc.Mutex,{createAsyncMiddleware:yp,createScaffoldMiddleware:bp}=Ei,_p=np,Ep=hp,Sp=vp,{intToHex:sl,hexToInt:Fs}=Wr;var Mp=Cp;function Cp({blockTracker:t,provider:e}){let r=0,n={};const i=new wp,s=kp({mutex:i}),a=bp({eth_newFilter:s(js(h)),eth_newBlockFilter:s(js(d)),eth_newPendingTransactionFilter:s(js(g)),eth_uninstallFilter:s(sn(M)),eth_getFilterChanges:s(sn(y)),eth_getFilterLogs:s(sn(_))}),u=async({oldBlock:P,newBlock:k})=>{if(n.length===0)return;const H=await i.acquire();try{await Promise.all(Zt(n).map(async N=>{try{await N.update({oldBlock:P,newBlock:k})}catch(O){console.error(O)}}))}catch(N){console.error(N)}H()};return a.newLogFilter=h,a.newBlockFilter=d,a.newPendingTransactionFilter=g,a.uninstallFilter=M,a.getFilterChanges=y,a.getFilterLogs=_,a.destroy=()=>{I()},a;async function h(P){const k=new _p({provider:e,params:P});return await C(k),k}async function d(){const P=new Ep({provider:e});return await C(P),P}async function g(){const P=new Sp({provider:e});return await C(P),P}async function y(P){const k=Fs(P),H=n[k];if(!H)throw new Error(`No filter for index "${k}"`);return H.getChangesAndClear()}async function _(P){const k=Fs(P),H=n[k];if(!H)throw new Error(`No filter for index "${k}"`);let N=[];return H.type==="log"&&(N=H.getAllResults()),N}async function M(P){const k=Fs(P),N=!!n[k];return N&&await R(k),N}async function C(P){const k=Zt(n).length,H=await t.getLatestBlock();await P.initialize({currentBlock:H}),r++,n[r]=P,P.id=r,P.idHex=sl(r);const N=Zt(n).length;return T({prevFilterCount:k,newFilterCount:N}),r}async function R(P){const k=Zt(n).length;delete n[P];const H=Zt(n).length;T({prevFilterCount:k,newFilterCount:H})}async function I(){const P=Zt(n).length;n={},T({prevFilterCount:P,newFilterCount:0})}function T({prevFilterCount:P,newFilterCount:k}){if(P===0&&k>0){t.on("sync",u);return}if(P>0&&k===0){t.removeListener("sync",u);return}}}function js(t){return sn(async(...e)=>{const r=await t(...e);return sl(r.id)})}function sn(t){return yp(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function kp({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Zt(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const Rp=Or.default,{createAsyncMiddleware:ra,createScaffoldMiddleware:Ip}=Ei,Ap=Mp,{unsafeRandomBytes:Np,incrementHexInt:Lp}=Wr,Tp=Li;var xp=Pp;function Pp({blockTracker:t,provider:e}){const r={},n=Ap({blockTracker:t,provider:e});let i=!1;const s=new Rp,a=Ip({eth_subscribe:ra(u),eth_unsubscribe:ra(h)});return a.destroy=g,{events:s,middleware:a};async function u(y,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const M=y.params[0],C=Np(16);let R;switch(M){case"newHeads":R=I({subId:C});break;case"logs":const P=y.params[1],k=await n.newLogFilter(P);R=T({subId:C,filter:k});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${M}"`)}r[C]=R,_.result=C;return;function I({subId:P}){const k={type:M,destroy:async()=>{t.removeListener("sync",k.update)},update:async({oldBlock:H,newBlock:N})=>{const O=N,q=Lp(H);(await Tp({provider:e,fromBlock:q,toBlock:O})).map(Op).filter(Y=>Y!==null).forEach(Y=>{d(P,Y)})}};return t.on("sync",k.update),k}function T({subId:P,filter:k}){return k.on("update",N=>d(P,N)),{type:M,destroy:async()=>await n.uninstallFilter(k.idHex)}}}async function h(y,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const M=y.params[0],C=r[M];if(!C){_.result=!1;return}delete r[M],await C.destroy(),_.result=!0}function d(y,_){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:y,result:_}})}function g(){s.removeAllListeners();for(const y in r)r[y].destroy(),delete r[y];i=!0}}function Op(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(On,"__esModule",{value:!0});On.SubscriptionManager=void 0;const $p=Ua,Bp=xp,na=()=>{};class Fp{constructor(e){const r=new $p.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Bp({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,na,na),r}destroy(){this.subscriptionMiddleware.destroy()}}On.SubscriptionManager=Fp;var il=$&&$.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.CoinbaseWalletProvider=void 0;const jp=il(fn),Dp=dl,V=Cr,j=L,Hp=Ar,sa=it,nn=hr,Ye=lr,Ds=il(ud),yr=dr,Up=ir,Vp=On,ia="DefaultChainId",oa="DefaultJsonRpcUrl";class Wp extends Dp.EventEmitter{constructor(e){var r,n;super(),this._filterPolyfill=new Up.FilterPolyfill(this),this._subscriptionManager=new Vp.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,j.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(sa.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const u=a.split(" ");u[0]!==""&&(this._addresses=u.map(h=>(0,j.ensureAddressString)(h)),this.emit("accountsChanged",u))}this._subscriptionManager.events.on("notification",u=>{this.emit("message",{type:u.method,data:u.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",u=>{var h;if(!(u.origin!==location.origin||u.source!==window)&&u.data.type==="walletLinkMessage"&&u.data.data.action==="dappChainSwitched"){const d=u.data.data.chainId,g=(h=u.data.data.jsonRpcUrl)!==null&&h!==void 0?h:this.jsonRpcUrl;this.updateProviderInfo(g,Number(d))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,j.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(oa))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(oa,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(ia,r.toString(10)),((0,j.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,a){const h=await(await this.initializeRelay()).watchAsset(e,r,n,i,s,a==null?void 0:a.toString()).promise;return(0,Ye.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(e,r,n,i,s,a){var u,h;if((0,j.ensureIntNumber)(e)===this.getChainId())return!1;const d=await this.initializeRelay(),g=d.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!g&&await d.requestEthereumAccounts().promise;const y=await d.addEthereumChain(e.toString(),r,s,n,i,a).promise;return(0,Ye.isErrorResponse)(y)?!1:(((u=y.result)===null||u===void 0?void 0:u.isApproved)===!0&&this.updateProviderInfo(r[0],e),((h=y.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Ye.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===V.standardErrorCodes.provider.unsupportedChain?V.standardErrors.provider.unsupportedChain():V.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(yr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?nn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,V.serializeError)(i,e)})}catch(n){throw(0,V.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(u=>u.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,V.serializeError)(n,e)})}catch(n){return Promise.reject((0,V.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,V.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,V.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw V.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw V.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw V.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){const n=await(await this.initializeRelay()).scanQRCode((0,j.ensureRegExpString)(e)).promise;if((0,Ye.isErrorResponse)(n))throw(0,V.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,V.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(e,r){const i=await(await this.initializeRelay()).genericRequest(e,r).promise;if((0,Ye.isErrorResponse)(i))throw(0,V.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,V.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(e){var r;(r=this.diagnostic)===null||r===void 0||r.log(yr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?nn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof Hp.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(e).promise,(0,Ye.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(e){const n=await(await this.initializeRelay()).selectProvider(e).promise;if((0,Ye.isErrorResponse)(n))throw(0,V.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,V.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,j.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(sa.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(u=>r(Object.assign(Object.assign({},u),{id:e.id}))).catch(u=>n(u));return}const a=this._handleSubscriptionMethods(e);if(a!==void 0){a.then(u=>r({jsonrpc:"2.0",id:e.id,result:u.result})).catch(u=>n(u));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===V.standardErrorCodes.rpc.methodNotFound||s.code===V.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(yr.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?nn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,j.ensureAddressString)(e);return this._addresses.map(i=>(0,j.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(yr.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,j.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,j.ensureAddressString)(e.to):null,i=e.value!=null?(0,j.ensureBN)(e.value):new jp.default(0),s=e.data?(0,j.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,j.ensureIntNumber)(e.nonce):null,u=e.gasPrice!=null?(0,j.ensureBN)(e.gasPrice):null,h=e.maxFeePerGas!=null?(0,j.ensureBN)(e.maxFeePerGas):null,d=e.maxPriorityFeePerGas!=null?(0,j.ensureBN)(e.maxPriorityFeePerGas):null,g=e.gas!=null?(0,j.ensureBN)(e.gas):null,y=e.chainId?(0,j.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:u,maxFeePerGas:h,maxPriorityFeePerGas:d,gasLimit:g,chainId:y}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw V.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw V.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;if((0,Ye.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;if((0,Ye.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,j.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(ia);if(!e)return(0,j.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,j.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(yr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?nn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,Ye.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,j.ensureAddressString)(e[0]),n=(0,j.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,j.ensureBuffer)(e[0]),n=(0,j.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,j.ensureBuffer)(e[0]),n=(0,j.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,j.ensureBuffer)(e[0]),n=(0,j.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,Ye.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,j.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,Ye.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,Ye.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?V.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,j.ensureParsedJSONObject)(e[0]),n=(0,j.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=Ds.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,j.ensureAddressString)(e[0]),n=(0,j.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ds.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,j.ensureAddressString)(e[0]),n=(0,j.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ds.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const a=e[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw V.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw V.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const u=parseInt(a.chainId,16);return await this.addEthereumChain(u,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw V.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw V.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw V.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw V.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:u}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,u,a,n)}}_eth_uninstallFilter(e){const r=(0,j.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,j.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,j.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}rr.CoinbaseWalletProvider=Wp;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.RelayEventManager=void 0;const zp=L;class qp{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,zp.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}es.RelayEventManager=qp;Object.defineProperty(_r,"__esModule",{value:!0});_r.CoinbaseWalletSDK=void 0;const Jp=dn,Gp=hn,aa=L,Zp=wn,Qp=rr,Kp=Ar,Xp=xr,Yp=es,em=Lr,tm=Nr,ol=ur;class ts{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||Gp.LINK_API_URL;typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),u=`${a.protocol}//${a.host}`;if(this._storage=new Zp.ScopedLocalStorage(`-walletlink:${u}`),this._storage.setItem("version",ts.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new Yp.RelayEventManager;const h=(0,aa.isMobileWeb)(),d=e.uiConstructor||(y=>h?new Xp.MobileRelayUI(y):new em.WalletLinkRelayUI(y)),g={linkAPIUrl:s,version:ol.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:d,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=h?new Kp.MobileRelay(g):new tm.WalletLinkRelay(g),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI()}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new Qp.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,aa.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,Jp.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}_r.CoinbaseWalletSDK=ts;ts.VERSION=ol.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=_r,r=rr;var n=_r;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=rr;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(ua);const rm=cl(ua),pm=Object.freeze(Object.defineProperty({__proto__:null,default:rm},Symbol.toStringTag,{value:"Module"}));export{pm as i}; diff --git a/dist/assets/index-CrW_pNDQ.js b/dist/assets/index-CrW_pNDQ.js deleted file mode 100644 index 8f547622..00000000 --- a/dist/assets/index-CrW_pNDQ.js +++ /dev/null @@ -1,41 +0,0 @@ -import{f as a}from"./index-DY4jrsxT.js";import{g as e,T as n,U as L,z as o,af as W,B as l,D as r,au as M,az as Z,aA as V,F as d,n as H,H as p,G as c,I as m,ax as k,ay as _,J as h,K as g,L as I,N as B,P as v,Q as T,X as w,aK as b,aL as f,o as S,Z as x,aG as A,_ as N,q as D,aD as E,$ as G,a0 as P,a1 as U,a2 as z,ap as F,aF as j,aH as q,aq as y,aC as J,a3 as K,ar as O,aI as Q,aB as X,a6 as $,as as R,t as Y,u as a1,v as i1,a8 as s1,a7 as C1,a9 as u1,aa as t1,ao as e1,ab as n1,aE as L1,av as o1,aw as W1,at as l1,ac as r1,ad as M1,aJ as Z1,aM as V1,w as d1,ae as H1,ag as p1,ai as c1,x as m1,ah as k1,ak as _1,aj as h1,a4 as g1,a5 as I1,al as B1,y as v1,am as T1,an as w1,c as b1,j as f1,l as S1,m as x1}from"./index-DY4jrsxT.js";const s=a` - - - - - -`,C=a` - - - - - -`;export{e as MathUtil,n as TransactionUtil,L as UiHelperUtil,o as WuiAccountButton,W as WuiAlertBar,l as WuiAllWalletsImage,r as WuiAvatar,M as WuiBalance,Z as WuiBanner,V as WuiBannerImg,d as WuiButton,H as WuiCard,p as WuiCardSelect,c as WuiCardSelectLoader,m as WuiChip,k as WuiChipButton,_ as WuiCompatibleNetwork,h as WuiConnectButton,g as WuiCtaButton,I as WuiDetailsGroup,B as WuiDetailsGroupItem,v as WuiDropdownMenu,T as WuiEmailInput,w as WuiEnsInput,b as WuiFlex,f as WuiGrid,S as WuiIcon,x as WuiIconBox,A as WuiIconButton,N as WuiIconLink,D as WuiImage,E as WuiInputAmount,G as WuiInputElement,P as WuiInputNumeric,U as WuiInputText,z as WuiLink,F as WuiListAccordion,j as WuiListAccount,q as WuiListButton,y as WuiListContent,J as WuiListDescription,K as WuiListItem,O as WuiListNetwork,Q as WuiListSocial,X as WuiListToken,$ as WuiListWallet,R as WuiListWalletTransaction,Y as WuiLoadingHexagon,a1 as WuiLoadingSpinner,i1 as WuiLoadingThumbnail,s1 as WuiLogo,C1 as WuiLogoSelect,u1 as WuiNetworkButton,t1 as WuiNetworkImage,e1 as WuiNoticeCard,n1 as WuiOtp,L1 as WuiPreviewItem,o1 as WuiProfileButton,W1 as WuiProfileButtonV2,l1 as WuiPromo,r1 as WuiQrCode,M1 as WuiSearchBar,Z1 as WuiSelect,V1 as WuiSeparator,d1 as WuiShimmer,H1 as WuiSnackbar,p1 as WuiTabs,c1 as WuiTag,m1 as WuiText,k1 as WuiTokenButton,_1 as WuiTokenListItem,h1 as WuiTooltip,g1 as WuiTransactionListItem,I1 as WuiTransactionListItemLoader,B1 as WuiTransactionVisual,v1 as WuiVisual,T1 as WuiVisualThumbnail,w1 as WuiWalletImage,b1 as customElement,f1 as initializeTheming,S1 as setColorTheme,x1 as setThemeVariables,s as swapInputMaskBottomSvg,C as swapInputMaskTopSvg}; diff --git a/dist/assets/index-DKSdwK6L.js b/dist/assets/index-DKSdwK6L.js deleted file mode 100644 index d6a07c24..00000000 --- a/dist/assets/index-DKSdwK6L.js +++ /dev/null @@ -1 +0,0 @@ -import{aS as M,aT as rr}from"./index-DY4jrsxT.js";import{j as nr,s as sr,r as vt,a as _t,b as ir,c as ar}from"./hooks.module-BBeYFAft.js";var Et={},te={},me={};Object.defineProperty(me,"__esModule",{value:!0});me.walletLogo=void 0;const or=(r,e)=>{let t;switch(r){case"standard":return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return t=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};me.walletLogo=or;var be={},j={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.errorValues=U.standardErrorCodes=void 0;U.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};U.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var ye={},$e={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serialize=r.getErrorCode=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=U,t="Unspecified error message.";r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(d,p=t){if(d&&Number.isInteger(d)){const m=d.toString();if(h(e.errorValues,m))return e.errorValues[m].message;if(c(d))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return p}r.getMessageFromCode=n;function s(d){if(!Number.isInteger(d))return!1;const p=d.toString();return!!(e.errorValues[p]||c(d))}r.isValidCode=s;function i(d){var p;if(typeof d=="number")return d;if(a(d))return(p=d.code)!==null&&p!==void 0?p:d.errorCode}r.getErrorCode=i;function a(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}function o(d,{shouldIncludeStack:p=!1}={}){const m={};if(d&&typeof d=="object"&&!Array.isArray(d)&&h(d,"code")&&s(d.code)){const B=d;m.code=B.code,B.message&&typeof B.message=="string"?(m.message=B.message,h(B,"data")&&(m.data=B.data)):(m.message=n(m.code),m.data={originalError:l(d)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(d,"message")?d.message:t,m.data={originalError:l(d)};return p&&(m.stack=f(d,"stack")?d.stack:void 0),m}r.serialize=o;function c(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function h(d,p){return Object.prototype.hasOwnProperty.call(d,p)}function f(d,p){return typeof d=="object"&&d!==null&&p in d&&typeof d[p]=="string"}})($e);Object.defineProperty(ye,"__esModule",{value:!0});ye.standardErrors=void 0;const v=U,St=$e;ye.standardErrors={rpc:{parse:r=>C(v.standardErrorCodes.rpc.parse,r),invalidRequest:r=>C(v.standardErrorCodes.rpc.invalidRequest,r),invalidParams:r=>C(v.standardErrorCodes.rpc.invalidParams,r),methodNotFound:r=>C(v.standardErrorCodes.rpc.methodNotFound,r),internal:r=>C(v.standardErrorCodes.rpc.internal,r),server:r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=r;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return C(e,r)},invalidInput:r=>C(v.standardErrorCodes.rpc.invalidInput,r),resourceNotFound:r=>C(v.standardErrorCodes.rpc.resourceNotFound,r),resourceUnavailable:r=>C(v.standardErrorCodes.rpc.resourceUnavailable,r),transactionRejected:r=>C(v.standardErrorCodes.rpc.transactionRejected,r),methodNotSupported:r=>C(v.standardErrorCodes.rpc.methodNotSupported,r),limitExceeded:r=>C(v.standardErrorCodes.rpc.limitExceeded,r)},provider:{userRejectedRequest:r=>$(v.standardErrorCodes.provider.userRejectedRequest,r),unauthorized:r=>$(v.standardErrorCodes.provider.unauthorized,r),unsupportedMethod:r=>$(v.standardErrorCodes.provider.unsupportedMethod,r),disconnected:r=>$(v.standardErrorCodes.provider.disconnected,r),chainDisconnected:r=>$(v.standardErrorCodes.provider.chainDisconnected,r),unsupportedChain:r=>$(v.standardErrorCodes.provider.unsupportedChain,r),custom:r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:t,data:n}=r;if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string');return new It(e,t,n)}}};function C(r,e){const[t,n]=Ct(e);return new kt(r,t||(0,St.getMessageFromCode)(r),n)}function $(r,e){const[t,n]=Ct(e);return new It(r,t||(0,St.getMessageFromCode)(r),n)}function Ct(r){if(r){if(typeof r=="string")return[r];if(typeof r=="object"&&!Array.isArray(r)){const{message:e,data:t}=r;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,t]}}return[]}class kt extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string.');super(t),this.code=e,n!==void 0&&(this.data=n)}}class It extends kt{constructor(e,t,n){if(!cr(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function cr(r){return Number.isInteger(r)&&r>=1e3&&r<=4999}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.standardErrors=r.standardErrorCodes=void 0;var e=U;Object.defineProperty(r,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var t=ye;Object.defineProperty(r,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}})})(j);var we={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.isErrorResponse=void 0;function dr(r){return r.errorMessage!==void 0}Q.isErrorResponse=dr;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.LIB_VERSION=void 0;K.LIB_VERSION="4.0.4";Object.defineProperty(we,"__esModule",{value:!0});we.serializeError=void 0;const lr=Q,ur=K,hr=U,gr=$e;function pr(r,e){const t=(0,gr.serialize)(fr(r),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",ur.LIB_VERSION),n.searchParams.set("code",t.code.toString());const s=mr(t.data,e);return s&&n.searchParams.set("method",s),n.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:n.href})}we.serializeError=pr;function fr(r){return typeof r=="string"?{message:r,code:hr.standardErrorCodes.rpc.internal}:(0,lr.isErrorResponse)(r)?Object.assign(Object.assign({},r),{message:r.errorMessage,code:r.errorCode,data:{method:r.method}}):r}function mr(r,e){const t=r==null?void 0:r.method;if(t)return t;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var _={};Object.defineProperty(_,"__esModule",{value:!0});_.RegExpString=_.IntNumber=_.BigIntString=_.AddressString=_.HexString=_.OpaqueType=void 0;function re(){return r=>r}_.OpaqueType=re;_.HexString=re();_.AddressString=re();_.BigIntString=re();function br(r){return Math.floor(r)}_.IntNumber=br;_.RegExpString=re();var u={};Object.defineProperty(u,"__esModule",{value:!0});u.areAddressArraysEqual=u.getFavicon=u.range=u.isBigNumber=u.ensureParsedJSONObject=u.ensureBigInt=u.ensureRegExpString=u.ensureIntNumber=u.ensureBuffer=u.ensureAddressString=u.ensureEvenLengthHexString=u.ensureHexString=u.isHexString=u.prepend0x=u.strip0x=u.has0xPrefix=u.hexStringFromIntNumber=u.intNumberFromHexString=u.bigIntStringFromBigInt=u.hexStringFromBuffer=u.hexStringToUint8Array=u.uint8ArrayToHex=u.randomBytesHex=void 0;const q=j,I=_,Mt=/^[0-9]*$/,Lt=/^[a-f0-9]*$/;function yr(r){return At(crypto.getRandomValues(new Uint8Array(r)))}u.randomBytesHex=yr;function At(r){return[...r].map(e=>e.toString(16).padStart(2,"0")).join("")}u.uint8ArrayToHex=At;function wr(r){return new Uint8Array(r.match(/.{1,2}/g).map(e=>parseInt(e,16)))}u.hexStringToUint8Array=wr;function vr(r,e=!1){const t=r.toString("hex");return(0,I.HexString)(e?`0x${t}`:t)}u.hexStringFromBuffer=vr;function _r(r){return(0,I.BigIntString)(r.toString(10))}u.bigIntStringFromBigInt=_r;function Er(r){return(0,I.IntNumber)(Number(BigInt(se(r,!0))))}u.intNumberFromHexString=Er;function Sr(r){return(0,I.HexString)(`0x${BigInt(r).toString(16)}`)}u.hexStringFromIntNumber=Sr;function Fe(r){return r.startsWith("0x")||r.startsWith("0X")}u.has0xPrefix=Fe;function ve(r){return Fe(r)?r.slice(2):r}u.strip0x=ve;function Rt(r){return Fe(r)?`0x${r.slice(2)}`:`0x${r}`}u.prepend0x=Rt;function ne(r){if(typeof r!="string")return!1;const e=ve(r).toLowerCase();return Lt.test(e)}u.isHexString=ne;function xt(r,e=!1){if(typeof r=="string"){const t=ve(r).toLowerCase();if(Lt.test(t))return(0,I.HexString)(e?`0x${t}`:t)}throw q.standardErrors.rpc.invalidParams(`"${String(r)}" is not a hexadecimal string`)}u.ensureHexString=xt;function se(r,e=!1){let t=xt(r,!1);return t.length%2===1&&(t=(0,I.HexString)(`0${t}`)),e?(0,I.HexString)(`0x${t}`):t}u.ensureEvenLengthHexString=se;function Cr(r){if(typeof r=="string"){const e=ve(r).toLowerCase();if(ne(e)&&e.length===40)return(0,I.AddressString)(Rt(e))}throw q.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(r)}`)}u.ensureAddressString=Cr;function kr(r){if(Buffer.isBuffer(r))return r;if(typeof r=="string"){if(ne(r)){const e=se(r,!1);return Buffer.from(e,"hex")}return Buffer.from(r,"utf8")}throw q.standardErrors.rpc.invalidParams(`Not binary data: ${String(r)}`)}u.ensureBuffer=kr;function Pt(r){if(typeof r=="number"&&Number.isInteger(r))return(0,I.IntNumber)(r);if(typeof r=="string"){if(Mt.test(r))return(0,I.IntNumber)(Number(r));if(ne(r))return(0,I.IntNumber)(Number(BigInt(se(r,!0))))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(r)}`)}u.ensureIntNumber=Pt;function Ir(r){if(r instanceof RegExp)return(0,I.RegExpString)(r.toString());throw q.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(r)}`)}u.ensureRegExpString=Ir;function Mr(r){if(r!==null&&(typeof r=="bigint"||Nt(r)))return BigInt(r.toString(10));if(typeof r=="number")return BigInt(Pt(r));if(typeof r=="string"){if(Mt.test(r))return BigInt(r);if(ne(r))return BigInt(se(r,!0))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(r)}`)}u.ensureBigInt=Mr;function Lr(r){if(typeof r=="string")return JSON.parse(r);if(typeof r=="object")return r;throw q.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(r)}`)}u.ensureParsedJSONObject=Lr;function Nt(r){if(r==null||typeof r.constructor!="function")return!1;const{constructor:e}=r;return typeof e.config=="function"&&typeof e.EUCLID=="number"}u.isBigNumber=Nt;function Ar(r,e){return Array.from({length:e-r},(t,n)=>r+n)}u.range=Ar;function Rr(){const r=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:t}=document.location,n=r?r.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${t}${n}`}u.getFavicon=Rr;function xr(r,e){return r.length===e.length&&r.every((t,n)=>t===e[n])}u.areAddressArraysEqual=xr;var P={},_e={},Ee={},y={};Object.defineProperty(y,"__esModule",{value:!0});y.decryptContent=y.encryptContent=y.importKeyFromHexString=y.exportKeyToHexString=y.decrypt=y.encrypt=y.deriveSharedSecret=y.generateKeyPair=void 0;const Tt=u;async function Pr(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}y.generateKeyPair=Pr;async function Nr(r,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}y.deriveSharedSecret=Nr;async function jt(r,e){const t=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},r,new TextEncoder().encode(e));return{iv:t,cipherText:n}}y.encrypt=jt;async function Ot(r,{iv:e,cipherText:t}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},r,t);return new TextDecoder().decode(n)}y.decrypt=Ot;function Dt(r){switch(r){case"public":return"spki";case"private":return"pkcs8"}}async function Tr(r,e){const t=Dt(r),n=await crypto.subtle.exportKey(t,e);return(0,Tt.uint8ArrayToHex)(new Uint8Array(n))}y.exportKeyToHexString=Tr;async function jr(r,e){const t=Dt(r),n=(0,Tt.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(t,n,{name:"ECDH",namedCurve:"P-256"},!0,r==="private"?["deriveKey"]:[])}y.importKeyFromHexString=jr;async function Or(r,e){const t=JSON.stringify(r,(n,s)=>{if(!(s instanceof Error))return s;const i=s;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return jt(e,t)}y.encryptContent=Or;async function Dr(r,e){return JSON.parse(await Ot(e,r))}y.decryptContent=Dr;var O={};Object.defineProperty(O,"__esModule",{value:!0});O.ScopedLocalStorage=void 0;class fe{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new fe("CBWSDK").clear(),new fe("walletlink").clear()}}O.ScopedLocalStorage=fe;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.SCWKeyManager=void 0;const oe=y,Wr=O,De={storageKey:"ownPrivateKey",keyType:"private"},We={storageKey:"ownPublicKey",keyType:"public"},Ue={storageKey:"peerPublicKey",keyType:"public"};class Ur{constructor(){this.storage=new Wr.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(Ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(We.storageKey),this.storage.removeItem(De.storageKey),this.storage.removeItem(Ue.storageKey)}async generateKeyPair(){const e=await(0,oe.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(De,e.privateKey),await this.storeKey(We,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(De)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(We)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(Ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,oe.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?(0,oe.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){const n=await(0,oe.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,n)}}Ee.SCWKeyManager=Ur;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.SCWStateManager=void 0;const Br=O,Qe="accounts",Xe="activeChain",et="availableChains",tt="walletCapabilities";class Hr{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,n;this.storage=new Br.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(et),this._walletCapabilities=this.loadItemFromStorage(tt);const s=this.loadItemFromStorage(Qe),i=this.loadItemFromStorage(Xe);s&&this.updateListener.onAccountsUpdate({accounts:s,source:"storage"}),i&&this.updateListener.onChainUpdate({chain:i,source:"storage"}),this._accounts=s||[],this._activeChain=i||{id:(n=(t=e.appChainIds)===null||t===void 0?void 0:t[0])!==null&&n!==void 0?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(Qe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;const n=(t=this.availableChains)===null||t===void 0?void 0:t.find(s=>s.id===e);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(Xe,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const t=Object.entries(e).map(([n,s])=>({id:Number(n),rpcUrl:s}));this.availableChains=t,this.storeItemToStorage(et,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(tt,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){const t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}}Se.SCWStateManager=Hr;Object.defineProperty(_e,"__esModule",{value:!0});_e.SCWSigner=void 0;const Kr=Ee,qr=Se,ce=j,rt=u,de=y;class $r{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new Kr.SCWKeyManager,this.stateManager=new qr.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;const n=await(0,de.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(n);const s=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},s);const i=s.result;if("error"in i)throw i.error;return this.stateManager.accounts}async request(e){const t=this.tryLocalHandling(e);if(t!==void 0){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(e),s=await this.decryptResponseMessage(n);this.updateInternalState(e,s);const i=s.result;if("error"in i)throw i.error;return i.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{const n=e.params;if(!n||!(!((t=n[0])===null||t===void 0)&&t.chainId))throw ce.standardErrors.rpc.invalidParams();const s=(0,rt.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(s)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw ce.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw ce.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,de.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),s=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(s)}async createRequestMessage(e){const t=await(0,de.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){const t=e.content;if("failure"in t)throw t.failure;const n=await this.keyManager.getSharedSecret();if(!n)throw ce.standardErrors.provider.unauthorized("Invalid session");return(0,de.decryptContent)(t.encrypted,n)}updateInternalState(e,t){var n,s;const i=(n=t.data)===null||n===void 0?void 0:n.chains;i&&this.stateManager.updateAvailableChains(i);const a=(s=t.data)===null||s===void 0?void 0:s.capabilities;a&&this.stateManager.updateWalletCapabilities(a);const o=t.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const c=o.value;this.stateManager.updateAccounts(c);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const c=e.params,l=(0,rt.ensureIntNumber)(c[0].chainId);this.stateManager.switchChain(l);break}}}}_e.SCWSigner=$r;var Ce={};const Fr=nr;function Wt(r){return Buffer.allocUnsafe(r).fill(0)}function Vr(r){return r.toString(2).length}function Ut(r,e){let t=r.toString(16);t.length%2!==0&&(t="0"+t);const n=t.match(/.{1,2}/g).map(s=>parseInt(s,16));for(;n.length"u")throw new Error("Not an array?");if(t=Ft(r),t!=="dynamic"&&t!==0&&e.length>t)throw new Error("Elements exceed array size: "+t);s=[],r=r.slice(0,r.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(i in e)s.push(R(r,e[i]));if(t==="dynamic"){var a=R("uint256",e.length);s.unshift(a)}return Buffer.concat(s)}else{if(r==="bytes")return e=new Buffer(e),s=Buffer.concat([R("uint256",e.length),e]),e.length%32!==0&&(s=Buffer.concat([s,E.zeros(32-e.length%32)])),s;if(r.startsWith("bytes")){if(t=G(r),t<1||t>32)throw new Error("Invalid bytes width: "+t);return E.setLengthRight(e,32)}else if(r.startsWith("uint")){if(t=G(r),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);n=H(e);const o=E.bitLengthFromBigInt(n);if(o>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+o);if(n<0)throw new Error("Supplied uint is negative");return E.bufferBEFromBigInt(n,32)}else if(r.startsWith("int")){if(t=G(r),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);n=H(e);const o=E.bitLengthFromBigInt(n);if(o>t)throw new Error("Supplied int exceeds width: "+t+" vs "+o);const c=E.twosFromBigInt(n,256);return E.bufferBEFromBigInt(c,32)}else if(r.startsWith("ufixed")){if(t=nt(r),n=H(e),n<0)throw new Error("Supplied ufixed is negative");return R("uint256",n*BigInt(2)**BigInt(t[1]))}else if(r.startsWith("fixed"))return t=nt(r),R("int256",H(e)*BigInt(2)**BigInt(t[1]))}throw new Error("Unsupported or invalid type: "+r)}function Qr(r){return r==="string"||r==="bytes"||Ft(r)==="dynamic"}function Xr(r){return r.lastIndexOf("]")===r.length-1}function en(r,e){var t=[],n=[],s=32*r.length;for(var i in r){var a=$t(r[i]),o=e[i],c=R(a,o);Qr(a)?(t.push(R("uint256",s)),n.push(c),s+=c.length):t.push(c)}return Buffer.concat(t.concat(n))}function Vt(r,e){if(r.length!==e.length)throw new Error("Number of types are not matching the values");for(var t,n,s=[],i=0;i32)throw new Error("Invalid bytes width: "+t);s.push(E.setLengthRight(o,t))}else if(a.startsWith("uint")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);n=H(o);const c=E.bitLengthFromBigInt(n);if(c>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+c);s.push(E.bufferBEFromBigInt(n,t/8))}else if(a.startsWith("int")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);n=H(o);const c=E.bitLengthFromBigInt(n);if(c>t)throw new Error("Supplied int exceeds width: "+t+" vs "+c);const l=E.twosFromBigInt(n,t);s.push(E.bufferBEFromBigInt(l,t/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(s)}function tn(r,e){return E.keccak(Vt(r,e))}var rn={rawEncode:en,solidityPack:Vt,soliditySHA3:tn};const A=qt,ee=rn,zt={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Be={encodeData(r,e,t,n=!0){const s=["bytes32"],i=[this.hashType(r,t)];if(n){const a=(o,c,l)=>{if(t[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(this.encodeData(c,l,t,n))];if(l===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",A.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",A.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),f=l.map(d=>a(o,h,d));return["bytes32",A.keccak(ee.rawEncode(f.map(([d])=>d),f.map(([,d])=>d)))]}return[c,l]};for(const o of t[r]){const[c,l]=a(o.name,o.type,e[o.name]);s.push(c),i.push(l)}}else for(const a of t[r]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")s.push("bytes32"),o=A.keccak(o),i.push(o);else if(a.type==="string")s.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=A.keccak(o),i.push(o);else if(t[a.type]!==void 0)s.push("bytes32"),o=A.keccak(this.encodeData(a.type,o,t,n)),i.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(o)}}return ee.rawEncode(s,i)},encodeType(r,e){let t="",n=this.findTypeDependencies(r,e).filter(s=>s!==r);n=[r].concat(n.sort());for(const s of n){if(!e[s])throw new Error("No type definition specified: "+s);t+=s+"("+e[s].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return t},findTypeDependencies(r,e,t=[]){if(r=r.match(/^\w*/)[0],t.includes(r)||e[r]===void 0)return t;t.push(r);for(const n of e[r])for(const s of this.findTypeDependencies(n.type,e,t))!t.includes(s)&&t.push(s);return t},hashStruct(r,e,t,n=!0){return A.keccak(this.encodeData(r,e,t,n))},hashType(r,e){return A.keccak(this.encodeType(r,e))},sanitizeData(r){const e={};for(const t in zt.properties)r[t]&&(e[t]=r[t]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(r,e=!0){const t=this.sanitizeData(r),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",t.domain,t.types,e)),t.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(t.primaryType,t.message,t.types,e)),A.keccak(Buffer.concat(n))}};var nn={TYPED_MESSAGE_SCHEMA:zt,TypedDataUtils:Be,hashForSignTypedDataLegacy:function(r){return sn(r.data)},hashForSignTypedData_v3:function(r){return Be.hash(r.data,!1)},hashForSignTypedData_v4:function(r){return Be.hash(r.data)}};function sn(r){const e=new Error("Expect argument to be non-empty array");if(typeof r!="object"||!r.length)throw e;const t=r.map(function(i){return i.type==="bytes"?A.toBuffer(i.value):i.value}),n=r.map(function(i){return i.type}),s=r.map(function(i){if(!i.name)throw e;return i.type+" "+i.name});return ee.soliditySHA3(["bytes32","bytes32"],[ee.soliditySHA3(new Array(r.length).fill("string"),s),ee.soliditySHA3(n,t)])}var N={};Object.defineProperty(N,"__esModule",{value:!0});N.APP_VERSION_KEY=N.LOCAL_STORAGE_ADDRESSES_KEY=N.WALLET_USER_NAME_KEY=void 0;N.WALLET_USER_NAME_KEY="walletUsername";N.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";N.APP_VERSION_KEY="AppVersion";var ie={};Object.defineProperty(ie,"__esModule",{value:!0});ie.RelayEventManager=void 0;const an=u;class on{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,an.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}ie.RelayEventManager=on;var Ie={},Me={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.WalletLinkCipher=void 0;const le=u;class cn{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(e)),o=16,c=a.slice(a.byteLength-o),l=a.slice(0,a.byteLength-o),h=new Uint8Array(c),f=new Uint8Array(l),d=new Uint8Array([...n,...h,...f]);return(0,le.uint8ArrayToHex)(d)}async decrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,le.hexStringToUint8Array)(e),o=a.slice(0,12),c=a.slice(12,28),l=a.slice(28),h=new Uint8Array([...l,...c]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const d=await window.crypto.subtle.decrypt(f,i,h),p=new TextDecoder;n(p.decode(d))}catch(d){s(d)}})()})}}Le.WalletLinkCipher=cn;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.WalletLinkHTTP=void 0;class dn{constructor(e,t,n){this.linkAPIUrl=e,this.sessionId=t;const s=`${t}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:n,error:s}=await t.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${t.status}`)}}Ae.WalletLinkHTTP=dn;var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.WalletLinkWebSocket=Y.ConnectionState=void 0;var Z;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(Z||(Y.ConnectionState=Z={}));class ln{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,t)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){t(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Z.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),t(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.DISCONNECTED)},s.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Z.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch{}}}sendData(e){const{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Y.WalletLinkWebSocket=ln;Object.defineProperty(Me,"__esModule",{value:!0});Me.WalletLinkConnection=void 0;const st=N,un=Le,hn=Ae,ue=Y,F=_,it=1e4,gn=6e4;class pn{constructor({session:e,linkAPIUrl:t,listener:n,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,F.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,l)=>{const h=a[l];h!==void 0&&c(h)})},this.handleDestroyed=a=>{var o;a==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async a=>{var o;{const c=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.accountUpdated(c)}},this.handleMetadataUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,l)}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(st.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(st.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(a),h=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.chainUpdated(l,h)}},this.session=e,this.cipher=new un.WalletLinkCipher(e.secret),this.listener=n;const i=new ue.WalletLinkWebSocket(`${t}/rpc`,s);i.setConnectionStateListener(async a=>{let o=!1;switch(a){case ue.ConnectionState.DISCONNECTED:if(!this.destroyed){const c=async()=>{await new Promise(l=>setTimeout(l,5e3)),this.destroyed||i.connect().catch(()=>{c()})};c()}break;case ue.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},it),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ue.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(a=>{var o;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const c=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=c||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((o=this.requestResolutions.get(a.id))===null||o===void 0||o(a))}),this.ws=i,this.http=new hn.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&((t=this.onceConnected)===null||t===void 0||t.call(this))}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,n;this._linked=e,e&&((t=this.onceLinked)===null||t===void 0||t.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if(!(e.type!=="Event"||e.event!=="Web3Response")){const n=await this.cipher.decrypt(e.data),s=JSON.parse(n);if(s.type!=="WEB3_RESPONSE")return;(t=this.listener)===null||t===void 0||t.handleWeb3ResponseMessage(s)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(t=>this.handleIncomingEvent(t))}async setSessionMetadata(e,t){const n={type:"SetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(e,t,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>it*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,t=gn){const n=e.id;this.sendData(e);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},t)}),new Promise(i=>{this.requestResolutions.set(n,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if(t.type==="Fail")throw new Error(t.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Me.WalletLinkConnection=pn;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.WalletLinkSession=void 0;const fn=sr,at=u,ot="session:id",ct="session:secret",dt="session:linked";class Ve{constructor(e,t,n,s){this._storage=e,this._id=t||(0,at.randomBytesHex)(16),this._secret=n||(0,at.randomBytesHex)(32),this._key=new fn.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){const t=e.getItem(ot),n=e.getItem(dt),s=e.getItem(ct);return t&&s?new Ve(e,t,s,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(ot,this._id),this._storage.setItem(ct,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(dt,this._linked?"1":"0")}}Re.WalletLinkSession=Ve;var S={};Object.defineProperty(S,"__esModule",{value:!0});S.isDarkMode=S.isMobileWeb=S.getLocation=S.createQrUrl=void 0;function mn(r,e,t,n,s,i){const a=n?"parent-id":"id",o=new URLSearchParams({[a]:r,secret:e,server:t,v:s,chainId:i.toString()}).toString();return`${t}/#/link?${o}`}S.createQrUrl=mn;function bn(){try{return window.frameElement!==null}catch{return!1}}function yn(){try{return bn()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=yn;function wn(){var r;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((r=window==null?void 0:window.navigator)===null||r===void 0?void 0:r.userAgent)}S.isMobileWeb=wn;function vn(){var r,e;return(e=(r=window==null?void 0:window.matchMedia)===null||r===void 0?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}S.isDarkMode=vn;var xe={},ae={},ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var _n=M&&M.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ae,"__esModule",{value:!0});ae.injectCssReset=void 0;const En=_n(ze);function Sn(){const r=document.createElement("style");r.type="text/css",r.appendChild(document.createTextNode(En.default)),document.documentElement.appendChild(r)}ae.injectCssReset=Sn;var Ze={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(r){var e=M&&M.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(r,"__esModule",{value:!0}),r.SnackbarInstance=r.SnackbarContainer=r.Snackbar=void 0;const t=e(vt),n=_t,s=ir,i=S,a=e(Ge),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class l{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,i.isDarkMode)()}attach(p){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",p.appendChild(this.root),this.render()}presentItem(p){const m=this.nextItemKey++;return this.items.set(m,p),this.render(),()=>{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(r.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([p,m])=>(0,n.h)(r.SnackbarInstance,Object.assign({},m,{key:p}))))),this.root)}}r.Snackbar=l;const h=d=>(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,a.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));r.SnackbarContainer=h;const f=({autoExpand:d,message:p,menuItems:m})=>{const[B,Xt]=(0,s.useState)(!0),[Oe,Je]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const L=[window.setTimeout(()=>{Xt(!1)},1),window.setTimeout(()=>{Je(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const er=()=>{Je(!Oe)};return(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance",B&&"-cbwsdk-snackbar-instance-hidden",Oe&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:er},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},p),(0,n.h)("div",{class:"-gear-container"},!Oe&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((L,tr)=>(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:tr},(0,n.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};r.SnackbarInstance=f})(Ze);Object.defineProperty(xe,"__esModule",{value:!0});xe.WalletLinkRelayUI=void 0;const Cn=ae,kn=Ze;class In{constructor(){this.attached=!1,this.snackbar=new kn.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,Cn.injectCssReset)()}showConnecting(e){let t;return e.isUnlinkedErrorState?t={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:t={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}xe.WalletLinkRelayUI=In;var Pe={},Ne={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Zt=M&&M.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.RedirectDialog=void 0;const Mn=Zt(vt),x=_t,Ln=ae,An=Ze,Rn=S,xn=Zt(Ye);class Pn{constructor(){this.root=null,this.darkMode=(0,Rn.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Ln.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,x.render)(null,this.root),e&&(0,x.render)((0,x.h)(Nn,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Ne.RedirectDialog=Pn;const Nn=({title:r,buttonText:e,darkMode:t,onButtonClick:n,onDismiss:s})=>{const i=t?"dark":"light";return(0,x.h)(An.SnackbarContainer,{darkMode:t},(0,x.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,x.h)("style",null,xn.default),(0,x.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,x.h)("div",{class:(0,Mn.default)("-cbwsdk-redirect-dialog-box",i)},(0,x.h)("p",null,r),(0,x.h)("button",{onClick:n},e))))};var T={};Object.defineProperty(T,"__esModule",{value:!0});T.CBW_MOBILE_DEEPLINK_URL=T.WALLETLINK_URL=T.CB_KEYS_URL=void 0;T.CB_KEYS_URL="https://keys.coinbase.com/connect";T.WALLETLINK_URL="https://www.walletlink.org";T.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.WLMobileRelayUI=void 0;const Tn=Ne,jn=S,On=T;class Dn{constructor(){this.attached=!1,this.redirectDialog=new Tn.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL(On.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,jn.getLocation)().href),e&&t.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=t.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Pe.WLMobileRelayUI=Dn;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.WalletLinkRelay=void 0;const Wn=Me,Un=N,Bn=ie,He=Re,V=Q,Hn=S,Kn=xe,lt=Pe,qn=j,b=u,$n=O;class W{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,Hn.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(Un.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(i,a))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),W.accountRequestCallbackIds.size>0&&(Array.from(W.accountRequestCallbackIds.values()).forEach(a=>{const o={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[i]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:a}))}),W.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:t,ui:n,connection:s}=this.subscribe();this._session=t,this.connection=s,this.relayEventManager=new Bn.RelayEventManager,this.ui=n}subscribe(){const e=He.WalletLinkSession.load(this.storage)||new He.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,n=new Wn.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),s=this.isMobileWeb?new lt.WLMobileRelayUI:new Kn.WalletLinkRelayUI;return n.connect(),{session:e,ui:s,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=He.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&$n.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),signature:(0,b.hexStringFromBuffer)(t,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,b.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const n=(0,b.randomBytesHex)(8),s=i=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,i),t==null||t()};return new Promise((i,a)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,o=>{if(t==null||t(),(0,V.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(n,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){const n={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",n,!0).then(s=>{}).catch(s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:t.method,errorMessage:s.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof lt.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,n){return this.connection.publishEvent(e,t,n)}handleWeb3ResponseMessage(e){const{response:t}=e;if(t.method==="requestEthereumAccounts"){W.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),W.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,n){var s;const i=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:i}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,b.randomBytesHex)(8);return new Promise((n,s)=>{this.relayEventManager.callbacks.set(t,i=>{if((0,V.isErrorResponse)(i))return s(new Error(i.errorMessage));n(i)}),W.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)})}watchAsset(e,t,n,s,i,a){const o={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:s,image:i},chainId:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,V.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}addEthereumChain(e,t,n,s,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,V.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}switchEthereumChain(e,t){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},s=(0,b.randomBytesHex)(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(s,o=>{if((0,V.isErrorResponse)(o)&&o.errorCode)return a(qn.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,V.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,n)})}}Ie.WalletLinkRelay=W;W.accountRequestCallbackIds=new Set;var Fn=M&&M.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.WalletLinkSigner=void 0;const Ke=Fn(nn),ut=N,Vn=ie,D=Q,zn=Ie,ht=T,w=j,g=u,Zn=O,qe="DefaultChainId",gt="DefaultJsonRpcUrl";class Gn{constructor(e){var t,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:s,appLogoUrl:i}=e.metadata;this._appName=s,this._appLogoUrl=i,this._storage=new Zn.ScopedLocalStorage("walletlink",ht.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Vn.RelayEventManager,this._jsonRpcUrlFromOpts="";const a=this._storage.getItem(ut.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(l=>(0,g.ensureAddressString)(l)),(t=this.updateListener)===null||t===void 0||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(qe)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:n}=e.getWalletLinkSession();return{id:t,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(gt))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(gt,e)}updateProviderInfo(e,t){var n;this.jsonRpcUrl=e;const s=this.getChainId();this._storage.setItem(qe,t.toString(10)),((0,g.ensureIntNumber)(t)!==s||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,n,s,i,a){const c=await this.initializeRelay().watchAsset(e,t,n,s,i,a==null?void 0:a.toString());return(0,D.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(e,t,n,s,i,a){var o,c;if((0,g.ensureIntNumber)(e)===this.getChainId())return!1;const l=this.initializeRelay();this._isAuthorized()||await l.requestEthereumAccounts();const h=await l.addEthereumChain(e.toString(),t,i,n,s,a);return(0,D.isErrorResponse)(h)?!1:(((o=h.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(e){const n=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,D.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===w.standardErrorCodes.provider.unsupportedChain?w.standardErrors.provider.unsupportedChain():w.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const s=n.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(t=>{throw t})}catch(t){return Promise.reject(t)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw w.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:n}=e;if(typeof t!="string"||t.length===0)throw w.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw w.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const s=n===void 0?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:s,jsonrpc:"2.0",id:i})).result}_setAddresses(e,t){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const s=e.map(i=>(0,g.ensureAddressString)(i));JSON.stringify(s)!==JSON.stringify(this._addresses)&&(this._addresses=s,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:s,source:"wallet"}),this._storage.setItem(ut.LOCAL_STORAGE_ADDRESSES_KEY,s.join(" ")))}_sendRequestAsync(e){return new Promise((t,n)=>{try{const s=this._handleSynchronousMethods(e);if(s!==void 0)return t({jsonrpc:"2.0",id:e.id,result:s})}catch(s){return n(s)}this._handleAsynchronousMethods(e).then(s=>s&&t(Object.assign(Object.assign({},s),{id:e.id}))).catch(s=>n(s))})}_handleSynchronousMethods(e){const{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,n=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const t=(0,g.ensureAddressString)(e);return this._addresses.map(s=>(0,g.ensureAddressString)(s)).includes(t)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,g.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);const n=e.to?(0,g.ensureAddressString)(e.to):null,s=e.value!=null?(0,g.ensureBigInt)(e.value):BigInt(0),i=e.data?(0,g.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,g.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,g.ensureBigInt)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,g.ensureBigInt)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,g.ensureBigInt)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,g.ensureBigInt)(e.gas):null,f=e.chainId?(0,g.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:t,toAddress:n,weiValue:s,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw w.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw w.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,n,s){this._ensureKnownAddress(t);try{const a=await this.initializeRelay().signEthereumMessage(e,t,n,s);if((0,D.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(e,t,n){const i=await this.initializeRelay().ethereumAddressFromSignedMessage(e,t,n);if((0,D.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,g.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(qe);if(!e)return(0,g.ensureIntNumber)(1);const t=parseInt(e,10);return(0,g.ensureIntNumber)(t)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,D.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(t){throw typeof t.message=="string"&&t.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied account authorization"):t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),n=(0,g.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}_eth_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),n=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,g.ensureBuffer)(e[0]),n=(0,g.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}_personal_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),n=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const t=(0,g.ensureBuffer)(e[0]),s=await this.initializeRelay().submitEthereumTransaction(t,this.getChainId());if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signAndSubmitEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,g.ensureParsedJSONObject)(e[0]),n=(0,g.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const s=Ke.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(s,n,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),n=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),n=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,t,!1,i)}async _wallet_addEthereumChain(e){var t,n,s,i;const a=e[0];if(((t=a.rpcUrls)===null||t===void 0?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw w.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw w.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(s=a.blockExplorerUrls)!==null&&s!==void 0?s:[],a.chainName,(i=a.iconUrls)!==null&&i!==void 0?i:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw w.standardErrors.rpc.invalidParams("Type is required");if((t==null?void 0:t.type)!=="ERC20")throw w.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(t!=null&&t.options))throw w.standardErrors.rpc.invalidParams("Options are required");if(!(t!=null&&t.options.address))throw w.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:s,symbol:i,image:a,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,s,i,o,a,n)}}initializeRelay(){if(!this._relay){const e=new zn.WalletLinkRelay({linkAPIUrl:ht.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((t,n)=>this._setAddresses(t,n)),e.setChainCallback((t,n)=>{this.updateProviderInfo(n,parseInt(t,10))}),this._relay=e}return this._relay}}Ce.WalletLinkSigner=Gn;var k={};Object.defineProperty(k,"__esModule",{value:!0});k.checkErrorForInvalidRequestArgs=k.getCoinbaseInjectedProvider=k.getCoinbaseInjectedSigner=k.fetchRPCRequest=void 0;const Yn=K,pe=j;async function Jn(r,e){if(!e.rpcUrl)throw pe.standardErrors.rpc.internal("No RPC URL set for chain");const t=Object.assign(Object.assign({},r),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":Yn.LIB_VERSION}})).json()).result}k.fetchRPCRequest=Jn;function Gt(){return globalThis.coinbaseWalletSigner}k.getCoinbaseInjectedSigner=Gt;function Qn(){return globalThis.coinbaseWalletExtension}function Xn(){var r,e;try{const t=globalThis;return(r=t.ethereum)!==null&&r!==void 0?r:(e=t.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function es({metadata:r,preference:e}){var t;if(e.options!=="smartWalletOnly"){if(Gt())return;const i=Qn();if(i){const{appName:a,appLogoUrl:o,appChainIds:c}=r;return(t=i.setAppInfo)===null||t===void 0||t.call(i,a,o,c),i}}const n=Xn();if(n!=null&&n.isCoinbaseBrowser)return n}k.getCoinbaseInjectedProvider=es;function ts(r){if(!r||typeof r!="object"||Array.isArray(r))return pe.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:r});const{method:e,params:t}=r;if(typeof e!="string"||e.length===0)return pe.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:r});if(t!==void 0&&!Array.isArray(t)&&(typeof t!="object"||t===null))return pe.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:r})}k.checkErrorForInvalidRequestArgs=ts;Object.defineProperty(P,"__esModule",{value:!0});P.createSigner=P.fetchSignerType=P.storeSignerType=P.loadSignerType=void 0;const rs=_e,Yt=Ce,ns=j,ss=k,is=O,Jt="SignerType",Qt=new is.ScopedLocalStorage("CBWSDK","SignerConfigurator");function as(){return Qt.getItem(Jt)}P.loadSignerType=as;function os(r){Qt.setItem(Jt,r)}P.storeSignerType=os;async function cs(r){const{communicator:e,metadata:t}=r;ls(e,t).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:r.preference},{data:s}=await e.postRequestAndWaitForResponse(n);return s}P.fetchSignerType=cs;function ds(r){const{signerType:e,metadata:t,communicator:n,updateListener:s}=r;switch(e){case"scw":return new rs.SCWSigner({metadata:t,updateListener:s,communicator:n});case"walletlink":return new Yt.WalletLinkSigner({metadata:t,updateListener:s});case"extension":{const i=(0,ss.getCoinbaseInjectedSigner)();if(!i)throw ns.standardErrors.rpc.internal("injected signer not found");return i}}}P.createSigner=ds;async function ls(r,e){await r.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const t=new Yt.WalletLinkSigner({metadata:e});r.postMessage({event:"WalletLinkUpdate",data:{session:t.getSession()}}),await t.handshake(),r.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Te={},J={};Object.defineProperty(J,"__esModule",{value:!0});J.closePopup=J.openPopup=void 0;const us=j,pt=420,ft=540;function hs(r){const e=(window.innerWidth-pt)/2+window.screenX,t=(window.innerHeight-ft)/2+window.screenY,n=window.open(r,"Smart Wallet",`width=${pt}, height=${ft}, left=${e}, top=${t}`);if(n==null||n.focus(),!n)throw us.standardErrors.rpc.internal("Pop up window failed to open");return n}J.openPopup=hs;function gs(r){r&&!r.closed&&r.close()}J.closePopup=gs;Object.defineProperty(Te,"__esModule",{value:!0});Te.Communicator=void 0;const ps=K,mt=J,fs=T,bt=j;class ms{constructor(e=fs.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async t=>{(await this.waitForPopupLoaded()).postMessage(t,this.url.origin)},this.postRequestAndWaitForResponse=async t=>{const n=this.onMessage(({requestId:s})=>s===t.id);return this.postMessage(t),await n},this.onMessage=async t=>new Promise((n,s)=>{const i=a=>{if(a.origin!==this.url.origin)return;const o=a.data;t(o)&&(n(o),window.removeEventListener("message",i),this.listeners.delete(i))};window.addEventListener("message",i),this.listeners.set(i,{reject:s})}),this.disconnect=()=>{(0,mt.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:t},n)=>{t(bt.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,mt.openPopup)(this.url),this.onMessage(({event:t})=>t==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:t})=>t==="PopupLoaded").then(t=>{this.postMessage({requestId:t.id,data:{version:ps.LIB_VERSION}})}).then(()=>{if(!this.popup)throw bt.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}Te.Communicator=ms;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.determineMethodCategory=void 0;const yt={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function bs(r){for(const e in yt){const t=e;if(yt[t].includes(r))return t}}je.determineMethodCategory=bs;var ys=M&&M.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s{try{if(this.connected)return this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),this.accounts;const h=await this.requestSignerSelection(),f=this.initSigner(h),d=await f.handshake();return this.signer=f,(0,ge.storeSignerType)(h),this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),d}catch(h){throw this.handleUnauthorizedError(h),h}},sign:async l=>{if(!this.connected||!this.signer)throw z.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(l)}catch(h){throw this.handleUnauthorizedError(h),h}},fetch:l=>(0,wt.fetchRPCRequest)(l,this.chain),state:l=>{const h=()=>{if(this.connected)return this.accounts;throw z.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(l.method){case"eth_chainId":return(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return h();case"eth_coinbase":return h()[0];default:return this.handlers.unsupported(l)}},deprecated:({method:l})=>{throw z.standardErrors.rpc.methodNotSupported(`Method ${l} is deprecated.`)},unsupported:({method:l})=>{throw z.standardErrors.rpc.methodNotSupported(`Method ${l} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:l,source:h})=>{(0,X.areAddressArraysEqual)(this.accounts,l)||(this.accounts=l,h!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:l,source:h})=>{l.id===this.chain.id&&l.rpcUrl===this.chain.rpcUrl||(this.chain=l,h!=="storage"&&this.emit("chainChanged",(0,X.hexStringFromIntNumber)((0,he.IntNumber)(l.id))))}},this.metadata=s,this.preference=o,this.communicator=new Es.Communicator(a),this.chain={id:(n=(t=s.appChainIds)===null||t===void 0?void 0:t[0])!==null&&n!==void 0?n:1};const c=(0,ge.loadSignerType)();this.signer=c?this.initSigner(c):null}get connected(){return this.accounts.length>0}async request(e){var t;try{const n=(0,wt.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const s=(t=(0,Ss.determineMethodCategory)(e.method))!==null&&t!==void 0?t:"fetch";return this.handlers[s](e)}catch(n){return Promise.reject((0,_s.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===z.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},Cs.ScopedLocalStorage.clearAll(),this.emit("disconnect",z.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,ge.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,ge.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}be.CoinbaseWalletProvider=ks;Object.defineProperty(te,"__esModule",{value:!0});te.CoinbaseWalletSDK=void 0;const Is=me,Ms=be,Ls=O,As=K,Rs=u,xs=k;class Ps{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,Rs.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;const n={metadata:this.metadata,preference:e};return(t=(0,xs.getCoinbaseInjectedProvider)(n))!==null&&t!==void 0?t:new Ms.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,t=240){return(0,Is.walletLogo)(e,t)}storeLatestVersion(){new Ls.ScopedLocalStorage("CBWSDK").setItem("VERSION",As.LIB_VERSION)}}te.CoinbaseWalletSDK=Ps;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.CoinbaseWalletSDK=void 0;const e=te;r.default=e.CoinbaseWalletSDK;var t=te;Object.defineProperty(r,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}})})(Et);const Ns=rr(Et),Os=Object.freeze(Object.defineProperty({__proto__:null,default:Ns},Symbol.toStringTag,{value:"Module"}));export{Os as i}; diff --git a/dist/assets/index-DUBt2OAj.css b/dist/assets/index-DUBt2OAj.css deleted file mode 100644 index c48f6387..00000000 --- a/dist/assets/index-DUBt2OAj.css +++ /dev/null @@ -1 +0,0 @@ -.react-datepicker__navigation-icon:before,.react-datepicker__year-read-view--down-arrow,.react-datepicker__month-read-view--down-arrow,.react-datepicker__month-year-read-view--down-arrow{border-color:#ccc;border-style:solid;border-width:3px 3px 0 0;content:"";display:block;height:9px;position:absolute;top:6px;width:9px}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle,.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle{margin-left:-4px;position:absolute;width:0}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:before,.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:before,.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:after,.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:after{box-sizing:content-box;position:absolute;border:8px solid transparent;height:0;width:1px;content:"";z-index:-1;border-width:8px;left:-8px}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:before,.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:before{border-bottom-color:#aeaeae}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle{top:0;margin-top:-8px}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:before,.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:after{border-top:none;border-bottom-color:#f0f0f0}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:after{top:0}.react-datepicker-popper[data-placement^=bottom] .react-datepicker__triangle:before{top:-1px;border-bottom-color:#aeaeae}.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle{bottom:0;margin-bottom:-8px}.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:before,.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:after{border-bottom:none;border-top-color:#fff}.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:after{bottom:0}.react-datepicker-popper[data-placement^=top] .react-datepicker__triangle:before{bottom:-1px;border-top-color:#aeaeae}.react-datepicker-wrapper{display:inline-block;padding:0;border:0}.react-datepicker{font-family:Helvetica Neue,helvetica,arial,sans-serif;font-size:.8rem;background-color:#fff;color:#000;border:1px solid #aeaeae;border-radius:.3rem;display:inline-block;position:relative}.react-datepicker--time-only .react-datepicker__triangle{left:35px}.react-datepicker--time-only .react-datepicker__time-container{border-left:0}.react-datepicker--time-only .react-datepicker__time,.react-datepicker--time-only .react-datepicker__time-box{border-bottom-left-radius:.3rem;border-bottom-right-radius:.3rem}.react-datepicker__triangle{position:absolute;left:50px}.react-datepicker-popper{z-index:1}.react-datepicker-popper[data-placement^=bottom]{padding-top:10px}.react-datepicker-popper[data-placement=bottom-end] .react-datepicker__triangle,.react-datepicker-popper[data-placement=top-end] .react-datepicker__triangle{left:auto;right:50px}.react-datepicker-popper[data-placement^=top]{padding-bottom:10px}.react-datepicker-popper[data-placement^=right]{padding-left:8px}.react-datepicker-popper[data-placement^=right] .react-datepicker__triangle{left:auto;right:42px}.react-datepicker-popper[data-placement^=left]{padding-right:8px}.react-datepicker-popper[data-placement^=left] .react-datepicker__triangle{left:42px;right:auto}.react-datepicker__header{text-align:center;background-color:#f0f0f0;border-bottom:1px solid #aeaeae;border-top-left-radius:.3rem;padding:8px 0;position:relative}.react-datepicker__header--time{padding-bottom:8px;padding-left:5px;padding-right:5px}.react-datepicker__header--time:not(.react-datepicker__header--time--only){border-top-left-radius:0}.react-datepicker__header:not(.react-datepicker__header--has-time-select){border-top-right-radius:.3rem}.react-datepicker__year-dropdown-container--select,.react-datepicker__month-dropdown-container--select,.react-datepicker__month-year-dropdown-container--select,.react-datepicker__year-dropdown-container--scroll,.react-datepicker__month-dropdown-container--scroll,.react-datepicker__month-year-dropdown-container--scroll{display:inline-block;margin:0 2px}.react-datepicker__current-month,.react-datepicker-time__header,.react-datepicker-year-header{margin-top:0;color:#000;font-weight:700;font-size:.944rem}.react-datepicker-time__header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.react-datepicker__navigation{align-items:center;background:none;display:flex;justify-content:center;text-align:center;cursor:pointer;position:absolute;top:2px;padding:0;border:none;z-index:1;height:32px;width:32px;text-indent:-999em;overflow:hidden}.react-datepicker__navigation--previous{left:2px}.react-datepicker__navigation--next{right:2px}.react-datepicker__navigation--next--with-time:not(.react-datepicker__navigation--next--with-today-button){right:85px}.react-datepicker__navigation--years{position:relative;top:0;display:block;margin-left:auto;margin-right:auto}.react-datepicker__navigation--years-previous{top:4px}.react-datepicker__navigation--years-upcoming{top:-4px}.react-datepicker__navigation:hover *:before{border-color:#a6a6a6}.react-datepicker__navigation-icon{position:relative;top:-1px;font-size:20px}.react-datepicker__navigation-icon--next{left:-2px}.react-datepicker__navigation-icon--next:before{transform:rotate(45deg);left:-7px}.react-datepicker__navigation-icon--previous{right:-2px}.react-datepicker__navigation-icon--previous:before{transform:rotate(225deg);right:-7px}.react-datepicker__month-container{float:left}.react-datepicker__year{margin:.4rem;text-align:center}.react-datepicker__year-wrapper{display:flex;flex-wrap:wrap;max-width:180px}.react-datepicker__year .react-datepicker__year-text{display:inline-block;width:4rem;margin:2px}.react-datepicker__month{margin:.4rem;text-align:center}.react-datepicker__month .react-datepicker__month-text,.react-datepicker__month .react-datepicker__quarter-text{display:inline-block;width:4rem;margin:2px}.react-datepicker__input-time-container{clear:both;width:100%;float:left;margin:5px 0 10px 15px;text-align:left}.react-datepicker__input-time-container .react-datepicker-time__caption,.react-datepicker__input-time-container .react-datepicker-time__input-container{display:inline-block}.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input{display:inline-block;margin-left:10px}.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input{width:auto}.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input[type=time]::-webkit-inner-spin-button,.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input[type=time]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__input input[type=time]{-moz-appearance:textfield}.react-datepicker__input-time-container .react-datepicker-time__input-container .react-datepicker-time__delimiter{margin-left:5px;display:inline-block}.react-datepicker__time-container{float:right;border-left:1px solid #aeaeae;width:85px}.react-datepicker__time-container--with-today-button{display:inline;border:1px solid #aeaeae;border-radius:.3rem;position:absolute;right:-72px;top:0}.react-datepicker__time-container .react-datepicker__time{position:relative;background:#fff;border-bottom-right-radius:.3rem}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box{width:85px;overflow-x:hidden;margin:0 auto;text-align:center;border-bottom-right-radius:.3rem}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list{list-style:none;margin:0;height:calc(195px + .85rem);overflow-y:scroll;padding-right:0;padding-left:0;width:100%;box-sizing:content-box}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item{height:30px;padding:5px 10px;white-space:nowrap}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item:hover{cursor:pointer;background-color:#f0f0f0}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--selected{background-color:#216ba5;color:#fff;font-weight:700}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--selected:hover{background-color:#216ba5}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--disabled{color:#ccc}.react-datepicker__time-container .react-datepicker__time .react-datepicker__time-box ul.react-datepicker__time-list li.react-datepicker__time-list-item--disabled:hover{cursor:default;background-color:transparent}.react-datepicker__week-number{color:#ccc;display:inline-block;width:1.7rem;line-height:1.7rem;text-align:center;margin:.166rem}.react-datepicker__week-number.react-datepicker__week-number--clickable{cursor:pointer}.react-datepicker__week-number.react-datepicker__week-number--clickable:hover{border-radius:.3rem;background-color:#f0f0f0}.react-datepicker__day-names,.react-datepicker__week{white-space:nowrap}.react-datepicker__day-names{margin-bottom:-8px}.react-datepicker__day-name,.react-datepicker__day,.react-datepicker__time-name{color:#000;display:inline-block;width:1.7rem;line-height:1.7rem;text-align:center;margin:.166rem}.react-datepicker__month--selected,.react-datepicker__month--in-selecting-range,.react-datepicker__month--in-range,.react-datepicker__quarter--selected,.react-datepicker__quarter--in-selecting-range,.react-datepicker__quarter--in-range{border-radius:.3rem;background-color:#216ba5;color:#fff}.react-datepicker__month--selected:hover,.react-datepicker__month--in-selecting-range:hover,.react-datepicker__month--in-range:hover,.react-datepicker__quarter--selected:hover,.react-datepicker__quarter--in-selecting-range:hover,.react-datepicker__quarter--in-range:hover{background-color:#1d5d90}.react-datepicker__month--disabled,.react-datepicker__quarter--disabled{color:#ccc;pointer-events:none}.react-datepicker__month--disabled:hover,.react-datepicker__quarter--disabled:hover{cursor:default;background-color:transparent}.react-datepicker__day,.react-datepicker__month-text,.react-datepicker__quarter-text,.react-datepicker__year-text{cursor:pointer}.react-datepicker__day:hover,.react-datepicker__month-text:hover,.react-datepicker__quarter-text:hover,.react-datepicker__year-text:hover{border-radius:.3rem;background-color:#f0f0f0}.react-datepicker__day--today,.react-datepicker__month-text--today,.react-datepicker__quarter-text--today,.react-datepicker__year-text--today{font-weight:700}.react-datepicker__day--highlighted,.react-datepicker__month-text--highlighted,.react-datepicker__quarter-text--highlighted,.react-datepicker__year-text--highlighted{border-radius:.3rem;background-color:#3dcc4a;color:#fff}.react-datepicker__day--highlighted:hover,.react-datepicker__month-text--highlighted:hover,.react-datepicker__quarter-text--highlighted:hover,.react-datepicker__year-text--highlighted:hover{background-color:#32be3f}.react-datepicker__day--highlighted-custom-1,.react-datepicker__month-text--highlighted-custom-1,.react-datepicker__quarter-text--highlighted-custom-1,.react-datepicker__year-text--highlighted-custom-1{color:#f0f}.react-datepicker__day--highlighted-custom-2,.react-datepicker__month-text--highlighted-custom-2,.react-datepicker__quarter-text--highlighted-custom-2,.react-datepicker__year-text--highlighted-custom-2{color:green}.react-datepicker__day--selected,.react-datepicker__day--in-selecting-range,.react-datepicker__day--in-range,.react-datepicker__month-text--selected,.react-datepicker__month-text--in-selecting-range,.react-datepicker__month-text--in-range,.react-datepicker__quarter-text--selected,.react-datepicker__quarter-text--in-selecting-range,.react-datepicker__quarter-text--in-range,.react-datepicker__year-text--selected,.react-datepicker__year-text--in-selecting-range,.react-datepicker__year-text--in-range{border-radius:.3rem;background-color:#216ba5;color:#fff}.react-datepicker__day--selected:hover,.react-datepicker__day--in-selecting-range:hover,.react-datepicker__day--in-range:hover,.react-datepicker__month-text--selected:hover,.react-datepicker__month-text--in-selecting-range:hover,.react-datepicker__month-text--in-range:hover,.react-datepicker__quarter-text--selected:hover,.react-datepicker__quarter-text--in-selecting-range:hover,.react-datepicker__quarter-text--in-range:hover,.react-datepicker__year-text--selected:hover,.react-datepicker__year-text--in-selecting-range:hover,.react-datepicker__year-text--in-range:hover{background-color:#1d5d90}.react-datepicker__day--keyboard-selected,.react-datepicker__month-text--keyboard-selected,.react-datepicker__quarter-text--keyboard-selected,.react-datepicker__year-text--keyboard-selected{border-radius:.3rem;background-color:#2a87d0;color:#fff}.react-datepicker__day--keyboard-selected:hover,.react-datepicker__month-text--keyboard-selected:hover,.react-datepicker__quarter-text--keyboard-selected:hover,.react-datepicker__year-text--keyboard-selected:hover{background-color:#1d5d90}.react-datepicker__day--in-selecting-range,.react-datepicker__month-text--in-selecting-range,.react-datepicker__quarter-text--in-selecting-range,.react-datepicker__year-text--in-selecting-range{background-color:#216ba580}.react-datepicker__month--selecting-range .react-datepicker__day--in-range,.react-datepicker__month--selecting-range .react-datepicker__month-text--in-range,.react-datepicker__month--selecting-range .react-datepicker__quarter-text--in-range,.react-datepicker__month--selecting-range .react-datepicker__year-text--in-range{background-color:#f0f0f0;color:#000}.react-datepicker__day--disabled,.react-datepicker__month-text--disabled,.react-datepicker__quarter-text--disabled,.react-datepicker__year-text--disabled{cursor:default;color:#ccc}.react-datepicker__day--disabled:hover,.react-datepicker__month-text--disabled:hover,.react-datepicker__quarter-text--disabled:hover,.react-datepicker__year-text--disabled:hover{background-color:transparent}.react-datepicker__month-text.react-datepicker__month--selected:hover,.react-datepicker__month-text.react-datepicker__month--in-range:hover,.react-datepicker__month-text.react-datepicker__quarter--selected:hover,.react-datepicker__month-text.react-datepicker__quarter--in-range:hover,.react-datepicker__quarter-text.react-datepicker__month--selected:hover,.react-datepicker__quarter-text.react-datepicker__month--in-range:hover,.react-datepicker__quarter-text.react-datepicker__quarter--selected:hover,.react-datepicker__quarter-text.react-datepicker__quarter--in-range:hover{background-color:#216ba5}.react-datepicker__month-text:hover,.react-datepicker__quarter-text:hover{background-color:#f0f0f0}.react-datepicker__input-container{position:relative;display:inline-block;width:100%}.react-datepicker__year-read-view,.react-datepicker__month-read-view,.react-datepicker__month-year-read-view{border:1px solid transparent;border-radius:.3rem;position:relative}.react-datepicker__year-read-view:hover,.react-datepicker__month-read-view:hover,.react-datepicker__month-year-read-view:hover{cursor:pointer}.react-datepicker__year-read-view:hover .react-datepicker__year-read-view--down-arrow,.react-datepicker__year-read-view:hover .react-datepicker__month-read-view--down-arrow,.react-datepicker__month-read-view:hover .react-datepicker__year-read-view--down-arrow,.react-datepicker__month-read-view:hover .react-datepicker__month-read-view--down-arrow,.react-datepicker__month-year-read-view:hover .react-datepicker__year-read-view--down-arrow,.react-datepicker__month-year-read-view:hover .react-datepicker__month-read-view--down-arrow{border-top-color:#b3b3b3}.react-datepicker__year-read-view--down-arrow,.react-datepicker__month-read-view--down-arrow,.react-datepicker__month-year-read-view--down-arrow{transform:rotate(135deg);right:-16px;top:0}.react-datepicker__year-dropdown,.react-datepicker__month-dropdown,.react-datepicker__month-year-dropdown{background-color:#f0f0f0;position:absolute;width:50%;left:25%;top:30px;z-index:1;text-align:center;border-radius:.3rem;border:1px solid #aeaeae}.react-datepicker__year-dropdown:hover,.react-datepicker__month-dropdown:hover,.react-datepicker__month-year-dropdown:hover{cursor:pointer}.react-datepicker__year-dropdown--scrollable,.react-datepicker__month-dropdown--scrollable,.react-datepicker__month-year-dropdown--scrollable{height:150px;overflow-y:scroll}.react-datepicker__year-option,.react-datepicker__month-option,.react-datepicker__month-year-option{line-height:20px;width:100%;display:block;margin-left:auto;margin-right:auto}.react-datepicker__year-option:first-of-type,.react-datepicker__month-option:first-of-type,.react-datepicker__month-year-option:first-of-type{border-top-left-radius:.3rem;border-top-right-radius:.3rem}.react-datepicker__year-option:last-of-type,.react-datepicker__month-option:last-of-type,.react-datepicker__month-year-option:last-of-type{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom-left-radius:.3rem;border-bottom-right-radius:.3rem}.react-datepicker__year-option:hover,.react-datepicker__month-option:hover,.react-datepicker__month-year-option:hover{background-color:#ccc}.react-datepicker__year-option:hover .react-datepicker__navigation--years-upcoming,.react-datepicker__month-option:hover .react-datepicker__navigation--years-upcoming,.react-datepicker__month-year-option:hover .react-datepicker__navigation--years-upcoming{border-bottom-color:#b3b3b3}.react-datepicker__year-option:hover .react-datepicker__navigation--years-previous,.react-datepicker__month-option:hover .react-datepicker__navigation--years-previous,.react-datepicker__month-year-option:hover .react-datepicker__navigation--years-previous{border-top-color:#b3b3b3}.react-datepicker__year-option--selected,.react-datepicker__month-option--selected,.react-datepicker__month-year-option--selected{position:absolute;left:15px}.react-datepicker__close-icon{cursor:pointer;background-color:transparent;border:0;outline:0;padding:0 6px 0 0;position:absolute;top:0;right:0;height:100%;display:table-cell;vertical-align:middle}.react-datepicker__close-icon:after{cursor:pointer;background-color:#216ba5;color:#fff;border-radius:50%;height:16px;width:16px;padding:2px;font-size:12px;line-height:1;text-align:center;display:table-cell;vertical-align:middle;content:"×"}.react-datepicker__today-button{background:#f0f0f0;border-top:1px solid #aeaeae;cursor:pointer;text-align:center;font-weight:700;padding:5px 0;clear:left}.react-datepicker__portal{position:fixed;width:100vw;height:100vh;background-color:#000c;left:0;top:0;justify-content:center;align-items:center;display:flex;z-index:2147483647}.react-datepicker__portal .react-datepicker__day-name,.react-datepicker__portal .react-datepicker__day,.react-datepicker__portal .react-datepicker__time-name{width:3rem;line-height:3rem}@media (max-width: 400px),(max-height: 550px){.react-datepicker__portal .react-datepicker__day-name,.react-datepicker__portal .react-datepicker__day,.react-datepicker__portal .react-datepicker__time-name{width:2rem;line-height:2rem}}.react-datepicker__portal .react-datepicker__current-month,.react-datepicker__portal .react-datepicker-time__header{font-size:1.44rem} diff --git a/dist/assets/index-DY4jrsxT.js b/dist/assets/index-DY4jrsxT.js deleted file mode 100644 index 90ac516a..00000000 --- a/dist/assets/index-DY4jrsxT.js +++ /dev/null @@ -1,14092 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DKSdwK6L.js","./hooks.module-BBeYFAft.js","./index-Clf5vl-T.js"])))=>i.map(i=>d[i]); -var noe=t=>{throw TypeError(t)};var Aj=(t,e,r)=>e.has(t)||noe("Cannot "+r);var at=(t,e,r)=>(Aj(t,e,"read from private field"),r?r.call(t):e.get(t)),ni=(t,e,r)=>e.has(t)?noe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),un=(t,e,r,n)=>(Aj(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),so=(t,e,r)=>(Aj(t,e,"access private method"),r);var SI=(t,e,r,n)=>({set _(i){un(t,e,i,r)},get _(){return at(t,e,n)}});function Lje(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var ioe={},R2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ioe<"u"?ioe:typeof self<"u"?self:{};function Un(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function bQ(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var J2e={exports:{}},XO={},exe={exports:{}},Wn={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var WE=Symbol.for("react.element"),$je=Symbol.for("react.portal"),Bje=Symbol.for("react.fragment"),Fje=Symbol.for("react.strict_mode"),jje=Symbol.for("react.profiler"),Uje=Symbol.for("react.provider"),zje=Symbol.for("react.context"),Hje=Symbol.for("react.forward_ref"),Vje=Symbol.for("react.suspense"),Gje=Symbol.for("react.memo"),Wje=Symbol.for("react.lazy"),aoe=Symbol.iterator;function qje(t){return t===null||typeof t!="object"?null:(t=aoe&&t[aoe]||t["@@iterator"],typeof t=="function"?t:null)}var txe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rxe=Object.assign,nxe={};function eS(t,e,r){this.props=t,this.context=e,this.refs=nxe,this.updater=r||txe}eS.prototype.isReactComponent={};eS.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};eS.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ixe(){}ixe.prototype=eS.prototype;function xQ(t,e,r){this.props=t,this.context=e,this.refs=nxe,this.updater=r||txe}var _Q=xQ.prototype=new ixe;_Q.constructor=xQ;rxe(_Q,eS.prototype);_Q.isPureReactComponent=!0;var ooe=Array.isArray,axe=Object.prototype.hasOwnProperty,SQ={current:null},oxe={key:!0,ref:!0,__self:!0,__source:!0};function sxe(t,e,r){var n,i={},a=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)axe.call(e,n)&&!oxe.hasOwnProperty(n)&&(i[n]=e[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,H=B[$];if(0>>1;$i(W,k))Qi(J,W)?(B[$]=J,B[Q]=k,$=Q):(B[$]=W,B[ie]=k,$=ie);else if(Qi(J,k))B[$]=J,B[Q]=k,$=Q;else break e}}return j}function i(B,j){var k=B.sortIndex-j.sortIndex;return k!==0?k:B.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(B){for(var j=r(c);j!==null;){if(j.callback===null)n(c);else if(j.startTime<=B)n(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=r(c)}}function w(B){if(g=!1,b(B),!p)if(r(l)!==null)p=!0,N(C);else{var j=r(c);j!==null&&F(w,j.startTime-B)}}function C(B,j){p=!1,g&&(g=!1,y(I),I=-1),h=!0;var k=d;try{for(b(j),f=r(l);f!==null&&(!(f.expirationTime>j)||B&&!O());){var $=f.callback;if(typeof $=="function"){f.callback=null,d=f.priorityLevel;var H=$(f.expirationTime<=j);j=t.unstable_now(),typeof H=="function"?f.callback=H:f===r(l)&&n(l),b(j)}else n(l);f=r(l)}if(f!==null)var Y=!0;else{var ie=r(c);ie!==null&&F(w,ie.startTime-j),Y=!1}return Y}finally{f=null,d=k,h=!1}}var A=!1,S=null,I=-1,D=5,L=-1;function O(){return!(t.unstable_now()-LB||125$?(B.sortIndex=k,e(c,B),r(l)===null&&B===r(c)&&(g?(y(I),I=-1):g=!0,F(w,k-$))):(B.sortIndex=H,e(l,B),p||h||(p=!0,N(C))),B},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(B){var j=d;return function(){var k=d;d=j;try{return B.apply(this,arguments)}finally{d=k}}}})(dxe);fxe.exports=dxe;var iUe=fxe.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var aUe=Z,gu=iUe;function Tt(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zG=Object.prototype.hasOwnProperty,oUe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,coe={},uoe={};function sUe(t){return zG.call(uoe,t)?!0:zG.call(coe,t)?!1:oUe.test(t)?uoe[t]=!0:(coe[t]=!0,!1)}function lUe(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function cUe(t,e,r,n){if(e===null||typeof e>"u"||lUe(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ec(t,e,r,n,i,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var Ms={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ms[t]=new ec(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ms[e]=new ec(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ms[t]=new ec(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ms[t]=new ec(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Ms[t]=new ec(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ms[t]=new ec(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ms[t]=new ec(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ms[t]=new ec(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ms[t]=new ec(t,5,!1,t.toLowerCase(),null,!1,!1)});var AQ=/[\-:]([a-z])/g;function TQ(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(AQ,TQ);Ms[e]=new ec(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(AQ,TQ);Ms[e]=new ec(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(AQ,TQ);Ms[e]=new ec(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ms[t]=new ec(t,1,!1,t.toLowerCase(),null,!1,!1)});Ms.xlinkHref=new ec("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ms[t]=new ec(t,1,!1,t.toLowerCase(),null,!0,!0)});function EQ(t,e,r,n){var i=Ms.hasOwnProperty(e)?Ms[e]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=s);break}}}finally{Ij=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?X4(t):""}function uUe(t){switch(t.tag){case 5:return X4(t.type);case 16:return X4("Lazy");case 13:return X4("Suspense");case 19:return X4("SuspenseList");case 0:case 2:case 15:return t=kj(t.type,!1),t;case 11:return t=kj(t.type.render,!1),t;case 1:return t=kj(t.type,!0),t;default:return""}}function WG(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M_:return"Fragment";case R_:return"Portal";case HG:return"Profiler";case IQ:return"StrictMode";case VG:return"Suspense";case GG:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case gxe:return(t.displayName||"Context")+".Consumer";case pxe:return(t._context.displayName||"Context")+".Provider";case kQ:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case PQ:return e=t.displayName||null,e!==null?e:WG(t.type)||"Memo";case fm:e=t._payload,t=t._init;try{return WG(t(e))}catch{}}return null}function fUe(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return WG(e);case 8:return e===IQ?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function _1(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function mxe(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dUe(t){var e=mxe(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function TI(t){t._valueTracker||(t._valueTracker=dUe(t))}function yxe(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=mxe(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function EM(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function qG(t,e){var r=e.checked;return Va({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function doe(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=_1(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function wxe(t,e){e=e.checked,e!=null&&EQ(t,"checked",e,!1)}function YG(t,e){wxe(t,e);var r=_1(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?KG(t,e.type,r):e.hasOwnProperty("defaultValue")&&KG(t,e.type,_1(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function hoe(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function KG(t,e,r){(e!=="number"||EM(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var J4=Array.isArray;function i3(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=EI.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function C6(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var _A={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hUe=["Webkit","ms","Moz","O"];Object.keys(_A).forEach(function(t){hUe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),_A[e]=_A[t]})});function Sxe(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||_A.hasOwnProperty(t)&&_A[t]?(""+e).trim():e+"px"}function Cxe(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Sxe(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var pUe=Va({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function XG(t,e){if(e){if(pUe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Tt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Tt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Tt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Tt(62))}}function JG(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eW=null;function RQ(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tW=null,a3=null,o3=null;function voe(t){if(t=KE(t)){if(typeof tW!="function")throw Error(Tt(280));var e=t.stateNode;e&&(e=nL(e),tW(t.stateNode,t.type,e))}}function Axe(t){a3?o3?o3.push(t):o3=[t]:a3=t}function Txe(){if(a3){var t=a3,e=o3;if(o3=a3=null,voe(t),e)for(t=0;t>>=0,t===0?32:31-(AUe(t)/TUe|0)|0}var II=64,kI=4194304;function eA(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function RM(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=eA(s):(a&=o,a!==0&&(n=eA(a)))}else o=r&~i,o!==0?n=eA(o):a!==0&&(n=eA(a));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function qE(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Jd(e),t[e]=r}function PUe(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=CA),Aoe=" ",Toe=!1;function Wxe(t,e){switch(t){case"keyup":return ize.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qxe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var D_=!1;function oze(t,e){switch(t){case"compositionend":return qxe(e);case"keypress":return e.which!==32?null:(Toe=!0,Aoe);case"textInput":return t=e.data,t===Aoe&&Toe?null:t;default:return null}}function sze(t,e){if(D_)return t==="compositionend"||!FQ&&Wxe(t,e)?(t=Vxe(),iP=LQ=$m=null,D_=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Poe(r)}}function Qxe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Qxe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Xxe(){for(var t=window,e=EM();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=EM(t.document)}return e}function jQ(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function vze(t){var e=Xxe(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Qxe(r.ownerDocument.documentElement,r)){if(n!==null&&jQ(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!t.extend&&a>n&&(i=n,n=a,a=i),i=Roe(r,a);var o=Roe(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,N_=null,sW=null,TA=null,lW=!1;function Moe(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;lW||N_==null||N_!==EM(n)||(n=N_,"selectionStart"in n&&jQ(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),TA&&P6(TA,n)||(TA=n,n=NM(sW,"onSelect"),0$_||(t.current=pW[$_],pW[$_]=null,$_--)}function ia(t,e){$_++,pW[$_]=t.current,t.current=e}var S1={},ul=ty(S1),Ac=ty(!1),Tb=S1;function z3(t,e){var r=t.type.contextTypes;if(!r)return S1;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=e[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Tc(t){return t=t.childContextTypes,t!=null}function LM(){ma(Ac),ma(ul)}function Foe(t,e,r){if(ul.current!==S1)throw Error(Tt(168));ia(ul,e),ia(Ac,r)}function s_e(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Tt(108,fUe(t)||"Unknown",i));return Va({},r,n)}function $M(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||S1,Tb=ul.current,ia(ul,t),ia(Ac,Ac.current),!0}function joe(t,e,r){var n=t.stateNode;if(!n)throw Error(Tt(169));r?(t=s_e(t,e,Tb),n.__reactInternalMemoizedMergedChildContext=t,ma(Ac),ma(ul),ia(ul,t)):ma(Ac),ia(Ac,r)}var pg=null,iL=!1,Hj=!1;function l_e(t){pg===null?pg=[t]:pg.push(t)}function Ize(t){iL=!0,l_e(t)}function ry(){if(!Hj&&pg!==null){Hj=!0;var t=0,e=Pi;try{var r=pg;for(Pi=1;t>=o,i-=o,xg=1<<32-Jd(e)+i|r<I?(D=S,S=null):D=S.sibling;var L=d(y,S,b[I],w);if(L===null){S===null&&(S=D);break}t&&S&&L.alternate===null&&e(y,S),m=a(L,m,I),A===null?C=L:A.sibling=L,A=L,S=D}if(I===b.length)return r(y,S),Pa&&bw(y,I),C;if(S===null){for(;II?(D=S,S=null):D=S.sibling;var O=d(y,S,L.value,w);if(O===null){S===null&&(S=D);break}t&&S&&O.alternate===null&&e(y,S),m=a(O,m,I),A===null?C=O:A.sibling=O,A=O,S=D}if(L.done)return r(y,S),Pa&&bw(y,I),C;if(S===null){for(;!L.done;I++,L=b.next())L=f(y,L.value,w),L!==null&&(m=a(L,m,I),A===null?C=L:A.sibling=L,A=L);return Pa&&bw(y,I),C}for(S=n(y,S);!L.done;I++,L=b.next())L=h(S,y,I,L.value,w),L!==null&&(t&&L.alternate!==null&&S.delete(L.key===null?I:L.key),m=a(L,m,I),A===null?C=L:A.sibling=L,A=L);return t&&S.forEach(function(P){return e(y,P)}),Pa&&bw(y,I),C}function v(y,m,b,w){if(typeof b=="object"&&b!==null&&b.type===M_&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case AI:e:{for(var C=b.key,A=m;A!==null;){if(A.key===C){if(C=b.type,C===M_){if(A.tag===7){r(y,A.sibling),m=i(A,b.props.children),m.return=y,y=m;break e}}else if(A.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===fm&&Hoe(C)===A.type){r(y,A.sibling),m=i(A,b.props),m.ref=RC(y,A,b),m.return=y,y=m;break e}r(y,A);break}else e(y,A);A=A.sibling}b.type===M_?(m=ob(b.props.children,y.mode,w,b.key),m.return=y,y=m):(w=dP(b.type,b.key,b.props,null,y.mode,w),w.ref=RC(y,m,b),w.return=y,y=w)}return o(y);case R_:e:{for(A=b.key;m!==null;){if(m.key===A)if(m.tag===4&&m.stateNode.containerInfo===b.containerInfo&&m.stateNode.implementation===b.implementation){r(y,m.sibling),m=i(m,b.children||[]),m.return=y,y=m;break e}else{r(y,m);break}else e(y,m);m=m.sibling}m=Qj(b,y.mode,w),m.return=y,y=m}return o(y);case fm:return A=b._init,v(y,m,A(b._payload),w)}if(J4(b))return p(y,m,b,w);if(TC(b))return g(y,m,b,w);LI(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,m!==null&&m.tag===6?(r(y,m.sibling),m=i(m,b),m.return=y,y=m):(r(y,m),m=Zj(b,y.mode,w),m.return=y,y=m),o(y)):r(y,m)}return v}var V3=d_e(!0),h_e=d_e(!1),jM=ty(null),UM=null,j_=null,VQ=null;function GQ(){VQ=j_=UM=null}function WQ(t){var e=jM.current;ma(jM),t._currentValue=e}function mW(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function l3(t,e){UM=t,VQ=j_=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(_c=!0),t.firstContext=null)}function Uf(t){var e=t._currentValue;if(VQ!==t)if(t={context:t,memoizedValue:e,next:null},j_===null){if(UM===null)throw Error(Tt(308));j_=t,UM.dependencies={lanes:0,firstContext:t}}else j_=j_.next=t;return e}var jw=null;function qQ(t){jw===null?jw=[t]:jw.push(t)}function p_e(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,qQ(e)):(r.next=i.next,i.next=r),e.interleaved=r,zg(t,n)}function zg(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var dm=!1;function YQ(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function g_e(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function kg(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function a1(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,li&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,zg(t,r)}return i=n.interleaved,i===null?(e.next=e,qQ(n)):(e.next=i.next,i.next=e),n.interleaved=e,zg(t,r)}function oP(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,DQ(t,r)}}function Voe(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function zM(t,e,r,n){var i=t.updateQueue;dm=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,o===null?a=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;o=0,u=c=l=null,s=a;do{var d=s.lane,h=s.eventTime;if((n&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=t,g=s;switch(d=e,h=r,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Va({},f,d);break e;case 2:dm=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[s]:d.push(s))}else h={eventTime:h,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=d;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;d=s,s=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);kb|=o,t.lanes=o,t.memoizedState=f}}function Goe(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=Gj.transition;Gj.transition={};try{t(!1),e()}finally{Pi=r,Gj.transition=n}}function D_e(){return zf().memoizedState}function Mze(t,e,r){var n=s1(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},N_e(t))O_e(e,r);else if(r=p_e(t,e,r,n),r!==null){var i=Fl();eh(r,t,n,i),L_e(r,e,n)}}function Dze(t,e,r){var n=s1(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(N_e(t))O_e(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,uh(s,o)){var l=e.interleaved;l===null?(i.next=i,qQ(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=p_e(t,e,i,n),r!==null&&(i=Fl(),eh(r,t,n,i),L_e(r,e,n))}}function N_e(t){var e=t.alternate;return t===za||e!==null&&e===za}function O_e(t,e){EA=VM=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function L_e(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,DQ(t,r)}}var GM={readContext:Uf,useCallback:Ws,useContext:Ws,useEffect:Ws,useImperativeHandle:Ws,useInsertionEffect:Ws,useLayoutEffect:Ws,useMemo:Ws,useReducer:Ws,useRef:Ws,useState:Ws,useDebugValue:Ws,useDeferredValue:Ws,useTransition:Ws,useMutableSource:Ws,useSyncExternalStore:Ws,useId:Ws,unstable_isNewReconciler:!1},Nze={readContext:Uf,useCallback:function(t,e){return ip().memoizedState=[t,e===void 0?null:e],t},useContext:Uf,useEffect:qoe,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,lP(4194308,4,I_e.bind(null,e,t),r)},useLayoutEffect:function(t,e){return lP(4194308,4,t,e)},useInsertionEffect:function(t,e){return lP(4,2,t,e)},useMemo:function(t,e){var r=ip();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=ip();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Mze.bind(null,za,t),[n.memoizedState,t]},useRef:function(t){var e=ip();return t={current:t},e.memoizedState=t},useState:Woe,useDebugValue:rX,useDeferredValue:function(t){return ip().memoizedState=t},useTransition:function(){var t=Woe(!1),e=t[0];return t=Rze.bind(null,t[1]),ip().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=za,i=ip();if(Pa){if(r===void 0)throw Error(Tt(407));r=r()}else{if(r=e(),os===null)throw Error(Tt(349));Ib&30||w_e(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,qoe(x_e.bind(null,n,a,t),[t]),n.flags|=2048,B6(9,b_e.bind(null,n,a,r,e),void 0,null),r},useId:function(){var t=ip(),e=os.identifierPrefix;if(Pa){var r=_g,n=xg;r=(n&~(1<<32-Jd(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=L6++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[mp]=e,t[D6]=n,W_e(t,e,!1,!1),e.stateNode=t;e:{switch(o=JG(r,n),r){case"dialog":ua("cancel",t),ua("close",t),i=n;break;case"iframe":case"object":case"embed":ua("load",t),i=n;break;case"video":case"audio":for(i=0;iq3&&(e.flags|=128,n=!0,MC(a,!1),e.lanes=4194304)}else{if(!n)if(t=HM(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),MC(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Pa)return qs(e),null}else 2*go()-a.renderingStartTime>q3&&r!==1073741824&&(e.flags|=128,n=!0,MC(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(r=a.last,r!==null?r.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=go(),e.sibling=null,r=Fa.current,ia(Fa,n?r&1|2:r&1),e):(qs(e),null);case 22:case 23:return lX(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ru&1073741824&&(qs(e),e.subtreeFlags&6&&(e.flags|=8192)):qs(e),null;case 24:return null;case 25:return null}throw Error(Tt(156,e.tag))}function zze(t,e){switch(zQ(e),e.tag){case 1:return Tc(e.type)&&LM(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return G3(),ma(Ac),ma(ul),QQ(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return ZQ(e),null;case 13:if(ma(Fa),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Tt(340));H3()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ma(Fa),null;case 4:return G3(),null;case 10:return WQ(e.type._context),null;case 22:case 23:return lX(),null;case 24:return null;default:return null}}var BI=!1,al=!1,Hze=typeof WeakSet=="function"?WeakSet:Set,sr=null;function U_(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ka(t,e,n)}else r.current=null}function TW(t,e,r){try{r()}catch(n){Ka(t,e,n)}}var ise=!1;function Vze(t,e){if(cW=MM,t=Xxe(),jQ(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(s=o+i),f!==a||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===r&&++c===i&&(s=o),d===a&&++u===n&&(l=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(uW={focusedElem:t,selectionRange:r},MM=!1,sr=e;sr!==null;)if(e=sr,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,sr=t;else for(;sr!==null;){e=sr;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,v=p.memoizedState,y=e.stateNode,m=y.getSnapshotBeforeUpdate(e.elementType===e.type?g:$d(e.type,g),v);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Tt(163))}}catch(w){Ka(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,sr=t;break}sr=e.return}return p=ise,ise=!1,p}function IA(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&TW(e,r,a)}i=i.next}while(i!==n)}}function sL(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function EW(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function K_e(t){var e=t.alternate;e!==null&&(t.alternate=null,K_e(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[mp],delete e[D6],delete e[hW],delete e[Tze],delete e[Eze])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Z_e(t){return t.tag===5||t.tag===3||t.tag===4}function ase(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Z_e(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function IW(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=OM));else if(n!==4&&(t=t.child,t!==null))for(IW(t,e,r),t=t.sibling;t!==null;)IW(t,e,r),t=t.sibling}function kW(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(kW(t,e,r),t=t.sibling;t!==null;)kW(t,e,r),t=t.sibling}var Ss=null,Hd=!1;function Uv(t,e,r){for(r=r.child;r!==null;)Q_e(t,e,r),r=r.sibling}function Q_e(t,e,r){if(Ep&&typeof Ep.onCommitFiberUnmount=="function")try{Ep.onCommitFiberUnmount(JO,r)}catch{}switch(r.tag){case 5:al||U_(r,e);case 6:var n=Ss,i=Hd;Ss=null,Uv(t,e,r),Ss=n,Hd=i,Ss!==null&&(Hd?(t=Ss,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ss.removeChild(r.stateNode));break;case 18:Ss!==null&&(Hd?(t=Ss,r=r.stateNode,t.nodeType===8?zj(t.parentNode,r):t.nodeType===1&&zj(t,r),I6(t)):zj(Ss,r.stateNode));break;case 4:n=Ss,i=Hd,Ss=r.stateNode.containerInfo,Hd=!0,Uv(t,e,r),Ss=n,Hd=i;break;case 0:case 11:case 14:case 15:if(!al&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&TW(r,e,o),i=i.next}while(i!==n)}Uv(t,e,r);break;case 1:if(!al&&(U_(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Ka(r,e,s)}Uv(t,e,r);break;case 21:Uv(t,e,r);break;case 22:r.mode&1?(al=(n=al)||r.memoizedState!==null,Uv(t,e,r),al=n):Uv(t,e,r);break;default:Uv(t,e,r)}}function ose(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Hze),e.forEach(function(n){var i=Jze.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function bd(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=go()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Wze(n/1960))-n,10t?16:t,Bm===null)var n=!1;else{if(t=Bm,Bm=null,YM=0,li&6)throw Error(Tt(331));var i=li;for(li|=4,sr=t.current;sr!==null;){var a=sr,o=a.child;if(sr.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lgo()-oX?ab(t,0):aX|=r),Ec(t,e)}function a3e(t,e){e===0&&(t.mode&1?(e=kI,kI<<=1,!(kI&130023424)&&(kI=4194304)):e=1);var r=Fl();t=zg(t,e),t!==null&&(qE(t,e,r),Ec(t,r))}function Xze(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),a3e(t,r)}function Jze(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Tt(314))}n!==null&&n.delete(e),a3e(t,r)}var o3e;o3e=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ac.current)_c=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return _c=!1,jze(t,e,r);_c=!!(t.flags&131072)}else _c=!1,Pa&&e.flags&1048576&&c_e(e,FM,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;cP(t,e),t=e.pendingProps;var i=z3(e,ul.current);l3(e,r),i=JQ(null,e,n,t,i,r);var a=eX();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Tc(n)?(a=!0,$M(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,YQ(e),i.updater=oL,e.stateNode=i,i._reactInternals=e,wW(e,n,t,r),e=_W(null,e,n,!0,a,r)):(e.tag=0,Pa&&a&&UQ(e),Dl(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(cP(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=tHe(n),t=$d(n,t),i){case 0:e=xW(null,e,n,t,r);break e;case 1:e=tse(null,e,n,t,r);break e;case 11:e=Joe(null,e,n,t,r);break e;case 14:e=ese(null,e,n,$d(n.type,t),r);break e}throw Error(Tt(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:$d(n,i),xW(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:$d(n,i),tse(t,e,n,i,r);case 3:e:{if(H_e(e),t===null)throw Error(Tt(387));n=e.pendingProps,a=e.memoizedState,i=a.element,g_e(t,e),zM(e,n,null,r);var o=e.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=W3(Error(Tt(423)),e),e=rse(t,e,n,r,i);break e}else if(n!==i){i=W3(Error(Tt(424)),e),e=rse(t,e,n,r,i);break e}else for(au=i1(e.stateNode.containerInfo.firstChild),du=e,Pa=!0,Gd=null,r=h_e(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(H3(),n===i){e=Hg(t,e,r);break e}Dl(t,e,n,r)}e=e.child}return e;case 5:return v_e(e),t===null&&vW(e),n=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,o=i.children,fW(n,i)?o=null:a!==null&&fW(n,a)&&(e.flags|=32),z_e(t,e),Dl(t,e,o,r),e.child;case 6:return t===null&&vW(e),null;case 13:return V_e(t,e,r);case 4:return KQ(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=V3(e,null,n,r):Dl(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:$d(n,i),Joe(t,e,n,i,r);case 7:return Dl(t,e,e.pendingProps,r),e.child;case 8:return Dl(t,e,e.pendingProps.children,r),e.child;case 12:return Dl(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,a=e.memoizedProps,o=i.value,ia(jM,n._currentValue),n._currentValue=o,a!==null)if(uh(a.value,o)){if(a.children===i.children&&!Ac.current){e=Hg(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=kg(-1,r&-r),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),mW(a.return,r,e),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Tt(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),mW(o,r,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Dl(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,l3(e,r),i=Uf(i),n=n(i),e.flags|=1,Dl(t,e,n,r),e.child;case 14:return n=e.type,i=$d(n,e.pendingProps),i=$d(n.type,i),ese(t,e,n,i,r);case 15:return j_e(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:$d(n,i),cP(t,e),e.tag=1,Tc(n)?(t=!0,$M(e)):t=!1,l3(e,r),$_e(e,n,i),wW(e,n,i,r),_W(null,e,n,!0,t,r);case 19:return G_e(t,e,r);case 22:return U_e(t,e,r)}throw Error(Tt(156,e.tag))};function s3e(t,e){return Dxe(t,e)}function eHe(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nf(t,e,r,n){return new eHe(t,e,r,n)}function uX(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tHe(t){if(typeof t=="function")return uX(t)?1:0;if(t!=null){if(t=t.$$typeof,t===kQ)return 11;if(t===PQ)return 14}return 2}function l1(t,e){var r=t.alternate;return r===null?(r=Nf(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function dP(t,e,r,n,i,a){var o=2;if(n=t,typeof t=="function")uX(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case M_:return ob(r.children,i,a,e);case IQ:o=8,i|=8;break;case HG:return t=Nf(12,r,e,i|2),t.elementType=HG,t.lanes=a,t;case VG:return t=Nf(13,r,e,i),t.elementType=VG,t.lanes=a,t;case GG:return t=Nf(19,r,e,i),t.elementType=GG,t.lanes=a,t;case vxe:return cL(r,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case pxe:o=10;break e;case gxe:o=9;break e;case kQ:o=11;break e;case PQ:o=14;break e;case fm:o=16,n=null;break e}throw Error(Tt(130,t==null?t:typeof t,""))}return e=Nf(o,r,e,i),e.elementType=t,e.type=n,e.lanes=a,e}function ob(t,e,r,n){return t=Nf(7,t,n,e),t.lanes=r,t}function cL(t,e,r,n){return t=Nf(22,t,n,e),t.elementType=vxe,t.lanes=r,t.stateNode={isHidden:!1},t}function Zj(t,e,r){return t=Nf(6,t,null,e),t.lanes=r,t}function Qj(t,e,r){return e=Nf(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function rHe(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rj(0),this.expirationTimes=Rj(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rj(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fX(t,e,r,n,i,a,o,s,l){return t=new rHe(t,e,r,s,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Nf(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},YQ(a),t}function nHe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f3e)}catch(t){console.error(t)}}f3e(),uxe.exports=Tu;var gX=uxe.exports;const d3e=Un(gX);var h3e={exports:{}},p3e={};/** - * @license React - * use-sync-external-store-with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var QE=Z;function lHe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var cHe=typeof Object.is=="function"?Object.is:lHe,uHe=QE.useSyncExternalStore,fHe=QE.useRef,dHe=QE.useEffect,hHe=QE.useMemo,pHe=QE.useDebugValue;p3e.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var a=fHe(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=hHe(function(){function l(h){if(!c){if(c=!0,u=h,h=n(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,cHe(u,h))return p;var g=n(h);return i!==void 0&&i(p,g)?p:(u=h,f=g)}var c=!1,u,f,d=r===void 0?null:r;return[function(){return l(e())},d===null?void 0:function(){return l(d())}]},[e,r,n,i]);var s=uHe(t,a[0],a[1]);return dHe(function(){o.hasValue=!0,o.value=s},[s]),pHe(s),s};h3e.exports=p3e;var gHe=h3e.exports,ou="default"in loe?Re:loe,pse=Symbol.for("react-redux-context"),gse=typeof globalThis<"u"?globalThis:{};function vHe(){if(!ou.createContext)return{};const t=gse[pse]??(gse[pse]=new Map);let e=t.get(ou.createContext);return e||(e=ou.createContext(null),t.set(ou.createContext,e)),e}var C1=vHe(),mHe=()=>{throw new Error("uSES not initialized!")};function vX(t=C1){return function(){return ou.useContext(t)}}var g3e=vX(),v3e=mHe,yHe=t=>{v3e=t},wHe=(t,e)=>t===e;function bHe(t=C1){const e=t===C1?g3e:vX(t),r=(n,i={})=>{const{equalityFn:a=wHe,devModeChecks:o={}}=typeof i=="function"?{equalityFn:i}:i,{store:s,subscription:l,getServerState:c,stabilityCheck:u,identityFunctionCheck:f}=e();ou.useRef(!0);const d=ou.useCallback({[n.name](p){return n(p)}}[n.name],[n,u,o.stabilityCheck]),h=v3e(l.addNestedSub,s.getState,c||s.getState,d,a);return ou.useDebugValue(h),h};return Object.assign(r,{withTypes:()=>r}),r}var m3e=bHe();function y3e(t){t()}function xHe(){let t=null,e=null;return{clear(){t=null,e=null},notify(){y3e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=t;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=e={callback:r,next:null,prev:e};return i.prev?i.prev.next=i:t=i,function(){!n||t===null||(n=!1,i.next?i.next.prev=i.prev:e=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var vse={notify(){},get:()=>[]};function _He(t,e){let r,n=vse,i=0,a=!1;function o(g){u();const v=n.subscribe(g);let y=!1;return()=>{y||(y=!0,v(),f())}}function s(){n.notify()}function l(){p.onStateChange&&p.onStateChange()}function c(){return a}function u(){i++,r||(r=t.subscribe(l),n=xHe())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=vse)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return p}var SHe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",CHe=typeof navigator<"u"&&navigator.product==="ReactNative",AHe=SHe||CHe?ou.useLayoutEffect:ou.useEffect;function mse(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function QM(t,e){if(mse(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let i=0;i{const c=_He(t);return{store:t,subscription:c,getServerState:n?()=>n:void 0,stabilityCheck:i,identityFunctionCheck:a}},[t,n,i,a]),s=ou.useMemo(()=>t.getState(),[t]);AHe(()=>{const{subscription:c}=o;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==t.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[o,s]);const l=e||C1;return ou.createElement(l.Provider,{value:o},r)}var EHe=THe;function w3e(t=C1){const e=t===C1?g3e:vX(t),r=()=>{const{store:n}=e();return n};return Object.assign(r,{withTypes:()=>r}),r}var b3e=w3e();function IHe(t=C1){const e=t===C1?b3e:w3e(t),r=()=>e().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var x3e=IHe(),kHe=y3e;yHe(gHe.useSyncExternalStoreWithSelector);function sl(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n3?e.i-4:e.i:Array.isArray(t)?1:pL(t)?2:gL(t)?3:0}function c1(t,e){return T1(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function hP(t,e){return T1(t)===2?t.get(e):t[e]}function _3e(t,e,r){var n=T1(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function S3e(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function pL(t){return OHe&&t instanceof Map}function gL(t){return LHe&&t instanceof Set}function _w(t){return t.o||t.t}function mX(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=A3e(t);delete e[Ta];for(var r=u3(e),n=0;n1&&(t.set=t.add=t.clear=t.delete=PHe),Object.freeze(t),e&&A1(t,function(r,n){return yX(n,!0)},!0)),t}function PHe(){sl(2)}function wX(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function kp(t){var e=$W[t];return e||sl(18,t),e}function C3e(t,e){$W[t]||($W[t]=e)}function NW(){return j6}function Xj(t,e){e&&(kp("Patches"),t.u=[],t.s=[],t.v=e)}function XM(t){OW(t),t.p.forEach(RHe),t.p=null}function OW(t){t===j6&&(j6=t.l)}function yse(t){return j6={p:[],l:j6,h:t,m:!0,_:0}}function RHe(t){var e=t[Ta];e.i===0||e.i===1?e.j():e.g=!0}function Jj(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||kp("ES5").S(e,t,n),n?(r[Ta].P&&(XM(e),sl(4)),qp(t)&&(t=JM(e,t),e.l||eD(e,t)),e.u&&kp("Patches").M(r[Ta].t,t,e.u,e.s)):t=JM(e,r,[]),XM(e),e.u&&e.v(e.u,e.s),t!==xX?t:void 0}function JM(t,e,r){if(wX(e))return e;var n=e[Ta];if(!n)return A1(e,function(s,l){return wse(t,n,e,s,l,r)},!0),e;if(n.A!==t)return e;if(!n.P)return eD(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=mX(n.k):n.o,a=i,o=!1;n.i===3&&(a=new Set(i),i.clear(),o=!0),A1(a,function(s,l){return wse(t,n,i,s,l,r,o)}),eD(t,i,!1),r&&t.u&&kp("Patches").N(n,r,t.u,t.s)}return n.o}function wse(t,e,r,n,i,a,o){if(Vg(i)){var s=JM(t,i,a&&e&&e.i!==3&&!c1(e.R,n)?a.concat(n):void 0);if(_3e(r,n,s),!Vg(s))return;t.m=!1}else o&&r.add(i);if(qp(i)&&!wX(i)){if(!t.h.D&&t._<1)return;JM(t,i),e&&e.A.l||eD(t,i)}}function eD(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&yX(e,r)}function eU(t,e){var r=t[Ta];return(r?_w(r):t)[e]}function bse(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Cm(t){t.P||(t.P=!0,t.l&&Cm(t.l))}function tU(t){t.o||(t.o=mX(t.t))}function LW(t,e,r){var n=pL(e)?kp("MapSet").F(e,r):gL(e)?kp("MapSet").T(e,r):t.O?function(i,a){var o=Array.isArray(i),s={i:o?1:0,A:a?a.A:NW(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},l=s,c=U6;o&&(l=[s],c=rA);var u=Proxy.revocable(l,c),f=u.revoke,d=u.proxy;return s.k=d,s.j=f,d}(e,r):kp("ES5").J(e,r);return(r?r.A:NW()).p.push(n),n}function MHe(t){return Vg(t)||sl(22,t),function e(r){if(!qp(r))return r;var n,i=r[Ta],a=T1(r);if(i){if(!i.P&&(i.i<4||!kp("ES5").K(i)))return i.t;i.I=!0,n=xse(r,a),i.I=!1}else n=xse(r,a);return A1(n,function(o,s){i&&hP(i.t,o)===s||_3e(n,o,e(s))}),a===3?new Set(n):n}(t)}function xse(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return mX(t)}function DHe(){function t(a,o){var s=i[a];return s?s.enumerable=o:i[a]=s={configurable:!0,enumerable:o,get:function(){var l=this[Ta];return U6.get(l,a)},set:function(l){var c=this[Ta];U6.set(c,a,l)}},s}function e(a){for(var o=a.length-1;o>=0;o--){var s=a[o][Ta];if(!s.P)switch(s.i){case 5:n(s)&&Cm(s);break;case 4:r(s)&&Cm(s)}}}function r(a){for(var o=a.t,s=a.k,l=u3(s),c=l.length-1;c>=0;c--){var u=l[c];if(u!==Ta){var f=o[u];if(f===void 0&&!c1(o,u))return!0;var d=s[u],h=d&&d[Ta];if(h?h.t!==f:!S3e(d,f))return!0}}var p=!!o[Ta];return l.length!==u3(o).length+(p?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var s=Object.getOwnPropertyDescriptor(o,o.length-1);if(s&&!s.get)return!0;for(var l=0;l1?y-1:0),b=1;b1?u-1:0),d=1;d=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}i>-1&&(n=n.slice(i+1));var o=kp("Patches").$;return Vg(r)?o(r,n):this.produce(r,function(s){return o(s,n)})},t}(),vu=new BHe,f3=vu.produce,FHe=vu.produceWithPatches.bind(vu);vu.setAutoFreeze.bind(vu);vu.setUseProxies.bind(vu);var jHe=vu.applyPatches.bind(vu);vu.createDraft.bind(vu);vu.finishDraft.bind(vu);function z6(t){"@babel/helpers - typeof";return z6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z6(t)}function UHe(t,e){if(z6(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(z6(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zHe(t){var e=UHe(t,"string");return z6(e)=="symbol"?e:e+""}function HHe(t,e,r){return(e=zHe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Cse(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ase(t){for(var e=1;e"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(tl(1));return r(T3e)(t,e)}if(typeof t!="function")throw new Error(tl(2));var i=t,a=e,o=[],s=o,l=!1;function c(){s===o&&(s=o.slice())}function u(){if(l)throw new Error(tl(3));return a}function f(g){if(typeof g!="function")throw new Error(tl(4));if(l)throw new Error(tl(5));var v=!0;return c(),s.push(g),function(){if(v){if(l)throw new Error(tl(6));v=!1,c();var m=s.indexOf(g);s.splice(m,1),o=null}}}function d(g){if(!VHe(g))throw new Error(tl(7));if(typeof g.type>"u")throw new Error(tl(8));if(l)throw new Error(tl(9));try{l=!0,a=i(a,g)}finally{l=!1}for(var v=o=s,y=0;y"u")throw new Error(tl(12));if(typeof r(void 0,{type:tD.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(tl(13))})}function E3e(t){for(var e=Object.keys(t),r={},n=0;n"u")throw c&&c.type,new Error(tl(14));f[h]=v,u=u||v!==g}return u=u||a.length!==Object.keys(l).length,u?f:l}}function H6(){for(var t=arguments.length,e=new Array(t),r=0;r-1){var c=r[l];return l>0&&(r.splice(l,1),r.unshift(c)),c.value}return rD}function i(s,l){n(s)===rD&&(r.unshift({key:s,value:l}),r.length>t&&r.pop())}function a(){return r}function o(){r=[]}return{get:n,put:i,getEntries:a,clear:o}}var KHe=function(e,r){return e===r};function ZHe(t){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;for(var i=r.length,a=0;a1?e-1:0),n=1;n0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]"u"?p:y}else{if(qp(p))return f3(p,function(m){return g(m,d)});var y=g(p,d);if(typeof y>"u"){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}return p},f)}return u.getInitialState=l,u}function vVe(t,e){return t+"/"+e}function mo(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var r=typeof t.initialState=="function"?t.initialState:f3(t.initialState,function(){}),n=t.reducers||{},i=Object.keys(n),a={},o={},s={};i.forEach(function(u){var f=n[u],d=vVe(e,u),h,p;"reducer"in f?(h=f.reducer,p=f.prepare):h=f,a[u]=h,o[d]=h,s[u]=p?Ic(d,p):Ic(d)});function l(){var u=typeof t.extraReducers=="function"?k3e(t.extraReducers):[t.extraReducers],f=u[0],d=f===void 0?{}:f,h=u[1],p=h===void 0?[]:h,g=u[2],v=g===void 0?void 0:g,y=u1(u1({},d),o);return gVe(r,y,p,v)}var c;return{name:e,reducer:function(u,f){return c||(c=l()),c(u,f)},actions:s,caseReducers:a,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}var mVe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",P3e=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=mVe[Math.random()*64|0];return e},yVe=["name","message","stack","code"],iU=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),kse=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),wVe=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=yVe;r-1;return r&&n}function JE(t){return typeof t[0]=="function"&&"pending"in t[0]&&"fulfilled"in t[0]&&"rejected"in t[0]}function _X(){for(var t=[],e=0;e`(min-width: ${Y3[t]}px)`,CVe=t=>`(max-width: ${Y3[t]}px)`,AVe=t=>`(min-width: ${Y3[t]}px) and (max-width: ${Y3[t]}px)`,TVe=(t,e)=>`(min-width: ${Y3[t]}px) and (max-width: ${Y3[e]-1}px)`,_t={up:SVe,down:CVe,only:AVe,between:TVe},EVe=1e6,an={ACCOUNT:"ACCOUNT",ADMIN:"ADMIN",APPS:"APPS",BACK_ARROW:"BACK_ARROW",CALENDAR:"CALENDAR",CALL_MADE:"CALL_MADE",CARET:"CARET",CHECK:"CHECK",CHEVRON:"CHEVRON",CLEAR:"CLEAR",CLOSE:"CLOSE",CUBES:"CUBES",DATA_OBJECT:"DATA_OBJECT",DISCORD:"DISCORD",FIGURE:"FIGURE",GITHUB:"GITHUB",HASH:"HASH",HELP:"HELP",HELP_OUTLINE:"HELP_OUTLINE",IN_PROGRESS:"IN_PROGRESS",INVENTORY:"INVENTORY",KEY:"KEY",LINE_CHART:"LINE_CHART",LOGO:"LOGO",LOGOUT:"LOGOUT",MEGAPHONE:"MEGAPHONE",MENU:"MENU",MOON:"MOON",PARTICIPATION:"PARTICIPATION",PROVENANCE:"PROVENANCE",PENDING:"PENDING",PRICE:"PRICE",RAINBOW:"RAINBOW",REPORTS:"REPORTS",SEARCH:"SEARCH",SETTINGS:"SETTINGS",SHARED_POOLS:"SHARED_POOLS",SLACK:"SLACK",SUN:"SUN",TRASH:"TRASH",UPGRADE:"UPGRADE",WARNING:"WARNING"},uc={ASSETS_URL:"/assets",DASHBOARD_URL:"/dashboard",FAUCET_URL:"/faucet",CONTRACTS_URL:"/contracts",IBC_URL:"/ibc",GOV_URL:"/proposals",HOME_URL:"/",STAKING_URL:"/validators",TRANSFER_URL:"/txs",GAS_URL:"/network/gas",NAME_TREE_URL:"/network/name-tree",PARAMS_URL:"/network/params",TOKEN_STATS_URL:"/network/token-stats",UPGRADES_URL:"/network/upgrades"},Fm={dashboard:{url:uc.DASHBOARD_URL,title:"Dashboard"},staking:{url:uc.STAKING_URL,title:"Validators"},transfer:{url:uc.TRANSFER_URL,title:"Transactions"},assets:{url:uc.ASSETS_URL,title:"Assets"},gov:{url:uc.GOV_URL,title:"Gov"},ibc:{url:uc.IBC_URL,title:"IBC"},contracts:{url:uc.CONTRACTS_URL,title:"Contracts"},network:{url:"",title:"Network",subMenu:{versions:{url:uc.UPGRADES_URL,title:"Upgrades"},params:{url:uc.PARAMS_URL,title:"Chain Parameters"},gas:{url:uc.GAS_URL,title:"Gas Statistics"},token_stats:{url:uc.TOKEN_STATS_URL,title:"Token Statistics"},name_tree:{url:uc.NAME_TREE_URL,title:"Name Tree"}}}},Ca={DELEGATE:"delegate",REDELEGATE:"redelegate",UNDELEGATE:"undelegate",CLAIM:"claim rewards"},IVe=5,Mw={UNSPECIFIED:"--",YES:"yes",ABSTAIN:"abstain",NO:"no",NO_WITH_VETO:"no with veto"},kVe={[Ca.DELEGATE]:{isDefault:!0,title:"Delegate"},[Ca.REDELEGATE]:{title:"Redelegate"},[Ca.UNDELEGATE]:{title:"Undelegate"}};Mw.UNSPECIFIED+"",Mw.YES+"",Mw.ABSTAIN+"",Mw.NO+"",Mw.NO_WITH_VETO+"";const PVe={active:{isDefault:!0,title:"Active"},candidate:{title:"Candidate"},jailed:{title:"Jailed"}},yL={all:{title:"All",isDefault:!0},success:{title:"Success"},failure:{title:"Failure"}},M3e={day:{title:"Day",isDefault:!0},hour:{title:"Hour"}},RVe=window.location.host==="www.figuremarkets.com"||window.location.host==="figuremarkets.com",iS={blockSpotlight:5e3,dailyPrice:9e4,latestPrice:3e5,recentBlocks:1e4,recentTxs:3e4,totalAum:1e6,notifications:RVe?9e5:6e4},Pse={TEXT:"text",SOFTWARE_UPGRADE:"software upgrade",CANCEL_SOFTWARE_UPGRADE:"cancel upgrade",STORE_CODE:"store code"},MVe={ACCESS_TYPE_UNSPECIFIED:"ACCESS_TYPE_UNSPECIFIED",ACCESS_TYPE_NOBODY:"ACCESS_TYPE_NOBODY",ACCESS_TYPE_ONLY_ADDRESS:"ACCESS_TYPE_ONLY_ADDRESS",ACCESS_TYPE_EVERYBODY:"ACCESS_TYPE_EVERYBODY"};let dn="",Vo="",D3e="";dn="https://service-explorer.test.provenance.io/api/v2",Vo="https://service-explorer.test.provenance.io/api/v3",D3e="https://test.provenance.io/blockchain/faucet/external";const Co=`${dn}/accounts`,H_=`${Vo}/accounts`,CX=`${dn}/assets`,DVe=`${dn}/assets/all`,NVe=`${Vo}/utility_token/distribution`,OVe=`${dn}/blocks/height`,LVe=`${dn}/blocks/height`,$Ve=`${dn}/blocks/recent`,BVe=`${dn}/spotlight`,FVe=`${dn}/chain/id`,jVe=`${dn}/chain/prefixes`,N3e=`${dn}/smart_contract/code`,UVe=`${dn}/smart_contract/codes/all`,O3e=`${dn}/smart_contract/contract`,zVe=`${dn}/smart_contract/contract/all`,L3e=`${dn}/txs/module/smart_contract?`,HVe=`${dn}/smart_contract/contract/labels`,VVe=`${dn}/gov/address`,AX=`${dn}/gov/proposals`,GVe=`${Vo}/gov/proposals`,WVe=`${Vo}/gov/submit/`,qVe=`${Vo}/gov/vote`,YVe=`${Vo}/gov/types/supported`,KVe=`${Vo}/grants/authz`,ZVe=`${Vo}/grants/feegrant`,QVe=`${dn}/ibc/balances/chain`,XVe=`${dn}/ibc/balances/channel`,JVe=`${dn}/ibc/balances/denom`,eGe=`${dn}/ibc/channels/src_port/`,tGe=`${dn}/ibc/channels/status`,rGe=`${dn}/ibc/denoms/all`,nGe=`${Vo}/utility_token/historical_pricing`,iGe=`${Vo}/utility_token/latest_pricing`,aGe=`${dn}/names/tree`,TX=`${dn}/nft/scope`,oGe=`${dn}/notifications/proposals`,sGe=`${dn}/notifications/upgrades`,$3e=`${dn}/notifications/announcement/all`,lGe=`${dn}/notifications/announcement`,cGe="https://github.com/provenance-io/explorer-frontend",uGe="https://provenance.io/",fGe="https://discord.com/invite/kNZC8nwCFP",dGe=`${Vo}/staking/delegate`,hGe=`${Vo}/staking/redelegate`,pGe=`${Vo}/staking/undelegate`,gGe=`${Vo}/staking/withdraw_commission`,vGe=`${Vo}/staking/withdraw_rewards`,mGe=`${dn}/chain/upgrades`,yGe=`${dn}/gas/stats`,wGe=`${dn}/gas/volume`,bGe=`${dn}/params`,xGe=`${Vo}/utility_token/stats`,_Ge=`${Vo}/utility_token/total_supply`,g0=`${dn}/txs`,B3e=`${Vo}/txs`,SGe=`${dn}/txs/recent`,CGe=`${dn}/txs/history`,AGe=`${dn}/txs/height`,F3e=`${dn}/txs/address`,TGe=`${dn}/txs/types`,EGe=`${dn}/txs/heatmap`,wL=`${dn}/validators`,j3e=`${dn}/validators/recent`,IGe=`${dn}/validators/recent/abbrev`,kGe=`${dn}/validators/height`,UW={eigengrau:"Skipped due to a migration error. Start `provenanced` with the `--unsafe-skip-upgrades=3417970` to bypass"};var bL=function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]"u"||navigator.onLine===void 0?!0:navigator.onLine}function FGe(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var Nse=XE;function H3e(t,e){if(t===e||!(Nse(t)&&Nse(e)||Array.isArray(t)&&Array.isArray(e)))return e;for(var r=Object.keys(e),n=Object.keys(t),i=r.length===n.length,a=Array.isArray(e)?[]:{},o=0,s=r;o=200&&t.status<=299},UGe=function(t){var e,r;return(r=(e=t.get("content-type"))==null?void 0:e.trim())==null?void 0:r.startsWith("application/json")},zGe=function(t,e){return xL(void 0,null,function(){var r;return bL(this,function(n){switch(n.label){case 0:return typeof e=="function"?[2,e(t)]:e==="text"?[2,t.text()]:e!=="json"?[3,2]:[4,t.text()];case 1:return r=n.sent(),[2,r.length?JSON.parse(r):null];case 2:return[2]}})})};function Lse(t){if(!XE(t))return t;for(var e=Oo({},t),r=0,n=Object.entries(e);r"u"&&delete e[a]}return e}function HGe(t){var e=this;t===void 0&&(t={});var r=t,n=r.baseUrl,i=r.prepareHeaders,a=i===void 0?function(u){return u}:i,o=r.fetchFn,s=o===void 0?Ose:o,l=r.paramsSerializer,c=Mse(r,["baseUrl","prepareHeaders","fetchFn","paramsSerializer"]);return typeof fetch>"u"&&s===Ose&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(u,f){return xL(e,null,function(){var d,h,p,g,v,y,m,b,w,C,A,S,I,D,L,O,P,x,T,E,N,F,B,j,k,$,H,Y,ie,W,Q,J,ee,ne,V,oe;return bL(this,function(ye){switch(ye.label){case 0:return d=f.signal,h=f.getState,p=f.extra,g=f.endpoint,v=f.forced,y=f.type,b=typeof u=="string"?{url:u}:u,w=b.url,C=b.method,A=C===void 0?"GET":C,S=b.headers,I=S===void 0?new Headers({}):S,D=b.body,L=D===void 0?void 0:D,O=b.params,P=O===void 0?void 0:O,x=b.responseHandler,T=x===void 0?"json":x,E=b.validateStatus,N=E===void 0?jGe:E,F=Mse(b,["url","method","headers","body","params","responseHandler","validateStatus"]),B=Oo(f1(Oo({},c),{method:A,signal:d,body:L}),F),j=B,[4,a(new Headers(Lse(I)),{getState:h,extra:p,endpoint:g,forced:v,type:y})];case 1:j.headers=ye.sent(),k=function(Te){return typeof Te=="object"&&(XE(Te)||Array.isArray(Te)||typeof Te.toJSON=="function")},!B.headers.has("content-type")&&k(L)&&B.headers.set("content-type","application/json"),L&&UGe(B.headers)&&(B.body=JSON.stringify(L)),P&&($=~w.indexOf("?")?"&":"?",H=l?l(P):new URLSearchParams(Lse(P)),w+=$+H),w=$Ge(n,w),Y=new Request(w,B),ie=Y.clone(),m={request:ie},ye.label=2;case 2:return ye.trys.push([2,4,,5]),[4,s(Y)];case 3:return W=ye.sent(),[3,5];case 4:return Q=ye.sent(),[2,{error:{status:"FETCH_ERROR",error:String(Q)},meta:m}];case 5:J=W.clone(),m.response=J,ne="",ye.label=6;case 6:return ye.trys.push([6,8,,9]),[4,Promise.all([zGe(W,T).then(function(Te){return ee=Te},function(Te){return V=Te}),J.text().then(function(Te){return ne=Te},function(){})])];case 7:if(ye.sent(),V)throw V;return[3,9];case 8:return oe=ye.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:W.status,data:ne,error:String(oe)},meta:m}];case 9:return[2,N(W,ee)?{data:ee,meta:m}:{error:{status:W.status,data:ee},meta:m}]}})})}}var $se=function(){function t(e,r){r===void 0&&(r=void 0),this.value=e,this.meta=r}return t}(),EX=Ic("__rtkq/focused"),V3e=Ic("__rtkq/unfocused"),IX=Ic("__rtkq/online"),G3e=Ic("__rtkq/offline"),fh;(function(t){t.query="query",t.mutation="mutation"})(fh||(fh={}));function VGe(t){return t.type===fh.query}function GGe(t){return t.type===fh.mutation}function W3e(t,e,r,n,i,a){return WGe(t)?t(e,r,n,i).map(zW).map(a):Array.isArray(t)?t.map(zW).map(a):[]}function WGe(t){return typeof t=="function"}function zW(t){return typeof t=="string"?{type:t}:t}function qGe(t){return t}function YGe(t){var e=this,r=t.reducerPath,n=t.baseQuery,i=t.context.endpointDefinitions,a=t.serializeQueryArgs,o=t.api,s=function(m,b,w){return function(C){var A=i[m];C(o.internalActions.queryResultPatched({queryCacheKey:a({queryArgs:b,endpointDefinition:A,endpointName:m}),patches:w}))}},l=function(m,b,w){return function(C,A){var S,I,D=o.endpoints[m].select(b)(A()),L={patches:[],inversePatches:[],undo:function(){return C(o.util.patchQueryData(m,b,L.inversePatches))}};if(D.status===Ea.uninitialized)return L;if("data"in D)if(qp(D.data)){var O=FHe(D.data,w),P=O[1],x=O[2];(S=L.patches).push.apply(S,P),(I=L.inversePatches).push.apply(I,x)}else{var T=w(D.data);L.patches.push({op:"replace",path:[],value:T}),L.inversePatches.push({op:"replace",path:[],value:D.data})}return C(o.util.patchQueryData(m,b,L.patches)),L}},c=function(m,b){return xL(e,[m,b],function(w,C){var A,S,I,D,L,O,P,x,T,E,N,F=C.signal,B=C.rejectWithValue,j=C.fulfillWithValue,k=C.dispatch,$=C.getState,H=C.extra;return bL(this,function(Y){switch(Y.label){case 0:A=i[w.endpointName],Y.label=1;case 1:return Y.trys.push([1,7,,8]),S=qGe,I=void 0,D={signal:F,dispatch:k,getState:$,extra:H,endpoint:w.endpointName,type:w.type,forced:w.type==="query"?u(w,$()):void 0},A.query?[4,n(A.query(w.originalArgs),D,A.extraOptions)]:[3,3];case 2:return I=Y.sent(),A.transformResponse&&(S=A.transformResponse),[3,5];case 3:return[4,A.queryFn(w.originalArgs,D,A.extraOptions,function(ie){return n(ie,D,A.extraOptions)})];case 4:I=Y.sent(),Y.label=5;case 5:if(typeof process<"u",I.error)throw new $se(I.error,I.meta);return E=j,[4,S(I.data,I.meta,w.originalArgs)];case 6:return[2,E.apply(void 0,[Y.sent(),{fulfilledTimeStamp:Date.now(),baseQueryMeta:I.meta}])];case 7:if(N=Y.sent(),N instanceof $se)return[2,B(N.value,{baseQueryMeta:N.meta})];throw typeof process<"u",console.error(N),N;case 8:return[2]}})})};function u(m,b){var w,C,A,S,I=(C=(w=b[r])==null?void 0:w.queries)==null?void 0:C[m.queryCacheKey],D=(A=b[r])==null?void 0:A.config.refetchOnMountOrArgChange,L=I==null?void 0:I.fulfilledTimeStamp,O=(S=m.forceRefetch)!=null?S:m.subscribe&&D;return O?O===!0||(Number(new Date)-Number(L))/1e3>=O:!1}var f=Bt(r+"/executeQuery",c,{getPendingMeta:function(){return{startedTimeStamp:Date.now()}},condition:function(m,b){var w=b.getState,C,A,S=w(),I=(A=(C=S[r])==null?void 0:C.queries)==null?void 0:A[m.queryCacheKey],D=I==null?void 0:I.fulfilledTimeStamp;return(I==null?void 0:I.status)==="pending"?!1:u(m,S)?!0:!D},dispatchConditionRejection:!0}),d=Bt(r+"/executeMutation",c,{getPendingMeta:function(){return{startedTimeStamp:Date.now()}}}),h=function(m){return"force"in m},p=function(m){return"ifOlderThan"in m},g=function(m,b,w){return function(C,A){var S=h(w)&&w.force,I=p(w)&&w.ifOlderThan,D=function(x){return x===void 0&&(x=!0),o.endpoints[m].initiate(b,{forceRefetch:x})},L=o.endpoints[m].select(b)(A());if(S)C(D());else if(I){var O=L==null?void 0:L.fulfilledTimeStamp;if(!O){C(D());return}var P=(Number(new Date)-Number(new Date(O)))/1e3>=I;P&&C(D())}else C(D(!1))}};function v(m){return function(b){var w,C;return((C=(w=b==null?void 0:b.meta)==null?void 0:w.arg)==null?void 0:C.endpointName)===m}}function y(m,b){return{matchPending:MA(_X(m),v(b)),matchFulfilled:MA(N2(m),v(b)),matchRejected:MA(V6(m),v(b))}}return{queryThunk:f,mutationThunk:d,prefetch:g,updateQueryData:l,patchQueryData:s,buildMatchThunkActions:y}}function q3e(t,e,r,n){return W3e(r[t.meta.arg.endpointName][e],N2(t)?t.payload:void 0,mL(t)?t.payload:void 0,t.meta.arg.originalArgs,"baseQueryMeta"in t.meta?t.meta.baseQueryMeta:void 0,n)}function UI(t,e,r){var n=t[e];n&&r(n)}function G6(t){var e;return(e="arg"in t?t.arg.fixedCacheKey:t.fixedCacheKey)!=null?e:t.requestId}function Bse(t,e,r){var n=t[G6(e)];n&&r(n)}var zI={};function KGe(t){var e=t.reducerPath,r=t.queryThunk,n=t.mutationThunk,i=t.context,a=i.endpointDefinitions,o=i.apiUid,s=i.extractRehydrationInfo,l=i.hasRehydrationInfo,c=t.assertTagType,u=t.config,f=Ic(e+"/resetApiState"),d=mo({name:e+"/queries",initialState:zI,reducers:{removeQueryResult:function(w,C){var A=C.payload.queryCacheKey;delete w[A]},queryResultPatched:function(w,C){var A=C.payload,S=A.queryCacheKey,I=A.patches;UI(w,S,function(D){D.data=jHe(D.data,I.concat())})}},extraReducers:function(w){w.addCase(r.pending,function(C,A){var S=A.meta,I=A.meta.arg,D,L;I.subscribe&&((L=C[D=I.queryCacheKey])!=null||(C[D]={status:Ea.uninitialized,endpointName:I.endpointName})),UI(C,I.queryCacheKey,function(O){O.status=Ea.pending,O.requestId=S.requestId,I.originalArgs!==void 0&&(O.originalArgs=I.originalArgs),O.startedTimeStamp=S.startedTimeStamp})}).addCase(r.fulfilled,function(C,A){var S=A.meta,I=A.payload;UI(C,S.arg.queryCacheKey,function(D){var L;D.requestId===S.requestId&&(D.status=Ea.fulfilled,D.data=(L=a[S.arg.endpointName].structuralSharing)==null||L?H3e(D.data,I):I,delete D.error,D.fulfilledTimeStamp=S.fulfilledTimeStamp)})}).addCase(r.rejected,function(C,A){var S=A.meta,I=S.condition,D=S.arg,L=S.requestId,O=A.error,P=A.payload;UI(C,D.queryCacheKey,function(x){if(!I){if(x.requestId!==L)return;x.status=Ea.rejected,x.error=P??O}})}).addMatcher(l,function(C,A){for(var S=s(A).queries,I=0,D=Object.entries(S);I{const r=e().app.authToken;return r&&t.set("authorization",`Bearer ${r}`),t}}),E1=TWe({reducerPath:"serviceApi",baseQuery:EWe,endpoints:()=>({})}),IWe=E1.injectEndpoints({endpoints:t=>({getVestingData:t.query({async queryFn({address:e},r,n,i){const{data:a,error:o}=await i(`${Co}/${e}`);let s={error:{status:500,statusText:"Account is not a vesting account",data:{accountInfo:a}}};return a.isVesting&&!o&&(s=await i(`${H_}/${e}/vesting`)),s}}),getDenomAmount:t.query({query:({address:e,denom:r})=>`${H_}/${e}/balances/${r}`}),getUtilityTokenAmount:t.query({query:({address:e})=>`${H_}/${e}/balances/utility_token`}),getUnbondings:t.query({query:({address:e})=>`${Co}/${e}/unbonding`}),getDelegations:t.query({query:({address:e})=>`${Co}/${e}/delegations`}),getRedelegations:t.query({query:({address:e})=>`${Co}/${e}/redelegations`}),getRewards:t.query({query:({address:e})=>`${Co}/${e}/rewards`}),getHashData:t.query({async queryFn({address:e},r,n,i){const{data:a,error:o}=await i(`${H_}/${e}/balances/utility_token`),{data:s,error:l}=await i(`${Co}/${e}/delegations`),{data:c,error:u}=await i(`${Co}/${e}/redelegations`),{data:f,error:d}=await i(`${Co}/${e}/unbonding`),{data:h,error:p}=await i(`${Co}/${e}/rewards`),g={assets:{...a},delegations:{...s},redelegations:{...c},unbonding:{...f},rewards:{...h}};return!o&&!l&&!u&&!d&&!p?{data:g}:{error:{status:500,statusText:"Internal Server Error",data:{delegationsError:l,hashDataError:o,redelegationsError:u,unbondingsError:d,rewardsError:p}}}}})})}),{useGetVestingDataQuery:kWe,useGetDenomAmountQuery:kxr,useGetUtilityTokenAmountQuery:Pxr,useGetUnbondingsQuery:Rxr,useGetDelegationsQuery:Mxr,useGetRedelegationsQuery:Dxr,useGetRewardsQuery:Nxr,useGetHashDataQuery:PWe}=IWe,RWe=E1.injectEndpoints({endpoints:t=>({getChaincodeId:t.query({query:()=>({url:`${FVe}`,responseHandler:e=>e.text()})}),getChaincodePrefixes:t.query({query:()=>({url:`${jVe}`})})})}),{useGetChaincodeIdQuery:MWe,useGetChaincodePrefixesQuery:DWe}=RWe;var K3e={},Z3e=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Q3e="%[a-f0-9]{2}",Vse=new RegExp("("+Q3e+")|([^%]+?)","gi"),Gse=new RegExp("("+Q3e+")+","gi");function HW(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],HW(r),HW(n))}function NWe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Vse)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},e5e=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),a=0;am==null,o=Symbol("encodeFragmentIdentifier");function s(m){switch(m.arrayFormat){case"index":return b=>(w,C)=>{const A=w.length;return C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,[u(b,m),"[",A,"]"].join("")]:[...w,[u(b,m),"[",u(A,m),"]=",u(C,m)].join("")]};case"bracket":return b=>(w,C)=>C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,[u(b,m),"[]"].join("")]:[...w,[u(b,m),"[]=",u(C,m)].join("")];case"comma":case"separator":case"bracket-separator":{const b=m.arrayFormat==="bracket-separator"?"[]=":"=";return w=>(C,A)=>A===void 0||m.skipNull&&A===null||m.skipEmptyString&&A===""?C:(A=A===null?"":A,C.length===0?[[u(w,m),b,u(A,m)].join("")]:[[C,u(A,m)].join(m.arrayFormatSeparator)])}default:return b=>(w,C)=>C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,u(b,m)]:[...w,[u(b,m),"=",u(C,m)].join("")]}}function l(m){let b;switch(m.arrayFormat){case"index":return(w,C,A)=>{if(b=/\[(\d*)\]$/.exec(w),w=w.replace(/\[\d*\]$/,""),!b){A[w]=C;return}A[w]===void 0&&(A[w]={}),A[w][b[1]]=C};case"bracket":return(w,C,A)=>{if(b=/(\[\])$/.exec(w),w=w.replace(/\[\]$/,""),!b){A[w]=C;return}if(A[w]===void 0){A[w]=[C];return}A[w]=[].concat(A[w],C)};case"comma":case"separator":return(w,C,A)=>{const S=typeof C=="string"&&C.includes(m.arrayFormatSeparator),I=typeof C=="string"&&!S&&f(C,m).includes(m.arrayFormatSeparator);C=I?f(C,m):C;const D=S||I?C.split(m.arrayFormatSeparator).map(L=>f(L,m)):C===null?C:f(C,m);A[w]=D};case"bracket-separator":return(w,C,A)=>{const S=/(\[\])$/.test(w);if(w=w.replace(/\[\]$/,""),!S){A[w]=C&&f(C,m);return}const I=C===null?[]:C.split(m.arrayFormatSeparator).map(D=>f(D,m));if(A[w]===void 0){A[w]=I;return}A[w]=[].concat(A[w],I)};default:return(w,C,A)=>{if(A[w]===void 0){A[w]=C;return}A[w]=[].concat(A[w],C)}}}function c(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(m,b){return b.encode?b.strict?e(m):encodeURIComponent(m):m}function f(m,b){return b.decode?r(m):m}function d(m){return Array.isArray(m)?m.sort():typeof m=="object"?d(Object.keys(m)).sort((b,w)=>Number(b)-Number(w)).map(b=>m[b]):m}function h(m){const b=m.indexOf("#");return b!==-1&&(m=m.slice(0,b)),m}function p(m){let b="";const w=m.indexOf("#");return w!==-1&&(b=m.slice(w)),b}function g(m){m=h(m);const b=m.indexOf("?");return b===-1?"":m.slice(b+1)}function v(m,b){return b.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):b.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function y(m,b){b=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},b),c(b.arrayFormatSeparator);const w=l(b),C=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return C;for(const A of m.split("&")){if(A==="")continue;let[S,I]=n(b.decode?A.replace(/\+/g," "):A,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(b.arrayFormat)?I:f(I,b),w(f(S,b),I,C)}for(const A of Object.keys(C)){const S=C[A];if(typeof S=="object"&&S!==null)for(const I of Object.keys(S))S[I]=v(S[I],b);else C[A]=v(S,b)}return b.sort===!1?C:(b.sort===!0?Object.keys(C).sort():Object.keys(C).sort(b.sort)).reduce((A,S)=>{const I=C[S];return I&&typeof I=="object"&&!Array.isArray(I)?A[S]=d(I):A[S]=I,A},Object.create(null))}t.extract=g,t.parse=y,t.stringify=(m,b)=>{if(!m)return"";b=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},b),c(b.arrayFormatSeparator);const w=I=>b.skipNull&&a(m[I])||b.skipEmptyString&&m[I]==="",C=s(b),A={};for(const I of Object.keys(m))w(I)||(A[I]=m[I]);const S=Object.keys(A);return b.sort!==!1&&S.sort(b.sort),S.map(I=>{const D=m[I];return D===void 0?"":D===null?u(I,b):Array.isArray(D)?D.length===0&&b.arrayFormat==="bracket-separator"?u(I,b)+"[]":D.reduce(C(I),[]).join("&"):u(I,b)+"="+u(D,b)}).filter(I=>I.length>0).join("&")},t.parseUrl=(m,b)=>{b=Object.assign({decode:!0},b);const[w,C]=n(m,"#");return Object.assign({url:w.split("?")[0]||"",query:y(g(m),b)},b&&b.parseFragmentIdentifier&&C?{fragmentIdentifier:f(C,b)}:{})},t.stringifyUrl=(m,b)=>{b=Object.assign({encode:!0,strict:!0,[o]:!0},b);const w=h(m.url).split("?")[0]||"",C=t.extract(m.url),A=t.parse(C,{sort:!1}),S=Object.assign(A,m.query);let I=t.stringify(S,b);I&&(I=`?${I}`);let D=p(m.url);return m.fragmentIdentifier&&(D=`#${b[o]?u(m.fragmentIdentifier,b):m.fragmentIdentifier}`),`${w}${I}${D}`},t.pick=(m,b,w)=>{w=Object.assign({parseFragmentIdentifier:!0,[o]:!1},w);const{url:C,query:A,fragmentIdentifier:S}=t.parseUrl(m,w);return t.stringifyUrl({url:C,query:i(A,b),fragmentIdentifier:S},w)},t.exclude=(m,b,w)=>{const C=Array.isArray(b)?A=>!b.includes(A):(A,S)=>!b(A,S);return t.pick(m,C,w)}})(K3e);const eo=Un(K3e),LWe=E1.injectEndpoints({endpoints:t=>({getGrants:t.query({query:({grant:e,type:r,address:n,page:i=1,count:a=10})=>`${e==="authz"?KVe:ZVe}/${n}/${r}?${eo.stringify({page:i,count:a})}`})})}),{useGetGrantsQuery:$We}=LWe,BWe=E1.injectEndpoints({endpoints:t=>({getTxHeatmapData:t.query({query:()=>EGe})})}),{useGetTxHeatmapDataQuery:kX}=BWe,FWe=E1.injectEndpoints({endpoints:t=>({getTxHistoryData:t.query({query:({fromDate:e,toDate:r,granularity:n,address:i=""})=>`${i?`${H_}/${i}/tx_history`:`${B3e}/history`}?${eo.stringify({fromDate:e,toDate:r,granularity:n})}`})})}),{useGetTxHistoryDataQuery:t5e}=FWe;function sD(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var lU=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wse={INIT:"@@redux/INIT"+lU(),REPLACE:"@@redux/REPLACE"+lU(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+lU()}};function jWe(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:Wse.INIT});if(typeof n>"u")throw new Error(sD(12));if(typeof r(void 0,{type:Wse.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(sD(13))})}function UWe(t){for(var e=Object.keys(t),r={},n=0;n"u")throw c&&c.type,new Error(sD(14));f[h]=v,u=u||v!==g}return u=u||a.length!==Object.keys(l).length,u?f:l}}function qse(t,e){return function(){return e(t.apply(this,arguments))}}function pl(t,e){if(typeof t=="function")return qse(t,e);if(typeof t!="object"||t===null)throw new Error(sD(16));var r={};for(var n in t){var i=t[n];typeof i=="function"&&(r[n]=qse(i,e))}return r}let VW;const zWe=t=>{VW=t};function Yse(t){return t.statusText?console.error(`Error: ${t.statusText}`,t):(console.error(`Something happened setting up the request to ${t.url}`,t),null)}const It=async({config:t,data:e,method:r="GET",url:n})=>{try{let i={Accept:"application/json","Content-Type":"application/json"};VW&&(i.Authorization=`Bearer ${VW}`),t!=null&&t.headers&&(i={...i,...t.headers});const a=await fetch(n,{...t,body:JSON.stringify(e),headers:i,method:r});if(!a.ok)return Promise.reject(Yse(a));const o=await a.json();return Promise.resolve({data:o,responseHeaders:{...a.headers}})}catch(i){return console.error({error:i}),Promise.reject(Yse(i))}},HWe={accountInfo:{publicKey:{base64:"",sigList:[],type:""}},accountInfoLoading:!1,accountInfoFailure:!1,accountAssetsLoading:!1,accountAssets:[],accountAssetsPages:0,accountAssetsTotal:0,accountDelegationsLoading:!1,accountDelegations:[],accountDelegationsPages:0,accountDelegationsCount:0,accountDelegationsTotal:{amount:"",denom:""},accountRedelegationsLoading:!1,accountRedelegations:[],accountRedelegationsTotal:{amount:"",denom:""},accountRewardsLoading:!1,accountRewards:{total:[],rewards:[]},accountUnbondingLoading:!1,accountUnbonding:[],accountUnbondingTotal:{amount:"",denom:""},accountHashData:{assets:{pages:0,results:[],total:0,rollupTotals:{}},rewards:{total:[],rewards:[]},delegations:{pages:0,results:[],total:0,rollupTotals:{bondedTotal:{amount:"",denom:""}}},redelegations:{records:[],rollupTotals:{redelegationTotal:{amount:"",denom:""}}},unbonding:{records:[],rollupTotals:{unbondingTotal:{amount:"",denom:""}}}},accountHashDataLoading:!1},VWe="ACCOUNTS::GET_ACCOUNT_INFO",GWe="ACCOUNTS::GET_ACCOUNT_ASSETS",WWe="ACCOUNTS::GET_ACCOUNT_DELEGATIONS",qWe="ACCOUNTS::GET_ACCOUNT_REDELEGATIONS",YWe="ACCOUNTS::GET_ACCOUNT_REWARDS",KWe="ACCOUNTS::GET_ACCOUNT_UNBONDING",ZWe="ACCOUNTS::GET_ACCOUNT_HASH_DATA",gP=Bt(VWe,t=>It({url:`${Co}/${t}`})),vP=Bt(GWe,({address:t,page:e=1,count:r=10})=>It({url:`${Co}/${t}/balances?${eo.stringify({page:e,count:r})}`})),mP=Bt(WWe,({address:t,page:e=1,count:r=10})=>It({url:`${Co}/${t}/delegations?${eo.stringify({page:e,count:r})}`})),yP=Bt(qWe,t=>It({url:`${Co}/${t}/redelegations`})),wP=Bt(YWe,t=>It({url:`${Co}/${t}/rewards`})),bP=Bt(KWe,t=>It({url:`${Co}/${t}/unbonding`})),xP=Bt(ZWe,async t=>{const e=await It({url:`${Co}/${t}/unbonding`}),r=await It({url:`${Co}/${t}/rewards`}),n=await It({url:`${Co}/${t}/redelegations`}),i=await It({url:`${Co}/${t}/delegations?${eo.stringify({page:1,count:100})}`}),a=await It({url:`${Co}/${t}/balances?${eo.stringify({page:1,count:100})}`});return{unbonding:{...e.data},rewards:{...r.data},redelegations:{...n.data},delegations:{...i.data},assets:{...a.data}}}),QWe={getAccountAssets:vP,getAccountDelegations:mP,getAccountInfo:gP,getAccountRedelegations:yP,getAccountRewards:wP,getAccountUnbonding:bP,getAccountHashData:xP},XWe=mo({name:"account",initialState:HWe,reducers:{},extraReducers(t){t.addCase(gP.pending,e=>{e.accountInfoLoading=!0,e.accountInfoFailure=!1}).addCase(gP.fulfilled,(e,{payload:r})=>{e.accountInfoLoading=!1,e.accountInfo=r.data,e.accountInfoFailure=!1}).addCase(gP.rejected,e=>{e.accountInfoLoading=!1,e.accountInfoFailure=!0}).addCase(vP.pending,e=>{e.accountAssetsLoading=!0}).addCase(vP.fulfilled,(e,{payload:r})=>{e.accountAssetsLoading=!1,e.accountAssets=r.data.results,e.accountAssetsPages=r.data.pages,e.accountAssetsTotal=r.data.total}).addCase(vP.rejected,e=>{e.accountAssetsLoading=!1}).addCase(mP.pending,e=>{e.accountDelegationsLoading=!0}).addCase(mP.fulfilled,(e,{payload:r})=>{e.accountDelegationsLoading=!1,e.accountDelegations=r.data.results,e.accountDelegationsPages=r.data.pages,e.accountDelegationsCount=r.data.total,e.accountDelegationsTotal=r.data.rollupTotals.bondedTotal}).addCase(mP.rejected,e=>{e.accountDelegationsLoading=!1}).addCase(yP.pending,e=>{e.accountRedelegationsLoading=!0}).addCase(yP.fulfilled,(e,{payload:r})=>{e.accountRedelegationsLoading=!1,e.accountRedelegations=r.data.records,e.accountRedelegationsTotal=r.data.rollupTotals.redelegationTotal}).addCase(yP.rejected,e=>{e.accountRedelegationsLoading=!1}).addCase(wP.pending,e=>{e.accountRewardsLoading=!0}).addCase(wP.fulfilled,(e,{payload:r})=>{e.accountRewardsLoading=!1,e.accountRewards=r.data}).addCase(wP.rejected,e=>{e.accountRewardsLoading=!1}).addCase(bP.pending,e=>{e.accountUnbondingLoading=!0}).addCase(bP.fulfilled,(e,{payload:r})=>{e.accountUnbondingLoading=!1,e.accountUnbonding=r.data.records,e.accountUnbondingTotal=r.data.rollupTotals.unbondingTotal}).addCase(bP.rejected,e=>{e.accountUnbondingLoading=!1}).addCase(xP.pending,e=>{e.accountHashDataLoading=!0}).addCase(xP.fulfilled,(e,{payload:r})=>{e.accountHashDataLoading=!1,e.accountHashData=r}).addCase(xP.rejected,e=>{e.accountHashDataLoading=!1})}}),JWe=t=>t.account,eqe=XWe.reducer;var tqe=20,rqe=1,Rb=1e6,Kse=1e6,nqe=-7,iqe=21,aqe=!1,e8="[big.js] ",O2=e8+"Invalid ",_L=O2+"decimal places",oqe=O2+"rounding mode",r5e=e8+"Division by zero",Yi={},Pp=void 0,sqe=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function n5e(){function t(e){var r=this;if(!(r instanceof t))return e===Pp?n5e():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0)throw TypeError(O2+"number");e=e===0&&1/e<0?"-0":String(e)}lqe(r,e)}r.constructor=t}return t.prototype=Yi,t.DP=tqe,t.RM=rqe,t.NE=nqe,t.PE=iqe,t.strict=aqe,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function lqe(t,e){var r,n,i;if(!sqe.test(e))throw Error(O2+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function L2(t,e,r,n){var i=t.c;if(r===Pp&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(oqe);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==Pp))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==Pp||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e--,n)for(;++i[e]>9;)i[e]=0,e--||(++t.e,i.unshift(1));for(e=i.length;!i[--e];)i.pop()}return t}function aS(t,e,r){var n=t.e,i=t.c.join(""),a=i.length;if(e)i=i.charAt(0)+(a>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>a)for(n-=a;n--;)i+="0";else n1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}Yi.abs=function(){var t=new this.constructor(this);return t.s=1,t};Yi.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,a=r.s,o=t.s,s=r.e,l=t.e;if(!n[0]||!i[0])return n[0]?a:i[0]?-o:0;if(a!=o)return a;if(e=a<0,s!=l)return s>l^e?1:-1;for(o=(s=n.length)<(l=i.length)?s:l,a=-1;++ai[a]^e?1:-1;return s==l?0:s>l^e?1:-1};Yi.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,a=e.s==t.s?1:-1,o=r.DP;if(o!==~~o||o<0||o>Rb)throw Error(_L);if(!i[0])throw Error(r5e);if(!n[0])return t.s=a,t.c=[t.e=0],t;var s,l,c,u,f,d=i.slice(),h=s=i.length,p=n.length,g=n.slice(0,s),v=g.length,y=t,m=y.c=[],b=0,w=o+(y.e=e.e-t.e)+1;for(y.s=a,a=w<0?0:w,d.unshift(0);v++v?1:-1;else for(f=-1,u=0;++fg[f]?1:-1;break}if(u<0){for(l=v==s?i:d;v;){if(g[--v]w&&L2(y,w,r.RM,g[0]!==Pp),y};Yi.eq=function(t){return this.cmp(t)===0};Yi.gt=function(t){return this.cmp(t)>0};Yi.gte=function(t){return this.cmp(t)>-1};Yi.lt=function(t){return this.cmp(t)<0};Yi.lte=function(t){return this.cmp(t)<1};Yi.minus=Yi.sub=function(t){var e,r,n,i,a=this,o=a.constructor,s=a.s,l=(t=new o(t)).s;if(s!=l)return t.s=-l,a.plus(t);var c=a.c.slice(),u=a.e,f=t.c,d=t.e;if(!c[0]||!f[0])return f[0]?t.s=-l:c[0]?t=new o(a):t.s=1,t;if(s=u-d){for((i=s<0)?(s=-s,n=c):(d=u,n=f),n.reverse(),l=s;l--;)n.push(0);n.reverse()}else for(r=((i=c.length0)for(;l--;)c[e++]=0;for(l=e;r>s;){if(c[--r]0?(l=o,n=c):(e=-e,n=s),n.reverse();e--;)n.push(0);n.reverse()}for(s.length-c.length<0&&(n=c,c=s,s=n),e=c.length,r=0;e;s[e]%=10)r=(s[--e]=s[e]+c[e]+r)/10|0;for(r&&(s.unshift(r),++l),e=s.length;s[--e]===0;)s.pop();return t.c=s,t.e=l,t};Yi.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-Kse||t>Kse)throw Error(O2+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};Yi.prec=function(t,e){if(t!==~~t||t<1||t>Rb)throw Error(O2+"precision");return L2(new this.constructor(this),t,e)};Yi.round=function(t,e){if(t===Pp)t=0;else if(t!==~~t||t<-Rb||t>Rb)throw Error(_L);return L2(new this.constructor(this),t+this.e+1,e)};Yi.sqrt=function(){var t,e,r,n=this,i=n.constructor,a=n.s,o=n.e,s=new i("0.5");if(!n.c[0])return new i(n);if(a<0)throw Error(e8+"No square root");a=Math.sqrt(n+""),a===0||a===1/0?(e=n.c.join(""),e.length+o&1||(e+="0"),a=Math.sqrt(e),o=((o+1)/2|0)-(o<0||o&1),t=new i((a==1/0?"5e":(a=a.toExponential()).slice(0,a.indexOf("e")+1))+o)):t=new i(a+""),o=t.e+(i.DP+=4);do r=t,t=s.times(r.plus(n.div(r)));while(r.c.slice(0,o).join("")!==t.c.slice(0,o).join(""));return L2(t,(i.DP-=4)+t.e+1,i.RM)};Yi.times=Yi.mul=function(t){var e,r=this,n=r.constructor,i=r.c,a=(t=new n(t)).c,o=i.length,s=a.length,l=r.e,c=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!a[0])return t.c=[t.e=0],t;for(t.e=l+c,ol;)s=e[c]+a[l]*i[c-l-1]+s,e[c--]=s%10,s=s/10|0;e[c]=s}for(s?++t.e:e.shift(),l=e.length;!e[--l];)e.pop();return t.c=e,t};Yi.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Pp){if(t!==~~t||t<0||t>Rb)throw Error(_L);for(r=L2(new r.constructor(r),++t,e);r.c.lengthRb)throw Error(_L);for(r=L2(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length=e.PE,!!t.c[0])};Yi.toNumber=function(){var t=Number(aS(this,!0,!0));if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(e8+"Imprecise conversion");return t};Yi.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Pp){if(t!==~~t||t<1||t>Rb)throw Error(O2+"precision");for(r=L2(new n(r),t,e);r.c.length=n.PE,!!i)};Yi.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(e8+"valueOf disallowed");return aS(t,t.e<=e.NE||t.e>=e.PE,!0)};var va=n5e();const cqe=t=>{var e,r,n,i,a,o,s,l,c,u;if(t){const f=new va(Number(((r=(e=t.delegations.rollupTotals)==null?void 0:e.bondedTotal)==null?void 0:r.amount)||0)).toNumber(),d=new va(((a=(i=(n=t==null?void 0:t.redelegations)==null?void 0:n.rollupTotals)==null?void 0:i.redelegationTotal)==null?void 0:a.amount)||0).toNumber(),h=new va(((l=(s=(o=t==null?void 0:t.unbonding)==null?void 0:o.rollupTotals)==null?void 0:s.unbondingTotal)==null?void 0:l.amount)||0).toNumber(),p=new va(((u=(c=t==null?void 0:t.rewards)==null?void 0:c.total[0])==null?void 0:u.amount)||0).toNumber(),g=new va(Number(t.assets.total.amount||0)).toNumber();return{hashTotal:g+f+d+h+p,hashDelegations:f,hashRedelegations:d,hashUnbondings:h,hashRewards:p,hashAvailable:g}}else return{hashTotal:0,hashDelegations:0,hashRedelegations:0,hashUnbondings:0,hashRewards:0,hashAvailable:0}},GW=(t,e=!1)=>{if(!(window&&window.document&&window.document.cookie!==void 0))return null;const n=window.document.cookie;if(!n.includes(t))return null;const a=n.split(`${t}=`)[1].split(";")[0],o=a.replace(/[^\w\s]/gi,"");return e?a:o};function An(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Kt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function ir(t){Kt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function $2(t,e){Kt(2,arguments);var r=ir(t),n=An(e);return isNaN(n)?new Date(NaN):(n&&r.setDate(r.getDate()+n),r)}const WW=(t,e,r)=>{const n=r?`; expires=${$2(new Date,r)}`:"";window&&window.document&&window.document.cookie!==void 0&&(window.document.cookie=`${t}=${e}${n}; path=/`)};function i5e(t){Kt(1,arguments);var e=ir(t);return!isNaN(e)}var VI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function uqe(t,e,r){r=r||{};var n;return typeof VI[t]=="string"?n=VI[t]:e===1?n=VI[t].one:n=VI[t].other.replace("{{count}}",e),r.addSuffix?r.comparison>0?"in "+n:n+" ago":n}function cU(t){return function(e){var r=e||{},n=r.width?String(r.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}var fqe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dqe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hqe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pqe={date:cU({formats:fqe,defaultWidth:"full"}),time:cU({formats:dqe,defaultWidth:"full"}),dateTime:cU({formats:hqe,defaultWidth:"full"})},gqe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function vqe(t,e,r,n){return gqe[t]}function NC(t){return function(e,r){var n=r||{},i=n.context?String(n.context):"standalone",a;if(i==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,s=n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{var l=t.defaultWidth,c=n.width?String(n.width):t.defaultWidth;a=t.values[c]||t.values[l]}var u=t.argumentCallback?t.argumentCallback(e):e;return a[u]}}var mqe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yqe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wqe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bqe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xqe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_qe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};function Sqe(t,e){var r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"}var Cqe={ordinalNumber:Sqe,era:NC({values:mqe,defaultWidth:"wide"}),quarter:NC({values:yqe,defaultWidth:"wide",argumentCallback:function(t){return Number(t)-1}}),month:NC({values:wqe,defaultWidth:"wide"}),day:NC({values:bqe,defaultWidth:"wide"}),dayPeriod:NC({values:xqe,defaultWidth:"wide",formattingValues:_qe,defaultFormattingWidth:"wide"})};function Aqe(t){return function(e,r){var n=String(e),i=r||{},a=n.match(t.matchPattern);if(!a)return null;var o=a[0],s=n.match(t.parsePattern);if(!s)return null;var l=t.valueCallback?t.valueCallback(s[0]):s[0];return l=i.valueCallback?i.valueCallback(l):l,{value:l,rest:n.slice(o.length)}}}function OC(t){return function(e,r){var n=String(e),i=r||{},a=i.width,o=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],s=n.match(o);if(!s)return null;var l=s[0],c=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],u;return Object.prototype.toString.call(c)==="[object Array]"?u=Eqe(c,function(f){return f.test(l)}):u=Tqe(c,function(f){return f.test(l)}),u=t.valueCallback?t.valueCallback(u):u,u=i.valueCallback?i.valueCallback(u):u,{value:u,rest:n.slice(l.length)}}}function Tqe(t,e){for(var r in t)if(t.hasOwnProperty(r)&&e(t[r]))return r}function Eqe(t,e){for(var r=0;r0?r:1-r;return Ii(e==="yy"?n%100:n,e.length)},M:function(t,e){var r=t.getUTCMonth();return e==="M"?String(r+1):Ii(r+1,2)},d:function(t,e){return Ii(t.getUTCDate(),e.length)},a:function(t,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,e){return Ii(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Ii(t.getUTCHours(),e.length)},m:function(t,e){return Ii(t.getUTCMinutes(),e.length)},s:function(t,e){return Ii(t.getUTCSeconds(),e.length)},S:function(t,e){var r=e.length,n=t.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,r-3));return Ii(i,e.length)}},Uqe=864e5;function zqe(t){Kt(1,arguments);var e=ir(t),r=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var n=e.getTime(),i=r-n;return Math.floor(i/Uqe)+1}function K3(t){Kt(1,arguments);var e=1,r=ir(t),n=r.getUTCDay(),i=(n=i.getTime()?r+1:e.getTime()>=o.getTime()?r:r-1}function Hqe(t){Kt(1,arguments);var e=o5e(t),r=new Date(0);r.setUTCFullYear(e,0,4),r.setUTCHours(0,0,0,0);var n=K3(r);return n}var Vqe=6048e5;function s5e(t){Kt(1,arguments);var e=ir(t),r=K3(e).getTime()-Hqe(e).getTime();return Math.round(r/Vqe)+1}function sb(t,e){Kt(1,arguments);var r=e||{},n=r.locale,i=n&&n.options&&n.options.weekStartsOn,a=i==null?0:An(i),o=r.weekStartsOn==null?a:An(r.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=ir(t),l=s.getUTCDay(),c=(l=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(n+1,0,l),c.setUTCHours(0,0,0,0);var u=sb(c,e),f=new Date(0);f.setUTCFullYear(n,0,l),f.setUTCHours(0,0,0,0);var d=sb(f,e);return r.getTime()>=u.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Gqe(t,e){Kt(1,arguments);var r=e||{},n=r.locale,i=n&&n.options&&n.options.firstWeekContainsDate,a=i==null?1:An(i),o=r.firstWeekContainsDate==null?a:An(r.firstWeekContainsDate),s=MX(t,e),l=new Date(0);l.setUTCFullYear(s,0,o),l.setUTCHours(0,0,0,0);var c=sb(l,e);return c}var Wqe=6048e5;function l5e(t,e){Kt(1,arguments);var r=ir(t),n=sb(r,e).getTime()-Gqe(r,e).getTime();return Math.round(n/Wqe)+1}var Bx={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qqe={G:function(t,e,r){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){var n=t.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return Hv.y(t,e)},Y:function(t,e,r,n){var i=MX(t,n),a=i>0?i:1-i;if(e==="YY"){var o=a%100;return Ii(o,2)}return e==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ii(a,e.length)},R:function(t,e){var r=o5e(t);return Ii(r,e.length)},u:function(t,e){var r=t.getUTCFullYear();return Ii(r,e.length)},Q:function(t,e,r){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ii(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ii(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){var n=t.getUTCMonth();switch(e){case"M":case"MM":return Hv.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return Ii(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){var i=l5e(t,n);return e==="wo"?r.ordinalNumber(i,{unit:"week"}):Ii(i,e.length)},I:function(t,e,r){var n=s5e(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):Ii(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Hv.d(t,e)},D:function(t,e,r){var n=zqe(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Ii(n,e.length)},E:function(t,e,r){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){var i=t.getUTCDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return Ii(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){var i=t.getUTCDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return Ii(a,e.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,r){var n=t.getUTCDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return Ii(i,e.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){var n=t.getUTCHours(),i=n/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,r){var n=t.getUTCHours(),i;switch(n===12?i=Bx.noon:n===0?i=Bx.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,r){var n=t.getUTCHours(),i;switch(n>=17?i=Bx.evening:n>=12?i=Bx.afternoon:n>=4?i=Bx.morning:i=Bx.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){var n=t.getUTCHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Hv.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Hv.H(t,e)},K:function(t,e,r){var n=t.getUTCHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Ii(n,e.length)},k:function(t,e,r){var n=t.getUTCHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):Ii(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Hv.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Hv.s(t,e)},S:function(t,e){return Hv.S(t,e)},X:function(t,e,r,n){var i=n._originalDate||t,a=i.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return Qse(a);case"XXXX":case"XX":return Sw(a);case"XXXXX":case"XXX":default:return Sw(a,":")}},x:function(t,e,r,n){var i=n._originalDate||t,a=i.getTimezoneOffset();switch(e){case"x":return Qse(a);case"xxxx":case"xx":return Sw(a);case"xxxxx":case"xxx":default:return Sw(a,":")}},O:function(t,e,r,n){var i=n._originalDate||t,a=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Zse(a,":");case"OOOO":default:return"GMT"+Sw(a,":")}},z:function(t,e,r,n){var i=n._originalDate||t,a=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Zse(a,":");case"zzzz":default:return"GMT"+Sw(a,":")}},t:function(t,e,r,n){var i=n._originalDate||t,a=Math.floor(i.getTime()/1e3);return Ii(a,e.length)},T:function(t,e,r,n){var i=n._originalDate||t,a=i.getTime();return Ii(a,e.length)}};function Zse(t,e){var r=t>0?"-":"+",n=Math.abs(t),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var o=e;return r+String(i)+o+Ii(a,2)}function Qse(t,e){if(t%60===0){var r=t>0?"-":"+";return r+Ii(Math.abs(t)/60,2)}return Sw(t,e)}function Sw(t,e){var r=e||"",n=t>0?"-":"+",i=Math.abs(t),a=Ii(Math.floor(i/60),2),o=Ii(i%60,2);return n+a+r+o}function Xse(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}function c5e(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}function Yqe(t,e){var r=t.match(/(P+)(p+)?/),n=r[1],i=r[2];if(!i)return Xse(t,e);var a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",Xse(n,e)).replace("{{time}}",c5e(i,e))}var u5e={p:c5e,P:Yqe};function I1(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var Kqe=["D","DD"],Zqe=["YY","YYYY"];function f5e(t){return Kqe.indexOf(t)!==-1}function d5e(t){return Zqe.indexOf(t)!==-1}function lD(t,e,r){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var Qqe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xqe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jqe=/^'([^]*?)'?$/,eYe=/''/g,tYe=/[a-zA-Z]/;function sn(t,e,r){Kt(2,arguments);var n=String(e),i=r||{},a=i.locale||PX,o=a.options&&a.options.firstWeekContainsDate,s=o==null?1:An(o),l=i.firstWeekContainsDate==null?s:An(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=a.options&&a.options.weekStartsOn,u=c==null?0:An(c),f=i.weekStartsOn==null?u:An(i.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var d=ir(t);if(!i5e(d))throw new RangeError("Invalid time value");var h=I1(d),p=a5e(d,h),g={firstWeekContainsDate:l,weekStartsOn:f,locale:a,_originalDate:d},v=n.match(Xqe).map(function(y){var m=y[0];if(m==="p"||m==="P"){var b=u5e[m];return b(y,a.formatLong,g)}return y}).join("").match(Qqe).map(function(y){if(y==="''")return"'";var m=y[0];if(m==="'")return rYe(y);var b=qqe[m];if(b)return!i.useAdditionalWeekYearTokens&&d5e(y)&&lD(y,e,t),!i.useAdditionalDayOfYearTokens&&f5e(y)&&lD(y,e,t),b(p,y,a.localize,g);if(m.match(tYe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return y}).join("");return v}function rYe(t){return t.match(Jqe)[1].replace(eYe,"'")}function Jse(t,e,r){var n=aYe(t,r.timeZone,r.locale);return n.formatToParts?nYe(n,e):iYe(n,e)}function nYe(t,e){var r=t.formatToParts(e);return r[r.length-1].value}function iYe(t,e){var r=t.format(e).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function aYe(t,e,r){if(r&&!r.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:e,timeZoneName:t})}function oYe(t,e){var r=uYe(e);return r.formatToParts?lYe(r,t):cYe(r,t)}var sYe={year:0,month:1,day:2,hour:3,minute:4,second:5};function lYe(t,e){for(var r=t.formatToParts(e),n=[],i=0;i=0&&(n[a]=parseInt(r[i].value,10))}return n}function cYe(t,e){var r=t.format(e).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[n[3],n[1],n[2],n[4],n[5],n[6]]}var uU={};function uYe(t){if(!uU[t]){var e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),r=e==="06/25/2014, 00:00:00"||e==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";uU[t]=r?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return uU[t]}var ele=36e5,fYe=6e4,GI={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/,timezoneIANA:/(UTC|(?:[a-zA-Z]+\/[a-zA-Z_-]+(?:\/[a-zA-Z_]+)?))$/};function DA(t,e,r){var n,i;if(n=GI.timezoneZ.exec(t),n)return 0;var a;if(n=GI.timezoneHH.exec(t),n)return a=parseInt(n[2],10),tle()?(i=a*ele,n[1]==="+"?-i:i):NaN;if(n=GI.timezoneHHMM.exec(t),n){a=parseInt(n[2],10);var o=parseInt(n[3],10);return tle(a,o)?(i=a*ele+o*fYe,n[1]==="+"?-i:i):NaN}if(n=GI.timezoneIANA.exec(t),n){e=new Date(e||Date.now());var s=r?e:dYe(e),l=qW(s,t),c=r?l:hYe(e,l,t);return-c}return 0}function dYe(t){return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}function qW(t,e){var r=oYe(t,e),n=Date.UTC(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5]),i=t.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,n-i}function hYe(t,e,r){var n=t.getTime(),i=n-e,a=qW(new Date(i),r);if(e===a)return e;i-=a-e;var o=qW(new Date(i),r);return a===o?a:Math.max(a,o)}function tle(t,e){return!(e!=null&&(e<0||e>59))}var fU=60*1e3,pYe={X:function(t,e,r,n){var i=n._originalDate||t,a=n.timeZone?DA(n.timeZone,i)/fU:i.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return rle(a);case"XXXX":case"XX":return w_(a);case"XXXXX":case"XXX":default:return w_(a,":")}},x:function(t,e,r,n){var i=n._originalDate||t,a=n.timeZone?DA(n.timeZone,i)/fU:i.getTimezoneOffset();switch(e){case"x":return rle(a);case"xxxx":case"xx":return w_(a);case"xxxxx":case"xxx":default:return w_(a,":")}},O:function(t,e,r,n){var i=n._originalDate||t,a=n.timeZone?DA(n.timeZone,i)/fU:i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+gYe(a,":");case"OOOO":default:return"GMT"+w_(a,":")}},z:function(t,e,r,n){var i=n._originalDate||t;switch(e){case"z":case"zz":case"zzz":return Jse("short",i,n);case"zzzz":default:return Jse("long",i,n)}}};function cD(t,e){for(var r=t<0?"-":"",n=Math.abs(t).toString();n.length0?"-":"+",i=Math.abs(t),a=cD(Math.floor(i/60),2),o=cD(i%60,2);return n+a+r+o}function rle(t,e){if(t%60===0){var r=t>0?"-":"+";return r+cD(Math.abs(t)/60,2)}return w_(t,e)}function gYe(t,e){var r=t>0?"-":"+",n=Math.abs(t),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var o=e;return r+String(i)+o+cD(a,2)}var dU=36e5,nle=6e4,vYe=2,Es={dateTimeDelimeter:/[T ]/,plainTime:/:/,timeZoneDelimeter:/[Z ]/i,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*| UTC|(?:[a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?))$/};function h5e(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(t===null)return new Date(NaN);var r=e||{},n=r.additionalDigits==null?vYe:An(r.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]")return new Date(t.getTime());if(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")return new Date(t);if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=mYe(t),a=yYe(i.date,n),o=a.year,s=a.restDateString,l=wYe(s,o);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,f;if(i.time&&(u=bYe(i.time),isNaN(u)))return new Date(NaN);if(i.timezone||r.timeZone){if(f=DA(i.timezone||r.timeZone,new Date(c+u)),isNaN(f))return new Date(NaN)}else f=I1(new Date(c+u)),f=I1(new Date(c+u+f));return new Date(c+u+f)}else return new Date(NaN)}function mYe(t){var e={},r=t.split(Es.dateTimeDelimeter),n;if(Es.plainTime.test(r[0])?(e.date=null,n=r[0]):(e.date=r[0],n=r[1],e.timezone=r[2],Es.timeZoneDelimeter.test(e.date)&&(e.date=t.split(Es.timeZoneDelimeter)[0],n=t.substr(e.date.length,t.length))),n){var i=Es.timezone.exec(n);i?(e.time=n.replace(i[1],""),e.timezone=i[1]):e.time=n}return e}function yYe(t,e){var r=Es.YYY[e],n=Es.YYYYY[e],i;if(i=Es.YYYY.exec(t)||n.exec(t),i){var a=i[1];return{year:parseInt(a,10),restDateString:t.slice(a.length)}}if(i=Es.YY.exec(t)||r.exec(t),i){var o=i[1];return{year:parseInt(o,10)*100,restDateString:t.slice(o.length)}}return{year:null}}function wYe(t,e){if(e===null)return null;var r,n,i,a;if(t.length===0)return n=new Date(0),n.setUTCFullYear(e),n;if(r=Es.MM.exec(t),r)return n=new Date(0),i=parseInt(r[1],10)-1,ale(e,i)?(n.setUTCFullYear(e,i),n):new Date(NaN);if(r=Es.DDD.exec(t),r){n=new Date(0);var o=parseInt(r[1],10);return SYe(e,o)?(n.setUTCFullYear(e,0,o),n):new Date(NaN)}if(r=Es.MMDD.exec(t),r){n=new Date(0),i=parseInt(r[1],10)-1;var s=parseInt(r[2],10);return ale(e,i,s)?(n.setUTCFullYear(e,i,s),n):new Date(NaN)}if(r=Es.Www.exec(t),r)return a=parseInt(r[1],10)-1,ole(e,a)?ile(e,a):new Date(NaN);if(r=Es.WwwD.exec(t),r){a=parseInt(r[1],10)-1;var l=parseInt(r[2],10)-1;return ole(e,a,l)?ile(e,a,l):new Date(NaN)}return null}function bYe(t){var e,r,n;if(e=Es.HH.exec(t),e)return r=parseFloat(e[1].replace(",",".")),hU(r)?r%24*dU:NaN;if(e=Es.HHMM.exec(t),e)return r=parseInt(e[1],10),n=parseFloat(e[2].replace(",",".")),hU(r,n)?r%24*dU+n*nle:NaN;if(e=Es.HHMMSS.exec(t),e){r=parseInt(e[1],10),n=parseInt(e[2],10);var i=parseFloat(e[3].replace(",","."));return hU(r,n,i)?r%24*dU+n*nle+i*1e3:NaN}return null}function ile(t,e,r){e=e||0,r=r||0;var n=new Date(0);n.setUTCFullYear(t,0,4);var i=n.getUTCDay()||7,a=e*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}var xYe=[31,28,31,30,31,30,31,31,30,31,30,31],_Ye=[31,29,31,30,31,30,31,31,30,31,30,31];function p5e(t){return t%400===0||t%4===0&&t%100!==0}function ale(t,e,r){if(e<0||e>11)return!1;if(r!=null){if(r<1)return!1;var n=p5e(t);if(n&&r>_Ye[e]||!n&&r>xYe[e])return!1}return!0}function SYe(t,e){if(e<1)return!1;var r=p5e(t);return!(r&&e>366||!r&&e>365)}function ole(t,e,r){return!(e<0||e>52||r!=null&&(r<0||r>6))}function hU(t,e,r){return!(t!=null&&(t<0||t>=25)||e!=null&&(e<0||e>=60)||r!=null&&(r<0||r>=60))}var CYe=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function AYe(t,e,r){var n=String(e),i=r||{},a=n.match(CYe);if(a){var o=h5e(t,i);n=a.reduce(function(s,l){return l[0]==="'"?s:s.replace(l,"'"+pYe[l[0]](o,l,null,i)+"'")},n)}return sn(t,n,i)}function TYe(t,e,r){var n=h5e(t,r),i=DA(e,n,!0)||0,a=new Date(n.getTime()-i),o=new Date(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds());return o}function g5e(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");e=e||{};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function EYe(t){return g5e({},t)}const v5e=(t,e="yyyy/MM/dd HH:mm:ss",r="UTC")=>AYe(TYe(t,r),e,{timeZone:r});function Gg(t,e){Kt(2,arguments);var r=ir(t),n=An(e);if(isNaN(n))return new Date(NaN);if(!n)return r;var i=r.getDate(),a=new Date(r.getTime());a.setMonth(r.getMonth()+n+1,0);var o=a.getDate();return i>=o?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var IYe=36e5;function kYe(t,e){Kt(2,arguments);var r=An(e);return RX(t,r*IYe)}function m5e(t,e){Kt(1,arguments);var r=e||{},n=r.locale,i=n&&n.options&&n.options.weekStartsOn,a=i==null?0:An(i),o=r.weekStartsOn==null?a:An(r.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=ir(t),l=s.getDay(),c=(l=i.getTime()?r+1:e.getTime()>=o.getTime()?r:r-1}function RYe(t){Kt(1,arguments);var e=PYe(t),r=new Date(0);r.setFullYear(e,0,4),r.setHours(0,0,0,0);var n=uD(r);return n}function Rp(t){Kt(1,arguments);var e=ir(t);return e.setHours(0,0,0,0),e}var MYe=864e5;function fD(t,e){Kt(2,arguments);var r=Rp(t),n=Rp(e),i=r.getTime()-I1(r),a=n.getTime()-I1(n);return Math.round((i-a)/MYe)}var DYe=6e4;function YW(t,e){Kt(2,arguments);var r=An(e);return RX(t,r*DYe)}function DX(t,e){Kt(2,arguments);var r=An(e),n=r*7;return $2(t,n)}function W6(t,e){Kt(2,arguments);var r=An(e);return Gg(t,r*12)}function NYe(t,e){Kt(2,arguments);var r=ir(t),n=ir(e),i=r.getTime()-n.getTime();return i<0?-1:i>0?1:i}function OYe(t,e){Kt(2,arguments);var r=Rp(t),n=Rp(e);return r.getTime()===n.getTime()}function dD(t,e){Kt(2,arguments);var r=ir(t),n=ir(e),i=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return i*12+a}function KW(t){Kt(1,arguments);var e=ir(t),r=Math.floor(e.getMonth()/3)+1;return r}function hD(t,e){Kt(2,arguments);var r=ir(t),n=ir(e);return r.getFullYear()-n.getFullYear()}function ZW(t){Kt(1,arguments);var e=ir(t);return e.setHours(23,59,59,999),e}function QW(t){Kt(1,arguments);var e=ir(t),r=e.getMonth(),n=r-r%3;return e.setMonth(n,1),e.setHours(0,0,0,0),e}function LYe(t){Kt(1,arguments);var e=ir(t);return e.setDate(1),e.setHours(0,0,0,0),e}function $Ye(t){Kt(1,arguments);var e=ir(t),r=new Date(0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}var sle=1e3*60,pD=60*24,lle=pD*30,cle=pD*365;function BYe(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Kt(2,arguments);var n=r.locale||PX;if(!n.formatDistance)throw new RangeError("locale must contain localize.formatDistance property");var i=NYe(t,e);if(isNaN(i))throw new RangeError("Invalid time value");var a=EYe(r);a.addSuffix=!!r.addSuffix,a.comparison=i;var o,s;i>0?(o=ir(e),s=ir(t)):(o=ir(t),s=ir(e));var l=r.roundingMethod==null?"round":String(r.roundingMethod),c;if(l==="floor")c=Math.floor;else if(l==="ceil")c=Math.ceil;else if(l==="round")c=Math.round;else throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");var u=s.getTime()-o.getTime(),f=u/sle,d=I1(s)-I1(o),h=(u-d)/sle,p;if(r.unit==null?f<1?p="second":f<60?p="minute":fn.getTime()}function jm(t,e){Kt(2,arguments);var r=ir(t),n=ir(e);return r.getTime()=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var l=ir(t),c=An(e),u=l.getUTCDay(),f=c%7,d=(f+7)%7,h=(d0,n=r?e:1-e,i;if(n<=50)i=t||100;else{var a=n+50,o=Math.floor(a/100)*100,s=t>=a%100;i=t+o-(s?100:0)}return r?i:1-i}var XYe=[31,28,31,30,31,30,31,31,30,31,30,31],JYe=[31,29,31,30,31,30,31,31,30,31,30,31];function dle(t){return t%400===0||t%4===0&&t%100!==0}var eKe={G:{priority:140,parse:function(t,e,r,n){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});case"GGGG":default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}},set:function(t,e,r,n){return e.era=r,t.setUTCFullYear(r,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,r,n){var i=function(a){return{year:a,isTwoDigitYear:e==="yy"}};switch(e){case"y":return Wa(4,t,i);case"yo":return r.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Wa(e.length,t,i)}},validate:function(t,e,r){return e.isTwoDigitYear||e.year>0},set:function(t,e,r,n){var i=t.getUTCFullYear();if(r.isTwoDigitYear){var a=fle(r.year,i);return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t}var o=!("era"in e)||e.era===1?r.year:1-r.year;return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,r,n){var i=function(a){return{year:a,isTwoDigitYear:e==="YY"}};switch(e){case"Y":return Wa(4,t,i);case"Yo":return r.ordinalNumber(t,{unit:"year",valueCallback:i});default:return Wa(e.length,t,i)}},validate:function(t,e,r){return e.isTwoDigitYear||e.year>0},set:function(t,e,r,n){var i=MX(t,n);if(r.isTwoDigitYear){var a=fle(r.year,i);return t.setUTCFullYear(a,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),sb(t,n)}var o=!("era"in e)||e.era===1?r.year:1-r.year;return t.setUTCFullYear(o,0,n.firstWeekContainsDate),t.setUTCHours(0,0,0,0),sb(t,n)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,r,n){return qI(e==="R"?4:e.length,t)},set:function(t,e,r,n){var i=new Date(0);return i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0),K3(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,r,n){return qI(e==="u"?4:e.length,t)},set:function(t,e,r,n){return t.setUTCFullYear(r,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,r,n){switch(e){case"Q":case"QQ":return Wa(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,r){return e>=1&&e<=4},set:function(t,e,r,n){return t.setUTCMonth((r-1)*3,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,r,n){switch(e){case"q":case"qq":return Wa(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,r){return e>=1&&e<=4},set:function(t,e,r,n){return t.setUTCMonth((r-1)*3,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,r,n){var i=function(a){return a-1};switch(e){case"M":return La(co.month,t,i);case"MM":return Wa(2,t,i);case"Mo":return r.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,r){return e>=0&&e<=11},set:function(t,e,r,n){return t.setUTCMonth(r,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,r,n){var i=function(a){return a-1};switch(e){case"L":return La(co.month,t,i);case"LL":return Wa(2,t,i);case"Lo":return r.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,r){return e>=0&&e<=11},set:function(t,e,r,n){return t.setUTCMonth(r,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,r,n){switch(e){case"w":return La(co.week,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=1&&e<=53},set:function(t,e,r,n){return sb(YYe(t,r,n),n)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,r,n){switch(e){case"I":return La(co.week,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=1&&e<=53},set:function(t,e,r,n){return K3(qYe(t,r,n),n)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,r,n){switch(e){case"d":return La(co.date,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return Wa(e.length,t)}},validate:function(t,e,r){var n=t.getUTCFullYear(),i=dle(n),a=t.getUTCMonth();return i?e>=1&&e<=JYe[a]:e>=1&&e<=XYe[a]},set:function(t,e,r,n){return t.setUTCDate(r),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,r,n){switch(e){case"D":case"DD":return La(co.dayOfYear,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return Wa(e.length,t)}},validate:function(t,e,r){var n=t.getUTCFullYear(),i=dle(n);return i?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,r,n){return t.setUTCMonth(0,r),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,r,n){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,r){return e>=0&&e<=6},set:function(t,e,r,n){return t=pU(t,r,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,r,n){var i=function(a){var o=Math.floor((a-1)/7)*7;return(a+n.weekStartsOn+6)%7+o};switch(e){case"e":case"ee":return Wa(e.length,t,i);case"eo":return r.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,r){return e>=0&&e<=6},set:function(t,e,r,n){return t=pU(t,r,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,r,n){var i=function(a){var o=Math.floor((a-1)/7)*7;return(a+n.weekStartsOn+6)%7+o};switch(e){case"c":case"cc":return Wa(e.length,t,i);case"co":return r.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,r){return e>=0&&e<=6},set:function(t,e,r,n){return t=pU(t,r,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,r,n){var i=function(a){return a===0?7:a};switch(e){case"i":case"ii":return Wa(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return r.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||r.day(t,{width:"short",context:"formatting",valueCallback:i})||r.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return r.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return r.day(t,{width:"short",context:"formatting",valueCallback:i})||r.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiii":default:return r.day(t,{width:"wide",context:"formatting",valueCallback:i})||r.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||r.day(t,{width:"short",context:"formatting",valueCallback:i})||r.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,r){return e>=1&&e<=7},set:function(t,e,r,n){return t=WYe(t,r,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,r,n){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,r,n){return t.setUTCHours(gU(r),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,r,n){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,r,n){return t.setUTCHours(gU(r),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,r,n){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,r,n){return t.setUTCHours(gU(r),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,r,n){switch(e){case"h":return La(co.hour12h,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=1&&e<=12},set:function(t,e,r,n){var i=t.getUTCHours()>=12;return i&&r<12?t.setUTCHours(r+12,0,0,0):!i&&r===12?t.setUTCHours(0,0,0,0):t.setUTCHours(r,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,r,n){switch(e){case"H":return La(co.hour23h,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=0&&e<=23},set:function(t,e,r,n){return t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,r,n){switch(e){case"K":return La(co.hour11h,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=0&&e<=11},set:function(t,e,r,n){var i=t.getUTCHours()>=12;return i&&r<12?t.setUTCHours(r+12,0,0,0):t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,r,n){switch(e){case"k":return La(co.hour24h,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=1&&e<=24},set:function(t,e,r,n){var i=r<=24?r%24:r;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,r,n){switch(e){case"m":return La(co.minute,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=0&&e<=59},set:function(t,e,r,n){return t.setUTCMinutes(r,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,r,n){switch(e){case"s":return La(co.second,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return Wa(e.length,t)}},validate:function(t,e,r){return e>=0&&e<=59},set:function(t,e,r,n){return t.setUTCSeconds(r,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,r,n){var i=function(a){return Math.floor(a*Math.pow(10,-e.length+3))};return Wa(e.length,t,i)},set:function(t,e,r,n){return t.setUTCMilliseconds(r),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,r,n){switch(e){case"X":return Gh(Vh.basicOptionalMinutes,t);case"XX":return Gh(Vh.basic,t);case"XXXX":return Gh(Vh.basicOptionalSeconds,t);case"XXXXX":return Gh(Vh.extendedOptionalSeconds,t);case"XXX":default:return Gh(Vh.extended,t)}},set:function(t,e,r,n){return e.timestampIsSet?t:new Date(t.getTime()-r)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,r,n){switch(e){case"x":return Gh(Vh.basicOptionalMinutes,t);case"xx":return Gh(Vh.basic,t);case"xxxx":return Gh(Vh.basicOptionalSeconds,t);case"xxxxx":return Gh(Vh.extendedOptionalSeconds,t);case"xxx":default:return Gh(Vh.extended,t)}},set:function(t,e,r,n){return e.timestampIsSet?t:new Date(t.getTime()-r)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,r,n){return ule(t)},set:function(t,e,r,n){return[new Date(r*1e3),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,r,n){return ule(t)},set:function(t,e,r,n){return[new Date(r),{timestampIsSet:!0}]},incompatibleTokens:"*"}},tKe=10,rKe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nKe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iKe=/^'([^]*?)'?$/,aKe=/''/g,oKe=/\S/,sKe=/[a-zA-Z]/;function NA(t,e,r,n){Kt(3,arguments);var i=String(t),a=String(e),o=n||{},s=o.locale||PX;if(!s.match)throw new RangeError("locale must contain match property");var l=s.options&&s.options.firstWeekContainsDate,c=l==null?1:An(l),u=o.firstWeekContainsDate==null?c:An(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=s.options&&s.options.weekStartsOn,d=f==null?0:An(f),h=o.weekStartsOn==null?d:An(o.weekStartsOn);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(a==="")return i===""?ir(r):new Date(NaN);var p={firstWeekContainsDate:u,weekStartsOn:h,locale:s},g=[{priority:tKe,subPriority:-1,set:lKe,index:0}],v,y=a.match(nKe).map(function(F){var B=F[0];if(B==="p"||B==="P"){var j=u5e[B];return j(F,s.formatLong,p)}return F}).join("").match(rKe),m=[];for(v=0;v0&&oKe.test(i))return new Date(NaN);var O=g.map(function(F){return F.priority}).sort(function(F,B){return B-F}).filter(function(F,B,j){return j.indexOf(F)===B}).map(function(F){return g.filter(function(B){return B.priority===F}).sort(function(B,j){return j.subPriority-B.subPriority})}).map(function(F){return F[0]}),P=ir(r);if(isNaN(P))return new Date(NaN);var x=a5e(P,I1(P)),T={};for(v=0;v=n&&r<=i}function hle(t){Kt(1,arguments);var e;if(t&&typeof t.forEach=="function")e=t;else if(typeof t=="object"&&t!==null)e=Array.prototype.slice.call(t);else return new Date(NaN);var r;return e.forEach(function(n){var i=ir(n);(r===void 0||ri||isNaN(i.getDate()))&&(r=i)}),r||new Date(NaN)}var b5e=36e5,x5e=6e4,hKe=2,YI={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},pKe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,gKe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,vKe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function nl(t,e){Kt(1,arguments);var r={},n=r.additionalDigits==null?hKe:An(r.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=mKe(t),a;if(i.date){var o=yKe(i.date,n);a=wKe(o.restDateString,o.year)}if(isNaN(a)||!a)return new Date(NaN);var s=a.getTime(),l=0,c;if(i.time&&(l=bKe(i.time),isNaN(l)||l===null))return new Date(NaN);if(i.timezone){if(c=xKe(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(s+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+l+c)}function mKe(t){var e={},r=t.split(YI.dateTimeDelimiter),n;if(r.length>2)return e;if(/:/.test(r[0])?(e.date=null,n=r[0]):(e.date=r[0],n=r[1],YI.timeZoneDelimiter.test(e.date)&&(e.date=t.split(YI.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){var i=YI.timezone.exec(n);i?(e.time=n.replace(i[1],""),e.timezone=i[1]):e.time=n}return e}function yKe(t,e){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(r);if(!n)return{year:null};var i=n[1]&&parseInt(n[1]),a=n[2]&&parseInt(n[2]);return{year:a==null?i:a*100,restDateString:t.slice((n[1]||n[2]).length)}}function wKe(t,e){if(e===null)return null;var r=t.match(pKe);if(!r)return null;var n=!!r[4],i=LC(r[1]),a=LC(r[2])-1,o=LC(r[3]),s=LC(r[4]),l=LC(r[5])-1;if(n)return TKe(e,s,l)?_Ke(e,s,l):new Date(NaN);var c=new Date(0);return!CKe(e,a,o)||!AKe(e,i)?new Date(NaN):(c.setUTCFullYear(e,a,Math.max(i,o)),c)}function LC(t){return t?parseInt(t):1}function bKe(t){var e=t.match(gKe);if(!e)return null;var r=vU(e[1]),n=vU(e[2]),i=vU(e[3]);return EKe(r,n,i)?r*b5e+n*x5e+i*1e3:NaN}function vU(t){return t&&parseFloat(t.replace(",","."))||0}function xKe(t){if(t==="Z")return 0;var e=t.match(vKe);if(!e)return 0;var r=e[1]==="+"?-1:1,n=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return IKe(n,i)?r*(n*b5e+i*x5e):NaN}function _Ke(t,e,r){var n=new Date(0);n.setUTCFullYear(t,0,4);var i=n.getUTCDay()||7,a=(e-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}var SKe=[31,null,31,30,31,30,31,31,30,31,30,31];function _5e(t){return t%400===0||t%4===0&&t%100}function CKe(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(SKe[e]||(_5e(t)?29:28))}function AKe(t,e){return e>=1&&e<=(_5e(t)?366:365)}function TKe(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function EKe(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function IKe(t,e){return e>=0&&e<=59}function yp(t,e){Kt(2,arguments);var r=ir(t),n=An(e),i=r.getFullYear(),a=r.getDate(),o=new Date(0);o.setFullYear(i,n,15),o.setHours(0,0,0,0);var s=jYe(o);return r.setMonth(n,Math.min(a,s)),r}function OA(t,e){Kt(2,arguments);var r=ir(t),n=An(e);return r.setHours(n),r}function LA(t,e){Kt(2,arguments);var r=ir(t),n=An(e);return r.setMinutes(n),r}function nA(t,e){Kt(2,arguments);var r=ir(t),n=An(e),i=Math.floor(r.getMonth()/3)+1,a=n-i;return yp(r,r.getMonth()+a*3)}function kKe(t,e){Kt(2,arguments);var r=ir(t),n=An(e);return r.setSeconds(n),r}function gD(t,e){Kt(2,arguments);var r=ir(t),n=An(e);return isNaN(r.getTime())?new Date(NaN):(r.setFullYear(n),r)}function PKe(t,e){Kt(2,arguments);var r=An(e);return DX(t,-r)}function vD(t,e){Kt(2,arguments);var r=An(e);return W6(t,-r)}const Wi=(t,e="yyyy/MM/dd HH:mm:ss")=>{const r=!t||t==="now"||t==="current"?new Date().toISOString():new Date(t).toISOString(),n=nl(r);return v5e(n,e,"UTC")},gle=(t,e={})=>{const r=e.unit,n=e.prefix||"> ",i=e.suffix||"",a=e.longhand,o=Wi("current"),s=NA(o,"yyyy/MM/dd HH:mm:ss",new Date(o)),l=NA(t,"yyyy/MM/dd HH:mm:ss",new Date(t)),c=BYe(s,l,{roundingMethod:"floor",unit:r});if(!a){let u=c.replace("seconds","second");return u=u.replace("second","s"),u=u.replace("minutes","minute"),u=u.replace("minute","m"),u=u.replace("hours","hour"),u=u.replace("hour","h"),u=u.replace("years","year"),u=u.replace("year","y"),u=u.replace(" ",""),`${n}${u}${i}`}return`${n}${c}${i}`},lu=(t,e)=>{const r=new Date(t.getTime());return r.setDate(r.getDate()-e),r},RKe=(t=0,e=2)=>{const a=o=>o.toLocaleString("en-US",{maximumFractionDigits:e});if(t>=86400){const o=a(t/86400);return`${o} Day${o>1?"s":""}`}if(t>=3600){const o=a(t/3600);return`${o} Hour${o>1?"s":""}`}if(t>=60){const o=a(t/60);return`${o} Minute${o>1?"s":""}`}return`${a(t)} Second${t>1?"s":""}`},vle={DAY:"DAY",HOUR:"HOUR",MONTH:"MONTH"},MKe=()=>[{type:"date",label:"from date",field:"fromDate"},{type:"date",label:"to date",field:"toDate"},{type:"dropdown",dropdown:vle,initialValue:vle.DAY,label:"granularity",field:"granularity"},{type:"checkbox",label:"Include advanced metrics",field:"advancedMetrics"}];var JW;try{JW=Map}catch{}var eq;try{eq=Set}catch{}function S5e(t,e,r){if(!t||typeof t!="object"||typeof t=="function")return t;if(t.nodeType&&"cloneNode"in t)return t.cloneNode(!0);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);if(Array.isArray(t))return t.map(tq);if(JW&&t instanceof JW)return new Map(Array.from(t.entries()));if(eq&&t instanceof eq)return new Set(Array.from(t.values()));if(t instanceof Object){e.push(t);var n=Object.create(t);r.push(n);for(var i in t){var a=e.findIndex(function(o){return o===t[i]});n[i]=a>-1?r[a]:S5e(t[i],e,r)}return n}return t}function tq(t){return S5e(t,[],[])}const DKe=Object.prototype.toString,NKe=Error.prototype.toString,OKe=RegExp.prototype.toString,LKe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",$Ke=/^Symbol\((.*)\)(.*)$/;function BKe(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function mle(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const r=typeof t;if(r==="number")return BKe(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return LKe.call(t).replace($Ke,"Symbol($1)");const n=DKe.call(t).slice(8,-1);return n==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):n==="Error"||t instanceof Error?"["+NKe.call(t)+"]":n==="RegExp"?OKe.call(t):null}function Z3(t,e){let r=mle(t,e);return r!==null?r:JSON.stringify(t,function(n,i){let a=mle(this[n],e);return a!==null?a:i},2)}let Cw={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{let i=n!=null&&n!==r,a=`${t} must be a \`${e}\` type, but the final value was: \`${Z3(r,!0)}\``+(i?` (cast from the value \`${Z3(n,!0)}\`).`:".");return r===null&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},Md={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},sm={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},rq={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},nq={isValue:"${path} field must be ${value}"},iq={noUnknown:"${path} field has unspecified keys: ${unknown}"},_P={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};Object.assign(Object.create(null),{mixed:Cw,string:Md,number:sm,date:rq,object:iq,array:_P,boolean:nq});var FKe=Object.prototype,jKe=FKe.hasOwnProperty;function UKe(t,e){return t!=null&&jKe.call(t,e)}var zKe=UKe,HKe=Array.isArray,ny=HKe,KI={},VKe=typeof KI=="object"&&KI&&KI.Object===Object&&KI,C5e=VKe,GKe=C5e,WKe=typeof self=="object"&&self&&self.Object===Object&&self,qKe=GKe||WKe||Function("return this")(),mv=qKe,YKe=mv,KKe=YKe.Symbol,SL=KKe,yle=SL,A5e=Object.prototype,ZKe=A5e.hasOwnProperty,QKe=A5e.toString,$C=yle?yle.toStringTag:void 0;function XKe(t){var e=ZKe.call(t,$C),r=t[$C];try{t[$C]=void 0;var n=!0}catch{}var i=QKe.call(t);return n&&(e?t[$C]=r:delete t[$C]),i}var JKe=XKe,eZe=Object.prototype,tZe=eZe.toString;function rZe(t){return tZe.call(t)}var nZe=rZe,wle=SL,iZe=JKe,aZe=nZe,oZe="[object Null]",sZe="[object Undefined]",ble=wle?wle.toStringTag:void 0;function lZe(t){return t==null?t===void 0?sZe:oZe:ble&&ble in Object(t)?iZe(t):aZe(t)}var t8=lZe;function cZe(t){return t!=null&&typeof t=="object"}var r8=cZe,uZe=t8,fZe=r8,dZe="[object Symbol]";function hZe(t){return typeof t=="symbol"||fZe(t)&&uZe(t)==dZe}var NX=hZe,pZe=ny,gZe=NX,vZe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mZe=/^\w*$/;function yZe(t,e){if(pZe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||gZe(t)?!0:mZe.test(t)||!vZe.test(t)||e!=null&&t in Object(e)}var OX=yZe;function wZe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var LX=wZe,bZe=t8,xZe=LX,_Ze="[object AsyncFunction]",SZe="[object Function]",CZe="[object GeneratorFunction]",AZe="[object Proxy]";function TZe(t){if(!xZe(t))return!1;var e=bZe(t);return e==SZe||e==CZe||e==_Ze||e==AZe}var T5e=TZe,EZe=mv,IZe=EZe["__core-js_shared__"],kZe=IZe,mU=kZe,xle=function(){var t=/[^.]+$/.exec(mU&&mU.keys&&mU.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function PZe(t){return!!xle&&xle in t}var RZe=PZe,MZe=Function.prototype,DZe=MZe.toString;function NZe(t){if(t!=null){try{return DZe.call(t)}catch{}try{return t+""}catch{}}return""}var E5e=NZe,OZe=T5e,LZe=RZe,$Ze=LX,BZe=E5e,FZe=/[\\^$.*+?()[\]{}|]/g,jZe=/^\[object .+?Constructor\]$/,UZe=Function.prototype,zZe=Object.prototype,HZe=UZe.toString,VZe=zZe.hasOwnProperty,GZe=RegExp("^"+HZe.call(VZe).replace(FZe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function WZe(t){if(!$Ze(t)||LZe(t))return!1;var e=OZe(t)?GZe:jZe;return e.test(BZe(t))}var qZe=WZe;function YZe(t,e){return t==null?void 0:t[e]}var KZe=YZe,ZZe=qZe,QZe=KZe;function XZe(t,e){var r=QZe(t,e);return ZZe(r)?r:void 0}var B2=XZe,JZe=B2,eQe=JZe(Object,"create"),CL=eQe,_le=CL;function tQe(){this.__data__=_le?_le(null):{},this.size=0}var rQe=tQe;function nQe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var iQe=nQe,aQe=CL,oQe="__lodash_hash_undefined__",sQe=Object.prototype,lQe=sQe.hasOwnProperty;function cQe(t){var e=this.__data__;if(aQe){var r=e[t];return r===oQe?void 0:r}return lQe.call(e,t)?e[t]:void 0}var uQe=cQe,fQe=CL,dQe=Object.prototype,hQe=dQe.hasOwnProperty;function pQe(t){var e=this.__data__;return fQe?e[t]!==void 0:hQe.call(e,t)}var gQe=pQe,vQe=CL,mQe="__lodash_hash_undefined__";function yQe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=vQe&&e===void 0?mQe:e,this}var wQe=yQe,bQe=rQe,xQe=iQe,_Qe=uQe,SQe=gQe,CQe=wQe;function oS(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}var UQe=jQe,zQe=AL;function HQe(t,e){var r=this.__data__,n=zQe(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var VQe=HQe,GQe=EQe,WQe=OQe,qQe=BQe,YQe=UQe,KQe=VQe;function sS(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=sJe}var jX=lJe,cJe=NX,uJe=1/0;function fJe(t){if(typeof t=="string"||cJe(t))return t;var e=t+"";return e=="0"&&1/t==-uJe?"-0":e}var IL=fJe,dJe=R5e,hJe=D5e,pJe=ny,gJe=N5e,vJe=jX,mJe=IL;function yJe(t,e,r){e=dJe(e,t);for(var n=-1,i=e.length,a=!1;++nt&&t.__isYupSchema__;class SJe{constructor(e,r){if(this.refs=e,this.refs=e,typeof r=="function"){this.fn=r;return}if(!mD(r,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:a}=r,o=typeof n=="function"?n:(...s)=>s.every(l=>l===n);this.fn=function(...s){let l=s.pop(),c=s.pop(),u=o(...s)?i:a;if(u)return typeof u=="function"?u(c):c.concat(u.resolve(l))}}resolve(e,r){let n=this.refs.map(a=>a.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),i=this.fn.apply(e,n.concat(e,r));if(i===void 0||i===e)return e;if(!UX(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}function L5e(t){return t==null?[]:[].concat(t)}function aq(){return aq=Object.assign||function(t){for(var e=1;eZ3(r[a])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,n,i){super(),this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],L5e(e).forEach(a=>{Sc.isError(a)?(this.errors.push(...a.errors),this.inner=this.inner.concat(a.inner.length?a.inner:a)):this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,Sc)}}const AJe=t=>{let e=!1;return(...r)=>{e||(e=!0,t(...r))}};function yD(t,e){let{endEarly:r,tests:n,args:i,value:a,errors:o,sort:s,path:l}=t,c=AJe(e),u=n.length;const f=[];if(o=o||[],!u)return o.length?c(new Sc(o,a,l)):c(null,a);for(let d=0;ds))return!1;var c=a.get(t),u=a.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=r&Utt?new $tt:void 0;for(a.set(t,e),a.set(e,t);++f=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var Pit=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Q5e=/^\d+$/,Rit=/^\d/,Mit=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Dit=/^\s*(['"]?)(.*?)(\1)\s*$/,HX=512,Yle=new F2(HX),Kle=new F2(HX),Zle=new F2(HX),kL={Cache:F2,split:fq,normalizePath:bU,setter:function(t){var e=bU(t);return Kle.get(t)||Kle.set(t,function(n,i){for(var a=0,o=e.length,s=n;a=0)&&(r[i]=t[i]);return r}function XI(t){function e(r,n){let{value:i,path:a="",label:o,options:s,originalValue:l,sync:c}=r,u=Fit(r,["value","path","label","options","originalValue","sync"]);const{name:f,test:d,params:h,message:p}=t;let{parent:g,context:v}=s;function y(A){return k1.isRef(A)?A.getValue(i,g,v):A}function m(A={}){const S=Z5e(_D({value:i,originalValue:l,label:o,path:A.path||a},h,A.params),y),I=new Sc(Sc.formatError(A.message||p,S),i,S.path,A.type||f);return I.params=S,I}let b=_D({path:a,parent:g,type:f,createError:m,resolve:y,options:s,originalValue:l},u);if(!c){try{Promise.resolve(d.call(b,i,b)).then(A=>{Sc.isError(A)?n(A):A?n(null,A):n(m())})}catch(A){n(A)}return}let w;try{var C;if(w=d.call(b,i,b),typeof((C=w)==null?void 0:C.then)=="function")throw new Error(`Validation test of type: "${b.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(A){n(A);return}Sc.isError(w)?n(w):w?n(null,w):n(m())}return e.OPTIONS=t,e}let jit=t=>t.substr(0,t.length-1).substr(1);function Uit(t,e,r,n=r){let i,a,o;return e?(kL.forEach(e,(s,l,c)=>{let u=l?jit(s):s;if(t=t.resolve({context:n,parent:i,value:r}),t.innerType){let f=c?parseInt(u,10):0;if(r&&f>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${e}. because there is no value at that index. `);i=r,r=r&&r[f],t=t.innerType}if(!c){if(!t.fields||!t.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${t._type}")`);i=r,r=r&&r[u],t=t.fields[u]}a=u,o=l?"["+s+"]":"."+s}),{schema:t,parent:i,parentPath:a}):{parent:i,parentPath:e,schema:t}}class SD{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const e=[];for(const r of this.list)e.push(r);for(const[,r]of this.refs)e.push(r.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){k1.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){k1.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,r){if(this.list.has(e))return!0;let n,i=this.refs.values();for(;n=i.next(),!n.done;)if(r(n.value)===e)return!0;return!1}clone(){const e=new SD;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,r){const n=this.clone();return e.list.forEach(i=>n.add(i)),e.refs.forEach(i=>n.add(i)),r.list.forEach(i=>n.delete(i)),r.refs.forEach(i=>n.delete(i)),n}}function pf(){return pf=Object.assign||function(t){for(var e=1;e{this.typeError(Cw.notType)}),this.type=(e==null?void 0:e.type)||"mixed",this.spec=pf({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},e==null?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeError=this._typeError,r._whitelistError=this._whitelistError,r._blacklistError=this._blacklistError,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.exclusiveTests=pf({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=tq(pf({},this.spec,e)),r}label(e){var r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=r,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,n=e.clone();const i=pf({},r.spec,n.spec);return n.spec=i,n._typeError||(n._typeError=r._typeError),n._whitelistError||(n._whitelistError=r._whitelistError),n._blacklistError||(n._blacklistError=r._blacklistError),n._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(a=>{e.tests.forEach(o=>{a.test(o.OPTIONS)})}),n}isType(e){return this.spec.nullable&&e===null?!0:this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((i,a)=>a.resolve(i,e),r),r=r.resolve(e)}return r}cast(e,r={}){let n=this.resolve(pf({value:e},r)),i=n._cast(e,r);if(e!==void 0&&r.assert!==!1&&n.isType(i)!==!0){let a=Z3(e),o=Z3(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". - -attempted value: ${a} -`+(o!==a?`result of cast: ${o}`:""))}return i}_cast(e,r){let n=e===void 0?e:this.transforms.reduce((i,a)=>a.call(this,i,e,this),e);return n===void 0&&(n=this.getDefault()),n}_validate(e,r={},n){let{sync:i,path:a,from:o=[],originalValue:s=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=r,u=e;l||(u=this._cast(u,pf({assert:!1},r)));let f={value:u,path:a,options:r,originalValue:s,schema:this,label:this.spec.label,sync:i,from:o},d=[];this._typeError&&d.push(this._typeError),this._whitelistError&&d.push(this._whitelistError),this._blacklistError&&d.push(this._blacklistError),yD({args:f,value:u,path:a,sync:i,tests:d,endEarly:c},h=>{if(h)return void n(h,u);yD({tests:this.tests,args:f,path:a,sync:i,value:u,endEarly:c},n)})}validate(e,r,n){let i=this.resolve(pf({},r,{value:e}));return typeof n=="function"?i._validate(e,r,n):new Promise((a,o)=>i._validate(e,r,(s,l)=>{s?o(s):a(l)}))}validateSync(e,r){let n=this.resolve(pf({},r,{value:e})),i;return n._validate(e,pf({},r,{sync:!0}),(a,o)=>{if(a)throw a;i=o}),i}isValid(e,r){return this.validate(e,r).then(()=>!0,n=>{if(Sc.isError(n))return!1;throw n})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(n){if(Sc.isError(n))return!1;throw n}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):tq(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){var r=this.clone();return r.spec.strict=e,r}_isPresent(e){return e!=null}defined(e=Cw.defined){return this.test({message:e,name:"defined",exclusive:!0,test(r){return r!==void 0}})}required(e=Cw.required){return this.clone({presence:"required"}).withMutation(r=>r.test({message:e,name:"required",exclusive:!0,test(n){return this.schema._isPresent(n)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e}nullable(e=!0){var r=this.clone({nullable:e!==!1});return r}transform(e){var r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=Cw.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=XI(r),a=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let n=this.clone(),i=L5e(e).map(a=>new k1(a));return i.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(new SJe(i,r)),n}typeError(e){var r=this.clone();return r._typeError=XI({message:e,name:"typeError",test(n){return n!==void 0&&!this.schema.isType(n)?this.createError({params:{type:this.schema._type}}):!0}}),r}oneOf(e,r=Cw.oneOf){var n=this.clone();return e.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n._whitelistError=XI({message:r,name:"oneOf",test(i){if(i===void 0)return!0;let a=this.schema._whitelist;return a.has(i,this.resolve)?!0:this.createError({params:{values:a.toArray().join(", ")}})}}),n}notOneOf(e,r=Cw.notOneOf){var n=this.clone();return e.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n._blacklistError=XI({message:r,name:"notOneOf",test(i){let a=this.schema._blacklist;return a.has(i,this.resolve)?this.createError({params:{values:a.toArray().join(", ")}}):!0}}),n}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(){const e=this.clone(),{label:r,meta:n}=e.spec;return{meta:n,label:r,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,o,s)=>s.findIndex(l=>l.name===a.name)===o)}}}Rs.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])Rs.prototype[`${t}At`]=function(e,r,n={}){const{parent:i,parentPath:a,schema:o}=Uit(this,e,r,n.context);return o[t](i&&i[a],pf({},n,{parent:i,path:e}))};for(const t of["equals","is"])Rs.prototype[t]=Rs.prototype.oneOf;for(const t of["not","nope"])Rs.prototype[t]=Rs.prototype.notOneOf;Rs.prototype.optional=Rs.prototype.notRequired;const X5e=Rs;function J5e(){return new X5e}J5e.prototype=X5e.prototype;const ja=t=>t==null;function eSe(){return new tSe}class tSe extends Rs{constructor(){super({type:"boolean"}),this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}isTrue(e=nq.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return ja(r)||r===!0}})}isFalse(e=nq.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return ja(r)||r===!1}})}}eSe.prototype=tSe.prototype;let zit=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,Hit=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Vit=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Git=t=>ja(t)||t===t.trim(),Wit={}.toString();function ts(){return new rSe}class rSe extends Rs{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;const r=e!=null&&e.toString?e.toString():e;return r===Wit?e:r})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,r=Md.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},test(n){return ja(n)||n.length===this.resolve(e)}})}min(e,r=Md.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(n){return ja(n)||n.length>=this.resolve(e)}})}max(e,r=Md.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:e},test(n){return ja(n)||n.length<=this.resolve(e)}})}matches(e,r){let n=!1,i,a;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:i,name:a}=r:i=r),this.test({name:a||"matches",message:i||Md.matches,params:{regex:e},test:o=>ja(o)||o===""&&n||o.search(e)!==-1})}email(e=Md.email){return this.matches(zit,{name:"email",message:e,excludeEmptyString:!0})}url(e=Md.url){return this.matches(Hit,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Md.uuid){return this.matches(Vit,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=Md.trim){return this.transform(r=>r!=null?r.trim():r).test({message:e,name:"trim",test:Git})}lowercase(e=Md.lowercase){return this.transform(r=>ja(r)?r:r.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:r=>ja(r)||r===r.toLowerCase()})}uppercase(e=Md.uppercase){return this.transform(r=>ja(r)?r:r.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:r=>ja(r)||r===r.toUpperCase()})}}ts.prototype=rSe.prototype;let qit=t=>t!=+t;function Of(){return new nSe}class nSe extends Rs{constructor(){super({type:"number"}),this.withMutation(()=>{this.transform(function(e){let r=e;if(typeof r=="string"){if(r=r.replace(/\s/g,""),r==="")return NaN;r=+r}return this.isType(r)?r:parseFloat(r)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!qit(e)}min(e,r=sm.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(n){return ja(n)||n>=this.resolve(e)}})}max(e,r=sm.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:e},test(n){return ja(n)||n<=this.resolve(e)}})}lessThan(e,r=sm.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:e},test(n){return ja(n)||nthis.resolve(e)}})}positive(e=sm.positive){return this.moreThan(0,e)}negative(e=sm.negative){return this.lessThan(0,e)}integer(e=sm.integer){return this.test({name:"integer",message:e,test:r=>ja(r)||Number.isInteger(r)})}truncate(){return this.transform(e=>ja(e)?e:e|0)}round(e){var r,n=["ceil","floor","round","trunc"];if(e=((r=e)==null?void 0:r.toLowerCase())||"round",e==="trunc")return this.truncate();if(n.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(i=>ja(i)?i:Math[e](i))}}Of.prototype=nSe.prototype;var Yit=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Kit(t){var e=[1,4,5,6,7,10,11],r=0,n,i;if(i=Yit.exec(t)){for(var a=0,o;o=e[a];++a)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?n=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(r=i[10]*60+i[11],i[9]==="+"&&(r=0-r)),n=Date.UTC(i[1],i[2],i[3],i[4],i[5]+r,i[6],i[7]))}else n=Date.parse?Date.parse(t):NaN;return n}let GX=new Date(""),Zit=t=>Object.prototype.toString.call(t)==="[object Date]";function V_(){return new WX}class WX extends Rs{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=Kit(e),isNaN(e)?GX:new Date(e))})})}_typeCheck(e){return Zit(e)&&!isNaN(e.getTime())}prepareParam(e,r){let n;if(k1.isRef(e))n=e;else{let i=this.cast(e);if(!this._typeCheck(i))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(e,r=rq.min){let n=this.prepareParam(e,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(i){return ja(i)||i>=this.resolve(n)}})}max(e,r=rq.max){var n=this.prepareParam(e,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:e},test(i){return ja(i)||i<=this.resolve(n)}})}}WX.INVALID_DATE=GX;V_.prototype=WX.prototype;V_.INVALID_DATE=GX;function Qit(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++ii?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n=n?t:cot(t,e,r)}var fot=uot,dot="\\ud800-\\udfff",hot="\\u0300-\\u036f",pot="\\ufe20-\\ufe2f",got="\\u20d0-\\u20ff",vot=hot+pot+got,mot="\\ufe0e\\ufe0f",yot="\\u200d",wot=RegExp("["+yot+dot+vot+mot+"]");function bot(t){return wot.test(t)}var ySe=bot;function xot(t){return t.split("")}var _ot=xot,wSe="\\ud800-\\udfff",Sot="\\u0300-\\u036f",Cot="\\ufe20-\\ufe2f",Aot="\\u20d0-\\u20ff",Tot=Sot+Cot+Aot,Eot="\\ufe0e\\ufe0f",Iot="["+wSe+"]",dq="["+Tot+"]",hq="\\ud83c[\\udffb-\\udfff]",kot="(?:"+dq+"|"+hq+")",bSe="[^"+wSe+"]",xSe="(?:\\ud83c[\\udde6-\\uddff]){2}",_Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Pot="\\u200d",SSe=kot+"?",CSe="["+Eot+"]?",Rot="(?:"+Pot+"(?:"+[bSe,xSe,_Se].join("|")+")"+CSe+SSe+")*",Mot=CSe+SSe+Rot,Dot="(?:"+[bSe+dq+"?",dq,xSe,_Se,Iot].join("|")+")",Not=RegExp(hq+"(?="+hq+")|"+Dot+Mot,"g");function Oot(t){return t.match(Not)||[]}var Lot=Oot,$ot=_ot,Bot=ySe,Fot=Lot;function jot(t){return Bot(t)?Fot(t):$ot(t)}var Uot=jot,zot=fot,Hot=ySe,Vot=Uot,Got=n8;function Wot(t){return function(e){e=Got(e);var r=Hot(e)?Vot(e):void 0,n=r?r[0]:e.charAt(0),i=r?zot(r,1).join(""):e.slice(1);return n[t]()+i}}var qot=Wot,Yot=qot,Kot=Yot("toUpperCase"),Zot=Kot,Qot=n8,Xot=Zot;function Jot(t){return Xot(Qot(t).toLowerCase())}var est=Jot,tst=est,rst=mSe,nst=rst(function(t,e,r){return e=e.toLowerCase(),t+(r?tst(e):e)}),ist=nst;const ast=Un(ist);var ost=$5e,sst=j5e,lst=K5e;function cst(t,e){var r={};return e=lst(e),sst(t,function(n,i,a){ost(r,e(n,i,a),n)}),r}var ust=cst;const fst=Un(ust);var qX={exports:{}};qX.exports=function(t){return ASe(dst(t),t)};qX.exports.array=ASe;function ASe(t,e){var r=t.length,n=new Array(r),i={},a=r,o=hst(e),s=pst(t);for(e.forEach(function(c){if(!s.has(c[0])||!s.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||l(t[a],a,new Set);return n;function l(c,u,f){if(f.has(c)){var d;try{d=", node was:"+JSON.stringify(c)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!s.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[u]){i[u]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),u=h.length){f.add(c);do{var p=h[--u];l(p,s.get(p),f)}while(u);f.delete(c)}n[--r]=c}}}function dst(t){for(var e=new Set,r=0,n=t.length;ri(s,a))}return vst.array(n,r).reverse()}function rce(t,e){let r=1/0;return t.some((n,i)=>{var a;if(((a=e.path)==null?void 0:a.indexOf(n))!==-1)return r=i,!0}),r}function TSe(t){return(e,r)=>rce(t,e)-rce(t,r)}function G_(){return G_=Object.assign||function(t){for(var e=1;eObject.prototype.toString.call(t)==="[object Object]";function yst(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter(n=>r.indexOf(n)===-1)}const wst=TSe([]);class ESe extends Rs{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=wst,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null}),e&&this.shape(e)})}_typeCheck(e){return nce(e)||typeof e=="function"}_cast(e,r={}){var n;let i=super._cast(e,r);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let a=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,s=this._nodes.concat(Object.keys(i).filter(f=>this._nodes.indexOf(f)===-1)),l={},c=G_({},r,{parent:l,__validating:r.__validating||!1}),u=!1;for(const f of s){let d=a[f],h=mD(i,f);if(d){let p,g=i[f];c.path=(r.path?`${r.path}.`:"")+f,d=d.resolve({value:g,context:r.context,parent:l});let v="spec"in d?d.spec:void 0,y=v==null?void 0:v.strict;if(v!=null&&v.strip){u=u||f in i;continue}p=!r.__validating||!y?d.cast(i[f],c):i[f],p!==void 0&&(l[f]=p)}else h&&!o&&(l[f]=i[f]);l[f]!==i[f]&&(u=!0)}return u?l:i}_validate(e,r={},n){let i=[],{sync:a,from:o=[],originalValue:s=e,abortEarly:l=this.spec.abortEarly,recursive:c=this.spec.recursive}=r;o=[{schema:this,value:s},...o],r.__validating=!0,r.originalValue=s,r.from=o,super._validate(e,r,(u,f)=>{if(u){if(!Sc.isError(u)||l)return void n(u,f);i.push(u)}if(!c||!nce(f)){n(i[0]||null,f);return}s=s||f;let d=this._nodes.map(h=>(p,g)=>{let v=h.indexOf(".")===-1?(r.path?`${r.path}.`:"")+h:`${r.path||""}["${h}"]`,y=this.fields[h];if(y&&"validate"in y){y.validate(f[h],G_({},r,{path:v,from:o,strict:!0,parent:f,originalValue:s[h]}),g);return}g(null)});yD({sync:a,tests:d,value:f,errors:i,endEarly:l,sort:this._sortErrors,path:r.path},n)})}clone(e){const r=super.clone(e);return r.fields=G_({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(e){let r=super.concat(e),n=r.fields;for(let[i,a]of Object.entries(this.fields)){const o=n[i];o===void 0?n[i]=a:o instanceof Rs&&a instanceof Rs&&(n[i]=a.concat(o))}return r.withMutation(()=>r.shape(n))}getDefaultFromShape(){let e={};return this._nodes.forEach(r=>{const n=this.fields[r];e[r]="default"in n?n.getDefault():void 0}),e}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(e,r=[]){let n=this.clone(),i=Object.assign(n.fields,e);if(n.fields=i,n._sortErrors=TSe(Object.keys(i)),r.length){Array.isArray(r[0])||(r=[r]);let a=r.map(([o,s])=>`${o}-${s}`);n._excludedEdges=n._excludedEdges.concat(a)}return n._nodes=mst(i,n._excludedEdges),n}pick(e){const r={};for(const n of e)this.fields[n]&&(r[n]=this.fields[n]);return this.clone().withMutation(n=>(n.fields={},n.shape(r)))}omit(e){const r=this.clone(),n=r.fields;r.fields={};for(const i of e)delete n[i];return r.withMutation(()=>r.shape(n))}from(e,r,n){let i=kL.getter(e,!0);return this.transform(a=>{if(a==null)return a;let o=a;return mD(a,e)&&(o=G_({},a),n||delete o[e],o[r]=i(a)),o})}noUnknown(e=!0,r=iq.noUnknown){typeof e=="string"&&(r=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(i){if(i==null)return!0;const a=yst(this.schema,i);return!e||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,r=iq.noUnknown){return this.noUnknown(!e,r)}transformKeys(e){return this.transform(r=>r&&fst(r,(n,i)=>e(i)))}camelCase(){return this.transformKeys(ast)}snakeCase(){return this.transformKeys(tce)}constantCase(){return this.transformKeys(e=>tce(e).toUpperCase())}describe(){let e=super.describe();return e.fields=Z5e(this.fields,r=>r.describe()),e}}function Sf(t){return new ESe(t)}Sf.prototype=ESe.prototype;function CD(){return CD=Object.assign||function(t){for(var e=1;e{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,r){const n=super._cast(e,r);if(!this._typeCheck(n)||!this.innerType)return n;let i=!1;const a=n.map((o,s)=>{const l=this.innerType.cast(o,CD({},r,{path:`${r.path||""}[${s}]`}));return l!==o&&(i=!0),l});return i?a:n}_validate(e,r={},n){var i,a;let o=[],s=r.sync,l=r.path,c=this.innerType,u=(i=r.abortEarly)!=null?i:this.spec.abortEarly,f=(a=r.recursive)!=null?a:this.spec.recursive,d=r.originalValue!=null?r.originalValue:e;super._validate(e,r,(h,p)=>{if(h){if(!Sc.isError(h)||u)return void n(h,p);o.push(h)}if(!f||!c||!this._typeCheck(p)){n(o[0]||null,p);return}d=d||p;let g=new Array(p.length);for(let v=0;vc.validate(y,b,C)}yD({sync:s,path:l,value:p,errors:o,endEarly:u,tests:g},n)})}clone(e){const r=super.clone(e);return r.innerType=this.innerType,r}concat(e){let r=super.concat(e);return r.innerType=this.innerType,e.innerType&&(r.innerType=r.innerType?r.innerType.concat(e.innerType):e.innerType),r}of(e){let r=this.clone();if(!UX(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Z3(e));return r.innerType=e,r}length(e,r=_P.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},test(n){return ja(n)||n.length===this.resolve(e)}})}min(e,r){return r=r||_P.min,this.test({message:r,name:"min",exclusive:!0,params:{min:e},test(n){return ja(n)||n.length>=this.resolve(e)}})}max(e,r){return r=r||_P.max,this.test({message:r,name:"max",exclusive:!0,params:{max:e},test(n){return ja(n)||n.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,r)=>this._typeCheck(e)?e:r==null?[]:[].concat(r))}compact(e){let r=e?(n,i,a)=>!e(n,i,a):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}pq.prototype=ISe.prototype;const bst=()=>Sf().shape({fromDate:V_().when("toDate",{is:t=>!!t,then:V_().max(Bit("toDate"),({max:t})=>`From date must be before ${new Date(t).toLocaleDateString()}`),otherwise:V_().max(new Date,`From date must be before ${new Date().toLocaleDateString()}`)}).when("toDate",(t,e)=>e.test({test:r=>new Date(r).toLocaleDateString()!==new Date(t).toLocaleDateString(),message:"To and From dates must be different"})),toDate:V_().required("To date is required").max(new Date,`To date must be on or before ${new Date().toLocaleDateString()}`),granularity:ts().matches(/(DAY|HOUR|MONTH)/),advancedMetric:eSe()}),ice=t=>Array.isArray(t),Rn=t=>[Object,Array].includes((t||{}).constructor)&&!Object.entries(t||{}).length,xst=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")};function _st(t,e=1){if(t===0)return"0 bytes";const r=1024,n=e<0?0:e,i=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],a=Math.floor(Math.log(t)/Math.log(r));return`${parseFloat((t/r**a).toFixed(n))} ${i[a]}`}const d3=(t=0,e,r=!1)=>{let n=JSON.parse(GW("assetMetadata",!0)||"[]");n.length===0&&(n=window.localStorage.getItem("assetMetadata"),n&&(n=JSON.parse(n)));const i=n==null?void 0:n.find(u=>u.base===e||r&&u.display===e);if(isNaN(t)||!i||!(i!=null&&i.denomUnits))return{amount:t,denom:e};const{base:a,display:o,denomUnits:s}=i;let{exponent:l}=s.find(({denom:u})=>u===o);l=r?l:l*-1;const c=r?a:o;return{amount:new va(t).times(new va(10).pow(l)).toFixed(),denom:c}},Qn=(t,e=1,r={})=>{if(t==null||t===""||t==="--")return t;if(r.shorthand){let a="",o=t;const s=1e12,l=1e9,c=1e6,u=1e3;return t>=s?(a="T",o=t/s):t>=l?(a="B",o=t/l):t>=c?(a="M",o=t/c):t>=u&&(a="K",o=t/u),`${o.toLocaleString("en-US",{maximumFractionDigits:e})}${a}`}const n=typeof t=="string"?Number(t):t,i={};return typeof e=="number"&&e>=0&&(i.maximumFractionDigits=e),n.toLocaleString("en-US",{...i,...r})},zt=(t,e,r={})=>{if(!t||!(typeof t!="number")&&!(typeof t!="string"))return t;const{amount:a,denom:o}=d3(t,e),{shorthand:s=!1,decimal:l=7,showDenom:c=!0}=r;return`${Qn(a,l,{shorthand:s,...r})} ${c?o:""}`},YX=t=>Kr(t.replace(/([A-Z])/g," $1")),Kr=(t="")=>!t||typeof t!="string"?t:t.replaceAll("_"," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.substring(1)).join(" "),Rr=(t,e,r="end")=>{if(typeof t!="string"&&typeof(t==null?void 0:t.toString)=="function"&&(t=t.toString()),typeof t!="string")return"";const n=!isNaN(r),i=r==="end",a=r==="start";if(!(n&&n>0&&r<=e||i||a)||t.length<=e)return t;if(n){const s=`${t.slice(0,r)}`,l=t.split(s)[1].split("").reverse().join(""),c=Math.abs(r-e),f=`${l.slice(0,c)}`.split("").reverse().join("");return`${s}...${f}`}return`${t.slice(0,e)}...`},Sst=(t=[],e)=>{if(!t.length)return t;const r=e.map(({dataName:n})=>n);return t.map(n=>{const i={};return r.forEach(a=>{let o=n;switch(a.split(".").forEach(s=>o=o==null?void 0:o[s]),a){case"ownerAddress":case"holdingAccount":case"delegatorAddr":case"creator":case"admin":case"granter":case"grantee":case"address":i[a]={value:o?Rr(o,11,3):"--",link:o&&`/accounts/${o}`,hover:o||"--",copy:o&&(a==="creator"||a==="admin"||a==="granter"||a==="grantee"||n.copy),raw:o};break;case"signers":{const s=o==null?void 0:o[0].address;i[a]={value:Rr(s,11,3),link:`/accounts/${s}`,addTextToLink:(o==null?void 0:o.length)>1?` +${(o==null?void 0:o.length)-1}`:"",hover:(o==null?void 0:o.length)<=1?s:`${o.length} total signers`};break}case"proposerAddress":case"addressId":i[a]={value:Rr(o,11,3),hover:o,link:`/validator/${o}`};break;case"txHash":{i[a]={value:Rr(o,11,3),link:`/tx/${o}/${n.block}`,hover:o};break}case"proposalTitle":case"title":{const{proposalId:s}=n;i[a]={value:o,hover:o,link:`/proposal/${s}`};break}case"scopeAddr":{i[a]={value:Rr(o,11),hover:o,link:`/nft/${o}`};break}case"contractAddress":i[a]={value:Rr(o,11,3),link:`/contract/${o}`,hover:o};break;case"codeId":i[a]={value:Rr(o,11,3),link:`/code/${o}`,hover:o};break;case"consensusAddress":case"dataHash":case"specAddr":i[a]={value:Rr(o,11,3),hover:o};break;case"balance":{const{count:s="--",denom:l="--"}=o;i[a]={value:zt(s,l,{decimal:6})};break}case"balances":{const{amount:s="--",denom:l="--"}=n||{};i[a]={value:zt(s,l,{decimal:6,showDenom:!1})};break}case"manager":{i[a]={value:Rr(o,11,3),hover:o,link:`/accounts/${o}`};break}case"permissions":{i[a]={value:o.join(", ")};break}case"amount":case"depositAmount":{const{amount:s="--",denom:l="--"}=o||{};i[a]={value:zt(s,l)};break}case"hashAmount":{const{amount:s="--",denom:l="--"}=o||{};i[a]={value:d3(s,l).amount};break}case"fee":case"txFee":{const{amount:s="--",denom:l="--"}=o||{};i[a]={value:zt(s,l,{decimal:20})};break}case"reward":{const{amount:s="--",denom:l="--"}=(o==null?void 0:o[0])||{};i[a]={value:zt(s,l,{decimal:4})};break}case"bondedTokens":case"selfBonded":{const{count:s="--",denom:l="--"}=o||{};i[a]={value:zt(s,l)};break}case"block":case"blockHeight":case"height":i[a]={value:o,link:`/block/${o}`};break;case"denom":case"marker":i[a]={value:n.displayDenom||o,link:`/asset/${o}`};break;case"moniker":{const s=(n==null?void 0:n.addressId)||(n==null?void 0:n.proposerAddress)||(n==null?void 0:n.ownerAddress)||(n==null?void 0:n.holdingAccount)||"";i[a]={value:o,link:`/validator/${s}`,hover:o,blockImage:n&&{icon:n.imgUrl,moniker:o,address:s}};break}case"voter":{const s=!Rn(o.validatorAddr),l=s?"validator":"accounts",c=s?o.validatorAddr:o.address,u=(o==null?void 0:o.moniker)||c;i[a]={value:Rr(u,16,3),link:`/${l}/${c}`,hover:u};break}case"votingTime.endTime":case"votingTime.startTime":{const s=o?Wi(o).slice(0,4)!=="1901"&&Wi(o).slice(0,4)!=="1970"?`${Wi(o)}+UTC`:"--":"N/A";i[a]={value:s,raw:o};break}case"depositEndTime":case"lastUpdated":case"submitTime":case"time":case"lastTx":case"lastTxTimestamp":case"timestamp":case"txTimestamp":case"txTime":{const s=o?`${Wi(o)}+UTC`:"N/A";i[a]={value:s,raw:o};break}case"expiration":{const s=o?`${Wi(o,"MMM dd, yyyy")}`:"N/A";i[a]={value:s,raw:o};break}case"endTime":{const s=o?`${Wi(new Date(o.millis?o.millis:o))}+UTC`:"N/A";i[a]={value:s,raw:o};break}case"txType":case"type":{if(n.granter)i[a]={value:`${Kr(o)}`};else{const{msg:{msgCount:s,displayMsgType:l="--"}}=n,c=s>1?`+${s-1}`:"";i[a]={value:`${Kr(l)} ${c}`}}break}case"votingPower":{const{count:s,total:l}=o||{},c=Qn(s/l*100,4),u=c>=1?`${c}%`:"< 1%";i[a]={value:u};break}case"validatorCount":{const{count:s,total:l}=o||{};i[a]={value:`${s} / ${l}`};break}case"supply":{const{amount:s="--",denom:l="--"}=o;i[a]={value:zt(s,l,{decimals:3,shorthand:!0,showDenom:!1}),hover:`${Qn(s,20)} ${l}`};break}case"commission":case"percentage":{const s=o*100,l=s<1e-4?"<0.0001":Qn(s,4);i[a]={value:`${l} %`};break}case"percentageHolders":{const{count:s,total:l}=n==null?void 0:n.balance;if(s&&l){const c=s/l*100,u=c<1e-4?">0.0001":Qn(c,4);i[a]={value:`${u} %`}}else i[a]={value:"--"};break}case"deposit":{const{current:s,needed:l}=o;if(s&&l){const c=s/l*100,u=c<1e-4?"<0.0001":c>100?">100":Qn(c,4);i[a]={value:`${u}%`}}else i[a]={value:"--"};break}case"events":{i[a]={value:n.scheduled?"Scheduled":n.skipped?"* Skipped":"",hover:o,raw:o};break}case"isProposer":case"didVote":i[a]={value:"",icon:o?"CHECK":a==="didVote"?"CLEAR":"",iconColor:o?"rgb(78, 210, 44)":"red",size:"2.0rem"};break;case"accordion":{i[a]={value:""};break}case"mintable":i[a]={value:Kr(`${o}`)};break;case"upgradeHeight":case"currentVersion":i[a]={value:o,skipped:n.skipped,scheduled:n.scheduled};break;case"upgradeName":i[a]={value:o,externalLink:n.releaseUrl,skipped:n.skipped,scheduled:n.scheduled};break;case"data":i[a]={value:Rr(o,20,3),copy:!0,hover:`${n.attribute} data`,raw:o};break;case"channelStatus":{const s=o.match(/_(.*)/)[1];i[a]={value:Kr(s)};break}case"hr24Change":i[a]={value:o||"--",color:o>0?"rgb(78, 210, 44)":o<0?"red":""};break;case"pricePerToken":case"supply.pricePerToken":{const s=n.displayDenom==="hash"?3:2;i[a]={value:o?`$${zt(n.exponent?o.amount*10**n.exponent:o.amount,o.denom,{decimal:s,minimumFractionDigits:s})}`:a==="pricePerToken"?"--":"-- --"};break}case"totalBalancePrice.amount":i[a]={value:o?`$${zt(o,"USD",{decimal:2,minimumFractionDigits:2})}`:"--"};break;case"range":i[a]={value:o==="1001-"?"1000+":o};break;case"sequence":case"contractCount":case"creationHeight":case"hashBucket":case"metric":case"label":case"percentTotal":case"amountHash":case"chainId":case"channelStats":case"srcChannel":case"dstChannel":case"attribute":case"initialVersion":case"bondHeight":case"unbondingHeight":case"currency":case"delegators":case"totalBalancePrice":case"param_name":case"value":case"proposerPriority":i[a]={value:o};break;case"shares":case"txNum":case"circulation":i[a]={value:Qn(o)};break;case"uptime":{i[a]={value:`${Qn(o)} %`};break}case"answer":{const s={VOTE_OPTION_YES:"CHART_PIE_G",VOTE_OPTION_NO:"CHART_PIE_NO",VOTE_OPTION_ABSTAIN:"CHART_PIE_ABSTAIN",VOTE_OPTION_NO_WITH_VETO:"CHART_PIE_NOWITHVETO"};let l="";const c=[];Object.keys(o).forEach(u=>{l+=`${Kr(u.replace(/vote_option_/gi,""))} (${o[u]?parseFloat(o[u])*100:"0"}%); `,c.push({color:s[u],value:o[u]*100})}),i[a]={value:c,hover:l};break}case"proposalStatus":case"txStatus":case"status":i[a]={value:Kr(o.replace(/proposal_status/gi,""))};break;case"depositType":case"markerType":case"proposalId":case"proposalType":case"specName":case"txMsgType":i[a]={value:Kr(o)};break}}),i})},ace=({description:t,title:e,initialDeposit:r,changes:n,name:i,height:a,info:o,runAs:s,accessType:l,address:c,admin:u,codeId:f,label:d,msg:h,funds:p,submitter:g})=>({content:n||i||a||o||s||l||c||u||f||d||h||p?JSON.stringify({changes:n,name:i,height:a,info:o,runAs:s,...l&&l!=="ACCESS_TYPE_UNSPECIFIED"&&{accessConfig:{type:l,address:c}},admin:u,codeId:f,label:d,msg:h,funds:p}):"",title:e,description:t,initialDeposit:r?[{amount:(parseFloat(r)*1e9).toFixed(),denom:"nhash"}]:[],submitter:g}),oce=t=>{let e=[];const r={type:"text",label:"title",field:"title"},n={type:"textarea",label:"description",field:"description"},i={type:"number",label:"initial deposit (hash)",field:"initialDeposit"};switch(t){case"cancel upgrade":case"text":e=[r,n,i];break;case"software upgrade":e=[r,n,{type:"text",label:"name",field:"name"},{type:"number",label:"height",field:"height"},{type:"text",label:"info",field:"info"},i];break;case"store code":e=[r,n,{type:"text",label:"run as",field:"runAs"},{type:"file",label:"WASM Byte Code",field:"file"},{type:"text",label:"address",field:"address"},i];break;case"instantiate contract":e=[r,n,{type:"text",label:"run as",field:"runAs"},{type:"text",label:"admin",field:"admin"},{type:"text",label:"code id",field:"codeId"},{type:"text",label:"label",field:"label"},{type:"text",label:"message",field:"msg"},{type:"repeating",label:"fund",field:"fundsList",subFields:[{type:"number",label:"amount",field:"amount"},{type:"text",label:"denom",field:"denom"}]},i];break;case"parameter change":e=[r,n,{type:"repeating",label:"change",field:"changes",subFields:[{type:"text",label:"subspace",field:"subspace"},{type:"text",label:"key",field:"key"},{type:"text",label:"value",field:"value"}]},i];break;default:console.warn(`Invalid proposal type of ${t}`);break}return e},Cst=t=>{let e=!0;return t&&(e=t.size{const r=ts().required("Title is required"),n=ts().required("Description is required"),i=Of().integer().default(0).min(0,"Min deposit is 0");switch(t){case"cancel upgrade":case"text":return Sf().shape({title:r,description:n,initialDeposit:i});case"software upgrade":return Sf().shape({title:r,description:n,name:ts().required("Name is required"),height:Of().min(e,`Min height is ${e}`),initialDeposit:i});case"store code":return Sf().shape({title:r,description:n,runAs:ts().required('"Run As" is required'),file:J5e().required("A .wasm file is required").test("fileType","Only .wasm file types are supported",a=>(a==null?void 0:a.type)==="application/wasm").test("fileSize","Files must be less than 1MB",Cst),address:ts().when(["accessType"],{is:a=>a===MVe.ACCESS_TYPE_NOBODY,then:ts().required('Address is required for "address only" access type')}),initialDeposit:i});case"instantiate contract":return Sf().shape({title:r,description:n,runAs:ts().required('"Run As" is required'),admin:ts().required("Admin is required"),codeId:ts().required("Code ID is required"),label:ts().required("Label is required"),msg:ts().required("Message is required"),fundsList:pq().of(Sf().shape({amount:Of().min(0,"Min amount is 0").required("Amount is required"),denom:ts().required("Denom is required")})),initialDeposit:i});case"parameter change":return Sf().shape({title:r,description:n,changes:pq().of(Sf().shape({subspace:ts().required("Subspace is required"),key:ts().required("Key is required"),value:ts().required("Value is required")})),initialDeposit:i});default:console.warn(`Invalid proposal type of ${t}`);break}return kSe},sce=t=>{let e=[];switch(t){case"weighted":e=[{type:"number",label:"yes",field:"yes"},{type:"number",label:"no",field:"no"},{type:"number",label:"abstain",field:"abstain"},{type:"number",label:"no with veto",field:"noWithVeto"}];break;default:e=[{type:"dropdown",dropdown:Mw,initialValue:Mw.YES,label:"vote",field:"vote"}];break}return e},Ast=t=>{switch(t){case"weighted":return Sf().shape({yes:Of().typeError("Please enter a valid number").min(0,"The minimum value is 0%").max(100,"The maximum value is 100%"),no:Of().typeError("Please enter a valid number").min(0,"The minimum value is 0%").max(100,"The maximum value is 100%"),abstain:Of().typeError("Please enter a valid number").min(0,"The minimum value is 0%").max(100,"The maximum value is 100%"),noWithVeto:Of().typeError("Please enter a valid number").min(0,"The minimum value is 0%").max(100,"The maximum value is 100%")});default:return Sf().shape({vote:ts().required("A vote is required")})}},Tst={assetInfo:{},pricePerToken:"",totalBalancePrice:"",assetInfoLoading:!1,assetAdminTransactions:[],assetAdminTransactionsLoading:!1,assetAdminTransactionsPages:1,assetTransferTransactions:[],assetTransferTransactionsLoading:!1,assetTransferTransactionsPages:1,assetHolders:[],assetHoldersLoading:!1,assetHoldersPages:1,assets:[],assetsPages:0,assetsLoading:!1,assetMetadata:[],assetMetadataLoading:!1,assetMetadataFailed:!1,assetsDist:[],assetsDistLoading:!1},Est="GET_ASSET_INFO",Ist="GET_ASSETS_LIST",kst="GET_ASSET_ADMIN_TRANSACTIONS",Pst="GET_ASSET_TRANSFER_TRANSACTIONS",Rst="GET_ASSET_HOLDERS",Mst="GET_ASSET_METADATA",Dst="GET_ASSETS_DIST",SP=Bt(Est,t=>It({url:`${CX}/detail/${t}`})),CP=Bt(Ist,({page:t=1,count:e=10})=>It({url:`${DVe}?${eo.stringify({page:t,count:e})}`})),AP=Bt(Rst,({assetId:t,page:e=1,count:r=10})=>It({url:`${CX}/holders?${eo.stringify({id:t,page:e,count:r})}`})),TP=Bt(kst,({denom:t,page:e=1,count:r=10})=>It({url:`${g0}/module/ASSET?${eo.stringify({denom:t,page:e,count:r})}`})),EP=Bt(Pst,({denom:t,page:e=1,count:r=10})=>It({url:`${g0}/module/TRANSFER?${eo.stringify({denom:t,page:e,count:r})}`})),IP=Bt(Mst,()=>It({url:`${CX}/metadata`})),kP=Bt(Dst,()=>It({url:`${NVe}`})),Nst={getAssetInfo:SP,getAssetAdminTransactions:TP,getAssetTransferTransactions:EP,getAssetHolders:AP,getAssetsList:CP,getAssetMetadata:IP,getAssetsDist:kP},Ost=mo({name:"asset",initialState:Tst,reducers:{},extraReducers(t){t.addCase(AP.pending,e=>{e.assetHoldersLoading=!0}).addCase(AP.fulfilled,(e,{payload:r})=>{e.assetHoldersLoading=!1,e.assetHoldersPages=r.data.pages,e.assetHolders=r.data.results}).addCase(AP.rejected,e=>{e.assetHoldersLoading=!1}).addCase(TP.pending,e=>{e.assetAdminTransactionsLoading=!0}).addCase(TP.fulfilled,(e,{payload:r})=>{e.assetAdminTransactionsLoading=!1,e.assetAdminTransactions=r.data.results,e.assetAdminTransactionsPages=r.data.pages}).addCase(TP.rejected,e=>{e.assetAdminTransactionsLoading=!1}).addCase(EP.pending,e=>{e.assetTransferTransactionsLoading=!0}).addCase(EP.fulfilled,(e,{payload:r})=>{e.assetTransferTransactionsLoading=!1,e.assetTransferTransactions=r.data.results,e.assetTransferTransactionsPages=r.data.pages}).addCase(EP.rejected,e=>{e.assetTransferTransactionsLoading=!1}).addCase(CP.pending,e=>{e.assetsLoading=!0}).addCase(CP.fulfilled,(e,{payload:r})=>{e.assetsLoading=!1,e.assets=r.data.results.map(n=>{var i,a;return{...n,lastTxTimestamp:n.lastTxTimestamp==="null"?null:n.lastTxTimestamp,pricePerToken:(i=n.supply)!=null&&i.pricePerToken?`$${zt(Number(n.supply.pricePerToken.amount),n.supply.pricePerToken.denom,{decimal:2,minimumFractionDigits:2})}`:"-- --",totalBalancePrice:(a=n.supply)!=null&&a.totalBalancePrice?`$${zt(Number(n.supply.totalBalancePrice.amount),n.supply.totalBalancePrice.denom,{decimal:2,minimumFractionDigits:2})}`:"-- --"}}),e.assetsPages=r.data.pages}).addCase(CP.rejected,e=>{e.assetsLoading=!1}).addCase(SP.pending,e=>{e.assetInfoLoading=!0}).addCase(SP.fulfilled,(e,{payload:r})=>{e.assetInfoLoading=!1,e.assetInfo=r.data,e.pricePerToken=r.data.supply.pricePerToken?zt(r.data.supply.pricePerToken.amount,r.data.supply.pricePerToken.denom,{decimal:2,minimumFractionDigits:2}):"-- --",e.totalBalancePrice=r.data.supply.totalBalancePrice?zt(r.data.supply.totalBalancePrice.amount,r.data.supply.totalBalancePrice.denom,{decimal:2,minimumFractionDigits:2}):"-- --"}).addCase(SP.rejected,e=>{e.assetInfoLoading=!1}).addCase(IP.pending,e=>{e.assetMetadataLoading=!0,e.assetMetadataFailed=!1}).addCase(IP.fulfilled,(e,{payload:r})=>{window.localStorage.setItem("assetMetadata",JSON.stringify(r.data)),WW("assetMetadata",JSON.stringify(r.data),5),window.localStorage.setItem("assetMetadata",JSON.stringify(r.data)),e.assetMetadataLoading=!1,e.assetMetadata=r.data}).addCase(IP.rejected,e=>{e.assetMetadataLoading=!1,e.assetMetadataFailed=!0}).addCase(kP.pending,e=>{e.assetsDistLoading=!0}).addCase(kP.fulfilled,(e,{payload:r})=>{e.assetsDistLoading=!1,e.assetsDist=r.data.map(n=>{n.amountHash=zt(Number(n.amount.amount),n.amount.denom,{decimal:0});const i=parseFloat(n.percent)*100;return n.percentTotal=(i<.01?i.toFixed(5):i.toFixed(2))+"%",n})}).addCase(kP.rejected,e=>{e.assetsDistLoading=!1})}}),Lst=t=>t.asset,$st=Ost.reducer,Bst={topCount:10,tableCount:30,validatorCount:100,theme:GW("theme")||"",walletUrl:GW("walletUrl",!0)||"",isLoggedIn:!1,proposalNotifications:localStorage.getItem("proposalNotificationsOn")==="true"||!1,upgradeNotifications:localStorage.getItem("upgradeNotificationsOn")==="true"||!1,announcementNotifications:localStorage.getItem("announcementNotificationsOn")==="true"||!1,authToken:"",changeOwnerData:{currentOwnerAddress:"",selected:""}},PSe=mo({name:"app",initialState:Bst,reducers:{setTheme(t,e){WW("theme",e.payload),t.theme=e.payload},setWalletUrl(t,e){WW("walletUrl",e.payload),t.walletUrl=e.payload},setIsLoggedIn(t,e){t.isLoggedIn=e.payload},setProposalNotifications(t,e){localStorage.setItem("proposalNotificationsOn",e.payload.toString()),t.proposalNotifications=e.payload},setUpgradeNotifications(t,e){localStorage.setItem("upgradeNotificationsOn",e.payload.toString()),t.upgradeNotifications=e.payload},setAnnouncementNotifications(t,e){localStorage.setItem("announcementNotificationsOn",e.payload.toString()),t.announcementNotifications=e.payload},setAuthToken(t,e){zWe(e.payload),t.authToken=e.payload,t.isLoggedIn=!0},setChangeOwnerData(t,e){t.changeOwnerData={...t.changeOwnerData,...e.payload}}}}),{setTheme:Fst,setWalletUrl:jst,setIsLoggedIn:Ust,setProposalNotifications:zst,setAnnouncementNotifications:Hst,setUpgradeNotifications:Vst,setAuthToken:Gst}=PSe.actions,Wst={setTheme:Fst,setWalletUrl:jst,setIsLoggedIn:Ust,setProposalNotifications:zst,setAnnouncementNotifications:Hst,setUpgradeNotifications:Vst,setAuthToken:Gst},qst=t=>t.app,Yst=PSe.reducer,Kst={blocksHeight:0,blocksHeightLoading:!1,blockInfo:{},blockInfoLoading:!1,blocks:[],blockPages:0,blocksRecentLoading:!1,blockSpotlightLoading:!1,blockLatest:{latestBlock:{}},blockHeight:0,blockSpotlightFailed:!1,recentBlocksCount:10},Zst="GET_BLOCK_INFO",Qst="GET_BLOCKS_HEIGHT",Xst="GET_BLOCKS_RECENT",Jst="GET_BLOCK_SPOTLIGHT",PP=Bt(Qst,()=>It({url:OVe})),RP=Bt(Xst,({count:t=10,page:e=1})=>It({url:`${$Ve}?${eo.stringify({page:e,count:t})}`})),MP=Bt(Zst,t=>It({url:`${LVe}/${t}`})),DP=Bt(Jst,()=>It({url:BVe})),RSe=mo({name:"block",initialState:Kst,reducers:{setRecentBlocksCount(t,e){t.recentBlocksCount=e.payload}},extraReducers(t){t.addCase(DP.pending,e=>{e.blockSpotlightLoading=!0,e.blockSpotlightFailed=!1}).addCase(DP.fulfilled,(e,{payload:r})=>{var n;e.blockSpotlightLoading=!1,e.blockSpotlightFailed=!1,e.blockLatest=r.data,e.blockHeight=(n=r.data.latestBlock)==null?void 0:n.height}).addCase(DP.rejected,e=>{e.blockSpotlightLoading=!1,e.blockSpotlightFailed=!0}).addCase(RP.pending,e=>{e.blocksRecentLoading=!0}).addCase(RP.fulfilled,(e,{payload:r})=>{e.blocksRecentLoading=!1,e.blocks=r.data.results,e.blockPages=r.data.pages}).addCase(RP.rejected,e=>{e.blocksRecentLoading=!1}).addCase(PP.pending,e=>{e.blocksHeightLoading=!0}).addCase(PP.fulfilled,(e,{payload:r})=>{e.blocksHeightLoading=!1,e.blocksHeight=r.data.height}).addCase(PP.rejected,e=>{e.blocksHeightLoading=!1}).addCase(MP.pending,e=>{e.blockInfoLoading=!0}).addCase(MP.fulfilled,(e,{payload:r})=>{e.blockInfoLoading=!1,e.blockInfo=r.data}).addCase(MP.rejected,e=>{e.blockInfoLoading=!1})}}),elt={getBlockInfo:MP,getBlockSpotlight:DP,getBlocksHeight:PP,getBlocksRecent:RP,...RSe.actions},tlt=t=>t.block,rlt=RSe.reducer,nlt={contractCode:{codeId:0,creationHeight:0,creator:"",dataHash:""},contractCodeLoading:!1,contractsByCode:[],contractsByCodePages:0,contractsByCodeLoading:!1,contractsByCodeTotal:0,codes:[],codesPages:0,codesLoading:!1,codesTotal:0,contractDetails:{admin:"",codeId:0,contractAddress:"",creationHeight:0,creator:"",label:""},contractDetailsLoading:!1,contractHistory:[],contractHistoryLoading:!1,contracts:[],contractsPages:0,contractsLoading:!1,contractsTotal:0,contractTxs:[],contractTxsLoading:!1,contractTxsPages:0,contractTxsTotal:0,codeTxs:[],codeTxsLoading:!1,codeTxsPages:0,codeTxsTotal:0,contractLabels:[],contractLabelsLoading:!1},ilt="GET_CONTRACT_CODE",alt="GET_CONTRACTS_BY_CODE",olt="GET_CODES",slt="GET_CONTRACT_DETAILS",llt="GET_CONTRACT_HISTORY",clt="GET_CONTRACTS",ult="GET_CONTRACT_TXS",flt="GET_CODE_TXS",dlt="GET_CONTRACT_LABELS",NP=Bt(ilt,({id:t=""})=>It({url:`${N3e}/${t}`})),OP=Bt(alt,({id:t="",page:e=1,count:r=10})=>It({url:`${N3e}/${t}/contracts/?${eo.stringify({page:e,count:r})}`})),LP=Bt(olt,({page:t=1,count:e=10,creator:r="",hasContracts:n=""})=>It({url:`${UVe}/?count=${e}&page=${t}${r&&`&creator=${r}`}${n&&`&has_contracts=${n}`}`})),$P=Bt(slt,({id:t=""})=>It({url:`${O3e}/${t}`})),BP=Bt(llt,({id:t=""})=>It({url:`${O3e}/${t}/history`})),FP=Bt(clt,({page:t=1,count:e=10,creator:r="",admin:n="",label:i=""})=>It({url:`${zVe}/?count=${e}&page=${t}${r?`&creator=${r}`:""}${n?`&admin=${n}`:""}${i?`&label=${i}`:""}`})),jP=Bt(ult,({id:t="",page:e=1,count:r=10,fromDate:n="",toDate:i="",status:a=""})=>It({url:`${L3e}?count=${r}&page=${e}&contract=${t}${a?`&txStatus=${a.toUpperCase()}`:""}${i?`&toDate=${i}`:""}${n?`&fromDate=${n}`:""}`})),UP=Bt(flt,({id:t="",page:e=1,count:r=10,fromDate:n="",toDate:i="",status:a=""})=>It({url:`${L3e}?count=${r}&page=${e}&code=${t}${a?`&txStatus=${a.toUpperCase()}`:""}${i?`&toDate=${i}`:""}${n?`&fromDate=${n}`:""}`})),zP=Bt(dlt,()=>It({url:HVe})),hlt={getContractCode:NP,getContractsByCode:OP,getCodes:LP,getContractDetails:$P,getContractHistory:BP,getContracts:FP,getContractTxs:jP,getCodeTxs:UP,getContractLabels:zP},plt=mo({name:"contract",initialState:nlt,reducers:{},extraReducers(t){t.addCase(NP.pending,e=>{e.contractCodeLoading=!0}).addCase(NP.fulfilled,(e,{payload:r})=>{e.contractCodeLoading=!1,e.contractCode=r.data}).addCase(NP.rejected,e=>{e.contractCodeLoading=!1}).addCase(OP.pending,e=>{e.contractsByCodeLoading=!0}).addCase(OP.fulfilled,(e,{payload:r})=>{e.contractsByCodeLoading=!1,e.contractsByCode=r.data.results,e.contractsByCodePages=r.data.pages,e.contractsByCodeTotal=r.data.total}).addCase(OP.rejected,e=>{e.contractsByCodeLoading=!1}).addCase(LP.pending,e=>{e.codesLoading=!0}).addCase(LP.fulfilled,(e,{payload:r})=>{e.codesLoading=!1,e.codes=r.data.results,e.codesPages=r.data.pages,e.codesTotal=r.data.total}).addCase(LP.rejected,e=>{e.codesLoading=!1}).addCase($P.pending,e=>{e.contractDetailsLoading=!0}).addCase($P.fulfilled,(e,{payload:r})=>{e.contractDetailsLoading=!1,e.contractDetails=r.data}).addCase($P.rejected,e=>{e.contractDetailsLoading=!1}).addCase(BP.pending,e=>{e.contractHistoryLoading=!0}).addCase(BP.fulfilled,(e,{payload:r})=>{e.contractHistoryLoading=!1,e.contractHistory=r.data}).addCase(BP.rejected,e=>{e.contractHistoryLoading=!1}).addCase(FP.pending,e=>{e.contractsLoading=!0}).addCase(FP.fulfilled,(e,{payload:r})=>{e.contractsLoading=!1,e.contracts=r.data.results,e.contractsPages=r.data.pages,e.contractsTotal=r.data.total}).addCase(FP.rejected,e=>{e.contractsLoading=!1}).addCase(jP.pending,e=>{e.contractTxsLoading=!0}).addCase(jP.fulfilled,(e,{payload:r})=>{e.contractTxsLoading=!1,e.contractTxs=r.data.results,e.contractTxsPages=r.data.pages,e.contractTxsTotal=r.data.total}).addCase(jP.rejected,e=>{e.contractTxsLoading=!1}).addCase(UP.pending,e=>{e.codeTxsLoading=!0}).addCase(UP.fulfilled,(e,{payload:r})=>{e.codeTxsLoading=!1,e.codeTxs=r.data.results,e.codeTxsPages=r.data.pages,e.codeTxsTotal=r.data.total}).addCase(UP.rejected,e=>{e.codeTxsLoading=!1}).addCase(zP.pending,e=>{e.contractLabelsLoading=!0}).addCase(zP.fulfilled,(e,{payload:r})=>{e.contractLabelsLoading=!1,e.contractLabels=r.data}).addCase(zP.rejected,e=>{e.contractLabelsLoading=!1})}}),glt=t=>t.contract,vlt=plt.reducer,mlt={faucetRequestStatus:"none"},ylt=t=>It({url:D3e,method:"POST",data:t}),wlt={},blt={sendFaucetAddress:ylt},xlt=mo({name:"faucet",initialState:mlt,reducers:{sendFaucetAddress(t,e){t.faucetRequestStatus=e.payload==="pending"?"loading":e.payload==="fulfilled"?"success":"failure"}}}),_lt=t=>t.faucet,Slt=xlt.reducer,Clt={addressVotes:[],addressVotesLoading:!1,addressVotesPages:0,proposal:{header:{description:"",details:{},proposalId:0,proposer:{address:"",moniker:"",validatorAddr:""},status:"",title:"",type:""},timings:{deposit:{current:"",denom:"",initial:"",needed:""},depositEndTime:"",submitTime:"",votingTime:{endTime:"",startTime:""},voting:{params:{passThreshold:"",quorumThreshold:"",totalEligibleAmount:{amount:"",denom:""},vetoThreshold:""},tally:{abstain:{amount:{amount:"",denom:""},count:0},no:{amount:{amount:"",denom:""},count:0},noWithVeto:{amount:{amount:"",denom:""},count:0},total:{amount:{amount:"",denom:""},count:0},yes:{amount:{amount:"",denom:""},count:0}}}}},tally:{abstain:{amount:{amount:"",denom:""},count:0},no:{amount:{amount:"",denom:""},count:0},noWithVeto:{amount:{amount:"",denom:""},count:0},total:{amount:{amount:"",denom:""},count:0},yes:{amount:{amount:"",denom:""},count:0}},params:{passThreshold:"",quorumThreshold:"",totalEligibleAmount:{amount:"",denom:""},vetoThreshold:""},proposalLoading:!1,proposalDeposits:[],proposalDepositsLoading:!1,proposalDepositsPages:0,proposals:[],proposalsLoading:!1,proposalsPages:0,proposalVotes:[],proposalVotesLoading:!1,proposalVotesPages:0,proposalVotesTotal:0,proposalTypes:{TEXT:{},PARAMETER_CHANGE:{changes:[]},SOFTWARE_UPGRADE:{name:"",height:0,info:""},CANCEL_UPGRADE:{},STORE_CODE:{runAs:"",accessConfig:{type:"",address:""}},INSTANTIATE_CONTRACT:{runAs:"",admin:"",codeId:0,label:"",msg:"",funds:[]}},proposalTypesLoading:!1},fS="GOV",Alt=`${fS}::GET_PROPOSAL`,Tlt=`${fS}::GET_PROPOSAL_DEPOSITS`,Elt=`${fS}::GET_PROPOSALS`,Ilt=`${fS}::GET_VOTES_BY_ADDRESS`,klt=`${fS}::GET_VOTES_BY_PROPOSAL`,Plt=`${fS}::GET_PROPOSAL_TYPES`,HP=Bt(Alt,t=>It({url:`${AX}/${t}`})),VP=Bt(Tlt,({proposalId:t,count:e=10,page:r=1})=>It({url:`${AX}/${t}/deposits?${eo.stringify({count:e,page:r})}`})),GP=Bt(Elt,({count:t=10,page:e=1})=>It({url:`${AX}/all?${eo.stringify({count:t,page:e})}`})),WP=Bt(Ilt,({address:t,count:e=10,page:r=1})=>It({url:`${VVe}/${t}/votes?${eo.stringify({count:e,page:r})}`})),qP=Bt(klt,({proposalId:t,count:e=10,page:r=1})=>It({url:`${GVe}/${t}/votes?${eo.stringify({count:e,page:r})}`})),Rlt=Bt(Plt,()=>It({url:`${YVe}/types/supported`})),Mlt=t=>It({url:`${qVe}`,method:"POST",data:t}),Dlt=({type:t,data:e,file:r,token:n})=>{const i=new FormData;return i.append("request",new Blob([JSON.stringify(e)],{type:"application/json"})),r&&t==="STORE_CODE"&&i.append("wasmFile",r),fetch(`${WVe}${t}`,{method:"POST",body:i,headers:{Accept:"application/json",Authorization:`Bearer ${n}`}}).then(a=>a.json()).then(a=>({data:a}))},Nlt={getProposal:HP,getProposalDeposits:VP,getAllProposals:GP,getVotesByAddress:WP,getVotesByProposal:qP,getProposalTypes:Rlt},Olt={submitProposal:Dlt,submitVotes:Mlt},Llt=mo({name:"governance",initialState:Clt,reducers:{},extraReducers(t){t.addCase(HP.pending,e=>{e.proposalLoading=!0}).addCase(HP.fulfilled,(e,{payload:r})=>{e.proposalLoading=!1,e.proposal=r.data,e.tally=r.data.timings.voting.tally,e.params=r.data.timings.voting.params}).addCase(HP.rejected,e=>{e.proposalLoading=!1}).addCase(VP.pending,e=>{e.proposalDepositsLoading=!0}).addCase(VP.fulfilled,(e,{payload:r})=>{e.proposalDepositsLoading=!1,e.proposalDeposits=r.data.results,e.proposalDepositsPages=r.data.pages}).addCase(VP.rejected,e=>{e.proposalDepositsLoading=!1}).addCase(GP.pending,e=>{e.proposalsLoading=!0}).addCase(GP.fulfilled,(e,{payload:r})=>{e.proposalsLoading=!1,e.proposals=r.data.results,e.proposalsPages=r.data.pages}).addCase(GP.rejected,e=>{e.proposalsLoading=!1}).addCase(WP.pending,e=>{e.addressVotesLoading=!0}).addCase(WP.fulfilled,(e,{payload:r})=>{e.addressVotesLoading=!1,e.addressVotes=r.data.results,e.addressVotesPages=r.data.pages}).addCase(WP.rejected,e=>{e.addressVotesLoading=!1}).addCase(qP.pending,e=>{e.proposalVotesLoading=!0}).addCase(qP.fulfilled,(e,{payload:r})=>{e.proposalVotesLoading=!1,e.proposalVotes=r.data.results,e.proposalVotesPages=r.data.pages,e.proposalVotesTotal=r.data.total}).addCase(qP.rejected,e=>{e.proposalVotesLoading=!1})}}),$lt=t=>t.governance,Blt=Llt.reducer,Flt={chainBalances:[],chainBalancesFailed:!1,chainBalancesLoading:!1,channelBalances:[],channelBalancesFailed:!1,channelBalancesLoading:!1,denomBalances:[],denomBalancesFailed:!1,denomBalancesLoading:!1,channelRelayers:[],channelRelayersFailed:!1,channelRelayersLoading:!1,channelStatus:[],channelStatusFailed:!1,channelStatusLoading:!1,denomsAll:[],denomsAllFailed:!1,denomsAllLoading:!1,denomsPages:0,denomsTotal:0},jlt="IBC::GET_CHAIN_BALANCES",Ult="IBC::GET_CHANNEL_BALANCES",zlt="IBC::GET_DENOM_BALANCES",Hlt="IBC::GET_CHANNEL_RELAYERS",Vlt="IBC::GET_CHANNEL_STATUS",Glt="IBC::GET_DENOMS_ALL",YP=Bt(jlt,()=>It({url:QVe})),KP=Bt(Ult,()=>It({url:XVe})),ZP=Bt(zlt,()=>It({url:JVe})),QP=Bt(Hlt,({srcPort:t,srcChannel:e})=>It({url:`${eGe}${t}/src_channel/${e}/relayers`})),XP=Bt(Vlt,({status:t=""})=>It({url:`${tGe}${t&&`/?status=${t}`}`})),JP=Bt(Glt,({page:t=1,count:e=1})=>It({url:`${rGe}/all?${eo.stringify({page:t,count:e})}`})),Wlt={getChainBalances:YP,getChannelBalances:KP,getDenomBalances:ZP,getChannelRelayers:QP,getChannelStatus:XP,getDenomsAll:JP},qlt=mo({name:"ibc",initialState:Flt,reducers:{},extraReducers(t){t.addCase(YP.pending,e=>{e.chainBalancesLoading=!0,e.chainBalancesFailed=!1}).addCase(YP.fulfilled,(e,{payload:r})=>{e.chainBalancesLoading=!1,e.chainBalances=r.data,e.chainBalancesFailed=!1}).addCase(YP.rejected,e=>{e.chainBalancesLoading=!1,e.chainBalancesFailed=!0}).addCase(KP.pending,e=>{e.channelBalancesLoading=!0,e.channelBalancesFailed=!1}).addCase(KP.fulfilled,(e,{payload:r})=>{e.channelBalancesLoading=!1,e.channelBalances=r.data,e.channelBalancesFailed=!1}).addCase(KP.rejected,e=>{e.channelBalancesLoading=!1,e.channelBalancesFailed=!0}).addCase(ZP.pending,e=>{e.denomBalancesLoading=!0,e.denomBalancesFailed=!1}).addCase(ZP.fulfilled,(e,{payload:r})=>{e.denomBalancesLoading=!1,e.denomBalances=r.data,e.denomBalancesFailed=!1}).addCase(ZP.rejected,e=>{e.denomBalancesLoading=!1,e.denomBalancesFailed=!0}).addCase(QP.pending,e=>{e.channelRelayersLoading=!0,e.channelRelayersFailed=!1}).addCase(QP.fulfilled,(e,{payload:r})=>{e.channelRelayersLoading=!1,e.channelRelayers=r.data,e.channelRelayersFailed=!1}).addCase(QP.rejected,e=>{e.channelRelayersLoading=!1,e.channelRelayersFailed=!0}).addCase(XP.pending,e=>{e.channelStatusLoading=!0,e.channelStatusFailed=!1}).addCase(XP.fulfilled,(e,{payload:r})=>{e.channelStatusLoading=!1,e.channelStatus=r.data,e.channelStatusFailed=!1}).addCase(XP.rejected,e=>{e.channelStatusLoading=!1,e.channelStatusFailed=!0}).addCase(JP.pending,e=>{e.denomsAllLoading=!0,e.denomsAllFailed=!1}).addCase(JP.fulfilled,(e,{payload:r})=>{e.denomsAllLoading=!1,e.denomsAll=r.data.results,e.denomsPages=r.data.pages,e.denomsTotal=r.data.total,e.denomsAllFailed=!1}).addCase(JP.rejected,e=>{e.denomsAllLoading=!1,e.denomsAllFailed=!0})}}),Ylt=t=>t.ibc,Klt=qlt.reducer,Zlt={nameTreeLoading:!1,nameTreeDepth:0,nameTree:[]},Qlt="GET_NAME_TREE",eR=Bt(Qlt,()=>It({url:aGe})),Xlt={getNameTree:eR},Jlt=mo({name:"name",initialState:Zlt,reducers:{},extraReducers(t){t.addCase(eR.pending,e=>{e.nameTreeLoading=!0}).addCase(eR.fulfilled,(e,{payload:r})=>{const n=i=>i.map(a=>(a.name=a.segmentName,a.value=a.children.length||1,a.label=a.fullName,a.nodes=a.children,a.key=a.fullName,a.toggled=!0,a.children.length>0&&n(a.children),a));e.nameTreeLoading=!1,e.nameTreeDepth=r.data.depthCount,e.nameTree=n(r.data.tree)}).addCase(eR.rejected,e=>{e.nameTreeLoading=!1})}}),ect=t=>t.name,tct=Jlt.reducer,rct={networkUpgrades:[],networkUpgradesLoading:!1,networkParams:{},cosmosParams:{},provParams:{},networkParamsLoading:!1,networkTokenStats:{bonded:{amount:"",denom:""},burned:{amount:"",denom:""},circulation:{amount:"",denom:""},communityPool:{amount:"",denom:""},currentSupply:{amount:"",denom:""},maxSupply:{amount:"",denom:""}},networkTokenStatsLoading:!1,networkGasStats:[],networkGasStatsLoading:!1,networkGasVolume:[],networkGasVolumeLoading:!1,networkTotalSupply:0,networkTotalSupplyLoading:!1},nct="GET_NETWORK_UPGRADES",ict="GET_NETWORK_PARAMS",act="GET_TOKEN_STATS",oct="GET_NETWORK_GAS_STATS",sct="GET_NETWORK_GAS_VOLUME",lct="GET_NETWORK_TOTAL_SUPPLY",tR=Bt(nct,()=>It({url:mGe})),rR=Bt(ict,()=>It({url:bGe})),nR=Bt(act,()=>It({url:xGe})),iR=Bt(oct,({toDate:t,fromDate:e,granularity:r="day"})=>It({url:`${yGe}?fromDate=${e}&toDate=${t}&granularity=${r.toUpperCase()}`})),aR=Bt(sct,({toDate:t,fromDate:e,granularity:r="day"})=>It({url:`${wGe}?fromDate=${e}&toDate=${t}&granularity=${r.toUpperCase()}`})),oR=Bt(lct,()=>It({url:_Ge})),cct={getNetworkUpgrades:tR,getNetworkParams:rR,getNetworkTokenStats:nR,getNetworkGasStats:iR,getNetworkGasVolume:aR,getNetworkTotalSupply:oR},uct=mo({name:"network",initialState:rct,reducers:{},extraReducers(t){t.addCase(tR.pending,e=>{e.networkUpgradesLoading=!0}).addCase(tR.fulfilled,(e,{payload:r})=>{e.networkUpgradesLoading=!1,e.networkUpgrades=r.data.reverse().map(n=>({...n,events:UW[n.upgradeName]||(n.scheduled?`Not yet applied - will be applied at upgrade height ${n.upgradeHeight}`:"")}))}).addCase(tR.rejected,e=>{e.networkUpgradesLoading=!1}).addCase(rR.pending,e=>{e.networkParamsLoading=!0}).addCase(rR.fulfilled,(e,{payload:r})=>{e.networkParamsLoading=!1,e.cosmosParams=r.data.cosmos,e.provParams=r.data.prov,e.networkParams=r.data}).addCase(rR.rejected,e=>{e.networkParamsLoading=!1}).addCase(nR.pending,e=>{e.networkTokenStatsLoading=!0}).addCase(nR.fulfilled,(e,{payload:r})=>{e.networkTokenStatsLoading=!1,e.networkTokenStats=r.data}).addCase(nR.rejected,e=>{e.networkTokenStatsLoading=!1}).addCase(iR.pending,e=>{e.networkGasStatsLoading=!0}).addCase(iR.fulfilled,(e,{payload:r})=>{e.networkGasStatsLoading=!1,e.networkGasStats=r.data}).addCase(iR.rejected,e=>{e.networkGasStatsLoading=!1}).addCase(aR.pending,e=>{e.networkGasVolumeLoading=!0}).addCase(aR.fulfilled,(e,{payload:r})=>{e.networkGasVolumeLoading=!1,e.networkGasVolume=r.data}).addCase(aR.rejected,e=>{e.networkGasVolumeLoading=!1}).addCase(oR.pending,e=>{e.networkTotalSupplyLoading=!0}).addCase(oR.fulfilled,(e,{payload:r})=>{e.networkTotalSupplyLoading=!1,e.networkTotalSupply=r.data}).addCase(oR.rejected,e=>{e.networkTotalSupplyLoading=!1})}}),fct=t=>t.network,dct=uct.reducer,hct={nftDetailLoading:!1,nftRecordsLoading:!1,nftByOwnerLoading:!1,nftByOwnerPages:1,nftDetail:{attributes:[],dataAccess:[],description:{description:"",iconUrl:"",name:"",websiteUrl:""},owners:[],scopeAddr:"",scopeUuid:"",specAddr:"",specName:"",valueOwner:""},nftRecords:[],nftByOwner:[]},pct="NFT::GET_NFT_DETAIL",gct="NFT::GET_NFT_RECORDS",vct="NFT::GET_NFT_BY_OWNER",sR=Bt(pct,t=>It({url:`${TX}/${t}`})),lR=Bt(gct,t=>It({url:`${TX}/${t}/records`})),cR=Bt(vct,({addr:t,page:e=1,count:r=50})=>It({url:`${TX}/owner/${t}?${eo.stringify({page:e,count:r})}`})),mct={getNftDetail:sR,getNftRecords:lR,getNftsByOwner:cR},yct=mo({name:"nft",initialState:hct,reducers:{},extraReducers(t){t.addCase(sR.pending,e=>{e.nftDetailLoading=!0}).addCase(sR.fulfilled,(e,{payload:r})=>{e.nftDetailLoading=!1,e.nftDetail=r.data}).addCase(sR.rejected,e=>{e.nftDetailLoading=!1}).addCase(lR.pending,e=>{e.nftRecordsLoading=!0}).addCase(lR.fulfilled,(e,{payload:r})=>{e.nftRecordsLoading=!1,e.nftRecords=r.data.filter(n=>!n.status.match(/NON_CONFORMING|ORPHAN/))}).addCase(lR.rejected,e=>{e.nftRecordsLoading=!1}).addCase(cR.pending,e=>{e.nftByOwnerLoading=!0}).addCase(cR.fulfilled,(e,{payload:r})=>{e.nftByOwnerLoading=!1,e.nftByOwner=r.data.results,e.nftByOwnerPages=r.data.pages}).addCase(cR.rejected,e=>{e.nftByOwnerLoading=!1})}}),wct=t=>t.nft,bct=yct.reducer,xct={openProposals:[],openProposalsLoading:!1,scheduledUpgrades:[],scheduledUpgradesLoading:!1,openAnnouncements:[],openAnnouncementsLoading:!1,announcementInfo:{body:"",id:0,timestamp:"",title:"",prevId:"",nextId:""},announcementInfoLoading:!1,allAnnouncementsLoading:!1,allAnnouncements:[],allAnnouncementsPages:0,allAnnouncementsTotal:0},_ct="GET_PROPOSAL_NOTIFICATIONS",Sct="GET_UPGRADE_NOTIFICATIONS",Cct="GET_ANNOUNCEMENT_NOTIFICATIONS",Act="GET_ANNOUNCEMENT_INFO",Tct="GET_ANNOUNCEMENTS_ALL",uR=Bt(_ct,()=>It({url:oGe})),fR=Bt(Sct,()=>It({url:sGe})),dR=Bt(Cct,({fromDate:t=""})=>It({url:`${$3e}${t?`?fromDate=${t}`:""}`})),hR=Bt(Act,({id:t})=>It({url:`${lGe}/${t}`})),pR=Bt(Tct,({fromDate:t="",count:e=10,page:r=1})=>It({url:`${$3e}?page=${r}&count=${e}${t?`?fromDate=${t}`:""}`})),Ect={getProposalNotifications:uR,getUpgradeNotifications:fR,getAnnouncementNotifications:dR,getAnnouncementInfo:hR,getAnnouncementsAll:pR},Ict=mo({name:"notification",initialState:xct,reducers:{},extraReducers(t){t.addCase(uR.pending,e=>{e.openProposalsLoading=!0}).addCase(uR.fulfilled,(e,{payload:r})=>{e.openProposalsLoading=!1;const{nonUpgradeOpenList:n,upgradeOpenList:i}=r.data,a=i.map(o=>({isUpgrade:!0,...o}));e.openProposals=n.concat(a).reverse()}).addCase(uR.rejected,e=>{e.openProposalsLoading=!1}).addCase(fR.pending,e=>{e.scheduledUpgradesLoading=!0}).addCase(fR.fulfilled,(e,{payload:r})=>{e.scheduledUpgradesLoading=!1,e.scheduledUpgrades=r.data.reverse().map(n=>({id:n.upgradeVersion,timestamp:n.approximateTime,title:n.upgradeName,body:n.upgradePlan}))}).addCase(fR.rejected,e=>{e.scheduledUpgradesLoading=!1}).addCase(dR.pending,e=>{e.openAnnouncementsLoading=!0}).addCase(dR.fulfilled,(e,{payload:r})=>{e.openAnnouncementsLoading=!1,e.openAnnouncements=r.data.results}).addCase(dR.rejected,e=>{e.openAnnouncementsLoading=!1}).addCase(hR.pending,e=>{e.announcementInfoLoading=!0}).addCase(hR.fulfilled,(e,{payload:r})=>{e.announcementInfoLoading=!1,e.announcementInfo=r.data}).addCase(hR.rejected,e=>{e.announcementInfoLoading=!1}).addCase(pR.pending,e=>{e.allAnnouncementsLoading=!0}).addCase(pR.fulfilled,(e,{payload:r})=>{e.allAnnouncementsLoading=!1,e.allAnnouncements=r.data.results,e.allAnnouncementsPages=r.data.pages,e.allAnnouncementsTotal=r.data.total}).addCase(pR.rejected,e=>{e.allAnnouncementsLoading=!1})}}),kct=t=>t.notification,Pct=Ict.reducer,Rct={historicalPricing:[],historicalPricingLoading:!1,historicalPricingFailed:!1,currentPricing:{circulating_supply:0,cmc_rank:0,date_added:"",id:0,is_active:!1,is_fiat:!1,last_updated:"",max_supply:0,name:"",num_market_pairs:0,platform:0,quote:{},self_reported_circulating_supply:0,self_reported_market_cap:0,slug:"",symbol:"",tags:[],tvl_ratio:0},currentPricingLoading:!1,currentPricingFailed:!1},Mct="ORDERBOOK::GET_HISTORICAL_PRICING",Dct="ORDERBOOK::GET_CURRENT_PRICING",gR=Bt(Dct,()=>It({url:`${iGe}`})),vR=Bt(Mct,({startTime:t="",endTime:e=""})=>It({url:`${nGe}${t||e?"?":""}${t?`fromDate=${t}`:""}${t&&e?"&":""}${e?`&toDate=${e}`:""}`})),Nct={getHistoricalPricing:vR,getCurrentPricing:gR},Oct=mo({name:"orderbook",initialState:Rct,reducers:{},extraReducers(t){t.addCase(vR.pending,e=>{e.historicalPricingLoading=!0,e.historicalPricingFailed=!1}).addCase(vR.fulfilled,(e,{payload:r})=>{e.historicalPricingLoading=!1,e.historicalPricing=r.data.map(n=>(n.time_close=new Date(n.time_close).toISOString(),{...n})),e.historicalPricingFailed=!1}).addCase(vR.rejected,e=>{e.historicalPricingLoading=!1,e.historicalPricingFailed=!0}).addCase(gR.pending,e=>{e.currentPricingLoading=!0,e.currentPricingFailed=!1}).addCase(gR.fulfilled,(e,{payload:r})=>{e.currentPricingLoading=!1,e.currentPricing=r.data,e.currentPricingFailed=!1}).addCase(gR.rejected,e=>{e.currentPricingLoading=!1,e.currentPricingFailed=!0})}}),Lct=t=>t.orderbook,$ct=Oct.reducer,Bct={},Fct=t=>It({url:dGe,method:"POST",data:t}),jct=t=>It({url:hGe,method:"POST",data:t}),Uct=t=>It({url:pGe,method:"POST",data:t}),zct=t=>It({url:gGe,method:"POST",data:t}),Hct=t=>It({url:vGe,method:"POST",data:t}),Vct={},Gct={delegateAction:Fct,redelegateAction:jct,undelegateAction:Uct,withdrawCommissionAction:zct,withdrawRewardsAction:Hct},Wct=mo({name:"staking",initialState:Bct,reducers:{}}),qct=t=>t.staking,Yct=Wct.reducer,Kct={txInfo:{additionalHeights:[],codespace:"",errorCode:0,errorLog:"",fee:[],feepayer:{address:"",type:""},gas:{gasPrice:{amount:"",denom:""},gasUsed:0,gasWanted:0},height:0,memo:"",monikers:{},signers:[],status:"",time:"",txHash:""},txsInfoLoading:!1,txs:[],txsPages:0,txTotal:0,recentTxsCount:10,txsRecentLoading:!1,txHistory:[],txHistoryDayRange:14,txHistoryLoading:!0,txFullJSONLoading:!1,txFullJSON:"",txsByBlock:[],txsByBlockLoading:!1,txsByBlockPages:0,txsByAddress:[],txsByAddressLoading:!1,txsByAddressPages:0,txTypesLoading:!1,txTypes:{},txTypesNoFormat:[],txMsgs:{},txMsgsLoading:!1,txMsgsPages:0,txMsgsTotal:0,txMsgTypes:{},txMsgTypesLoading:!1,txByModule:[],txByModuleLoading:!1,txByModulePages:0,txByNft:[],txByNftLoading:!1,txByNftPages:0,accountTxByDate:[],accountTxByDateLoading:!1},Zct="TX::GET_TX_INFO",Qct="TX::GET_TXS_RECENT",Xct="TX::GET_TX_HISTORY",Jct="TX::GET_TXS_BY_BLOCK",eut="TX::GET_TXS_BY_ADDRESS",tut="TX::GET_TX_FULL_JSON",rut="TX::GET_TX_TYPES",nut="TX::GET_TX_MSGS",iut="TX::GET_TX_MSG_TYPES",aut="TX::GET_TX_BY_MODULE",out="TX::GET_TXS_BY_NFT",sut="TX::GET_ACCOUNT_TX_BY_DATE",mR=Bt(Qct,({count:t=10,page:e=1,type:r="",status:n="",toDate:i,fromDate:a})=>It({url:`${SGe}?count=${t}&page=${e}${r?`&msgType=${r}`:""}${n?`&txStatus=${n.toUpperCase()}`:""}${i?`&toDate=${i}`:""}${a?`&fromDate=${a}`:""}`})),yR=Bt(eut,({count:t=10,page:e=1,type:r="",status:n="",address:i,toDate:a,fromDate:o})=>It({url:`${F3e}/${i}?count=${t}&page=${e}${r?`&msgType=${r}`:""}${n?`&txStatus=${n.toUpperCase()}`:""}${a?`&toDate=${a}`:""}${o?`&fromDate=${o}`:""}`})),wR=Bt(Jct,({blockheight:t,count:e=10,page:r=1})=>It({url:`${AGe}/${t}?count=${e}&page=${r}`})),bR=Bt(Zct,({txHash:t,block:e})=>It({url:`${g0}/${t}${e?`?blockHeight=${e}`:""}`})),xR=Bt(Xct,({toDate:t,fromDate:e,granularity:r="day"})=>It({url:`${CGe}?toDate=${t}&fromDate=${e}&granularity=${r.toUpperCase()}`})),_R=Bt(tut,t=>It({url:`${g0}/${t}/json`})),SR=Bt(rut,()=>It({url:TGe})),CR=Bt(nut,({txHash:t,count:e=10,page:r=1,msgType:n=""})=>It({url:`${g0}/${t}/msgs?${eo.stringify({page:r,count:e,msgType:n})}`})),AR=Bt(iut,t=>It({url:`${g0}/types/tx/${t}`})),TR=Bt(aut,({module:t,...e})=>It({url:`${g0}/module/${t}${Rn(e)?"":`?${eo.stringify(e)}`}`})),ER=Bt(out,({addr:t,count:e=10,page:r=1,...n})=>It({url:`${g0}/nft/${t}?${eo.stringify({count:e,page:r,...n})}`})),IR=Bt(sut,({address:t,toDate:e,fromDate:r})=>It({url:`${F3e}/${t}?toDate=${e}&fromDate=${r}`})),MSe=mo({name:"tx",initialState:Kct,reducers:{resetTxMsgs(t,e){const{[e.payload]:r,...n}=t.txMsgs;t.txMsgs=n},setRecentTxsCount(t,e){t.recentTxsCount=e.payload}},extraReducers(t){t.addCase(SR.pending,e=>{e.txTypesLoading=!0}).addCase(SR.fulfilled,(e,{payload:r})=>{const n={allTxTypes:{isDefault:!0,title:"All Tx Types"}};r.data.forEach(({module:i,type:a})=>{n[i]={title:Kr(i),options:{}}}),r.data.forEach(({module:i,type:a})=>{n[i].options={[a]:{title:Kr(a)},...n[i].options}}),e.txTypesLoading=!1,e.txTypes=n,e.txTypesNoFormat=r.data}).addCase(SR.rejected,e=>{e.txTypesLoading=!1}).addCase(_R.pending,e=>{e.txFullJSONLoading=!0}).addCase(_R.fulfilled,(e,{payload:r})=>{e.txFullJSONLoading=!1,e.txFullJSON=r.data}).addCase(_R.rejected,e=>{e.txFullJSONLoading=!1}).addCase(wR.pending,e=>{e.txsByBlockLoading=!0}).addCase(wR.fulfilled,(e,{payload:r})=>{e.txsByBlockLoading=!1,e.txsByBlock=r.data.results,e.txsByBlockPages=r.data.pages}).addCase(wR.rejected,e=>{e.txsByBlockLoading=!1}).addCase(yR.pending,e=>{e.txsByAddressLoading=!0}).addCase(yR.fulfilled,(e,{payload:r})=>{e.txsByAddressLoading=!1,e.txsByAddress=r.data.results,e.txsByAddressPages=r.data.pages}).addCase(yR.rejected,e=>{e.txsByAddressLoading=!1}).addCase(mR.pending,e=>{e.txsRecentLoading=!0}).addCase(mR.fulfilled,(e,{payload:r})=>{e.txsRecentLoading=!1,e.txs=r.data.results,e.txTotal=r.data.total,e.txsPages=r.data.pages}).addCase(mR.rejected,e=>{e.txsRecentLoading=!1}).addCase(bR.pending,e=>{e.txsInfoLoading=!0}).addCase(bR.fulfilled,(e,{payload:r})=>{e.txsInfoLoading=!1,e.txInfo=r.data}).addCase(bR.rejected,e=>{e.txsInfoLoading=!1}).addCase(xR.pending,e=>{e.txHistoryLoading=!0}).addCase(xR.fulfilled,(e,{payload:r})=>{e.txHistoryLoading=!1,e.txHistory=r.data.reverse()}).addCase(xR.rejected,e=>{e.txHistoryLoading=!1}).addCase(CR.pending,e=>{e.txMsgsLoading=!0}).addCase(CR.fulfilled,(e,{payload:r,meta:n})=>{const{txHash:i}=n.arg,a=e.txMsgs[i]||[];e.txMsgs={...e.txMsgs,[i]:[...a,...r.data.results]},e.txMsgsLoading=!1,e.txMsgsTotal=r.data.total,e.txMsgsPages=r.data.pages}).addCase(CR.rejected,e=>{e.txMsgsLoading=!1}).addCase(AR.pending,e=>{e.txMsgTypesLoading=!0}).addCase(AR.fulfilled,(e,{payload:r})=>{const n={allTxTypes:{isDefault:!0,title:"All Tx Types"}};r.data.forEach(({type:i})=>{n[i]={title:Kr(i)}}),e.txMsgTypesLoading=!1,e.txMsgTypes=n}).addCase(AR.rejected,e=>{e.txMsgTypesLoading=!1}).addCase(TR.pending,e=>{e.txByModuleLoading=!0}).addCase(TR.fulfilled,(e,{payload:r})=>{e.txByModuleLoading=!1,e.txByModule=r.data.results,e.txByModulePages=r.data.pages}).addCase(TR.rejected,e=>{e.txByModuleLoading=!1}).addCase(ER.pending,e=>{e.txByNftLoading=!0}).addCase(ER.fulfilled,(e,{payload:r})=>{e.txByNftLoading=!1,e.txByNft=r.data.results,e.txByNftPages=r.data.pages}).addCase(ER.rejected,e=>{e.txByNftLoading=!1}).addCase(IR.pending,e=>{e.accountTxByDateLoading=!0}).addCase(IR.fulfilled,(e,{payload:r})=>{e.accountTxByDateLoading=!1,e.accountTxByDate=r.data.results}).addCase(IR.rejected,e=>{e.accountTxByDateLoading=!1})}}),{resetTxMsgs:lut,setRecentTxsCount:cut}=MSe.actions,uut={getAccountTxByDate:IR,getTxsRecent:mR,getTxsByAddress:yR,getTxsByBlock:wR,getTxInfo:bR,getTxHistory:xR,getTxFullJSON:_R,getTxTypes:SR,getTxMsgs:CR,getTxMsgTypes:AR,getTxByModule:TR,getTxsByNft:ER,resetTxMsgs:lut,setRecentTxsCount:cut},fut=t=>t.tx,dut=MSe.reducer,hut={allValidators:[],allValidatorsPages:0,allValidatorsLoading:!1,validators:[],validatorsPages:0,validatorsTotal:0,validatorsRecentLoading:!1,validatorSpotlight:{blockCount:{count:0,total:0},bondHeight:0,consensusPubKey:"",description:"",identity:"",imgUrl:"",jailedUntil:"",moniker:"",operatorAddress:"",ownerAddress:"",removed:!1,siteUrl:"",status:"",unbondingHeight:0,uptime:0,votingPower:{count:0,total:0},withdrawalAddress:""},validatorSpotlightLoading:!1,topValidators:[],topValidatorsLoading:!1,blockValidators:[],blockValidatorsLoading:!1,blockValidatorsPages:0,validatorDelegations:[],validatorDelegationsLoading:!1,validatorDelegationsPages:1,validatorUnbondingDelegations:[],validatorUnbondingDelegationsLoading:!1,validatorUnbondingDelegationsTotal:{amount:"",denom:""},validatorDelegationTxs:[],validatorDelegationTxsLoading:!1,validatorDelegationTxsPages:1,validatorTxs:[],validatorTxsLoading:!1,validatorTxsPages:1,validatorCommission:{bondedTokens:{count:"",denom:"",total:""},commissionRate:{maxChangeRate:"",maxRate:"",rate:""},commissionRewards:{amount:"",denom:""},delegatorBonded:{count:"",denom:"",total:""},delegatorCount:0,selfBonded:{count:"",denom:"",total:""},totalShares:""},validatorCommissionLoading:!1},put="GET_TOP_VALIDATORS",gut="GET_ALL_VALIDATORS",vut="GET_BLOCK_VALIDATORS",mut="GET_VALIDATOR_SPOTLIGHT",yut="GET_VALIDATORS_RECENT",wut="GET_VALIDATOR_COMMISSION",but="GET_VALIDATOR_DELEGATIONS",xut="GET_VALIDATOR_UNBONDING_DELEGATIONS",_ut="GET_VALIDATOR_DELEGATION_TXS",Sut="GET_VALIDATOR_TXS",kR=Bt(vut,({blockHeight:t,page:e=1,count:r=10,sort:n="desc"})=>It({url:`${kGe}/${t}?page=${e}&count=${r}&sort=${n}`})),PR=Bt(yut,({page:t=1,count:e=10,status:r="active"})=>It({url:`${j3e}?page=${t}&count=${e}&status=${r}`})),RR=Bt(gut,({page:t=1,count:e=100,status:r="all"})=>It({url:`${IGe}?page=${t}&count=${e}&status=${r}`})),MR=Bt(put,({page:t=1,count:e=10,sort:r="desc"})=>It({url:`${j3e}?sort=${r}&page=${t}&count=${e}`})),DR=Bt(mut,t=>It({url:`${wL}/${t}`})),NR=Bt(wut,t=>It({url:`${wL}/${t}/commission`})),OR=Bt(but,({id:t,page:e=1,count:r=10})=>It({url:`${wL}/${t}/delegations/bonded?count=${r}&page=${e}`})),LR=Bt(xut,({id:t,page:e=1,count:r=10})=>It({url:`${wL}/${t}/delegations/unbonding?count=${r}&page=${e}`})),$R=Bt(_ut,({id:t,page:e=1,count:r=10})=>It({url:`${g0}/module/DELEGATION?address=${t}&page=${e}&count=${r}`})),BR=Bt(Sut,({id:t,page:e=1,count:r=10})=>It({url:`${g0}/module/VALIDATION?address=${t}&page=${e}&count=${r}`})),Cut={getBlockValidators:kR,getValidatorsRecent:PR,getAllValidators:RR,getTopValidators:MR,getValidatorSpotlight:DR,getValidatorCommission:NR,getValidatorDelegations:OR,getValidatorUnbondingDelegations:LR,getValidatorDelegationTxs:$R,getValidatorTxs:BR},Aut=mo({name:"validator",initialState:hut,reducers:{},extraReducers(t){t.addCase(RR.pending,e=>{e.allValidatorsLoading=!0}).addCase(RR.fulfilled,(e,{payload:r})=>{e.allValidatorsLoading=!1,e.allValidators=r.data.results,e.allValidatorsPages=r.data.pages}).addCase(RR.rejected,e=>{e.allValidatorsLoading=!1}).addCase(BR.pending,e=>{e.validatorTxsLoading=!0}).addCase(BR.fulfilled,(e,{payload:r})=>{e.validatorTxsLoading=!1,e.validatorTxs=r.data.results,e.validatorTxsPages=r.data.pages}).addCase(BR.rejected,e=>{e.validatorTxsLoading=!1}).addCase($R.pending,e=>{e.validatorDelegationTxsLoading=!0}).addCase($R.fulfilled,(e,{payload:r})=>{e.validatorDelegationTxsLoading=!1,e.validatorDelegationTxs=r.data.results,e.validatorDelegationTxsPages=r.data.pages}).addCase($R.rejected,e=>{e.validatorDelegationTxsLoading=!1}).addCase(LR.pending,e=>{e.validatorUnbondingDelegationsLoading=!0}).addCase(LR.fulfilled,(e,{payload:r})=>{e.validatorUnbondingDelegationsLoading=!1,e.validatorUnbondingDelegations=r.data.records,e.validatorUnbondingDelegationsTotal=r.data.rollupTotals.unbondingTotal}).addCase(LR.rejected,e=>{e.validatorUnbondingDelegationsLoading=!1}).addCase(OR.pending,e=>{e.validatorDelegationsLoading=!0}).addCase(OR.fulfilled,(e,{payload:r})=>{e.validatorDelegationsLoading=!1,e.validatorDelegations=r.data.results,e.validatorDelegationsPages=r.data.pages}).addCase(OR.rejected,e=>{e.validatorDelegationsLoading=!1}).addCase(NR.pending,e=>{e.validatorCommissionLoading=!0}).addCase(NR.fulfilled,(e,{payload:r})=>{e.validatorCommissionLoading=!1,e.validatorCommission=r.data}).addCase(NR.rejected,e=>{e.validatorCommissionLoading=!1}).addCase(MR.pending,e=>{e.topValidators=[],e.topValidatorsLoading=!0}).addCase(MR.fulfilled,(e,{payload:r})=>{e.topValidators=r.data.results||[],e.topValidatorsLoading=!1}).addCase(MR.rejected,e=>{e.topValidatorsLoading=!1}).addCase(DR.pending,e=>{e.validatorSpotlightLoading=!0}).addCase(DR.fulfilled,(e,{payload:r})=>{e.validatorSpotlightLoading=!1,e.validatorSpotlight=r.data}).addCase(DR.rejected,e=>{e.validatorSpotlightLoading=!1}).addCase(PR.pending,e=>{e.validatorsRecentLoading=!0}).addCase(PR.fulfilled,(e,{payload:r})=>{e.validatorsRecentLoading=!1,e.validators=r.data.results,e.validatorsPages=r.data.pages,e.validatorsTotal=r.data.total}).addCase(PR.rejected,e=>{e.validatorsRecentLoading=!1}).addCase(kR.pending,e=>{e.blockValidatorsLoading=!0}).addCase(kR.fulfilled,(e,{payload:r})=>{e.blockValidatorsLoading=!1,e.blockValidators=r.data.results,e.blockValidatorsPages=r.data.pages}).addCase(kR.rejected,e=>{e.blockValidatorsLoading=!1})}}),Tut=t=>t.validator,Eut=Aut.reducer,Iut=UWe({account:eqe,asset:$st,app:Yst,block:rlt,contract:vlt,faucet:Slt,governance:Blt,ibc:Klt,name:tct,network:dct,nft:bct,notification:Pct,orderbook:$ct,staking:Yct,tx:dut,validator:Eut,[E1.reducerPath]:E1.reducer}),kut=t=>hVe({devTools:!1,reducer:Iut,middleware:e=>e({serializableCheck:!1}).concat(E1.middleware),preloadedState:t}),Put="modulepreload",Rut=function(t,e){return new URL(t,e).href},lce={},Bf=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=Rut(c,n),c in lce)return;lce[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!n)for(let p=o.length-1;p>=0;p--){const g=o[p];if(g.href===c&&(!u||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":Put,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return e().catch(a)})},Mut=Symbol(),cce=Object.getPrototypeOf,gq=new WeakMap,Dut=t=>t&&(gq.has(t)?gq.get(t):cce(t)===Object.prototype||cce(t)===Array.prototype),Nut=t=>Dut(t)&&t[Mut]||null,uce=(t,e=!0)=>{gq.set(t,e)},AD={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ENV:"test",VITE_APP_LOCAL_FAUCET_HOSTNAME:"http://localhost:42000",VITE_APP_LOCAL_HOSTNAME:"localhost:8612",VITE_APP_PROD_FIGURE_WALLET_URL:"https://www.figure.com/dashboard",VITE_APP_PROD_GA4_ID:"G-GXQC2ZQW28",VITE_APP_PROD_GTM_ID:"GTM-5QCZCBS",VITE_APP_PROD_PROVENANCE_WALLET_URL:"https://wallet.provenance.io",VITE_APP_PROD_SERVER_HOSTNAME:"service-explorer.provenance.io",VITE_APP_TEST_FAUCET_HOSTNAME:"https://test.provenance.io/blockchain/faucet/external",VITE_APP_TEST_FIGURE_WALLET_URL:"https://test.figure.com/dashboard",VITE_APP_TEST_PROVENANCE_WALLET_URL:"https://wallet.test.provenance.io",VITE_APP_TEST_SERVER_HOSTNAME:"service-explorer.test.provenance.io"},xU=t=>typeof t=="object"&&t!==null,hm=new WeakMap,iA=new WeakSet,Out=(t=Object.is,e=(c,u)=>new Proxy(c,u),r=c=>xU(c)&&!iA.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),n=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},i=new WeakMap,a=(c,u,f=n)=>{const d=i.get(c);if((d==null?void 0:d[0])===u)return d[1];const h=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return uce(h,!0),i.set(c,[u,h]),Reflect.ownKeys(c).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const g=Reflect.get(c,p),v={value:g,enumerable:!0,configurable:!0};if(iA.has(g))uce(g,!1);else if(g instanceof Promise)delete v.value,v.get=()=>f(g);else if(hm.has(g)){const[y,m]=hm.get(g);v.value=a(y,m(),f)}Object.defineProperty(h,p,v)}),Object.preventExtensions(h)},o=new WeakMap,s=[1,1],l=c=>{if(!xU(c))throw new Error("object required");const u=o.get(c);if(u)return u;let f=s[0];const d=new Set,h=(D,L=++s[0])=>{f!==L&&(f=L,d.forEach(O=>O(D,L)))};let p=s[1];const g=(D=++s[1])=>(p!==D&&!d.size&&(p=D,y.forEach(([L])=>{const O=L[1](D);O>f&&(f=O)})),f),v=D=>(L,O)=>{const P=[...L];P[1]=[D,...P[1]],h(P,O)},y=new Map,m=(D,L)=>{if((AD?"production":void 0)!=="production"&&y.has(D))throw new Error("prop listener already exists");if(d.size){const O=L[3](v(D));y.set(D,[L,O])}else y.set(D,[L])},b=D=>{var L;const O=y.get(D);O&&(y.delete(D),(L=O[1])==null||L.call(O))},w=D=>(d.add(D),d.size===1&&y.forEach(([O,P],x)=>{if((AD?"production":void 0)!=="production"&&P)throw new Error("remove already exists");const T=O[3](v(x));y.set(x,[O,T])}),()=>{d.delete(D),d.size===0&&y.forEach(([O,P],x)=>{P&&(P(),y.set(x,[O]))})}),C=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),S=e(C,{deleteProperty(D,L){const O=Reflect.get(D,L);b(L);const P=Reflect.deleteProperty(D,L);return P&&h(["delete",[L],O]),P},set(D,L,O,P){const x=Reflect.has(D,L),T=Reflect.get(D,L,P);if(x&&(t(T,O)||o.has(O)&&t(T,o.get(O))))return!0;b(L),xU(O)&&(O=Nut(O)||O);let E=O;if(O instanceof Promise)O.then(N=>{O.status="fulfilled",O.value=N,h(["resolve",[L],N])}).catch(N=>{O.status="rejected",O.reason=N,h(["reject",[L],N])});else{!hm.has(O)&&r(O)&&(E=l(O));const N=!iA.has(E)&&hm.get(E);N&&m(L,N)}return Reflect.set(D,L,E,P),h(["set",[L],O,T]),!0}});o.set(c,S);const I=[C,g,a,w];return hm.set(S,I),Reflect.ownKeys(c).forEach(D=>{const L=Object.getOwnPropertyDescriptor(c,D);"value"in L&&(S[D]=c[D],delete L.value,delete L.writable),Object.defineProperty(C,D,L)}),S})=>[l,hm,iA,t,e,r,n,i,a,o,s],[Lut]=Out();function wa(t={}){return Lut(t)}function Hl(t,e,r){const n=hm.get(t);(AD?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const a=[],o=n[3];let s=!1;const c=o(u=>{a.push(u),i||(i=Promise.resolve().then(()=>{i=void 0,s&&e(a.splice(0))}))});return s=!0,()=>{s=!1,c()}}function vq(t,e){const r=hm.get(t);(AD?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,a]=r;return a(n,i(),e)}function Wd(t){return iA.add(t),t}function gl(t,e,r,n){let i=t[e];return Hl(t,()=>{const a=t[e];Object.is(i,a)||r(i=a)})}function $ut(t){const e=wa({data:Array.from([]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(a=>a[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(e,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(e),e}var DSe={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(R2,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",o="second",s="minute",l="hour",c="day",u="week",f="month",d="quarter",h="year",p="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(T){var E=["th","st","nd","rd"],N=T%100;return"["+T+(E[(N-20)%10]||E[N]||E[0])+"]"}},b=function(T,E,N){var F=String(T);return!F||F.length>=E?T:""+Array(E+1-F.length).join(N)+T},w={s:b,z:function(T){var E=-T.utcOffset(),N=Math.abs(E),F=Math.floor(N/60),B=N%60;return(E<=0?"+":"-")+b(F,2,"0")+":"+b(B,2,"0")},m:function T(E,N){if(E.date()1)return T(k[0])}else{var $=E.name;A[$]=E,B=$}return!F&&B&&(C=B),B||!F&&C},L=function(T,E){if(I(T))return T.clone();var N=typeof E=="object"?E:{};return N.date=T,N.args=arguments,new P(N)},O=w;O.l=D,O.i=I,O.w=function(T,E){return L(T,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var P=function(){function T(N){this.$L=D(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[S]=!0}var E=T.prototype;return E.parse=function(N){this.$d=function(F){var B=F.date,j=F.utc;if(B===null)return new Date(NaN);if(O.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var k=B.match(v);if(k){var $=k[2]-1||0,H=(k[7]||"0").substring(0,3);return j?new Date(Date.UTC(k[1],$,k[3]||1,k[4]||0,k[5]||0,k[6]||0,H)):new Date(k[1],$,k[3]||1,k[4]||0,k[5]||0,k[6]||0,H)}}return new Date(B)}(N),this.init()},E.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},E.$utils=function(){return O},E.isValid=function(){return this.$d.toString()!==g},E.isSame=function(N,F){var B=L(N);return this.startOf(F)<=B&&B<=this.endOf(F)},E.isAfter=function(N,F){return L(N)0,A<=C.r||!C.r){A<=1&&w>0&&(C=m[w-1]);var S=y[C.l];h&&(A=h(""+A)),g=typeof S=="string"?S.replace("%d",A):S(A,u,C.l,v);break}}if(u)return g;var I=v?y.future:y.past;return typeof I=="function"?I(g):I.replace("%s",g)},a.to=function(c,u){return s(c,u,this,!0)},a.from=function(c,u){return s(c,u,this)};var l=function(c){return c.$u?i.utc():i()};a.toNow=function(c){return this.to(l(this),c)},a.fromNow=function(c){return this.from(l(this),c)}}})})(OSe);var Uut=OSe.exports;const zut=Un(Uut);var LSe={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(R2,function(){return function(r,n,i){i.updateLocale=function(a,o){var s=i.Ls[a];if(s)return(o?Object.keys(o):[]).forEach(function(l){s[l]=o[l]}),s}}})})(LSe);var Hut=LSe.exports;const Vut=Un(Hut);h3.extend(zut);h3.extend(Vut);const Gut={...jut,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};h3.locale("en-web3-modal",Gut);const KX={getYear(t=new Date().toISOString()){return h3(t).year()},getRelativeDateFromNow(t){return h3(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return h3(t).format(e)}},Bd={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t}};var Wut=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,_U=Math.ceil,cf=Math.floor,fc="[BigNumber Error] ",fce=fc+"Number primitive has more than 15 significant digits: ",xd=1e14,yn=14,SU=9007199254740991,CU=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Vv=1e7,Ko=1e9;function $Se(t){var e,r,n,i=m.prototype={constructor:m,toString:null,valueOf:null},a=new m(1),o=20,s=4,l=-7,c=21,u=-1e7,f=1e7,d=!1,h=1,p=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},v="0123456789abcdefghijklmnopqrstuvwxyz",y=!0;function m(I,D){var L,O,P,x,T,E,N,F,B=this;if(!(B instanceof m))return new m(I,D);if(D==null){if(I&&I._isBigNumber===!0){B.s=I.s,!I.c||I.e>f?B.c=B.e=null:I.e=10;T/=10,x++);x>f?B.c=B.e=null:(B.e=x,B.c=[I]);return}F=String(I)}else{if(!Wut.test(F=String(I)))return n(B,F,E);B.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(x=F.indexOf("."))>-1&&(F=F.replace(".","")),(T=F.search(/e/i))>0?(x<0&&(x=T),x+=+F.slice(T+1),F=F.substring(0,T)):x<0&&(x=F.length)}else{if(Oa(D,2,v.length,"Base"),D==10&&y)return B=new m(I),A(B,o+B.e+1,s);if(F=String(I),E=typeof I=="number"){if(I*0!=0)return n(B,F,E,D);if(B.s=1/I<0?(F=F.slice(1),-1):1,m.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(fce+I)}else B.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(L=v.slice(0,D),x=T=0,N=F.length;Tx){x=N;continue}}else if(!P&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){P=!0,T=-1,x=0;continue}return n(B,String(I),E,D)}E=!1,F=r(F,D,10,B.s),(x=F.indexOf("."))>-1?F=F.replace(".",""):x=F.length}for(T=0;F.charCodeAt(T)===48;T++);for(N=F.length;F.charCodeAt(--N)===48;);if(F=F.slice(T,++N)){if(N-=T,E&&m.DEBUG&&N>15&&(I>SU||I!==cf(I)))throw Error(fce+B.s*I);if((x=x-T-1)>f)B.c=B.e=null;else if(x=-Ko&&P<=Ko&&P===cf(P)){if(O[0]===0){if(P===0&&O.length===1)return!0;break e}if(D=(P+1)%yn,D<1&&(D+=yn),String(O[0]).length==D){for(D=0;D=xd||L!==cf(L))break e;if(L!==0)return!0}}}else if(O===null&&P===null&&(x===null||x===1||x===-1))return!0;throw Error(fc+"Invalid BigNumber: "+I)},m.maximum=m.max=function(){return w(arguments,-1)},m.minimum=m.min=function(){return w(arguments,1)},m.random=function(){var I=9007199254740992,D=Math.random()*I&2097151?function(){return cf(Math.random()*I)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(L){var O,P,x,T,E,N=0,F=[],B=new m(a);if(L==null?L=o:Oa(L,0,Ko),T=_U(L/yn),d)if(crypto.getRandomValues){for(O=crypto.getRandomValues(new Uint32Array(T*=2));N>>11),E>=9e15?(P=crypto.getRandomValues(new Uint32Array(2)),O[N]=P[0],O[N+1]=P[1]):(F.push(E%1e14),N+=2);N=T/2}else if(crypto.randomBytes){for(O=crypto.randomBytes(T*=7);N=9e15?crypto.randomBytes(7).copy(O,N):(F.push(E%1e14),N+=7);N=T/7}else throw d=!1,Error(fc+"crypto unavailable");if(!d)for(;N=10;E/=10,N++);NP-1&&(E[T+1]==null&&(E[T+1]=0),E[T+1]+=E[T]/P|0,E[T]%=P)}return E.reverse()}return function(L,O,P,x,T){var E,N,F,B,j,k,$,H,Y=L.indexOf("."),ie=o,W=s;for(Y>=0&&(B=p,p=0,L=L.replace(".",""),H=new m(O),k=H.pow(L.length-Y),p=B,H.c=D(W0(Wu(k.c),k.e,"0"),10,P,I),H.e=H.c.length),$=D(L,O,P,T?(E=v,I):(E=I,v)),F=B=$.length;$[--B]==0;$.pop());if(!$[0])return E.charAt(0);if(Y<0?--F:(k.c=$,k.e=F,k.s=x,k=e(k,H,ie,W,P),$=k.c,j=k.r,F=k.e),N=F+ie+1,Y=$[N],B=P/2,j=j||N<0||$[N+1]!=null,j=W<4?(Y!=null||j)&&(W==0||W==(k.s<0?3:2)):Y>B||Y==B&&(W==4||j||W==6&&$[N-1]&1||W==(k.s<0?8:7)),N<1||!$[0])L=j?W0(E.charAt(1),-ie,E.charAt(0)):E.charAt(0);else{if($.length=N,j)for(--P;++$[--N]>P;)$[N]=0,N||(++F,$=[1].concat($));for(B=$.length;!$[--B];);for(Y=0,L="";Y<=B;L+=E.charAt($[Y++]));L=W0(L,F,E.charAt(0))}return L}}(),e=function(){function I(O,P,x){var T,E,N,F,B=0,j=O.length,k=P%Vv,$=P/Vv|0;for(O=O.slice();j--;)N=O[j]%Vv,F=O[j]/Vv|0,T=$*N+F*k,E=k*N+T%Vv*Vv+B,B=(E/x|0)+(T/Vv|0)+$*F,O[j]=E%x;return B&&(O=[B].concat(O)),O}function D(O,P,x,T){var E,N;if(x!=T)N=x>T?1:-1;else for(E=N=0;EP[E]?1:-1;break}return N}function L(O,P,x,T){for(var E=0;x--;)O[x]-=E,E=O[x]1;O.splice(0,1));}return function(O,P,x,T,E){var N,F,B,j,k,$,H,Y,ie,W,Q,J,ee,ne,V,oe,ye,Te=O.s==P.s?1:-1,Me=O.c,Oe=P.c;if(!Me||!Me[0]||!Oe||!Oe[0])return new m(!O.s||!P.s||(Me?Oe&&Me[0]==Oe[0]:!Oe)?NaN:Me&&Me[0]==0||!Oe?Te*0:Te/0);for(Y=new m(Te),ie=Y.c=[],F=O.e-P.e,Te=x+F+1,E||(E=xd,F=uf(O.e/yn)-uf(P.e/yn),Te=Te/yn|0),B=0;Oe[B]==(Me[B]||0);B++);if(Oe[B]>(Me[B]||0)&&F--,Te<0)ie.push(1),j=!0;else{for(ne=Me.length,oe=Oe.length,B=0,Te+=2,k=cf(E/(Oe[0]+1)),k>1&&(Oe=I(Oe,k,E),Me=I(Me,k,E),oe=Oe.length,ne=Me.length),ee=oe,W=Me.slice(0,oe),Q=W.length;Q=E/2&&V++;do{if(k=0,N=D(Oe,W,oe,Q),N<0){if(J=W[0],oe!=Q&&(J=J*E+(W[1]||0)),k=cf(J/V),k>1)for(k>=E&&(k=E-1),$=I(Oe,k,E),H=$.length,Q=W.length;D($,W,H,Q)==1;)k--,L($,oe=10;Te/=10,B++);A(Y,x+(Y.e=B+F*yn-1)+1,T,j)}else Y.e=F,Y.r=+j;return Y}}();function b(I,D,L,O){var P,x,T,E,N;if(L==null?L=s:Oa(L,0,8),!I.c)return I.toString();if(P=I.c[0],T=I.e,D==null)N=Wu(I.c),N=O==1||O==2&&(T<=l||T>=c)?e7(N,T):W0(N,T,"0");else if(I=A(new m(I),D,L),x=I.e,N=Wu(I.c),E=N.length,O==1||O==2&&(D<=x||x<=l)){for(;EE){if(--D>0)for(N+=".";D--;N+="0");}else if(D+=x-E,D>0)for(x+1==E&&(N+=".");D--;N+="0");return I.s<0&&P?"-"+N:N}function w(I,D){for(var L,O,P=1,x=new m(I[0]);P=10;P/=10,O++);return(L=O+L*yn-1)>f?I.c=I.e=null:L=10;E/=10,P++);if(x=D-P,x<0)x+=yn,T=D,N=j[F=0],B=cf(N/k[P-T-1]%10);else if(F=_U((x+1)/yn),F>=j.length)if(O){for(;j.length<=F;j.push(0));N=B=0,P=1,x%=yn,T=x-yn+1}else break e;else{for(N=E=j[F],P=1;E>=10;E/=10,P++);x%=yn,T=x-yn+P,B=T<0?0:cf(N/k[P-T-1]%10)}if(O=O||D<0||j[F+1]!=null||(T<0?N:N%k[P-T-1]),O=L<4?(B||O)&&(L==0||L==(I.s<0?3:2)):B>5||B==5&&(L==4||O||L==6&&(x>0?T>0?N/k[P-T]:0:j[F-1])%10&1||L==(I.s<0?8:7)),D<1||!j[0])return j.length=0,O?(D-=I.e+1,j[0]=k[(yn-D%yn)%yn],I.e=-D||0):j[0]=I.e=0,I;if(x==0?(j.length=F,E=1,F--):(j.length=F+1,E=k[yn-x],j[F]=T>0?cf(N/k[P-T]%k[T])*E:0),O)for(;;)if(F==0){for(x=1,T=j[0];T>=10;T/=10,x++);for(T=j[0]+=E,E=1;T>=10;T/=10,E++);x!=E&&(I.e++,j[0]==xd&&(j[0]=1));break}else{if(j[F]+=E,j[F]!=xd)break;j[F--]=0,E=1}for(x=j.length;j[--x]===0;j.pop());}I.e>f?I.c=I.e=null:I.e=c?e7(D,L):W0(D,L,"0"),I.s<0?"-"+D:D)}return i.absoluteValue=i.abs=function(){var I=new m(this);return I.s<0&&(I.s=1),I},i.comparedTo=function(I,D){return Ly(this,new m(I,D))},i.decimalPlaces=i.dp=function(I,D){var L,O,P,x=this;if(I!=null)return Oa(I,0,Ko),D==null?D=s:Oa(D,0,8),A(new m(x),I+x.e+1,D);if(!(L=x.c))return null;if(O=((P=L.length-1)-uf(this.e/yn))*yn,P=L[P])for(;P%10==0;P/=10,O--);return O<0&&(O=0),O},i.dividedBy=i.div=function(I,D){return e(this,new m(I,D),o,s)},i.dividedToIntegerBy=i.idiv=function(I,D){return e(this,new m(I,D),0,1)},i.exponentiatedBy=i.pow=function(I,D){var L,O,P,x,T,E,N,F,B,j=this;if(I=new m(I),I.c&&!I.isInteger())throw Error(fc+"Exponent not an integer: "+S(I));if(D!=null&&(D=new m(D)),E=I.e>14,!j.c||!j.c[0]||j.c[0]==1&&!j.e&&j.c.length==1||!I.c||!I.c[0])return B=new m(Math.pow(+S(j),E?I.s*(2-JI(I)):+S(I))),D?B.mod(D):B;if(N=I.s<0,D){if(D.c?!D.c[0]:!D.s)return new m(NaN);O=!N&&j.isInteger()&&D.isInteger(),O&&(j=j.mod(D))}else{if(I.e>9&&(j.e>0||j.e<-1||(j.e==0?j.c[0]>1||E&&j.c[1]>=24e7:j.c[0]<8e13||E&&j.c[0]<=9999975e7)))return x=j.s<0&&JI(I)?-0:0,j.e>-1&&(x=1/x),new m(N?1/x:x);p&&(x=_U(p/yn+2))}for(E?(L=new m(.5),N&&(I.s=1),F=JI(I)):(P=Math.abs(+S(I)),F=P%2),B=new m(a);;){if(F){if(B=B.times(j),!B.c)break;x?B.c.length>x&&(B.c.length=x):O&&(B=B.mod(D))}if(P){if(P=cf(P/2),P===0)break;F=P%2}else if(I=I.times(L),A(I,I.e+1,1),I.e>14)F=JI(I);else{if(P=+S(I),P===0)break;F=P%2}j=j.times(j),x?j.c&&j.c.length>x&&(j.c.length=x):O&&(j=j.mod(D))}return O?B:(N&&(B=a.div(B)),D?B.mod(D):x?A(B,p,s,T):B)},i.integerValue=function(I){var D=new m(this);return I==null?I=s:Oa(I,0,8),A(D,D.e+1,I)},i.isEqualTo=i.eq=function(I,D){return Ly(this,new m(I,D))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(I,D){return Ly(this,new m(I,D))>0},i.isGreaterThanOrEqualTo=i.gte=function(I,D){return(D=Ly(this,new m(I,D)))===1||D===0},i.isInteger=function(){return!!this.c&&uf(this.e/yn)>this.c.length-2},i.isLessThan=i.lt=function(I,D){return Ly(this,new m(I,D))<0},i.isLessThanOrEqualTo=i.lte=function(I,D){return(D=Ly(this,new m(I,D)))===-1||D===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(I,D){var L,O,P,x,T=this,E=T.s;if(I=new m(I,D),D=I.s,!E||!D)return new m(NaN);if(E!=D)return I.s=-D,T.plus(I);var N=T.e/yn,F=I.e/yn,B=T.c,j=I.c;if(!N||!F){if(!B||!j)return B?(I.s=-D,I):new m(j?T:NaN);if(!B[0]||!j[0])return j[0]?(I.s=-D,I):new m(B[0]?T:s==3?-0:0)}if(N=uf(N),F=uf(F),B=B.slice(),E=N-F){for((x=E<0)?(E=-E,P=B):(F=N,P=j),P.reverse(),D=E;D--;P.push(0));P.reverse()}else for(O=(x=(E=B.length)<(D=j.length))?E:D,E=D=0;D0)for(;D--;B[L++]=0);for(D=xd-1;O>E;){if(B[--O]=0;){for(L=0,k=J[P]%ie,$=J[P]/ie|0,T=N,x=P+T;x>P;)F=Q[--T]%ie,B=Q[T]/ie|0,E=$*F+B*k,F=k*F+E%ie*ie+H[x]+L,L=(F/Y|0)+(E/ie|0)+$*B,H[x--]=F%Y;H[x]=L}return L?++O:H.splice(0,1),C(I,H,O)},i.negated=function(){var I=new m(this);return I.s=-I.s||null,I},i.plus=function(I,D){var L,O=this,P=O.s;if(I=new m(I,D),D=I.s,!P||!D)return new m(NaN);if(P!=D)return I.s=-D,O.minus(I);var x=O.e/yn,T=I.e/yn,E=O.c,N=I.c;if(!x||!T){if(!E||!N)return new m(P/0);if(!E[0]||!N[0])return N[0]?I:new m(E[0]?O:P*0)}if(x=uf(x),T=uf(T),E=E.slice(),P=x-T){for(P>0?(T=x,L=N):(P=-P,L=E),L.reverse();P--;L.push(0));L.reverse()}for(P=E.length,D=N.length,P-D<0&&(L=N,N=E,E=L,D=P),P=0;D;)P=(E[--D]=E[D]+N[D]+P)/xd|0,E[D]=xd===E[D]?0:E[D]%xd;return P&&(E=[P].concat(E),++T),C(I,E,T)},i.precision=i.sd=function(I,D){var L,O,P,x=this;if(I!=null&&I!==!!I)return Oa(I,1,Ko),D==null?D=s:Oa(D,0,8),A(new m(x),I,D);if(!(L=x.c))return null;if(P=L.length-1,O=P*yn+1,P=L[P]){for(;P%10==0;P/=10,O--);for(P=L[0];P>=10;P/=10,O++);}return I&&x.e+1>O&&(O=x.e+1),O},i.shiftedBy=function(I){return Oa(I,-SU,SU),this.times("1e"+I)},i.squareRoot=i.sqrt=function(){var I,D,L,O,P,x=this,T=x.c,E=x.s,N=x.e,F=o+4,B=new m("0.5");if(E!==1||!T||!T[0])return new m(!E||E<0&&(!T||T[0])?NaN:T?x:1/0);if(E=Math.sqrt(+S(x)),E==0||E==1/0?(D=Wu(T),(D.length+N)%2==0&&(D+="0"),E=Math.sqrt(+D),N=uf((N+1)/2)-(N<0||N%2),E==1/0?D="5e"+N:(D=E.toExponential(),D=D.slice(0,D.indexOf("e")+1)+N),L=new m(D)):L=new m(E+""),L.c[0]){for(N=L.e,E=N+F,E<3&&(E=0);;)if(P=L,L=B.times(P.plus(e(x,P,F,1))),Wu(P.c).slice(0,E)===(D=Wu(L.c)).slice(0,E))if(L.e0&&H>0){for(x=H%E||E,B=$.substr(0,x);x0&&(B+=F+$.slice(x)),k&&(B="-"+B)}O=j?B+(L.decimalSeparator||"")+((N=+L.fractionGroupSize)?j.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(L.fractionGroupSeparator||"")):j):B}return(L.prefix||"")+O+(L.suffix||"")},i.toFraction=function(I){var D,L,O,P,x,T,E,N,F,B,j,k,$=this,H=$.c;if(I!=null&&(E=new m(I),!E.isInteger()&&(E.c||E.s!==1)||E.lt(a)))throw Error(fc+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+S(E));if(!H)return new m($);for(D=new m(a),F=L=new m(a),O=N=new m(a),k=Wu(H),x=D.e=k.length-$.e-1,D.c[0]=CU[(T=x%yn)<0?yn+T:T],I=!I||E.comparedTo(D)>0?x>0?D:F:E,T=f,f=1/0,E=new m(k),N.c[0]=0;B=e(E,D,0,1),P=L.plus(B.times(O)),P.comparedTo(I)!=1;)L=O,O=P,F=N.plus(B.times(P=F)),N=P,D=E.minus(B.times(P=D)),E=P;return P=e(I.minus(L),O,0,1),N=N.plus(P.times(F)),L=L.plus(P.times(O)),N.s=F.s=$.s,x=x*2,j=e(F,O,x,s).minus($).abs().comparedTo(e(N,L,x,s).minus($).abs())<1?[F,O]:[N,L],f=T,j},i.toNumber=function(){return+S(this)},i.toPrecision=function(I,D){return I!=null&&Oa(I,1,Ko),b(this,I,D,2)},i.toString=function(I){var D,L=this,O=L.s,P=L.e;return P===null?O?(D="Infinity",O<0&&(D="-"+D)):D="NaN":(I==null?D=P<=l||P>=c?e7(Wu(L.c),P):W0(Wu(L.c),P,"0"):I===10&&y?(L=A(new m(L),o+P+1,s),D=W0(Wu(L.c),L.e,"0")):(Oa(I,2,v.length,"Base"),D=r(W0(Wu(L.c),P,"0"),10,I,O,!0)),O<0&&L.c[0]&&(D="-"+D)),D},i.valueOf=i.toJSON=function(){return S(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,t!=null&&m.set(t),m}function uf(t){var e=t|0;return t>0||t===e?e:e-1}function Wu(t){for(var e,r,n=1,i=t.length,a=t[0]+"";nc^r?1:-1;for(s=(l=i.length)<(c=a.length)?l:c,o=0;oa[o]^r?1:-1;return l==c?0:l>c^r?1:-1}function Oa(t,e,r,n){if(tr||t!==cf(t))throw Error(fc+(n||"Argument")+(typeof t=="number"?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function JI(t){var e=t.c.length-1;return uf(t.e/yn)==e&&t.c[e]%2!=0}function e7(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function W0(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(n=t.length,++e>n){for(i=r,e-=n;--e;i+=r);t+=i}else e="0"&&a<="9";!i&&(s||l||c||u)&&t.preventDefault(),e==="0"&&!f&&!d&&a==="0"&&t.preventDefault(),e==="0"&&h&&(r(a),t.preventDefault()),(f||d)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!h&&!n.includes(a)&&!d&&!f&&t.preventDefault()}},Yut=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Kut=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],ya={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"]},Zut={getERC20Abi:t=>ya.USDT_CONTRACT_ADDRESSES.includes(t)?Kut:Yut},ZX={URLS:{FAQ:"https://walletconnect.com/faq"}},ra={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE"},na={setItem(t,e){r7()&&localStorage.setItem(t,e)},getItem(t){if(r7())return localStorage.getItem(t)||void 0},removeItem(t){r7()&&localStorage.removeItem(t)},clear(){r7()&&localStorage.clear()}};function r7(){return typeof window<"u"&&typeof localStorage<"u"}function Sg(t,e){return e==="light"?{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function Qut(t){return(t==null?void 0:t.endsWith(ya.WC_NAME_SUFFIX_LEGACY))||(t==null?void 0:t.endsWith(ya.WC_NAME_SUFFIX))}const Xut="rpc.walletconnect.org",Y6={extendRpcUrlWithProjectId(t,e){if(t.includes(Xut)){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},extendCaipNetwork(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return{...t,imageId:e[t.chainId],imageUrl:r==null?void 0:r[t.chainId],rpcUrl:Y6.extendRpcUrlWithProjectId(t.rpcUrl,n)}},extendCaipNetworks(t,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}){return t.map(i=>Y6.extendCaipNetwork(i,{networkImageIds:e,customNetworkImageUrls:r,projectId:n}))}},AU="https://secure.walletconnect.org",BSe=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],Jut="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",Da={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:AU,SECURE_SITE_DASHBOARD:`${AU}/dashboard`,SECURE_SITE_FAVICON:`${AU}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:["eip155"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0}},gt={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const t=window.navigator.userAgent.toLowerCase();return gt.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return gt.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Da.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Da.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Da.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e){if(gt.isHttpUrl(t))return this.formatUniversalUrl(t,e);let r=t;r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.isTelegram()&&this.isAndroid()&&(e=encodeURIComponent(e));const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},formatUniversalUrl(t,e){if(!gt.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},getOpenTargetForPlatform(t){return this.isTelegram()?"_blank":t},openHref(t,e,r){window.open(t,this.getOpenTargetForPlatform(e),r||"noreferrer noopener")},returnOpenHref(t,e,r){return window.open(t,this.getOpenTargetForPlatform(e),r||"noreferrer noopener")},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,gt.wait(2e3)])},formatBalance(t,e){let r="0.000";if(typeof t=="string"){const n=Number(t);if(n){const i=Math.floor(n*1e3)/1e3;i&&(r=i.toString())}}return`${r}${e?` ${e}`:""}`},formatBalance2(t,e){var n;let r;if(t==="0")r="0";else if(typeof t=="string"){const i=Number(t);i&&(r=(n=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:n[0])}return{value:r??"0",rest:r==="0"?"000":"",symbol:e}},getApiUrl(){return ya.W3M_API_URL},getBlockchainApiUrl(){return ya.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return ya.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const a=r[n.id],o=r[i.id];return a!==void 0&&o!==void 0?a-o:a!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?"universal":t.map(a=>a.adapterType).join(",");return`${e}-${i}-${r}`}};async function BC(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class PL{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const a=this.createUrl(i);return(await BC(a,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await BC(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const a=this.createUrl(i);return(await BC(a,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const a=this.createUrl(i);return(await BC(a,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const a=this.createUrl(i);return(await BC(a,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,a)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}}const Zi=wa({features:Da.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),At={state:Zi,subscribeKey(t,e){return gl(Zi,t,e)},setOptions(t){Object.assign(Zi,t)},setFeatures(t){t&&Object.entries(t).forEach(([e,r])=>{Zi.features||(Zi.features=Da.DEFAULT_FEATURES),e in Zi.features&&(Zi.features[e]=r)})},setProjectId(t){Zi.projectId=t},setAllWallets(t){Zi.allWallets=t},setIncludeWalletIds(t){Zi.includeWalletIds=t},setExcludeWalletIds(t){Zi.excludeWalletIds=t},setFeaturedWalletIds(t){Zi.featuredWalletIds=t},setTokens(t){Zi.tokens=t},setTermsConditionsUrl(t){Zi.termsConditionsUrl=t},setPrivacyPolicyUrl(t){Zi.privacyPolicyUrl=t},setCustomWallets(t){Zi.customWallets=t},setIsSiweEnabled(t){Zi.isSiweEnabled=t},setIsUniversalProvider(t){Zi.isUniversalProvider=t},setSdkVersion(t){Zi.sdkVersion=t},setMetadata(t){Zi.metadata=t},setDisableAppend(t){Zi.disableAppend=t},setEIP6963Enabled(t){Zi.enableEIP6963=t},setDebug(t){Zi.debug=t},setEnableWalletConnect(t){Zi.enableWalletConnect=t},setEnableWallets(t){Zi.enableWallets=t},setHasMultipleAddresses(t){Zi.hasMultipleAddresses=t}},eft=gt.getAnalyticsUrl(),tft=new PL({baseUrl:eft,clientId:null}),rft=["MODAL_CREATED"],Fx=wa({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),Vt={state:Fx,subscribe(t){return Hl(Fx,()=>t(Fx))},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=At.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":r||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(t){try{if(rft.includes(t.data.event)||typeof window>"u")return;await tft.post({path:"/e",headers:Vt._getApiHeaders(),body:{eventId:gt.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){var e;Fx.timestamp=Date.now(),Fx.data=t,(e=At.state.features)!=null&&e.analytics&&Vt._sendAnalyticsEvent(Fx)}},dce=wa({supportsAllNetworks:!0,smartAccountEnabledNetworks:[]}),Jr={state:dce,replaceState(t){t&&Object.assign(dce,Wd(t))},subscribeKey(t,e){let r;return Pe.subscribeChainProp("networkState",n=>{if(n){const i=n[t];r!==i&&(r=i,e(i))}})},_getClient(){return Pe.getNetworkControllerClient()},setActiveCaipNetwork(t){if(!t)return;Pe.setActiveCaipNetwork(t),this.checkIfSupportedNetwork()||this.showUnsupportedChainUI()},setCaipNetwork(t){if(t){if(!(t!=null&&t.chainNamespace))throw new Error("chain is required to set active network");Pe.setCaipNetwork(t==null?void 0:t.chainNamespace,t)}},setRequestedCaipNetworks(t,e){Pe.setChainNetworkData(e,{requestedCaipNetworks:t})},setAllowUnsupportedChain(t,e){Pe.setChainNetworkData(e||Pe.state.activeChain,{allowUnsupportedCaipNetwork:t})},setSmartAccountEnabledNetworks(t,e){Pe.setChainNetworkData(e,{smartAccountEnabledNetworks:t})},getRequestedCaipNetworks(t){let e;if(!Pe.state.activeChain)throw new Error("activeChain is required to get requested networks");if(t){const a=t;if(!a)throw new Error("chain is required to get requested networks");e=[a]}else e=[...Pe.state.chains.keys()];const r=[],n=[];return e.forEach(a=>{var o,s,l,c,u,f,d,h;(s=(o=Pe.state.chains.get(a))==null?void 0:o.networkState)!=null&&s.approvedCaipNetworkIds&&r.push(...((c=(l=Pe.state.chains.get(a))==null?void 0:l.networkState)==null?void 0:c.approvedCaipNetworkIds)||[]),(f=(u=Pe.state.chains.get(a))==null?void 0:u.networkState)!=null&&f.requestedCaipNetworks&&n.push(...((h=(d=Pe.state.chains.get(a))==null?void 0:d.networkState)==null?void 0:h.requestedCaipNetworks)||[])}),gt.sortRequestedNetworks(r,n)},async switchActiveNetwork(t){const e=Pe.getNetworkControllerClient(t==null?void 0:t.chainNamespace);e&&await e.switchCaipNetwork(t),Pe.setActiveCaipNetwork(t),t&&Vt.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.id}})},getApprovedCaipNetworkIds(t){var r,n;if(t){const i=t;if(!i)throw new Error("chain is required to get approved network IDs");return(n=(r=Pe.state.chains.get(i))==null?void 0:r.networkState)==null?void 0:n.approvedCaipNetworkIds}const e=[];return Object.values(Pe.state.chains).forEach(i=>{var a;i.networkState.approvedCaipNetworkIds&&e.push(...((a=i.networkState)==null?void 0:a.approvedCaipNetworkIds)||[])}),e},async setApprovedCaipNetworksData(t){if(!t)throw new Error("chain is required to set approved network data");const e=Pe.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());Pe.setChainNetworkData(t,r)},checkIfSupportedNetwork(){const t=Pe.state.activeChain;if(!t)return!1;const e=Pe.state.activeCaipNetwork,r=this.getRequestedCaipNetworks(t);return r.length?r==null?void 0:r.some(n=>n.id===(e==null?void 0:e.id)):!0},checkIfSmartAccountEnabled(){var n;const t=Bd.caipNetworkIdToNumber((n=Pe.state.activeCaipNetwork)==null?void 0:n.id);if(!Pe.state.activeChain)throw new Error("activeChain is required to check if smart account is enabled");if(!t)return!1;const r=Pe.getNetworkProp("smartAccountEnabledNetworks");return!!(r!=null&&r.includes(Number(t)))},checkIfNamesSupported(){const t=Pe.state.activeCaipNetwork;return(t==null?void 0:t.chainNamespace)&&Da.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(t.chainNamespace)},resetNetwork(){const t=Pe.state.activeChain;if(!t)throw new Error("chain is required to reset network");Pe.setChainNetworkData(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},getSupportsAllNetworks(){var e,r;const t=Pe.state.activeChain;if(!t)throw new Error("chain is required to check if network supports all networks");return(r=(e=Pe.state.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.supportsAllNetworks},showUnsupportedChainUI(){setTimeout(()=>{jr.open({view:"UnsupportedChain"})},300)},getActiveNetworkTokenAddress(){var e,r;const t=Da.NATIVE_TOKEN_ADDRESS[((e=Pe.state.activeCaipNetwork)==null?void 0:e.chainNamespace)||"eip155"];return`${((r=Pe.state.activeCaipNetwork)==null?void 0:r.id)||"eip155:1"}:${t}`}},nft={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},FSe=gt.getBlockchainApiUrl(),_o=wa({clientId:null,api:new PL({baseUrl:FSe,clientId:null})}),Ma={state:_o,fetchIdentity({address:t}){return _o.api.get({path:`/v1/identity/${t}`,params:{projectId:At.state.projectId,sender:Pe.state.activeCaipAddress?gt.getPlainAddress(Pe.state.activeCaipAddress):void 0}})},fetchTransactions({account:t,projectId:e,cursor:r,onramp:n,signal:i,cache:a,chainId:o}){return _o.api.get({path:`/v1/account/${t}/history`,params:{projectId:e,cursor:r,onramp:n,chainId:o},signal:i,cache:a})},fetchSwapQuote({projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:a}){return _o.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:t,amount:e,userAddress:r,from:n,to:i,gasPrice:a}})},fetchSwapTokens({projectId:t,chainId:e}){return _o.api.get({path:"/v1/convert/tokens",params:{projectId:t,chainId:e}})},fetchTokenPrice({projectId:t,addresses:e}){return _o.api.post({path:"/v1/fungible/price",body:{projectId:t,currency:"usd",addresses:e},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:t,tokenAddress:e,userAddress:r}){const{sdkType:n,sdkVersion:i}=At.state;return _o.api.get({path:"/v1/convert/allowance",params:{projectId:t,tokenAddress:e,userAddress:r},headers:{"Content-Type":"application/json","x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:t,chainId:e}){const{sdkType:r,sdkVersion:n}=At.state;return _o.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":r,"x-sdk-version":n||"html-wagmi-4.2.2"},params:{projectId:t,chainId:e}})},generateSwapCalldata({amount:t,from:e,projectId:r,to:n,userAddress:i}){return _o.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:Da.CONVERT_SLIPPAGE_TOLERANCE},from:e,projectId:r,to:n,userAddress:i}})},generateApproveCalldata({from:t,projectId:e,to:r,userAddress:n}){const{sdkType:i,sdkVersion:a}=At.state;return _o.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":i,"x-sdk-version":a||"html-wagmi-4.2.2"},params:{projectId:e,userAddress:n,from:t,to:r}})},async getBalance(t,e,r){const{sdkType:n,sdkVersion:i}=At.state;return _o.api.get({path:`/v1/account/${t}/balance`,headers:{"x-sdk-type":n,"x-sdk-version":i||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:At.state.projectId,chainId:e,forceUpdate:r}})},async lookupEnsName(t){return _o.api.get({path:`/v1/profile/account/${t}`,params:{projectId:At.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:t}){return _o.api.get({path:`/v1/profile/reverse/${t}`,params:{sender:Ze.state.address,projectId:At.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(t){return _o.api.get({path:`/v1/profile/suggestions/${t}`,params:{projectId:At.state.projectId}})},async registerEnsName({coinType:t,address:e,message:r,signature:n}){return _o.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){return(await _o.api.post({path:"/v1/generators/onrampurl",params:{projectId:At.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url},async getOnrampOptions(){try{return await _o.api.get({path:"/v1/onramp/options",params:{projectId:At.state.projectId}})}catch{return nft}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){try{return await _o.api.post({path:"/v1/onramp/quote",params:{projectId:At.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}})}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},setClientId(t){_o.clientId=t,_o.api=new PL({baseUrl:FSe,clientId:t})}},qu=wa({message:"",variant:"success",open:!1}),vr={state:qu,subscribeKey(t,e){return gl(qu,t,e)},showLoading(t){qu.message=t,qu.variant="loading",qu.open=!0},showSuccess(t){qu.message=t,qu.variant="success",qu.open=!0},showError(t){const e=gt.parseError(t);qu.message=e,qu.variant="error",qu.open=!0},hide(){qu.open=!1}};var jSe={},RL={};RL.byteLength=oft;RL.toByteArray=lft;RL.fromByteArray=fft;var wp=[],gf=[],ift=typeof Uint8Array<"u"?Uint8Array:Array,TU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var jx=0,aft=TU.length;jx0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function oft(t){var e=USe(t),r=e[0],n=e[1];return(r+n)*3/4-n}function sft(t,e,r){return(e+r)*3/4-r}function lft(t){var e,r=USe(t),n=r[0],i=r[1],a=new ift(sft(t,n,i)),o=0,s=i>0?n-4:n,l;for(l=0;l>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=gf[t.charCodeAt(l)]<<2|gf[t.charCodeAt(l+1)]>>4,a[o++]=e&255),i===1&&(e=gf[t.charCodeAt(l)]<<10|gf[t.charCodeAt(l+1)]<<4|gf[t.charCodeAt(l+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function cft(t){return wp[t>>18&63]+wp[t>>12&63]+wp[t>>6&63]+wp[t&63]}function uft(t,e,r){for(var n,i=[],a=e;as?s:o+a));return n===1?(e=t[r-1],i.push(wp[e>>2]+wp[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(wp[e>>10]+wp[e>>4&63]+wp[e<<2&63]+"=")),i.join("")}var QX={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */QX.read=function(t,e,r,n,i){var a,o,s=i*8-n-1,l=(1<>1,u=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,a=h&(1<<-u)-1,h>>=-u,u+=s;u>0;a=a*256+t[e+f],f+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=o*256+t[e+f],f+=d,u-=8);if(a===0)a=1-c;else{if(a===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(h?-1:1)*o*Math.pow(2,a-n)};QX.write=function(t,e,r,n,i,a){var o,s,l,c=a*8-i-1,u=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o=o+f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+h]=s&255,h+=p,s/=256,i-=8);for(o=o<0;t[r+h]=o&255,h+=p,o/=256,c-=8);t[r+h-p]|=g*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(t){const e=RL,r=QX,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const q=new Uint8Array(1),z={foo:function(){return 42}};return Object.setPrototypeOf(z,Uint8Array.prototype),Object.setPrototypeOf(q,z),q.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(q){if(q>i)throw new RangeError('The value "'+q+'" is invalid for option "size"');const z=new Uint8Array(q);return Object.setPrototypeOf(z,s.prototype),z}function s(q,z,G){if(typeof q=="number"){if(typeof z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(q)}return l(q,z,G)}s.poolSize=8192;function l(q,z,G){if(typeof q=="string")return d(q,z);if(ArrayBuffer.isView(q))return p(q);if(q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q);if(Le(q,ArrayBuffer)||q&&Le(q.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Le(q,SharedArrayBuffer)||q&&Le(q.buffer,SharedArrayBuffer)))return g(q,z,G);if(typeof q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const re=q.valueOf&&q.valueOf();if(re!=null&&re!==q)return s.from(re,z,G);const ue=v(q);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof q[Symbol.toPrimitive]=="function")return s.from(q[Symbol.toPrimitive]("string"),z,G);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof q)}s.from=function(q,z,G){return l(q,z,G)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(q){if(typeof q!="number")throw new TypeError('"size" argument must be of type number');if(q<0)throw new RangeError('The value "'+q+'" is invalid for option "size"')}function u(q,z,G){return c(q),q<=0?o(q):z!==void 0?typeof G=="string"?o(q).fill(z,G):o(q).fill(z):o(q)}s.alloc=function(q,z,G){return u(q,z,G)};function f(q){return c(q),o(q<0?0:y(q)|0)}s.allocUnsafe=function(q){return f(q)},s.allocUnsafeSlow=function(q){return f(q)};function d(q,z){if((typeof z!="string"||z==="")&&(z="utf8"),!s.isEncoding(z))throw new TypeError("Unknown encoding: "+z);const G=b(q,z)|0;let re=o(G);const ue=re.write(q,z);return ue!==G&&(re=re.slice(0,ue)),re}function h(q){const z=q.length<0?0:y(q.length)|0,G=o(z);for(let re=0;re=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return q|0}function m(q){return+q!=q&&(q=0),s.alloc(+q)}s.isBuffer=function(z){return z!=null&&z._isBuffer===!0&&z!==s.prototype},s.compare=function(z,G){if(Le(z,Uint8Array)&&(z=s.from(z,z.offset,z.byteLength)),Le(G,Uint8Array)&&(G=s.from(G,G.offset,G.byteLength)),!s.isBuffer(z)||!s.isBuffer(G))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(z===G)return 0;let re=z.length,ue=G.length;for(let _e=0,Ee=Math.min(re,ue);_eue.length?(s.isBuffer(Ee)||(Ee=s.from(Ee)),Ee.copy(ue,_e)):Uint8Array.prototype.set.call(ue,Ee,_e);else if(s.isBuffer(Ee))Ee.copy(ue,_e);else throw new TypeError('"list" argument must be an Array of Buffers');_e+=Ee.length}return ue};function b(q,z){if(s.isBuffer(q))return q.length;if(ArrayBuffer.isView(q)||Le(q,ArrayBuffer))return q.byteLength;if(typeof q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof q);const G=q.length,re=arguments.length>2&&arguments[2]===!0;if(!re&&G===0)return 0;let ue=!1;for(;;)switch(z){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":return it(q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G*2;case"hex":return G>>>1;case"base64":return Ce(q).length;default:if(ue)return re?-1:it(q).length;z=(""+z).toLowerCase(),ue=!0}}s.byteLength=b;function w(q,z,G){let re=!1;if((z===void 0||z<0)&&(z=0),z>this.length||((G===void 0||G>this.length)&&(G=this.length),G<=0)||(G>>>=0,z>>>=0,G<=z))return"";for(q||(q="utf8");;)switch(q){case"hex":return j(this,z,G);case"utf8":case"utf-8":return T(this,z,G);case"ascii":return F(this,z,G);case"latin1":case"binary":return B(this,z,G);case"base64":return x(this,z,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,z,G);default:if(re)throw new TypeError("Unknown encoding: "+q);q=(q+"").toLowerCase(),re=!0}}s.prototype._isBuffer=!0;function C(q,z,G){const re=q[z];q[z]=q[G],q[G]=re}s.prototype.swap16=function(){const z=this.length;if(z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let G=0;GG&&(z+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(z,G,re,ue,_e){if(Le(z,Uint8Array)&&(z=s.from(z,z.offset,z.byteLength)),!s.isBuffer(z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof z);if(G===void 0&&(G=0),re===void 0&&(re=z?z.length:0),ue===void 0&&(ue=0),_e===void 0&&(_e=this.length),G<0||re>z.length||ue<0||_e>this.length)throw new RangeError("out of range index");if(ue>=_e&&G>=re)return 0;if(ue>=_e)return-1;if(G>=re)return 1;if(G>>>=0,re>>>=0,ue>>>=0,_e>>>=0,this===z)return 0;let Ee=_e-ue,et=re-G;const pt=Math.min(Ee,et),Ct=this.slice(ue,_e),ot=z.slice(G,re);for(let Pt=0;Pt2147483647?G=2147483647:G<-2147483648&&(G=-2147483648),G=+G,Ke(G)&&(G=ue?0:q.length-1),G<0&&(G=q.length+G),G>=q.length){if(ue)return-1;G=q.length-1}else if(G<0)if(ue)G=0;else return-1;if(typeof z=="string"&&(z=s.from(z,re)),s.isBuffer(z))return z.length===0?-1:S(q,z,G,re,ue);if(typeof z=="number")return z=z&255,typeof Uint8Array.prototype.indexOf=="function"?ue?Uint8Array.prototype.indexOf.call(q,z,G):Uint8Array.prototype.lastIndexOf.call(q,z,G):S(q,[z],G,re,ue);throw new TypeError("val must be string, number or Buffer")}function S(q,z,G,re,ue){let _e=1,Ee=q.length,et=z.length;if(re!==void 0&&(re=String(re).toLowerCase(),re==="ucs2"||re==="ucs-2"||re==="utf16le"||re==="utf-16le")){if(q.length<2||z.length<2)return-1;_e=2,Ee/=2,et/=2,G/=2}function pt(ot,Pt){return _e===1?ot[Pt]:ot.readUInt16BE(Pt*_e)}let Ct;if(ue){let ot=-1;for(Ct=G;CtEe&&(G=Ee-et),Ct=G;Ct>=0;Ct--){let ot=!0;for(let Pt=0;Ptue&&(re=ue)):re=ue;const _e=z.length;re>_e/2&&(re=_e/2);let Ee;for(Ee=0;Ee>>0,isFinite(re)?(re=re>>>0,ue===void 0&&(ue="utf8")):(ue=re,re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const _e=this.length-G;if((re===void 0||re>_e)&&(re=_e),z.length>0&&(re<0||G<0)||G>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let Ee=!1;for(;;)switch(ue){case"hex":return I(this,z,G,re);case"utf8":case"utf-8":return D(this,z,G,re);case"ascii":case"latin1":case"binary":return L(this,z,G,re);case"base64":return O(this,z,G,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,z,G,re);default:if(Ee)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),Ee=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(q,z,G){return z===0&&G===q.length?e.fromByteArray(q):e.fromByteArray(q.slice(z,G))}function T(q,z,G){G=Math.min(q.length,G);const re=[];let ue=z;for(;ue239?4:_e>223?3:_e>191?2:1;if(ue+et<=G){let pt,Ct,ot,Pt;switch(et){case 1:_e<128&&(Ee=_e);break;case 2:pt=q[ue+1],(pt&192)===128&&(Pt=(_e&31)<<6|pt&63,Pt>127&&(Ee=Pt));break;case 3:pt=q[ue+1],Ct=q[ue+2],(pt&192)===128&&(Ct&192)===128&&(Pt=(_e&15)<<12|(pt&63)<<6|Ct&63,Pt>2047&&(Pt<55296||Pt>57343)&&(Ee=Pt));break;case 4:pt=q[ue+1],Ct=q[ue+2],ot=q[ue+3],(pt&192)===128&&(Ct&192)===128&&(ot&192)===128&&(Pt=(_e&15)<<18|(pt&63)<<12|(Ct&63)<<6|ot&63,Pt>65535&&Pt<1114112&&(Ee=Pt))}}Ee===null?(Ee=65533,et=1):Ee>65535&&(Ee-=65536,re.push(Ee>>>10&1023|55296),Ee=56320|Ee&1023),re.push(Ee),ue+=et}return N(re)}const E=4096;function N(q){const z=q.length;if(z<=E)return String.fromCharCode.apply(String,q);let G="",re=0;for(;rere)&&(G=re);let ue="";for(let _e=z;_ere&&(z=re),G<0?(G+=re,G<0&&(G=0)):G>re&&(G=re),GG)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(z,G,re){z=z>>>0,G=G>>>0,re||$(z,G,this.length);let ue=this[z],_e=1,Ee=0;for(;++Ee>>0,G=G>>>0,re||$(z,G,this.length);let ue=this[z+--G],_e=1;for(;G>0&&(_e*=256);)ue+=this[z+--G]*_e;return ue},s.prototype.readUint8=s.prototype.readUInt8=function(z,G){return z=z>>>0,G||$(z,1,this.length),this[z]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(z,G){return z=z>>>0,G||$(z,2,this.length),this[z]|this[z+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(z,G){return z=z>>>0,G||$(z,2,this.length),this[z]<<8|this[z+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(z,G){return z=z>>>0,G||$(z,4,this.length),(this[z]|this[z+1]<<8|this[z+2]<<16)+this[z+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(z,G){return z=z>>>0,G||$(z,4,this.length),this[z]*16777216+(this[z+1]<<16|this[z+2]<<8|this[z+3])},s.prototype.readBigUInt64LE=we(function(z){z=z>>>0,Te(z,"offset");const G=this[z],re=this[z+7];(G===void 0||re===void 0)&&Me(z,this.length-8);const ue=G+this[++z]*2**8+this[++z]*2**16+this[++z]*2**24,_e=this[++z]+this[++z]*2**8+this[++z]*2**16+re*2**24;return BigInt(ue)+(BigInt(_e)<>>0,Te(z,"offset");const G=this[z],re=this[z+7];(G===void 0||re===void 0)&&Me(z,this.length-8);const ue=G*2**24+this[++z]*2**16+this[++z]*2**8+this[++z],_e=this[++z]*2**24+this[++z]*2**16+this[++z]*2**8+re;return(BigInt(ue)<>>0,G=G>>>0,re||$(z,G,this.length);let ue=this[z],_e=1,Ee=0;for(;++Ee=_e&&(ue-=Math.pow(2,8*G)),ue},s.prototype.readIntBE=function(z,G,re){z=z>>>0,G=G>>>0,re||$(z,G,this.length);let ue=G,_e=1,Ee=this[z+--ue];for(;ue>0&&(_e*=256);)Ee+=this[z+--ue]*_e;return _e*=128,Ee>=_e&&(Ee-=Math.pow(2,8*G)),Ee},s.prototype.readInt8=function(z,G){return z=z>>>0,G||$(z,1,this.length),this[z]&128?(255-this[z]+1)*-1:this[z]},s.prototype.readInt16LE=function(z,G){z=z>>>0,G||$(z,2,this.length);const re=this[z]|this[z+1]<<8;return re&32768?re|4294901760:re},s.prototype.readInt16BE=function(z,G){z=z>>>0,G||$(z,2,this.length);const re=this[z+1]|this[z]<<8;return re&32768?re|4294901760:re},s.prototype.readInt32LE=function(z,G){return z=z>>>0,G||$(z,4,this.length),this[z]|this[z+1]<<8|this[z+2]<<16|this[z+3]<<24},s.prototype.readInt32BE=function(z,G){return z=z>>>0,G||$(z,4,this.length),this[z]<<24|this[z+1]<<16|this[z+2]<<8|this[z+3]},s.prototype.readBigInt64LE=we(function(z){z=z>>>0,Te(z,"offset");const G=this[z],re=this[z+7];(G===void 0||re===void 0)&&Me(z,this.length-8);const ue=this[z+4]+this[z+5]*2**8+this[z+6]*2**16+(re<<24);return(BigInt(ue)<>>0,Te(z,"offset");const G=this[z],re=this[z+7];(G===void 0||re===void 0)&&Me(z,this.length-8);const ue=(G<<24)+this[++z]*2**16+this[++z]*2**8+this[++z];return(BigInt(ue)<>>0,G||$(z,4,this.length),r.read(this,z,!0,23,4)},s.prototype.readFloatBE=function(z,G){return z=z>>>0,G||$(z,4,this.length),r.read(this,z,!1,23,4)},s.prototype.readDoubleLE=function(z,G){return z=z>>>0,G||$(z,8,this.length),r.read(this,z,!0,52,8)},s.prototype.readDoubleBE=function(z,G){return z=z>>>0,G||$(z,8,this.length),r.read(this,z,!1,52,8)};function H(q,z,G,re,ue,_e){if(!s.isBuffer(q))throw new TypeError('"buffer" argument must be a Buffer instance');if(z>ue||z<_e)throw new RangeError('"value" argument is out of bounds');if(G+re>q.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(z,G,re,ue){if(z=+z,G=G>>>0,re=re>>>0,!ue){const et=Math.pow(2,8*re)-1;H(this,z,G,re,et,0)}let _e=1,Ee=0;for(this[G]=z&255;++Ee>>0,re=re>>>0,!ue){const et=Math.pow(2,8*re)-1;H(this,z,G,re,et,0)}let _e=re-1,Ee=1;for(this[G+_e]=z&255;--_e>=0&&(Ee*=256);)this[G+_e]=z/Ee&255;return G+re},s.prototype.writeUint8=s.prototype.writeUInt8=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,1,255,0),this[G]=z&255,G+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,2,65535,0),this[G]=z&255,this[G+1]=z>>>8,G+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,2,65535,0),this[G]=z>>>8,this[G+1]=z&255,G+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,4,4294967295,0),this[G+3]=z>>>24,this[G+2]=z>>>16,this[G+1]=z>>>8,this[G]=z&255,G+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,4,4294967295,0),this[G]=z>>>24,this[G+1]=z>>>16,this[G+2]=z>>>8,this[G+3]=z&255,G+4};function Y(q,z,G,re,ue){ye(z,re,ue,q,G,7);let _e=Number(z&BigInt(4294967295));q[G++]=_e,_e=_e>>8,q[G++]=_e,_e=_e>>8,q[G++]=_e,_e=_e>>8,q[G++]=_e;let Ee=Number(z>>BigInt(32)&BigInt(4294967295));return q[G++]=Ee,Ee=Ee>>8,q[G++]=Ee,Ee=Ee>>8,q[G++]=Ee,Ee=Ee>>8,q[G++]=Ee,G}function ie(q,z,G,re,ue){ye(z,re,ue,q,G,7);let _e=Number(z&BigInt(4294967295));q[G+7]=_e,_e=_e>>8,q[G+6]=_e,_e=_e>>8,q[G+5]=_e,_e=_e>>8,q[G+4]=_e;let Ee=Number(z>>BigInt(32)&BigInt(4294967295));return q[G+3]=Ee,Ee=Ee>>8,q[G+2]=Ee,Ee=Ee>>8,q[G+1]=Ee,Ee=Ee>>8,q[G]=Ee,G+8}s.prototype.writeBigUInt64LE=we(function(z,G=0){return Y(this,z,G,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=we(function(z,G=0){return ie(this,z,G,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(z,G,re,ue){if(z=+z,G=G>>>0,!ue){const pt=Math.pow(2,8*re-1);H(this,z,G,re,pt-1,-pt)}let _e=0,Ee=1,et=0;for(this[G]=z&255;++_e>0)-et&255;return G+re},s.prototype.writeIntBE=function(z,G,re,ue){if(z=+z,G=G>>>0,!ue){const pt=Math.pow(2,8*re-1);H(this,z,G,re,pt-1,-pt)}let _e=re-1,Ee=1,et=0;for(this[G+_e]=z&255;--_e>=0&&(Ee*=256);)z<0&&et===0&&this[G+_e+1]!==0&&(et=1),this[G+_e]=(z/Ee>>0)-et&255;return G+re},s.prototype.writeInt8=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,1,127,-128),z<0&&(z=255+z+1),this[G]=z&255,G+1},s.prototype.writeInt16LE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,2,32767,-32768),this[G]=z&255,this[G+1]=z>>>8,G+2},s.prototype.writeInt16BE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,2,32767,-32768),this[G]=z>>>8,this[G+1]=z&255,G+2},s.prototype.writeInt32LE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,4,2147483647,-2147483648),this[G]=z&255,this[G+1]=z>>>8,this[G+2]=z>>>16,this[G+3]=z>>>24,G+4},s.prototype.writeInt32BE=function(z,G,re){return z=+z,G=G>>>0,re||H(this,z,G,4,2147483647,-2147483648),z<0&&(z=4294967295+z+1),this[G]=z>>>24,this[G+1]=z>>>16,this[G+2]=z>>>8,this[G+3]=z&255,G+4},s.prototype.writeBigInt64LE=we(function(z,G=0){return Y(this,z,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=we(function(z,G=0){return ie(this,z,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(q,z,G,re,ue,_e){if(G+re>q.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("Index out of range")}function Q(q,z,G,re,ue){return z=+z,G=G>>>0,ue||W(q,z,G,4),r.write(q,z,G,re,23,4),G+4}s.prototype.writeFloatLE=function(z,G,re){return Q(this,z,G,!0,re)},s.prototype.writeFloatBE=function(z,G,re){return Q(this,z,G,!1,re)};function J(q,z,G,re,ue){return z=+z,G=G>>>0,ue||W(q,z,G,8),r.write(q,z,G,re,52,8),G+8}s.prototype.writeDoubleLE=function(z,G,re){return J(this,z,G,!0,re)},s.prototype.writeDoubleBE=function(z,G,re){return J(this,z,G,!1,re)},s.prototype.copy=function(z,G,re,ue){if(!s.isBuffer(z))throw new TypeError("argument should be a Buffer");if(re||(re=0),!ue&&ue!==0&&(ue=this.length),G>=z.length&&(G=z.length),G||(G=0),ue>0&&ue=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),z.length-G>>0,re=re===void 0?this.length:re>>>0,z||(z=0);let _e;if(typeof z=="number")for(_e=G;_e2**32?ue=V(String(G)):typeof G=="bigint"&&(ue=String(G),(G>BigInt(2)**BigInt(32)||G<-(BigInt(2)**BigInt(32)))&&(ue=V(ue)),ue+="n"),re+=` It must be ${z}. Received ${ue}`,re},RangeError);function V(q){let z="",G=q.length;const re=q[0]==="-"?1:0;for(;G>=re+4;G-=3)z=`_${q.slice(G-3,G)}${z}`;return`${q.slice(0,G)}${z}`}function oe(q,z,G){Te(z,"offset"),(q[z]===void 0||q[z+G]===void 0)&&Me(z,q.length-(G+1))}function ye(q,z,G,re,ue,_e){if(q>G||q= 0${Ee} and < 2${Ee} ** ${(_e+1)*8}${Ee}`:et=`>= -(2${Ee} ** ${(_e+1)*8-1}${Ee}) and < 2 ** ${(_e+1)*8-1}${Ee}`,new ee.ERR_OUT_OF_RANGE("value",et,q)}oe(re,ue,_e)}function Te(q,z){if(typeof q!="number")throw new ee.ERR_INVALID_ARG_TYPE(z,"number",q)}function Me(q,z,G){throw Math.floor(q)!==q?(Te(q,G),new ee.ERR_OUT_OF_RANGE("offset","an integer",q)):z<0?new ee.ERR_BUFFER_OUT_OF_BOUNDS:new ee.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${z}`,q)}const Oe=/[^+/0-9A-Za-z-_]/g;function nt(q){if(q=q.split("=")[0],q=q.trim().replace(Oe,""),q.length<2)return"";for(;q.length%4!==0;)q=q+"=";return q}function it(q,z){z=z||1/0;let G;const re=q.length;let ue=null;const _e=[];for(let Ee=0;Ee55295&&G<57344){if(!ue){if(G>56319){(z-=3)>-1&&_e.push(239,191,189);continue}else if(Ee+1===re){(z-=3)>-1&&_e.push(239,191,189);continue}ue=G;continue}if(G<56320){(z-=3)>-1&&_e.push(239,191,189),ue=G;continue}G=(ue-55296<<10|G-56320)+65536}else ue&&(z-=3)>-1&&_e.push(239,191,189);if(ue=null,G<128){if((z-=1)<0)break;_e.push(G)}else if(G<2048){if((z-=2)<0)break;_e.push(G>>6|192,G&63|128)}else if(G<65536){if((z-=3)<0)break;_e.push(G>>12|224,G>>6&63|128,G&63|128)}else if(G<1114112){if((z-=4)<0)break;_e.push(G>>18|240,G>>12&63|128,G>>6&63|128,G&63|128)}else throw new Error("Invalid code point")}return _e}function St(q){const z=[];for(let G=0;G>8,ue=G%256,_e.push(ue),_e.push(re);return _e}function Ce(q){return e.toByteArray(nt(q))}function We(q,z,G,re){let ue;for(ue=0;ue=z.length||ue>=q.length);++ue)z[ue+G]=q[ue];return ue}function Le(q,z){return q instanceof z||q!=null&&q.constructor!=null&&q.constructor.name!=null&&q.constructor.name===z.name}function Ke(q){return q!==q}const qe=function(){const q="0123456789abcdef",z=new Array(256);for(let G=0;G<16;++G){const re=G*16;for(let ue=0;ue<16;++ue)z[re+ue]=q[G]+q[ue]}return z}();function we(q){return typeof BigInt>"u"?Se:q}function Se(){throw new Error("BigInt not supported")}})(jSe);var z2e;typeof window<"u"&&(window.Buffer||(window.Buffer=jSe.Buffer),window.global||(window.global=window),window.process||(window.process={}),(z2e=window.process)!=null&&z2e.env||(window.process={env:{}}));var zSe={};const dft=zSe.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.org/sdk",hft=zSe.NEXT_PUBLIC_DEFAULT_LOG_LEVEL||"error",wr={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},xn={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(const o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(fi||(fi={}));var mq;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(mq||(mq={}));const er=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Am=t=>{switch(typeof t){case"undefined":return er.undefined;case"string":return er.string;case"number":return isNaN(t)?er.nan:er.number;case"boolean":return er.boolean;case"function":return er.function;case"bigint":return er.bigint;case"symbol":return er.symbol;case"object":return Array.isArray(t)?er.array:t===null?er.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?er.promise:typeof Map<"u"&&t instanceof Map?er.map:typeof Set<"u"&&t instanceof Set?er.set:typeof Date<"u"&&t instanceof Date?er.date:er.object;default:return er.unknown}},Rt=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pft=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class nh extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}nh.create=t=>new nh(t);const K6=(t,e)=>{let r;switch(t.code){case Rt.invalid_type:t.received===er.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Rt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Rt.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Rt.invalid_union:r="Invalid input";break;case Rt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Rt.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Rt.invalid_arguments:r="Invalid function arguments";break;case Rt.invalid_return_type:r="Invalid function return type";break;case Rt.invalid_date:r="Invalid date";break;case Rt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Rt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Rt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Rt.custom:r="Invalid input";break;case Rt.invalid_intersection_types:r="Intersection results could not be merged";break;case Rt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Rt.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}};let HSe=K6;function gft(t){HSe=t}function TD(){return HSe}const ED=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};let s="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)s=c(o,{data:e,defaultError:s}).message;return{...i,path:a,message:i.message||s}},vft=[];function or(t,e){const r=ED({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,TD(),K6].filter(n=>!!n)});t.common.issues.push(r)}class fl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return vn;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return fl.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return vn;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}}const vn=Object.freeze({status:"aborted"}),VSe=t=>({status:"dirty",value:t}),Vl=t=>({status:"valid",value:t}),yq=t=>t.status==="aborted",wq=t=>t.status==="dirty",Z6=t=>t.status==="valid",ID=t=>typeof Promise<"u"&&t instanceof Promise;var Or;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Or||(Or={}));class Yp{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hce=(t,e)=>{if(Z6(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new nh(t.common.issues);return this._error=r,this._error}}};function Tn(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>o.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:n??s.defaultError}:{message:r??s.defaultError},description:i}}class $n{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Am(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Am(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new fl,ctx:{common:e.parent.common,data:e.data,parsedType:Am(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ID(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Am(e)},a=this._parseSync({data:e,path:i.path,parent:i});return hce(i,a)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Am(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(ID(i)?i:Promise.resolve(i));return hce(n,a)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=e(i),s=()=>a.addIssue({code:Rt.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new dh({schema:this,typeName:Zr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Pg.create(this,this._def)}nullable(){return Nb.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ih.create(this,this._def)}promise(){return X3.create(this,this._def)}or(e){return eT.create([this,e],this._def)}and(e){return tT.create(this,e,this._def)}transform(e){return new dh({...Tn(this._def),schema:this,typeName:Zr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new oT({...Tn(this._def),innerType:this,defaultValue:r,typeName:Zr.ZodDefault})}brand(){return new WSe({typeName:Zr.ZodBranded,type:this,...Tn(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new MD({...Tn(this._def),innerType:this,catchValue:r,typeName:Zr.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return i8.create(this,e)}readonly(){return ND.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mft=/^c[^\s-]{8,}$/i,yft=/^[a-z][a-z0-9]*$/,wft=/^[0-9A-HJKMNP-TV-Z]{26}$/,bft=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xft=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_ft="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let EU;const Sft=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Cft=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Aft=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Tft(t,e){return!!((e==="v4"||!e)&&Sft.test(t)||(e==="v6"||!e)&&Cft.test(t))}class Yd extends $n{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==er.string){const a=this._getOrReturnCtx(e);return or(a,{code:Rt.invalid_type,expected:er.string,received:a.parsedType}),vn}const n=new fl;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(i=this._getOrReturnCtx(e,i),or(i,{code:Rt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,s=e.data.lengthe.test(i),{validation:r,code:Rt.invalid_string,...Or.errToObj(n)})}_addCheck(e){return new Yd({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Or.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Or.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Or.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Or.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Or.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Or.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Or.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Or.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...Or.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Or.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...Or.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Or.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Or.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Or.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Or.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Or.errToObj(r)})}nonempty(e){return this.min(1,Or.errToObj(e))}trim(){return new Yd({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yd({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yd({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new Yd({checks:[],typeName:Zr.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Tn(t)})};function Eft(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}class P1 extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==er.number){const a=this._getOrReturnCtx(e);return or(a,{code:Rt.invalid_type,expected:er.number,received:a.parsedType}),vn}let n;const i=new fl;for(const a of this._def.checks)a.kind==="int"?fi.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{code:Rt.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),or(n,{code:Rt.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Eft(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),or(n,{code:Rt.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),or(n,{code:Rt.not_finite,message:a.message}),i.dirty()):fi.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Or.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Or.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Or.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Or.toString(r))}setLimit(e,r,n,i){return new P1({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Or.toString(i)}]})}_addCheck(e){return new P1({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Or.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Or.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Or.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Or.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Or.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Or.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Or.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Or.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Or.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew P1({checks:[],typeName:Zr.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Tn(t)});class R1 extends $n{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==er.bigint){const a=this._getOrReturnCtx(e);return or(a,{code:Rt.invalid_type,expected:er.bigint,received:a.parsedType}),vn}let n;const i=new fl;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),or(n,{code:Rt.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),or(n,{code:Rt.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):fi.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Or.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Or.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Or.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Or.toString(r))}setLimit(e,r,n,i){return new R1({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Or.toString(i)}]})}_addCheck(e){return new R1({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Or.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Or.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Or.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Or.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Or.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value{var e;return new R1({checks:[],typeName:Zr.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Tn(t)})};class Q6 extends $n{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==er.boolean){const n=this._getOrReturnCtx(e);return or(n,{code:Rt.invalid_type,expected:er.boolean,received:n.parsedType}),vn}return Vl(e.data)}}Q6.create=t=>new Q6({typeName:Zr.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Tn(t)});class Mb extends $n{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==er.date){const a=this._getOrReturnCtx(e);return or(a,{code:Rt.invalid_type,expected:er.date,received:a.parsedType}),vn}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return or(a,{code:Rt.invalid_date}),vn}const n=new fl;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(i=this._getOrReturnCtx(e,i),or(i,{code:Rt.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):fi.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Mb({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Or.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Or.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Mb({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Zr.ZodDate,...Tn(t)});class kD extends $n{_parse(e){if(this._getType(e)!==er.symbol){const n=this._getOrReturnCtx(e);return or(n,{code:Rt.invalid_type,expected:er.symbol,received:n.parsedType}),vn}return Vl(e.data)}}kD.create=t=>new kD({typeName:Zr.ZodSymbol,...Tn(t)});class X6 extends $n{_parse(e){if(this._getType(e)!==er.undefined){const n=this._getOrReturnCtx(e);return or(n,{code:Rt.invalid_type,expected:er.undefined,received:n.parsedType}),vn}return Vl(e.data)}}X6.create=t=>new X6({typeName:Zr.ZodUndefined,...Tn(t)});class J6 extends $n{_parse(e){if(this._getType(e)!==er.null){const n=this._getOrReturnCtx(e);return or(n,{code:Rt.invalid_type,expected:er.null,received:n.parsedType}),vn}return Vl(e.data)}}J6.create=t=>new J6({typeName:Zr.ZodNull,...Tn(t)});class Q3 extends $n{constructor(){super(...arguments),this._any=!0}_parse(e){return Vl(e.data)}}Q3.create=t=>new Q3({typeName:Zr.ZodAny,...Tn(t)});class lb extends $n{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vl(e.data)}}lb.create=t=>new lb({typeName:Zr.ZodUnknown,...Tn(t)});class qg extends $n{_parse(e){const r=this._getOrReturnCtx(e);return or(r,{code:Rt.invalid_type,expected:er.never,received:r.parsedType}),vn}}qg.create=t=>new qg({typeName:Zr.ZodNever,...Tn(t)});class PD extends $n{_parse(e){if(this._getType(e)!==er.undefined){const n=this._getOrReturnCtx(e);return or(n,{code:Rt.invalid_type,expected:er.void,received:n.parsedType}),vn}return Vl(e.data)}}PD.create=t=>new PD({typeName:Zr.ZodVoid,...Tn(t)});class ih extends $n{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==er.array)return or(r,{code:Rt.invalid_type,expected:er.array,received:r.parsedType}),vn;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(or(r,{code:Rt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Yp(r,o,r.path,s)))).then(o=>fl.mergeArray(n,o));const a=[...r.data].map((o,s)=>i.type._parseSync(new Yp(r,o,r.path,s)));return fl.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new ih({...this._def,minLength:{value:e,message:Or.toString(r)}})}max(e,r){return new ih({...this._def,maxLength:{value:e,message:Or.toString(r)}})}length(e,r){return new ih({...this._def,exactLength:{value:e,message:Or.toString(r)}})}nonempty(e){return this.min(1,e)}}ih.create=(t,e)=>new ih({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Zr.ZodArray,...Tn(e)});function x_(t){if(t instanceof $a){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Pg.create(x_(n))}return new $a({...t._def,shape:()=>e})}else return t instanceof ih?new ih({...t._def,type:x_(t.element)}):t instanceof Pg?Pg.create(x_(t.unwrap())):t instanceof Nb?Nb.create(x_(t.unwrap())):t instanceof Kp?Kp.create(t.items.map(e=>x_(e))):t}class $a extends $n{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==er.object){const c=this._getOrReturnCtx(e);return or(c,{code:Rt.invalid_type,expected:er.object,received:c.parsedType}),vn}const{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof qg&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||s.push(c);const l=[];for(const c of o){const u=a[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Yp(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof qg){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")s.length>0&&(or(i,{code:Rt.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Yp(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key;c.push({key:f,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>fl.mergeObjectSync(n,c)):fl.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return Or.errToObj,new $a({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,o,s;const l=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(s=Or.errToObj(e).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new $a({...this._def,unknownKeys:"strip"})}passthrough(){return new $a({...this._def,unknownKeys:"passthrough"})}extend(e){return new $a({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $a({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Zr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new $a({...this._def,catchall:e})}pick(e){const r={};return fi.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new $a({...this._def,shape:()=>r})}omit(e){const r={};return fi.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new $a({...this._def,shape:()=>r})}deepPartial(){return x_(this)}partial(e){const r={};return fi.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new $a({...this._def,shape:()=>r})}required(e){const r={};return fi.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Pg;)a=a._def.innerType;r[n]=a}}),new $a({...this._def,shape:()=>r})}keyof(){return GSe(fi.objectKeys(this.shape))}}$a.create=(t,e)=>new $a({shape:()=>t,unknownKeys:"strip",catchall:qg.create(),typeName:Zr.ZodObject,...Tn(e)});$a.strictCreate=(t,e)=>new $a({shape:()=>t,unknownKeys:"strict",catchall:qg.create(),typeName:Zr.ZodObject,...Tn(e)});$a.lazycreate=(t,e)=>new $a({shape:t,unknownKeys:"strip",catchall:qg.create(),typeName:Zr.ZodObject,...Tn(e)});class eT extends $n{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new nh(s.ctx.common.issues));return or(r,{code:Rt.invalid_union,unionErrors:o}),vn}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new nh(l));return or(r,{code:Rt.invalid_union,unionErrors:s}),vn}}get options(){return this._def.options}}eT.create=(t,e)=>new eT({options:t,typeName:Zr.ZodUnion,...Tn(e)});const FR=t=>t instanceof nT?FR(t.schema):t instanceof dh?FR(t.innerType()):t instanceof iT?[t.value]:t instanceof M1?t.options:t instanceof aT?Object.keys(t.enum):t instanceof oT?FR(t._def.innerType):t instanceof X6?[void 0]:t instanceof J6?[null]:null;class ML extends $n{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==er.object)return or(r,{code:Rt.invalid_type,expected:er.object,received:r.parsedType}),vn;const n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(or(r,{code:Rt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),vn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const a of r){const o=FR(a.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new ML({typeName:Zr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Tn(n)})}}function bq(t,e){const r=Am(t),n=Am(e);if(t===e)return{valid:!0,data:t};if(r===er.object&&n===er.object){const i=fi.objectKeys(e),a=fi.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(const s of a){const l=bq(t[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(r===er.array&&n===er.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a{if(yq(a)||yq(o))return vn;const s=bq(a.value,o.value);return s.valid?((wq(a)||wq(o))&&r.dirty(),{status:r.value,value:s.data}):(or(n,{code:Rt.invalid_intersection_types}),vn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}tT.create=(t,e,r)=>new tT({left:t,right:e,typeName:Zr.ZodIntersection,...Tn(r)});class Kp extends $n{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==er.array)return or(n,{code:Rt.invalid_type,expected:er.array,received:n.parsedType}),vn;if(n.data.lengththis._def.items.length&&(or(n,{code:Rt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Yp(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>fl.mergeArray(r,o)):fl.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Kp({...this._def,rest:e})}}Kp.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kp({items:t,typeName:Zr.ZodTuple,rest:null,...Tn(e)})};class rT extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==er.object)return or(n,{code:Rt.invalid_type,expected:er.object,received:n.parsedType}),vn;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in n.data)i.push({key:a._parse(new Yp(n,s,n.path,s)),value:o._parse(new Yp(n,n.data[s],n.path,s))});return n.common.async?fl.mergeObjectAsync(r,i):fl.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof $n?new rT({keyType:e,valueType:r,typeName:Zr.ZodRecord,...Tn(n)}):new rT({keyType:Yd.create(),valueType:e,typeName:Zr.ZodRecord,...Tn(r)})}}class RD extends $n{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==er.map)return or(n,{code:Rt.invalid_type,expected:er.map,received:n.parsedType}),vn;const i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,l],c)=>({key:i._parse(new Yp(n,s,n.path,[c,"key"])),value:a._parse(new Yp(n,l,n.path,[c,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return vn;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(c.value,u.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return vn;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(c.value,u.value)}return{status:r.value,value:s}}}}RD.create=(t,e,r)=>new RD({valueType:e,keyType:t,typeName:Zr.ZodMap,...Tn(r)});class Db extends $n{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==er.set)return or(n,{code:Rt.invalid_type,expected:er.set,received:n.parsedType}),vn;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(or(n,{code:Rt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return vn;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const s=[...n.data.values()].map((l,c)=>a._parse(new Yp(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,r){return new Db({...this._def,minSize:{value:e,message:Or.toString(r)}})}max(e,r){return new Db({...this._def,maxSize:{value:e,message:Or.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Db.create=(t,e)=>new Db({valueType:t,minSize:null,maxSize:null,typeName:Zr.ZodSet,...Tn(e)});class p3 extends $n{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==er.function)return or(r,{code:Rt.invalid_type,expected:er.function,received:r.parsedType}),vn;function n(s,l){return ED({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,TD(),K6].filter(c=>!!c),issueData:{code:Rt.invalid_arguments,argumentsError:l}})}function i(s,l){return ED({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,TD(),K6].filter(c=>!!c),issueData:{code:Rt.invalid_return_type,returnTypeError:l}})}const a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof X3){const s=this;return Vl(async function(...l){const c=new nh([]),u=await s._def.args.parseAsync(l,a).catch(h=>{throw c.addIssue(n(l,h)),c}),f=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(f,a).catch(h=>{throw c.addIssue(i(f,h)),c})})}else{const s=this;return Vl(function(...l){const c=s._def.args.safeParse(l,a);if(!c.success)throw new nh([n(l,c.error)]);const u=Reflect.apply(o,this,c.data),f=s._def.returns.safeParse(u,a);if(!f.success)throw new nh([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new p3({...this._def,args:Kp.create(e).rest(lb.create())})}returns(e){return new p3({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new p3({args:e||Kp.create([]).rest(lb.create()),returns:r||lb.create(),typeName:Zr.ZodFunction,...Tn(n)})}}class nT extends $n{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}nT.create=(t,e)=>new nT({getter:t,typeName:Zr.ZodLazy,...Tn(e)});class iT extends $n{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return or(r,{received:r.data,code:Rt.invalid_literal,expected:this._def.value}),vn}return{status:"valid",value:e.data}}get value(){return this._def.value}}iT.create=(t,e)=>new iT({value:t,typeName:Zr.ZodLiteral,...Tn(e)});function GSe(t,e){return new M1({values:t,typeName:Zr.ZodEnum,...Tn(e)})}class M1 extends $n{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return or(r,{expected:fi.joinValues(n),received:r.parsedType,code:Rt.invalid_type}),vn}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return or(r,{received:r.data,code:Rt.invalid_enum_value,options:n}),vn}return Vl(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return M1.create(e)}exclude(e){return M1.create(this.options.filter(r=>!e.includes(r)))}}M1.create=GSe;class aT extends $n{_parse(e){const r=fi.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==er.string&&n.parsedType!==er.number){const i=fi.objectValues(r);return or(n,{expected:fi.joinValues(i),received:n.parsedType,code:Rt.invalid_type}),vn}if(r.indexOf(e.data)===-1){const i=fi.objectValues(r);return or(n,{received:n.data,code:Rt.invalid_enum_value,options:i}),vn}return Vl(e.data)}get enum(){return this._def.values}}aT.create=(t,e)=>new aT({values:t,typeName:Zr.ZodNativeEnum,...Tn(e)});class X3 extends $n{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==er.promise&&r.common.async===!1)return or(r,{code:Rt.invalid_type,expected:er.promise,received:r.parsedType}),vn;const n=r.parsedType===er.promise?r.data:Promise.resolve(r.data);return Vl(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}X3.create=(t,e)=>new X3({type:t,typeName:Zr.ZodPromise,...Tn(e)});class dh extends $n{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Zr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{or(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(s=>this._def.schema._parseAsync({data:s,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?vn:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?vn:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Z6(o))return o;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Z6(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):o);fi.assertNever(i)}}dh.create=(t,e,r)=>new dh({schema:t,typeName:Zr.ZodEffects,effect:e,...Tn(r)});dh.createWithPreprocess=(t,e,r)=>new dh({schema:e,effect:{type:"preprocess",transform:t},typeName:Zr.ZodEffects,...Tn(r)});class Pg extends $n{_parse(e){return this._getType(e)===er.undefined?Vl(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pg.create=(t,e)=>new Pg({innerType:t,typeName:Zr.ZodOptional,...Tn(e)});class Nb extends $n{_parse(e){return this._getType(e)===er.null?Vl(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nb.create=(t,e)=>new Nb({innerType:t,typeName:Zr.ZodNullable,...Tn(e)});class oT extends $n{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===er.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}oT.create=(t,e)=>new oT({innerType:t,typeName:Zr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tn(e)});class MD extends $n{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ID(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new nh(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new nh(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}MD.create=(t,e)=>new MD({innerType:t,typeName:Zr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Tn(e)});class DD extends $n{_parse(e){if(this._getType(e)!==er.nan){const n=this._getOrReturnCtx(e);return or(n,{code:Rt.invalid_type,expected:er.nan,received:n.parsedType}),vn}return{status:"valid",value:e.data}}}DD.create=t=>new DD({typeName:Zr.ZodNaN,...Tn(t)});const Ift=Symbol("zod_brand");class WSe extends $n{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class i8 extends $n{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?vn:a.status==="dirty"?(r.dirty(),VSe(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?vn:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new i8({in:e,out:r,typeName:Zr.ZodPipeline})}}class ND extends $n{_parse(e){const r=this._def.innerType._parse(e);return Z6(r)&&(r.value=Object.freeze(r.value)),r}}ND.create=(t,e)=>new ND({innerType:t,typeName:Zr.ZodReadonly,...Tn(e)});const qSe=(t,e={},r)=>t?Q3.create().superRefine((n,i)=>{var a,o;if(!t(n)){const s=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(o=(a=s.fatal)!==null&&a!==void 0?a:r)!==null&&o!==void 0?o:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:l})}}):Q3.create(),kft={object:$a.lazycreate};var Zr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Zr||(Zr={}));const Pft=(t,e={message:`Input not instance of ${t.name}`})=>qSe(r=>r instanceof t,e),YSe=Yd.create,KSe=P1.create,Rft=DD.create,Mft=R1.create,ZSe=Q6.create,Dft=Mb.create,Nft=kD.create,Oft=X6.create,Lft=J6.create,$ft=Q3.create,Bft=lb.create,Fft=qg.create,jft=PD.create,Uft=ih.create,zft=$a.create,Hft=$a.strictCreate,Vft=eT.create,Gft=ML.create,Wft=tT.create,qft=Kp.create,Yft=rT.create,Kft=RD.create,Zft=Db.create,Qft=p3.create,Xft=nT.create,Jft=iT.create,edt=M1.create,tdt=aT.create,rdt=X3.create,pce=dh.create,ndt=Pg.create,idt=Nb.create,adt=dh.createWithPreprocess,odt=i8.create,sdt=()=>YSe().optional(),ldt=()=>KSe().optional(),cdt=()=>ZSe().optional(),udt={string:t=>Yd.create({...t,coerce:!0}),number:t=>P1.create({...t,coerce:!0}),boolean:t=>Q6.create({...t,coerce:!0}),bigint:t=>R1.create({...t,coerce:!0}),date:t=>Mb.create({...t,coerce:!0})},fdt=vn;var pe=Object.freeze({__proto__:null,defaultErrorMap:K6,setErrorMap:gft,getErrorMap:TD,makeIssue:ED,EMPTY_PATH:vft,addIssueToContext:or,ParseStatus:fl,INVALID:vn,DIRTY:VSe,OK:Vl,isAborted:yq,isDirty:wq,isValid:Z6,isAsync:ID,get util(){return fi},get objectUtil(){return mq},ZodParsedType:er,getParsedType:Am,ZodType:$n,ZodString:Yd,ZodNumber:P1,ZodBigInt:R1,ZodBoolean:Q6,ZodDate:Mb,ZodSymbol:kD,ZodUndefined:X6,ZodNull:J6,ZodAny:Q3,ZodUnknown:lb,ZodNever:qg,ZodVoid:PD,ZodArray:ih,ZodObject:$a,ZodUnion:eT,ZodDiscriminatedUnion:ML,ZodIntersection:tT,ZodTuple:Kp,ZodRecord:rT,ZodMap:RD,ZodSet:Db,ZodFunction:p3,ZodLazy:nT,ZodLiteral:iT,ZodEnum:M1,ZodNativeEnum:aT,ZodPromise:X3,ZodEffects:dh,ZodTransformer:dh,ZodOptional:Pg,ZodNullable:Nb,ZodDefault:oT,ZodCatch:MD,ZodNaN:DD,BRAND:Ift,ZodBranded:WSe,ZodPipeline:i8,ZodReadonly:ND,custom:qSe,Schema:$n,ZodSchema:$n,late:kft,get ZodFirstPartyTypeKind(){return Zr},coerce:udt,any:$ft,array:Uft,bigint:Mft,boolean:ZSe,date:Dft,discriminatedUnion:Gft,effect:pce,enum:edt,function:Qft,instanceof:Pft,intersection:Wft,lazy:Xft,literal:Jft,map:Kft,nan:Rft,nativeEnum:tdt,never:Fft,null:Lft,nullable:idt,number:KSe,object:zft,oboolean:cdt,onumber:ldt,optional:ndt,ostring:sdt,pipeline:odt,preprocess:adt,promise:rdt,record:Yft,set:Zft,strictObject:Hft,string:YSe,symbol:Nft,transformer:pce,tuple:qft,undefined:Oft,union:Vft,unknown:Bft,void:jft,NEVER:fdt,ZodIssueCode:Rt,quotelessJson:pft,ZodError:nh});const lo=pe.object({message:pe.string()});function pr(t){return pe.literal(wr[t])}pe.object({accessList:pe.array(pe.string()),blockHash:pe.string().nullable(),blockNumber:pe.string().nullable(),chainId:pe.string().or(pe.number()),from:pe.string(),gas:pe.string(),hash:pe.string(),input:pe.string().nullable(),maxFeePerGas:pe.string(),maxPriorityFeePerGas:pe.string(),nonce:pe.string(),r:pe.string(),s:pe.string(),to:pe.string(),transactionIndex:pe.string().nullable(),type:pe.string(),v:pe.string(),value:pe.string()});const ddt=pe.object({chainId:pe.string().or(pe.number())}),hdt=pe.object({email:pe.string().email()}),pdt=pe.object({otp:pe.string()}),gdt=pe.object({uri:pe.string()}),vdt=pe.object({chainId:pe.optional(pe.string().or(pe.number())),preferredAccountType:pe.optional(pe.string())}),mdt=pe.object({provider:pe.enum(["google","github","apple","facebook","x","discord"])}),ydt=pe.object({email:pe.string().email()}),wdt=pe.object({otp:pe.string()}),bdt=pe.object({otp:pe.string()}),xdt=pe.object({themeMode:pe.optional(pe.enum(["light","dark"])),themeVariables:pe.optional(pe.record(pe.string(),pe.string().or(pe.number()))),w3mThemeVariables:pe.optional(pe.record(pe.string(),pe.string()))}),_dt=pe.object({metadata:pe.object({name:pe.string(),description:pe.string(),url:pe.string(),icons:pe.array(pe.string())}).optional(),sdkVersion:pe.string().optional(),sdkType:pe.string().optional(),projectId:pe.string()}),Sdt=pe.object({type:pe.string()}),Cdt=pe.object({action:pe.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),Adt=pe.object({url:pe.string()}),Tdt=pe.object({userName:pe.string()}),Edt=pe.object({email:pe.string(),address:pe.string(),chainId:pe.string().or(pe.number()),accounts:pe.array(pe.object({address:pe.string(),type:pe.enum([xn.ACCOUNT_TYPES.EOA,xn.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:pe.string().optional()}),Idt=pe.object({action:pe.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),kdt=pe.object({email:pe.string().email().optional().nullable(),address:pe.string(),chainId:pe.string().or(pe.number()),smartAccountDeployed:pe.optional(pe.boolean()),accounts:pe.array(pe.object({address:pe.string(),type:pe.enum([xn.ACCOUNT_TYPES.EOA,xn.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:pe.optional(pe.string())}),Pdt=pe.object({uri:pe.string()}),Rdt=pe.object({isConnected:pe.boolean()}),Mdt=pe.object({chainId:pe.string().or(pe.number())}),Ddt=pe.object({chainId:pe.string().or(pe.number())}),Ndt=pe.object({newEmail:pe.string().email()}),Odt=pe.object({smartAccountEnabledNetworks:pe.array(pe.number())});pe.object({address:pe.string(),isDeployed:pe.boolean()});const Ldt=pe.object({version:pe.string().optional()}),$dt=pe.object({type:pe.string(),address:pe.string()}),Bdt=pe.any(),Fdt=pe.object({method:pe.literal("eth_accounts")}),jdt=pe.object({method:pe.literal("eth_blockNumber")}),Udt=pe.object({method:pe.literal("eth_call"),params:pe.array(pe.any())}),zdt=pe.object({method:pe.literal("eth_chainId")}),Hdt=pe.object({method:pe.literal("eth_estimateGas"),params:pe.array(pe.any())}),Vdt=pe.object({method:pe.literal("eth_feeHistory"),params:pe.array(pe.any())}),Gdt=pe.object({method:pe.literal("eth_gasPrice")}),Wdt=pe.object({method:pe.literal("eth_getAccount"),params:pe.array(pe.any())}),qdt=pe.object({method:pe.literal("eth_getBalance"),params:pe.array(pe.any())}),Ydt=pe.object({method:pe.literal("eth_getBlockByHash"),params:pe.array(pe.any())}),Kdt=pe.object({method:pe.literal("eth_getBlockByNumber"),params:pe.array(pe.any())}),Zdt=pe.object({method:pe.literal("eth_getBlockReceipts"),params:pe.array(pe.any())}),Qdt=pe.object({method:pe.literal("eth_getBlockTransactionCountByHash"),params:pe.array(pe.any())}),Xdt=pe.object({method:pe.literal("eth_getBlockTransactionCountByNumber"),params:pe.array(pe.any())}),Jdt=pe.object({method:pe.literal("eth_getCode"),params:pe.array(pe.any())}),eht=pe.object({method:pe.literal("eth_getFilterChanges"),params:pe.array(pe.any())}),tht=pe.object({method:pe.literal("eth_getFilterLogs"),params:pe.array(pe.any())}),rht=pe.object({method:pe.literal("eth_getLogs"),params:pe.array(pe.any())}),nht=pe.object({method:pe.literal("eth_getProof"),params:pe.array(pe.any())}),iht=pe.object({method:pe.literal("eth_getStorageAt"),params:pe.array(pe.any())}),aht=pe.object({method:pe.literal("eth_getTransactionByBlockHashAndIndex"),params:pe.array(pe.any())}),oht=pe.object({method:pe.literal("eth_getTransactionByBlockNumberAndIndex"),params:pe.array(pe.any())}),sht=pe.object({method:pe.literal("eth_getTransactionByHash"),params:pe.array(pe.any())}),lht=pe.object({method:pe.literal("eth_getTransactionCount"),params:pe.array(pe.any())}),cht=pe.object({method:pe.literal("eth_getTransactionReceipt"),params:pe.array(pe.any())}),uht=pe.object({method:pe.literal("eth_getUncleCountByBlockHash"),params:pe.array(pe.any())}),fht=pe.object({method:pe.literal("eth_getUncleCountByBlockNumber"),params:pe.array(pe.any())}),dht=pe.object({method:pe.literal("eth_maxPriorityFeePerGas")}),hht=pe.object({method:pe.literal("eth_newBlockFilter")}),pht=pe.object({method:pe.literal("eth_newFilter"),params:pe.array(pe.any())}),ght=pe.object({method:pe.literal("eth_newPendingTransactionFilter")}),vht=pe.object({method:pe.literal("eth_sendRawTransaction"),params:pe.array(pe.any())}),mht=pe.object({method:pe.literal("eth_syncing"),params:pe.array(pe.any())}),yht=pe.object({method:pe.literal("eth_uninstallFilter"),params:pe.array(pe.any())}),gce=pe.object({method:pe.literal("personal_sign"),params:pe.array(pe.any())}),wht=pe.object({method:pe.literal("eth_signTypedData_v4"),params:pe.array(pe.any())}),vce=pe.object({method:pe.literal("eth_sendTransaction"),params:pe.array(pe.any())}),bht=pe.object({method:pe.literal("solana_signMessage"),params:pe.object({message:pe.string(),pubkey:pe.string()})}),xht=pe.object({method:pe.literal("solana_signTransaction"),params:pe.object({transaction:pe.string()})}),_ht=pe.object({method:pe.literal("solana_signAllTransactions"),params:pe.object({transactions:pe.array(pe.string())})}),Sht=pe.object({method:pe.literal("solana_signAndSendTransaction"),params:pe.object({transaction:pe.string(),options:pe.object({skipPreflight:pe.boolean().optional(),preflightCommitment:pe.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:pe.number().optional(),minContextSlot:pe.number().optional()}).optional()})}),Cht=pe.object({method:pe.literal("wallet_sendCalls"),params:pe.array(pe.object({chainId:pe.string().or(pe.number()).optional(),from:pe.string().optional(),version:pe.string().optional(),capabilities:pe.any().optional(),calls:pe.array(pe.object({to:pe.string().startsWith("0x"),data:pe.string().startsWith("0x").optional(),value:pe.string().optional()}))}))}),Aht=pe.object({method:pe.literal("wallet_getCallsStatus"),params:pe.array(pe.string())}),Tht=pe.object({method:pe.literal("wallet_getCapabilities")}),Eht=pe.object({method:pe.literal("wallet_grantPermissions"),params:pe.array(pe.any())}),mce=pe.object({token:pe.string()}),gr=pe.object({id:pe.string().optional()}),FC={appEvent:gr.extend({type:pr("APP_SWITCH_NETWORK"),payload:ddt}).or(gr.extend({type:pr("APP_CONNECT_EMAIL"),payload:hdt})).or(gr.extend({type:pr("APP_CONNECT_DEVICE")})).or(gr.extend({type:pr("APP_CONNECT_OTP"),payload:pdt})).or(gr.extend({type:pr("APP_CONNECT_SOCIAL"),payload:gdt})).or(gr.extend({type:pr("APP_GET_FARCASTER_URI")})).or(gr.extend({type:pr("APP_CONNECT_FARCASTER")})).or(gr.extend({type:pr("APP_GET_USER"),payload:pe.optional(vdt)})).or(gr.extend({type:pr("APP_GET_SOCIAL_REDIRECT_URI"),payload:mdt})).or(gr.extend({type:pr("APP_SIGN_OUT")})).or(gr.extend({type:pr("APP_IS_CONNECTED"),payload:pe.optional(mce)})).or(gr.extend({type:pr("APP_GET_CHAIN_ID")})).or(gr.extend({type:pr("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(gr.extend({type:pr("APP_INIT_SMART_ACCOUNT")})).or(gr.extend({type:pr("APP_SET_PREFERRED_ACCOUNT"),payload:Sdt})).or(gr.extend({type:pr("APP_RPC_REQUEST"),payload:gce.or(vce).or(Fdt).or(jdt).or(Udt).or(zdt).or(Hdt).or(Vdt).or(Gdt).or(Wdt).or(qdt).or(Ydt).or(Kdt).or(Zdt).or(Qdt).or(Xdt).or(Jdt).or(eht).or(tht).or(rht).or(nht).or(iht).or(aht).or(oht).or(sht).or(lht).or(cht).or(uht).or(fht).or(dht).or(hht).or(pht).or(ght).or(vht).or(mht).or(yht).or(gce).or(wht).or(vce).or(bht).or(xht).or(_ht).or(Sht).or(Aht).or(Cht).or(Tht).or(Eht)})).or(gr.extend({type:pr("APP_UPDATE_EMAIL"),payload:ydt})).or(gr.extend({type:pr("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:wdt})).or(gr.extend({type:pr("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:bdt})).or(gr.extend({type:pr("APP_SYNC_THEME"),payload:xdt})).or(gr.extend({type:pr("APP_SYNC_DAPP_DATA"),payload:_dt})),frameEvent:gr.extend({type:pr("FRAME_SWITCH_NETWORK_ERROR"),payload:lo}).or(gr.extend({type:pr("FRAME_SWITCH_NETWORK_SUCCESS"),payload:Ddt})).or(gr.extend({type:pr("FRAME_CONNECT_EMAIL_SUCCESS"),payload:Cdt})).or(gr.extend({type:pr("FRAME_CONNECT_EMAIL_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:Adt})).or(gr.extend({type:pr("FRAME_GET_FARCASTER_URI_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:Tdt})).or(gr.extend({type:pr("FRAME_CONNECT_FARCASTER_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_CONNECT_OTP_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_CONNECT_OTP_SUCCESS")})).or(gr.extend({type:pr("FRAME_CONNECT_DEVICE_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_CONNECT_DEVICE_SUCCESS")})).or(gr.extend({type:pr("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:Edt})).or(gr.extend({type:pr("FRAME_CONNECT_SOCIAL_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_GET_USER_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_GET_USER_SUCCESS"),payload:kdt})).or(gr.extend({type:pr("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:Pdt})).or(gr.extend({type:pr("FRAME_SIGN_OUT_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_SIGN_OUT_SUCCESS")})).or(gr.extend({type:pr("FRAME_IS_CONNECTED_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_IS_CONNECTED_SUCCESS"),payload:Rdt})).or(gr.extend({type:pr("FRAME_GET_CHAIN_ID_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_GET_CHAIN_ID_SUCCESS"),payload:Mdt})).or(gr.extend({type:pr("FRAME_RPC_REQUEST_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_RPC_REQUEST_SUCCESS"),payload:Bdt})).or(gr.extend({type:pr("FRAME_SESSION_UPDATE"),payload:mce})).or(gr.extend({type:pr("FRAME_UPDATE_EMAIL_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_UPDATE_EMAIL_SUCCESS"),payload:Idt})).or(gr.extend({type:pr("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(gr.extend({type:pr("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:Ndt})).or(gr.extend({type:pr("FRAME_SYNC_THEME_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_SYNC_THEME_SUCCESS")})).or(gr.extend({type:pr("FRAME_SYNC_DAPP_DATA_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(gr.extend({type:pr("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:Odt})).or(gr.extend({type:pr("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:$dt})).or(gr.extend({type:pr("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:lo})).or(gr.extend({type:pr("FRAME_READY"),payload:Ldt}))},Js={set(t,e){ol.isClient&&localStorage.setItem(`${wr.STORAGE_KEY}${t}`,e)},get(t){return ol.isClient?localStorage.getItem(`${wr.STORAGE_KEY}${t}`):null},delete(t,e){ol.isClient&&(e?localStorage.removeItem(t):localStorage.removeItem(`${wr.STORAGE_KEY}${t}`))}},yce={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},n7=30*1e3,ol={checkIfAllowedToTriggerEmail(){const t=Js.get(wr.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e{function s({data:l}){var u;if(!((u=l.type)!=null&&u.includes(wr.FRAME_EVENT_KEY)))return;const c=FC.frameEvent.parse(l);c.id===i&&(a(c),window.removeEventListener("message",s))}ol.isClient&&(window.addEventListener("message",s),o.addEventListener("abort",()=>{window.removeEventListener("message",s)}))},onFrameEvent:i=>{ol.isClient&&window.addEventListener("message",({data:a})=>{var s;if(!((s=a.type)!=null&&s.includes(wr.FRAME_EVENT_KEY)))return;const o=FC.frameEvent.parse(a);i(o)})},onAppEvent:i=>{ol.isClient&&window.addEventListener("message",({data:a})=>{var s;if(!((s=a.type)!=null&&s.includes(wr.APP_EVENT_KEY)))return;const o=FC.appEvent.parse(a);i(o)})},postAppEvent:i=>{var a;if(ol.isClient){if(!((a=this.iframe)!=null&&a.contentWindow))throw new Error("W3mFrame: iframe is not set");FC.appEvent.parse(i),this.iframe.contentWindow.postMessage(i,"*")}},postFrameEvent:i=>{if(ol.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");FC.frameEvent.parse(i),parent.postMessage(i,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((i,a)=>{this.frameLoadPromiseResolver={resolve:i,reject:a}}),r&&(this.frameLoadPromise=new Promise((i,a)=>{this.frameLoadPromiseResolver={resolve:i,reject:a}}),ol.isClient)){const i=document.createElement("iframe");i.id="w3m-iframe",i.src=`${dft}?projectId=${e}&chainId=${n}`,i.name="w3m-secure-iframe",i.style.position="fixed",i.style.zIndex="999999",i.style.display="none",i.style.animationDelay="0s, 50ms",i.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",i.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(i),this.iframe=i,this.iframe.onload=()=>{var a;(a=this.frameLoadPromiseResolver)==null||a.resolve(void 0)},this.iframe.onerror=()=>{var a;(a=this.frameLoadPromiseResolver)==null||a.reject("Unable to load email login dependency")}}}get networks(){const e=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(r=>({[r]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${r}&projectId=${this.projectId}`,chainId:r}}));return Object.assign({},...e)}}function kht(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var Pht=Rht;function Rht(t,e,r){var n=r&&r.stringify||kht,i=1;if(typeof t=="object"&&t!==null){var a=e.length+i;if(a===1)return t;var o=new Array(a);o[0]=n(t);for(var s=1;s-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(u>=l||e[u]==null)break;f=l||e[u]==null)break;f=l||e[u]===void 0)break;f",f=h+2,h++;break}c+=n(e[u]),f=h+2,h++;break;case 115:if(u>=l)break;f-1&&(a=!1);const o=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const s=t.level||"info",l=Object.create(r);l.log||(l.log=lT),Object.defineProperty(l,"levelVal",{get:u}),Object.defineProperty(l,"level",{get:f,set:d});const c={transmit:e,serialize:i,asObject:t.browser.asObject,levels:o,timestamp:Bht(t)};l.levels=Mp.levels,l.level=s,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=lT,l.serializers=n,l._serialize=i,l._stdErrSerialize=a,l.child=h,e&&(l._logEvent=xq());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function d(p){if(p!=="silent"&&!this.levels.values[p])throw Error("unknown level "+p);this._level=p,Ux(c,l,"error","log"),Ux(c,l,"fatal","error"),Ux(c,l,"warn","error"),Ux(c,l,"info","log"),Ux(c,l,"debug","log"),Ux(c,l,"trace","log")}function h(p,g){if(!p)throw new Error("missing bindings for child Pino");g=g||{},i&&p.serializers&&(g.serializers=p.serializers);const v=g.serializers;if(i&&v){var y=Object.assign({},n,v),m=t.browser.serialize===!0?Object.keys(y):i;delete p.serializers,DL([p],m,y,this._stdErrSerialize)}function b(w){this._childLevel=(w._childLevel|0)+1,this.error=zx(w,p,"error"),this.fatal=zx(w,p,"fatal"),this.warn=zx(w,p,"warn"),this.info=zx(w,p,"info"),this.debug=zx(w,p,"debug"),this.trace=zx(w,p,"trace"),y&&(this.serializers=y,this._serialize=m),e&&(this._logEvent=xq([].concat(w._logEvent.bindings,p)))}return b.prototype=this,new b(this)}return l}Mp.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Mp.stdSerializers=Mht;Mp.stdTimeFunctions=Object.assign({},{nullTime:QSe,epochTime:XSe,unixTime:Fht,isoTime:jht});function Ux(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?lT:i[r]?i[r]:sT[r]||sT[n]||lT,Nht(t,e,r)}function Nht(t,e,r){!t.transmit&&e[r]===lT||(e[r]=function(n){return function(){const a=t.timestamp(),o=new Array(arguments.length),s=Object.getPrototypeOf&&Object.getPrototypeOf(this)===sT?sT:this;for(var l=0;l-1&&a in r&&(t[i][a]=r[a](t[i][a]))}function zx(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;iJSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),Hht=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Ob(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return Hht(t)}catch{return t}}function Yg(t){return typeof t=="string"?t:zht(t)||""}const Vht={level:"info"},o8="custom_context",XX=1e3*1024;let Ght=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},bce=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new Ght(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},JSe=class{constructor(e,r=XX){this.level=e??"error",this.levelValue=__.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new bce(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===__.levels.values.error?console.error(e):r===__.levels.values.warn?console.warn(e):r===__.levels.values.debug?console.debug(e):r===__.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Yg({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new bce(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Yg({extraMetadata:e})),new Blob(r,{type:"application/json"})}},Wht=class{constructor(e,r=XX){this.baseChunkLogger=new JSe(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},qht=class{constructor(e,r=XX){this.baseChunkLogger=new JSe(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var Yht=Object.defineProperty,Kht=Object.defineProperties,Zht=Object.getOwnPropertyDescriptors,xce=Object.getOwnPropertySymbols,Qht=Object.prototype.hasOwnProperty,Xht=Object.prototype.propertyIsEnumerable,_ce=(t,e,r)=>e in t?Yht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,OD=(t,e)=>{for(var r in e||(e={}))Qht.call(e,r)&&_ce(t,r,e[r]);if(xce)for(var r of xce(e))Xht.call(e,r)&&_ce(t,r,e[r]);return t},LD=(t,e)=>Kht(t,Zht(e));function dS(t){return LD(OD({},t),{level:(t==null?void 0:t.level)||Vht.level})}function Jht(t,e=o8){return t[e]||""}function ept(t,e,r=o8){return t[r]=e,t}function Uc(t,e=o8){let r="";return typeof t.bindings>"u"?r=Jht(t,e):r=t.bindings().context||"",r}function tpt(t,e,r=o8){const n=Uc(t,r);return n.trim()?`${n}/${e}`:e}function vl(t,e,r=o8){const n=tpt(t,e,r),i=t.child({context:n});return ept(i,n,r)}function rpt(t){var e,r;const n=new Wht((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:a8(LD(OD({},t.opts),{level:"trace",browser:LD(OD({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function npt(t){var e;const r=new qht((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:a8(LD(OD({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function JX(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?rpt(t):npt(t)}class ipt{constructor(e){var a;const r=dS({level:hft}),{logger:n,chunkLoggerController:i}=JX({opts:r});this.logger=vl(n,this.constructor.name),this.chunkLoggerController=i,typeof window<"u"&&((a=this.chunkLoggerController)!=null&&a.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var o;(o=this.chunkLoggerController)!=null&&o.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class apt{constructor({projectId:e,chainId:r,onTimeout:n}){this.openRpcRequests=[],this.w3mLogger=new ipt(e),this.w3mFrame=new Iht(e,!0,r),this.onTimeout=n}getLoginEmailUsed(){return!!Js.get(wr.EMAIL_LOGIN_USED_KEY)}getEmail(){return Js.get(wr.EMAIL)}async connectEmail(e){try{ol.checkIfAllowedToTriggerEmail();const r=await this.appEvent({type:wr.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting email"),r}}async connectDevice(){try{return this.appEvent({type:wr.APP_CONNECT_DEVICE})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting device"),e}}async connectOtp(e){try{return this.appEvent({type:wr.APP_CONNECT_OTP,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting otp"),r}}async isConnected(){try{const e=await this.appEvent({type:wr.APP_IS_CONNECTED});return e.isConnected||this.deleteAuthLoginCache(),e}catch(e){throw this.deleteAuthLoginCache(),this.w3mLogger.logger.error({error:e},"Error checking connection"),e}}async getChainId(){try{const e=await this.appEvent({type:wr.APP_GET_CHAIN_ID});return this.setLastUsedChainId(e.chainId),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting chain id"),e}}async getSocialRedirectUri(e){try{return this.appEvent({type:wr.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error getting social redirect uri"),r}}async updateEmail(e){try{const r=await this.appEvent({type:wr.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email"),r}}async updateEmailPrimaryOtp(e){try{return this.appEvent({type:wr.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email primary otp"),r}}async updateEmailSecondaryOtp(e){try{const r=await this.appEvent({type:wr.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(r.newEmail),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error updating email secondary otp"),r}}async syncTheme(e){try{return this.appEvent({type:wr.APP_SYNC_THEME,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error syncing theme"),r}}async syncDappData(e){try{return this.appEvent({type:wr.APP_SYNC_DAPP_DATA,payload:e})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error syncing dapp data"),r}}async getSmartAccountEnabledNetworks(){try{const e=await this.appEvent({type:wr.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks),e}catch(e){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger.logger.error({error:e},"Error getting smart account enabled networks"),e}}async setPreferredAccount(e){try{return this.appEvent({type:wr.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error setting preferred account"),r}}async connect(e){try{const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,n=await this.appEvent({type:wr.APP_GET_USER,payload:{...e,chainId:r}});return this.setLoginSuccess(n.email),this.setLastUsedChainId(n.chainId),n}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting"),r}}async getUser(e){try{const r=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1;return await this.appEvent({type:wr.APP_GET_USER,payload:{...e,chainId:r}})}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting"),r}}async connectSocial(e){try{const r=await this.appEvent({type:wr.APP_CONNECT_SOCIAL,payload:{uri:e}});return r.userName&&this.setSocialLoginSuccess(r.userName),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error connecting social"),r}}async getFarcasterUri(){try{return await this.appEvent({type:wr.APP_GET_FARCASTER_URI})}catch(e){throw this.w3mLogger.logger.error({error:e},"Error getting farcaster uri"),e}}async connectFarcaster(){try{const e=await this.appEvent({type:wr.APP_CONNECT_FARCASTER});return e.userName&&this.setSocialLoginSuccess(e.userName),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error connecting farcaster"),e}}async switchNetwork(e){try{const r=await this.appEvent({type:wr.APP_SWITCH_NETWORK,payload:{chainId:e}});return this.setLastUsedChainId(r.chainId),r}catch(r){throw this.w3mLogger.logger.error({error:r},"Error switching network"),r}}async disconnect(){try{const e=await this.appEvent({type:wr.APP_SIGN_OUT});return this.deleteAuthLoginCache(),e}catch(e){throw this.w3mLogger.logger.error({error:e},"Error disconnecting"),e}}async request(e){var r,n,i;try{if(xn.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();(r=this.rpcRequestHandler)==null||r.call(this,e);const a=await this.appEvent({type:wr.APP_RPC_REQUEST,payload:e});return(n=this.rpcSuccessHandler)==null||n.call(this,a,e),a}catch(a){throw(i=this.rpcErrorHandler)==null||i.call(this,a,e),this.w3mLogger.logger.error({error:a},"Error requesting"),a}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===wr.FRAME_IS_CONNECTED_SUCCESS&&r.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===wr.FRAME_IS_CONNECTED_ERROR&&e(),r.type===wr.FRAME_IS_CONNECTED_SUCCESS&&!r.payload.isConnected&&e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===wr.FRAME_GET_USER_SUCCESS&&e(r.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===wr.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(r.payload):r.type===wr.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:xn.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===wr.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(r.payload.smartAccountEnabledNetworks):r.type===wr.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}rejectRpcRequests(){try{this.openRpcRequests.forEach(({abortController:e,method:r})=>{xn.SAFE_RPC_METHODS.includes(r)||e.abort()}),this.openRpcRequests=[]}catch(e){this.w3mLogger.logger.error({error:e},"Error aborting RPC request")}}async appEvent(e){await this.w3mFrame.frameLoadPromise;let r;function n(o){return o.replace("@w3m-app/","")}const i=n(e.type);return[wr.APP_CONNECT_EMAIL,wr.APP_CONNECT_DEVICE,wr.APP_CONNECT_OTP,wr.APP_CONNECT_SOCIAL,wr.APP_GET_SOCIAL_REDIRECT_URI,wr.APP_GET_FARCASTER_URI].map(n).includes(i)&&this.onTimeout&&(r=setTimeout(this.onTimeout,15e3)),new Promise((o,s)=>{var f,d;const l=Math.random().toString(36).substring(7);(d=(f=this.w3mLogger.logger).info)==null||d.call(f,{event:e,id:l},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:l});const c=new AbortController;if(i==="RPC_REQUEST"){const h=e;this.openRpcRequests=[...this.openRpcRequests,{...h.payload,abortController:c}]}c.signal.addEventListener("abort",()=>{i==="RPC_REQUEST"&&s(new Error("Request was aborted"))});function u(h,p){var g,v,y;h.id===l&&((v=(g=p.logger).info)==null||v.call(g,{framEvent:h,id:l},"Received frame response"),h.type===`@w3m-frame/${i}_SUCCESS`?(r&&clearTimeout(r),"payload"in h&&o(h.payload),o(void 0)):h.type===`@w3m-frame/${i}_ERROR`&&("payload"in h&&s(new Error(((y=h.payload)==null?void 0:y.message)||"An error occurred")),s(new Error("An error occurred"))))}this.w3mFrame.events.registerFrameEventHandler(l,h=>u(h,this.w3mLogger),c.signal)})}setNewLastEmailLoginTime(){Js.set(wr.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Js.set(wr.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&Js.set(wr.EMAIL,e),Js.set(wr.EMAIL_LOGIN_USED_KEY,"true"),Js.delete(wr.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Js.delete(wr.EMAIL_LOGIN_USED_KEY),Js.delete(wr.EMAIL),Js.delete(wr.LAST_USED_CHAIN_KEY),Js.delete(wr.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&Js.set(wr.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(Js.get(wr.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(e){Js.set(wr.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}const Qi=wa({transactions:[],coinbaseTransactions:{},transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),Do={state:Qi,subscribe(t){return Hl(Qi,()=>t(Qi))},setLastNetworkInView(t){Qi.lastNetworkInView=t},async fetchTransactions(t,e){var n;const{projectId:r}=At.state;if(!r||!t)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");Qi.loading=!0;try{const i=await Ma.fetchTransactions({account:t,projectId:r,cursor:Qi.next,onramp:e,cache:e==="coinbase"?"no-cache":void 0,chainId:(n=Pe.state.activeCaipNetwork)==null?void 0:n.id}),a=this.filterSpamTransactions(i.data),o=this.filterByConnectedChain(a),s=[...Qi.transactions,...o];Qi.loading=!1,e==="coinbase"?Qi.coinbaseTransactions=this.groupTransactionsByYearAndMonth(Qi.coinbaseTransactions,i.data):(Qi.transactions=s,Qi.transactionsByYear=this.groupTransactionsByYearAndMonth(Qi.transactionsByYear,o)),Qi.empty=s.length===0,Qi.next=i.next?i.next:void 0}catch{Vt.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:t,projectId:r,cursor:Qi.next,isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),vr.showError("Failed to fetch transactions"),Qi.loading=!1,Qi.empty=!0,Qi.next=void 0}},groupTransactionsByYearAndMonth(t={},e=[]){const r=t;return e.forEach(n=>{const i=new Date(n.metadata.minedAt).getFullYear(),a=new Date(n.metadata.minedAt).getMonth(),o=r[i]??{},l=(o[a]??[]).filter(c=>c.id!==n.id);r[i]={...o,[a]:[...l,n].sort((c,u)=>new Date(u.metadata.minedAt).getTime()-new Date(c.metadata.minedAt).getTime())}}),r},filterSpamTransactions(t){return t.filter(e=>!e.transfers.every(n=>{var i;return((i=n.nft_info)==null?void 0:i.flags.is_spam)===!0}))},filterByConnectedChain(t){var n;const e=(n=Pe.state.activeCaipNetwork)==null?void 0:n.id;return t.filter(i=>i.metadata.chain===e)},clearCursor(){Qi.next=void 0},resetTransactions(){Qi.transactions=[],Qi.transactionsByYear={},Qi.lastNetworkInView=void 0,Qi.loading=!1,Qi.empty=!1,Qi.next=void 0}},q0=wa({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),Ia={state:q0,subscribe(t){return Hl(q0,()=>t(q0))},setThemeMode(t){q0.themeMode=t;try{const e=rr.getAuthConnector();if(e){const r=Ia.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:t,themeVariables:r,w3mThemeVariables:Sg(r,t)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(t){q0.themeVariables={...q0.themeVariables,...t};try{const e=rr.getAuthConnector();if(e){const r=Ia.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:r,w3mThemeVariables:Sg(q0.themeVariables,q0.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return vq(q0)}},_d=wa({allConnectors:[],connectors:[]}),rr={state:_d,subscribeKey(t,e){return gl(_d,t,e)},setConnectors(t){const e=t.filter(r=>{try{wa(r)}catch(n){return console.error("ConnectorController.setConnectors: Not possible to add connector",{newConnector:r,error:n}),!1}return!_d.allConnectors.some(n=>n.id===r.id&&this.getConnectorName(n.name)===this.getConnectorName(r.name)&&n.chain===r.chain)});_d.allConnectors=[..._d.connectors,...e],_d.connectors=this.mergeMultiChainConnectors(_d.allConnectors)},mergeMultiChainConnectors(t){const e=this.generateConnectorMapByName(t),r=[];return e.forEach(n=>{const i=n[0],a=(i==null?void 0:i.id)==="w3mAuth";n.length>1?r.push({name:i==null?void 0:i.name,imageUrl:i==null?void 0:i.imageUrl,imageId:i==null?void 0:i.imageId,connectors:[...n],type:a?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(i==null?void 0:i.id)||""}):i&&r.push(i)}),r},generateConnectorMapByName(t){const e=new Map;return t.forEach(r=>{const{name:n}=r,i=this.getConnectorName(n);if(!i)return;const a=e.get(i)||[];a.find(s=>s.chain===r.chain)||a.push(r),e.set(i,a)}),e},getConnectorName(t){return t&&({"Trust Wallet":"Trust"}[t]||t)},getUniqueConnectorsByName(t){const e=[];return t.forEach(r=>{e.find(n=>n.chain===r.chain)||e.push(r)}),e},addConnector(t){var e,r;if(t.id==="w3mAuth"){const n=t,i=vq(At.state),a=Ia.getSnapshot().themeMode,o=Ia.getSnapshot().themeVariables;(r=(e=n==null?void 0:n.provider)==null?void 0:e.syncDappData)==null||r.call(e,{metadata:i.metadata,sdkVersion:i.sdkVersion,projectId:i.projectId,sdkType:i.sdkType}),n.provider.syncTheme({themeMode:a,themeVariables:o,w3mThemeVariables:Sg(o,a)}),this.setConnectors([t])}else this.setConnectors([t])},getAuthConnector(){var r;const t=Pe.state.activeChain,e=_d.connectors.find(n=>n.id==="w3mAuth");if(e)return(r=e==null?void 0:e.connectors)!=null&&r.length?e.connectors.find(i=>i.chain===t):e},getAnnouncedConnectorRdns(){return _d.connectors.filter(t=>t.type==="ANNOUNCED").map(t=>{var e;return(e=t.info)==null?void 0:e.rdns})},getConnectors(){return _d.connectors},getConnector(t,e){return _d.connectors.find(r=>{var n;return r.explorerId===t||((n=r.info)==null?void 0:n.rdns)===e})},syncIfAuthConnector(t){var a,o;if(t.id!=="w3mAuth")return;const e=t,r=vq(At.state),n=Ia.getSnapshot().themeMode,i=Ia.getSnapshot().themeVariables;(o=(a=e==null?void 0:e.provider)==null?void 0:a.syncDappData)==null||o.call(a,{metadata:r.metadata,sdkVersion:r.sdkVersion,sdkType:r.sdkType,projectId:r.projectId}),e.provider.syncTheme({themeMode:n,themeVariables:i,w3mThemeVariables:Sg(i,n)})}},_a=wa({wcError:!1,buffering:!1,status:"disconnected"});let Hx;const Dr={state:_a,subscribeKey(t,e){return gl(_a,t,e)},_getClient(t){return Pe.getConnectionControllerClient(t)},setClient(t){_a._client=Wd(t)},async connectWalletConnect(){var t,e,r,n;if(jn.setConnectedConnector("WALLET_CONNECT"),gt.isTelegram()){if(Hx){try{await Hx}catch{}Hx=void 0;return}if(!gt.isPairingExpired(_a==null?void 0:_a.wcPairingExpiry)){const i=_a.wcUri;_a.wcUri=i;return}Hx=new Promise(async(i,a)=>{var o,s,l,c;await((c=(l=(s=(o=Pe.state)==null?void 0:o.universalAdapter)==null?void 0:s.connectionControllerClient)==null?void 0:l.connectWalletConnect)==null?void 0:c.call(l,u=>{_a.wcUri=u,_a.wcPairingExpiry=gt.getPairingExpiry()}).catch(a)),i()}),this.state.status="connecting",await Hx,Hx=void 0,_a.wcPairingExpiry=void 0,this.state.status="connected"}else await((n=(r=(e=(t=Pe.state)==null?void 0:t.universalAdapter)==null?void 0:e.connectionControllerClient)==null?void 0:r.connectWalletConnect)==null?void 0:n.call(r,i=>{_a.wcUri=i,_a.wcPairingExpiry=gt.getPairingExpiry()}))},async connectExternal(t,e,r=!0){var n,i;await((i=(n=this._getClient(e)).connectExternal)==null?void 0:i.call(n,t)),r&&(Pe.setActiveNamespace(e),jn.setConnectedConnector(t.type))},async reconnectExternal(t){var e,r;await((r=(e=this._getClient()).reconnectExternal)==null?void 0:r.call(e,t)),jn.setConnectedConnector(t.type)},async setPreferredAccountType(t){var r;jr.setLoading(!0);const e=rr.getAuthConnector();e&&(await(e==null?void 0:e.provider.setPreferredAccount(t)),await this.reconnectExternal(e),jr.setLoading(!1),Vt.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:t,network:((r=Pe.state.activeCaipNetwork)==null?void 0:r.id)||""}}))},async signMessage(t){return this._getClient().signMessage(t)},parseUnits(t,e){return this._getClient().parseUnits(t,e)},formatUnits(t,e){return this._getClient().formatUnits(t,e)},async sendTransaction(t){return this._getClient().sendTransaction(t)},async estimateGas(t){return this._getClient().estimateGas(t)},async writeContract(t){return this._getClient().writeContract(t)},async getEnsAddress(t){return this._getClient().getEnsAddress(t)},async getEnsAvatar(t){return this._getClient().getEnsAvatar(t)},checkInstalled(t,e){var r,n;return((n=(r=this._getClient(e)).checkInstalled)==null?void 0:n.call(r,t))||!1},resetWcConnection(){_a.wcUri=void 0,_a.wcPairingExpiry=void 0,_a.wcLinking=void 0,_a.recentWallet=void 0,_a.status="disconnected",Do.resetTransactions(),jn.deleteWalletConnectDeepLink()},setWcLinking(t){_a.wcLinking=t},setWcError(t){_a.wcError=t,_a.buffering=!1},setRecentWallet(t){_a.recentWallet=t},setBuffering(t){_a.buffering=t},setStatus(t){_a.status=t},async disconnect(){const t=this._getClient();try{await(t==null?void 0:t.disconnect()),this.resetWcConnection()}catch{throw new Error("Failed to disconnect")}}},aA={async getTokenList(){var n;const t=Pe.state.activeCaipNetwork,e=await Ma.fetchSwapTokens({chainId:t==null?void 0:t.id,projectId:At.state.projectId});return((n=e==null?void 0:e.tokens)==null?void 0:n.map(i=>({...i,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){const t=At.state.projectId,e=Pe.state.activeCaipNetwork;if(!e)return null;try{switch(e.chainNamespace){case"solana":const r=(await Dr.estimateGas({chainNamespace:"solana"})).toString();return{standard:r,fast:r,instant:r};case"eip155":default:return await Ma.fetchGasPrice({projectId:t,chainId:e.id})}}catch{return null}},async fetchSwapAllowance({tokenAddress:t,userAddress:e,sourceTokenAmount:r,sourceTokenDecimals:n}){const i=At.state.projectId,a=await Ma.fetchSwapAllowance({projectId:i,tokenAddress:t,userAddress:e});if(a!=null&&a.allowance&&r&&n){const o=Dr.parseUnits(r,n)||0;return BigInt(a.allowance)>=o}return!1},async getMyTokensWithBalance(t){const e=Ze.state.address,r=Pe.state.activeCaipNetwork;if(!e||!r)return[];const i=(await Ma.getBalance(e,r.id,t)).balances.filter(a=>a.quantity.decimals!=="0");return Ze.setTokenBalance(i,Pe.state.activeChain),this.mapBalancesToSwapTokens(i)},mapBalancesToSwapTokens(t){return(t==null?void 0:t.map(e=>({...e,address:e!=null&&e.address?e.address:Jr.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},Xi=wa({view:"Connect",history:["Connect"],transactionStack:[]}),Ye={state:Xi,subscribeKey(t,e){return gl(Xi,t,e)},pushTransactionStack(t){Xi.transactionStack.push(t)},popTransactionStack(t){var r,n;const e=Xi.transactionStack.pop();if(e)if(t)this.goBack(),(r=e==null?void 0:e.onCancel)==null||r.call(e);else{if(e.goBack)this.goBack();else if(e.replace){const a=Xi.history.indexOf("ConnectingSiwe");a>0?this.goBackToIndex(a-1):(jr.close(),Xi.history=[])}else e.view&&this.reset(e.view);(n=e==null?void 0:e.onSuccess)==null||n.call(e)}},push(t,e){t!==Xi.view&&(Xi.view=t,Xi.history.push(t),Xi.data=e)},reset(t){Xi.view=t,Xi.history=[t]},replace(t,e){Xi.history.at(-1)===t||(Xi.view=t,Xi.history[Xi.history.length-1]=t,Xi.data=e)},goBack(){if(Xi.history.length>1){Xi.history.pop();const[t]=Xi.history.slice(-1);t&&(Xi.view=t)}else jr.close()},goBackToIndex(t){if(Xi.history.length>1){Xi.history=Xi.history.slice(0,t+1);const[e]=Xi.history.slice(-1);e&&(Xi.view=e)}}},sg={getGasPriceInEther(t,e){const r=e*t;return Number(r)/1e18},getGasPriceInUSD(t,e,r){const n=sg.getGasPriceInEther(e,r);return ii.bigNumber(t).multipliedBy(n).toNumber()},getPriceImpact({sourceTokenAmount:t,sourceTokenPriceInUSD:e,toTokenPriceInUSD:r,toTokenAmount:n}){const i=ii.bigNumber(t).multipliedBy(e),a=ii.bigNumber(n).multipliedBy(r);return i.minus(a).dividedBy(i).multipliedBy(100).toNumber()},getMaxSlippage(t,e){const r=ii.bigNumber(t).dividedBy(100);return ii.multiply(e,r).toNumber()},getProviderFee(t,e=.0085){return ii.bigNumber(t).multipliedBy(e).toString()},isInsufficientNetworkTokenForGas(t,e){const r=e||"0";return ii.bigNumber(t).isZero()?!0:ii.bigNumber(ii.bigNumber(r)).isGreaterThan(t)},isInsufficientSourceTokenForSwap(t,e,r){var a,o;const n=(o=(a=r==null?void 0:r.find(s=>s.address===e))==null?void 0:a.quantity)==null?void 0:o.numeric;return ii.bigNumber(n||"0").isLessThan(t)},getToTokenAmount({sourceToken:t,toToken:e,sourceTokenPrice:r,toTokenPrice:n,sourceTokenAmount:i}){if(i==="0"||!t||!e)return"0";const a=t.decimals,o=r,s=e.decimals,l=n;if(l<=0)return"0";const c=ii.bigNumber(i).multipliedBy(.0085),f=ii.bigNumber(i).minus(c).multipliedBy(ii.bigNumber(10).pow(a)),d=ii.bigNumber(o).dividedBy(l),h=a-s;return f.multipliedBy(d).dividedBy(ii.bigNumber(10).pow(h)).dividedBy(ii.bigNumber(10).pow(s)).toFixed(s).toString()}},Sce=15e4,opt=6,sc={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:Da.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},Xe=wa(sc),jt={state:Xe,subscribe(t){return Hl(Xe,()=>t(Xe))},subscribeKey(t,e){return gl(Xe,t,e)},getParams(){var s,l,c,u,f,d,h,p;const t=Pe.state.activeCaipAddress,e=gt.getPlainAddress(t),r=Jr.getActiveNetworkTokenAddress(),n=jn.getConnectedConnector();if(!e)throw new Error("No address found to swap the tokens from.");const i=!((s=Xe.toToken)!=null&&s.address)||!((l=Xe.toToken)!=null&&l.decimals),a=!((c=Xe.sourceToken)!=null&&c.address)||!((u=Xe.sourceToken)!=null&&u.decimals)||!ii.bigNumber(Xe.sourceTokenAmount).isGreaterThan(0),o=!Xe.sourceTokenAmount;return{networkAddress:r,fromAddress:e,fromCaipAddress:t,sourceTokenAddress:(f=Xe.sourceToken)==null?void 0:f.address,toTokenAddress:(d=Xe.toToken)==null?void 0:d.address,toTokenAmount:Xe.toTokenAmount,toTokenDecimals:(h=Xe.toToken)==null?void 0:h.decimals,sourceTokenAmount:Xe.sourceTokenAmount,sourceTokenDecimals:(p=Xe.sourceToken)==null?void 0:p.decimals,invalidToToken:i,invalidSourceToken:a,invalidSourceTokenAmount:o,availableToSwap:t&&!i&&!a&&!o,isAuthConnector:n==="AUTH"}},setSourceToken(t){if(!t){Xe.sourceToken=t,Xe.sourceTokenAmount="",Xe.sourceTokenPriceInUSD=0;return}Xe.sourceToken=t,this.setTokenPrice(t.address,"sourceToken")},setSourceTokenAmount(t){Xe.sourceTokenAmount=t},setToToken(t){if(!t){Xe.toToken=t,Xe.toTokenAmount="",Xe.toTokenPriceInUSD=0;return}Xe.toToken=t,this.setTokenPrice(t.address,"toToken")},setToTokenAmount(t){Xe.toTokenAmount=t?ii.formatNumberToLocalString(t,opt):""},async setTokenPrice(t,e){const{availableToSwap:r}=this.getParams();let n=Xe.tokensPriceMap[t]||0;n||(Xe.loadingPrices=!0,n=await this.getAddressPrice(t)),e==="sourceToken"?Xe.sourceTokenPriceInUSD=n:e==="toToken"&&(Xe.toTokenPriceInUSD=n),Xe.loadingPrices&&(Xe.loadingPrices=!1,r&&this.swapTokens())},switchTokens(){if(Xe.initializing||!Xe.initialized)return;const t=Xe.toToken?{...Xe.toToken}:void 0,e=Xe.sourceToken?{...Xe.sourceToken}:void 0,r=t&&Xe.toTokenAmount===""?"1":Xe.toTokenAmount;this.setSourceToken(t),this.setToToken(e),this.setSourceTokenAmount(r),this.setToTokenAmount(""),this.swapTokens()},resetState(){Xe.myTokensWithBalance=sc.myTokensWithBalance,Xe.tokensPriceMap=sc.tokensPriceMap,Xe.initialized=sc.initialized,Xe.sourceToken=sc.sourceToken,Xe.sourceTokenAmount=sc.sourceTokenAmount,Xe.sourceTokenPriceInUSD=sc.sourceTokenPriceInUSD,Xe.toToken=sc.toToken,Xe.toTokenAmount=sc.toTokenAmount,Xe.toTokenPriceInUSD=sc.toTokenPriceInUSD,Xe.networkPrice=sc.networkPrice,Xe.networkTokenSymbol=sc.networkTokenSymbol,Xe.networkBalanceInUSD=sc.networkBalanceInUSD,Xe.inputError=sc.inputError},resetValues(){var r;const{networkAddress:t}=this.getParams(),e=(r=Xe.tokens)==null?void 0:r.find(n=>n.address===t);this.setSourceToken(e),this.setToToken(void 0)},getApprovalLoadingState(){return Xe.loadingApprovalTransaction},clearError(){Xe.transactionError=void 0},async initializeState(){if(!Xe.initializing){if(Xe.initializing=!0,!Xe.initialized)try{await this.fetchTokens(),Xe.initialized=!0}catch{Xe.initialized=!1,vr.showError("Failed to initialize swap"),Ye.goBack()}Xe.initializing=!1}},async fetchTokens(){var r;const{networkAddress:t}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();const e=(r=Xe.tokens)==null?void 0:r.find(n=>n.address===t);e&&(Xe.networkTokenSymbol=e.symbol,this.setSourceToken(e),this.setSourceTokenAmount("1"))},async getTokenList(){const t=await aA.getTokenList();Xe.tokens=t,Xe.popularTokens=t.sort((e,r)=>e.symbolr.symbol?1:0),Xe.suggestedTokens=t.filter(e=>!!Da.SWAP_SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(t){var l,c;const e=Xe.tokensPriceMap[t];if(e)return e;const n=(await Ma.fetchTokenPrice({projectId:At.state.projectId,addresses:[t]})).fungibles||[],i=[...Xe.tokens||[],...Xe.myTokensWithBalance||[]],a=(l=i==null?void 0:i.find(u=>u.address===t))==null?void 0:l.symbol,o=((c=n.find(u=>u.symbol.toLowerCase()===(a==null?void 0:a.toLowerCase())))==null?void 0:c.price)||0,s=parseFloat(o.toString());return Xe.tokensPriceMap[t]=s,s},async getNetworkTokenPrice(){var i;const{networkAddress:t}=this.getParams(),r=(i=(await Ma.fetchTokenPrice({projectId:At.state.projectId,addresses:[t]}).catch(()=>(vr.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:i[0],n=(r==null?void 0:r.price.toString())||"0";Xe.tokensPriceMap[t]=parseFloat(n),Xe.networkTokenSymbol=(r==null?void 0:r.symbol)||"",Xe.networkPrice=n},async getMyTokensWithBalance(t){const e=await aA.getMyTokensWithBalance(t);e&&(await this.getInitialGasPrice(),this.setBalances(e))},setBalances(t){const{networkAddress:e}=this.getParams(),r=Pe.state.activeCaipNetwork;if(!r)return;const n=t.find(i=>i.address===e);t.forEach(i=>{Xe.tokensPriceMap[i.address]=i.price||0}),Xe.myTokensWithBalance=t.filter(i=>i.address.startsWith(r.id)),Xe.networkBalanceInUSD=n?ii.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){var e,r;const t=await aA.fetchGasPrice();if(!t)return{gasPrice:null,gasPriceInUSD:null};switch((r=(e=Pe.state)==null?void 0:e.activeCaipNetwork)==null?void 0:r.chainNamespace){case"solana":return Xe.gasFee=t.standard,Xe.gasPriceInUSD=ii.multiply(t.standard,Xe.networkPrice).dividedBy(1e9).toNumber(),{gasPrice:BigInt(Xe.gasFee),gasPriceInUSD:Number(Xe.gasPriceInUSD)};case"eip155":default:const n=t.standard,i=BigInt(n),a=BigInt(Sce),o=sg.getGasPriceInUSD(Xe.networkPrice,a,i);return Xe.gasFee=n,Xe.gasPriceInUSD=o,{gasPrice:i,gasPriceInUSD:o}}},async swapTokens(){var c,u;const t=Ze.state.address,e=Xe.sourceToken,r=Xe.toToken,n=ii.bigNumber(Xe.sourceTokenAmount).isGreaterThan(0);if(!r||!e||Xe.loadingPrices||!n)return;Xe.loadingQuote=!0;const i=ii.bigNumber(Xe.sourceTokenAmount).multipliedBy(10**e.decimals).integerValue(),a=await Ma.fetchSwapQuote({userAddress:t,projectId:At.state.projectId,from:e.address,to:r.address,gasPrice:Xe.gasFee,amount:i.toString()});Xe.loadingQuote=!1;const o=(u=(c=a==null?void 0:a.quotes)==null?void 0:c[0])==null?void 0:u.toAmount;if(!o)return;const s=ii.bigNumber(o).dividedBy(10**r.decimals).toString();this.setToTokenAmount(s),this.hasInsufficientToken(Xe.sourceTokenAmount,e.address)?Xe.inputError="Insufficient balance":(Xe.inputError=void 0,this.setTransactionDetails())},async getTransaction(){const{fromCaipAddress:t,availableToSwap:e}=this.getParams(),r=Xe.sourceToken,n=Xe.toToken;if(!(!t||!e||!r||!n||Xe.loadingQuote))try{Xe.loadingBuildTransaction=!0;const i=await aA.fetchSwapAllowance({userAddress:t,tokenAddress:r.address,sourceTokenAmount:Xe.sourceTokenAmount,sourceTokenDecimals:r.decimals});let a;return i?a=await this.createSwapTransaction():a=await this.createAllowanceTransaction(),Xe.loadingBuildTransaction=!1,Xe.fetchError=!1,a}catch{Ye.goBack(),vr.showError("Failed to check allowance"),Xe.loadingBuildTransaction=!1,Xe.approvalTransaction=void 0,Xe.swapTransaction=void 0,Xe.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:t,fromAddress:e,sourceTokenAddress:r,toTokenAddress:n}=this.getParams();if(!(!t||!n)){if(!r)throw new Error("createAllowanceTransaction - No source token address found.");try{const i=await Ma.generateApproveCalldata({projectId:At.state.projectId,from:r,to:n,userAddress:t}),a=await Dr.estimateGas({address:e,to:gt.getPlainAddress(i.tx.to),data:i.tx.data}),o={data:i.tx.data,to:gt.getPlainAddress(i.tx.from),gas:a,gasPrice:BigInt(i.tx.eip155.gasPrice),value:BigInt(i.tx.value),toAmount:Xe.toTokenAmount};return Xe.swapTransaction=void 0,Xe.approvalTransaction=o,o}catch{Ye.goBack(),vr.showError("Failed to create approval transaction"),Xe.approvalTransaction=void 0,Xe.swapTransaction=void 0,Xe.fetchError=!0;return}}},async createSwapTransaction(){const{networkAddress:t,fromCaipAddress:e,sourceTokenAmount:r}=this.getParams(),n=Xe.sourceToken,i=Xe.toToken;if(!e||!r||!n||!i)return;const a=Dr.parseUnits(r,n.decimals).toString();try{const o=await Ma.generateSwapCalldata({projectId:At.state.projectId,userAddress:e,from:n.address,to:i.address,amount:a}),s=n.address===t,l=BigInt(o.tx.eip155.gas),c=BigInt(o.tx.eip155.gasPrice),u={data:o.tx.data,to:gt.getPlainAddress(o.tx.to),gas:l,gasPrice:c,value:BigInt(s?a:"0"),toAmount:Xe.toTokenAmount};return Xe.gasPriceInUSD=sg.getGasPriceInUSD(Xe.networkPrice,l,c),Xe.approvalTransaction=void 0,Xe.swapTransaction=u,u}catch{Ye.goBack(),vr.showError("Failed to create transaction"),Xe.approvalTransaction=void 0,Xe.swapTransaction=void 0,Xe.fetchError=!0;return}},async sendTransactionForApproval(t){const{fromAddress:e,isAuthConnector:r}=this.getParams();Xe.loadingApprovalTransaction=!0;const n="Approve limit increase in your wallet";r?Ye.pushTransactionStack({view:null,goBack:!0,onSuccess(){vr.showLoading(n)}}):vr.showLoading(n);try{await Dr.sendTransaction({address:e,to:t.to,data:t.data,value:BigInt(t.value),gasPrice:BigInt(t.gasPrice)}),await this.swapTokens(),await this.getTransaction(),Xe.approvalTransaction=void 0,Xe.loadingApprovalTransaction=!1}catch(i){const a=i;Xe.transactionError=a==null?void 0:a.shortMessage,Xe.loadingApprovalTransaction=!1,vr.showError((a==null?void 0:a.shortMessage)||"Transaction error")}},async sendTransactionForSwap(t){var o,s,l,c,u,f,d,h,p,g,v,y;if(!t)return;const{fromAddress:e,toTokenAmount:r,isAuthConnector:n}=this.getParams();Xe.loadingTransaction=!0;const i=`Swapping ${(o=Xe.sourceToken)==null?void 0:o.symbol} to ${ii.formatNumberToLocalString(r,3)} ${(s=Xe.toToken)==null?void 0:s.symbol}`,a=`Swapped ${(l=Xe.sourceToken)==null?void 0:l.symbol} to ${ii.formatNumberToLocalString(r,3)} ${(c=Xe.toToken)==null?void 0:c.symbol}`;n?Ye.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){vr.showLoading(i),jt.resetState()}}):vr.showLoading("Confirm transaction in your wallet");try{const m=[(u=Xe.sourceToken)==null?void 0:u.address,(f=Xe.toToken)==null?void 0:f.address].join(","),b=await Dr.sendTransaction({address:e,to:t.to,data:t.data,gas:t.gas,gasPrice:BigInt(t.gasPrice),value:t.value});return Xe.loadingTransaction=!1,vr.showSuccess(a),Vt.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((d=Pe.state.activeCaipNetwork)==null?void 0:d.id)||"",swapFromToken:((h=this.state.sourceToken)==null?void 0:h.symbol)||"",swapToToken:((p=this.state.toToken)==null?void 0:p.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),jt.resetState(),n||Ye.replace("Account"),jt.getMyTokensWithBalance(m),b}catch(m){const b=m;Xe.transactionError=b==null?void 0:b.shortMessage,Xe.loadingTransaction=!1,vr.showError((b==null?void 0:b.shortMessage)||"Transaction error"),Vt.sendEvent({type:"track",event:"SWAP_ERROR",properties:{network:((g=Pe.state.activeCaipNetwork)==null?void 0:g.id)||"",swapFromToken:((v=this.state.sourceToken)==null?void 0:v.symbol)||"",swapToToken:((y=this.state.toToken)==null?void 0:y.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(t,e){const r=sg.isInsufficientSourceTokenForSwap(t,e,Xe.myTokensWithBalance);return Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT?!0:sg.isInsufficientNetworkTokenForGas(Xe.networkBalanceInUSD,Xe.gasPriceInUSD)||r},setTransactionDetails(){const{toTokenAddress:t,toTokenDecimals:e}=this.getParams();!t||!e||(Xe.gasPriceInUSD=sg.getGasPriceInUSD(Xe.networkPrice,BigInt(Xe.gasFee),BigInt(Sce)),Xe.priceImpact=sg.getPriceImpact({sourceTokenAmount:Xe.sourceTokenAmount,sourceTokenPriceInUSD:Xe.sourceTokenPriceInUSD,toTokenPriceInUSD:Xe.toTokenPriceInUSD,toTokenAmount:Xe.toTokenAmount}),Xe.maxSlippage=sg.getMaxSlippage(Xe.slippage,Xe.toTokenAmount),Xe.providerFee=sg.getProviderFee(Xe.sourceTokenAmount))}},Cce=wa({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),Ze={state:Cce,replaceState(t){t&&Object.assign(Cce,Wd(t))},subscribe(t){return Pe.subscribeChainProp("accountState",e=>{if(e)return t(e)})},subscribeKey(t,e,r){let n;return Pe.subscribeChainProp("accountState",i=>{if(i){const a=i[t];n!==a&&(n=a,e(a))}},r)},setStatus(t,e){Pe.setAccountProp("status",t,e)},getCaipAddress(t){return Pe.getAccountProp("caipAddress",t)},setProvider(t,e){t&&Pe.setAccountProp("provider",t,e)},setCaipAddress(t,e){const r=t?gt.getPlainAddress(t):void 0;Pe.state.activeCaipAddress=t,Pe.setAccountProp("caipAddress",t,e),Pe.setAccountProp("address",r,e)},setBalance(t,e,r){Pe.setAccountProp("balance",t,r),Pe.setAccountProp("balanceSymbol",e,r)},setProfileName(t,e){Pe.setAccountProp("profileName",t,e)},setProfileImage(t,e){Pe.setAccountProp("profileImage",t,e)},setAddressExplorerUrl(t,e){Pe.setAccountProp("addressExplorerUrl",t,e)},setSmartAccountDeployed(t,e){Pe.setAccountProp("smartAccountDeployed",t,e)},setCurrentTab(t){Pe.setAccountProp("currentTab",t,Pe.state.activeChain)},setTokenBalance(t,e){t&&Pe.setAccountProp("tokenBalance",t,e)},setShouldUpdateToAddress(t,e){Pe.setAccountProp("shouldUpdateToAddress",t,e)},setAllAccounts(t,e){Pe.setAccountProp("allAccounts",t,e)},addAddressLabel(t,e,r){const n=Pe.getAccountProp("addressLabels",r)||new Map;n.set(t,e),Pe.setAccountProp("addressLabels",n,r)},removeAddressLabel(t,e){const r=Pe.getAccountProp("addressLabels",e)||new Map;r.delete(t),Pe.setAccountProp("addressLabels",r,e)},setConnectedWalletInfo(t,e){Pe.setAccountProp("connectedWalletInfo",t,e,!1)},setPreferredAccountType(t,e){Pe.setAccountProp("preferredAccountType",t,e)},setSocialProvider(t,e){t&&Pe.setAccountProp("socialProvider",t,e)},setSocialWindow(t,e){t&&Pe.setAccountProp("socialWindow",Wd(t),e)},setFarcasterUrl(t,e){t&&Pe.setAccountProp("farcasterUrl",t,e)},async fetchTokenBalance(){var i,a;const t=(i=Pe.state.activeCaipNetwork)==null?void 0:i.id,e=(a=Pe.state.activeCaipNetwork)==null?void 0:a.chainNamespace,r=Pe.state.activeCaipAddress,n=r?gt.getPlainAddress(r):void 0;try{if(n&&t&&e){const o=await Ma.getBalance(n,t),s=o.balances.filter(l=>l.quantity.decimals!=="0");this.setTokenBalance(s,e),jt.setBalances(aA.mapBalancesToSwapTokens(o.balances))}}catch{vr.showError("Failed to fetch token balance")}},resetAccount(t){Pe.resetAccount(t)},setSiweStatus(t){Pe.setAccountProp("siweStatus",t,Pe.state.activeChain)}},jC=wa({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0}),Cg={state:jC,subscribe(t){return Hl(jC,()=>t(jC))},set(t){Object.assign(jC,{...jC,...t})}},Ace={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]},Tce={supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},Fr=wa({chains:$ut(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0}}),Pe={state:Fr,subscribeKey(t,e){return gl(Fr,t,e)},subscribeChainProp(t,e,r){let n;return Hl(Fr.chains,()=>{var a;const i=r||Fr.activeChain;if(i){const o=(a=Fr.chains.get(i))==null?void 0:a[t];n!==o&&(n=o,e(o))}})},initialize(t){const e=t==null?void 0:t[0];(t==null?void 0:t.length)===0&&(Fr.noAdapters=!0),Fr.noAdapters||(Fr.activeChain=e==null?void 0:e.chainNamespace,Cg.set({activeChain:e==null?void 0:e.chainNamespace}),t.forEach(r=>{Fr.chains.set(r.chainNamespace,{chainNamespace:r.chainNamespace,connectionControllerClient:r.connectionControllerClient,networkControllerClient:r.networkControllerClient,adapterType:r.adapterType,accountState:Ace,networkState:Tce,caipNetworks:r.caipNetworks})}))},initializeUniversalAdapter(t,e){var n,i;if(Fr.universalAdapter=t,e.length===0){const a=jn.getStoredActiveCaipNetwork();try{a?Fr.activeChain=a.chainNamespace:Fr.activeChain=((n=t==null?void 0:t.defaultNetwork)==null?void 0:n.chainNamespace)??((i=t.caipNetworks[0])==null?void 0:i.chainNamespace)}catch(o){console.warn(">>> Error setting active caip network",o)}}[...new Set(t.caipNetworks.map(a=>a.chainNamespace))].forEach(a=>{Fr.chains.set(a,{chainNamespace:a,connectionControllerClient:void 0,networkControllerClient:void 0,adapterType:t.adapterType,accountState:Ace,networkState:Tce,caipNetworks:t.caipNetworks})})},setChainNetworkData(t,e,r=!1){if(!t)throw new Error("Chain is required to update chain network data");const n=Fr.chains.get(t);n&&(n.networkState=Wd({...n.networkState,...e}),Fr.chains.set(t,Wd(n)),(r||Fr.chains.size===1||Fr.activeChain===t)&&Jr.replaceState(n.networkState))},setChainAccountData(t,e,r=!0){if(!t)throw new Error("Chain is required to update chain account data");const n=Fr.chains.get(t);n&&(n.accountState=Wd({...n.accountState,...e}),Fr.chains.set(t,n),(r||Fr.chains.size===1||Fr.activeChain===t)&&(e.caipAddress&&(Fr.activeCaipAddress=e.caipAddress),Ze.replaceState(n.accountState)))},setAccountProp(t,e,r,n=!0){this.setChainAccountData(r,{[t]:e},n)},setActiveNamespace(t){var n,i;Fr.activeChain=t;const e=t?Fr.chains.get(t):void 0,r=(n=e==null?void 0:e.networkState)==null?void 0:n.caipNetwork;r!=null&&r.id&&(Fr.activeCaipAddress=(i=e==null?void 0:e.accountState)==null?void 0:i.caipAddress,Fr.activeCaipNetwork=r,na.setItem(ra.ACTIVE_CAIP_NETWORK_ID,r==null?void 0:r.id),Cg.set({activeChain:t,selectedNetworkId:r==null?void 0:r.id}))},setActiveCaipNetwork(t){var r,n;if(!t)return;const e=Fr.chains.get(t.chainNamespace);Fr.activeChain=t.chainNamespace,Fr.activeCaipNetwork=t,Fr.activeCaipAddress=(r=e==null?void 0:e.accountState)==null?void 0:r.caipAddress,e&&(Jr.replaceState(e.networkState),Ze.replaceState(e.accountState)),Cg.set({activeChain:Fr.activeChain,selectedNetworkId:(n=Fr.activeCaipNetwork)==null?void 0:n.id}),na.setItem(ra.ACTIVE_CAIP_NETWORK_ID,t.id)},setCaipNetwork(t,e,r=!1){var n;Fr.activeChain=e==null?void 0:e.chainNamespace,Fr.activeCaipNetwork=e,Cg.set({activeChain:Fr.activeChain,selectedNetworkId:(n=Fr.activeCaipNetwork)==null?void 0:n.id}),this.setChainNetworkData(t,{caipNetwork:e},r)},setActiveConnector(t){t&&(Fr.activeConnector=Wd(t))},getNetworkControllerClient(t){const e=na.getItem(ra.WALLET_ID),r=t||Fr.activeChain,n=e==="walletConnect",i=Fr.universalAdapter.networkControllerClient;if(n||Fr.noAdapters){if(!i)throw new Error("Universal Adapter's networkControllerClient is not set");return i}if(!r)throw new Error("Chain is required to get network controller client");const o=Fr.chains.get(r);if(!o)throw new Error("Chain adapter not found");if(!o.networkControllerClient)throw new Error("NetworkController client not set");return o.networkControllerClient},getConnectionControllerClient(t){var s;const e=t||Fr.activeChain,r=na.getItem(ra.CONNECTED_CONNECTOR)==="WALLET_CONNECT",n=Fr.universalAdapter.connectionControllerClient,i=((s=Fr.chains.get("eip155"))==null?void 0:s.adapterType)==="wagmi";if(r&&!i||Fr.noAdapters){if(!n)throw new Error("Universal Adapter's ConnectionControllerClient is not set");return n}if(!e)throw new Error("Chain is required to get connection controller client");const o=Fr.chains.get(e);if(!o)throw new Error("Chain adapter not found");if(!o.connectionControllerClient)throw new Error("ConnectionController client not set");return o.connectionControllerClient},getAccountProp(t,e){var i;let r=Fr.activeChain;if(e&&(r=e),!r)return;const n=(i=Fr.chains.get(r))==null?void 0:i.accountState;if(n)return n[t]},getNetworkProp(t,e){var i;const r=e||Fr.activeChain;if(!r)return;const n=(i=Fr.chains.get(r))==null?void 0:i.networkState;if(n)return n[t]},getAllRequestedCaipNetworks(){const t=[];return Fr.chains.forEach(e=>{const r=e.networkState;r!=null&&r.requestedCaipNetworks&&t.push(...r.requestedCaipNetworks)}),t},getAllApprovedCaipNetworks(){const t=[];return Fr.chains.forEach(e=>{const r=e.networkState;r!=null&&r.approvedCaipNetworkIds&&t.push(...r.approvedCaipNetworkIds)}),t},resetAccount(t){const e=t;if(!e)throw new Error("Chain is required to set account prop");Pe.state.activeCaipAddress=void 0,this.setChainAccountData(e,Wd({smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,provider:void 0}))}},jn={setWalletConnectDeepLink({name:t,href:e}){try{na.setItem(ra.DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const t=na.getItem(ra.DEEPLINK_CHOICE);if(t)return JSON.parse(t)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{na.removeItem(ra.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setAppKitRecent(t){try{const e=jn.getRecentWallets();e.find(n=>n.id===t.id)||(e.unshift(t),e.length>2&&e.pop(),na.setItem(ra.RECENT_WALLETS,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const t=na.getItem(ra.RECENT_WALLETS);return t?JSON.parse(t):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnector(t){try{na.setItem(ra.CONNECTED_CONNECTOR,t)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return na.getItem(ra.CONNECTED_CONNECTOR)}catch{console.info("Unable to get Connected Connector")}},setConnectedSocialProvider(t){try{na.setItem(ra.CONNECTED_SOCIAL,t)}catch{console.info("Unable to set Connected Social Provider")}},getConnectedSocialProvider(){try{return na.getItem(ra.CONNECTED_SOCIAL)}catch{console.info("Unable to get Connected Social Provider")}},getConnectedSocialUsername(){try{return na.getItem(ra.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get Connected Social Username")}},getStoredActiveCaipNetwork(){const t=na.getItem(ra.ACTIVE_CAIP_NETWORK_ID),e=Pe.getAllRequestedCaipNetworks();return e==null?void 0:e.find(n=>n.id===t)}},Yu=wa({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),Ua={state:Yu,subscribeNetworkImages(t){return Hl(Yu.networkImages,()=>t(Yu.networkImages))},subscribeKey(t,e){return gl(Yu,t,e)},subscribe(t){return Hl(Yu,()=>t(Yu))},setWalletImage(t,e){Yu.walletImages[t]=e},setNetworkImage(t,e){Yu.networkImages[t]=e},setChainImage(t,e){Yu.chainImages[t]=e},setConnectorImage(t,e){Yu.connectorImages[t]=e},setTokenImage(t,e){Yu.tokenImages[t]=e},setCurrencyImage(t,e){Yu.currencyImages[t]=e}},spt=gt.getApiUrl(),Ys=new PL({baseUrl:spt,clientId:null}),lpt="40",Ece="4",cpt=20,Zo=wa({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1,excludedRDNS:[]}),xr={state:Zo,subscribeKey(t,e){return gl(Zo,t,e)},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:r}=At.state;return{"x-project-id":t,"x-sdk-type":e||"appkit","x-sdk-version":r||"html-wagmi-4.2.2"}},_filterOutExtensions(t){return At.state.isUniversalProvider?t.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):t},async _fetchWalletImage(t){const e=`${Ys.baseUrl}/getWalletImage/${t}`,r=await Ys.getBlob({path:e,headers:xr._getApiHeaders()});Ua.setWalletImage(t,URL.createObjectURL(r))},async _fetchNetworkImage(t){const e=`${Ys.baseUrl}/public/getAssetImage/${t}`,r=await Ys.getBlob({path:e,headers:xr._getApiHeaders()});Ua.setNetworkImage(t,URL.createObjectURL(r))},async _fetchConnectorImage(t){const e=`${Ys.baseUrl}/public/getAssetImage/${t}`,r=await Ys.getBlob({path:e,headers:xr._getApiHeaders()});Ua.setConnectorImage(t,URL.createObjectURL(r))},async _fetchCurrencyImage(t){const e=`${Ys.baseUrl}/public/getCurrencyImage/${t}`,r=await Ys.getBlob({path:e,headers:xr._getApiHeaders()});Ua.setCurrencyImage(t,URL.createObjectURL(r))},async _fetchTokenImage(t){const e=`${Ys.baseUrl}/public/getTokenImage/${t}`,r=await Ys.getBlob({path:e,headers:xr._getApiHeaders()});Ua.setTokenImage(t,URL.createObjectURL(r))},async fetchNetworkImages(){const t=Jr.getRequestedCaipNetworks(),e=t==null?void 0:t.map(({imageId:r})=>r).filter(Boolean);e&&await Promise.allSettled(e.map(r=>xr._fetchNetworkImage(r)))},async fetchConnectorImages(){const{connectors:t}=rr.state,e=t.map(({imageId:r})=>r).filter(Boolean);await Promise.allSettled(e.map(r=>xr._fetchConnectorImage(r)))},async fetchCurrencyImages(t=[]){await Promise.allSettled(t.map(e=>xr._fetchCurrencyImage(e)))},async fetchTokenImages(t=[]){await Promise.allSettled(t.map(e=>xr._fetchTokenImage(e)))},async fetchFeaturedWallets(){const{featuredWalletIds:t}=At.state;if(t!=null&&t.length){const{data:e}=await Ys.get({path:"/getWallets",headers:xr._getApiHeaders(),params:{page:"1",entries:t!=null&&t.length?String(t.length):Ece,include:t==null?void 0:t.join(",")}});e.sort((n,i)=>t.indexOf(n.id)-t.indexOf(i.id));const r=e.map(n=>n.image_id).filter(Boolean);await Promise.allSettled(r.map(n=>xr._fetchWalletImage(n))),Zo.featured=e}},async fetchRecommendedWallets(){var t;try{const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=At.state,i=[...r??[],...n??[]].filter(Boolean),{data:a,count:o}=await Ys.get({path:"/getWallets",headers:xr._getApiHeaders(),params:{page:"1",chains:(t=Pe.state.activeCaipNetwork)==null?void 0:t.id,entries:Ece,include:e==null?void 0:e.join(","),exclude:i==null?void 0:i.join(",")}}),s=jn.getRecentWallets(),l=a.map(u=>u.image_id).filter(Boolean),c=s.map(u=>u.image_id).filter(Boolean);await Promise.allSettled([...l,...c].map(u=>xr._fetchWalletImage(u))),Zo.recommended=a,Zo.count=o??0}catch{}},async fetchWallets({page:t}){var l;const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=At.state,i=[...Zo.recommended.map(({id:c})=>c),...r??[],...n??[]].filter(Boolean),{data:a,count:o}=await Ys.get({path:"/getWallets",headers:xr._getApiHeaders(),params:{page:String(t),entries:lpt,chains:(l=Pe.state.activeCaipNetwork)==null?void 0:l.id,include:e==null?void 0:e.join(","),exclude:i.join(",")}}),s=a.slice(0,cpt).map(c=>c.image_id).filter(Boolean);await Promise.allSettled(s.map(c=>xr._fetchWalletImage(c))),Zo.wallets=gt.uniqueBy([...Zo.wallets,...xr._filterOutExtensions(a)],"id"),Zo.count=o>Zo.count?o:Zo.count,Zo.page=t},async searchWalletByIds({ids:t}){var r;const{data:e}=await Ys.get({path:"/getWallets",headers:xr._getApiHeaders(),params:{page:"1",entries:String(t.length),chains:(r=Pe.state.activeCaipNetwork)==null?void 0:r.id,include:t==null?void 0:t.join(",")}});e&&e.forEach(n=>{n!=null&&n.rdns&&Zo.excludedRDNS.push(n.rdns)})},async searchWallet({search:t}){var a;const{includeWalletIds:e,excludeWalletIds:r}=At.state;Zo.search=[];const{data:n}=await Ys.get({path:"/getWallets",headers:xr._getApiHeaders(),params:{page:"1",entries:"100",search:t==null?void 0:t.trim(),chains:(a=Pe.state.activeCaipNetwork)==null?void 0:a.id,include:e==null?void 0:e.join(","),exclude:r==null?void 0:r.join(",")}}),i=n.map(o=>o.image_id).filter(Boolean);await Promise.allSettled([...i.map(o=>xr._fetchWalletImage(o)),gt.wait(300)]),Zo.search=xr._filterOutExtensions(n)},async reFetchWallets(){Zo.page=1,Zo.wallets=[],await xr.fetchFeaturedWallets(),await xr.fetchRecommendedWallets()},prefetch(){var e;const t=[xr.fetchFeaturedWallets(),xr.fetchRecommendedWallets(),xr.fetchNetworkImages(),xr.fetchConnectorImages()];(e=At.state.features)!=null&&e.analytics&&t.push(xr.fetchAnalyticsConfig()),Zo.prefetchPromise=Promise.race([Promise.allSettled(t)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:t}=await Ys.get({path:"/getAnalyticsConfig",headers:xr._getApiHeaders()});At.setFeatures({analytics:t})}},Wh=wa({loading:!1,open:!1,shake:!1}),jr={state:Wh,subscribe(t){return Hl(Wh,()=>t(Wh))},subscribeKey(t,e){return gl(Wh,t,e)},async open(t){await xr.state.prefetchPromise;const e=Pe.state.activeCaipAddress,r=Pe.state.noAdapters;t!=null&&t.view?Ye.reset(t.view):e?Ye.reset("Account"):r&&!gt.isMobile()?Ye.reset("ConnectingWalletConnect"):Ye.reset("Connect"),Wh.open=!0,Cg.set({open:!0}),Vt.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!e}})},close(){const t=!!Pe.state.activeCaipAddress;Wh.open=!1,Cg.set({open:!1}),Vt.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}})},setLoading(t){Wh.loading=t,Cg.set({loading:t})},shake(){Wh.shake||(Wh.shake=!0,setTimeout(()=>{Wh.shake=!1},500))}},$A={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},_q={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},upt={providers:BSe,selectedProvider:null,error:null,purchaseCurrency:$A,paymentCurrency:_q,purchaseCurrencies:[$A],paymentCurrencies:[],quotesLoading:!1},mi=wa(upt),wi={state:mi,subscribe(t){return Hl(mi,()=>t(mi))},subscribeKey(t,e){return gl(mi,t,e)},setSelectedProvider(t){if(t&&t.name==="meld"){const e=Jut,r=Pe.state.activeChain===ya.CHAIN.SOLANA?"SOL":"USDC",n=Ze.state.address??"",i=new URL(t.url);i.searchParams.append("publicKey",e),i.searchParams.append("destinationCurrencyCode",r),i.searchParams.append("walletAddress",n),t.url=i.toString()}mi.selectedProvider=t},setPurchaseCurrency(t){mi.purchaseCurrency=t},setPaymentCurrency(t){mi.paymentCurrency=t},setPurchaseAmount(t){this.state.purchaseAmount=t},setPaymentAmount(t){this.state.paymentAmount=t},async getAvailableCurrencies(){const t=await Ma.getOnrampOptions();mi.purchaseCurrencies=t.purchaseCurrencies,mi.paymentCurrencies=t.paymentCurrencies,mi.paymentCurrency=t.paymentCurrencies[0]||_q,mi.purchaseCurrency=t.purchaseCurrencies[0]||$A,await xr.fetchCurrencyImages(t.paymentCurrencies.map(e=>e.id)),await xr.fetchTokenImages(t.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var t,e;mi.quotesLoading=!0;try{const r=await Ma.getOnrampQuote({purchaseCurrency:mi.purchaseCurrency,paymentCurrency:mi.paymentCurrency,amount:((t=mi.paymentAmount)==null?void 0:t.toString())||"0",network:(e=mi.purchaseCurrency)==null?void 0:e.symbol});return mi.quotesLoading=!1,mi.purchaseAmount=Number(r.purchaseAmount.amount),r}catch(r){return mi.error=r.message,mi.quotesLoading=!1,null}finally{mi.quotesLoading=!1}},resetState(){mi.providers=BSe,mi.selectedProvider=null,mi.error=null,mi.purchaseCurrency=$A,mi.paymentCurrency=_q,mi.purchaseCurrencies=[$A],mi.paymentCurrencies=[],mi.paymentAmount=void 0,mi.purchaseAmount=void 0,mi.quotesLoading=!1}},Qo=wa({loading:!1}),ui={state:Qo,subscribe(t){return Hl(Qo,()=>t(Qo))},subscribeKey(t,e){return gl(Qo,t,e)},setToken(t){t&&(Qo.token=Wd(t))},setTokenAmount(t){Qo.sendTokenAmount=t},setReceiverAddress(t){Qo.receiverAddress=t},setReceiverProfileImageUrl(t){Qo.receiverProfileImageUrl=t},setReceiverProfileName(t){Qo.receiverProfileName=t},setGasPrice(t){Qo.gasPrice=t},setGasPriceInUsd(t){Qo.gasPriceInUSD=t},setLoading(t){Qo.loading=t},sendToken(){var t;switch((t=Pe.state.activeCaipNetwork)==null?void 0:t.chainNamespace){case"eip155":this.sendEvmToken();return;case"solana":this.sendSolanaToken();return;default:throw new Error("Unsupported chain")}},sendEvmToken(){var t,e,r,n,i;(t=this.state.token)!=null&&t.address&&this.state.sendTokenAmount&&this.state.receiverAddress?(Vt.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token.address,amount:this.state.sendTokenAmount,network:((e=Pe.state.activeCaipNetwork)==null?void 0:e.id)||""}}),this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals})):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&((r=this.state.token)!=null&&r.quantity.decimals)&&(Vt.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,token:(n=this.state.token)==null?void 0:n.symbol,amount:this.state.sendTokenAmount,network:((i=Pe.state.activeCaipNetwork)==null?void 0:i.id)||""}}),this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals}))},async sendNativeToken(t){var a,o,s,l;Ye.pushTransactionStack({view:"Account",goBack:!1});const e=t.receiverAddress,r=Ze.state.address,n=Dr.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals)),i="0x";try{await Dr.sendTransaction({to:e,address:r,data:i,value:n,gasPrice:t.gasPrice}),vr.showSuccess("Transaction started"),Vt.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,token:((a=this.state.token)==null?void 0:a.symbol)||"",amount:t.sendTokenAmount,network:((o=Pe.state.activeCaipNetwork)==null?void 0:o.id)||""}}),this.resetSend()}catch{Vt.sendEvent({type:"track",event:"SEND_ERROR",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,token:((s=this.state.token)==null?void 0:s.symbol)||"",amount:t.sendTokenAmount,network:((l=Pe.state.activeCaipNetwork)==null?void 0:l.id)||""}}),vr.showError("Something went wrong")}},async sendERC20Token(t){Ye.pushTransactionStack({view:"Account",goBack:!1});const e=Dr.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals));try{if(Ze.state.address&&t.sendTokenAmount&&t.receiverAddress&&t.tokenAddress){const r=gt.getPlainAddress(t.tokenAddress);await Dr.writeContract({fromAddress:Ze.state.address,tokenAddress:r,receiverAddress:t.receiverAddress,tokenAmount:e,method:"transfer",abi:Zut.getERC20Abi(r)}),vr.showSuccess("Transaction started"),this.resetSend()}}catch{vr.showError("Something went wrong")}},sendSolanaToken(){if(!this.state.sendTokenAmount||!this.state.receiverAddress){vr.showError("Please enter a valid amount and receiver address");return}Ye.pushTransactionStack({view:"Account",goBack:!1}),Dr.sendTransaction({chainNamespace:"solana",to:this.state.receiverAddress,value:this.state.sendTokenAmount}).then(()=>{this.resetSend(),Ze.fetchTokenBalance()}).catch(t=>{vr.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send solana transaction",t)})},resetSend(){Qo.token=void 0,Qo.sendTokenAmount=void 0,Qo.receiverAddress=void 0,Qo.receiverProfileImageUrl=void 0,Qo.receiverProfileName=void 0,Qo.loading=!1}},Sd=wa({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),nu={state:Sd,subscribe(t){return Hl(Sd,()=>t(Sd))},subscribeKey(t,e){return gl(Sd,t,e)},showTooltip({message:t,triggerRect:e,variant:r}){Sd.open=!0,Sd.message=t,Sd.triggerRect=e,Sd.variant=r},hide(){Sd.open=!1,Sd.message="",Sd.triggerRect={width:0,height:0,top:0,left:0}}},Ice=2147483648,fpt={convertEVMChainIdToCoinType(t){if(t>=Ice)throw new Error("Invalid chainId");return(Ice|t)>>>0}},Ku=wa({suggestions:[],loading:!1}),ap={state:Ku,subscribe(t){return Hl(Ku,()=>t(Ku))},subscribeKey(t,e){return gl(Ku,t,e)},async resolveName(t){var e,r;try{return await Ma.lookupEnsName(t)}catch(n){const i=n;throw new Error(((r=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:r.description)||"Error resolving name")}},async isNameRegistered(t){try{return await Ma.lookupEnsName(t),!0}catch{return!1}},async getSuggestions(t){try{Ku.loading=!0,Ku.suggestions=[];const e=await Ma.getEnsNameSuggestions(t);return Ku.suggestions=e.suggestions.map(r=>({...r,name:r.name}))||[],Ku.suggestions}catch(e){const r=this.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(r)}finally{Ku.loading=!1}},async getNamesForAddress(t){try{return Pe.state.activeCaipNetwork?await Ma.reverseLookupEnsName({address:t}):[]}catch(e){const r=this.parseEnsApiError(e,"Error fetching names for address");throw new Error(r)}},async registerName(t){const e=Pe.state.activeCaipNetwork;if(!e)throw new Error("Network not found");const r=Ze.state.address,n=rr.getAuthConnector();if(!r||!n)throw new Error("Address or auth connector not found");Ku.loading=!0;try{const i=JSON.stringify({name:t,attributes:{},timestamp:Math.floor(Date.now())});Ye.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){Ku.loading=!1}});const a=await Dr.signMessage(i),o=Bd.caipNetworkIdToNumber(e.id);if(!o)throw new Error("Network not found");const s=fpt.convertEVMChainIdToCoinType(Number(o));await Ma.registerEnsName({coinType:s,address:r,signature:a,message:i}),Ze.setProfileName(t,e.chainNamespace),Ye.replace("RegisterAccountNameSuccess")}catch(i){const a=this.parseEnsApiError(i,`Error registering name ${t}`);throw Ye.replace("RegisterAccountName"),new Error(a)}finally{Ku.loading=!1}},validateName(t){return/^[a-zA-Z0-9-]{4,}$/u.test(t)},parseEnsApiError(t,e){var n,i;const r=t;return((i=(n=r==null?void 0:r.reasons)==null?void 0:n[0])==null?void 0:i.description)||e}},Gv=wa({message:"",variant:"info",open:!1}),cb={state:Gv,subscribeKey(t,e){return gl(Gv,t,e)},open(t,e){const{debug:r}=At.state,{shortMessage:n,longMessage:i}=t;r&&(Gv.message=n,Gv.variant=e,Gv.open=!0),i&&console.error(typeof i=="function"?i():i)},close(){Gv.open=!1,Gv.message="",Gv.variant="info"}},dpt={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:""},Jn={async fetchWalletImage(t){if(t)return await xr._fetchWalletImage(t),this.getWalletImageById(t)},getWalletImageById(t){if(t)return Ua.state.walletImages[t]},getWalletImage(t){if(t!=null&&t.image_url)return t==null?void 0:t.image_url;if(t!=null&&t.image_id)return Ua.state.walletImages[t.image_id]},getNetworkImage(t){if(t!=null&&t.imageUrl)return t==null?void 0:t.imageUrl;if(t!=null&&t.imageId)return Ua.state.networkImages[t.imageId]},getNetworkImageById(t){if(t)return Ua.state.networkImages[t]},getConnectorImage(t){if(t!=null&&t.imageUrl)return t.imageUrl;if(t!=null&&t.imageId)return Ua.state.connectorImages[t.imageId]},getChainImage(t){return Ua.state.networkImages[dpt[t]]}};/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const jR=globalThis,eJ=jR.ShadowRoot&&(jR.ShadyCSS===void 0||jR.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,tJ=Symbol(),kce=new WeakMap;let eCe=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==tJ)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(eJ&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=kce.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&kce.set(r,e))}return e}toString(){return this.cssText}};const ff=t=>new eCe(typeof t=="string"?t:t+"",void 0,tJ),Je=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new eCe(r,t,tJ)},hpt=(t,e)=>{if(eJ)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),i=jR.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},Pce=eJ?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return ff(r)})(t):t;/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const{is:ppt,defineProperty:gpt,getOwnPropertyDescriptor:vpt,getOwnPropertyNames:mpt,getOwnPropertySymbols:ypt,getPrototypeOf:wpt}=Object,d1=globalThis,Rce=d1.trustedTypes,bpt=Rce?Rce.emptyScript:"",kU=d1.reactiveElementPolyfillSupport,BA=(t,e)=>t,$D={toAttribute(t,e){switch(e){case Boolean:t=t?bpt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},rJ=(t,e)=>!ppt(t,e),Mce={attribute:!0,type:String,converter:$D,reflect:!1,hasChanged:rJ};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),d1.litPropertyMetadata??(d1.litPropertyMetadata=new WeakMap);let S_=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Mce){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&gpt(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){const{get:i,set:a}=vpt(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const s=i==null?void 0:i.call(this);a.call(this,o),this.requestUpdate(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Mce}static _$Ei(){if(this.hasOwnProperty(BA("elementProperties")))return;const e=wpt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(BA("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(BA("properties"))){const r=this.properties,n=[...mpt(r),...ypt(r)];for(const i of n)this.createProperty(i,r[i])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(Pce(i))}else e!==void 0&&r.push(Pce(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return hpt(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EC(e,r){var a;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((a=n.converter)==null?void 0:a.toAttribute)!==void 0?n.converter:$D).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,r){var a;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((a=o.converter)==null?void 0:a.fromAttribute)!==void 0?o.converter:$D;this._$Em=i,this[i]=s.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){if(n??(n=this.constructor.getPropertyOptions(e)),!(n.hasChanged??rJ)(this[e],r))return;this.P(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,n){this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,o]of this._$Ep)this[a]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[a,o]of i)o.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.P(a,this[a],o)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(i=>{var a;return(a=i.hostUpdate)==null?void 0:a.call(i)}),this.update(r)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}};S_.elementStyles=[],S_.shadowRootOptions={mode:"open"},S_[BA("elementProperties")]=new Map,S_[BA("finalized")]=new Map,kU==null||kU({ReactiveElement:S_}),(d1.reactiveElementVersions??(d1.reactiveElementVersions=[])).push("2.0.4");/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const FA=globalThis,BD=FA.trustedTypes,Dce=BD?BD.createPolicy("lit-html",{createHTML:t=>t}):void 0,tCe="$lit$",Tm=`lit$${Math.random().toFixed(9).slice(2)}$`,rCe="?"+Tm,xpt=`<${rCe}>`,Lb=document,cT=()=>Lb.createComment(""),uT=t=>t===null||typeof t!="object"&&typeof t!="function",nJ=Array.isArray,_pt=t=>nJ(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",PU=`[ -\f\r]`,UC=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nce=/-->/g,Oce=/>/g,$y=RegExp(`>|${PU}(?:([^\\s"'>=/]+)(${PU}*=${PU}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),Lce=/'/g,$ce=/"/g,nCe=/^(?:script|style|textarea|title)$/i,iCe=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),X=iCe(1),mt=iCe(2),$b=Symbol.for("lit-noChange"),vo=Symbol.for("lit-nothing"),Bce=new WeakMap,Vw=Lb.createTreeWalker(Lb,129);function aCe(t,e){if(!nJ(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Dce!==void 0?Dce.createHTML(e):e}const Spt=(t,e)=>{const r=t.length-1,n=[];let i,a=e===2?"":e===3?"":"",o=UC;for(let s=0;s"?(o=i??UC,f=-1):u[1]===void 0?f=-2:(f=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?$y:u[3]==='"'?$ce:Lce):o===$ce||o===Lce?o=$y:o===Nce||o===Oce?o=UC:(o=$y,i=void 0);const h=o===$y&&t[s+1].startsWith("/>")?" ":"";a+=o===UC?l+xpt:f>=0?(n.push(c),l.slice(0,f)+tCe+l.slice(f)+Tm+h):l+Tm+(f===-2?s:h)}return[aCe(t,a+(t[r]||"")+(e===2?"":e===3?"":"")),n]};let Sq=class oCe{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0;const s=e.length-1,l=this.parts,[c,u]=Spt(e,r);if(this.el=oCe.createElement(c,n),Vw.currentNode=this.el.content,r===2||r===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Vw.nextNode())!==null&&l.length0){i.textContent=BD?BD.emptyScript:"";for(let h=0;h2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=vo}_$AI(e,r=this,n,i){const a=this.strings;let o=!1;if(a===void 0)e=J3(this,e,r,0),o=!uT(e)||e!==this._$AH&&e!==$b,o&&(this._$AH=e);else{const s=e;let l,c;for(e=a[0],l=0;l{const n=(r==null?void 0:r.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const a=(r==null?void 0:r.renderBefore)??null;n._$litPart$=i=new iJ(e.insertBefore(cT(),a),a,void 0,r??{})}return i._$AI(t),i};/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */let He=class extends S_{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=kpt(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return $b}};var H2e;He._$litElement$=!0,He.finalized=!0,(H2e=globalThis.litElementHydrateSupport)==null||H2e.call(globalThis,{LitElement:He});const MU=globalThis.litElementPolyfillSupport;MU==null||MU({LitElement:He});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");let jA,h1,p1;function Qxr(t,e){jA=document.createElement("style"),h1=document.createElement("style"),p1=document.createElement("style"),jA.textContent=g3(t).core.cssText,h1.textContent=g3(t).dark.cssText,p1.textContent=g3(t).light.cssText,document.head.appendChild(jA),document.head.appendChild(h1),document.head.appendChild(p1),lCe(e)}function lCe(t){h1&&p1&&(t==="light"?(h1.removeAttribute("media"),p1.media="enabled"):(p1.removeAttribute("media"),h1.media="enabled"))}function Ppt(t){jA&&h1&&p1&&(jA.textContent=g3(t).core.cssText,h1.textContent=g3(t).dark.cssText,p1.textContent=g3(t).light.cssText)}function g3(t){return{core:Je` - @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); - @keyframes w3m-shake { - 0% { - transform: scale(1) rotate(0deg); - } - 20% { - transform: scale(1) rotate(-1deg); - } - 40% { - transform: scale(1) rotate(1.5deg); - } - 60% { - transform: scale(1) rotate(-1.5deg); - } - 80% { - transform: scale(1) rotate(1deg); - } - 100% { - transform: scale(1) rotate(0deg); - } - } - @keyframes w3m-iframe-fade-out { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } - } - @keyframes w3m-iframe-zoom-in { - 0% { - transform: translateY(50px); - opacity: 0; - } - 100% { - transform: translateY(0px); - opacity: 1; - } - } - @keyframes w3m-iframe-zoom-in-mobile { - 0% { - transform: scale(0.95); - opacity: 0; - } - 100% { - transform: scale(1); - opacity: 1; - } - } - :root { - --w3m-modal-width: 360px; - --w3m-color-mix-strength: ${ff(t!=null&&t["--w3m-color-mix-strength"]?`${t["--w3m-color-mix-strength"]}%`:"0%")}; - --w3m-font-family: ${ff((t==null?void 0:t["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; - --w3m-font-size-master: ${ff((t==null?void 0:t["--w3m-font-size-master"])||"10px")}; - --w3m-border-radius-master: ${ff((t==null?void 0:t["--w3m-border-radius-master"])||"4px")}; - --w3m-z-index: ${ff((t==null?void 0:t["--w3m-z-index"])||999)}; - - --wui-font-family: var(--w3m-font-family); - - --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8); - --wui-font-size-micro: var(--w3m-font-size-master); - --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); - --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); - --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); - --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8); - --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); - --wui-font-size-title-6: calc(var(--w3m-font-size-master) * 2.2); - --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4); - --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4); - - --wui-border-radius-5xs: var(--w3m-border-radius-master); - --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); - --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); - --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); - --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); - --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); - --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); - --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); - --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); - - --wui-font-weight-light: 400; - --wui-font-weight-regular: 500; - --wui-font-weight-medium: 600; - --wui-font-weight-bold: 700; - - --wui-letter-spacing-2xl: -1.6px; - --wui-letter-spacing-medium-title: -0.96px; - --wui-letter-spacing-title-6: -0.88px; - --wui-letter-spacing-large: -0.8px; - --wui-letter-spacing-medium: -0.72px; - --wui-letter-spacing-paragraph: -0.64px; - --wui-letter-spacing-small: -0.56px; - --wui-letter-spacing-tiny: -0.48px; - --wui-letter-spacing-micro: -0.2px; - --wui-letter-spacing-mini: -0.16px; - - --wui-spacing-0: 0px; - --wui-spacing-4xs: 2px; - --wui-spacing-3xs: 4px; - --wui-spacing-xxs: 6px; - --wui-spacing-2xs: 7px; - --wui-spacing-xs: 8px; - --wui-spacing-1xs: 10px; - --wui-spacing-s: 12px; - --wui-spacing-m: 14px; - --wui-spacing-l: 16px; - --wui-spacing-2l: 18px; - --wui-spacing-xl: 20px; - --wui-spacing-xxl: 24px; - --wui-spacing-2xl: 32px; - --wui-spacing-3xl: 40px; - --wui-spacing-4xl: 90px; - --wui-spacing-5xl: 95px; - - --wui-icon-box-size-xxs: 14px; - --wui-icon-box-size-xs: 20px; - --wui-icon-box-size-sm: 24px; - --wui-icon-box-size-md: 32px; - --wui-icon-box-size-lg: 40px; - --wui-icon-box-size-2lg: 48px; - --wui-icon-box-size-xl: 64px; - - --wui-icon-size-inherit: inherit; - --wui-icon-size-xxs: 10px; - --wui-icon-size-xs: 12px; - --wui-icon-size-sm: 14px; - --wui-icon-size-md: 16px; - --wui-icon-size-mdl: 18px; - --wui-icon-size-lg: 20px; - --wui-icon-size-xl: 24px; - --wui-icon-size-xxl: 28px; - - --wui-wallet-image-size-inherit: inherit; - --wui-wallet-image-size-sm: 40px; - --wui-wallet-image-size-md: 56px; - --wui-wallet-image-size-lg: 80px; - - --wui-visual-size-size-inherit: inherit; - --wui-visual-size-sm: 40px; - --wui-visual-size-md: 55px; - --wui-visual-size-lg: 80px; - - --wui-box-size-md: 100px; - --wui-box-size-lg: 120px; - - --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); - --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); - - --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); - --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); - --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); - - --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); - - --wui-duration-lg: 200ms; - --wui-duration-md: 125ms; - --wui-duration-sm: 75ms; - - --wui-path-network-sm: path( - 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' - ); - - --wui-path-network-md: path( - 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' - ); - - --wui-path-network-lg: path( - 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' - ); - - --wui-width-network-sm: 36px; - --wui-width-network-md: 48px; - --wui-width-network-lg: 86px; - - --wui-height-network-sm: 40px; - --wui-height-network-md: 54px; - --wui-height-network-lg: 96px; - - --wui-icon-size-network-xs: 12px; - --wui-icon-size-network-sm: 16px; - --wui-icon-size-network-md: 24px; - --wui-icon-size-network-lg: 42px; - - --wui-color-inherit: inherit; - - --wui-color-inverse-100: #fff; - --wui-color-inverse-000: #000; - - --wui-cover: rgba(20, 20, 20, 0.8); - - --wui-color-modal-bg: var(--wui-color-modal-bg-base); - - --wui-color-accent-100: var(--wui-color-accent-base-100); - --wui-color-accent-090: var(--wui-color-accent-base-090); - --wui-color-accent-080: var(--wui-color-accent-base-080); - - --wui-color-success-100: var(--wui-color-success-base-100); - --wui-color-success-125: var(--wui-color-success-base-125); - - --wui-color-warning-100: var(--wui-color-warning-base-100); - - --wui-color-error-100: var(--wui-color-error-base-100); - --wui-color-error-125: var(--wui-color-error-base-125); - - --wui-color-blue-100: var(--wui-color-blue-base-100); - - --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); - --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); - --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); - --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); - - --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-100); - - --wui-avatar-border: var(--wui-avatar-border-base); - - --wui-thumbnail-border: var(--wui-thumbnail-border-base); - - --wui-box-shadow-blue: var(--wui-color-accent-glass-020); - } - - @supports (background: color-mix(in srgb, white 50%, black)) { - :root { - --wui-color-modal-bg: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-modal-bg-base) - ); - - --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 20%, transparent); - - --wui-color-accent-100: color-mix( - in srgb, - var(--wui-color-accent-base-100) 100%, - transparent - ); - --wui-color-accent-090: color-mix( - in srgb, - var(--wui-color-accent-base-100) 90%, - transparent - ); - --wui-color-accent-080: color-mix( - in srgb, - var(--wui-color-accent-base-100) 80%, - transparent - ); - --wui-color-accent-glass-090: color-mix( - in srgb, - var(--wui-color-accent-base-100) 90%, - transparent - ); - --wui-color-accent-glass-080: color-mix( - in srgb, - var(--wui-color-accent-base-100) 80%, - transparent - ); - --wui-color-accent-glass-020: color-mix( - in srgb, - var(--wui-color-accent-base-100) 20%, - transparent - ); - --wui-color-accent-glass-015: color-mix( - in srgb, - var(--wui-color-accent-base-100) 15%, - transparent - ); - --wui-color-accent-glass-010: color-mix( - in srgb, - var(--wui-color-accent-base-100) 10%, - transparent - ); - --wui-color-accent-glass-005: color-mix( - in srgb, - var(--wui-color-accent-base-100) 5%, - transparent - ); - --wui-color-accent-002: color-mix( - in srgb, - var(--wui-color-accent-base-100) 2%, - transparent - ); - - --wui-color-fg-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-100) - ); - --wui-color-fg-125: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-125) - ); - --wui-color-fg-150: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-150) - ); - --wui-color-fg-175: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-175) - ); - --wui-color-fg-200: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-200) - ); - --wui-color-fg-225: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-225) - ); - --wui-color-fg-250: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-250) - ); - --wui-color-fg-275: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-275) - ); - --wui-color-fg-300: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-300) - ); - --wui-color-fg-325: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-325) - ); - --wui-color-fg-350: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-fg-350) - ); - - --wui-color-bg-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-100) - ); - --wui-color-bg-125: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-125) - ); - --wui-color-bg-150: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-150) - ); - --wui-color-bg-175: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-175) - ); - --wui-color-bg-200: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-200) - ); - --wui-color-bg-225: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-225) - ); - --wui-color-bg-250: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-250) - ); - --wui-color-bg-275: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-275) - ); - --wui-color-bg-300: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-300) - ); - --wui-color-bg-325: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-325) - ); - --wui-color-bg-350: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-bg-350) - ); - - --wui-color-success-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-success-base-100) - ); - --wui-color-success-125: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-success-base-125) - ); - - --wui-color-warning-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-warning-base-100) - ); - - --wui-color-error-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-error-base-100) - ); - --wui-color-blue-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-blue-base-100) - ); - --wui-color-error-125: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-color-error-base-125) - ); - - --wui-icon-box-bg-error-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-icon-box-bg-error-base-100) - ); - --wui-icon-box-bg-accent-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-icon-box-bg-blue-base-100) - ); - --wui-icon-box-bg-success-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-icon-box-bg-success-base-100) - ); - --wui-icon-box-bg-inverse-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-icon-box-bg-inverse-base-100) - ); - - --wui-all-wallets-bg-100: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-all-wallets-bg-100) - ); - - --wui-avatar-border: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-avatar-border-base) - ); - - --wui-thumbnail-border: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--wui-thumbnail-border-base) - ); - } - } - `,light:Je` - :root { - --w3m-color-mix: ${ff((t==null?void 0:t["--w3m-color-mix"])||"#fff")}; - --w3m-accent: ${ff(Sg(t,"dark")["--w3m-accent"])}; - --w3m-default: #fff; - - --wui-color-modal-bg-base: ${ff(Sg(t,"dark")["--w3m-background"])}; - --wui-color-accent-base-100: var(--w3m-accent); - - --wui-color-blueberry-100: hsla(230, 100%, 67%, 1); - --wui-color-blueberry-090: hsla(231, 76%, 61%, 1); - --wui-color-blueberry-080: hsla(230, 59%, 55%, 1); - --wui-color-blueberry-050: hsla(231, 100%, 70%, 0.1); - - --wui-color-fg-100: #e4e7e7; - --wui-color-fg-125: #d0d5d5; - --wui-color-fg-150: #a8b1b1; - --wui-color-fg-175: #a8b0b0; - --wui-color-fg-200: #949e9e; - --wui-color-fg-225: #868f8f; - --wui-color-fg-250: #788080; - --wui-color-fg-275: #788181; - --wui-color-fg-300: #6e7777; - --wui-color-fg-325: #9a9a9a; - --wui-color-fg-350: #363636; - - --wui-color-bg-100: #141414; - --wui-color-bg-125: #191a1a; - --wui-color-bg-150: #1e1f1f; - --wui-color-bg-175: #222525; - --wui-color-bg-200: #272a2a; - --wui-color-bg-225: #2c3030; - --wui-color-bg-250: #313535; - --wui-color-bg-275: #363b3b; - --wui-color-bg-300: #3b4040; - --wui-color-bg-325: #252525; - --wui-color-bg-350: #ffffff; - - --wui-color-success-base-100: #26d962; - --wui-color-success-base-125: #30a46b; - - --wui-color-warning-base-100: #f3a13f; - - --wui-color-error-base-100: #f25a67; - --wui-color-error-base-125: #df4a34; - - --wui-color-blue-base-100: #667dff; - - --wui-color-success-glass-001: rgba(38, 217, 98, 0.01); - --wui-color-success-glass-002: rgba(38, 217, 98, 0.02); - --wui-color-success-glass-005: rgba(38, 217, 98, 0.05); - --wui-color-success-glass-010: rgba(38, 217, 98, 0.1); - --wui-color-success-glass-015: rgba(38, 217, 98, 0.15); - --wui-color-success-glass-020: rgba(38, 217, 98, 0.2); - --wui-color-success-glass-025: rgba(38, 217, 98, 0.25); - --wui-color-success-glass-030: rgba(38, 217, 98, 0.3); - --wui-color-success-glass-060: rgba(38, 217, 98, 0.6); - --wui-color-success-glass-080: rgba(38, 217, 98, 0.8); - - --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2); - - --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2); - - --wui-color-error-glass-001: rgba(242, 90, 103, 0.01); - --wui-color-error-glass-002: rgba(242, 90, 103, 0.02); - --wui-color-error-glass-005: rgba(242, 90, 103, 0.05); - --wui-color-error-glass-010: rgba(242, 90, 103, 0.1); - --wui-color-error-glass-015: rgba(242, 90, 103, 0.15); - --wui-color-error-glass-020: rgba(242, 90, 103, 0.2); - --wui-color-error-glass-025: rgba(242, 90, 103, 0.25); - --wui-color-error-glass-030: rgba(242, 90, 103, 0.3); - --wui-color-error-glass-060: rgba(242, 90, 103, 0.6); - --wui-color-error-glass-080: rgba(242, 90, 103, 0.8); - - --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2); - - --wui-color-gray-glass-001: rgba(255, 255, 255, 0.01); - --wui-color-gray-glass-002: rgba(255, 255, 255, 0.02); - --wui-color-gray-glass-005: rgba(255, 255, 255, 0.05); - --wui-color-gray-glass-010: rgba(255, 255, 255, 0.1); - --wui-color-gray-glass-015: rgba(255, 255, 255, 0.15); - --wui-color-gray-glass-020: rgba(255, 255, 255, 0.2); - --wui-color-gray-glass-025: rgba(255, 255, 255, 0.25); - --wui-color-gray-glass-030: rgba(255, 255, 255, 0.3); - --wui-color-gray-glass-060: rgba(255, 255, 255, 0.6); - --wui-color-gray-glass-080: rgba(255, 255, 255, 0.8); - --wui-color-gray-glass-090: rgba(255, 255, 255, 0.9); - - --wui-color-dark-glass-100: rgba(42, 42, 42, 1); - - --wui-icon-box-bg-error-base-100: #3c2426; - --wui-icon-box-bg-blue-base-100: #20303f; - --wui-icon-box-bg-success-base-100: #1f3a28; - --wui-icon-box-bg-inverse-base-100: #243240; - - --wui-all-wallets-bg-100: #222b35; - - --wui-avatar-border-base: #252525; - - --wui-thumbnail-border-base: #252525; - } - `,dark:Je` - :root { - --w3m-color-mix: ${ff((t==null?void 0:t["--w3m-color-mix"])||"#000")}; - --w3m-accent: ${ff(Sg(t,"light")["--w3m-accent"])}; - --w3m-default: #000; - - --wui-color-modal-bg-base: ${ff(Sg(t,"light")["--w3m-background"])}; - --wui-color-accent-base-100: var(--w3m-accent); - - --wui-color-blueberry-100: hsla(231, 100%, 70%, 1); - --wui-color-blueberry-090: hsla(231, 97%, 72%, 1); - --wui-color-blueberry-080: hsla(231, 92%, 74%, 1); - - --wui-color-fg-100: #141414; - --wui-color-fg-125: #2d3131; - --wui-color-fg-150: #474d4d; - --wui-color-fg-175: #636d6d; - --wui-color-fg-200: #798686; - --wui-color-fg-225: #828f8f; - --wui-color-fg-250: #8b9797; - --wui-color-fg-275: #95a0a0; - --wui-color-fg-300: #9ea9a9; - --wui-color-fg-325: #9a9a9a; - --wui-color-fg-350: #d0d0d0; - - --wui-color-bg-100: #ffffff; - --wui-color-bg-125: #f5fafa; - --wui-color-bg-150: #f3f8f8; - --wui-color-bg-175: #eef4f4; - --wui-color-bg-200: #eaf1f1; - --wui-color-bg-225: #e5eded; - --wui-color-bg-250: #e1e9e9; - --wui-color-bg-275: #dce7e7; - --wui-color-bg-300: #d8e3e3; - --wui-color-bg-325: #f3f3f3; - --wui-color-bg-350: #202020; - - --wui-color-success-base-100: #26b562; - --wui-color-success-base-125: #30a46b; - - --wui-color-warning-base-100: #f3a13f; - - --wui-color-error-base-100: #f05142; - --wui-color-error-base-125: #df4a34; - - --wui-color-blue-base-100: #667dff; - - --wui-color-success-glass-001: rgba(38, 181, 98, 0.01); - --wui-color-success-glass-002: rgba(38, 181, 98, 0.02); - --wui-color-success-glass-005: rgba(38, 181, 98, 0.05); - --wui-color-success-glass-010: rgba(38, 181, 98, 0.1); - --wui-color-success-glass-015: rgba(38, 181, 98, 0.15); - --wui-color-success-glass-020: rgba(38, 181, 98, 0.2); - --wui-color-success-glass-025: rgba(38, 181, 98, 0.25); - --wui-color-success-glass-030: rgba(38, 181, 98, 0.3); - --wui-color-success-glass-060: rgba(38, 181, 98, 0.6); - --wui-color-success-glass-080: rgba(38, 181, 98, 0.8); - - --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2); - - --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2); - - --wui-color-error-glass-001: rgba(240, 81, 66, 0.01); - --wui-color-error-glass-002: rgba(240, 81, 66, 0.02); - --wui-color-error-glass-005: rgba(240, 81, 66, 0.05); - --wui-color-error-glass-010: rgba(240, 81, 66, 0.1); - --wui-color-error-glass-015: rgba(240, 81, 66, 0.15); - --wui-color-error-glass-020: rgba(240, 81, 66, 0.2); - --wui-color-error-glass-025: rgba(240, 81, 66, 0.25); - --wui-color-error-glass-030: rgba(240, 81, 66, 0.3); - --wui-color-error-glass-060: rgba(240, 81, 66, 0.6); - --wui-color-error-glass-080: rgba(240, 81, 66, 0.8); - - --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2); - - --wui-icon-box-bg-error-base-100: #f4dfdd; - --wui-icon-box-bg-blue-base-100: #d9ecfb; - --wui-icon-box-bg-success-base-100: #daf0e4; - --wui-icon-box-bg-inverse-base-100: #dcecfc; - - --wui-all-wallets-bg-100: #e8f1fa; - - --wui-avatar-border-base: #f3f4f4; - - --wui-thumbnail-border-base: #eaefef; - - --wui-color-gray-glass-001: rgba(0, 0, 0, 0.01); - --wui-color-gray-glass-002: rgba(0, 0, 0, 0.02); - --wui-color-gray-glass-005: rgba(0, 0, 0, 0.05); - --wui-color-gray-glass-010: rgba(0, 0, 0, 0.1); - --wui-color-gray-glass-015: rgba(0, 0, 0, 0.15); - --wui-color-gray-glass-020: rgba(0, 0, 0, 0.2); - --wui-color-gray-glass-025: rgba(0, 0, 0, 0.25); - --wui-color-gray-glass-030: rgba(0, 0, 0, 0.3); - --wui-color-gray-glass-060: rgba(0, 0, 0, 0.6); - --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8); - --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9); - - --wui-color-dark-glass-100: rgba(233, 233, 233, 1); - } - `}}const Wt=Je` - *, - *::after, - *::before, - :host { - margin: 0; - padding: 0; - box-sizing: border-box; - font-style: normal; - text-rendering: optimizeSpeed; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-tap-highlight-color: transparent; - font-family: var(--wui-font-family); - backface-visibility: hidden; - } -`,hn=Je` - button, - a { - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; - position: relative; - transition: - color var(--wui-duration-lg) var(--wui-ease-out-power-1), - background-color var(--wui-duration-lg) var(--wui-ease-out-power-1), - border var(--wui-duration-lg) var(--wui-ease-out-power-1), - box-shadow var(--wui-duration-lg) var(--wui-ease-out-power-1); - will-change: background-color, color, border, box-shadow; - outline: none; - border: none; - column-gap: var(--wui-spacing-3xs); - background-color: transparent; - text-decoration: none; - } - - button:disabled > wui-wallet-image, - button:disabled > wui-all-wallets-image, - button:disabled > wui-network-image, - button:disabled > wui-image, - button:disabled > wui-transaction-visual, - button:disabled > wui-logo { - filter: grayscale(1); - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled { - background-color: var(--wui-color-gray-glass-005); - } - - button:active:enabled { - background-color: var(--wui-color-gray-glass-010); - } - } - - button:disabled > wui-icon-box { - opacity: 0.5; - } - - input { - border: none; - outline: none; - appearance: none; - } -`,OL=Je` - .wui-color-inherit { - color: var(--wui-color-inherit); - } - - .wui-color-accent-100 { - color: var(--wui-color-accent-100); - } - - .wui-color-error-100 { - color: var(--wui-color-error-100); - } - - .wui-color-blue-100 { - color: var(--wui-color-blue-100); - } - - .wui-color-error-125 { - color: var(--wui-color-error-125); - } - - .wui-color-success-100 { - color: var(--wui-color-success-100); - } - - .wui-color-success-125 { - color: var(--wui-color-success-125); - } - - .wui-color-inverse-100 { - color: var(--wui-color-inverse-100); - } - - .wui-color-inverse-000 { - color: var(--wui-color-inverse-000); - } - - .wui-color-fg-100 { - color: var(--wui-color-fg-100); - } - - .wui-color-fg-200 { - color: var(--wui-color-fg-200); - } - - .wui-color-fg-300 { - color: var(--wui-color-fg-300); - } - - .wui-color-fg-325 { - color: var(--wui-color-fg-325); - } - - .wui-color-fg-350 { - color: var(--wui-color-fg-350); - } - - .wui-bg-color-inherit { - background-color: var(--wui-color-inherit); - } - - .wui-bg-color-blue-100 { - background-color: var(--wui-color-accent-100); - } - - .wui-bg-color-error-100 { - background-color: var(--wui-color-error-100); - } - - .wui-bg-color-error-125 { - background-color: var(--wui-color-error-125); - } - - .wui-bg-color-success-100 { - background-color: var(--wui-color-success-100); - } - - .wui-bg-color-success-125 { - background-color: var(--wui-color-success-100); - } - - .wui-bg-color-inverse-100 { - background-color: var(--wui-color-inverse-100); - } - - .wui-bg-color-inverse-000 { - background-color: var(--wui-color-inverse-000); - } - - .wui-bg-color-fg-100 { - background-color: var(--wui-color-fg-100); - } - - .wui-bg-color-fg-200 { - background-color: var(--wui-color-fg-200); - } - - .wui-bg-color-fg-300 { - background-color: var(--wui-color-fg-300); - } - - .wui-color-fg-325 { - background-color: var(--wui-color-fg-325); - } - - .wui-color-fg-350 { - background-color: var(--wui-color-fg-350); - } -`;function Rpt(t,e){const{kind:r,elements:n}=e;return{kind:r,elements:n,finisher(i){customElements.get(t)||customElements.define(t,i)}}}function Mpt(t,e){return customElements.get(t)||customElements.define(t,e),e}function Fe(t){return function(r){return typeof r=="function"?Mpt(t,r):Rpt(t,r)}}const Dpt=Je` - :host { - display: block; - border-radius: clamp(0px, var(--wui-border-radius-l), 44px); - box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005); - background-color: var(--wui-color-modal-bg); - overflow: hidden; - } -`;var Npt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Cq=class extends He{render(){return X``}};Cq.styles=[Wt,Dpt];Cq=Npt([Fe("wui-card")],Cq);/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const Opt={attribute:!0,type:String,converter:$D,reflect:!1,hasChanged:rJ},Lpt=(t=Opt,e,r)=>{const{kind:n,metadata:i}=r;let a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(r.name,t),n==="accessor"){const{name:o}=r;return{set(s){const l=e.get.call(this);e.set.call(this,s),this.requestUpdate(o,l,t)},init(s){return s!==void 0&&this.P(o,void 0,t),s}}}if(n==="setter"){const{name:o}=r;return function(s){const l=this[o];e.call(this,s),this.requestUpdate(o,l,t)}}throw Error("Unsupported decorator location: "+n)};function ce(t){return(e,r)=>typeof r=="object"?Lpt(t,e,r):((n,i,a)=>{const o=i.hasOwnProperty(a);return i.constructor.createProperty(a,o?{...n,wrapped:!0}:n),o?Object.getOwnPropertyDescriptor(i,a):void 0})(t,e,r)}/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */function xe(t){return ce({...t,state:!0,attribute:!1})}const $pt=Je` - :host { - display: flex; - aspect-ratio: 1 / 1; - color: var(--local-color); - width: var(--local-width); - } - - svg { - width: inherit; - height: inherit; - object-fit: contain; - object-position: center; - } -`,Bpt=mt` - `,Fpt=mt` - -`,jpt=mt` - `,Upt=mt` - - - - - - - - - -`,zpt=mt` - - - - - - - - - - - - - -`,Hpt=mt` - -`,Vpt=mt` - -`,Gpt=mt` - -`,Wpt=mt` - -`,qpt=mt` - `,Ypt=mt` - - -`,Kpt=mt` - `,Zpt=mt` - -`,Qpt=mt` - - -`,Xpt=mt` - -`,Jpt=mt` - -`,e0t=mt` - -`,t0t=mt` - -`,r0t=mt` - - - - - - - - - - - - - - - - - - - - - -`,n0t=mt` - -`,i0t=mt` - -`,a0t=mt` - -`,o0t=mt` - -`,s0t=mt` - `,l0t=mt` - -`,c0t=mt` - - - - `,u0t=mt` - - -`,f0t=mt` - -`,d0t=mt` - - - - - - - - - - -`,h0t=mt` - -`,p0t=mt` - -`,g0t=mt` - -`,v0t=mt` - - - - - - - - - - - - - - - -`,m0t=mt` - - - - -`,y0t=mt` - -`,w0t=mt` - - - - - - - - - - - - - -`,b0t=mt` - - - - -`,x0t=mt` - - -`,_0t=mt` - - -`,S0t=mt` - - -`,C0t=mt` - -`,A0t=mt` - - -`,T0t=mt` - - -`,E0t=mt` - - -`,I0t=mt` - -`,k0t=mt` - -`,P0t=mt` - - - - - - -`,R0t=mt` - `,M0t=mt` - -`,D0t=mt` - `,N0t=mt` - -`,O0t=mt` - -`,L0t=mt` - - `,$0t=mt` - -`,B0t=mt` - -`,F0t=mt` - - - -`,j0t=mt` - -`,U0t=mt` - -`,z0t=mt` - - - - - - - - - - - - - - -`,H0t=mt` - - - -`,V0t=mt` - - - - - - - - - - - - - -`,G0t=mt` - -`,W0t=mt` - -`,q0t=mt` - -`,Y0t=mt` - - - - -`,K0t=mt` - -`,Z0t=mt` - - -`,Q0t=mt` - - - - - - - - - - - -`,X0t=mt` - - -`,J0t=mt` - -`,egt=mt` - -`,Fce=mt` - - - - - - - -`,tgt=mt` - -`,rgt=mt` - - -`;var LL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const ngt={add:Bpt,allWallets:Fpt,arrowBottomCircle:jpt,appStore:Upt,apple:zpt,arrowBottom:Hpt,arrowLeft:Vpt,arrowRight:Gpt,arrowTop:Wpt,bank:qpt,browser:Ypt,card:Kpt,checkmark:Qpt,checkmarkBold:Zpt,chevronBottom:Xpt,chevronLeft:Jpt,chevronRight:e0t,chevronTop:t0t,chromeStore:r0t,clock:n0t,close:i0t,compass:o0t,coinPlaceholder:a0t,copy:s0t,cursor:l0t,cursorTransparent:c0t,desktop:u0t,disconnect:f0t,discord:d0t,etherscan:h0t,extension:p0t,externalLink:g0t,facebook:v0t,farcaster:m0t,filters:y0t,github:w0t,google:b0t,helpCircle:x0t,image:_0t,id:egt,infoCircle:S0t,lightbulb:J0t,mail:C0t,mobile:A0t,more:T0t,networkPlaceholder:E0t,nftPlaceholder:I0t,off:k0t,playStore:P0t,plus:R0t,qrCode:M0t,recycleHorizontal:D0t,refresh:N0t,search:O0t,send:L0t,swapHorizontal:$0t,swapHorizontalMedium:F0t,swapHorizontalBold:B0t,swapHorizontalRoundedBold:j0t,swapVertical:U0t,telegram:z0t,threeDots:H0t,twitch:V0t,twitter:Fce,twitterIcon:G0t,verify:W0t,verifyFilled:q0t,wallet:K0t,walletConnect:Z0t,walletConnectLightBrown:Q0t,walletPlaceholder:Y0t,warningCircle:X0t,x:Fce,info:tgt,exclamationTriangle:rgt};let e5=class extends He{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` - --local-color: ${`var(--wui-color-${this.color});`} - --local-width: ${`var(--wui-icon-size-${this.size});`} - `,X`${ngt[this.name]}`}};e5.styles=[Wt,OL,$pt];LL([ce()],e5.prototype,"size",void 0);LL([ce()],e5.prototype,"name",void 0);LL([ce()],e5.prototype,"color",void 0);e5=LL([Fe("wui-icon")],e5);const igt=Je` - :host { - display: block; - width: var(--local-width); - height: var(--local-height); - } - - img { - display: block; - width: 100%; - height: 100%; - object-fit: cover; - object-position: center center; - border-radius: inherit; - } -`;var $L=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let t5=class extends He{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` - --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; - --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; - `,X`${this.alt}`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};t5.styles=[Wt,OL,igt];$L([ce()],t5.prototype,"src",void 0);$L([ce()],t5.prototype,"alt",void 0);$L([ce()],t5.prototype,"size",void 0);t5=$L([Fe("wui-image")],t5);const agt=Je` - :host { - display: block; - width: var(--wui-box-size-lg); - height: var(--wui-box-size-lg); - } - - svg { - width: var(--wui-box-size-lg); - height: var(--wui-box-size-lg); - fill: none; - stroke: transparent; - stroke-linecap: round; - } - - use { - stroke: var(--wui-color-accent-100); - stroke-width: 2px; - stroke-dasharray: 54, 118; - stroke-dashoffset: 172; - animation: dash 1s linear infinite; - } - - @keyframes dash { - to { - stroke-dashoffset: 0px; - } - } -`;var ogt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Aq=class extends He{render(){return X` - - - - - `}};Aq.styles=[Wt,agt];Aq=ogt([Fe("wui-loading-hexagon")],Aq);const sgt=Je` - :host { - display: flex; - } - - :host([data-size='sm']) > svg { - width: 12px; - height: 12px; - } - - :host([data-size='md']) > svg { - width: 16px; - height: 16px; - } - - :host([data-size='lg']) > svg { - width: 24px; - height: 24px; - } - - :host([data-size='xl']) > svg { - width: 32px; - height: 32px; - } - - svg { - animation: rotate 2s linear infinite; - } - - circle { - fill: none; - stroke: var(--local-color); - stroke-width: 4px; - stroke-dasharray: 1, 124; - stroke-dashoffset: 0; - stroke-linecap: round; - animation: dash 1.5s ease-in-out infinite; - } - - :host([data-size='md']) > svg > circle { - stroke-width: 6px; - } - - :host([data-size='sm']) > svg > circle { - stroke-width: 8px; - } - - @keyframes rotate { - 100% { - transform: rotate(360deg); - } - } - - @keyframes dash { - 0% { - stroke-dasharray: 1, 124; - stroke-dashoffset: 0; - } - - 50% { - stroke-dasharray: 90, 124; - stroke-dashoffset: -35; - } - - 100% { - stroke-dashoffset: -125; - } - } -`;var aJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let fT=class extends He{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,X` - - `}};fT.styles=[Wt,sgt];aJ([ce()],fT.prototype,"color",void 0);aJ([ce()],fT.prototype,"size",void 0);fT=aJ([Fe("wui-loading-spinner")],fT);const lgt=Je` - :host { - display: block; - width: var(--wui-box-size-md); - height: var(--wui-box-size-md); - } - - svg { - width: var(--wui-box-size-md); - height: var(--wui-box-size-md); - } - - rect { - fill: none; - stroke: var(--wui-color-accent-100); - stroke-width: 4px; - stroke-linecap: round; - animation: dash 1s linear infinite; - } - - @keyframes dash { - to { - stroke-dashoffset: 0px; - } - } -`;var cCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let FD=class extends He{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,n=36-e,i=116+n,a=245+n,o=360+n*1.75;return X` - - - - `}};FD.styles=[Wt,lgt];cCe([ce({type:Number})],FD.prototype,"radius",void 0);FD=cCe([Fe("wui-loading-thumbnail")],FD);const cgt=Je` - :host { - display: block; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - background: linear-gradient( - 120deg, - var(--wui-color-bg-200) 5%, - var(--wui-color-bg-200) 48%, - var(--wui-color-bg-300) 55%, - var(--wui-color-bg-300) 60%, - var(--wui-color-bg-300) calc(60% + 10px), - var(--wui-color-bg-200) calc(60% + 12px), - var(--wui-color-bg-200) 100% - ); - background-size: 250%; - animation: shimmer 3s linear infinite reverse; - } - - :host([variant='light']) { - background: linear-gradient( - 120deg, - var(--wui-color-bg-150) 5%, - var(--wui-color-bg-150) 48%, - var(--wui-color-bg-200) 55%, - var(--wui-color-bg-200) 60%, - var(--wui-color-bg-200) calc(60% + 10px), - var(--wui-color-bg-150) calc(60% + 12px), - var(--wui-color-bg-150) 100% - ); - background-size: 250%; - } - - @keyframes shimmer { - from { - background-position: -250% 0; - } - to { - background-position: 250% 0; - } - } -`;var s8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Bb=class extends He{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=` - width: ${this.width}; - height: ${this.height}; - border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; - `,X``}};Bb.styles=[cgt];s8([ce()],Bb.prototype,"width",void 0);s8([ce()],Bb.prototype,"height",void 0);s8([ce()],Bb.prototype,"borderRadius",void 0);s8([ce()],Bb.prototype,"variant",void 0);Bb=s8([Fe("wui-shimmer")],Bb);/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const uCe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},fCe=t=>(...e)=>({_$litDirective$:t,values:e});let dCe=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this.t=e,this._$AM=r,this.i=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/** - * @license - * Copyright 2018 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const hCe=fCe(class extends dCe{constructor(t){var e;if(super(t),t.type!==uCe.ATTRIBUTE||t.name!=="class"||((e=t.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var n,i;if(this.st===void 0){this.st=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in e)e[a]&&!((n=this.nt)!=null&&n.has(a))&&this.st.add(a);return this.render(e)}const r=t.element.classList;for(const a of this.st)a in e||(r.remove(a),this.st.delete(a));for(const a in e){const o=!!e[a];o===this.st.has(a)||(i=this.nt)!=null&&i.has(a)||(o?(r.add(a),this.st.add(a)):(r.remove(a),this.st.delete(a)))}return $b}}),ugt=Je` - :host { - display: inline-flex !important; - } - - slot { - width: 100%; - display: inline-block; - font-style: normal; - font-family: var(--wui-font-family); - font-feature-settings: - 'tnum' on, - 'lnum' on, - 'case' on; - line-height: 130%; - font-weight: var(--wui-font-weight-regular); - overflow: inherit; - text-overflow: inherit; - text-align: var(--local-align); - color: var(--local-color); - } - - .wui-line-clamp-1 { - overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 1; - } - - .wui-line-clamp-2 { - overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - } - - .wui-font-medium-400 { - font-size: var(--wui-font-size-medium); - font-weight: var(--wui-font-weight-light); - letter-spacing: var(--wui-letter-spacing-medium); - } - - .wui-font-medium-600 { - font-size: var(--wui-font-size-medium); - letter-spacing: var(--wui-letter-spacing-medium); - } - - .wui-font-title-600 { - font-size: var(--wui-font-size-title); - letter-spacing: var(--wui-letter-spacing-title); - } - - .wui-font-title-6-600 { - font-size: var(--wui-font-size-title-6); - letter-spacing: var(--wui-letter-spacing-title-6); - } - - .wui-font-mini-700 { - font-size: var(--wui-font-size-mini); - letter-spacing: var(--wui-letter-spacing-mini); - text-transform: uppercase; - } - - .wui-font-large-500, - .wui-font-large-600, - .wui-font-large-700 { - font-size: var(--wui-font-size-large); - letter-spacing: var(--wui-letter-spacing-large); - } - - .wui-font-2xl-500, - .wui-font-2xl-600, - .wui-font-2xl-700 { - font-size: var(--wui-font-size-2xl); - letter-spacing: var(--wui-letter-spacing-2xl); - } - - .wui-font-paragraph-400, - .wui-font-paragraph-500, - .wui-font-paragraph-600, - .wui-font-paragraph-700 { - font-size: var(--wui-font-size-paragraph); - letter-spacing: var(--wui-letter-spacing-paragraph); - } - - .wui-font-small-400, - .wui-font-small-500, - .wui-font-small-600 { - font-size: var(--wui-font-size-small); - letter-spacing: var(--wui-letter-spacing-small); - } - - .wui-font-tiny-400, - .wui-font-tiny-500, - .wui-font-tiny-600 { - font-size: var(--wui-font-size-tiny); - letter-spacing: var(--wui-letter-spacing-tiny); - } - - .wui-font-micro-700, - .wui-font-micro-600 { - font-size: var(--wui-font-size-micro); - letter-spacing: var(--wui-letter-spacing-micro); - text-transform: uppercase; - } - - .wui-font-tiny-400, - .wui-font-small-400, - .wui-font-medium-400, - .wui-font-paragraph-400 { - font-weight: var(--wui-font-weight-light); - } - - .wui-font-large-700, - .wui-font-paragraph-700, - .wui-font-micro-700, - .wui-font-mini-700 { - font-weight: var(--wui-font-weight-bold); - } - - .wui-font-medium-600, - .wui-font-medium-title-600, - .wui-font-title-6-600, - .wui-font-large-600, - .wui-font-paragraph-600, - .wui-font-small-600, - .wui-font-tiny-600, - .wui-font-micro-600 { - font-weight: var(--wui-font-weight-medium); - } - - :host([disabled]) { - opacity: 0.4; - } -`;var l8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Fb=class extends He{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=` - --local-align: ${this.align}; - --local-color: var(--wui-color-${this.color}); - `,X``}};Fb.styles=[Wt,ugt];l8([ce()],Fb.prototype,"variant",void 0);l8([ce()],Fb.prototype,"color",void 0);l8([ce()],Fb.prototype,"align",void 0);l8([ce()],Fb.prototype,"lineClamp",void 0);Fb=l8([Fe("wui-text")],Fb);const fgt=mt` - - - - - - - - `,dgt=mt` - - - - - - - - - - - - - - - - `,hgt=mt` - - - - - - - - - - - - -`,pgt=mt` - - - - - - - - - - - - - `,ggt=mt` - - - - - - - - - - - - - - - `,vgt=mt` - - - - - -`,mgt=mt` - - - - - -`,ygt=mt` - - - - - - - - - - `,wgt=mt` - - - - - - - - - - - - - - - -`,bgt=mt` - - - - - - - - - - `,xgt=mt` - - - - - - - - -`,_gt=mt` - - - - - - - - - - - - - - - `,Sgt=mt` - - - - - - - - - - - - - - `,Cgt=mt` - - - - - - - - - -`,Agt=mt` - - - - - - - - - - -`,Tgt=mt` - - - - - - - - - - -`,Egt=mt` - - - - - - - - - - - - -`,Igt=mt` - - - - - - - - - - - - -`,kgt=mt` - - - - - - - - - -`,Pgt=mt` - - - - - - - - - - - - - - - - - - -`,Rgt=mt` - - - - - - - - - - - - - - - - -`,Mgt=mt` - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,Dgt=Je` - :host { - display: block; - width: var(--local-size); - height: var(--local-size); - } - - :host svg { - width: 100%; - height: 100%; - } -`,Ngt=mt` - - - - - - - - - - - - - - - - - `;var oJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const Ogt={browser:fgt,dao:dgt,defi:hgt,defiAlt:pgt,eth:ggt,layers:vgt,lock:mgt,login:ygt,network:wgt,nft:bgt,noun:xgt,profile:_gt,system:Sgt,coinbase:Cgt,meld:Mgt,onrampCard:Igt,moonpay:Agt,stripe:Tgt,paypal:Egt,google:kgt,pencil:Pgt,lightbulb:Rgt,solana:Ngt};let dT=class extends He{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` - --local-size: var(--wui-visual-size-${this.size}); - `,X`${Ogt[this.name]}`}};dT.styles=[Wt,Dgt];oJ([ce()],dT.prototype,"name",void 0);oJ([ce()],dT.prototype,"size",void 0);dT=oJ([Fe("wui-visual")],dT);/** - * @license - * Copyright 2018 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const Ut=t=>t??vo,Tr={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:r,truncate:n}){return t.length<=e+r?t:n==="end"?`${t.substring(0,e)}...`:n==="start"?`...${t.substring(t.length-r)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`},generateAvatarColors(t){const r=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),n=this.hexToRgb(r),i=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),o=100-3*Number(i==null?void 0:i.replace("px","")),s=`${o}% ${o}% at 65% 40%`,l=[];for(let c=0;c<5;c+=1){const u=this.tintColor(n,.15*c);l.push(`rgb(${u[0]}, ${u[1]}, ${u[2]})`)}return` - --local-color-1: ${l[0]}; - --local-color-2: ${l[1]}; - --local-color-3: ${l[2]}; - --local-color-4: ${l[3]}; - --local-color-5: ${l[4]}; - --local-radial-circle: ${s} - `},hexToRgb(t){const e=parseInt(t,16),r=e>>16&255,n=e>>8&255,i=e&255;return[r,n,i]},tintColor(t,e){const[r,n,i]=t,a=Math.round(r+(255-r)*e),o=Math.round(n+(255-n)*e),s=Math.round(i+(255-i)*e);return[a,o,s]},isNumber(t){return{number:/^[0-9]+$/u}.number.test(t)},getColorTheme(t){return t||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(t){const e=t.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(t,e,r){return t.toString().length>=e?Number(t).toFixed(r):t},formatNumberToLocalString(t,e=2){return t===void 0?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},Lgt=Je` - :host { - display: flex; - width: inherit; - height: inherit; - } -`;var Iu=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Gl=class extends He{render(){return this.style.cssText=` - flex-direction: ${this.flexDirection}; - flex-wrap: ${this.flexWrap}; - flex-basis: ${this.flexBasis}; - flex-grow: ${this.flexGrow}; - flex-shrink: ${this.flexShrink}; - align-items: ${this.alignItems}; - justify-content: ${this.justifyContent}; - column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; - row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; - gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; - padding-top: ${this.padding&&Tr.getSpacingStyles(this.padding,0)}; - padding-right: ${this.padding&&Tr.getSpacingStyles(this.padding,1)}; - padding-bottom: ${this.padding&&Tr.getSpacingStyles(this.padding,2)}; - padding-left: ${this.padding&&Tr.getSpacingStyles(this.padding,3)}; - margin-top: ${this.margin&&Tr.getSpacingStyles(this.margin,0)}; - margin-right: ${this.margin&&Tr.getSpacingStyles(this.margin,1)}; - margin-bottom: ${this.margin&&Tr.getSpacingStyles(this.margin,2)}; - margin-left: ${this.margin&&Tr.getSpacingStyles(this.margin,3)}; - `,X``}};Gl.styles=[Wt,Lgt];Iu([ce()],Gl.prototype,"flexDirection",void 0);Iu([ce()],Gl.prototype,"flexWrap",void 0);Iu([ce()],Gl.prototype,"flexBasis",void 0);Iu([ce()],Gl.prototype,"flexGrow",void 0);Iu([ce()],Gl.prototype,"flexShrink",void 0);Iu([ce()],Gl.prototype,"alignItems",void 0);Iu([ce()],Gl.prototype,"justifyContent",void 0);Iu([ce()],Gl.prototype,"columnGap",void 0);Iu([ce()],Gl.prototype,"rowGap",void 0);Iu([ce()],Gl.prototype,"gap",void 0);Iu([ce()],Gl.prototype,"padding",void 0);Iu([ce()],Gl.prototype,"margin",void 0);Gl=Iu([Fe("wui-flex")],Gl);const $gt=Je` - :host { - display: block; - width: var(--local-width); - height: var(--local-height); - border-radius: var(--wui-border-radius-3xl); - box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); - overflow: hidden; - position: relative; - } - - :host([data-variant='generated']) { - --mixed-local-color-1: var(--local-color-1); - --mixed-local-color-2: var(--local-color-2); - --mixed-local-color-3: var(--local-color-3); - --mixed-local-color-4: var(--local-color-4); - --mixed-local-color-5: var(--local-color-5); - } - - @supports (background: color-mix(in srgb, white 50%, black)) { - :host([data-variant='generated']) { - --mixed-local-color-1: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--local-color-1) - ); - --mixed-local-color-2: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--local-color-2) - ); - --mixed-local-color-3: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--local-color-3) - ); - --mixed-local-color-4: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--local-color-4) - ); - --mixed-local-color-5: color-mix( - in srgb, - var(--w3m-color-mix) var(--w3m-color-mix-strength), - var(--local-color-5) - ); - } - } - - :host([data-variant='generated']) { - box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); - background: radial-gradient( - var(--local-radial-circle), - #fff 0.52%, - var(--mixed-local-color-5) 31.25%, - var(--mixed-local-color-3) 51.56%, - var(--mixed-local-color-2) 65.63%, - var(--mixed-local-color-1) 82.29%, - var(--mixed-local-color-4) 100% - ); - } - - :host([data-variant='default']) { - box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005); - background: radial-gradient( - 75.29% 75.29% at 64.96% 24.36%, - #fff 0.52%, - #f5ccfc 31.25%, - #dba4f5 51.56%, - #9a8ee8 65.63%, - #6493da 82.29%, - #6ebdea 100% - ); - } -`;var c8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let jb=class extends He{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=` - --local-width: var(--wui-icon-box-size-${this.size}); - --local-height: var(--wui-icon-box-size-${this.size}); - `,X`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",X``;if(this.address){this.dataset.variant="generated";const e=Tr.generateAvatarColors(this.address);return this.style.cssText+=` - ${e}`,null}return this.dataset.variant="default",null}};jb.styles=[Wt,$gt];c8([ce()],jb.prototype,"imageSrc",void 0);c8([ce()],jb.prototype,"alt",void 0);c8([ce()],jb.prototype,"address",void 0);c8([ce()],jb.prototype,"size",void 0);jb=c8([Fe("wui-avatar")],jb);const Bgt=Je` - :host { - display: inline-flex; - justify-content: center; - align-items: center; - position: relative; - overflow: hidden; - background-color: var(--wui-color-gray-glass-020); - border-radius: var(--local-border-radius); - border: var(--local-border); - box-sizing: content-box; - width: var(--local-size); - height: var(--local-size); - min-height: var(--local-size); - min-width: var(--local-size); - } - - @supports (background: color-mix(in srgb, white 50%, black)) { - :host { - background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); - } - } -`;var yv=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let hh=class extends He{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,r=this.size==="lg",n=this.size==="xl",i=r?"12%":"16%",a=r?"xxs":n?"s":"3xl",o=this.background==="gray",s=this.background==="opaque",l=this.backgroundColor==="accent-100"&&s||this.backgroundColor==="success-100"&&s||this.backgroundColor==="error-100"&&s||this.backgroundColor==="inverse-100"&&s;let c=`var(--wui-color-${this.backgroundColor})`;return l?c=`var(--wui-icon-box-bg-${this.backgroundColor})`:o&&(c=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=` - --local-bg-value: ${c}; - --local-bg-mix: ${l||o?"100%":i}; - --local-border-radius: var(--wui-border-radius-${a}); - --local-size: var(--wui-icon-box-size-${this.size}); - --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} - `,X` `}};hh.styles=[Wt,hn,Bgt];yv([ce()],hh.prototype,"size",void 0);yv([ce()],hh.prototype,"backgroundColor",void 0);yv([ce()],hh.prototype,"iconColor",void 0);yv([ce()],hh.prototype,"iconSize",void 0);yv([ce()],hh.prototype,"background",void 0);yv([ce({type:Boolean})],hh.prototype,"border",void 0);yv([ce()],hh.prototype,"borderColor",void 0);yv([ce()],hh.prototype,"icon",void 0);hh=yv([Fe("wui-icon-box")],hh);const Fgt=Je` - :host { - display: block; - } - - button { - border-radius: var(--wui-border-radius-3xl); - background: var(--wui-color-gray-glass-002); - display: flex; - gap: var(--wui-spacing-xs); - padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) - var(--wui-spacing-xs); - border: 1px solid var(--wui-color-gray-glass-005); - } - - button:disabled { - background: var(--wui-color-gray-glass-015); - } - - button:disabled > wui-text { - color: var(--wui-color-gray-glass-015); - } - - button:disabled > wui-flex > wui-text { - color: var(--wui-color-gray-glass-015); - } - - button:disabled > wui-image, - button:disabled > wui-flex > wui-avatar { - filter: grayscale(1); - } - - button:has(wui-image) { - padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) - var(--wui-spacing-xs); - } - - wui-text { - color: var(--wui-color-fg-100); - } - - wui-flex > wui-text { - color: var(--wui-color-fg-200); - } - - wui-image, - wui-icon-box { - border-radius: var(--wui-border-radius-3xl); - width: 24px; - height: 24px; - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - } - - wui-flex { - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-005); - background: var(--wui-color-gray-glass-005); - padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); - } - - button.local-no-balance { - border-radius: 0px; - border: none; - background: transparent; - } - - wui-avatar { - width: 20px; - height: 20px; - box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010); - } - - @media (max-width: 500px) { - button { - gap: 0px; - padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; - height: 32px; - } - wui-image, - wui-icon-box, - button > wui-text { - visibility: hidden; - width: 0px; - height: 0px; - } - button { - border-radius: 0px; - border: none; - background: transparent; - padding: 0px; - } - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled > wui-flex > wui-text { - color: var(--wui-color-fg-175); - } - - button:active:enabled > wui-flex > wui-text { - color: var(--wui-color-fg-175); - } - } -`;var v0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Hf=class extends He{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return X` - - `}balanceTemplate(){if(this.isUnsupportedChain)return X` - Switch Network`;if(this.balance){const e=this.networkSrc?X``:X` - - `;return X` - ${e} - ${this.balance} - `}return null}};Hf.styles=[Wt,hn,Fgt];v0([ce()],Hf.prototype,"networkSrc",void 0);v0([ce()],Hf.prototype,"avatarSrc",void 0);v0([ce()],Hf.prototype,"balance",void 0);v0([ce({type:Boolean})],Hf.prototype,"isUnsupportedChain",void 0);v0([ce({type:Boolean})],Hf.prototype,"disabled",void 0);v0([ce()],Hf.prototype,"address",void 0);v0([ce()],Hf.prototype,"profileName",void 0);v0([ce()],Hf.prototype,"charsStart",void 0);v0([ce()],Hf.prototype,"charsEnd",void 0);Hf=v0([Fe("wui-account-button")],Hf);const jgt=Je` - :host { - position: relative; - background-color: var(--wui-color-gray-glass-002); - display: flex; - justify-content: center; - align-items: center; - width: var(--local-size); - height: var(--local-size); - border-radius: inherit; - border-radius: var(--local-border-radius); - } - - :host > wui-flex { - overflow: hidden; - border-radius: inherit; - border-radius: var(--local-border-radius); - } - - :host::after { - content: ''; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - border-radius: inherit; - border: 1px solid var(--wui-color-gray-glass-010); - pointer-events: none; - } - - :host([name='Extension'])::after { - border: 1px solid var(--wui-color-accent-glass-010); - } - - :host([data-wallet-icon='allWallets']) { - background-color: var(--wui-all-wallets-bg-100); - } - - :host([data-wallet-icon='allWallets'])::after { - border: 1px solid var(--wui-color-accent-glass-010); - } - - wui-icon[data-parent-size='inherit'] { - width: 75%; - height: 75%; - align-items: center; - } - - wui-icon[data-parent-size='sm'] { - width: 18px; - height: 18px; - } - - wui-icon[data-parent-size='md'] { - width: 24px; - height: 24px; - } - - wui-icon[data-parent-size='lg'] { - width: 42px; - height: 42px; - } - - wui-icon[data-parent-size='full'] { - width: 100%; - height: 100%; - } - - :host > wui-icon-box { - position: absolute; - overflow: hidden; - right: -1px; - bottom: -2px; - z-index: 1; - border: 2px solid var(--wui-color-bg-150, #1e1f1f); - padding: 1px; - } -`;var j2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Kg=class extends He{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` - --local-border-radius: var(--wui-border-radius-${e}); - --local-size: var(--wui-wallet-image-size-${this.size}); - `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),X` - ${this.templateVisual()} - `}templateVisual(){return this.imageSrc?X``:this.walletIcon?X``:X``}};Kg.styles=[Wt,jgt];j2([ce()],Kg.prototype,"size",void 0);j2([ce()],Kg.prototype,"name",void 0);j2([ce()],Kg.prototype,"imageSrc",void 0);j2([ce()],Kg.prototype,"walletIcon",void 0);j2([ce({type:Boolean})],Kg.prototype,"installed",void 0);j2([ce()],Kg.prototype,"badgeSize",void 0);Kg=j2([Fe("wui-wallet-image")],Kg);const Ugt=Je` - :host { - position: relative; - border-radius: var(--wui-border-radius-xxs); - width: 40px; - height: 40px; - overflow: hidden; - background: var(--wui-color-gray-glass-002); - display: flex; - justify-content: center; - align-items: center; - flex-wrap: wrap; - gap: var(--wui-spacing-4xs); - padding: 3.75px !important; - } - - :host::after { - content: ''; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - border-radius: inherit; - border: 1px solid var(--wui-color-gray-glass-010); - pointer-events: none; - } - - :host > wui-wallet-image { - width: 14px; - height: 14px; - border-radius: var(--wui-border-radius-5xs); - } - - :host > wui-flex { - padding: 2px; - position: fixed; - overflow: hidden; - left: 34px; - bottom: 8px; - background: var(--dark-background-150, #1e1f1f); - border-radius: 50%; - z-index: 2; - display: flex; - } -`;var pCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const DU=4;let jD=class extends He{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthX` - - `)} - ${e?[...Array(DU-this.walletImages.length)].map(()=>X` `):null} - - - `}};jD.styles=[Wt,Ugt];pCe([ce({type:Array})],jD.prototype,"walletImages",void 0);jD=pCe([Fe("wui-all-wallets-image")],jD);const zgt=Je` - :host { - width: var(--local-width); - position: relative; - } - - button { - border: none; - border-radius: var(--local-border-radius); - width: var(--local-width); - white-space: nowrap; - } - - /* -- Sizes --------------------------------------------------- */ - button[data-size='md'] { - padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); - height: 36px; - } - - button[data-size='md'][data-icon-left='true'][data-icon-right='false'] { - padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); - } - - button[data-size='md'][data-icon-right='true'][data-icon-left='false'] { - padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); - } - - button[data-size='lg'] { - padding: var(--wui-spacing-m) var(--wui-spacing-2l); - height: 48px; - } - - /* -- Variants --------------------------------------------------------- */ - button[data-variant='main'] { - background-color: var(--wui-color-accent-100); - color: var(--wui-color-inverse-100); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - button[data-variant='inverse'] { - background-color: var(--wui-color-inverse-100); - color: var(--wui-color-inverse-000); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - button[data-variant='accent'] { - background-color: var(--wui-color-accent-glass-010); - color: var(--wui-color-accent-100); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - button[data-variant='accent-error'] { - background: var(--wui-color-error-glass-015); - color: var(--wui-color-error-100); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010); - } - - button[data-variant='accent-success'] { - background: var(--wui-color-success-glass-015); - color: var(--wui-color-success-100); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010); - } - - button[data-variant='neutral'] { - background: transparent; - color: var(--wui-color-fg-100); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - /* -- Focus states --------------------------------------------------- */ - button[data-variant='main']:focus-visible:enabled { - background-color: var(--wui-color-accent-090); - box-shadow: - inset 0 0 0 1px var(--wui-color-accent-100), - 0 0 0 4px var(--wui-color-accent-glass-020); - } - button[data-variant='inverse']:focus-visible:enabled { - background-color: var(--wui-color-inverse-100); - box-shadow: - inset 0 0 0 1px var(--wui-color-gray-glass-010), - 0 0 0 4px var(--wui-color-accent-glass-020); - } - button[data-variant='accent']:focus-visible:enabled { - background-color: var(--wui-color-accent-glass-010); - box-shadow: - inset 0 0 0 1px var(--wui-color-accent-100), - 0 0 0 4px var(--wui-color-accent-glass-020); - } - button[data-variant='accent-error']:focus-visible:enabled { - background: var(--wui-color-error-glass-015); - box-shadow: - inset 0 0 0 1px var(--wui-color-error-100), - 0 0 0 4px var(--wui-color-error-glass-020); - } - button[data-variant='accent-success']:focus-visible:enabled { - background: var(--wui-color-success-glass-015); - box-shadow: - inset 0 0 0 1px var(--wui-color-success-100), - 0 0 0 4px var(--wui-color-success-glass-020); - } - button[data-variant='neutral']:focus-visible:enabled { - background: var(--wui-color-gray-glass-005); - box-shadow: - inset 0 0 0 1px var(--wui-color-gray-glass-010), - 0 0 0 4px var(--wui-color-gray-glass-002); - } - - /* -- Hover & Active states ----------------------------------------------------------- */ - @media (hover: hover) and (pointer: fine) { - button[data-variant='main']:hover:enabled { - background-color: var(--wui-color-accent-090); - } - - button[data-variant='main']:active:enabled { - background-color: var(--wui-color-accent-080); - } - - button[data-variant='accent']:hover:enabled { - background-color: var(--wui-color-accent-glass-015); - } - - button[data-variant='accent']:active:enabled { - background-color: var(--wui-color-accent-glass-020); - } - - button[data-variant='accent-error']:hover:enabled { - background: var(--wui-color-error-glass-020); - color: var(--wui-color-error-100); - } - - button[data-variant='accent-error']:active:enabled { - background: var(--wui-color-error-glass-030); - color: var(--wui-color-error-100); - } - - button[data-variant='accent-success']:hover:enabled { - background: var(--wui-color-success-glass-020); - color: var(--wui-color-success-100); - } - - button[data-variant='accent-success']:active:enabled { - background: var(--wui-color-success-glass-030); - color: var(--wui-color-success-100); - } - - button[data-variant='neutral']:hover:enabled { - background: var(--wui-color-gray-glass-002); - } - - button[data-variant='neutral']:active:enabled { - background: var(--wui-color-gray-glass-005); - } - - button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] { - padding-left: var(--wui-spacing-m); - } - - button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] { - padding-right: var(--wui-spacing-m); - } - } - - /* -- Disabled state --------------------------------------------------- */ - button:disabled { - background-color: var(--wui-color-gray-glass-002); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - color: var(--wui-color-gray-glass-020); - cursor: not-allowed; - } - - button > wui-text { - transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: opacity; - opacity: var(--local-opacity-100); - } - - ::slotted(*) { - transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: opacity; - opacity: var(--local-opacity-100); - } - - wui-loading-spinner { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - opacity: var(--local-opacity-000); - } -`;var m0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const jce={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},Hgt={lg:"paragraph-600",md:"small-600"},Vgt={lg:"md",md:"md"};let Vf=class extends He{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` - --local-width: ${this.fullWidth?"100%":"auto"}; - --local-opacity-100: ${this.loading?0:1}; - --local-opacity-000: ${this.loading?1:0}; - --local-border-radius: var(--wui-border-radius-${this.borderRadius}); - `;const e=this.textVariant??Hgt[this.size];return X` - - `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=Vgt[this.size],r=this.disabled?jce.disabled:jce[this.variant];return X``}return X``}};Vf.styles=[Wt,hn,zgt];m0([ce()],Vf.prototype,"size",void 0);m0([ce({type:Boolean})],Vf.prototype,"disabled",void 0);m0([ce({type:Boolean})],Vf.prototype,"fullWidth",void 0);m0([ce({type:Boolean})],Vf.prototype,"loading",void 0);m0([ce()],Vf.prototype,"variant",void 0);m0([ce({type:Boolean})],Vf.prototype,"hasIconLeft",void 0);m0([ce({type:Boolean})],Vf.prototype,"hasIconRight",void 0);m0([ce()],Vf.prototype,"borderRadius",void 0);m0([ce()],Vf.prototype,"textVariant",void 0);Vf=m0([Fe("wui-button")],Vf);const gCe=mt` - -`,Ggt=Je` - :host { - display: flex; - flex-direction: column; - align-items: center; - width: 76px; - row-gap: var(--wui-spacing-xs); - padding: var(--wui-spacing-xs) 10px; - background-color: var(--wui-color-gray-glass-002); - border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); - position: relative; - } - - wui-shimmer[data-type='network'] { - border: none; - -webkit-clip-path: var(--wui-path-network); - clip-path: var(--wui-path-network); - } - - svg { - position: absolute; - width: 48px; - height: 54px; - z-index: 1; - } - - svg > path { - stroke: var(--wui-color-gray-glass-010); - stroke-width: 1px; - } -`;var vCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let UD=class extends He{constructor(){super(...arguments),this.type="wallet"}render(){return X` - ${this.shimmerTemplate()} - - `}shimmerTemplate(){return this.type==="network"?X` - ${gCe}`:X``}};UD.styles=[Wt,hn,Ggt];vCe([ce()],UD.prototype,"type",void 0);UD=vCe([Fe("wui-card-select-loader")],UD);const Wgt=mt` - - - -`,qgt=mt` - -`,Ygt=Je` - :host { - position: relative; - border-radius: inherit; - display: flex; - justify-content: center; - align-items: center; - width: var(--local-width); - height: var(--local-height); - } - - :host([data-round='true']) { - background: var(--wui-color-gray-glass-002); - border-radius: 100%; - outline: 1px solid var(--wui-color-gray-glass-005); - } - - svg { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 1; - fill: var(--wui-color-gray-glass-002); - } - - svg > path { - stroke: var(--local-stroke); - } - - wui-image { - width: 100%; - height: 100%; - -webkit-clip-path: var(--local-path); - clip-path: var(--local-path); - background: var(--wui-color-gray-glass-002); - } - - wui-icon { - transform: translateY(-5%); - width: var(--local-icon-size); - height: var(--local-icon-size); - } -`;var U2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Zg=class extends He{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:Wgt,md:gCe,lg:qgt},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=` - --local-width: var(--wui-spacing-3xl); - --local-height: var(--wui-spacing-3xl); - --local-icon-size: var(--wui-spacing-l); - `):this.style.cssText=` - - --local-path: var(--wui-path-network-${this.size}); - --local-width: var(--wui-width-network-${this.size}); - --local-height: var(--wui-height-network-${this.size}); - --local-icon-size: var(--wui-icon-size-network-${this.size}); - `,X`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?X``:X``}};Zg.styles=[Wt,Ygt];U2([ce()],Zg.prototype,"size",void 0);U2([ce()],Zg.prototype,"name",void 0);U2([ce({type:Object})],Zg.prototype,"networkImagesBySize",void 0);U2([ce()],Zg.prototype,"imageSrc",void 0);U2([ce({type:Boolean})],Zg.prototype,"selected",void 0);U2([ce({type:Boolean})],Zg.prototype,"round",void 0);Zg=U2([Fe("wui-network-image")],Zg);const Kgt=Je` - button { - flex-direction: column; - width: 76px; - row-gap: var(--wui-spacing-xs); - padding: var(--wui-spacing-xs) var(--wui-spacing-0); - background-color: var(--wui-color-gray-glass-002); - border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); - } - - button > wui-text { - color: var(--wui-color-fg-100); - max-width: var(--wui-icon-box-size-xl); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - justify-content: center; - } - - button:disabled > wui-text { - color: var(--wui-color-gray-glass-015); - } - - [data-selected='true'] { - background-color: var(--wui-color-accent-glass-020); - } - - @media (hover: hover) and (pointer: fine) { - [data-selected='true']:hover:enabled { - background-color: var(--wui-color-accent-glass-015); - } - } - - [data-selected='true']:active:enabled { - background-color: var(--wui-color-accent-glass-010); - } -`;var z2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Qg=class extends He{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return X` - - `}imageTemplate(){return this.type==="network"?X` - - - `:X` - - - `}};Qg.styles=[Wt,hn,Kgt];z2([ce()],Qg.prototype,"name",void 0);z2([ce()],Qg.prototype,"type",void 0);z2([ce()],Qg.prototype,"imageSrc",void 0);z2([ce({type:Boolean})],Qg.prototype,"disabled",void 0);z2([ce({type:Boolean})],Qg.prototype,"selected",void 0);z2([ce({type:Boolean})],Qg.prototype,"installed",void 0);Qg=z2([Fe("wui-card-select")],Qg);const Zgt=Je` - a { - border: 1px solid var(--wui-color-gray-glass-010); - border-radius: var(--wui-border-radius-3xl); - } - - wui-image { - border-radius: var(--wui-border-radius-3xl); - overflow: hidden; - } - - a.disabled > wui-icon:not(.image-icon), - a.disabled > wui-image { - filter: grayscale(1); - } - - a[data-variant='fill'] { - color: var(--wui-color-inverse-100); - background-color: var(--wui-color-accent-100); - } - - a[data-variant='shade'], - a[data-variant='shadeSmall'] { - background-color: transparent; - background-color: var(--wui-color-gray-glass-010); - color: var(--wui-color-fg-200); - } - - a[data-variant='success'] { - column-gap: var(--wui-spacing-xxs); - border: 1px solid var(--wui-color-success-glass-010); - background-color: var(--wui-color-success-glass-010); - color: var(--wui-color-success-100); - } - - a[data-variant='error'] { - column-gap: var(--wui-spacing-xxs); - border: 1px solid var(--wui-color-error-glass-010); - background-color: var(--wui-color-error-glass-010); - color: var(--wui-color-error-100); - } - - a[data-variant='transparent'] { - column-gap: var(--wui-spacing-xxs); - background-color: transparent; - color: var(--wui-color-fg-150); - } - - a[data-variant='transparent'], - a[data-variant='success'], - a[data-variant='shadeSmall'], - a[data-variant='error'] { - padding: 7px var(--wui-spacing-s) 7px 10px; - } - - a[data-variant='transparent']:has(wui-text:first-child), - a[data-variant='success']:has(wui-text:first-child), - a[data-variant='shadeSmall']:has(wui-text:first-child), - a[data-variant='error']:has(wui-text:first-child) { - padding: 7px var(--wui-spacing-s); - } - - a[data-variant='fill'], - a[data-variant='shade'] { - column-gap: var(--wui-spacing-xs); - padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) - var(--wui-spacing-xs); - } - - a[data-variant='fill']:has(wui-text:first-child), - a[data-variant='shade']:has(wui-text:first-child) { - padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); - } - - a[data-variant='fill'] > wui-image, - a[data-variant='shade'] > wui-image { - width: 24px; - height: 24px; - } - - a[data-variant='fill'] > wui-image { - box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); - } - - a[data-variant='shade'] > wui-image, - a[data-variant='shadeSmall'] > wui-image { - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - a[data-variant='fill'] > wui-icon:not(.image-icon), - a[data-variant='shade'] > wui-icon:not(.image-icon) { - width: 14px; - height: 14px; - } - - a[data-variant='transparent'] > wui-image, - a[data-variant='success'] > wui-image, - a[data-variant='shadeSmall'] > wui-image, - a[data-variant='error'] > wui-image { - width: 14px; - height: 14px; - } - - a[data-variant='transparent'] > wui-icon:not(.image-icon), - a[data-variant='success'] > wui-icon:not(.image-icon), - a[data-variant='shadeSmall'] > wui-icon:not(.image-icon), - a[data-variant='error'] > wui-icon:not(.image-icon) { - width: 12px; - height: 12px; - } - - a[data-variant='fill']:focus-visible { - background-color: var(--wui-color-accent-090); - } - - a[data-variant='shade']:focus-visible, - a[data-variant='shadeSmall']:focus-visible { - background-color: var(--wui-color-gray-glass-015); - } - - a[data-variant='transparent']:focus-visible { - background-color: var(--wui-color-gray-glass-005); - } - - a[data-variant='success']:focus-visible { - background-color: var(--wui-color-success-glass-015); - } - - a[data-variant='error']:focus-visible { - background-color: var(--wui-color-error-glass-015); - } - - a.disabled { - color: var(--wui-color-gray-glass-015); - background-color: var(--wui-color-gray-glass-015); - pointer-events: none; - } - - @media (hover: hover) and (pointer: fine) { - a[data-variant='fill']:hover { - background-color: var(--wui-color-accent-090); - } - - a[data-variant='shade']:hover, - a[data-variant='shadeSmall']:hover { - background-color: var(--wui-color-gray-glass-015); - } - - a[data-variant='transparent']:hover { - background-color: var(--wui-color-gray-glass-005); - } - - a[data-variant='success']:hover { - background-color: var(--wui-color-success-glass-015); - } - - a[data-variant='error']:hover { - background-color: var(--wui-color-error-glass-015); - } - } - - a[data-variant='fill']:active { - background-color: var(--wui-color-accent-080); - } - - a[data-variant='shade']:active, - a[data-variant='shadeSmall']:active { - background-color: var(--wui-color-gray-glass-020); - } - - a[data-variant='transparent']:active { - background-color: var(--wui-color-gray-glass-010); - } - - a[data-variant='success']:active { - background-color: var(--wui-color-success-glass-020); - } - - a[data-variant='error']:active { - background-color: var(--wui-color-error-glass-020); - } -`;var wv=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let ph=class extends He{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.imageIcon=void 0,this.imageIconSize="md",this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const r=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return X` - - ${this.imageTemplate()} - - ${this.title?this.title:Tr.getHostName(this.href)} - - - - `}imageTemplate(){return this.imageSrc?X``:this.imageIcon?X``:null}};ph.styles=[Wt,hn,Zgt];wv([ce()],ph.prototype,"variant",void 0);wv([ce()],ph.prototype,"imageSrc",void 0);wv([ce()],ph.prototype,"imageIcon",void 0);wv([ce()],ph.prototype,"imageIconSize",void 0);wv([ce({type:Boolean})],ph.prototype,"disabled",void 0);wv([ce()],ph.prototype,"icon",void 0);wv([ce()],ph.prototype,"href",void 0);wv([ce()],ph.prototype,"text",void 0);ph=wv([Fe("wui-chip")],ph);const Qgt=Je` - :host { - position: relative; - display: block; - } - - button { - background: var(--wui-color-accent-100); - border: 1px solid var(--wui-color-gray-glass-010); - border-radius: var(--wui-border-radius-m); - gap: var(--wui-spacing-xs); - } - - button.loading { - background: var(--wui-color-gray-glass-010); - border: 1px solid var(--wui-color-gray-glass-010); - pointer-events: none; - } - - button:disabled { - background-color: var(--wui-color-gray-glass-015); - border: 1px solid var(--wui-color-gray-glass-010); - } - - button:disabled > wui-text { - color: var(--wui-color-gray-glass-015); - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled { - background-color: var(--wui-color-accent-090); - } - - button:active:enabled { - background-color: var(--wui-color-accent-080); - } - } - - button:focus-visible { - border: 1px solid var(--wui-color-gray-glass-010); - background-color: var(--wui-color-accent-090); - -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - } - - button[data-size='sm'] { - padding: 6.75px 10px 7.25px; - } - - ::slotted(*) { - transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: opacity; - opacity: var(--local-opacity-100); - } - - button > wui-text { - transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: opacity; - opacity: var(--local-opacity-100); - color: var(--wui-color-inverse-100); - } - - button[data-size='md'] { - padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); - } - - button[data-size='md'] + wui-text { - padding-left: var(--wui-spacing-3xs); - } - - @media (max-width: 500px) { - button[data-size='md'] { - height: 32px; - padding: 5px 12px; - } - - button[data-size='md'] > wui-text > slot { - font-size: 14px !important; - } - } - - wui-loading-spinner { - width: 14px; - height: 14px; - } - - wui-loading-spinner::slotted(svg) { - width: 10px !important; - height: 10px !important; - } - - button[data-size='sm'] > wui-loading-spinner { - width: 12px; - height: 12px; - } -`;var sJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let hT=class extends He{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const e=this.size==="md"?"paragraph-600":"small-600";return X` - - `}loadingTemplate(){return this.loading?X``:null}};hT.styles=[Wt,hn,Qgt];sJ([ce()],hT.prototype,"size",void 0);sJ([ce({type:Boolean})],hT.prototype,"loading",void 0);hT=sJ([Fe("wui-connect-button")],hT);const Xgt=Je` - wui-flex { - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - } -`;var BL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let r5=class extends He{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return X` - - ${this.label} - - - - `}};r5.styles=[Wt,hn,Xgt];BL([ce({type:Boolean})],r5.prototype,"disabled",void 0);BL([ce()],r5.prototype,"label",void 0);BL([ce()],r5.prototype,"buttonLabel",void 0);r5=BL([Fe("wui-cta-button")],r5);const Jgt=Je` - :host { - display: block; - padding: var(--wui-spacing-l) var(--wui-spacing-m); - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - width: 100%; - } -`;var evt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Tq=class extends He{render(){return X` - - - - `}};Tq.styles=[Wt,hn,Jgt];Tq=evt([Fe("wui-details-group")],Tq);const tvt=Je` - :host { - display: flex; - flex-direction: row; - gap: var(--wui-spacing-l); - width: 100%; - border-radius: var(--wui-border-radius-xs); - } -`;var mCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let zD=class extends He{constructor(){super(...arguments),this.name=""}render(){return X` - - ${this.name} - - - - - `}};zD.styles=[Wt,hn,tvt];mCe([ce()],zD.prototype,"name",void 0);zD=mCe([Fe("wui-details-group-item")],zD);const rvt=Je` - :host { - z-index: calc(var(--w3m-z-index) + 1); - width: 200px; - padding: var(--wui-spacing-3xs); - align-items: center; - display: inherit; - border-radius: var(--wui-border-radius-xs); - border: 1px solid var(--wui-color-gray-glass-002); - background: var(--wui-color-fg-base-125); - /* Dark/Elevation/L */ - box-shadow: - 0px 8px 22px -6px rgba(0, 0, 0, 0.12), - 0px 14px 64px -4px rgba(0, 0, 0, 0.12); - } -`;var lJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let pT=class extends He{constructor(){super(...arguments),this.actions=[],this.isOpen=!1}render(){return this.isOpen?X` - - ${this.actions.map(e=>X` - - ${e.label} - - `)} - - `:null}};pT.styles=[Wt,hn,rvt];lJ([ce({type:Array})],pT.prototype,"actions",void 0);lJ([ce({type:Boolean})],pT.prototype,"isOpen",void 0);pT=lJ([Fe("wui-dropdown-menu")],pT);/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const nvt=t=>t.strings===void 0;/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const UA=(t,e)=>{var n;const r=t._$AN;if(r===void 0)return!1;for(const i of r)(n=i._$AO)==null||n.call(i,e,!1),UA(i,e);return!0},HD=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while((r==null?void 0:r.size)===0)},yCe=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),ovt(e)}};function ivt(t){this._$AN!==void 0?(HD(this),this._$AM=t,yCe(this)):this._$AM=t}function avt(t,e=!1,r=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let a=r;a{t.type==uCe.CHILD&&(t._$AP??(t._$AP=avt),t._$AQ??(t._$AQ=ivt))};let svt=class extends dCe{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,n){super._$AT(e,r,n),yCe(this),this.isConnected=e._$AU}_$AO(e,r=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),r&&(UA(this,e),HD(this))}setValue(e){if(nvt(this.t))this.t._$AI(e,this);else{const r=[...this.t._$AH];r[this.i]=e,this.t._$AI(r,this,0)}}disconnected(){}reconnected(){}};/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const D1=()=>new lvt;let lvt=class{};const NU=new WeakMap,N1=fCe(class extends svt{render(t){return vo}update(t,[e]){var n;const r=e!==this.Y;return r&&this.Y!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.Y=e,this.ht=(n=t.options)==null?void 0:n.host,this.rt(this.ct=t.element)),vo}rt(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let r=NU.get(e);r===void 0&&(r=new WeakMap,NU.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e;return typeof this.Y=="function"?(t=NU.get(this.ht??globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),cvt=Je` - :host { - position: relative; - width: 100%; - display: inline-block; - color: var(--wui-color-fg-275); - } - - input { - width: 100%; - border-radius: var(--wui-border-radius-xs); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - background: var(--wui-color-gray-glass-002); - font-size: var(--wui-font-size-paragraph); - letter-spacing: var(--wui-letter-spacing-paragraph); - color: var(--wui-color-fg-100); - transition: - background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), - border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), - box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); - will-change: background-color, border-color, box-shadow; - caret-color: var(--wui-color-accent-100); - } - - input:disabled { - cursor: not-allowed; - border: 1px solid var(--wui-color-gray-glass-010); - } - - input:disabled::placeholder, - input:disabled + wui-icon { - color: var(--wui-color-fg-300); - } - - input::placeholder { - color: var(--wui-color-fg-275); - } - - input:focus:enabled { - background-color: var(--wui-color-gray-glass-005); - -webkit-box-shadow: - inset 0 0 0 1px var(--wui-color-accent-100), - 0px 0px 0px 4px var(--wui-box-shadow-blue); - -moz-box-shadow: - inset 0 0 0 1px var(--wui-color-accent-100), - 0px 0px 0px 4px var(--wui-box-shadow-blue); - box-shadow: - inset 0 0 0 1px var(--wui-color-accent-100), - 0px 0px 0px 4px var(--wui-box-shadow-blue); - } - - input:hover:enabled { - background-color: var(--wui-color-gray-glass-005); - } - - wui-icon { - position: absolute; - top: 50%; - transform: translateY(-50%); - pointer-events: none; - } - - .wui-size-sm { - padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); - } - - wui-icon + .wui-size-sm { - padding: 9px var(--wui-spacing-m) 10px 36px; - } - - wui-icon[data-input='sm'] { - left: var(--wui-spacing-s); - } - - .wui-size-md { - padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); - } - - wui-icon + .wui-size-md, - wui-loading-spinner + .wui-size-md { - padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl); - } - - wui-icon[data-input='md'] { - left: var(--wui-spacing-l); - } - - .wui-size-lg { - padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l); - letter-spacing: var(--wui-letter-spacing-medium-title); - font-size: var(--wui-font-size-medium-title); - font-weight: var(--wui-font-weight-light); - line-height: 130%; - color: var(--wui-color-fg-100); - height: 64px; - } - - .wui-padding-right-xs { - padding-right: var(--wui-spacing-xs); - } - - .wui-padding-right-s { - padding-right: var(--wui-spacing-s); - } - - .wui-padding-right-m { - padding-right: var(--wui-spacing-m); - } - - .wui-padding-right-l { - padding-right: var(--wui-spacing-l); - } - - .wui-padding-right-xl { - padding-right: var(--wui-spacing-xl); - } - - .wui-padding-right-2xl { - padding-right: var(--wui-spacing-2xl); - } - - .wui-padding-right-3xl { - padding-right: var(--wui-spacing-3xl); - } - - .wui-padding-right-4xl { - padding-right: var(--wui-spacing-4xl); - } - - .wui-padding-right-5xl { - padding-right: var(--wui-spacing-5xl); - } - - wui-icon + .wui-size-lg, - wui-loading-spinner + .wui-size-lg { - padding-left: 50px; - } - - wui-icon[data-input='lg'] { - left: var(--wui-spacing-l); - } - - .wui-size-mdl { - padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m); - } - wui-icon + .wui-size-mdl, - wui-loading-spinner + .wui-size-mdl { - padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px; - } - wui-icon[data-input='mdl'] { - left: var(--wui-spacing-m); - } - - input:placeholder-shown ~ ::slotted(wui-input-element), - input:placeholder-shown ~ ::slotted(wui-icon) { - opacity: 0; - pointer-events: none; - } - - input::-webkit-outer-spin-button, - input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } - - input[type='number'] { - -moz-appearance: textfield; - } - - ::slotted(wui-input-element), - ::slotted(wui-icon) { - position: absolute; - top: 50%; - transform: translateY(-50%); - } - - ::slotted(wui-input-element) { - right: var(--wui-spacing-m); - } - - ::slotted(wui-icon) { - right: 0px; - } -`;var bv=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let gh=class extends He{constructor(){super(...arguments),this.inputElementRef=D1(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-padding-right-${this.inputRightPadding}`,n={[`wui-size-${this.size}`]:!0,[e]:!!this.inputRightPadding};return X`${this.templateIcon()} - - `}templateIcon(){return this.icon?X``:null}dispatchInputChangeEvent(){var e;this.dispatchEvent(new CustomEvent("inputChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.value,bubbles:!0,composed:!0}))}};gh.styles=[Wt,hn,cvt];bv([ce()],gh.prototype,"size",void 0);bv([ce()],gh.prototype,"icon",void 0);bv([ce({type:Boolean})],gh.prototype,"disabled",void 0);bv([ce()],gh.prototype,"placeholder",void 0);bv([ce()],gh.prototype,"type",void 0);bv([ce()],gh.prototype,"keyHint",void 0);bv([ce()],gh.prototype,"value",void 0);bv([ce()],gh.prototype,"inputRightPadding",void 0);gh=bv([Fe("wui-input-text")],gh);const uvt=Je` - :host { - position: relative; - display: inline-block; - } - - wui-text { - margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); - } -`;var FL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let n5=class extends He{constructor(){super(...arguments),this.disabled=!1}render(){return X` - - ${this.templateError()} - `}templateError(){return this.errorMessage?X`${this.errorMessage}`:null}};n5.styles=[Wt,uvt];FL([ce()],n5.prototype,"errorMessage",void 0);FL([ce({type:Boolean})],n5.prototype,"disabled",void 0);FL([ce()],n5.prototype,"value",void 0);n5=FL([Fe("wui-email-input")],n5);const fvt=Je` - :host { - position: relative; - width: 100%; - display: inline-block; - color: var(--wui-color-fg-275); - } - - .error { - margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); - } - - .base-name { - position: absolute; - right: 45px; - top: 15px; - text-align: right; - } -`;var u8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Ub=class extends He{constructor(){super(...arguments),this.disabled=!1,this.loading=!1}render(){return X` - - ${this.baseNameTemplate()} ${this.errorTemplate()}${this.loadingTemplate()} - - `}baseNameTemplate(){return X` - ${ya.WC_NAME_SUFFIX} - `}loadingTemplate(){return this.loading?X``:null}errorTemplate(){return this.errorMessage?X`${this.errorMessage}`:null}};Ub.styles=[Wt,fvt];u8([ce()],Ub.prototype,"errorMessage",void 0);u8([ce({type:Boolean})],Ub.prototype,"disabled",void 0);u8([ce()],Ub.prototype,"value",void 0);u8([ce({type:Boolean})],Ub.prototype,"loading",void 0);Ub=u8([Fe("wui-ens-input")],Ub);const dvt=Je` - button { - border-radius: var(--local-border-radius); - color: var(--wui-color-fg-100); - padding: var(--local-padding); - } - - @media (max-width: 700px) { - button { - padding: var(--wui-spacing-s); - } - } - - button > wui-icon { - pointer-events: none; - } - - button:disabled > wui-icon { - color: var(--wui-color-bg-300) !important; - } - - button:disabled { - background-color: transparent; - } -`;var f8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let zb=class extends He{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",r=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=` - --local-border-radius: var(${e}); - --local-padding: var(${r}); -`,X` - - `}};zb.styles=[Wt,hn,OL,dvt];f8([ce()],zb.prototype,"size",void 0);f8([ce({type:Boolean})],zb.prototype,"disabled",void 0);f8([ce()],zb.prototype,"icon",void 0);f8([ce()],zb.prototype,"iconColor",void 0);zb=f8([Fe("wui-icon-link")],zb);const hvt=Je` - button { - background-color: var(--wui-color-fg-300); - border-radius: var(--wui-border-radius-4xs); - width: 16px; - height: 16px; - } - - button:disabled { - background-color: var(--wui-color-bg-300); - } - - wui-icon { - color: var(--wui-color-bg-200) !important; - } - - button:focus-visible { - background-color: var(--wui-color-fg-250); - border: 1px solid var(--wui-color-accent-100); - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled { - background-color: var(--wui-color-fg-250); - } - - button:active:enabled { - background-color: var(--wui-color-fg-225); - } - } -`;var wCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let VD=class extends He{constructor(){super(...arguments),this.icon="copy"}render(){return X` - - `}};VD.styles=[Wt,hn,hvt];wCe([ce()],VD.prototype,"icon",void 0);VD=wCe([Fe("wui-input-element")],VD);const pvt=Je` - :host { - position: relative; - display: inline-block; - } - - input { - width: 50px; - height: 50px; - background: var(--wui-color-gray-glass-010); - border-radius: var(--wui-border-radius-xs); - border: 1px solid var(--wui-color-gray-glass-005); - font-family: var(--wui-font-family); - font-size: var(--wui-font-size-large); - font-weight: var(--wui-font-weight-regular); - letter-spacing: var(--wui-letter-spacing-large); - text-align: center; - color: var(--wui-color-fg-100); - caret-color: var(--wui-color-accent-100); - transition: - background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), - border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), - box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); - will-change: background-color, border-color, box-shadow; - box-sizing: border-box; - -webkit-appearance: none; - -moz-appearance: textfield; - padding: 0px; - } - - input::-webkit-outer-spin-button, - input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } - - input[type='number'] { - -moz-appearance: textfield; - } - - input:disabled { - cursor: not-allowed; - border: 1px solid var(--wui-color-gray-glass-010); - background: var(--wui-color-gray-glass-005); - } - - input:focus:enabled { - background-color: var(--wui-color-gray-glass-015); - border: 1px solid var(--wui-color-accent-100); - -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - } - - @media (hover: hover) and (pointer: fine) { - input:hover:enabled { - background-color: var(--wui-color-gray-glass-015); - } - } -`;var cJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let gT=class extends He{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return X` `}};gT.styles=[Wt,hn,pvt];cJ([ce({type:Boolean})],gT.prototype,"disabled",void 0);cJ([ce({type:String})],gT.prototype,"value",void 0);gT=cJ([Fe("wui-input-numeric")],gT);const gvt=Je` - button { - padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); - border-radius: var(--wui-border-radius-3xs); - background-color: transparent; - color: var(--wui-color-accent-100); - } - - button:disabled { - background-color: transparent; - color: var(--wui-color-gray-glass-015); - } - - button:hover { - background-color: var(--wui-color-gray-glass-005); - } -`;var uJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let vT=class extends He{constructor(){super(...arguments),this.disabled=!1,this.color="inherit"}render(){return X` - - `}};vT.styles=[Wt,hn,gvt];uJ([ce({type:Boolean})],vT.prototype,"disabled",void 0);uJ([ce()],vT.prototype,"color",void 0);vT=uJ([Fe("wui-link")],vT);const vvt=Je` - button { - column-gap: var(--wui-spacing-s); - padding: 11px 18px 11px var(--wui-spacing-s); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-250); - transition: - color var(--wui-ease-out-power-1) var(--wui-duration-md), - background-color var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: color, background-color; - } - - button[data-iconvariant='square'], - button[data-iconvariant='square-blue'] { - padding: 6px 18px 6px 9px; - } - - button > wui-flex { - flex: 1; - } - - button > wui-image { - width: 32px; - height: 32px; - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - border-radius: var(--wui-border-radius-3xl); - } - - button > wui-icon { - width: 36px; - height: 36px; - transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: opacity; - } - - button > wui-icon-box[data-variant='blue'] { - box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005); - } - - button > wui-icon-box[data-variant='overlay'] { - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - } - - button > wui-icon-box[data-variant='square-blue'] { - border-radius: var(--wui-border-radius-3xs); - position: relative; - border: none; - width: 36px; - height: 36px; - } - - button > wui-icon-box[data-variant='square-blue']::after { - content: ''; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - border-radius: inherit; - border: 1px solid var(--wui-color-accent-glass-010); - pointer-events: none; - } - - button > wui-icon:last-child { - width: 14px; - height: 14px; - } - - button:disabled { - color: var(--wui-color-gray-glass-020); - } - - button[data-loading='true'] > wui-icon { - opacity: 0; - } - - wui-loading-spinner { - position: absolute; - right: 18px; - top: 50%; - transform: translateY(-50%); - } -`;var y0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Gf=class extends He{constructor(){super(...arguments),this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return X` - - `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return X``;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return X``;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",r=this.iconVariant==="square-blue"?"mdl":"md",n=this.iconSize?this.iconSize:r;return X` - - `}return null}loadingTemplate(){return this.loading?X``:X``}chevronTemplate(){return this.chevron?X``:null}};Gf.styles=[Wt,hn,vvt];y0([ce()],Gf.prototype,"icon",void 0);y0([ce()],Gf.prototype,"iconSize",void 0);y0([ce()],Gf.prototype,"variant",void 0);y0([ce()],Gf.prototype,"iconVariant",void 0);y0([ce({type:Boolean})],Gf.prototype,"disabled",void 0);y0([ce()],Gf.prototype,"imageSrc",void 0);y0([ce()],Gf.prototype,"alt",void 0);y0([ce({type:Boolean})],Gf.prototype,"chevron",void 0);y0([ce({type:Boolean})],Gf.prototype,"loading",void 0);Gf=y0([Fe("wui-list-item")],Gf);var Eq;(function(t){t.approve="approved",t.bought="bought",t.borrow="borrowed",t.burn="burnt",t.cancel="canceled",t.claim="claimed",t.deploy="deployed",t.deposit="deposited",t.execute="executed",t.mint="minted",t.receive="received",t.repay="repaid",t.send="sent",t.sell="sold",t.stake="staked",t.trade="swapped",t.unstake="unstaked",t.withdraw="withdrawn"})(Eq||(Eq={}));const mvt=Je` - :host > wui-flex { - display: flex; - justify-content: center; - align-items: center; - position: relative; - width: 40px; - height: 40px; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - background-color: var(--wui-color-gray-glass-005); - } - - :host > wui-flex wui-image { - display: block; - } - - :host > wui-flex, - :host > wui-flex wui-image, - .swap-images-container, - .swap-images-container.nft, - wui-image.nft { - border-top-left-radius: var(--local-left-border-radius); - border-top-right-radius: var(--local-right-border-radius); - border-bottom-left-radius: var(--local-left-border-radius); - border-bottom-right-radius: var(--local-right-border-radius); - } - - wui-icon { - width: 20px; - height: 20px; - } - - wui-icon-box { - position: absolute; - right: 0; - bottom: 0; - transform: translate(20%, 20%); - } - - .swap-images-container { - position: relative; - width: 40px; - height: 40px; - overflow: hidden; - } - - .swap-images-container wui-image:first-child { - position: absolute; - width: 40px; - height: 40px; - top: 0; - left: 0%; - clip-path: inset(0px calc(50% + 2px) 0px 0%); - } - - .swap-images-container wui-image:last-child { - clip-path: inset(0px 0px 0px calc(50% + 2px)); - } -`;var H2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Xg=class extends He{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[e,r]=this.images,n=(e==null?void 0:e.type)==="NFT",i=r!=null&&r.url?r.type==="NFT":n,a=n?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",o=i?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=` - --local-left-border-radius: ${a}; - --local-right-border-radius: ${o}; - `,X` ${this.templateVisual()} ${this.templateIcon()} `}templateVisual(){const[e,r]=this.images,n=e==null?void 0:e.type;return this.images.length===2&&(e!=null&&e.url||r!=null&&r.url)?X`
- ${e!=null&&e.url?X``:null} - ${r!=null&&r.url?X``:null} -
`:e!=null&&e.url?X``:n==="NFT"?X``:X``}templateIcon(){let e="accent-100",r;return r=this.getIcon(),this.status&&(e=this.getStatusColor()),r?X` - - `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};Xg.styles=[mvt];H2([ce()],Xg.prototype,"type",void 0);H2([ce()],Xg.prototype,"status",void 0);H2([ce()],Xg.prototype,"direction",void 0);H2([ce({type:Boolean})],Xg.prototype,"onlyDirectionIcon",void 0);H2([ce({type:Array})],Xg.prototype,"images",void 0);H2([ce({type:Object})],Xg.prototype,"secondImage",void 0);Xg=H2([Fe("wui-transaction-visual")],Xg);const yvt=Je` - :host > wui-flex:first-child { - align-items: center; - column-gap: var(--wui-spacing-s); - padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs); - width: 100%; - } - - :host > wui-flex:first-child wui-text:nth-child(1) { - text-transform: capitalize; - } - - wui-transaction-visual { - width: 40px; - height: 40px; - } - - wui-flex { - flex: 1; - } - - :host wui-flex wui-flex { - overflow: hidden; - } - - :host .description-container wui-text span { - word-break: break-all; - } - - :host .description-container wui-text { - overflow: hidden; - } - - :host .description-separator-icon { - margin: 0px 6px; - } - - :host wui-text > span { - overflow: hidden; - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 1; - } -`;var Ch=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let mu=class extends He{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return X` - - - - - ${Eq[this.type]||this.type} - - - ${this.templateDescription()} ${this.templateSecondDescription()} - - - ${this.date} - - `}templateDescription(){var r;const e=(r=this.descriptions)==null?void 0:r[0];return e?X` - - ${e} - - `:null}templateSecondDescription(){var r;const e=(r=this.descriptions)==null?void 0:r[1];return e?X` - - - ${e} - - `:null}};mu.styles=[Wt,yvt];Ch([ce()],mu.prototype,"type",void 0);Ch([ce({type:Array})],mu.prototype,"descriptions",void 0);Ch([ce()],mu.prototype,"date",void 0);Ch([ce({type:Boolean})],mu.prototype,"onlyDirectionIcon",void 0);Ch([ce()],mu.prototype,"status",void 0);Ch([ce()],mu.prototype,"direction",void 0);Ch([ce({type:Array})],mu.prototype,"images",void 0);Ch([ce({type:Array})],mu.prototype,"price",void 0);Ch([ce({type:Array})],mu.prototype,"amount",void 0);Ch([ce({type:Array})],mu.prototype,"symbol",void 0);mu=Ch([Fe("wui-transaction-list-item")],mu);const wvt=Je` - :host > wui-flex:first-child { - column-gap: var(--wui-spacing-s); - padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); - width: 100%; - } - - wui-flex { - display: flex; - flex: 1; - } -`;var bvt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Iq=class extends He{render(){return X` - - - - - - - - - `}};Iq.styles=[Wt,wvt];Iq=bvt([Fe("wui-transaction-list-item-loader")],Iq);const xvt=Je` - :host { - display: flex; - justify-content: center; - align-items: center; - height: var(--wui-spacing-m); - padding: 0 var(--wui-spacing-3xs) !important; - border-radius: var(--wui-border-radius-5xs); - } - - :host > wui-text { - transform: translateY(5%); - } - - :host([data-variant='main']) { - background-color: var(--wui-color-accent-glass-015); - color: var(--wui-color-accent-100); - } - - :host([data-variant='shade']) { - background-color: var(--wui-color-gray-glass-010); - color: var(--wui-color-fg-200); - } - - :host([data-variant='success']) { - background-color: var(--wui-icon-box-bg-success-100); - color: var(--wui-color-success-100); - } - - :host([data-variant='error']) { - background-color: var(--wui-icon-box-bg-error-100); - color: var(--wui-color-error-100); - } - - :host([data-size='lg']) { - padding: 11px 5px !important; - } - - :host([data-size='lg']) > wui-text { - transform: translateY(2%); - } -`;var fJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let mT=class extends He{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return X` - - - - `}};mT.styles=[Wt,xvt];fJ([ce()],mT.prototype,"variant",void 0);fJ([ce()],mT.prototype,"size",void 0);mT=fJ([Fe("wui-tag")],mT);const _vt=Je` - button { - column-gap: var(--wui-spacing-s); - padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-100); - } - - button > wui-text:nth-child(2) { - display: flex; - flex: 1; - } - - button:disabled { - background-color: var(--wui-color-gray-glass-015); - color: var(--wui-color-gray-glass-015); - } - - button:disabled > wui-tag { - background-color: var(--wui-color-gray-glass-010); - color: var(--wui-color-fg-300); - } - - wui-icon { - color: var(--wui-color-fg-200) !important; - } -`;var Ah=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let yu=class extends He{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return X` - - `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?X` `:this.showAllWallets&&this.walletIcon?X` `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?X``:!this.showAllWallets&&!this.imageSrc?X``:null}templateStatus(){return this.tagLabel&&this.tagVariant?X`${this.tagLabel}`:this.icon?X``:null}};yu.styles=[Wt,hn,_vt];Ah([ce({type:Array})],yu.prototype,"walletImages",void 0);Ah([ce()],yu.prototype,"imageSrc",void 0);Ah([ce()],yu.prototype,"name",void 0);Ah([ce()],yu.prototype,"tagLabel",void 0);Ah([ce()],yu.prototype,"tagVariant",void 0);Ah([ce()],yu.prototype,"icon",void 0);Ah([ce()],yu.prototype,"walletIcon",void 0);Ah([ce({type:Boolean})],yu.prototype,"installed",void 0);Ah([ce({type:Boolean})],yu.prototype,"disabled",void 0);Ah([ce({type:Boolean})],yu.prototype,"showAllWallets",void 0);yu=Ah([Fe("wui-list-wallet")],yu);const Svt=Je` - :host { - display: flex; - justify-content: center; - align-items: center; - width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-005); - overflow: hidden; - } - - wui-icon { - width: 100%; - height: 100%; - } -`;var bCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let GD=class extends He{constructor(){super(...arguments),this.logo="google"}render(){return X` `}};GD.styles=[Wt,Svt];bCe([ce()],GD.prototype,"logo",void 0);GD=bCe([Fe("wui-logo")],GD);const Cvt=Je` - :host { - display: block; - width: 100%; - } - - button { - width: 100%; - height: 56px; - background: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - } -`;var dJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let yT=class extends He{constructor(){super(...arguments),this.logo="google",this.disabled=!1}render(){return X` - - `}};yT.styles=[Wt,hn,Cvt];dJ([ce()],yT.prototype,"logo",void 0);dJ([ce({type:Boolean})],yT.prototype,"disabled",void 0);yT=dJ([Fe("wui-logo-select")],yT);const Avt=Je` - :host { - display: block; - } - - button { - border-radius: var(--wui-border-radius-3xl); - display: flex; - gap: var(--wui-spacing-xs); - padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) - var(--wui-spacing-xs); - border: 1px solid var(--wui-color-gray-glass-010); - background-color: var(--wui-color-gray-glass-005); - color: var(--wui-color-fg-100); - } - - button:disabled { - border: 1px solid var(--wui-color-gray-glass-005); - background-color: var(--wui-color-gray-glass-015); - color: var(--wui-color-gray-glass-015); - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled { - background-color: var(--wui-color-gray-glass-010); - } - - button:active:enabled { - background-color: var(--wui-color-gray-glass-015); - } - } - - wui-image, - wui-icon-box { - border-radius: var(--wui-border-radius-3xl); - width: 24px; - height: 24px; - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - } -`;var jL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let i5=class extends He{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return X` - - `}visualTemplate(){return this.isUnsupportedChain?X` - - `:this.imageSrc?X``:X` - - `}};i5.styles=[Wt,hn,Avt];jL([ce()],i5.prototype,"imageSrc",void 0);jL([ce({type:Boolean})],i5.prototype,"isUnsupportedChain",void 0);jL([ce({type:Boolean})],i5.prototype,"disabled",void 0);i5=jL([Fe("wui-network-button")],i5);const Tvt=Je` - :host { - position: relative; - display: block; - } -`;var UL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let a5=class extends He{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=e=>this.values.slice(0,e).every(n=>n!==""),this.handleKeyDown=(e,r)=>{const n=e.target,i=this.getInputElement(n),a=["ArrowLeft","ArrowRight","Shift","Delete"];if(!i)return;a.includes(e.key)&&e.preventDefault();const o=i.selectionStart;switch(e.key){case"ArrowLeft":o&&i.setSelectionRange(o+1,o+1),this.focusInputField("prev",r);break;case"ArrowRight":this.focusInputField("next",r);break;case"Shift":this.focusInputField("next",r);break;case"Delete":i.value===""?this.focusInputField("prev",r):this.updateInput(i,r,"");break;case"Backspace":i.value===""?this.focusInputField("prev",r):this.updateInput(i,r,"");break}},this.focusInputField=(e,r)=>{if(e==="next"){const n=r+1;if(!this.shouldInputBeEnabled(n))return;const i=this.numerics[n-1?n:r],a=i?this.getInputElement(i):void 0;a&&a.focus()}}}firstUpdated(){var r,n;this.otp&&(this.values=this.otp.split(""));const e=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("wui-input-numeric");e&&(this.numerics=Array.from(e)),(n=this.numerics[0])==null||n.focus()}render(){return X` - - ${Array.from({length:this.length}).map((e,r)=>X` - this.handleInput(n,r)} - @click=${n=>this.selectInput(n)} - @keydown=${n=>this.handleKeyDown(n,r)} - .disabled=${!this.shouldInputBeEnabled(r)} - .value=${this.values[r]||""} - > - - `)} - - `}updateInput(e,r,n){const i=this.numerics[r],a=e||(i?this.getInputElement(i):void 0);a&&(a.value=n,this.values=this.values.map((o,s)=>s===r?n:o))}selectInput(e){const r=e.target;if(r){const n=this.getInputElement(r);n==null||n.select()}}handleInput(e,r){const n=e.target,i=this.getInputElement(n);if(i){const a=i.value;e.inputType==="insertFromPaste"?this.handlePaste(i,a,r):Tr.isNumber(a)&&e.data?(this.updateInput(i,r,e.data),this.focusInputField("next",r)):this.updateInput(i,r,"")}this.dispatchInputChangeEvent()}handlePaste(e,r,n){const i=r[0];if(i&&Tr.isNumber(i)){this.updateInput(e,n,i);const o=r.substring(1);if(n+140)throw new Error('"version" should be in range from 1 to 40');return e*4+17};ku.getSymbolTotalCodewords=function(e){return Ivt[e]};ku.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};ku.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');hJ=e};ku.isKanjiModeEnabled=function(){return typeof hJ<"u"};ku.toSJIS=function(e){return hJ(e)};var zL={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(zL);function _Ce(){this.buffer=[],this.length=0}_Ce.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var kvt=_Ce;function h8(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}h8.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};h8.prototype.get=function(t,e){return this.data[t*this.size+e]};h8.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};h8.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Pvt=h8,SCe={};(function(t){const e=ku.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),o=a===145?26:Math.ceil((a-13)/(2*i-2))*2,s=[a-7];for(let l=1;l=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const a=i.size;let o=0,s=0,l=0,c=null,u=null;for(let f=0;f=5&&(o+=e.N1+(s-5)),c=h,s=1),h=i.get(d,f),h===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=h,l=1)}s>=5&&(o+=e.N1+(s-5)),l>=5&&(o+=e.N1+(l-5))}return o},t.getPenaltyN2=function(i){const a=i.size;let o=0;for(let s=0;s=10&&(s===1488||s===93)&&o++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&o++}return o*e.N3},t.getPenaltyN4=function(i){let a=0;const o=i.data.length;for(let l=0;l=0;){const o=a[0];for(let l=0;l0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var Mvt=pJ,ICe={},iy={},gJ={};gJ.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var w0={};const kCe="[0-9]+",Dvt="[A-Z $%*+\\-./:]+";let wT="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";wT=wT.replace(/u/g,"\\u");const Nvt="(?:(?![A-Z0-9 $%*+\\-./:]|"+wT+`)(?:.|[\r -]))+`;w0.KANJI=new RegExp(wT,"g");w0.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");w0.BYTE=new RegExp(Nvt,"g");w0.NUMERIC=new RegExp(kCe,"g");w0.ALPHANUMERIC=new RegExp(Dvt,"g");const Ovt=new RegExp("^"+wT+"$"),Lvt=new RegExp("^"+kCe+"$"),$vt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");w0.testKanji=function(e){return Ovt.test(e)};w0.testNumeric=function(e){return Lvt.test(e)};w0.testAlphanumeric=function(e){return $vt.test(e)};(function(t){const e=gJ,r=w0;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(a,o){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?a.ccBits[0]:o<27?a.ccBits[1]:a.ccBits[2]},t.getBestModeForData=function(a){return r.testNumeric(a)?t.NUMERIC:r.testAlphanumeric(a)?t.ALPHANUMERIC:r.testKanji(a)?t.KANJI:t.BYTE},t.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},t.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(a,o){if(t.isValid(a))return a;try{return n(a)}catch{return o}}})(iy);(function(t){const e=ku,r=HL,n=zL,i=iy,a=gJ,o=7973,s=e.getBCHDigit(o);function l(d,h,p){for(let g=1;g<=40;g++)if(h<=t.getCapacity(g,p,d))return g}function c(d,h){return i.getCharCountIndicator(d,h)+4}function u(d,h){let p=0;return d.forEach(function(g){const v=c(g.mode,h);p+=v+g.getBitsLength()}),p}function f(d,h){for(let p=1;p<=40;p++)if(u(d,p)<=t.getCapacity(p,h,i.MIXED))return p}t.from=function(h,p){return a.isValid(h)?parseInt(h,10):p},t.getCapacity=function(h,p,g){if(!a.isValid(h))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=i.BYTE);const v=e.getSymbolTotalCodewords(h),y=r.getTotalCodewordsCount(h,p),m=(v-y)*8;if(g===i.MIXED)return m;const b=m-c(g,h);switch(g){case i.NUMERIC:return Math.floor(b/10*3);case i.ALPHANUMERIC:return Math.floor(b/11*2);case i.KANJI:return Math.floor(b/13);case i.BYTE:default:return Math.floor(b/8)}},t.getBestVersionForData=function(h,p){let g;const v=n.from(p,n.M);if(Array.isArray(h)){if(h.length>1)return f(h,v);if(h.length===0)return 1;g=h[0]}else g=h;return l(g.mode,g.getLength(),v)},t.getEncodedBits=function(h){if(!a.isValid(h)||h<7)throw new Error("Invalid QR Code version");let p=h<<12;for(;e.getBCHDigit(p)-s>=0;)p^=o<=0;)i^=RCe<0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,a*3+1))};var jvt=o5;const Uvt=iy,OU=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s5(t){this.mode=Uvt.ALPHANUMERIC,this.data=t}s5.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};s5.prototype.getLength=function(){return this.data.length};s5.prototype.getBitsLength=function(){return s5.getBitsLength(this.data.length)};s5.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=OU.indexOf(this.data[r])*45;n+=OU.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(OU.indexOf(this.data[r]),6)};var zvt=s5,Hvt=function(e){for(var r=[],n=e.length,i=0;i=55296&&a<=56319&&n>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(a=(a-55296)*1024+o-56320+65536,i+=1)}if(a<128){r.push(a);continue}if(a<2048){r.push(a>>6|192),r.push(a&63|128);continue}if(a<55296||a>=57344&&a<65536){r.push(a>>12|224),r.push(a>>6&63|128),r.push(a&63|128);continue}if(a>=65536&&a<=1114111){r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const Vvt=Hvt,Gvt=iy;function l5(t){this.mode=Gvt.BYTE,typeof t=="string"&&(t=Vvt(t)),this.data=new Uint8Array(t)}l5.getBitsLength=function(e){return e*8};l5.prototype.getLength=function(){return this.data.length};l5.prototype.getBitsLength=function(){return l5.getBitsLength(this.data.length)};l5.prototype.write=function(t){for(let e=0,r=this.data.length;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` -Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var Kvt=c5,DCe={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var a={},o={};o[n]=0;var s=e.PriorityQueue.make();s.push(n,0);for(var l,c,u,f,d,h,p,g,v;!s.empty();){l=s.pop(),c=l.value,f=l.cost,d=r[c]||{};for(u in d)d.hasOwnProperty(u)&&(h=d[u],p=f+h,g=o[u],v=typeof o[u]>"u",(v||g>p)&&(o[u]=p,s.push(u,p),a[u]=c))}if(typeof i<"u"&&typeof o[i]>"u"){var y=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(y)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],a=n;a;)i.push(a),r[a],a=r[a];return i.reverse(),i},find_path:function(r,n,i){var a=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(DCe);var Zvt=DCe.exports;(function(t){const e=iy,r=jvt,n=zvt,i=Wvt,a=Kvt,o=w0,s=ku,l=Zvt;function c(y){return unescape(encodeURIComponent(y)).length}function u(y,m,b){const w=[];let C;for(;(C=y.exec(b))!==null;)w.push({data:C[0],index:C.index,mode:m,length:C[0].length});return w}function f(y){const m=u(o.NUMERIC,e.NUMERIC,y),b=u(o.ALPHANUMERIC,e.ALPHANUMERIC,y);let w,C;return s.isKanjiModeEnabled()?(w=u(o.BYTE,e.BYTE,y),C=u(o.KANJI,e.KANJI,y)):(w=u(o.BYTE_KANJI,e.BYTE,y),C=[]),m.concat(b,w,C).sort(function(S,I){return S.index-I.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function d(y,m){switch(m){case e.NUMERIC:return r.getBitsLength(y);case e.ALPHANUMERIC:return n.getBitsLength(y);case e.KANJI:return a.getBitsLength(y);case e.BYTE:return i.getBitsLength(y)}}function h(y){return y.reduce(function(m,b){const w=m.length-1>=0?m[m.length-1]:null;return w&&w.mode===b.mode?(m[m.length-1].data+=b.data,m):(m.push(b),m)},[])}function p(y){const m=[];for(let b=0;b=0&&s<=6&&(l===0||l===6)||l>=0&&l<=6&&(s===0||s===6)||s>=2&&s<=4&&l>=2&&l<=4?t.set(a+s,o+l,!0,!0):t.set(a+s,o+l,!1,!0))}}function amt(t){const e=t.size;for(let r=8;r>s&1)===1,t.set(i,a,o,!0),t.set(a,i,o,!0)}function BU(t,e,r){const n=t.size,i=rmt.getEncodedBits(e,r);let a,o;for(a=0;a<15;a++)o=(i>>a&1)===1,a<6?t.set(a,8,o,!0):a<8?t.set(a+1,8,o,!0):t.set(n-15+a,8,o,!0),a<8?t.set(8,n-a-1,o,!0):a<9?t.set(8,15-a-1+1,o,!0):t.set(8,15-a-1,o,!0);t.set(n-8,8,1,!0)}function lmt(t,e){const r=t.size;let n=-1,i=r-1,a=7,o=0;for(let s=r-1;s>0;s-=2)for(s===6&&s--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,s-l)){let c=!1;o>>a&1)===1),t.set(i,s-l,c),a--,a===-1&&(o++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function cmt(t,e,r){const n=new Qvt;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),nmt.getCharCountIndicator(l.mode,t)),l.write(n)});const i=GL.getSymbolTotalCodewords(t),a=Rq.getTotalCodewordsCount(t,e),o=(i-a)*8;for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const s=(o-n.getLengthInBits())/8;for(let l=0;l=7&&smt(l,e),lmt(l,o),isNaN(n)&&(n=Pq.getBestMask(l,BU.bind(null,l,r))),Pq.applyMask(n,l),BU(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}xCe.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=LU.M,i,a;return typeof r<"u"&&(n=LU.from(r.errorCorrectionLevel,LU.M),i=qD.from(r.version),a=Pq.from(r.maskPattern),r.toSJISFunc&&GL.setToSJISFunction(r.toSJISFunc)),fmt(e,i,n,a)};var NCe={},vJ={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:a,scale:a?4:o,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const a=t.getScale(n,i);return Math.floor((n+i.margin*2)*a)},t.qrToImageData=function(n,i,a){const o=i.modules.size,s=i.modules.data,l=t.getScale(o,a),c=Math.floor((o+a.margin*2)*l),u=a.margin*l,f=[a.color.light,a.color.dark];for(let d=0;d=u&&h>=u&&d"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(c=n()),l=e.getOptions(l);const u=e.getImageWidth(a.modules.size,l),f=c.getContext("2d"),d=f.createImageData(u,u);return e.qrToImageData(d.data,a,l),r(f,c,u),f.putImageData(d,0,0),c},t.renderToDataURL=function(a,o,s){let l=s;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const c=t.render(a,o,l),u=l.type||"image/png",f=l.rendererOpts||{};return c.toDataURL(u,f.quality)}})(NCe);var OCe={};const dmt=vJ;function Hce(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function FU(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function hmt(t,e,r){let n="",i=0,a=!1,o=0;for(let s=0;s0&&l>0&&t[s-1]||(n+=a?FU("M",l+r,.5+c+r):FU("m",i,0),i=0,a=!1),l+1':"",c="',u='viewBox="0 0 '+s+" "+s+'"',d=''+l+c+` -`;return typeof n=="function"&&n(null,d),d};const pmt=Evt,Mq=xCe,LCe=NCe,gmt=OCe;function mJ(t,e,r,n,i){const a=[].slice.call(arguments,1),o=a.length,s=typeof a[o-1]=="function";if(!s&&!pmt())throw new Error("Callback required as last argument");if(s){if(o<2)throw new Error("Too few arguments provided");o===2?(i=r,r=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(r=e,e=n=void 0):o===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,c){try{const u=Mq.create(r,n);l(t(u,e,n))}catch(u){c(u)}})}try{const l=Mq.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}d8.create=Mq.create;d8.toCanvas=mJ.bind(null,LCe.render);d8.toDataURL=mJ.bind(null,LCe.renderToDataURL);d8.toString=mJ.bind(null,function(t,e,r){return gmt.render(t,r)});const vmt=.1,Vce=2.5,Y0=7;function jU(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+vmt}function mmt(t,e){const r=Array.prototype.slice.call(d8.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,a,o)=>(o%n===0?i.push([a]):i[i.length-1].push(a))&&i,[])}const ymt={generate(t,e,r){const n="#141414",i="transparent",o=[],s=mmt(t,"Q"),l=e/s.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:g,y:v})=>{const y=(s.length-Y0)*l*g,m=(s.length-Y0)*l*v,b=.45;for(let w=0;w - `)}});const u=Math.floor((r+25)/l),f=s.length/2-u/2,d=s.length/2+u/2-1,h=[];s.forEach((g,v)=>{g.forEach((y,m)=>{if(s[v][m]&&!(vs.length-(Y0+1)&&ms.length-(Y0+1))&&!(v>f&&vf&&m{var y;p[g]?(y=p[g])==null||y.push(v):p[g]=[v]}),Object.entries(p).map(([g,v])=>{const y=v.filter(m=>v.every(b=>!jU(m,b,l)));return[Number(g),y]}).forEach(([g,v])=>{v.forEach(y=>{o.push(mt``)})}),Object.entries(p).filter(([g,v])=>v.length>1).map(([g,v])=>{const y=v.filter(m=>v.some(b=>jU(m,b,l)));return[Number(g),y]}).map(([g,v])=>{v.sort((m,b)=>mw.some(C=>jU(m,C,l)));b?b.push(m):y.push([m])}return[g,y.map(m=>[m[0],m[m.length-1]])]}).forEach(([g,v])=>{v.forEach(([y,m])=>{o.push(mt` - - `)})}),o}},wmt=Je` - :host { - position: relative; - user-select: none; - display: block; - overflow: hidden; - aspect-ratio: 1 / 1; - width: var(--local-size); - } - - :host([data-theme='dark']) { - border-radius: clamp(0px, var(--wui-border-radius-l), 40px); - background-color: var(--wui-color-inverse-100); - padding: var(--wui-spacing-l); - } - - :host([data-theme='light']) { - box-shadow: 0 0 0 1px var(--wui-color-bg-125); - background-color: var(--wui-color-bg-125); - } - - :host([data-clear='true']) > wui-icon { - display: none; - } - - svg:first-child, - wui-image, - wui-icon { - position: absolute; - top: 50%; - left: 50%; - transform: translateY(-50%) translateX(-50%); - } - - wui-image { - width: 25%; - height: 25%; - border-radius: var(--wui-border-radius-xs); - } - - wui-icon { - width: 100%; - height: 100%; - color: #3396ff !important; - transform: translateY(-50%) translateX(-50%) scale(0.25); - } -`;var ay=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Zp=class extends He{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,X`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return mt` - - ${ymt.generate(this.uri,e,this.arenaClear?0:e/4)} - - `}templateVisual(){return this.imageSrc?X``:this.farcaster?X``:X``}};Zp.styles=[Wt,wmt];ay([ce()],Zp.prototype,"uri",void 0);ay([ce({type:Number})],Zp.prototype,"size",void 0);ay([ce()],Zp.prototype,"theme",void 0);ay([ce()],Zp.prototype,"imageSrc",void 0);ay([ce()],Zp.prototype,"alt",void 0);ay([ce({type:Boolean})],Zp.prototype,"arenaClear",void 0);ay([ce({type:Boolean})],Zp.prototype,"farcaster",void 0);Zp=ay([Fe("wui-qr-code")],Zp);const bmt=Je` - :host { - position: relative; - display: inline-block; - width: 100%; - } -`;var xmt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Dq=class extends He{constructor(){super(...arguments),this.inputComponentRef=D1()}render(){return X` - - - - `}clearValue(){const e=this.inputComponentRef.value,r=e==null?void 0:e.inputElementRef.value;r&&(r.value="",r.focus(),r.dispatchEvent(new Event("input")))}};Dq.styles=[Wt,bmt];Dq=xmt([Fe("wui-search-bar")],Dq);const _mt=Je` - :host { - display: flex; - column-gap: var(--wui-spacing-xs); - align-items: center; - padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-005); - box-sizing: border-box; - max-height: 40px; - background-color: var(--wui-color-bg-175); - box-shadow: - 0px 14px 64px -4px rgba(0, 0, 0, 0.15), - 0px 8px 22px -6px rgba(0, 0, 0, 0.15); - } - - :host wui-loading-spinner { - margin-left: var(--wui-spacing-3xs); - } -`;var hS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let O1=class extends He{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message="",this.loading=!1}render(){return X` - ${this.loading?X``:X``} - ${this.message} - `}};O1.styles=[Wt,_mt];hS([ce()],O1.prototype,"backgroundColor",void 0);hS([ce()],O1.prototype,"iconColor",void 0);hS([ce()],O1.prototype,"icon",void 0);hS([ce()],O1.prototype,"message",void 0);hS([ce()],O1.prototype,"loading",void 0);O1=hS([Fe("wui-snackbar")],O1);const Smt=Je` - :host { - display: flex; - align-items: center; - justify-content: center; - padding: var(--wui-spacing-s); - border-radius: var(--wui-border-radius-s); - border: 1px solid var(--wui-color-dark-glass-100); - box-sizing: border-box; - background-color: var(--wui-color-bg-325); - box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25); - } - - wui-flex { - width: 100%; - } - - wui-text { - word-break: break-word; - flex: 1; - } - - .close { - cursor: pointer; - } - - .icon-box { - height: 40px; - width: 40px; - border-radius: var(--wui-border-radius-3xs); - background-color: var(--local-icon-bg-value); - } -`;var p8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Hb=class extends He{constructor(){super(...arguments),this.message="",this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="info"}render(){return this.style.cssText=` - --local-icon-bg-value: var(--wui-color-${this.backgroundColor}); - `,X` - - - - - - ${this.message} - - - - `}onClose(){cb.close()}};Hb.styles=[Wt,Smt];p8([ce()],Hb.prototype,"message",void 0);p8([ce()],Hb.prototype,"backgroundColor",void 0);p8([ce()],Hb.prototype,"iconColor",void 0);p8([ce()],Hb.prototype,"icon",void 0);Hb=p8([Fe("wui-alertbar")],Hb);const Cmt=Je` - :host { - display: inline-flex; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-3xl); - padding: var(--wui-spacing-3xs); - position: relative; - height: 36px; - min-height: 36px; - overflow: hidden; - } - - :host::before { - content: ''; - position: absolute; - pointer-events: none; - top: 4px; - left: 4px; - display: block; - width: var(--local-tab-width); - height: 28px; - border-radius: var(--wui-border-radius-3xl); - background-color: var(--wui-color-gray-glass-002); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); - transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: background-color, opacity; - } - - :host([data-type='flex'])::before { - left: 3px; - transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); - } - - :host([data-type='flex']) { - display: flex; - padding: 0px 0px 0px 12px; - gap: 4px; - } - - :host([data-type='flex']) > button > wui-text { - position: absolute; - left: 18px; - opacity: 0; - } - - button[data-active='true'] > wui-icon, - button[data-active='true'] > wui-text { - color: var(--wui-color-fg-100); - } - - button[data-active='false'] > wui-icon, - button[data-active='false'] > wui-text { - color: var(--wui-color-fg-200); - } - - button[data-active='true']:disabled, - button[data-active='false']:disabled { - background-color: transparent; - opacity: 0.5; - cursor: not-allowed; - } - - button[data-active='true']:disabled > wui-text { - color: var(--wui-color-fg-200); - } - - button[data-active='false']:disabled > wui-text { - color: var(--wui-color-fg-300); - } - - button > wui-icon, - button > wui-text { - pointer-events: none; - transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); - will-change: color; - } - - button { - width: var(--local-tab-width); - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: background-color; - } - - :host([data-type='flex']) > button { - width: 34px; - position: relative; - display: flex; - justify-content: flex-start; - } - - button:hover:enabled, - button:active:enabled { - background-color: transparent !important; - } - - button:hover:enabled > wui-icon, - button:active:enabled > wui-icon { - transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); - color: var(--wui-color-fg-125); - } - - button:hover:enabled > wui-text, - button:active:enabled > wui-text { - transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg); - color: var(--wui-color-fg-125); - } - - button { - border-radius: var(--wui-border-radius-3xl); - } -`;var oy=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Qp=class extends He{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` - --local-tab: ${this.activeTab}; - --local-tab-width: ${this.localTabWidth}; - `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,r)=>{var i;const n=r===this.activeTab;return X` - - `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?X``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,r){const n=this.buttons[this.activeTab],i=this.buttons[e],a=n==null?void 0:n.querySelector("wui-text"),o=i==null?void 0:i.querySelector("wui-text"),s=i==null?void 0:i.getBoundingClientRect(),l=o==null?void 0:o.getBoundingClientRect();n&&a&&!r&&e!==this.activeTab&&(a.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),n.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),i&&s&&l&&o&&(e!==this.activeTab||r)&&(this.localTabWidth=`${Math.round(s.width+l.width)+6}px`,i.animate([{width:`${s.width+l.width}px`}],{duration:r?0:500,fill:"forwards",easing:"ease"}),o.animate([{opacity:1}],{duration:r?0:125,delay:r?0:200,fill:"forwards",easing:"ease"}))}};Qp.styles=[Wt,hn,Cmt];oy([ce({type:Array})],Qp.prototype,"tabs",void 0);oy([ce()],Qp.prototype,"onTabChange",void 0);oy([ce({type:Array})],Qp.prototype,"buttons",void 0);oy([ce({type:Boolean})],Qp.prototype,"disabled",void 0);oy([ce()],Qp.prototype,"localTabWidth",void 0);oy([xe()],Qp.prototype,"activeTab",void 0);oy([xe()],Qp.prototype,"isDense",void 0);Qp=oy([Fe("wui-tabs")],Qp);const Amt=Je` - :host { - display: block; - } - - :host > button { - gap: var(--wui-spacing-xxs); - padding: var(--wui-spacing-xs); - padding-right: var(--wui-spacing-1xs); - height: 40px; - border-radius: var(--wui-border-radius-l); - background: var(--wui-color-gray-glass-002); - border-width: 0px; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - } - - :host > button wui-image { - width: 24px; - height: 24px; - border-radius: var(--wui-border-radius-s); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } -`;var yJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let bT=class extends He{constructor(){super(...arguments),this.text=""}render(){return X` - - `}tokenTemplate(){return this.imageSrc?X``:X` - - `}};bT.styles=[Wt,hn,Amt];yJ([ce()],bT.prototype,"imageSrc",void 0);yJ([ce()],bT.prototype,"text",void 0);bT=yJ([Fe("wui-token-button")],bT);const Tmt=Je` - :host { - display: block; - padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xxs); - - color: var(--wui-color-bg-100); - position: relative; - } - - :host([data-variant='shade']) { - background-color: var(--wui-color-bg-150); - border: 1px solid var(--wui-color-gray-glass-005); - } - - :host([data-variant='shade']) > wui-text { - color: var(--wui-color-fg-150); - } - - :host([data-variant='fill']) { - background-color: var(--wui-color-fg-100); - border: none; - } - - wui-icon { - position: absolute; - width: 12px !important; - height: 4px !important; - } - - wui-icon[data-placement='top'] { - bottom: 0px; - left: 50%; - transform: translate(-50%, 95%); - } - - wui-icon[data-placement='bottom'] { - top: 0; - left: 50%; - transform: translate(-50%, -95%) rotate(180deg); - } - - wui-icon[data-placement='right'] { - top: 50%; - left: 0; - transform: translate(-65%, -50%) rotate(90deg); - } - - wui-icon[data-placement='left'] { - top: 50%; - right: 0%; - transform: translate(65%, -50%) rotate(270deg); - } -`;var WL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let u5=class extends He{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,X` - ${this.message}`}};u5.styles=[Wt,hn,Tmt];WL([ce()],u5.prototype,"placement",void 0);WL([ce()],u5.prototype,"variant",void 0);WL([ce()],u5.prototype,"message",void 0);u5=WL([Fe("wui-tooltip")],u5);const Emt=Je` - :host { - height: 60px; - min-height: 60px; - } - - :host > wui-flex { - cursor: pointer; - height: 100%; - display: flex; - column-gap: var(--wui-spacing-s); - padding: var(--wui-spacing-xs); - padding-right: var(--wui-spacing-l); - width: 100%; - background-color: transparent; - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-250); - transition: - background-color var(--wui-ease-out-power-1) var(--wui-duration-lg), - opacity var(--wui-ease-out-power-1) var(--wui-duration-lg); - will-change: background-color, opacity; - } - - @media (hover: hover) and (pointer: fine) { - :host > wui-flex:hover { - background-color: var(--wui-color-gray-glass-002); - } - - :host > wui-flex:active { - background-color: var(--wui-color-gray-glass-005); - } - } - - :host([disabled]) > wui-flex { - opacity: 0.6; - } - - :host([disabled]) > wui-flex:hover { - background-color: transparent; - } - - :host > wui-flex > wui-flex { - flex: 1; - } - - :host > wui-flex > wui-image, - :host > wui-flex > .token-item-image-placeholder { - width: 40px; - max-width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-3xl); - position: relative; - } - - :host > wui-flex > .token-item-image-placeholder { - display: flex; - align-items: center; - justify-content: center; - } - - :host > wui-flex > wui-image::after, - :host > wui-flex > .token-item-image-placeholder::after { - position: absolute; - content: ''; - inset: 0; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - border-radius: var(--wui-border-radius-l); - } - - button > wui-icon-box[data-variant='square-blue'] { - border-radius: var(--wui-border-radius-3xs); - position: relative; - border: none; - width: 36px; - height: 36px; - } -`;var sy=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Xp=class extends He{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0,this.visible=!1,this.imageError=!1,this.observer=new IntersectionObserver(e=>{e.forEach(r=>{r.isIntersecting?this.visible=!0:this.visible=!1})},{threshold:.1})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var r;if(!this.visible)return null;const e=this.amount&&this.price?(r=ii.multiply(this.price,this.amount))==null?void 0:r.toFixed(3):null;return X` - - ${this.visualTemplate()} - - - ${this.name} - ${e?X` - - $${Tr.formatNumberToLocalString(e,3)} - - `:null} - - - ${this.symbol} - ${this.amount?X` - ${Tr.formatNumberToLocalString(this.amount,4)} - `:null} - - - - `}visualTemplate(){return this.imageError?X` - - `:this.imageSrc?X``:null}imageLoadError(){this.imageError=!0}};Xp.styles=[Wt,hn,Emt];sy([ce()],Xp.prototype,"imageSrc",void 0);sy([ce()],Xp.prototype,"name",void 0);sy([ce()],Xp.prototype,"symbol",void 0);sy([ce()],Xp.prototype,"price",void 0);sy([ce()],Xp.prototype,"amount",void 0);sy([xe()],Xp.prototype,"visible",void 0);sy([xe()],Xp.prototype,"imageError",void 0);Xp=sy([Fe("wui-token-list-item")],Xp);const Imt=Je` - :host { - display: flex; - justify-content: center; - align-items: center; - width: var(--wui-icon-box-size-xl); - height: var(--wui-icon-box-size-xl); - box-shadow: 0 0 0 8px var(--wui-thumbnail-border); - border-radius: var(--local-border-radius); - overflow: hidden; - } - - wui-icon { - width: 32px; - height: 32px; - } -`;var qL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let f5=class extends He{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,X`${this.templateVisual()}`}templateVisual(){return this.imageSrc?X``:X``}};f5.styles=[Wt,Imt];qL([ce()],f5.prototype,"imageSrc",void 0);qL([ce()],f5.prototype,"alt",void 0);qL([ce({type:Boolean})],f5.prototype,"borderRadiusFull",void 0);f5=qL([Fe("wui-visual-thumbnail")],f5);const kmt=Je` - :host { - display: block; - } - - button { - width: 100%; - display: block; - padding-top: var(--wui-spacing-l); - padding-bottom: var(--wui-spacing-l); - padding-left: var(--wui-spacing-s); - padding-right: var(--wui-spacing-2l); - border-radius: var(--wui-border-radius-s); - background-color: var(--wui-color-accent-glass-010); - } - - button:hover { - background-color: var(--wui-color-accent-glass-015) !important; - } - - button:active { - background-color: var(--wui-color-accent-glass-020) !important; - } -`;var YL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let d5=class extends He{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return X` - - `}};d5.styles=[Wt,hn,kmt];YL([ce()],d5.prototype,"label",void 0);YL([ce()],d5.prototype,"description",void 0);YL([ce()],d5.prototype,"icon",void 0);d5=YL([Fe("wui-notice-card")],d5);const Pmt=Je` - button { - height: auto; - position: relative; - flex-direction: column; - gap: var(--wui-spacing-s); - padding: 17px 18px 17px var(--wui-spacing-m); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-250); - } - - .overflowedContent { - width: 100%; - overflow: hidden; - } - - .overflowedContent[data-active='false']:after { - content: ''; - position: absolute; - top: 50%; - left: 0; - right: 0; - bottom: 0; - background: linear-gradient(to top, var(--wui-color-bg-150), transparent); - border-bottom-left-radius: var(--wui-border-radius-xs); - border-bottom-right-radius: var(--wui-border-radius-xs); - } - - .heightContent { - max-height: 100px; - } - - pre { - text-align: left; - white-space: pre-wrap; - height: auto; - overflow-x: auto; - overflow-wrap: anywhere; - } -`;var wJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const UU=100;let xT=class extends He{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var n,i;const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".heightContent"),r=(i=this.shadowRoot)==null?void 0:i.querySelector(".textContent");if(e&&r){this.scrollElement=e;const a=r==null?void 0:r.scrollHeight;a&&a>UU&&(this.enableAccordion=!0,this.scrollHeightElement=a,this.requestUpdate())}})}render(){return X` - - `}onClick(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${UU}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${UU}px`}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?X` `:null}};xT.styles=[Wt,hn,Pmt];wJ([ce()],xT.prototype,"textTitle",void 0);wJ([ce()],xT.prototype,"overflowedContent",void 0);xT=wJ([Fe("wui-list-accordion")],xT);const Rmt=Je` - :host { - display: flex; - column-gap: var(--wui-spacing-s); - padding: 17px 18px 17px var(--wui-spacing-m); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-250); - } - - wui-image { - width: var(--wui-icon-size-lg); - height: var(--wui-icon-size-lg); - border-radius: var(--wui-border-radius-3xl); - } - - wui-icon { - width: var(--wui-icon-size-lg); - height: var(--wui-icon-size-lg); - } -`;var KL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let h5=class extends He{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return X` - - - ${this.textTitle} - - ${this.templateContent()} - - `}templateContent(){return this.imageSrc?X``:this.textValue?X` ${this.textValue} `:X``}};h5.styles=[Wt,hn,Rmt];KL([ce()],h5.prototype,"imageSrc",void 0);KL([ce()],h5.prototype,"textTitle",void 0);KL([ce()],h5.prototype,"textValue",void 0);h5=KL([Fe("wui-list-content")],h5);const Mmt=Je` - button { - column-gap: var(--wui-spacing-s); - padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); - width: 100%; - transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-100); - } - - button > wui-text:nth-child(2) { - display: flex; - flex: 1; - } - - button[data-transparent='true'] { - pointer-events: none; - background-color: transparent; - } - - button:hover { - background-color: var(--wui-color-gray-glass-002); - } - - button:active { - background-color: var(--wui-color-gray-glass-005); - } - - wui-image { - width: var(--wui-spacing-3xl); - height: var(--wui-spacing-3xl); - border-radius: 100%; - } - - button:disabled { - background-color: var(--wui-color-gray-glass-002); - opacity: 0.5; - cursor: not-allowed; - } - - button:disabled > wui-tag { - background-color: var(--wui-color-gray-glass-010); - color: var(--wui-color-fg-300); - } -`;var pS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let L1=class extends He{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return X` - - `}checkmarkTemplate(){return this.selected?X``:null}templateNetworkImage(){return this.imageSrc?X``:this.imageSrc?null:X``}};L1.styles=[Wt,hn,Mmt];pS([ce()],L1.prototype,"imageSrc",void 0);pS([ce()],L1.prototype,"name",void 0);pS([ce({type:Boolean})],L1.prototype,"disabled",void 0);pS([ce({type:Boolean})],L1.prototype,"selected",void 0);pS([ce({type:Boolean})],L1.prototype,"transparent",void 0);L1=pS([Fe("wui-list-network")],L1);const Dmt=Je` - :host { - display: flex; - flex-direction: column; - gap: var(--wui-spacing-l); - padding: 17px 18px 17px var(--wui-spacing-m); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-250); - } - - wui-image { - width: var(--wui-icon-size-lg); - height: var(--wui-icon-size-lg); - border-radius: var(--wui-border-radius-3xl); - } - - wui-icon { - width: var(--wui-icon-size-lg); - height: var(--wui-icon-size-lg); - } -`;var gS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let $1=class extends He{constructor(){super(...arguments),this.amount="",this.networkCurreny="",this.networkImageUrl="",this.receiverAddress="",this.addressExplorerUrl=""}render(){return X` - - Sending - - - ${this.amount} ${this.networkCurreny} - - ${this.templateNetworkVisual()} - - - - To - - - `}templateNetworkVisual(){return this.networkImageUrl?X``:X``}};$1.styles=[Wt,hn,Dmt];gS([ce()],$1.prototype,"amount",void 0);gS([ce()],$1.prototype,"networkCurreny",void 0);gS([ce()],$1.prototype,"networkImageUrl",void 0);gS([ce()],$1.prototype,"receiverAddress",void 0);gS([ce()],$1.prototype,"addressExplorerUrl",void 0);$1=gS([Fe("wui-list-wallet-transaction")],$1);const Nmt=Je` - button { - display: flex; - gap: var(--wui-spacing-3xs); - align-items: center; - padding: 6.25px var(--wui-spacing-xs) 7.25px var(--wui-spacing-s); - background-color: var(--wui-color-gray-glass-090); - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-060); - transition: background-color var(--wui-duration-md) var(--wui-ease-inout-power-1); - will-change: background-color; - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled { - background-color: var(--wui-color-gray-glass-080); - } - - button:active:enabled { - background-color: var(--wui-color-gray-glass-060); - } - } -`;var $Ce=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let YD=class extends He{constructor(){super(...arguments),this.text=""}render(){return X``}};YD.styles=[Wt,hn,Nmt];$Ce([ce()],YD.prototype,"text",void 0);YD=$Ce([Fe("wui-promo")],YD);const Omt=Je` - span { - font-weight: 500; - font-size: 40px; - color: var(--wui-color-fg-100); - line-height: 130%; /* 52px */ - letter-spacing: -1.6px; - text-align: center; - } - - .pennies { - color: var(--wui-color-fg-200); - } -`;var bJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let _T=class extends He{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return X`$${this.dollars}.${this.pennies}`}};_T.styles=[Wt,Omt];bJ([ce()],_T.prototype,"dollars",void 0);bJ([ce()],_T.prototype,"pennies",void 0);_T=bJ([Fe("wui-balance")],_T);const Lmt=Je` - button { - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-002); - padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); - position: relative; - } - - wui-avatar { - width: 32px; - height: 32px; - box-shadow: 0 0 0 0; - outline: 3px solid var(--wui-color-gray-glass-005); - } - - wui-icon-box, - wui-image { - width: 16px; - height: 16px; - border-radius: var(--wui-border-radius-3xl); - position: absolute; - left: 26px; - top: 24px; - } - - wui-image { - outline: 2px solid var(--wui-color-bg-125); - } - - wui-icon-box { - outline: 2px solid var(--wui-color-bg-200); - background-color: var(--wui-color-bg-250); - } -`;var vS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let B1=class extends He{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return X``}networkImageTemplate(){return this.networkSrc?X``:X` - - `}};B1.styles=[Wt,hn,Lmt];vS([ce()],B1.prototype,"networkSrc",void 0);vS([ce()],B1.prototype,"avatarSrc",void 0);vS([ce()],B1.prototype,"profileName",void 0);vS([ce()],B1.prototype,"address",void 0);vS([ce()],B1.prototype,"icon",void 0);B1=vS([Fe("wui-profile-button")],B1);const $mt=Je` - button { - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-002); - padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); - position: relative; - } - - wui-avatar { - width: 32px; - height: 32px; - box-shadow: 0 0 0 0; - outline: 3px solid var(--wui-color-gray-glass-005); - } - - wui-icon-box, - wui-image { - width: 16px; - height: 16px; - border-radius: var(--wui-border-radius-3xl); - position: absolute; - left: 26px; - top: 24px; - } - - wui-image { - outline: 2px solid var(--wui-color-bg-125); - } - - wui-icon-box { - outline: 2px solid var(--wui-color-bg-200); - background-color: var(--wui-color-bg-250); - } -`;var V2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Jg=class extends He{constructor(){super(...arguments),this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="mail",this.connectedConnector=jn.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH"}render(){return X``}handleClick(e){var r,n;if(e.target instanceof HTMLElement&&e.target.id==="copy-address"){(r=this.onCopyClick)==null||r.call(this,e);return}(n=this.onProfileClick)==null||n.call(this,e)}getIconTemplate(e){return X` - - `}};Jg.styles=[Wt,hn,$mt];V2([ce()],Jg.prototype,"avatarSrc",void 0);V2([ce()],Jg.prototype,"profileName",void 0);V2([ce()],Jg.prototype,"address",void 0);V2([ce()],Jg.prototype,"icon",void 0);V2([ce()],Jg.prototype,"onProfileClick",void 0);V2([ce()],Jg.prototype,"onCopyClick",void 0);Jg=V2([Fe("wui-profile-button-v2")],Jg);const Bmt=Je` - button { - border: none; - border-radius: var(--wui-border-radius-3xl); - } - - button[data-variant='main'] { - background-color: var(--wui-color-accent-100); - color: var(--wui-color-inverse-100); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - button[data-variant='accent'] { - background-color: var(--wui-color-accent-glass-010); - color: var(--wui-color-accent-100); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - button[data-variant='gray'] { - background-color: transparent; - color: var(--wui-color-fg-200); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - button[data-variant='shade'] { - background-color: transparent; - color: var(--wui-color-accent-100); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - button[data-size='sm'] { - height: 32px; - padding: 0 var(--wui-spacing-s); - } - - button[data-size='md'] { - height: 40px; - padding: 0 var(--wui-spacing-l); - } - - button[data-size='sm'] > wui-image { - width: 16px; - height: 16px; - } - - button[data-size='md'] > wui-image { - width: 24px; - height: 24px; - } - - button[data-size='sm'] > wui-icon { - width: 12px; - height: 12px; - } - - button[data-size='md'] > wui-icon { - width: 14px; - height: 14px; - } - - wui-image { - border-radius: var(--wui-border-radius-3xl); - overflow: hidden; - } - - button.disabled > wui-icon, - button.disabled > wui-image { - filter: grayscale(1); - } - - button[data-variant='main'] > wui-image { - box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); - } - - button[data-variant='shade'] > wui-image, - button[data-variant='gray'] > wui-image { - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - @media (hover: hover) and (pointer: fine) { - button[data-variant='main']:focus-visible { - background-color: var(--wui-color-accent-090); - } - - button[data-variant='main']:hover:enabled { - background-color: var(--wui-color-accent-090); - } - - button[data-variant='main']:active:enabled { - background-color: var(--wui-color-accent-080); - } - - button[data-variant='accent']:hover:enabled { - background-color: var(--wui-color-accent-glass-015); - } - - button[data-variant='accent']:active:enabled { - background-color: var(--wui-color-accent-glass-020); - } - - button[data-variant='shade']:focus-visible, - button[data-variant='gray']:focus-visible, - button[data-variant='shade']:hover, - button[data-variant='gray']:hover { - background-color: var(--wui-color-gray-glass-002); - } - - button[data-variant='gray']:active, - button[data-variant='shade']:active { - background-color: var(--wui-color-gray-glass-005); - } - } - - button.disabled { - color: var(--wui-color-gray-glass-020); - background-color: var(--wui-color-gray-glass-002); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - pointer-events: none; - } -`;var G2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let ev=class extends He{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){const e=this.size==="sm"?"small-600":"paragraph-600";return X` - - `}};ev.styles=[Wt,hn,Bmt];G2([ce()],ev.prototype,"variant",void 0);G2([ce()],ev.prototype,"imageSrc",void 0);G2([ce({type:Boolean})],ev.prototype,"disabled",void 0);G2([ce()],ev.prototype,"icon",void 0);G2([ce()],ev.prototype,"size",void 0);G2([ce()],ev.prototype,"text",void 0);ev=G2([Fe("wui-chip-button")],ev);const Fmt=Je` - button { - display: flex; - gap: var(--wui-spacing-xl); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xxs); - padding: var(--wui-spacing-m) var(--wui-spacing-s); - } - - wui-text { - width: 100%; - } - - wui-flex { - width: auto; - } - - .network-icon { - width: var(--wui-spacing-2l); - height: var(--wui-spacing-2l); - border-radius: calc(var(--wui-spacing-2l) / 2); - overflow: hidden; - box-shadow: - 0 0 0 3px var(--wui-color-gray-glass-002), - 0 0 0 3px var(--wui-color-modal-bg); - } -`;var xJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let ST=class extends He{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return X` - - `}networksTemplate(){const e=this.networkImages.slice(0,5);return X` - ${e==null?void 0:e.map(r=>X` `)} - `}};ST.styles=[Wt,hn,Fmt];xJ([ce({type:Array})],ST.prototype,"networkImages",void 0);xJ([ce()],ST.prototype,"text",void 0);ST=xJ([Fe("wui-compatible-network")],ST);const jmt=Je` - wui-flex { - width: 100%; - background-color: var(--wui-color-gray-glass-005); - border-radius: var(--wui-border-radius-s); - padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) - var(--wui-spacing-1xs); - } -`;var _J=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let CT=class extends He{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return X` - - - ${this.text} - - `}};CT.styles=[Wt,hn,jmt];_J([ce()],CT.prototype,"icon",void 0);_J([ce()],CT.prototype,"text",void 0);CT=_J([Fe("wui-banner")],CT);const Umt=Je` - wui-flex { - width: 100%; - background-color: var(--wui-color-gray-glass-005); - border-radius: var(--wui-border-radius-m); - padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) - var(--wui-spacing-1xs); - } -`;var ZL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let p5=class extends He{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return X` - - - ${this.text} - - `}};p5.styles=[Wt,hn,Umt];ZL([ce()],p5.prototype,"imageSrc",void 0);ZL([ce()],p5.prototype,"text",void 0);ZL([ce()],p5.prototype,"size",void 0);p5=ZL([Fe("wui-banner-img")],p5);const zmt=Je` - button { - padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); - display: flex; - justify-content: space-between; - width: 100%; - border-radius: var(--wui-border-radius-xs); - background-color: var(--wui-color-gray-glass-002); - } - - button[data-clickable='false'] { - pointer-events: none; - background-color: transparent; - } - - wui-image, - wui-icon { - width: var(--wui-spacing-3xl); - height: var(--wui-spacing-3xl); - } - - wui-image { - border-radius: var(--wui-border-radius-3xl); - } -`;var W2=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let tv=class extends He{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return X` - - `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?X``:X``}};tv.styles=[Wt,hn,zmt];W2([ce()],tv.prototype,"tokenName",void 0);W2([ce()],tv.prototype,"tokenImageUrl",void 0);W2([ce({type:Number})],tv.prototype,"tokenValue",void 0);W2([ce()],tv.prototype,"tokenAmount",void 0);W2([ce()],tv.prototype,"tokenCurrency",void 0);W2([ce({type:Boolean})],tv.prototype,"clickable",void 0);tv=W2([Fe("wui-list-token")],tv);const Hmt=Je` - button { - width: 100%; - display: flex; - gap: var(--wui-spacing-s); - align-items: center; - justify-content: flex-start; - padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - } - - wui-icon-box { - width: var(--wui-spacing-2xl); - height: var(--wui-spacing-2xl); - } - - wui-flex { - width: auto; - } -`;var ly=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Jp=class extends He{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return X` - - `}titleTemplate(){return this.tag?X` ${this.text}${this.tag} - `:X`${this.text}`}};Jp.styles=[Wt,hn,Hmt];ly([ce()],Jp.prototype,"icon",void 0);ly([ce()],Jp.prototype,"text",void 0);ly([ce()],Jp.prototype,"description",void 0);ly([ce()],Jp.prototype,"tag",void 0);ly([ce()],Jp.prototype,"iconBackgroundColor",void 0);ly([ce()],Jp.prototype,"iconColor",void 0);ly([ce({type:Boolean})],Jp.prototype,"disabled",void 0);Jp=ly([Fe("wui-list-description")],Jp);const Vmt=Je` - :host { - position: relative; - display: inline-block; - } - - input { - background: transparent; - width: 100%; - height: auto; - font-family: var(--wui-font-family); - color: var(--wui-color-fg-100); - - font-feature-settings: 'case' on; - font-size: 32px; - font-weight: var(--wui-font-weight-light); - caret-color: var(--wui-color-accent-100); - line-height: 130%; - letter-spacing: -1.28px; - box-sizing: border-box; - -webkit-appearance: none; - -moz-appearance: textfield; - padding: 0px; - } - - input::-webkit-outer-spin-button, - input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } - - input::placeholder { - color: var(--wui-color-fg-275); - } -`,Gmt=/[.*+?^${}()|[\]\\]/gu,Wmt=/[0-9,.]/u;var QL=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let g5=class extends He{constructor(){super(...arguments),this.inputElementRef=D1(),this.disabled=!1,this.value="",this.placeholder="0"}render(){var e;return(e=this.inputElementRef)!=null&&e.value&&this.value&&(this.inputElementRef.value.value=this.value),X` `}dispatchInputChangeEvent(e){var n,i;const r=e.data;if(r&&((n=this.inputElementRef)!=null&&n.value))if(r===","){const a=this.inputElementRef.value.value.replace(",",".");this.inputElementRef.value.value=a,this.value=`${this.value}${a}`}else Wmt.test(r)||(this.inputElementRef.value.value=this.value.replace(new RegExp(r.replace(Gmt,"\\$&"),"gu"),""));this.dispatchEvent(new CustomEvent("inputChange",{detail:(i=this.inputElementRef.value)==null?void 0:i.value,bubbles:!0,composed:!0}))}};g5.styles=[Wt,hn,Vmt];QL([ce({type:Boolean})],g5.prototype,"disabled",void 0);QL([ce({type:String})],g5.prototype,"value",void 0);QL([ce({type:String})],g5.prototype,"placeholder",void 0);g5=QL([Fe("wui-input-amount")],g5);const qmt=Je` - :host { - display: flex; - gap: var(--wui-spacing-xs); - border-radius: var(--wui-border-radius-3xl); - border: 1px solid var(--wui-color-gray-glass-002); - background: var(--wui-color-gray-glass-002); - padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs) - var(--wui-spacing-s); - align-items: center; - } - - wui-avatar, - wui-icon, - wui-image { - width: 32px; - height: 32px; - border: 1px solid var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-3xl); - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002); - } -`;var g8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Vb=class extends He{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return X`${this.text} - ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?X``:this.imageSrc?X``:X``}};Vb.styles=[Wt,hn,qmt];g8([ce()],Vb.prototype,"text",void 0);g8([ce()],Vb.prototype,"address",void 0);g8([ce()],Vb.prototype,"imageSrc",void 0);g8([ce({type:Boolean})],Vb.prototype,"isAddress",void 0);Vb=g8([Fe("wui-preview-item")],Vb);const Ymt=Je` - button { - padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); - display: flex; - justify-content: space-between; - width: 100%; - border-radius: var(--wui-border-radius-xs); - background-color: var(--wui-color-gray-glass-002); - } - - button[data-clickable='false'] { - pointer-events: none; - background-color: transparent; - } - - wui-image { - width: var(--wui-spacing-3xl); - height: var(--wui-spacing-3xl); - border-radius: var(--wui-border-radius-3xl); - } - - wui-avatar { - width: var(--wui-spacing-3xl); - height: var(--wui-spacing-3xl); - box-shadow: 0 0 0 0; - } - .address { - color: var(--wui-color-fg-base-100); - } - .address-description { - text-transform: capitalize; - color: var(--wui-color-fg-base-200); - } - - wui-icon-box { - position: relative; - right: 15px; - top: 15px; - border: 2px solid var(--wui-color-bg-150); - background-color: var(--wui-color-bg-125); - } -`;var v8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Gb=class extends He{constructor(){super(...arguments),this.accountAddress="",this.accountType="",this.connectedConnector=jn.getConnectedConnector(),this.labels=Ze.state.addressLabels,this.caipNetwork=Pe.state.activeCaipNetwork,this.socialProvider=jn.getConnectedSocialProvider(),this.balance=0,this.fetchingBalance=!0,this.shouldShowIcon=!1,this.selected=!1}connectedCallback(){var e;super.connectedCallback(),Ma.getBalance(this.accountAddress,(e=this.caipNetwork)==null?void 0:e.id).then(r=>{let n=this.balance;r.balances.length>0&&(n=r.balances.reduce((i,a)=>i+((a==null?void 0:a.value)||0),0)),this.balance=n,this.fetchingBalance=!1,this.requestUpdate()})}render(){const e=this.getLabel();return this.shouldShowIcon=this.connectedConnector==="AUTH",X` - - - - ${this.shouldShowIcon?X``:X``} - - ${Tr.getTruncateString({string:this.accountAddress,charsStart:4,charsEnd:6,truncate:"middle"})} - ${e} - - - ${this.fetchingBalance?X``:X` $${this.balance.toFixed(2)}`} - - - - `}getLabel(){var r;let e=(r=this.labels)==null?void 0:r.get(this.accountAddress);return!e&&this.connectedConnector==="AUTH"?e=`${this.accountType==="eoa"?this.socialProvider??"Email":"Smart"} Account`:!e&&this.connectedConnector==="INJECTED"||this.connectedConnector==="ANNOUNCED"?e="Injected Account":e||(e="EOA"),e}};Gb.styles=[Wt,hn,Ymt];v8([ce()],Gb.prototype,"accountAddress",void 0);v8([ce()],Gb.prototype,"accountType",void 0);v8([ce({type:Boolean})],Gb.prototype,"selected",void 0);v8([ce({type:Function})],Gb.prototype,"onSelect",void 0);Gb=v8([Fe("wui-list-account")],Gb);const Kmt=Je` - :host { - position: relative; - } - - button { - display: flex; - justify-content: center; - align-items: center; - height: 48px; - width: 100%; - background-color: var(--wui-color-accent-glass-010); - border-radius: var(--wui-border-radius-xs); - border: 1px solid var(--wui-color-accent-glass-010); - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: background-color; - } - - wui-tooltip { - padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); - position: absolute; - top: -8px; - left: 50%; - transform: translate(-50%, -100%); - opacity: 0; - display: none; - } - - @media (hover: hover) and (pointer: fine) { - button:hover:enabled { - background-color: var(--wui-color-accent-glass-015); - } - - button:active:enabled { - background-color: var(--wui-color-accent-glass-020); - } - } -`;var SJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let AT=class extends He{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return X``}};AT.styles=[Wt,hn,Kmt];SJ([ce()],AT.prototype,"text",void 0);SJ([ce()],AT.prototype,"icon",void 0);AT=SJ([Fe("wui-icon-button")],AT);const Zmt=Je` - button { - column-gap: var(--wui-spacing-s); - padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs); - width: 100%; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-100); - justify-content: center; - align-items: center; - } - - button:disabled { - background-color: var(--wui-color-gray-glass-015); - color: var(--wui-color-gray-glass-015); - } -`;var CJ=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let TT=class extends He{constructor(){super(...arguments),this.text="",this.disabled=!1}render(){return X` - - `}};TT.styles=[Wt,hn,Zmt];CJ([ce()],TT.prototype,"text",void 0);CJ([ce({type:Boolean})],TT.prototype,"disabled",void 0);TT=CJ([Fe("wui-list-button")],TT);const Qmt=Je` - button { - column-gap: var(--wui-spacing-s); - padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); - width: 100%; - justify-content: flex-start; - background-color: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - color: var(--wui-color-fg-100); - } - - wui-text { - text-transform: capitalize; - } - - wui-text[data-align='left'] { - display: flex; - flex: 1; - } - - wui-text[data-align='center'] { - display: flex; - flex: 1; - justify-content: center; - } - - .invisible { - opacity: 0; - pointer-events: none; - } - - button:disabled { - background-color: var(--wui-color-gray-glass-015); - color: var(--wui-color-gray-glass-015); - } -`;var m8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Wb=class extends He{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return X` - - `}templatePlacement(){return this.align==="center"?X` `:null}};Wb.styles=[Wt,hn,Qmt];m8([ce()],Wb.prototype,"logo",void 0);m8([ce()],Wb.prototype,"name",void 0);m8([ce()],Wb.prototype,"align",void 0);m8([ce({type:Boolean})],Wb.prototype,"disabled",void 0);Wb=m8([Fe("wui-list-social")],Wb);const Xmt=Je` - button { - display: block; - display: flex; - align-items: center; - padding: var(--wui-spacing-xxs); - gap: var(--wui-spacing-xxs); - transition: all var(--wui-ease-out-power-1) var(--wui-duration-md); - border-radius: var(--wui-border-radius-xxs); - } - - wui-image { - border-radius: 100%; - width: var(--wui-spacing-xl); - height: var(--wui-spacing-xl); - } - - wui-icon-box { - width: var(--wui-spacing-xl); - height: var(--wui-spacing-xl); - } - - button:hover { - background-color: var(--wui-color-gray-glass-002); - } - - button:active { - background-color: var(--wui-color-gray-glass-005); - } -`;var BCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let KD=class extends He{constructor(){super(...arguments),this.imageSrc=""}render(){return X``}imageTemplate(){return this.imageSrc?X``:X``}};KD.styles=[Wt,hn,OL,Xmt];BCe([ce()],KD.prototype,"imageSrc",void 0);KD=BCe([Fe("wui-select")],KD);const Jmt=Je` - :host { - display: grid; - width: inherit; - height: inherit; - } -`;var ed=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Nc=class extends He{render(){return this.style.cssText=` - grid-template-rows: ${this.gridTemplateRows}; - grid-template-columns: ${this.gridTemplateColumns}; - justify-items: ${this.justifyItems}; - align-items: ${this.alignItems}; - justify-content: ${this.justifyContent}; - align-content: ${this.alignContent}; - column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; - row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; - gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; - padding-top: ${this.padding&&Tr.getSpacingStyles(this.padding,0)}; - padding-right: ${this.padding&&Tr.getSpacingStyles(this.padding,1)}; - padding-bottom: ${this.padding&&Tr.getSpacingStyles(this.padding,2)}; - padding-left: ${this.padding&&Tr.getSpacingStyles(this.padding,3)}; - margin-top: ${this.margin&&Tr.getSpacingStyles(this.margin,0)}; - margin-right: ${this.margin&&Tr.getSpacingStyles(this.margin,1)}; - margin-bottom: ${this.margin&&Tr.getSpacingStyles(this.margin,2)}; - margin-left: ${this.margin&&Tr.getSpacingStyles(this.margin,3)}; - `,X``}};Nc.styles=[Wt,Jmt];ed([ce()],Nc.prototype,"gridTemplateRows",void 0);ed([ce()],Nc.prototype,"gridTemplateColumns",void 0);ed([ce()],Nc.prototype,"justifyItems",void 0);ed([ce()],Nc.prototype,"alignItems",void 0);ed([ce()],Nc.prototype,"justifyContent",void 0);ed([ce()],Nc.prototype,"alignContent",void 0);ed([ce()],Nc.prototype,"columnGap",void 0);ed([ce()],Nc.prototype,"rowGap",void 0);ed([ce()],Nc.prototype,"gap",void 0);ed([ce()],Nc.prototype,"padding",void 0);ed([ce()],Nc.prototype,"margin",void 0);Nc=ed([Fe("wui-grid")],Nc);const e1t=Je` - :host { - position: relative; - display: flex; - width: 100%; - height: 1px; - background-color: var(--wui-color-gray-glass-005); - justify-content: center; - align-items: center; - } - - :host > wui-text { - position: absolute; - padding: 0px 10px; - background-color: var(--wui-color-modal-bg); - } -`;var FCe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let ZD=class extends He{constructor(){super(...arguments),this.text=""}render(){return X`${this.template()}`}template(){return this.text?X`${this.text}`:null}};ZD.styles=[Wt,e1t];FCe([ce()],ZD.prototype,"text",void 0);ZD=FCe([Fe("wui-separator")],ZD);const s7={interpolate(t,e,r){if(t.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const n=t[0]||0,i=t[1]||0,a=e[0]||0,o=e[1]||0;return ri?o:(o-a)/(i-n)*(r-n)+a}},t1t=3,r1t=["receive","deposit","borrow","claim"],n1t=["withdraw","repay","burn"],Gw={getMonthName(t){const e=new Date;return e.setMonth(t),e.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(t,e){const r=KX.getYear(),n=this.getMonthName(e);return t===r?n:`${n} ${t}`},getTransactionImages(t){const[e,r]=t,n=!!e&&(t==null?void 0:t.every(o=>!!o.nft_info)),i=(t==null?void 0:t.length)>1;return(t==null?void 0:t.length)===2&&!n?[this.getTransactionImage(e),this.getTransactionImage(r)]:i?t.map(o=>this.getTransactionImage(o)):[this.getTransactionImage(e)]},getTransactionImage(t){return{type:Gw.getTransactionTransferTokenType(t),url:Gw.getTransactionImageURL(t)}},getTransactionImageURL(t){var i,a,o,s,l;let e;const r=!!(t!=null&&t.nft_info),n=!!(t!=null&&t.fungible_info);return t&&r?e=(o=(a=(i=t==null?void 0:t.nft_info)==null?void 0:i.content)==null?void 0:a.preview)==null?void 0:o.url:t&&n&&(e=(l=(s=t==null?void 0:t.fungible_info)==null?void 0:s.icon)==null?void 0:l.url),e},getTransactionTransferTokenType(t){if(t!=null&&t.fungible_info)return"FUNGIBLE";if(t!=null&&t.nft_info)return"NFT"},getTransactionDescriptions(t){var f,d,h;const e=(f=t==null?void 0:t.metadata)==null?void 0:f.operationType,r=t==null?void 0:t.transfers,n=((d=t==null?void 0:t.transfers)==null?void 0:d.length)>0,i=((h=t==null?void 0:t.transfers)==null?void 0:h.length)>1,a=n&&(r==null?void 0:r.every(p=>!!(p!=null&&p.fungible_info))),[o,s]=r;let l=this.getTransferDescription(o),c=this.getTransferDescription(s);if(!n)return(e==="send"||e==="receive")&&a?(l=Tr.getTruncateString({string:t==null?void 0:t.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),c=Tr.getTruncateString({string:t==null?void 0:t.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[l,c]):[t.metadata.status];if(i)return r.map(p=>this.getTransferDescription(p));let u="";return r1t.includes(e)?u="+":n1t.includes(e)&&(u="-"),l=u.concat(l),[l]},getTransferDescription(t){var r;let e="";return t&&(t!=null&&t.nft_info?e=((r=t==null?void 0:t.nft_info)==null?void 0:r.name)||"-":t!=null&&t.fungible_info&&(e=this.getFungibleTransferDescription(t)||"-")),e},getFungibleTransferDescription(t){var n;return t?[this.getQuantityFixedValue(t==null?void 0:t.quantity.numeric),(n=t==null?void 0:t.fungible_info)==null?void 0:n.symbol].join(" ").trim():null},getQuantityFixedValue(t){return t?parseFloat(t).toFixed(t1t):null}},Sn={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",WALLET_STANDARD_CONNECTOR_ID:"announced",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",AUTH_CONNECTOR_ID:"w3mAuth",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"}},Rf={ConnectorExplorerIds:{[Sn.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[Sn.COINBASE_SDK_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[Sn.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[Sn.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[Sn.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Sn.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Sn.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[Sn.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[Sn.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[Sn.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[Sn.INJECTED_CONNECTOR_ID]:"Browser Wallet",[Sn.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[Sn.COINBASE_CONNECTOR_ID]:"Coinbase",[Sn.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[Sn.LEDGER_CONNECTOR_ID]:"Ledger",[Sn.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[Sn.INJECTED_CONNECTOR_ID]:"INJECTED",[Sn.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[Sn.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[Sn.AUTH_CONNECTOR_ID]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},Gce={getCaipTokens(t){if(!t)return;const e={};return Object.entries(t).forEach(([r,n])=>{e[`${Sn.EIP155}:${r}`]=n}),e}},ET={UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:"Unauthorized: origin not allowed"},ALERT_ERRORS:{INVALID_APP_CONFIGURATION:{shortMessage:"Invalid App Configuration",longMessage:()=>`Origin ${Wce()?window.origin:"unknown"} not found on Allowlist - update configuration`},INVALID_APP_CONFIGURATION_SOCIALS:{shortMessage:"Invalid App Configuration",longMessage:()=>`Origin ${Wce()?window.origin:"unknown"} not found on Allowlist - update configuration to enable social login`},PROJECT_ID_NOT_CONFIGURED:{shortMessage:"Project ID Not Configured",longMessage:"Project ID Not Configured - update configuration"}}};function Wce(){return typeof window<"u"}const i1t={createLogger(t,e="error"){const r=dS({level:e}),{logger:n}=JX({opts:r});return n.error=(...i)=>{for(const a of i)if(a instanceof Error){t(a,...i);break}t(new Error,...i)},n}};var QD;(function(t){t.Google="google",t.Github="github",t.Apple="apple",t.Facebook="facebook",t.X="x",t.Discord="discord",t.Farcaster="farcaster"})(QD||(QD={}));var AJ={exports:{}},v3=typeof Reflect=="object"?Reflect:null,qce=v3&&typeof v3.apply=="function"?v3.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},UR;v3&&typeof v3.ownKeys=="function"?UR=v3.ownKeys:Object.getOwnPropertySymbols?UR=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:UR=function(e){return Object.getOwnPropertyNames(e)};function a1t(t){console&&console.warn&&console.warn(t)}var jCe=Number.isNaN||function(e){return e!==e};function Fi(){Fi.init.call(this)}AJ.exports=Fi;AJ.exports.once=c1t;Fi.EventEmitter=Fi;Fi.prototype._events=void 0;Fi.prototype._eventsCount=0;Fi.prototype._maxListeners=void 0;var Yce=10;function XL(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Fi,"defaultMaxListeners",{enumerable:!0,get:function(){return Yce},set:function(t){if(typeof t!="number"||t<0||jCe(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Yce=t}});Fi.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Fi.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||jCe(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function UCe(t){return t._maxListeners===void 0?Fi.defaultMaxListeners:t._maxListeners}Fi.prototype.getMaxListeners=function(){return UCe(this)};Fi.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(l===void 0)return!1;if(typeof l=="function")qce(l,this,r);else for(var c=l.length,u=WCe(l,c),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=o.length,a1t(s)}return t}Fi.prototype.addListener=function(e,r){return zCe(this,e,r,!1)};Fi.prototype.on=Fi.prototype.addListener;Fi.prototype.prependListener=function(e,r){return zCe(this,e,r,!0)};function o1t(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function HCe(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=o1t.bind(n);return i.listener=r,n.wrapFn=i,i}Fi.prototype.once=function(e,r){return XL(r),this.on(e,HCe(this,e,r)),this};Fi.prototype.prependOnceListener=function(e,r){return XL(r),this.prependListener(e,HCe(this,e,r)),this};Fi.prototype.removeListener=function(e,r){var n,i,a,o,s;if(XL(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){s=n[o].listener,a=o;break}if(a<0)return this;a===0?n.shift():s1t(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};Fi.prototype.off=Fi.prototype.removeListener;Fi.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function VCe(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?l1t(i):WCe(i,i.length)}Fi.prototype.listeners=function(e){return VCe(this,e,!0)};Fi.prototype.rawListeners=function(e){return VCe(this,e,!1)};Fi.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):GCe.call(t,e)};Fi.prototype.listenerCount=GCe;function GCe(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Fi.prototype.eventNames=function(){return this._eventsCount>0?UR(this._events):[]};function WCe(t,e){for(var r=new Array(e),n=0;n=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function p1t(t,e){return function(r,n){e(r,n,t)}}function g1t(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function v1t(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((n=n.apply(t,e||[])).next())})}function m1t(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function YCe(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function b1t(){for(var t=[],e=0;e1||s(d,h)})})}function s(d,h){try{l(n[d](h))}catch(p){f(a[0][3],p)}}function l(d){d.value instanceof IT?Promise.resolve(d.value.v).then(c,u):f(a[0][2],d)}function c(d){s("next",d)}function u(d){s("throw",d)}function f(d,h){d(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function S1t(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(o){return(r=!r)?{value:IT(t[i](o)),done:i==="return"}:a?a(o):o}:a}}function C1t(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Lq=="function"?Lq(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(o){return new Promise(function(s,l){o=t[a](o),i(s,l,o.done,o.value)})}}function i(a,o,s,l){Promise.resolve(l).then(function(c){a({value:c,done:s})},o)}}function A1t(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function T1t(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function E1t(t){return t&&t.__esModule?t:{default:t}}function I1t(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function k1t(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const P1t=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Oq},__asyncDelegator:S1t,__asyncGenerator:_1t,__asyncValues:C1t,__await:IT,__awaiter:v1t,__classPrivateFieldGet:I1t,__classPrivateFieldSet:k1t,__createBinding:y1t,__decorate:h1t,__exportStar:w1t,__extends:f1t,__generator:m1t,__importDefault:E1t,__importStar:T1t,__makeTemplateObject:A1t,__metadata:g1t,__param:p1t,__read:YCe,__rest:d1t,__spread:b1t,__spreadArrays:x1t,__values:Lq},Symbol.toStringTag,{value:"Module"})),y8=bQ(P1t);var zU={},zC={},Kce;function R1t(){if(Kce)return zC;Kce=1,Object.defineProperty(zC,"__esModule",{value:!0}),zC.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return zC.delay=t,zC}var By={},HU={},Fy={},Zce;function M1t(){return Zce||(Zce=1,Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.ONE_THOUSAND=Fy.ONE_HUNDRED=void 0,Fy.ONE_HUNDRED=100,Fy.ONE_THOUSAND=1e3),Fy}var VU={},Qce;function D1t(){return Qce||(Qce=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(VU)),VU}var Xce;function KCe(){return Xce||(Xce=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=y8;e.__exportStar(M1t(),t),e.__exportStar(D1t(),t)}(HU)),HU}var Jce;function N1t(){if(Jce)return By;Jce=1,Object.defineProperty(By,"__esModule",{value:!0}),By.fromMiliseconds=By.toMiliseconds=void 0;const t=KCe();function e(n){return n*t.ONE_THOUSAND}By.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return By.fromMiliseconds=r,By}var eue;function O1t(){return eue||(eue=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=y8;e.__exportStar(R1t(),t),e.__exportStar(N1t(),t)}(zU)),zU}var Vx={},tue;function L1t(){if(tue)return Vx;tue=1,Object.defineProperty(Vx,"__esModule",{value:!0}),Vx.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Vx.Watch=t,Vx.default=t,Vx}var GU={},HC={},rue;function $1t(){if(rue)return HC;rue=1,Object.defineProperty(HC,"__esModule",{value:!0}),HC.IWatch=void 0;class t{}return HC.IWatch=t,HC}var nue;function B1t(){return nue||(nue=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),y8.__exportStar($1t(),t)}(GU)),GU}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=y8;e.__exportStar(O1t(),t),e.__exportStar(L1t(),t),e.__exportStar(B1t(),t),e.__exportStar(KCe(),t)})(Ft);class q2{}let F1t=class extends q2{constructor(e){super()}};const iue=Ft.FIVE_SECONDS,mS={pulse:"heartbeat_pulse"};let j1t=class ZCe extends F1t{constructor(e){super(e),this.events=new td.EventEmitter,this.interval=iue,this.interval=(e==null?void 0:e.interval)||iue}static async init(e){const r=new ZCe(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Ft.toMiliseconds(this.interval))}pulse(){this.events.emit(mS.pulse)}};const U1t=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,z1t=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,H1t=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function V1t(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){G1t(t);return}return e}function G1t(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function l7(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!H1t.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(U1t.test(t)||z1t.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,V1t)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function W1t(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function es(t,...e){try{return W1t(t(...e))}catch(r){return Promise.reject(r)}}function q1t(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function Y1t(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function zR(t){if(q1t(t))return String(t);if(Y1t(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return zR(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function QCe(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const $q="base64:";function K1t(t){if(typeof t=="string")return t;QCe();const e=Buffer.from(t).toString("base64");return $q+e}function Z1t(t){return typeof t!="string"||!t.startsWith($q)?t:(QCe(),Buffer.from(t.slice($q.length),"base64"))}function dc(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Q1t(...t){return dc(t.join(":"))}function c7(t){return t=dc(t),t?t+":":""}const X1t="memory",J1t=()=>{const t=new Map;return{name:X1t,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function eyt(t={}){const e={mounts:{"":t.driver||J1t()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=c=>{for(const u of e.mountpoints)if(c.startsWith(u))return{base:u,relativeKey:c.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:c,driver:e.mounts[""]}},n=(c,u)=>e.mountpoints.filter(f=>f.startsWith(c)||u&&c.startsWith(f)).map(f=>({relativeBase:c.length>f.length?c.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(c,u)=>{if(e.watching){u=dc(u);for(const f of e.watchListeners)f(c,u)}},a=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await aue(e.mounts[c],i,c)}},o=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},s=(c,u,f)=>{const d=new Map,h=p=>{let g=d.get(p.base);return g||(g={driver:p.driver,base:p.base,items:[]},d.set(p.base,g)),g};for(const p of c){const g=typeof p=="string",v=dc(g?p:p.key),y=g?void 0:p.value,m=g||!p.options?u:{...u,...p.options},b=r(v);h(b).items.push({key:v,value:y,relativeKey:b.relativeKey,options:m})}return Promise.all([...d.values()].map(p=>f(p))).then(p=>p.flat())},l={hasItem(c,u={}){c=dc(c);const{relativeKey:f,driver:d}=r(c);return es(d.hasItem,f,u)},getItem(c,u={}){c=dc(c);const{relativeKey:f,driver:d}=r(c);return es(d.getItem,f,u).then(h=>l7(h))},getItems(c,u){return s(c,u,f=>f.driver.getItems?es(f.driver.getItems,f.items.map(d=>({key:d.relativeKey,options:d.options})),u).then(d=>d.map(h=>({key:Q1t(f.base,h.key),value:l7(h.value)}))):Promise.all(f.items.map(d=>es(f.driver.getItem,d.relativeKey,d.options).then(h=>({key:d.key,value:l7(h)})))))},getItemRaw(c,u={}){c=dc(c);const{relativeKey:f,driver:d}=r(c);return d.getItemRaw?es(d.getItemRaw,f,u):es(d.getItem,f,u).then(h=>Z1t(h))},async setItem(c,u,f={}){if(u===void 0)return l.removeItem(c);c=dc(c);const{relativeKey:d,driver:h}=r(c);h.setItem&&(await es(h.setItem,d,zR(u),f),h.watch||i("update",c))},async setItems(c,u){await s(c,u,async f=>{if(f.driver.setItems)return es(f.driver.setItems,f.items.map(d=>({key:d.relativeKey,value:zR(d.value),options:d.options})),u);f.driver.setItem&&await Promise.all(f.items.map(d=>es(f.driver.setItem,d.relativeKey,zR(d.value),d.options)))})},async setItemRaw(c,u,f={}){if(u===void 0)return l.removeItem(c,f);c=dc(c);const{relativeKey:d,driver:h}=r(c);if(h.setItemRaw)await es(h.setItemRaw,d,u,f);else if(h.setItem)await es(h.setItem,d,K1t(u),f);else return;h.watch||i("update",c)},async removeItem(c,u={}){typeof u=="boolean"&&(u={removeMeta:u}),c=dc(c);const{relativeKey:f,driver:d}=r(c);d.removeItem&&(await es(d.removeItem,f,u),(u.removeMeta||u.removeMata)&&await es(d.removeItem,f+"$",u),d.watch||i("remove",c))},async getMeta(c,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),c=dc(c);const{relativeKey:f,driver:d}=r(c),h=Object.create(null);if(d.getMeta&&Object.assign(h,await es(d.getMeta,f,u)),!u.nativeOnly){const p=await es(d.getItem,f+"$",u).then(g=>l7(g));p&&typeof p=="object"&&(typeof p.atime=="string"&&(p.atime=new Date(p.atime)),typeof p.mtime=="string"&&(p.mtime=new Date(p.mtime)),Object.assign(h,p))}return h},setMeta(c,u,f={}){return this.setItem(c+"$",u,f)},removeMeta(c,u={}){return this.removeItem(c+"$",u)},async getKeys(c,u={}){c=c7(c);const f=n(c,!0);let d=[];const h=[];for(const p of f){const g=await es(p.driver.getKeys,p.relativeBase,u);for(const v of g){const y=p.mountpoint+dc(v);d.some(m=>y.startsWith(m))||h.push(y)}d=[p.mountpoint,...d.filter(v=>!v.startsWith(p.mountpoint))]}return c?h.filter(p=>p.startsWith(c)&&p[p.length-1]!=="$"):h.filter(p=>p[p.length-1]!=="$")},async clear(c,u={}){c=c7(c),await Promise.all(n(c,!1).map(async f=>{if(f.driver.clear)return es(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const d=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(d.map(h=>f.driver.removeItem(h,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(c=>oue(c)))},async watch(c){return await a(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==c),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(c,u){if(c=c7(c),c&&e.mounts[c])throw new Error(`already mounted at ${c}`);return c&&(e.mountpoints.push(c),e.mountpoints.sort((f,d)=>d.length-f.length)),e.mounts[c]=u,e.watching&&Promise.resolve(aue(u,i,c)).then(f=>{e.unwatch[c]=f}).catch(console.error),l},async unmount(c,u=!0){c=c7(c),!(!c||!e.mounts[c])&&(e.watching&&c in e.unwatch&&(e.unwatch[c](),delete e.unwatch[c]),u&&await oue(e.mounts[c]),e.mountpoints=e.mountpoints.filter(f=>f!==c),delete e.mounts[c])},getMount(c=""){c=dc(c)+":";const u=r(c);return{driver:u.driver,base:u.base}},getMounts(c="",u={}){return c=dc(c),n(c,u.parents).map(d=>({driver:d.driver,base:d.mountpoint}))},keys:(c,u={})=>l.getKeys(c,u),get:(c,u={})=>l.getItem(c,u),set:(c,u,f={})=>l.setItem(c,u,f),has:(c,u={})=>l.hasItem(c,u),del:(c,u={})=>l.removeItem(c,u),remove:(c,u={})=>l.removeItem(c,u)};return l}function aue(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function oue(t){typeof t.dispose=="function"&&await es(t.dispose)}function Y2(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function XCe(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Y2(r);return(i,a)=>n.then(o=>a(o.transaction(e,i).objectStore(e)))}let WU;function w8(){return WU||(WU=XCe("keyval-store","keyval")),WU}function sue(t,e=w8()){return e("readonly",r=>Y2(r.get(t)))}function tyt(t,e,r=w8()){return r("readwrite",n=>(n.put(e,t),Y2(n.transaction)))}function ryt(t,e=w8()){return e("readwrite",r=>(r.delete(t),Y2(r.transaction)))}function nyt(t=w8()){return t("readwrite",e=>(e.clear(),Y2(e.transaction)))}function iyt(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Y2(t.transaction)}function ayt(t=w8()){return t("readonly",e=>{if(e.getAllKeys)return Y2(e.getAllKeys());const r=[];return iyt(e,n=>r.push(n.key)).then(()=>r)})}var lue={};const oyt="idb-keyval";var syt=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=XCe(t.dbName,t.storeName)),{name:oyt,options:t,async hasItem(i){return!(typeof await sue(r(i),n)>"u")},async getItem(i){return await sue(r(i),n)??null},setItem(i,a){return tyt(r(i),a,n)},removeItem(i){return ryt(r(i),n)},getKeys(){return ayt(n)},clear(){return nyt(n)}}};const lyt="WALLET_CONNECT_V2_INDEXED_DB",cyt="keyvaluestorage";let uyt=class{constructor(){this.indexedDb=eyt({driver:syt({dbName:lyt,storeName:cyt})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Yg(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var qU=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof lue<"u"?lue:typeof self<"u"?self:{},HR={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof qU<"u"&&qU.localStorage?HR.exports=qU.localStorage:typeof window<"u"&&window.localStorage?HR.exports=window.localStorage:HR.exports=new e})();function fyt(t){var e;return[t[0],Ob((e=t[1])!=null?e:"")]}let dyt=class{constructor(){this.localStorage=HR.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(fyt)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Ob(r)}async setItem(e,r){this.localStorage.setItem(e,Yg(r))}async removeItem(e){this.localStorage.removeItem(e)}};const hyt="wc_storage_version",cue=1,pyt=async(t,e,r)=>{const n=hyt,i=await e.getItem(n);if(i&&i>=cue){r(e);return}const a=await t.getKeys();if(!a.length){r(e);return}const o=[];for(;a.length;){const s=a.shift();if(!s)continue;const l=s.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const c=await t.getItem(s);await e.setItem(s,c),o.push(s)}}await e.setItem(n,cue),r(e),gyt(t,o)},gyt=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let vyt=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new dyt;this.storage=e;try{const r=new uyt;pyt(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}},myt=class extends q2{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},yyt=class extends q2{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},wyt=class{constructor(e,r){this.logger=e,this.core=r}},byt=class extends q2{constructor(e,r){super(),this.relayer=e,this.logger=r}},xyt=class extends q2{constructor(e){super()}},_yt=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},Syt=class extends q2{constructor(e,r){super(),this.relayer=e,this.logger=r}},Cyt=class extends q2{constructor(e,r){super(),this.core=e,this.logger=r}},Ayt=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},Tyt=class{constructor(e,r){this.projectId=e,this.logger=r}},Eyt=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},Iyt=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},kyt=class{constructor(e){this.client=e}};var EJ={},cy={},JL={},e$={};Object.defineProperty(e$,"__esModule",{value:!0});e$.BrowserRandomSource=void 0;const uue=65536;class Pyt{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n>>16&65535,u=s&65535,f=l>>>16&65535,d=l&65535;return u*d+(c*d+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(s,l){return s+l|0}t.add=r;function n(s,l){return s-l|0}t.sub=n;function i(s,l){return s<>>32-l}t.rotl=i;function a(s,l){return s<<32-l|s>>>l}t.rotr=a;function o(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(s){return t.isInteger(s)&&s>=-t.MAX_SAFE_INTEGER&&s<=t.MAX_SAFE_INTEGER}})(JCe);Object.defineProperty(kn,"__esModule",{value:!0});var e4e=JCe;function jyt(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}kn.readInt16BE=jyt;function Uyt(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}kn.readUint16BE=Uyt;function zyt(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}kn.readInt16LE=zyt;function Hyt(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}kn.readUint16LE=Hyt;function t4e(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}kn.writeUint16BE=t4e;kn.writeInt16BE=t4e;function r4e(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}kn.writeUint16LE=r4e;kn.writeInt16LE=r4e;function Bq(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}kn.readInt32BE=Bq;function Fq(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}kn.readUint32BE=Fq;function jq(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}kn.readInt32LE=jq;function Uq(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}kn.readUint32LE=Uq;function XD(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}kn.writeUint32BE=XD;kn.writeInt32BE=XD;function JD(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}kn.writeUint32LE=JD;kn.writeInt32LE=JD;function Vyt(t,e){e===void 0&&(e=0);var r=Bq(t,e),n=Bq(t,e+4);return r*4294967296+n-(n>>31)*4294967296}kn.readInt64BE=Vyt;function Gyt(t,e){e===void 0&&(e=0);var r=Fq(t,e),n=Fq(t,e+4);return r*4294967296+n}kn.readUint64BE=Gyt;function Wyt(t,e){e===void 0&&(e=0);var r=jq(t,e),n=jq(t,e+4);return n*4294967296+r-(r>>31)*4294967296}kn.readInt64LE=Wyt;function qyt(t,e){e===void 0&&(e=0);var r=Uq(t,e),n=Uq(t,e+4);return n*4294967296+r}kn.readUint64LE=qyt;function n4e(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),XD(t/4294967296>>>0,e,r),XD(t>>>0,e,r+4),e}kn.writeUint64BE=n4e;kn.writeInt64BE=n4e;function i4e(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),JD(t>>>0,e,r),JD(t/4294967296>>>0,e,r+4),e}kn.writeUint64LE=i4e;kn.writeInt64LE=i4e;function Yyt(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}kn.readUintBE=Yyt;function Kyt(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a=n;a--)r[a]=e/i&255,i*=256;return r}kn.writeUintBE=Zyt;function Qyt(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!e4e.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a256)throw new Error("randomString charset is too long");let d="";const h=u.length,p=256-256%h;for(;c>0;){const g=i(Math.ceil(c*256/p),f);for(let v=0;v0;v++){const y=g[v];y0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},s.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,d=c<<3,h=c%128<112?128:256;this._buffer[u]=128;for(var p=u+1;p0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},s.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},s.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},s}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(s,l,c,u,f,d,h){for(var p=c[0],g=c[1],v=c[2],y=c[3],m=c[4],b=c[5],w=c[6],C=c[7],A=u[0],S=u[1],I=u[2],D=u[3],L=u[4],O=u[5],P=u[6],x=u[7],T,E,N,F,B,j,k,$;h>=128;){for(var H=0;H<16;H++){var Y=8*H+d;s[H]=e.readUint32BE(f,Y),l[H]=e.readUint32BE(f,Y+4)}for(var H=0;H<80;H++){var ie=p,W=g,Q=v,J=y,ee=m,ne=b,V=w,oe=C,ye=A,Te=S,Me=I,Oe=D,nt=L,it=O,St=P,bt=x;if(T=C,E=x,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=(m>>>14|L<<18)^(m>>>18|L<<14)^(L>>>9|m<<23),E=(L>>>14|m<<18)^(L>>>18|m<<14)^(m>>>9|L<<23),B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,T=m&b^~m&w,E=L&O^~L&P,B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,T=i[H*2],E=i[H*2+1],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,T=s[H%16],E=l[H%16],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,N=k&65535|$<<16,F=B&65535|j<<16,T=N,E=F,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=(p>>>28|A<<4)^(A>>>2|p<<30)^(A>>>7|p<<25),E=(A>>>28|p<<4)^(p>>>2|A<<30)^(p>>>7|A<<25),B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,T=p&g^p&v^g&v,E=A&S^A&I^S&I,B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,oe=k&65535|$<<16,bt=B&65535|j<<16,T=J,E=Oe,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=N,E=F,B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,J=k&65535|$<<16,Oe=B&65535|j<<16,g=ie,v=W,y=Q,m=J,b=ee,w=ne,C=V,p=oe,S=ye,I=Te,D=Me,L=Oe,O=nt,P=it,x=St,A=bt,H%16===15)for(var Y=0;Y<16;Y++)T=s[Y],E=l[Y],B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=s[(Y+9)%16],E=l[(Y+9)%16],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,N=s[(Y+1)%16],F=l[(Y+1)%16],T=(N>>>1|F<<31)^(N>>>8|F<<24)^N>>>7,E=(F>>>1|N<<31)^(F>>>8|N<<24)^(F>>>7|N<<25),B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,N=s[(Y+14)%16],F=l[(Y+14)%16],T=(N>>>19|F<<13)^(F>>>29|N<<3)^N>>>6,E=(F>>>19|N<<13)^(N>>>29|F<<3)^(F>>>6|N<<26),B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,s[Y]=k&65535|$<<16,l[Y]=B&65535|j<<16}T=p,E=A,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[0],E=u[0],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[0]=p=k&65535|$<<16,u[0]=A=B&65535|j<<16,T=g,E=S,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[1],E=u[1],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[1]=g=k&65535|$<<16,u[1]=S=B&65535|j<<16,T=v,E=I,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[2],E=u[2],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[2]=v=k&65535|$<<16,u[2]=I=B&65535|j<<16,T=y,E=D,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[3],E=u[3],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[3]=y=k&65535|$<<16,u[3]=D=B&65535|j<<16,T=m,E=L,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[4],E=u[4],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[4]=m=k&65535|$<<16,u[4]=L=B&65535|j<<16,T=b,E=O,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[5],E=u[5],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[5]=b=k&65535|$<<16,u[5]=O=B&65535|j<<16,T=w,E=P,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[6],E=u[6],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[6]=w=k&65535|$<<16,u[6]=P=B&65535|j<<16,T=C,E=x,B=E&65535,j=E>>>16,k=T&65535,$=T>>>16,T=c[7],E=u[7],B+=E&65535,j+=E>>>16,k+=T&65535,$+=T>>>16,j+=B>>>16,k+=j>>>16,$+=k>>>16,c[7]=C=k&65535|$<<16,u[7]=x=B&65535|j<<16,d+=128,h-=128}return d}function o(s){var l=new n;l.update(s);var c=l.digest();return l.clean(),c}t.hash=o})(a4e);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=cy,r=a4e,n=Pu;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(J){const ee=new Float64Array(16);if(J)for(let ne=0;ne>16&1),ne[Te-1]&=65535;ne[15]=V[15]-32767-(ne[14]>>16&1);const ye=ne[15]>>16&1;ne[14]&=65535,g(V,ne,1-ye)}for(let oe=0;oe<16;oe++)J[2*oe]=V[oe]&255,J[2*oe+1]=V[oe]>>8}function y(J,ee){let ne=0;for(let V=0;V<32;V++)ne|=J[V]^ee[V];return(1&ne-1>>>8)-1}function m(J,ee){const ne=new Uint8Array(32),V=new Uint8Array(32);return v(ne,J),v(V,ee),y(ne,V)}function b(J){const ee=new Uint8Array(32);return v(ee,J),ee[0]&1}function w(J,ee){for(let ne=0;ne<16;ne++)J[ne]=ee[2*ne]+(ee[2*ne+1]<<8);J[15]&=32767}function C(J,ee,ne){for(let V=0;V<16;V++)J[V]=ee[V]+ne[V]}function A(J,ee,ne){for(let V=0;V<16;V++)J[V]=ee[V]-ne[V]}function S(J,ee,ne){let V,oe,ye=0,Te=0,Me=0,Oe=0,nt=0,it=0,St=0,bt=0,Ce=0,We=0,Le=0,Ke=0,qe=0,we=0,Se=0,q=0,z=0,G=0,re=0,ue=0,_e=0,Ee=0,et=0,pt=0,Ct=0,ot=0,Pt=0,mr=0,qt=0,Ur=0,Ir=0,yt=ne[0],Qt=ne[1],Xt=ne[2],$t=ne[3],hr=ne[4],lr=ne[5],Dt=ne[6],kr=ne[7],_r=ne[8],Jt=ne[9],Pr=ne[10],zr=ne[11],Zt=ne[12],Nr=ne[13],Sr=ne[14],Yt=ne[15];V=ee[0],ye+=V*yt,Te+=V*Qt,Me+=V*Xt,Oe+=V*$t,nt+=V*hr,it+=V*lr,St+=V*Dt,bt+=V*kr,Ce+=V*_r,We+=V*Jt,Le+=V*Pr,Ke+=V*zr,qe+=V*Zt,we+=V*Nr,Se+=V*Sr,q+=V*Yt,V=ee[1],Te+=V*yt,Me+=V*Qt,Oe+=V*Xt,nt+=V*$t,it+=V*hr,St+=V*lr,bt+=V*Dt,Ce+=V*kr,We+=V*_r,Le+=V*Jt,Ke+=V*Pr,qe+=V*zr,we+=V*Zt,Se+=V*Nr,q+=V*Sr,z+=V*Yt,V=ee[2],Me+=V*yt,Oe+=V*Qt,nt+=V*Xt,it+=V*$t,St+=V*hr,bt+=V*lr,Ce+=V*Dt,We+=V*kr,Le+=V*_r,Ke+=V*Jt,qe+=V*Pr,we+=V*zr,Se+=V*Zt,q+=V*Nr,z+=V*Sr,G+=V*Yt,V=ee[3],Oe+=V*yt,nt+=V*Qt,it+=V*Xt,St+=V*$t,bt+=V*hr,Ce+=V*lr,We+=V*Dt,Le+=V*kr,Ke+=V*_r,qe+=V*Jt,we+=V*Pr,Se+=V*zr,q+=V*Zt,z+=V*Nr,G+=V*Sr,re+=V*Yt,V=ee[4],nt+=V*yt,it+=V*Qt,St+=V*Xt,bt+=V*$t,Ce+=V*hr,We+=V*lr,Le+=V*Dt,Ke+=V*kr,qe+=V*_r,we+=V*Jt,Se+=V*Pr,q+=V*zr,z+=V*Zt,G+=V*Nr,re+=V*Sr,ue+=V*Yt,V=ee[5],it+=V*yt,St+=V*Qt,bt+=V*Xt,Ce+=V*$t,We+=V*hr,Le+=V*lr,Ke+=V*Dt,qe+=V*kr,we+=V*_r,Se+=V*Jt,q+=V*Pr,z+=V*zr,G+=V*Zt,re+=V*Nr,ue+=V*Sr,_e+=V*Yt,V=ee[6],St+=V*yt,bt+=V*Qt,Ce+=V*Xt,We+=V*$t,Le+=V*hr,Ke+=V*lr,qe+=V*Dt,we+=V*kr,Se+=V*_r,q+=V*Jt,z+=V*Pr,G+=V*zr,re+=V*Zt,ue+=V*Nr,_e+=V*Sr,Ee+=V*Yt,V=ee[7],bt+=V*yt,Ce+=V*Qt,We+=V*Xt,Le+=V*$t,Ke+=V*hr,qe+=V*lr,we+=V*Dt,Se+=V*kr,q+=V*_r,z+=V*Jt,G+=V*Pr,re+=V*zr,ue+=V*Zt,_e+=V*Nr,Ee+=V*Sr,et+=V*Yt,V=ee[8],Ce+=V*yt,We+=V*Qt,Le+=V*Xt,Ke+=V*$t,qe+=V*hr,we+=V*lr,Se+=V*Dt,q+=V*kr,z+=V*_r,G+=V*Jt,re+=V*Pr,ue+=V*zr,_e+=V*Zt,Ee+=V*Nr,et+=V*Sr,pt+=V*Yt,V=ee[9],We+=V*yt,Le+=V*Qt,Ke+=V*Xt,qe+=V*$t,we+=V*hr,Se+=V*lr,q+=V*Dt,z+=V*kr,G+=V*_r,re+=V*Jt,ue+=V*Pr,_e+=V*zr,Ee+=V*Zt,et+=V*Nr,pt+=V*Sr,Ct+=V*Yt,V=ee[10],Le+=V*yt,Ke+=V*Qt,qe+=V*Xt,we+=V*$t,Se+=V*hr,q+=V*lr,z+=V*Dt,G+=V*kr,re+=V*_r,ue+=V*Jt,_e+=V*Pr,Ee+=V*zr,et+=V*Zt,pt+=V*Nr,Ct+=V*Sr,ot+=V*Yt,V=ee[11],Ke+=V*yt,qe+=V*Qt,we+=V*Xt,Se+=V*$t,q+=V*hr,z+=V*lr,G+=V*Dt,re+=V*kr,ue+=V*_r,_e+=V*Jt,Ee+=V*Pr,et+=V*zr,pt+=V*Zt,Ct+=V*Nr,ot+=V*Sr,Pt+=V*Yt,V=ee[12],qe+=V*yt,we+=V*Qt,Se+=V*Xt,q+=V*$t,z+=V*hr,G+=V*lr,re+=V*Dt,ue+=V*kr,_e+=V*_r,Ee+=V*Jt,et+=V*Pr,pt+=V*zr,Ct+=V*Zt,ot+=V*Nr,Pt+=V*Sr,mr+=V*Yt,V=ee[13],we+=V*yt,Se+=V*Qt,q+=V*Xt,z+=V*$t,G+=V*hr,re+=V*lr,ue+=V*Dt,_e+=V*kr,Ee+=V*_r,et+=V*Jt,pt+=V*Pr,Ct+=V*zr,ot+=V*Zt,Pt+=V*Nr,mr+=V*Sr,qt+=V*Yt,V=ee[14],Se+=V*yt,q+=V*Qt,z+=V*Xt,G+=V*$t,re+=V*hr,ue+=V*lr,_e+=V*Dt,Ee+=V*kr,et+=V*_r,pt+=V*Jt,Ct+=V*Pr,ot+=V*zr,Pt+=V*Zt,mr+=V*Nr,qt+=V*Sr,Ur+=V*Yt,V=ee[15],q+=V*yt,z+=V*Qt,G+=V*Xt,re+=V*$t,ue+=V*hr,_e+=V*lr,Ee+=V*Dt,et+=V*kr,pt+=V*_r,Ct+=V*Jt,ot+=V*Pr,Pt+=V*zr,mr+=V*Zt,qt+=V*Nr,Ur+=V*Sr,Ir+=V*Yt,ye+=38*z,Te+=38*G,Me+=38*re,Oe+=38*ue,nt+=38*_e,it+=38*Ee,St+=38*et,bt+=38*pt,Ce+=38*Ct,We+=38*ot,Le+=38*Pt,Ke+=38*mr,qe+=38*qt,we+=38*Ur,Se+=38*Ir,oe=1,V=ye+oe+65535,oe=Math.floor(V/65536),ye=V-oe*65536,V=Te+oe+65535,oe=Math.floor(V/65536),Te=V-oe*65536,V=Me+oe+65535,oe=Math.floor(V/65536),Me=V-oe*65536,V=Oe+oe+65535,oe=Math.floor(V/65536),Oe=V-oe*65536,V=nt+oe+65535,oe=Math.floor(V/65536),nt=V-oe*65536,V=it+oe+65535,oe=Math.floor(V/65536),it=V-oe*65536,V=St+oe+65535,oe=Math.floor(V/65536),St=V-oe*65536,V=bt+oe+65535,oe=Math.floor(V/65536),bt=V-oe*65536,V=Ce+oe+65535,oe=Math.floor(V/65536),Ce=V-oe*65536,V=We+oe+65535,oe=Math.floor(V/65536),We=V-oe*65536,V=Le+oe+65535,oe=Math.floor(V/65536),Le=V-oe*65536,V=Ke+oe+65535,oe=Math.floor(V/65536),Ke=V-oe*65536,V=qe+oe+65535,oe=Math.floor(V/65536),qe=V-oe*65536,V=we+oe+65535,oe=Math.floor(V/65536),we=V-oe*65536,V=Se+oe+65535,oe=Math.floor(V/65536),Se=V-oe*65536,V=q+oe+65535,oe=Math.floor(V/65536),q=V-oe*65536,ye+=oe-1+37*(oe-1),oe=1,V=ye+oe+65535,oe=Math.floor(V/65536),ye=V-oe*65536,V=Te+oe+65535,oe=Math.floor(V/65536),Te=V-oe*65536,V=Me+oe+65535,oe=Math.floor(V/65536),Me=V-oe*65536,V=Oe+oe+65535,oe=Math.floor(V/65536),Oe=V-oe*65536,V=nt+oe+65535,oe=Math.floor(V/65536),nt=V-oe*65536,V=it+oe+65535,oe=Math.floor(V/65536),it=V-oe*65536,V=St+oe+65535,oe=Math.floor(V/65536),St=V-oe*65536,V=bt+oe+65535,oe=Math.floor(V/65536),bt=V-oe*65536,V=Ce+oe+65535,oe=Math.floor(V/65536),Ce=V-oe*65536,V=We+oe+65535,oe=Math.floor(V/65536),We=V-oe*65536,V=Le+oe+65535,oe=Math.floor(V/65536),Le=V-oe*65536,V=Ke+oe+65535,oe=Math.floor(V/65536),Ke=V-oe*65536,V=qe+oe+65535,oe=Math.floor(V/65536),qe=V-oe*65536,V=we+oe+65535,oe=Math.floor(V/65536),we=V-oe*65536,V=Se+oe+65535,oe=Math.floor(V/65536),Se=V-oe*65536,V=q+oe+65535,oe=Math.floor(V/65536),q=V-oe*65536,ye+=oe-1+37*(oe-1),J[0]=ye,J[1]=Te,J[2]=Me,J[3]=Oe,J[4]=nt,J[5]=it,J[6]=St,J[7]=bt,J[8]=Ce,J[9]=We,J[10]=Le,J[11]=Ke,J[12]=qe,J[13]=we,J[14]=Se,J[15]=q}function I(J,ee){S(J,ee,ee)}function D(J,ee){const ne=i();let V;for(V=0;V<16;V++)ne[V]=ee[V];for(V=253;V>=0;V--)I(ne,ne),V!==2&&V!==4&&S(ne,ne,ee);for(V=0;V<16;V++)J[V]=ne[V]}function L(J,ee){const ne=i();let V;for(V=0;V<16;V++)ne[V]=ee[V];for(V=250;V>=0;V--)I(ne,ne),V!==1&&S(ne,ne,ee);for(V=0;V<16;V++)J[V]=ne[V]}function O(J,ee){const ne=i(),V=i(),oe=i(),ye=i(),Te=i(),Me=i(),Oe=i(),nt=i(),it=i();A(ne,J[1],J[0]),A(it,ee[1],ee[0]),S(ne,ne,it),C(V,J[0],J[1]),C(it,ee[0],ee[1]),S(V,V,it),S(oe,J[3],ee[3]),S(oe,oe,c),S(ye,J[2],ee[2]),C(ye,ye,ye),A(Te,V,ne),A(Me,ye,oe),C(Oe,ye,oe),C(nt,V,ne),S(J[0],Te,Me),S(J[1],nt,Oe),S(J[2],Oe,Me),S(J[3],Te,nt)}function P(J,ee,ne){for(let V=0;V<4;V++)g(J[V],ee[V],ne)}function x(J,ee){const ne=i(),V=i(),oe=i();D(oe,ee[2]),S(ne,ee[0],oe),S(V,ee[1],oe),v(J,V),J[31]^=b(ne)<<7}function T(J,ee,ne){h(J[0],o),h(J[1],s),h(J[2],s),h(J[3],o);for(let V=255;V>=0;--V){const oe=ne[V/8|0]>>(V&7)&1;P(J,ee,oe),O(ee,J),O(J,J),P(J,ee,oe)}}function E(J,ee){const ne=[i(),i(),i(),i()];h(ne[0],u),h(ne[1],f),h(ne[2],s),S(ne[3],u,f),T(J,ne,ee)}function N(J){if(J.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const ee=(0,r.hash)(J);ee[0]&=248,ee[31]&=127,ee[31]|=64;const ne=new Uint8Array(32),V=[i(),i(),i(),i()];E(V,ee),x(ne,V);const oe=new Uint8Array(64);return oe.set(J),oe.set(ne,32),{publicKey:ne,secretKey:oe}}t.generateKeyPairFromSeed=N;function F(J){const ee=(0,e.randomBytes)(32,J),ne=N(ee);return(0,n.wipe)(ee),ne}t.generateKeyPair=F;function B(J){if(J.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(J.subarray(32))}t.extractPublicKeyFromSecretKey=B;const j=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function k(J,ee){let ne,V,oe,ye;for(V=63;V>=32;--V){for(ne=0,oe=V-32,ye=V-12;oe>4)*j[oe],ne=ee[oe]>>8,ee[oe]&=255;for(oe=0;oe<32;oe++)ee[oe]-=ne*j[oe];for(V=0;V<32;V++)ee[V+1]+=ee[V]>>8,J[V]=ee[V]&255}function $(J){const ee=new Float64Array(64);for(let ne=0;ne<64;ne++)ee[ne]=J[ne];for(let ne=0;ne<64;ne++)J[ne]=0;k(J,ee)}function H(J,ee){const ne=new Float64Array(64),V=[i(),i(),i(),i()],oe=(0,r.hash)(J.subarray(0,32));oe[0]&=248,oe[31]&=127,oe[31]|=64;const ye=new Uint8Array(64);ye.set(oe.subarray(32),32);const Te=new r.SHA512;Te.update(ye.subarray(32)),Te.update(ee);const Me=Te.digest();Te.clean(),$(Me),E(V,Me),x(ye,V),Te.reset(),Te.update(ye.subarray(0,32)),Te.update(J.subarray(32)),Te.update(ee);const Oe=Te.digest();$(Oe);for(let nt=0;nt<32;nt++)ne[nt]=Me[nt];for(let nt=0;nt<32;nt++)for(let it=0;it<32;it++)ne[nt+it]+=Oe[nt]*oe[it];return k(ye.subarray(32),ne),ye}t.sign=H;function Y(J,ee){const ne=i(),V=i(),oe=i(),ye=i(),Te=i(),Me=i(),Oe=i();return h(J[2],s),w(J[1],ee),I(oe,J[1]),S(ye,oe,l),A(oe,oe,J[2]),C(ye,J[2],ye),I(Te,ye),I(Me,Te),S(Oe,Me,Te),S(ne,Oe,oe),S(ne,ne,ye),L(ne,ne),S(ne,ne,oe),S(ne,ne,ye),S(ne,ne,ye),S(J[0],ne,ye),I(V,J[0]),S(V,V,ye),m(V,oe)&&S(J[0],J[0],d),I(V,J[0]),S(V,V,ye),m(V,oe)?-1:(b(J[0])===ee[31]>>7&&A(J[0],o,J[0]),S(J[3],J[0],J[1]),0)}function ie(J,ee,ne){const V=new Uint8Array(32),oe=[i(),i(),i(),i()],ye=[i(),i(),i(),i()];if(ne.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(Y(ye,J))return!1;const Te=new r.SHA512;Te.update(ne.subarray(0,32)),Te.update(J),Te.update(ee);const Me=Te.digest();return $(Me),T(oe,ye,Me),E(ye,ne.subarray(32)),O(oe,ye),x(V,oe),!y(ne,V)}t.verify=ie;function W(J){let ee=[i(),i(),i(),i()];if(Y(ee,J))throw new Error("Ed25519: invalid public key");let ne=i(),V=i(),oe=ee[1];C(ne,s,oe),A(V,s,oe),D(V,V),S(ne,ne,V);let ye=new Uint8Array(32);return v(ye,ne),ye}t.convertPublicKeyToX25519=W;function Q(J){const ee=(0,r.hash)(J.subarray(0,32));ee[0]&=248,ee[31]&=127,ee[31]|=64;const ne=new Uint8Array(ee.subarray(0,32));return(0,n.wipe)(ee),ne}t.convertSecretKeyToX25519=Q})(EJ);const owt="EdDSA",swt="JWT",eN=".",r$="base64url",o4e="utf8",s4e="utf8",lwt=":",cwt="did",uwt="key",fue="base58btc",fwt="z",dwt="K36",hwt=32;function l4e(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function VR(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=l4e(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function pwt(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,w=new Uint8Array(b);y!==m;){for(var C=p[y],A=0,S=b-1;(C!==0||A>>0,w[S]=C%s>>>0,C=C/s>>>0;if(C!==0)throw new Error("Non-zero carry");v=A,y++}for(var I=b-v;I!==b&&w[I]===0;)I++;for(var D=l.repeat(g);I>>0,b=new Uint8Array(m);p[g];){var w=r[p.charCodeAt(g)];if(w===255)return;for(var C=0,A=m-1;(w!==0||C>>0,b[A]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");y=C,g++}if(p[g]!==" "){for(var S=m-y;S!==m&&b[S]===0;)S++;for(var I=new Uint8Array(v+(m-S)),D=v;S!==m;)I[D++]=b[S++];return I}}}function h(p){var g=d(p);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var gwt=pwt,vwt=gwt;const mwt=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},ywt=t=>new TextEncoder().encode(t),wwt=t=>new TextDecoder().decode(t);class bwt{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class xwt{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return c4e(this,e)}}class _wt{constructor(e){this.decoders=e}or(e){return c4e(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const c4e=(t,e)=>new _wt({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Swt{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new bwt(e,r,n),this.decoder=new xwt(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const n$=({name:t,prefix:e,encode:r,decode:n})=>new Swt(t,e,r,n),b8=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=vwt(r,e);return n$({prefix:t,name:e,encode:n,decode:a=>mwt(i(a))})},Cwt=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(s-=8,o[c++]=255&l>>s)}if(s>=r||255&l<<8-s)throw new SyntaxError("Unexpected end of data");return o},Awt=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<n$({prefix:e,name:t,encode(i){return Awt(i,n,r)},decode(i){return Cwt(i,n,r,t)}}),Twt=n$({prefix:"\0",name:"identity",encode:t=>wwt(t),decode:t=>ywt(t)}),Ewt=Object.freeze(Object.defineProperty({__proto__:null,identity:Twt},Symbol.toStringTag,{value:"Module"})),Iwt=Ls({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),kwt=Object.freeze(Object.defineProperty({__proto__:null,base2:Iwt},Symbol.toStringTag,{value:"Module"})),Pwt=Ls({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Rwt=Object.freeze(Object.defineProperty({__proto__:null,base8:Pwt},Symbol.toStringTag,{value:"Module"})),Mwt=b8({prefix:"9",name:"base10",alphabet:"0123456789"}),Dwt=Object.freeze(Object.defineProperty({__proto__:null,base10:Mwt},Symbol.toStringTag,{value:"Module"})),Nwt=Ls({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Owt=Ls({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Lwt=Object.freeze(Object.defineProperty({__proto__:null,base16:Nwt,base16upper:Owt},Symbol.toStringTag,{value:"Module"})),$wt=Ls({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Bwt=Ls({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Fwt=Ls({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jwt=Ls({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Uwt=Ls({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),zwt=Ls({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Hwt=Ls({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Vwt=Ls({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Gwt=Ls({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Wwt=Object.freeze(Object.defineProperty({__proto__:null,base32:$wt,base32hex:Uwt,base32hexpad:Hwt,base32hexpadupper:Vwt,base32hexupper:zwt,base32pad:Fwt,base32padupper:jwt,base32upper:Bwt,base32z:Gwt},Symbol.toStringTag,{value:"Module"})),qwt=b8({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ywt=b8({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Kwt=Object.freeze(Object.defineProperty({__proto__:null,base36:qwt,base36upper:Ywt},Symbol.toStringTag,{value:"Module"})),Zwt=b8({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Qwt=b8({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Xwt=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Zwt,base58flickr:Qwt},Symbol.toStringTag,{value:"Module"})),Jwt=Ls({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ebt=Ls({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),tbt=Ls({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rbt=Ls({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),nbt=Object.freeze(Object.defineProperty({__proto__:null,base64:Jwt,base64pad:ebt,base64url:tbt,base64urlpad:rbt},Symbol.toStringTag,{value:"Module"})),u4e=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ibt=u4e.reduce((t,e,r)=>(t[r]=e,t),[]),abt=u4e.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function obt(t){return t.reduce((e,r)=>(e+=ibt[r],e),"")}function sbt(t){const e=[];for(const r of t){const n=abt[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const lbt=n$({prefix:"🚀",name:"base256emoji",encode:obt,decode:sbt}),cbt=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:lbt},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const due={...Ewt,...kwt,...Rwt,...Dwt,...Lwt,...Wwt,...Kwt,...Xwt,...nbt,...cbt};function f4e(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const hue=f4e("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),YU=f4e("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=l4e(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new wbt:typeof navigator<"u"?Abt(navigator.userAgent):Ebt()}function Cbt(t){return t!==""&&_bt.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function Abt(t){var e=Cbt(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new ybt;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length-1){const v=p.getAttribute("href");if(v)if(v.toLowerCase().indexOf("https:")===-1&&v.toLowerCase().indexOf("http:")===-1&&v.indexOf("//")!==0){let y=e.protocol+"//"+e.host;if(v.indexOf("/")===0)y+=v;else{const m=e.pathname.split("/");m.pop();const b=m.join("/");y+=b+"/"+v}d.push(y)}else if(v.indexOf("//")===0){const y=e.protocol+v;d.push(y)}else d.push(v)}}return d}function n(...f){const d=t.getElementsByTagName("meta");for(let h=0;hp.getAttribute(v)).filter(v=>v?f.includes(v):!1);if(g.length&&g){const v=p.getAttribute("content");if(v)return v}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function a(){return n("description","og:description","twitter:description","keywords")}const o=i(),s=a(),l=e.origin,c=r();return{description:s,url:l,icons:c,name:o}}g4e=PJ.getWindowMetadata=Fbt;var kT={};(function(t){const e=Z3e,r=X3e,n=J3e,i=e5e,a=m=>m==null,o=Symbol("encodeFragmentIdentifier");function s(m){switch(m.arrayFormat){case"index":return b=>(w,C)=>{const A=w.length;return C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,[u(b,m),"[",A,"]"].join("")]:[...w,[u(b,m),"[",u(A,m),"]=",u(C,m)].join("")]};case"bracket":return b=>(w,C)=>C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,[u(b,m),"[]"].join("")]:[...w,[u(b,m),"[]=",u(C,m)].join("")];case"colon-list-separator":return b=>(w,C)=>C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,[u(b,m),":list="].join("")]:[...w,[u(b,m),":list=",u(C,m)].join("")];case"comma":case"separator":case"bracket-separator":{const b=m.arrayFormat==="bracket-separator"?"[]=":"=";return w=>(C,A)=>A===void 0||m.skipNull&&A===null||m.skipEmptyString&&A===""?C:(A=A===null?"":A,C.length===0?[[u(w,m),b,u(A,m)].join("")]:[[C,u(A,m)].join(m.arrayFormatSeparator)])}default:return b=>(w,C)=>C===void 0||m.skipNull&&C===null||m.skipEmptyString&&C===""?w:C===null?[...w,u(b,m)]:[...w,[u(b,m),"=",u(C,m)].join("")]}}function l(m){let b;switch(m.arrayFormat){case"index":return(w,C,A)=>{if(b=/\[(\d*)\]$/.exec(w),w=w.replace(/\[\d*\]$/,""),!b){A[w]=C;return}A[w]===void 0&&(A[w]={}),A[w][b[1]]=C};case"bracket":return(w,C,A)=>{if(b=/(\[\])$/.exec(w),w=w.replace(/\[\]$/,""),!b){A[w]=C;return}if(A[w]===void 0){A[w]=[C];return}A[w]=[].concat(A[w],C)};case"colon-list-separator":return(w,C,A)=>{if(b=/(:list)$/.exec(w),w=w.replace(/:list$/,""),!b){A[w]=C;return}if(A[w]===void 0){A[w]=[C];return}A[w]=[].concat(A[w],C)};case"comma":case"separator":return(w,C,A)=>{const S=typeof C=="string"&&C.includes(m.arrayFormatSeparator),I=typeof C=="string"&&!S&&f(C,m).includes(m.arrayFormatSeparator);C=I?f(C,m):C;const D=S||I?C.split(m.arrayFormatSeparator).map(L=>f(L,m)):C===null?C:f(C,m);A[w]=D};case"bracket-separator":return(w,C,A)=>{const S=/(\[\])$/.test(w);if(w=w.replace(/\[\]$/,""),!S){A[w]=C&&f(C,m);return}const I=C===null?[]:C.split(m.arrayFormatSeparator).map(D=>f(D,m));if(A[w]===void 0){A[w]=I;return}A[w]=[].concat(A[w],I)};default:return(w,C,A)=>{if(A[w]===void 0){A[w]=C;return}A[w]=[].concat(A[w],C)}}}function c(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(m,b){return b.encode?b.strict?e(m):encodeURIComponent(m):m}function f(m,b){return b.decode?r(m):m}function d(m){return Array.isArray(m)?m.sort():typeof m=="object"?d(Object.keys(m)).sort((b,w)=>Number(b)-Number(w)).map(b=>m[b]):m}function h(m){const b=m.indexOf("#");return b!==-1&&(m=m.slice(0,b)),m}function p(m){let b="";const w=m.indexOf("#");return w!==-1&&(b=m.slice(w)),b}function g(m){m=h(m);const b=m.indexOf("?");return b===-1?"":m.slice(b+1)}function v(m,b){return b.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):b.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function y(m,b){b=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},b),c(b.arrayFormatSeparator);const w=l(b),C=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return C;for(const A of m.split("&")){if(A==="")continue;let[S,I]=n(b.decode?A.replace(/\+/g," "):A,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(b.arrayFormat)?I:f(I,b),w(f(S,b),I,C)}for(const A of Object.keys(C)){const S=C[A];if(typeof S=="object"&&S!==null)for(const I of Object.keys(S))S[I]=v(S[I],b);else C[A]=v(S,b)}return b.sort===!1?C:(b.sort===!0?Object.keys(C).sort():Object.keys(C).sort(b.sort)).reduce((A,S)=>{const I=C[S];return I&&typeof I=="object"&&!Array.isArray(I)?A[S]=d(I):A[S]=I,A},Object.create(null))}t.extract=g,t.parse=y,t.stringify=(m,b)=>{if(!m)return"";b=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},b),c(b.arrayFormatSeparator);const w=I=>b.skipNull&&a(m[I])||b.skipEmptyString&&m[I]==="",C=s(b),A={};for(const I of Object.keys(m))w(I)||(A[I]=m[I]);const S=Object.keys(A);return b.sort!==!1&&S.sort(b.sort),S.map(I=>{const D=m[I];return D===void 0?"":D===null?u(I,b):Array.isArray(D)?D.length===0&&b.arrayFormat==="bracket-separator"?u(I,b)+"[]":D.reduce(C(I),[]).join("&"):u(I,b)+"="+u(D,b)}).filter(I=>I.length>0).join("&")},t.parseUrl=(m,b)=>{b=Object.assign({decode:!0},b);const[w,C]=n(m,"#");return Object.assign({url:w.split("?")[0]||"",query:y(g(m),b)},b&&b.parseFragmentIdentifier&&C?{fragmentIdentifier:f(C,b)}:{})},t.stringifyUrl=(m,b)=>{b=Object.assign({encode:!0,strict:!0,[o]:!0},b);const w=h(m.url).split("?")[0]||"",C=t.extract(m.url),A=t.parse(C,{sort:!1}),S=Object.assign(A,m.query);let I=t.stringify(S,b);I&&(I=`?${I}`);let D=p(m.url);return m.fragmentIdentifier&&(D=`#${b[o]?u(m.fragmentIdentifier,b):m.fragmentIdentifier}`),`${w}${I}${D}`},t.pick=(m,b,w)=>{w=Object.assign({parseFragmentIdentifier:!0,[o]:!1},w);const{url:C,query:A,fragmentIdentifier:S}=t.parseUrl(m,w);return t.stringifyUrl({url:C,query:i(A,b),fragmentIdentifier:S},w)},t.exclude=(m,b,w)=>{const C=Array.isArray(b)?A=>!b.includes(A):(A,S)=>!b(A,S);return t.pick(m,C,w)}})(kT);var RJ={},a$={};Object.defineProperty(a$,"__esModule",{value:!0});var Ks=kn,Hq=Pu,jbt=20;function Ubt(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,o=1797285236,s=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],c=r[11]<<24|r[10]<<16|r[9]<<8|r[8],u=r[15]<<24|r[14]<<16|r[13]<<8|r[12],f=r[19]<<24|r[18]<<16|r[17]<<8|r[16],d=r[23]<<24|r[22]<<16|r[21]<<8|r[20],h=r[27]<<24|r[26]<<16|r[25]<<8|r[24],p=r[31]<<24|r[30]<<16|r[29]<<8|r[28],g=e[3]<<24|e[2]<<16|e[1]<<8|e[0],v=e[7]<<24|e[6]<<16|e[5]<<8|e[4],y=e[11]<<24|e[10]<<16|e[9]<<8|e[8],m=e[15]<<24|e[14]<<16|e[13]<<8|e[12],b=n,w=i,C=a,A=o,S=s,I=l,D=c,L=u,O=f,P=d,x=h,T=p,E=g,N=v,F=y,B=m,j=0;j>>16|E<<16,O=O+E|0,S^=O,S=S>>>20|S<<12,w=w+I|0,N^=w,N=N>>>16|N<<16,P=P+N|0,I^=P,I=I>>>20|I<<12,C=C+D|0,F^=C,F=F>>>16|F<<16,x=x+F|0,D^=x,D=D>>>20|D<<12,A=A+L|0,B^=A,B=B>>>16|B<<16,T=T+B|0,L^=T,L=L>>>20|L<<12,C=C+D|0,F^=C,F=F>>>24|F<<8,x=x+F|0,D^=x,D=D>>>25|D<<7,A=A+L|0,B^=A,B=B>>>24|B<<8,T=T+B|0,L^=T,L=L>>>25|L<<7,w=w+I|0,N^=w,N=N>>>24|N<<8,P=P+N|0,I^=P,I=I>>>25|I<<7,b=b+S|0,E^=b,E=E>>>24|E<<8,O=O+E|0,S^=O,S=S>>>25|S<<7,b=b+I|0,B^=b,B=B>>>16|B<<16,x=x+B|0,I^=x,I=I>>>20|I<<12,w=w+D|0,E^=w,E=E>>>16|E<<16,T=T+E|0,D^=T,D=D>>>20|D<<12,C=C+L|0,N^=C,N=N>>>16|N<<16,O=O+N|0,L^=O,L=L>>>20|L<<12,A=A+S|0,F^=A,F=F>>>16|F<<16,P=P+F|0,S^=P,S=S>>>20|S<<12,C=C+L|0,N^=C,N=N>>>24|N<<8,O=O+N|0,L^=O,L=L>>>25|L<<7,A=A+S|0,F^=A,F=F>>>24|F<<8,P=P+F|0,S^=P,S=S>>>25|S<<7,w=w+D|0,E^=w,E=E>>>24|E<<8,T=T+E|0,D^=T,D=D>>>25|D<<7,b=b+I|0,B^=b,B=B>>>24|B<<8,x=x+B|0,I^=x,I=I>>>25|I<<7;Ks.writeUint32LE(b+n|0,t,0),Ks.writeUint32LE(w+i|0,t,4),Ks.writeUint32LE(C+a|0,t,8),Ks.writeUint32LE(A+o|0,t,12),Ks.writeUint32LE(S+s|0,t,16),Ks.writeUint32LE(I+l|0,t,20),Ks.writeUint32LE(D+c|0,t,24),Ks.writeUint32LE(L+u|0,t,28),Ks.writeUint32LE(O+f|0,t,32),Ks.writeUint32LE(P+d|0,t,36),Ks.writeUint32LE(x+h|0,t,40),Ks.writeUint32LE(T+p|0,t,44),Ks.writeUint32LE(E+g|0,t,48),Ks.writeUint32LE(N+v|0,t,52),Ks.writeUint32LE(F+y|0,t,56),Ks.writeUint32LE(B+m|0,t,60)}function v4e(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var m4e={},uy={};Object.defineProperty(uy,"__esModule",{value:!0});function Vbt(t,e,r){return~(t-1)&e|t-1&r}uy.select=Vbt;function Gbt(t,e){return(t|0)-(e|0)-1>>>31&1}uy.lessOrEqual=Gbt;function y4e(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}uy.compare=y4e;function Wbt(t,e){return t.length===0||e.length===0?!1:y4e(t,e)!==0}uy.equal=Wbt;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=uy,r=Pu;t.DIGEST_LENGTH=16;var n=function(){function o(s){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var l=s[0]|s[1]<<8;this._r[0]=l&8191;var c=s[2]|s[3]<<8;this._r[1]=(l>>>13|c<<3)&8191;var u=s[4]|s[5]<<8;this._r[2]=(c>>>10|u<<6)&7939;var f=s[6]|s[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var d=s[8]|s[9]<<8;this._r[4]=(f>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var h=s[10]|s[11]<<8;this._r[6]=(d>>>14|h<<2)&8191;var p=s[12]|s[13]<<8;this._r[7]=(h>>>11|p<<5)&8065;var g=s[14]|s[15]<<8;this._r[8]=(p>>>8|g<<8)&8191,this._r[9]=g>>>5&127,this._pad[0]=s[16]|s[17]<<8,this._pad[1]=s[18]|s[19]<<8,this._pad[2]=s[20]|s[21]<<8,this._pad[3]=s[22]|s[23]<<8,this._pad[4]=s[24]|s[25]<<8,this._pad[5]=s[26]|s[27]<<8,this._pad[6]=s[28]|s[29]<<8,this._pad[7]=s[30]|s[31]<<8}return o.prototype._blocks=function(s,l,c){for(var u=this._fin?0:2048,f=this._h[0],d=this._h[1],h=this._h[2],p=this._h[3],g=this._h[4],v=this._h[5],y=this._h[6],m=this._h[7],b=this._h[8],w=this._h[9],C=this._r[0],A=this._r[1],S=this._r[2],I=this._r[3],D=this._r[4],L=this._r[5],O=this._r[6],P=this._r[7],x=this._r[8],T=this._r[9];c>=16;){var E=s[l+0]|s[l+1]<<8;f+=E&8191;var N=s[l+2]|s[l+3]<<8;d+=(E>>>13|N<<3)&8191;var F=s[l+4]|s[l+5]<<8;h+=(N>>>10|F<<6)&8191;var B=s[l+6]|s[l+7]<<8;p+=(F>>>7|B<<9)&8191;var j=s[l+8]|s[l+9]<<8;g+=(B>>>4|j<<12)&8191,v+=j>>>1&8191;var k=s[l+10]|s[l+11]<<8;y+=(j>>>14|k<<2)&8191;var $=s[l+12]|s[l+13]<<8;m+=(k>>>11|$<<5)&8191;var H=s[l+14]|s[l+15]<<8;b+=($>>>8|H<<8)&8191,w+=H>>>5|u;var Y=0,ie=Y;ie+=f*C,ie+=d*(5*T),ie+=h*(5*x),ie+=p*(5*P),ie+=g*(5*O),Y=ie>>>13,ie&=8191,ie+=v*(5*L),ie+=y*(5*D),ie+=m*(5*I),ie+=b*(5*S),ie+=w*(5*A),Y+=ie>>>13,ie&=8191;var W=Y;W+=f*A,W+=d*C,W+=h*(5*T),W+=p*(5*x),W+=g*(5*P),Y=W>>>13,W&=8191,W+=v*(5*O),W+=y*(5*L),W+=m*(5*D),W+=b*(5*I),W+=w*(5*S),Y+=W>>>13,W&=8191;var Q=Y;Q+=f*S,Q+=d*A,Q+=h*C,Q+=p*(5*T),Q+=g*(5*x),Y=Q>>>13,Q&=8191,Q+=v*(5*P),Q+=y*(5*O),Q+=m*(5*L),Q+=b*(5*D),Q+=w*(5*I),Y+=Q>>>13,Q&=8191;var J=Y;J+=f*I,J+=d*S,J+=h*A,J+=p*C,J+=g*(5*T),Y=J>>>13,J&=8191,J+=v*(5*x),J+=y*(5*P),J+=m*(5*O),J+=b*(5*L),J+=w*(5*D),Y+=J>>>13,J&=8191;var ee=Y;ee+=f*D,ee+=d*I,ee+=h*S,ee+=p*A,ee+=g*C,Y=ee>>>13,ee&=8191,ee+=v*(5*T),ee+=y*(5*x),ee+=m*(5*P),ee+=b*(5*O),ee+=w*(5*L),Y+=ee>>>13,ee&=8191;var ne=Y;ne+=f*L,ne+=d*D,ne+=h*I,ne+=p*S,ne+=g*A,Y=ne>>>13,ne&=8191,ne+=v*C,ne+=y*(5*T),ne+=m*(5*x),ne+=b*(5*P),ne+=w*(5*O),Y+=ne>>>13,ne&=8191;var V=Y;V+=f*O,V+=d*L,V+=h*D,V+=p*I,V+=g*S,Y=V>>>13,V&=8191,V+=v*A,V+=y*C,V+=m*(5*T),V+=b*(5*x),V+=w*(5*P),Y+=V>>>13,V&=8191;var oe=Y;oe+=f*P,oe+=d*O,oe+=h*L,oe+=p*D,oe+=g*I,Y=oe>>>13,oe&=8191,oe+=v*S,oe+=y*A,oe+=m*C,oe+=b*(5*T),oe+=w*(5*x),Y+=oe>>>13,oe&=8191;var ye=Y;ye+=f*x,ye+=d*P,ye+=h*O,ye+=p*L,ye+=g*D,Y=ye>>>13,ye&=8191,ye+=v*I,ye+=y*S,ye+=m*A,ye+=b*C,ye+=w*(5*T),Y+=ye>>>13,ye&=8191;var Te=Y;Te+=f*T,Te+=d*x,Te+=h*P,Te+=p*O,Te+=g*L,Y=Te>>>13,Te&=8191,Te+=v*D,Te+=y*I,Te+=m*S,Te+=b*A,Te+=w*C,Y+=Te>>>13,Te&=8191,Y=(Y<<2)+Y|0,Y=Y+ie|0,ie=Y&8191,Y=Y>>>13,W+=Y,f=ie,d=W,h=Q,p=J,g=ee,v=ne,y=V,m=oe,b=ye,w=Te,l+=16,c-=16}this._h[0]=f,this._h[1]=d,this._h[2]=h,this._h[3]=p,this._h[4]=g,this._h[5]=v,this._h[6]=y,this._h[7]=m,this._h[8]=b,this._h[9]=w},o.prototype.finish=function(s,l){l===void 0&&(l=0);var c=new Uint16Array(10),u,f,d,h;if(this._leftover){for(h=this._leftover,this._buffer[h++]=1;h<16;h++)this._buffer[h]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,h=2;h<10;h++)this._h[h]+=u,u=this._h[h]>>>13,this._h[h]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,c[0]=this._h[0]+5,u=c[0]>>>13,c[0]&=8191,h=1;h<10;h++)c[h]=this._h[h]+u,u=c[h]>>>13,c[h]&=8191;for(c[9]-=8192,f=(u^1)-1,h=0;h<10;h++)c[h]&=f;for(f=~f,h=0;h<10;h++)this._h[h]=this._h[h]&f|c[h];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,h=1;h<8;h++)d=(this._h[h]+this._pad[h]|0)+(d>>>16)|0,this._h[h]=d&65535;return s[l+0]=this._h[0]>>>0,s[l+1]=this._h[0]>>>8,s[l+2]=this._h[1]>>>0,s[l+3]=this._h[1]>>>8,s[l+4]=this._h[2]>>>0,s[l+5]=this._h[2]>>>8,s[l+6]=this._h[3]>>>0,s[l+7]=this._h[3]>>>8,s[l+8]=this._h[4]>>>0,s[l+9]=this._h[4]>>>8,s[l+10]=this._h[5]>>>0,s[l+11]=this._h[5]>>>8,s[l+12]=this._h[6]>>>0,s[l+13]=this._h[6]>>>8,s[l+14]=this._h[7]>>>0,s[l+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(s){var l=0,c=s.length,u;if(this._leftover){u=16-this._leftover,u>c&&(u=c);for(var f=0;f=16&&(u=c-c%16,this._blocks(s,l,u),l+=u,c-=u),c){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var h=new Uint8Array(16);h.set(c,h.length-c.length);var p=new Uint8Array(32);e.stream(this._key,h,p,4);var g=u.length+this.tagLength,v;if(d){if(d.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");v=d}else v=new Uint8Array(g);return e.streamXOR(this._key,h,u,v,4),this._authenticate(v.subarray(v.length-this.tagLength,v.length),p,v.subarray(0,v.length-this.tagLength),f),n.wipe(h),v},l.prototype.open=function(c,u,f,d){if(c.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&h.update(o.subarray(d.length%16))),h.update(f),f.length%16>0&&h.update(o.subarray(f.length%16));var p=new Uint8Array(8);d&&i.writeUint64LE(d.length,p),h.update(p),i.writeUint64LE(f.length,p),h.update(p);for(var g=h.digest(),v=0;vthis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._temp,this._state,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},s.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,d=c<<3,h=c%64<56?64:128;this._buffer[u]=128;for(var p=u+1;p0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},s.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},s.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},s}();t.SHA256=n;var i=new Int32Array([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]);function a(s,l,c,u,f){for(;f>=64;){for(var d=l[0],h=l[1],p=l[2],g=l[3],v=l[4],y=l[5],m=l[6],b=l[7],w=0;w<16;w++){var C=u+w*4;s[w]=e.readUint32BE(c,C)}for(var w=16;w<64;w++){var A=s[w-2],S=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10;A=s[w-15];var I=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3;s[w]=(S+s[w-7]|0)+(I+s[w-16]|0)}for(var w=0;w<64;w++){var S=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&y^~v&m)|0)+(b+(i[w]+s[w]|0)|0)|0,I=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&h^d&p^h&p)|0;b=m,m=y,y=v,v=g+S|0,g=p,p=h,h=d,d=S+I|0}l[0]+=d,l[1]+=h,l[2]+=p,l[3]+=g,l[4]+=v,l[5]+=y,l[6]+=m,l[7]+=b,u+=64,f-=64}return u}function o(s){var l=new n;l.update(s);var c=l.digest();return l.clean(),c}t.hash=o})(_8);var DJ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=cy,r=Pu;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(w){const C=new Float64Array(16);if(w)for(let A=0;A>16&1),A[L-1]&=65535;A[15]=S[15]-32767-(A[14]>>16&1);const D=A[15]>>16&1;A[14]&=65535,s(S,A,1-D)}for(let I=0;I<16;I++)w[2*I]=S[I]&255,w[2*I+1]=S[I]>>8}function c(w,C){for(let A=0;A<16;A++)w[A]=C[2*A]+(C[2*A+1]<<8);w[15]&=32767}function u(w,C,A){for(let S=0;S<16;S++)w[S]=C[S]+A[S]}function f(w,C,A){for(let S=0;S<16;S++)w[S]=C[S]-A[S]}function d(w,C,A){let S,I,D=0,L=0,O=0,P=0,x=0,T=0,E=0,N=0,F=0,B=0,j=0,k=0,$=0,H=0,Y=0,ie=0,W=0,Q=0,J=0,ee=0,ne=0,V=0,oe=0,ye=0,Te=0,Me=0,Oe=0,nt=0,it=0,St=0,bt=0,Ce=A[0],We=A[1],Le=A[2],Ke=A[3],qe=A[4],we=A[5],Se=A[6],q=A[7],z=A[8],G=A[9],re=A[10],ue=A[11],_e=A[12],Ee=A[13],et=A[14],pt=A[15];S=C[0],D+=S*Ce,L+=S*We,O+=S*Le,P+=S*Ke,x+=S*qe,T+=S*we,E+=S*Se,N+=S*q,F+=S*z,B+=S*G,j+=S*re,k+=S*ue,$+=S*_e,H+=S*Ee,Y+=S*et,ie+=S*pt,S=C[1],L+=S*Ce,O+=S*We,P+=S*Le,x+=S*Ke,T+=S*qe,E+=S*we,N+=S*Se,F+=S*q,B+=S*z,j+=S*G,k+=S*re,$+=S*ue,H+=S*_e,Y+=S*Ee,ie+=S*et,W+=S*pt,S=C[2],O+=S*Ce,P+=S*We,x+=S*Le,T+=S*Ke,E+=S*qe,N+=S*we,F+=S*Se,B+=S*q,j+=S*z,k+=S*G,$+=S*re,H+=S*ue,Y+=S*_e,ie+=S*Ee,W+=S*et,Q+=S*pt,S=C[3],P+=S*Ce,x+=S*We,T+=S*Le,E+=S*Ke,N+=S*qe,F+=S*we,B+=S*Se,j+=S*q,k+=S*z,$+=S*G,H+=S*re,Y+=S*ue,ie+=S*_e,W+=S*Ee,Q+=S*et,J+=S*pt,S=C[4],x+=S*Ce,T+=S*We,E+=S*Le,N+=S*Ke,F+=S*qe,B+=S*we,j+=S*Se,k+=S*q,$+=S*z,H+=S*G,Y+=S*re,ie+=S*ue,W+=S*_e,Q+=S*Ee,J+=S*et,ee+=S*pt,S=C[5],T+=S*Ce,E+=S*We,N+=S*Le,F+=S*Ke,B+=S*qe,j+=S*we,k+=S*Se,$+=S*q,H+=S*z,Y+=S*G,ie+=S*re,W+=S*ue,Q+=S*_e,J+=S*Ee,ee+=S*et,ne+=S*pt,S=C[6],E+=S*Ce,N+=S*We,F+=S*Le,B+=S*Ke,j+=S*qe,k+=S*we,$+=S*Se,H+=S*q,Y+=S*z,ie+=S*G,W+=S*re,Q+=S*ue,J+=S*_e,ee+=S*Ee,ne+=S*et,V+=S*pt,S=C[7],N+=S*Ce,F+=S*We,B+=S*Le,j+=S*Ke,k+=S*qe,$+=S*we,H+=S*Se,Y+=S*q,ie+=S*z,W+=S*G,Q+=S*re,J+=S*ue,ee+=S*_e,ne+=S*Ee,V+=S*et,oe+=S*pt,S=C[8],F+=S*Ce,B+=S*We,j+=S*Le,k+=S*Ke,$+=S*qe,H+=S*we,Y+=S*Se,ie+=S*q,W+=S*z,Q+=S*G,J+=S*re,ee+=S*ue,ne+=S*_e,V+=S*Ee,oe+=S*et,ye+=S*pt,S=C[9],B+=S*Ce,j+=S*We,k+=S*Le,$+=S*Ke,H+=S*qe,Y+=S*we,ie+=S*Se,W+=S*q,Q+=S*z,J+=S*G,ee+=S*re,ne+=S*ue,V+=S*_e,oe+=S*Ee,ye+=S*et,Te+=S*pt,S=C[10],j+=S*Ce,k+=S*We,$+=S*Le,H+=S*Ke,Y+=S*qe,ie+=S*we,W+=S*Se,Q+=S*q,J+=S*z,ee+=S*G,ne+=S*re,V+=S*ue,oe+=S*_e,ye+=S*Ee,Te+=S*et,Me+=S*pt,S=C[11],k+=S*Ce,$+=S*We,H+=S*Le,Y+=S*Ke,ie+=S*qe,W+=S*we,Q+=S*Se,J+=S*q,ee+=S*z,ne+=S*G,V+=S*re,oe+=S*ue,ye+=S*_e,Te+=S*Ee,Me+=S*et,Oe+=S*pt,S=C[12],$+=S*Ce,H+=S*We,Y+=S*Le,ie+=S*Ke,W+=S*qe,Q+=S*we,J+=S*Se,ee+=S*q,ne+=S*z,V+=S*G,oe+=S*re,ye+=S*ue,Te+=S*_e,Me+=S*Ee,Oe+=S*et,nt+=S*pt,S=C[13],H+=S*Ce,Y+=S*We,ie+=S*Le,W+=S*Ke,Q+=S*qe,J+=S*we,ee+=S*Se,ne+=S*q,V+=S*z,oe+=S*G,ye+=S*re,Te+=S*ue,Me+=S*_e,Oe+=S*Ee,nt+=S*et,it+=S*pt,S=C[14],Y+=S*Ce,ie+=S*We,W+=S*Le,Q+=S*Ke,J+=S*qe,ee+=S*we,ne+=S*Se,V+=S*q,oe+=S*z,ye+=S*G,Te+=S*re,Me+=S*ue,Oe+=S*_e,nt+=S*Ee,it+=S*et,St+=S*pt,S=C[15],ie+=S*Ce,W+=S*We,Q+=S*Le,J+=S*Ke,ee+=S*qe,ne+=S*we,V+=S*Se,oe+=S*q,ye+=S*z,Te+=S*G,Me+=S*re,Oe+=S*ue,nt+=S*_e,it+=S*Ee,St+=S*et,bt+=S*pt,D+=38*W,L+=38*Q,O+=38*J,P+=38*ee,x+=38*ne,T+=38*V,E+=38*oe,N+=38*ye,F+=38*Te,B+=38*Me,j+=38*Oe,k+=38*nt,$+=38*it,H+=38*St,Y+=38*bt,I=1,S=D+I+65535,I=Math.floor(S/65536),D=S-I*65536,S=L+I+65535,I=Math.floor(S/65536),L=S-I*65536,S=O+I+65535,I=Math.floor(S/65536),O=S-I*65536,S=P+I+65535,I=Math.floor(S/65536),P=S-I*65536,S=x+I+65535,I=Math.floor(S/65536),x=S-I*65536,S=T+I+65535,I=Math.floor(S/65536),T=S-I*65536,S=E+I+65535,I=Math.floor(S/65536),E=S-I*65536,S=N+I+65535,I=Math.floor(S/65536),N=S-I*65536,S=F+I+65535,I=Math.floor(S/65536),F=S-I*65536,S=B+I+65535,I=Math.floor(S/65536),B=S-I*65536,S=j+I+65535,I=Math.floor(S/65536),j=S-I*65536,S=k+I+65535,I=Math.floor(S/65536),k=S-I*65536,S=$+I+65535,I=Math.floor(S/65536),$=S-I*65536,S=H+I+65535,I=Math.floor(S/65536),H=S-I*65536,S=Y+I+65535,I=Math.floor(S/65536),Y=S-I*65536,S=ie+I+65535,I=Math.floor(S/65536),ie=S-I*65536,D+=I-1+37*(I-1),I=1,S=D+I+65535,I=Math.floor(S/65536),D=S-I*65536,S=L+I+65535,I=Math.floor(S/65536),L=S-I*65536,S=O+I+65535,I=Math.floor(S/65536),O=S-I*65536,S=P+I+65535,I=Math.floor(S/65536),P=S-I*65536,S=x+I+65535,I=Math.floor(S/65536),x=S-I*65536,S=T+I+65535,I=Math.floor(S/65536),T=S-I*65536,S=E+I+65535,I=Math.floor(S/65536),E=S-I*65536,S=N+I+65535,I=Math.floor(S/65536),N=S-I*65536,S=F+I+65535,I=Math.floor(S/65536),F=S-I*65536,S=B+I+65535,I=Math.floor(S/65536),B=S-I*65536,S=j+I+65535,I=Math.floor(S/65536),j=S-I*65536,S=k+I+65535,I=Math.floor(S/65536),k=S-I*65536,S=$+I+65535,I=Math.floor(S/65536),$=S-I*65536,S=H+I+65535,I=Math.floor(S/65536),H=S-I*65536,S=Y+I+65535,I=Math.floor(S/65536),Y=S-I*65536,S=ie+I+65535,I=Math.floor(S/65536),ie=S-I*65536,D+=I-1+37*(I-1),w[0]=D,w[1]=L,w[2]=O,w[3]=P,w[4]=x,w[5]=T,w[6]=E,w[7]=N,w[8]=F,w[9]=B,w[10]=j,w[11]=k,w[12]=$,w[13]=H,w[14]=Y,w[15]=ie}function h(w,C){d(w,C,C)}function p(w,C){const A=n();for(let S=0;S<16;S++)A[S]=C[S];for(let S=253;S>=0;S--)h(A,A),S!==2&&S!==4&&d(A,A,C);for(let S=0;S<16;S++)w[S]=A[S]}function g(w,C){const A=new Uint8Array(32),S=new Float64Array(80),I=n(),D=n(),L=n(),O=n(),P=n(),x=n();for(let F=0;F<31;F++)A[F]=w[F];A[31]=w[31]&127|64,A[0]&=248,c(S,C);for(let F=0;F<16;F++)D[F]=S[F];I[0]=O[0]=1;for(let F=254;F>=0;--F){const B=A[F>>>3]>>>(F&7)&1;s(I,D,B),s(L,O,B),u(P,I,L),f(I,I,L),u(L,D,O),f(D,D,O),h(O,P),h(x,I),d(I,L,I),d(L,D,P),u(P,I,L),f(I,I,L),h(D,I),f(L,O,x),d(I,L,a),u(I,I,O),d(L,L,I),d(I,O,x),d(O,D,S),h(D,P),s(I,D,B),s(L,O,B)}for(let F=0;F<16;F++)S[F+16]=I[F],S[F+32]=L[F],S[F+48]=D[F],S[F+64]=O[F];const T=S.subarray(32),E=S.subarray(16);p(T,T),d(E,E,T);const N=new Uint8Array(32);return l(N,E),N}t.scalarMult=g;function v(w){return g(w,i)}t.scalarMultBase=v;function y(w){if(w.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const C=new Uint8Array(w);return{publicKey:v(C),secretKey:C}}t.generateKeyPairFromSeed=y;function m(w){const C=(0,e.randomBytes)(32,w),A=y(C);return(0,r.wipe)(C),A}t.generateKeyPair=m;function b(w,C,A=!1){if(w.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(C.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const S=g(w,C);if(A){let I=0;for(let D=0;D",l2t="MIT",c2t={url:"https://github.com/indutny/elliptic/issues"},u2t="https://github.com/indutny/elliptic",f2t={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},d2t={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},h2t={name:Jbt,version:e2t,description:t2t,main:r2t,files:n2t,scripts:i2t,repository:a2t,keywords:o2t,author:s2t,license:l2t,bugs:c2t,homepage:u2t,devDependencies:f2t,dependencies:d2t};var Ru={},NJ={exports:{}};NJ.exports;(function(t){(function(e,r){function n(O,P){if(!O)throw new Error(P||"Assertion failed")}function i(O,P){O.super_=P;var x=function(){};x.prototype=P.prototype,O.prototype=new x,O.prototype.constructor=O}function a(O,P,x){if(a.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((P==="le"||P==="be")&&(x=P,P=10),this._init(O||0,P||10,x||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=IJ.Buffer}catch{}a.isBN=function(P){return P instanceof a?!0:P!==null&&typeof P=="object"&&P.constructor.wordSize===a.wordSize&&Array.isArray(P.words)},a.max=function(P,x){return P.cmp(x)>0?P:x},a.min=function(P,x){return P.cmp(x)<0?P:x},a.prototype._init=function(P,x,T){if(typeof P=="number")return this._initNumber(P,x,T);if(typeof P=="object")return this._initArray(P,x,T);x==="hex"&&(x=16),n(x===(x|0)&&x>=2&&x<=36),P=P.toString().replace(/\s+/g,"");var E=0;P[0]==="-"&&(E++,this.negative=1),E=0;E-=3)F=P[E]|P[E-1]<<8|P[E-2]<<16,this.words[N]|=F<>>26-B&67108863,B+=24,B>=26&&(B-=26,N++);else if(T==="le")for(E=0,N=0;E>>26-B&67108863,B+=24,B>=26&&(B-=26,N++);return this.strip()};function s(O,P){var x=O.charCodeAt(P);return x>=65&&x<=70?x-55:x>=97&&x<=102?x-87:x-48&15}function l(O,P,x){var T=s(O,x);return x-1>=P&&(T|=s(O,x-1)<<4),T}a.prototype._parseHex=function(P,x,T){this.length=Math.ceil((P.length-x)/6),this.words=new Array(this.length);for(var E=0;E=x;E-=2)B=l(P,x,E)<=18?(N-=18,F+=1,this.words[F]|=B>>>26):N+=8;else{var j=P.length-x;for(E=j%2===0?x+1:x;E=18?(N-=18,F+=1,this.words[F]|=B>>>26):N+=8}this.strip()};function c(O,P,x,T){for(var E=0,N=Math.min(O.length,x),F=P;F=49?E+=B-49+10:B>=17?E+=B-17+10:E+=B}return E}a.prototype._parseBase=function(P,x,T){this.words=[0],this.length=1;for(var E=0,N=1;N<=67108863;N*=x)E++;E--,N=N/x|0;for(var F=P.length-T,B=F%E,j=Math.min(F,F-B)+T,k=0,$=T;$1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(P,x){P=P||10,x=x|0||1;var T;if(P===16||P==="hex"){T="";for(var E=0,N=0,F=0;F>>24-E&16777215,N!==0||F!==this.length-1?T=u[6-j.length]+j+T:T=j+T,E+=2,E>=26&&(E-=26,F--)}for(N!==0&&(T=N.toString(16)+T);T.length%x!==0;)T="0"+T;return this.negative!==0&&(T="-"+T),T}if(P===(P|0)&&P>=2&&P<=36){var k=f[P],$=d[P];T="";var H=this.clone();for(H.negative=0;!H.isZero();){var Y=H.modn($).toString(P);H=H.idivn($),H.isZero()?T=Y+T:T=u[k-Y.length]+Y+T}for(this.isZero()&&(T="0"+T);T.length%x!==0;)T="0"+T;return this.negative!==0&&(T="-"+T),T}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var P=this.words[0];return this.length===2?P+=this.words[1]*67108864:this.length===3&&this.words[2]===1?P+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-P:P},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(P,x){return n(typeof o<"u"),this.toArrayLike(o,P,x)},a.prototype.toArray=function(P,x){return this.toArrayLike(Array,P,x)},a.prototype.toArrayLike=function(P,x,T){var E=this.byteLength(),N=T||Math.max(1,E);n(E<=N,"byte array longer than desired length"),n(N>0,"Requested array length <= 0"),this.strip();var F=x==="le",B=new P(N),j,k,$=this.clone();if(F){for(k=0;!$.isZero();k++)j=$.andln(255),$.iushrn(8),B[k]=j;for(;k=4096&&(T+=13,x>>>=13),x>=64&&(T+=7,x>>>=7),x>=8&&(T+=4,x>>>=4),x>=2&&(T+=2,x>>>=2),T+x},a.prototype._zeroBits=function(P){if(P===0)return 26;var x=P,T=0;return x&8191||(T+=13,x>>>=13),x&127||(T+=7,x>>>=7),x&15||(T+=4,x>>>=4),x&3||(T+=2,x>>>=2),x&1||T++,T},a.prototype.bitLength=function(){var P=this.words[this.length-1],x=this._countBits(P);return(this.length-1)*26+x};function h(O){for(var P=new Array(O.bitLength()),x=0;x>>E}return P}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var P=0,x=0;xP.length?this.clone().ior(P):P.clone().ior(this)},a.prototype.uor=function(P){return this.length>P.length?this.clone().iuor(P):P.clone().iuor(this)},a.prototype.iuand=function(P){var x;this.length>P.length?x=P:x=this;for(var T=0;TP.length?this.clone().iand(P):P.clone().iand(this)},a.prototype.uand=function(P){return this.length>P.length?this.clone().iuand(P):P.clone().iuand(this)},a.prototype.iuxor=function(P){var x,T;this.length>P.length?(x=this,T=P):(x=P,T=this);for(var E=0;EP.length?this.clone().ixor(P):P.clone().ixor(this)},a.prototype.uxor=function(P){return this.length>P.length?this.clone().iuxor(P):P.clone().iuxor(this)},a.prototype.inotn=function(P){n(typeof P=="number"&&P>=0);var x=Math.ceil(P/26)|0,T=P%26;this._expand(x),T>0&&x--;for(var E=0;E0&&(this.words[E]=~this.words[E]&67108863>>26-T),this.strip()},a.prototype.notn=function(P){return this.clone().inotn(P)},a.prototype.setn=function(P,x){n(typeof P=="number"&&P>=0);var T=P/26|0,E=P%26;return this._expand(T+1),x?this.words[T]=this.words[T]|1<P.length?(T=this,E=P):(T=P,E=this);for(var N=0,F=0;F>>26;for(;N!==0&&F>>26;if(this.length=T.length,N!==0)this.words[this.length]=N,this.length++;else if(T!==this)for(;FP.length?this.clone().iadd(P):P.clone().iadd(this)},a.prototype.isub=function(P){if(P.negative!==0){P.negative=0;var x=this.iadd(P);return P.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(P),this.negative=1,this._normSign();var T=this.cmp(P);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,N;T>0?(E=this,N=P):(E=P,N=this);for(var F=0,B=0;B>26,this.words[B]=x&67108863;for(;F!==0&&B>26,this.words[B]=x&67108863;if(F===0&&B>>26,H=j&67108863,Y=Math.min(k,P.length-1),ie=Math.max(0,k-O.length+1);ie<=Y;ie++){var W=k-ie|0;E=O.words[W]|0,N=P.words[ie]|0,F=E*N+H,$+=F/67108864|0,H=F&67108863}x.words[k]=H|0,j=$|0}return j!==0?x.words[k]=j|0:x.length--,x.strip()}var g=function(P,x,T){var E=P.words,N=x.words,F=T.words,B=0,j,k,$,H=E[0]|0,Y=H&8191,ie=H>>>13,W=E[1]|0,Q=W&8191,J=W>>>13,ee=E[2]|0,ne=ee&8191,V=ee>>>13,oe=E[3]|0,ye=oe&8191,Te=oe>>>13,Me=E[4]|0,Oe=Me&8191,nt=Me>>>13,it=E[5]|0,St=it&8191,bt=it>>>13,Ce=E[6]|0,We=Ce&8191,Le=Ce>>>13,Ke=E[7]|0,qe=Ke&8191,we=Ke>>>13,Se=E[8]|0,q=Se&8191,z=Se>>>13,G=E[9]|0,re=G&8191,ue=G>>>13,_e=N[0]|0,Ee=_e&8191,et=_e>>>13,pt=N[1]|0,Ct=pt&8191,ot=pt>>>13,Pt=N[2]|0,mr=Pt&8191,qt=Pt>>>13,Ur=N[3]|0,Ir=Ur&8191,yt=Ur>>>13,Qt=N[4]|0,Xt=Qt&8191,$t=Qt>>>13,hr=N[5]|0,lr=hr&8191,Dt=hr>>>13,kr=N[6]|0,_r=kr&8191,Jt=kr>>>13,Pr=N[7]|0,zr=Pr&8191,Zt=Pr>>>13,Nr=N[8]|0,Sr=Nr&8191,Yt=Nr>>>13,ve=N[9]|0,me=ve&8191,le=ve>>>13;T.negative=P.negative^x.negative,T.length=19,j=Math.imul(Y,Ee),k=Math.imul(Y,et),k=k+Math.imul(ie,Ee)|0,$=Math.imul(ie,et);var de=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(de>>>26)|0,de&=67108863,j=Math.imul(Q,Ee),k=Math.imul(Q,et),k=k+Math.imul(J,Ee)|0,$=Math.imul(J,et),j=j+Math.imul(Y,Ct)|0,k=k+Math.imul(Y,ot)|0,k=k+Math.imul(ie,Ct)|0,$=$+Math.imul(ie,ot)|0;var ge=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(ge>>>26)|0,ge&=67108863,j=Math.imul(ne,Ee),k=Math.imul(ne,et),k=k+Math.imul(V,Ee)|0,$=Math.imul(V,et),j=j+Math.imul(Q,Ct)|0,k=k+Math.imul(Q,ot)|0,k=k+Math.imul(J,Ct)|0,$=$+Math.imul(J,ot)|0,j=j+Math.imul(Y,mr)|0,k=k+Math.imul(Y,qt)|0,k=k+Math.imul(ie,mr)|0,$=$+Math.imul(ie,qt)|0;var Ue=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,j=Math.imul(ye,Ee),k=Math.imul(ye,et),k=k+Math.imul(Te,Ee)|0,$=Math.imul(Te,et),j=j+Math.imul(ne,Ct)|0,k=k+Math.imul(ne,ot)|0,k=k+Math.imul(V,Ct)|0,$=$+Math.imul(V,ot)|0,j=j+Math.imul(Q,mr)|0,k=k+Math.imul(Q,qt)|0,k=k+Math.imul(J,mr)|0,$=$+Math.imul(J,qt)|0,j=j+Math.imul(Y,Ir)|0,k=k+Math.imul(Y,yt)|0,k=k+Math.imul(ie,Ir)|0,$=$+Math.imul(ie,yt)|0;var tt=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(tt>>>26)|0,tt&=67108863,j=Math.imul(Oe,Ee),k=Math.imul(Oe,et),k=k+Math.imul(nt,Ee)|0,$=Math.imul(nt,et),j=j+Math.imul(ye,Ct)|0,k=k+Math.imul(ye,ot)|0,k=k+Math.imul(Te,Ct)|0,$=$+Math.imul(Te,ot)|0,j=j+Math.imul(ne,mr)|0,k=k+Math.imul(ne,qt)|0,k=k+Math.imul(V,mr)|0,$=$+Math.imul(V,qt)|0,j=j+Math.imul(Q,Ir)|0,k=k+Math.imul(Q,yt)|0,k=k+Math.imul(J,Ir)|0,$=$+Math.imul(J,yt)|0,j=j+Math.imul(Y,Xt)|0,k=k+Math.imul(Y,$t)|0,k=k+Math.imul(ie,Xt)|0,$=$+Math.imul(ie,$t)|0;var Qe=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,j=Math.imul(St,Ee),k=Math.imul(St,et),k=k+Math.imul(bt,Ee)|0,$=Math.imul(bt,et),j=j+Math.imul(Oe,Ct)|0,k=k+Math.imul(Oe,ot)|0,k=k+Math.imul(nt,Ct)|0,$=$+Math.imul(nt,ot)|0,j=j+Math.imul(ye,mr)|0,k=k+Math.imul(ye,qt)|0,k=k+Math.imul(Te,mr)|0,$=$+Math.imul(Te,qt)|0,j=j+Math.imul(ne,Ir)|0,k=k+Math.imul(ne,yt)|0,k=k+Math.imul(V,Ir)|0,$=$+Math.imul(V,yt)|0,j=j+Math.imul(Q,Xt)|0,k=k+Math.imul(Q,$t)|0,k=k+Math.imul(J,Xt)|0,$=$+Math.imul(J,$t)|0,j=j+Math.imul(Y,lr)|0,k=k+Math.imul(Y,Dt)|0,k=k+Math.imul(ie,lr)|0,$=$+Math.imul(ie,Dt)|0;var Ne=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,j=Math.imul(We,Ee),k=Math.imul(We,et),k=k+Math.imul(Le,Ee)|0,$=Math.imul(Le,et),j=j+Math.imul(St,Ct)|0,k=k+Math.imul(St,ot)|0,k=k+Math.imul(bt,Ct)|0,$=$+Math.imul(bt,ot)|0,j=j+Math.imul(Oe,mr)|0,k=k+Math.imul(Oe,qt)|0,k=k+Math.imul(nt,mr)|0,$=$+Math.imul(nt,qt)|0,j=j+Math.imul(ye,Ir)|0,k=k+Math.imul(ye,yt)|0,k=k+Math.imul(Te,Ir)|0,$=$+Math.imul(Te,yt)|0,j=j+Math.imul(ne,Xt)|0,k=k+Math.imul(ne,$t)|0,k=k+Math.imul(V,Xt)|0,$=$+Math.imul(V,$t)|0,j=j+Math.imul(Q,lr)|0,k=k+Math.imul(Q,Dt)|0,k=k+Math.imul(J,lr)|0,$=$+Math.imul(J,Dt)|0,j=j+Math.imul(Y,_r)|0,k=k+Math.imul(Y,Jt)|0,k=k+Math.imul(ie,_r)|0,$=$+Math.imul(ie,Jt)|0;var ut=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(ut>>>26)|0,ut&=67108863,j=Math.imul(qe,Ee),k=Math.imul(qe,et),k=k+Math.imul(we,Ee)|0,$=Math.imul(we,et),j=j+Math.imul(We,Ct)|0,k=k+Math.imul(We,ot)|0,k=k+Math.imul(Le,Ct)|0,$=$+Math.imul(Le,ot)|0,j=j+Math.imul(St,mr)|0,k=k+Math.imul(St,qt)|0,k=k+Math.imul(bt,mr)|0,$=$+Math.imul(bt,qt)|0,j=j+Math.imul(Oe,Ir)|0,k=k+Math.imul(Oe,yt)|0,k=k+Math.imul(nt,Ir)|0,$=$+Math.imul(nt,yt)|0,j=j+Math.imul(ye,Xt)|0,k=k+Math.imul(ye,$t)|0,k=k+Math.imul(Te,Xt)|0,$=$+Math.imul(Te,$t)|0,j=j+Math.imul(ne,lr)|0,k=k+Math.imul(ne,Dt)|0,k=k+Math.imul(V,lr)|0,$=$+Math.imul(V,Dt)|0,j=j+Math.imul(Q,_r)|0,k=k+Math.imul(Q,Jt)|0,k=k+Math.imul(J,_r)|0,$=$+Math.imul(J,Jt)|0,j=j+Math.imul(Y,zr)|0,k=k+Math.imul(Y,Zt)|0,k=k+Math.imul(ie,zr)|0,$=$+Math.imul(ie,Zt)|0;var Lt=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,j=Math.imul(q,Ee),k=Math.imul(q,et),k=k+Math.imul(z,Ee)|0,$=Math.imul(z,et),j=j+Math.imul(qe,Ct)|0,k=k+Math.imul(qe,ot)|0,k=k+Math.imul(we,Ct)|0,$=$+Math.imul(we,ot)|0,j=j+Math.imul(We,mr)|0,k=k+Math.imul(We,qt)|0,k=k+Math.imul(Le,mr)|0,$=$+Math.imul(Le,qt)|0,j=j+Math.imul(St,Ir)|0,k=k+Math.imul(St,yt)|0,k=k+Math.imul(bt,Ir)|0,$=$+Math.imul(bt,yt)|0,j=j+Math.imul(Oe,Xt)|0,k=k+Math.imul(Oe,$t)|0,k=k+Math.imul(nt,Xt)|0,$=$+Math.imul(nt,$t)|0,j=j+Math.imul(ye,lr)|0,k=k+Math.imul(ye,Dt)|0,k=k+Math.imul(Te,lr)|0,$=$+Math.imul(Te,Dt)|0,j=j+Math.imul(ne,_r)|0,k=k+Math.imul(ne,Jt)|0,k=k+Math.imul(V,_r)|0,$=$+Math.imul(V,Jt)|0,j=j+Math.imul(Q,zr)|0,k=k+Math.imul(Q,Zt)|0,k=k+Math.imul(J,zr)|0,$=$+Math.imul(J,Zt)|0,j=j+Math.imul(Y,Sr)|0,k=k+Math.imul(Y,Yt)|0,k=k+Math.imul(ie,Sr)|0,$=$+Math.imul(ie,Yt)|0;var Wr=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,j=Math.imul(re,Ee),k=Math.imul(re,et),k=k+Math.imul(ue,Ee)|0,$=Math.imul(ue,et),j=j+Math.imul(q,Ct)|0,k=k+Math.imul(q,ot)|0,k=k+Math.imul(z,Ct)|0,$=$+Math.imul(z,ot)|0,j=j+Math.imul(qe,mr)|0,k=k+Math.imul(qe,qt)|0,k=k+Math.imul(we,mr)|0,$=$+Math.imul(we,qt)|0,j=j+Math.imul(We,Ir)|0,k=k+Math.imul(We,yt)|0,k=k+Math.imul(Le,Ir)|0,$=$+Math.imul(Le,yt)|0,j=j+Math.imul(St,Xt)|0,k=k+Math.imul(St,$t)|0,k=k+Math.imul(bt,Xt)|0,$=$+Math.imul(bt,$t)|0,j=j+Math.imul(Oe,lr)|0,k=k+Math.imul(Oe,Dt)|0,k=k+Math.imul(nt,lr)|0,$=$+Math.imul(nt,Dt)|0,j=j+Math.imul(ye,_r)|0,k=k+Math.imul(ye,Jt)|0,k=k+Math.imul(Te,_r)|0,$=$+Math.imul(Te,Jt)|0,j=j+Math.imul(ne,zr)|0,k=k+Math.imul(ne,Zt)|0,k=k+Math.imul(V,zr)|0,$=$+Math.imul(V,Zt)|0,j=j+Math.imul(Q,Sr)|0,k=k+Math.imul(Q,Yt)|0,k=k+Math.imul(J,Sr)|0,$=$+Math.imul(J,Yt)|0,j=j+Math.imul(Y,me)|0,k=k+Math.imul(Y,le)|0,k=k+Math.imul(ie,me)|0,$=$+Math.imul(ie,le)|0;var nn=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(nn>>>26)|0,nn&=67108863,j=Math.imul(re,Ct),k=Math.imul(re,ot),k=k+Math.imul(ue,Ct)|0,$=Math.imul(ue,ot),j=j+Math.imul(q,mr)|0,k=k+Math.imul(q,qt)|0,k=k+Math.imul(z,mr)|0,$=$+Math.imul(z,qt)|0,j=j+Math.imul(qe,Ir)|0,k=k+Math.imul(qe,yt)|0,k=k+Math.imul(we,Ir)|0,$=$+Math.imul(we,yt)|0,j=j+Math.imul(We,Xt)|0,k=k+Math.imul(We,$t)|0,k=k+Math.imul(Le,Xt)|0,$=$+Math.imul(Le,$t)|0,j=j+Math.imul(St,lr)|0,k=k+Math.imul(St,Dt)|0,k=k+Math.imul(bt,lr)|0,$=$+Math.imul(bt,Dt)|0,j=j+Math.imul(Oe,_r)|0,k=k+Math.imul(Oe,Jt)|0,k=k+Math.imul(nt,_r)|0,$=$+Math.imul(nt,Jt)|0,j=j+Math.imul(ye,zr)|0,k=k+Math.imul(ye,Zt)|0,k=k+Math.imul(Te,zr)|0,$=$+Math.imul(Te,Zt)|0,j=j+Math.imul(ne,Sr)|0,k=k+Math.imul(ne,Yt)|0,k=k+Math.imul(V,Sr)|0,$=$+Math.imul(V,Yt)|0,j=j+Math.imul(Q,me)|0,k=k+Math.imul(Q,le)|0,k=k+Math.imul(J,me)|0,$=$+Math.imul(J,le)|0;var Dn=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,j=Math.imul(re,mr),k=Math.imul(re,qt),k=k+Math.imul(ue,mr)|0,$=Math.imul(ue,qt),j=j+Math.imul(q,Ir)|0,k=k+Math.imul(q,yt)|0,k=k+Math.imul(z,Ir)|0,$=$+Math.imul(z,yt)|0,j=j+Math.imul(qe,Xt)|0,k=k+Math.imul(qe,$t)|0,k=k+Math.imul(we,Xt)|0,$=$+Math.imul(we,$t)|0,j=j+Math.imul(We,lr)|0,k=k+Math.imul(We,Dt)|0,k=k+Math.imul(Le,lr)|0,$=$+Math.imul(Le,Dt)|0,j=j+Math.imul(St,_r)|0,k=k+Math.imul(St,Jt)|0,k=k+Math.imul(bt,_r)|0,$=$+Math.imul(bt,Jt)|0,j=j+Math.imul(Oe,zr)|0,k=k+Math.imul(Oe,Zt)|0,k=k+Math.imul(nt,zr)|0,$=$+Math.imul(nt,Zt)|0,j=j+Math.imul(ye,Sr)|0,k=k+Math.imul(ye,Yt)|0,k=k+Math.imul(Te,Sr)|0,$=$+Math.imul(Te,Yt)|0,j=j+Math.imul(ne,me)|0,k=k+Math.imul(ne,le)|0,k=k+Math.imul(V,me)|0,$=$+Math.imul(V,le)|0;var Hr=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,j=Math.imul(re,Ir),k=Math.imul(re,yt),k=k+Math.imul(ue,Ir)|0,$=Math.imul(ue,yt),j=j+Math.imul(q,Xt)|0,k=k+Math.imul(q,$t)|0,k=k+Math.imul(z,Xt)|0,$=$+Math.imul(z,$t)|0,j=j+Math.imul(qe,lr)|0,k=k+Math.imul(qe,Dt)|0,k=k+Math.imul(we,lr)|0,$=$+Math.imul(we,Dt)|0,j=j+Math.imul(We,_r)|0,k=k+Math.imul(We,Jt)|0,k=k+Math.imul(Le,_r)|0,$=$+Math.imul(Le,Jt)|0,j=j+Math.imul(St,zr)|0,k=k+Math.imul(St,Zt)|0,k=k+Math.imul(bt,zr)|0,$=$+Math.imul(bt,Zt)|0,j=j+Math.imul(Oe,Sr)|0,k=k+Math.imul(Oe,Yt)|0,k=k+Math.imul(nt,Sr)|0,$=$+Math.imul(nt,Yt)|0,j=j+Math.imul(ye,me)|0,k=k+Math.imul(ye,le)|0,k=k+Math.imul(Te,me)|0,$=$+Math.imul(Te,le)|0;var Nn=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,j=Math.imul(re,Xt),k=Math.imul(re,$t),k=k+Math.imul(ue,Xt)|0,$=Math.imul(ue,$t),j=j+Math.imul(q,lr)|0,k=k+Math.imul(q,Dt)|0,k=k+Math.imul(z,lr)|0,$=$+Math.imul(z,Dt)|0,j=j+Math.imul(qe,_r)|0,k=k+Math.imul(qe,Jt)|0,k=k+Math.imul(we,_r)|0,$=$+Math.imul(we,Jt)|0,j=j+Math.imul(We,zr)|0,k=k+Math.imul(We,Zt)|0,k=k+Math.imul(Le,zr)|0,$=$+Math.imul(Le,Zt)|0,j=j+Math.imul(St,Sr)|0,k=k+Math.imul(St,Yt)|0,k=k+Math.imul(bt,Sr)|0,$=$+Math.imul(bt,Yt)|0,j=j+Math.imul(Oe,me)|0,k=k+Math.imul(Oe,le)|0,k=k+Math.imul(nt,me)|0,$=$+Math.imul(nt,le)|0;var zn=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(zn>>>26)|0,zn&=67108863,j=Math.imul(re,lr),k=Math.imul(re,Dt),k=k+Math.imul(ue,lr)|0,$=Math.imul(ue,Dt),j=j+Math.imul(q,_r)|0,k=k+Math.imul(q,Jt)|0,k=k+Math.imul(z,_r)|0,$=$+Math.imul(z,Jt)|0,j=j+Math.imul(qe,zr)|0,k=k+Math.imul(qe,Zt)|0,k=k+Math.imul(we,zr)|0,$=$+Math.imul(we,Zt)|0,j=j+Math.imul(We,Sr)|0,k=k+Math.imul(We,Yt)|0,k=k+Math.imul(Le,Sr)|0,$=$+Math.imul(Le,Yt)|0,j=j+Math.imul(St,me)|0,k=k+Math.imul(St,le)|0,k=k+Math.imul(bt,me)|0,$=$+Math.imul(bt,le)|0;var Cr=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,j=Math.imul(re,_r),k=Math.imul(re,Jt),k=k+Math.imul(ue,_r)|0,$=Math.imul(ue,Jt),j=j+Math.imul(q,zr)|0,k=k+Math.imul(q,Zt)|0,k=k+Math.imul(z,zr)|0,$=$+Math.imul(z,Zt)|0,j=j+Math.imul(qe,Sr)|0,k=k+Math.imul(qe,Yt)|0,k=k+Math.imul(we,Sr)|0,$=$+Math.imul(we,Yt)|0,j=j+Math.imul(We,me)|0,k=k+Math.imul(We,le)|0,k=k+Math.imul(Le,me)|0,$=$+Math.imul(Le,le)|0;var pi=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(pi>>>26)|0,pi&=67108863,j=Math.imul(re,zr),k=Math.imul(re,Zt),k=k+Math.imul(ue,zr)|0,$=Math.imul(ue,Zt),j=j+Math.imul(q,Sr)|0,k=k+Math.imul(q,Yt)|0,k=k+Math.imul(z,Sr)|0,$=$+Math.imul(z,Yt)|0,j=j+Math.imul(qe,me)|0,k=k+Math.imul(qe,le)|0,k=k+Math.imul(we,me)|0,$=$+Math.imul(we,le)|0;var ci=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(ci>>>26)|0,ci&=67108863,j=Math.imul(re,Sr),k=Math.imul(re,Yt),k=k+Math.imul(ue,Sr)|0,$=Math.imul(ue,Yt),j=j+Math.imul(q,me)|0,k=k+Math.imul(q,le)|0,k=k+Math.imul(z,me)|0,$=$+Math.imul(z,le)|0;var ro=(B+j|0)+((k&8191)<<13)|0;B=($+(k>>>13)|0)+(ro>>>26)|0,ro&=67108863,j=Math.imul(re,me),k=Math.imul(re,le),k=k+Math.imul(ue,me)|0,$=Math.imul(ue,le);var zs=(B+j|0)+((k&8191)<<13)|0;return B=($+(k>>>13)|0)+(zs>>>26)|0,zs&=67108863,F[0]=de,F[1]=ge,F[2]=Ue,F[3]=tt,F[4]=Qe,F[5]=Ne,F[6]=ut,F[7]=Lt,F[8]=Wr,F[9]=nn,F[10]=Dn,F[11]=Hr,F[12]=Nn,F[13]=zn,F[14]=Cr,F[15]=pi,F[16]=ci,F[17]=ro,F[18]=zs,B!==0&&(F[19]=B,T.length++),T};Math.imul||(g=p);function v(O,P,x){x.negative=P.negative^O.negative,x.length=O.length+P.length;for(var T=0,E=0,N=0;N>>26)|0,E+=F>>>26,F&=67108863}x.words[N]=B,T=F,F=E}return T!==0?x.words[N]=T:x.length--,x.strip()}function y(O,P,x){var T=new m;return T.mulp(O,P,x)}a.prototype.mulTo=function(P,x){var T,E=this.length+P.length;return this.length===10&&P.length===10?T=g(this,P,x):E<63?T=p(this,P,x):E<1024?T=v(this,P,x):T=y(this,P,x),T};function m(O,P){this.x=O,this.y=P}m.prototype.makeRBT=function(P){for(var x=new Array(P),T=a.prototype._countBits(P)-1,E=0;E>=1;return E},m.prototype.permute=function(P,x,T,E,N,F){for(var B=0;B>>1)N++;return 1<>>13,T[2*F+1]=N&8191,N=N>>>13;for(F=2*x;F>=26,x+=E/67108864|0,x+=N>>>26,this.words[T]=N&67108863}return x!==0&&(this.words[T]=x,this.length++),this},a.prototype.muln=function(P){return this.clone().imuln(P)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(P){var x=h(P);if(x.length===0)return new a(1);for(var T=this,E=0;E=0);var x=P%26,T=(P-x)/26,E=67108863>>>26-x<<26-x,N;if(x!==0){var F=0;for(N=0;N>>26-x}F&&(this.words[N]=F,this.length++)}if(T!==0){for(N=this.length-1;N>=0;N--)this.words[N+T]=this.words[N];for(N=0;N=0);var E;x?E=(x-x%26)/26:E=0;var N=P%26,F=Math.min((P-N)/26,this.length),B=67108863^67108863>>>N<F)for(this.length-=F,k=0;k=0&&($!==0||k>=E);k--){var H=this.words[k]|0;this.words[k]=$<<26-N|H>>>N,$=H&B}return j&&$!==0&&(j.words[j.length++]=$),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(P,x,T){return n(this.negative===0),this.iushrn(P,x,T)},a.prototype.shln=function(P){return this.clone().ishln(P)},a.prototype.ushln=function(P){return this.clone().iushln(P)},a.prototype.shrn=function(P){return this.clone().ishrn(P)},a.prototype.ushrn=function(P){return this.clone().iushrn(P)},a.prototype.testn=function(P){n(typeof P=="number"&&P>=0);var x=P%26,T=(P-x)/26,E=1<=0);var x=P%26,T=(P-x)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(x!==0&&T++,this.length=Math.min(T,this.length),x!==0){var E=67108863^67108863>>>x<=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},a.prototype.isubn=function(P){if(n(typeof P=="number"),n(P<67108864),P<0)return this.iaddn(-P);if(this.negative!==0)return this.negative=0,this.iaddn(P),this.negative=1,this;if(this.words[0]-=P,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x>26)-(j/67108864|0),this.words[N+T]=F&67108863}for(;N>26,this.words[N+T]=F&67108863;if(B===0)return this.strip();for(n(B===-1),B=0,N=0;N>26,this.words[N]=F&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(P,x){var T=this.length-P.length,E=this.clone(),N=P,F=N.words[N.length-1]|0,B=this._countBits(F);T=26-B,T!==0&&(N=N.ushln(T),E.iushln(T),F=N.words[N.length-1]|0);var j=E.length-N.length,k;if(x!=="mod"){k=new a(null),k.length=j+1,k.words=new Array(k.length);for(var $=0;$=0;Y--){var ie=(E.words[N.length+Y]|0)*67108864+(E.words[N.length+Y-1]|0);for(ie=Math.min(ie/F|0,67108863),E._ishlnsubmul(N,ie,Y);E.negative!==0;)ie--,E.negative=0,E._ishlnsubmul(N,1,Y),E.isZero()||(E.negative^=1);k&&(k.words[Y]=ie)}return k&&k.strip(),E.strip(),x!=="div"&&T!==0&&E.iushrn(T),{div:k||null,mod:E}},a.prototype.divmod=function(P,x,T){if(n(!P.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var E,N,F;return this.negative!==0&&P.negative===0?(F=this.neg().divmod(P,x),x!=="mod"&&(E=F.div.neg()),x!=="div"&&(N=F.mod.neg(),T&&N.negative!==0&&N.iadd(P)),{div:E,mod:N}):this.negative===0&&P.negative!==0?(F=this.divmod(P.neg(),x),x!=="mod"&&(E=F.div.neg()),{div:E,mod:F.mod}):this.negative&P.negative?(F=this.neg().divmod(P.neg(),x),x!=="div"&&(N=F.mod.neg(),T&&N.negative!==0&&N.isub(P)),{div:F.div,mod:N}):P.length>this.length||this.cmp(P)<0?{div:new a(0),mod:this}:P.length===1?x==="div"?{div:this.divn(P.words[0]),mod:null}:x==="mod"?{div:null,mod:new a(this.modn(P.words[0]))}:{div:this.divn(P.words[0]),mod:new a(this.modn(P.words[0]))}:this._wordDiv(P,x)},a.prototype.div=function(P){return this.divmod(P,"div",!1).div},a.prototype.mod=function(P){return this.divmod(P,"mod",!1).mod},a.prototype.umod=function(P){return this.divmod(P,"mod",!0).mod},a.prototype.divRound=function(P){var x=this.divmod(P);if(x.mod.isZero())return x.div;var T=x.div.negative!==0?x.mod.isub(P):x.mod,E=P.ushrn(1),N=P.andln(1),F=T.cmp(E);return F<0||N===1&&F===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},a.prototype.modn=function(P){n(P<=67108863);for(var x=(1<<26)%P,T=0,E=this.length-1;E>=0;E--)T=(x*T+(this.words[E]|0))%P;return T},a.prototype.idivn=function(P){n(P<=67108863);for(var x=0,T=this.length-1;T>=0;T--){var E=(this.words[T]|0)+x*67108864;this.words[T]=E/P|0,x=E%P}return this.strip()},a.prototype.divn=function(P){return this.clone().idivn(P)},a.prototype.egcd=function(P){n(P.negative===0),n(!P.isZero());var x=this,T=P.clone();x.negative!==0?x=x.umod(P):x=x.clone();for(var E=new a(1),N=new a(0),F=new a(0),B=new a(1),j=0;x.isEven()&&T.isEven();)x.iushrn(1),T.iushrn(1),++j;for(var k=T.clone(),$=x.clone();!x.isZero();){for(var H=0,Y=1;!(x.words[0]&Y)&&H<26;++H,Y<<=1);if(H>0)for(x.iushrn(H);H-- >0;)(E.isOdd()||N.isOdd())&&(E.iadd(k),N.isub($)),E.iushrn(1),N.iushrn(1);for(var ie=0,W=1;!(T.words[0]&W)&&ie<26;++ie,W<<=1);if(ie>0)for(T.iushrn(ie);ie-- >0;)(F.isOdd()||B.isOdd())&&(F.iadd(k),B.isub($)),F.iushrn(1),B.iushrn(1);x.cmp(T)>=0?(x.isub(T),E.isub(F),N.isub(B)):(T.isub(x),F.isub(E),B.isub(N))}return{a:F,b:B,gcd:T.iushln(j)}},a.prototype._invmp=function(P){n(P.negative===0),n(!P.isZero());var x=this,T=P.clone();x.negative!==0?x=x.umod(P):x=x.clone();for(var E=new a(1),N=new a(0),F=T.clone();x.cmpn(1)>0&&T.cmpn(1)>0;){for(var B=0,j=1;!(x.words[0]&j)&&B<26;++B,j<<=1);if(B>0)for(x.iushrn(B);B-- >0;)E.isOdd()&&E.iadd(F),E.iushrn(1);for(var k=0,$=1;!(T.words[0]&$)&&k<26;++k,$<<=1);if(k>0)for(T.iushrn(k);k-- >0;)N.isOdd()&&N.iadd(F),N.iushrn(1);x.cmp(T)>=0?(x.isub(T),E.isub(N)):(T.isub(x),N.isub(E))}var H;return x.cmpn(1)===0?H=E:H=N,H.cmpn(0)<0&&H.iadd(P),H},a.prototype.gcd=function(P){if(this.isZero())return P.abs();if(P.isZero())return this.abs();var x=this.clone(),T=P.clone();x.negative=0,T.negative=0;for(var E=0;x.isEven()&&T.isEven();E++)x.iushrn(1),T.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;T.isEven();)T.iushrn(1);var N=x.cmp(T);if(N<0){var F=x;x=T,T=F}else if(N===0||T.cmpn(1)===0)break;x.isub(T)}while(!0);return T.iushln(E)},a.prototype.invm=function(P){return this.egcd(P).a.umod(P)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(P){return this.words[0]&P},a.prototype.bincn=function(P){n(typeof P=="number");var x=P%26,T=(P-x)/26,E=1<>>26,B&=67108863,this.words[F]=B}return N!==0&&(this.words[F]=N,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(P){var x=P<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this.strip();var T;if(this.length>1)T=1;else{x&&(P=-P),n(P<=67108863,"Number is too big");var E=this.words[0]|0;T=E===P?0:EP.length)return 1;if(this.length=0;T--){var E=this.words[T]|0,N=P.words[T]|0;if(E!==N){EN&&(x=1);break}}return x},a.prototype.gtn=function(P){return this.cmpn(P)===1},a.prototype.gt=function(P){return this.cmp(P)===1},a.prototype.gten=function(P){return this.cmpn(P)>=0},a.prototype.gte=function(P){return this.cmp(P)>=0},a.prototype.ltn=function(P){return this.cmpn(P)===-1},a.prototype.lt=function(P){return this.cmp(P)===-1},a.prototype.lten=function(P){return this.cmpn(P)<=0},a.prototype.lte=function(P){return this.cmp(P)<=0},a.prototype.eqn=function(P){return this.cmpn(P)===0},a.prototype.eq=function(P){return this.cmp(P)===0},a.red=function(P){return new D(P)},a.prototype.toRed=function(P){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),P.convertTo(this)._forceRed(P)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(P){return this.red=P,this},a.prototype.forceRed=function(P){return n(!this.red,"Already a number in reduction context"),this._forceRed(P)},a.prototype.redAdd=function(P){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,P)},a.prototype.redIAdd=function(P){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,P)},a.prototype.redSub=function(P){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,P)},a.prototype.redISub=function(P){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,P)},a.prototype.redShl=function(P){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,P)},a.prototype.redMul=function(P){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.mul(this,P)},a.prototype.redIMul=function(P){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.imul(this,P)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(P){return n(this.red&&!P.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,P)};var b={k256:null,p224:null,p192:null,p25519:null};function w(O,P){this.name=O,this.p=new a(P,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var P=new a(null);return P.words=new Array(Math.ceil(this.n/13)),P},w.prototype.ireduce=function(P){var x=P,T;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),T=x.bitLength();while(T>this.n);var E=T0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},w.prototype.split=function(P,x){P.iushrn(this.n,0,x)},w.prototype.imulK=function(P){return P.imul(this.k)};function C(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(C,w),C.prototype.split=function(P,x){for(var T=4194303,E=Math.min(P.length,9),N=0;N>>22,F=B}F>>>=22,P.words[N-10]=F,F===0&&P.length>10?P.length-=10:P.length-=9},C.prototype.imulK=function(P){P.words[P.length]=0,P.words[P.length+1]=0,P.length+=2;for(var x=0,T=0;T>>=26,P.words[T]=N,x=E}return x!==0&&(P.words[P.length++]=x),P},a._prime=function(P){if(b[P])return b[P];var x;if(P==="k256")x=new C;else if(P==="p224")x=new A;else if(P==="p192")x=new S;else if(P==="p25519")x=new I;else throw new Error("Unknown prime "+P);return b[P]=x,x};function D(O){if(typeof O=="string"){var P=a._prime(O);this.m=P.p,this.prime=P}else n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}D.prototype._verify1=function(P){n(P.negative===0,"red works only with positives"),n(P.red,"red works only with red numbers")},D.prototype._verify2=function(P,x){n((P.negative|x.negative)===0,"red works only with positives"),n(P.red&&P.red===x.red,"red works only with red numbers")},D.prototype.imod=function(P){return this.prime?this.prime.ireduce(P)._forceRed(this):P.umod(this.m)._forceRed(this)},D.prototype.neg=function(P){return P.isZero()?P.clone():this.m.sub(P)._forceRed(this)},D.prototype.add=function(P,x){this._verify2(P,x);var T=P.add(x);return T.cmp(this.m)>=0&&T.isub(this.m),T._forceRed(this)},D.prototype.iadd=function(P,x){this._verify2(P,x);var T=P.iadd(x);return T.cmp(this.m)>=0&&T.isub(this.m),T},D.prototype.sub=function(P,x){this._verify2(P,x);var T=P.sub(x);return T.cmpn(0)<0&&T.iadd(this.m),T._forceRed(this)},D.prototype.isub=function(P,x){this._verify2(P,x);var T=P.isub(x);return T.cmpn(0)<0&&T.iadd(this.m),T},D.prototype.shl=function(P,x){return this._verify1(P),this.imod(P.ushln(x))},D.prototype.imul=function(P,x){return this._verify2(P,x),this.imod(P.imul(x))},D.prototype.mul=function(P,x){return this._verify2(P,x),this.imod(P.mul(x))},D.prototype.isqr=function(P){return this.imul(P,P.clone())},D.prototype.sqr=function(P){return this.mul(P,P)},D.prototype.sqrt=function(P){if(P.isZero())return P.clone();var x=this.m.andln(3);if(n(x%2===1),x===3){var T=this.m.add(new a(1)).iushrn(2);return this.pow(P,T)}for(var E=this.m.subn(1),N=0;!E.isZero()&&E.andln(1)===0;)N++,E.iushrn(1);n(!E.isZero());var F=new a(1).toRed(this),B=F.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new a(2*k*k).toRed(this);this.pow(k,j).cmp(B)!==0;)k.redIAdd(B);for(var $=this.pow(k,E),H=this.pow(P,E.addn(1).iushrn(1)),Y=this.pow(P,E),ie=N;Y.cmp(F)!==0;){for(var W=Y,Q=0;W.cmp(F)!==0;Q++)W=W.redSqr();n(Q=0;N--){for(var $=x.words[N],H=k-1;H>=0;H--){var Y=$>>H&1;if(F!==E[0]&&(F=this.sqr(F)),Y===0&&B===0){j=0;continue}B<<=1,B|=Y,j++,!(j!==T&&(N!==0||H!==0))&&(F=this.mul(F,E[B]),j=0,B=0)}k=26}return F},D.prototype.convertTo=function(P){var x=P.umod(this.m);return x===P?x.clone():x},D.prototype.convertFrom=function(P){var x=P.clone();return x.red=null,x},a.mont=function(P){return new L(P)};function L(O){D.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(L,D),L.prototype.convertTo=function(P){return this.imod(P.ushln(this.shift))},L.prototype.convertFrom=function(P){var x=this.imod(P.mul(this.rinv));return x.red=null,x},L.prototype.imul=function(P,x){if(P.isZero()||x.isZero())return P.words[0]=0,P.length=1,P;var T=P.imul(x),E=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=T.isub(E).iushrn(this.shift),F=N;return N.cmp(this.m)>=0?F=N.isub(this.m):N.cmpn(0)<0&&(F=N.iadd(this.m)),F._forceRed(this)},L.prototype.mul=function(P,x){if(P.isZero()||x.isZero())return new a(0)._forceRed(this);var T=P.mul(x),E=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=T.isub(E).iushrn(this.shift),F=N;return N.cmp(this.m)>=0?F=N.isub(this.m):N.cmpn(0)<0&&(F=N.iadd(this.m)),F._forceRed(this)},L.prototype.invm=function(P){var x=this.imod(P._invmp(this.m).mul(this.r2));return x._forceRed(this)}})(t,R2)})(NJ);var xv=NJ.exports,Z2=_4e;function _4e(t,e){if(!t)throw new Error(e||"Assertion failed")}_4e.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var OJ={};(function(t){var e=t;function r(a,o){if(Array.isArray(a))return a.slice();if(!a)return[];var s=[];if(typeof a!="string"){for(var l=0;l>8,f=c&255;u?s.push(u,f):s.push(f)}return s}e.toArray=r;function n(a){return a.length===1?"0"+a:a}e.zero2=n;function i(a){for(var o="",s=0;s(g>>1)-1?y=(g>>1)-m:y=m,v.isubn(y)):y=0,h[p]=y,v.iushrn(1)}return h}e.getNAF=a;function o(u,f){var d=[[],[]];u=u.clone(),f=f.clone();for(var h=0,p=0,g;u.cmpn(-h)>0||f.cmpn(-p)>0;){var v=u.andln(3)+h&3,y=f.andln(3)+p&3;v===3&&(v=-1),y===3&&(y=-1);var m;v&1?(g=u.andln(7)+h&7,(g===3||g===5)&&y===2?m=-v:m=v):m=0,d[0].push(m);var b;y&1?(g=f.andln(7)+p&7,(g===3||g===5)&&v===2?b=-y:b=y):b=0,d[1].push(b),2*h===m+1&&(h=1-h),2*p===b+1&&(p=1-p),u.iushrn(1),f.iushrn(1)}return d}e.getJSF=o;function s(u,f,d){var h="_"+f;u.prototype[f]=function(){return this[h]!==void 0?this[h]:this[h]=d.call(this)}}e.cachedProperty=s;function l(u){return typeof u=="string"?e.toArray(u,"hex"):u}e.parseBytes=l;function c(u){return new r(u,"hex","le")}e.intFromLE=c})(Ru);var LJ={exports:{}},KU;LJ.exports=function(e){return KU||(KU=new zm(null)),KU.generate(e)};function zm(t){this.rand=t}LJ.exports.Rand=zm;zm.prototype.generate=function(e){return this._rand(e)};zm.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var o$=fy;fy.prototype.point=function(){throw new Error("Not implemented")};fy.prototype.validate=function(){throw new Error("Not implemented")};fy.prototype._fixedNafMul=function(e,r){nN(e.precomputed);var n=e._getDoubles(),i=rN(r,1,this._bitLength),a=(1<=s;c--)l=(l<<1)+i[c];o.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=a;d>0;d--){for(s=0;s=0;l--){for(var c=0;l>=0&&o[l]===0;l--)c++;if(l>=0&&c++,s=s.dblp(c),l<0)break;var u=o[l];nN(u!==0),e.type==="affine"?u>0?s=s.mixedAdd(a[u-1>>1]):s=s.mixedAdd(a[-u-1>>1].neg()):u>0?s=s.add(a[u-1>>1]):s=s.add(a[-u-1>>1].neg())}return e.type==="affine"?s.toP():s};fy.prototype._wnafMulAdd=function(e,r,n,i,a){var o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,c=0,u,f,d;for(u=0;u=1;u-=2){var p=u-1,g=u;if(o[p]!==1||o[g]!==1){l[p]=rN(n[p],o[p],this._bitLength),l[g]=rN(n[g],o[g],this._bitLength),c=Math.max(l[p].length,c),c=Math.max(l[g].length,c);continue}var v=[r[p],null,null,r[g]];r[p].y.cmp(r[g].y)===0?(v[1]=r[p].add(r[g]),v[2]=r[p].toJ().mixedAdd(r[g].neg())):r[p].y.cmp(r[g].y.redNeg())===0?(v[1]=r[p].toJ().mixedAdd(r[g]),v[2]=r[p].add(r[g].neg())):(v[1]=r[p].toJ().mixedAdd(r[g]),v[2]=r[p].toJ().mixedAdd(r[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],m=p2t(n[p],n[g]);for(c=Math.max(m[0].length,c),l[p]=new Array(c),l[g]=new Array(c),f=0;f=0;u--){for(var S=0;u>=0;){var I=!0;for(f=0;f=0&&S++,C=C.dblp(S),u<0)break;for(f=0;f0?d=s[f][D-1>>1]:D<0&&(d=s[f][-D-1>>1].neg()),d.type==="affine"?C=C.mixedAdd(d):C=C.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};rd.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(h=c,p=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};nd.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),s=a.mul(n.a),l=o.mul(i.a),c=a.mul(n.b),u=o.mul(i.b),f=e.sub(s).sub(l),d=c.add(u).neg();return{k1:f,k2:d}};nd.prototype.pointFromX=function(e,r){e=new Xa(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};nd.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};nd.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,o=0;o":""};hs.prototype.isInfinity=function(){return this.inf};hs.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};hs.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)};hs.prototype.getX=function(){return this.x.fromRed()};hs.prototype.getY=function(){return this.y.fromRed()};hs.prototype.mul=function(e){return e=new Xa(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};hs.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};hs.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};hs.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};hs.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};hs.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function $s(t,e,r,n){wS.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Xa(0)):(this.x=new Xa(e,16),this.y=new Xa(r,16),this.z=new Xa(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}BJ($s,wS.BasePoint);nd.prototype.jpoint=function(e,r,n){return new $s(this,e,r,n)};$s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};$s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};$s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),s=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=o.redSub(s);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),d=i.redMul(u),h=c.redSqr().redIAdd(f).redISub(d).redISub(d),p=c.redMul(d.redISub(h)).redISub(o.redMul(f)),g=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(h,p,g)};$s.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,o=e.y.redMul(r).redMul(this.z),s=n.redSub(i),l=a.redSub(o);if(s.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),f=n.redMul(c),d=l.redSqr().redIAdd(u).redISub(f).redISub(f),h=l.redMul(f.redISub(d)).redISub(a.redMul(u)),p=this.z.redMul(s);return this.curve.jpoint(d,h,p)};$s.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}};$s.prototype.inspect=function(){return this.isInfinity()?"":""};$s.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var W_=xv,C4e=s$,l$=o$,y2t=Ru;function bS(t){l$.call(this,"mont",t),this.a=new W_(t.a,16).toRed(this.red),this.b=new W_(t.b,16).toRed(this.red),this.i4=new W_(4).toRed(this.red).redInvm(),this.two=new W_(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}C4e(bS,l$);var w2t=bS;bS.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0};function fs(t,e,r){l$.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new W_(e,16),this.z=new W_(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}C4e(fs,l$.BasePoint);bS.prototype.decodePoint=function(e,r){return this.point(y2t.toArray(e,r),1)};bS.prototype.point=function(e,r){return new fs(this,e,r)};bS.prototype.pointFromJSON=function(e){return fs.fromJSON(this,e)};fs.prototype.precompute=function(){};fs.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};fs.fromJSON=function(e,r){return new fs(e,r[0],r[1]||e.one)};fs.prototype.inspect=function(){return this.isInfinity()?"":""};fs.prototype.isInfinity=function(){return this.z.cmpn(0)===0};fs.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),o=r.redMul(i),s=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(o,s)};fs.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};fs.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),o=e.x.redSub(e.z),s=o.redMul(n),l=a.redMul(i),c=r.z.redMul(s.redAdd(l).redSqr()),u=r.x.redMul(s.redISub(l).redSqr());return this.curve.point(c,u)};fs.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var s=o.length-1;s>=0;s--)o[s]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i};fs.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};fs.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};fs.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};fs.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};fs.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var b2t=Ru,Ag=xv,A4e=s$,c$=o$,x2t=b2t.assert;function b0(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,c$.call(this,"edwards",t),this.a=new Ag(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Ag(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Ag(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),x2t(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}A4e(b0,c$);var _2t=b0;b0.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};b0.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};b0.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};b0.prototype.pointFromX=function(e,r){e=new Ag(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(a.redInvm()),s=o.redSqrt();if(s.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var l=s.fromRed().isOdd();return(r&&!l||!r&&l)&&(s=s.redNeg()),this.point(e,s)};b0.prototype.pointFromY=function(e,r){e=new Ag(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(a.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var s=o.redSqrt();if(s.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return s.fromRed().isOdd()!==r&&(s=s.redNeg()),this.point(s,e)};b0.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0};function sa(t,e,r,n,i){c$.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Ag(e,16),this.y=new Ag(r,16),this.z=n?new Ag(n,16):this.curve.one,this.t=i&&new Ag(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}A4e(sa,c$.BasePoint);b0.prototype.pointFromJSON=function(e){return sa.fromJSON(this,e)};b0.prototype.point=function(e,r,n,i){return new sa(this,e,r,n,i)};sa.fromJSON=function(e,r){return new sa(e,r[0],r[1],r[2])};sa.prototype.inspect=function(){return this.isInfinity()?"":""};sa.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};sa.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),s=o.redSub(n),l=i.redSub(r),c=a.redMul(s),u=o.redMul(l),f=a.redMul(l),d=s.redMul(o);return this.curve.point(c,u,d,f)};sa.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,o,s,l,c;if(this.curve.twisted){s=this.curve._mulA(r);var u=s.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(u.redSub(this.curve.two)),a=u.redMul(s.redSub(n)),o=u.redSqr().redSub(u).redSub(u)):(l=this.z.redSqr(),c=u.redSub(l).redISub(l),i=e.redSub(r).redISub(n).redMul(c),a=u.redMul(s.redSub(n)),o=u.redMul(c))}else s=r.redAdd(n),l=this.curve._mulC(this.z).redSqr(),c=s.redSub(l).redSub(l),i=this.curve._mulC(e.redISub(s)).redMul(c),a=this.curve._mulC(s).redMul(r.redISub(n)),o=s.redMul(c);return this.curve.point(i,a,o)};sa.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};sa.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),s=a.redSub(i),l=a.redAdd(i),c=n.redAdd(r),u=o.redMul(s),f=l.redMul(c),d=o.redMul(c),h=s.redMul(l);return this.curve.point(u,f,h,d)};sa.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(a),s=n.redSub(o),l=n.redAdd(o),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),u=r.redMul(s).redMul(c),f,d;return this.curve.twisted?(f=r.redMul(l).redMul(a.redSub(this.curve._mulA(i))),d=s.redMul(l)):(f=r.redMul(l).redMul(a.redSub(i)),d=this.curve._mulC(s).redMul(l)),this.curve.point(u,f,d)};sa.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};sa.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};sa.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};sa.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};sa.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};sa.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};sa.prototype.getX=function(){return this.normalize(),this.x.fromRed()};sa.prototype.getY=function(){return this.normalize(),this.y.fromRed()};sa.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};sa.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};sa.prototype.toP=sa.prototype.normalize;sa.prototype.mixedAdd=sa.prototype.add;(function(t){var e=t;e.base=o$,e.short=m2t,e.mont=w2t,e.edwards=_2t})($J);var u$={},f$={},ei={},S2t=Z2,C2t=s$;ei.inherits=C2t;function A2t(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function T2t(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=a&63|128):A2t(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}ei.htonl=T4e;function I2t(t,e){for(var r="",n=0;n>>0}return a}ei.join32=k2t;function P2t(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}ei.split32=P2t;function R2t(t,e){return t>>>e|t<<32-e}ei.rotr32=R2t;function M2t(t,e){return t<>>32-e}ei.rotl32=M2t;function D2t(t,e){return t+e>>>0}ei.sum32=D2t;function N2t(t,e,r){return t+e+r>>>0}ei.sum32_3=N2t;function O2t(t,e,r,n){return t+e+r+n>>>0}ei.sum32_4=O2t;function L2t(t,e,r,n,i){return t+e+r+n+i>>>0}ei.sum32_5=L2t;function $2t(t,e,r,n){var i=t[e],a=t[e+1],o=n+a>>>0,s=(o>>0,t[e+1]=o}ei.sum64=$2t;function B2t(t,e,r,n){var i=e+n>>>0,a=(i>>0}ei.sum64_hi=B2t;function F2t(t,e,r,n){var i=e+n;return i>>>0}ei.sum64_lo=F2t;function j2t(t,e,r,n,i,a,o,s){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}ei.sum64_4_hi=j2t;function U2t(t,e,r,n,i,a,o,s){var l=e+n+a+s;return l>>>0}ei.sum64_4_lo=U2t;function z2t(t,e,r,n,i,a,o,s,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}ei.sum64_5_hi=z2t;function H2t(t,e,r,n,i,a,o,s,l,c){var u=e+n+a+s+c;return u>>>0}ei.sum64_5_lo=H2t;function V2t(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}ei.rotr64_hi=V2t;function G2t(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}ei.rotr64_lo=G2t;function W2t(t,e,r){return t>>>r}ei.shr64_hi=W2t;function q2t(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}ei.shr64_lo=q2t;var xS={},Sue=ei,Y2t=Z2;function d$(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}xS.BlockHash=d$;d$.prototype.update=function(e,r){if(e=Sue.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=Sue.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,o=8;o>>3}x0.g0_256=J2t;function ext(t){return Dp(t,17)^Dp(t,19)^t>>>10}x0.g1_256=ext;var v5=ei,txt=xS,rxt=x0,ZU=v5.rotl32,VC=v5.sum32,nxt=v5.sum32_5,ixt=rxt.ft_1,M4e=txt.BlockHash,axt=[1518500249,1859775393,2400959708,3395469782];function e0(){if(!(this instanceof e0))return new e0;M4e.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}v5.inherits(e0,M4e);var oxt=e0;e0.blockSize=512;e0.outSize=160;e0.hmacStrength=80;e0.padLength=64;e0.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),qxt(e.length<=this.blockSize);for(var r=e.length;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Qxt=F1;F1.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};F1.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=ub.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var iN=xv,FJ=Ru,t_t=FJ.assert;function h$(t,e){if(t instanceof h$)return t;this._importDER(t,e)||(t_t(t.r&&t.s,"Signature without r or s"),this.r=new iN(t.r,16),this.s=new iN(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var r_t=h$;function n_t(){this.place=0}function ez(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,a=0,o=e.place;a>>=0;return i<=127?!1:(e.place=o,i)}function Iue(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}h$.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Iue(r),n=Iue(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];tz(i,r.length),i=i.concat(r),i.push(2),tz(i,n.length);var a=i.concat(n),o=[48];return tz(o,a.length),o=o.concat(a),FJ.encode(o,e)};var fb=xv,V4e=Qxt,i_t=Ru,rz=u$,a_t=S4e,G4e=i_t.assert,jJ=e_t,p$=r_t;function Wf(t){if(!(this instanceof Wf))return new Wf(t);typeof t=="string"&&(G4e(Object.prototype.hasOwnProperty.call(rz,t),"Unknown curve "+t),t=rz[t]),t instanceof rz.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var o_t=Wf;Wf.prototype.keyPair=function(e){return new jJ(this,e)};Wf.prototype.keyFromPrivate=function(e,r){return jJ.fromPrivate(this,e,r)};Wf.prototype.keyFromPublic=function(e,r){return jJ.fromPublic(this,e,r)};Wf.prototype.genKeyPair=function(e){e||(e={});for(var r=new V4e({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a_t(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new fb(2));;){var a=new fb(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};Wf.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Wf.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new fb(e,16));for(var a=this.n.byteLength(),o=r.getPrivate().toArray("be",a),s=e.toArray("be",a),l=new V4e({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new fb(1)),u=0;;u++){var f=i.k?i.k(u):new fb(l.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var g=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(g=g.umod(this.n),g.cmpn(0)!==0){var v=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new p$({r:p,s:g,recoveryParam:v})}}}}}};Wf.prototype.verify=function(e,r,n,i){e=this._truncateToN(new fb(e,16)),n=this.keyFromPublic(n,i),r=new p$(r,"hex");var a=r.r,o=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),l=s.mul(e).umod(this.n),c=s.mul(a).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.eqXToP(a)):(u=this.g.mulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.getX().umod(this.n).cmp(a)===0)};Wf.prototype.recoverPubKey=function(t,e,r,n){G4e((3&r)===r,"The recovery param is more than two bits"),e=new p$(e,n);var i=this.n,a=new fb(t),o=e.r,s=e.s,l=r&1,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),d=s.mul(u).umod(i);return this.g.mulAdd(f,o,d)};Wf.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new p$(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var C8=Ru,W4e=C8.assert,kue=C8.parseBytes,CS=C8.cachedProperty;function ls(t,e){this.eddsa=t,this._secret=kue(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=kue(e.pub)}ls.fromPublic=function(e,r){return r instanceof ls?r:new ls(e,{pub:r})};ls.fromSecret=function(e,r){return r instanceof ls?r:new ls(e,{secret:r})};ls.prototype.secret=function(){return this._secret};CS(ls,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});CS(ls,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});CS(ls,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});CS(ls,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});CS(ls,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});CS(ls,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});ls.prototype.sign=function(e){return W4e(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};ls.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};ls.prototype.getSecret=function(e){return W4e(this._secret,"KeyPair is public only"),C8.encode(this.secret(),e)};ls.prototype.getPublic=function(e){return C8.encode(this.pubBytes(),e)};var s_t=ls,l_t=xv,g$=Ru,Pue=g$.assert,v$=g$.cachedProperty,c_t=g$.parseBytes;function Q2(t,e){this.eddsa=t,typeof e!="object"&&(e=c_t(e)),Array.isArray(e)&&(Pue(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Pue(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof l_t&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}v$(Q2,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});v$(Q2,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});v$(Q2,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});v$(Q2,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Q2.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Q2.prototype.toHex=function(){return g$.encode(this.toBytes(),"hex").toUpperCase()};var u_t=Q2,f_t=f$,d_t=u$,w5=Ru,h_t=w5.assert,q4e=w5.parseBytes,Y4e=s_t,Rue=u_t;function Lc(t){if(h_t(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Lc))return new Lc(t);t=d_t[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=f_t.sha512}var p_t=Lc;Lc.prototype.sign=function(e,r){e=q4e(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),o=this.encodePoint(a),s=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),l=i.add(s).umod(this.curve.n);return this.makeSignature({R:a,S:l,Rencoded:o})};Lc.prototype.verify=function(e,r,n){if(e=q4e(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),s=r.R().add(i.pub().mul(a));return s.eq(o)};Lc.prototype.hashInt=function(){for(var e=this.hash(),r=0;re in t?y_t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nue=(t,e)=>{for(var r in e||(e={}))w_t.call(e,r)&&Due(t,r,e[r]);if(Mue)for(var r of Mue(e))b_t.call(e,r)&&Due(t,r,e[r]);return t};const x_t="ReactNative",cu={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},__t="js";function aN(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function AS(){return!i$()&&!!kJ()&&navigator.product===x_t}function A8(){return!aN()&&!!kJ()&&!!i$()}function T8(){return AS()?cu.reactNative:aN()?cu.node:A8()?cu.browser:cu.unknown}function S_t(){var t;try{return AS()&&typeof Ra<"u"&&typeof(Ra==null?void 0:Ra.Application)<"u"?(t=Ra.Application)==null?void 0:t.applicationId:void 0}catch{return}}function C_t(t,e){let r=kT.parse(t);return r=Nue(Nue({},r),e),t=kT.stringify(r),t}function Z4e(){return g4e()||{name:"",description:"",url:"",icons:[""]}}function A_t(){if(T8()===cu.reactNative&&typeof Ra<"u"&&typeof(Ra==null?void 0:Ra.Platform)<"u"){const{OS:r,Version:n}=Ra.Platform;return[r,n].join("-")}const t=Sbt();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function T_t(){var t;const e=T8();return e===cu.browser?[e,((t=p4e())==null?void 0:t.host)||"unknown"].join(":"):e}function Q4e(t,e,r){const n=A_t(),i=T_t();return[[t,e].join("-"),[__t,r].join("-"),n,i].join("/")}function E_t({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:o,bundleId:s}){const l=r.split("?"),c=Q4e(t,e,n),u={auth:i,ua:c,projectId:a,useOnCloseEvent:o||void 0,origin:s||void 0},f=C_t(l[1]||"",u);return l[0]+"?"+f}function Ww(t,e){return t.filter(r=>e.includes(r)).length===t.length}function X4e(t){return Object.fromEntries(t.entries())}function J4e(t){return new Map(Object.entries(t))}function Tw(t=Ft.FIVE_MINUTES,e){const r=Ft.toMiliseconds(t||Ft.FIVE_MINUTES);let n,i,a;return{resolve:o=>{a&&n&&(clearTimeout(a),n(o))},reject:o=>{a&&i&&(clearTimeout(a),i(o))},done:()=>new Promise((o,s)=>{a=setTimeout(()=>{s(new Error(e))},r),n=o,i=s})}}function m3(t,e,r){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(a)})}function eAe(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function I_t(t){return eAe("topic",t)}function k_t(t){return eAe("id",t)}function tAe(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Mo(t,e){return Ft.fromMiliseconds(Date.now()+Ft.toMiliseconds(t))}function pm(t){return Date.now()>=Ft.toMiliseconds(t)}function Vn(t,e){return`${t}${e?`:${e}`:""}`}function GR(t=[],e=[]){return[...new Set([...t,...e])]}async function P_t({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,a=i==null?void 0:i.href;if(typeof a!="string")return;const o=R_t(a,t,e),s=T8();if(s===cu.browser){if(!((n=i$())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,D_t()?"_blank":"_self","noreferrer noopener")}else s===cu.reactNative&&typeof(Ra==null?void 0:Ra.Linking)<"u"&&await Ra.Linking.openURL(o)}catch(i){console.error(i)}}function R_t(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const a=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${a}${N_t(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function M_t(t,e){let r="";try{if(A8()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function Oue(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Lue(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function UJ(){return typeof process<"u"&&v_t.IS_VITEST==="true"}function D_t(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function N_t(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function rAe(t){return Buffer.from(t,"base64").toString("utf-8")}var nAe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ra<"u"?Ra:typeof self<"u"?self:{};function O_t(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var iAe={exports:{}};/** -* [js-sha3]{@link https://github.com/emn178/js-sha3} -* -* @version 0.8.0 -* @author Chen, Yi-Cyuan [emn178@gmail.com] -* @copyright Chen, Yi-Cyuan 2015-2018 -* @license MIT -*/(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var a=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=nAe:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],h=[6,1536,393216,100663296],p=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(W){return Object.prototype.toString.call(W)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(W){return typeof W=="object"&&W.buffer&&W.buffer.constructor===ArrayBuffer});for(var w=function(W,Q,J){return function(ee){return new H(W,Q,W).update(ee)[J]()}},C=function(W,Q,J){return function(ee,ne){return new H(W,Q,ne).update(ee)[J]()}},A=function(W,Q,J){return function(ee,ne,V,oe){return T["cshake"+W].update(ee,ne,V,oe)[J]()}},S=function(W,Q,J){return function(ee,ne,V,oe){return T["kmac"+W].update(ee,ne,V,oe)[J]()}},I=function(W,Q,J,ee){for(var ne=0;ne>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var ee=0;ee<50;++ee)this.s[ee]=0}H.prototype.update=function(W){if(this.finalized)throw new Error(r);var Q,J=typeof W;if(J!=="string"){if(J==="object"){if(W===null)throw new Error(e);if(l&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!l||!ArrayBuffer.isView(W)))throw new Error(e)}else throw new Error(e);Q=!0}for(var ee=this.blocks,ne=this.byteCount,V=W.length,oe=this.blockCount,ye=0,Te=this.s,Me,Oe;ye>2]|=W[ye]<>2]|=Oe<>2]|=(192|Oe>>6)<>2]|=(128|Oe&63)<=57344?(ee[Me>>2]|=(224|Oe>>12)<>2]|=(128|Oe>>6&63)<>2]|=(128|Oe&63)<>2]|=(240|Oe>>18)<>2]|=(128|Oe>>12&63)<>2]|=(128|Oe>>6&63)<>2]|=(128|Oe&63)<=ne){for(this.start=Me-ne,this.block=ee[oe],Me=0;Me>8,J=W&255;J>0;)ne.unshift(J),W=W>>8,J=W&255,++ee;return Q?ne.push(ee):ne.unshift(ee),this.update(ne),ne.length},H.prototype.encodeString=function(W){var Q,J=typeof W;if(J!=="string"){if(J==="object"){if(W===null)throw new Error(e);if(l&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!l||!ArrayBuffer.isView(W)))throw new Error(e)}else throw new Error(e);Q=!0}var ee=0,ne=W.length;if(Q)ee=ne;else for(var V=0;V=57344?ee+=3:(oe=65536+((oe&1023)<<10|W.charCodeAt(++V)&1023),ee+=4)}return ee+=this.encode(ee*8),this.update(W),ee},H.prototype.bytepad=function(W,Q){for(var J=this.encode(Q),ee=0;ee>2]|=this.padding[Q&3],this.lastByteIndex===this.byteCount)for(W[0]=W[J],Q=1;Q>4&15]+c[ye&15]+c[ye>>12&15]+c[ye>>8&15]+c[ye>>20&15]+c[ye>>16&15]+c[ye>>28&15]+c[ye>>24&15];V%W===0&&(ie(Q),ne=0)}return ee&&(ye=Q[ne],oe+=c[ye>>4&15]+c[ye&15],ee>1&&(oe+=c[ye>>12&15]+c[ye>>8&15]),ee>2&&(oe+=c[ye>>20&15]+c[ye>>16&15])),oe},H.prototype.arrayBuffer=function(){this.finalize();var W=this.blockCount,Q=this.s,J=this.outputBlocks,ee=this.extraBytes,ne=0,V=0,oe=this.outputBits>>3,ye;ee?ye=new ArrayBuffer(J+1<<2):ye=new ArrayBuffer(oe);for(var Te=new Uint32Array(ye);V>8&255,oe[ye+2]=Te>>16&255,oe[ye+3]=Te>>24&255;V%W===0&&ie(Q)}return ee&&(ye=V<<2,Te=Q[ne],oe[ye]=Te&255,ee>1&&(oe[ye+1]=Te>>8&255),ee>2&&(oe[ye+2]=Te>>16&255)),oe};function Y(W,Q,J){H.call(this,W,Q,J)}Y.prototype=new H,Y.prototype.finalize=function(){return this.encode(this.outputBits,!0),H.prototype.finalize.call(this)};var ie=function(W){var Q,J,ee,ne,V,oe,ye,Te,Me,Oe,nt,it,St,bt,Ce,We,Le,Ke,qe,we,Se,q,z,G,re,ue,_e,Ee,et,pt,Ct,ot,Pt,mr,qt,Ur,Ir,yt,Qt,Xt,$t,hr,lr,Dt,kr,_r,Jt,Pr,zr,Zt,Nr,Sr,Yt,ve,me,le,de,ge,Ue,tt,Qe,Ne,ut;for(ee=0;ee<48;ee+=2)ne=W[0]^W[10]^W[20]^W[30]^W[40],V=W[1]^W[11]^W[21]^W[31]^W[41],oe=W[2]^W[12]^W[22]^W[32]^W[42],ye=W[3]^W[13]^W[23]^W[33]^W[43],Te=W[4]^W[14]^W[24]^W[34]^W[44],Me=W[5]^W[15]^W[25]^W[35]^W[45],Oe=W[6]^W[16]^W[26]^W[36]^W[46],nt=W[7]^W[17]^W[27]^W[37]^W[47],it=W[8]^W[18]^W[28]^W[38]^W[48],St=W[9]^W[19]^W[29]^W[39]^W[49],Q=it^(oe<<1|ye>>>31),J=St^(ye<<1|oe>>>31),W[0]^=Q,W[1]^=J,W[10]^=Q,W[11]^=J,W[20]^=Q,W[21]^=J,W[30]^=Q,W[31]^=J,W[40]^=Q,W[41]^=J,Q=ne^(Te<<1|Me>>>31),J=V^(Me<<1|Te>>>31),W[2]^=Q,W[3]^=J,W[12]^=Q,W[13]^=J,W[22]^=Q,W[23]^=J,W[32]^=Q,W[33]^=J,W[42]^=Q,W[43]^=J,Q=oe^(Oe<<1|nt>>>31),J=ye^(nt<<1|Oe>>>31),W[4]^=Q,W[5]^=J,W[14]^=Q,W[15]^=J,W[24]^=Q,W[25]^=J,W[34]^=Q,W[35]^=J,W[44]^=Q,W[45]^=J,Q=Te^(it<<1|St>>>31),J=Me^(St<<1|it>>>31),W[6]^=Q,W[7]^=J,W[16]^=Q,W[17]^=J,W[26]^=Q,W[27]^=J,W[36]^=Q,W[37]^=J,W[46]^=Q,W[47]^=J,Q=Oe^(ne<<1|V>>>31),J=nt^(V<<1|ne>>>31),W[8]^=Q,W[9]^=J,W[18]^=Q,W[19]^=J,W[28]^=Q,W[29]^=J,W[38]^=Q,W[39]^=J,W[48]^=Q,W[49]^=J,bt=W[0],Ce=W[1],_r=W[11]<<4|W[10]>>>28,Jt=W[10]<<4|W[11]>>>28,Ee=W[20]<<3|W[21]>>>29,et=W[21]<<3|W[20]>>>29,tt=W[31]<<9|W[30]>>>23,Qe=W[30]<<9|W[31]>>>23,hr=W[40]<<18|W[41]>>>14,lr=W[41]<<18|W[40]>>>14,mr=W[2]<<1|W[3]>>>31,qt=W[3]<<1|W[2]>>>31,We=W[13]<<12|W[12]>>>20,Le=W[12]<<12|W[13]>>>20,Pr=W[22]<<10|W[23]>>>22,zr=W[23]<<10|W[22]>>>22,pt=W[33]<<13|W[32]>>>19,Ct=W[32]<<13|W[33]>>>19,Ne=W[42]<<2|W[43]>>>30,ut=W[43]<<2|W[42]>>>30,ve=W[5]<<30|W[4]>>>2,me=W[4]<<30|W[5]>>>2,Ur=W[14]<<6|W[15]>>>26,Ir=W[15]<<6|W[14]>>>26,Ke=W[25]<<11|W[24]>>>21,qe=W[24]<<11|W[25]>>>21,Zt=W[34]<<15|W[35]>>>17,Nr=W[35]<<15|W[34]>>>17,ot=W[45]<<29|W[44]>>>3,Pt=W[44]<<29|W[45]>>>3,G=W[6]<<28|W[7]>>>4,re=W[7]<<28|W[6]>>>4,le=W[17]<<23|W[16]>>>9,de=W[16]<<23|W[17]>>>9,yt=W[26]<<25|W[27]>>>7,Qt=W[27]<<25|W[26]>>>7,we=W[36]<<21|W[37]>>>11,Se=W[37]<<21|W[36]>>>11,Sr=W[47]<<24|W[46]>>>8,Yt=W[46]<<24|W[47]>>>8,Dt=W[8]<<27|W[9]>>>5,kr=W[9]<<27|W[8]>>>5,ue=W[18]<<20|W[19]>>>12,_e=W[19]<<20|W[18]>>>12,ge=W[29]<<7|W[28]>>>25,Ue=W[28]<<7|W[29]>>>25,Xt=W[38]<<8|W[39]>>>24,$t=W[39]<<8|W[38]>>>24,q=W[48]<<14|W[49]>>>18,z=W[49]<<14|W[48]>>>18,W[0]=bt^~We&Ke,W[1]=Ce^~Le&qe,W[10]=G^~ue&Ee,W[11]=re^~_e&et,W[20]=mr^~Ur&yt,W[21]=qt^~Ir&Qt,W[30]=Dt^~_r&Pr,W[31]=kr^~Jt&zr,W[40]=ve^~le&ge,W[41]=me^~de&Ue,W[2]=We^~Ke&we,W[3]=Le^~qe&Se,W[12]=ue^~Ee&pt,W[13]=_e^~et&Ct,W[22]=Ur^~yt&Xt,W[23]=Ir^~Qt&$t,W[32]=_r^~Pr&Zt,W[33]=Jt^~zr&Nr,W[42]=le^~ge&tt,W[43]=de^~Ue&Qe,W[4]=Ke^~we&q,W[5]=qe^~Se&z,W[14]=Ee^~pt&ot,W[15]=et^~Ct&Pt,W[24]=yt^~Xt&hr,W[25]=Qt^~$t&lr,W[34]=Pr^~Zt&Sr,W[35]=zr^~Nr&Yt,W[44]=ge^~tt&Ne,W[45]=Ue^~Qe&ut,W[6]=we^~q&bt,W[7]=Se^~z&Ce,W[16]=pt^~ot&G,W[17]=Ct^~Pt&re,W[26]=Xt^~hr&mr,W[27]=$t^~lr&qt,W[36]=Zt^~Sr&Dt,W[37]=Nr^~Yt&kr,W[46]=tt^~Ne&ve,W[47]=Qe^~ut&me,W[8]=q^~bt&We,W[9]=z^~Ce&Le,W[18]=ot^~G&ue,W[19]=Pt^~re&_e,W[28]=hr^~mr&Ur,W[29]=lr^~qt&Ir,W[38]=Sr^~Dt&_r,W[39]=Yt^~kr&Jt,W[48]=Ne^~ve&le,W[49]=ut^~me&de,W[0]^=g[ee],W[1]^=g[ee+1]};if(s)t.exports=T;else for(N=0;N{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const jue=B_t();var Yq;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Yq||(Yq={}));var Fd;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Fd||(Fd={}));const Uue="0123456789abcdef";let Is=class Ro{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();WR[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Fue>WR[n])&&console.log.apply(console,r)}debug(...e){this._log(Ro.levels.DEBUG,e)}info(...e){this._log(Ro.levels.INFO,e)}warn(...e){this._log(Ro.levels.WARNING,e)}makeError(e,r,n){if(Bue)return this.makeError("censored error",r,{});r||(r=Ro.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const c=n[l];try{if(c instanceof Uint8Array){let u="";for(let f=0;f>4],u+=Uue[c[f]&15];i.push(l+"=Uint8Array(0x"+u+")")}else i.push(l+"="+JSON.stringify(c))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=e;let o="";switch(r){case Fd.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Fd.CALL_EXCEPTION:case Fd.INSUFFICIENT_FUNDS:case Fd.MISSING_NEW:case Fd.NONCE_EXPIRED:case Fd.REPLACEMENT_UNDERPRICED:case Fd.TRANSACTION_REPLACED:case Fd.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const s=new Error(e);return s.reason=a,s.code=r,Object.keys(n).forEach(function(l){s[l]=n[l]}),s}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Ro.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){jue&&this.throwError("platform missing String.prototype.normalize",Ro.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:jue})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Ro.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Ro.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Ro.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Ro.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Ro.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Ro.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return nz||(nz=new Ro($_t)),nz}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Ro.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),$ue){if(!e)return;this.globalLogger().throwError("error censorship permanent",Ro.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Bue=!!e,$ue=!!r}static setLogLevel(e){const r=WR[e.toLowerCase()];if(r==null){Ro.globalLogger().warn("invalid log level - "+e);return}Fue=r}static from(e){return new Ro(e)}};Is.errors=Fd,Is.levels=Yq;const F_t="bytes/5.7.0",uo=new Is(F_t);function aAe(t){return!!t.toHexString}function y3(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return y3(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function j_t(t){return hu(t)&&!(t.length%2)||TS(t)}function zue(t){return typeof t=="number"&&t==t&&t%1===0}function TS(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!zue(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function Qa(t,e){if(e||(e={}),typeof t=="number"){uo.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),y3(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),aAe(t)&&(t=t.toHexString()),hu(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":uo.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;iQa(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),y3(n)}function z_t(t,e){t=Qa(t),t.length>e&&uo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),y3(r)}function hu(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const iz="0123456789abcdef";function gc(t,e){if(e||(e={}),typeof t=="number"){uo.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=iz[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),aAe(t))return t.toHexString();if(hu(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":uo.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(TS(t)){let r="0x";for(let n=0;n>4]+iz[i&15]}return r}return uo.throwArgumentError("invalid hexlify value","value",t)}function H_t(t){if(typeof t!="string")t=gc(t);else if(!hu(t)||t.length%2)return null;return(t.length-2)/2}function Hue(t,e,r){return typeof t!="string"?t=gc(t):(!hu(t)||t.length%2)&&uo.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Lp(t,e){for(typeof t!="string"?t=gc(t):hu(t)||uo.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&uo.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function oAe(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(j_t(t)){let r=Qa(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=gc(r.slice(0,32)),e.s=gc(r.slice(32,64))):r.length===65?(e.r=gc(r.slice(0,32)),e.s=gc(r.slice(32,64)),e.v=r[64]):uo.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:uo.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=gc(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=z_t(Qa(e._vs),32);e._vs=gc(i);const a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&uo.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=gc(i);e.s==null?e.s=o:e.s!==o&&uo.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?uo.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&uo.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!hu(e.r)?uo.throwArgumentError("signature missing or invalid r","signature",t):e.r=Lp(e.r,32),e.s==null||!hu(e.s)?uo.throwArgumentError("signature missing or invalid s","signature",t):e.s=Lp(e.s,32);const r=Qa(e.s);r[0]>=128&&uo.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=gc(r);e._vs&&(hu(e._vs)||uo.throwArgumentError("signature invalid _vs","signature",t),e._vs=Lp(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&uo.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function zJ(t){return"0x"+L_t.keccak_256(Qa(t))}var sAe={exports:{}},V_t={},G_t=Object.freeze({__proto__:null,default:V_t}),W_t=O_t(G_t);(function(t){(function(e,r){function n(x,T){if(!x)throw new Error(T||"Assertion failed")}function i(x,T){x.super_=T;var E=function(){};E.prototype=T.prototype,x.prototype=new E,x.prototype.constructor=x}function a(x,T,E){if(a.isBN(x))return x;this.negative=0,this.words=null,this.length=0,this.red=null,x!==null&&((T==="le"||T==="be")&&(E=T,T=10),this._init(x||0,T||10,E||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=W_t.Buffer}catch{}a.isBN=function(x){return x instanceof a?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===a.wordSize&&Array.isArray(x.words)},a.max=function(x,T){return x.cmp(T)>0?x:T},a.min=function(x,T){return x.cmp(T)<0?x:T},a.prototype._init=function(x,T,E){if(typeof x=="number")return this._initNumber(x,T,E);if(typeof x=="object")return this._initArray(x,T,E);T==="hex"&&(T=16),n(T===(T|0)&&T>=2&&T<=36),x=x.toString().replace(/\s+/g,"");var N=0;x[0]==="-"&&(N++,this.negative=1),N=0;N-=3)B=x[N]|x[N-1]<<8|x[N-2]<<16,this.words[F]|=B<>>26-j&67108863,j+=24,j>=26&&(j-=26,F++);else if(E==="le")for(N=0,F=0;N>>26-j&67108863,j+=24,j>=26&&(j-=26,F++);return this._strip()};function s(x,T){var E=x.charCodeAt(T);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;n(!1,"Invalid character in "+x)}function l(x,T,E){var N=s(x,E);return E-1>=T&&(N|=s(x,E-1)<<4),N}a.prototype._parseHex=function(x,T,E){this.length=Math.ceil((x.length-T)/6),this.words=new Array(this.length);for(var N=0;N=T;N-=2)j=l(x,T,N)<=18?(F-=18,B+=1,this.words[B]|=j>>>26):F+=8;else{var k=x.length-T;for(N=k%2===0?T+1:T;N=18?(F-=18,B+=1,this.words[B]|=j>>>26):F+=8}this._strip()};function c(x,T,E,N){for(var F=0,B=0,j=Math.min(x.length,E),k=T;k=49?B=$-49+10:$>=17?B=$-17+10:B=$,n($>=0&&B1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(x,T){x=x||10,T=T|0||1;var E;if(x===16||x==="hex"){E="";for(var N=0,F=0,B=0;B>>24-N&16777215,N+=2,N>=26&&(N-=26,B--),F!==0||B!==this.length-1?E=d[6-k.length]+k+E:E=k+E}for(F!==0&&(E=F.toString(16)+E);E.length%T!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(x===(x|0)&&x>=2&&x<=36){var $=h[x],H=p[x];E="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var ie=Y.modrn(H).toString(x);Y=Y.idivn(H),Y.isZero()?E=ie+E:E=d[$-ie.length]+ie+E}for(this.isZero()&&(E="0"+E);E.length%T!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(x,T){return this.toArrayLike(o,x,T)}),a.prototype.toArray=function(x,T){return this.toArrayLike(Array,x,T)};var g=function(x,T){return x.allocUnsafe?x.allocUnsafe(T):new x(T)};a.prototype.toArrayLike=function(x,T,E){this._strip();var N=this.byteLength(),F=E||Math.max(1,N);n(N<=F,"byte array longer than desired length"),n(F>0,"Requested array length <= 0");var B=g(x,F),j=T==="le"?"LE":"BE";return this["_toArrayLike"+j](B,N),B},a.prototype._toArrayLikeLE=function(x,T){for(var E=0,N=0,F=0,B=0;F>8&255),E>16&255),B===6?(E>24&255),N=0,B=0):(N=j>>>24,B+=2)}if(E=0&&(x[E--]=j>>8&255),E>=0&&(x[E--]=j>>16&255),B===6?(E>=0&&(x[E--]=j>>24&255),N=0,B=0):(N=j>>>24,B+=2)}if(E>=0)for(x[E--]=N;E>=0;)x[E--]=0},Math.clz32?a.prototype._countBits=function(x){return 32-Math.clz32(x)}:a.prototype._countBits=function(x){var T=x,E=0;return T>=4096&&(E+=13,T>>>=13),T>=64&&(E+=7,T>>>=7),T>=8&&(E+=4,T>>>=4),T>=2&&(E+=2,T>>>=2),E+T},a.prototype._zeroBits=function(x){if(x===0)return 26;var T=x,E=0;return T&8191||(E+=13,T>>>=13),T&127||(E+=7,T>>>=7),T&15||(E+=4,T>>>=4),T&3||(E+=2,T>>>=2),T&1||E++,E},a.prototype.bitLength=function(){var x=this.words[this.length-1],T=this._countBits(x);return(this.length-1)*26+T};function v(x){for(var T=new Array(x.bitLength()),E=0;E>>F&1}return T}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,T=0;Tx.length?this.clone().ior(x):x.clone().ior(this)},a.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},a.prototype.iuand=function(x){var T;this.length>x.length?T=x:T=this;for(var E=0;Ex.length?this.clone().iand(x):x.clone().iand(this)},a.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},a.prototype.iuxor=function(x){var T,E;this.length>x.length?(T=this,E=x):(T=x,E=this);for(var N=0;Nx.length?this.clone().ixor(x):x.clone().ixor(this)},a.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},a.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var T=Math.ceil(x/26)|0,E=x%26;this._expand(T),E>0&&T--;for(var N=0;N0&&(this.words[N]=~this.words[N]&67108863>>26-E),this._strip()},a.prototype.notn=function(x){return this.clone().inotn(x)},a.prototype.setn=function(x,T){n(typeof x=="number"&&x>=0);var E=x/26|0,N=x%26;return this._expand(E+1),T?this.words[E]=this.words[E]|1<x.length?(E=this,N=x):(E=x,N=this);for(var F=0,B=0;B>>26;for(;F!==0&&B>>26;if(this.length=E.length,F!==0)this.words[this.length]=F,this.length++;else if(E!==this)for(;Bx.length?this.clone().iadd(x):x.clone().iadd(this)},a.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var T=this.iadd(x);return x.negative=1,T._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var E=this.cmp(x);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,F;E>0?(N=this,F=x):(N=x,F=this);for(var B=0,j=0;j>26,this.words[j]=T&67108863;for(;B!==0&&j>26,this.words[j]=T&67108863;if(B===0&&j>>26,ie=$&67108863,W=Math.min(H,T.length-1),Q=Math.max(0,H-x.length+1);Q<=W;Q++){var J=H-Q|0;F=x.words[J]|0,B=T.words[Q]|0,j=F*B+ie,Y+=j/67108864|0,ie=j&67108863}E.words[H]=ie|0,$=Y|0}return $!==0?E.words[H]=$|0:E.length--,E._strip()}var m=function(x,T,E){var N=x.words,F=T.words,B=E.words,j=0,k,$,H,Y=N[0]|0,ie=Y&8191,W=Y>>>13,Q=N[1]|0,J=Q&8191,ee=Q>>>13,ne=N[2]|0,V=ne&8191,oe=ne>>>13,ye=N[3]|0,Te=ye&8191,Me=ye>>>13,Oe=N[4]|0,nt=Oe&8191,it=Oe>>>13,St=N[5]|0,bt=St&8191,Ce=St>>>13,We=N[6]|0,Le=We&8191,Ke=We>>>13,qe=N[7]|0,we=qe&8191,Se=qe>>>13,q=N[8]|0,z=q&8191,G=q>>>13,re=N[9]|0,ue=re&8191,_e=re>>>13,Ee=F[0]|0,et=Ee&8191,pt=Ee>>>13,Ct=F[1]|0,ot=Ct&8191,Pt=Ct>>>13,mr=F[2]|0,qt=mr&8191,Ur=mr>>>13,Ir=F[3]|0,yt=Ir&8191,Qt=Ir>>>13,Xt=F[4]|0,$t=Xt&8191,hr=Xt>>>13,lr=F[5]|0,Dt=lr&8191,kr=lr>>>13,_r=F[6]|0,Jt=_r&8191,Pr=_r>>>13,zr=F[7]|0,Zt=zr&8191,Nr=zr>>>13,Sr=F[8]|0,Yt=Sr&8191,ve=Sr>>>13,me=F[9]|0,le=me&8191,de=me>>>13;E.negative=x.negative^T.negative,E.length=19,k=Math.imul(ie,et),$=Math.imul(ie,pt),$=$+Math.imul(W,et)|0,H=Math.imul(W,pt);var ge=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(ge>>>26)|0,ge&=67108863,k=Math.imul(J,et),$=Math.imul(J,pt),$=$+Math.imul(ee,et)|0,H=Math.imul(ee,pt),k=k+Math.imul(ie,ot)|0,$=$+Math.imul(ie,Pt)|0,$=$+Math.imul(W,ot)|0,H=H+Math.imul(W,Pt)|0;var Ue=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,k=Math.imul(V,et),$=Math.imul(V,pt),$=$+Math.imul(oe,et)|0,H=Math.imul(oe,pt),k=k+Math.imul(J,ot)|0,$=$+Math.imul(J,Pt)|0,$=$+Math.imul(ee,ot)|0,H=H+Math.imul(ee,Pt)|0,k=k+Math.imul(ie,qt)|0,$=$+Math.imul(ie,Ur)|0,$=$+Math.imul(W,qt)|0,H=H+Math.imul(W,Ur)|0;var tt=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(tt>>>26)|0,tt&=67108863,k=Math.imul(Te,et),$=Math.imul(Te,pt),$=$+Math.imul(Me,et)|0,H=Math.imul(Me,pt),k=k+Math.imul(V,ot)|0,$=$+Math.imul(V,Pt)|0,$=$+Math.imul(oe,ot)|0,H=H+Math.imul(oe,Pt)|0,k=k+Math.imul(J,qt)|0,$=$+Math.imul(J,Ur)|0,$=$+Math.imul(ee,qt)|0,H=H+Math.imul(ee,Ur)|0,k=k+Math.imul(ie,yt)|0,$=$+Math.imul(ie,Qt)|0,$=$+Math.imul(W,yt)|0,H=H+Math.imul(W,Qt)|0;var Qe=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,k=Math.imul(nt,et),$=Math.imul(nt,pt),$=$+Math.imul(it,et)|0,H=Math.imul(it,pt),k=k+Math.imul(Te,ot)|0,$=$+Math.imul(Te,Pt)|0,$=$+Math.imul(Me,ot)|0,H=H+Math.imul(Me,Pt)|0,k=k+Math.imul(V,qt)|0,$=$+Math.imul(V,Ur)|0,$=$+Math.imul(oe,qt)|0,H=H+Math.imul(oe,Ur)|0,k=k+Math.imul(J,yt)|0,$=$+Math.imul(J,Qt)|0,$=$+Math.imul(ee,yt)|0,H=H+Math.imul(ee,Qt)|0,k=k+Math.imul(ie,$t)|0,$=$+Math.imul(ie,hr)|0,$=$+Math.imul(W,$t)|0,H=H+Math.imul(W,hr)|0;var Ne=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,k=Math.imul(bt,et),$=Math.imul(bt,pt),$=$+Math.imul(Ce,et)|0,H=Math.imul(Ce,pt),k=k+Math.imul(nt,ot)|0,$=$+Math.imul(nt,Pt)|0,$=$+Math.imul(it,ot)|0,H=H+Math.imul(it,Pt)|0,k=k+Math.imul(Te,qt)|0,$=$+Math.imul(Te,Ur)|0,$=$+Math.imul(Me,qt)|0,H=H+Math.imul(Me,Ur)|0,k=k+Math.imul(V,yt)|0,$=$+Math.imul(V,Qt)|0,$=$+Math.imul(oe,yt)|0,H=H+Math.imul(oe,Qt)|0,k=k+Math.imul(J,$t)|0,$=$+Math.imul(J,hr)|0,$=$+Math.imul(ee,$t)|0,H=H+Math.imul(ee,hr)|0,k=k+Math.imul(ie,Dt)|0,$=$+Math.imul(ie,kr)|0,$=$+Math.imul(W,Dt)|0,H=H+Math.imul(W,kr)|0;var ut=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(ut>>>26)|0,ut&=67108863,k=Math.imul(Le,et),$=Math.imul(Le,pt),$=$+Math.imul(Ke,et)|0,H=Math.imul(Ke,pt),k=k+Math.imul(bt,ot)|0,$=$+Math.imul(bt,Pt)|0,$=$+Math.imul(Ce,ot)|0,H=H+Math.imul(Ce,Pt)|0,k=k+Math.imul(nt,qt)|0,$=$+Math.imul(nt,Ur)|0,$=$+Math.imul(it,qt)|0,H=H+Math.imul(it,Ur)|0,k=k+Math.imul(Te,yt)|0,$=$+Math.imul(Te,Qt)|0,$=$+Math.imul(Me,yt)|0,H=H+Math.imul(Me,Qt)|0,k=k+Math.imul(V,$t)|0,$=$+Math.imul(V,hr)|0,$=$+Math.imul(oe,$t)|0,H=H+Math.imul(oe,hr)|0,k=k+Math.imul(J,Dt)|0,$=$+Math.imul(J,kr)|0,$=$+Math.imul(ee,Dt)|0,H=H+Math.imul(ee,kr)|0,k=k+Math.imul(ie,Jt)|0,$=$+Math.imul(ie,Pr)|0,$=$+Math.imul(W,Jt)|0,H=H+Math.imul(W,Pr)|0;var Lt=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,k=Math.imul(we,et),$=Math.imul(we,pt),$=$+Math.imul(Se,et)|0,H=Math.imul(Se,pt),k=k+Math.imul(Le,ot)|0,$=$+Math.imul(Le,Pt)|0,$=$+Math.imul(Ke,ot)|0,H=H+Math.imul(Ke,Pt)|0,k=k+Math.imul(bt,qt)|0,$=$+Math.imul(bt,Ur)|0,$=$+Math.imul(Ce,qt)|0,H=H+Math.imul(Ce,Ur)|0,k=k+Math.imul(nt,yt)|0,$=$+Math.imul(nt,Qt)|0,$=$+Math.imul(it,yt)|0,H=H+Math.imul(it,Qt)|0,k=k+Math.imul(Te,$t)|0,$=$+Math.imul(Te,hr)|0,$=$+Math.imul(Me,$t)|0,H=H+Math.imul(Me,hr)|0,k=k+Math.imul(V,Dt)|0,$=$+Math.imul(V,kr)|0,$=$+Math.imul(oe,Dt)|0,H=H+Math.imul(oe,kr)|0,k=k+Math.imul(J,Jt)|0,$=$+Math.imul(J,Pr)|0,$=$+Math.imul(ee,Jt)|0,H=H+Math.imul(ee,Pr)|0,k=k+Math.imul(ie,Zt)|0,$=$+Math.imul(ie,Nr)|0,$=$+Math.imul(W,Zt)|0,H=H+Math.imul(W,Nr)|0;var Wr=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,k=Math.imul(z,et),$=Math.imul(z,pt),$=$+Math.imul(G,et)|0,H=Math.imul(G,pt),k=k+Math.imul(we,ot)|0,$=$+Math.imul(we,Pt)|0,$=$+Math.imul(Se,ot)|0,H=H+Math.imul(Se,Pt)|0,k=k+Math.imul(Le,qt)|0,$=$+Math.imul(Le,Ur)|0,$=$+Math.imul(Ke,qt)|0,H=H+Math.imul(Ke,Ur)|0,k=k+Math.imul(bt,yt)|0,$=$+Math.imul(bt,Qt)|0,$=$+Math.imul(Ce,yt)|0,H=H+Math.imul(Ce,Qt)|0,k=k+Math.imul(nt,$t)|0,$=$+Math.imul(nt,hr)|0,$=$+Math.imul(it,$t)|0,H=H+Math.imul(it,hr)|0,k=k+Math.imul(Te,Dt)|0,$=$+Math.imul(Te,kr)|0,$=$+Math.imul(Me,Dt)|0,H=H+Math.imul(Me,kr)|0,k=k+Math.imul(V,Jt)|0,$=$+Math.imul(V,Pr)|0,$=$+Math.imul(oe,Jt)|0,H=H+Math.imul(oe,Pr)|0,k=k+Math.imul(J,Zt)|0,$=$+Math.imul(J,Nr)|0,$=$+Math.imul(ee,Zt)|0,H=H+Math.imul(ee,Nr)|0,k=k+Math.imul(ie,Yt)|0,$=$+Math.imul(ie,ve)|0,$=$+Math.imul(W,Yt)|0,H=H+Math.imul(W,ve)|0;var nn=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(nn>>>26)|0,nn&=67108863,k=Math.imul(ue,et),$=Math.imul(ue,pt),$=$+Math.imul(_e,et)|0,H=Math.imul(_e,pt),k=k+Math.imul(z,ot)|0,$=$+Math.imul(z,Pt)|0,$=$+Math.imul(G,ot)|0,H=H+Math.imul(G,Pt)|0,k=k+Math.imul(we,qt)|0,$=$+Math.imul(we,Ur)|0,$=$+Math.imul(Se,qt)|0,H=H+Math.imul(Se,Ur)|0,k=k+Math.imul(Le,yt)|0,$=$+Math.imul(Le,Qt)|0,$=$+Math.imul(Ke,yt)|0,H=H+Math.imul(Ke,Qt)|0,k=k+Math.imul(bt,$t)|0,$=$+Math.imul(bt,hr)|0,$=$+Math.imul(Ce,$t)|0,H=H+Math.imul(Ce,hr)|0,k=k+Math.imul(nt,Dt)|0,$=$+Math.imul(nt,kr)|0,$=$+Math.imul(it,Dt)|0,H=H+Math.imul(it,kr)|0,k=k+Math.imul(Te,Jt)|0,$=$+Math.imul(Te,Pr)|0,$=$+Math.imul(Me,Jt)|0,H=H+Math.imul(Me,Pr)|0,k=k+Math.imul(V,Zt)|0,$=$+Math.imul(V,Nr)|0,$=$+Math.imul(oe,Zt)|0,H=H+Math.imul(oe,Nr)|0,k=k+Math.imul(J,Yt)|0,$=$+Math.imul(J,ve)|0,$=$+Math.imul(ee,Yt)|0,H=H+Math.imul(ee,ve)|0,k=k+Math.imul(ie,le)|0,$=$+Math.imul(ie,de)|0,$=$+Math.imul(W,le)|0,H=H+Math.imul(W,de)|0;var Dn=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,k=Math.imul(ue,ot),$=Math.imul(ue,Pt),$=$+Math.imul(_e,ot)|0,H=Math.imul(_e,Pt),k=k+Math.imul(z,qt)|0,$=$+Math.imul(z,Ur)|0,$=$+Math.imul(G,qt)|0,H=H+Math.imul(G,Ur)|0,k=k+Math.imul(we,yt)|0,$=$+Math.imul(we,Qt)|0,$=$+Math.imul(Se,yt)|0,H=H+Math.imul(Se,Qt)|0,k=k+Math.imul(Le,$t)|0,$=$+Math.imul(Le,hr)|0,$=$+Math.imul(Ke,$t)|0,H=H+Math.imul(Ke,hr)|0,k=k+Math.imul(bt,Dt)|0,$=$+Math.imul(bt,kr)|0,$=$+Math.imul(Ce,Dt)|0,H=H+Math.imul(Ce,kr)|0,k=k+Math.imul(nt,Jt)|0,$=$+Math.imul(nt,Pr)|0,$=$+Math.imul(it,Jt)|0,H=H+Math.imul(it,Pr)|0,k=k+Math.imul(Te,Zt)|0,$=$+Math.imul(Te,Nr)|0,$=$+Math.imul(Me,Zt)|0,H=H+Math.imul(Me,Nr)|0,k=k+Math.imul(V,Yt)|0,$=$+Math.imul(V,ve)|0,$=$+Math.imul(oe,Yt)|0,H=H+Math.imul(oe,ve)|0,k=k+Math.imul(J,le)|0,$=$+Math.imul(J,de)|0,$=$+Math.imul(ee,le)|0,H=H+Math.imul(ee,de)|0;var Hr=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,k=Math.imul(ue,qt),$=Math.imul(ue,Ur),$=$+Math.imul(_e,qt)|0,H=Math.imul(_e,Ur),k=k+Math.imul(z,yt)|0,$=$+Math.imul(z,Qt)|0,$=$+Math.imul(G,yt)|0,H=H+Math.imul(G,Qt)|0,k=k+Math.imul(we,$t)|0,$=$+Math.imul(we,hr)|0,$=$+Math.imul(Se,$t)|0,H=H+Math.imul(Se,hr)|0,k=k+Math.imul(Le,Dt)|0,$=$+Math.imul(Le,kr)|0,$=$+Math.imul(Ke,Dt)|0,H=H+Math.imul(Ke,kr)|0,k=k+Math.imul(bt,Jt)|0,$=$+Math.imul(bt,Pr)|0,$=$+Math.imul(Ce,Jt)|0,H=H+Math.imul(Ce,Pr)|0,k=k+Math.imul(nt,Zt)|0,$=$+Math.imul(nt,Nr)|0,$=$+Math.imul(it,Zt)|0,H=H+Math.imul(it,Nr)|0,k=k+Math.imul(Te,Yt)|0,$=$+Math.imul(Te,ve)|0,$=$+Math.imul(Me,Yt)|0,H=H+Math.imul(Me,ve)|0,k=k+Math.imul(V,le)|0,$=$+Math.imul(V,de)|0,$=$+Math.imul(oe,le)|0,H=H+Math.imul(oe,de)|0;var Nn=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,k=Math.imul(ue,yt),$=Math.imul(ue,Qt),$=$+Math.imul(_e,yt)|0,H=Math.imul(_e,Qt),k=k+Math.imul(z,$t)|0,$=$+Math.imul(z,hr)|0,$=$+Math.imul(G,$t)|0,H=H+Math.imul(G,hr)|0,k=k+Math.imul(we,Dt)|0,$=$+Math.imul(we,kr)|0,$=$+Math.imul(Se,Dt)|0,H=H+Math.imul(Se,kr)|0,k=k+Math.imul(Le,Jt)|0,$=$+Math.imul(Le,Pr)|0,$=$+Math.imul(Ke,Jt)|0,H=H+Math.imul(Ke,Pr)|0,k=k+Math.imul(bt,Zt)|0,$=$+Math.imul(bt,Nr)|0,$=$+Math.imul(Ce,Zt)|0,H=H+Math.imul(Ce,Nr)|0,k=k+Math.imul(nt,Yt)|0,$=$+Math.imul(nt,ve)|0,$=$+Math.imul(it,Yt)|0,H=H+Math.imul(it,ve)|0,k=k+Math.imul(Te,le)|0,$=$+Math.imul(Te,de)|0,$=$+Math.imul(Me,le)|0,H=H+Math.imul(Me,de)|0;var zn=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(zn>>>26)|0,zn&=67108863,k=Math.imul(ue,$t),$=Math.imul(ue,hr),$=$+Math.imul(_e,$t)|0,H=Math.imul(_e,hr),k=k+Math.imul(z,Dt)|0,$=$+Math.imul(z,kr)|0,$=$+Math.imul(G,Dt)|0,H=H+Math.imul(G,kr)|0,k=k+Math.imul(we,Jt)|0,$=$+Math.imul(we,Pr)|0,$=$+Math.imul(Se,Jt)|0,H=H+Math.imul(Se,Pr)|0,k=k+Math.imul(Le,Zt)|0,$=$+Math.imul(Le,Nr)|0,$=$+Math.imul(Ke,Zt)|0,H=H+Math.imul(Ke,Nr)|0,k=k+Math.imul(bt,Yt)|0,$=$+Math.imul(bt,ve)|0,$=$+Math.imul(Ce,Yt)|0,H=H+Math.imul(Ce,ve)|0,k=k+Math.imul(nt,le)|0,$=$+Math.imul(nt,de)|0,$=$+Math.imul(it,le)|0,H=H+Math.imul(it,de)|0;var Cr=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(ue,Dt),$=Math.imul(ue,kr),$=$+Math.imul(_e,Dt)|0,H=Math.imul(_e,kr),k=k+Math.imul(z,Jt)|0,$=$+Math.imul(z,Pr)|0,$=$+Math.imul(G,Jt)|0,H=H+Math.imul(G,Pr)|0,k=k+Math.imul(we,Zt)|0,$=$+Math.imul(we,Nr)|0,$=$+Math.imul(Se,Zt)|0,H=H+Math.imul(Se,Nr)|0,k=k+Math.imul(Le,Yt)|0,$=$+Math.imul(Le,ve)|0,$=$+Math.imul(Ke,Yt)|0,H=H+Math.imul(Ke,ve)|0,k=k+Math.imul(bt,le)|0,$=$+Math.imul(bt,de)|0,$=$+Math.imul(Ce,le)|0,H=H+Math.imul(Ce,de)|0;var pi=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(pi>>>26)|0,pi&=67108863,k=Math.imul(ue,Jt),$=Math.imul(ue,Pr),$=$+Math.imul(_e,Jt)|0,H=Math.imul(_e,Pr),k=k+Math.imul(z,Zt)|0,$=$+Math.imul(z,Nr)|0,$=$+Math.imul(G,Zt)|0,H=H+Math.imul(G,Nr)|0,k=k+Math.imul(we,Yt)|0,$=$+Math.imul(we,ve)|0,$=$+Math.imul(Se,Yt)|0,H=H+Math.imul(Se,ve)|0,k=k+Math.imul(Le,le)|0,$=$+Math.imul(Le,de)|0,$=$+Math.imul(Ke,le)|0,H=H+Math.imul(Ke,de)|0;var ci=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(ci>>>26)|0,ci&=67108863,k=Math.imul(ue,Zt),$=Math.imul(ue,Nr),$=$+Math.imul(_e,Zt)|0,H=Math.imul(_e,Nr),k=k+Math.imul(z,Yt)|0,$=$+Math.imul(z,ve)|0,$=$+Math.imul(G,Yt)|0,H=H+Math.imul(G,ve)|0,k=k+Math.imul(we,le)|0,$=$+Math.imul(we,de)|0,$=$+Math.imul(Se,le)|0,H=H+Math.imul(Se,de)|0;var ro=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(ro>>>26)|0,ro&=67108863,k=Math.imul(ue,Yt),$=Math.imul(ue,ve),$=$+Math.imul(_e,Yt)|0,H=Math.imul(_e,ve),k=k+Math.imul(z,le)|0,$=$+Math.imul(z,de)|0,$=$+Math.imul(G,le)|0,H=H+Math.imul(G,de)|0;var zs=(j+k|0)+(($&8191)<<13)|0;j=(H+($>>>13)|0)+(zs>>>26)|0,zs&=67108863,k=Math.imul(ue,le),$=Math.imul(ue,de),$=$+Math.imul(_e,le)|0,H=Math.imul(_e,de);var bs=(j+k|0)+(($&8191)<<13)|0;return j=(H+($>>>13)|0)+(bs>>>26)|0,bs&=67108863,B[0]=ge,B[1]=Ue,B[2]=tt,B[3]=Qe,B[4]=Ne,B[5]=ut,B[6]=Lt,B[7]=Wr,B[8]=nn,B[9]=Dn,B[10]=Hr,B[11]=Nn,B[12]=zn,B[13]=Cr,B[14]=pi,B[15]=ci,B[16]=ro,B[17]=zs,B[18]=bs,j!==0&&(B[19]=j,E.length++),E};Math.imul||(m=y);function b(x,T,E){E.negative=T.negative^x.negative,E.length=x.length+T.length;for(var N=0,F=0,B=0;B>>26)|0,F+=j>>>26,j&=67108863}E.words[B]=k,N=j,j=F}return N!==0?E.words[B]=N:E.length--,E._strip()}function w(x,T,E){return b(x,T,E)}a.prototype.mulTo=function(x,T){var E,N=this.length+x.length;return this.length===10&&x.length===10?E=m(this,x,T):N<63?E=y(this,x,T):N<1024?E=b(this,x,T):E=w(this,x,T),E},a.prototype.mul=function(x){var T=new a(null);return T.words=new Array(this.length+x.length),this.mulTo(x,T)},a.prototype.mulf=function(x){var T=new a(null);return T.words=new Array(this.length+x.length),w(this,x,T)},a.prototype.imul=function(x){return this.clone().mulTo(x,this)},a.prototype.imuln=function(x){var T=x<0;T&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var E=0,N=0;N>=26,E+=F/67108864|0,E+=B>>>26,this.words[N]=B&67108863}return E!==0&&(this.words[N]=E,this.length++),T?this.ineg():this},a.prototype.muln=function(x){return this.clone().imuln(x)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(x){var T=v(x);if(T.length===0)return new a(1);for(var E=this,N=0;N=0);var T=x%26,E=(x-T)/26,N=67108863>>>26-T<<26-T,F;if(T!==0){var B=0;for(F=0;F>>26-T}B&&(this.words[F]=B,this.length++)}if(E!==0){for(F=this.length-1;F>=0;F--)this.words[F+E]=this.words[F];for(F=0;F=0);var N;T?N=(T-T%26)/26:N=0;var F=x%26,B=Math.min((x-F)/26,this.length),j=67108863^67108863>>>F<B)for(this.length-=B,$=0;$=0&&(H!==0||$>=N);$--){var Y=this.words[$]|0;this.words[$]=H<<26-F|Y>>>F,H=Y&j}return k&&H!==0&&(k.words[k.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(x,T,E){return n(this.negative===0),this.iushrn(x,T,E)},a.prototype.shln=function(x){return this.clone().ishln(x)},a.prototype.ushln=function(x){return this.clone().iushln(x)},a.prototype.shrn=function(x){return this.clone().ishrn(x)},a.prototype.ushrn=function(x){return this.clone().iushrn(x)},a.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var T=x%26,E=(x-T)/26,N=1<=0);var T=x%26,E=(x-T)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(T!==0&&E++,this.length=Math.min(E,this.length),T!==0){var N=67108863^67108863>>>T<=67108864;T++)this.words[T]-=67108864,T===this.length-1?this.words[T+1]=1:this.words[T+1]++;return this.length=Math.max(this.length,T+1),this},a.prototype.isubn=function(x){if(n(typeof x=="number"),n(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var T=0;T>26)-(k/67108864|0),this.words[F+E]=B&67108863}for(;F>26,this.words[F+E]=B&67108863;if(j===0)return this._strip();for(n(j===-1),j=0,F=0;F>26,this.words[F]=B&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(x,T){var E=this.length-x.length,N=this.clone(),F=x,B=F.words[F.length-1]|0,j=this._countBits(B);E=26-j,E!==0&&(F=F.ushln(E),N.iushln(E),B=F.words[F.length-1]|0);var k=N.length-F.length,$;if(T!=="mod"){$=new a(null),$.length=k+1,$.words=new Array($.length);for(var H=0;H<$.length;H++)$.words[H]=0}var Y=N.clone()._ishlnsubmul(F,1,k);Y.negative===0&&(N=Y,$&&($.words[k]=1));for(var ie=k-1;ie>=0;ie--){var W=(N.words[F.length+ie]|0)*67108864+(N.words[F.length+ie-1]|0);for(W=Math.min(W/B|0,67108863),N._ishlnsubmul(F,W,ie);N.negative!==0;)W--,N.negative=0,N._ishlnsubmul(F,1,ie),N.isZero()||(N.negative^=1);$&&($.words[ie]=W)}return $&&$._strip(),N._strip(),T!=="div"&&E!==0&&N.iushrn(E),{div:$||null,mod:N}},a.prototype.divmod=function(x,T,E){if(n(!x.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var N,F,B;return this.negative!==0&&x.negative===0?(B=this.neg().divmod(x,T),T!=="mod"&&(N=B.div.neg()),T!=="div"&&(F=B.mod.neg(),E&&F.negative!==0&&F.iadd(x)),{div:N,mod:F}):this.negative===0&&x.negative!==0?(B=this.divmod(x.neg(),T),T!=="mod"&&(N=B.div.neg()),{div:N,mod:B.mod}):this.negative&x.negative?(B=this.neg().divmod(x.neg(),T),T!=="div"&&(F=B.mod.neg(),E&&F.negative!==0&&F.isub(x)),{div:B.div,mod:F}):x.length>this.length||this.cmp(x)<0?{div:new a(0),mod:this}:x.length===1?T==="div"?{div:this.divn(x.words[0]),mod:null}:T==="mod"?{div:null,mod:new a(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new a(this.modrn(x.words[0]))}:this._wordDiv(x,T)},a.prototype.div=function(x){return this.divmod(x,"div",!1).div},a.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},a.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},a.prototype.divRound=function(x){var T=this.divmod(x);if(T.mod.isZero())return T.div;var E=T.div.negative!==0?T.mod.isub(x):T.mod,N=x.ushrn(1),F=x.andln(1),B=E.cmp(N);return B<0||F===1&&B===0?T.div:T.div.negative!==0?T.div.isubn(1):T.div.iaddn(1)},a.prototype.modrn=function(x){var T=x<0;T&&(x=-x),n(x<=67108863);for(var E=(1<<26)%x,N=0,F=this.length-1;F>=0;F--)N=(E*N+(this.words[F]|0))%x;return T?-N:N},a.prototype.modn=function(x){return this.modrn(x)},a.prototype.idivn=function(x){var T=x<0;T&&(x=-x),n(x<=67108863);for(var E=0,N=this.length-1;N>=0;N--){var F=(this.words[N]|0)+E*67108864;this.words[N]=F/x|0,E=F%x}return this._strip(),T?this.ineg():this},a.prototype.divn=function(x){return this.clone().idivn(x)},a.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var T=this,E=x.clone();T.negative!==0?T=T.umod(x):T=T.clone();for(var N=new a(1),F=new a(0),B=new a(0),j=new a(1),k=0;T.isEven()&&E.isEven();)T.iushrn(1),E.iushrn(1),++k;for(var $=E.clone(),H=T.clone();!T.isZero();){for(var Y=0,ie=1;!(T.words[0]&ie)&&Y<26;++Y,ie<<=1);if(Y>0)for(T.iushrn(Y);Y-- >0;)(N.isOdd()||F.isOdd())&&(N.iadd($),F.isub(H)),N.iushrn(1),F.iushrn(1);for(var W=0,Q=1;!(E.words[0]&Q)&&W<26;++W,Q<<=1);if(W>0)for(E.iushrn(W);W-- >0;)(B.isOdd()||j.isOdd())&&(B.iadd($),j.isub(H)),B.iushrn(1),j.iushrn(1);T.cmp(E)>=0?(T.isub(E),N.isub(B),F.isub(j)):(E.isub(T),B.isub(N),j.isub(F))}return{a:B,b:j,gcd:E.iushln(k)}},a.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var T=this,E=x.clone();T.negative!==0?T=T.umod(x):T=T.clone();for(var N=new a(1),F=new a(0),B=E.clone();T.cmpn(1)>0&&E.cmpn(1)>0;){for(var j=0,k=1;!(T.words[0]&k)&&j<26;++j,k<<=1);if(j>0)for(T.iushrn(j);j-- >0;)N.isOdd()&&N.iadd(B),N.iushrn(1);for(var $=0,H=1;!(E.words[0]&H)&&$<26;++$,H<<=1);if($>0)for(E.iushrn($);$-- >0;)F.isOdd()&&F.iadd(B),F.iushrn(1);T.cmp(E)>=0?(T.isub(E),N.isub(F)):(E.isub(T),F.isub(N))}var Y;return T.cmpn(1)===0?Y=N:Y=F,Y.cmpn(0)<0&&Y.iadd(x),Y},a.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var T=this.clone(),E=x.clone();T.negative=0,E.negative=0;for(var N=0;T.isEven()&&E.isEven();N++)T.iushrn(1),E.iushrn(1);do{for(;T.isEven();)T.iushrn(1);for(;E.isEven();)E.iushrn(1);var F=T.cmp(E);if(F<0){var B=T;T=E,E=B}else if(F===0||E.cmpn(1)===0)break;T.isub(E)}while(!0);return E.iushln(N)},a.prototype.invm=function(x){return this.egcd(x).a.umod(x)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(x){return this.words[0]&x},a.prototype.bincn=function(x){n(typeof x=="number");var T=x%26,E=(x-T)/26,N=1<>>26,j&=67108863,this.words[B]=j}return F!==0&&(this.words[B]=F,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(x){var T=x<0;if(this.negative!==0&&!T)return-1;if(this.negative===0&&T)return 1;this._strip();var E;if(this.length>1)E=1;else{T&&(x=-x),n(x<=67108863,"Number is too big");var N=this.words[0]|0;E=N===x?0:Nx.length)return 1;if(this.length=0;E--){var N=this.words[E]|0,F=x.words[E]|0;if(N!==F){NF&&(T=1);break}}return T},a.prototype.gtn=function(x){return this.cmpn(x)===1},a.prototype.gt=function(x){return this.cmp(x)===1},a.prototype.gten=function(x){return this.cmpn(x)>=0},a.prototype.gte=function(x){return this.cmp(x)>=0},a.prototype.ltn=function(x){return this.cmpn(x)===-1},a.prototype.lt=function(x){return this.cmp(x)===-1},a.prototype.lten=function(x){return this.cmpn(x)<=0},a.prototype.lte=function(x){return this.cmp(x)<=0},a.prototype.eqn=function(x){return this.cmpn(x)===0},a.prototype.eq=function(x){return this.cmp(x)===0},a.red=function(x){return new O(x)},a.prototype.toRed=function(x){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(x){return this.red=x,this},a.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},a.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},a.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},a.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},a.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},a.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},a.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},a.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var C={k256:null,p224:null,p192:null,p25519:null};function A(x,T){this.name=x,this.p=new a(T,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}A.prototype._tmp=function(){var x=new a(null);return x.words=new Array(Math.ceil(this.n/13)),x},A.prototype.ireduce=function(x){var T=x,E;do this.split(T,this.tmp),T=this.imulK(T),T=T.iadd(this.tmp),E=T.bitLength();while(E>this.n);var N=E0?T.isub(this.p):T.strip!==void 0?T.strip():T._strip(),T},A.prototype.split=function(x,T){x.iushrn(this.n,0,T)},A.prototype.imulK=function(x){return x.imul(this.k)};function S(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(S,A),S.prototype.split=function(x,T){for(var E=4194303,N=Math.min(x.length,9),F=0;F>>22,B=j}B>>>=22,x.words[F-10]=B,B===0&&x.length>10?x.length-=10:x.length-=9},S.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var T=0,E=0;E>>=26,x.words[E]=F,T=N}return T!==0&&(x.words[x.length++]=T),x},a._prime=function(x){if(C[x])return C[x];var T;if(x==="k256")T=new S;else if(x==="p224")T=new I;else if(x==="p192")T=new D;else if(x==="p25519")T=new L;else throw new Error("Unknown prime "+x);return C[x]=T,T};function O(x){if(typeof x=="string"){var T=a._prime(x);this.m=T.p,this.prime=T}else n(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}O.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},O.prototype._verify2=function(x,T){n((x.negative|T.negative)===0,"red works only with positives"),n(x.red&&x.red===T.red,"red works only with red numbers")},O.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},O.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},O.prototype.add=function(x,T){this._verify2(x,T);var E=x.add(T);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},O.prototype.iadd=function(x,T){this._verify2(x,T);var E=x.iadd(T);return E.cmp(this.m)>=0&&E.isub(this.m),E},O.prototype.sub=function(x,T){this._verify2(x,T);var E=x.sub(T);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},O.prototype.isub=function(x,T){this._verify2(x,T);var E=x.isub(T);return E.cmpn(0)<0&&E.iadd(this.m),E},O.prototype.shl=function(x,T){return this._verify1(x),this.imod(x.ushln(T))},O.prototype.imul=function(x,T){return this._verify2(x,T),this.imod(x.imul(T))},O.prototype.mul=function(x,T){return this._verify2(x,T),this.imod(x.mul(T))},O.prototype.isqr=function(x){return this.imul(x,x.clone())},O.prototype.sqr=function(x){return this.mul(x,x)},O.prototype.sqrt=function(x){if(x.isZero())return x.clone();var T=this.m.andln(3);if(n(T%2===1),T===3){var E=this.m.add(new a(1)).iushrn(2);return this.pow(x,E)}for(var N=this.m.subn(1),F=0;!N.isZero()&&N.andln(1)===0;)F++,N.iushrn(1);n(!N.isZero());var B=new a(1).toRed(this),j=B.redNeg(),k=this.m.subn(1).iushrn(1),$=this.m.bitLength();for($=new a(2*$*$).toRed(this);this.pow($,k).cmp(j)!==0;)$.redIAdd(j);for(var H=this.pow($,N),Y=this.pow(x,N.addn(1).iushrn(1)),ie=this.pow(x,N),W=F;ie.cmp(B)!==0;){for(var Q=ie,J=0;Q.cmp(B)!==0;J++)Q=Q.redSqr();n(J=0;F--){for(var H=T.words[F],Y=$-1;Y>=0;Y--){var ie=H>>Y&1;if(B!==N[0]&&(B=this.sqr(B)),ie===0&&j===0){k=0;continue}j<<=1,j|=ie,k++,!(k!==E&&(F!==0||Y!==0))&&(B=this.mul(B,N[j]),k=0,j=0)}$=26}return B},O.prototype.convertTo=function(x){var T=x.umod(this.m);return T===x?T.clone():T},O.prototype.convertFrom=function(x){var T=x.clone();return T.red=null,T},a.mont=function(x){return new P(x)};function P(x){O.call(this,x),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(P,O),P.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},P.prototype.convertFrom=function(x){var T=this.imod(x.mul(this.rinv));return T.red=null,T},P.prototype.imul=function(x,T){if(x.isZero()||T.isZero())return x.words[0]=0,x.length=1,x;var E=x.imul(T),N=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=E.isub(N).iushrn(this.shift),B=F;return F.cmp(this.m)>=0?B=F.isub(this.m):F.cmpn(0)<0&&(B=F.iadd(this.m)),B._forceRed(this)},P.prototype.mul=function(x,T){if(x.isZero()||T.isZero())return new a(0)._forceRed(this);var E=x.mul(T),N=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=E.isub(N).iushrn(this.shift),B=F;return F.cmp(this.m)>=0?B=F.isub(this.m):F.cmpn(0)<0&&(B=F.iadd(this.m)),B._forceRed(this)},P.prototype.invm=function(x){var T=this.imod(x._invmp(this.m).mul(this.r2));return T._forceRed(this)}})(t,nAe)})(sAe);var wn=sAe.exports;const lAe="bignumber/5.7.0";var oN=wn.BN;const fg=new Is(lAe),az={},Vue=9007199254740991;function q_t(t){return t!=null&&(Wl.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||hu(t)||typeof t=="bigint"||TS(t))}let Gue=!1,Wl=class Dd{constructor(e,r){e!==az&&fg.throwError("cannot call constructor directly; use BigNumber.from",Is.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ac(Zn(this).fromTwos(e))}toTwos(e){return ac(Zn(this).toTwos(e))}abs(){return this._hex[0]==="-"?Dd.from(this._hex.substring(1)):this}add(e){return ac(Zn(this).add(Zn(e)))}sub(e){return ac(Zn(this).sub(Zn(e)))}div(e){return Dd.from(e).isZero()&&Zu("division-by-zero","div"),ac(Zn(this).div(Zn(e)))}mul(e){return ac(Zn(this).mul(Zn(e)))}mod(e){const r=Zn(e);return r.isNeg()&&Zu("division-by-zero","mod"),ac(Zn(this).umod(r))}pow(e){const r=Zn(e);return r.isNeg()&&Zu("negative-power","pow"),ac(Zn(this).pow(r))}and(e){const r=Zn(e);return(this.isNegative()||r.isNeg())&&Zu("unbound-bitwise-result","and"),ac(Zn(this).and(r))}or(e){const r=Zn(e);return(this.isNegative()||r.isNeg())&&Zu("unbound-bitwise-result","or"),ac(Zn(this).or(r))}xor(e){const r=Zn(e);return(this.isNegative()||r.isNeg())&&Zu("unbound-bitwise-result","xor"),ac(Zn(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Zu("negative-width","mask"),ac(Zn(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Zu("negative-width","shl"),ac(Zn(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Zu("negative-width","shr"),ac(Zn(this).shrn(e))}eq(e){return Zn(this).eq(Zn(e))}lt(e){return Zn(this).lt(Zn(e))}lte(e){return Zn(this).lte(Zn(e))}gt(e){return Zn(this).gt(Zn(e))}gte(e){return Zn(this).gte(Zn(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Zn(this).isZero()}toNumber(){try{return Zn(this).toNumber()}catch{Zu("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return fg.throwError("this platform does not support BigInt",Is.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Gue||(Gue=!0,fg.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?fg.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Is.errors.UNEXPECTED_ARGUMENT,{}):fg.throwError("BigNumber.toString does not accept parameters",Is.errors.UNEXPECTED_ARGUMENT,{})),Zn(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Dd)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Dd(az,PT(e)):e.match(/^-?[0-9]+$/)?new Dd(az,PT(new oN(e))):fg.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Zu("underflow","BigNumber.from",e),(e>=Vue||e<=-Vue)&&Zu("overflow","BigNumber.from",e),Dd.from(String(e));const r=e;if(typeof r=="bigint")return Dd.from(r.toString());if(TS(r))return Dd.from(gc(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Dd.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(hu(n)||n[0]==="-"&&hu(n.substring(1))))return Dd.from(n)}return fg.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function PT(t){if(typeof t!="string")return PT(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&fg.throwArgumentError("invalid hex","value",t),t=PT(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function ac(t){return Wl.from(PT(t))}function Zn(t){const e=Wl.from(t).toHexString();return e[0]==="-"?new oN("-"+e.substring(3),16):new oN(e.substring(2),16)}function Zu(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),fg.throwError(t,Is.errors.NUMERIC_FAULT,n)}function Y_t(t){return new oN(t,36).toString(16)}const $l=new Is(lAe),VA={},cAe=Wl.from(0),uAe=Wl.from(-1);function fAe(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),$l.throwError(t,Is.errors.NUMERIC_FAULT,i)}let GA="0";for(;GA.length<256;)GA+=GA;function HJ(t){if(typeof t!="number")try{t=Wl.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+GA.substring(0,t):$l.throwArgumentError("invalid decimal size","decimals",t)}function oz(t,e){e==null&&(e=0);const r=HJ(e);t=Wl.from(t);const n=t.lt(cAe);n&&(t=t.mul(uAe));let i=t.mod(r).toString();for(;i.length2&&$l.throwArgumentError("too many decimal points","value",t);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&fAe("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==s&&$l.throwArgumentError("invalid fixed format ("+o+" not "+s+")","format."+o,e[o]),e[o]);r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&$l.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&$l.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Kq(VA,r,n,i)}},dAe=class kl{constructor(e,r,n,i){e!==VA&&$l.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Is.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&$l.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=K0(this._value,this.format.decimals),n=K0(e._value,e.format.decimals);return kl.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=K0(this._value,this.format.decimals),n=K0(e._value,e.format.decimals);return kl.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=K0(this._value,this.format.decimals),n=K0(e._value,e.format.decimals);return kl.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=K0(this._value,this.format.decimals),n=K0(e._value,e.format.decimals);return kl.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=kl.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Wue.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=kl.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Wue.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&$l.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=kl.from("1"+GA.substring(0,e),this.format),i=K_t.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&$l.throwArgumentError("invalid byte width","width",e);const r=Wl.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Lp(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return kl.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!q_t(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),kl.fromString(oz(e,r),sz.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=sz.from(r),i=K0(e,n.decimals);!n.signed&&i.lt(cAe)&&fAe("unsigned value cannot be negative","overflow","value",e);let a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=Lp(a,n.width/8));const o=oz(i,n.decimals);return new kl(VA,a,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=sz.from(r);if(Qa(e).length>n.width/8)throw new Error("overflow");let i=Wl.from(e);n.signed&&(i=i.fromTwos(n.width));const a=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=oz(i,n.decimals);return new kl(VA,a,o,n)}static from(e,r){if(typeof e=="string")return kl.fromString(e,r);if(TS(e))return kl.fromBytes(e,r);try{return kl.fromValue(e,0,r)}catch(n){if(n.code!==Is.errors.INVALID_ARGUMENT)throw n}return $l.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const Wue=dAe.from(1),K_t=dAe.from("0.5"),Z_t="strings/5.7.0",Q_t=new Is(Z_t);var sN;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(sN||(sN={}));var que;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(que||(que={}));function lz(t,e=sN.current){e!=sN.current&&(Q_t.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(a&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Qa(r)}function X_t(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let a=i.split(":");r+=parseInt(a[0],16),n[r]=e(a[1])}),n}function Yue(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}Yue("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),cz("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),cz("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),cz("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",X_t),Yue("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function J_t(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(s)?i(s,o-1):r.push(s)})};return i(t,e),r}function e3t(t){const e={};for(let r=0;r>--l&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,g=d-1;let v=0;for(let C=0;C1;){let L=A+S>>>1;C>>1|u(),I=I<<1^h,D=(D^h)<<1|h|1;m=I,b=1+D-I}let w=n-4;return y.map(C=>{switch(C-w){case 3:return w+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return w+256+(t[s++]<<8|t[s++]);case 1:return w+t[s++];default:return C-1}})}function r3t(t){let e=0;return()=>t[e++]}function n3t(t){return r3t(t3t(t))}function i3t(t){return t&1?~t>>1:t>>1}function a3t(t,e){let r=Array(t);for(let n=0;ne[o]):r}function s3t(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(c3t(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(u3t(r,t))}return e3t(hAe(e))}function l3t(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function pAe(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(a));return n}function c3t(t,e){let r=1+e(),n=e(),i=l3t(e),a=pAe(i.length,1+t,e);return hAe(a.map((o,s)=>{const l=o[0],c=o.slice(1);return Array(i[s]).fill(void 0).map((u,f)=>{let d=f*n;return[l+f*r,c.map(h=>h+d)]})}))}function u3t(t,e){let r=1+e();return pAe(r,1+t,e).map(n=>[n[0],n.slice(1)])}function f3t(t){let e=lN(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=lN(t,e);if(c.length==0)break;n.push({set:new Set(c),node:r()})}n.sort((c,u)=>u.set.size-c.set.size);let i=t(),a=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let s=i==1,l=i==2;return{branches:n,valid:a,fe0f:o,save:s,check:l}}}function d3t(){return n3t(J_t("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const f7=d3t();new Set(lN(f7)),new Set(lN(f7)),s3t(f7),f3t(f7);const h3t=new Uint8Array(32);h3t.fill(0);const p3t=`Ethereum Signed Message: -`;function gAe(t){return typeof t=="string"&&(t=lz(t)),zJ(U_t([lz(p3t),lz(String(t.length)),t]))}const g3t="address/5.7.0",oA=new Is(g3t);function Zue(t){hu(t,20)||oA.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Qa(zJ(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const v3t=9007199254740991;function m3t(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const VJ={};for(let t=0;t<10;t++)VJ[String(t)]=String(t);for(let t=0;t<26;t++)VJ[String.fromCharCode(65+t)]=String(10+t);const Que=Math.floor(m3t(v3t));function y3t(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>VJ[n]).join("");for(;e.length>=Que;){let n=e.substring(0,Que);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function w3t(t){let e=null;if(typeof t!="string"&&oA.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=Zue(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&oA.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==y3t(t)&&oA.throwArgumentError("bad icap checksum","address",t),e=Y_t(t.substring(4));e.length<40;)e="0"+e;e=Zue("0x"+e)}else oA.throwArgumentError("invalid address","address",t);return e}function WC(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}const b3t=new Uint8Array(32);b3t.fill(0),Wl.from(-1);const x3t=Wl.from(0),_3t=Wl.from(1);Wl.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Lp(_3t.toHexString(),32),Lp(x3t.toHexString(),32);var op={},ti={},E8=vAe;function vAe(t,e){if(!t)throw new Error(e||"Assertion failed")}vAe.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var Zq={exports:{}};typeof Object.create=="function"?Zq.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Zq.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var S3t=E8,C3t=Zq.exports;ti.inherits=C3t;function A3t(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function T3t(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=a&63|128):A3t(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}ti.htonl=mAe;function I3t(t,e){for(var r="",n=0;n>>0}return a}ti.join32=k3t;function P3t(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}ti.split32=P3t;function R3t(t,e){return t>>>e|t<<32-e}ti.rotr32=R3t;function M3t(t,e){return t<>>32-e}ti.rotl32=M3t;function D3t(t,e){return t+e>>>0}ti.sum32=D3t;function N3t(t,e,r){return t+e+r>>>0}ti.sum32_3=N3t;function O3t(t,e,r,n){return t+e+r+n>>>0}ti.sum32_4=O3t;function L3t(t,e,r,n,i){return t+e+r+n+i>>>0}ti.sum32_5=L3t;function $3t(t,e,r,n){var i=t[e],a=t[e+1],o=n+a>>>0,s=(o>>0,t[e+1]=o}ti.sum64=$3t;function B3t(t,e,r,n){var i=e+n>>>0,a=(i>>0}ti.sum64_hi=B3t;function F3t(t,e,r,n){var i=e+n;return i>>>0}ti.sum64_lo=F3t;function j3t(t,e,r,n,i,a,o,s){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}ti.sum64_4_hi=j3t;function U3t(t,e,r,n,i,a,o,s){var l=e+n+a+s;return l>>>0}ti.sum64_4_lo=U3t;function z3t(t,e,r,n,i,a,o,s,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}ti.sum64_5_hi=z3t;function H3t(t,e,r,n,i,a,o,s,l,c){var u=e+n+a+s+c;return u>>>0}ti.sum64_5_lo=H3t;function V3t(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}ti.rotr64_hi=V3t;function G3t(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}ti.rotr64_lo=G3t;function W3t(t,e,r){return t>>>r}ti.shr64_hi=W3t;function q3t(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}ti.shr64_lo=q3t;var ES={},Xue=ti,Y3t=E8;function d7(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}ES.BlockHash=d7,d7.prototype.update=function(t,e){if(t=Xue.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=Xue.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=t&255}else for(n[i++]=t&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a>>3}_0.g0_256=J3t;function e5t(t){return $p(t,17)^$p(t,19)^t>>>10}_0.g1_256=e5t;var b5=ti,t5t=ES,r5t=_0,uz=b5.rotl32,qC=b5.sum32,n5t=b5.sum32_5,i5t=r5t.ft_1,SAe=t5t.BlockHash,a5t=[1518500249,1859775393,2400959708,3395469782];function gp(){if(!(this instanceof gp))return new gp;SAe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}b5.inherits(gp,SAe);var o5t=gp;gp.blockSize=512,gp.outSize=160,gp.hmacStrength=80,gp.padLength=64,gp.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=new this.Hash().update(t).digest()),q5t(t.length<=this.blockSize);for(var e=t.length;e>8,d=u&255;f?l.push(f,d):l.push(d)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function a(o){for(var s="",l=0;l(d>>1)-1?g=(d>>1)-v:g=v,h.isubn(g)):g=0,f[p]=g,h.iushrn(1)}return f}r.getNAF=n;function i(l,c){var u=[[],[]];l=l.clone(),c=c.clone();for(var f=0,d=0,h;l.cmpn(-f)>0||c.cmpn(-d)>0;){var p=l.andln(3)+f&3,g=c.andln(3)+d&3;p===3&&(p=-1),g===3&&(g=-1);var v;p&1?(h=l.andln(7)+f&7,(h===3||h===5)&&g===2?v=-p:v=p):v=0,u[0].push(v);var y;g&1?(h=c.andln(7)+d&7,(h===3||h===5)&&p===2?y=-g:y=g):y=0,u[1].push(y),2*f===v+1&&(f=1-f),2*d===y+1&&(d=1-d),l.iushrn(1),c.iushrn(1)}return u}r.getJSF=i;function a(l,c,u){var f="_"+c;l.prototype[c]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=a;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function s(l){return new wn(l,"hex","le")}r.intFromLE=s}),p7=wu.getNAF,Z5t=wu.getJSF,cN=wu.assert;function Em(t,e){this.type=t,this.p=new wn(e.p,16),this.red=e.prime?wn.red(e.prime):wn.mont(this.p),this.zero=new wn(0).toRed(this.red),this.one=new wn(1).toRed(this.red),this.two=new wn(2).toRed(this.red),this.n=e.n&&new wn(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var X2=Em;Em.prototype.point=function(){throw new Error("Not implemented")},Em.prototype.validate=function(){throw new Error("Not implemented")},Em.prototype._fixedNafMul=function(t,e){cN(t.precomputed);var r=t._getDoubles(),n=p7(e,1,this._bitLength),i=(1<=o;l--)s=(s<<1)+n[l];a.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;s--){for(var l=0;s>=0&&a[s]===0;s--)l++;if(s>=0&&l++,o=o.dblp(l),s<0)break;var c=a[s];cN(c!==0),t.type==="affine"?c>0?o=o.mixedAdd(i[c-1>>1]):o=o.mixedAdd(i[-c-1>>1].neg()):c>0?o=o.add(i[c-1>>1]):o=o.add(i[-c-1>>1].neg())}return t.type==="affine"?o.toP():o},Em.prototype._wnafMulAdd=function(t,e,r,n,i){var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,l=0,c,u,f;for(c=0;c=1;c-=2){var h=c-1,p=c;if(a[h]!==1||a[p]!==1){s[h]=p7(r[h],a[h],this._bitLength),s[p]=p7(r[p],a[p],this._bitLength),l=Math.max(s[h].length,l),l=Math.max(s[p].length,l);continue}var g=[e[h],null,null,e[p]];e[h].y.cmp(e[p].y)===0?(g[1]=e[h].add(e[p]),g[2]=e[h].toJ().mixedAdd(e[p].neg())):e[h].y.cmp(e[p].y.redNeg())===0?(g[1]=e[h].toJ().mixedAdd(e[p]),g[2]=e[h].add(e[p].neg())):(g[1]=e[h].toJ().mixedAdd(e[p]),g[2]=e[h].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=Z5t(r[h],r[p]);for(l=Math.max(y[0].length,l),s[h]=new Array(l),s[p]=new Array(l),u=0;u=0;c--){for(var A=0;c>=0;){var S=!0;for(u=0;u=0&&A++,w=w.dblp(A),c<0)break;for(u=0;u0?f=o[u][I-1>>1]:I<0&&(f=o[u][-I-1>>1].neg()),f.type==="affine"?w=w.mixedAdd(f):w=w.add(f))}}for(c=0;c=Math.ceil((t.bitLength()+1)/e.step):!1},Qu.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(d=l,h=c),u.negative&&(u=u.neg(),f=f.neg()),d.negative&&(d=d.neg(),h=h.neg()),[{a:u,b:f},{a:d,b:h}]},Cf.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),l=i.mul(r.b),c=a.mul(n.b),u=t.sub(o).sub(s),f=l.add(c).neg();return{k1:u,k2:f}},Cf.prototype.pointFromX=function(t,e){t=new wn(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},Cf.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0},Cf.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},Xo.prototype.isInfinity=function(){return this.inf},Xo.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Xo.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},Xo.prototype.getX=function(){return this.x.fromRed()},Xo.prototype.getY=function(){return this.y.fromRed()},Xo.prototype.mul=function(t){return t=new wn(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Xo.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Xo.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Xo.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},Xo.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(i){return i.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},Xo.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function _s(t,e,r,n){X2.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new wn(0)):(this.x=new wn(e,16),this.y=new wn(r,16),this.z=new wn(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}WJ(_s,X2.BasePoint),Cf.prototype.jpoint=function(t,e,r){return new _s(this,t,e,r)},_s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},_s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_s.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),l=a.redSub(o);if(s.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),f=n.redMul(c),d=l.redSqr().redIAdd(u).redISub(f).redISub(f),h=l.redMul(f.redISub(d)).redISub(a.redMul(u)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,h,p)},_s.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,a=t.y.redMul(e).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(o.cmpn(0)===0)return s.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),c=l.redMul(o),u=r.redMul(l),f=s.redSqr().redIAdd(c).redISub(u).redISub(u),d=s.redMul(u.redISub(f)).redISub(i.redMul(c)),h=this.z.redMul(o);return this.curve.jpoint(f,d,h)},_s.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}},_s.prototype.inspect=function(){return this.isInfinity()?"":""},_s.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var qR=kS(function(t,e){var r=e;r.base=X2,r.short=X5t,r.mont=null,r.edwards=null}),YR=kS(function(t,e){var r=e,n=wu.assert;function i(s){s.type==="short"?this.curve=new qR.short(s):s.type==="edwards"?this.curve=new qR.edwards(s):this.curve=new qR.mont(s),this.g=this.curve.g,this.n=this.curve.n,this.hash=s.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function a(s,l){Object.defineProperty(r,s,{configurable:!0,enumerable:!0,get:function(){var c=new i(l);return Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:c}),c}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:op.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:op.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:op.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:op.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:op.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:op.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:op.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:op.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Im(t){if(!(this instanceof Im))return new Im(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Kd.toArray(t.entropy,t.entropyEnc||"hex"),r=Kd.toArray(t.nonce,t.nonceEnc||"hex"),n=Kd.toArray(t.pers,t.persEnc||"hex");GJ(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var rfe=Im;Im.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Im.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(n=r,r=e,e=null),r&&(r=Kd.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var J5t=wu.assert;function m$(t,e){if(t instanceof m$)return t;this._importDER(t,e)||(J5t(t.r&&t.s,"Signature without r or s"),this.r=new wn(t.r,16),this.s=new wn(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var g7=m$;function eSt(){this.place=0}function gz(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,o=e.place;a>>=0;return i<=127?!1:(e.place=o,i)}function nfe(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}m$.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=nfe(e),r=nfe(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var n=[2];vz(n,e.length),n=n.concat(e),n.push(2),vz(n,r.length);var i=n.concat(r),a=[48];return vz(a,i.length),a=a.concat(i),wu.encode(a,t)};var tSt=function(){throw new Error("unsupported")},OAe=wu.assert;function vf(t){if(!(this instanceof vf))return new vf(t);typeof t=="string"&&(OAe(Object.prototype.hasOwnProperty.call(YR,t),"Unknown curve "+t),t=YR[t]),t instanceof YR.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var rSt=vf;vf.prototype.keyPair=function(t){return new pz(this,t)},vf.prototype.keyFromPrivate=function(t,e){return pz.fromPrivate(this,t,e)},vf.prototype.keyFromPublic=function(t,e){return pz.fromPublic(this,t,e)},vf.prototype.genKeyPair=function(t){t||(t={});for(var e=new rfe({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||tSt(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new wn(2));;){var i=new wn(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},vf.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},vf.prototype.sign=function(t,e,r,n){typeof r=="object"&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new wn(t,16));for(var i=this.n.byteLength(),a=e.getPrivate().toArray("be",i),o=t.toArray("be",i),s=new rfe({hash:this.hash,entropy:a,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new wn(1)),c=0;;c++){var u=n.k?n.k(c):new wn(s.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(l)>=0)){var f=this.g.mul(u);if(!f.isInfinity()){var d=f.getX(),h=d.umod(this.n);if(h.cmpn(0)!==0){var p=u.invm(this.n).mul(h.mul(e.getPrivate()).iadd(t));if(p=p.umod(this.n),p.cmpn(0)!==0){var g=(f.getY().isOdd()?1:0)|(d.cmp(h)!==0?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new g7({r:h,s:p,recoveryParam:g})}}}}}},vf.prototype.verify=function(t,e,r,n){t=this._truncateToN(new wn(t,16)),r=this.keyFromPublic(r,n),e=new g7(e,"hex");var i=e.r,a=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o=a.invm(this.n),s=o.mul(t).umod(this.n),l=o.mul(i).umod(this.n),c;return this.curve._maxwellTrick?(c=this.g.jmulAdd(s,r.getPublic(),l),c.isInfinity()?!1:c.eqXToP(i)):(c=this.g.mulAdd(s,r.getPublic(),l),c.isInfinity()?!1:c.getX().umod(this.n).cmp(i)===0)},vf.prototype.recoverPubKey=function(t,e,r,n){OAe((3&r)===r,"The recovery param is more than two bits"),e=new g7(e,n);var i=this.n,a=new wn(t),o=e.r,s=e.s,l=r&1,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),d=s.mul(u).umod(i);return this.g.mulAdd(f,o,d)},vf.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new g7(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var nSt=kS(function(t,e){var r=e;r.version="6.5.4",r.utils=wu,r.rand=function(){throw new Error("unsupported")},r.curve=qR,r.curves=YR,r.ec=rSt,r.eddsa=null}),iSt=nSt.ec;const aSt="signing-key/5.7.0",Jq=new Is(aSt);let mz=null;function gm(){return mz||(mz=new iSt("secp256k1")),mz}class oSt{constructor(e){WC(this,"curve","secp256k1"),WC(this,"privateKey",gc(e)),H_t(this.privateKey)!==32&&Jq.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=gm().keyFromPrivate(Qa(this.privateKey));WC(this,"publicKey","0x"+r.getPublic(!1,"hex")),WC(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),WC(this,"_isSigningKey",!0)}_addPoint(e){const r=gm().keyFromPublic(Qa(this.publicKey)),n=gm().keyFromPublic(Qa(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=gm().keyFromPrivate(Qa(this.privateKey)),n=Qa(e);n.length!==32&&Jq.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return oAe({recoveryParam:i.recoveryParam,r:Lp("0x"+i.r.toString(16),32),s:Lp("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=gm().keyFromPrivate(Qa(this.privateKey)),n=gm().keyFromPublic(Qa(LAe(e)));return Lp("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function sSt(t,e){const r=oAe(e),n={r:Qa(r.r),s:Qa(r.s)};return"0x"+gm().recoverPubKey(Qa(t),n,r.recoveryParam).encode("hex",!1)}function LAe(t,e){const r=Qa(t);return r.length===32?new oSt(r).publicKey:r.length===33?"0x"+gm().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?gc(r):Jq.throwArgumentError("invalid public or private key","key","[REDACTED]")}var ife;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(ife||(ife={}));function lSt(t){const e=LAe(t);return w3t(Hue(zJ(Hue(e,1)),12))}function cSt(t,e){return lSt(sSt(Qa(t),e))}const uSt="https://rpc.walletconnect.org/v1";async function fSt(t,e,r,n,i,a){switch(r.t){case"eip191":return dSt(t,e,r.s);case"eip1271":return await hSt(t,e,r.s,n,i,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function dSt(t,e,r){return cSt(gAe(e),r).toLowerCase()===t.toLowerCase()}async function hSt(t,e,r,n,i,a){try{const o="0x1626ba7e",s="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",c=r.substring(2),u=gAe(e).substring(2),f=o+u+s+l+c,d=await fetch(`${a||uSt}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:pSt(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:f},"latest"]})}),{result:h}=await d.json();return h?h.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function pSt(){return Date.now()+Math.floor(Math.random()*1e3)}var gSt=Object.defineProperty,vSt=Object.defineProperties,mSt=Object.getOwnPropertyDescriptors,afe=Object.getOwnPropertySymbols,ySt=Object.prototype.hasOwnProperty,wSt=Object.prototype.propertyIsEnumerable,ofe=(t,e,r)=>e in t?gSt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bSt=(t,e)=>{for(var r in e||(e={}))ySt.call(e,r)&&ofe(t,r,e[r]);if(afe)for(var r of afe(e))wSt.call(e,r)&&ofe(t,r,e[r]);return t},xSt=(t,e)=>vSt(t,mSt(e));const _St="did:pkh:",qJ=t=>t==null?void 0:t.split(":"),$Ae=t=>{const e=t&&qJ(t);if(e)return t.includes(_St)?e[3]:e[1]},sfe=t=>{const e=t&&qJ(t);if(e)return e[2]+":"+e[3]},uN=t=>{const e=t&&qJ(t);if(e)return e.pop()};async function lfe(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,a=BAe(i,i.iss),o=uN(i.iss);return await fSt(o,a,n,$Ae(i.iss),r)}const BAe=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=uN(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const a=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,s=`Chain ID: ${$Ae(e)}`,l=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,d=t.requestId?`Request ID: ${t.requestId}`:void 0,h=t.resources?`Resources:${t.resources.map(g=>` -- ${g}`).join("")}`:void 0,p=KR(t.resources);if(p){const g=RT(p);i=RSt(i,g)}return[r,n,"",i,"",a,o,s,l,c,u,f,d,h].filter(g=>g!=null).join(` -`)};function SSt(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function CSt(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Yb(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const a=n[i];if(!Array.isArray(a))throw new Error(`Ability limits ${i} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);a.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function ASt(t,e,r,n={}){return r==null||r.sort((i,a)=>i.localeCompare(a)),{att:{[t]:TSt(e,r,n)}}}function TSt(t,e,r={}){e=e==null?void 0:e.sort((i,a)=>i.localeCompare(a));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function FAe(t){return Yb(t),`urn:recap:${SSt(t).replace(/=/g,"")}`}function RT(t){const e=CSt(t.replace("urn:recap:",""));return Yb(e),e}function ESt(t,e,r){const n=ASt(t,e,r);return FAe(n)}function ISt(t){return t&&t.includes("urn:recap:")}function kSt(t,e){const r=RT(t),n=RT(e),i=PSt(r,n);return FAe(i)}function PSt(t,e){Yb(t),Yb(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,a)=>i.localeCompare(a)),n={att:{}};return r.forEach(i=>{var a,o;Object.keys(((a=t.att)==null?void 0:a[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((s,l)=>s.localeCompare(l)).forEach(s=>{var l,c;n.att[i]=xSt(bSt({},n.att[i]),{[s]:((l=t.att[i])==null?void 0:l[s])||((c=e.att[i])==null?void 0:c[s])})})}),n}function RSt(t="",e){Yb(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(s=>{const l=Object.keys(e.att[s]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));l.sort((f,d)=>f.action.localeCompare(d.action));const c={};l.forEach(f=>{c[f.ability]||(c[f.ability]=[]),c[f.ability].push(f.action)});const u=Object.keys(c).map(f=>(i++,`(${i}) '${f}': '${c[f].join("', '")}' for '${s}'.`));n.push(u.join(", ").replace(".,","."))});const a=n.join(" "),o=`${r}${a}`;return`${t?t+" ":""}${o}`}function cfe(t){var e;const r=RT(t);Yb(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function ufe(t){const e=RT(t);Yb(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var a;(a=i==null?void 0:i[0])!=null&&a.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function KR(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return ISt(e)?e:void 0}const jAe="base10",jl="base16",Hm="base64pad",KC="base64url",I8="utf8",UAe=0,Rg=1,k8=2,MSt=0,ffe=1,WA=12,YJ=32;function DSt(){const t=DJ.generateKeyPair();return{privateKey:ss(t.secretKey,jl),publicKey:ss(t.publicKey,jl)}}function eY(){const t=cy.randomBytes(YJ);return ss(t,jl)}function NSt(t,e){const r=DJ.sharedKey(is(t,jl),is(e,jl),!0),n=new Xbt(_8.SHA256,r).expand(YJ);return ss(n,jl)}function ZR(t){const e=_8.hash(is(t,jl));return ss(e,jl)}function gg(t){const e=_8.hash(is(t,I8));return ss(e,jl)}function zAe(t){return is(`${t}`,jAe)}function Kb(t){return Number(ss(t,jAe))}function OSt(t){const e=zAe(typeof t.type<"u"?t.type:UAe);if(Kb(e)===Rg&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?is(t.senderPublicKey,jl):void 0,n=typeof t.iv<"u"?is(t.iv,jl):cy.randomBytes(WA),i=new RJ.ChaCha20Poly1305(is(t.symKey,jl)).seal(n,is(t.message,I8));return HAe({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function LSt(t,e){const r=zAe(k8),n=cy.randomBytes(WA),i=is(t,I8);return HAe({type:r,sealed:i,iv:n,encoding:e})}function $St(t){const e=new RJ.ChaCha20Poly1305(is(t.symKey,jl)),{sealed:r,iv:n}=MT({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return ss(i,I8)}function BSt(t,e){const{sealed:r}=MT({encoded:t,encoding:e});return ss(r,I8)}function HAe(t){const{encoding:e=Hm}=t;if(Kb(t.type)===k8)return ss(VR([t.type,t.sealed]),e);if(Kb(t.type)===Rg){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ss(VR([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return ss(VR([t.type,t.iv,t.sealed]),e)}function MT(t){const{encoded:e,encoding:r=Hm}=t,n=is(e,r),i=n.slice(MSt,ffe),a=ffe;if(Kb(i)===Rg){const c=a+YJ,u=c+WA,f=n.slice(a,c),d=n.slice(c,u),h=n.slice(u);return{type:i,sealed:h,iv:d,senderPublicKey:f}}if(Kb(i)===k8){const c=n.slice(a),u=cy.randomBytes(WA);return{type:i,sealed:c,iv:u}}const o=a+WA,s=n.slice(a,o),l=n.slice(o);return{type:i,sealed:l,iv:s}}function FSt(t,e){const r=MT({encoded:t,encoding:e==null?void 0:e.encoding});return VAe({type:Kb(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ss(r.senderPublicKey,jl):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function VAe(t){const e=(t==null?void 0:t.type)||UAe;if(e===Rg){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function dfe(t){return t.type===Rg&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function hfe(t){return t.type===k8}function jSt(t){return new x4e.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function USt(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function zSt(t){return Buffer.from(USt(t),"base64")}function HSt(t,e){const[r,n,i]=t.split("."),a=zSt(i);if(a.length!==64)throw new Error("Invalid signature length");const o=a.slice(0,32).toString("hex"),s=a.slice(32,64).toString("hex"),l=`${r}.${n}`,c=new _8.SHA256().update(Buffer.from(l)).digest(),u=jSt(e),f=Buffer.from(c).toString("hex");if(!u.verify(f,{r:o,s}))throw new Error("Invalid signature");return zq(t).payload}const VSt="irn";function tY(t){return(t==null?void 0:t.relay)||{protocol:VSt}}function sA(t){const e=g_t[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var GSt=Object.defineProperty,WSt=Object.defineProperties,qSt=Object.getOwnPropertyDescriptors,pfe=Object.getOwnPropertySymbols,YSt=Object.prototype.hasOwnProperty,KSt=Object.prototype.propertyIsEnumerable,gfe=(t,e,r)=>e in t?GSt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vfe=(t,e)=>{for(var r in e||(e={}))YSt.call(e,r)&&gfe(t,r,e[r]);if(pfe)for(var r of pfe(e))KSt.call(e,r)&&gfe(t,r,e[r]);return t},ZSt=(t,e)=>WSt(t,qSt(e));function QSt(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),o=t[i];r[a]=o}}),r}function mfe(t){if(!t.includes("wc:")){const l=rAe(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),a=typeof r<"u"?t.substring(r):"",o=kT.parse(a),s=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:XSt(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:QSt(o),methods:s,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function XSt(t){return t.startsWith("//")?t.substring(2):t}function JSt(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const a=r+e+i;t[i]&&(n[a]=t[i])}),n}function yfe(t){return`${t.protocol}:${t.topic}@${t.version}?`+kT.stringify(vfe(ZSt(vfe({symKey:t.symKey},JSt(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function v7(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function PS(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function eCt(t){const e=[];return Object.values(t).forEach(r=>{e.push(...PS(r.accounts))}),e}function tCt(t,e){const r=[];return Object.values(t).forEach(n=>{PS(n.accounts).includes(e)&&r.push(...n.methods)}),r}function rCt(t,e){const r=[];return Object.values(t).forEach(n=>{PS(n.accounts).includes(e)&&r.push(...n.events)}),r}function KJ(t){return t.includes(":")}function lA(t){return KJ(t)?t.split(":")[0]:t}function nCt(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function wfe(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=nCt(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=GR(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const iCt={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},aCt={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ot(t,e){const{message:r,code:n}=aCt[t];return{message:e?`${r} ${e}`:r,code:n}}function $i(t,e){const{message:r,code:n}=iCt[t];return{message:e?`${r} ${e}`:r,code:n}}function Zb(t,e){return!!Array.isArray(t)}function DT(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function bc(t){return typeof t>"u"}function ho(t,e){return e&&bc(t)?!0:typeof t=="string"&&!!t.trim().length}function ZJ(t,e){return typeof t=="number"&&!isNaN(t)}function oCt(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let a=!0;return Ww(i,n)?(n.forEach(o=>{const{accounts:s,methods:l,events:c}=t.namespaces[o],u=PS(s),f=r[o];(!Ww(K4e(o,f),u)||!Ww(f.methods,l)||!Ww(f.events,c))&&(a=!1)}),a):!1}function fN(t){return ho(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function sCt(t){if(ho(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&fN(r)}}return!1}function lCt(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(ho(t,!1)){if(e(t))return!0;const r=rAe(t);return e(r)}}catch{}return!1}function cCt(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function uCt(t){return t==null?void 0:t.topic}function fCt(t,e){let r=null;return ho(t==null?void 0:t.publicKey,!1)||(r=Ot("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function bfe(t){let e=!0;return Zb(t)?t.length&&(e=t.every(r=>ho(r,!1))):e=!1,e}function dCt(t,e,r){let n=null;return Zb(e)&&e.length?e.forEach(i=>{n||fN(i)||(n=$i("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):fN(t)||(n=$i("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function hCt(t,e,r){let n=null;return Object.entries(t).forEach(([i,a])=>{if(n)return;const o=dCt(i,K4e(i,a),`${e} ${r}`);o&&(n=o)}),n}function pCt(t,e){let r=null;return Zb(t)?t.forEach(n=>{r||sCt(n)||(r=$i("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=$i("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function gCt(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=pCt(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function vCt(t,e){let r=null;return bfe(t==null?void 0:t.methods)?bfe(t==null?void 0:t.events)||(r=$i("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=$i("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function GAe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=vCt(n,`${e}, namespace`);i&&(r=i)}),r}function mCt(t,e,r){let n=null;if(t&&DT(t)){const i=GAe(t,e);i&&(n=i);const a=hCt(t,e,r);a&&(n=a)}else n=Ot("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function yz(t,e){let r=null;if(t&&DT(t)){const n=GAe(t,e);n&&(r=n);const i=gCt(t,e);i&&(r=i)}else r=Ot("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function WAe(t){return ho(t.protocol,!0)}function yCt(t,e){let r=!1;return t?t&&Zb(t)&&t.length&&t.forEach(n=>{r=WAe(n)}):r=!0,r}function wCt(t){return typeof t=="number"}function hc(t){return typeof t<"u"&&typeof t!==null}function bCt(t){return!(!t||typeof t!="object"||!t.code||!ZJ(t.code)||!t.message||!ho(t.message,!1))}function xCt(t){return!(bc(t)||!ho(t.method,!1))}function _Ct(t){return!(bc(t)||bc(t.result)&&bc(t.error)||!ZJ(t.id)||!ho(t.jsonrpc,!1))}function SCt(t){return!(bc(t)||!ho(t.name,!1))}function xfe(t,e){return!(!fN(e)||!eCt(t).includes(e))}function CCt(t,e,r){return ho(r,!1)?tCt(t,e).includes(r):!1}function ACt(t,e,r){return ho(r,!1)?rCt(t,e).includes(r):!1}function _fe(t,e,r){let n=null;const i=TCt(t),a=ECt(e),o=Object.keys(i),s=Object.keys(a),l=Sfe(Object.keys(t)),c=Sfe(Object.keys(e)),u=l.filter(f=>!c.includes(f));return u.length&&(n=Ot("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. - Required: ${u.toString()} - Received: ${Object.keys(e).toString()}`)),Ww(o,s)||(n=Ot("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. - Required: ${o.toString()} - Approved: ${s.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const d=PS(e[f].accounts);d.includes(f)||(n=Ot("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} - Required: ${f} - Approved: ${d.toString()}`))}),o.forEach(f=>{n||(Ww(i[f].methods,a[f].methods)?Ww(i[f].events,a[f].events)||(n=Ot("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=Ot("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function TCt(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function Sfe(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function ECt(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=PS(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(a=>a.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function ICt(t,e){return ZJ(t)&&t<=e.max&&t>=e.min}function Cfe(){const t=T8();return new Promise(e=>{switch(t){case cu.browser:e(kCt());break;case cu.reactNative:e(PCt());break;case cu.node:e(RCt());break;default:e(!0)}})}function kCt(){return A8()&&(navigator==null?void 0:navigator.onLine)}async function PCt(){if(AS()&&typeof Ra<"u"&&Ra!=null&&Ra.NetInfo){const t=await(Ra==null?void 0:Ra.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function RCt(){return!0}function MCt(t){switch(T8()){case cu.browser:DCt(t);break;case cu.reactNative:NCt(t);break}}function DCt(t){!AS()&&A8()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function NCt(t){AS()&&typeof Ra<"u"&&Ra!=null&&Ra.NetInfo&&(Ra==null||Ra.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const wz={};class ZC{static get(e){return wz[e]}static set(e,r){wz[e]=r}static delete(e){delete wz[e]}}const OCt="PARSE_ERROR",LCt="INVALID_REQUEST",$Ct="METHOD_NOT_FOUND",BCt="INVALID_PARAMS",qAe="INTERNAL_ERROR",QJ="SERVER_ERROR",FCt=[-32700,-32600,-32601,-32602,-32603],qA={[OCt]:{code:-32700,message:"Parse error"},[LCt]:{code:-32600,message:"Invalid Request"},[$Ct]:{code:-32601,message:"Method not found"},[BCt]:{code:-32602,message:"Invalid params"},[qAe]:{code:-32603,message:"Internal error"},[QJ]:{code:-32e3,message:"Server error"}},YAe=QJ;function jCt(t){return FCt.includes(t)}function Afe(t){return Object.keys(qA).includes(t)?qA[t]:qA[YAe]}function UCt(t){const e=Object.values(qA).find(r=>r.code===t);return e||qA[YAe]}function KAe(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var ZAe={},Z0={},Tfe;function zCt(){if(Tfe)return Z0;Tfe=1;var t={};Object.defineProperty(Z0,"__esModule",{value:!0}),Z0.isBrowserCryptoAvailable=Z0.getSubtleCrypto=Z0.getBrowerCrypto=void 0;function e(){return(t==null?void 0:t.crypto)||(t==null?void 0:t.msCrypto)||{}}Z0.getBrowerCrypto=e;function r(){const i=e();return i.subtle||i.webkitSubtle}Z0.getSubtleCrypto=r;function n(){return!!e()&&!!r()}return Z0.isBrowserCryptoAvailable=n,Z0}var Q0={},Efe;function HCt(){if(Efe)return Q0;Efe=1,Object.defineProperty(Q0,"__esModule",{value:!0}),Q0.isBrowser=Q0.isNode=Q0.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Q0.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Q0.isNode=e;function r(){return!t()&&!e()}return Q0.isBrowser=r,Q0}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=y8;e.__exportStar(zCt(),t),e.__exportStar(HCt(),t)})(ZAe);function vm(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function qw(t=6){return BigInt(vm(t))}function Vm(t,e,r){return{id:r||vm(),jsonrpc:"2.0",method:t,params:e}}function y$(t,e){return{id:t,jsonrpc:"2.0",result:e}}function w$(t,e,r){return{id:t,jsonrpc:"2.0",error:VCt(e)}}function VCt(t,e){return typeof t>"u"?Afe(qAe):(typeof t=="string"&&(t=Object.assign(Object.assign({},Afe(QJ)),{message:t})),jCt(t.code)&&(t=UCt(t.code)),t)}let GCt=class{},WCt=class extends GCt{constructor(){super()}},qCt=class extends WCt{constructor(e){super()}};const YCt="^https?:",KCt="^wss?:";function ZCt(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function QAe(t,e){const r=ZCt(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Ife(t){return QAe(t,YCt)}function kfe(t){return QAe(t,KCt)}function QCt(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function XAe(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function XJ(t){return XAe(t)&&"method"in t}function b$(t){return XAe(t)&&(lp(t)||xf(t))}function lp(t){return"result"in t}function xf(t){return"error"in t}let Th=class extends qCt{constructor(e){super(e),this.events=new td.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Vm(e.method,e.params||[],e.id||qw().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{xf(a)?i(a.error):n(a.result)});try{await this.connection.send(e,r)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),b$(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var YA={};const XCt=()=>typeof WebSocket<"u"?WebSocket:typeof YA<"u"&&typeof YA.WebSocket<"u"?YA.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),JCt=()=>typeof WebSocket<"u"||typeof YA<"u"&&typeof YA.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Pfe=t=>t.split("?")[0],Rfe=10,e4t=XCt();let t4t=class{constructor(e){if(this.url=e,this.events=new td.EventEmitter,this.registering=!1,!kfe(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Yg(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!kfe(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),a=ZAe.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!QCt(e)},o=new e4t(e,[],a);JCt()?o.onerror=s=>{const l=s;n(this.emitError(l.error))}:o.on("error",s=>{n(this.emitError(s))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Ob(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=w$(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return KAe(e,Pfe(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Rfe&&this.events.setMaxListeners(Rfe)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${Pfe(this.url)}`));return this.events.emit("register_error",r),r}};var dN={exports:{}};dN.exports;(function(t,e){var r={},n=200,i="__lodash_hash_undefined__",a=1,o=2,s=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",g="[object GeneratorFunction]",v="[object Map]",y="[object Number]",m="[object Null]",b="[object Object]",w="[object Promise]",C="[object Proxy]",A="[object RegExp]",S="[object Set]",I="[object String]",D="[object Symbol]",L="[object Undefined]",O="[object WeakMap]",P="[object ArrayBuffer]",x="[object DataView]",T="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",F="[object Int16Array]",B="[object Int32Array]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",$="[object Uint16Array]",H="[object Uint32Array]",Y=/[\\^$.*+?()[\]{}|]/g,ie=/^\[object .+?Constructor\]$/,W=/^(?:0|[1-9]\d*)$/,Q={};Q[T]=Q[E]=Q[N]=Q[F]=Q[B]=Q[j]=Q[k]=Q[$]=Q[H]=!0,Q[l]=Q[c]=Q[P]=Q[f]=Q[x]=Q[d]=Q[h]=Q[p]=Q[v]=Q[y]=Q[b]=Q[A]=Q[S]=Q[I]=Q[O]=!1;var J=typeof r=="object"&&r&&r.Object===Object&&r,ee=typeof self=="object"&&self&&self.Object===Object&&self,ne=J||ee||Function("return this")(),V=e&&!e.nodeType&&e,oe=V&&!0&&t&&!t.nodeType&&t,ye=oe&&oe.exports===V,Te=ye&&J.process,Me=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),Oe=Me&&Me.isTypedArray;function nt(be,$e){for(var vt=-1,nr=be==null?0:be.length,Ui=0,pn=[];++vt-1}function ut(be,$e){var vt=this.__data__,nr=bl(vt,be);return nr<0?(++this.size,vt.push([be,$e])):vt[nr][1]=$e,this}ge.prototype.clear=Ue,ge.prototype.delete=tt,ge.prototype.get=Qe,ge.prototype.has=Ne,ge.prototype.set=ut;function Lt(be){var $e=-1,vt=be==null?0:be.length;for(this.clear();++$eYn))return!1;var gi=pn.get(be);if(gi&&pn.get($e))return gi==$e;var Hs=-1,_l=!0,Ti=vt&o?new zn:void 0;for(pn.set(be,$e),pn.set($e,be);++Hs-1&&be%1==0&&be<$e}function M9(be){var $e=typeof be;return $e=="string"||$e=="number"||$e=="symbol"||$e=="boolean"?be!=="__proto__":be===null}function D9(be){return!!_e&&_e in be}function mF(be){var $e=be&&be.constructor,vt=typeof $e=="function"&&$e.prototype||z;return be===vt}function yF(be){return Ee.call(be)}function L0(be){if(be!=null){try{return re.call(be)}catch{}try{return be+""}catch{}}return""}function sC(be,$e){return be===$e||be!==be&&$e!==$e}var wF=$h(function(){return arguments}())?$h:function(be){return Ey(be)&&ue.call(be,"callee")&&!Pt.call(be,"callee")},_x=Array.isArray;function bF(be){return be!=null&&O9(be.length)&&!N9(be)}var lC=Ir||xF;function cC(be,$e){return Bh(be,$e)}function N9(be){if(!L9(be))return!1;var $e=xl(be);return $e==p||$e==g||$e==u||$e==C}function O9(be){return typeof be=="number"&&be>-1&&be%1==0&&be<=s}function L9(be){var $e=typeof be;return be!=null&&($e=="object"||$e=="function")}function Ey(be){return be!=null&&typeof be=="object"}var $9=Oe?Ce(Oe):Rv;function ji(be){return bF(be)?no(be):N0(be)}function Li(){return[]}function xF(){return!1}t.exports=cC})(dN,dN.exports);var r4t=dN.exports;const n4t=Un(r4t),JAe="wc",e6e=2,JJ="core",n0=`${JAe}@2:${JJ}:`,i4t={name:JJ,logger:"error"},a4t={database:":memory:"},o4t="crypto",Mfe="client_ed25519_seed",s4t=Ft.ONE_DAY,l4t="keychain",c4t="0.3",u4t="messages",f4t="0.3",d4t=Ft.SIX_HOURS,h4t="publisher",t6e="irn",p4t="error",r6e="wss://relay.walletconnect.org",g4t="relayer",Ll={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},v4t="_subscription",Xu={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},m4t=.1,rY="2.17.0",Vi={link_mode:"link_mode",relay:"relay"},y4t="0.3",w4t="WALLETCONNECT_CLIENT_ID",Dfe="WALLETCONNECT_LINK_MODE_APPS",cp={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},b4t="subscription",x4t="0.3",_4t=Ft.FIVE_SECONDS*1e3,S4t="pairing",C4t="0.3",QC={wc_pairingDelete:{req:{ttl:Ft.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ft.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ft.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ft.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ft.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ft.ONE_DAY,prompt:!1,tag:0}}},Dw={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Td={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},A4t="history",T4t="0.3",E4t="expirer",hf={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},I4t="0.3",k4t="verify-api",P4t="https://verify.walletconnect.com",n6e="https://verify.walletconnect.org",KA=n6e,R4t=`${KA}/v3`,M4t=[P4t,n6e],D4t="echo",N4t="https://echo.walletconnect.com",rp={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},lg={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Ed={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Uy={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},zy={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},XC={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},O4t=.1,L4t="event-client",$4t=86400,B4t="https://pulse.walletconnect.org/batch";function F4t(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,w=new Uint8Array(b);y!==m;){for(var C=p[y],A=0,S=b-1;(C!==0||A>>0,w[S]=C%s>>>0,C=C/s>>>0;if(C!==0)throw new Error("Non-zero carry");v=A,y++}for(var I=b-v;I!==b&&w[I]===0;)I++;for(var D=l.repeat(g);I>>0,b=new Uint8Array(m);p[g];){var w=r[p.charCodeAt(g)];if(w===255)return;for(var C=0,A=m-1;(w!==0||C>>0,b[A]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");y=C,g++}if(p[g]!==" "){for(var S=m-y;S!==m&&b[S]===0;)S++;for(var I=new Uint8Array(v+(m-S)),D=v;S!==m;)I[D++]=b[S++];return I}}}function h(p){var g=d(p);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var j4t=F4t,U4t=j4t;const i6e=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},z4t=t=>new TextEncoder().encode(t),H4t=t=>new TextDecoder().decode(t);class V4t{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class G4t{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return a6e(this,e)}}class W4t{constructor(e){this.decoders=e}or(e){return a6e(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const a6e=(t,e)=>new W4t({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class q4t{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new V4t(e,r,n),this.decoder=new G4t(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const x$=({name:t,prefix:e,encode:r,decode:n})=>new q4t(t,e,r,n),P8=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=U4t(r,e);return x$({prefix:t,name:e,encode:n,decode:a=>i6e(i(a))})},Y4t=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(s-=8,o[c++]=255&l>>s)}if(s>=r||255&l<<8-s)throw new SyntaxError("Unexpected end of data");return o},K4t=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<x$({prefix:e,name:t,encode(i){return K4t(i,n,r)},decode(i){return Y4t(i,n,r,t)}}),Z4t=x$({prefix:"\0",name:"identity",encode:t=>H4t(t),decode:t=>z4t(t)});var Q4t=Object.freeze({__proto__:null,identity:Z4t});const X4t=Bs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var J4t=Object.freeze({__proto__:null,base2:X4t});const eAt=Bs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var tAt=Object.freeze({__proto__:null,base8:eAt});const rAt=P8({prefix:"9",name:"base10",alphabet:"0123456789"});var nAt=Object.freeze({__proto__:null,base10:rAt});const iAt=Bs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),aAt=Bs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var oAt=Object.freeze({__proto__:null,base16:iAt,base16upper:aAt});const sAt=Bs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),lAt=Bs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cAt=Bs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),uAt=Bs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),fAt=Bs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dAt=Bs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),hAt=Bs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),pAt=Bs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),gAt=Bs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var vAt=Object.freeze({__proto__:null,base32:sAt,base32upper:lAt,base32pad:cAt,base32padupper:uAt,base32hex:fAt,base32hexupper:dAt,base32hexpad:hAt,base32hexpadupper:pAt,base32z:gAt});const mAt=P8({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),yAt=P8({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var wAt=Object.freeze({__proto__:null,base36:mAt,base36upper:yAt});const bAt=P8({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),xAt=P8({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var _At=Object.freeze({__proto__:null,base58btc:bAt,base58flickr:xAt});const SAt=Bs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),CAt=Bs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),AAt=Bs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TAt=Bs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var EAt=Object.freeze({__proto__:null,base64:SAt,base64pad:CAt,base64url:AAt,base64urlpad:TAt});const o6e=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),IAt=o6e.reduce((t,e,r)=>(t[r]=e,t),[]),kAt=o6e.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function PAt(t){return t.reduce((e,r)=>(e+=IAt[r],e),"")}function RAt(t){const e=[];for(const r of t){const n=kAt[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const MAt=x$({prefix:"🚀",name:"base256emoji",encode:PAt,decode:RAt});var DAt=Object.freeze({__proto__:null,base256emoji:MAt}),NAt=s6e,Nfe=128,OAt=127,LAt=~OAt,$At=Math.pow(2,31);function s6e(t,e,r){e=e||[],r=r||0;for(var n=r;t>=$At;)e[r++]=t&255|Nfe,t/=128;for(;t&LAt;)e[r++]=t&255|Nfe,t>>>=7;return e[r]=t|0,s6e.bytes=r-n+1,e}var BAt=nY,FAt=128,Ofe=127;function nY(t,n){var r=0,n=n||0,i=0,a=n,o,s=t.length;do{if(a>=s)throw nY.bytes=0,new RangeError("Could not decode varint");o=t[a++],r+=i<28?(o&Ofe)<=FAt);return nY.bytes=a-n,r}var jAt=Math.pow(2,7),UAt=Math.pow(2,14),zAt=Math.pow(2,21),HAt=Math.pow(2,28),VAt=Math.pow(2,35),GAt=Math.pow(2,42),WAt=Math.pow(2,49),qAt=Math.pow(2,56),YAt=Math.pow(2,63),KAt=function(t){return t(l6e.encode(t,e,r),e),$fe=t=>l6e.encodingLength(t),iY=(t,e)=>{const r=e.byteLength,n=$fe(t),i=n+$fe(r),a=new Uint8Array(i+r);return Lfe(t,a,0),Lfe(r,a,n),a.set(e,i),new QAt(t,r,e,a)};class QAt{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const c6e=({name:t,code:e,encode:r})=>new XAt(t,e,r);class XAt{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?iY(this.code,r):r.then(n=>iY(this.code,n))}else throw Error("Unknown type, must be binary type")}}const u6e=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),JAt=c6e({name:"sha2-256",code:18,encode:u6e("SHA-256")}),e6t=c6e({name:"sha2-512",code:19,encode:u6e("SHA-512")});var t6t=Object.freeze({__proto__:null,sha256:JAt,sha512:e6t});const f6e=0,r6t="identity",d6e=i6e,n6t=t=>iY(f6e,d6e(t)),i6t={code:f6e,name:r6t,encode:d6e,digest:n6t};var a6t=Object.freeze({__proto__:null,identity:i6t});new TextEncoder,new TextDecoder;const Bfe={...Q4t,...J4t,...tAt,...nAt,...oAt,...vAt,...wAt,..._At,...EAt,...DAt};({...t6t,...a6t});function o6t(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function h6e(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Ffe=h6e("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),bz=h6e("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=o6t(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:a}=Ot("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=vl(r,this.name)}get context(){return Uc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,X4e(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?J4e(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}}let u6t=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=o4t,this.randomSessionIdentifier=eY(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),a=gue(i);return h4e(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=DSt();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),o=gue(a),s=this.randomSessionIdentifier;return await pbt(s,i,s4t,o)},this.generateSharedKey=(i,a,o)=>{this.isInitialized();const s=this.getPrivateKey(i),l=NSt(s,a);return this.setSymKey(l,o)},this.setSymKey=async(i,a)=>{this.isInitialized();const o=a||ZR(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,a,o)=>{this.isInitialized();const s=VAe(o),l=Yg(a);if(hfe(s))return LSt(l,o==null?void 0:o.encoding);if(dfe(s)){const d=s.senderPublicKey,h=s.receiverPublicKey;i=await this.generateSharedKey(d,h)}const c=this.getSymKey(i),{type:u,senderPublicKey:f}=s;return OSt({type:u,symKey:c,message:l,senderPublicKey:f,encoding:o==null?void 0:o.encoding})},this.decode=async(i,a,o)=>{this.isInitialized();const s=FSt(a,o);if(hfe(s)){const l=BSt(a,o==null?void 0:o.encoding);return Ob(l)}if(dfe(s)){const l=s.receiverPublicKey,c=s.senderPublicKey;i=await this.generateSharedKey(l,c)}try{const l=this.getSymKey(i),c=$St({symKey:l,encoded:a,encoding:o==null?void 0:o.encoding});return Ob(c)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=(i,a=Hm)=>{const o=MT({encoded:i,encoding:a});return Kb(o.type)},this.getPayloadSenderPublicKey=(i,a=Hm)=>{const o=MT({encoded:i,encoding:a});return o.senderPublicKey?ss(o.senderPublicKey,jl):void 0},this.core=e,this.logger=vl(r,this.name),this.keychain=n||new c6t(this.core,this.logger)}get context(){return Uc(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Mfe)}catch{e=eY(),await this.keychain.set(Mfe,e)}return l6t(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}};class f6t extends wyt{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=u4t,this.version=f4t,this.initialized=!1,this.storagePrefix=n0,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const a=gg(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[a]<"u"||(o[a]=i,this.messages.set(n,o),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),o=gg(i);return typeof a[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=vl(e,this.name),this.core=r}get context(){return Uc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,X4e(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?J4e(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}}class d6t extends byt{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new td.EventEmitter,this.name=h4t,this.queue=new Map,this.publishTimeout=Ft.toMiliseconds(Ft.ONE_MINUTE),this.failedPublishTimeout=Ft.toMiliseconds(Ft.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});const s=(a==null?void 0:a.ttl)||d4t,l=tY(a),c=(a==null?void 0:a.prompt)||!1,u=(a==null?void 0:a.tag)||0,f=(a==null?void 0:a.id)||qw().toString(),d={topic:n,message:i,opts:{ttl:s,relay:l,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}},h=`Failed to publish payload, please try again. id:${f} tag:${u}`,p=Date.now();let g,v=1;try{for(;g===void 0;){if(Date.now()-p>this.publishTimeout)throw new Error(h);this.logger.trace({id:f,attempts:v},`publisher.publish - attempt ${v}`),g=await await m3(this.rpcPublish(n,i,s,l,c,u,f,a==null?void 0:a.attestation).catch(y=>this.logger.warn(y)),this.publishTimeout,h),v++,g||await new Promise(y=>setTimeout(y,this.failedPublishTimeout))}this.relayer.events.emit(Ll.publish,d),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:a}})}catch(y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(y),(o=a==null?void 0:a.internal)!=null&&o.throwOnFailedPublish)throw y;this.queue.set(f,d)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=vl(r,this.name),this.registerEventListeners()}get context(){return Uc(this.logger)}rpcPublish(e,r,n,i,a,o,s,l){var c,u,f,d;const h={method:sA(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:a,tag:o,attestation:l},id:s};return bc((c=h.params)==null?void 0:c.prompt)&&((u=h.params)==null||delete u.prompt),bc((f=h.params)==null?void 0:f.tag)&&((d=h.params)==null||delete d.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.request(h)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(mS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ll.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ll.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class h6t{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(a=>a!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var p6t=Object.defineProperty,g6t=Object.defineProperties,v6t=Object.getOwnPropertyDescriptors,jfe=Object.getOwnPropertySymbols,m6t=Object.prototype.hasOwnProperty,y6t=Object.prototype.propertyIsEnumerable,Ufe=(t,e,r)=>e in t?p6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,JC=(t,e)=>{for(var r in e||(e={}))m6t.call(e,r)&&Ufe(t,r,e[r]);if(jfe)for(var r of jfe(e))y6t.call(e,r)&&Ufe(t,r,e[r]);return t},xz=(t,e)=>g6t(t,v6t(e));class w6t extends Syt{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new h6t,this.events=new td.EventEmitter,this.name=b4t,this.version=x4t,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=n0,this.subscribeTimeout=Ft.toMiliseconds(Ft.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const a=tY(i),o={topic:n,relay:a,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const s=await this.rpcSubscribe(n,a,i==null?void 0:i.transportType);return typeof s=="string"&&(this.onSubscribe(s,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),s}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,o)=>{const s=new Ft.Watch;s.start(i);const l=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(l),s.stop(i),a(!0)),s.elapsed(i)>=_4t&&(clearInterval(l),s.stop(i),o(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=vl(r,this.name),this.clientId=""}get context(){return Uc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=tY(n);await this.rpcUnsubscribe(e,r,i);const a=$i("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n=Vi.relay){n===Vi.relay&&await this.restartToComplete();const i={method:sA(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{const a=gg(e+this.clientId);return n===Vi.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(o=>this.logger.warn(o))},Ft.toMiliseconds(Ft.ONE_SECOND)),a):await await m3(this.relayer.request(i).catch(o=>this.logger.warn(o)),this.subscribeTimeout)?a:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ll.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:sA(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await m3(this.relayer.request(n).catch(i=>this.logger.warn(i)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ll.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:sA(r.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await m3(this.relayer.request(n).catch(a=>this.logger.warn(a)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ll.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:sA(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,xz(JC({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,JC({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,JC({},r)),this.topicMap.set(r.topic,e),this.events.emit(cp.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=Ot("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(cp.deleted,xz(JC({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(cp.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=Ot("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Zb(r)&&this.onBatchSubscribe(r.map((n,i)=>xz(JC({},e[i]),{id:n})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(mS.pulse,async()=>{await this.checkPending()}),this.events.on(cp.created,async e=>{const r=cp.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(cp.deleted,async e=>{const r=cp.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var b6t=Object.defineProperty,zfe=Object.getOwnPropertySymbols,x6t=Object.prototype.hasOwnProperty,_6t=Object.prototype.propertyIsEnumerable,Hfe=(t,e,r)=>e in t?b6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S6t=(t,e)=>{for(var r in e||(e={}))x6t.call(e,r)&&Hfe(t,r,e[r]);if(zfe)for(var r of zfe(e))_6t.call(e,r)&&Hfe(t,r,e[r]);return t};class C6t extends xyt{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new td.EventEmitter,this.name=g4t,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=Ft.toMiliseconds(Ft.THIRTY_SECONDS+Ft.ONE_SECOND),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const a=r.id||qw().toString();await this.toEstablishConnection();try{const o=this.provider.request(r);this.requestsInFlight.set(a,{promise:o,request:r}),this.logger.trace({id:a,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - attempt to publish...");const s=await new Promise(async(l,c)=>{const u=()=>{c(new Error(`relayer.request - publish interrupted, id: ${a}`))};this.provider.on(Xu.disconnect,u);const f=await o;this.provider.off(Xu.disconnect,u),l(f)});return this.logger.trace({id:a,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - published"),s}catch(o){throw this.logger.debug(`Failed to Publish Request: ${a}`),o}finally{this.requestsInFlight.delete(a)}},this.resetPingTimeout=()=>{if(aN())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Ll.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ll.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Xu.payload,this.onPayloadHandler),this.provider.on(Xu.connect,this.onConnectHandler),this.provider.on(Xu.disconnect,this.onDisconnectHandler),this.provider.on(Xu.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?vl(e.logger,this.name):a8(dS({level:e.logger||p4t})),this.messages=new f6t(this.logger,e.core),this.subscriber=new w6t(this,this.logger),this.publisher=new d6t(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||r6e,this.projectId=e.projectId,this.bundleId=S_t(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return Uc(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:Vi.relay})}async subscribe(e,r){var n;this.isInitialized(),(r==null?void 0:r.transportType)==="relay"&&await this.toEstablishConnection();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"",a;const o=s=>{s.topic===e&&(this.subscriber.off(cp.created,o),a())};return await Promise.all([new Promise(s=>{a=s,this.subscriber.on(cp.created,o)}),new Promise(async s=>{i=await this.subscriber.subscribe(e,r)||i,s()})]),i}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await m3(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,n)=>{const i=()=>{this.provider.off(Xu.disconnect,i),n(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Xu.disconnect,i),await m3(this.provider.connect(),Ft.toMiliseconds(Ft.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{n(a)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(a=>{this.logger.error(a),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const n=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(n.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Cfe())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=Mo(Ft.FIVE_MINUTES),a={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,a)}this.events.emit(Ll.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,r,n,i,a;if(aN())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((a=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||a.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Th(new t4t(E_t({sdkVersion:rY,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),XJ(e)){if(!e.method.endsWith(v4t))return;const r=e.params,{topic:n,message:i,publishedAt:a,attestation:o}=r.data,s={topic:n,message:i,publishedAt:a,transportType:Vi.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(S6t({type:"event",event:r.id},s)),this.events.emit(r.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else b$(e)&&this.events.emit(Ll.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ll.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=y$(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Xu.payload,this.onPayloadHandler),this.provider.off(Xu.connect,this.onConnectHandler),this.provider.off(Xu.disconnect,this.onDisconnectHandler),this.provider.off(Xu.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Cfe();MCt(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Ll.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Ft.toMiliseconds(m4t))))}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var A6t=Object.defineProperty,Vfe=Object.getOwnPropertySymbols,T6t=Object.prototype.hasOwnProperty,E6t=Object.prototype.propertyIsEnumerable,Gfe=(t,e,r)=>e in t?A6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wfe=(t,e)=>{for(var r in e||(e={}))T6t.call(e,r)&&Gfe(t,r,e[r]);if(Vfe)for(var r of Vfe(e))E6t.call(e,r)&&Gfe(t,r,e[r]);return t};class J2 extends _yt{constructor(e,r,n,i=n0,a=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=y4t,this.cached=[],this.initialized=!1,this.storagePrefix=n0,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!bc(o)?this.map.set(this.getKey(o),o):cCt(o)?this.map.set(o.id,o):uCt(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,s)=>{this.isInitialized(),this.map.has(o)?await this.update(o,s):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:s}),this.map.set(o,s),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(s=>Object.keys(o).every(l=>n4t(s[l],o[l]))):this.values),this.update=async(o,s)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:s});const l=Wfe(Wfe({},this.getData(o)),s);this.map.set(o,l),await this.persist()},this.delete=async(o,s)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:s}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=vl(r,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Uc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=Ot("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=Ot("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=Ot("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}}class I6t{constructor(e,r){this.core=e,this.logger=r,this.name=S4t,this.version=C4t,this.events=new TJ,this.initialized=!1,this.storagePrefix=n0,this.ignoredPayloadTypes=[Rg],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=eY(),a=await this.core.crypto.setSymKey(i),o=Mo(Ft.FIVE_MINUTES),s={protocol:t6e},l={topic:a,expiry:o,relay:s,active:!1,methods:n==null?void 0:n.methods},c=yfe({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:i,relay:s,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(Dw.create,l),this.core.expirer.set(a,o),await this.pairings.set(a,l),await this.core.relayer.subscribe(a,{transportType:n==null?void 0:n.transportType}),{topic:a,uri:c}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[rp.pairing_started]}});this.isValidPair(n,i);const{topic:a,symKey:o,relay:s,expiryTimestamp:l,methods:c}=mfe(n.uri);i.props.properties.topic=a,i.addTrace(rp.pairing_uri_validation_success),i.addTrace(rp.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(a)){if(u=this.pairings.get(a),i.addTrace(rp.existing_pairing),u.active)throw i.setError(lg.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);i.addTrace(rp.pairing_not_expired)}const f=l||Mo(Ft.FIVE_MINUTES),d={topic:a,relay:s,expiry:f,active:!1,methods:c};this.core.expirer.set(a,f),await this.pairings.set(a,d),i.addTrace(rp.store_new_pairing),n.activatePairing&&await this.activate({topic:a}),this.events.emit(Dw.create,d),i.addTrace(rp.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(o,a),i.addTrace(rp.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(lg.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:s})}catch(h){throw i.setError(lg.subscribe_pairing_topic_failure),h}return i.addTrace(rp.subscribe_pairing_topic_success),d},this.activate=async({topic:n})=>{this.isInitialized();const i=Mo(Ft.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:s,reject:l}=Tw();this.events.once(Vn("pairing_ping",a),({error:c})=>{c?l(c):s()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",$i("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:a,expiry:o,methods:s}=n,l=this.core.crypto.keychain.get(i);return yfe({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:a,expiryTimestamp:o,methods:s})},this.sendRequest=async(n,i,a)=>{const o=Vm(i,a),s=await this.core.crypto.encode(n,o),l=QC[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,s,l),o.id},this.sendResult=async(n,i,a)=>{const o=y$(n,a),s=await this.core.crypto.encode(i,o),l=await this.core.history.get(i,n),c=QC[l.request.method].res;await this.core.relayer.publish(i,s,c),await this.core.history.resolve(o)},this.sendError=async(n,i,a)=>{const o=w$(n,a),s=await this.core.crypto.encode(i,o),l=await this.core.history.get(i,n),c=QC[l.request.method]?QC[l.request.method].res:QC.unregistered_method.res;await this.core.relayer.publish(i,s,c),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,$i("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>pm(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,o=(await this.core.history.get(i,a.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(Dw.ping,{id:a,topic:n})}catch(o){await this.sendError(a,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{lp(i)?this.events.emit(Vn("pairing_ping",a),{}):xf(i)&&this.events.emit(Vn("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Dw.delete,{id:a,topic:n})}catch(o){await this.sendError(a,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:o}=i;try{if(this.registeredMethods.includes(o))return;const s=$i("WC_METHOD_UNSUPPORTED",o);await this.sendError(a,n,s),this.logger.error(s)}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error($i("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var a;if(!hc(n)){const{message:s}=Ot("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(lg.malformed_pairing_uri),new Error(s)}if(!lCt(n.uri)){const{message:s}=Ot("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(lg.malformed_pairing_uri),new Error(s)}const o=mfe(n==null?void 0:n.uri);if(!((a=o==null?void 0:o.relay)!=null&&a.protocol)){const{message:s}=Ot("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(lg.malformed_pairing_uri),new Error(s)}if(!(o!=null&&o.symKey)){const{message:s}=Ot("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(lg.malformed_pairing_uri),new Error(s)}if(o!=null&&o.expiryTimestamp&&Ft.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!hc(n)){const{message:a}=Ot("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!hc(n)){const{message:a}=Ot("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!ho(n,!1)){const{message:i}=Ot("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=Ot("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(pm(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=Ot("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=vl(r,this.name),this.pairings=new J2(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Uc(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ll.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===Vi.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const a=await this.core.crypto.decode(r,n);try{XJ(a)?(this.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a})):b$(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.core.history.delete(r,a.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(hf.expired,async e=>{const{topic:r}=tAe(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Dw.expire,{topic:r}))})}}class k6t extends yyt{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new td.EventEmitter,this.name=A4t,this.version=T4t,this.cached=[],this.initialized=!1,this.storagePrefix=n0,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Mo(Ft.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Td.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=xf(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Td.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(Td.deleted,a)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=vl(r,this.name)}get context(){return Uc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Vm(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=Ot("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Td.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Ot("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Td.created,e=>{const r=Td.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Td.updated,e=>{const r=Td.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Td.deleted,e=>{const r=Td.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(mS.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{Ft.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Td.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}}class P6t extends Cyt{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new td.EventEmitter,this.name=E4t,this.version=I4t,this.cached=[],this.initialized=!1,this.storagePrefix=n0,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const a=this.formatTarget(n),o={target:a,expiry:i};this.expirations.set(a,o),this.checkExpiry(a,o),this.events.emit(hf.created,{target:a,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(hf.deleted,{target:i,expiration:a})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=vl(r,this.name)}get context(){return Uc(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return I_t(e);if(typeof e=="number")return k_t(e);const{message:r}=Ot("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(hf.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Ot("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=Ot("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Ft.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(hf.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(mS.pulse,()=>this.checkExpirations()),this.events.on(hf.created,e=>{const r=hf.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(hf.expired,e=>{const r=hf.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(hf.deleted,e=>{const r=hf.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}}var pa={};Object.defineProperty(pa,"__esModule",{value:!0}),pa.getLocalStorage=pa.getLocalStorageOrThrow=pa.getCrypto=pa.getCryptoOrThrow=pa.getLocation=pa.getLocationOrThrow=pa.getNavigator=pa.getNavigatorOrThrow=p6e=pa.getDocument=pa.getDocumentOrThrow=pa.getFromWindowOrThrow=pa.getFromWindow=void 0;function ex(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}pa.getFromWindow=ex;function RS(t){const e=ex(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}pa.getFromWindowOrThrow=RS;function R6t(){return RS("document")}pa.getDocumentOrThrow=R6t;function M6t(){return ex("document")}var p6e=pa.getDocument=M6t;function D6t(){return RS("navigator")}pa.getNavigatorOrThrow=D6t;function N6t(){return ex("navigator")}pa.getNavigator=N6t;function O6t(){return RS("location")}pa.getLocationOrThrow=O6t;function L6t(){return ex("location")}pa.getLocation=L6t;function $6t(){return RS("crypto")}pa.getCryptoOrThrow=$6t;function B6t(){return ex("crypto")}pa.getCrypto=B6t;function F6t(){return RS("localStorage")}pa.getLocalStorageOrThrow=F6t;function j6t(){return ex("localStorage")}pa.getLocalStorage=j6t;class U6t extends Ayt{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=k4t,this.verifyUrlV3=R4t,this.storagePrefix=n0,this.version=e6e,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Ft.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!A8()||this.isDevEnv)return;const a=window.location.origin,{id:o,decryptedId:s}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${o}&decryptedId=${s}`;try{const c=p6e(),u=this.startAbortTimer(Ft.ONE_SECOND*5),f=await new Promise((d,h)=>{const p=()=>{window.removeEventListener("message",v),c.body.removeChild(g),h("attestation aborted")};this.abortController.signal.addEventListener("abort",p);const g=c.createElement("iframe");g.src=l,g.style.display="none",g.addEventListener("error",p,{signal:this.abortController.signal});const v=y=>{if(y.data&&typeof y.data=="string")try{const m=JSON.parse(y.data);if(m.type==="verify_attestation"){if(zq(m.attestation).payload.id!==o)return;clearInterval(u),c.body.removeChild(g),this.abortController.signal.removeEventListener("abort",p),window.removeEventListener("message",v),d(m.attestation===null?"":m.attestation)}}catch(m){this.logger.warn(m)}};c.body.appendChild(g),window.addEventListener("message",v,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}catch(c){this.logger.warn(c)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:a,hash:o,encryptedId:s}=i;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(zq(a).payload.id!==s)return;const c=await this.isValidJwtAttestation(a);if(c){if(!c.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return c}}if(!o)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,l)},this.fetchAttestation=async(i,a)=>{this.logger.debug(`resolving attestation: ${i} from url: ${a}`);const o=this.startAbortTimer(Ft.ONE_SECOND*5),s=await fetch(`${a}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),s.status===200?await s.json():void 0},this.getVerifyUrl=i=>{let a=i||KA;return M4t.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${KA}`),a=KA),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Ft.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await a.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(s){this.logger.error(s),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(s){this.logger.error(s),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),a(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,a)=>{const o=HSt(i,a.publicKey),s={hasExpired:Ft.toMiliseconds(o.exp)this.abortController.abort(),Ft.toMiliseconds(e))}}class z6t extends Tyt{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=D4t,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:o,enableEncrypted:s=!1}=n,l=`${N4t}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:a,always_raw:s})})},this.logger=vl(r,this.context)}}var H6t=Object.defineProperty,qfe=Object.getOwnPropertySymbols,V6t=Object.prototype.hasOwnProperty,G6t=Object.prototype.propertyIsEnumerable,Yfe=(t,e,r)=>e in t?H6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e4=(t,e)=>{for(var r in e||(e={}))V6t.call(e,r)&&Yfe(t,r,e[r]);if(qfe)for(var r of qfe(e))G6t.call(e,r)&&Yfe(t,r,e[r]);return t};class W6t extends Eyt{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=L4t,this.storagePrefix=n0,this.storageVersion=O4t,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!UJ())try{const i={eventId:Lue(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Q4e(this.core.relayer.protocol,this.core.relayer.version,rY)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:a="ERROR",type:o="",properties:{topic:s,trace:l}}=i,c=Lue(),u=this.core.projectId||"",f=Date.now(),d=e4({eventId:c,timestamp:f,props:{event:a,type:o,properties:{topic:s,trace:l}},bundleId:u,domain:this.getAppDomain()},this.setMethods(c));return this.telemetryEnabled&&(this.events.set(c,d),this.shouldPersist=!0),d},this.getEvent=i=>{const{eventId:a,topic:o}=i;if(a)return this.events.get(a);const s=Array.from(this.events.values()).find(l=>l.props.properties.topic===o);if(s)return e4(e4({},s),this.setMethods(s.eventId))},this.deleteEvent=i=>{const{eventId:a}=i;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(mS.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Ft.fromMiliseconds(Date.now())-Ft.fromMiliseconds(i.timestamp)>$4t&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:a=>this.addTrace(i,a),setError:a=>this.setError(i,a)}),this.addTrace=(i,a)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(a),this.events.set(i,o),this.shouldPersist=!0)},this.setError=(i,a)=>{const o=this.events.get(i);o&&(o.props.type=a,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(a=>{this.events.set(a.eventId,e4(e4({},a),this.setMethods(a.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[a,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const a of i)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async i=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${B4t}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${rY}${a}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>Z4e().url,this.logger=vl(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var q6t=Object.defineProperty,Kfe=Object.getOwnPropertySymbols,Y6t=Object.prototype.hasOwnProperty,K6t=Object.prototype.propertyIsEnumerable,Zfe=(t,e,r)=>e in t?q6t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qfe=(t,e)=>{for(var r in e||(e={}))Y6t.call(e,r)&&Zfe(t,r,e[r]);if(Kfe)for(var r of Kfe(e))K6t.call(e,r)&&Zfe(t,r,e[r]);return t};let Z6t=class g6e extends myt{constructor(e){var r;super(e),this.protocol=JAe,this.version=e6e,this.name=JJ,this.events=new td.EventEmitter,this.initialized=!1,this.on=(o,s)=>this.events.on(o,s),this.once=(o,s)=>this.events.once(o,s),this.off=(o,s)=>this.events.off(o,s),this.removeListener=(o,s)=>this.events.removeListener(o,s),this.dispatchEnvelope=({topic:o,message:s,sessionExists:l})=>{if(!o||!s)return;const c={topic:o,message:s,publishedAt:Date.now(),transportType:Vi.link_mode};this.relayer.onLinkMessageEvent(c,{sessionExists:l})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||r6e,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=dS({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:i4t.logger}),{logger:i,chunkLoggerController:a}=JX({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,s;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((s=this.logChunkController)==null||s.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=vl(i,this.name),this.heartbeat=new j1t,this.crypto=new u6t(this,this.logger,e==null?void 0:e.keychain),this.history=new k6t(this,this.logger),this.expirer=new P6t(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new vyt(Qfe(Qfe({},a4t),e==null?void 0:e.storageOptions)),this.relayer=new C6t({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new I6t(this,this.logger),this.verify=new U6t(this,this.logger,this.storage),this.echoClient=new z6t(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new W6t(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new g6e(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(w4t,n),r}get context(){return Uc(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(Dfe,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Dfe)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const Q6t=Z6t;var Id={};const v6e="wc",m6e=2,y6e="client",eee=`${v6e}@${m6e}:${y6e}:`,_z={name:y6e,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},Xfe="WALLETCONNECT_DEEPLINK_CHOICE",X6t="proposal",w6e="Proposal expired",J6t="session",Gx=Ft.SEVEN_DAYS,eTt="engine",Jo={wc_sessionPropose:{req:{ttl:Ft.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ft.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ft.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ft.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ft.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ft.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ft.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ft.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ft.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ft.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ft.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ft.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ft.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Ft.FIVE_MINUTES,prompt:!1,tag:1119}}},Sz={min:Ft.FIVE_MINUTES,max:Ft.SEVEN_DAYS},Yh={idle:"IDLE",active:"ACTIVE"},tTt="request",rTt=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],nTt="wc",iTt="auth",aTt="authKeys",oTt="pairingTopics",sTt="requests",_$=`${nTt}@${1.5}:${iTt}:`,QR=`${_$}:PUB_KEY`;var lTt=Object.defineProperty,cTt=Object.defineProperties,uTt=Object.getOwnPropertyDescriptors,Jfe=Object.getOwnPropertySymbols,fTt=Object.prototype.hasOwnProperty,dTt=Object.prototype.propertyIsEnumerable,ede=(t,e,r)=>e in t?lTt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qa=(t,e)=>{for(var r in e||(e={}))fTt.call(e,r)&&ede(t,r,e[r]);if(Jfe)for(var r of Jfe(e))dTt.call(e,r)&&ede(t,r,e[r]);return t},kd=(t,e)=>cTt(t,uTt(e));class hTt extends kyt{constructor(e){super(e),this.name=eTt,this.events=new TJ,this.initialized=!1,this.requestQueue={state:Yh.idle,queue:[]},this.sessionRequestQueue={state:Yh.idle,queue:[]},this.requestQueueDelay=Ft.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Jo)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ft.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=kd(qa({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:o,sessionProperties:s,relays:l}=n;let c=i,u,f=!1;try{c&&(f=this.client.core.pairing.pairings.get(c).active)}catch(w){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),w}if(!c||!f){const{topic:w,uri:C}=await this.client.core.pairing.create();c=w,u=C}if(!c){const{message:w}=Ot("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(w)}const d=await this.client.core.crypto.generateKeyPair(),h=Jo.wc_sessionPropose.req.ttl||Ft.FIVE_MINUTES,p=Mo(h),g=qa({requiredNamespaces:a,optionalNamespaces:o,relays:l??[{protocol:t6e}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:c},s&&{sessionProperties:s}),{reject:v,resolve:y,done:m}=Tw(h,w6e);this.events.once(Vn("session_connect"),async({error:w,session:C})=>{if(w)v(w);else if(C){C.self.publicKey=d;const A=kd(qa({},C),{pairingTopic:g.pairingTopic,requiredNamespaces:g.requiredNamespaces,optionalNamespaces:g.optionalNamespaces,transportType:Vi.relay});await this.client.session.set(C.topic,A),await this.setExpiry(C.topic,C.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:C.peer.metadata}),this.cleanupDuplicatePairings(A),y(A)}});const b=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:g,throwOnFailedPublish:!0});return await this.setProposal(b,qa({id:b},g)),{uri:u,approval:m}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,a;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[Ed.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(I){throw o.setError(Uy.no_internet_connection),I}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(I){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(Uy.proposal_not_found),I}try{await this.isValidApprove(r)}catch(I){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(Uy.session_approve_namespace_validation_failure),I}const{id:s,relayProtocol:l,namespaces:c,sessionProperties:u,sessionConfig:f}=r,d=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:h,proposer:p,requiredNamespaces:g,optionalNamespaces:v}=d;let y=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:h});y||(y=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:Ed.session_approve_started,properties:{topic:h,trace:[Ed.session_approve_started,Ed.session_namespaces_validation_success]}}));const m=await this.client.core.crypto.generateKeyPair(),b=p.publicKey,w=await this.client.core.crypto.generateSharedKey(m,b),C=qa(qa({relay:{protocol:l??"irn"},namespaces:c,controller:{publicKey:m,metadata:this.client.metadata},expiry:Mo(Gx)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),A=Vi.relay;y.addTrace(Ed.subscribing_session_topic);try{await this.client.core.relayer.subscribe(w,{transportType:A})}catch(I){throw y.setError(Uy.subscribe_session_topic_failure),I}y.addTrace(Ed.subscribe_session_topic_success);const S=kd(qa({},C),{topic:w,requiredNamespaces:g,optionalNamespaces:v,pairingTopic:h,acknowledged:!1,self:C.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:m,transportType:Vi.relay});await this.client.session.set(w,S),y.addTrace(Ed.store_session);try{y.addTrace(Ed.publishing_session_settle),await this.sendRequest({topic:w,method:"wc_sessionSettle",params:C,throwOnFailedPublish:!0}).catch(I=>{throw y==null||y.setError(Uy.session_settle_publish_failure),I}),y.addTrace(Ed.session_settle_publish_success),y.addTrace(Ed.publishing_session_approve),await this.sendResult({id:s,topic:h,result:{relay:{protocol:l??"irn"},responderPublicKey:m},throwOnFailedPublish:!0}).catch(I=>{throw y==null||y.setError(Uy.session_approve_publish_failure),I}),y.addTrace(Ed.session_approve_publish_success)}catch(I){throw this.client.logger.error(I),this.client.session.delete(w,$i("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(w),I}return this.client.core.eventClient.deleteEvent({eventId:y.eventId}),await this.client.core.pairing.updateMetadata({topic:h,metadata:p.metadata}),await this.client.proposal.delete(s,$i("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(w,Mo(Gx)),{topic:w,acknowledged:()=>Promise.resolve(this.client.session.get(w))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let a;try{a=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}a&&(await this.sendError({id:n,topic:a,error:i,rpcOpts:Jo.wc_sessionPropose.reject}),await this.client.proposal.delete(n,$i("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:n,namespaces:i}=r,{done:a,resolve:o,reject:s}=Tw(),l=vm(),c=qw().toString(),u=this.client.session.get(n).namespaces;return this.events.once(Vn("session_update",l),({error:f})=>{f?s(f):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:c}).catch(f=>{this.client.logger.error(f),this.client.session.update(n,{namespaces:u}),s(f)}),{acknowledged:a}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:n}=r,i=vm(),{done:a,resolve:o,reject:s}=Tw();return this.events.once(Vn("session_extend",i),({error:l})=>{l?s(l):o()}),await this.setExpiry(n,Mo(Gx)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{s(l)}),{acknowledged:a}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(p){throw this.client.logger.error("request() -> isValidRequest() failed"),p}const{chainId:n,request:i,topic:a,expiry:o=Jo.wc_sessionRequest.req.ttl}=r,s=this.client.session.get(a);(s==null?void 0:s.transportType)===Vi.relay&&await this.confirmOnlineStateOrThrow();const l=vm(),c=qw().toString(),{done:u,resolve:f,reject:d}=Tw(o,"Request expired. Please try again.");this.events.once(Vn("session_request",l),({error:p,result:g})=>{p?d(p):f(g)});const h=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);return h?(await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:kd(qa({},i),{expiryTimestamp:Mo(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:h}).catch(p=>d(p)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),await u()):await Promise.all([new Promise(async p=>{await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:kd(qa({},i),{expiryTimestamp:Mo(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(g=>d(g)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),p()}),new Promise(async p=>{var g;if(!((g=s.sessionConfig)!=null&&g.disableDeepLink)){const v=await M_t(this.client.core.storage,Xfe);await P_t({id:l,topic:a,wcDeepLink:v})}p()}),u()]).then(p=>p[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:a}=i,o=this.client.session.get(n);o.transportType===Vi.relay&&await this.confirmOnlineStateOrThrow();const s=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);lp(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:s}):xf(i)&&await this.sendError({id:a,topic:n,error:i.error,appLink:s}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=vm(),a=qw().toString(),{done:o,resolve:s,reject:l}=Tw();this.events.once(Vn("session_ping",i),({error:c})=>{c?l(c):s()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:a}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:a}=r,o=qw().toString();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a},throwOnFailedPublish:!0,relayRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:$i("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=Ot("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>oCt(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const a=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=a?Vi.link_mode:Vi.relay;o===Vi.relay&&await this.confirmOnlineStateOrThrow();const{chains:s,statement:l="",uri:c,domain:u,nonce:f,type:d,exp:h,nbf:p,methods:g=[],expiry:v}=r,y=[...r.resources||[]],{topic:m,uri:b}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:m,uri:b}});const w=await this.client.core.crypto.generateKeyPair(),C=ZR(w);if(await Promise.all([this.client.auth.authKeys.set(QR,{responseTopic:C,publicKey:w}),this.client.auth.pairingTopics.set(C,{topic:C,pairingTopic:m})]),await this.client.core.relayer.subscribe(C,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${m}`),g.length>0){const{namespace:B}=HA(s[0]);let j=ESt(B,"request",g);KR(y)&&(j=kSt(j,y.pop())),y.push(j)}const A=v&&v>Jo.wc_sessionAuthenticate.req.ttl?v:Jo.wc_sessionAuthenticate.req.ttl,S={authPayload:{type:d??"caip122",chains:s,statement:l,aud:c,domain:u,version:"1",nonce:f,iat:new Date().toISOString(),exp:h,nbf:p,resources:y},requester:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:Mo(A)},I={eip155:{chains:s,methods:[...new Set(["personal_sign",...g])],events:["chainChanged","accountsChanged"]}},D={requiredNamespaces:{},optionalNamespaces:I,relays:[{protocol:"irn"}],pairingTopic:m,proposer:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:Mo(Jo.wc_sessionPropose.req.ttl)},{done:L,resolve:O,reject:P}=Tw(A,"Request expired"),x=async({error:B,session:j})=>{if(this.events.off(Vn("session_request",E),T),B)P(B);else if(j){j.self.publicKey=w,await this.client.session.set(j.topic,j),await this.setExpiry(j.topic,j.expiry),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:j.peer.metadata});const k=this.client.session.get(j.topic);await this.deleteProposal(N),O({session:k})}},T=async B=>{var j,k,$;if(await this.deletePendingAuthRequest(E,{message:"fulfilled",code:0}),B.error){const ee=$i("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return B.error.code===ee.code?void 0:(this.events.off(Vn("session_connect"),x),P(B.error.message))}await this.deleteProposal(N),this.events.off(Vn("session_connect"),x);const{cacaos:H,responder:Y}=B.result,ie=[],W=[];for(const ee of H){await lfe({cacao:ee,projectId:this.client.core.projectId})||(this.client.logger.error(ee,"Signature verification failed"),P($i("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ne}=ee,V=KR(ne.resources),oe=[sfe(ne.iss)],ye=uN(ne.iss);if(V){const Te=cfe(V),Me=ufe(V);ie.push(...Te),oe.push(...Me)}for(const Te of oe)W.push(`${Te}:${ye}`)}const Q=await this.client.core.crypto.generateSharedKey(w,Y.publicKey);let J;ie.length>0&&(J={topic:Q,acknowledged:!0,self:{publicKey:w,metadata:this.client.metadata},peer:Y,controller:Y.publicKey,expiry:Mo(Gx),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:m,namespaces:wfe([...new Set(ie)],[...new Set(W)]),transportType:o},await this.client.core.relayer.subscribe(Q,{transportType:o}),await this.client.session.set(Q,J),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:Y.metadata}),J=this.client.session.get(Q)),(j=this.client.metadata.redirect)!=null&&j.linkMode&&(k=Y.metadata.redirect)!=null&&k.linkMode&&($=Y.metadata.redirect)!=null&&$.universal&&n&&(this.client.core.addLinkModeSupportedApp(Y.metadata.redirect.universal),this.client.session.update(Q,{transportType:Vi.link_mode})),O({auths:H,session:J})},E=vm(),N=vm();this.events.once(Vn("session_connect"),x),this.events.once(Vn("session_request",E),T);let F;try{if(a){const B=Vm("wc_sessionAuthenticate",S,E);this.client.core.history.set(m,B);const j=await this.client.core.crypto.encode("",B,{type:k8,encoding:KC});F=v7(n,m,j)}else await Promise.all([this.sendRequest({topic:m,method:"wc_sessionAuthenticate",params:S,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:E}),this.sendRequest({topic:m,method:"wc_sessionPropose",params:D,expiry:Jo.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:N})])}catch(B){throw this.events.off(Vn("session_connect"),x),this.events.off(Vn("session_request",E),T),B}return await this.setProposal(N,qa({id:N},D)),await this.setAuthRequest(E,{request:kd(qa({},S),{verifyContext:{}}),pairingTopic:m,transportType:o}),{uri:F??b,response:L}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,a=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[zy.authenticated_session_approve_started]}});try{this.isInitialized()}catch(v){throw a.setError(XC.no_internet_connection),v}const o=this.getPendingAuthRequest(n);if(!o)throw a.setError(XC.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const s=o.transportType||Vi.relay;s===Vi.relay&&await this.confirmOnlineStateOrThrow();const l=o.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=ZR(l),f={type:Rg,receiverPublicKey:l,senderPublicKey:c},d=[],h=[];for(const v of i){if(!await lfe({cacao:v,projectId:this.client.core.projectId})){a.setError(XC.invalid_cacao);const C=$i("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:C,encodeOpts:f}),new Error(C.message)}a.addTrace(zy.cacaos_verified);const{p:y}=v,m=KR(y.resources),b=[sfe(y.iss)],w=uN(y.iss);if(m){const C=cfe(m),A=ufe(m);d.push(...C),b.push(...A)}for(const C of b)h.push(`${C}:${w}`)}const p=await this.client.core.crypto.generateSharedKey(c,l);a.addTrace(zy.create_authenticated_session_topic);let g;if((d==null?void 0:d.length)>0){g={topic:p,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:l,metadata:o.requester.metadata},controller:l,expiry:Mo(Gx),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:wfe([...new Set(d)],[...new Set(h)]),transportType:s},a.addTrace(zy.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(p,{transportType:s})}catch(v){throw a.setError(XC.subscribe_authenticated_session_topic_failure),v}a.addTrace(zy.subscribe_authenticated_session_topic_success),await this.client.session.set(p,g),a.addTrace(zy.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}a.addTrace(zy.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:i,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,s)})}catch(v){throw a.setError(XC.authenticated_session_approve_publish_failure),v}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:g}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,a=this.getPendingAuthRequest(n);if(!a)throw new Error(`Could not find pending auth request with id ${n}`);a.transportType===Vi.relay&&await this.confirmOnlineStateOrThrow();const o=a.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),l=ZR(o),c={type:Rg,receiverPublicKey:o,senderPublicKey:s};await this.sendError({id:n,topic:l,error:i,encodeOpts:c,rpcOpts:Jo.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,$i("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return BAe(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var o,s;return((o=a.peerMetadata)==null?void 0:o.url)&&((s=a.peerMetadata)==null?void 0:s.url)===r.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:a=!1,emitEvent:o=!0,id:s=0}=r,{self:l}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,$i("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),a||this.client.core.expirer.del(i),this.client.core.storage.removeItem(Xfe).catch(c=>this.client.logger.warn(c)),this.getPendingSessionRequests().forEach(c=>{c.topic===i&&this.deletePendingSessionRequest(c.id,$i("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=Yh.idle),o&&this.client.events.emit("session_delete",{id:s,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),a=this.client.core.eventClient.getEvent({topic:i.pairingTopic});a==null||a.setError(Uy.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,$i("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==r),i&&(this.sessionRequestQueue.state=Yh.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Mo(Jo.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:a,transportType:o=Vi.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:a,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:a,verifyContext:o}=r,s=a.request.expiryTimestamp||Mo(Jo.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,s),await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:o})},this.sendRequest=async r=>{const{topic:n,method:i,params:a,expiry:o,relayRpcId:s,clientRpcId:l,throwOnFailedPublish:c,appLink:u}=r,f=Vm(i,a,l);let d;const h=!!u;try{const v=h?KC:Hm;d=await this.client.core.crypto.encode(n,f,{encoding:v})}catch(v){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),v}let p;if(rTt.includes(i)){const v=gg(JSON.stringify(f)),y=gg(d);p=await this.client.core.verify.register({id:y,decryptedId:v})}const g=Jo[i].req;if(g.attestation=p,o&&(g.ttl=o),s&&(g.id=s),this.client.core.history.set(n,f),h){const v=v7(u,n,d);await Id.Linking.openURL(v,this.client.name)}else{const v=Jo[i].req;o&&(v.ttl=o),s&&(v.id=s),c?(v.internal=kd(qa({},v.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,d,v)):this.client.core.relayer.publish(n,d,v).catch(y=>this.client.logger.error(y))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:a,throwOnFailedPublish:o,encodeOpts:s,appLink:l}=r,c=y$(n,a);let u;const f=l&&typeof(Id==null?void 0:Id.Linking)<"u";try{const h=f?KC:Hm;u=await this.client.core.crypto.encode(i,c,kd(qa({},s||{}),{encoding:h}))}catch(h){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),h}let d;try{d=await this.client.core.history.get(i,n)}catch(h){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),h}if(f){const h=v7(l,i,u);await Id.Linking.openURL(h,this.client.name)}else{const h=Jo[d.request.method].res;o?(h.internal=kd(qa({},h.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,h)):this.client.core.relayer.publish(i,u,h).catch(p=>this.client.logger.error(p))}await this.client.core.history.resolve(c)},this.sendError=async r=>{const{id:n,topic:i,error:a,encodeOpts:o,rpcOpts:s,appLink:l}=r,c=w$(n,a);let u;const f=l&&typeof(Id==null?void 0:Id.Linking)<"u";try{const h=f?KC:Hm;u=await this.client.core.crypto.encode(i,c,kd(qa({},o||{}),{encoding:h}))}catch(h){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),h}let d;try{d=await this.client.core.history.get(i,n)}catch(h){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),h}if(f){const h=v7(l,i,u);await Id.Linking.openURL(h,this.client.name)}else{const h=s||Jo[d.request.method].res;this.client.core.relayer.publish(i,u,h)}await this.client.core.history.resolve(c)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;pm(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{pm(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Yh.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Yh.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Yh.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:a,transportType:o,encryptedId:s}=r,l=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:l}))switch(l){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:a,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:a,encryptedId:s,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:a,encryptedId:s,transportType:o});default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:a}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,a);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=Ot("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,a=this.expectedPairingMethodMap.get(n);return!a||a.includes(i)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:a,encryptedId:o}=r,{params:s,id:l}=i;try{const c=this.client.core.eventClient.getEvent({topic:n});this.isValidConnect(qa({},i.params));const u=s.expiryTimestamp||Mo(Jo.wc_sessionPropose.req.ttl),f=qa({id:l,pairingTopic:n,expiryTimestamp:u},s);await this.setProposal(l,f);const d=await this.getVerifyContext({attestationId:a,hash:gg(JSON.stringify(i)),encryptedId:o,metadata:f.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),c==null||c.setError(lg.proposal_listener_not_found)),c==null||c.addTrace(rp.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:f,verifyContext:d})}catch(c){await this.sendError({id:l,topic:n,error:c,rpcOpts:Jo.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:a}=n;if(lp(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const s=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const l=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const c=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const u=await this.client.core.crypto.generateSharedKey(l,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});const f=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else if(xf(n)){await this.client.proposal.delete(a,$i("USER_DISCONNECTED"));const o=Vn("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(Vn("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:o,controller:s,expiry:l,namespaces:c,sessionProperties:u,sessionConfig:f}=n.params,d=kd(qa(qa({topic:r,relay:o,expiry:l,namespaces:c,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:s.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:s.publicKey,metadata:s.metadata}},u&&{sessionProperties:u}),f&&{sessionConfig:f}),{transportType:Vi.relay}),h=Vn("session_connect");if(this.events.listenerCount(h)===0)throw new Error(`emitting ${h} without any listeners 997`);this.events.emit(Vn("session_connect"),{session:d}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;lp(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Vn("session_approve",i),{})):xf(n)&&(await this.client.session.delete(r,$i("USER_DISCONNECTED")),this.events.emit(Vn("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:a}=n;try{const o=`${r}_session_update`,s=ZC.get(o);if(s&&this.isRequestOutOfSync(s,a)){this.client.logger.info(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:r,error:$i("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(qa({topic:r},i));try{ZC.set(o,a),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw ZC.delete(o),l}this.client.events.emit("session_update",{id:a,topic:r,params:i})}catch(o){await this.sendError({id:a,topic:r,error:o}),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,a=Vn("session_update",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);lp(n)?this.events.emit(Vn("session_update",i),{}):xf(n)&&this.events.emit(Vn("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Mo(Gx)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,a=Vn("session_extend",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);lp(n)?this.events.emit(Vn("session_extend",i),{}):xf(n)&&this.events.emit(Vn("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,a=Vn("session_ping",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{lp(n)?this.events.emit(Vn("session_ping",i),{}):xf(n)&&this.events.emit(Vn("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Ll.publish,async()=>{a(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:$i("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async r=>{var n,i,a;const{topic:o,payload:s,attestation:l,encryptedId:c,transportType:u}=r,{id:f,params:d}=s;try{await this.isValidRequest(qa({topic:o},d));const h=this.client.session.get(o),p=await this.getVerifyContext({attestationId:l,hash:gg(JSON.stringify(Vm("wc_sessionRequest",d,f))),encryptedId:c,metadata:h.peer.metadata,transportType:u}),g={id:f,topic:o,params:d,verifyContext:p};await this.setPendingSessionRequest(g),u===Vi.link_mode&&(n=h.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=h.peer.metadata.redirect)==null?void 0:i.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(g):(this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue())}catch(h){await this.sendError({id:f,topic:o,error:h}),this.client.logger.error(h)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,a=Vn("session_request",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);lp(n)?this.events.emit(Vn("session_request",i),{result:n.result}):xf(n)&&this.events.emit(Vn("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:a}=n;try{const o=`${r}_session_event_${a.event.name}`,s=ZC.get(o);if(s&&this.isRequestOutOfSync(s,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(qa({topic:r},a)),this.client.events.emit("session_event",{id:i,topic:r,params:a}),ZC.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),lp(n)?this.events.emit(Vn("session_request",i),{result:n.result}):xf(n)&&this.events.emit(Vn("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:a,attestation:o,encryptedId:s,transportType:l}=r;try{const{requester:c,authPayload:u,expiryTimestamp:f}=a.params,d=await this.getVerifyContext({attestationId:o,hash:gg(JSON.stringify(a)),encryptedId:s,metadata:c.metadata,transportType:l}),h={requester:c,pairingTopic:i,id:a.id,authPayload:u,verifyContext:d,expiryTimestamp:f};await this.setAuthRequest(a.id,{request:h,pairingTopic:i,transportType:l}),l===Vi.link_mode&&(n=c.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:a.params,id:a.id,verifyContext:d})}catch(c){this.client.logger.error(c);const u=a.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),d=this.getAppLinkIfEnabled(a.params.requester.metadata,l),h={type:Rg,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:a.id,topic:i,error:c,encodeOpts:h,rpcOpts:Jo.wc_sessionAuthenticate.autoReject,appLink:d})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Yh.idle,this.processSessionRequestQueue()},Ft.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===r&&a.request.method==="wc_sessionRequest").forEach(a=>{const o=a.request.id,s=Vn("session_request",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);this.events.emit(Vn("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Yh.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Yh.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Vm("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!hc(r)){const{message:l}=Ot("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:o,relays:s}=r;if(bc(n)||await this.isValidPairingTopic(n),!yCt(s)){const{message:l}=Ot("MISSING_OR_INVALID",`connect() relays: ${s}`);throw new Error(l)}!bc(i)&&DT(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!bc(a)&&DT(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),bc(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=mCt(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!hc(r))throw new Error(Ot("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const s=this.client.proposal.get(n),l=yz(i,"approve()");if(l)throw new Error(l.message);const c=_fe(s.requiredNamespaces,i,"approve()");if(c)throw new Error(c.message);if(!ho(a,!0)){const{message:u}=Ot("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(u)}bc(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!hc(r)){const{message:a}=Ot("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(a)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!bCt(i)){const{message:a}=Ot("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=r=>{if(!hc(r)){const{message:c}=Ot("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(c)}const{relay:n,controller:i,namespaces:a,expiry:o}=r;if(!WAe(n)){const{message:c}=Ot("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(c)}const s=fCt(i,"onSessionSettleRequest()");if(s)throw new Error(s.message);const l=yz(a,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(pm(o)){const{message:c}=Ot("EXPIRED","onSessionSettleRequest()");throw new Error(c)}},this.isValidUpdate=async r=>{if(!hc(r)){const{message:l}=Ot("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const a=this.client.session.get(n),o=yz(i,"update()");if(o)throw new Error(o.message);const s=_fe(a.requiredNamespaces,i,"update()");if(s)throw new Error(s.message)},this.isValidExtend=async r=>{if(!hc(r)){const{message:i}=Ot("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!hc(r)){const{message:l}=Ot("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:a,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!xfe(s,a)){const{message:l}=Ot("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(l)}if(!xCt(i)){const{message:l}=Ot("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!CCt(s,a,i.method)){const{message:l}=Ot("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(o&&!ICt(o,Sz)){const{message:l}=Ot("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${Sz.min} and ${Sz.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var n;if(!hc(r)){const{message:o}=Ot("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:a}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!_Ct(a)){const{message:o}=Ot("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!hc(r)){const{message:i}=Ot("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!hc(r)){const{message:s}=Ot("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(s)}const{topic:n,event:i,chainId:a}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!xfe(o,a)){const{message:s}=Ot("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(s)}if(!SCt(i)){const{message:s}=Ot("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(s)}if(!ACt(o,a,i.name)){const{message:s}=Ot("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidDisconnect=async r=>{if(!hc(r)){const{message:i}=Ot("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:a,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ho(i,!1))throw new Error("uri is required parameter");if(!ho(a,!1))throw new Error("domain is required parameter");if(!ho(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(l=>HA(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=HA(n[0]);if(s!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:a,metadata:o,transportType:s}=r,l={verified:{verifyUrl:o.verifyUrl||KA,validation:"UNKNOWN",origin:o.url||""}};try{if(s===Vi.link_mode){const u=this.getAppLinkIfEnabled(o,s);return l.verified.validation=u&&new URL(u).origin===new URL(o.url).origin?"VALID":"INVALID",l}const c=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:a,verifyUrl:o.verifyUrl});c&&(l.verified.origin=c.origin,l.verified.isScam=c.isScam,l.verified.validation=c.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(c){this.client.logger.warn(c)}return this.client.logger.debug(`Verify context: ${JSON.stringify(l)}`),l},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!ho(i,!1)){const{message:a}=Ot("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const a=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=a)break;this.recentlyDeletedMap.delete(o)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=Ot("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,a,o,s,l,c,u,f,d;return!r||n!==Vi.link_mode?!1:((a=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:a.linkMode)===!0&&((s=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:s.universal)!==void 0&&((c=(l=this.client.metadata)==null?void 0:l.redirect)==null?void 0:c.universal)!==""&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==void 0&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==""&&((d=r==null?void 0:r.redirect)==null?void 0:d.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(Id==null?void 0:Id.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=Oue(r,"topic")||"",i=decodeURIComponent(Oue(r,"wc_ev")||""),a=this.client.session.keys.includes(n);a&&this.client.session.update(n,{transportType:Vi.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:a})},this.registerLinkModeListeners=async()=>{var r;if(UJ()||AS()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=Id==null?void 0:Id.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=Ot("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ll.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:a}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(QR)?this.client.auth.authKeys.get(QR):{responseTopic:void 0,publicKey:void 0},s=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:a===Vi.link_mode?KC:Hm});try{XJ(s)?(this.client.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s,attestation:i,transportType:a,encryptedId:gg(n)})):b$(s)?(await this.client.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s,transportType:a}),this.client.core.history.delete(r,s.id)):this.onRelayEventUnknownPayload({topic:r,payload:s,transportType:a})}catch(l){this.client.logger.error(l)}}registerExpirerEvents(){this.client.core.expirer.on(hf.expired,async e=>{const{topic:r,id:n}=tAe(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Ot("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,Ot("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Dw.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Dw.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ho(e,!1)){const{message:r}=Ot("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=Ot("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(pm(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Ot("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!ho(e,!1)){const{message:r}=Ot("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=Ot("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(pm(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Ot("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Ot("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ho(e,!1)){const{message:r}=Ot("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Ot("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!wCt(e)){const{message:r}=Ot("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Ot("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(pm(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Ot("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class pTt extends J2{constructor(e,r){super(e,r,X6t,eee),this.core=e,this.logger=r}}let gTt=class extends J2{constructor(e,r){super(e,r,J6t,eee),this.core=e,this.logger=r}};class vTt extends J2{constructor(e,r){super(e,r,tTt,eee,n=>n.id),this.core=e,this.logger=r}}class mTt extends J2{constructor(e,r){super(e,r,aTt,_$,()=>QR),this.core=e,this.logger=r}}class yTt extends J2{constructor(e,r){super(e,r,oTt,_$),this.core=e,this.logger=r}}class wTt extends J2{constructor(e,r){super(e,r,sTt,_$,n=>n.id),this.core=e,this.logger=r}}class bTt{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new mTt(this.core,this.logger),this.pairingTopics=new yTt(this.core,this.logger),this.requests=new wTt(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let xTt=class b6e extends Iyt{constructor(e){super(e),this.protocol=v6e,this.version=m6e,this.name=_z.name,this.events=new td.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||_z.name,this.metadata=(e==null?void 0:e.metadata)||Z4e(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:a8(dS({level:(e==null?void 0:e.logger)||_z.logger}));this.core=(e==null?void 0:e.core)||new Q6t(e),this.logger=vl(r,this.name),this.session=new gTt(this.core,this.logger),this.proposal=new pTt(this.core,this.logger),this.pendingRequest=new vTt(this.core,this.logger),this.engine=new hTt(this),this.auth=new bTt(this.core,this.logger)}static async init(e){const r=new b6e(e);return await r.initialize(),r}get context(){return Uc(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var aY={exports:{}};(function(t,e){var r=typeof self<"u"?self:R2,n=function(){function a(){this.fetch=!1,this.DOMException=r.DOMException}return a.prototype=r,new a}();(function(a){(function(o){var s={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(T){return T&&DataView.prototype.isPrototypeOf(T)}if(s.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(T){return T&&c.indexOf(Object.prototype.toString.call(T))>-1};function f(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(T))throw new TypeError("Invalid character in header field name");return T.toLowerCase()}function d(T){return typeof T!="string"&&(T=String(T)),T}function h(T){var E={next:function(){var N=T.shift();return{done:N===void 0,value:N}}};return s.iterable&&(E[Symbol.iterator]=function(){return E}),E}function p(T){this.map={},T instanceof p?T.forEach(function(E,N){this.append(N,E)},this):Array.isArray(T)?T.forEach(function(E){this.append(E[0],E[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(E){this.append(E,T[E])},this)}p.prototype.append=function(T,E){T=f(T),E=d(E);var N=this.map[T];this.map[T]=N?N+", "+E:E},p.prototype.delete=function(T){delete this.map[f(T)]},p.prototype.get=function(T){return T=f(T),this.has(T)?this.map[T]:null},p.prototype.has=function(T){return this.map.hasOwnProperty(f(T))},p.prototype.set=function(T,E){this.map[f(T)]=d(E)},p.prototype.forEach=function(T,E){for(var N in this.map)this.map.hasOwnProperty(N)&&T.call(E,this.map[N],N,this)},p.prototype.keys=function(){var T=[];return this.forEach(function(E,N){T.push(N)}),h(T)},p.prototype.values=function(){var T=[];return this.forEach(function(E){T.push(E)}),h(T)},p.prototype.entries=function(){var T=[];return this.forEach(function(E,N){T.push([N,E])}),h(T)},s.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function g(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}function v(T){return new Promise(function(E,N){T.onload=function(){E(T.result)},T.onerror=function(){N(T.error)}})}function y(T){var E=new FileReader,N=v(E);return E.readAsArrayBuffer(T),N}function m(T){var E=new FileReader,N=v(E);return E.readAsText(T),N}function b(T){for(var E=new Uint8Array(T),N=new Array(E.length),F=0;F-1?E:T}function I(T,E){E=E||{};var N=E.body;if(T instanceof I){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,E.headers||(this.headers=new p(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!N&&T._bodyInit!=null&&(N=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=E.credentials||this.credentials||"same-origin",(E.headers||!this.headers)&&(this.headers=new p(E.headers)),this.method=S(E.method||this.method||"GET"),this.mode=E.mode||this.mode||null,this.signal=E.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&N)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(N)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function D(T){var E=new FormData;return T.trim().split("&").forEach(function(N){if(N){var F=N.split("="),B=F.shift().replace(/\+/g," "),j=F.join("=").replace(/\+/g," ");E.append(decodeURIComponent(B),decodeURIComponent(j))}}),E}function L(T){var E=new p,N=T.replace(/\r?\n[\t ]+/g," ");return N.split(/\r?\n/).forEach(function(F){var B=F.split(":"),j=B.shift().trim();if(j){var k=B.join(":").trim();E.append(j,k)}}),E}C.call(I.prototype);function O(T,E){E||(E={}),this.type="default",this.status=E.status===void 0?200:E.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in E?E.statusText:"OK",this.headers=new p(E.headers),this.url=E.url||"",this._initBody(T)}C.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},O.error=function(){var T=new O(null,{status:0,statusText:""});return T.type="error",T};var P=[301,302,303,307,308];O.redirect=function(T,E){if(P.indexOf(E)===-1)throw new RangeError("Invalid status code");return new O(null,{status:E,headers:{location:T}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(E,N){this.message=E,this.name=N;var F=Error(E);this.stack=F.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function x(T,E){return new Promise(function(N,F){var B=new I(T,E);if(B.signal&&B.signal.aborted)return F(new o.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function k(){j.abort()}j.onload=function(){var $={status:j.status,statusText:j.statusText,headers:L(j.getAllResponseHeaders()||"")};$.url="responseURL"in j?j.responseURL:$.headers.get("X-Request-URL");var H="response"in j?j.response:j.responseText;N(new O(H,$))},j.onerror=function(){F(new TypeError("Network request failed"))},j.ontimeout=function(){F(new TypeError("Network request failed"))},j.onabort=function(){F(new o.DOMException("Aborted","AbortError"))},j.open(B.method,B.url,!0),B.credentials==="include"?j.withCredentials=!0:B.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&s.blob&&(j.responseType="blob"),B.headers.forEach(function($,H){j.setRequestHeader(H,$)}),B.signal&&(B.signal.addEventListener("abort",k),j.onreadystatechange=function(){j.readyState===4&&B.signal.removeEventListener("abort",k)}),j.send(typeof B._bodyInit>"u"?null:B._bodyInit)})}return x.polyfill=!0,a.fetch||(a.fetch=x,a.Headers=p,a.Request=I,a.Response=O),o.Headers=p,o.Request=I,o.Response=O,o.fetch=x,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(aY,aY.exports);var _Tt=aY.exports;const tde=Un(_Tt);var STt=Object.defineProperty,CTt=Object.defineProperties,ATt=Object.getOwnPropertyDescriptors,rde=Object.getOwnPropertySymbols,TTt=Object.prototype.hasOwnProperty,ETt=Object.prototype.propertyIsEnumerable,nde=(t,e,r)=>e in t?STt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ide=(t,e)=>{for(var r in e||(e={}))TTt.call(e,r)&&nde(t,r,e[r]);if(rde)for(var r of rde(e))ETt.call(e,r)&&nde(t,r,e[r]);return t},ade=(t,e)=>CTt(t,ATt(e));const ITt={Accept:"application/json","Content-Type":"application/json"},kTt="POST",ode={headers:ITt,method:kTt},sde=10;let S0=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new td.EventEmitter,this.isAvailable=!1,this.registering=!1,!Ife(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Yg(e),n=await(await tde(this.url,ade(ide({},ode),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!Ife(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Yg({id:1,jsonrpc:"2.0",method:"test",params:[]});await tde(e,ade(ide({},ode),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Ob(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=w$(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return KAe(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>sde&&this.events.setMaxListeners(sde)}};var lde={};const cde="error",PTt="wss://relay.walletconnect.org",RTt="wc",MTt="universal_provider",ude=`${RTt}@2:${MTt}:`,x6e="https://rpc.walletconnect.org/v1/",A_="generic",DTt=`${x6e}bundler`,Eh={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var t4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof lde<"u"?lde:typeof self<"u"?self:{},oY={exports:{}};/** -* @license -* Lodash -* Copyright OpenJS Foundation and other contributors -* Released under MIT license -* Based on Underscore.js 1.8.3 -* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -*/(function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,d=2,h=4,p=1,g=2,v=1,y=2,m=4,b=8,w=16,C=32,A=64,S=128,I=256,D=512,L=30,O="...",P=800,x=16,T=1,E=2,N=3,F=1/0,B=9007199254740991,j=17976931348623157e292,k=NaN,$=4294967295,H=$-1,Y=$>>>1,ie=[["ary",S],["bind",v],["bindKey",y],["curry",b],["curryRight",w],["flip",D],["partial",C],["partialRight",A],["rearg",I]],W="[object Arguments]",Q="[object Array]",J="[object AsyncFunction]",ee="[object Boolean]",ne="[object Date]",V="[object DOMException]",oe="[object Error]",ye="[object Function]",Te="[object GeneratorFunction]",Me="[object Map]",Oe="[object Number]",nt="[object Null]",it="[object Object]",St="[object Promise]",bt="[object Proxy]",Ce="[object RegExp]",We="[object Set]",Le="[object String]",Ke="[object Symbol]",qe="[object Undefined]",we="[object WeakMap]",Se="[object WeakSet]",q="[object ArrayBuffer]",z="[object DataView]",G="[object Float32Array]",re="[object Float64Array]",ue="[object Int8Array]",_e="[object Int16Array]",Ee="[object Int32Array]",et="[object Uint8Array]",pt="[object Uint8ClampedArray]",Ct="[object Uint16Array]",ot="[object Uint32Array]",Pt=/\b__p \+= '';/g,mr=/\b(__p \+=) '' \+/g,qt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ur=/&(?:amp|lt|gt|quot|#39);/g,Ir=/[&<>"']/g,yt=RegExp(Ur.source),Qt=RegExp(Ir.source),Xt=/<%-([\s\S]+?)%>/g,$t=/<%([\s\S]+?)%>/g,hr=/<%=([\s\S]+?)%>/g,lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dt=/^\w*$/,kr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_r=/[\\^$.*+?()[\]{}|]/g,Jt=RegExp(_r.source),Pr=/^\s+/,zr=/\s/,Zt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nr=/\{\n\/\* \[wrapped with (.+)\] \*/,Sr=/,? & /,Yt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ve=/[()=,{}\[\]\/\s]/,me=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,Ue=/^0b[01]+$/i,tt=/^\[object .+?Constructor\]$/,Qe=/^0o[0-7]+$/i,Ne=/^(?:0|[1-9]\d*)$/,ut=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lt=/($^)/,Wr=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",Dn="\\u0300-\\u036f",Hr="\\ufe20-\\ufe2f",Nn="\\u20d0-\\u20ff",zn=Dn+Hr+Nn,Cr="\\u2700-\\u27bf",pi="a-z\\xdf-\\xf6\\xf8-\\xff",ci="\\xac\\xb1\\xd7\\xf7",ro="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zs="\\u2000-\\u206f",bs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",M0="A-Z\\xc0-\\xd6\\xd8-\\xde",fd="\\ufe0e\\ufe0f",no=ci+ro+zs+bs,bl="['’]",D0="["+nn+"]",xl="["+no+"]",$h="["+zn+"]",Bh="\\d+",Ay="["+Cr+"]",Pv="["+pi+"]",Rv="[^"+nn+no+Bh+Cr+pi+M0+"]",N0="\\ud83c[\\udffb-\\udfff]",dd="(?:"+$h+"|"+N0+")",Ty="[^"+nn+"]",oC="(?:\\ud83c[\\udde6-\\uddff]){2}",xx="[\\ud800-\\udbff][\\udc00-\\udfff]",hd="["+M0+"]",O0="\\u200d",P9="(?:"+Pv+"|"+Rv+")",vF="(?:"+hd+"|"+Rv+")",pd="(?:"+bl+"(?:d|ll|m|re|s|t|ve))?",R9="(?:"+bl+"(?:D|LL|M|RE|S|T|VE))?",M9=dd+"?",D9="["+fd+"]?",mF="(?:"+O0+"(?:"+[Ty,oC,xx].join("|")+")"+D9+M9+")*",yF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",L0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sC=D9+M9+mF,wF="(?:"+[Ay,oC,xx].join("|")+")"+sC,_x="(?:"+[Ty+$h+"?",$h,oC,xx,D0].join("|")+")",bF=RegExp(bl,"g"),lC=RegExp($h,"g"),cC=RegExp(N0+"(?="+N0+")|"+_x+sC,"g"),N9=RegExp([hd+"?"+Pv+"+"+pd+"(?="+[xl,hd,"$"].join("|")+")",vF+"+"+R9+"(?="+[xl,hd+P9,"$"].join("|")+")",hd+"?"+P9+"+"+pd,hd+"+"+R9,L0,yF,Bh,wF].join("|"),"g"),O9=RegExp("["+O0+nn+zn+fd+"]"),L9=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ey=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$9=-1,ji={};ji[G]=ji[re]=ji[ue]=ji[_e]=ji[Ee]=ji[et]=ji[pt]=ji[Ct]=ji[ot]=!0,ji[W]=ji[Q]=ji[q]=ji[ee]=ji[z]=ji[ne]=ji[oe]=ji[ye]=ji[Me]=ji[Oe]=ji[it]=ji[Ce]=ji[We]=ji[Le]=ji[we]=!1;var Li={};Li[W]=Li[Q]=Li[q]=Li[z]=Li[ee]=Li[ne]=Li[G]=Li[re]=Li[ue]=Li[_e]=Li[Ee]=Li[Me]=Li[Oe]=Li[it]=Li[Ce]=Li[We]=Li[Le]=Li[Ke]=Li[et]=Li[pt]=Li[Ct]=Li[ot]=!0,Li[oe]=Li[ye]=Li[we]=!1;var xF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},be={"&":"&","<":"<",">":">",'"':""","'":"'"},$e={"&":"&","<":"<",">":">",""":'"',"'":"'"},vt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nr=parseFloat,Ui=parseInt,pn=typeof t4=="object"&&t4&&t4.Object===Object&&t4,ba=typeof self=="object"&&self&&self.Object===Object&&self,Yn=pn||ba||Function("return this")(),io=e&&!e.nodeType&&e,gi=io&&!0&&t&&!t.nodeType&&t,Hs=gi&&gi.exports===io,_l=Hs&&pn.process,Ti=function(){try{var Be=gi&&gi.require&&gi.require("util").types;return Be||_l&&_l.binding&&_l.binding("util")}catch{}}(),Sl=Ti&&Ti.isArrayBuffer,Cl=Ti&&Ti.isDate,gd=Ti&&Ti.isMap,Bu=Ti&&Ti.isRegExp,Fh=Ti&&Ti.isSet,uC=Ti&&Ti.isTypedArray;function qo(Be,ct,rt){switch(rt.length){case 0:return Be.call(ct);case 1:return Be.call(ct,rt[0]);case 2:return Be.call(ct,rt[0],rt[1]);case 3:return Be.call(ct,rt[0],rt[1],rt[2])}return Be.apply(ct,rt)}function Sx(Be,ct,rt,ar){for(var gn=-1,vi=Be==null?0:Be.length;++gn-1}function _F(Be,ct,rt){for(var ar=-1,gn=Be==null?0:Be.length;++ar-1;);return rt}function fie(Be,ct){for(var rt=Be.length;rt--&&Cx(ct,Be[rt],0)>-1;);return rt}function pNe(Be,ct){for(var rt=Be.length,ar=0;rt--;)Be[rt]===ct&&++ar;return ar}var gNe=TF(xF),vNe=TF(be);function mNe(Be){return"\\"+vt[Be]}function yNe(Be,ct){return Be==null?r:Be[ct]}function Ax(Be){return O9.test(Be)}function wNe(Be){return L9.test(Be)}function bNe(Be){for(var ct,rt=[];!(ct=Be.next()).done;)rt.push(ct.value);return rt}function PF(Be){var ct=-1,rt=Array(Be.size);return Be.forEach(function(ar,gn){rt[++ct]=[gn,ar]}),rt}function die(Be,ct){return function(rt){return Be(ct(rt))}}function Nv(Be,ct){for(var rt=-1,ar=Be.length,gn=0,vi=[];++rt-1}function sOe(_,R){var U=this.__data__,K=tI(U,_);return K<0?(++this.size,U.push([_,R])):U[K][1]=R,this}$0.prototype.clear=nOe,$0.prototype.delete=iOe,$0.prototype.get=aOe,$0.prototype.has=oOe,$0.prototype.set=sOe;function B0(_){var R=-1,U=_==null?0:_.length;for(this.clear();++R=R?_:R)),_}function zu(_,R,U,K,ae,he){var Ae,ke=R&f,Ve=R&d,dt=R&h;if(U&&(Ae=ae?U(_,K,ae,he):U(_)),Ae!==r)return Ae;if(!Na(_))return _;var ht=mn(_);if(ht){if(Ae=fLe(_),!ke)return tc(_,Ae)}else{var wt=Gs(_),Ht=wt==ye||wt==Te;if(jv(_))return Yie(_,ke);if(wt==it||wt==W||Ht&&!ae){if(Ae=Ve||Ht?{}:hae(_),!ke)return Ve?eLe(_,SOe(Ae,_)):JOe(_,Cie(Ae,_))}else{if(!Li[wt])return ae?_:{};Ae=dLe(_,wt,ke)}}he||(he=new md);var yr=he.get(_);if(yr)return yr;he.set(_,Ae),zae(_)?_.forEach(function(Yr){Ae.add(zu(Yr,R,U,Yr,_,he))}):jae(_)&&_.forEach(function(Yr,Hn){Ae.set(Hn,zu(Yr,R,U,Hn,_,he))});var qr=dt?Ve?rj:tj:Ve?nc:Yo,On=ht?r:qr(_);return Fu(On||_,function(Yr,Hn){On&&(Hn=Yr,Yr=_[Hn]),mC(Ae,Hn,zu(Yr,R,U,Hn,_,he))}),Ae}function COe(_){var R=Yo(_);return function(U){return Aie(U,_,R)}}function Aie(_,R,U){var K=U.length;if(_==null)return!K;for(_=zi(_);K--;){var ae=U[K],he=R[ae],Ae=_[ae];if(Ae===r&&!(ae in _)||!he(Ae))return!1}return!0}function Tie(_,R,U){if(typeof _!="function")throw new ju(o);return CC(function(){_.apply(r,U)},R)}function yC(_,R,U,K){var ae=-1,he=B9,Ae=!0,ke=_.length,Ve=[],dt=R.length;if(!ke)return Ve;U&&(R=xa(R,Wc(U))),K?(he=_F,Ae=!1):R.length>=i&&(he=fC,Ae=!1,R=new Py(R));e:for(;++aeae?0:ae+U),K=K===r||K>ae?ae:Pn(K),K<0&&(K+=ae),K=U>K?0:Vae(K);U0&&U(ke)?R>1?xs(ke,R-1,U,K,ae):Dv(ae,ke):K||(ae[ae.length]=ke)}return ae}var $F=eae(),kie=eae(!0);function jh(_,R){return _&&$F(_,R,Yo)}function BF(_,R){return _&&kie(_,R,Yo)}function nI(_,R){return Mv(R,function(U){return H0(_[U])})}function My(_,R){R=Bv(R,_);for(var U=0,K=R.length;_!=null&&UR}function EOe(_,R){return _!=null&&Ei.call(_,R)}function IOe(_,R){return _!=null&&R in zi(_)}function kOe(_,R,U){return _>=Vs(R,U)&&_=120&&ht.length>=120)?new Py(Ae&&ht):r}ht=_[0];var wt=-1,Ht=ke[0];e:for(;++wt-1;)ke!==_&&Y9.call(ke,Ve,1),Y9.call(_,Ve,1);return _}function jie(_,R){for(var U=_?R.length:0,K=U-1;U--;){var ae=R[U];if(U==K||ae!==he){var he=ae;z0(ae)?Y9.call(_,ae,1):YF(_,ae)}}return _}function GF(_,R){return _+Q9(bie()*(R-_+1))}function zOe(_,R,U,K){for(var ae=-1,he=Po(Z9((R-_)/(U||1)),0),Ae=rt(he);he--;)Ae[K?he:++ae]=_,_+=U;return Ae}function WF(_,R){var U="";if(!_||R<1||R>B)return U;do R%2&&(U+=_),R=Q9(R/2),R&&(_+=_);while(R);return U}function Fn(_,R){return cj(vae(_,R,ic),_+"")}function HOe(_){return Sie(Lx(_))}function VOe(_,R){var U=Lx(_);return pI(U,Ry(R,0,U.length))}function xC(_,R,U,K){if(!Na(_))return _;R=Bv(R,_);for(var ae=-1,he=R.length,Ae=he-1,ke=_;ke!=null&&++aeae?0:ae+R),U=U>ae?ae:U,U<0&&(U+=ae),ae=R>U?0:U-R>>>0,R>>>=0;for(var he=rt(ae);++K>>1,Ae=_[he];Ae!==null&&!Yc(Ae)&&(U?Ae<=R:Ae=i){var dt=R?null:iLe(_);if(dt)return j9(dt);Ae=!1,ae=fC,Ve=new Py}else Ve=R?[]:ke;e:for(;++K=K?_:Hu(_,R,U)}var qie=ONe||function(_){return Yn.clearTimeout(_)};function Yie(_,R){if(R)return _.slice();var U=_.length,K=gie?gie(U):new _.constructor(U);return _.copy(K),K}function XF(_){var R=new _.constructor(_.byteLength);return new W9(R).set(new W9(_)),R}function KOe(_,R){var U=R?XF(_.buffer):_.buffer;return new _.constructor(U,_.byteOffset,_.byteLength)}function ZOe(_){var R=new _.constructor(_.source,de.exec(_));return R.lastIndex=_.lastIndex,R}function QOe(_){return vC?zi(vC.call(_)):{}}function Kie(_,R){var U=R?XF(_.buffer):_.buffer;return new _.constructor(U,_.byteOffset,_.length)}function Zie(_,R){if(_!==R){var U=_!==r,K=_===null,ae=_===_,he=Yc(_),Ae=R!==r,ke=R===null,Ve=R===R,dt=Yc(R);if(!ke&&!dt&&!he&&_>R||he&&Ae&&Ve&&!ke&&!dt||K&&Ae&&Ve||!U&&Ve||!ae)return 1;if(!K&&!he&&!dt&&_=ke)return Ve;var dt=U[K];return Ve*(dt=="desc"?-1:1)}}return _.index-R.index}function Qie(_,R,U,K){for(var ae=-1,he=_.length,Ae=U.length,ke=-1,Ve=R.length,dt=Po(he-Ae,0),ht=rt(Ve+dt),wt=!K;++ke1?U[ae-1]:r,Ae=ae>2?U[2]:r;for(he=_.length>3&&typeof he=="function"?(ae--,he):r,Ae&&Tl(U[0],U[1],Ae)&&(he=ae<3?r:he,ae=1),R=zi(R);++K-1?ae[he?R[Ae]:Ae]:r}}function nae(_){return U0(function(R){var U=R.length,K=U,ae=Uu.prototype.thru;for(_&&R.reverse();K--;){var he=R[K];if(typeof he!="function")throw new ju(o);if(ae&&!Ae&&dI(he)=="wrapper")var Ae=new Uu([],!0)}for(K=Ae?K:U;++K1&&ri.reverse(),ht&&Veke))return!1;var dt=he.get(_),ht=he.get(R);if(dt&&ht)return dt==R&&ht==_;var wt=-1,Ht=!0,yr=U&g?new Py:r;for(he.set(_,R),he.set(R,_);++wt1?"& ":"")+R[K],R=R.join(U>2?", ":" "),_.replace(Zt,`{ -/* [wrapped with `+R+`] */ -`)}function pLe(_){return mn(_)||Oy(_)||!!(yie&&_&&_[yie])}function z0(_,R){var U=typeof _;return R=R??B,!!R&&(U=="number"||U!="symbol"&&Ne.test(_))&&_>-1&&_%1==0&&_0){if(++R>=P)return arguments[0]}else R=0;return _.apply(r,arguments)}}function pI(_,R){var U=-1,K=_.length,ae=K-1;for(R=R===r?K:R;++U1?_[R-1]:r;return U=typeof U=="function"?(_.pop(),U):r,Iae(_,U)});function kae(_){var R=fe(_);return R.__chain__=!0,R}function A$e(_,R){return R(_),_}function gI(_,R){return R(_)}var T$e=U0(function(_){var R=_.length,U=R?_[0]:0,K=this.__wrapped__,ae=function(he){return LF(he,_)};return R>1||this.__actions__.length||!(K instanceof Kn)||!z0(U)?this.thru(ae):(K=K.slice(U,+U+(R?1:0)),K.__actions__.push({func:gI,args:[ae],thisArg:r}),new Uu(K,this.__chain__).thru(function(he){return R&&!he.length&&he.push(r),he}))});function E$e(){return kae(this)}function I$e(){return new Uu(this.value(),this.__chain__)}function k$e(){this.__values__===r&&(this.__values__=Hae(this.value()));var _=this.__index__>=this.__values__.length,R=_?r:this.__values__[this.__index__++];return{done:_,value:R}}function P$e(){return this}function R$e(_){for(var R,U=this;U instanceof eI;){var K=_ae(U);K.__index__=0,K.__values__=r,R?ae.__wrapped__=K:R=K;var ae=K;U=U.__wrapped__}return ae.__wrapped__=_,R}function M$e(){var _=this.__wrapped__;if(_ instanceof Kn){var R=_;return this.__actions__.length&&(R=new Kn(this)),R=R.reverse(),R.__actions__.push({func:gI,args:[uj],thisArg:r}),new Uu(R,this.__chain__)}return this.thru(uj)}function D$e(){return Gie(this.__wrapped__,this.__actions__)}var N$e=sI(function(_,R,U){Ei.call(_,U)?++_[U]:F0(_,U,1)});function O$e(_,R,U){var K=mn(_)?iie:AOe;return U&&Tl(_,R,U)&&(R=r),K(_,Vr(R,3))}function L$e(_,R){var U=mn(_)?Mv:Iie;return U(_,Vr(R,3))}var $$e=rae(Sae),B$e=rae(Cae);function F$e(_,R){return xs(vI(_,R),1)}function j$e(_,R){return xs(vI(_,R),F)}function U$e(_,R,U){return U=U===r?1:Pn(U),xs(vI(_,R),U)}function Pae(_,R){var U=mn(_)?Fu:Lv;return U(_,Vr(R,3))}function Rae(_,R){var U=mn(_)?oNe:Eie;return U(_,Vr(R,3))}var z$e=sI(function(_,R,U){Ei.call(_,U)?_[U].push(R):F0(_,U,[R])});function H$e(_,R,U,K){_=rc(_)?_:Lx(_),U=U&&!K?Pn(U):0;var ae=_.length;return U<0&&(U=Po(ae+U,0)),xI(_)?U<=ae&&_.indexOf(R,U)>-1:!!ae&&Cx(_,R,U)>-1}var V$e=Fn(function(_,R,U){var K=-1,ae=typeof R=="function",he=rc(_)?rt(_.length):[];return Lv(_,function(Ae){he[++K]=ae?qo(R,Ae,U):wC(Ae,R,U)}),he}),G$e=sI(function(_,R,U){F0(_,U,R)});function vI(_,R){var U=mn(_)?xa:Nie;return U(_,Vr(R,3))}function W$e(_,R,U,K){return _==null?[]:(mn(R)||(R=R==null?[]:[R]),U=K?r:U,mn(U)||(U=U==null?[]:[U]),Bie(_,R,U))}var q$e=sI(function(_,R,U){_[U?0:1].push(R)},function(){return[[],[]]});function Y$e(_,R,U){var K=mn(_)?SF:lie,ae=arguments.length<3;return K(_,Vr(R,4),U,ae,Lv)}function K$e(_,R,U){var K=mn(_)?sNe:lie,ae=arguments.length<3;return K(_,Vr(R,4),U,ae,Eie)}function Z$e(_,R){var U=mn(_)?Mv:Iie;return U(_,wI(Vr(R,3)))}function Q$e(_){var R=mn(_)?Sie:HOe;return R(_)}function X$e(_,R,U){(U?Tl(_,R,U):R===r)?R=1:R=Pn(R);var K=mn(_)?bOe:VOe;return K(_,R)}function J$e(_){var R=mn(_)?xOe:WOe;return R(_)}function eBe(_){if(_==null)return 0;if(rc(_))return xI(_)?Tx(_):_.length;var R=Gs(_);return R==Me||R==We?_.size:zF(_).length}function tBe(_,R,U){var K=mn(_)?CF:qOe;return U&&Tl(_,R,U)&&(R=r),K(_,Vr(R,3))}var rBe=Fn(function(_,R){if(_==null)return[];var U=R.length;return U>1&&Tl(_,R[0],R[1])?R=[]:U>2&&Tl(R[0],R[1],R[2])&&(R=[R[0]]),Bie(_,xs(R,1),[])}),mI=LNe||function(){return Yn.Date.now()};function nBe(_,R){if(typeof R!="function")throw new ju(o);return _=Pn(_),function(){if(--_<1)return R.apply(this,arguments)}}function Mae(_,R,U){return R=U?r:R,R=_&&R==null?_.length:R,j0(_,S,r,r,r,r,R)}function Dae(_,R){var U;if(typeof R!="function")throw new ju(o);return _=Pn(_),function(){return--_>0&&(U=R.apply(this,arguments)),_<=1&&(R=r),U}}var dj=Fn(function(_,R,U){var K=v;if(U.length){var ae=Nv(U,Nx(dj));K|=C}return j0(_,K,R,U,ae)}),Nae=Fn(function(_,R,U){var K=v|y;if(U.length){var ae=Nv(U,Nx(Nae));K|=C}return j0(R,K,_,U,ae)});function Oae(_,R,U){R=U?r:R;var K=j0(_,b,r,r,r,r,r,R);return K.placeholder=Oae.placeholder,K}function Lae(_,R,U){R=U?r:R;var K=j0(_,w,r,r,r,r,r,R);return K.placeholder=Lae.placeholder,K}function $ae(_,R,U){var K,ae,he,Ae,ke,Ve,dt=0,ht=!1,wt=!1,Ht=!0;if(typeof _!="function")throw new ju(o);R=Gu(R)||0,Na(U)&&(ht=!!U.leading,wt="maxWait"in U,he=wt?Po(Gu(U.maxWait)||0,R):he,Ht="trailing"in U?!!U.trailing:Ht);function yr(oo){var wd=K,G0=ae;return K=ae=r,dt=oo,Ae=_.apply(G0,wd),Ae}function qr(oo){return dt=oo,ke=CC(Hn,R),ht?yr(oo):Ae}function On(oo){var wd=oo-Ve,G0=oo-dt,roe=R-wd;return wt?Vs(roe,he-G0):roe}function Yr(oo){var wd=oo-Ve,G0=oo-dt;return Ve===r||wd>=R||wd<0||wt&&G0>=he}function Hn(){var oo=mI();if(Yr(oo))return ri(oo);ke=CC(Hn,On(oo))}function ri(oo){return ke=r,Ht&&K?yr(oo):(K=ae=r,Ae)}function Kc(){ke!==r&&qie(ke),dt=0,K=Ve=ae=ke=r}function El(){return ke===r?Ae:ri(mI())}function Zc(){var oo=mI(),wd=Yr(oo);if(K=arguments,ae=this,Ve=oo,wd){if(ke===r)return qr(Ve);if(wt)return qie(ke),ke=CC(Hn,R),yr(Ve)}return ke===r&&(ke=CC(Hn,R)),Ae}return Zc.cancel=Kc,Zc.flush=El,Zc}var iBe=Fn(function(_,R){return Tie(_,1,R)}),aBe=Fn(function(_,R,U){return Tie(_,Gu(R)||0,U)});function oBe(_){return j0(_,D)}function yI(_,R){if(typeof _!="function"||R!=null&&typeof R!="function")throw new ju(o);var U=function(){var K=arguments,ae=R?R.apply(this,K):K[0],he=U.cache;if(he.has(ae))return he.get(ae);var Ae=_.apply(this,K);return U.cache=he.set(ae,Ae)||he,Ae};return U.cache=new(yI.Cache||B0),U}yI.Cache=B0;function wI(_){if(typeof _!="function")throw new ju(o);return function(){var R=arguments;switch(R.length){case 0:return!_.call(this);case 1:return!_.call(this,R[0]);case 2:return!_.call(this,R[0],R[1]);case 3:return!_.call(this,R[0],R[1],R[2])}return!_.apply(this,R)}}function sBe(_){return Dae(2,_)}var lBe=YOe(function(_,R){R=R.length==1&&mn(R[0])?xa(R[0],Wc(Vr())):xa(xs(R,1),Wc(Vr()));var U=R.length;return Fn(function(K){for(var ae=-1,he=Vs(K.length,U);++ae=R}),Oy=Rie(function(){return arguments}())?Rie:function(_){return Ga(_)&&Ei.call(_,"callee")&&!mie.call(_,"callee")},mn=rt.isArray,SBe=Sl?Wc(Sl):ROe;function rc(_){return _!=null&&bI(_.length)&&!H0(_)}function ao(_){return Ga(_)&&rc(_)}function CBe(_){return _===!0||_===!1||Ga(_)&&Al(_)==ee}var jv=BNe||Cj,ABe=Cl?Wc(Cl):MOe;function TBe(_){return Ga(_)&&_.nodeType===1&&!AC(_)}function EBe(_){if(_==null)return!0;if(rc(_)&&(mn(_)||typeof _=="string"||typeof _.splice=="function"||jv(_)||Ox(_)||Oy(_)))return!_.length;var R=Gs(_);if(R==Me||R==We)return!_.size;if(SC(_))return!zF(_).length;for(var U in _)if(Ei.call(_,U))return!1;return!0}function IBe(_,R){return bC(_,R)}function kBe(_,R,U){U=typeof U=="function"?U:r;var K=U?U(_,R):r;return K===r?bC(_,R,r,U):!!K}function pj(_){if(!Ga(_))return!1;var R=Al(_);return R==oe||R==V||typeof _.message=="string"&&typeof _.name=="string"&&!AC(_)}function PBe(_){return typeof _=="number"&&wie(_)}function H0(_){if(!Na(_))return!1;var R=Al(_);return R==ye||R==Te||R==J||R==bt}function Fae(_){return typeof _=="number"&&_==Pn(_)}function bI(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=B}function Na(_){var R=typeof _;return _!=null&&(R=="object"||R=="function")}function Ga(_){return _!=null&&typeof _=="object"}var jae=gd?Wc(gd):NOe;function RBe(_,R){return _===R||UF(_,R,ij(R))}function MBe(_,R,U){return U=typeof U=="function"?U:r,UF(_,R,ij(R),U)}function DBe(_){return Uae(_)&&_!=+_}function NBe(_){if(mLe(_))throw new gn(a);return Mie(_)}function OBe(_){return _===null}function LBe(_){return _==null}function Uae(_){return typeof _=="number"||Ga(_)&&Al(_)==Oe}function AC(_){if(!Ga(_)||Al(_)!=it)return!1;var R=q9(_);if(R===null)return!0;var U=Ei.call(R,"constructor")&&R.constructor;return typeof U=="function"&&U instanceof U&&H9.call(U)==MNe}var gj=Bu?Wc(Bu):OOe;function $Be(_){return Fae(_)&&_>=-B&&_<=B}var zae=Fh?Wc(Fh):LOe;function xI(_){return typeof _=="string"||!mn(_)&&Ga(_)&&Al(_)==Le}function Yc(_){return typeof _=="symbol"||Ga(_)&&Al(_)==Ke}var Ox=uC?Wc(uC):$Oe;function BBe(_){return _===r}function FBe(_){return Ga(_)&&Gs(_)==we}function jBe(_){return Ga(_)&&Al(_)==Se}var UBe=fI(HF),zBe=fI(function(_,R){return _<=R});function Hae(_){if(!_)return[];if(rc(_))return xI(_)?vd(_):tc(_);if(dC&&_[dC])return bNe(_[dC]());var R=Gs(_),U=R==Me?PF:R==We?j9:Lx;return U(_)}function V0(_){if(!_)return _===0?_:0;if(_=Gu(_),_===F||_===-F){var R=_<0?-1:1;return R*j}return _===_?_:0}function Pn(_){var R=V0(_),U=R%1;return R===R?U?R-U:R:0}function Vae(_){return _?Ry(Pn(_),0,$):0}function Gu(_){if(typeof _=="number")return _;if(Yc(_))return k;if(Na(_)){var R=typeof _.valueOf=="function"?_.valueOf():_;_=Na(R)?R+"":R}if(typeof _!="string")return _===0?_:+_;_=cie(_);var U=Ue.test(_);return U||Qe.test(_)?Ui(_.slice(2),U?2:8):ge.test(_)?k:+_}function Gae(_){return Uh(_,nc(_))}function HBe(_){return _?Ry(Pn(_),-B,B):_===0?_:0}function Si(_){return _==null?"":qc(_)}var VBe=Mx(function(_,R){if(SC(R)||rc(R)){Uh(R,Yo(R),_);return}for(var U in R)Ei.call(R,U)&&mC(_,U,R[U])}),Wae=Mx(function(_,R){Uh(R,nc(R),_)}),_I=Mx(function(_,R,U,K){Uh(R,nc(R),_,K)}),GBe=Mx(function(_,R,U,K){Uh(R,Yo(R),_,K)}),WBe=U0(LF);function qBe(_,R){var U=Rx(_);return R==null?U:Cie(U,R)}var YBe=Fn(function(_,R){_=zi(_);var U=-1,K=R.length,ae=K>2?R[2]:r;for(ae&&Tl(R[0],R[1],ae)&&(K=1);++U1),he}),Uh(_,rj(_),U),K&&(U=zu(U,f|d|h,aLe));for(var ae=R.length;ae--;)YF(U,R[ae]);return U});function dFe(_,R){return Yae(_,wI(Vr(R)))}var hFe=U0(function(_,R){return _==null?{}:jOe(_,R)});function Yae(_,R){if(_==null)return{};var U=xa(rj(_),function(K){return[K]});return R=Vr(R),Fie(_,U,function(K,ae){return R(K,ae[0])})}function pFe(_,R,U){R=Bv(R,_);var K=-1,ae=R.length;for(ae||(ae=1,_=r);++KR){var K=_;_=R,R=K}if(U||_%1||R%1){var ae=bie();return Vs(_+ae*(R-_+nr("1e-"+((ae+"").length-1))),R)}return GF(_,R)}var AFe=Dx(function(_,R,U){return R=R.toLowerCase(),_+(U?Qae(R):R)});function Qae(_){return yj(Si(_).toLowerCase())}function Xae(_){return _=Si(_),_&&_.replace(ut,gNe).replace(lC,"")}function TFe(_,R,U){_=Si(_),R=qc(R);var K=_.length;U=U===r?K:Ry(Pn(U),0,K);var ae=U;return U-=R.length,U>=0&&_.slice(U,ae)==R}function EFe(_){return _=Si(_),_&&Qt.test(_)?_.replace(Ir,vNe):_}function IFe(_){return _=Si(_),_&&Jt.test(_)?_.replace(_r,"\\$&"):_}var kFe=Dx(function(_,R,U){return _+(U?"-":"")+R.toLowerCase()}),PFe=Dx(function(_,R,U){return _+(U?" ":"")+R.toLowerCase()}),RFe=tae("toLowerCase");function MFe(_,R,U){_=Si(_),R=Pn(R);var K=R?Tx(_):0;if(!R||K>=R)return _;var ae=(R-K)/2;return uI(Q9(ae),U)+_+uI(Z9(ae),U)}function DFe(_,R,U){_=Si(_),R=Pn(R);var K=R?Tx(_):0;return R&&K>>0,U?(_=Si(_),_&&(typeof R=="string"||R!=null&&!gj(R))&&(R=qc(R),!R&&Ax(_))?Fv(vd(_),0,U):_.split(R,U)):[]}var jFe=Dx(function(_,R,U){return _+(U?" ":"")+yj(R)});function UFe(_,R,U){return _=Si(_),U=U==null?0:Ry(Pn(U),0,_.length),R=qc(R),_.slice(U,U+R.length)==R}function zFe(_,R,U){var K=fe.templateSettings;U&&Tl(_,R,U)&&(R=r),_=Si(_),R=_I({},R,K,lae);var ae=_I({},R.imports,K.imports,lae),he=Yo(ae),Ae=kF(ae,he),ke,Ve,dt=0,ht=R.interpolate||Lt,wt="__p += '",Ht=RF((R.escape||Lt).source+"|"+ht.source+"|"+(ht===hr?le:Lt).source+"|"+(R.evaluate||Lt).source+"|$","g"),yr="//# sourceURL="+(Ei.call(R,"sourceURL")?(R.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$9+"]")+` -`;_.replace(Ht,function(Yr,Hn,ri,Kc,El,Zc){return ri||(ri=Kc),wt+=_.slice(dt,Zc).replace(Wr,mNe),Hn&&(ke=!0,wt+=`' + -__e(`+Hn+`) + -'`),El&&(Ve=!0,wt+=`'; -`+El+`; -__p += '`),ri&&(wt+=`' + -((__t = (`+ri+`)) == null ? '' : __t) + -'`),dt=Zc+Yr.length,Yr}),wt+=`'; -`;var qr=Ei.call(R,"variable")&&R.variable;if(!qr)wt=`with (obj) { -`+wt+` -} -`;else if(ve.test(qr))throw new gn(s);wt=(Ve?wt.replace(Pt,""):wt).replace(mr,"$1").replace(qt,"$1;"),wt="function("+(qr||"obj")+`) { -`+(qr?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(ke?", __e = _.escape":"")+(Ve?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+wt+`return __p -}`;var On=eoe(function(){return vi(he,yr+"return "+wt).apply(r,Ae)});if(On.source=wt,pj(On))throw On;return On}function HFe(_){return Si(_).toLowerCase()}function VFe(_){return Si(_).toUpperCase()}function GFe(_,R,U){if(_=Si(_),_&&(U||R===r))return cie(_);if(!_||!(R=qc(R)))return _;var K=vd(_),ae=vd(R),he=uie(K,ae),Ae=fie(K,ae)+1;return Fv(K,he,Ae).join("")}function WFe(_,R,U){if(_=Si(_),_&&(U||R===r))return _.slice(0,hie(_)+1);if(!_||!(R=qc(R)))return _;var K=vd(_),ae=fie(K,vd(R))+1;return Fv(K,0,ae).join("")}function qFe(_,R,U){if(_=Si(_),_&&(U||R===r))return _.replace(Pr,"");if(!_||!(R=qc(R)))return _;var K=vd(_),ae=uie(K,vd(R));return Fv(K,ae).join("")}function YFe(_,R){var U=L,K=O;if(Na(R)){var ae="separator"in R?R.separator:ae;U="length"in R?Pn(R.length):U,K="omission"in R?qc(R.omission):K}_=Si(_);var he=_.length;if(Ax(_)){var Ae=vd(_);he=Ae.length}if(U>=he)return _;var ke=U-Tx(K);if(ke<1)return K;var Ve=Ae?Fv(Ae,0,ke).join(""):_.slice(0,ke);if(ae===r)return Ve+K;if(Ae&&(ke+=Ve.length-ke),gj(ae)){if(_.slice(ke).search(ae)){var dt,ht=Ve;for(ae.global||(ae=RF(ae.source,Si(de.exec(ae))+"g")),ae.lastIndex=0;dt=ae.exec(ht);)var wt=dt.index;Ve=Ve.slice(0,wt===r?ke:wt)}}else if(_.indexOf(qc(ae),ke)!=ke){var Ht=Ve.lastIndexOf(ae);Ht>-1&&(Ve=Ve.slice(0,Ht))}return Ve+K}function KFe(_){return _=Si(_),_&&yt.test(_)?_.replace(Ur,CNe):_}var ZFe=Dx(function(_,R,U){return _+(U?" ":"")+R.toUpperCase()}),yj=tae("toUpperCase");function Jae(_,R,U){return _=Si(_),R=U?r:R,R===r?wNe(_)?ENe(_):uNe(_):_.match(R)||[]}var eoe=Fn(function(_,R){try{return qo(_,r,R)}catch(U){return pj(U)?U:new gn(U)}}),QFe=U0(function(_,R){return Fu(R,function(U){U=zh(U),F0(_,U,dj(_[U],_))}),_});function XFe(_){var R=_==null?0:_.length,U=Vr();return _=R?xa(_,function(K){if(typeof K[1]!="function")throw new ju(o);return[U(K[0]),K[1]]}):[],Fn(function(K){for(var ae=-1;++aeB)return[];var U=$,K=Vs(_,$);R=Vr(R),_-=$;for(var ae=IF(K,R);++U<_;)R(U);return ae}function wje(_){return mn(_)?xa(_,zh):Yc(_)?[_]:tc(xae(Si(_)))}function bje(_){var R=++RNe;return Si(_)+R}var xje=cI(function(_,R){return _+R},0),_je=ej("ceil"),Sje=cI(function(_,R){return _/R},1),Cje=ej("floor");function Aje(_){return _&&_.length?rI(_,ic,FF):r}function Tje(_,R){return _&&_.length?rI(_,Vr(R,2),FF):r}function Eje(_){return sie(_,ic)}function Ije(_,R){return sie(_,Vr(R,2))}function kje(_){return _&&_.length?rI(_,ic,HF):r}function Pje(_,R){return _&&_.length?rI(_,Vr(R,2),HF):r}var Rje=cI(function(_,R){return _*R},1),Mje=ej("round"),Dje=cI(function(_,R){return _-R},0);function Nje(_){return _&&_.length?EF(_,ic):0}function Oje(_,R){return _&&_.length?EF(_,Vr(R,2)):0}return fe.after=nBe,fe.ary=Mae,fe.assign=VBe,fe.assignIn=Wae,fe.assignInWith=_I,fe.assignWith=GBe,fe.at=WBe,fe.before=Dae,fe.bind=dj,fe.bindAll=QFe,fe.bindKey=Nae,fe.castArray=gBe,fe.chain=kae,fe.chunk=CLe,fe.compact=ALe,fe.concat=TLe,fe.cond=XFe,fe.conforms=JFe,fe.constant=wj,fe.countBy=N$e,fe.create=qBe,fe.curry=Oae,fe.curryRight=Lae,fe.debounce=$ae,fe.defaults=YBe,fe.defaultsDeep=KBe,fe.defer=iBe,fe.delay=aBe,fe.difference=ELe,fe.differenceBy=ILe,fe.differenceWith=kLe,fe.drop=PLe,fe.dropRight=RLe,fe.dropRightWhile=MLe,fe.dropWhile=DLe,fe.fill=NLe,fe.filter=L$e,fe.flatMap=F$e,fe.flatMapDeep=j$e,fe.flatMapDepth=U$e,fe.flatten=Aae,fe.flattenDeep=OLe,fe.flattenDepth=LLe,fe.flip=oBe,fe.flow=tje,fe.flowRight=rje,fe.fromPairs=$Le,fe.functions=rFe,fe.functionsIn=nFe,fe.groupBy=z$e,fe.initial=FLe,fe.intersection=jLe,fe.intersectionBy=ULe,fe.intersectionWith=zLe,fe.invert=aFe,fe.invertBy=oFe,fe.invokeMap=V$e,fe.iteratee=bj,fe.keyBy=G$e,fe.keys=Yo,fe.keysIn=nc,fe.map=vI,fe.mapKeys=lFe,fe.mapValues=cFe,fe.matches=nje,fe.matchesProperty=ije,fe.memoize=yI,fe.merge=uFe,fe.mergeWith=qae,fe.method=aje,fe.methodOf=oje,fe.mixin=xj,fe.negate=wI,fe.nthArg=lje,fe.omit=fFe,fe.omitBy=dFe,fe.once=sBe,fe.orderBy=W$e,fe.over=cje,fe.overArgs=lBe,fe.overEvery=uje,fe.overSome=fje,fe.partial=hj,fe.partialRight=Bae,fe.partition=q$e,fe.pick=hFe,fe.pickBy=Yae,fe.property=toe,fe.propertyOf=dje,fe.pull=WLe,fe.pullAll=Eae,fe.pullAllBy=qLe,fe.pullAllWith=YLe,fe.pullAt=KLe,fe.range=hje,fe.rangeRight=pje,fe.rearg=cBe,fe.reject=Z$e,fe.remove=ZLe,fe.rest=uBe,fe.reverse=uj,fe.sampleSize=X$e,fe.set=gFe,fe.setWith=vFe,fe.shuffle=J$e,fe.slice=QLe,fe.sortBy=rBe,fe.sortedUniq=i$e,fe.sortedUniqBy=a$e,fe.split=FFe,fe.spread=fBe,fe.tail=o$e,fe.take=s$e,fe.takeRight=l$e,fe.takeRightWhile=c$e,fe.takeWhile=u$e,fe.tap=A$e,fe.throttle=dBe,fe.thru=gI,fe.toArray=Hae,fe.toPairs=Kae,fe.toPairsIn=Zae,fe.toPath=wje,fe.toPlainObject=Gae,fe.transform=mFe,fe.unary=hBe,fe.union=f$e,fe.unionBy=d$e,fe.unionWith=h$e,fe.uniq=p$e,fe.uniqBy=g$e,fe.uniqWith=v$e,fe.unset=yFe,fe.unzip=fj,fe.unzipWith=Iae,fe.update=wFe,fe.updateWith=bFe,fe.values=Lx,fe.valuesIn=xFe,fe.without=m$e,fe.words=Jae,fe.wrap=pBe,fe.xor=y$e,fe.xorBy=w$e,fe.xorWith=b$e,fe.zip=x$e,fe.zipObject=_$e,fe.zipObjectDeep=S$e,fe.zipWith=C$e,fe.entries=Kae,fe.entriesIn=Zae,fe.extend=Wae,fe.extendWith=_I,xj(fe,fe),fe.add=xje,fe.attempt=eoe,fe.camelCase=AFe,fe.capitalize=Qae,fe.ceil=_je,fe.clamp=_Fe,fe.clone=vBe,fe.cloneDeep=yBe,fe.cloneDeepWith=wBe,fe.cloneWith=mBe,fe.conformsTo=bBe,fe.deburr=Xae,fe.defaultTo=eje,fe.divide=Sje,fe.endsWith=TFe,fe.eq=yd,fe.escape=EFe,fe.escapeRegExp=IFe,fe.every=O$e,fe.find=$$e,fe.findIndex=Sae,fe.findKey=ZBe,fe.findLast=B$e,fe.findLastIndex=Cae,fe.findLastKey=QBe,fe.floor=Cje,fe.forEach=Pae,fe.forEachRight=Rae,fe.forIn=XBe,fe.forInRight=JBe,fe.forOwn=eFe,fe.forOwnRight=tFe,fe.get=vj,fe.gt=xBe,fe.gte=_Be,fe.has=iFe,fe.hasIn=mj,fe.head=Tae,fe.identity=ic,fe.includes=H$e,fe.indexOf=BLe,fe.inRange=SFe,fe.invoke=sFe,fe.isArguments=Oy,fe.isArray=mn,fe.isArrayBuffer=SBe,fe.isArrayLike=rc,fe.isArrayLikeObject=ao,fe.isBoolean=CBe,fe.isBuffer=jv,fe.isDate=ABe,fe.isElement=TBe,fe.isEmpty=EBe,fe.isEqual=IBe,fe.isEqualWith=kBe,fe.isError=pj,fe.isFinite=PBe,fe.isFunction=H0,fe.isInteger=Fae,fe.isLength=bI,fe.isMap=jae,fe.isMatch=RBe,fe.isMatchWith=MBe,fe.isNaN=DBe,fe.isNative=NBe,fe.isNil=LBe,fe.isNull=OBe,fe.isNumber=Uae,fe.isObject=Na,fe.isObjectLike=Ga,fe.isPlainObject=AC,fe.isRegExp=gj,fe.isSafeInteger=$Be,fe.isSet=zae,fe.isString=xI,fe.isSymbol=Yc,fe.isTypedArray=Ox,fe.isUndefined=BBe,fe.isWeakMap=FBe,fe.isWeakSet=jBe,fe.join=HLe,fe.kebabCase=kFe,fe.last=Vu,fe.lastIndexOf=VLe,fe.lowerCase=PFe,fe.lowerFirst=RFe,fe.lt=UBe,fe.lte=zBe,fe.max=Aje,fe.maxBy=Tje,fe.mean=Eje,fe.meanBy=Ije,fe.min=kje,fe.minBy=Pje,fe.stubArray=Sj,fe.stubFalse=Cj,fe.stubObject=gje,fe.stubString=vje,fe.stubTrue=mje,fe.multiply=Rje,fe.nth=GLe,fe.noConflict=sje,fe.noop=_j,fe.now=mI,fe.pad=MFe,fe.padEnd=DFe,fe.padStart=NFe,fe.parseInt=OFe,fe.random=CFe,fe.reduce=Y$e,fe.reduceRight=K$e,fe.repeat=LFe,fe.replace=$Fe,fe.result=pFe,fe.round=Mje,fe.runInContext=Be,fe.sample=Q$e,fe.size=eBe,fe.snakeCase=BFe,fe.some=tBe,fe.sortedIndex=XLe,fe.sortedIndexBy=JLe,fe.sortedIndexOf=e$e,fe.sortedLastIndex=t$e,fe.sortedLastIndexBy=r$e,fe.sortedLastIndexOf=n$e,fe.startCase=jFe,fe.startsWith=UFe,fe.subtract=Dje,fe.sum=Nje,fe.sumBy=Oje,fe.template=zFe,fe.times=yje,fe.toFinite=V0,fe.toInteger=Pn,fe.toLength=Vae,fe.toLower=HFe,fe.toNumber=Gu,fe.toSafeInteger=HBe,fe.toString=Si,fe.toUpper=VFe,fe.trim=GFe,fe.trimEnd=WFe,fe.trimStart=qFe,fe.truncate=YFe,fe.unescape=KFe,fe.uniqueId=bje,fe.upperCase=ZFe,fe.upperFirst=yj,fe.each=Pae,fe.eachRight=Rae,fe.first=Tae,xj(fe,function(){var _={};return jh(fe,function(R,U){Ei.call(fe.prototype,U)||(_[U]=R)}),_}(),{chain:!1}),fe.VERSION=n,Fu(["bind","bindKey","curry","curryRight","partial","partialRight"],function(_){fe[_].placeholder=fe}),Fu(["drop","take"],function(_,R){Kn.prototype[_]=function(U){U=U===r?1:Po(Pn(U),0);var K=this.__filtered__&&!R?new Kn(this):this.clone();return K.__filtered__?K.__takeCount__=Vs(U,K.__takeCount__):K.__views__.push({size:Vs(U,$),type:_+(K.__dir__<0?"Right":"")}),K},Kn.prototype[_+"Right"]=function(U){return this.reverse()[_](U).reverse()}}),Fu(["filter","map","takeWhile"],function(_,R){var U=R+1,K=U==T||U==N;Kn.prototype[_]=function(ae){var he=this.clone();return he.__iteratees__.push({iteratee:Vr(ae,3),type:U}),he.__filtered__=he.__filtered__||K,he}}),Fu(["head","last"],function(_,R){var U="take"+(R?"Right":"");Kn.prototype[_]=function(){return this[U](1).value()[0]}}),Fu(["initial","tail"],function(_,R){var U="drop"+(R?"":"Right");Kn.prototype[_]=function(){return this.__filtered__?new Kn(this):this[U](1)}}),Kn.prototype.compact=function(){return this.filter(ic)},Kn.prototype.find=function(_){return this.filter(_).head()},Kn.prototype.findLast=function(_){return this.reverse().find(_)},Kn.prototype.invokeMap=Fn(function(_,R){return typeof _=="function"?new Kn(this):this.map(function(U){return wC(U,_,R)})}),Kn.prototype.reject=function(_){return this.filter(wI(Vr(_)))},Kn.prototype.slice=function(_,R){_=Pn(_);var U=this;return U.__filtered__&&(_>0||R<0)?new Kn(U):(_<0?U=U.takeRight(-_):_&&(U=U.drop(_)),R!==r&&(R=Pn(R),U=R<0?U.dropRight(-R):U.take(R-_)),U)},Kn.prototype.takeRightWhile=function(_){return this.reverse().takeWhile(_).reverse()},Kn.prototype.toArray=function(){return this.take($)},jh(Kn.prototype,function(_,R){var U=/^(?:filter|find|map|reject)|While$/.test(R),K=/^(?:head|last)$/.test(R),ae=fe[K?"take"+(R=="last"?"Right":""):R],he=K||/^find/.test(R);ae&&(fe.prototype[R]=function(){var Ae=this.__wrapped__,ke=K?[1]:arguments,Ve=Ae instanceof Kn,dt=ke[0],ht=Ve||mn(Ae),wt=function(Hn){var ri=ae.apply(fe,Dv([Hn],ke));return K&&Ht?ri[0]:ri};ht&&U&&typeof dt=="function"&&dt.length!=1&&(Ve=ht=!1);var Ht=this.__chain__,yr=!!this.__actions__.length,qr=he&&!Ht,On=Ve&&!yr;if(!he&&ht){Ae=On?Ae:new Kn(this);var Yr=_.apply(Ae,ke);return Yr.__actions__.push({func:gI,args:[wt],thisArg:r}),new Uu(Yr,Ht)}return qr&&On?_.apply(this,ke):(Yr=this.thru(wt),qr?K?Yr.value()[0]:Yr.value():Yr)})}),Fu(["pop","push","shift","sort","splice","unshift"],function(_){var R=U9[_],U=/^(?:push|sort|unshift)$/.test(_)?"tap":"thru",K=/^(?:pop|shift)$/.test(_);fe.prototype[_]=function(){var ae=arguments;if(K&&!this.__chain__){var he=this.value();return R.apply(mn(he)?he:[],ae)}return this[U](function(Ae){return R.apply(mn(Ae)?Ae:[],ae)})}}),jh(Kn.prototype,function(_,R){var U=fe[R];if(U){var K=U.name+"";Ei.call(Px,K)||(Px[K]=[]),Px[K].push({name:R,func:U})}}),Px[lI(r,y).name]=[{name:"wrapper",func:r}],Kn.prototype.clone=KNe,Kn.prototype.reverse=ZNe,Kn.prototype.value=QNe,fe.prototype.at=T$e,fe.prototype.chain=E$e,fe.prototype.commit=I$e,fe.prototype.next=k$e,fe.prototype.plant=R$e,fe.prototype.reverse=M$e,fe.prototype.toJSON=fe.prototype.valueOf=fe.prototype.value=D$e,fe.prototype.first=fe.prototype.head,dC&&(fe.prototype[dC]=P$e),fe},Ex=INe();gi?((gi.exports=Ex)._=Ex,io._=Ex):Yn._=Ex}).call(t4)})(oY,oY.exports);var NTt=Object.defineProperty,OTt=Object.defineProperties,LTt=Object.getOwnPropertyDescriptors,fde=Object.getOwnPropertySymbols,$Tt=Object.prototype.hasOwnProperty,BTt=Object.prototype.propertyIsEnumerable,dde=(t,e,r)=>e in t?NTt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m7=(t,e)=>{for(var r in e||(e={}))$Tt.call(e,r)&&dde(t,r,e[r]);if(fde)for(var r of fde(e))BTt.call(e,r)&&dde(t,r,e[r]);return t},FTt=(t,e)=>OTt(t,LTt(e));function mh(t,e,r){var n;const i=HA(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${x6e}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function tx(t){return t.includes(":")?t.split(":")[1]:t}function _6e(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function jTt(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function Cz(t={},e={}){const r=hde(t),n=hde(e);return oY.exports.merge(r,n)}function hde(t){var e,r,n,i;const a={};if(!DT(t))return a;for(const[o,s]of Object.entries(t)){const l=KJ(o)?[o]:s.chains,c=s.methods||[],u=s.events||[],f=s.rpcMap||{},d=lA(o);a[d]=FTt(m7(m7({},a[d]),s),{chains:GR(l,(e=a[d])==null?void 0:e.chains),methods:GR(c,(r=a[d])==null?void 0:r.methods),events:GR(u,(n=a[d])==null?void 0:n.events),rpcMap:m7(m7({},f),(i=a[d])==null?void 0:i.rpcMap)})}return a}function UTt(t){return t.includes(":")?t.split(":")[2]:t}function pde(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],a=n.events||[],o=n.accounts||[],s=KJ(r)?[r]:n.chains?n.chains:_6e(n.accounts);e[r]={chains:s,methods:i,events:a,accounts:o}}return e}function Az(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const S6e={},Ai=t=>S6e[t],Tz=(t,e)=>{S6e[t]=e};class zTt{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=tx(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}var HTt=Object.defineProperty,VTt=Object.defineProperties,GTt=Object.getOwnPropertyDescriptors,gde=Object.getOwnPropertySymbols,WTt=Object.prototype.hasOwnProperty,qTt=Object.prototype.propertyIsEnumerable,vde=(t,e,r)=>e in t?HTt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mde=(t,e)=>{for(var r in e||(e={}))WTt.call(e,r)&&vde(t,r,e[r]);if(gde)for(var r of gde(e))qTt.call(e,r)&&vde(t,r,e[r]);return t},yde=(t,e)=>VTt(t,GTt(e));class YTt{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||mh(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(tx(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const a=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),s=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(s!=null&&s[a])return s==null?void 0:s[a];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:yde(mde({},o.sessionProperties||{}),{capabilities:yde(mde({},s||{}),{[a]:l})})})}catch(c){console.warn("Failed to update session with capabilities",c)}return l}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),a=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(a){const s=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(s,e)}catch(l){console.warn("Failed to fetch call status from bundler",l,s)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(s){console.warn("Failed to fetch call status from custom bundler",s,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Vm("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,r){return`${DTt}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class KTt{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=tx(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}class ZTt{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=tx(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}class QTt{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||mh(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Th(new S0(n,Ai("disableProviderPing")))}}class XTt{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=tx(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}class JTt{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=tx(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}class eEt{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=tx(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}class tEt{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||mh(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace);return typeof n>"u"?void 0:new Th(new S0(n,Ai("disableProviderPing")))}}class rEt{constructor(e){this.name=A_,this.namespace=e.namespace,this.events=Ai("events"),this.client=Ai("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Eh.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const a=HA(i);n[`${a.namespace}:${a.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||mh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Th(new S0(n,Ai("disableProviderPing")))}}var nEt=Object.defineProperty,iEt=Object.defineProperties,aEt=Object.getOwnPropertyDescriptors,wde=Object.getOwnPropertySymbols,oEt=Object.prototype.hasOwnProperty,sEt=Object.prototype.propertyIsEnumerable,bde=(t,e,r)=>e in t?nEt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,y7=(t,e)=>{for(var r in e||(e={}))oEt.call(e,r)&&bde(t,r,e[r]);if(wde)for(var r of wde(e))sEt.call(e,r)&&bde(t,r,e[r]);return t},Ez=(t,e)=>iEt(t,aEt(e));class tee{constructor(e){this.events=new TJ,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:a8(dS({level:(e==null?void 0:e.logger)||cde})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new tee(e);return await r.initialize(),r}async request(e,r,n){const[i,a]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:y7({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const a=new Date().getTime();this.request(e,n,i).then(o=>r(null,y$(a,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:$i("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const a=await i();if(this.session=a.session,this.session){const o=pde(this.session.namespaces);this.namespaces=Cz(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a;const o=pde(a.namespaces);this.namespaces=Cz(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==w6e)throw a;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),a=this.getProvider(n);a.name===A_?a.setDefaultChain(`${n}:${i}`,r):a.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Zb(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await xTt.init({core:this.providerOpts.core,logger:this.providerOpts.logger||cde,relayUrl:this.providerOpts.relayUrl||PTt,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>lA(r)))];Tz("client",this.client),Tz("events",this.events),Tz("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=jTt(r,this.session),i=_6e(n),a=Cz(this.namespaces,this.optionalNamespaces),o=Ez(y7({},a[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new YTt({namespace:o});break;case"algorand":this.rpcProviders[r]=new QTt({namespace:o});break;case"solana":this.rpcProviders[r]=new KTt({namespace:o});break;case"cosmos":this.rpcProviders[r]=new ZTt({namespace:o});break;case"polkadot":this.rpcProviders[r]=new zTt({namespace:o});break;case"cip34":this.rpcProviders[r]=new XTt({namespace:o});break;case"elrond":this.rpcProviders[r]=new JTt({namespace:o});break;case"multiversx":this.rpcProviders[r]=new eEt({namespace:o});break;case"near":this.rpcProviders[r]=new tEt({namespace:o});break;default:this.rpcProviders[A_]?this.rpcProviders[A_].updateNamespace(o):this.rpcProviders[A_]=new rEt({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Zb(i)&&this.events.emit("accountsChanged",i.map(UTt))}else if(n.name==="chainChanged"){const i=r.chainId,a=r.event.data,o=lA(i),s=Az(i)!==Az(a)?`${o}:${Az(a)}`:i;this.onChainChanged(s)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,a=(n=this.client)==null?void 0:n.session.get(e);this.session=Ez(y7({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ez(y7({},$i("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Eh.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[A_]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>lA(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=lA(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${ude}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${ude}/${e}`)}}const hN={getMethodsByChainNamespace(t){switch(t){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_switchEthereumChain"];default:return[]}},createNamespaces(t){return t.reduce((e,r)=>{const{chainId:n,chainNamespace:i,rpcUrl:a}=r,o=this.getMethodsByChainNamespace(i);e[i]||(e[i]={methods:o,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});const s=`${i}:${n}`,l=e[i];return l.chains.push(s),l!=null&&l.rpcMap&&(l.rpcMap[n]=a),e},{})},getChainsFromNamespaces(t={}){return Object.values(t).flatMap(e=>{const r=e.chains||[],n=e.accounts.map(i=>{const[a,o]=i.split(":");return`${a}:${o}`});return Array.from(new Set([...r,...n]))})}},Ju=wa({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),_5={state:Ju,subscribeKey(t,e){return gl(Ju,t,e)},subscribeProviders(t){return Hl(Ju.providers,()=>t(Ju.providers))},setProvider(t,e){e&&(Ju.providers[t]=Wd(e))},getProvider(t){return Ju.providers[t]},setProviderId(t,e){e&&(Ju.providerIds[t]=e)},getProviderId(t){return Ju.providerIds[t]},reset(){Ju.providers={eip155:void 0,solana:void 0,polkadot:void 0},Ju.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(t){Ju.providers[t]=void 0,Ju.providerIds[t]=void 0}},lEt=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class cEt{constructor(e){this.appKit=void 0,this.isUniversalAdapterClient=!0,this.defaultNetwork=void 0,this.options=void 0,this.adapterType="universal",this.reportErrors=!0;const{siweConfig:r,metadata:n}=e;this.caipNetworks=e.networks,this.chainNamespace="eip155",this.metadata=n,this.defaultNetwork=e.defaultNetwork||e.networks[0],this.networkControllerClient={switchCaipNetwork:i=>{if(i)try{this.switchNetwork(i)}catch{throw new Error("networkControllerClient:switchCaipNetwork - unable to switch chain")}},getApprovedCaipNetworksData:async()=>{var o;const i=await this.getWalletConnectProvider();if(!i)return Promise.resolve({supportsAllNetworks:!1,approvedCaipNetworkIds:[]});const a=hN.getChainsFromNamespaces((o=i.session)==null?void 0:o.namespaces);return Promise.resolve({supportsAllNetworks:!1,approvedCaipNetworkIds:a})}},this.connectionControllerClient={connectWalletConnect:async i=>{var o,s,l,c,u,f,d,h,p,g,v;const a=await this.getWalletConnectProvider();if(!a)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(a.on("display_uri",y=>{i(y)}),Pe.state.activeChain&&((l=(s=(o=Pe.state)==null?void 0:o.chains)==null?void 0:s.get(Pe.state.activeChain))==null?void 0:l.adapterType)==="wagmi"){const y=Pe.state.chains.get(Pe.state.activeChain);await((u=(c=y==null?void 0:y.connectionControllerClient)==null?void 0:c.connectWalletConnect)==null?void 0:u.call(c,i)),this.setWalletConnectProvider()}else{const y=await((f=r==null?void 0:r.getMessageParams)==null?void 0:f.call(r)),m=(d=r==null?void 0:r.options)==null?void 0:d.enabled,b=typeof(a==null?void 0:a.authenticate)=="function",w=y&&Object.keys(y||{}).length>0;if(r&&m&&y&&b&&w&&Pe.state.activeChain==="eip155"){const{SIWEController:C,getDidChainId:A,getDidAddress:S}=await Bf(async()=>{const{SIWEController:O,getDidChainId:P,getDidAddress:x}=await import("./index-Cdw1Pm6b.js");return{SIWEController:O,getDidChainId:P,getDidAddress:x}},[],import.meta.url),I=(h=this.caipNetworks)==null?void 0:h.filter(O=>O.chainNamespace==="eip155").map(O=>O.id);y.chains=(p=this.caipNetworks)==null?void 0:p.filter(O=>O.chainNamespace==="eip155").map(O=>O.chainId);const D=await a.authenticate({nonce:await((g=r==null?void 0:r.getNonce)==null?void 0:g.call(r)),methods:[...lEt],...y,chains:I}),L=(v=D==null?void 0:D.auths)==null?void 0:v[0];if(L){const{p:O,s:P}=L,x=A(O.iss),T=S(O.iss);T&&x&&C.setSession({address:T,chainId:parseInt(x,10)});try{const E=a.client.formatAuthMessage({request:O,iss:O.iss});await C.verifyMessage({message:E,signature:P.s,cacao:L})}catch(E){throw console.error("Error verifying message",E),await a.disconnect().catch(console.error),await C.signOut().catch(console.error),E}}}else{const C=hN.createNamespaces(this.caipNetworks);await a.connect({optionalNamespaces:C})}this.setWalletConnectProvider()}},disconnect:async()=>{var i,a,o,s;if(na.removeItem(ra.WALLET_ID),(i=r==null?void 0:r.options)!=null&&i.signOutOnDisconnect){const{SIWEController:l}=await Bf(async()=>{const{SIWEController:c}=await import("./index-Cdw1Pm6b.js");return{SIWEController:c}},[],import.meta.url);await l.signOut()}await((a=this.walletConnectProvider)==null?void 0:a.disconnect()),(o=this.appKit)==null||o.resetAccount("eip155"),(s=this.appKit)==null||s.resetAccount("solana")},signMessage:async i=>{const a=await this.getWalletConnectProvider(),o=Pe.state.activeCaipAddress,s=gt.getPlainAddress(o);if(!a)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await a.request({method:"personal_sign",params:[i,s]})},estimateGas:async()=>await Promise.resolve(BigInt(0)),getEnsAvatar:async i=>await Promise.resolve(i),getEnsAddress:async i=>await Promise.resolve(i),writeContract:async()=>await Promise.resolve("0x"),sendTransaction:async()=>await Promise.resolve("0x"),parseUnits:()=>BigInt(0),formatUnits:()=>""}}construct(e,r){this.appKit=e,this.options=r,this.createProvider(),this.syncRequestedNetworks(this.caipNetworks),this.syncConnectors()}switchNetwork(e){e&&this.walletConnectProvider&&this.walletConnectProvider.setDefaultChain(e.id)}async disconnect(){var e,r;this.walletConnectProvider&&(await this.walletConnectProvider.disconnect(),(e=this.appKit)==null||e.resetAccount("eip155"),(r=this.appKit)==null||r.resetAccount("solana"))}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch{throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")}return this.walletConnectProvider}createProvider(){var e,r;return!this.walletConnectProviderInitPromise&&typeof window<"u"&&((e=this.options)!=null&&e.projectId)&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider((r=this.options)==null?void 0:r.projectId)),this.walletConnectProviderInitPromise}async initWalletConnectProvider(e){const r=i1t.createLogger((i,...a)=>{if(i.message.includes(ET.UniversalProviderErrors.UNAUTHORIZED_DOMAIN_NOT_ALLOWED)){this.reportErrors&&(cb.open(ET.ALERT_ERRORS.INVALID_APP_CONFIGURATION,"error"),this.reportErrors=!1);return}console.error(...a)}),n={projectId:e,metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]},logger:r};this.walletConnectProvider=await tee.init(n),await this.checkActiveWalletConnectProvider()}syncRequestedNetworks(e){[...new Set(e.map(n=>n.chainNamespace))].filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(a=>a.chainNamespace===n),n)})}async checkActiveWalletConnectProvider(){const e=await this.getWalletConnectProvider(),r=na.getItem(ra.WALLET_ID);e&&r===Sn.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var r,n,i;na.setItem(ra.WALLET_ID,Sn.WALLET_CONNECT_CONNECTOR_ID);const e=(n=(r=this.walletConnectProvider)==null?void 0:r.session)==null?void 0:n.namespaces;if(e){Object.keys(e).reverse().forEach(l=>{var u,f,d;const c=(u=e==null?void 0:e[l])==null?void 0:u.accounts[0];_5.setProvider(l,this.walletConnectProvider),_5.setProviderId(l,"walletConnect"),(f=this.appKit)==null||f.setApprovedCaipNetworksData(l),c&&((d=this.appKit)==null||d.setCaipAddress(c,l))});const o=jn.getStoredActiveCaipNetwork(),s=Pe.state.activeCaipNetwork;try{o?Jr.setActiveCaipNetwork(o):s?(i=Jr.state.approvedCaipNetworkIds)!=null&&i.includes(s.id)||this.setDefaultNetwork(e):this.setDefaultNetwork(e)}catch(l){console.warn(">>> Error setting active caip network",l)}}this.syncAccount(),this.watchWalletConnect()}setDefaultNetwork(e){var n,i;const r=(n=this.caipNetworks[0])==null?void 0:n.chainNamespace;if(r){const a=e==null?void 0:e[r];if(a!=null&&a.chains){const o=a.chains[0];if(o){const s=(i=Jr.state)==null?void 0:i.requestedCaipNetworks;if(s){const l=s.find(c=>c.id===o);l&&Jr.setActiveCaipNetwork(l)}}}}}async watchWalletConnect(){var o;const e=await this.getWalletConnectProvider(),r=((o=e==null?void 0:e.session)==null?void 0:o.namespaces)||{};function n(){Object.keys(r).forEach(s=>{Ze.resetAccount(s)}),Dr.resetWcConnection(),na.removeItem(ra.WALLET_ID),e==null||e.removeListener("disconnect",n),e==null||e.removeListener("accountsChanged",i)}const i=s=>{s.length>0&&this.syncAccount()},a=s=>{var u,f,d;const l=this.caipNetworks.find(h=>h.chainId==s),c=(u=this.appKit)==null?void 0:u.getCaipNetwork();if(!l){Jr.setActiveCaipNetwork({chainId:Number(s),id:`eip155:${s}`,name:"Unknown Network",currency:"",explorerUrl:"",rpcUrl:"",chainNamespace:((f=this.appKit)==null?void 0:f.getActiveChainNamespace())||"eip155"});return}(!c||(c==null?void 0:c.id)!==(l==null?void 0:l.id))&&((d=this.appKit)==null||d.setCaipNetwork(l))};e&&(e.on("disconnect",n),e.on("accountsChanged",i),e.on("chainChanged",a))}getProviderData(){var i,a,o,s;const e=((a=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:a.namespaces)||{},r=((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1,n=((s=this.appKit)==null?void 0:s.getPreferredAccountType())||"";return{provider:this.walletConnectProvider,namespaces:e,namespaceKeys:e?Object.keys(e):[],isConnected:r,preferredAccountType:n}}syncAccount(){var a,o,s,l;const{namespaceKeys:e,namespaces:r}=this.getProviderData(),n=(a=this.appKit)==null?void 0:a.getPreferredAccountType();((o=this.appKit)==null?void 0:o.getIsConnectedState())||!1?e.forEach(async c=>{var h,p,g,v,y;const u=c,f=(h=r==null?void 0:r[c])==null?void 0:h.accounts[0];((p=this.appKit)==null?void 0:p.getCaipAddress(u))||((g=this.appKit)==null||g.setPreferredAccountType(n,u),(v=this.appKit)==null||v.setCaipAddress(f,u),this.syncConnectedWalletInfo(),await Promise.all([(y=this.appKit)==null?void 0:y.setApprovedCaipNetworksData(u)])),this.syncAccounts()}):((s=this.appKit)==null||s.resetWcConnection(),(l=this.appKit)==null||l.resetNetwork(),this.syncAccounts(!0))}syncAccounts(e=!1){const{namespaces:r}=this.getProviderData();Object.keys(r).forEach(i=>{var o,s,l,c;const a=(s=(o=r==null?void 0:r[i])==null?void 0:o.accounts)==null?void 0:s.map(u=>{const[,,f]=u.split(":");return f}).filter((u,f,d)=>d.indexOf(u)===f);e&&((l=this.appKit)==null||l.setAllAccounts([],i)),a&&((c=this.appKit)==null||c.setAllAccounts(a.map(u=>({address:u,type:"eoa"})),i))})}syncConnectedWalletInfo(){var i,a;const e=na.getItem(ra.WALLET_ID),r=((a=(i=this.walletConnectProvider)==null?void 0:i.session)==null?void 0:a.namespaces)||{};Object.keys(r).forEach(o=>{var s,l,c,u,f;(s=this.walletConnectProvider)!=null&&s.session?(c=this.appKit)==null||c.setConnectedWalletInfo({...this.walletConnectProvider.session.peer.metadata,name:this.walletConnectProvider.session.peer.metadata.name,icon:(l=this.walletConnectProvider.session.peer.metadata.icons)==null?void 0:l[0]},o):e&&((u=this.appKit)==null||u.setConnectedWalletInfo({name:e},"eip155"),(f=this.appKit)==null||f.setConnectedWalletInfo({name:e},"solana"))})}syncConnectors(){var r;const e=[];e.push({id:Sn.WALLET_CONNECT_CONNECTOR_ID,explorerId:Rf.ConnectorExplorerIds[Sn.WALLET_CONNECT_CONNECTOR_ID],imageId:Rf.ConnectorImageIds[Sn.WALLET_CONNECT_CONNECTOR_ID],name:Rf.ConnectorNamesMap[Sn.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(r=this.appKit)==null||r.setConnectors(e)}}let xde=!1;class uEt{constructor(e){var r;this.initPromise=void 0,this.setStatus=(n,i)=>{Ze.setStatus(n,i)},this.getIsConnectedState=()=>!!Pe.state.activeCaipAddress,this.setAllAccounts=(n,i)=>{Ze.setAllAccounts(n,i),At.setHasMultipleAddresses((n==null?void 0:n.length)>1)},this.addAddressLabel=(n,i,a)=>{Ze.addAddressLabel(n,i,a)},this.removeAddressLabel=(n,i)=>{Ze.removeAddressLabel(n,i)},this.getCaipAddress=n=>Pe.state.activeChain===n||!n?Pe.state.activeCaipAddress:Pe.getAccountProp("caipAddress",n),this.getAddress=n=>Pe.state.activeChain===n||!n?Ze.state.address:Pe.getAccountProp("address",n),this.getProvider=()=>Ze.state.provider,this.getPreferredAccountType=()=>Ze.state.preferredAccountType,this.setCaipAddress=(n,i)=>{Ze.setCaipAddress(n,i)},this.setProvider=(n,i)=>{Ze.setProvider(n,i)},this.setBalance=(n,i,a)=>{Ze.setBalance(n,i,a)},this.setProfileName=(n,i)=>{Ze.setProfileName(n,i)},this.setProfileImage=(n,i)=>{Ze.setProfileImage(n,i)},this.resetAccount=n=>{Ze.resetAccount(n)},this.setCaipNetwork=n=>{Pe.setActiveCaipNetwork(n)},this.getCaipNetwork=n=>{var i;return n?(i=Jr.getRequestedCaipNetworks().filter(a=>a.chainNamespace===n))==null?void 0:i[0]:Pe.state.activeCaipNetwork},this.getCaipNetworks=()=>Jr.getRequestedCaipNetworks(),this.getActiveChainNamespace=()=>Pe.state.activeChain,this.setRequestedCaipNetworks=(n,i)=>{Jr.setRequestedCaipNetworks(n,i)},this.getApprovedCaipNetworkIds=()=>Jr.getApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=n=>Jr.setApprovedCaipNetworksData(n),this.resetNetwork=()=>{Jr.resetNetwork()},this.setConnectors=n=>{const i=[...rr.getConnectors(),...n];rr.setConnectors(i)},this.addConnector=n=>{rr.addConnector(n)},this.getConnectors=()=>rr.getConnectors(),this.resetWcConnection=()=>{Dr.resetWcConnection()},this.fetchIdentity=n=>Ma.fetchIdentity(n),this.setAddressExplorerUrl=(n,i)=>{Ze.setAddressExplorerUrl(n,i)},this.setSmartAccountDeployed=(n,i)=>{Ze.setSmartAccountDeployed(n,i)},this.setConnectedWalletInfo=(n,i)=>{Ze.setConnectedWalletInfo(n,i)},this.setSmartAccountEnabledNetworks=(n,i)=>{Jr.setSmartAccountEnabledNetworks(n,i)},this.setPreferredAccountType=(n,i)=>{Ze.setPreferredAccountType(n,i)},this.getReownName=n=>ap.getNamesForAddress(n),this.resolveReownName=async n=>{var o;const i=await ap.resolveName(n);return((o=(Object.values(i==null?void 0:i.addresses)||[])[0])==null?void 0:o.address)||!1},this.setEIP6963Enabled=n=>{At.setEIP6963Enabled(n)},this.setClientId=n=>{Ma.setClientId(n)},this.getConnectorImage=n=>Jn.getConnectorImage(n),this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.adapter=(r=e.adapters)==null?void 0:r[0],this.initControllers(e),this.initOrContinue()}static getInstance(){return this.instance}async open(e){await this.initOrContinue(),jr.open(e)}async close(){await this.initOrContinue(),jr.close()}setLoading(e){jr.setLoading(e)}getError(){return""}getChainId(){var e;return(e=Pe.state.activeCaipNetwork)==null?void 0:e.chainId}switchNetwork(e){return Jr.switchActiveNetwork(e)}getWalletProvider(){return Pe.state.activeChain?_5.state.providers[Pe.state.activeChain]:null}getWalletProviderType(){return Pe.state.activeChain?_5.state.providerIds[Pe.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return Ia.state.themeMode}getThemeVariables(){return Ia.state.themeVariables}setThemeMode(e){Ia.setThemeMode(e),lCe(Ia.state.themeMode)}setThemeVariables(e){Ia.setThemeVariables(e),Ppt(Ia.state.themeVariables)}subscribeTheme(e){return Ia.subscribe(e)}getWalletInfo(){return Ze.state.connectedWalletInfo}subscribeWalletInfo(e){return Ze.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){Ze.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){Jr.subscribeKey("caipNetwork",e)}getState(){return Cg.state}subscribeState(e){return Cg.subscribe(e)}showErrorMessage(e){vr.showError(e)}showSuccessMessage(e){vr.showSuccess(e)}getEvent(){return{...Vt.state}}subscribeEvents(e){return Vt.subscribe(e)}replace(e){Ye.replace(e)}redirect(e){Ye.push(e)}popTransactionStack(e){Ye.popTransactionStack(e)}isOpen(){return jr.state.open}isTransactionStackEmpty(){return Ye.state.transactionStack.length===0}isTransactionShouldReplaceView(){var e;return(e=Ye.state.transactionStack[Ye.state.transactionStack.length-1])==null?void 0:e.replace}async initControllers(e){var n;if(At.setDebug(e.debug),At.setProjectId(e.projectId),At.setSdkVersion(e.sdkVersion),!e.projectId){cb.open(ET.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(this.adapters=e.adapters,this.setMetadata(e),this.extendCaipNetworks(e),this.initializeUniversalAdapter(e),this.initializeAdapters(e),this.setDefaultNetwork(e),At.setAllWallets(e.allWallets),At.setIncludeWalletIds(e.includeWalletIds),At.setExcludeWalletIds(e.excludeWalletIds),e.excludeWalletIds&&xr.searchWalletByIds({ids:e.excludeWalletIds}),At.setFeaturedWalletIds(e.featuredWalletIds),At.setTokens(e.tokens),At.setTermsConditionsUrl(e.termsConditionsUrl),At.setPrivacyPolicyUrl(e.privacyPolicyUrl),At.setCustomWallets(e.customWallets),At.setFeatures(e.features),At.setEnableWalletConnect(e.enableWalletConnect!==!1),At.setEnableWallets(e.enableWallets!==!1),e.metadata&&At.setMetadata(e.metadata),e.themeMode&&Ia.setThemeMode(e.themeMode),e.themeVariables&&Ia.setThemeVariables(e.themeVariables),e.disableAppend&&At.setDisableAppend(!!e.disableAppend),((n=e.adapters)==null?void 0:n.find(i=>i.chainNamespace===ya.CHAIN.EVM))&&e.siweConfig){const{SIWEController:i}=await Bf(async()=>{const{SIWEController:a}=await import("./index-Cdw1Pm6b.js");return{SIWEController:a}},[],import.meta.url);i.setSIWEClient(e.siweConfig)}}setMetadata(e){var r,n,i;typeof window>"u"||typeof document>"u"||(e.metadata={name:((r=document.getElementsByTagName("title")[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]})}extendCaipNetworks(e){e.networks=Y6.extendCaipNetworks(e.networks,{networkImageIds:Rf.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}),e.defaultNetwork=e.networks.find(r=>{var n;return r.id===((n=e.defaultNetwork)==null?void 0:n.id)})}initializeUniversalAdapter(e){var r,n;this.universalAdapter=new cEt(e),Pe.initializeUniversalAdapter(this.universalAdapter,e.adapters||[]),(n=(r=this.universalAdapter).construct)==null||n.call(r,this,e)}initializeAdapters(e){var r;Pe.initialize(e.adapters||[]),(r=e.adapters)==null||r.forEach(n=>{var i;(i=n.construct)==null||i.call(n,this,e)})}setDefaultNetwork(e){const r=e.defaultNetwork?Y6.extendCaipNetwork(e.defaultNetwork,{networkImageIds:Rf.NetworkImageIds,customNetworkImageUrls:e.chainImages,projectId:e.projectId}):void 0,n=na.getItem(ra.ACTIVE_CAIP_NETWORK_ID),a=(n?e.networks.find(o=>o.id===n):void 0)??r??e.networks[0];Pe.setActiveCaipNetwork(a)}async initOrContinue(){return!this.initPromise&&!xde&>.isClient()&&(xde=!0,this.initPromise=new Promise(async e=>{await Promise.all([Bf(()=>import("./index-CrW_pNDQ.js"),[],import.meta.url),Bf(()=>import("./w3m-modal-BzJLjRtR.js"),[],import.meta.url)]);const r=document.createElement("w3m-modal");At.state.disableAppend||document.body.insertAdjacentElement("beforeend",r),e()})),this.initPromise}}const fEt="@reown/appkit",dEt="1.0.7",hEt="module",pEt="./dist/esm/exports/index.js",gEt="./dist/types/exports/index.d.ts",vEt=["dist","!tsconfig.tsbuildinfo"],mEt={"build:clean":"rm -rf dist",build:"tsc --build tsconfig.build.json",watch:"tsc --watch",typecheck:"tsc --noEmit",lint:"eslint . --ext .js,.jsx,.ts,.tsx",test:"vitest run --coverage.enabled=true -- coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true"},yEt={".":{types:"./dist/types/exports/index.d.ts",import:"./dist/esm/exports/index.js",default:"./dist/esm/exports/index.js"},"./react":{types:"./dist/types/exports/react.d.ts",import:"./dist/esm/exports/react.js",default:"./dist/esm/exports/react.js"},"./vue":{types:"./dist/types/exports/vue.d.ts",import:"./dist/esm/exports/vue.js",default:"./dist/esm/exports/vue.js"},"./library/react":{types:"./dist/types/exports/library/react.d.ts",import:"./dist/esm/exports/library/react.js",default:"./dist/esm/exports/library/react.js"},"./library/vue":{types:"./dist/types/exports/library/vue.d.ts",import:"./dist/esm/exports/library/vue.js",default:"./dist/esm/exports/library/vue.js"},"./store":{types:"./dist/types/exports/store.d.ts",import:"./dist/esm/exports/store.js",default:"./dist/esm/exports/store.js"},"./utils":{types:"./dist/types/exports/utils.d.ts",import:"./dist/esm/exports/utils.js",default:"./dist/esm/exports/utils.js"},"./networks":{types:"./dist/types/exports/networks.d.ts",import:"./dist/esm/exports/networks.js",default:"./dist/esm/exports/networks.js"},"./auth-provider":{types:"./dist/types/exports/auth-provider.d.ts",import:"./dist/esm/exports/auth-provider.js",default:"./dist/esm/exports/auth-provider.js"}},wEt={"*":{react:["./dist/types/exports/react.d.ts"],vue:["./dist/types/exports/vue.d.ts"],"library/react":["./dist/types/exports/library/react.d.ts"],"library/vue":["./dist/types/exports/library/vue.d.ts"],store:["./dist/types/exports/store.d.ts"],networks:["./dist/types/exports/networks.d.ts"],"auth-provider":["./dist/types/exports/auth-provider.d.ts"]}},bEt={"@reown/appkit-common":"workspace:*","@reown/appkit-core":"workspace:*","@reown/appkit-polyfills":"workspace:*","@reown/appkit-scaffold-ui":"workspace:*","@reown/appkit-utils":"workspace:*","@reown/appkit-siwe":"workspace:*","@reown/appkit-ui":"workspace:*","@reown/appkit-wallet":"workspace:*","@walletconnect/types":"2.17.0","@walletconnect/utils":"2.17.0","@walletconnect/universal-provider":"2.17.0",valtio:"1.11.2"},xEt={"@types/react":"18.2.0","@types/react-dom":"18.2.0","@vitest/coverage-v8":"2.0.5","@vue/runtime-core":"3.4.3","@walletconnect/types":"2.13.3","@walletconnect/universal-provider":"2.17.0",react:"18.2.0","react-dom":"18.2.0",vitest:"2.0.5",vue:"3.4.3"},_Et="Reown (https://reown.com)",SEt="Apache-2.0",CEt="https://github.com/WalletConnect/web3modal",AEt={type:"git",url:"git+https://github.com/WalletConnect/web3modal.git"},TEt={url:"https://github.com/WalletConnect/web3modal/issues"},EEt={name:fEt,version:dEt,type:hEt,main:pEt,types:gEt,files:vEt,scripts:mEt,exports:yEt,typesVersions:wEt,dependencies:bEt,devDependencies:xEt,author:_Et,license:SEt,homepage:CEt,repository:AEt,bugs:TEt};var Mu=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Bc=class extends He{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=Pe.state.activeCaipAddress,this.balanceVal=Ze.state.balance,this.balanceSymbol=Ze.state.balanceSymbol,this.profileName=Ze.state.profileName,this.profileImage=Ze.state.profileImage,this.network=Pe.state.activeCaipNetwork,this.networkImage=this.network?Jn.getNetworkImage(this.network):void 0,this.isUnsupportedChain=Jr.state.isUnsupportedChain,this.unsubscribe.push(Ua.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Jn.getNetworkImage(this.network):void 0}),Pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),Ze.subscribeKey("balance",e=>this.balanceVal=e),Ze.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Ze.subscribeKey("profileName",e=>this.profileName=e),Ze.subscribeKey("profileImage",e=>this.profileImage=e),Pe.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Jn.getNetworkImage(e):void 0}),Jr.subscribeKey("isUnsupportedChain",e=>{this.isUnsupportedChain=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.balance==="show";return X` - - - `}onClick(){this.isUnsupportedChain?jr.open({view:"UnsupportedChain"}):jr.open()}};Mu([ce({type:Boolean})],Bc.prototype,"disabled",void 0);Mu([ce()],Bc.prototype,"balance",void 0);Mu([ce()],Bc.prototype,"charsStart",void 0);Mu([ce()],Bc.prototype,"charsEnd",void 0);Mu([xe()],Bc.prototype,"caipAddress",void 0);Mu([xe()],Bc.prototype,"balanceVal",void 0);Mu([xe()],Bc.prototype,"balanceSymbol",void 0);Mu([xe()],Bc.prototype,"profileName",void 0);Mu([xe()],Bc.prototype,"profileImage",void 0);Mu([xe()],Bc.prototype,"network",void 0);Mu([xe()],Bc.prototype,"networkImage",void 0);Mu([xe()],Bc.prototype,"isUnsupportedChain",void 0);Bc=Mu([Fe("w3m-account-button")],Bc);const IEt=Je` - :host { - display: block; - width: max-content; - } -`;var C0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let qf=class extends He{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.caipAddress=Pe.state.activeCaipAddress,this.isLoading=jr.state.loading}firstUpdated(){this.unsubscribe.push(Pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),jr.subscribeKey("loading",e=>this.isLoading=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress&&!this.isLoading?X` - - - `:X` - - `}};qf.styles=IEt;C0([ce({type:Boolean})],qf.prototype,"disabled",void 0);C0([ce()],qf.prototype,"balance",void 0);C0([ce()],qf.prototype,"size",void 0);C0([ce()],qf.prototype,"label",void 0);C0([ce()],qf.prototype,"loadingLabel",void 0);C0([ce()],qf.prototype,"charsStart",void 0);C0([ce()],qf.prototype,"charsEnd",void 0);C0([xe()],qf.prototype,"caipAddress",void 0);C0([xe()],qf.prototype,"isLoading",void 0);qf=C0([Fe("w3m-button")],qf);var MS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Qb=class extends He{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=jr.state.open,this.loading=jr.state.loading,this.unsubscribe.push(jr.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.loading||this.open;return X` - - ${e?this.loadingLabel:this.label} - - `}onClick(){this.open?jr.close():this.loading||jr.open()}};MS([ce()],Qb.prototype,"size",void 0);MS([ce()],Qb.prototype,"label",void 0);MS([ce()],Qb.prototype,"loadingLabel",void 0);MS([xe()],Qb.prototype,"open",void 0);MS([xe()],Qb.prototype,"loading",void 0);Qb=MS([Fe("w3m-connect-button")],Qb);const kEt=Je` - :host { - display: block; - width: max-content; - } -`;var dy=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let i0=class extends He{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=Pe.state.activeCaipNetwork,this.networkImage=this.network?Jn.getNetworkImage(this.network):void 0,this.caipAddress=Pe.state.activeCaipAddress,this.loading=jr.state.loading,this.isUnsupportedChain=Jr.state.isUnsupportedChain,this.unsubscribe.push(Ua.subscribeNetworkImages(()=>{var e;this.networkImage=(e=this.network)!=null&&e.imageId?Jn.getNetworkImage(this.network):void 0}),Pe.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),Pe.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=e!=null&&e.imageId?Jn.getNetworkImage(e):void 0}),jr.subscribeKey("loading",e=>this.loading=e),Jr.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - ${this.getLabel()} - - - `}getLabel(){return this.network?this.network.name:this.label?this.label:this.isUnsupportedChain?"Switch Network":this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(Vt.sendEvent({type:"track",event:"CLICK_NETWORKS"}),jr.open({view:"Networks"}))}};i0.styles=kEt;dy([ce({type:Boolean})],i0.prototype,"disabled",void 0);dy([ce({type:String})],i0.prototype,"label",void 0);dy([xe()],i0.prototype,"network",void 0);dy([xe()],i0.prototype,"networkImage",void 0);dy([xe()],i0.prototype,"caipAddress",void 0);dy([xe()],i0.prototype,"loading",void 0);dy([xe()],i0.prototype,"isUnsupportedChain",void 0);i0=dy([Fe("w3m-network-button")],i0);const PEt=Je` - :host { - --prev-height: 0px; - --new-height: 0px; - display: block; - } - - div.w3m-router-container { - transform: translateY(0); - opacity: 1; - } - - div.w3m-router-container[view-direction='prev'] { - animation: - slide-left-out 150ms forwards ease, - slide-left-in 150ms forwards ease; - animation-delay: 0ms, 200ms; - } - - div.w3m-router-container[view-direction='next'] { - animation: - slide-right-out 150ms forwards ease, - slide-right-in 150ms forwards ease; - animation-delay: 0ms, 200ms; - } - - @keyframes slide-left-out { - from { - transform: translateX(0px); - opacity: 1; - } - to { - transform: translateX(10px); - opacity: 0; - } - } - - @keyframes slide-left-in { - from { - transform: translateX(-10px); - opacity: 0; - } - to { - transform: translateX(0); - opacity: 1; - } - } - - @keyframes slide-right-out { - from { - transform: translateX(0px); - opacity: 1; - } - to { - transform: translateX(-10px); - opacity: 0; - } - } - - @keyframes slide-right-in { - from { - transform: translateX(10px); - opacity: 0; - } - to { - transform: translateX(0); - opacity: 1; - } - } -`;var REt={};const Tg={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:REt.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}};var ree=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let NT=class extends He{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=Ye.state.view,this.viewDirection="",this.unsubscribe.push(Ye.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const r=`${e==null?void 0:e.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",r),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=r,this.style.animation="unset"},Tg.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(r=>r())}render(){return X`
- ${this.viewTemplate()} -
`}viewTemplate(){switch(this.view){case"AccountSettings":return X``;case"Account":return X``;case"AllWallets":return X``;case"ApproveTransaction":return X``;case"BuyInProgress":return X``;case"ChooseAccountName":return X``;case"Connect":return X``;case"Create":return X``;case"ConnectingWalletConnect":return X``;case"ConnectingExternal":return X``;case"ConnectingSiwe":return X``;case"ConnectWallets":return X``;case"ConnectSocials":return X``;case"ConnectingSocial":return X``;case"Downloads":return X``;case"EmailVerifyOtp":return X``;case"EmailVerifyDevice":return X``;case"GetWallet":return X``;case"Networks":return X``;case"SwitchNetwork":return X``;case"Profile":return X``;case"SelectAddresses":return X``;case"SwitchAddress":return X``;case"Transactions":return X``;case"OnRampProviders":return X``;case"OnRampActivity":return X``;case"OnRampTokenSelect":return X``;case"OnRampFiatSelect":return X``;case"UpgradeEmailWallet":return X``;case"UpgradeToSmartAccount":return X``;case"UpdateEmailWallet":return X``;case"UpdateEmailPrimaryOtp":return X``;case"UpdateEmailSecondaryOtp":return X``;case"UnsupportedChain":return X``;case"Swap":return X``;case"SwapSelectToken":return X``;case"SwapPreview":return X``;case"WalletSend":return X``;case"WalletSendSelectToken":return X``;case"WalletSendPreview":return X``;case"WhatIsABuy":return X``;case"WalletReceive":return X``;case"WalletCompatibleNetworks":return X``;case"WhatIsAWallet":return X``;case"ConnectingMultiChain":return X``;case"WhatIsANetwork":return X``;case"ConnectingFarcaster":return X``;case"SwitchActiveChain":return X``;case"RegisterAccountName":return X``;case"RegisterAccountNameSuccess":return X``;default:return X``}}onViewChange(e){nu.hide();let r=Tg.VIEW_DIRECTION.Next;const{history:n}=Ye.state;n.length{this.view=e},Tg.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("div")}};NT.styles=PEt;ree([xe()],NT.prototype,"view",void 0);ree([xe()],NT.prototype,"viewDirection",void 0);NT=ree([Fe("w3m-router")],NT);const MEt=Je` - :host > wui-flex { - width: 100%; - max-width: 360px; - } - - :host > wui-flex > wui-flex { - border-radius: var(--wui-border-radius-l); - width: 100%; - } - - .amounts-container { - width: 100%; - } -`;var hy=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const DEt={USD:"$",EUR:"€",GBP:"£"},NEt=[100,250,500,1e3];let a0=class extends He{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.caipAddress=Pe.state.activeCaipAddress,this.loading=jr.state.loading,this.paymentCurrency=wi.state.paymentCurrency,this.paymentAmount=wi.state.paymentAmount,this.purchaseAmount=wi.state.purchaseAmount,this.quoteLoading=wi.state.quotesLoading,this.unsubscribe.push(Pe.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),jr.subscribeKey("loading",e=>{this.loading=e}),wi.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - - - - - ${NEt.map(e=>{var r;return X`this.selectPresetAmount(e)} - >${`${DEt[((r=this.paymentCurrency)==null?void 0:r.id)||"USD"]} ${e}`}`})} - - ${this.templateButton()} - - - `}templateButton(){return this.caipAddress?X` - Get quotes - `:X` - Connect wallet - `}getQuotes(){this.loading||jr.open({view:"OnRampProviders"})}openModal(){jr.open({view:"Connect"})}async onPaymentAmountChange(e){wi.setPaymentAmount(Number(e.detail)),await wi.getQuote()}async selectPresetAmount(e){wi.setPaymentAmount(e),await wi.getQuote()}};a0.styles=MEt;hy([ce({type:Boolean})],a0.prototype,"disabled",void 0);hy([xe()],a0.prototype,"caipAddress",void 0);hy([xe()],a0.prototype,"loading",void 0);hy([xe()],a0.prototype,"paymentCurrency",void 0);hy([xe()],a0.prototype,"paymentAmount",void 0);hy([xe()],a0.prototype,"purchaseAmount",void 0);hy([xe()],a0.prototype,"quoteLoading",void 0);a0=hy([Fe("w3m-onramp-widget")],a0);var A0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let yh=class extends He{constructor(){super(),this.usubscribe=[],this.networkImages=Ua.state.networkImages,this.address=Ze.state.address,this.profileImage=Ze.state.profileImage,this.profileName=Ze.state.profileName,this.network=Pe.state.activeCaipNetwork,this.preferredAccountType=Ze.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(Ze.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):jr.close()}),Ze.subscribeKey("preferredAccountType",e=>this.preferredAccountType=e),Pe.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var r,n;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((r=this.network)==null?void 0:r.imageId)??""];return X` - - - - - - ${Tr.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} - - - - - - - - ${this.authCardTemplate()} - - - - ${((n=this.network)==null?void 0:n.name)??"Unknown"} - - - ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()} - - Disconnect - - - - `}chooseNameButtonTemplate(){const e=jn.getConnectedConnector(),r=rr.getAuthConnector();return!Jr.checkIfNamesSupported()||!r||e!=="AUTH"||this.profileName?null:X` - - Choose account name - - `}authCardTemplate(){const e=jn.getConnectedConnector(),r=rr.getAuthConnector(),{origin:n}=location;return!r||e!=="AUTH"||n.includes(Da.SECURE_SITE)?null:X` - - `}isAllowedNetworkSwitch(){const e=Jr.getRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var a;return i===((a=this.network)==null?void 0:a.id)});return r||!n}onCopyAddress(){try{this.address&&(gt.copyToClopboard(this.address),vr.showSuccess("Address copied"))}catch{vr.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const e=Jr.checkIfSmartAccountEnabled(),r=jn.getConnectedConnector();return!rr.getAuthConnector()||r!=="AUTH"||!e?null:(this.switched||(this.text=this.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),X` - - ${this.text} - - `)}onChooseName(){Ye.push("ChooseAccountName")}async changePreferredAccountType(){const e=Jr.checkIfSmartAccountEnabled(),r=this.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT||!e?xn.ACCOUNT_TYPES.EOA:xn.ACCOUNT_TYPES.SMART_ACCOUNT;rr.getAuthConnector()&&(this.loading=!0,await Dr.setPreferredAccountType(r),this.text=r===xn.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,ui.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&Ye.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await Dr.disconnect(),Vt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jr.close()}catch{Vt.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),vr.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){Vt.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),Ye.push("UpgradeEmailWallet")}};A0([xe()],yh.prototype,"address",void 0);A0([xe()],yh.prototype,"profileImage",void 0);A0([xe()],yh.prototype,"profileName",void 0);A0([xe()],yh.prototype,"network",void 0);A0([xe()],yh.prototype,"preferredAccountType",void 0);A0([xe()],yh.prototype,"disconnecting",void 0);A0([xe()],yh.prototype,"loading",void 0);A0([xe()],yh.prototype,"switched",void 0);A0([xe()],yh.prototype,"text",void 0);yh=A0([Fe("w3m-account-settings-view")],yh);var OEt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let _de=class extends He{render(){const e=jn.getConnectedConnector(),r=rr.getAuthConnector();return X` - ${r&&e==="AUTH"?this.walletFeaturesTemplate():this.defaultTemplate()} - `}walletFeaturesTemplate(){return X``}defaultTemplate(){return X``}};_de=OEt([Fe("w3m-account-view")],_de);var C6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let sY=class extends He{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=gt.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return X` - - - ${this.qrButtonTemplate()} - - ${e?X``:X``} - `}onInputChange(e){this.onDebouncedSearch(e.detail)}qrButtonTemplate(){return gt.isMobile()?X` - - `:null}onWalletConnectQr(){Ye.push("ConnectingWalletConnect")}};C6e([xe()],sY.prototype,"search",void 0);sY=C6e([Fe("w3m-all-wallets-view")],sY);const LEt=Je` - @keyframes shake { - 0% { - transform: translateX(0); - } - 25% { - transform: translateX(3px); - } - 50% { - transform: translateX(-3px); - } - 75% { - transform: translateX(3px); - } - 100% { - transform: translateX(0); - } - } - - wui-flex:first-child:not(:only-child) { - position: relative; - } - - wui-loading-thumbnail { - position: absolute; - } - - wui-visual { - width: var(--wui-wallet-image-size-lg); - height: var(--wui-wallet-image-size-lg); - border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); - position: relative; - overflow: hidden; - } - - wui-visual::after { - content: ''; - display: block; - width: 100%; - height: 100%; - position: absolute; - inset: 0; - border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - wui-icon-box { - position: absolute; - right: calc(var(--wui-spacing-3xs) * -1); - bottom: calc(var(--wui-spacing-3xs) * -1); - opacity: 0; - transform: scale(0.5); - transition: - opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), - transform var(--wui-ease-out-power-2) var(--wui-duration-lg); - will-change: opacity, transform; - } - - wui-text[align='center'] { - width: 100%; - padding: 0px var(--wui-spacing-l); - } - - [data-error='true'] wui-icon-box { - opacity: 1; - transform: scale(1); - } - - [data-error='true'] > wui-flex:first-child { - animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; - } - - [data-retry='false'] wui-link { - display: none; - } - - [data-retry='true'] wui-link { - display: block; - opacity: 1; - } - - wui-link { - padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); - } -`;var Ih=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let bu=class extends He{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=wi.state.selectedProvider,this.uri=Dr.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(wi.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var n,i;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(n=this.selectedOnRampProvider)==null?void 0:n.label}`);const r=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return X` - - - - - - ${this.error?null:this.loaderTemplate()} - - - - - - - ${e} - - ${r} - - - ${this.error?this.tryAgainTemplate():null} - - - - - - Copy link - - - `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=Ze.state.address,r=At.state.projectId;if(!e)throw new Error("No address found");(await Ma.fetchTransactions({account:e,onramp:"coinbase",projectId:r})).data.filter(a=>new Date(a.metadata.minedAt)>new Date(this.startTime)||a.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),Ye.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){vr.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,gt.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?X` - - Try again - `:null}loaderTemplate(){const e=Ia.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return X``}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){vr.showError("No link found"),Ye.goBack();return}try{gt.copyToClopboard(this.selectedOnRampProvider.url),vr.showSuccess("Link copied")}catch{vr.showError("Failed to copy")}}};bu.styles=LEt;Ih([xe()],bu.prototype,"intervalId",void 0);Ih([xe()],bu.prototype,"selectedOnRampProvider",void 0);Ih([xe()],bu.prototype,"uri",void 0);Ih([xe()],bu.prototype,"ready",void 0);Ih([xe()],bu.prototype,"showRetry",void 0);Ih([xe()],bu.prototype,"buffering",void 0);Ih([xe()],bu.prototype,"error",void 0);Ih([xe()],bu.prototype,"startTime",void 0);Ih([ce({type:Boolean})],bu.prototype,"isMobile",void 0);Ih([ce()],bu.prototype,"onRetry",void 0);bu=Ih([Fe("w3m-buy-in-progress-view")],bu);const $Et=Je` - :host > wui-flex { - max-height: clamp(360px, 540px, 80vh); - scrollbar-width: none; - overflow-y: scroll; - overflow-x: hidden; - } - - :host > wui-flex::-webkit-scrollbar { - display: none; - } - - .all-wallets { - flex-flow: column; - } -`;var R8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Xb=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.features=At.state.features,this.walletGuide="get-started",this.unsubscribe.push(rr.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),At.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var a;const e=(a=this.features)==null?void 0:a.socials,r=At.state.enableWallets,i=e&&e.length||this.authConnector;return X` - - - - ${this.walletListTemplate()} - - ${this.guideTemplate()} - - `}walletListTemplate(){var i,a;const e=(i=this.features)==null?void 0:i.socials,r=(a=this.features)==null?void 0:a.emailShowWallets;return!At.state.enableWallets||(gt.isTelegram()&>.isIos()&&Dr.connectWalletConnect().catch(o=>({})),this.walletGuide==="explore")?null:this.authConnector&&e?this.authConnector&&r?X` - - - - - - - `:X``:X``}guideTemplate(){var i;const e=(i=this.features)==null?void 0:i.socials,r=At.state.enableWallets,n=e&&e.length;return!this.authConnector&&!n||!r?null:this.walletGuide==="explore"?X` - - - - `:X` - - - - `}onContinueWalletClick(){Ye.push("ConnectWallets")}};Xb.styles=$Et;R8([xe()],Xb.prototype,"connectors",void 0);R8([xe()],Xb.prototype,"authConnector",void 0);R8([xe()],Xb.prototype,"features",void 0);R8([ce()],Xb.prototype,"walletGuide",void 0);Xb=R8([Fe("w3m-connect-view")],Xb);const BEt=Je` - @keyframes shake { - 0% { - transform: translateX(0); - } - 25% { - transform: translateX(3px); - } - 50% { - transform: translateX(-3px); - } - 75% { - transform: translateX(3px); - } - 100% { - transform: translateX(0); - } - } - - wui-flex:first-child:not(:only-child) { - position: relative; - } - - wui-loading-thumbnail { - position: absolute; - } - - wui-icon-box { - position: absolute; - right: calc(var(--wui-spacing-3xs) * -1); - bottom: calc(var(--wui-spacing-3xs) * -1); - opacity: 0; - transform: scale(0.5); - transition-property: opacity, transform; - transition-duration: var(--wui-duration-lg); - transition-timing-function: var(--wui-ease-out-power-2); - will-change: opacity, transform; - } - - wui-text[align='center'] { - width: 100%; - padding: 0px var(--wui-spacing-l); - } - - [data-error='true'] wui-icon-box { - opacity: 1; - transform: scale(1); - } - - [data-error='true'] > wui-flex:first-child { - animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; - } - - [data-retry='false'] wui-link { - display: none; - } - - [data-retry='true'] wui-link { - display: block; - opacity: 1; - } -`;var rx=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};class zc extends He{constructor(){var e,r,n,i,a;super(),this.wallet=(e=Ye.state.data)==null?void 0:e.wallet,this.connector=(r=Ye.state.data)==null?void 0:r.connector,this.timeout=void 0,this.secondaryBtnLabel="Try again",this.secondaryBtnIcon="refresh",this.secondaryLabel="Accept connection request in the wallet",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=Jn.getWalletImage(this.wallet)??Jn.getConnectorImage(this.connector),this.name=((n=this.wallet)==null?void 0:n.name)??((i=this.connector)==null?void 0:i.name)??"Wallet",this.isRetrying=!1,this.uri=Dr.state.wcUri,this.error=Dr.state.wcError,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Dr.subscribeKey("wcUri",o=>{var s;this.uri=o,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(s=this.onConnect)==null||s.call(this))}),Dr.subscribeKey("wcError",o=>this.error=o),Dr.subscribeKey("buffering",o=>this.buffering=o)),gt.isTelegram()&>.isIos()&&Dr.state.wcUri&&((a=this.onConnect)==null||a.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){var n;(n=this.onRender)==null||n.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let r=`Continue in ${this.name}`;return this.buffering&&(r="Connecting..."),this.error&&(r="Connection declined"),X` - - - - - ${this.error?null:this.loaderTemplate()} - - - - - - - ${r} - - ${e} - - - - - ${this.secondaryBtnLabel} - - - - ${this.isWalletConnect?X` - - - - Copy link - - - `:null} - - - `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,r;this.buffering||(Dr.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(r=this.onConnect)==null||r.call(this))}loaderTemplate(){const e=Ia.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return X``}onCopyUri(){try{this.uri&&(gt.copyToClopboard(this.uri),vr.showSuccess("Link copied"))}catch{vr.showError("Failed to copy")}}}zc.styles=BEt;rx([xe()],zc.prototype,"uri",void 0);rx([xe()],zc.prototype,"error",void 0);rx([xe()],zc.prototype,"ready",void 0);rx([xe()],zc.prototype,"showRetry",void 0);rx([xe()],zc.prototype,"buffering",void 0);rx([ce({type:Boolean})],zc.prototype,"isMobile",void 0);rx([ce()],zc.prototype,"onRetry",void 0);var FEt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Sde=class extends zc{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw new Error("w3m-connecting-view: No connector provided");Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(Pe.subscribeKey("activeCaipAddress",e=>{e&&jr.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==Sn.COINBASE_SDK_CONNECTOR_ID||!this.error)&&(await Dr.connectExternal(this.connector,this.connector.chain),Vt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){Vt.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};Sde=FEt([Fe("w3m-connecting-external-view")],Sde);const jEt=Je` - wui-flex, - wui-list-wallet { - width: 100%; - } -`;var A6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let pN=class extends He{constructor(){super(),this.unsubscribe=[],this.activeConnector=Pe.state.activeConnector,this.unsubscribe.push(Pe.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return X` - - - - - - - Select Chain for ${(e=this.activeConnector)==null?void 0:e.name} - - Select which chain to connect to your multi chain wallet - - - ${this.networksTemplate()} - - - `}networksTemplate(){var e,r;return(r=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:r.map(n=>n.name?X` - this.onConnector(n)} - > - `:null)}onConnector(e){var n,i;const r=(i=(n=this.activeConnector)==null?void 0:n.connectors)==null?void 0:i.find(a=>a.chain===e.chain);if(!r){vr.showError("Failed to find connector");return}r.id==="walletConnect"?gt.isMobile()?Ye.push("AllWallets"):Ye.push("ConnectingWalletConnect"):Ye.push("ConnectingExternal",{connector:r})}};pN.styles=jEt;A6e([xe()],pN.prototype,"activeConnector",void 0);pN=A6e([Fe("w3m-connecting-multi-chain-view")],pN);var nee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let gN=class extends He{constructor(){var e;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(e=Ye.state.data)==null?void 0:e.wallet,this.platform=void 0,this.platforms=[],this.determinePlatforms(),this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),Da.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?X` - ${this.headerTemplate()} -
${this.platformTemplate()}
- `:X``}async initializeConnection(e=!1){if(this.platform!=="browser")try{const{wcPairingExpiry:r,status:n}=Dr.state;(e||gt.isPairingExpired(r)||n==="connecting")&&(await Dr.connectWalletConnect(),this.finalizeConnection(),jn.getConnectedConnector()==="AUTH"&&At.state.hasMultipleAddresses?Ye.push("SelectAddresses"):jr.close())}catch(r){Vt.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),Dr.setWcError(!0),gt.isAllowedRetry(this.lastRetry)&&(vr.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var n;const{wcLinking:e,recentWallet:r}=Dr.state;e&&jn.setWalletConnectDeepLink(e),r&&jn.setAppKitRecent(r),Vt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:((n=this.wallet)==null?void 0:n.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:r,webapp_link:n,injected:i,rdns:a,name:o}=this.wallet,s=i==null?void 0:i.map(({injected_id:g})=>g).filter(Boolean),l=[...a?[a]:s??[],o],c=At.state.isUniversalProvider?!1:l.length,u=e,f=n,d=Dr.checkInstalled(l),h=c&&d,p=r&&!gt.isMobile();h&&this.platforms.push("browser"),u&&this.platforms.push(gt.isMobile()?"mobile":"qrcode"),f&&this.platforms.push("web"),p&&this.platforms.push("desktop"),!h&&c&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return X``;case"desktop":return X` - this.initializeConnection(!0)}> - - `;case"web":return X` - this.initializeConnection(!0)}> - - `;case"mobile":return X` - this.initializeConnection(!0)}> - - `;case"qrcode":return X``;default:return X``}}headerTemplate(){return this.platforms.length>1?X` - - - `:null}async onSelectPlatform(e){var n;const r=(n=this.shadowRoot)==null?void 0:n.querySelector("div");r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};nee([xe()],gN.prototype,"platform",void 0);nee([xe()],gN.prototype,"platforms",void 0);gN=nee([Fe("w3m-connecting-wc-view")],gN);const UEt=Je` - .continue-button-container { - width: 100%; - } -`;var T6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let vN=class extends He{constructor(){super(...arguments),this.loading=!1}render(){return X` - - ${this.onboardingTemplate()} ${this.buttonsTemplate()} - {gt.openHref(ZX.URLS.FAQ,"_blank")}} - > - Learn more about names - - - - `}onboardingTemplate(){return X` - - - - - - Choose your account name - - - Finally say goodbye to 0x addresses, name your account to make it easier to exchange - assets - - - `}buttonsTemplate(){return X` - Choose name - - `}handleContinue(){Ye.push("RegisterAccountName"),Vt.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}})}};vN.styles=UEt;T6e([xe()],vN.prototype,"loading",void 0);vN=T6e([Fe("w3m-choose-account-name-view")],vN);var zEt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Cde=class extends He{constructor(){var e;super(...arguments),this.wallet=(e=Ye.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return X` - - ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} - ${this.homepageTemplate()} - - `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?X` - Chrome Extension - `:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?X` - iOS App - `:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?X` - Android App - `:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?X` - - Website - - `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&>.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&>.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&>.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&>.openHref(this.wallet.homepage,"_blank")}};Cde=zEt([Fe("w3m-downloads-view")],Cde);var HEt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const VEt="https://walletconnect.com/explorer";let Ade=class extends He{render(){return X` - - ${this.recommendedWalletsTemplate()} - {gt.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} - > - - `}recommendedWalletsTemplate(){const{recommended:e,featured:r}=xr.state,{customWallets:n}=At.state;return[...r,...n??[],...e].slice(0,4).map(a=>X` - {gt.openHref(a.homepage??VEt,"_blank")}} - > - `)}};Ade=HEt([Fe("w3m-get-wallet-view")],Ade);const GEt=Je` - wui-flex { - width: 100%; - } - - .suggestion { - background: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xs); - } - - .suggestion:hover { - background-color: var(--wui-color-gray-glass-005); - cursor: pointer; - } - - .suggested-name { - max-width: 75%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - form { - width: 100%; - } - - wui-icon-link { - position: absolute; - right: 20px; - transform: translateY(11px); - } -`;var py=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let o0=class extends He{constructor(){super(),this.formRef=D1(),this.usubscribe=[],this.name="",this.error="",this.loading=ap.state.loading,this.suggestions=ap.state.suggestions,this.registered=!1,this.profileName=Ze.state.profileName,this.onDebouncedNameInputChange=gt.debounce(e=>{ap.validateName(e)?(this.error="",this.name=e,ap.getSuggestions(e),ap.isNameRegistered(e).then(r=>{this.registered=r})):e.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(ap.subscribe(e=>{this.suggestions=e.suggestions,this.loading=e.loading}),Ze.subscribeKey("profileName",e=>{this.profileName=e,e&&(this.error="You already own a name")}))}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var e;super.disconnectedCallback(),this.usubscribe.forEach(r=>r()),(e=this.formRef.value)==null||e.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return X` - -
- - - ${this.submitButtonTemplate()} - -
- ${this.templateSuggestions()} -
- `}submitButtonTemplate(){return this.isAllowedToSubmit()?X` - - - `:null}onSelectSuggestion(e){return()=>{this.name=e,this.registered=!1,this.requestUpdate()}}onNameInputChange(e){this.onDebouncedNameInputChange(e.detail)}nameSuggestionTagTemplate(){return this.loading?X``:this.registered?X`Registered`:X`Available`}templateSuggestions(){if(!this.name||this.name.length<4||this.error)return null;const e=this.registered?this.suggestions.filter(r=>r.name!==this.name):[];return X` - - - ${this.name}${this.nameSuggestionTagTemplate()} - - ${e.map(r=>this.availableNameTemplate(r.name))} - `}availableNameTemplate(e){return X` - - ${e} - - Available - `}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&!this.profileName&&ap.validateName(this.name)}async onSubmitName(){try{if(!this.isAllowedToSubmit())return;const e=`${this.name}${ya.WC_NAME_SUFFIX}`;Vt.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}}),await ap.registerName(e),Vt.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}})}catch(e){vr.showError(e.message),Vt.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:`${this.name}${ya.WC_NAME_SUFFIX}`,error:(e==null?void 0:e.message)||"Unknown error"}})}}onEnterKey(e){e.key==="Enter"&&this.isAllowedToSubmit()&&this.onSubmitName()}};o0.styles=GEt;py([ce()],o0.prototype,"errorMessage",void 0);py([xe()],o0.prototype,"name",void 0);py([xe()],o0.prototype,"error",void 0);py([xe()],o0.prototype,"loading",void 0);py([xe()],o0.prototype,"suggestions",void 0);py([xe()],o0.prototype,"registered",void 0);py([xe()],o0.prototype,"profileName",void 0);o0=py([Fe("w3m-register-account-name-view")],o0);const WEt=Je` - .continue-button-container { - width: 100%; - } -`;var qEt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let lY=class extends He{render(){return X` - - ${this.onboardingTemplate()} ${this.buttonsTemplate()} - {gt.openHref(ZX.URLS.FAQ,"_blank")}} - > - Learn more - - - - `}onboardingTemplate(){return X` - - - - - - Account name chosen successfully - - - You can now fund your account and trade crypto - - - `}buttonsTemplate(){return X` - Let's Go! - - `}redirectToAccount(){Ye.replace("Account")}};lY.styles=WEt;lY=qEt([Fe("w3m-register-account-name-success-view")],lY);const YEt=Je` - @keyframes shake { - 0% { - transform: translateX(0); - } - 25% { - transform: translateX(3px); - } - 50% { - transform: translateX(-3px); - } - 75% { - transform: translateX(3px); - } - 100% { - transform: translateX(0); - } - } - - wui-flex:first-child:not(:only-child) { - position: relative; - } - - wui-loading-hexagon { - position: absolute; - } - - wui-icon-box { - position: absolute; - right: 4px; - bottom: 0; - opacity: 0; - transform: scale(0.5); - z-index: 1; - } - - wui-button { - display: none; - } - - [data-error='true'] wui-icon-box { - opacity: 1; - transform: scale(1); - } - - [data-error='true'] > wui-flex:first-child { - animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; - } - - wui-button[data-retry='true'] { - display: block; - opacity: 1; - } -`;var iee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let OT=class extends He{constructor(){var e;super(),this.network=(e=Ye.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),r=this.getSubLabel();return X` - - - - - ${this.error?null:X``} - - - - - - ${e} - ${r} - - - - - Try again - - - `}getSubLabel(){const e=jn.getConnectedConnector();return rr.getAuthConnector()&&e==="AUTH"?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var n;const e=jn.getConnectedConnector();return rr.getAuthConnector()&&e==="AUTH"?`Switching to ${((n=this.network)==null?void 0:n.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&await Jr.switchActiveNetwork(this.network)}catch{this.error=!0}}};OT.styles=YEt;iee([xe()],OT.prototype,"showRetry",void 0);iee([xe()],OT.prototype,"error",void 0);OT=iee([Fe("w3m-network-switch-view")],OT);const KEt=Je` - .container { - max-height: 360px; - overflow: auto; - } - - .container::-webkit-scrollbar { - display: none; - } -`;var M8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Jb=class extends He{constructor(){super(),this.unsubscribe=[],this.network=Pe.state.activeCaipNetwork,this.requestedCaipNetworks=Jr.getRequestedCaipNetworks(),this.search="",this.onDebouncedSearch=gt.debounce(e=>{this.search=e},100),this.unsubscribe.push(Pe.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - ${this.templateSearchInput()} - - ${this.networksTemplate()} - - - - - - - Your connected wallet may not support some of the networks available for this dApp - - - - What is a network - - - `}templateSearchInput(){return X` - - - - `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){Vt.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),Ye.push("WhatIsANetwork")}networksTemplate(){var i;const e=Jr.getRequestedCaipNetworks(),r=Jr.state.approvedCaipNetworkIds,n=gt.sortRequestedNetworks(r,e);return this.search?this.filteredNetworks=n==null?void 0:n.filter(a=>{var o;return(o=a==null?void 0:a.name)==null?void 0:o.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=n,(i=this.filteredNetworks)==null?void 0:i.map(a=>{var o;return X` - this.onSwitchNetwork(a)} - .disabled=${this.getNetworkDisabled(a)} - data-testid=${`w3m-network-switch-${a.name??a.id}`} - > - `})}getNetworkDisabled(e){const r=e.chainNamespace,n=Ze.getCaipAddress(r),i=Pe.getAllApprovedCaipNetworks(),a=Pe.getNetworkProp("supportsAllNetworks",r)!==!1,o=jn.getConnectedConnector(),s=rr.getAuthConnector();return!n||a||o==="AUTH"&&s?!1:!(i!=null&&i.includes(e.id))}onSwitchNetwork(e){var l;const r=Ye.state.data;if(e.id===((l=this.network)==null?void 0:l.id))return;const i=e.chainNamespace!==Pe.state.activeChain,a=Pe.getAccountProp("caipAddress",e.chainNamespace),o=Ze.state.caipAddress,s=jn.getConnectedConnector()==="AUTH";i&&o&&!a&&!s?Ye.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):Ye.push("SwitchNetwork",{...r,network:e})}};Jb.styles=KEt;M8([xe()],Jb.prototype,"network",void 0);M8([xe()],Jb.prototype,"requestedCaipNetworks",void 0);M8([xe()],Jb.prototype,"filteredNetworks",void 0);M8([xe()],Jb.prototype,"search",void 0);Jb=M8([Fe("w3m-networks-view")],Jb);const ZEt=Je` - :host > wui-flex { - height: 500px; - overflow-y: auto; - overflow-x: hidden; - scrollbar-width: none; - padding: var(--wui-spacing-m); - box-sizing: border-box; - display: flex; - align-items: center; - justify-content: flex-start; - } - - :host > wui-flex::-webkit-scrollbar { - display: none; - } - - :host > wui-flex > wui-flex { - width: 100%; - } - - wui-transaction-list-item-loader { - width: 100%; - } -`;var D8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const QEt=7;let e2=class extends He{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=wi.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=Do.state.coinbaseTransactions,this.tokenImages=Ua.state.tokenImages,this.unsubscribe.push(wi.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),Ua.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},Do.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),Do.clearCursor(),this.fetchTransactions()}render(){return X` - - ${this.loading?this.templateLoading():this.templateTransactionsByYear()} - - `}templateTransactions(e){return e==null?void 0:e.map(r=>{var s,l,c;const n=KX.formatDate((s=r==null?void 0:r.metadata)==null?void 0:s.minedAt),i=r.transfers[0],a=i==null?void 0:i.fungible_info;if(!a)return null;const o=((l=a==null?void 0:a.icon)==null?void 0:l.url)||((c=this.tokenImages)==null?void 0:c[a.symbol||""]);return X` - - `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(r=>{const n=parseInt(r,10);return new Array(12).fill(null).map((a,o)=>o).reverse().map(a=>{var l;const o=Gw.getTransactionGroupTitle(n,a),s=(l=this.coinbaseTransactions[n])==null?void 0:l[a];return s?X` - - - ${o} - - - ${this.templateTransactions(s)} - - - `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=Ze.state.address,r=At.state.projectId;if(!e)throw new Error("No address found");if(!r)throw new Error("No projectId found");this.loading=!0,await Do.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var i;const e=new Date;if((((i=this.coinbaseTransactions[e.getFullYear()])==null?void 0:i[e.getMonth()])||[]).filter(a=>a.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const a=Ze.state.address;await Do.fetchTransactions(a,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(QEt).fill(X` `).map(e=>e)}};e2.styles=ZEt;D8([xe()],e2.prototype,"selectedOnRampProvider",void 0);D8([xe()],e2.prototype,"loading",void 0);D8([xe()],e2.prototype,"coinbaseTransactions",void 0);D8([xe()],e2.prototype,"tokenImages",void 0);e2=D8([Fe("w3m-onramp-activity-view")],e2);const XEt=Je` - :host > wui-grid { - max-height: 360px; - overflow: auto; - } - - wui-grid::-webkit-scrollbar { - display: none; - } -`;var S$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let S5=class extends He{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=wi.state.paymentCurrency,this.currencies=wi.state.paymentCurrencies,this.currencyImages=Ua.state.currencyImages,this.unsubscribe.push(wi.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),Ua.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - ${this.currenciesTemplate()} - - - `}currenciesTemplate(){return this.currencies.map(e=>{var r;return X` - this.selectCurrency(e)} - variant="image" - > - ${e.id} - - `})}selectCurrency(e){e&&(wi.setPaymentCurrency(e),jr.close())}};S5.styles=XEt;S$([xe()],S5.prototype,"selectedCurrency",void 0);S$([xe()],S5.prototype,"currencies",void 0);S$([xe()],S5.prototype,"currencyImages",void 0);S5=S$([Fe("w3m-onramp-fiat-select-view")],S5);var E6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let cY=class extends He{constructor(){super(),this.unsubscribe=[],this.providers=wi.state.providers,this.unsubscribe.push(wi.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async r=>r.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(r==null?void 0:r.url));Promise.all(e).then(r=>{this.providers=this.providers.map((n,i)=>({...n,url:r[i]||""}))})}render(){return X` - - ${this.onRampProvidersTemplate()} - - - `}onRampProvidersTemplate(){return this.providers.filter(e=>e.supportedChains.includes(Pe.state.activeChain??"eip155")).map(e=>X` - {this.onClickProvider(e)}} - ?disabled=${!e.url} - > - `)}onClickProvider(e){wi.setSelectedProvider(e),Ye.push("BuyInProgress"),gt.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes"),Vt.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:e.name,isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){const e=Ze.state.address,r=Pe.state.activeCaipNetwork;if(!e)throw new Error("No address found");if(!(r!=null&&r.name))throw new Error("No network found");const n=Da.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[r.name]??Da.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,i=wi.state.purchaseCurrency,a=i?[i.symbol]:wi.state.purchaseCurrencies.map(o=>o.symbol);return await Ma.generateOnRampURL({defaultNetwork:n,destinationWallets:[{address:e,blockchains:Da.WC_COINBASE_PAY_SDK_CHAINS,assets:a}],partnerUserId:e,purchaseAmount:wi.state.purchaseAmount})}};E6e([xe()],cY.prototype,"providers",void 0);cY=E6e([Fe("w3m-onramp-providers-view")],cY);const JEt=Je` - :host > wui-grid { - max-height: 360px; - overflow: auto; - } - - wui-grid::-webkit-scrollbar { - display: none; - } -`;var C$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let C5=class extends He{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=wi.state.purchaseCurrencies,this.tokens=wi.state.purchaseCurrencies,this.tokenImages=Ua.state.tokenImages,this.unsubscribe.push(wi.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),Ua.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - ${this.currenciesTemplate()} - - - `}currenciesTemplate(){return this.tokens.map(e=>{var r;return X` - this.selectToken(e)} - variant="image" - > - - ${e.name} - ${e.symbol} - - - `})}selectToken(e){e&&(wi.setPurchaseCurrency(e),jr.close())}};C5.styles=JEt;C$([xe()],C5.prototype,"selectedCurrency",void 0);C$([xe()],C5.prototype,"tokens",void 0);C$([xe()],C5.prototype,"tokenImages",void 0);C5=C$([Fe("w3m-onramp-token-select-view")],C5);const e8t=Je` - :host > wui-flex:first-child { - overflow-y: auto; - overflow-x: hidden; - scrollbar-width: none; - } - - :host > wui-flex:first-child::-webkit-scrollbar { - display: none; - } - - wui-loading-hexagon { - position: absolute; - } - - .action-button { - width: 100%; - border-radius: var(--wui-border-radius-xs); - } - - .action-button:disabled { - border-color: 1px solid var(--wui-color-gray-glass-005); - } - - .swap-inputs-container { - position: relative; - } - - .replace-tokens-button-container { - display: flex; - justify-content: center; - align-items: center; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - gap: var(--wui-spacing-1xs); - border-radius: var(--wui-border-radius-xs); - background-color: var(--wui-color-modal-bg-base); - padding: var(--wui-spacing-xxs); - } - - .replace-tokens-button-container > button { - display: flex; - justify-content: center; - align-items: center; - height: 40px; - width: 40px; - padding: var(--wui-spacing-xs); - border: none; - border-radius: var(--wui-border-radius-xxs); - background: var(--wui-color-gray-glass-002); - transition: background-color var(--wui-duration-md) var(--wui-ease-out-power-1); - will-change: background-color; - z-index: 20; - } - - .replace-tokens-button-container > button:hover { - background: var(--wui-color-gray-glass-005); - } - - .details-container > wui-flex { - background: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xxs); - width: 100%; - } - - .details-container > wui-flex > button { - border: none; - background: none; - padding: var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xxs); - transition: background 0.2s linear; - } - - .details-container > wui-flex > button:hover { - background: var(--wui-color-gray-glass-002); - } - - .details-content-container { - padding: var(--wui-spacing-1xs); - display: flex; - align-items: center; - justify-content: center; - } - - .details-content-container > wui-flex { - width: 100%; - } - - .details-row { - width: 100%; - padding: var(--wui-spacing-s) var(--wui-spacing-xl); - border-radius: var(--wui-border-radius-xxs); - background: var(--wui-color-gray-glass-002); - } -`;var Fs=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let zo=class extends He{constructor(){var e;super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=(e=Pe.state.activeCaipNetwork)==null?void 0:e.id,this.initialized=jt.state.initialized,this.loadingQuote=jt.state.loadingQuote,this.loadingPrices=jt.state.loadingPrices,this.loadingTransaction=jt.state.loadingTransaction,this.sourceToken=jt.state.sourceToken,this.sourceTokenAmount=jt.state.sourceTokenAmount,this.sourceTokenPriceInUSD=jt.state.sourceTokenPriceInUSD,this.toToken=jt.state.toToken,this.toTokenAmount=jt.state.toTokenAmount,this.toTokenPriceInUSD=jt.state.toTokenPriceInUSD,this.inputError=jt.state.inputError,this.gasPriceInUSD=jt.state.gasPriceInUSD,this.fetchError=jt.state.fetchError,this.onDebouncedGetSwapCalldata=gt.debounce(async()=>{await jt.swapTokens()},200),Pe.subscribeKey("activeCaipNetwork",r=>{this.caipNetworkId!==(r==null?void 0:r.id)&&(this.caipNetworkId=r==null?void 0:r.id,jt.resetState(),jt.initializeState())}),this.unsubscribe.push(jr.subscribeKey("open",r=>{r||jt.resetState()}),Ye.subscribeKey("view",r=>{r.includes("Swap")||jt.resetValues()}),jt.subscribe(r=>{this.initialized=r.initialized,this.loadingQuote=r.loadingQuote,this.loadingPrices=r.loadingPrices,this.loadingTransaction=r.loadingTransaction,this.sourceToken=r.sourceToken,this.sourceTokenAmount=r.sourceTokenAmount,this.sourceTokenPriceInUSD=r.sourceTokenPriceInUSD,this.toToken=r.toToken,this.toTokenAmount=r.toTokenAmount,this.toTokenPriceInUSD=r.toTokenPriceInUSD,this.inputError=r.inputError,this.gasPriceInUSD=r.gasPriceInUSD,this.fetchError=r.fetchError}))}firstUpdated(){jt.initializeState(),this.watchTokensAndValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return X` - - ${this.initialized?this.templateSwap():this.templateLoading()} - - `}watchTokensAndValues(){this.interval=setInterval(()=>{jt.getNetworkTokenPrice(),jt.getMyTokensWithBalance(),jt.swapTokens()},1e4)}templateSwap(){return X` - - - ${this.templateTokenInput("sourceToken",this.sourceToken)} - ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()} - - ${this.templateDetails()} ${this.templateActionButton()} - - `}actionButtonLabel(){return this.fetchError?"Swap":!this.sourceToken||!this.toToken?"Select token":this.sourceTokenAmount?this.inputError?this.inputError:"Review swap":"Enter amount"}templateReplaceTokensButton(){return X` - - - - `}templateLoading(){return X` - - - - - ${this.templateReplaceTokensButton()} - - ${this.templateActionButton()} - - `}templateTokenInput(e,r){var s,l;const n=(s=jt.state.myTokensWithBalance)==null?void 0:s.find(c=>(c==null?void 0:c.address)===(r==null?void 0:r.address)),i=e==="toToken"?this.toTokenAmount:this.sourceTokenAmount,a=e==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD;let o=parseFloat(i)*a;return e==="toToken"&&(o-=this.gasPriceInUSD||0),X``}onSetMaxValue(e,r){const n=e==="sourceToken"?this.sourceToken:this.toToken,i=(n==null?void 0:n.address)===Jr.getActiveNetworkTokenAddress();let a="0";if(!r){a="0",this.handleChangeAmount(e,a);return}if(!this.gasPriceInUSD){a=r,this.handleChangeAmount(e,a);return}const o=ii.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),s=i?ii.bigNumber(r).minus(o):ii.bigNumber(r);this.handleChangeAmount(e,s.isGreaterThan(0)?s.toFixed(20):"0")}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:X``}handleChangeAmount(e,r){jt.clearError(),e==="sourceToken"?jt.setSourceTokenAmount(r):jt.setToTokenAmount(r),this.onDebouncedGetSwapCalldata()}templateActionButton(){const e=!this.toToken||!this.sourceToken,r=!this.sourceTokenAmount,n=this.loadingQuote||this.loadingPrices||this.loadingTransaction,i=n||e||r||this.inputError;return X` - - ${this.actionButtonLabel()} - - `}onSwitchTokens(){jt.switchTokens()}onSwapPreview(){var e,r;if(this.fetchError){jt.swapTokens();return}Vt.sendEvent({type:"track",event:"INITIATE_SWAP",properties:{network:this.caipNetworkId||"",swapFromToken:((e=this.sourceToken)==null?void 0:e.symbol)||"",swapToToken:((r=this.toToken)==null?void 0:r.symbol)||"",swapFromAmount:this.sourceTokenAmount||"",swapToAmount:this.toTokenAmount||"",isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ye.push("SwapPreview")}};zo.styles=e8t;Fs([xe()],zo.prototype,"interval",void 0);Fs([xe()],zo.prototype,"detailsOpen",void 0);Fs([xe()],zo.prototype,"caipNetworkId",void 0);Fs([xe()],zo.prototype,"initialized",void 0);Fs([xe()],zo.prototype,"loadingQuote",void 0);Fs([xe()],zo.prototype,"loadingPrices",void 0);Fs([xe()],zo.prototype,"loadingTransaction",void 0);Fs([xe()],zo.prototype,"sourceToken",void 0);Fs([xe()],zo.prototype,"sourceTokenAmount",void 0);Fs([xe()],zo.prototype,"sourceTokenPriceInUSD",void 0);Fs([xe()],zo.prototype,"toToken",void 0);Fs([xe()],zo.prototype,"toTokenAmount",void 0);Fs([xe()],zo.prototype,"toTokenPriceInUSD",void 0);Fs([xe()],zo.prototype,"inputError",void 0);Fs([xe()],zo.prototype,"gasPriceInUSD",void 0);Fs([xe()],zo.prototype,"fetchError",void 0);zo=Fs([Fe("w3m-swap-view")],zo);const t8t=Je` - @keyframes shake { - 0% { - transform: translateX(0); - } - 25% { - transform: translateX(3px); - } - 50% { - transform: translateX(-3px); - } - 75% { - transform: translateX(3px); - } - 100% { - transform: translateX(0); - } - } - - wui-flex:first-child:not(:only-child) { - position: relative; - } - - wui-loading-thumbnail { - position: absolute; - } - - wui-visual { - width: var(--wui-wallet-image-size-lg); - height: var(--wui-wallet-image-size-lg); - border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); - position: relative; - overflow: hidden; - } - - wui-visual::after { - content: ''; - display: block; - width: 100%; - height: 100%; - position: absolute; - inset: 0; - border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - wui-icon-box { - position: absolute; - right: calc(var(--wui-spacing-3xs) * -1); - bottom: calc(var(--wui-spacing-3xs) * -1); - opacity: 0; - transform: scale(0.5); - transition: - opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), - transform var(--wui-ease-out-power-2) var(--wui-duration-lg); - will-change: opacity, transform; - } - - wui-text[align='center'] { - width: 100%; - padding: 0px var(--wui-spacing-l); - } - - [data-error='true'] wui-icon-box { - opacity: 1; - transform: scale(1); - } - - [data-error='true'] > wui-flex:first-child { - animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; - } - - [data-retry='false'] wui-link { - display: none; - } - - [data-retry='true'] wui-link { - display: block; - opacity: 1; - } - - wui-link { - padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); - } - - .capitalize { - text-transform: capitalize; - } -`;var I6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let mN=class extends He{constructor(){var e,r,n,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=Ye.state.data)==null?void 0:e.switchToChain,this.navigateTo=(r=Ye.state.data)==null?void 0:r.navigateTo,this.navigateWithReplace=(n=Ye.state.data)==null?void 0:n.navigateWithReplace,this.caipNetwork=(i=Ye.state.data)==null?void 0:i.network,this.activeChain=Pe.state.activeChain}firstUpdated(){this.unsubscribe.push(Pe.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?ya.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const r=this.switchToChain==="eip155"?"Ethereum":this.switchToChain;return X` - - - - Switch to ${r} - - Connected wallet doesn't support connecting to ${e} chain. You - need to connect with a different wallet. - - Switch - - - `}async switchActiveChain(){this.switchToChain&&(await Jr.switchActiveNetwork(this.caipNetwork),jr.close(),jr.open({view:"Connect"}))}};mN.styles=t8t;I6e([ce()],mN.prototype,"activeChain",void 0);mN=I6e([Fe("w3m-switch-active-chain-view")],mN);const r8t=Je` - :host > wui-flex:first-child { - overflow-y: auto; - overflow-x: hidden; - scrollbar-width: none; - } - - :host > wui-flex:first-child::-webkit-scrollbar { - display: none; - } - - .preview-container, - .details-container { - width: 100%; - } - - .token-image { - width: 24px; - height: 24px; - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - border-radius: 12px; - } - - wui-loading-hexagon { - position: absolute; - } - - .token-item { - display: flex; - align-items: center; - justify-content: center; - gap: var(--wui-spacing-xxs); - padding: var(--wui-spacing-xs); - height: 40px; - border: none; - border-radius: 80px; - background: var(--wui-color-gray-glass-002); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - cursor: pointer; - transition: background 0.2s linear; - } - - .token-item:hover { - background: var(--wui-color-gray-glass-005); - } - - .preview-token-details-container { - width: 100%; - } - - .details-row { - width: 100%; - padding: var(--wui-spacing-s) var(--wui-spacing-xl); - border-radius: var(--wui-border-radius-xxs); - background: var(--wui-color-gray-glass-002); - } - - .action-buttons-container { - width: 100%; - gap: var(--wui-spacing-xs); - } - - .action-buttons-container > button { - display: flex; - align-items: center; - justify-content: center; - background: transparent; - height: 48px; - border-radius: var(--wui-border-radius-xs); - border: none; - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } - - .action-buttons-container > button:disabled { - opacity: 0.8; - cursor: not-allowed; - } - - .action-button > wui-loading-spinner { - display: inline-block; - } - - .cancel-button:hover, - .action-button:hover { - cursor: pointer; - } - - .action-buttons-container > wui-button.cancel-button { - flex: 2; - } - - .action-buttons-container > wui-button.action-button { - flex: 4; - } - - .action-buttons-container > button.action-button > wui-text { - color: white; - } - - .details-container > wui-flex { - background: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xxs); - width: 100%; - } - - .details-container > wui-flex > button { - border: none; - background: none; - padding: var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xxs); - transition: background 0.2s linear; - } - - .details-container > wui-flex > button:hover { - background: var(--wui-color-gray-glass-002); - } - - .details-content-container { - padding: var(--wui-spacing-1xs); - display: flex; - align-items: center; - justify-content: center; - } - - .details-content-container > wui-flex { - width: 100%; - } - - .details-row { - width: 100%; - padding: var(--wui-spacing-s) var(--wui-spacing-xl); - border-radius: var(--wui-border-radius-xxs); - background: var(--wui-color-gray-glass-002); - } -`;var Go=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let wo=class extends He{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=jt.state.approvalTransaction,this.swapTransaction=jt.state.swapTransaction,this.sourceToken=jt.state.sourceToken,this.sourceTokenAmount=jt.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=jt.state.sourceTokenPriceInUSD,this.toToken=jt.state.toToken,this.toTokenAmount=jt.state.toTokenAmount??"",this.toTokenPriceInUSD=jt.state.toTokenPriceInUSD,this.caipNetwork=Pe.state.activeCaipNetwork,this.balanceSymbol=Ze.state.balanceSymbol,this.gasPriceInUSD=jt.state.gasPriceInUSD,this.inputError=jt.state.inputError,this.loadingQuote=jt.state.loadingQuote,this.loadingApprovalTransaction=jt.state.loadingApprovalTransaction,this.loadingBuildTransaction=jt.state.loadingBuildTransaction,this.loadingTransaction=jt.state.loadingTransaction,this.unsubscribe.push(Ze.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&Ye.goBack()}),Pe.subscribeKey("activeCaipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),jt.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.swapTransaction=e.swapTransaction,this.sourceToken=e.sourceToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toToken=e.toToken,this.gasPriceInUSD=e.gasPriceInUSD,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.inputError=e.inputError,e.inputError&&Ye.goBack(),this.loadingQuote=e.loadingQuote,this.loadingApprovalTransaction=e.loadingApprovalTransaction,this.loadingBuildTransaction=e.loadingBuildTransaction,this.loadingTransaction=e.loadingTransaction}))}firstUpdated(){jt.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return X` - - ${this.templateSwap()} - - `}refreshTransaction(){this.interval=setInterval(()=>{jt.getApprovalLoadingState()||jt.getTransaction()},1e4)}templateSwap(){var l,c,u,f;const e=`${Tr.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(l=this.sourceToken)==null?void 0:l.symbol}`,r=`${Tr.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(c=this.toToken)==null?void 0:c.symbol}`,n=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,i=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),a=Tr.formatNumberToLocalString(n),o=Tr.formatNumberToLocalString(i),s=this.loadingQuote||this.loadingBuildTransaction||this.loadingTransaction||this.loadingApprovalTransaction;return X` - - - - - Send - $${a} - - - - - - - - Receive - $${o} - - - - - - - ${this.templateDetails()} - - - - Review transaction carefully - - - - - Cancel - - - - ${this.actionButtonLabel()} - - - - - `}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:X``}actionButtonLabel(){return this.loadingApprovalTransaction?"Approving...":this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){Ye.goBack()}onSendTransaction(){this.approvalTransaction?jt.sendTransactionForApproval(this.approvalTransaction):jt.sendTransactionForSwap(this.swapTransaction)}};wo.styles=r8t;Go([xe()],wo.prototype,"interval",void 0);Go([xe()],wo.prototype,"detailsOpen",void 0);Go([xe()],wo.prototype,"approvalTransaction",void 0);Go([xe()],wo.prototype,"swapTransaction",void 0);Go([xe()],wo.prototype,"sourceToken",void 0);Go([xe()],wo.prototype,"sourceTokenAmount",void 0);Go([xe()],wo.prototype,"sourceTokenPriceInUSD",void 0);Go([xe()],wo.prototype,"toToken",void 0);Go([xe()],wo.prototype,"toTokenAmount",void 0);Go([xe()],wo.prototype,"toTokenPriceInUSD",void 0);Go([xe()],wo.prototype,"caipNetwork",void 0);Go([xe()],wo.prototype,"balanceSymbol",void 0);Go([xe()],wo.prototype,"gasPriceInUSD",void 0);Go([xe()],wo.prototype,"inputError",void 0);Go([xe()],wo.prototype,"loadingQuote",void 0);Go([xe()],wo.prototype,"loadingApprovalTransaction",void 0);Go([xe()],wo.prototype,"loadingBuildTransaction",void 0);Go([xe()],wo.prototype,"loadingTransaction",void 0);wo=Go([Fe("w3m-swap-preview-view")],wo);const n8t=Je` - :host { - --tokens-scroll--top-opacity: 0; - --tokens-scroll--bottom-opacity: 1; - --suggested-tokens-scroll--left-opacity: 0; - --suggested-tokens-scroll--right-opacity: 1; - } - - :host > wui-flex:first-child { - overflow-y: hidden; - overflow-x: hidden; - scrollbar-width: none; - scrollbar-height: none; - } - - :host > wui-flex:first-child::-webkit-scrollbar { - display: none; - } - - wui-loading-hexagon { - position: absolute; - } - - .suggested-tokens-container { - overflow-x: auto; - mask-image: linear-gradient( - to right, - rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px, - rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px, - black 50px, - black 90px, - black calc(100% - 90px), - black calc(100% - 50px), - rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px), - rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100% - ); - } - - .suggested-tokens-container::-webkit-scrollbar { - display: none; - } - - .tokens-container { - border-top: 1px solid var(--wui-color-gray-glass-005); - height: 100%; - max-height: 390px; - } - - .tokens { - width: 100%; - overflow-y: auto; - mask-image: linear-gradient( - to bottom, - rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px, - rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px, - black 50px, - black 90px, - black calc(100% - 90px), - black calc(100% - 50px), - rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px), - rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100% - ); - } - - .network-search-input, - .select-network-button { - height: 40px; - } - - .select-network-button { - border: none; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - gap: var(--wui-spacing-xs); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - background-color: transparent; - border-radius: var(--wui-border-radius-xxs); - padding: var(--wui-spacing-xs); - align-items: center; - transition: background-color 0.2s linear; - } - - .select-network-button:hover { - background-color: var(--wui-color-gray-glass-002); - } - - .select-network-button > wui-image { - width: 26px; - height: 26px; - border-radius: var(--wui-border-radius-xs); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010); - } -`;var _v=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let wh=class extends He{constructor(){var e;super(),this.unsubscribe=[],this.targetToken=(e=Ye.state.data)==null?void 0:e.target,this.sourceToken=jt.state.sourceToken,this.sourceTokenAmount=jt.state.sourceTokenAmount,this.toToken=jt.state.toToken,this.myTokensWithBalance=jt.state.myTokensWithBalance,this.popularTokens=jt.state.popularTokens,this.searchValue="",this.unsubscribe.push(jt.subscribe(r=>{this.sourceToken=r.sourceToken,this.toToken=r.toToken,this.myTokensWithBalance=r.myTokensWithBalance}))}updated(){var n,i;const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container");e==null||e.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");r==null||r.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var n,i;super.disconnectedCallback();const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container"),r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");e==null||e.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),r==null||r.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return X` - - ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()} - - `}onSelectToken(e){this.targetToken==="sourceToken"?jt.setSourceToken(e):(jt.setToToken(e),this.sourceToken&&this.sourceTokenAmount&&jt.swapTokens()),Ye.goBack()}templateSearchInput(){return X` - - - - `}templateTokens(){const e=this.myTokensWithBalance?Object.values(this.myTokensWithBalance):[],r=this.popularTokens?this.popularTokens:[],n=this.filterTokensWithText(e,this.searchValue),i=this.filterTokensWithText(r,this.searchValue);return X` - - - ${(n==null?void 0:n.length)>0?X` - - Your tokens - - ${n.map(a=>{var s,l,c;const o=a.symbol===((s=this.sourceToken)==null?void 0:s.symbol)||a.symbol===((l=this.toToken)==null?void 0:l.symbol);return X` - {o||this.onSelectToken(a)}} - > - - `})} - `:null} - - - Tokens - - ${(i==null?void 0:i.length)>0?i.map(a=>X` - this.onSelectToken(a)} - > - - `):null} - - - `}templateSuggestedTokens(){const e=jt.state.suggestedTokens?jt.state.suggestedTokens.slice(0,8):null;return e?X` - - ${e.map(r=>X` - this.onSelectToken(r)} - > - - `)} - - `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",s7.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",s7.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",s7.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",s7.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,r){return e.filter(n=>`${n.symbol} ${n.name} ${n.address}`.toLowerCase().includes(r.toLowerCase()))}};wh.styles=n8t;_v([xe()],wh.prototype,"interval",void 0);_v([xe()],wh.prototype,"targetToken",void 0);_v([xe()],wh.prototype,"sourceToken",void 0);_v([xe()],wh.prototype,"sourceTokenAmount",void 0);_v([xe()],wh.prototype,"toToken",void 0);_v([xe()],wh.prototype,"myTokensWithBalance",void 0);_v([xe()],wh.prototype,"popularTokens",void 0);_v([xe()],wh.prototype,"searchValue",void 0);wh=_v([Fe("w3m-swap-select-token-view")],wh);const i8t=Je` - :host > wui-flex:first-child { - height: 500px; - overflow-y: auto; - overflow-x: hidden; - scrollbar-width: none; - } - - :host > wui-flex:first-child::-webkit-scrollbar { - display: none; - } -`;var a8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let uY=class extends He{render(){return X` - - - - `}};uY.styles=i8t;uY=a8t([Fe("w3m-transactions-view")],uY);var o8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const s8t=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let Tde=class extends He{render(){return X` - - - {gt.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} - > - Learn more - - - - `}};Tde=o8t([Fe("w3m-what-is-a-network-view")],Tde);var l8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const c8t=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let Ede=class extends He{render(){return X` - - - - - Get a wallet - - - `}onGetWallet(){Vt.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),Ye.push("GetWallet")}};Ede=l8t([Fe("w3m-what-is-a-wallet-view")],Ede);var u8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Ide=class extends He{render(){return X` - - - - - Quickly and easily buy digital assets! - - - Simply select your preferred onramp provider and add digital assets to your account - using your credit card or bank transfer - - - - - Buy - - - `}};Ide=u8t([Fe("w3m-what-is-a-buy-view")],Ide);const f8t=Je` - wui-loading-spinner { - margin: 9px auto; - } - - .email-display, - .email-display wui-text { - max-width: 100%; - } -`;var A$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const d8t=6;let iv=class extends He{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=ol.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=Ye.state.data)==null?void 0:e.email,this.authConnector=rr.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,r=this.getFooterLabels(e);return X` - - - - The code expires in 20 minutes - - ${this.loading?X``:X` - - ${this.error?X` - - ${this.error}. Try Again - - `:null} - `} - - - ${r.title} - - ${r.action} - - - - `}startOTPTimeout(){this.timeoutTimeLeft=ol.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=ol.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var r;try{this.loading||(this.otp=e.detail,this.authConnector&&this.otp.length===d8t&&(this.loading=!0,await((r=this.onOtpSubmit)==null?void 0:r.call(this,this.otp))))}catch(n){this.error=gt.parseError(n),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!rr.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),vr.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){vr.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};iv.styles=f8t;A$([xe()],iv.prototype,"loading",void 0);A$([xe()],iv.prototype,"timeoutTimeLeft",void 0);A$([xe()],iv.prototype,"error",void 0);iv=A$([Fe("w3m-email-otp-widget")],iv);var k6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let fY=class extends iv{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=Ze.state.smartAccountDeployed,this.onOtpSubmit=async e=>{try{if(this.authConnector){const r=Jr.checkIfSmartAccountEnabled();if(await this.authConnector.provider.connectOtp({otp:e}),Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Pe.state.activeChain)await Dr.connectExternal(this.authConnector,Pe.state.activeChain);else throw new Error("Active chain is not set on ChainControll");Vt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),Ze.state.allAccounts.length>1?Ye.push("SelectAddresses"):r&&!this.smartAccountDeployed?Ye.push("UpgradeToSmartAccount"):At.state.isSiweEnabled||jr.close()}}catch(r){throw Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(Ze.subscribeKey("smartAccountDeployed",e=>{this.smartAccountDeployed=e}))}};k6e([xe()],fY.prototype,"smartAccountDeployed",void 0);fY=k6e([Fe("w3m-email-verify-otp-view")],fY);const h8t=Je` - wui-icon-box { - height: var(--wui-icon-box-size-xl); - width: var(--wui-icon-box-size-xl); - } -`;var P6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let yN=class extends He{constructor(){var e;super(),this.email=(e=Ye.state.data)==null?void 0:e.email,this.authConnector=rr.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return X` - - - - - - - Approve the login link we sent to - - ${this.email} - - - - The code expires in 20 minutes - - - - - Didn't receive it? - - - Resend email - - - - - `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),Vt.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),Ye.replace("EmailVerifyOtp",{email:this.email})}catch{Ye.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),vr.showSuccess("Code email resent")}}catch(e){vr.showError(e)}finally{this.loading=!1}}};yN.styles=h8t;P6e([xe()],yN.prototype,"loading",void 0);yN=P6e([Fe("w3m-email-verify-device-view")],yN);const p8t=Je` - div { - width: 100%; - height: 400px; - } - - [data-ready='false'] { - transform: scale(1.05); - } - - @media (max-width: 430px) { - [data-ready='false'] { - transform: translateY(-50px); - } - } -`;var R6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const kde=400,Pde=360,g8t=64;let wN=class extends He{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(jr.subscribeKey("open",e=>{e||(this.onHideIframe(),Ye.popTransactionStack())}),jr.subscribeKey("shake",e=>{e?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var e;this.onHideIframe(),this.unsubscribe.forEach(r=>r()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block",this.bodyObserver=new ResizeObserver(e=>{var i,a;const r=(i=e==null?void 0:e[0])==null?void 0:i.contentBoxSize,n=(a=r==null?void 0:r[0])==null?void 0:a.inlineSize;this.iframe.style.height=`${kde}px`,n&&n<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${Pde}px`,this.iframe.style.left=`calc(50% - ${Pde/2}px)`,this.iframe.style.top=`calc(50% - ${kde/2}px + ${g8t/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return X`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const e=rr.getAuthConnector();if(e){const r=Ia.getSnapshot().themeMode,n=Ia.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:n,w3mThemeVariables:Sg(n,r)})}}};wN.styles=p8t;R6e([xe()],wN.prototype,"ready",void 0);wN=R6e([Fe("w3m-approve-transaction-view")],wN);var v8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Rde=class extends He{render(){return X` - - Follow the instructions on - - - - You will have to reconnect for security reasons - - - `}};Rde=v8t([Fe("w3m-upgrade-wallet-view")],Rde);var aee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let bN=class extends He{constructor(){super(...arguments),this.authConnector=rr.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,await Dr.setPreferredAccountType(xn.ACCOUNT_TYPES.SMART_ACCOUNT),this.loading=!1,Ye.push("Account")}catch{vr.showError("Error upgrading to smart account")}}}render(){return X` - - ${this.onboardingTemplate()} ${this.buttonsTemplate()} - {gt.openHref(ZX.URLS.FAQ,"_blank")}} - > - Learn more - - - - `}onboardingTemplate(){return X` - - - - - - - - Discover Smart Accounts - - - Access advanced features such as username, social login, improved security and a smoother - user experience! - - - `}buttonsTemplate(){return X` - - Do it later - - Continue - - `}redirectToAccount(){Ye.push("Account")}};aee([xe()],bN.prototype,"authConnector",void 0);aee([xe()],bN.prototype,"loading",void 0);bN=aee([Fe("w3m-upgrade-to-smart-account-view")],bN);const m8t=Je` - wui-email-input { - width: 100%; - } - - form { - width: 100%; - display: block; - position: relative; - } -`;var oee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let LT=class extends He{constructor(){var e;super(...arguments),this.formRef=D1(),this.initialEmail=((e=Ye.state.data)==null?void 0:e.email)??"",this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",r=>{r.key==="Enter"&&this.onSubmitEmail(r)})}render(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return X` - -
- - - -
- - - - Cancel - - - - Save - - -
- `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const r=rr.getAuthConnector();if(!r)throw new Error("w3m-update-email-wallet: Auth connector not found");const n=await r.provider.updateEmail({email:this.email});Vt.sendEvent({type:"track",event:"EMAIL_EDIT"}),n.action==="VERIFY_SECONDARY_OTP"?Ye.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):Ye.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(r){vr.showError(r),this.loading=!1}}};LT.styles=m8t;oee([xe()],LT.prototype,"email",void 0);oee([xe()],LT.prototype,"loading",void 0);LT=oee([Fe("w3m-update-email-wallet-view")],LT);var y8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Mde=class extends iv{constructor(){var e;super(),this.email=(e=Ye.state.data)==null?void 0:e.email,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:r}),Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Ye.replace("UpdateEmailSecondaryOtp",Ye.state.data))}catch(n){throw Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onStartOver=()=>{Ye.replace("UpdateEmailWallet",Ye.state.data)}}};Mde=y8t([Fe("w3m-update-email-primary-otp-view")],Mde);var w8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Dde=class extends iv{constructor(){var e;super(),this.email=(e=Ye.state.data)==null?void 0:e.newEmail,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:r}),Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),Ye.reset("Account"))}catch(n){throw Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onStartOver=()=>{Ye.replace("UpdateEmailWallet",Ye.state.data)}}};Dde=w8t([Fe("w3m-update-email-secondary-otp-view")],Dde);const b8t=Je` - :host > wui-flex { - max-height: clamp(360px, 540px, 80vh); - overflow: scroll; - scrollbar-width: none; - } - - :host > wui-flex::-webkit-scrollbar { - display: none; - } -`;var M6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let xN=class extends He{constructor(){var e;super(...arguments),this.swapUnsupportedChain=(e=Ye.state.data)==null?void 0:e.swapUnsupportedChain,this.disconecting=!1}render(){return X` - - - ${this.descriptionTemplate()} - - - - ${this.networksTemplate()} - - - - - - Disconnect - - - - `}descriptionTemplate(){return this.swapUnsupportedChain?X` - - The swap feature doesn’t support your current network. Switch to an available option to - continue. - - `:X` - - This app doesn’t support your current network. Switch to an available option to continue. - - `}networksTemplate(){const e=Jr.getRequestedCaipNetworks(),r=Jr.state.approvedCaipNetworkIds,n=gt.sortRequestedNetworks(r,e);return(this.swapUnsupportedChain?n.filter(a=>Da.SWAP_SUPPORTED_NETWORKS.includes(a.id)):n).map(a=>X` - this.onSwitchNetwork(a)} - > - - `)}async onDisconnect(){try{this.disconecting=!0,await Dr.disconnect(),Vt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jr.close()}catch{Vt.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),vr.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const r=Ze.state.caipAddress,n=Jr.state.approvedCaipNetworkIds,i=Jr.state.supportsAllNetworks,a=Pe.state.activeCaipNetwork,o=Ye.state.data;r&&(a==null?void 0:a.id)!==e.id?n!=null&&n.includes(e.id)?await Jr.switchActiveNetwork(e):i&&Ye.push("SwitchNetwork",{...o,network:e}):r||(Jr.setActiveCaipNetwork(e),Ye.push("Connect"))}};xN.styles=b8t;M6e([xe()],xN.prototype,"disconecting",void 0);xN=M6e([Fe("w3m-unsupported-chain-view")],xN);const x8t=Je` - wui-compatible-network { - margin-top: var(--wui-spacing-l); - } -`;var N8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let t2=class extends He{constructor(){super(),this.unsubscribe=[],this.address=Ze.state.address,this.profileName=Ze.state.profileName,this.network=Pe.state.activeCaipNetwork,this.preferredAccountType=Ze.state.preferredAccountType,this.unsubscribe.push(Ze.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):vr.showError("Account not found")}),Pe.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=Jn.getNetworkImage(this.network);return X` - - - - - Copy your address or scan this QR code - - - ${this.networkTemplate()} - `}networkTemplate(){var o;const e=Jr.getRequestedCaipNetworks(),r=Jr.checkIfSmartAccountEnabled(),n=Pe.state.activeCaipNetwork;if(this.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT&&r)return n?X``:null;const a=((o=e==null?void 0:e.filter(s=>s==null?void 0:s.imageId))==null?void 0:o.slice(0,5)).map(Jn.getNetworkImage).filter(Boolean);return X``}onReceiveClick(){Ye.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(gt.copyToClopboard(this.address),vr.showSuccess("Address copied"))}catch{vr.showError("Failed to copy")}}};t2.styles=x8t;N8([xe()],t2.prototype,"address",void 0);N8([xe()],t2.prototype,"profileName",void 0);N8([xe()],t2.prototype,"network",void 0);N8([xe()],t2.prototype,"preferredAccountType",void 0);t2=N8([Fe("w3m-wallet-receive-view")],t2);const _8t=Je` - :host > wui-flex { - max-height: clamp(360px, 540px, 80vh); - overflow: scroll; - scrollbar-width: none; - } - - :host > wui-flex::-webkit-scrollbar { - display: none; - } -`;var D6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let _N=class extends He{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=Ze.state.preferredAccountType,this.unsubscribe.push(Ze.subscribeKey("preferredAccountType",e=>{this.preferredAccountType=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - ${this.networkTemplate()} - `}networkTemplate(){const e=Jr.getRequestedCaipNetworks(),r=Jr.state.approvedCaipNetworkIds,n=Pe.state.activeCaipNetwork,i=Jr.checkIfSmartAccountEnabled();let a=gt.sortRequestedNetworks(r,e);if(i&&this.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT){if(!n)return null;a=[n]}return a.map(o=>X` - - - `)}};_N.styles=_8t;D6e([xe()],_N.prototype,"preferredAccountType",void 0);_N=D6e([Fe("w3m-wallet-compatible-networks-view")],_N);const S8t=Je` - :host { - display: block; - } - - wui-flex { - position: relative; - } - - wui-icon-box { - width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-xs) !important; - border: 5px solid var(--wui-color-bg-125); - background: var(--wui-color-bg-175); - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 3; - } - - wui-button { - --local-border-radius: var(--wui-border-radius-xs) !important; - } - - .inputContainer { - height: fit-content; - } -`;var Sv=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let bh=class extends He{constructor(){super(),this.unsubscribe=[],this.token=ui.state.token,this.sendTokenAmount=ui.state.sendTokenAmount,this.receiverAddress=ui.state.receiverAddress,this.receiverProfileName=ui.state.receiverProfileName,this.loading=ui.state.loading,this.gasPriceInUSD=ui.state.gasPriceInUSD,this.gasPrice=ui.state.gasPrice,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push(ui.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),X` - - - - - - - - ${this.message} - - - `}async fetchNetworkPrice(){await jt.getNetworkTokenPrice();const e=await jt.getInitialGasPrice();e!=null&&e.gasPrice&&(e!=null&&e.gasPriceInUSD)&&(ui.setGasPrice(e.gasPrice),ui.setGasPriceInUsd(e.gasPriceInUSD))}onButtonClick(){Ye.push("WalletSendPreview")}getMessage(){var e;this.message="Preview Send",this.receiverAddress&&!gt.isAddress(this.receiverAddress,Pe.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((e=this.token)!=null&&e.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};bh.styles=S8t;Sv([xe()],bh.prototype,"token",void 0);Sv([xe()],bh.prototype,"sendTokenAmount",void 0);Sv([xe()],bh.prototype,"receiverAddress",void 0);Sv([xe()],bh.prototype,"receiverProfileName",void 0);Sv([xe()],bh.prototype,"loading",void 0);Sv([xe()],bh.prototype,"gasPriceInUSD",void 0);Sv([xe()],bh.prototype,"gasPrice",void 0);Sv([xe()],bh.prototype,"message",void 0);bh=Sv([Fe("w3m-wallet-send-view")],bh);const C8t=Je` - .contentContainer { - height: 440px; - overflow: scroll; - scrollbar-width: none; - } - - .contentContainer::-webkit-scrollbar { - display: none; - } - - wui-icon-box { - width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-xxs); - } -`;var O8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let r2=class extends He{constructor(){super(),this.unsubscribe=[],this.tokenBalance=Ze.state.tokenBalance,this.search="",this.onDebouncedSearch=gt.debounce(e=>{this.search=e}),this.unsubscribe.push(Ze.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - ${this.templateSearchInput()} ${this.templateTokens()} - - `}templateSearchInput(){return X` - - - - `}templateTokens(){var e,r;return this.tokens=(e=this.tokenBalance)==null?void 0:e.filter(n=>{var i;return n.chainId===((i=Pe.state.activeCaipNetwork)==null?void 0:i.id)}),this.search?this.filteredTokens=(r=this.tokenBalance)==null?void 0:r.filter(n=>n.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,X` - - - Your tokens - - - ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(n=>X``):X` - - - No tokens found - Your tokens will appear here - - Buy - `} - - - `}onBuyClick(){Ye.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){ui.setToken(e),ui.setTokenAmount(void 0),Ye.goBack()}};r2.styles=C8t;O8([xe()],r2.prototype,"tokenBalance",void 0);O8([xe()],r2.prototype,"tokens",void 0);O8([xe()],r2.prototype,"filteredTokens",void 0);O8([xe()],r2.prototype,"search",void 0);r2=O8([Fe("w3m-wallet-send-select-token-view")],r2);const A8t=Je` - wui-avatar, - wui-image { - display: ruby; - width: 32px; - height: 32px; - border-radius: var(--wui-border-radius-3xl); - } - - .sendButton { - width: 70%; - --local-width: 100% !important; - --local-border-radius: var(--wui-border-radius-xs) !important; - } - - .cancelButton { - width: 30%; - --local-width: 100% !important; - --local-border-radius: var(--wui-border-radius-xs) !important; - } -`;var gy=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let s0=class extends He{constructor(){super(),this.unsubscribe=[],this.token=ui.state.token,this.sendTokenAmount=ui.state.sendTokenAmount,this.receiverAddress=ui.state.receiverAddress,this.receiverProfileName=ui.state.receiverProfileName,this.receiverProfileImageUrl=ui.state.receiverProfileImageUrl,this.gasPriceInUSD=ui.state.gasPriceInUSD,this.caipNetwork=Pe.state.activeCaipNetwork,this.unsubscribe.push(ui.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.gasPriceInUSD=e.gasPriceInUSD,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl}),Pe.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,r;return X` - - - - Send - ${this.sendValueTemplate()} - - - - - - - - To - - - - - - - - Review transaction carefully - - - - Cancel - - - Send - - - `}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const r=this.token.price*this.sendTokenAmount;return X`$${r.toFixed(2)}`}return null}onSendClick(){ui.sendToken()}onCancelClick(){Ye.goBack()}};s0.styles=A8t;gy([xe()],s0.prototype,"token",void 0);gy([xe()],s0.prototype,"sendTokenAmount",void 0);gy([xe()],s0.prototype,"receiverAddress",void 0);gy([xe()],s0.prototype,"receiverProfileName",void 0);gy([xe()],s0.prototype,"receiverProfileImageUrl",void 0);gy([xe()],s0.prototype,"gasPriceInUSD",void 0);gy([xe()],s0.prototype,"caipNetwork",void 0);s0=gy([Fe("w3m-wallet-send-preview-view")],s0);const T8t=Je` - wui-flex { - max-height: clamp(360px, 540px, 80vh); - overflow: scroll; - scrollbar-width: none; - } - wui-flex::-webkit-scrollbar { - display: none; - } -`;var E8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let dY=class extends He{render(){return X` - - - - - `}};dY.styles=T8t;dY=E8t([Fe("w3m-connect-wallets-view")],dY);const I8t=Je` - wui-flex { - max-height: clamp(360px, 540px, 80vh); - overflow: scroll; - scrollbar-width: none; - } - wui-flex::-webkit-scrollbar { - display: none; - } -`;var k8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let hY=class extends He{render(){return X` - - - - - `}};hY.styles=I8t;hY=k8t([Fe("w3m-connect-socials-view")],hY);const P8t=Je` - wui-logo { - width: 80px; - height: 80px; - border-radius: var(--wui-border-radius-m); - } - @keyframes shake { - 0% { - transform: translateX(0); - } - 25% { - transform: translateX(3px); - } - 50% { - transform: translateX(-3px); - } - 75% { - transform: translateX(3px); - } - 100% { - transform: translateX(0); - } - } - wui-flex:first-child:not(:only-child) { - position: relative; - } - wui-loading-thumbnail { - position: absolute; - } - wui-icon-box { - position: absolute; - right: calc(var(--wui-spacing-3xs) * -1); - bottom: calc(var(--wui-spacing-3xs) * -1); - opacity: 0; - transform: scale(0.5); - transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); - } - wui-text[align='center'] { - width: 100%; - padding: 0px var(--wui-spacing-l); - } - [data-error='true'] wui-icon-box { - opacity: 1; - transform: scale(1); - } - [data-error='true'] > wui-flex:first-child { - animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; - } - .capitalize { - text-transform: capitalize; - } -`;var DS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let j1=class extends He{constructor(){super(),this.unsubscribe=[],this.socialProvider=Ze.state.socialProvider,this.socialWindow=Ze.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=rr.getAuthConnector(),this.handleSocialConnection=async e=>{var r;if((r=e.data)!=null&&r.resultUri)if(e.origin===Tg.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),Ze.setSocialWindow(void 0,Pe.state.activeChain)),this.connecting=!0,this.updateMessage();const n=e.data.resultUri;await this.authConnector.provider.connectSocial(n),this.socialProvider&&(jn.setConnectedSocialProvider(this.socialProvider),await Dr.connectExternal(this.authConnector,this.authConnector.chain),Vt.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch{this.error=!0,this.updateMessage(),this.socialProvider&&Vt.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else Ye.goBack(),vr.showError("Untrusted Origin"),this.socialProvider&&Vt.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},this.unsubscribe.push(Ze.subscribe(e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow),e.address&&jr.state.open&&jr.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return X` - - - - ${this.error?null:this.loaderTemplate()} - - - - Log in with - ${this.socialProvider??"Social"} - ${this.message} - - `}loaderTemplate(){const e=Ia.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return X``}connectSocial(){const e=setInterval(()=>{var r;(r=this.socialWindow)!=null&&r.closed&&(!this.connecting&&Ye.state.view==="ConnectingSocial"&&Ye.goBack(),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};j1.styles=P8t;DS([xe()],j1.prototype,"socialProvider",void 0);DS([xe()],j1.prototype,"socialWindow",void 0);DS([xe()],j1.prototype,"error",void 0);DS([xe()],j1.prototype,"connecting",void 0);DS([xe()],j1.prototype,"message",void 0);j1=DS([Fe("w3m-connecting-social-view")],j1);const R8t=Je` - wui-flex { - width: 100%; - } - - wui-icon-link { - margin-right: calc(var(--wui-icon-box-size-md) * -1); - } - - .account-links { - display: flex; - justify-content: space-between; - align-items: center; - } - - .account-links wui-flex { - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - flex: 1; - background: red; - align-items: center; - justify-content: center; - height: 48px; - padding: 10px; - flex: 1 0 0; - - border-radius: var(--XS, 16px); - border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); - background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: background-color; - } - - .account-links wui-flex:hover { - background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); - } - - .account-links wui-flex wui-icon { - width: var(--S, 20px); - height: var(--S, 20px); - } - - .account-links wui-flex wui-icon svg path { - stroke: #47a1ff; - } - - .account-settings-button { - padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l); - height: 40px; - border-radius: var(--wui-border-radius-xxs); - border: 1px solid var(--wui-color-gray-glass-002); - background: var(--wui-color-gray-glass-002); - cursor: pointer; - } - - .account-settings-button:hover { - background: var(--wui-color-gray-glass-005); - } -`;var L8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let n2=class extends He{constructor(){super(),this.usubscribe=[],this.address=Ze.state.address,this.profileImage=Ze.state.profileImage,this.profileName=Ze.state.profileName,this.accounts=Ze.state.allAccounts,this.usubscribe.push(Ze.subscribeKey("address",e=>{e?this.address=e:jr.close()})),this.usubscribe.push(Ze.subscribeKey("profileImage",e=>{this.profileImage=e})),this.usubscribe.push(Ze.subscribeKey("profileName",e=>{this.profileName=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-profile-view: No account provided");return X` - - - - - - - ${this.profileName?Tr.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Tr.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} - - - - - - - ${this.accountsTemplate()} - - `}accountsTemplate(){return X` - - Your accounts - - - ${this.accounts.map(e=>this.accountTemplate(e))} - - `}async onSwitchAccount(e){Ze.setShouldUpdateToAddress(e.address,Pe.state.activeChain);const r=rr.getAuthConnector();r&&(await r.provider.setPreferredAccount(e.type),await r.provider.connect())}accountTemplate(e){return X` - ${e.address===this.address?"":X`this.onSwitchAccount(e)} - >Switch`} - `}onCopyAddress(){try{this.profileName?(gt.copyToClopboard(this.profileName),vr.showSuccess("Name copied")):this.address&&(gt.copyToClopboard(this.address),vr.showSuccess("Address copied"))}catch{vr.showError("Failed to copy")}}};n2.styles=R8t;L8([xe()],n2.prototype,"address",void 0);L8([xe()],n2.prototype,"profileImage",void 0);L8([xe()],n2.prototype,"profileName",void 0);L8([xe()],n2.prototype,"accounts",void 0);n2=L8([Fe("w3m-profile-view")],n2);const M8t=Je` - input[type='checkbox'] { - all: revert; - width: var(--wui-spacing-xl); - height: var(--wui-spacing-xl); - accent-color: var(--wui-color-accent-100); - } -`;var NS=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let U1=class extends He{constructor(){super(),this.metadata=At.state.metadata,this.allAccounts=Ze.state.allAccounts,this.selectedAccounts=Ze.state.allAccounts,this.selectAll=!0,this.approved=!1,this.isApproving=!1,this.getAddressTemplate=e=>{const r=this.selectedAccounts.some(n=>n.address===e.address);return X` - - `},this.onSelectAll=e=>{const r=e.target.checked;this.selectAll=this.selectedAccounts.length===this.allAccounts.length,this.allAccounts.forEach(n=>{this.onSelect(n,r)})},this.onSelect=(e,r)=>{r?this.selectedAccounts.push(e):this.selectedAccounts=this.selectedAccounts.filter(n=>n.address!==e.address),this.selectedAccounts.length>0&&(this.selectAll=this.selectedAccounts.length===this.allAccounts.length)},Ze.subscribeKey("allAccounts",e=>{this.allAccounts=e})}render(){var e,r;return X` - - - - - Select all - - - - ${this.allAccounts.map(n=>this.getAddressTemplate(n))} - - - - Cancel - - - ${this.isApproving?"Signing...":"Continue"} - - - `}handleClick(e){return r=>{var i;const n=r.target;(i=this.onSelect)==null||i.call(this,{...e},n==null?void 0:n.checked)}}onContinue(){var e;this.selectedAccounts.length>0?(this.isApproving=!0,Ze.setAllAccounts(this.selectedAccounts,Pe.state.activeChain),Ze.setShouldUpdateToAddress(((e=this.selectedAccounts[0])==null?void 0:e.address)??"",Pe.state.activeChain),this.approved=!0,this.isApproving=!1,jr.close()):this.onCancel()}async onCancel(){const{activeCaipAddress:e}=Pe.state;e?(await Dr.disconnect(),jr.close()):Ye.push("Connect")}disconnectedCallback(){super.disconnectedCallback(),this.approved||this.onCancel()}};U1.styles=M8t;NS([xe()],U1.prototype,"allAccounts",void 0);NS([xe()],U1.prototype,"selectedAccounts",void 0);NS([xe()],U1.prototype,"selectAll",void 0);NS([xe()],U1.prototype,"approved",void 0);NS([xe()],U1.prototype,"isApproving",void 0);U1=NS([Fe("w3m-select-addresses-view")],U1);const D8t=Je` - wui-avatar { - width: var(--wui-spacing-3xl); - height: var(--wui-spacing-3xl); - box-shadow: 0 0 0 0; - } - - wui-icon-box { - position: relative; - right: 15px; - top: 15px; - border: 2px solid var(--wui-color-bg-150); - background-color: var(--wui-color-bg-125); - } -`;var see=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let $T=class extends He{constructor(){super(),this.metadata=At.state.metadata,this.allAccounts=Ze.state.allAccounts||[],this.balances={},this.labels=Ze.state.addressLabels,this.currentAddress=Ze.state.address||"",this.connectedConnector=jn.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH",this.caipNetwork=Pe.state.activeCaipNetwork,Ze.subscribeKey("allAccounts",e=>{this.allAccounts=e})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(e=>{var r;Ma.getBalance(e.address,(r=this.caipNetwork)==null?void 0:r.id).then(n=>{let i=this.balances[e.address]||0;n.balances.length>0&&(i=n.balances.reduce((a,o)=>a+((o==null?void 0:o.value)||0),0)),this.balances[e.address]=i,this.requestUpdate()})})}getAddressIcon(e){return e==="smartAccount"?"lightbulb":"mail"}render(){var e,r;return X` - - - - - ${this.allAccounts.map((n,i)=>this.getAddressTemplate(n,i))} - - `}getAddressTemplate(e,r){var i,a,o,s;const n=(i=this.labels)==null?void 0:i.get(e.address);return X` - - - - ${this.shouldShowIcon?X``:X``} - - ${n||Tr.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})} - - ${typeof this.balances[e.address]=="number"?`$${(a=this.balances[e.address])==null?void 0:a.toFixed(2)}`:X``} - - - - - ${((o=e.address)==null?void 0:o.toLowerCase())===((s=this.currentAddress)==null?void 0:s.toLowerCase())?"":X` - this.onSwitchAddress(e.address)} - >Switch to - `} - - - `}onSwitchAddress(e){const r=Pe.state.activeCaipNetwork,n=r==null?void 0:r.chainNamespace,i=`${n}:${r==null?void 0:r.chainId}:${e}`;Ze.setCaipAddress(i,n),jr.close()}};$T.styles=D8t;see([xe()],$T.prototype,"allAccounts",void 0);see([xe()],$T.prototype,"balances",void 0);$T=see([Fe("w3m-switch-address-view")],$T);const N8t=Je` - @keyframes fadein { - from { - opacity: 0; - } - to { - opacity: 1; - } - } - - wui-shimmer { - width: 100%; - aspect-ratio: 1 / 1; - border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; - } - - wui-qr-code { - opacity: 0; - animation-duration: 200ms; - animation-timing-function: ease; - animation-name: fadein; - animation-fill-mode: forwards; - } - - wui-logo { - width: 80px; - height: 80px; - border-radius: var(--wui-border-radius-m); - } - - wui-flex:first-child:not(:only-child) { - position: relative; - } - wui-loading-thumbnail { - position: absolute; - } - wui-icon-box { - position: absolute; - right: calc(var(--wui-spacing-3xs) * -1); - bottom: calc(var(--wui-spacing-3xs) * -1); - opacity: 0; - transform: scale(0.5); - transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg); - } -`;var $8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let i2=class extends He{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=Ze.state.socialProvider,this.uri=Ze.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=rr.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(Ze.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),Ze.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),X`${this.platformTemplate()}`}platformTemplate(){return gt.isMobile()?X`${this.mobileTemplate()}`:X`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?X`${this.loadingTemplate()}`:X`${this.qrTemplate()}`}qrTemplate(){return X` - ${this.qrCodeTemplate()} - - - Scan this QR Code with your phone - - ${this.copyTemplate()} - `}loadingTemplate(){return X` - - - - ${this.loaderTemplate()} - - - - - Loading user data - - - Please wait a moment while we load your data. - - - - `}mobileTemplate(){return X` - - - ${this.loaderTemplate()} - - - - Continue in Farcaster - Accept connection request in the app - ${this.mobileLinkTemplate()} - `}loaderTemplate(){const e=Ia.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return X``}async connectFarcaster(){var e;if(this.authConnector)try{await((e=this.authConnector)==null?void 0:e.provider.connectFarcaster()),this.socialProvider&&jn.setConnectedSocialProvider(this.socialProvider),this.loading=!0,await Dr.connectExternal(this.authConnector,this.authConnector.chain),this.loading=!1,jr.close()}catch(r){Ye.goBack(),vr.showError(r)}}mobileLinkTemplate(){return X`{this.uri&>.openHref(this.uri,"_blank")}} - > - Open farcaster`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},0))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40;return X` `}copyTemplate(){const e=!this.uri||!this.ready;return X` - - Copy link - `}onCopyUri(){try{this.uri&&(gt.copyToClopboard(this.uri),vr.showSuccess("Link copied"))}catch{vr.showError("Failed to copy")}}};i2.styles=N8t;$8([xe()],i2.prototype,"socialProvider",void 0);$8([xe()],i2.prototype,"uri",void 0);$8([xe()],i2.prototype,"ready",void 0);$8([xe()],i2.prototype,"loading",void 0);i2=$8([Fe("w3m-connecting-farcaster-view")],i2);const O8t=Je` - wui-grid { - max-height: clamp(360px, 400px, 80vh); - overflow: scroll; - scrollbar-width: none; - grid-auto-rows: min-content; - grid-template-columns: repeat(auto-fill, 76px); - } - - @media (max-width: 435px) { - wui-grid { - grid-template-columns: repeat(auto-fill, 77px); - } - } - - wui-grid[data-scroll='false'] { - overflow: hidden; - } - - wui-grid::-webkit-scrollbar { - display: none; - } - - wui-loading-spinner { - padding-top: var(--wui-spacing-l); - padding-bottom: var(--wui-spacing-l); - justify-content: center; - grid-column: 1 / span 4; - } -`,A5={filterOutDuplicatesByRDNS(t){const e=At.state.enableEIP6963?rr.state.connectors:[],r=jn.getRecentWallets(),n=e.map(s=>{var l;return(l=s.info)==null?void 0:l.rdns}).filter(Boolean),i=r.map(s=>s.rdns).filter(Boolean),a=n.concat(i);if(a.includes("io.metamask.mobile")&>.isMobile()){const s=a.indexOf("io.metamask.mobile");a[s]="io.metamask"}return t.filter(s=>!a.includes(String(s==null?void 0:s.rdns)))},filterOutDuplicatesByIds(t){const e=rr.state.connectors.filter(s=>s.type==="ANNOUNCED"||s.type==="INJECTED"),r=jn.getRecentWallets(),n=e.map(s=>s.explorerId),i=r.map(s=>s.id),a=n.concat(i);return t.filter(s=>!a.includes(s==null?void 0:s.id))},filterOutDuplicateWallets(t){const e=this.filterOutDuplicatesByRDNS(t);return this.filterOutDuplicatesByIds(e)},markWalletsAsInstalled(t){const{connectors:e}=rr.state,r=e.filter(a=>a.type==="ANNOUNCED").reduce((a,o)=>{var s;return(s=o.info)!=null&&s.rdns&&(a[o.info.rdns]=!0),a},{});return t.map(a=>({...a,installed:!!a.rdns&&!!r[a.rdns??""]})).sort((a,o)=>Number(o.installed)-Number(a.installed))}};var B8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const Nde="local-paginator";let a2=class extends He{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!xr.state.wallets.length,this.wallets=xr.state.wallets,this.recommended=xr.state.recommended,this.featured=xr.state.featured,this.unsubscribe.push(xr.subscribeKey("wallets",e=>this.wallets=e),xr.subscribeKey("recommended",e=>this.recommended=e),xr.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(r=>r()),(e=this.paginationObserver)==null||e.disconnect()}render(){return X` - - ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()} - ${this.paginationLoaderTemplate()} - - `}async initialFetch(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-grid");this.initial&&e&&(await xr.fetchWallets({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,r){return[...Array(e)].map(()=>X` - - `)}walletsTemplate(){const e=[...this.featured,...this.recommended,...this.wallets];return A5.markWalletsAsInstalled(e).map(n=>X` - this.onConnectWallet(n)} - .wallet=${n} - > - `)}paginationLoaderTemplate(){const{wallets:e,recommended:r,featured:n,count:i}=xr.state,a=window.innerWidth<352?3:4,o=e.length+r.length;let l=Math.ceil(o/a)*a-o+a;return l-=e.length?n.length%a:0,i===0&&n.length>0?null:i===0||[...n,...e,...r].length{if(n!=null&&n.isIntersecting&&!this.initial){const{page:i,count:a,wallets:o}=xr.state;o.length wui-text { - color: var(--wui-color-fg-100); - max-width: var(--wui-icon-box-size-xl); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - justify-content: center; - } - - button:hover:enabled { - background-color: var(--wui-color-gray-glass-005); - } - - button:disabled > wui-text { - color: var(--wui-color-gray-glass-015); - } - - [data-selected='true'] { - background-color: var(--wui-color-accent-glass-020); - } - - @media (hover: hover) and (pointer: fine) { - [data-selected='true']:hover:enabled { - background-color: var(--wui-color-accent-glass-015); - } - } - - [data-selected='true']:active:enabled { - background-color: var(--wui-color-accent-glass-010); - } -`;var F8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let o2=class extends He{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(r=>{r.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var e;return X` - - `}imageTemplate(){var e,r;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():X` - - - `}shimmerTemplate(){return X``}async fetchImageSrc(){this.wallet&&(this.imageSrc=Jn.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await Jn.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};o2.styles=L8t;F8([xe()],o2.prototype,"visible",void 0);F8([xe()],o2.prototype,"imageSrc",void 0);F8([xe()],o2.prototype,"imageLoading",void 0);F8([ce()],o2.prototype,"wallet",void 0);o2=F8([Fe("w3m-all-wallets-list-item")],o2);const $8t=Je` - wui-grid, - wui-loading-spinner, - wui-flex { - height: 360px; - } - - wui-grid { - overflow: scroll; - scrollbar-width: none; - grid-auto-rows: min-content; - } - - wui-grid[data-scroll='false'] { - overflow: hidden; - } - - wui-grid::-webkit-scrollbar { - display: none; - } - - wui-loading-spinner { - justify-content: center; - align-items: center; - } -`;var lee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let BT=class extends He{constructor(){super(...arguments),this.prevQuery="",this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?X``:this.walletsTemplate()}async onSearch(){this.query.trim()!==this.prevQuery.trim()&&(this.prevQuery=this.query,this.loading=!0,await xr.searchWallet({search:this.query}),this.loading=!1)}walletsTemplate(){const{search:e}=xr.state,r=A5.markWalletsAsInstalled(e);return e.length?X` - - ${r.map(n=>X` - this.onConnectWallet(n)} - .wallet=${n} - > - `)} - - `:X` - - - No Wallet found - - `}onConnectWallet(e){const r=rr.getConnector(e.id,e.rdns);r?Ye.push("ConnectingExternal",{connector:r}):Ye.push("ConnectingWalletConnect",{wallet:e})}};BT.styles=$8t;lee([xe()],BT.prototype,"loading",void 0);lee([ce()],BT.prototype,"query",void 0);BT=lee([Fe("w3m-all-wallets-search")],BT);var T$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let FT=class extends He{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(Dr.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return X` - - - - `}generateTabs(){const e=this.platforms.map(r=>r==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:r==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:r==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:r==="web"?{label:"Webapp",icon:"browser",platform:"web"}:r==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:r})=>r),e}onTabChange(e){var n;const r=this.platformTabs[e];r&&((n=this.onSelectPlatfrom)==null||n.call(this,r))}};T$([ce({type:Array})],FT.prototype,"platforms",void 0);T$([ce()],FT.prototype,"onSelectPlatfrom",void 0);T$([xe()],FT.prototype,"buffering",void 0);FT=T$([Fe("w3m-connecting-header")],FT);var B8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Ode=class extends zc{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:r}=rr.state,n=r.find(i=>{var a,o,s;return i.type==="ANNOUNCED"&&((a=i.info)==null?void 0:a.rdns)===((o=this.wallet)==null?void 0:o.rdns)||i.type==="INJECTED"||i.name===((s=this.wallet)==null?void 0:s.name)});if(n)await Dr.connectExternal(n,n.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");jr.close(),Vt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(r){Vt.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),this.error=!0}}};Ode=B8t([Fe("w3m-connecting-wc-browser")],Ode);var F8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Lde=class extends zc{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:r,name:n}=this.wallet,{redirect:i,href:a}=gt.formatNativeUrl(r,this.uri);Dr.setWcLinking({name:n,href:a}),Dr.setRecentWallet(this.wallet),gt.openHref(i,"_blank")}catch{this.error=!0}}};Lde=F8t([Fe("w3m-connecting-wc-desktop")],Lde);var j8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let $de=class extends zc{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this))}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:r,name:n}=this.wallet,{redirect:i,href:a}=gt.formatNativeUrl(r,this.uri);Dr.setWcLinking({name:n,href:a}),Dr.setRecentWallet(this.wallet),gt.openHref(i,"_self")}catch(r){Vt.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:r instanceof Error?r.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}}onBuffering(){const e=gt.isIos();(document==null?void 0:document.visibilityState)==="visible"&&!this.error&&e&&(Dr.setBuffering(!0),setTimeout(()=>{Dr.setBuffering(!1)},5e3))}};$de=j8t([Fe("w3m-connecting-wc-mobile")],$de);const U8t=Je` - @keyframes fadein { - from { - opacity: 0; - } - to { - opacity: 1; - } - } - - wui-shimmer { - width: 100%; - aspect-ratio: 1 / 1; - border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; - } - - wui-qr-code { - opacity: 0; - animation-duration: 200ms; - animation-timing-function: ease; - animation-name: fadein; - animation-fill-mode: forwards; - } -`;var z8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let pY=class extends zc{constructor(){var e;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),X` - - ${this.qrCodeTemplate()} - - - Scan this QR Code with your phone - - ${this.copyTemplate()} - - - - `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,r=this.wallet?this.wallet.name:void 0;return Dr.setWcLinking(void 0),Dr.setRecentWallet(this.wallet),X` `}copyTemplate(){const e=!this.uri||!this.ready;return X` - - Copy link - `}};pY.styles=U8t;pY=z8t([Fe("w3m-connecting-wc-qrcode")],pY);var H8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Bde=class extends He{constructor(){var e;if(super(),this.wallet=(e=Ye.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return X` - - - - Not Detected - - - - `}};Bde=H8t([Fe("w3m-connecting-wc-unsupported")],Bde);var V8t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Fde=class extends zc{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",Vt.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:r,name:n}=this.wallet,{redirect:i,href:a}=gt.formatUniversalUrl(r,this.uri);Dr.setWcLinking({name:n,href:a}),Dr.setRecentWallet(this.wallet),gt.openHref(i,"_blank")}catch{this.error=!0}}};Fde=V8t([Fe("w3m-connecting-wc-web")],Fde);const G8t=Je` - :host { - width: 100%; - } - - .details-container > wui-flex { - background: var(--wui-color-gray-glass-002); - border-radius: var(--wui-border-radius-xxs); - width: 100%; - } - - .details-container > wui-flex > button { - border: none; - background: none; - padding: var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xxs); - cursor: pointer; - } - - .details-content-container { - padding: var(--wui-spacing-1xs); - padding-top: 0px; - display: flex; - align-items: center; - justify-content: center; - } - - .details-content-container > wui-flex { - width: 100%; - } - - .details-row { - width: 100%; - padding: var(--wui-spacing-s); - padding-left: var(--wui-spacing-s); - padding-right: var(--wui-spacing-1xs); - border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs)); - background: var(--wui-color-gray-glass-002); - } - - .details-row-title { - white-space: nowrap; - } - - .details-row.provider-free-row { - padding-right: var(--wui-spacing-xs); - } -`;var Du=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const W8t=Da.CONVERT_SLIPPAGE_TOLERANCE;let ql=class extends He{constructor(){var e;super(),this.unsubscribe=[],this.networkName=(e=Pe.state.activeCaipNetwork)==null?void 0:e.name,this.detailsOpen=!1,this.sourceToken=jt.state.sourceToken,this.toToken=jt.state.toToken,this.toTokenAmount=jt.state.toTokenAmount,this.sourceTokenPriceInUSD=jt.state.sourceTokenPriceInUSD,this.toTokenPriceInUSD=jt.state.toTokenPriceInUSD,this.gasPriceInUSD=jt.state.gasPriceInUSD,this.priceImpact=jt.state.priceImpact,this.maxSlippage=jt.state.maxSlippage,this.networkTokenSymbol=jt.state.networkTokenSymbol,this.inputError=jt.state.inputError,this.unsubscribe.push(jt.subscribe(r=>{this.sourceToken=r.sourceToken,this.toToken=r.toToken,this.toTokenAmount=r.toTokenAmount,this.gasPriceInUSD=r.gasPriceInUSD,this.priceImpact=r.priceImpact,this.maxSlippage=r.maxSlippage,this.sourceTokenPriceInUSD=r.sourceTokenPriceInUSD,this.toTokenPriceInUSD=r.toTokenPriceInUSD,this.inputError=r.inputError}))}render(){const e=this.toTokenAmount&&this.maxSlippage?ii.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString():null;if(!this.sourceToken||!this.toToken||this.inputError)return null;const r=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return X` - - - - ${this.detailsOpen?X` - - - - - - Network cost - - - - - - - $${Tr.formatNumberToLocalString(this.gasPriceInUSD,3)} - - - - ${this.priceImpact?X` - - - - Price impact - - - - - - - - ${Tr.formatNumberToLocalString(this.priceImpact,3)}% - - - - `:null} - ${this.maxSlippage&&this.sourceToken.symbol?X` - - - - Max. slippage - - - - - - - - ${Tr.formatNumberToLocalString(this.maxSlippage,6)} - ${this.toToken.symbol} ${W8t}% - - - - `:null} - - - - - Provider fee - - - - 0.85% - - - - - `:null} - - - `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};ql.styles=[G8t];Du([xe()],ql.prototype,"networkName",void 0);Du([ce()],ql.prototype,"detailsOpen",void 0);Du([xe()],ql.prototype,"sourceToken",void 0);Du([xe()],ql.prototype,"toToken",void 0);Du([xe()],ql.prototype,"toTokenAmount",void 0);Du([xe()],ql.prototype,"sourceTokenPriceInUSD",void 0);Du([xe()],ql.prototype,"toTokenPriceInUSD",void 0);Du([xe()],ql.prototype,"gasPriceInUSD",void 0);Du([xe()],ql.prototype,"priceImpact",void 0);Du([xe()],ql.prototype,"maxSlippage",void 0);Du([xe()],ql.prototype,"networkTokenSymbol",void 0);Du([xe()],ql.prototype,"inputError",void 0);ql=Du([Fe("w3m-swap-details")],ql);const q8t=Je` - :host > wui-flex { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - border-radius: var(--wui-border-radius-s); - background-color: var(--wui-color-gray-glass-002); - padding: var(--wui-spacing-xl); - padding-right: var(--wui-spacing-s); - width: 100%; - height: 100px; - box-sizing: border-box; - box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002); - position: relative; - transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-lg); - will-change: background-color; - } - - :host wui-flex.focus { - box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-005); - } - - :host > wui-flex .swap-input, - :host > wui-flex .swap-token-button { - z-index: 10; - } - - :host > wui-flex .swap-input { - -webkit-mask-image: linear-gradient( - 270deg, - transparent 0px, - transparent 8px, - black 24px, - black 25px, - black 32px, - black 100% - ); - mask-image: linear-gradient( - 270deg, - transparent 0px, - transparent 8px, - black 24px, - black 25px, - black 32px, - black 100% - ); - } - - :host > wui-flex .swap-input input { - background: none; - border: none; - height: 42px; - width: 100%; - font-size: 32px; - font-style: normal; - font-weight: 400; - line-height: 130%; - letter-spacing: -1.28px; - outline: none; - caret-color: var(--wui-color-accent-100); - color: var(--wui-color-fg-100); - padding: 0px; - } - - :host > wui-flex .swap-input input:focus-visible { - outline: none; - } - - :host > wui-flex .swap-input input::-webkit-outer-spin-button, - :host > wui-flex .swap-input input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } - - .max-value-button { - background-color: transparent; - border: none; - cursor: pointer; - color: var(--wui-color-gray-glass-020); - padding-left: 0px; - } - - .market-value { - min-height: 18px; - } -`;var kh=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const Y8t=5e-5;let xu=class extends He{constructor(){super(...arguments),this.focused=!1,this.price=0,this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const e=this.marketValue||"0",r=ii.bigNumber(e).isGreaterThan("0");return X` - - - this.onFocusChange(!0)} - @focusout=${()=>this.onFocusChange(!1)} - ?disabled=${this.disabled} - .value=${this.value} - @input=${this.dispatchInputChangeEvent} - @keydown=${this.handleKeydown} - placeholder="0" - type="text" - inputmode="decimal" - /> - - ${r?`$${Tr.formatNumberToLocalString(this.marketValue,3)}`:null} - - - ${this.templateTokenSelectButton()} - - `}handleKeydown(e){return qut.numericInputKeyDown(e,this.value,r=>{var n;return(n=this.onSetAmount)==null?void 0:n.call(this,this.target,r)})}dispatchInputChangeEvent(e){if(!this.onSetAmount)return;const r=e.target.value.replace(/[^0-9.]/gu,"");r===","||r==="."?this.onSetAmount(this.target,"0."):r.endsWith(",")?this.onSetAmount(this.target,r.replace(",",".")):this.onSetAmount(this.target,r)}setMaxValueToInput(){var e;(e=this.onSetMaxValue)==null||e.call(this,this.target,this.balance)}templateTokenSelectButton(){return this.token?X` - - - - ${this.tokenBalanceTemplate()} - - `:X` - Select token - `}tokenBalanceTemplate(){const e=ii.multiply(this.balance,this.price),r=e?e==null?void 0:e.isGreaterThan(Y8t):!1;return X` - ${r?X` - ${Tr.formatNumberToLocalString(this.balance,3)} - `:null} - ${this.target==="sourceToken"?this.tokenActionButtonTemplate(r):null} - `}tokenActionButtonTemplate(e){return e?X` `:X` `}onFocusChange(e){this.focused=e}onSelectToken(){Vt.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),Ye.push("SwapSelectToken",{target:this.target})}onBuyToken(){Ye.push("OnRampProviders")}};xu.styles=[q8t];kh([ce()],xu.prototype,"focused",void 0);kh([ce()],xu.prototype,"balance",void 0);kh([ce()],xu.prototype,"value",void 0);kh([ce()],xu.prototype,"price",void 0);kh([ce()],xu.prototype,"marketValue",void 0);kh([ce()],xu.prototype,"disabled",void 0);kh([ce()],xu.prototype,"target",void 0);kh([ce()],xu.prototype,"token",void 0);kh([ce()],xu.prototype,"onSetAmount",void 0);kh([ce()],xu.prototype,"onSetMaxValue",void 0);xu=kh([Fe("w3m-swap-input")],xu);const K8t=Je` - :host { - width: 100%; - } - - :host > wui-flex { - display: flex; - flex-direction: row; - justify-content: space-between; - align-items: center; - border-radius: var(--wui-border-radius-s); - padding: var(--wui-spacing-xl); - padding-right: var(--wui-spacing-s); - background-color: var(--wui-color-gray-glass-002); - box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002); - width: 100%; - height: 100px; - box-sizing: border-box; - position: relative; - } - - wui-shimmer.market-value { - opacity: 0; - } - - :host > wui-flex > svg.input_mask { - position: absolute; - inset: 0; - z-index: 5; - } - - :host wui-flex .input_mask__border, - :host wui-flex .input_mask__background { - transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1); - will-change: fill; - } - - :host wui-flex .input_mask__border { - fill: var(--wui-color-gray-glass-020); - } - - :host wui-flex .input_mask__background { - fill: var(--wui-color-gray-glass-002); - } -`;var N6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let SN=class extends He{constructor(){super(...arguments),this.target="sourceToken"}render(){return X` - - - - - ${this.templateTokenSelectButton()} - - `}templateTokenSelectButton(){return X` - - - - `}};SN.styles=[K8t];N6e([ce()],SN.prototype,"target",void 0);SN=N6e([Fe("w3m-swap-input-skeleton")],SN);const Z8t=Je` - :host { - height: 64px; - } - - wui-text { - text-transform: capitalize; - } - - wui-flex.w3m-header-title { - transform: translateY(0); - opacity: 1; - } - - wui-flex.w3m-header-title[view-direction='prev'] { - animation: - slide-down-out 120ms forwards var(--wui-ease-out-power-2), - slide-down-in 120ms forwards var(--wui-ease-out-power-2); - animation-delay: 0ms, 200ms; - } - - wui-flex.w3m-header-title[view-direction='next'] { - animation: - slide-up-out 120ms forwards var(--wui-ease-out-power-2), - slide-up-in 120ms forwards var(--wui-ease-out-power-2); - animation-delay: 0ms, 200ms; - } - - wui-icon-link[data-hidden='true'] { - opacity: 0 !important; - pointer-events: none; - } - - @keyframes slide-up-out { - from { - transform: translateY(0px); - opacity: 1; - } - to { - transform: translateY(3px); - opacity: 0; - } - } - - @keyframes slide-up-in { - from { - transform: translateY(-3px); - opacity: 0; - } - to { - transform: translateY(0); - opacity: 1; - } - } - - @keyframes slide-down-out { - from { - transform: translateY(0px); - opacity: 1; - } - to { - transform: translateY(-3px); - opacity: 0; - } - } - - @keyframes slide-down-in { - from { - transform: translateY(3px); - opacity: 0; - } - to { - transform: translateY(0); - opacity: 1; - } - } -`;var T0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const Q8t=["Swap","SwapSelectToken","SwapPreview"];function Iz(){var o,s,l,c,u,f,d;const t=(s=(o=Ye.state.data)==null?void 0:o.connector)==null?void 0:s.name,e=(c=(l=Ye.state.data)==null?void 0:l.wallet)==null?void 0:c.name,r=(f=(u=Ye.state.data)==null?void 0:u.network)==null?void 0:f.name,n=e??t,i=rr.getConnectors();return{Connect:`Connect ${i.length===1&&((d=i[0])==null?void 0:d.id)==="w3m-email"?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:n??"Connect Wallet",ConnectingWalletConnect:n??"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:n?`Get ${n}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SelectAddresses:"Select accounts",SwitchNetwork:r??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:Ze.state.socialProvider?Ze.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain"}}let Yf=class extends He{constructor(){super(),this.unsubscribe=[],this.heading=Iz()[Ye.state.view],this.network=Pe.state.activeCaipNetwork,this.buffering=!1,this.showBack=!1,this.isSiweEnabled=At.state.isSiweEnabled,this.prevHistoryLength=1,this.view=Ye.state.view,this.viewDirection="",this.headerText=Iz()[Ye.state.view],this.unsubscribe.push(Ye.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=Iz()[e]},Tg.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),Dr.subscribeKey("buffering",e=>this.buffering=e),Pe.subscribeKey("activeCaipNetwork",e=>this.network=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` - - ${this.dynamicButtonTemplate()} ${this.titleTemplate()} ${this.closeButtonTemplate()} - - `}onWalletHelp(){Vt.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Ye.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Bf(async()=>{const{SIWEController:i}=await import("./index-Cdw1Pm6b.js");return{SIWEController:i}},[],import.meta.url),r=Ye.state.view==="ApproveTransaction";e.state.status!=="success"&&r?Ye.popTransactionStack(!0):jr.close()}else jr.close()}closeButtonTemplate(){const e=Ye.state.view==="ConnectingSiwe";return this.isSiweEnabled&&e?X`
`:X` - - `}titleTemplate(){const e=Q8t.includes(this.view);return X` - - ${this.headerText} - ${e?X`Beta`:null} - - `}dynamicButtonTemplate(){var l;const{view:e}=Ye.state,r=e==="Connect",n=e==="ApproveTransaction",i=e==="UpgradeToSmartAccount",a=e==="ConnectingSiwe",o=e==="Account",s=n||i||a;return o?X``:this.showBack&&!s?X``:X``}onNetworks(){this.isAllowedNetworkSwitch()&&(Vt.sendEvent({type:"track",event:"CLICK_NETWORKS"}),Ye.push("Networks"))}isAllowedNetworkSwitch(){const e=Jr.getRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var a;return i===((a=this.network)==null?void 0:a.id)});return r||!n}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:e}=Ye.state;let r=Tg.VIEW_DIRECTION.Next;e.length1&&!this.showBack&&r?(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){Ye.goBack()}};Yf.styles=Z8t;T0([xe()],Yf.prototype,"heading",void 0);T0([xe()],Yf.prototype,"network",void 0);T0([xe()],Yf.prototype,"buffering",void 0);T0([xe()],Yf.prototype,"showBack",void 0);T0([xe()],Yf.prototype,"isSiweEnabled",void 0);T0([xe()],Yf.prototype,"prevHistoryLength",void 0);T0([xe()],Yf.prototype,"view",void 0);T0([xe()],Yf.prototype,"viewDirection",void 0);T0([xe()],Yf.prototype,"headerText",void 0);Yf=T0([Fe("w3m-header")],Yf);var O6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let gY=class extends He{constructor(){super(...arguments),this.data=[]}render(){return X` - - ${this.data.map(e=>X` - - - ${e.images.map(r=>X``)} - - - - - ${e.title} - - ${e.text} - - `)} - - `}};O6e([ce({type:Array})],gY.prototype,"data",void 0);gY=O6e([Fe("w3m-help-widget")],gY);const X8t=Je` - :host { - width: 100%; - } - - :host > wui-flex { - width: 100%; - padding: var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xs); - width: 100%; - display: flex; - align-items: center; - justify-content: flex-start; - gap: var(--wui-spacing-s); - } - - :host > wui-flex:hover { - background-color: var(--wui-color-gray-glass-002); - } - - .purchase-image-container { - display: flex; - justify-content: center; - align-items: center; - position: relative; - width: var(--wui-icon-box-size-lg); - height: var(--wui-icon-box-size-lg); - } - - .purchase-image-container wui-image { - width: 100%; - height: 100%; - position: relative; - border-radius: calc(var(--wui-icon-box-size-lg) / 2); - } - - .purchase-image-container wui-image::after { - content: ''; - display: block; - width: 100%; - height: 100%; - position: absolute; - inset: 0; - border-radius: calc(var(--wui-icon-box-size-lg) / 2); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - .purchase-image-container wui-icon-box { - position: absolute; - right: 0; - bottom: 0; - transform: translate(20%, 20%); - } -`;var Nu=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Yl=class extends He{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return X` - - ${this.imageTemplate()} - - - ${this.statusIconTemplate()} - ${this.label} - - - + ${this.purchaseValue} ${this.purchaseCurrency} - - - ${this.inProgress?X``:X`${this.date}`} - - `}async fetchTokenImage(){await xr._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return X``}imageTemplate(){const e=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return X` - - `}boughtIconTemplate(){return X``}};Yl.styles=[X8t];Nu([ce({type:Boolean})],Yl.prototype,"disabled",void 0);Nu([ce()],Yl.prototype,"color",void 0);Nu([ce()],Yl.prototype,"label",void 0);Nu([ce()],Yl.prototype,"purchaseValue",void 0);Nu([ce()],Yl.prototype,"purchaseCurrency",void 0);Nu([ce()],Yl.prototype,"date",void 0);Nu([ce({type:Boolean})],Yl.prototype,"completed",void 0);Nu([ce({type:Boolean})],Yl.prototype,"inProgress",void 0);Nu([ce({type:Boolean})],Yl.prototype,"failed",void 0);Nu([ce()],Yl.prototype,"onClick",void 0);Nu([ce()],Yl.prototype,"symbol",void 0);Nu([ce()],Yl.prototype,"icon",void 0);Yl=Nu([Fe("w3m-onramp-activity-item")],Yl);const J8t=Je` - :host { - width: 100%; - } - - wui-loading-spinner { - position: absolute; - top: 50%; - right: 20px; - transform: translateY(-50%); - } - - .currency-container { - position: absolute; - top: 50%; - transform: translateY(-50%); - right: var(--wui-spacing-1xs); - height: 40px; - padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs) - var(--wui-spacing-xs); - min-width: 95px; - border-radius: var(--FULL, 1000px); - border: 1px solid var(--wui-color-gray-glass-002); - background: var(--wui-color-gray-glass-002); - cursor: pointer; - } - - .currency-container > wui-image { - height: 24px; - width: 24px; - border-radius: 50%; - } -`;var nx=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let av=class extends He{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=Ua.state.currencyImages,this.tokenImages=Ua.state.tokenImages,this.unsubscribe.push(wi.subscribeKey("purchaseCurrency",r=>{!r||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(r))}),wi.subscribeKey("paymentCurrency",r=>{!r||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(r))}),wi.subscribe(r=>{this.type==="Fiat"?this.currencies=r.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=r.paymentCurrencies.map(this.formatPaymentCurrency)}),Ua.subscribe(r=>{this.currencyImages={...r.currencyImages},this.tokenImages={...r.tokenImages}}))}firstUpdated(){wi.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var n;const e=((n=this.selectedCurrency)==null?void 0:n.symbol)||"",r=this.currencyImages[e]||this.tokenImages[e];return X` - ${this.selectedCurrency?X` jr.open({view:`OnRamp${this.type}Select`})} - > - - ${this.selectedCurrency.symbol} - `:X``} - `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};av.styles=J8t;nx([ce({type:String})],av.prototype,"type",void 0);nx([ce({type:Number})],av.prototype,"value",void 0);nx([xe()],av.prototype,"currencies",void 0);nx([xe()],av.prototype,"selectedCurrency",void 0);nx([xe()],av.prototype,"currencyImages",void 0);nx([xe()],av.prototype,"tokenImages",void 0);av=nx([Fe("w3m-onramp-input")],av);const e9t=Je` - button { - padding: var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xs); - border: none; - outline: none; - background-color: var(--wui-color-gray-glass-002); - width: 100%; - display: flex; - align-items: center; - justify-content: flex-start; - gap: var(--wui-spacing-s); - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: background-color; - } - - button:hover { - background-color: var(--wui-color-gray-glass-005); - } - - .provider-image { - width: var(--wui-spacing-3xl); - min-width: var(--wui-spacing-3xl); - height: var(--wui-spacing-3xl); - border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); - position: relative; - overflow: hidden; - } - - .provider-image::after { - content: ''; - display: block; - width: 100%; - height: 100%; - position: absolute; - inset: 0; - border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); - } - - .network-icon { - width: var(--wui-spacing-m); - height: var(--wui-spacing-m); - border-radius: calc(var(--wui-spacing-m) / 2); - overflow: hidden; - box-shadow: - 0 0 0 3px var(--wui-color-gray-glass-002), - 0 0 0 3px var(--wui-color-modal-bg); - transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: box-shadow; - } - - button:hover .network-icon { - box-shadow: - 0 0 0 3px var(--wui-color-gray-glass-005), - 0 0 0 3px var(--wui-color-modal-bg); - } -`;var vy=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let l0=class extends He{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return X` - - `}networksTemplate(){var n;const e=Jr.getRequestedCaipNetworks(),r=(n=e==null?void 0:e.filter(i=>i==null?void 0:i.imageId))==null?void 0:n.slice(0,5);return X` - - ${r==null?void 0:r.map(i=>X` - - - - `)} - - `}};l0.styles=[e9t];vy([ce({type:Boolean})],l0.prototype,"disabled",void 0);vy([ce()],l0.prototype,"color",void 0);vy([ce()],l0.prototype,"name",void 0);vy([ce()],l0.prototype,"label",void 0);vy([ce()],l0.prototype,"feeRange",void 0);vy([ce({type:Boolean})],l0.prototype,"loading",void 0);vy([ce()],l0.prototype,"onClick",void 0);l0=vy([Fe("w3m-onramp-provider-item")],l0);const t9t=Je` - wui-flex { - background-color: var(--wui-color-gray-glass-005); - } - - a { - text-decoration: none; - color: var(--wui-color-fg-175); - font-weight: 500; - } -`;var r9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let vY=class extends He{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=At.state;return!e&&!r?null:X` - - - By connecting your wallet, you agree to our
- ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} -
-
- `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=At.state;return e&&r?"and":""}termsTemplate(){const{termsConditionsUrl:e}=At.state;return e?X`Terms of Service`:null}privacyTemplate(){const{privacyPolicyUrl:e}=At.state;return e?X`Privacy Policy`:null}};vY.styles=[t9t];vY=r9t([Fe("w3m-legal-footer")],vY);const n9t=Je` - :host { - display: block; - padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); - } -`;var L6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let CN=class extends He{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:r,play_store:n,chrome_store:i,homepage:a}=this.wallet,o=gt.isMobile(),s=gt.isIos(),l=gt.isAndroid(),c=[r,n,a,i].filter(Boolean).length>1,u=Tr.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return c&&!o?X` - Ye.push("Downloads",{wallet:this.wallet})} - > - `:!c&&a?X` - - `:r&&s?X` - - `:n&&l?X` - - `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&>.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&>.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&>.openHref(this.wallet.homepage,"_blank")}};CN.styles=[n9t];L6e([ce({type:Object})],CN.prototype,"wallet",void 0);CN=L6e([Fe("w3m-mobile-download-links")],CN);const i9t=Je` - wui-flex { - border-top: 1px solid var(--wui-color-gray-glass-005); - } - - a { - text-decoration: none; - color: var(--wui-color-fg-175); - font-weight: 500; - display: flex; - align-items: center; - justify-content: center; - gap: var(--wui-spacing-3xs); - } -`;var a9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let mY=class extends He{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=At.state;return!e&&!r?null:X` - - - We work with the best providers to give you the lowest fees and best support. More options - coming soon! - - - ${this.howDoesItWorkTemplate()} - - `}howDoesItWorkTemplate(){return X` - - How does it work? - `}onWhatIsBuy(){Vt.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ye.push("WhatIsABuy")}};mY.styles=[i9t];mY=a9t([Fe("w3m-onramp-providers-footer")],mY);const o9t=Je` - :host { - display: block; - position: absolute; - opacity: 0; - pointer-events: none; - top: 11px; - left: 50%; - width: max-content; - } -`;var $6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const s9t={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let AN=class extends He{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=vr.state.open,this.unsubscribe.push(vr.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:r}=vr.state,n=s9t[r];return X` - - `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout=setTimeout(()=>vr.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};AN.styles=o9t;$6e([xe()],AN.prototype,"open",void 0);AN=$6e([Fe("w3m-snackbar")],AN);const l9t=Je` - :host { - display: block; - position: absolute; - top: var(--wui-spacing-s); - left: var(--wui-spacing-l); - right: var(--wui-spacing-l); - opacity: 0; - pointer-events: none; - } -`;var B6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const c9t={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"exclamationTriangle"}};let TN=class extends He{constructor(){super(),this.unsubscribe=[],this.open=cb.state.open,this.onOpen(!0),this.unsubscribe.push(cb.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:r}=cb.state,n=c9t[r];return X` - - `}onOpen(e){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):e||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};TN.styles=l9t;B6e([xe()],TN.prototype,"open",void 0);TN=B6e([Fe("w3m-alertbar")],TN);const u9t=Je` - wui-separator { - margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); - width: calc(100% + var(--wui-spacing-s) * 2); - } - - wui-email-input { - width: 100%; - } - - form { - width: 100%; - display: block; - position: relative; - } - - wui-icon-link, - wui-loading-spinner { - position: absolute; - top: 50%; - transform: translateY(-50%); - } - - wui-icon-link { - right: var(--wui-spacing-xs); - } - - wui-loading-spinner { - right: var(--wui-spacing-m); - } -`;var ix=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let ov=class extends He{constructor(){super(),this.unsubscribe=[],this.formRef=D1(),this.connectors=rr.state.connectors,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.email="",this.loading=!1,this.error="",this.walletGuide="get-started",this.unsubscribe.push(rr.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=e.find(r=>r.type==="AUTH")}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",r=>{r.key==="Enter"&&this.onSubmitEmail(r)})}render(){var r;const e=(r=At.state.features)==null?void 0:r.email;return!this.authConnector||!e?null:X` -
- - - - ${this.submitButtonTemplate()}${this.loadingTemplate()} - -
- ${this.separatorTemplate()} - `}submitButtonTemplate(){return!this.loading&&this.email.length>3?X` - - - `:null}separatorTemplate(){var o,s;const e=(o=At.state.features)==null?void 0:o.socials,r=this.connectors.length>1,n=At.state.enableWallets,i=(s=At.state.features)==null?void 0:s.emailShowWallets;return(e&&e.length||i||!r||!n)&&this.walletGuide==="get-started"||e&&e.length>0?null:X` - - - - `}loadingTemplate(){return this.loading?X``:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){if(![ya.CHAIN.EVM,ya.CHAIN.SOLANA].find(i=>i===Pe.state.activeChain)){Ye.push("SwitchActiveChain",{switchToChain:ya.CHAIN.EVM});return}try{if(this.loading)return;this.loading=!0,e.preventDefault();const i=rr.getAuthConnector();if(!i)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:a}=await i.provider.connectEmail({email:this.email});Vt.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),a==="VERIFY_OTP"?(Vt.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),Ye.push("EmailVerifyOtp",{email:this.email})):a==="VERIFY_DEVICE"&&Ye.push("EmailVerifyDevice",{email:this.email})}catch(i){const a=gt.parseError(i);a!=null&&a.includes("Invalid email")?this.error="Invalid email. Try again.":vr.showError(i)}finally{this.loading=!1}}onFocusEvent(){Vt.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};ov.styles=u9t;ix([xe()],ov.prototype,"connectors",void 0);ix([xe()],ov.prototype,"authConnector",void 0);ix([xe()],ov.prototype,"email",void 0);ix([xe()],ov.prototype,"loading",void 0);ix([xe()],ov.prototype,"error",void 0);ix([ce()],ov.prototype,"walletGuide",void 0);ov=ix([Fe("w3m-email-login-widget")],ov);const f9t=Je` - wui-flex { - width: 100%; - } - - :host > wui-flex:first-child { - transform: translateY(calc(var(--wui-spacing-xxs) * -1)); - } - - wui-icon-link { - margin-right: calc(var(--wui-icon-box-size-md) * -1); - } - - wui-notice-card { - margin-bottom: var(--wui-spacing-3xs); - } - - wui-list-item > wui-text { - flex: 1; - } - - w3m-transactions-view { - max-height: 200px; - } - - .tab-content-container { - height: 300px; - overflow-y: auto; - overflow-x: hidden; - scrollbar-width: none; - } - - .tab-content-container::-webkit-scrollbar { - display: none; - } - - .account-button { - width: auto; - border: none; - display: flex; - align-items: center; - justify-content: center; - gap: var(--wui-spacing-s); - height: 48px; - padding: var(--wui-spacing-xs); - padding-right: var(--wui-spacing-s); - box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002); - background-color: var(--wui-color-gray-glass-002); - border-radius: 24px; - transition: background-color 0.2s linear; - } - - .account-button:hover { - background-color: var(--wui-color-gray-glass-005); - } - - .avatar-container { - position: relative; - } - - wui-avatar.avatar { - width: 32px; - height: 32px; - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - } - - wui-avatar.network-avatar { - width: 16px; - height: 16px; - position: absolute; - left: 100%; - top: 100%; - transform: translate(-75%, -75%); - box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005); - } - - .account-links { - display: flex; - justify-content: space-between; - align-items: center; - } - - .account-links wui-flex { - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - flex: 1; - background: red; - align-items: center; - justify-content: center; - height: 48px; - padding: 10px; - flex: 1 0 0; - border-radius: var(--XS, 16px); - border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); - background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); - transition: - background-color var(--wui-ease-out-power-1) var(--wui-duration-md), - opacity var(--wui-ease-out-power-1) var(--wui-duration-md); - will-change: background-color, opacity; - } - - .account-links wui-flex:hover { - background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); - } - - .account-links wui-flex wui-icon { - width: var(--S, 20px); - height: var(--S, 20px); - } - - .account-links wui-flex wui-icon svg path { - stroke: #667dff; - } -`;var E0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Kf=class extends He{constructor(){super(),this.unsubscribe=[],this.caipAddress=Ze.state.caipAddress,this.address=gt.getPlainAddress(Ze.state.caipAddress),this.allAccounts=Ze.state.allAccounts,this.profileImage=Ze.state.profileImage,this.profileName=Ze.state.profileName,this.disconnecting=!1,this.balance=Ze.state.balance,this.balanceSymbol=Ze.state.balanceSymbol,this.features=At.state.features,this.unsubscribe.push(Ze.subscribeKey("caipAddress",e=>{this.address=gt.getPlainAddress(e),this.caipAddress=e}),Ze.subscribeKey("balance",e=>this.balance=e),Ze.subscribeKey("balanceSymbol",e=>this.balanceSymbol=e),Ze.subscribeKey("profileName",e=>this.profileName=e),Ze.subscribeKey("profileImage",e=>this.profileImage=e),At.subscribeKey("features",e=>this.features=e),Ze.subscribeKey("allAccounts",e=>{this.allAccounts=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress)throw new Error("w3m-account-view: No account provided");const e=Pe.state.activeChain===ya.CHAIN.EVM&&this.allAccounts.length>1;return X` - ${e?this.multiAccountTemplate():this.singleAccountTemplate()} - - - ${gt.formatBalance(this.balance,this.balanceSymbol)} - - - ${this.explorerBtnTemplate()} - - - - ${this.authCardTemplate()} - ${this.onrampTemplate()} ${this.swapsTemplate()} ${this.activityTemplate()} - - Disconnect - - `}onrampTemplate(){var r;return((r=this.features)==null?void 0:r.onramp)?X` - - Buy crypto - - `:null}activityTemplate(){const e=Pe.state.activeChain===ya.CHAIN.SOLANA;return X` - Activity - ${e?X`Coming soon`:""} - `}swapsTemplate(){var n;const e=(n=this.features)==null?void 0:n.swaps,r=Pe.state.activeChain===ya.CHAIN.SOLANA;return!e||r?null:X` - - Swap - - `}authCardTemplate(){const e=jn.getConnectedConnector(),r=rr.getAuthConnector(),{origin:n}=location;return!r||e!=="AUTH"||n.includes(Da.SECURE_SITE)?null:X` - - `}handleSwitchAccountsView(){Ye.push("SwitchAddress")}handleClickPay(){Ye.push("OnRampProviders")}handleClickSwap(){Ye.push("Swap")}explorerBtnTemplate(){return Ze.state.addressExplorerUrl?X` - - - Block Explorer - - - `:null}singleAccountTemplate(){return X` - - - - - ${this.profileName?Tr.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Tr.getTruncateString({string:this.address||"",charsStart:4,charsEnd:4,truncate:"middle"})} - - - `}multiAccountTemplate(){if(!this.address)throw new Error("w3m-account-view: No account provided");const e=this.allAccounts.find(n=>n.address===this.address),r=Ze.state.addressLabels.get(this.address);return X` - - `}onCopyAddress(){try{this.address&&(gt.copyToClopboard(this.address),vr.showSuccess("Address copied"))}catch{vr.showError("Failed to copy")}}onTransactions(){Vt.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ye.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await Dr.disconnect(),Vt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),jr.close()}catch{Vt.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),vr.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const e=Ze.state.addressExplorerUrl;e&>.openHref(e,"_blank")}onGoToUpgradeView(){Vt.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),Ye.push("UpgradeEmailWallet")}};Kf.styles=f9t;E0([xe()],Kf.prototype,"caipAddress",void 0);E0([xe()],Kf.prototype,"address",void 0);E0([xe()],Kf.prototype,"allAccounts",void 0);E0([xe()],Kf.prototype,"profileImage",void 0);E0([xe()],Kf.prototype,"profileName",void 0);E0([xe()],Kf.prototype,"disconnecting",void 0);E0([xe()],Kf.prototype,"balance",void 0);E0([xe()],Kf.prototype,"balanceSymbol",void 0);E0([xe()],Kf.prototype,"features",void 0);Kf=E0([Fe("w3m-account-default-widget")],Kf);const d9t=Je` - wui-flex { - width: 100%; - } - - wui-promo { - position: absolute; - top: -32px; - } - - wui-profile-button { - margin-top: calc(-1 * var(--wui-spacing-2l)); - } - - wui-promo + wui-profile-button { - margin-top: var(--wui-spacing-2l); - } - - wui-tabs { - width: 100%; - } - - .contentContainer { - height: 280px; - } - - .contentContainer > wui-icon-box { - width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-xxs); - } - - .contentContainer > .textContent { - width: 65%; - } -`;var Ph=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const h9t=3,p9t=48,g9t=430;let _u=class extends He{constructor(){super(),this.unsubscribe=[],this.address=Ze.state.address,this.profileImage=Ze.state.profileImage,this.profileName=Ze.state.profileName,this.smartAccountDeployed=Ze.state.smartAccountDeployed,this.network=Pe.state.activeCaipNetwork,this.currentTab=Ze.state.currentTab,this.tokenBalance=Ze.state.tokenBalance,this.preferredAccountType=Ze.state.preferredAccountType,this.features=At.state.features,this.unsubscribe.push(Ze.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance,this.smartAccountDeployed=e.smartAccountDeployed,this.preferredAccountType=e.preferredAccountType):jr.close()}),Pe.subscribeKey("activeCaipNetwork",e=>this.network=e),At.subscribeKey("features",e=>this.features=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){Ze.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");const e=Jn.getNetworkImage(this.network);return X` - ${this.network&&X``} - ${this.activateAccountTemplate()} - - ${this.tokenBalanceTemplate()} - - - - - ${this.swapsTemplate()} - - - - - - - - - - - ${this.listContentTemplate()} - `}swapsTemplate(){var r;return((r=this.features)==null?void 0:r.swaps)?X` - - - - - `:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>Ze.fetchTokenBalance(),1e4)}listContentTemplate(){return this.currentTab===0?X``:this.currentTab===1?X``:this.currentTab===2?X``:X``}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const r=gt.calculateBalance(this.tokenBalance),{dollars:n="0",pennies:i="00"}=gt.formatTokenBalance(r);return X``}return X``}activateAccountTemplate(){return!Jr.checkIfSmartAccountEnabled()||this.preferredAccountType!==xn.ACCOUNT_TYPES.EOA||this.smartAccountDeployed?null:X` `}onTabChange(e){Ze.setCurrentTab(e)}onProfileButtonClick(){Ye.push("Profile")}onBuyClick(){Ye.push("OnRampProviders")}onSwapClick(){var e,r,n;(e=this.network)!=null&&e.id&&!Da.SWAP_SUPPORTED_NETWORKS.includes((r=this.network)==null?void 0:r.id)?Ye.push("UnsupportedChain",{swapUnsupportedChain:!0}):(Vt.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((n=this.network)==null?void 0:n.id)||"",isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ye.push("Swap"))}onReceiveClick(){Ye.push("WalletReceive")}onSendClick(){var e;Vt.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((e=this.network)==null?void 0:e.id)||"",isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ye.push("WalletSend")}onUpdateToSmartAccount(){Ye.push("UpgradeToSmartAccount")}};_u.styles=d9t;Ph([xe()],_u.prototype,"watchTokenBalance",void 0);Ph([xe()],_u.prototype,"address",void 0);Ph([xe()],_u.prototype,"profileImage",void 0);Ph([xe()],_u.prototype,"profileName",void 0);Ph([xe()],_u.prototype,"smartAccountDeployed",void 0);Ph([xe()],_u.prototype,"network",void 0);Ph([xe()],_u.prototype,"currentTab",void 0);Ph([xe()],_u.prototype,"tokenBalance",void 0);Ph([xe()],_u.prototype,"preferredAccountType",void 0);Ph([xe()],_u.prototype,"features",void 0);_u=Ph([Fe("w3m-account-wallet-features-widget")],_u);const v9t=Je` - :host { - width: 100%; - max-height: 280px; - overflow: scroll; - scrollbar-width: none; - } - - :host::-webkit-scrollbar { - display: none; - } -`;var m9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let yY=class extends He{render(){return X``}};yY.styles=v9t;yY=m9t([Fe("w3m-account-activity-widget")],yY);const y9t=Je` - .contentContainer { - height: 280px; - } - - .contentContainer > wui-icon-box { - width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-xxs); - } - - .contentContainer > .textContent { - width: 65%; - } -`;var w9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let wY=class extends He{render(){return X`${this.nftTemplate()}`}nftTemplate(){return X` - - - Coming soon - Stay tuned for our upcoming NFT feature - - Receive funds - `}onReceiveClick(){Ye.push("WalletReceive")}};wY.styles=y9t;wY=w9t([Fe("w3m-account-nfts-widget")],wY);const b9t=Je` - :host { - width: 100%; - } - - wui-flex { - width: 100%; - } - - .contentContainer { - max-height: 280px; - overflow: scroll; - scrollbar-width: none; - } - - .contentContainer::-webkit-scrollbar { - display: none; - } -`;var F6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let EN=class extends He{constructor(){super(),this.unsubscribe=[],this.tokenBalance=Ze.state.tokenBalance,this.unsubscribe.push(Ze.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?X` - ${this.tokenItemTemplate()} - `:X` `}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(r=>X``)}onReceiveClick(){Ye.push("WalletReceive")}onBuyClick(){Vt.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ye.push("OnRampProviders")}};EN.styles=b9t;F6e([xe()],EN.prototype,"tokenBalance",void 0);EN=F6e([Fe("w3m-account-tokens-widget")],EN);const x9t=Je` - :host { - min-height: 100%; - } - - .group-container[last-group='true'] { - padding-bottom: var(--wui-spacing-m); - } - - .contentContainer { - height: 280px; - } - - .contentContainer > wui-icon-box { - width: 40px; - height: 40px; - border-radius: var(--wui-border-radius-xxs); - } - - .contentContainer > .textContent { - width: 65%; - } - - .emptyContainer { - height: 100%; - } -`;var ax=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const w7="last-transaction",_9t=7;let sv=class extends He{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=Pe.state.activeCaipAddress,this.transactionsByYear=Do.state.transactionsByYear,this.loading=Do.state.loading,this.empty=Do.state.empty,this.next=Do.state.next,Do.clearCursor(),this.unsubscribe.push(Pe.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(Do.resetTransactions(),Do.fetchTransactions(e)),this.caipAddress=e}),Pe.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),Do.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return X` ${this.empty?null:this.templateTransactionsByYear()} - ${this.loading?this.templateLoading():null} - ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){var n;const e=(n=Pe.state.activeCaipNetwork)==null?void 0:n.id;Do.state.lastNetworkInView!==e&&(Do.resetTransactions(),this.caipAddress&&Do.fetchTransactions(gt.getPlainAddress(this.caipAddress))),Do.setLastNetworkInView(e)}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(r=>{const n=parseInt(r,10),i=new Array(12).fill(null).map((a,o)=>{var c;const s=Gw.getTransactionGroupTitle(n,o),l=(c=this.transactionsByYear[n])==null?void 0:c[o];return{groupTitle:s,transactions:l}}).filter(({transactions:a})=>a).reverse();return i.map(({groupTitle:a,transactions:o},s)=>{const l=s===i.length-1;return o?X` - - - ${a} - - - ${this.templateTransactions(o,l)} - - - `:null})})}templateRenderTransaction(e,r){const{date:n,descriptions:i,direction:a,isAllNFT:o,images:s,status:l,transfers:c,type:u}=this.getTransactionListItemProps(e),f=(c==null?void 0:c.length)>1;return(c==null?void 0:c.length)===2&&!o?X` - - `:f?c.map((h,p)=>{const g=Gw.getTransferDescription(h),v=r&&p===c.length-1;return X` `}):X` - - `}templateTransactions(e,r){return e.map((n,i)=>{const a=r&&i===e.length-1;return X`${this.templateRenderTransaction(n,a)}`})}emptyStateActivity(){return X` - - - No Transactions yet - Start trading on dApps
- to grow your wallet!
-
-
`}emptyStateAccount(){return X` - - - No activity yet - Your next transactions will appear here - - Trade - `}templateEmpty(){return this.page==="account"?X`${this.emptyStateAccount()}`:X`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(_9t).fill(X` `).map(e=>e):null}onReceiveClick(){Ye.push("WalletReceive")}createPaginationObserver(){const{projectId:e}=At.state;this.paginationObserver=new IntersectionObserver(([r])=>{r!=null&&r.isIntersecting&&!this.loading&&(Do.fetchTransactions(gt.getPlainAddress(this.caipAddress)),Vt.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:gt.getPlainAddress(this.caipAddress),projectId:e,cursor:this.next,isSmartAccount:Ze.state.preferredAccountType===xn.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var r,n,i;(r=this.paginationObserver)==null||r.disconnect();const e=(n=this.shadowRoot)==null?void 0:n.querySelector(`#${w7}`);e&&((i=this.paginationObserver)==null||i.observe(e))}getTransactionListItemProps(e){var l,c,u,f,d;const r=KX.formatDate((l=e==null?void 0:e.metadata)==null?void 0:l.minedAt),n=Gw.getTransactionDescriptions(e),i=e==null?void 0:e.transfers,a=(c=e==null?void 0:e.transfers)==null?void 0:c[0],o=!!a&&((u=e==null?void 0:e.transfers)==null?void 0:u.every(h=>!!h.nft_info)),s=Gw.getTransactionImages(i);return{date:r,direction:a==null?void 0:a.direction,descriptions:n,isAllNFT:o,images:s,status:(f=e.metadata)==null?void 0:f.status,transfers:i,type:(d=e.metadata)==null?void 0:d.operationType}}};sv.styles=x9t;ax([ce()],sv.prototype,"page",void 0);ax([xe()],sv.prototype,"caipAddress",void 0);ax([xe()],sv.prototype,"transactionsByYear",void 0);ax([xe()],sv.prototype,"loading",void 0);ax([xe()],sv.prototype,"empty",void 0);ax([xe()],sv.prototype,"next",void 0);sv=ax([Fe("w3m-activity-list")],sv);const S9t=Je` - :host { - width: 100%; - height: 100px; - border-radius: var(--wui-border-radius-s); - border: 1px solid var(--wui-color-gray-glass-002); - background-color: var(--wui-color-gray-glass-002); - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); - will-change: background-color; - } - - :host(:hover) { - background-color: var(--wui-color-gray-glass-005); - } - - wui-flex { - width: 100%; - height: fit-content; - } - - wui-button { - width: 100%; - display: flex; - justify-content: flex-end; - } - - wui-input-amount { - mask-image: linear-gradient( - 270deg, - transparent 0px, - transparent 8px, - black 24px, - black 25px, - black 32px, - black 100% - ); - } - - .totalValue { - width: 100%; - } -`;var j8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let s2=class extends He{render(){return X` - - - ${this.buttonTemplate()} - - - ${this.sendValueTemplate()} - - ${this.maxAmountTemplate()} ${this.actionTemplate()} - - - `}buttonTemplate(){return this.token?X` - `:X`Select token`}handleSelectButtonClick(){Ye.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const r=this.token.price*this.sendTokenAmount;return X`${r?`$${Tr.formatNumberToLocalString(r,2)}`:"Incorrect value"}`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?X` - ${Tr.roundNumber(Number(this.token.quantity.numeric),6,5)} - `:X` - ${Tr.roundNumber(Number(this.token.quantity.numeric),6,5)} - `:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?X`Buy`:X`Max`:null}onInputChange(e){ui.setTokenAmount(e.detail)}onMaxClick(){if(this.token&&typeof this.gasPrice<"u"){const e=this.token.address===void 0||Object.values(Da.NATIVE_TOKEN_ADDRESS).some(i=>{var a;return((a=this.token)==null?void 0:a.address)===i}),r=ii.bigNumber(this.gasPrice).shiftedBy(-this.token.quantity.decimals),n=e?ii.bigNumber(this.token.quantity.numeric).minus(r):ii.bigNumber(this.token.quantity.numeric);ui.setTokenAmount(Number(n.toFixed(20)))}}onBuyClick(){Ye.push("OnRampProviders")}};s2.styles=S9t;j8([ce({type:Object})],s2.prototype,"token",void 0);j8([ce({type:Number})],s2.prototype,"sendTokenAmount",void 0);j8([ce({type:Number})],s2.prototype,"gasPriceInUSD",void 0);j8([ce({type:Number})],s2.prototype,"gasPrice",void 0);s2=j8([Fe("w3m-input-token")],s2);const C9t=Je` - :host { - width: 100%; - height: 100px; - border-radius: var(--wui-border-radius-s); - border: 1px solid var(--wui-color-gray-glass-002); - background-color: var(--wui-color-gray-glass-002); - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); - will-change: background-color; - position: relative; - } - - :host(:hover) { - background-color: var(--wui-color-gray-glass-005); - } - - wui-flex { - width: 100%; - height: fit-content; - } - - wui-button { - display: ruby; - color: var(--wui-color-fg-100); - margin: 0 var(--wui-spacing-xs); - } - - .instruction { - position: absolute; - top: 50%; - transform: translateY(-50%); - z-index: 2; - } - - .paste { - display: inline-flex; - } - - textarea { - background: transparent; - width: 100%; - font-family: var(--w3m-font-family); - font-size: var(--wui-font-size-medium); - font-style: normal; - font-weight: var(--wui-font-weight-light); - line-height: 130%; - letter-spacing: var(--wui-letter-spacing-medium); - color: var(--wui-color-fg-100); - caret-color: var(--wui-color-accent-100); - box-sizing: border-box; - -webkit-appearance: none; - -moz-appearance: textfield; - padding: 0px; - border: none; - outline: none; - appearance: none; - resize: none; - overflow: hidden; - } -`;var E$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let T5=class extends He{constructor(){super(...arguments),this.inputElementRef=D1(),this.instructionElementRef=D1(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=gt.debounce(async e=>{const r=await Dr.getEnsAddress(e);if(ui.setLoading(!1),r){ui.setReceiverProfileName(e),ui.setReceiverAddress(r);const n=await Dr.getEnsAvatar(e);ui.setReceiverProfileImageUrl(n||void 0)}else ui.setReceiverAddress(e),ui.setReceiverProfileName(void 0),ui.setReceiverProfileImageUrl(void 0)})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return X` - - Type or - - - Paste - - address - - - `}async focusInput(){var e;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(e=this.inputElementRef.value)==null||e.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var e;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(e=this.inputElementRef.value)==null||e.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:e?0:1},{opacity:e?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const e=await navigator.clipboard.readText();ui.setReceiverAddress(e),this.focusInput()}onInputChange(e){this.pasting=!1;const r=e.target;r.value&&!this.instructionHidden&&this.focusInput(),ui.setLoading(!0),this.onDebouncedSearch(r.value)}};T5.styles=C9t;E$([ce()],T5.prototype,"value",void 0);E$([xe()],T5.prototype,"instructionHidden",void 0);E$([xe()],T5.prototype,"pasting",void 0);T5=E$([Fe("w3m-input-address")],T5);const A9t=Je` - :host { - display: flex; - width: auto; - flex-direction: column; - gap: var(--wui-border-radius-1xs); - border-radius: var(--wui-border-radius-s); - background: var(--wui-color-gray-glass-002); - padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs) - var(--wui-spacing-1xs); - } - - wui-text { - padding: 0 var(--wui-spacing-1xs); - } - - wui-flex { - margin-top: var(--wui-spacing-1xs); - } - - .network { - cursor: pointer; - transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); - will-change: background-color; - } - - .network:focus-visible { - border: 1px solid var(--wui-color-accent-100); - background-color: var(--wui-color-gray-glass-005); - -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); - } - - .network:hover { - background-color: var(--wui-color-gray-glass-005); - } - - .network:active { - background-color: var(--wui-color-gray-glass-010); - } -`;var I$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let E5=class extends He{render(){return X` Details - - - - - ${this.networkTemplate()} - `}networkTemplate(){var e;return(e=this.caipNetwork)!=null&&e.name?X` this.onNetworkClick(this.caipNetwork)} - class="network" - textTitle="Network" - imageSrc=${Ut(Jn.getNetworkImage(this.caipNetwork))} - >`:null}onNetworkClick(e){e&&Ye.push("Networks",{network:e})}};E5.styles=A9t;I$([ce()],E5.prototype,"receiverAddress",void 0);I$([ce({type:Object})],E5.prototype,"caipNetwork",void 0);I$([ce({type:Number})],E5.prototype,"networkFee",void 0);E5=I$([Fe("w3m-wallet-send-details")],E5);const T9t=Je` - :host { - pointer-events: none; - } - - :host > wui-flex { - display: var(--w3m-tooltip-display); - opacity: var(--w3m-tooltip-opacity); - padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); - border-radius: var(--wui-border-radius-xxs); - color: var(--wui-color-bg-100); - position: fixed; - top: var(--w3m-tooltip-top); - left: var(--w3m-tooltip-left); - transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px)); - max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl)); - transition: opacity 0.2s var(--wui-ease-out-power-2); - will-change: opacity; - } - - :host([data-variant='shade']) > wui-flex { - background-color: var(--wui-color-bg-150); - border: 1px solid var(--wui-color-gray-glass-005); - } - - :host([data-variant='shade']) > wui-flex > wui-text { - color: var(--wui-color-fg-150); - } - - :host([data-variant='fill']) > wui-flex { - background-color: var(--wui-color-fg-100); - border: none; - } - - wui-icon { - position: absolute; - width: 12px !important; - height: 4px !important; - color: var(--wui-color-bg-150); - } - - wui-icon[data-placement='top'] { - bottom: 0px; - left: 50%; - transform: translate(-50%, 95%); - } - - wui-icon[data-placement='bottom'] { - top: 0; - left: 50%; - transform: translate(-50%, -95%) rotate(180deg); - } - - wui-icon[data-placement='right'] { - top: 50%; - left: 0; - transform: translate(-65%, -50%) rotate(90deg); - } - - wui-icon[data-placement='left'] { - top: 50%; - right: 0%; - transform: translate(65%, -50%) rotate(270deg); - } -`;var U8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let l2=class extends He{constructor(){super(),this.unsubscribe=[],this.open=nu.state.open,this.message=nu.state.message,this.triggerRect=nu.state.triggerRect,this.variant=nu.state.variant,this.unsubscribe.push(nu.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,r=this.triggerRect.left;return this.style.cssText=` - --w3m-tooltip-top: ${e}px; - --w3m-tooltip-left: ${r}px; - --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px; - --w3m-tooltip-display: ${this.open?"flex":"none"}; - --w3m-tooltip-opacity: ${this.open?1:0}; - `,X` - - ${this.message} - `}};l2.styles=[T9t];U8([xe()],l2.prototype,"open",void 0);U8([xe()],l2.prototype,"message",void 0);U8([xe()],l2.prototype,"triggerRect",void 0);U8([xe()],l2.prototype,"variant",void 0);l2=U8([Fe("w3m-tooltip")],l2);const E9t=Je` - :host { - width: 100%; - display: block; - } -`;var cee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let jT=class extends He{constructor(){super(),this.unsubscribe=[],this.text="",this.open=nu.state.open,this.unsubscribe.push(Ye.subscribeKey("view",()=>{nu.hide()}),jr.subscribeKey("open",e=>{e||nu.hide()}),nu.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),nu.hide()}render(){return X` -
- ${this.renderChildren()} -
- `}renderChildren(){return X` `}onMouseEnter(){const e=this.getBoundingClientRect();this.open||nu.showTooltip({message:this.text,triggerRect:{width:e.width,height:e.height,left:e.left,top:e.top},variant:"shade"})}onMouseLeave(e){this.contains(e.relatedTarget)||nu.hide()}};jT.styles=[E9t];cee([ce()],jT.prototype,"text",void 0);cee([xe()],jT.prototype,"open",void 0);jT=cee([Fe("w3m-tooltip-trigger")],jT);const I9t=Je` - :host > wui-flex:first-child { - margin-top: var(--wui-spacing-s); - } - wui-separator { - margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m) - calc(var(--wui-spacing-m) * -1); - width: calc(100% + var(--wui-spacing-s) * 2); - } -`;var z8=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};const jde=2,Ude=6;let c2=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.features=At.state.features,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.walletGuide="get-started",this.unsubscribe.push(rr.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),At.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var r;const e=(r=this.features)==null?void 0:r.socials;return!this.authConnector||!e||!(e!=null&&e.length)?null:X` - - ${this.topViewTemplate()}${this.bottomViewTemplate()} - - ${this.separatorTemplate()} - `}topViewTemplate(){var r;const e=(r=this.features)==null?void 0:r.socials;return!this.authConnector||!e||!(e!=null&&e.length)?null:e.length===2?X` - ${e.slice(0,jde).map(n=>X`{this.onSocialClick(n)}} - logo=${n} - >`)} - `:X` {this.onSocialClick(e==null?void 0:e[0])}} - logo=${Ut(e[0])} - align="center" - name=${`Continue with ${e[0]}`} - >`}bottomViewTemplate(){var r;const e=(r=this.features)==null?void 0:r.socials;return!this.authConnector||!e||!(e!=null&&e.length)||e.length<=jde?null:e.length>Ude?X` - ${e.slice(1,Ude-1).map(n=>X`{this.onSocialClick(n)}} - logo=${n} - >`)} - - `:X` - ${e.slice(1,e.length).map(n=>X`{this.onSocialClick(n)}} - logo=${n} - >`)} - `}separatorTemplate(){const e=this.connectors.find(n=>n.id==="walletConnect"),r=At.state.enableWallets;return e&&r||this.walletGuide==="explore"?X``:null}onMoreSocialsClick(){Ye.push("ConnectSocials")}async onSocialClick(e){var r,n;if(e&&(Ze.setSocialProvider(e,Pe.state.activeChain),Vt.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}})),e===QD.Farcaster){Ye.push("ConnectingFarcaster");const i=rr.getAuthConnector();if(i&&!Ze.state.farcasterUrl)try{const{url:a}=await i.provider.getFarcasterUri();Ze.setFarcasterUrl(a,Pe.state.activeChain)}catch(a){Ye.goBack(),vr.showError(a)}}else{Ye.push("ConnectingSocial");const i=rr.getAuthConnector();this.popupWindow=gt.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if(i&&e){const{uri:a}=await i.provider.getSocialRedirectUri({provider:e});if(this.popupWindow&&a)Ze.setSocialWindow(this.popupWindow,Pe.state.activeChain),this.popupWindow.location.href=a;else throw(r=this.popupWindow)==null||r.close(),new Error("Something went wrong")}}catch{(n=this.popupWindow)==null||n.close(),vr.showError("Something went wrong")}}}};c2.styles=I9t;z8([xe()],c2.prototype,"connectors",void 0);z8([xe()],c2.prototype,"features",void 0);z8([xe()],c2.prototype,"authConnector",void 0);z8([ce()],c2.prototype,"walletGuide",void 0);c2=z8([Fe("w3m-social-login-widget")],c2);var k9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let zde=class extends He{render(){return X` - - - - - `}};zde=k9t([Fe("w3m-wallet-login-list")],zde);const P9t=Je` - :host { - margin-top: var(--wui-spacing-3xs); - } - wui-separator { - margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) - calc(var(--wui-spacing-m) * -1); - width: calc(100% + var(--wui-spacing-s) * 2); - } -`;var k$=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let I5=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.features=At.state.features,this.unsubscribe.push(rr.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),At.subscribeKey("features",e=>this.features=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var r;const e=(r=this.features)==null?void 0:r.socials;return!this.authConnector||!e||!(e!=null&&e.length)?null:X` - ${e.map(n=>X`{this.onSocialClick(n)}} - name=${n} - logo=${n} - >`)} - `}async onSocialClick(e){var r,n;if(e&&(Ze.setSocialProvider(e,Pe.state.activeChain),Vt.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}})),e===QD.Farcaster){Ye.push("ConnectingFarcaster");const i=rr.getAuthConnector();if(i&&!Ze.state.farcasterUrl)try{const{url:a}=await i.provider.getFarcasterUri();Ze.setFarcasterUrl(a,Pe.state.activeChain)}catch(a){Ye.goBack(),vr.showError(a)}}else{Ye.push("ConnectingSocial");const i=rr.getAuthConnector();this.popupWindow=gt.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if(i&&e){const{uri:a}=await i.provider.getSocialRedirectUri({provider:e});if(this.popupWindow&&a)Ze.setSocialWindow(this.popupWindow,Pe.state.activeChain),this.popupWindow.location.href=a;else throw(r=this.popupWindow)==null||r.close(),new Error("Something went wrong")}}catch{(n=this.popupWindow)==null||n.close(),vr.showError("Something went wrong")}}}};I5.styles=P9t;k$([xe()],I5.prototype,"connectors",void 0);k$([xe()],I5.prototype,"authConnector",void 0);k$([xe()],I5.prototype,"features",void 0);I5=k$([Fe("w3m-social-login-list")],I5);var j6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let bY=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(r=>r.type==="ANNOUNCED");return e!=null&&e.length?X` - - ${e.map(r=>{var n,i;return(n=r.info)!=null&&n.rdns&&xr.state.excludedRDNS&&xr.state.excludedRDNS.includes((i=r==null?void 0:r.info)==null?void 0:i.rdns)?null:X` - this.onConnector(r)} - tagVariant="success" - tagLabel="installed" - data-testid=${`wallet-selector-${r.id}`} - .installed=${!0} - > - - `})} - - `:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?gt.isMobile()?Ye.push("AllWallets"):Ye.push("ConnectingWalletConnect"):Ye.push("ConnectingExternal",{connector:e})}};j6e([xe()],bY.prototype,"connectors",void 0);bY=j6e([Fe("w3m-connect-announced-widget")],bY);var U6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let xY=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=At.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const r=this.filterOutDuplicateWallets(e);return X` - ${r.map(n=>X` - this.onConnectWallet(n)} - data-testid=${`wallet-selector-${n.id}`} - > - - `)} - `}filterOutDuplicateWallets(e){const r=jn.getRecentWallets(),n=this.connectors.map(s=>{var l;return(l=s.info)==null?void 0:l.rdns}).filter(Boolean),i=r.map(s=>s.rdns).filter(Boolean),a=n.concat(i);if(a.includes("io.metamask.mobile")&>.isMobile()){const s=a.indexOf("io.metamask.mobile");a[s]="io.metamask"}return e.filter(s=>!a.includes(String(s==null?void 0:s.rdns)))}onConnectWallet(e){Ye.push("ConnectingWalletConnect",{wallet:e})}};U6e([xe()],xY.prototype,"connectors",void 0);xY=U6e([Fe("w3m-connect-custom-widget")],xY);var R9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Hde=class extends He{constructor(){super(...arguments),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{featured:e}=xr.state;if(!e.length)return this.style.cssText="display: none",null;const r=A5.filterOutDuplicateWallets(e);return X` - - ${r.map(n=>X` - this.onConnectWallet(n)} - > - - `)} - - `}onConnectWallet(e){const r=rr.getConnector(e.id,e.rdns);r?Ye.push("ConnectingExternal",{connector:r}):Ye.push("ConnectingWalletConnect",{wallet:e})}};Hde=R9t([Fe("w3m-connect-featured-widget")],Hde);var z6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let _Y=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var r;const e=this.connectors.filter(n=>n.type==="INJECTED");return!(e!=null&&e.length)||e.length===1&&((r=e[0])==null?void 0:r.name)==="Browser Wallet"&&!gt.isMobile()?(this.style.cssText="display: none",null):X` - - ${e.map(n=>{var i,a;return!gt.isMobile()&&n.name==="Browser Wallet"?null:Dr.checkInstalled(void 0,n.chain)?(i=n.info)!=null&&i.rdns&&xr.state.excludedRDNS&&xr.state.excludedRDNS.includes((a=n==null?void 0:n.info)==null?void 0:a.rdns)?null:X` - this.onConnector(n)} - > - - `:(this.style.cssText="display: none",null)})} - - `}onConnector(e){Pe.setActiveConnector(e),Ye.push("ConnectingExternal",{connector:e})}};z6e([xe()],_Y.prototype,"connectors",void 0);_Y=z6e([Fe("w3m-connect-injected-widget")],_Y);var H6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let SY=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(r=>r.type==="MULTI_CHAIN"&&r.name!=="WalletConnect");return e!=null&&e.length?X` - - ${e.map(r=>X` - this.onConnector(r)} - > - - `)} - - `:(this.style.cssText="display: none",null)}onConnector(e){Pe.setActiveConnector(e),Ye.push("ConnectingMultiChain")}};H6e([xe()],SY.prototype,"connectors",void 0);SY=H6e([Fe("w3m-connect-multi-chain-widget")],SY);var V6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let CY=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const r=this.connectors.filter(n=>n.type==="EXTERNAL").filter(n=>n.id!=="coinbaseWalletSDK");return r!=null&&r.length?X` - - ${r.map(n=>X` - this.onConnector(n)} - > - - `)} - - `:(this.style.cssText="display: none",null)}onConnector(e){Ye.push("ConnectingExternal",{connector:e})}};V6e([xe()],CY.prototype,"connectors",void 0);CY=V6e([Fe("w3m-connect-external-widget")],CY);var M9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Vde=class extends He{render(){const e=jn.getRecentWallets();return e!=null&&e.length?X` - - ${e.map(r=>X` - this.onConnectWallet(r)} - tagLabel="recent" - tagVariant="shade" - > - - `)} - - `:(this.style.cssText="display: none",null)}onConnectWallet(e){Ye.push("ConnectingWalletConnect",{wallet:e})}};Vde=M9t([Fe("w3m-connect-recent-widget")],Vde);var G6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let AY=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.connectors.find(d=>d.id==="walletConnect"))return null;const{recommended:r}=xr.state,{customWallets:n,featuredWalletIds:i}=At.state,{connectors:a}=rr.state,o=jn.getRecentWallets(),l=a.filter(d=>d.type==="INJECTED"||d.type==="ANNOUNCED"||d.type==="MULTI_CHAIN").filter(d=>d.name!=="Browser Wallet");if(i||n||!r.length)return this.style.cssText="display: none",null;const c=l.length+o.length,u=Math.max(0,2-c),f=A5.filterOutDuplicateWallets(r).slice(0,u);return f.length?X` - - ${f.map(d=>X` - this.onConnectWallet(d)} - > - - `)} - - `:(this.style.cssText="display: none",null)}onConnectWallet(e){const r=rr.getConnector(e.id,e.rdns);r?Ye.push("ConnectingExternal",{connector:r}):Ye.push("ConnectingWalletConnect",{wallet:e})}};G6e([xe()],AY.prototype,"connectors",void 0);AY=G6e([Fe("w3m-connect-recommended-widget")],AY);var W6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let TY=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(gt.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(r=>r.id==="walletConnect");return e?X` - this.onConnector(e)} - tagLabel="qr code" - tagVariant="main" - data-testid="wallet-selector-walletconnect" - > - - `:(this.style.cssText="display: none",null)}onConnector(e){Pe.setActiveConnector(e),Ye.push("ConnectingWalletConnect")}};W6e([xe()],TY.prototype,"connectors",void 0);TY=W6e([Fe("w3m-connect-walletconnect-widget")],TY);const D9t=Je` - :host { - margin-top: var(--wui-spacing-3xs); - } - wui-separator { - margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs) - calc(var(--wui-spacing-m) * -1); - width: calc(100% + var(--wui-spacing-s) * 2); - } -`;var q6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let IN=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{custom:e,recent:r,announced:n,injected:i,multiChain:a,recommended:o,featured:s,external:l}=this.getConnectorsByType(),c=At.state.enableWalletConnect;return X` - - ${c?X``:null} - ${r.length?X``:null} - ${a.length?X``:null} - ${n.length?X``:null} - ${i.length?X``:null} - ${s.length?X``:null} - ${e!=null&&e.length?X``:null} - ${l.length?X``:null} - ${o.length?X``:null} - - `}getConnectorsByType(){const{featured:e,recommended:r}=xr.state,{customWallets:n}=At.state,i=jn.getRecentWallets(),a=A5.filterOutDuplicateWallets(r),o=A5.filterOutDuplicateWallets(e),s=this.connectors.filter(h=>h.type==="MULTI_CHAIN"),l=this.connectors.filter(h=>h.type==="ANNOUNCED"),c=this.connectors.filter(h=>h.type==="INJECTED"),u=this.connectors.filter(h=>h.type==="EXTERNAL"),d=Pe.state.activeChain===ya.CHAIN.EVM?At.state.enableEIP6963:!0;return{custom:n,recent:i,external:u,multiChain:s,announced:d?l:[],injected:d?c:[],recommended:a,featured:o}}};IN.styles=D9t;q6e([xe()],IN.prototype,"connectors",void 0);IN=q6e([Fe("w3m-connector-list")],IN);var uee=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let kN=class extends He{constructor(){super(),this.unsubscribe=[],this.connectors=rr.state.connectors,this.count=xr.state.count,this.unsubscribe.push(rr.subscribeKey("connectors",e=>this.connectors=e),xr.subscribeKey("count",e=>this.count=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(s=>s.id==="walletConnect"),{allWallets:r}=At.state;if(!e||r==="HIDE"||r==="ONLY_MOBILE"&&!gt.isMobile())return null;const n=xr.state.featured.length,i=this.count+n,a=i<10?i:Math.floor(i/10)*10,o=a - `}onAllWallets(){Vt.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),Ye.push("AllWallets")}};uee([xe()],kN.prototype,"connectors",void 0);uee([xe()],kN.prototype,"count",void 0);kN=uee([Fe("w3m-all-wallets-widget")],kN);var N9t=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let Gde=class extends He{constructor(){super(...arguments),this.socialProvider=jn.getConnectedSocialProvider(),this.socialUsername=jn.getConnectedSocialUsername()}render(){const e=jn.getConnectedConnector(),r=rr.getAuthConnector();if(!r||e!=="AUTH")return this.style.cssText="display: none",null;const n=r.provider.getEmail()??"";return X` - {this.onGoToUpdateEmail(n,this.socialProvider)}} - > - ${this.getAuthName(n)} - - `}onGoToUpdateEmail(e,r){r||Ye.push("UpdateEmailWallet",{email:e})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};Gde=N9t([Fe("w3m-account-auth-button")],Gde);const O9t=Je` - wui-flex { - width: 100%; - } - - .wallet-guide { - width: 100%; - } - - .chip-box { - width: fit-content; - background-color: var(--wui-color-gray-glass-005); - border-radius: var(--wui-border-radius-3xl); - } -`;var Y6e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};let PN=class extends He{constructor(){super(...arguments),this.walletGuide="get-started"}render(){return this.walletGuide==="explore"?X` - - Looking for a self-custody wallet? - - - - - - `:X` - Haven't got a wallet? - - Get started - - `}onGetStarted(){Ye.push("Create")}};PN.styles=O9t;Y6e([ce()],PN.prototype,"walletGuide",void 0);PN=Y6e([Fe("w3m-wallet-guide")],PN);let kz;function L9t(t){return kz||(kz=new uEt({...t,sdkVersion:gt.generateSdkVersion(t.adapters??[],"react",EEt.version)})),kz}const K6e="2.21.18";let b7={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:K6e},kt=class EY extends Error{constructor(e,r={}){var s;const n=(()=>{var l;return r.cause instanceof EY?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof EY&&r.cause.docsPath||r.docsPath,a=(s=b7.getDocsUrl)==null?void 0:s.call(b7,{...r,docsPath:i}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],`Version: ${b7.version}`].join(` -`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=K6e}walk(e){return Z6e(this,e)}};function Z6e(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?Z6e(t.cause,e):e?null:t}class $9t extends kt{constructor({max:e,min:r,signed:n,size:i,value:a}){super(`Number "${a}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class B9t extends kt{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class F9t extends kt{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}class Q6e extends kt{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class X6e extends kt{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}class Wde extends kt{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function OS(t,{dir:e,size:r=32}={}){return typeof t=="string"?g1(t,{dir:e,size:r}):j9t(t,{dir:e,size:r})}function g1(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new X6e({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function j9t(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new X6e({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i=X0.zero&&t<=X0.nine)return t-X0.zero;if(t>=X0.A&&t<=X0.F)return t-(X0.A-10);if(t>=X0.a&&t<=X0.f)return t-(X0.a-10)}function c0(t,e={}){let r=t;e.size&&(Rh(r,{size:e.size}),r=OS(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,a=new Uint8Array(i);for(let o=0,s=0;oe)throw new F9t({givenSize:ks(t),maxSize:e})}function k5(t,e={}){const{signed:r}=e;e.size&&Rh(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,a=(1n<e.toString(16).padStart(2,"0"));function f2(t,e={}){return typeof t=="number"||typeof t=="bigint"?Ln(t,e):typeof t=="string"?R$(t,e):typeof t=="boolean"?eTe(t,e):Ds(t,e)}function eTe(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Rh(r,{size:e.size}),OS(r,{size:e.size})):r}function Ds(t,e={}){let r="";for(let i=0;ia||iW9t(r,{includeName:e})).join(e?", ":","):""}function W9t(t,{includeName:e}){return t.type.startsWith("tuple")?`(${fee(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class q9t extends kt{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class Yde extends kt{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class Y9t extends kt{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${fee(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class M$ extends kt{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class K9t extends kt{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`),{name:"AbiEncodingArrayLengthMismatchError"})}}class Z9t extends kt{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ks(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Q9t extends kt{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`),{name:"AbiEncodingLengthMismatchError"})}}class tTe extends kt{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class RN extends kt{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class X9t extends kt{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class J9t extends kt{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${P5(e.abiItem)}\`, and`,`\`${r.type}\` in \`${P5(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class eIt extends kt{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class tIt extends kt{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r,name:"InvalidAbiDecodingType"})}}class rIt extends kt{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`),{name:"InvalidArrayError"})}}class nIt extends kt{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`),{name:"InvalidDefinitionTypeError"})}}function d2(t){return typeof t[0]=="string"?D$(t):iIt(t)}function iIt(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function D$(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}class UT extends kt{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class dee extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}function MN(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function aIt(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function N$(t,...e){if(!aIt(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function GSr(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");MN(t.outputLen),MN(t.blockLen)}function DN(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function rTe(t,e){N$(t);const r=e.outputLen;if(t.length>Kde&x7)}:{h:Number(t>>Kde&x7)|0,l:Number(t&x7)|0}}function sIt(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,cIt=(t,e,r)=>e<>>32-r,uIt=(t,e,r)=>e<>>64-r,fIt=(t,e,r)=>t<>>64-r,Pz=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dIt=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Rz=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Kh=(t,e)=>t<<32-e|t>>>e,Zde=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,hIt=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function Qde(t){for(let e=0;et().update(hee(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function YSr(t=32){if(Pz&&typeof Pz.getRandomValues=="function")return Pz.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}const aTe=[],oTe=[],sTe=[],gIt=BigInt(0),r4=BigInt(1),vIt=BigInt(2),mIt=BigInt(7),yIt=BigInt(256),wIt=BigInt(113);for(let t=0,e=r4,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],aTe.push(2*(5*n+r)),oTe.push((t+1)*(t+2)/2%64);let i=gIt;for(let a=0;a<7;a++)e=(e<>mIt)*wIt)%yIt,e&vIt&&(i^=r4<<(r4<r>32?uIt(t,e,r):lIt(t,e,r),Jde=(t,e,r)=>r>32?fIt(t,e,r):cIt(t,e,r);function _It(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,l=(o+2)%10,c=r[l],u=r[l+1],f=Xde(c,u,1)^r[s],d=Jde(c,u,1)^r[s+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],a=t[3];for(let o=0;o<24;o++){const s=oTe[o],l=Xde(i,a,s),c=Jde(i,a,s),u=aTe[o];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)r[s]=t[o+s];for(let s=0;s<10;s++)t[o+s]^=~r[(s+2)%10]&r[(s+4)%10]}t[0]^=bIt[n],t[1]^=xIt[n]}r.fill(0)}class pee extends nTe{constructor(e,r,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,MN(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=dIt(this.state)}keccak(){Zde||Qde(this.state32),_It(this.state32,this.rounds),Zde||Qde(this.state32),this.posOut=0,this.pos=0}update(e){DN(this);const{blockLen:r,state:n}=this;e=hee(e);const i=e.length;for(let a=0;a=n&&this.keccak();const o=Math.min(n-this.posOut,a-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return MN(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(rTe(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:a,enableXOF:o}=this;return e||(e=new pee(r,n,i,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const SIt=(t,e,r)=>iTe(()=>new pee(e,t,r)),CIt=SIt(1,136,256/8);function z1(t,e){const r=e||"hex",n=CIt(lv(t,{strict:!1})?P$(t):t);return r==="bytes"?n:f2(n)}const Mz=new dee(8192);function O$(t,e){if(Mz.has(`${t}.${e}`))return Mz.get(`${t}.${e}`);const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=z1(hb(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const a=`0x${i.join("")}`;return Mz.set(`${t}.${e}`,a),a}function Cc(t,e){if(!H1(t,{strict:!1}))throw new UT({address:t});return O$(t,e)}const AIt=/^0x[a-fA-F0-9]{40}$/,Dz=new dee(8192);function H1(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(Dz.has(n))return Dz.get(n);const i=AIt.test(t)?t.toLowerCase()===t?!0:r?O$(t)===t:!0:!1;return Dz.set(n,i),i}function NN(t,e,r,{strict:n}={}){return lv(t,{strict:!1})?TIt(t,e,r,{strict:n}):uTe(t,e,r,{strict:n})}function lTe(t,e){if(typeof e=="number"&&e>0&&e>ks(t)-1)throw new Q6e({offset:e,position:"start",size:ks(t)})}function cTe(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ks(t)!==r-e)throw new Q6e({offset:r,position:"end",size:ks(t)})}function uTe(t,e,r,{strict:n}={}){lTe(t,e);const i=t.slice(e,r);return n&&cTe(i,e,r),i}function TIt(t,e,r,{strict:n}={}){lTe(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&cTe(i,e,r),i}function fTe(t,e){if(t.length!==e.length)throw new Q9t({expectedLength:t.length,givenLength:e.length});const r=EIt({params:t,values:e}),n=vee(r);return n.length===0?"0x":n}function EIt({params:t,values:e}){const r=[];for(let n=0;n0?d2([s,o]):s}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:d2(a.map(({encoded:o})=>o))}}function PIt(t,{param:e}){const[,r]=e.type.split("bytes"),n=ks(t);if(!r){let i=t;return n%32!==0&&(i=g1(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:d2([g1(Ln(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new Z9t({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:g1(t,{dir:"right"})}}function RIt(t){if(typeof t!="boolean")throw new kt(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:g1(eTe(t))}}function MIt(t,{signed:e}){return{dynamic:!1,encoded:Ln(t,{size:32,signed:e})}}function DIt(t){const e=R$(t),r=Math.ceil(ks(e)/32),n=[];for(let i=0;ii))}}function mee(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const Nz="/docs/contract/encodeDeployData";function dTe(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new q9t({docsPath:Nz});if(!("inputs"in i))throw new Yde({docsPath:Nz});if(!i.inputs||i.inputs.length===0)throw new Yde({docsPath:Nz});const a=fTe(i.inputs,r);return D$([n,a])}function Mh(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class yee extends kt{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` -`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class Oz extends kt{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function OIt(t){const e=z1(`0x${t.substring(4)}`).substring(26);return O$(`0x${e}`)}async function LIt({hash:t,signature:e}){const r=lv(t)?t:f2(t),{secp256k1:n}=await Bf(async()=>{const{secp256k1:o}=await import("./secp256k1-CThcWgWC.js");return{secp256k1:o}},[],import.meta.url);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:u,v:f,yParity:d}=e,h=Number(d??f),p=ehe(h);return new n.Signature(k5(c),k5(u)).addRecoveryBit(p)}const o=lv(e)?e:f2(e),s=u2(`0x${o.slice(130)}`),l=ehe(s);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function ehe(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function $It({hash:t,signature:e}){return OIt(await LIt({hash:t,signature:e}))}class the extends kt{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class BIt extends kt{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class FIt extends kt{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const jIt={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new FIt({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new BIt({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new the({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new the({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function wee(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(jIt);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function UIt(t,e="hex"){const r=hTe(t),n=wee(new Uint8Array(r.length));return r.encode(n),e==="hex"?Ds(n.bytes):n.bytes}function hTe(t){return Array.isArray(t)?zIt(t.map(e=>hTe(e))):HIt(t)}function zIt(t){const e=t.reduce((i,a)=>i+a.length,0),r=pTe(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:a}of t)a(i)}}}function HIt(t){const e=typeof t=="string"?c0(t):t,r=pTe(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function pTe(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new kt("Length is too large.")}function VIt(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,a=z1(D$(["0x05",UIt([Ln(e),r,n?Ln(n):"0x"])]));return i==="bytes"?c0(a):a}async function gTe(t){const{authorization:e,signature:r}=t;return $It({hash:VIt(e),signature:r??e})}class IY extends kt{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class GIt extends kt{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class WIt extends kt{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`),{name:"ChainNotFoundError"})}}class vTe extends kt{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}function qIt({chain:t,currentChainId:e}){if(!t)throw new WIt;if(e!==t.id)throw new GIt({chain:t,currentChainId:e})}const YIt={gwei:9,wei:18},KIt={ether:-9,wei:9},ZIt={ether:-18,gwei:-9};function H8(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,a]=[r.slice(0,r.length-e),r.slice(r.length-e)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${a?`.${a}`:""}`}function kc(t,e="wei"){return H8(t,KIt[e])}class q_ extends kt{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(q_,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(q_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class ON extends kt{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${kc(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(ON,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class kY extends kt{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${kc(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(kY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class PY extends kt{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(PY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class RY extends kt{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(RY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class MY extends kt{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(MY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class DY extends kt{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(DY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class NY extends kt{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(NY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class OY extends kt{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(OY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class LY extends kt{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(LY,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class LN extends kt{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${kc(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${kc(n)} gwei`:""}).`].join(` -`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(LN,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class L$ extends kt{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function bee(t,e="wei"){return H8(t,YIt[e])}function V8(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` -`)}class QIt extends kt{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`),{name:"FeeConflictError"})}}class XIt extends kt{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",V8(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class JIt extends kt{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:o,gasPrice:s,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:d}){var p;const h=V8({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${bee(d)} ${((p=i==null?void 0:i.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof s<"u"&&`${kc(s)} gwei`,maxFeePerGas:typeof l<"u"&&`${kc(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${kc(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class mTe extends kt{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){let o="Transaction";n&&a!==void 0&&(o=`Transaction at block time "${n}" at index "${a}"`),e&&a!==void 0&&(o=`Transaction at block hash "${e}" at index "${a}"`),r&&a!==void 0&&(o=`Transaction at block number "${r}" at index "${a}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class yTe extends kt{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class e7t extends kt{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const ah=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r),t7t=t=>t,xee=t=>t;class ZA extends kt{constructor({body:e,cause:r,details:n,headers:i,status:a,url:o}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${xee(o)}`,e&&`Request body: ${ah(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=a,this.url=o}}class wTe extends kt{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${xee(n)}`,`Request body: ${ah(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class rhe extends kt{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${xee(r)}`,`Request body: ${ah(e)}`],name:"TimeoutError"})}}const r7t=-1;class Hc extends kt{constructor(e,{code:r,docsPath:n,metaMessages:i,name:a,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof wTe?e.code:r??r7t}}class $S extends Hc{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class zT extends Hc{constructor(e){super(e,{code:zT.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(zT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class HT extends Hc{constructor(e){super(e,{code:HT.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(HT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class VT extends Hc{constructor(e,{method:r}={}){super(e,{code:VT.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(VT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class GT extends Hc{constructor(e){super(e,{code:GT.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(GT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class h2 extends Hc{constructor(e){super(e,{code:h2.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(h2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class WT extends Hc{constructor(e){super(e,{code:WT.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(WT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class qT extends Hc{constructor(e){super(e,{code:qT.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(qT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class v1 extends Hc{constructor(e){super(e,{code:v1.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(v1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class R5 extends Hc{constructor(e){super(e,{code:R5.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(R5,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class YT extends Hc{constructor(e,{method:r}={}){super(e,{code:YT.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(YT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class M5 extends Hc{constructor(e){super(e,{code:M5.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(M5,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class KT extends Hc{constructor(e){super(e,{code:KT.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(KT,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class ga extends $S{constructor(e){super(e,{code:ga.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(ga,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ZT extends $S{constructor(e){super(e,{code:ZT.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(ZT,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class QT extends $S{constructor(e,{method:r}={}){super(e,{code:QT.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(QT,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class XT extends $S{constructor(e){super(e,{code:XT.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(XT,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class JT extends $S{constructor(e){super(e,{code:JT.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(JT,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Fc extends $S{constructor(e){super(e,{code:Fc.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Fc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class n7t extends Hc{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function _ee(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof kt?t.walk(i=>(i==null?void 0:i.code)===q_.code):t;return n instanceof kt?new q_({cause:t,message:n.details}):q_.nodeMessage.test(r)?new q_({cause:t,message:t.details}):ON.nodeMessage.test(r)?new ON({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):kY.nodeMessage.test(r)?new kY({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):PY.nodeMessage.test(r)?new PY({cause:t,nonce:e==null?void 0:e.nonce}):RY.nodeMessage.test(r)?new RY({cause:t,nonce:e==null?void 0:e.nonce}):MY.nodeMessage.test(r)?new MY({cause:t,nonce:e==null?void 0:e.nonce}):DY.nodeMessage.test(r)?new DY({cause:t}):NY.nodeMessage.test(r)?new NY({cause:t,gas:e==null?void 0:e.gas}):OY.nodeMessage.test(r)?new OY({cause:t,gas:e==null?void 0:e.gas}):LY.nodeMessage.test(r)?new LY({cause:t}):LN.nodeMessage.test(r)?new LN({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new L$({cause:t})}function i7t(t,{docsPath:e,...r}){const n=(()=>{const i=_ee(t,r);return i instanceof L$?t:i})();return new JIt(n,{docsPath:e,...r})}function See(t,{format:e}){if(!e)return{};const r={};function n(a){const o=Object.keys(a);for(const s of o)s in t&&(r[s]=t[s]),a[s]&&typeof a[s]=="object"&&!Array.isArray(a[s])&&n(a[s])}const i=e(t||{});return n(i),r}const a7t={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Cee(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=o7t(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>Ds(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=Ln(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=Ln(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=Ln(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=Ln(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=Ln(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=Ln(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=a7t[t.type]),typeof t.value<"u"&&(e.value=Ln(t.value)),e}function o7t(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:Ln(e.chainId),nonce:Ln(e.nonce),...typeof e.yParity<"u"?{yParity:Ln(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Ln(e.v)}:{}}))}function aa(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:a=>e(t,a)}const s7t=2n**256n-1n;function $$(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:a}=t,o=e?Mh(e):void 0;if(o&&!H1(o.address))throw new UT({address:o.address});if(a&&!H1(a))throw new UT({address:a});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new QIt;if(n&&n>s7t)throw new ON({maxFeePerGas:n});if(i&&n&&i>n)throw new LN({maxFeePerGas:n,maxPriorityFeePerGas:i})}async function bTe(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return u2(e)}class l7t extends kt{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Aee extends kt{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class c7t extends kt{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${kc(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class xTe extends kt{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const _Te={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function STe(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?u2(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?u2(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?_Te[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=u7t(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}function u7t(t){return t.map(e=>({contractAddress:e.address,r:e.r,s:e.s,chainId:Number(e.chainId),nonce:Number(e.nonce),...typeof e.yParity<"u"?{yParity:Number(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Number(e.v)}:{}}))}function f7t(t){var r;const e=(r=t.transactions)==null?void 0:r.map(n=>typeof n=="string"?n:STe(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}async function eE(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const a=n??"latest",o=i??!1,s=r!==void 0?Ln(r):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[s||a,o]},{dedupe:!!s}),!l)throw new xTe({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||f7t)(l)}async function CTe(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function d7t(t,e){var a,o;const{block:r,chain:n=t.chain,request:i}=e||{};try{const s=((a=n==null?void 0:n.fees)==null?void 0:a.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof s=="function"){const c=r||await aa(t,eE,"getBlock")({}),u=await s({block:c,client:t,request:i});if(u===null)throw new Error;return u}if(typeof s<"u")return s;const l=await t.request({method:"eth_maxPriorityFeePerGas"});return k5(l)}catch{const[s,l]=await Promise.all([r?Promise.resolve(r):aa(t,eE,"getBlock")({}),aa(t,CTe,"getGasPrice")({})]);if(typeof s.baseFeePerGas!="bigint")throw new Aee;const c=l-s.baseFeePerGas;return c<0n?0n:c}}async function nhe(t,e){var d,h;const{block:r,chain:n=t.chain,request:i,type:a="eip1559"}=e||{},o=await(async()=>{var p,g;return typeof((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((g=n==null?void 0:n.fees)==null?void 0:g.baseFeeMultiplier)??1.2})();if(o<1)throw new l7t;const l=10**(((d=o.toString().split(".")[1])==null?void 0:d.length)??0),c=p=>p*BigInt(Math.ceil(o*l))/BigInt(l),u=r||await aa(t,eE,"getBlock")({});if(typeof((h=n==null?void 0:n.fees)==null?void 0:h.estimateFeesPerGas)=="function"){const p=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:c,request:i,type:a});if(p!==null)return p}if(a==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Aee;const p=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await d7t(t,{block:u,chain:n,request:i}),g=c(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??g+p,maxPriorityFeePerGas:p}}return{gasPrice:(i==null?void 0:i.gasPrice)??c(await aa(t,CTe,"getGasPrice")({}))}}class h7t extends kt{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:o,gasPrice:s,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:d}){var p;const h=V8({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${bee(d)} ${((p=i==null?void 0:i.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof s<"u"&&`${kc(s)} gwei`,maxFeePerGas:typeof l<"u"&&`${kc(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${kc(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function p7t(t,{docsPath:e,...r}){const n=(()=>{const i=_ee(t,r);return i instanceof L$?t:i})();return new h7t(n,{docsPath:e,...r})}class g7t extends kt{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class v7t extends kt{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function ihe(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} -`,"")}function m7t(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: -`;return n.nonce&&(i+=` nonce: ${n.nonce} -`),n.balance&&(i+=` balance: ${n.balance} -`),n.code&&(i+=` code: ${n.code} -`),n.state&&(i+=` state: -`,i+=ihe(n.state)),n.stateDiff&&(i+=` stateDiff: -`,i+=ihe(n.stateDiff)),i},` State Override: -`).slice(0,-1)}function ahe(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new Wde({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new Wde({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function y7t(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:a}=t,o={};if(a!==void 0&&(o.code=a),e!==void 0&&(o.balance=Ln(e)),r!==void 0&&(o.nonce=Ln(r)),n!==void 0&&(o.state=ahe(n)),i!==void 0){if(o.state)throw new v7t;o.stateDiff=ahe(i)}return o}function ATe(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!H1(r,{strict:!1}))throw new UT({address:r});if(e[r])throw new g7t({address:r});e[r]=y7t(n)}return e}async function TTe(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Ln(r):void 0,a=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(a)}async function Tee(t,e){var i,a,o;const r=e.account??t.account,n=r?Mh(r):void 0;try{let T=function(N){const{block:F,request:B,rpcStateOverride:j}=N;return t.request({method:"eth_estimateGas",params:j?[B,F??"latest",j]:F?[B,F]:[B]})};const{accessList:s,authorizationList:l,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:d,data:h,gas:p,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:b,value:w,stateOverride:C,...A}=await Iee(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),I=(f?Ln(f):void 0)||d,D=ATe(C),L=await(async()=>{if(A.to)return A.to;if(l&&l.length>0)return await gTe({authorization:l[0]}).catch(()=>{throw new kt("`to` is required. Could not infer from `authorizationList`")})})();$$(e);const O=(o=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionRequest)==null?void 0:o.format,x=(O||Cee)({...See(A,{format:O}),from:n==null?void 0:n.address,accessList:s,authorizationList:l,blobs:c,blobVersionedHashes:u,data:h,gas:p,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:y,maxPriorityFeePerGas:m,nonce:b,to:L,value:w});let E=BigInt(await T({block:I,request:x,rpcStateOverride:D}));if(l){const N=await TTe(t,{address:x.from}),F=await Promise.all(l.map(async B=>{const{contractAddress:j}=B,k=await T({block:I,request:{authorizationList:void 0,data:h,from:n==null?void 0:n.address,to:j,value:Ln(N)},rpcStateOverride:D}).catch(()=>100000n);return 2n*BigInt(k)}));E+=F.reduce((B,j)=>B+j,0n)}return E}catch(s){throw p7t(s,{...e,account:n,chain:t.chain})}}async function w7t(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?Ln(n):r]},{dedupe:!!n});return u2(i)}function ETe(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(a=>c0(a)):t.blobs,i=[];for(const a of n)i.push(Uint8Array.from(e.blobToKzgCommitment(a)));return r==="bytes"?i:i.map(a=>Ds(a))}function ITe(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>c0(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>c0(o)):t.commitments,a=[];for(let o=0;oDs(o))}function b7t(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),o=Number(r>>i&a),s=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+c,s,n)}const x7t=(t,e,r)=>t&e^~t&r,_7t=(t,e,r)=>t&e^t&r^e&r;class S7t extends nTe{constructor(e,r,n,i){super(),this.blockLen=e,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(e),this.view=Rz(this.buffer)}update(e){DN(this);const{view:r,buffer:n,blockLen:i}=this;e=hee(e);const a=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,g=Kh(h,17)^Kh(h,19)^h>>>10;Kv[f]=g+Kv[f-7]+p+Kv[f-16]|0}let{A:n,B:i,C:a,D:o,E:s,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const d=Kh(s,6)^Kh(s,11)^Kh(s,25),h=u+d+x7t(s,l,c)+C7t[f]+Kv[f]|0,g=(Kh(n,2)^Kh(n,13)^Kh(n,22))+_7t(n,i,a)|0;u=c,c=l,l=s,s=o+h|0,o=a,a=i,i=n,n=h+g|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,o,s,l,c,u)}roundClean(){Kv.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const T7t=iTe(()=>new A7t);function E7t(t,e){return T7t(lv(t,{strict:!1})?P$(t):t)}function I7t(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=E7t(e);return i.set([r],0),n==="bytes"?i:Ds(i)}function k7t(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const a of e)i.push(I7t({commitment:a,to:n,version:r}));return i}const ohe=6,kTe=32,Eee=4096,PTe=kTe*Eee,she=PTe*ohe-1-1*Eee*ohe;class P7t extends kt{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class R7t extends kt{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function M7t(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?c0(t.data):t.data,n=ks(r);if(!n)throw new R7t;if(n>she)throw new P7t({maxSize:she,size:n});const i=[];let a=!0,o=0;for(;a;){const s=wee(new Uint8Array(PTe));let l=0;for(;ls.bytes):i.map(s=>Ds(s.bytes))}function D7t(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??M7t({data:e,to:n}),a=t.commitments??ETe({blobs:i,kzg:r,to:n}),o=t.proofs??ITe({blobs:i,commitments:a,kzg:r,to:n}),s=[];for(let l=0;l"u"&&f)if(l){const y=await v();d.nonce=await l.consume({address:f.address,chainId:y,client:t})}else d.nonce=await aa(t,w7t,"getTransactionCount")({address:f.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{d.type=N7t(d)}catch{const y=await p();d.type=typeof(y==null?void 0:y.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(d.type!=="legacy"&&d.type!=="eip2930"){if(typeof d.maxFeePerGas>"u"||typeof d.maxPriorityFeePerGas>"u"){const y=await p(),{maxFeePerGas:m,maxPriorityFeePerGas:b}=await nhe(t,{block:y,chain:i,request:d});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(d.gas=await aa(t,Tee,"estimateGas")({...d,account:f?{address:f.address,type:"json-rpc"}:void 0})),$$(d),delete d.parameters,d}async function O7t(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function MTe(t,e){var y,m,b,w;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:a,blobs:o,data:s,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,nonce:h,value:p,...g}=e;if(!r)throw new yee({docsPath:"/docs/actions/wallet/sendTransaction"});const v=Mh(r);try{$$(e);const C=await(async()=>{if(e.to)return e.to;if(a&&a.length>0)return await gTe({authorization:a[0]}).catch(()=>{throw new kt("`to` is required. Could not infer from `authorizationList`.")})})();if(v.type==="json-rpc"){let A;n!==null&&(A=await aa(t,bTe,"getChainId")({}),qIt({currentChainId:A,chain:n}));const S=(b=(m=(y=t.chain)==null?void 0:y.formatters)==null?void 0:m.transactionRequest)==null?void 0:b.format,D=(S||Cee)({...See(g,{format:S}),accessList:i,authorizationList:a,blobs:o,chainId:A,data:s,from:v.address,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,nonce:h,to:C,value:p});return await t.request({method:"eth_sendTransaction",params:[D]},{retryCount:0})}if(v.type==="local"){const A=await aa(t,Iee,"prepareTransactionRequest")({account:v,accessList:i,authorizationList:a,blobs:o,chain:n,data:s,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:d,nonce:h,nonceManager:v.nonceManager,parameters:[...RTe,"sidecars"],value:p,...g,to:C}),S=(w=n==null?void 0:n.serializers)==null?void 0:w.transaction,I=await v.signTransaction(A,{serializer:S});return await aa(t,O7t,"sendRawTransaction")({serializedTransaction:I})}throw v.type==="smart"?new Oz({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Oz({docsPath:"/docs/actions/wallet/sendTransaction",type:v.type})}catch(C){throw C instanceof Oz?C:i7t(C,{...e,account:v,chain:e.chain||void 0})}}const $Y=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],DTe=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],NTe=[...DTe,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],L7t=[...DTe,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],lhe=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],che=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}];function $7t(t,e={}){typeof e.size<"u"&&Rh(t,{size:e.size});const r=Ds(t,e);return k5(r,e)}function B7t(t,e={}){let r=t;if(typeof e.size<"u"&&(Rh(r,{size:e.size}),r=LS(r)),r.length>1||r[0]>1)throw new B9t(r);return!!r[0]}function Mg(t,e={}){typeof e.size<"u"&&Rh(t,{size:e.size});const r=Ds(t,e);return u2(r,e)}function F7t(t,e={}){let r=t;return typeof e.size<"u"&&(Rh(r,{size:e.size}),r=LS(r,{dir:"right"})),new TextDecoder().decode(r)}function OTe(t,e){const r=typeof e=="string"?c0(e):e,n=wee(r);if(ks(r)===0&&t.length>0)throw new M$;if(ks(e)&&ks(e)<32)throw new Y9t({data:typeof e=="string"?e:Ds(e),params:t,size:ks(e)});let i=0;const a=[];for(let o=0;o48?$7t(i,{signed:r}):Mg(i,{signed:r}),32]}function G7t(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let a=0;if(tE(e)){const o=Mg(t.readBytes(BY)),s=r+o;for(let l=0;lz1(P$(t));function Y7t(t){return q7t(t)}const K7t="1.0.5";let id=class FY extends Error{constructor(e,r={}){var o;const n=r.cause instanceof FY?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,i=r.cause instanceof FY&&r.cause.docsPath||r.docsPath,a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${K7t}`].join(` -`);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function my(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const LTe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$Te=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,BTe=/^\(.+?\).*?$/,fhe=/^tuple(?(\[(\d*)\])*)$/;function jY(t){let e=t.type;if(fhe.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function Q7t(t){return FTe.test(t)}function X7t(t){return my(FTe,t)}const jTe=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function J7t(t){return jTe.test(t)}function ekt(t){return my(jTe,t)}const UTe=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function tkt(t){return UTe.test(t)}function rkt(t){return my(UTe,t)}const zTe=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function HTe(t){return zTe.test(t)}function nkt(t){return my(zTe,t)}const VTe=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function ikt(t){return VTe.test(t)}function akt(t){return my(VTe,t)}const okt=/^fallback\(\) external(?:\s(?payable{1}))?$/;function skt(t){return okt.test(t)}const lkt=/^receive\(\) external payable$/;function ckt(t){return lkt.test(t)}const ukt=new Set(["indexed"]),UY=new Set(["calldata","memory","storage"]);class fkt extends id{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class dkt extends id{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class hkt extends id{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class pkt extends id{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class gkt extends id{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class vkt extends id{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class mkt extends id{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class cA extends id{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class ykt extends id{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class wkt extends id{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class bkt extends id{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class xkt extends id{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function _kt(t,e){return e?`${e}:${t}`:t}const Lz=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Skt(t,e={}){if(tkt(t)){const r=rkt(t);if(!r)throw new cA({signature:t,type:"function"});const n=qd(r.parameters),i=[],a=n.length;for(let s=0;s[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Akt=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Tkt=/^u?int$/;function Nw(t,e){var f,d;const r=_kt(t,e==null?void 0:e.type);if(Lz.has(r))return Lz.get(r);const n=BTe.test(t),i=my(n?Akt:Ckt,t);if(!i)throw new hkt({param:t});if(i.name&&Ikt(i.name))throw new pkt({param:t,name:i.name});const a=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},s=(e==null?void 0:e.structs)??{};let l,c={};if(n){l="tuple";const h=qd(i.type),p=[],g=h.length;for(let v=0;v[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function WTe(t,e,r=new Set){const n=[],i=t.length;for(let a=0;a{const e=typeof t=="string"?t:Z7t(t);return Mkt(e)};function YTe(t){return Y7t(Dkt(t))}const Nkt=YTe,kee=t=>NN(YTe(t),0,4);function Pee(t){const{abi:e,args:r=[],name:n}=t,i=lv(n,{strict:!1}),a=e.filter(s=>i?s.type==="function"?kee(s)===n:s.type==="event"?Nkt(s)===n:!1:"name"in s&&s.name===n);if(a.length===0)return;if(a.length===1)return a[0];let o;for(const s of a){if(!("inputs"in s))continue;if(!r||r.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==r.length)continue;if(r.every((c,u)=>{const f="inputs"in s&&s.inputs[u];return f?zY(c,f):!1})){if(o&&"inputs"in o&&o.inputs){const c=KTe(s.inputs,o.inputs,r);if(c)throw new J9t({abiItem:s,type:c[0]},{abiItem:o,type:c[1]})}o=s}}return o||a[0]}function zY(t,e){const r=typeof t,n=e.type;switch(n){case"address":return H1(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,a)=>zY(Object.values(t)[a],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>zY(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function KTe(t,e,r){for(const n in t){const i=t[n],a=e[n];if(i.type==="tuple"&&a.type==="tuple"&&"components"in i&&"components"in a)return KTe(i.components,a.components,r[n]);const o=[i.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?H1(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?H1(r[n],{strict:!1}):!1)return o}}const $z="/docs/contract/decodeFunctionResult";function BS(t){const{abi:e,args:r,functionName:n,data:i}=t;let a=e[0];if(n){const s=Pee({abi:e,args:r,name:n});if(!s)throw new RN(n,{docsPath:$z});a=s}if(a.type!=="function")throw new RN(void 0,{docsPath:$z});if(!a.outputs)throw new X9t(a.name,{docsPath:$z});const o=OTe(a.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const dhe="/docs/contract/encodeFunctionData";function Okt(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const a=Pee({abi:e,args:r,name:n});if(!a)throw new RN(n,{docsPath:dhe});i=a}if(i.type!=="function")throw new RN(void 0,{docsPath:dhe});return{abi:[i],functionName:kee(P5(i))}}function ox(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var s;return t.abi.length===1&&((s=t.functionName)!=null&&s.startsWith("0x"))?t:Okt(t)})(),i=r[0],a=n,o="inputs"in i&&i.inputs?fTe(i.inputs,e??[]):void 0;return D$([a,o??"0x"])}function G8({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new IY({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new IY({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}const ZTe={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Lkt={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},$kt={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Bkt(t){const{abi:e,data:r}=t,n=NN(r,0,4);if(n==="0x")throw new M$;const a=[...e||[],Lkt,$kt].find(o=>o.type==="error"&&n===kee(P5(o)));if(!a)throw new tTe(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?OTe(a.inputs,NN(r,4)):void 0,errorName:a.name}}function QTe({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,a)=>`${n&&i.name?`${i.name}: `:""}${typeof e[a]=="object"?ah(e[a]):e[a]}`).join(", ")})`}class Fkt extends kt{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:o,gasPrice:s,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:d,stateOverride:h}){var v;const p=r?Mh(r):void 0;let g=V8({from:p==null?void 0:p.address,to:f,value:typeof d<"u"&&`${bee(d)} ${((v=i==null?void 0:i.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof s<"u"&&`${kc(s)} gwei`,maxFeePerGas:typeof l<"u"&&`${kc(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${kc(c)} gwei`,nonce:u});h&&(g+=` -${m7t(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Ree extends kt{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:a,functionName:o,sender:s}){const l=Pee({abi:r,args:n,name:o}),c=l?QTe({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?P5(l,{includeName:!0}):void 0,f=V8({address:i&&t7t(i),function:u,args:c&&c!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=s}}class HY extends kt{constructor({abi:e,data:r,functionName:n,message:i}){let a,o,s,l;if(r&&r!=="0x")try{o=Bkt({abi:e,data:r});const{abiItem:u,errorName:f,args:d}=o;if(f==="Error")l=d[0];else if(f==="Panic"){const[h]=d;l=ZTe[h]}else{const h=u?P5(u,{includeName:!0}):void 0,p=u&&d?QTe({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;s=[h?`Error: ${h}`:"",p&&p!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(u){a=u}else i&&(l=i);let c;a instanceof tTe&&(c=a.signature,s=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(l&&l!=="execution reverted"||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,l||c].join(` -`):`The contract function "${n}" reverted.`,{cause:a,metaMessages:s,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=l,this.signature=c}}class jkt extends kt{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class Ukt extends kt{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class Mee extends kt{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function Dee(t,e){var n,i,a,o,s,l;if(!(t instanceof kt))return!1;const r=t.walk(c=>c instanceof HY);return r instanceof HY?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((a=r.data)==null?void 0:a.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((s=r.data)==null?void 0:s.errorName)==="HttpError"||(l=r.reason)!=null&&l.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===ZTe[50]):!1}function XTe(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return lv(e)?e:null}function XR(t){let e=new Uint8Array(32).fill(0);if(!t)return Ds(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=XTe(r[n]),a=i?P$(i):z1(hb(r[n]),"bytes");e=z1(d2([e,a]),"bytes")}return Ds(e)}function zkt(t){return`[${t.slice(2)}]`}function Hkt(t){const e=new Uint8Array(32).fill(0);return t?XTe(t)||z1(hb(t)):Ds(e)}function Nee(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(hb(e).byteLength+2);let n=0;const i=e.split(".");for(let a=0;a255&&(o=hb(zkt(Hkt(i[a])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const Vkt=3;function rE(t,{abi:e,address:r,args:n,docsPath:i,functionName:a,sender:o}){const{code:s,data:l,message:c,shortMessage:u}=t instanceof Mee?t:t instanceof kt?t.walk(d=>"data"in d)||t.walk():{},f=t instanceof M$?new jkt({functionName:a}):[Vkt,h2.code].includes(s)&&(l||c||u)?new HY({abi:e,data:typeof l=="object"?l.data:l,functionName:a,message:u??c}):t;return new Ree(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:a,sender:o})}const Gkt="0x82ad56cb",Wkt="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",qkt="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function Ykt(t,{docsPath:e,...r}){const n=(()=>{const i=_ee(t,r);return i instanceof L$?t:i})();return new Fkt(n,{docsPath:e,...r})}const Bz=new Map;function JTe({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const a=async()=>{const u=l();o();const f=u.map(({args:d})=>d);f.length!==0&&t(f).then(d=>{var h;i&&Array.isArray(d)&&d.sort(i);for(let p=0;p{var h;for(let p=0;pBz.delete(e),s=()=>l().map(({args:u})=>u),l=()=>Bz.get(e)||[],c=u=>Bz.set(e,[...l(),u]);return{flush:o,async schedule(u){const f={},d=new Promise((g,v)=>{f.resolve=g,f.reject=v});return(r==null?void 0:r([...s(),u]))&&a(),l().length>0?(c({args:u,pendingPromise:f}),d):(c({args:u,pendingPromise:f}),setTimeout(a,n),d)}}}async function Oee(t,e){var O,P,x,T;const{account:r=t.account,batch:n=!!((O=t.batch)!=null&&O.multicall),blockNumber:i,blockTag:a="latest",accessList:o,blobs:s,code:l,data:c,factory:u,factoryData:f,gas:d,gasPrice:h,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:y,to:m,value:b,stateOverride:w,...C}=e,A=r?Mh(r):void 0;if(l&&(u||f))throw new kt("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&m)throw new kt("Cannot provide both `code` & `to` as parameters.");const S=l&&c,I=u&&f&&m&&c,D=S||I,L=S?Qkt({code:l,data:c}):I?Xkt({data:c,factory:u,factoryData:f,to:m}):c;try{$$(e);const N=(i?Ln(i):void 0)||a,F=ATe(w),B=(T=(x=(P=t.chain)==null?void 0:P.formatters)==null?void 0:x.transactionRequest)==null?void 0:T.format,k=(B||Cee)({...See(C,{format:B}),from:A==null?void 0:A.address,accessList:o,blobs:s,data:L,gas:d,gasPrice:h,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:y,to:D?void 0:m,value:b});if(n&&Kkt({request:k})&&!F)try{return await Zkt(t,{...k,blockNumber:i,blockTag:a})}catch(H){if(!(H instanceof vTe)&&!(H instanceof IY))throw H}const $=await t.request({method:"eth_call",params:F?[k,N,F]:[k,N]});return $==="0x"?{data:void 0}:{data:$}}catch(E){const N=Jkt(E),{offchainLookup:F,offchainLookupSignature:B}=await Bf(async()=>{const{offchainLookup:j,offchainLookupSignature:k}=await import("./ccip-D0okC1-o.js");return{offchainLookup:j,offchainLookupSignature:k}},[],import.meta.url);if(t.ccipRead!==!1&&(N==null?void 0:N.slice(0,10))===B&&m)return{data:await F(t,{data:N,to:m})};throw D&&(N==null?void 0:N.slice(0,10))==="0x101bb98d"?new Ukt({factory:u}):Ykt(E,{...e,account:A,chain:t.chain})}}function Kkt({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(Gkt)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Zkt(t,e){var g;const{batchSize:r=1024,wait:n=0}=typeof((g=t.batch)==null?void 0:g.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:a="latest",data:o,multicallAddress:s,to:l}=e;let c=s;if(!c){if(!t.chain)throw new vTe;c=G8({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Ln(i):void 0)||a,{schedule:d}=JTe({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(v){return v.reduce((m,{data:b})=>m+(b.length-2),0)>r*2},fn:async v=>{const y=v.map(w=>({allowFailure:!0,callData:w.data,target:w.to})),m=ox({abi:$Y,args:[y],functionName:"aggregate3"}),b=await t.request({method:"eth_call",params:[{data:m,to:c},f]});return BS({abi:$Y,args:[y],functionName:"aggregate3",data:b||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:l});if(!p)throw new Mee({data:h});return h==="0x"?{data:void 0}:{data:h}}function Qkt(t){const{code:e,data:r}=t;return dTe({abi:qTe(["constructor(bytes, bytes)"]),bytecode:Wkt,args:[e,r]})}function Xkt(t){const{data:e,factory:r,factoryData:n,to:i}=t;return dTe({abi:qTe(["constructor(address, bytes, address, bytes)"]),bytecode:qkt,args:[i,e,r,n]})}function Jkt(t){var r;if(!(t instanceof kt))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function p2(t,e){const{abi:r,address:n,args:i,functionName:a,...o}=e,s=ox({abi:r,args:i,functionName:a});try{const{data:l}=await aa(t,Oee,"call")({...o,data:s,to:n});return BS({abi:r,args:i,functionName:a,data:l||"0x"})}catch(l){throw rE(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:a})}}async function ePt(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:a,strict:o,universalResolverAddress:s}){let l=s;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=G8({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c=ox({abi:che,functionName:"addr",...n!=null?{args:[XR(i),BigInt(n)]}:{args:[XR(i)]}}),u={address:l,abi:NTe,functionName:"resolve",args:[f2(Nee(i)),c],blockNumber:e,blockTag:r},f=aa(t,p2,"readContract"),d=a?await f({...u,args:[...u.args,a]}):await f(u);if(d[0]==="0x")return null;const h=BS({abi:che,args:n!=null?[XR(i),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||LS(h)==="0x00"?null:h}catch(c){if(o)throw c;if(Dee(c,"resolve"))return null;throw c}}class tPt extends kt{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class i4 extends kt{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class Lee extends kt{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class rPt extends kt{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const nPt=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,iPt=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,aPt=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,oPt=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function sPt(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function hhe(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function eEe({uri:t,gatewayUrls:e}){const r=aPt.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=hhe(e==null?void 0:e.ipfs,"https://ipfs.io"),i=hhe(e==null?void 0:e.arweave,"https://arweave.net"),a=t.match(nPt),{protocol:o,subpath:s,target:l,subtarget:c=""}=(a==null?void 0:a.groups)||{},u=o==="ipns:/"||s==="ipns/",f=o==="ipfs:/"||s==="ipfs/"||iPt.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(oPt,"");if(d.startsWith("i.json());return await $ee({gatewayUrls:t,uri:tEe(r)})}catch{throw new Lee({uri:e})}}async function $ee({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=eEe({uri:e,gatewayUrls:t});if(n||await sPt(r))return r;throw new Lee({uri:e})}function cPt(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[a,o]=r.split(":"),[s,l]=n.split(":");if(!a||a.toLowerCase()!=="eip155")throw new i4({reason:"Only EIP-155 supported"});if(!o)throw new i4({reason:"Chain ID not found"});if(!l)throw new i4({reason:"Contract address not found"});if(!i)throw new i4({reason:"Token ID not found"});if(!s)throw new i4({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:s.toLowerCase(),contractAddress:l,tokenID:i}}async function uPt(t,{nft:e}){if(e.namespace==="erc721")return p2(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return p2(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new rPt({namespace:e.namespace})}async function fPt(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?dPt(t,{gatewayUrls:e,record:r}):$ee({uri:r,gatewayUrls:e})}async function dPt(t,{gatewayUrls:e,record:r}){const n=cPt(r),i=await uPt(t,{nft:n}),{uri:a,isOnChain:o,isEncoded:s}=eEe({uri:i,gatewayUrls:e});if(o&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const c=s?atob(a.replace("data:application/json;base64,","")):a,u=JSON.parse(c);return $ee({uri:tEe(u),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),lPt({gatewayUrls:e,uri:a.replace(/(?:0x)?{id}/,l)})}async function hPt(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:a,strict:o,universalResolverAddress:s}){let l=s;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=G8({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:NTe,functionName:"resolve",args:[f2(Nee(n)),ox({abi:lhe,functionName:"text",args:[XR(n),i]})],blockNumber:e,blockTag:r},u=aa(t,p2,"readContract"),f=a?await u({...c,args:[...c.args,a]}):await u(c);if(f[0]==="0x")return null;const d=BS({abi:lhe,functionName:"text",data:f[0]});return d===""?null:d}catch(c){if(o)throw c;if(Dee(c,"resolve"))return null;throw c}}async function pPt(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:a,strict:o,universalResolverAddress:s}){const l=await aa(t,hPt,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:s,gatewayUrls:a,strict:o});if(!l)return null;try{return await fPt(t,{record:l,gatewayUrls:n})}catch{return null}}async function gPt(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:a,universalResolverAddress:o}){let s=o;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=G8({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:s,abi:L7t,functionName:"reverse",args:[f2(Nee(l))],blockNumber:r,blockTag:n},u=aa(t,p2,"readContract"),[f,d]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==d.toLowerCase()?null:f}catch(c){if(a)throw c;if(Dee(c,"reverse"))return null;throw c}}const vPt=new Map,mPt=new Map;function yPt(t){const e=(i,a)=>({clear:()=>a.delete(i),get:()=>a.get(i),set:o=>a.set(i,o)}),r=e(t,vPt),n=e(t,mPt);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function wPt(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=yPt(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function xPt(t,{cacheTime:e=t.cacheTime}={}){const r=await wPt(()=>t.request({method:"eth_blockNumber"}),{cacheKey:bPt(t.uid),cacheTime:e});return BigInt(r)}function _Pt(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}async function rEe(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){var u,f,d;const o=n||"latest",s=r!==void 0?Ln(r):void 0;let l=null;if(i?l=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?l=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Ln(a)]},{dedupe:!0}):(s||o)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[s||o,Ln(a)]},{dedupe:!!s})),!l)throw new mTe({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:a});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||STe)(l)}const SPt={"0x0":"reverted","0x1":"success"};function CPt(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>_Pt(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?u2(t.transactionIndex):null,status:t.status?SPt[t.status]:null,type:t.type?_Te[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}async function phe(t,{hash:e}){var i,a,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new yTe({hash:e});return(((o=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||CPt)(r)}async function APt(t,e){var v;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:a,multicallAddress:o,stateOverride:s}=e,l=e.contracts,c=n??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=o;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=G8({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let d=0,h=0;for(let y=0;y0&&h>c&&f[d].length>0&&(d++,h=(A.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:A,target:b}]}catch(A){const S=rE(A,{abi:m,address:b,args:w,docsPath:"/docs/contract/multicall",functionName:C});if(!r)throw S;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:b}]}}const p=await Promise.allSettled(f.map(y=>aa(t,p2,"readContract")({abi:$Y,address:u,args:[y],blockNumber:i,blockTag:a,functionName:"aggregate3",stateOverride:s}))),g=[];for(let y=0;yFz.get(t)||[],a=()=>{const u=i();Fz.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=ghe.get(t);i().length===1&&u&&u(),a()},s=i();if(Fz.set(t,[...s,{id:n,fns:e}]),s&&s.length>0)return o;const l={};for(const u in e)l[u]=(...f)=>{var h,p;const d=i();if(d.length!==0)for(const g of d)(p=(h=g.fns)[u])==null||p.call(h,...f)};const c=r(l);return typeof c=="function"&&ghe.set(t,c),o}async function $N(t){return new Promise(e=>setTimeout(e,t))}function EPt(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const a=()=>i=!1;return(async()=>{let s;e&&(s=await t({unpoll:a}));const l=await(r==null?void 0:r(s))??n;await $N(l);const c=async()=>{i&&(await t({unpoll:a}),await $N(n),c())};c()})(),a}function IPt(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:a,pollingInterval:o=t.pollingInterval}){const s=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let l;return s?(()=>{const f=ah(["watchBlockNumber",t.uid,e,r,o]);return VY(f,{onBlockNumber:n,onError:i},d=>EPt(async()=>{var h;try{const p=await aa(t,xPt,"getBlockNumber")({cacheTime:0});if(l){if(p===l)return;if(p-l>1&&r)for(let g=l+1n;gl)&&(d.onBlockNumber(p,l),l=p)}catch(p){(h=d.onError)==null||h.call(d,p)}},{emitOnBegin:e,interval:o}))})():(()=>{const f=ah(["watchBlockNumber",t.uid,e,r]);return VY(f,{onBlockNumber:n,onError:i},d=>{let h=!0,p=()=>h=!1;return(async()=>{try{const g=(()=>{if(t.transport.type==="fallback"){const y=t.transport.transports.find(m=>m.config.type==="webSocket");return y?y.value:t.transport}return t.transport})(),{unsubscribe:v}=await g.subscribe({params:["newHeads"],onData(y){var b;if(!h)return;const m=k5((b=y.result)==null?void 0:b.number);d.onBlockNumber(m,l),l=m},onError(y){var m;(m=d.onError)==null||m.call(d,y)}});p=v,h||p()}catch(g){i==null||i(g)}})(),()=>p()})})()}const _7=new dee(8192);function kPt(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(_7.get(r))return _7.get(r);const n=t().finally(()=>_7.delete(r));return _7.set(r,n),n}function BN(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,a)=>{const o=async({count:s=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:s,error:c}):e;u&&await $N(u),o({count:s+1})};try{const c=await t();i(c)}catch(c){if(s{const{dedupe:i=!1,retryDelay:a=150,retryCount:o=3,uid:s}={...e,...n},l=i?z1(R$(`${s}.${ah(r)}`)):void 0;return kPt(()=>BN(async()=>{try{return await t(r)}catch(c){const u=c;switch(u.code){case zT.code:throw new zT(u);case HT.code:throw new HT(u);case VT.code:throw new VT(u,{method:r.method});case GT.code:throw new GT(u);case h2.code:throw new h2(u);case WT.code:throw new WT(u);case qT.code:throw new qT(u);case v1.code:throw new v1(u);case R5.code:throw new R5(u);case YT.code:throw new YT(u,{method:r.method});case M5.code:throw new M5(u);case KT.code:throw new KT(u);case ga.code:throw new ga(u);case ZT.code:throw new ZT(u);case QT.code:throw new QT(u);case XT.code:throw new XT(u);case JT.code:throw new JT(u);case Fc.code:throw new Fc(u);case 5e3:throw new ga(u);default:throw c instanceof kt?c:new n7t(u)}}},{delay:({count:c,error:u})=>{var f;if(u&&u instanceof ZA){const d=(f=u==null?void 0:u.headers)==null?void 0:f.get("Retry-After");if(d!=null&&d.match(/\d/))return Number.parseInt(d)*1e3}return~~(1<RPt(c)}),{enabled:i,id:l})}}function RPt(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===M5.code||t.code===h2.code:t instanceof ZA&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function MPt(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function nEe(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,a)=>{(async()=>{let o;try{const s=new AbortController;r>0&&(o=setTimeout(()=>{n?s.abort():a(e)},r)),i(await t({signal:(s==null?void 0:s.signal)||null}))}catch(s){(s==null?void 0:s.name)==="AbortError"&&a(e),a(s)}finally{clearTimeout(o)}})()})}function DPt(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const vhe=DPt();function NPt(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:a=e.onResponse,timeout:o=e.timeout??1e4}=r,s={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:c,signal:u}=s;try{const d=await nEe(async({signal:p})=>{const g={...s,body:Array.isArray(n)?ah(n.map(m=>({jsonrpc:"2.0",id:m.id??vhe.take(),...m}))):ah({jsonrpc:"2.0",id:n.id??vhe.take(),...n}),headers:{"Content-Type":"application/json",...l},method:c||"POST",signal:u||(o>0?p:null)},v=new Request(t,g);return i&&await i(v),await fetch(t,g)},{errorInstance:new rhe({body:n,url:t}),timeout:o,signal:!0});a&&await a(d);let h;if((f=d.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))h=await d.json();else{h=await d.text();try{h=JSON.parse(h||"{}")}catch(p){if(d.ok)throw p;h={error:h}}}if(!d.ok)throw new ZA({body:n,details:ah(h.error)||d.statusText,headers:d.headers,status:d.status,url:t});return h}catch(d){throw d instanceof ZA||d instanceof rhe?d:new ZA({body:n,cause:d,url:t})}}}}class OPt extends kt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function LPt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new OPt({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[a,o,s]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${o}.${s}`);l>9?n=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):n=`${a}${l}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}async function $Pt(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:a=6,retryDelay:o=({count:l})=>~~(1<{s&&setTimeout(()=>p(new e7t({hash:r})),s);const g=VY(l,{onReplaced:n,resolve:h,reject:p},v=>{const y=aa(t,IPt,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(m){const b=C=>{y(),C(),g()};let w=m;if(!d)try{if(f){if(e>1&&(!f.blockNumber||w-f.blockNumber+1nv.resolve(f));return}if(c||(d=!0,await BN(async()=>{c=await aa(t,rEe,"getTransaction")({hash:r}),c.blockNumber&&(w=c.blockNumber)},{delay:o,retryCount:a}),d=!1),f=await aa(t,phe,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||w-f.blockNumber+1nv.resolve(f))}catch(C){if(C instanceof mTe||C instanceof yTe){if(!c){d=!1;return}try{u=c,d=!0;const A=await BN(()=>aa(t,eE,"getBlock")({blockNumber:w,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:D})=>D instanceof xTe});d=!1;const S=A.transactions.find(({from:D,nonce:L})=>D===u.from&&L===u.nonce);if(!S||(f=await aa(t,phe,"getTransactionReceipt")({hash:S.hash}),e>1&&(!f.blockNumber||w-f.blockNumber+1n{var D;(D=v.onReplaced)==null||D.call(v,{reason:I,replacedTransaction:u,transaction:S,transactionReceipt:f}),v.resolve(f)})}catch(A){b(()=>v.reject(A))}}else b(()=>v.reject(C))}}})})})}async function BPt(t,{account:e=t.account,message:r}){if(!e)throw new yee({docsPath:"/docs/actions/wallet/signMessage"});const n=Mh(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?R$(r):r.raw instanceof Uint8Array?f2(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function FPt(t,e){const{abi:r,address:n,args:i,dataSuffix:a,functionName:o,...s}=e,l=s.account?Mh(s.account):t.account,c=ox({abi:r,args:i,functionName:o});try{const{data:u}=await aa(t,Oee,"call")({batch:!1,data:`${c}${a?a.replace("0x",""):""}`,to:n,...s,account:l}),f=BS({abi:r,args:i,functionName:o,data:u||"0x"}),d=r.filter(h=>"name"in h&&h.name===e.functionName);return{result:f,request:{abi:d,address:n,args:i,dataSuffix:a,functionName:o,...s,account:l}}}catch(u){throw rE(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:l==null?void 0:l.address})}}async function jPt(t,e){const{abi:r,account:n=t.account,address:i,args:a,dataSuffix:o,functionName:s,...l}=e;if(!n)throw new yee({docsPath:"/docs/contract/writeContract"});const c=Mh(n),u=ox({abi:r,args:a,functionName:s});try{return await aa(t,MTe,"sendTransaction")({data:`${u}${o?o.replace("0x",""):""}`,to:i,account:c,...l})}catch(f){throw rE(f,{abi:r,address:i,args:a,docsPath:"/docs/contract/writeContract",functionName:s,sender:c.address})}}function cl(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:a=>e(t,a)}const JR="2.13.8",UPt=()=>`@wagmi/core@${JR}`;var iEe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},FN,aEe;let Cv=class GY extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return UPt()}constructor(e,r={}){var a;super(),FN.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=r.cause instanceof GY?r.cause.details:(a=r.cause)!=null&&a.message?r.cause.message:r.details,i=r.cause instanceof GY&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` -`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return iEe(this,FN,"m",aEe).call(this,this,e)}};FN=new WeakSet,aEe=function t(e,r){return r!=null&&r(e)?e:e.cause?iEe(this,FN,"m",t).call(this,e.cause,r):e};class g2 extends Cv{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class zPt extends Cv{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class oEe extends Cv{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class HPt extends Cv{constructor({address:e,connector:r}){super(`Account "${e}" not found for connector "${r.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class VPt extends Cv{constructor({connectionChainId:e,connectorChainId:r}){super(`The current chain of the connector (id: ${r}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class GPt extends Cv{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function WY(t,e){var n;let r;if(typeof e.connector=="function"?r=t._internal.connectors.setup(e.connector):r=e.connector,r.uid===t.state.current)throw new zPt;try{t.setState(o=>({...o,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const i=await r.connect({chainId:e.chainId}),a=i.accounts;return r.emitter.off("connect",t._internal.events.connect),r.emitter.on("change",t._internal.events.change),r.emitter.on("disconnect",t._internal.events.disconnect),await((n=t.storage)==null?void 0:n.setItem("recentConnectorId",r.id)),t.setState(o=>({...o,connections:new Map(o.connections).set(r.uid,{accounts:a,chainId:i.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:a,chainId:i.chainId}}catch(i){throw t.setState(a=>({...a,status:a.current?"connected":"disconnected"})),i}}const qY=256;let S7=qY,C7;function sEe(t=11){if(!C7||S7+t>qY*2){C7="",S7=0;for(let e=0;e{const m=y(v);for(const w in p)delete m[w];const b={...v,...m};return Object.assign(b,{extend:g(b)})}}return Object.assign(p,{extend:g(p)})}function Bee({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:a,type:o},s){const l=sEe();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:a,type:o},request:PPt(r,{retryCount:n,retryDelay:i,uid:l}),value:s}}function WPt(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:a})=>Bee({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??a,retryDelay:i,type:"custom"})}function qPt(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:a,retryDelay:o}=e;return({chain:s,pollingInterval:l=4e3,timeout:c,...u})=>{let f=t,d=()=>{};const h=Bee({key:r,name:n,async request({method:p,params:g}){const v=async(y=0)=>{const m=f[y]({...u,chain:s,retryCount:0,timeout:c});try{const b=await m.request({method:p,params:g});return d({method:p,params:g,response:b,transport:m,status:"success"}),b}catch(b){if(d({error:b,method:p,params:g,transport:m,status:"error"}),YPt(b)||y===f.length-1)throw b;return v(y+1)}};return v()},retryCount:a,retryDelay:o,type:"fallback"},{onResponse:p=>d=p,transports:f.map(p=>p({chain:s,retryCount:0}))});if(i){const p=typeof i=="object"?i:{};KPt({chain:s,interval:p.interval??l,onTransports:g=>f=g,sampleCount:p.sampleCount,timeout:p.timeout,transports:f,weights:p.weights})}return h}}function YPt(t){return"code"in t&&typeof t.code=="number"&&(t.code===R5.code||t.code===ga.code||t.code===5e3)}function KPt({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:a,weights:o={}}){const{stability:s=.7,latency:l=.3}=o,c=[],u=async()=>{const f=await Promise.all(a.map(async p=>{const g=p({chain:t,retryCount:0,timeout:i}),v=Date.now();let y,m;try{await g.request({method:"net_listening"}),m=1}catch{m=0}finally{y=Date.now()}return{latency:y-v,success:m}}));c.push(f),c.length>n&&c.shift();const d=Math.max(...c.map(p=>Math.max(...p.map(({latency:g})=>g)))),h=a.map((p,g)=>{const v=c.map(C=>C[g].latency),m=1-v.reduce((C,A)=>C+A,0)/v.length/d,b=c.map(C=>C[g].success),w=b.reduce((C,A)=>C+A,0)/b.length;return w===0?[0,g]:[l*m+s*w,g]}).sort((p,g)=>g[0]-p[0]);r(h.map(([,p])=>a[p])),await $N(e),u()};u()}class ZPt extends kt{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function jz(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:a="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:s,retryDelay:l}=e;return({chain:c,retryCount:u,timeout:f})=>{const{batchSize:d=1e3,wait:h=0}=typeof r=="object"?r:{},p=e.retryCount??u,g=f??e.timeout??1e4,v=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!v)throw new ZPt;const y=NPt(v,{fetchOptions:n,onRequest:o,onResponse:s,timeout:g});return Bee({key:i,name:a,async request({method:m,params:b}){const w={method:m,params:b},{schedule:C}=JTe({id:v,wait:h,shouldSplitBatch(D){return D.length>d},fn:D=>y.request({body:D}),sort:(D,L)=>D.id-L.id}),A=async D=>r?C(D):[await y.request({body:D})],[{error:S,result:I}]=await A(w);if(S)throw new wTe({body:w,error:S,url:v});return I},retryCount:p,retryDelay:l,timeout:g,type:"http"},{fetchOptions:n,url:v})}}async function W8(t,e={}){let r;if(e.connector){const{connector:c}=e;if(t.state.status==="reconnecting"&&!c.getAccounts&&!c.getChainId)throw new GPt({connector:c});const[u,f]=await Promise.all([c.getAccounts(),c.getChainId()]);r={accounts:u,chainId:f,connector:c}}else r=t.state.connections.get(t.state.current);if(!r)throw new oEe;const n=e.chainId??r.chainId,i=await r.connector.getChainId();if(i!==r.chainId)throw new VPt({connectionChainId:r.chainId,connectorChainId:i});const a=r.connector;if(a.getClient)return a.getClient({chainId:n});const o=Mh(e.account??r.accounts[0]);if(o.address=Cc(o.address),e.account&&!r.accounts.some(c=>c.toLowerCase()===o.address.toLowerCase()))throw new HPt({address:o.address,connector:a});const s=t.chains.find(c=>c.id===n),l=await r.connector.getProvider({chainId:n});return lEe({account:o,chain:s,name:"Connector Client",transport:c=>WPt(l)({...c,retryCount:0})})}async function QPt(t,e={}){var i,a;let r;if(e.connector)r=e.connector;else{const{connections:o,current:s}=t.state,l=o.get(s);r=l==null?void 0:l.connector}const n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(o=>{if(n.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const s=n.values().next().value;return{...o,connections:new Map(n),current:s.connector.uid}});{const o=t.state.current;if(!o)return;const s=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!s)return;await((a=t.storage)==null?void 0:a.setItem("recentConnectorId",s.id))}}async function XPt(t,e){const{chainId:r,connector:n,...i}=e;let a;e.account?a=e.account:a=(await W8(t,{account:e.account,chainId:r,connector:n})).account;const o=t.getClient({chainId:r});return cl(o,Tee,"estimateGas")({...i,account:a})}function cEe(t){return typeof t=="number"?t:t==="wei"?0:Math.abs(ZIt[t])}function q8(t){const e=t.state.current,r=t.state.connections.get(e),n=r==null?void 0:r.accounts,i=n==null?void 0:n[0],a=t.chains.find(s=>s.id===(r==null?void 0:r.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:a,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:a,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:a,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}async function JPt(t,e){const{allowFailure:r=!0,chainId:n,contracts:i,...a}=e,o=t.getClient({chainId:n});return cl(o,APt,"multicall")({allowFailure:r,contracts:i,...a})}function eRt(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return cl(i,p2,"readContract")(n)}async function tRt(t,e){var s;const{allowFailure:r=!0,blockNumber:n,blockTag:i,...a}=e,o=e.contracts;try{const l={};for(const[d,h]of o.entries()){const p=h.chainId??t.state.chainId;l[p]||(l[p]=[]),(s=l[p])==null||s.push({contract:h,index:d})}const c=()=>Object.entries(l).map(([d,h])=>JPt(t,{...a,allowFailure:r,blockNumber:n,blockTag:i,chainId:Number.parseInt(d),contracts:h.map(({contract:p})=>p)})),u=(await Promise.all(c())).flat(),f=Object.values(l).flatMap(d=>d.map(({index:h})=>h));return u.reduce((d,h,p)=>(d&&(d[f[p]]=h),d),[])}catch(l){if(l instanceof Ree)throw l;const c=()=>o.map(u=>eRt(t,{...u,blockNumber:n,blockTag:i}));return r?(await Promise.allSettled(c())).map(u=>u.status==="fulfilled"?{result:u.value,status:"success"}:{error:u.reason,result:void 0,status:"failure"}):await Promise.all(c())}}async function rRt(t,e){const{address:r,blockNumber:n,blockTag:i,chainId:a,token:o,unit:s="ether"}=e;if(o)try{return mhe(t,{balanceAddress:r,chainId:a,symbolType:"string",tokenAddress:o})}catch(d){if(d instanceof Ree){const h=await mhe(t,{balanceAddress:r,chainId:a,symbolType:"bytes32",tokenAddress:o}),p=J6e(LS(h.symbol,{dir:"right"}));return{...h,symbol:p}}throw d}const l=t.getClient({chainId:a}),u=await cl(l,TTe,"getBalance")(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),f=t.chains.find(d=>d.id===a)??l.chain;return{decimals:f.nativeCurrency.decimals,formatted:H8(u,cEe(s)),symbol:f.nativeCurrency.symbol,value:u}}async function mhe(t,e){const{balanceAddress:r,chainId:n,symbolType:i,tokenAddress:a,unit:o}=e,s={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:i}]}],address:a},[l,c,u]=await tRt(t,{allowFailure:!1,contracts:[{...s,functionName:"balanceOf",args:[r],chainId:n},{...s,functionName:"decimals",chainId:n},{...s,functionName:"symbol",chainId:n}]}),f=H8(l??"0",cEe(o??c));return{decimals:c,formatted:f,symbol:u,value:l}}function nE(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!nE(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const a=i[n];if(a&&!nE(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}let A7=[];function nRt(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||nE(A7,e)?A7:(A7=e,e)}let Uz=[];function YY(t){const e=t.connectors;return nE(Uz,e)?Uz:(Uz=e,e)}function iRt(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return cl(i,ePt,"getEnsAddress")(n)}function yhe(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return cl(i,pPt,"getEnsAvatar")(n)}function aRt(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return cl(i,gPt,"getEnsName")(n)}async function oRt(t,e){const{account:r,chainId:n,...i}=e,a=r??q8(t).address,o=t.getClient({chainId:n});return cl(o,Iee,"prepareTransactionRequest")({...i,...a?{account:a}:{}})}let zz=!1;async function KY(t,e={}){var c,u;if(zz)return[];zz=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((c=e.connectors)!=null&&c.length)for(const f of e.connectors){let d;typeof f=="function"?d=t._internal.connectors.setup(f):d=f,r.push(d)}else r.push(...t.connectors);let n;try{n=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const a=Object.keys(i).length>0?[...r].sort((f,d)=>(i[f.id]??10)-(i[d.id]??10)):r;let o=!1;const s=[],l=[];for(const f of a){const d=await f.getProvider().catch(()=>{});if(!d||l.some(g=>g===d)||!await f.isAuthorized())continue;const p=await f.connect({isReconnecting:!0}).catch(()=>null);p&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(g=>{const v=new Map(o?g.connections:new Map).set(f.uid,{accounts:p.accounts,chainId:p.chainId,connector:f});return{...g,current:o?g.current:f.uid,connections:v}}),s.push({accounts:p.accounts,chainId:p.chainId,connector:f}),l.push(d),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),zz=!1,s}async function sRt(t,e){const{account:r,chainId:n,connector:i,gas:a,...o}=e;let s;typeof r=="object"&&r.type==="local"?s=t.getClient({chainId:n}):s=await W8(t,{account:r,chainId:n,connector:i});const{connector:l}=q8(t),c=await(async()=>{var d;if(!(!("data"in e)||!e.data)&&!((d=i??l)!=null&&d.supportsSimulation)&&a!==null)return a===void 0?cl(s,Tee,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):a})();return await cl(s,MTe,"sendTransaction")({...o,...r?{account:r}:{},gas:c,chain:n?{id:n}:null})}async function lRt(t,e){const{account:r,connector:n,...i}=e;let a;return typeof r=="object"&&r.type==="local"?a=t.getClient():a=await W8(t,{account:r,connector:n}),cl(a,BPt,"signMessage")({...i,...r?{account:r}:{}})}async function cRt(t,e){const{abi:r,chainId:n,connector:i,...a}=e;let o;e.account?o=e.account:o=(await W8(t,{chainId:n,connector:i})).account;const s=t.getClient({chainId:n}),l=cl(s,FPt,"simulateContract"),{result:c,request:u}=await l({...a,abi:r,account:o});return{chainId:s.chain.id,result:c,request:{__mode:"prepared",...u,chainId:n}}}async function uRt(t,e){var i;const{connector:r}=e,n=t.state.connections.get(r.uid);if(!n)throw new oEe;return await((i=t.storage)==null?void 0:i.setItem("recentConnectorId",r.id)),t.setState(a=>({...a,current:r.uid})),{accounts:n.accounts,chainId:n.chainId}}class mm extends Cv{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class fRt extends Cv{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function dRt(t,e){var o;const{addEthereumChainParameter:r,chainId:n}=e,i=t.state.connections.get(((o=e.connector)==null?void 0:o.uid)??t.state.current);if(i){const s=i.connector;if(!s.switchChain)throw new fRt({connector:s});return await s.switchChain({addEthereumChainParameter:r,chainId:n})}const a=t.chains.find(s=>s.id===n);if(!a)throw new g2;return t.setState(s=>({...s,chainId:n})),a}function hRt(t,e){const{onChange:r}=e;return t.subscribe(()=>q8(t),r,{equalityFn(n,i){const{connector:a,...o}=n,{connector:s,...l}=i;return nE(o,l)&&(a==null?void 0:a.id)===(s==null?void 0:s.id)&&(a==null?void 0:a.uid)===(s==null?void 0:s.uid)}})}function uEe(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}async function pRt(t,e){const{chainId:r,timeout:n=0,...i}=e,a=t.getClient({chainId:r}),s=await cl(a,$Pt,"waitForTransactionReceipt")({...i,timeout:n});if(s.status==="reverted"){const c=await cl(a,rEe,"getTransaction")({hash:s.transactionHash}),f=await cl(a,Oee,"call")({...c,gasPrice:c.type!=="eip1559"?c.gasPrice:void 0,maxFeePerGas:c.type==="eip1559"?c.maxFeePerGas:void 0,maxPriorityFeePerGas:c.type==="eip1559"?c.maxPriorityFeePerGas:void 0}),d=f!=null&&f.data?J6e(`0x${f.data.substring(138)}`):"unknown reason";throw new Error(d)}return{...s,chainId:a.chain.id}}async function gRt(t,e){const{account:r,chainId:n,connector:i,__mode:a,...o}=e;let s;typeof r=="object"&&r.type==="local"?s=t.getClient({chainId:n}):s=await W8(t,{account:r,chainId:n,connector:i});const{connector:l}=q8(t);let c;if(a==="prepared"||l!=null&&l.supportsSimulation)c=o;else{const{request:d}=await cRt(t,{...o,account:r,chainId:n});c=d}return await cl(s,jPt,"writeContract")({...c,...r?{account:r}:{},chain:n?{id:n}:null})}const vRt=/(rabby|trustwallet)/,mRt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:eM(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return eM(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const r=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const n of r)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,r;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(r=t.phantom)==null?void 0:r.ethereum:eM(t,"isPhantom")}}};B$.type="injected";function B$(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:r}=t;function n(){const l=t.target;if(typeof l=="function"){const c=l();if(c)return c}return typeof l=="object"?l:typeof l=="string"?{...mRt[l]??{id:l,name:`${l[0].toUpperCase()}${l.slice(1)}`,provider:`is${l[0].toUpperCase()}${l.slice(1)}`}}:{id:"injected",name:"Injected",provider(c){return c==null?void 0:c.ethereum}}}let i,a,o,s;return l=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},get supportsSimulation(){return vRt.test(this.id.toLowerCase())},type:B$.type,async setup(){const c=await this.getProvider();c!=null&&c.on&&t.target&&(o||(o=this.onConnect.bind(this),c.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),c.on("accountsChanged",i)))},async connect({chainId:c,isReconnecting:u}={}){var h,p,g,v,y,m;const f=await this.getProvider();if(!f)throw new mm;let d=[];if(u)d=await this.getAccounts().catch(()=>[]);else if(e)try{d=(v=(g=(p=(h=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:h.caveats)==null?void 0:p[0])==null?void 0:g.value)==null?void 0:v.map(w=>Cc(w)),d.length>0&&(d=await this.getAccounts())}catch(b){const w=b;if(w.code===ga.code)throw new ga(w);if(w.code===v1.code)throw w}try{!(d!=null&&d.length)&&!u&&(d=(await f.request({method:"eth_requestAccounts"})).map(C=>Cc(C))),o&&(f.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),f.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),s||(s=this.onDisconnect.bind(this),f.on("disconnect",s));let b=await this.getChainId();if(c&&b!==c){const w=await this.switchChain({chainId:c}).catch(C=>{if(C.code===ga.code)throw C;return{id:b}});b=(w==null?void 0:w.id)??b}return e&&await((y=l.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),t.target||await((m=l.storage)==null?void 0:m.setItem("injected.connected",!0)),{accounts:d,chainId:b}}catch(b){const w=b;throw w.code===ga.code?new ga(w):w.code===v1.code?new v1(w):w}},async disconnect(){var u,f;const c=await this.getProvider();if(!c)throw new mm;a&&(c.removeListener("chainChanged",a),a=void 0),s&&(c.removeListener("disconnect",s),s=void 0),o||(o=this.onConnect.bind(this),c.on("connect",o));try{await nEe(()=>c.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((u=l.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((f=l.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const c=await this.getProvider();if(!c)throw new mm;return(await c.request({method:"eth_accounts"})).map(f=>Cc(f))},async getChainId(){const c=await this.getProvider();if(!c)throw new mm;const u=await c.request({method:"eth_chainId"});return Number(u)},async getProvider(){if(typeof window>"u")return;let c;const u=n();return typeof u.provider=="function"?c=u.provider(window):typeof u.provider=="string"?c=eM(window,u.provider):c=u.provider,c&&!c.removeListener&&("off"in c&&typeof c.off=="function"?c.removeListener=c.off:c.removeListener=()=>{}),c},async isAuthorized(){var c,u;try{if(e&&await((c=l.storage)==null?void 0:c.getItem(`${this.id}.disconnected`))||!t.target&&!await((u=l.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(r!==void 0&&r!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),g=typeof r=="number"?r:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(y=>window.addEventListener("ethereum#initialized",()=>y(p()),{once:!0}))]:[],new Promise(y=>setTimeout(()=>y(p()),g))]))return!0}throw new mm}return!!(await BN(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:u}){var h,p,g,v;const f=await this.getProvider();if(!f)throw new mm;const d=l.chains.find(y=>y.id===u);if(!d)throw new Fc(new g2);try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:Ln(u)}]}).then(async()=>{await this.getChainId()===u&&l.emitter.emit("change",{chainId:u})}),new Promise(y=>{const m=b=>{"chainId"in b&&b.chainId===u&&(l.emitter.off("change",m),y())};l.emitter.on("change",m)})]),d}catch(y){const m=y;if(m.code===4902||((p=(h=m==null?void 0:m.data)==null?void 0:h.originalError)==null?void 0:p.code)===4902)try{const{default:b,...w}=d.blockExplorers??{};let C;c!=null&&c.blockExplorerUrls?C=c.blockExplorerUrls:b&&(C=[b.url,...Object.values(w).map(D=>D.url)]);let A;(g=c==null?void 0:c.rpcUrls)!=null&&g.length?A=c.rpcUrls:A=[((v=d.rpcUrls.default)==null?void 0:v.http[0])??""];const S={blockExplorerUrls:C,chainId:Ln(u),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:A};if(await f.request({method:"wallet_addEthereumChain",params:[S]}),await this.getChainId()!==u)throw new ga(new Error("User rejected switch after adding network."));return d}catch(b){throw new ga(b)}throw m.code===ga.code?new ga(m):new Fc(m)}},async onAccountsChanged(c){var u;if(c.length===0)this.onDisconnect();else if(l.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),e&&await((u=l.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else l.emitter.emit("change",{accounts:c.map(f=>Cc(f))})},onChainChanged(c){const u=Number(c);l.emitter.emit("change",{chainId:u})},async onConnect(c){const u=await this.getAccounts();if(u.length===0)return;const f=Number(c.chainId);l.emitter.emit("connect",{accounts:u,chainId:f});const d=await this.getProvider();d&&(o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),d.on("chainChanged",a)),s||(s=this.onDisconnect.bind(this),d.on("disconnect",s)))},async onDisconnect(c){const u=await this.getProvider();c&&c.code===1013&&u&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),u&&(a&&(u.removeListener("chainChanged",a),a=void 0),s&&(u.removeListener("disconnect",s),s=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o))))}})}function eM(t,e){function r(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const n=t.ethereum;if(n!=null&&n.providers)return n.providers.find(i=>r(i));if(n&&r(n))return n}function yRt(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function wRt(){const t=new Set;let e=[];const r=()=>yRt(i=>{e.some(({info:a})=>a.uuid===i.info.uuid)||(e=[...e,i],t.forEach(a=>a(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(a=>a.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:a}={}){return t.add(i),a&&i(e,{added:e}),()=>t.delete(i)}}}const bRt={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ENV:"test",VITE_APP_LOCAL_FAUCET_HOSTNAME:"http://localhost:42000",VITE_APP_LOCAL_HOSTNAME:"localhost:8612",VITE_APP_PROD_FIGURE_WALLET_URL:"https://www.figure.com/dashboard",VITE_APP_PROD_GA4_ID:"G-GXQC2ZQW28",VITE_APP_PROD_GTM_ID:"GTM-5QCZCBS",VITE_APP_PROD_PROVENANCE_WALLET_URL:"https://wallet.provenance.io",VITE_APP_PROD_SERVER_HOSTNAME:"service-explorer.provenance.io",VITE_APP_TEST_FAUCET_HOSTNAME:"https://test.provenance.io/blockchain/faucet/external",VITE_APP_TEST_FIGURE_WALLET_URL:"https://test.figure.com/dashboard",VITE_APP_TEST_PROVENANCE_WALLET_URL:"https://wallet.test.provenance.io",VITE_APP_TEST_SERVER_HOSTNAME:"service-explorer.test.provenance.io"},xRt=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,s,l)=>{let c=o;if(s){const u=(l==null?void 0:l.equalityFn)||Object.is;let f=o(n.getState());c=d=>{const h=o(d);if(!u(f,h)){const p=f;s(f=h,p)}},l!=null&&l.fireImmediately&&s(f,f)}return i(c)},t(e,r,n)},_Rt=xRt;function SRt(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var a;const o=l=>l===null?null:JSON.parse(l,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(o):o(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const iE=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return iE(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return iE(n)(r)}}}},CRt=(t,e)=>(r,n,i)=>{let a={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...e},o=!1;const s=new Set,l=new Set;let c;try{c=a.getStorage()}catch{}if(!c)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=iE(a.serialize),f=()=>{const v=a.partialize({...n()});let y;const m=u({state:v,version:a.version}).then(b=>c.setItem(a.name,b)).catch(b=>{y=b});if(y)throw y;return m},d=i.setState;i.setState=(v,y)=>{d(v,y),f()};const h=t((...v)=>{r(...v),f()},n,i);let p;const g=()=>{var v;if(!c)return;o=!1,s.forEach(m=>m(n()));const y=((v=a.onRehydrateStorage)==null?void 0:v.call(a,n()))||void 0;return iE(c.getItem.bind(c))(a.name).then(m=>{if(m)return a.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return a.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var b;return p=a.merge(m,(b=n())!=null?b:h),r(p,!0),f()}).then(()=>{y==null||y(p,void 0),o=!0,l.forEach(m=>m(p))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:v=>{a={...a,...v},v.getStorage&&(c=v.getStorage())},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},g(),p||h},ARt=(t,e)=>(r,n,i)=>{let a={storage:SRt(()=>localStorage),partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...e},o=!1;const s=new Set,l=new Set;let c=a.storage;if(!c)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...g)},n,i);const u=()=>{const g=a.partialize({...n()});return c.setItem(a.name,{state:g,version:a.version})},f=i.setState;i.setState=(g,v)=>{f(g,v),u()};const d=t((...g)=>{r(...g),u()},n,i);let h;const p=()=>{var g,v;if(!c)return;o=!1,s.forEach(m=>{var b;return m((b=n())!=null?b:d)});const y=((v=a.onRehydrateStorage)==null?void 0:v.call(a,(g=n())!=null?g:d))||void 0;return iE(c.getItem.bind(c))(a.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==a.version){if(a.migrate)return a.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var b;return h=a.merge(m,(b=n())!=null?b:d),r(h,!0),u()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,l.forEach(m=>m(h))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:g=>{a={...a,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},a.skipHydration||p(),h||d},TRt=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((bRt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),CRt(t,e)):ARt(t,e),ERt=TRt,IRt={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ENV:"test",VITE_APP_LOCAL_FAUCET_HOSTNAME:"http://localhost:42000",VITE_APP_LOCAL_HOSTNAME:"localhost:8612",VITE_APP_PROD_FIGURE_WALLET_URL:"https://www.figure.com/dashboard",VITE_APP_PROD_GA4_ID:"G-GXQC2ZQW28",VITE_APP_PROD_GTM_ID:"GTM-5QCZCBS",VITE_APP_PROD_PROVENANCE_WALLET_URL:"https://wallet.provenance.io",VITE_APP_PROD_SERVER_HOSTNAME:"service-explorer.provenance.io",VITE_APP_TEST_FAUCET_HOSTNAME:"https://test.provenance.io/blockchain/faucet/external",VITE_APP_TEST_FIGURE_WALLET_URL:"https://test.figure.com/dashboard",VITE_APP_TEST_PROVENANCE_WALLET_URL:"https://wallet.test.provenance.io",VITE_APP_TEST_SERVER_HOSTNAME:"service-explorer.test.provenance.io"},whe=t=>{let e;const r=new Set,n=(l,c)=>{const u=typeof l=="function"?l(e):l;if(!Object.is(u,e)){const f=e;e=c??typeof u!="object"?u:Object.assign({},e,u),r.forEach(d=>d(e,f))}},i=()=>e,s={setState:n,getState:i,subscribe:l=>(r.add(l),()=>r.delete(l)),destroy:()=>{(IRt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,s),s},Hz=t=>t?whe(t):whe;var fEe={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function a(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=r?r+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},s.prototype.listeners=function(c){var u=r?r+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d{let i=n;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(r,i))??i})}function bhe(t,e){return t.slice(0,e).join(".")||"."}function xhe(t,e){const{length:r}=t;for(let n=0;n{let o=a;return typeof o=="bigint"&&(o={__type:"bigint",value:a.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(a.entries())}),(e==null?void 0:e(i,o))??o},n),r??void 0)}function LRt(t){const{deserialize:e=DRt,key:r="wagmi",serialize:n=ORt,storage:i=dEe}=t;function a(o){return o instanceof Promise?o.then(s=>s).catch(()=>null):o}return{...i,key:r,async getItem(o,s){const l=i.getItem(`${r}.${o}`),c=await a(l);return c?e(c)??null:s??null},async setItem(o,s){const l=`${r}.${o}`;s===null?await a(i.removeItem(l)):await a(i.setItem(l,n(s)))},async removeItem(o){await a(i.removeItem(`${r}.${o}`))}}}const dEe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},ZY=256;let T7=ZY,E7;function $Rt(t=11){if(!E7||T7+t>ZY*2){E7="",T7=0;for(let e=0;ea.chains),l=Hz(()=>[...a.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(u))??[]].map(c));function c(C){var I;const A=MRt($Rt()),S={...C({emitter:A,chains:s.getState(),storage:r,transports:a.transports}),emitter:A,uid:A.uid};return A.on("connect",b),(I=S.setup)==null||I.call(S),S}function u(C){const{info:A}=C,S=C.provider;return B$({target:{...A,id:A.rdns,provider:S}})}const f=new Map;function d(C={}){const A=C.chainId??v.getState().chainId,S=s.getState().find(D=>D.id===A);if(C.chainId&&!S)throw new g2;{const D=f.get(v.getState().chainId);if(D&&!S)return D;if(!S)throw new g2}{const D=f.get(A);if(D)return D}let I;if(a.client)I=a.client({chain:S});else{const D=S.id,L=s.getState().map(x=>x.id),O={},P=Object.entries(a);for(const[x,T]of P)if(!(x==="chains"||x==="client"||x==="connectors"||x==="transports"))if(typeof T=="object")if(D in T)O[x]=T[D];else{if(L.some(N=>N in T))continue;O[x]=T}else O[x]=T;I=lEe({...O,chain:S,batch:O.batch??{multicall:!0},transport:x=>a.transports[D]({...x,connectors:l})})}return f.set(A,I),I}function h(){return{chainId:s.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const g="0.0.0-canary-";JR.startsWith(g)?p=Number.parseInt(JR.replace(g,"")):p=Number.parseInt(JR.split(".")[0]??"0");const v=Hz(_Rt(r?ERt(h,{migrate(C,A){if(A===p)return C;const S=h(),I=y(C,S.chainId);return{...S,chainId:I}},name:"store",partialize(C){return{connections:{__type:"Map",value:Array.from(C.connections.entries()).map(([A,S])=>{const{id:I,name:D,type:L,uid:O}=S.connector;return[A,{...S,connector:{id:I,name:D,type:L,uid:O}}]})},chainId:C.chainId,current:C.current}},merge(C,A){typeof C=="object"&&C&&"status"in C&&delete C.status;const S=y(C,A.chainId);return{...A,...C,chainId:S}},skipHydration:i,storage:r,version:p}):h));function y(C,A){return C&&typeof C=="object"&&"chainId"in C&&typeof C.chainId=="number"&&s.getState().some(S=>S.id===C.chainId)?C.chainId:A}n&&v.subscribe(({connections:C,current:A})=>{var S;return A?(S=C.get(A))==null?void 0:S.chainId:void 0},C=>{if(s.getState().some(S=>S.id===C))return v.setState(S=>({...S,chainId:C??S.chainId}))}),o==null||o.subscribe(C=>{const A=new Map;for(const I of l.getState())A.set(I.id,!0);const S=[];for(const I of C){const D=c(u(I));A.has(D.id)||S.push(D)}r&&!v.persist.hasHydrated()||l.setState(I=>[...I,...S],!0)});function m(C){v.setState(A=>{const S=A.connections.get(C.uid);return S?{...A,connections:new Map(A.connections).set(C.uid,{accounts:C.accounts??S.accounts,chainId:C.chainId??S.chainId,connector:S.connector})}:A})}function b(C){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(A=>{const S=l.getState().find(I=>I.uid===C.uid);return S?(S.emitter.listenerCount("connect")&&S.emitter.off("connect",m),S.emitter.listenerCount("change")||S.emitter.on("change",m),S.emitter.listenerCount("disconnect")||S.emitter.on("disconnect",w),{...A,connections:new Map(A.connections).set(C.uid,{accounts:C.accounts,chainId:C.chainId,connector:S}),current:C.uid,status:"connected"}):A})}function w(C){v.setState(A=>{const S=A.connections.get(C.uid);if(S){const D=S.connector;D.emitter.listenerCount("change")&&S.connector.emitter.off("change",m),D.emitter.listenerCount("disconnect")&&S.connector.emitter.off("disconnect",w),D.emitter.listenerCount("connect")||S.connector.emitter.on("connect",b)}if(A.connections.delete(C.uid),A.connections.size===0)return{...A,connections:new Map,current:null,status:"disconnected"};const I=A.connections.values().next().value;return{...A,connections:new Map(A.connections),current:I.connector.uid}})}return{get chains(){return s.getState()},get connectors(){return l.getState()},storage:r,getClient:d,get state(){return v.getState()},setState(C){let A;typeof C=="function"?A=C(v.getState()):A=C;const S=h();typeof A!="object"&&(A=S),Object.keys(S).some(D=>!(D in A))&&(A=S),v.setState(A,!0)},subscribe(C,A,S){return v.subscribe(C,A,S?{...S,fireImmediately:S.emitImmediately}:void 0)},_internal:{mipd:o,store:v,ssr:!!i,syncConnectedChain:n,transports:a.transports,chains:{setState(C){const A=typeof C=="function"?C(s.getState()):C;if(A.length!==0)return s.setState(A,!0)},subscribe(C){return s.subscribe(C)}},connectors:{providerDetailToConnector:u,setup:c,setState(C){return l.setState(typeof C=="function"?C(l.getState()):C,!0)},subscribe(C){return l.subscribe(C)}},events:{change:m,connect:b,disconnect:w}}}}function FRt(t,e){const{initialState:r,reconnectOnMount:n}=e;return r&&!t._internal.store.persist.hasHydrated()&&t.setState({...r,chainId:t.chains.some(i=>i.id===r.chainId)?r.chainId:t.chains[0].id,connections:n?r.connections:new Map,status:n?"reconnecting":"disconnected"}),{async onMount(){var i;if(t._internal.ssr){await t._internal.store.persist.rehydrate();const a=(i=t._internal.mipd)==null?void 0:i.getProviders().map(t._internal.connectors.providerDetailToConnector).map(t._internal.connectors.setup);t._internal.connectors.setState(o=>[...o,...a??[]])}n?KY(t):t.storage&&t.setState(a=>({...a,connections:new Map}))}}}function jRt(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:a}=FRt(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||a();const o=Z.useRef(!0);return Z.useEffect(()=>{if(o.current&&r._internal.ssr)return a(),()=>{o.current=!1}},[]),e}const hEe=Z.createContext(void 0);function URt(t){const{children:e,config:r}=t,n={value:r};return Z.createElement(jRt,t,Z.createElement(hEe.Provider,n,e))}const zRt="2.12.16",HRt=()=>`wagmi@${zRt}`;class VRt extends Cv{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return HRt()}}class GRt extends VRt{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function pEe(t={}){const e=t.config??Z.useContext(hEe);if(!e)throw new GRt;return e}var Y8=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},F$=typeof window>"u"||"Deno"in globalThis;function jd(){}function WRt(t,e){return typeof t=="function"?t(e):t}function qRt(t){return typeof t=="number"&&t>=0&&t!==1/0}function YRt(t,e){return Math.max(t+(e||0)-Date.now(),0)}function _he(t,e){return typeof t=="function"?t(e):t}function KRt(t,e){return typeof t=="function"?t(e):t}function She(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=t;if(o){if(n){if(e.queryHash!==Fee(o,e.options))return!1}else if(!aE(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||i&&i!==e.state.fetchStatus||a&&!a(e))}function Che(t,e){const{exact:r,status:n,predicate:i,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(r){if(v2(e.options.mutationKey)!==v2(a))return!1}else if(!aE(e.options.mutationKey,a))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function Fee(t,e){return((e==null?void 0:e.queryKeyHashFn)||v2)(t)}function v2(t){return JSON.stringify(t,(e,r)=>QY(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function aE(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!aE(t[r],e[r])):!1}function gEe(t,e){if(t===e)return t;const r=Ahe(t)&&Ahe(e);if(r||QY(t)&&QY(e)){const n=r?t:Object.keys(t),i=n.length,a=r?e:Object.keys(e),o=a.length,s=r?[]:{};let l=0;for(let c=0;c{setTimeout(e,t)})}function XRt(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?gEe(t,e):e}function JRt(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function eMt(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var vEe=Symbol();function mEe(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===vEe?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var tb,Pm,M3,V2e,tMt=(V2e=class extends Y8{constructor(){super();ni(this,tb);ni(this,Pm);ni(this,M3);un(this,M3,e=>{if(!F$&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){at(this,Pm)||this.setEventListener(at(this,M3))}onUnsubscribe(){var e;this.hasListeners()||((e=at(this,Pm))==null||e.call(this),un(this,Pm,void 0))}setEventListener(e){var r;un(this,M3,e),(r=at(this,Pm))==null||r.call(this),un(this,Pm,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){at(this,tb)!==e&&(un(this,tb,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof at(this,tb)=="boolean"?at(this,tb):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},tb=new WeakMap,Pm=new WeakMap,M3=new WeakMap,V2e),yEe=new tMt,D3,Rm,N3,G2e,rMt=(G2e=class extends Y8{constructor(){super();ni(this,D3,!0);ni(this,Rm);ni(this,N3);un(this,N3,e=>{if(!F$&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){at(this,Rm)||this.setEventListener(at(this,N3))}onUnsubscribe(){var e;this.hasListeners()||((e=at(this,Rm))==null||e.call(this),un(this,Rm,void 0))}setEventListener(e){var r;un(this,N3,e),(r=at(this,Rm))==null||r.call(this),un(this,Rm,e(this.setOnline.bind(this)))}setOnline(e){at(this,D3)!==e&&(un(this,D3,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return at(this,D3)}},D3=new WeakMap,Rm=new WeakMap,N3=new WeakMap,G2e),jN=new rMt;function nMt(){let t,e;const r=new Promise((i,a)=>{t=i,e=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}function iMt(t){return Math.min(1e3*2**t,3e4)}function wEe(t){return(t??"online")==="online"?jN.isOnline():!0}var bEe=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Vz(t){return t instanceof bEe}function xEe(t){let e=!1,r=0,n=!1,i;const a=nMt(),o=g=>{var v;n||(d(new bEe(g)),(v=t.abort)==null||v.call(t))},s=()=>{e=!0},l=()=>{e=!1},c=()=>yEe.isFocused()&&(t.networkMode==="always"||jN.isOnline())&&t.canRun(),u=()=>wEe(t.networkMode)&&t.canRun(),f=g=>{var v;n||(n=!0,(v=t.onSuccess)==null||v.call(t,g),i==null||i(),a.resolve(g))},d=g=>{var v;n||(n=!0,(v=t.onError)==null||v.call(t,g),i==null||i(),a.reject(g))},h=()=>new Promise(g=>{var v;i=y=>{(n||c())&&g(y)},(v=t.onPause)==null||v.call(t)}).then(()=>{var g;i=void 0,n||(g=t.onContinue)==null||g.call(t)}),p=()=>{if(n)return;let g;const v=r===0?t.initialPromise:void 0;try{g=v??t.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(f).catch(y=>{var A;if(n)return;const m=t.retry??(F$?0:3),b=t.retryDelay??iMt,w=typeof b=="function"?b(r,y):b,C=m===!0||typeof m=="number"&&rc()?void 0:h()).then(()=>{e?d(y):p()})})};return{promise:a,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?p():h().then(p),a)}}function aMt(){let t=[],e=0,r=s=>{s()},n=s=>{s()},i=s=>setTimeout(s,0);const a=s=>{e?t.push(s):i(()=>{r(s)})},o=()=>{const s=t;t=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var Ts=aMt(),rb,W2e,_Ee=(W2e=class{constructor(){ni(this,rb)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qRt(this.gcTime)&&un(this,rb,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(F$?1/0:5*60*1e3))}clearGcTimeout(){at(this,rb)&&(clearTimeout(at(this,rb)),un(this,rb,void 0))}},rb=new WeakMap,W2e),O3,L3,bf,el,VE,nb,zd,cg,q2e,oMt=(q2e=class extends _Ee{constructor(e){super();ni(this,zd);ni(this,O3);ni(this,L3);ni(this,bf);ni(this,el);ni(this,VE);ni(this,nb);un(this,nb,!1),un(this,VE,e.defaultOptions),this.setOptions(e.options),this.observers=[],un(this,bf,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,un(this,O3,lMt(this.options)),this.state=e.state??at(this,O3),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=at(this,el))==null?void 0:e.promise}setOptions(e){this.options={...at(this,VE),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&at(this,bf).remove(this)}setData(e,r){const n=XRt(this.state.data,e,this.options);return so(this,zd,cg).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){so(this,zd,cg).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=at(this,el))==null?void 0:n.promise;return(i=at(this,el))==null||i.cancel(e),r?r.then(jd).catch(jd):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(at(this,O3))}isActive(){return this.observers.some(e=>KRt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!YRt(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=at(this,el))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=at(this,el))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),at(this,bf).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(at(this,el)&&(at(this,nb)?at(this,el).cancel({revert:!0}):at(this,el).cancelRetry()),this.scheduleGc()),at(this,bf).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||so(this,zd,cg).call(this,{type:"invalidate"})}fetch(e,r){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(at(this,el))return at(this,el).continueRetry(),at(this,el).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(un(this,nb,!0),n.signal)})},a=()=>{const f=mEe(this.options,r),d={queryKey:this.queryKey,meta:this.meta};return i(d),un(this,nb,!1),this.options.persister?this.options.persister(f,d,this):f(d)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),un(this,L3,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&so(this,zd,cg).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const s=f=>{var d,h,p,g;Vz(f)&&f.silent||so(this,zd,cg).call(this,{type:"error",error:f}),Vz(f)||((h=(d=at(this,bf).config).onError)==null||h.call(d,f,this),(g=(p=at(this,bf).config).onSettled)==null||g.call(p,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return un(this,el,xEe({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var d,h,p,g;if(f===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){s(v);return}(h=(d=at(this,bf).config).onSuccess)==null||h.call(d,f,this),(g=(p=at(this,bf).config).onSettled)==null||g.call(p,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(f,d)=>{so(this,zd,cg).call(this,{type:"failed",failureCount:f,error:d})},onPause:()=>{so(this,zd,cg).call(this,{type:"pause"})},onContinue:()=>{so(this,zd,cg).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),at(this,el).start()}},O3=new WeakMap,L3=new WeakMap,bf=new WeakMap,el=new WeakMap,VE=new WeakMap,nb=new WeakMap,zd=new WeakSet,cg=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...sMt(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Vz(i)&&i.revert&&at(this,L3)?{...at(this,L3),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),Ts.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),at(this,bf).notify({query:this,type:"updated",action:e})})},q2e);function sMt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wEe(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function lMt(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var dp,Y2e,cMt=(Y2e=class extends Y8{constructor(e={}){super();ni(this,dp);this.config=e,un(this,dp,new Map)}build(e,r,n){const i=r.queryKey,a=r.queryHash??Fee(i,r);let o=this.get(a);return o||(o=new oMt({cache:this,queryKey:i,queryHash:a,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){at(this,dp).has(e.queryHash)||(at(this,dp).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=at(this,dp).get(e.queryHash);r&&(e.destroy(),r===e&&at(this,dp).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ts.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return at(this,dp).get(e)}getAll(){return[...at(this,dp).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>She(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>She(e,n)):r}notify(e){Ts.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Ts.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ts.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dp=new WeakMap,Y2e),hp,Rl,ib,pp,lm,K2e,uMt=(K2e=class extends _Ee{constructor(e){super();ni(this,pp);ni(this,hp);ni(this,Rl);ni(this,ib);this.mutationId=e.mutationId,un(this,Rl,e.mutationCache),un(this,hp,[]),this.state=e.state||SEe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){at(this,hp).includes(e)||(at(this,hp).push(e),this.clearGcTimeout(),at(this,Rl).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){un(this,hp,at(this,hp).filter(r=>r!==e)),this.scheduleGc(),at(this,Rl).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){at(this,hp).length||(this.state.status==="pending"?this.scheduleGc():at(this,Rl).remove(this))}continue(){var e;return((e=at(this,ib))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,a,o,s,l,c,u,f,d,h,p,g,v,y,m,b,w,C,A,S;un(this,ib,xEe({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(I,D)=>{so(this,pp,lm).call(this,{type:"failed",failureCount:I,error:D})},onPause:()=>{so(this,pp,lm).call(this,{type:"pause"})},onContinue:()=>{so(this,pp,lm).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>at(this,Rl).canRun(this)}));const r=this.state.status==="pending",n=!at(this,ib).canStart();try{if(!r){so(this,pp,lm).call(this,{type:"pending",variables:e,isPaused:n}),await((a=(i=at(this,Rl).config).onMutate)==null?void 0:a.call(i,e,this));const D=await((s=(o=this.options).onMutate)==null?void 0:s.call(o,e));D!==this.state.context&&so(this,pp,lm).call(this,{type:"pending",context:D,variables:e,isPaused:n})}const I=await at(this,ib).start();return await((c=(l=at(this,Rl).config).onSuccess)==null?void 0:c.call(l,I,e,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,I,e,this.state.context)),await((h=(d=at(this,Rl).config).onSettled)==null?void 0:h.call(d,I,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,I,null,e,this.state.context)),so(this,pp,lm).call(this,{type:"success",data:I}),I}catch(I){try{throw await((y=(v=at(this,Rl).config).onError)==null?void 0:y.call(v,I,e,this.state.context,this)),await((b=(m=this.options).onError)==null?void 0:b.call(m,I,e,this.state.context)),await((C=(w=at(this,Rl).config).onSettled)==null?void 0:C.call(w,void 0,I,this.state.variables,this.state.context,this)),await((S=(A=this.options).onSettled)==null?void 0:S.call(A,void 0,I,e,this.state.context)),I}finally{so(this,pp,lm).call(this,{type:"error",error:I})}}finally{at(this,Rl).runNext(this)}}},hp=new WeakMap,Rl=new WeakMap,ib=new WeakMap,pp=new WeakSet,lm=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ts.batch(()=>{at(this,hp).forEach(n=>{n.onMutationUpdate(e)}),at(this,Rl).notify({mutation:this,type:"updated",action:e})})},K2e);function SEe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tu,GE,Z2e,fMt=(Z2e=class extends Y8{constructor(e={}){super();ni(this,tu);ni(this,GE);this.config=e,un(this,tu,new Map),un(this,GE,Date.now())}build(e,r,n){const i=new uMt({mutationCache:this,mutationId:++SI(this,GE)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){const r=I7(e),n=at(this,tu).get(r)??[];n.push(e),at(this,tu).set(r,n),this.notify({type:"added",mutation:e})}remove(e){var n;const r=I7(e);if(at(this,tu).has(r)){const i=(n=at(this,tu).get(r))==null?void 0:n.filter(a=>a!==e);i&&(i.length===0?at(this,tu).delete(r):at(this,tu).set(r,i))}this.notify({type:"removed",mutation:e})}canRun(e){var n;const r=(n=at(this,tu).get(I7(e)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}runNext(e){var n;const r=(n=at(this,tu).get(I7(e)))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){Ts.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...at(this,tu).values()].flat()}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Che(r,n))}findAll(e={}){return this.getAll().filter(r=>Che(e,r))}notify(e){Ts.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Ts.batch(()=>Promise.all(e.map(r=>r.continue().catch(jd))))}},tu=new WeakMap,GE=new WeakMap,Z2e);function I7(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function Ehe(t){return{onFetch:(e,r)=>{var u,f,d,h,p;const n=e.options,i=(d=(f=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,a=((h=e.state.data)==null?void 0:h.pages)||[],o=((p=e.state.data)==null?void 0:p.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const v=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},y=mEe(e.options,e.fetchOptions),m=async(b,w,C)=>{if(g)return Promise.reject();if(w==null&&b.pages.length)return Promise.resolve(b);const A={queryKey:e.queryKey,pageParam:w,direction:C?"backward":"forward",meta:e.options.meta};v(A);const S=await y(A),{maxPages:I}=e.options,D=C?eMt:JRt;return{pages:D(b.pages,S,I),pageParams:D(b.pageParams,w,I)}};if(i&&a.length){const b=i==="backward",w=b?dMt:Ihe,C={pages:a,pageParams:o},A=w(n,C);s=await m(C,A,b)}else{const b=t??a.length;do{const w=l===0?o[0]??n.initialPageParam:Ihe(n,s);if(l>0&&w==null)break;s=await m(s,w),l++}while(l{var g,v;return(v=(g=e.options).persister)==null?void 0:v.call(g,c,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=c}}}function Ihe(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function dMt(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var Ya,Mm,Dm,$3,B3,Nm,F3,j3,Q2e,hMt=(Q2e=class{constructor(t={}){ni(this,Ya);ni(this,Mm);ni(this,Dm);ni(this,$3);ni(this,B3);ni(this,Nm);ni(this,F3);ni(this,j3);un(this,Ya,t.queryCache||new cMt),un(this,Mm,t.mutationCache||new fMt),un(this,Dm,t.defaultOptions||{}),un(this,$3,new Map),un(this,B3,new Map),un(this,Nm,0)}mount(){SI(this,Nm)._++,at(this,Nm)===1&&(un(this,F3,yEe.subscribe(async t=>{t&&(await this.resumePausedMutations(),at(this,Ya).onFocus())})),un(this,j3,jN.subscribe(async t=>{t&&(await this.resumePausedMutations(),at(this,Ya).onOnline())})))}unmount(){var t,e;SI(this,Nm)._--,at(this,Nm)===0&&((t=at(this,F3))==null||t.call(this),un(this,F3,void 0),(e=at(this,j3))==null||e.call(this),un(this,j3,void 0))}isFetching(t){return at(this,Ya).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return at(this,Mm).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=at(this,Ya).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const r=this.defaultQueryOptions(t),n=at(this,Ya).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(_he(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return at(this,Ya).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),i=at(this,Ya).get(n.queryHash),a=i==null?void 0:i.state.data,o=WRt(e,a);if(o!==void 0)return at(this,Ya).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Ts.batch(()=>at(this,Ya).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=at(this,Ya).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=at(this,Ya);Ts.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=at(this,Ya),n={type:"active",...t};return Ts.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=Ts.batch(()=>at(this,Ya).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(jd).catch(jd)}invalidateQueries(t={},e={}){return Ts.batch(()=>{if(at(this,Ya).findAll(t).forEach(n=>{n.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t={},e){const r={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},n=Ts.batch(()=>at(this,Ya).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(jd)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(jd)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=at(this,Ya).build(this,e);return r.isStaleByTime(_he(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(jd).catch(jd)}fetchInfiniteQuery(t){return t.behavior=Ehe(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(jd).catch(jd)}ensureInfiniteQueryData(t){return t.behavior=Ehe(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return jN.isOnline()?at(this,Mm).resumePausedMutations():Promise.resolve()}getQueryCache(){return at(this,Ya)}getMutationCache(){return at(this,Mm)}getDefaultOptions(){return at(this,Dm)}setDefaultOptions(t){un(this,Dm,t)}setQueryDefaults(t,e){at(this,$3).set(v2(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...at(this,$3).values()];let r={};return e.forEach(n=>{aE(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){at(this,B3).set(v2(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...at(this,B3).values()];let r={};return e.forEach(n=>{aE(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...at(this,Dm).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Fee(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===vEe&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...at(this,Dm).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){at(this,Ya).clear(),at(this,Mm).clear()}},Ya=new WeakMap,Mm=new WeakMap,Dm=new WeakMap,$3=new WeakMap,B3=new WeakMap,Nm=new WeakMap,F3=new WeakMap,j3=new WeakMap,Q2e),Om,Lm,pc,mg,Fg,tM,XY,X2e,pMt=(X2e=class extends Y8{constructor(r,n){super();ni(this,Fg);ni(this,Om);ni(this,Lm);ni(this,pc);ni(this,mg);un(this,Om,r),this.setOptions(n),this.bindMethods(),so(this,Fg,tM).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=at(this,Om).defaultMutationOptions(r),ZRt(this.options,n)||at(this,Om).getMutationCache().notify({type:"observerOptionsUpdated",mutation:at(this,pc),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&v2(n.mutationKey)!==v2(this.options.mutationKey)?this.reset():((i=at(this,pc))==null?void 0:i.state.status)==="pending"&&at(this,pc).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=at(this,pc))==null||r.removeObserver(this)}onMutationUpdate(r){so(this,Fg,tM).call(this),so(this,Fg,XY).call(this,r)}getCurrentResult(){return at(this,Lm)}reset(){var r;(r=at(this,pc))==null||r.removeObserver(this),un(this,pc,void 0),so(this,Fg,tM).call(this),so(this,Fg,XY).call(this)}mutate(r,n){var i;return un(this,mg,n),(i=at(this,pc))==null||i.removeObserver(this),un(this,pc,at(this,Om).getMutationCache().build(at(this,Om),this.options)),at(this,pc).addObserver(this),at(this,pc).execute(r)}},Om=new WeakMap,Lm=new WeakMap,pc=new WeakMap,mg=new WeakMap,Fg=new WeakSet,tM=function(){var n;const r=((n=at(this,pc))==null?void 0:n.state)??SEe();un(this,Lm,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},XY=function(r){Ts.batch(()=>{var n,i,a,o,s,l,c,u;if(at(this,mg)&&this.hasListeners()){const f=at(this,Lm).variables,d=at(this,Lm).context;(r==null?void 0:r.type)==="success"?((i=(n=at(this,mg)).onSuccess)==null||i.call(n,r.data,f,d),(o=(a=at(this,mg)).onSettled)==null||o.call(a,r.data,null,f,d)):(r==null?void 0:r.type)==="error"&&((l=(s=at(this,mg)).onError)==null||l.call(s,r.error,f,d),(u=(c=at(this,mg)).onSettled)==null||u.call(c,void 0,r.error,f,d))}this.listeners.forEach(f=>{f(at(this,Lm))})})},X2e);function gMt(t){return{mutationFn(e){return WY(t,e)},mutationKey:["connect"]}}var CEe=Z.createContext(void 0),vMt=t=>{const e=Z.useContext(CEe);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},mMt=({client:t,children:e})=>(Z.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),M.jsx(CEe.Provider,{value:t,children:e}));function yMt(t,e){return typeof t=="function"?t(...e):!!t}function wMt(){}function bMt(t,e){const r=vMt(),[n]=Z.useState(()=>new pMt(r,t));Z.useEffect(()=>{n.setOptions(t)},[n,t]);const i=Z.useSyncExternalStore(Z.useCallback(o=>n.subscribe(Ts.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=Z.useCallback((o,s)=>{n.mutate(o,s).catch(wMt)},[n]);if(i.error&&yMt(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function xMt(t={}){const e=pEe(t);return Z.useSyncExternalStore(r=>uEe(e,{onChange:r}),()=>YY(e),()=>YY(e))}function _Mt(t={}){const{mutation:e}=t,r=pEe(t),n=gMt(r),{mutate:i,mutateAsync:a,...o}=bMt({...e,...n});return Z.useEffect(()=>r.subscribe(({status:s})=>s,(s,l)=>{l==="connected"&&s==="disconnected"&&o.reset()}),[r,o.reset]),{...o,connect:i,connectAsync:a,connectors:xMt({config:r})}}function AEe(t,e){return`https://rpc.walletconnect.org/v1/?chainId=${e}:${t}`}const SMt={id:"eip155:1",chainId:1,name:"Ethereum",currency:"ETH",explorerUrl:"https://etherscan.io",rpcUrl:AEe(1,"eip155"),chainNamespace:"eip155"},CMt={id:"eip155:42161",chainId:42161,name:"Arbitrum",currency:"ETH",explorerUrl:"https://arbiscan.io",rpcUrl:AEe(42161,"eip155"),chainNamespace:"eip155"},khe=MPt({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});async function AMt(t){var n;if(!t)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const e=await(t==null?void 0:t.getProvider());return{supportsAllNetworks:!1,approvedCaipNetworkIds:hN.getChainsFromNamespaces((n=e==null?void 0:e.session)==null?void 0:n.namespaces)}}function TMt(){return{supportsAllNetworks:!0,approvedCaipNetworkIds:Rf.WalletConnectRpcChainIds.map(t=>`${Sn.EIP155}:${t}`)}}function EMt({chain:t,projectId:e}){var i,a;const r=gt.getBlockchainApiUrl(),n=(a=(i=t.rpcUrls[0])==null?void 0:i.http)==null?void 0:a[0];return Rf.WalletConnectRpcChainIds.includes(t.id)?qPt([jz(`${r}/v1/?chainId=${Sn.EIP155}:${t.id}&projectId=${e}`,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),jz(n)]):jz(n)}function Phe(t){if(!t)throw new Error("No CAIP address provided");const e=t.split(":")[2];if(!e)throw new Error("Invalid CAIP address");return e}function TEe(t){return t.map(r=>({blockExplorers:{default:{apiUrl:"",name:"",url:r.explorerUrl||""}},fees:void 0,formatters:void 0,id:Number(r.chainId),name:r.name,nativeCurrency:{decimals:18,name:r.currency,symbol:r.currency},rpcUrls:{default:{http:[r.rpcUrl]}},serializers:void 0}))}var IMt="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const Rhe=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Mhe=4;function kMt(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,a=[0,1];for(let C=1;C>--l&1}const f=31,d=2**f,h=d>>>1,p=h>>1,g=d-1;let v=0;for(let C=0;C1;){let L=A+S>>>1;C>>1|u(),I=I<<1^h,D=(D^h)<<1|h|1;m=I,b=1+D-I}let w=n-4;return y.map(C=>{switch(C-w){case 3:return w+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return w+256+(t[s++]<<8|t[s++]);case 1:return w+t[s++];default:return C-1}})}function PMt(t){let e=0;return()=>t[e++]}function EEe(t){return PMt(kMt(RMt(t)))}function RMt(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,a=0,o=0,s=0;i=8&&(n[a++]=s>>(o-=8));return n}function MMt(t){return t&1?~t>>1:t>>1}function DMt(t,e){let r=Array(t);for(let n=0,i=0;n{let e=oE(t);if(e.length)return e})}function kEe(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(NMt(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(OMt(r,t))}return e.flat()}function sE(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function PEe(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;in[o].push(a));return n}function NMt(t,e){let r=1+e(),n=e(),i=sE(e);return PEe(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let d=f*n;return[l+f*r,c.map(h=>h+d)]})})}function OMt(t,e){let r=1+e();return PEe(r,1+t,e).map(i=>[i[0],i.slice(1)])}function LMt(t){let e=[],r=oE(t);return i(n([]),[]),e;function n(a){let o=t(),s=sE(()=>{let l=oE(t).map(c=>r[c]);if(l.length)return n(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function $Mt(t){return t.toString(16).toUpperCase().padStart(2,"0")}function REe(t){return`{${$Mt(t)}}`}function BMt(t){let e=[];for(let r=0,n=t.length;r>24&255}function NEe(t){return t&16777215}let JY,Dhe,eK,rM;function WMt(){let t=EEe(jMt);JY=new Map(IEe(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),Dhe=new Set(oE(t)),eK=new Map,rM=new Map;for(let[e,r]of kEe(t)){if(!Dhe.has(e)&&r.length==2){let[n,i]=r,a=rM.get(n);a||(a=new Map,rM.set(n,a)),a.set(i,e)}eK.set(e,r.reverse())}}function OEe(t){return t>=lE&&t=UN&&t=zN&&eHN&&e0&&i(HN+c)}else{let o=eK.get(a);o?r.push(...o):i(a)}if(!r.length)break;a=r.pop()}if(n&&e.length>1){let a=uA(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=s):r.push(s),i=o;else{let l=qMt(n,s);l>=0?n=l:i==0&&o==0?(e.push(n),n=s):(r.push(s),i=o)}}return n>=0&&e.push(n,...r),e}function $Ee(t){return LEe(t).map(NEe)}function KMt(t){return YMt(LEe(t))}const Nhe=45,BEe=".",FEe=65039,jEe=1,Y_=t=>Array.from(t);function cE(t,e){return t.P.has(e)||t.Q.has(e)}class ZMt extends Array{get is_emoji(){return!0}}let tK,UEe,Yw,rK,zEe,x3,Gz,T_,HEe,Ohe,nK;function jee(){if(tK)return;let t=EEe(IMt);const e=()=>oE(t),r=()=>new Set(e());tK=new Map(kEe(t)),UEe=r(),Yw=e(),rK=new Set(e().map(u=>Yw[u])),Yw=new Set(Yw),zEe=r(),r();let n=IEe(t),i=t();const a=()=>new Set(e().flatMap(u=>n[u]).concat(e()));x3=sE(u=>{let f=sE(t).map(d=>d+96);if(f.length){let d=u>=i;f[0]-=32,f=D5(f),d&&(f=`Restricted[${f}]`);let h=a(),p=a(),g=!t();return{N:f,P:h,Q:p,M:g,R:d}}}),Gz=r(),T_=new Map;let o=e().concat(Y_(Gz)).sort((u,f)=>u-f);o.forEach((u,f)=>{let d=t(),h=o[f]=d?o[f-d]:{V:[],M:new Map};h.V.push(u),Gz.has(u)||T_.set(u,h)});for(let{V:u,M:f}of new Set(T_.values())){let d=[];for(let p of u){let g=x3.filter(y=>cE(y,p)),v=d.find(({G:y})=>g.some(m=>y.has(m)));v||(v={G:new Set,V:[]},d.push(v)),v.V.push(p),g.forEach(y=>v.G.add(y))}let h=d.flatMap(p=>Y_(p.G));for(let{G:p,V:g}of d){let v=new Set(h.filter(y=>!p.has(y)));for(let y of g)f.set(y,v)}}let s=new Set,l=new Set;const c=u=>s.has(u)?l.add(u):s.add(u);for(let u of x3){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of s)!T_.has(u)&&!l.has(u)&&T_.set(u,jEe);HEe=new Set(Y_(s).concat(Y_($Ee(s)))),Ohe=LMt(t).map(u=>ZMt.from(u)).sort(FMt),nK=new Map;for(let u of Ohe){let f=[nK];for(let d of u){let h=f.map(p=>{let g=p.get(d);return g||(g=new Map,p.set(d,g)),g});d===FEe?f.push(...h):f=h}for(let d of f)d.V=u}}function Uee(t){return(VEe(t)?"":`${zee(j$([t]))} `)+REe(t)}function zee(t){return`"${t}"‎`}function QMt(t){if(t.length>=4&&t[2]==Nhe&&t[3]==Nhe)throw new Error(`invalid label extension: "${D5(t.slice(0,4))}"`)}function XMt(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function JMt(t){let e=t[0],r=Rhe.get(e);if(r)throw QA(`leading ${r}`);let n=t.length,i=-1;for(let a=1;a{let a=BMt(i),o={input:a,offset:n};n+=a.length+1;try{let s=o.tokens=sDt(a,e,r),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(XMt(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(d=>d<128))QMt(u),c="ASCII";else{let d=s.flatMap(h=>h.is_emoji?[]:h);if(!d.length)c="Emoji";else{if(Yw.has(u[0]))throw QA("leading combining mark");for(let g=1;go.has(s)):Y_(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(a=>cE(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function iDt(t){let e=x3;for(let r of t){let n=e.filter(i=>cE(i,r));if(!n.length)throw x3.some(i=>cE(i,r))?WEe(e[0],r):GEe(r);if(e=n,n.length==1)break}return e}function aDt(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${zee(j$(e))}: ${i}`)}return D5(n)}).join(BEe)}function GEe(t){return new Error(`disallowed character: ${Uee(t)}`)}function WEe(t,e){let r=Uee(e),n=x3.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function QA(t){return new Error(`illegal placement: ${t}`)}function oDt(t,e){for(let r of e)if(!cE(t,r))throw WEe(t,r);if(t.M){let r=$Ee(e);for(let n=1,i=r.length;nMhe)throw new Error(`excessive non-spacing marks: ${zee(j$(r.slice(n-1,a)))} (${a-n}/${Mhe})`);n=a}}}function sDt(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let a=cDt(t);if(a)i.length&&(n.push(e(i)),i=[]),n.push(r(a));else{let o=t.pop();if(HEe.has(o))i.push(o);else{let s=tK.get(o);if(s)i.push(...s);else if(!UEe.has(o))throw GEe(o)}}}return i.length&&n.push(e(i)),n}function lDt(t){return t.filter(e=>e!=FEe)}function cDt(t,e){let r=nK,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:a}=r;a&&(n=a,t.length=i)}return n}function Lhe(t){return tDt(t)}Hee.type="walletConnect";function Hee(t,e){const r=t.isNewChainsStale??!0;let n,i,a,o,s,l,c,u;return f=>({id:"walletConnect",name:"WalletConnect",type:Hee.type,async setup(){const d=await this.getProvider().catch(()=>null);d&&(s||(s=this.onConnect.bind(this),d.on("connect",s)),c||(c=this.onSessionDelete.bind(this),d.on("session_delete",c)))},async connect({...d}={}){try{const h=await this.getProvider();if(!h)throw new mm;l||(l=this.onDisplayUri,h.on("display_uri",l));const p=await this.isChainsStale();if(h.session&&p&&await h.disconnect(),!h.session||p){const y=hN.createNamespaces(t.networks);await h.connect({optionalNamespaces:y,..."pairingTopic"in d?{pairingTopic:d.pairingTopic}:{}}),this.setRequestedChainsIds(t.networks.map(m=>Number(m.chainId)))}const g=(await h.enable()).map(y=>Cc(y)),v=await this.getChainId();return l&&(h.removeListener("display_uri",l),l=void 0),s&&(h.removeListener("connect",s),s=void 0),a||(a=this.onAccountsChanged.bind(this),h.on("accountsChanged",a)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),u||(u=this.onDisconnect.bind(this),h.on("disconnect",u)),c||(c=this.onSessionDelete.bind(this),h.on("session_delete",c)),{accounts:g,chainId:v}}catch(h){throw/(user rejected|connection request reset)/i.test(h==null?void 0:h.message)?new ga(h):h}},async disconnect(){const d=await this.getProvider();try{await(d==null?void 0:d.disconnect())}catch(h){if(!/No matching key/i.test(h.message))throw h}finally{o&&(d==null||d.removeListener("chainChanged",o),o=void 0),u&&(d==null||d.removeListener("disconnect",u),u=void 0),s||(s=this.onConnect.bind(this),d==null||d.on("connect",s)),a&&(d==null||d.removeListener("accountsChanged",a),a=void 0),c&&(d==null||d.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var g,v,y;const d=await this.getProvider();if(!((g=d==null?void 0:d.session)!=null&&g.namespaces))return[];const h=(y=(v=d==null?void 0:d.session)==null?void 0:v.namespaces.eip155)==null?void 0:y.accounts;return(h==null?void 0:h.map(m=>m.split(":")[2]))??[]},async getProvider({chainId:d}={}){var g,v,y;async function h(){var w;if(!t.networks.map(C=>Number(C.chainId)).length)return;const b=(w=e.universalAdapter)==null?void 0:w.getWalletConnectProvider();if(!b)throw new Error("Provider not found");return b}n||(i||(i=h()),n=await i,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY));const p=(g=e.getCaipNetwork())==null?void 0:g.chainId;if(d&&p!==d){const m=jn.getStoredActiveCaipNetwork();m&&m.chainNamespace==="eip155"?await((v=this.switchChain)==null?void 0:v.call(this,{chainId:Number(m.chainId)})):await((y=this.switchChain)==null?void 0:y.call(this,{chainId:d}))}return n},async getChainId(){var v,y,m,b;const d=(v=e.getCaipNetwork())==null?void 0:v.chainId;if(d)return d;const p=(b=(m=(y=(await this.getProvider()).session)==null?void 0:y.namespaces.eip155)==null?void 0:m.chains)==null?void 0:b[0],g=t.networks.find(w=>w.id===p);return g==null?void 0:g.chainId},async isAuthorized(){try{const[d,h]=await Promise.all([this.getAccounts(),this.getProvider()]);return d.length?await this.isChainsStale()&&h.session?(await h.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:d,chainId:h}){var y,m;const p=await this.getProvider();if(!p)throw new mm;const g=t.networks.find(b=>b.chainId===h),[v]=g?TEe([g]):[];if(!v)throw new Fc(new g2);try{g!=null&&g.id&&p.setDefaultChain(g==null?void 0:g.id),await p.request({method:"wallet_switchEthereumChain",params:[{chainId:Ln(h)}]}),f.emitter.emit("change",{chainId:Number(h)});const b=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...b,h]),v}catch(b){const w=b;if(/(?:user rejected)/iu.test(w.message))throw new ga(w);try{let C;d!=null&&d.blockExplorerUrls?C=d.blockExplorerUrls:C=(y=v.blockExplorers)!=null&&y.default.url?[(m=v.blockExplorers)==null?void 0:m.default.url]:[];const A={blockExplorerUrls:C,chainId:Ln(h),chainName:v.name,iconUrls:d==null?void 0:d.iconUrls,nativeCurrency:v.nativeCurrency,rpcUrls:v.rpcUrls.default.http};await p.request({method:"wallet_addEthereumChain",params:[A]});const S=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...S,h]),v}catch(C){throw new ga(C)}}},onAccountsChanged(d){d.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:d.map(h=>Cc(h))})},onChainChanged(d){const h=Number(d);f.emitter.emit("change",{chainId:h})},async onConnect(d){const h=Number(d.chainId),p=await this.getAccounts();f.emitter.emit("connect",{accounts:p,chainId:h})},async onDisconnect(d){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const h=await this.getProvider();a&&(h.removeListener("accountsChanged",a),a=void 0),o&&(h.removeListener("chainChanged",o),o=void 0),u&&(h.removeListener("disconnect",u),u=void 0),c&&(h.removeListener("session_delete",c),c=void 0),s||(s=this.onConnect.bind(this),h.on("connect",s))},onDisplayUri(d){f.emitter.emit("message",{type:"display_uri",data:d})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var p,g,v;if(!((p=n==null?void 0:n.session)!=null&&p.namespaces))return[];const d=(v=(g=n==null?void 0:n.session)==null?void 0:g.namespaces.eip155)==null?void 0:v.accounts;return(d==null?void 0:d.map(y=>Number.parseInt(y.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var h;const d=await((h=f.storage)==null?void 0:h.getItem(this.requestedChainsStorageKey))??[];return[...new Set(d)]},async isChainsStale(){if(!r)return!1;const d=f.chains.map(g=>g.id),h=this.getNamespaceChainsIds();if(h.length&&!h.some(g=>d.includes(g)))return!1;const p=await this.getRequestedChainsIds();return!d.every(g=>p.includes(Number(g)))},async setRequestedChainsIds(d){var h;await((h=f.storage)==null?void 0:h.setItem(this.requestedChainsStorageKey,d))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}U$.type="coinbaseWallet";function U$(t={}){return t.version==="3"||t.headlessMode?fDt(t):uDt(t)}function uDt(t){let e,r,n,i,a;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:U$.type,async connect({chainId:s}={}){try{const l=await this.getProvider(),c=(await l.request({method:"eth_requestAccounts"})).map(f=>Cc(f));n||(n=this.onAccountsChanged.bind(this),l.on("accountsChanged",n)),i||(i=this.onChainChanged.bind(this),l.on("chainChanged",i)),a||(a=this.onDisconnect.bind(this),l.on("disconnect",a));let u=await this.getChainId();if(s&&u!==s){const f=await this.switchChain({chainId:s}).catch(d=>{if(d.code===ga.code)throw d;return{id:u}});u=(f==null?void 0:f.id)??u}return{accounts:c,chainId:u}}catch(l){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(l.message)?new ga(l):l}},async disconnect(){var l;const s=await this.getProvider();n&&(s.removeListener("accountsChanged",n),n=void 0),i&&(s.removeListener("chainChanged",i),i=void 0),a&&(s.removeListener("disconnect",a),a=void 0),s.disconnect(),(l=s.close)==null||l.call(s)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>Cc(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){if(!r){const s=await(async()=>{const{default:l}=await Bf(async()=>{const{default:c}=await import("./index-DKSdwK6L.js").then(u=>u.i);return{default:c}},__vite__mapDeps([0,1]),import.meta.url);return typeof l!="function"&&typeof l.default=="function"?l.default:l})();e=new s({...t,appChainIds:o.chains.map(l=>l.id)}),r=e.makeWeb3Provider({...t,options:t.preference??"all"})}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:s,chainId:l}){var f,d,h,p;const c=o.chains.find(g=>g.id===l);if(!c)throw new Fc(new g2);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:Ln(c.id)}]}),c}catch(g){if(g.code===4902)try{let v;s!=null&&s.blockExplorerUrls?v=s.blockExplorerUrls:v=(f=c.blockExplorers)!=null&&f.default.url?[(d=c.blockExplorers)==null?void 0:d.default.url]:[];let y;(h=s==null?void 0:s.rpcUrls)!=null&&h.length?y=s.rpcUrls:y=[((p=c.rpcUrls.default)==null?void 0:p.http[0])??""];const m={blockExplorerUrls:v,chainId:Ln(l),chainName:(s==null?void 0:s.chainName)??c.name,iconUrls:s==null?void 0:s.iconUrls,nativeCurrency:(s==null?void 0:s.nativeCurrency)??c.nativeCurrency,rpcUrls:y};return await u.request({method:"wallet_addEthereumChain",params:[m]}),c}catch(v){throw new ga(v)}throw new Fc(g)}},onAccountsChanged(s){s.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:s.map(l=>Cc(l))})},onChainChanged(s){const l=Number(s);o.emitter.emit("change",{chainId:l})},async onDisconnect(s){o.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),i&&(l.removeListener("chainChanged",i),i=void 0),a&&(l.removeListener("disconnect",a),a=void 0)}})}function fDt(t){let r,n,i,a,o;return s=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:U$.type,async connect({chainId:l}={}){try{const c=await this.getProvider(),u=(await c.request({method:"eth_requestAccounts"})).map(d=>Cc(d));i||(i=this.onAccountsChanged.bind(this),c.on("accountsChanged",i)),a||(a=this.onChainChanged.bind(this),c.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),c.on("disconnect",o));let f=await this.getChainId();if(l&&f!==l){const d=await this.switchChain({chainId:l}).catch(h=>{if(h.code===ga.code)throw h;return{id:f}});f=(d==null?void 0:d.id)??f}return{accounts:u,chainId:f}}catch(c){throw/(user closed modal|accounts received is empty|user denied account)/i.test(c.message)?new ga(c):c}},async disconnect(){const l=await this.getProvider();i&&(l.removeListener("accountsChanged",i),i=void 0),a&&(l.removeListener("chainChanged",a),a=void 0),o&&(l.removeListener("disconnect",o),o=void 0),l.disconnect(),l.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>Cc(c))},async getChainId(){const c=await(await this.getProvider()).request({method:"eth_chainId"});return Number(c)},async getProvider(){var l;if(!n){const c=await(async()=>{const{default:p}=await Bf(async()=>{const{default:g}=await import("./index-Clf5vl-T.js").then(v=>v.i);return{default:g}},__vite__mapDeps([2,1]),import.meta.url);return typeof p!="function"&&typeof p.default=="function"?p.default:p})();r=new c({...t,reloadOnDisconnect:!1});const u=(l=r.walletExtension)==null?void 0:l.getChainId(),f=s.chains.find(p=>t.chainId?p.id===t.chainId:p.id===u)||s.chains[0],d=t.chainId||(f==null?void 0:f.id),h=t.jsonRpcUrl||(f==null?void 0:f.rpcUrls.default.http[0]);n=r.makeWeb3Provider(h,d)}return n},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:c}){var d,h,p,g;const u=s.chains.find(v=>v.id===c);if(!u)throw new Fc(new g2);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:Ln(u.id)}]}),u}catch(v){if(v.code===4902)try{let y;l!=null&&l.blockExplorerUrls?y=l.blockExplorerUrls:y=(d=u.blockExplorers)!=null&&d.default.url?[(h=u.blockExplorers)==null?void 0:h.default.url]:[];let m;(p=l==null?void 0:l.rpcUrls)!=null&&p.length?m=l.rpcUrls:m=[((g=u.rpcUrls.default)==null?void 0:g.http[0])??""];const b={blockExplorerUrls:y,chainId:Ln(c),chainName:(l==null?void 0:l.chainName)??u.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??u.nativeCurrency,rpcUrls:m};return await f.request({method:"wallet_addEthereumChain",params:[b]}),u}catch(y){throw new ga(y)}throw new Fc(v)}},onAccountsChanged(l){l.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:l.map(c=>Cc(c))})},onChainChanged(l){const c=Number(l);s.emitter.emit("change",{chainId:c})},async onDisconnect(l){s.emitter.emit("disconnect");const c=await this.getProvider();i&&(c.removeListener("accountsChanged",i),i=void 0),a&&(c.removeListener("chainChanged",a),a=void 0),o&&(c.removeListener("disconnect",o),o=void 0)}})}class XA{constructor(){}static getInstance({projectId:e,chainId:r,onTimeout:n}){return XA.instance||(XA.instance=new apt({projectId:e,chainId:r,onTimeout:n})),XA.instance}}function dDt(t){function e(r){return Bd.parseEvmChainId(r)||1}return r=>({id:Sn.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"w3mAuth",chain:ya.CHAIN.EVM,async connect(n={}){const i=await this.getProvider();let a=n.chainId;if(n.isReconnecting&&(a=i.getLastUsedChainId(),!a))throw new Error("ChainId not found in provider");const{address:o,chainId:s}=await i.connect({chainId:a});await i.getSmartAccountEnabledNetworks();const l=e(s);return{accounts:[o],account:o,chainId:l,chain:{id:l,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},async getAccounts(){const n=await this.getProvider(),{address:i}=await n.connect();return r.emitter.emit("change",{accounts:[i]}),[i]},async getProvider(){return this.provider||(this.provider=XA.getInstance({projectId:t.options.projectId,onTimeout:()=>{cb.open(ET.ALERT_ERRORS.INVALID_APP_CONFIGURATION_SOCIALS,"error")}})),Promise.resolve(this.provider)},async getChainId(){const n=await this.getProvider(),{chainId:i}=await n.getChainId();return e(i)},async isAuthorized(){const n=await this.getProvider(),{isConnected:i}=await n.isConnected();return i},async switchChain({chainId:n}){try{const i=r.chains.find(s=>s.id===n);if(!i)throw new Fc(new Error("chain not found on connector."));const o=await(await this.getProvider()).connect({chainId:n});return r.emitter.emit("change",{chainId:Number(n),accounts:[o.address]}),i}catch(i){throw i instanceof Error?new Fc(i):i}},onAccountsChanged(n){n.length===0?this.onDisconnect():r.emitter.emit("change",{accounts:n.map(Cc)})},onChainChanged(n){const i=Number(n);r.emitter.emit("change",{chainId:i})},async onDisconnect(n){await(await this.getProvider()).disconnect()}})}const hDt=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class pDt{constructor(e){var a,o;if(this.appKit=void 0,this.options=void 0,this.chainNamespace=ya.CHAIN.EVM,this.defaultCaipNetwork=void 0,this.tokens=Gce.getCaipTokens((a=this.options)==null?void 0:a.tokens),this.siweControllerClient=(o=this.options)==null?void 0:o.siweConfig,this.adapterType="wagmi",!e.projectId)throw new Error(ET.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED.shortMessage);this.caipNetworks=e.networks.map(s=>({...s,rpcUrl:Y6.extendRpcUrlWithProjectId(s.rpcUrl,e.projectId)})),this.wagmiChains=TEe(this.caipNetworks.filter(s=>s.chainNamespace===ya.CHAIN.EVM));const r=this.wagmiChains.map(s=>[s.id,EMt({chain:s,projectId:e.projectId})]),n=Object.fromEntries(r),i=[...e.connectors??[]];this.wagmiConfig=BRt({...e,chains:this.wagmiChains,transports:n,connectors:[...i,...(e==null?void 0:e.connectors)??[]]})}setCustomConnectors(e,r){var o,s,l,c,u,f,d;const n=[];e.enableWalletConnect!==!1&&n.push(Hee(e,r)),e.enableInjected!==!1&&n.push(B$({shimDisconnect:!0})),e.enableCoinbase!==!1&&n.push(U$({version:"4",appName:((o=e.metadata)==null?void 0:o.name)??"Unknown",appLogoUrl:((s=e.metadata)==null?void 0:s.icons[0])??"Unknown",preference:e.coinbasePreference??"all"}));const i=((l=e.features)==null?void 0:l.email)===void 0?Da.DEFAULT_FEATURES.email:(c=e.features)==null?void 0:c.email,a=(u=e.features)!=null&&u.socials?((d=(f=e.features)==null?void 0:f.socials)==null?void 0:d.length)>0:Da.DEFAULT_FEATURES.socials;(i||a)&&n.push(dDt({chains:this.wagmiChains,options:{projectId:e.projectId}})),n.forEach(h=>{const p=this.wagmiConfig._internal.connectors.setup(h);this.wagmiConfig._internal.connectors.setState(g=>[...g,p])})}construct(e,r){var n,i,a;if(this.appKit=e,this.options=r,this.caipNetworks=r.networks,this.defaultCaipNetwork=r.defaultNetwork||r.networks[0],this.tokens=Gce.getCaipTokens(r.tokens),this.setCustomConnectors(r,e),!this.wagmiConfig)throw new Error("appkit:wagmiConfig - is undefined");this.networkControllerClient={switchCaipNetwork:async o=>{const s=Number(Bd.caipNetworkIdToNumber(o==null?void 0:o.id));s&&this.wagmiConfig&&await dRt(this.wagmiConfig,{chainId:s})},getApprovedCaipNetworksData:async()=>{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");return new Promise(o=>{var c,u;const l=new Map(this.wagmiConfig.state.connections).get(this.wagmiConfig.state.current||"");if(((c=l==null?void 0:l.connector)==null?void 0:c.id)===Sn.AUTH_CONNECTOR_ID)o(TMt());else if(((u=l==null?void 0:l.connector)==null?void 0:u.id)===Sn.WALLET_CONNECT_CONNECTOR_ID){const f=this.wagmiConfig.connectors.find(d=>d.id===Sn.WALLET_CONNECT_CONNECTOR_ID);o(AMt(f))}o({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})}},this.connectionControllerClient={connectWalletConnect:async()=>{var p,g,v,y,m,b,w,C,A,S,I,D;if(!this.wagmiConfig)throw new Error("connectionControllerClient:getWalletConnectUri - wagmiConfig is undefined");const o=this.wagmiConfig.connectors.find(L=>L.id===Sn.WALLET_CONNECT_CONNECTOR_ID);if(!o)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");const s=await o.getProvider(),l=await((v=(g=(p=this.options)==null?void 0:p.siweConfig)==null?void 0:g.getMessageParams)==null?void 0:v.call(g)),c=(b=(m=(y=this.options)==null?void 0:y.siweConfig)==null?void 0:m.options)==null?void 0:b.enabled,u=typeof(s==null?void 0:s.authenticate)=="function",f=l&&Object.keys(l||{}).length>0,d=(w=this.options)==null?void 0:w.siweConfig;if(c&&u&&f&&d){await o.setRequestedChainsIds(l.chains);const{SIWEController:L,getDidChainId:O,getDidAddress:P}=await Bf(async()=>{const{SIWEController:N,getDidChainId:F,getDidAddress:B}=await import("./index-Cdw1Pm6b.js");return{SIWEController:N,getDidChainId:F,getDidAddress:B}},[],import.meta.url),x=(C=this.caipNetworks)==null?void 0:C.filter(N=>N.chainNamespace==="eip155").map(N=>N.id);l.chains=(A=this.caipNetworks)==null?void 0:A.filter(N=>N.chainNamespace==="eip155").map(N=>N.chainId);const T=await s.authenticate({nonce:await d.getNonce(),methods:[...hDt],...l,chains:x}),E=(S=T==null?void 0:T.auths)==null?void 0:S[0];if(E){const{p:N,s:F}=E,B=O(N.iss),j=P(N.iss);j&&B&&L.setSession({address:j,chainId:parseInt(B,10)});try{const k=s.client.formatAuthMessage({request:N,iss:N.iss});await L.verifyMessage({message:k,signature:F.s,cacao:E})}catch(k){throw console.error("Error verifying message",k),await s.disconnect().catch(console.error),await L.signOut().catch(console.error),k}}}const h=Number(Bd.caipNetworkIdToNumber((D=(I=this.appKit)==null?void 0:I.getCaipNetwork())==null?void 0:D.id));await WY(this.wagmiConfig,{connector:o,chainId:h})},connectExternal:async({id:o,provider:s,info:l})=>{var f,d,h,p;if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const c=this.wagmiConfig.connectors.find(g=>g.id===o);if(!c)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(f=this.appKit)==null||f.setClientId(null),s&&l&&c.id===Sn.EIP6963_CONNECTOR_ID&&((d=c.setEip6963Wallet)==null||d.call(c,{provider:s,info:l}));const u=Number(Bd.caipNetworkIdToNumber((p=(h=this.appKit)==null?void 0:h.getCaipNetwork())==null?void 0:p.id));await WY(this.wagmiConfig,{connector:c,chainId:u})},checkInstalled:o=>{var l;const s=(l=this.appKit)==null?void 0:l.getConnectors().find(c=>c.type==="INJECTED");return o?s&&window!=null&&window.ethereum?o.some(c=>{var u;return!!((u=window.ethereum)!=null&&u[String(c)])}):!1:!!window.ethereum},disconnect:async()=>{var o,s,l,c,u;if(await QPt(this.wagmiConfig),(l=(s=(o=this.options)==null?void 0:o.siweConfig)==null?void 0:s.options)!=null&&l.signOutOnDisconnect){const{SIWEController:f}=await Bf(async()=>{const{SIWEController:d}=await import("./index-Cdw1Pm6b.js");return{SIWEController:d}},[],import.meta.url);await f.signOut()}na.removeItem(ra.WALLET_ID),na.removeItem(ra.CONNECTED_CONNECTOR),na.removeItem(ra.WALLET_NAME),(c=this.appKit)==null||c.setClientId(null),this.syncAccount({address:void 0,chainId:void 0,connector:void 0,addresses:void 0,status:"disconnected"}),(u=this.appKit)==null||u.resetAccount("solana")},signMessage:async o=>{var c;const s=((c=this.appKit)==null?void 0:c.getCaipAddress())||"",l=Phe(s);return lRt(this.wagmiConfig,{message:o,account:l})},estimateGas:async o=>{if(o.chainNamespace&&o.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${o.chainNamespace}`);try{return await XPt(this.wagmiConfig,{account:o.address,to:o.to,data:o.data,type:"legacy"})}catch{return BigInt(0)}},sendTransaction:async o=>{if(o.chainNamespace&&o.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${o.chainNamespace}`);const{chainId:s}=q8(this.wagmiConfig),l={account:o.address,to:o.to,value:o.value,gas:o.gas,gasPrice:o.gasPrice,data:o.data,chainId:s,type:"legacy"};await oRt(this.wagmiConfig,l);const c=await sRt(this.wagmiConfig,l);return await pRt(this.wagmiConfig,{hash:c,timeout:25e3}),c},writeContract:async o=>{var f,d,h,p;const s=((f=this.appKit)==null?void 0:f.getCaipAddress())||"",l=Phe(s),c=Number(Bd.caipNetworkIdToNumber((h=(d=this.appKit)==null?void 0:d.getCaipNetwork())==null?void 0:h.id));return await gRt(this.wagmiConfig,{chain:(p=this.wagmiChains)==null?void 0:p[c],chainId:c,address:o.tokenAddress,account:l,abi:o.abi,functionName:o.method,args:[o.receiverAddress,o.tokenAmount]})},getEnsAddress:async o=>{var s,l,c;try{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const u=Number(Bd.caipNetworkIdToNumber((l=(s=this.appKit)==null?void 0:s.getCaipNetwork())==null?void 0:l.id));let f=!1,d=!1;return Qut(o)&&(d=await((c=this.appKit)==null?void 0:c.resolveReownName(o))||!1),u===1&&(f=await iRt(this.wagmiConfig,{name:Lhe(o),chainId:u})),f||d||!1}catch{return!1}},getEnsAvatar:async o=>{var c,u;const s=Number(Bd.caipNetworkIdToNumber((u=(c=this.appKit)==null?void 0:c.getCaipNetwork())==null?void 0:u.id));return s!==khe.id?!1:await yhe(this.wagmiConfig,{name:Lhe(o),chainId:s})||!1},parseUnits:LPt,formatUnits:H8},Pe.state.chains.set(this.chainNamespace,{chainNamespace:this.chainNamespace,connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient,adapterType:this.adapterType,caipNetworks:this.caipNetworks}),this.syncConnectors(this.wagmiConfig.connectors),this.syncAuthConnector((n=this.wagmiConfig)==null?void 0:n.connectors.find(o=>o.id===Sn.AUTH_CONNECTOR_ID)),this.syncRequestedNetworks(this.caipNetworks),uEe(this.wagmiConfig,{onChange:o=>{this.syncConnectors(o),this.syncAuthConnector(o.find(s=>s.id===Sn.AUTH_CONNECTOR_ID))}}),hRt(this.wagmiConfig,{onChange:o=>{this.syncAccount(o)}}),(i=this.appKit)==null||i.setEIP6963Enabled(r.enableEIP6963!==!1),(a=this.appKit)==null||a.subscribeShouldUpdateToAddress(o=>{var s;if(o){const c=(s=nRt(this.wagmiConfig)[0])==null?void 0:s.connector;c&&uRt(this.wagmiConfig,{connector:c}).then(u=>this.syncAccount({address:o,isConnected:!0,addresses:u.accounts,connector:c,chainId:u.chainId,status:"connected"}))}})}subscribeState(e){var r;return(r=this.appKit)==null?void 0:r.subscribeState(n=>e({...n,selectedNetworkId:Number(Bd.caipNetworkIdToNumber(n.selectedNetworkId))}))}syncRequestedNetworks(e){Array.from(new Set(e.map(n=>n.chainNamespace))).filter(n=>!!n).forEach(n=>{var i;(i=this.appKit)==null||i.setRequestedCaipNetworks(e.filter(a=>a.chainNamespace===n),n)})}async syncAccount({address:e,chainId:r,connector:n,addresses:i,status:a}){var s,l,c,u,f,d,h,p,g,v,y,m,b,w,C,A;const o=(n==null?void 0:n.id)===Sn.AUTH_CONNECTOR_ID;if(a==="disconnected"){(s=this.appKit)==null||s.resetAccount(this.chainNamespace),(l=this.appKit)==null||l.resetWcConnection(),(c=this.appKit)==null||c.resetNetwork(),(u=this.appKit)==null||u.setAllAccounts([],this.chainNamespace),na.removeItem(ra.WALLET_ID),o&&await n.disconnect();return}if(this.wagmiConfig&&n){if(n&&n.name==="WalletConnect"&&n.getProvider&&e){const S=r||Number(Bd.caipNetworkIdToNumber((d=(f=this.appKit)==null?void 0:f.getCaipNetwork())==null?void 0:d.id)),I=await n.getProvider(),D=((h=I==null?void 0:I.session)==null?void 0:h.namespaces)||{},L=D?Object.keys(D):[],O=(p=this.appKit)==null?void 0:p.getPreferredAccountType();L.forEach(P=>{var E,N,F;const x=P,T=(E=D==null?void 0:D[P])==null?void 0:E.accounts[0];_5.setProvider(x,I),_5.setProviderId(x,"walletConnect"),(N=this.appKit)==null||N.setPreferredAccountType(O,x),(F=this.appKit)==null||F.setCaipAddress(T,x)}),((v=(g=this.appKit)==null?void 0:g.getCaipNetwork())==null?void 0:v.chainNamespace)!=="solana"&&(this.syncNetwork(e,S,!0),await Promise.all([this.syncProfile(e,S),this.syncBalance(e,S),this.syncConnectedWalletInfo(n),(y=this.appKit)==null?void 0:y.setApprovedCaipNetworksData(this.chainNamespace)]))}else if(a==="connected"&&e&&r){const S=`eip155:${r}:${e}`;this.syncNetwork(e,r,!0),(m=this.appKit)==null||m.setCaipAddress(S,this.chainNamespace),await Promise.all([this.syncProfile(e,r),this.syncBalance(e,r),this.syncConnectedWalletInfo(n),(b=this.appKit)==null?void 0:b.setApprovedCaipNetworksData(this.chainNamespace)]),n&&this.syncConnectedWalletInfo(n),!o&&(i!=null&&i.length)&&((w=this.appKit)==null||w.setAllAccounts(i.map(I=>({address:I,type:"eoa"})),this.chainNamespace))}else if(a==="reconnecting"){(C=this.appKit)==null||C.setLoading(!0);const I=YY(this.wagmiConfig).find(D=>D.id===n.id);I&&(await KY(this.wagmiConfig,{connectors:[I]}),(A=this.appKit)==null||A.setLoading(!1))}}}async syncNetwork(e,r,n){var a,o,s,l,c,u;const i=this.caipNetworks.find(f=>f.chainId===r);if(i&&r&&((s=this.appKit)==null||s.setCaipNetwork({chainId:i.chainId,id:i.id,name:i.name||"",imageId:Rf.NetworkImageIds[i.chainId],imageUrl:(o=(a=this.options)==null?void 0:a.chainImages)==null?void 0:o[i.chainId],chainNamespace:this.chainNamespace,currency:(i==null?void 0:i.currency)||"",explorerUrl:(i==null?void 0:i.explorerUrl)||"",rpcUrl:(i==null?void 0:i.rpcUrl)||""}),n&&e&&r)){const f=`eip155:${r}:${e}`;if((l=this.appKit)==null||l.setCaipAddress(f,this.chainNamespace),i!=null&&i.explorerUrl){const d=`${i.explorerUrl}/address/${e}`;(c=this.appKit)==null||c.setAddressExplorerUrl(d,this.chainNamespace)}else(u=this.appKit)==null||u.setAddressExplorerUrl(void 0,this.chainNamespace);await this.syncBalance(e,r)}}async syncReownName(e){var r,n,i;if(!this.appKit)throw new Error("syncReownName - appKit is undefined");try{const a=await this.appKit.getReownName(e);if(a[0]){const o=a[0];(r=this.appKit)==null||r.setProfileName(o.name,this.chainNamespace)}else(n=this.appKit)==null||n.setProfileName(null,this.chainNamespace)}catch{(i=this.appKit)==null||i.setProfileName(null,this.chainNamespace)}}async syncProfile(e,r){var n,i,a,o,s,l;if(!this.appKit)throw new Error("syncProfile - appKit is undefined");try{const{name:c,avatar:u}=await this.appKit.fetchIdentity({address:e});(n=this.appKit)==null||n.setProfileName(c,this.chainNamespace),(i=this.appKit)==null||i.setProfileImage(u,this.chainNamespace),c||await this.syncReownName(e)}catch{if(r===khe.id){const c=await aRt(this.wagmiConfig,{address:e,chainId:r});if(c){(a=this.appKit)==null||a.setProfileName(c,this.chainNamespace);const u=await yhe(this.wagmiConfig,{name:c,chainId:r});u&&((o=this.appKit)==null||o.setProfileImage(u,this.chainNamespace))}else await this.syncReownName(e),(s=this.appKit)==null||s.setProfileImage(null,this.chainNamespace)}else await this.syncReownName(e),(l=this.appKit)==null||l.setProfileImage(null,this.chainNamespace)}}async syncBalance(e,r){var i,a,o,s,l;const n=this.caipNetworks.find(c=>c.chainId===r);if(n&&this.wagmiConfig){const c=await rRt(this.wagmiConfig,{address:e,chainId:r,token:(o=(a=(i=this.options)==null?void 0:i.tokens)==null?void 0:a[n.id])==null?void 0:o.address});(s=this.appKit)==null||s.setBalance(c.formatted,c.symbol,this.chainNamespace);return}(l=this.appKit)==null||l.setBalance(void 0,void 0,this.chainNamespace)}async syncConnectedWalletInfo(e){var r,n,i,a;if(!e)throw Error("syncConnectedWalletInfo - connector is undefined");if(e.id===Sn.WALLET_CONNECT_CONNECTOR_ID&&e.getProvider){const o=await e.getProvider();o.session&&((n=this.appKit)==null||n.setConnectedWalletInfo({...o.session.peer.metadata,name:o.session.peer.metadata.name,icon:(r=o.session.peer.metadata.icons)==null?void 0:r[0]},this.chainNamespace))}else{const o=(i=this.appKit)==null?void 0:i.getConnectors().find(s=>s.id===e.id);(a=this.appKit)==null||a.setConnectedWalletInfo({name:e.name,icon:e.icon||this.appKit.getConnectorImage(o)},this.chainNamespace)}}syncConnectors(e){var o;const r=e.map(s=>({...s,chain:this.chainNamespace})),n=new Set,i=r.filter(s=>{const l=n.has(s.id);return n.add(s.id),!l}),a=[];i.forEach(({id:s,name:l,type:c,icon:u})=>{var d,h;Sn.AUTH_CONNECTOR_ID===s||a.push({id:s,explorerId:Rf.ConnectorExplorerIds[s],imageUrl:((h=(d=this.options)==null?void 0:d.connectorImages)==null?void 0:h[s])??u,name:Rf.ConnectorNamesMap[s]??l,imageId:Rf.ConnectorImageIds[s],type:Rf.ConnectorTypesMap[c]??"EXTERNAL",info:{rdns:s},chain:this.chainNamespace})}),(o=this.appKit)==null||o.setConnectors(a)}async syncAuthConnector(e){var n;const r=e;if(r){const i=await r.getProvider();(n=this.appKit)==null||n.addConnector({id:Sn.AUTH_CONNECTOR_ID,type:"AUTH",name:"w3mAuth",provider:i,chain:this.chainNamespace}),this.initAuthConnectorListeners(e)}}async initAuthConnectorListeners(e){e&&(await this.listenAuthConnector(e),await this.listenModal(e))}async listenAuthConnector(e,r=!1){var n,i;if(r||typeof window<"u"&&e){(n=this.appKit)==null||n.setLoading(!0);const a=await e.getProvider(),o=a.getLoginEmailUsed();(i=this.appKit)==null||i.setLoading(o),a.onRpcRequest(s=>{var l,c;ol.checkIfRequestExists(s)?ol.checkIfRequestIsSafe(s)||(l=this.appKit)==null||l.handleUnsafeRPCRequest():((c=this.appKit)==null||c.open(),console.error(xn.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:s.method}),setTimeout(()=>{var u;(u=this.appKit)==null||u.showErrorMessage(xn.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),a.rejectRpcRequests())}),a.onRpcError(()=>{var l,c,u,f;((l=this.appKit)==null?void 0:l.isOpen())&&((c=this.appKit)!=null&&c.isTransactionStackEmpty()?(u=this.appKit)==null||u.close():(f=this.appKit)==null||f.popTransactionStack(!0))}),a.onRpcSuccess((s,l)=>{var u,f,d;ol.checkIfRequestIsSafe(l)||((u=this.appKit)!=null&&u.isTransactionStackEmpty()?(f=this.appKit)==null||f.close():(d=this.appKit)==null||d.popTransactionStack())}),a.onNotConnected(()=>{var u,f,d;const s=(u=this.appKit)==null?void 0:u.getIsConnectedState(),c=na.getItem(ra.CONNECTED_CONNECTOR)==="AUTH";!s&&c&&((f=this.appKit)==null||f.setCaipAddress(void 0,this.chainNamespace),(d=this.appKit)==null||d.setLoading(!1))}),a.onIsConnected(()=>{a.connect()}),a.onConnect(s=>{var c,u,f,d,h;const l=`eip155:${s.chainId}:${s.address}`;(c=this.appKit)==null||c.setCaipAddress(l,this.chainNamespace),(u=this.appKit)==null||u.setSmartAccountDeployed(!!s.smartAccountDeployed,this.chainNamespace),(f=this.appKit)==null||f.setPreferredAccountType(s.preferredAccountType,this.chainNamespace),(d=this.appKit)==null||d.setAllAccounts(s.accounts||[{address:s.address,type:s.preferredAccountType||"eoa"}],this.chainNamespace),jn.setConnectedConnector("AUTH"),(h=this.appKit)==null||h.setLoading(!1)}),a.onGetSmartAccountEnabledNetworks(s=>{var l;(l=this.appKit)==null||l.setSmartAccountEnabledNetworks(s,this.chainNamespace)}),a.onSetPreferredAccount(({address:s,type:l})=>{var c;s&&((c=this.appKit)==null||c.setPreferredAccountType(l,this.chainNamespace),this.wagmiConfig&&KY(this.wagmiConfig,{connectors:[e]}))})}}async listenModal(e){const r=await e.getProvider();this.subscribeState(n=>{n.open||r.rejectRpcRequests()})}}const gDt=new hMt,qEe="6451479b4eb6d2967465521cb99ff677",vDt={name:"Provenance Explorer",description:"AppKit Example",url:"https://reown.com/appkit",icons:["https://assets.reown.com/reown-profile-pic.png"]},YEe=[SMt,CMt],KEe=new pDt({networks:YEe,projectId:qEe,ssr:!0});L9t({adapters:[KEe],networks:YEe,projectId:qEe,metadata:vDt,features:{analytics:!0,socials:[]}});function mDt({children:t}){return M.jsx(URt,{config:KEe.wagmiConfig,children:M.jsx(mMt,{client:gDt,children:t})})}var yDt={},ZEe={},QEe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(){for(var i=arguments.length,a=new Array(i),o=0;o"u"&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(s=window).gtag.apply(s,a)}},r=e;t.default=r})(QEe);var XEe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var e=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function r(s){return s.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(l,c,u){return c>0&&c+l.length!==u.length&&l.search(e)>-1&&u.charAt(c-2)!==":"&&(u.charAt(c+l.length)!=="-"||u.charAt(c-1)==="-")&&u.charAt(c-1).search(/[^\s-]/)<0?l.toLowerCase():l.substr(1).search(/[A-Z]|\../)>-1?l:l.charAt(0).toUpperCase()+l.substr(1)})}function n(s){return typeof s=="string"&&s.indexOf("@")!==-1}var i="REDACTED (Potential Email Address)";function a(s){return n(s)?(console.warn("This arg looks like an email address, redacting."),i):s}function o(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=s||"";return l&&(u=r(s)),c&&(u=a(u)),u}})(XEe);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.GA4=void 0;var e=o(QEe),r=o(XEe),n=["eventCategory","eventAction","eventLabel","eventValue","hitType"],i=["title","location"],a=["page","hitType"];function o(T){return T&&T.__esModule?T:{default:T}}function s(T,E){if(T==null)return{};var N=l(T,E),F,B;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(T);for(B=0;B=0)&&Object.prototype.propertyIsEnumerable.call(T,F)&&(N[F]=T[F])}return N}function l(T,E){if(T==null)return{};var N={},F=Object.keys(T),B,j;for(j=0;j=0)&&(N[B]=T[B]);return N}function c(T){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},c(T)}function u(T){return h(T)||d(T)||m(T)||f()}function f(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(T){if(typeof Symbol<"u"&&T[Symbol.iterator]!=null||T["@@iterator"]!=null)return Array.from(T)}function h(T){if(Array.isArray(T))return b(T)}function p(T,E){var N=Object.keys(T);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(T);E&&(F=F.filter(function(B){return Object.getOwnPropertyDescriptor(T,B).enumerable})),N.push.apply(N,F)}return N}function g(T){for(var E=1;ET.length)&&(E=T.length);for(var N=0,F=new Array(E);N2&&arguments[2]!==void 0?arguments[2]:"https://www.googletagmanager.com/gtag/js";if(!(typeof window>"u"||typeof document>"u")&&!E._hasLoadedGA){var j=document.createElement("script");j.async=!0,j.src="".concat(B,"?id=").concat(N),F&&j.setAttribute("nonce",F),document.body.appendChild(j),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},E._hasLoadedGA=!0}}),D(this,"_toGtagOptions",function(N){if(N){var F={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},B=Object.entries(N).reduce(function(j,k){var $=v(k,2),H=$[0],Y=$[1];return F[H]?j[F[H]]=Y:j[H]=Y,j},{});return B}}),D(this,"initialize",function(N){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!N)throw new Error("Require GA_MEASUREMENT_ID");var B=typeof N=="string"?[{trackingId:N}]:N;E._currentMeasurementId=B[0].trackingId;var j=F.gaOptions,k=F.gtagOptions,$=F.nonce,H=F.testMode,Y=H===void 0?!1:H,ie=F.gtagUrl;if(E._testMode=Y,Y||E._loadGA(E._currentMeasurementId,$,ie),E.isInitialized||(E._gtag("js",new Date),B.forEach(function(J){var ee=g(g(g({},E._toGtagOptions(g(g({},j),J.gaOptions))),k),J.gtagOptions);Object.keys(ee).length?E._gtag("config",J.trackingId,ee):E._gtag("config",J.trackingId)})),E.isInitialized=!0,!Y){var W=u(E._queueGtag);for(E._queueGtag=[],E._isQueuing=!1;W.length;){var Q=W.shift();E._gtag.apply(E,u(Q)),Q[0]==="get"&&(E._isQueuing=!0)}}}),D(this,"set",function(N){if(!N){console.warn("`fieldsObject` is required in .set()");return}if(c(N)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}Object.keys(N).length===0&&console.warn("empty `fieldsObject` given to .set()"),E._gaCommand("set",N)}),D(this,"_gaCommandSendEvent",function(N,F,B,j,k){E._gtag("event",F,g(g({event_category:N,event_label:B,value:j},k&&{non_interaction:k.nonInteraction}),E._toGtagOptions(k)))}),D(this,"_gaCommandSendEventParameters",function(){for(var N=arguments.length,F=new Array(N),B=0;B1?F-1:0),j=1;j`,f=` - (function(w,d,s,l,i){w[l]=w[l]||[]; - w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', `+JSON.stringify(n).slice(1,-1)+`}); - var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; - j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'`+l+c+`>m_cookies_win=x'; - f.parentNode.insertBefore(j,f); - })(window,document,'script','`+a+"','"+r+"');",d=this.dataLayer(i,a);return{iframe:u,script:f,dataLayerVar:d}},dataLayer:function(e,r){return` - window.`+r+" = window."+r+` || []; - window.`+r+".push("+JSON.stringify(e)+")"}},CDt=SDt,ADt=CDt,$he=TDt(ADt);function TDt(t){return t&&t.__esModule?t:{default:t}}var EDt={dataScript:function(e){var r=document.createElement("script");return r.innerHTML=e,r},gtm:function(e){var r=$he.default.tags(e),n=function(){var s=document.createElement("noscript");return s.innerHTML=r.iframe,s},i=function(){var s=document.createElement("script");return s.innerHTML=r.script,s},a=this.dataScript(r.dataLayerVar);return{noScript:n,script:i,dataScript:a}},initialize:function(e){var r=e.gtmId,n=e.events,i=n===void 0?{}:n,a=e.dataLayer,o=e.dataLayerName,s=o===void 0?"dataLayer":o,l=e.auth,c=l===void 0?"":l,u=e.preview,f=u===void 0?"":u,d=this.gtm({id:r,events:i,dataLayer:a||void 0,dataLayerName:s,auth:c,preview:f});a&&document.head.appendChild(d.dataScript),document.head.insertBefore(d.script(),document.head.childNodes[0]),document.body.insertBefore(d.noScript(),document.body.childNodes[0])},dataLayer:function(e){var r=e.dataLayer,n=e.dataLayerName,i=n===void 0?"dataLayer":n;if(window[i])return window[i].push(r);var a=$he.default.dataLayer(r,i),o=this.dataScript(a);document.head.insertBefore(o,document.head.childNodes[0])}},IDt=EDt,kDt=IDt,PDt=RDt(kDt);function RDt(t){return t&&t.__esModule?t:{default:t}}PDt.default;var JEe={exports:{}},Di={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ps=typeof Symbol=="function"&&Symbol.for,Gee=ps?Symbol.for("react.element"):60103,Wee=ps?Symbol.for("react.portal"):60106,z$=ps?Symbol.for("react.fragment"):60107,H$=ps?Symbol.for("react.strict_mode"):60108,V$=ps?Symbol.for("react.profiler"):60114,G$=ps?Symbol.for("react.provider"):60109,W$=ps?Symbol.for("react.context"):60110,qee=ps?Symbol.for("react.async_mode"):60111,q$=ps?Symbol.for("react.concurrent_mode"):60111,Y$=ps?Symbol.for("react.forward_ref"):60112,K$=ps?Symbol.for("react.suspense"):60113,MDt=ps?Symbol.for("react.suspense_list"):60120,Z$=ps?Symbol.for("react.memo"):60115,Q$=ps?Symbol.for("react.lazy"):60116,DDt=ps?Symbol.for("react.block"):60121,NDt=ps?Symbol.for("react.fundamental"):60117,ODt=ps?Symbol.for("react.responder"):60118,LDt=ps?Symbol.for("react.scope"):60119;function Ou(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Gee:switch(t=t.type,t){case qee:case q$:case z$:case V$:case H$:case K$:return t;default:switch(t=t&&t.$$typeof,t){case W$:case Y$:case Q$:case Z$:case G$:return t;default:return e}}case Wee:return e}}}function e8e(t){return Ou(t)===q$}Di.AsyncMode=qee;Di.ConcurrentMode=q$;Di.ContextConsumer=W$;Di.ContextProvider=G$;Di.Element=Gee;Di.ForwardRef=Y$;Di.Fragment=z$;Di.Lazy=Q$;Di.Memo=Z$;Di.Portal=Wee;Di.Profiler=V$;Di.StrictMode=H$;Di.Suspense=K$;Di.isAsyncMode=function(t){return e8e(t)||Ou(t)===qee};Di.isConcurrentMode=e8e;Di.isContextConsumer=function(t){return Ou(t)===W$};Di.isContextProvider=function(t){return Ou(t)===G$};Di.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Gee};Di.isForwardRef=function(t){return Ou(t)===Y$};Di.isFragment=function(t){return Ou(t)===z$};Di.isLazy=function(t){return Ou(t)===Q$};Di.isMemo=function(t){return Ou(t)===Z$};Di.isPortal=function(t){return Ou(t)===Wee};Di.isProfiler=function(t){return Ou(t)===V$};Di.isStrictMode=function(t){return Ou(t)===H$};Di.isSuspense=function(t){return Ou(t)===K$};Di.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===z$||t===q$||t===V$||t===H$||t===K$||t===MDt||typeof t=="object"&&t!==null&&(t.$$typeof===Q$||t.$$typeof===Z$||t.$$typeof===G$||t.$$typeof===W$||t.$$typeof===Y$||t.$$typeof===NDt||t.$$typeof===ODt||t.$$typeof===LDt||t.$$typeof===DDt)};Di.typeOf=Ou;JEe.exports=Di;var Yee=JEe.exports,$Dt=function(e,r,n,i){var a=n?n.call(i,e,r):void 0;if(a!==void 0)return!!a;if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var o=Object.keys(e),s=Object.keys(r);if(o.length!==s.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;coe)&&(Ce=(qe=qe.replace(" ",":")).length),0W&&(W=(Y=Y.trim()).charCodeAt(0)),W){case 38:return Y.replace(y,"$1"+H.trim());case 58:return H.trim()+Y.replace(y,"$1"+H.trim());default:if(0<1*ie&&0ee.charCodeAt(8))break;case 115:Q=Q.replace(ee,"-webkit-"+ee)+";"+Q;break;case 207:case 102:Q=Q.replace(ee,"-webkit-"+(102ie.charCodeAt(0)&&(ie=ie.trim()),$=ie,ie=[$],01?e-1:0),n=1;n0?" Args: "+r.join(", "):""))}var eNt=function(){function t(r){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=r}var e=t.prototype;return e.indexOfGroup=function(r){for(var n=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,a=i.length,o=a;r>=o;)(o<<=1)<0&&Zd(16,""+r);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=a;s=this.length||this.groupSizes[r]===0)return n;for(var i=this.groupSizes[r],a=this.indexOfGroup(r),o=a+i,s=a;s=0;c--){var u=l[c];if(u&&u.nodeType===1&&u.hasAttribute(V1))return u}}(r),a=i!==void 0?i.nextSibling:null;n.setAttribute(V1,"active"),n.setAttribute("data-styled-version","5.3.0");var o=oK();return o&&n.setAttribute("nonce",o),r.insertBefore(n,a),n},sNt=function(){function t(r){var n=this.element=n8e(r);n.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var a=document.styleSheets,o=0,s=a.length;o=0){var i=document.createTextNode(n),a=this.nodes[r];return this.element.insertBefore(i,a||null),this.length++,!0}return!1},e.deleteRule=function(r){this.element.removeChild(this.nodes[r]),this.length--},e.getRule=function(r){return r0&&(f+=d+",")}),a+=""+c+u+'{content:"'+f+`"}/*!sc*/ -`}}}return a}(this)},t}(),fNt=/(a)(d)/gi,Vhe=function(t){return String.fromCharCode(t+(t>25?39:97))};function sK(t){var e,r="";for(e=Math.abs(t);e>52;e=e/52|0)r=Vhe(e%52)+r;return(Vhe(e%52)+r).replace(fNt,"$1-$2")}var K_=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},i8e=function(t){return K_(5381,t)};function a8e(t){for(var e=0;e>>0);if(!r.hasNameForId(i,s)){var l=n(o,"."+s,void 0,i);r.insertRules(i,s,l)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=K_(this.baseHash,n.hash),f="",d=0;d>>0);if(!r.hasNameForId(i,v)){var y=n(f,"."+v,void 0,i);r.insertRules(i,v,y)}a.push(v)}}return a.join(" ")},t}(),pNt=/^\s*\/\/.*$/gm,gNt=[":","[",".","#"];function o8e(t){var e,r,n,i,a=t===void 0?m1:t,o=a.options,s=o===void 0?m1:o,l=a.plugins,c=l===void 0?GN:l,u=new FDt(s),f=[],d=function(g){function v(y){if(y)try{g(y+"}")}catch{}}return function(y,m,b,w,C,A,S,I,D,L){switch(y){case 1:if(D===0&&m.charCodeAt(0)===64)return g(m+";"),"";break;case 2:if(I===0)return m+"/*|*/";break;case 3:switch(I){case 102:case 112:return g(b[0]+m),"";default:return m+(L===0?"/*|*/":"")}case-2:m.split("/*|*/}").forEach(v)}}}(function(g){f.push(g)}),h=function(g,v,y){return v===0&&gNt.indexOf(y[r.length])!==-1||y.match(i)?g:"."+e};function p(g,v,y,m){m===void 0&&(m="&");var b=g.replace(pNt,""),w=v&&y?y+" "+v+" { "+b+" }":b;return e=m,r=v,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),u(y||!v?"":v,w)}return u.use([].concat(c,[function(g,v,y){g===2&&y.length&&y[0].lastIndexOf(r)>0&&(y[0]=y[0].replace(n,h))},d,function(g){if(g===-2){var v=f;return f=[],v}}])),p.hash=c.length?c.reduce(function(g,v){return v.name||Zd(15),K_(g,v.name)},5381).toString():"",p}var J$=Re.createContext(),vNt=J$.Consumer,Jee=Re.createContext(),s8e=(Jee.Consumer,new L5),lK=o8e();function ete(){return Z.useContext(J$)||s8e}function l8e(){return Z.useContext(Jee)||lK}function c8e(t){var e=Z.useState(t.stylisPlugins),r=e[0],n=e[1],i=ete(),a=Z.useMemo(function(){var s=i;return t.sheet?s=t.sheet:t.target&&(s=s.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(s=s.reconstructWithOptions({useCSSOMInjection:!1})),s},[t.disableCSSOMInjection,t.sheet,t.target]),o=Z.useMemo(function(){return o8e({options:{prefix:!t.disableVendorPrefixes},plugins:r})},[t.disableVendorPrefixes,r]);return Z.useEffect(function(){BDt(r,t.stylisPlugins)||n(t.stylisPlugins)},[t.stylisPlugins]),Re.createElement(J$.Provider,{value:a},Re.createElement(Jee.Provider,{value:o},t.children))}var u8e=function(){function t(e,r){var n=this;this.inject=function(i,a){a===void 0&&(a=lK);var o=n.name+a.hash;i.hasNameForId(n.id,o)||i.insertRules(n.id,o,a(n.rules,o,"@keyframes"))},this.toString=function(){return Zd(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=r}return t.prototype.getName=function(e){return e===void 0&&(e=lK),this.name+e.hash},t}(),mNt=/([A-Z])/,yNt=/([A-Z])/g,wNt=/^ms-/,bNt=function(t){return"-"+t.toLowerCase()};function Ghe(t){return mNt.test(t)?t.replace(yNt,bNt).replace(wNt,"-ms-"):t}var Whe=function(t){return t==null||t===!1||t===""};function m2(t,e,r,n){if(Array.isArray(t)){for(var i,a=[],o=0,s=t.length;o1?e-1:0),n=1;n?@[\\\]^`{|}~-]+/g,_Nt=/(^-|-$)/g;function qz(t){return t.replace(xNt,"-").replace(_Nt,"")}var rte=function(t){return sK(i8e(t)>>>0)};function P7(t){return typeof t=="string"&&!0}var cK=function(t){return typeof t=="function"||typeof t=="object"&&t!==null&&!Array.isArray(t)},SNt=function(t){return t!=="__proto__"&&t!=="constructor"&&t!=="prototype"};function CNt(t,e,r){var n=t[r];cK(e)&&cK(n)?f8e(n,e):t[r]=e}function f8e(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0||(L[I]=A[I]);return L}(e,["componentId"]),C=b&&b+"-"+(P7(m)?m:qz(aK(m)));return h8e(m,uu({},w,{attrs:d,componentId:C}),r)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(m){this._foldedDefaultProps=n?f8e({},t.defaultProps,m):m}}),p.toString=function(){return"."+p.styledComponentId},i&&Qee(p,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var se=function(t){return function e(r,n,i){if(i===void 0&&(i=m1),!Yee.isValidElementType(n))return Zd(1,String(n));var a=function(){return r(n,i,K8.apply(void 0,arguments))};return a.withConfig=function(o){return e(r,n,uu({},i,{},o))},a.attrs=function(o){return e(r,n,uu({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(h8e,t)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(t){se[t]=se(t)});var TNt=function(){function t(r,n){this.rules=r,this.componentId=n,this.isStatic=a8e(r),L5.registerId(this.componentId+1)}var e=t.prototype;return e.createStyles=function(r,n,i,a){var o=a(m2(this.rules,n,i,a).join(""),""),s=this.componentId+r;i.insertRules(s,s,o)},e.removeStyles=function(r,n){n.clearRules(this.componentId+r)},e.renderStyles=function(r,n,i,a){r>2&&L5.registerId(this.componentId+r),this.removeStyles(r,i),this.createStyles(r,n,i,a)},t}();function p8e(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1?e-1:0),n=1;n"+n+""},this.getStyleTags=function(){return r.sealed?Zd(2):r._emitSheetCSS()},this.getStyleElement=function(){var n;if(r.sealed)return Zd(2);var i=((n={})[V1]="",n["data-styled-version"]="5.3.0",n.dangerouslySetInnerHTML={__html:r.instance.toString()},n),a=oK();return a&&(i.nonce=a),[Re.createElement("style",uu({},i,{key:"sc-0-0"}))]},this.seal=function(){r.sealed=!0},this.instance=new L5({isServer:!0}),this.sealed=!1}var e=t.prototype;return e.collectStyles=function(r){return this.sealed?Zd(2):Re.createElement(c8e,{sheet:this.instance},r)},e.interleaveWithNodeStream=function(r){return Zd(3)},t}(),INt=function(t){var e=Re.forwardRef(function(r,n){var i=Z.useContext(G1),a=t.defaultProps,o=tte(r,i,a);return Re.createElement(t,uu({},r,{theme:o,ref:n}))});return Qee(e,t),e.displayName="WithTheme("+aK(t)+")",e},_i=function(){return Z.useContext(G1)},kNt={StyleSheet:L5,masterSheet:s8e};const PNt=Object.freeze(Object.defineProperty({__proto__:null,ServerStyleSheet:ENt,StyleSheetConsumer:vNt,StyleSheetContext:J$,StyleSheetManager:c8e,ThemeConsumer:ANt,ThemeContext:G1,ThemeProvider:d8e,__PRIVATE__:kNt,createGlobalStyle:p8e,css:K8,default:se,isStyledComponent:X$,keyframes:nte,useTheme:_i,version:QDt,withTheme:INt},Symbol.toStringTag,{value:"Module"}));function uK(t,e){return uK=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},uK(t,e)}function u0(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,uK(t,e)}var g8e={exports:{}},RNt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",MNt=RNt,DNt=MNt;function v8e(){}function m8e(){}m8e.resetWarningCache=v8e;var NNt=function(){function t(n,i,a,o,s,l){if(l!==DNt){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:m8e,resetWarningCache:v8e};return r.PropTypes=r,r};g8e.exports=NNt();var ONt=g8e.exports;const Ie=Un(ONt);function Ns(){return Ns=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;u--){var f=n[u];f==="."?Kz(n,u):f===".."?(Kz(n,u),c++):c&&(Kz(n,u),c--)}if(!o)for(;c--;c)n.unshift("..");o&&n[0]!==""&&(!n[0]||!R7(n[0]))&&n.unshift("");var d=n.join("/");return s&&d.substr(-1)!=="/"&&(d+="/"),d}function qhe(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}function iM(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(i,a){return iM(i,e[a])});if(typeof t=="object"||typeof e=="object"){var r=qhe(t),n=qhe(e);return r!==t||n!==e?iM(r,n):Object.keys(Object.assign({},t,e)).every(function(i){return iM(t[i],e[i])})}return!1}var $Nt="Invariant failed";function yy(t,e){throw new Error($Nt)}function JA(t){return t.charAt(0)==="/"?t:"/"+t}function Yhe(t){return t.charAt(0)==="/"?t.substr(1):t}function BNt(t,e){return t.toLowerCase().indexOf(e.toLowerCase())===0&&"/?#".indexOf(t.charAt(e.length))!==-1}function y8e(t,e){return BNt(t,e)?t.substr(e.length):t}function w8e(t){return t.charAt(t.length-1)==="/"?t.slice(0,-1):t}function FNt(t){var e=t||"/",r="",n="",i=e.indexOf("#");i!==-1&&(n=e.substr(i),e=e.substr(0,i));var a=e.indexOf("?");return a!==-1&&(r=e.substr(a),e=e.substr(0,a)),{pathname:e,search:r==="?"?"":r,hash:n==="#"?"":n}}function mf(t){var e=t.pathname,r=t.search,n=t.hash,i=e||"/";return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(i+=n.charAt(0)==="#"?n:"#"+n),i}function Bl(t,e,r,n){var i;typeof t=="string"?(i=FNt(t),i.state=e):(i=Ns({},t),i.pathname===void 0&&(i.pathname=""),i.search?i.search.charAt(0)!=="?"&&(i.search="?"+i.search):i.search="",i.hash?i.hash.charAt(0)!=="#"&&(i.hash="#"+i.hash):i.hash="",e!==void 0&&i.state===void 0&&(i.state=e));try{i.pathname=decodeURI(i.pathname)}catch(a){throw a instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):a}return r&&(i.key=r),n?i.pathname?i.pathname.charAt(0)!=="/"&&(i.pathname=LNt(i.pathname,n.pathname)):i.pathname=n.pathname:i.pathname||(i.pathname="/"),i}function jNt(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&iM(t.state,e.state)}function ite(){var t=null;function e(o){return t=o,function(){t===o&&(t=null)}}function r(o,s,l,c){if(t!=null){var u=typeof t=="function"?t(o,s):t;typeof u=="string"?typeof l=="function"?l(u,c):c(!0):c(u!==!1)}else c(!0)}var n=[];function i(o){var s=!0;function l(){s&&o.apply(void 0,arguments)}return n.push(l),function(){s=!1,n=n.filter(function(c){return c!==l})}}function a(){for(var o=arguments.length,s=new Array(o),l=0;lT?E.splice(T,E.length-T,O):E.push(O),u({action:L,location:O,index:T,entries:E})}})}function v(I,D){var L="REPLACE",O=Bl(I,D,f(),S.location);c.confirmTransitionTo(O,L,r,function(P){P&&(S.entries[S.index]=O,u({action:L,location:O}))})}function y(I){var D=Jhe(S.index+I,0,S.entries.length-1),L="POP",O=S.entries[D];c.confirmTransitionTo(O,L,r,function(P){P?u({action:L,location:O,index:D}):u()})}function m(){y(-1)}function b(){y(1)}function w(I){var D=S.index+I;return D>=0&&D-1?"[^"+Kw(t)+"]+?":Kw(e)+"|(?:(?!"+Kw(e)+")[^"+Kw(t)+"])+?"}function iOt(t,e){return C8e(ate(t,e),e)}function aOt(t){return encodeURI(t).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function oOt(t){return encodeURI(t).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function C8e(t,e){for(var r=new Array(t.length),n=0;n"u"&&($5=dte);function COt(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var AOt=$5(function(t,e){var r=t.innerRef,n=t.navigate,i=t.onClick,a=eB(t,["innerRef","navigate","onClick"]),o=a.target,s=Ns({},a,{onClick:function(c){try{i&&i(c)}catch(u){throw c.preventDefault(),u}!c.defaultPrevented&&c.button===0&&(!o||o==="_self")&&!COt(c)&&(c.preventDefault(),n())}});return dte!==$5?s.ref=e||r:s.ref=r,Re.createElement("a",s)}),Wo=$5(function(t,e){var r=t.component,n=r===void 0?AOt:r,i=t.replace,a=t.to,o=t.innerRef,s=eB(t,["component","replace","to","innerRef"]);return Re.createElement(cv.Consumer,null,function(l){l||yy();var c=l.history,u=k8e(fK(a,l.location),l.location),f=u?c.createHref(u):"",d=Ns({},s,{href:f,navigate:function(){var p=fK(a,l.location),g=i?c.replace:c.push;g(p)}});return dte!==$5?d.ref=e||o:d.innerRef=o,Re.createElement(n,d)})}),P8e=function(e){return e},YN=Re.forwardRef;typeof YN>"u"&&(YN=P8e);function TOt(){for(var t=arguments.length,e=new Array(t),r=0;rx3e(),yl=m3e,Vc=()=>{const t=ml(),e=yl(JWe),r=Z.useMemo(()=>pl(QWe,t),[t]);return{...e,...r}},Av=()=>{const t=ml(),e=yl(Lst),r=Z.useMemo(()=>pl(Nst,t),[t]);return{...e,...r}},Ki=()=>{const t=ml(),e=yl(qst),r=Z.useMemo(()=>pl(Wst,t),[t]);return{...e,...r}},wy=()=>{const t=ml(),e=yl(tlt),r=Z.useMemo(()=>pl(elt,t),[t]);return{...e,...r}},ze={WHITE:"#FFFFFF",BLACK:"#000000",BLACK30:"#00000076",GRAY_LIGHTEST:"#EEEEEE",GRAY_LIGHTER:"#D2D2D2",GRAY_LIGHT:"#A7A7A7",GRAY_PRIMARY:"#7E7E7E",GRAY_DARK:"#575757",GRAY_DARKER:"#333333",GRAY_DARKEST:"#222222",RED_LIGHTEST:"#FFAFAF",RED_LIGHTER:"#FF9F72",RED_LIGHT:"#FF7F56",RED_PRIMARY:"#FF5E3B",RED_DARK:"#FD3A1F",RED_DARKER:"#D90000",RED_DARKEST:"#A90000",GREEN_LIGHTEST:"#B2E8A6",GREEN_LIGHTER:"#89BE7E",GREEN_LIGHT:"#63975A",GREEN_PRIMARY:"#3F7237",GREEN_DARK:"#1A4E17",GREEN_DARKER:"#002D00",GREEN_DARKEST:"#001D00",BLUE_LIGHTEST:"#C3D9FF",BLUE_LIGHTER:"#A1C0F7",BLUE_LIGHT:"#6B9BF1",BLUE_PRIMARY:"#3F80F3",BLUE_DARK:"#5273ad",BLUE_DARKER:"#4b5f81",BLUE_DARKEST:"#404959",BLUE_GRAY:"#BFD7ED",TEAL_LIGHTEST:"#B9D7DC",TEAL_LIGHTER:"#7EB4BE",TEAL_LIGHT:"#598F98",TEAL_PRIMARY:"#356B74",TEAL_DARK:"#0A4952",TEAL_DARKER:"#002A32",TEAL_DARKEST:"#00191E",YELLOW_LIGHTEST:"#FFF67A",YELLOW_LIGHTER:"#F4F27D",YELLOW_LIGHT:"#BDBE4B",YELLOW_PRIMARY:"#898C15",YELLOW_DARK:"#565D00",YELLOW_DARKER:"#2E3200",YELLOW_DARKEST:"#1A2100",ORANGE_LIGHTEST:"#FEDF9B",ORANGE_LIGHTER:"#FAC653",ORANGE_LIGHT:"#C89A24",ORANGE_PRIMARY:"#976F00",ORANGE_DARK:"#694800",ORANGE_DARKER:"#4E4637",ORANGE_DARKEST:"#432300",PURPLE_LIGHTEST:"#E8C5FF",PURPLE_LIGHTER:"#D491FF",PURPLE_LIGHT:"#AC6CD6",PURPLE_PRIMARY:"#8548AF",PURPLE_DARK:"#5F2489",PURPLE_DARKER:"#3A0065",PURPLE_DARKEST:"#2A0045",IRIS_PRIMARY:"#5A4FCF",RED_NEGATIVE_PRIMARY:"#FF0000",GREEN_POSITIVE_PRIMARY:"#4ED22C"},KN={FONT_LINK:ze.BLUE_LIGHT,FONT_LINK_VISITED:ze.BLUE_LIGHT,FONT_NAV:ze.WHITE,FONT_NAV_VISITED:ze.WHITE,FONT_PRIMARY:ze.GRAY_DARKEST,FONT_SECONDARY:ze.GRAY_LIGHT,FONT_TITLE_INFO:ze.GRAY_PRIMARY,FONT_THEME:ze.BLUE_PRIMARY,FONT_WHITE:ze.WHITE,FONT_BLACK:ze.BLACK,FONT_ERROR:ze.RED_DARKER,FONT_WARNING:ze.RED_LIGHT,FONT_SUCCESS:ze.GREEN_LIGHT,FONT_DISABLED:ze.GRAY_LIGHTER,BACKGROUND_WHITE:ze.WHITE,BACKGROUND_BLACK:ze.BLACK,BACKGROUND_THEME:ze.BLUE_PRIMARY,BACKGROUND_CONTENT:ze.WHITE,BACKGROUND_DARK:ze.GRAY_DARKEST,BACKGROUND_LIGHT:ze.GRAY_LIGHTEST,BACKGROUND_NAV:ze.BLUE_DARKEST,BACKGROUND_HEADER:ze.WHITE,BACKGROUND_SUBHEADER:ze.BLUE_GRAY,BOX_SHADOW:ze.BLACK30,BUTTON_PRIMARY:ze.BLUE_PRIMARY,BUTTON_PRIMARY_HOVER:ze.BLUE_DARKER,BUTTON_PRIMARY_ACTIVE:ze.BLUE_DARK,BUTTON_PRIMARY_FOCUS:ze.BLUE_DARK,BUTTON_PRIMARY_OUTLINE:ze.BLUE_LIGHTEST,BUTTON_PRIMARY_FONT:ze.WHITE,BUTTON_SECONDARY:ze.TEAL_PRIMARY,BUTTON_SECONDARY_HOVER:ze.TEAL_DARKER,BUTTON_SECONDARY_ACTIVE:ze.TEAL_DARK,BUTTON_SECONDARY_FOCUS:ze.TEAL_DARK,BUTTON_SECONDARY_OUTLINE:ze.TEAL_LIGHTEST,BUTTON_SECONDARY_FONT:ze.WHITE,BUTTON_DISABLED:ze.GRAY_DARK,BORDER_PRIMARY:ze.GRAY_LIGHTER,BORDER_SECONDARY:ze.GRAY_PRIMARY,BORDER_THEME:ze.BLUE_PRIMARY,BORDER_DISABLED:ze.BLACK,CHIP_ACTIVE:ze.BLUE_PRIMARY,CHIP_CANDIDATE:ze.GREEN_PRIMARY,CHIP_JAILED:ze.RED_PRIMARY,ICON_WHITE:ze.WHITE,ICON_BLACK:ze.BLACK,ICON_PRIMARY:ze.BLUE_PRIMARY,ICON_SECONDARY:ze.TEAL_PRIMARY,ICON_DISABLED:ze.GRAY_PRIMARY,INPUT_BG_LIGHT:ze.WHITE,INPUT_BORDER_LIGHT:ze.GRAY_LIGHTER,INPUT_OUTLINE_LIGHT:ze.GRAY_LIGHTER,INPUT_FONT_LIGHT:ze.GRAY_DARK,INPUT_BTN_LIGHT:ze.GRAY_LIGHTEST,INPUT_BTN_LIGHT_TEXT:ze.GRAY_DARKER,INPUT_BG_DARK:ze.BLUE_DARKER,INPUT_BORDER_DARK:ze.BLUE_DARK,INPUT_OUTLINE_DARK:ze.BLUE_LIGHTER,INPUT_FONT_DARK:ze.WHITE,INPUT_PLACEHOLDER_DARK:ze.GRAY_LIGHT,INPUT_BTN_DARK:ze.BLUE_DARKEST,INPUT_BTN_DARK_TEXT:ze.WHITE,INPUT_BG_THEME:ze.BLUE_PRIMARY,INPUT_FONT_THEME:ze.BLUE_PRIMARY,INPUT_DISABLED:ze.GRAY_LIGHTEST,CHART_PIE_A:ze.BLUE_LIGHTEST,CHART_PIE_B:ze.BLUE_LIGHTER,CHART_PIE_C:ze.BLUE_LIGHT,CHART_PIE_D:ze.BLUE_PRIMARY,CHART_PIE_E:ze.BLUE_DARK,CHART_PIE_F:ze.TEAL_LIGHTEST,CHART_PIE_G:ze.TEAL_LIGHTER,CHART_PIE_H:ze.TEAL_LIGHT,CHART_PIE_I:ze.TEAL_PRIMARY,CHART_PIE_J:ze.TEAL_DARK,CHART_PIE_K:ze.RED_PRIMARY,CHART_PIE_L:ze.PURPLE_PRIMARY,CHART_PIE_M:ze.GREEN_PRIMARY,CHART_PIE_N:ze.RED_NEGATIVE_PRIMARY,CHART_PIE_YES:ze.GREEN_POSITIVE_PRIMARY,CHART_PIE_NOWITHVETO:ze.RED_NEGATIVE_PRIMARY,CHART_PIE_NO:ze.BLUE_LIGHTEST,CHART_PIE_ABSTAIN:ze.GRAY_PRIMARY,CHART_PIE_CIRCULATION:ze.GREEN_DARK,CHART_PIE_COMMUNITY:ze.YELLOW_LIGHT,CHART_PIE_BURNED:ze.RED_DARKER,CHART_PIE_BONDED:ze.TEAL_LIGHT,CHART_PIE_REMAINING:ze.PURPLE_DARK,CHART_LINE_MAIN:ze.BLUE_PRIMARY,CHART_LINE_GRADIENT_START:ze.BLUE_LIGHTER,CHART_LINE_GRADIENT_END:ze.WHITE,TOGGLE_BACKGROUND:ze.GRAY_DARK,TOGGLE_BORDER:ze.GRAY_PRIMARY,TOGGLE_NOTCH:ze.WHITE,WARNING_BORDER:ze.RED_PRIMARY,WARNING_BORDER_LIGHTER:ze.ORANGE_DARK,POSITIVE_CHANGE:ze.GREEN_POSITIVE_PRIMARY,NEGATIVE_CHANGE:ze.RED_NEGATIVE_PRIMARY,...ze},EOt={PRIMARY_FONT:"'Montserrat', sans-serif",HEADER_FONT:"'Montserrat', sans-serif",CODE_FONT:"monospace, serif",FONT_WEIGHT_THINEST:"200",FONT_WEIGHT_THIN:"300",FONT_WEIGHT_NORMAL:"500",FONT_WEIGHT_BOLD:"700",FONT_WEIGHT_BOLDEST:"900"},hte={...KN,...EOt},IOt={...hte,FONT_WEIGHT_THINEST:"200",FONT_WEIGHT_THIN:"300",FONT_WEIGHT_NORMAL:"500",FONT_WEIGHT_BOLD:"500",FONT_WEIGHT_BOLDEST:"700",BACKGROUND_LIGHT:ze.GRAY_DARKEST,BACKGROUND_CONTENT:ze.GRAY_DARKER,BACKGROUND_NAV:ze.BLACK,BACKGROUND_HEADER:ze.GRAY_DARK,BACKGROUND_THEME:ze.BLUE_DARK,BACKGROUND_SUBHEADER:ze.GRAY_DARKER,BORDER_PRIMARY:ze.GRAY_DARK,BUTTON_PRIMARY:ze.BLUE_DARK,BUTTON_PRIMARY_HOVER:ze.BLUE_DARKEST,BUTTON_PRIMARY_ACTIVE:ze.BLUE_DARKER,BUTTON_PRIMARY_FOCUS:ze.BLUE_DARKER,BUTTON_PRIMARY_OUTLINE:ze.BLUE_LIGHT,BUTTON_PRIMARY_FONT:ze.WHITE,FONT_PRIMARY:ze.WHITE,FONT_SECONDARY:ze.GRAY_LIGHT,FONT_TITLE_INFO:ze.GRAY_LIGHT,FONT_DISABLED:ze.GRAY_DARK,INPUT_BG_LIGHT:ze.GRAY_DARK,INPUT_BORDER_LIGHT:ze.GRAY_PRIMARY,INPUT_OUTLINE_LIGHT:ze.GRAY_PRIMARY,INPUT_FONT_LIGHT:ze.WHITE,INPUT_BG_DARK:ze.GRAY_DARKER,INPUT_BORDER_DARK:ze.GRAY_DARK,INPUT_OUTLINE_DARK:ze.GRAY_DARK,INPUT_FONT_DARK:ze.GRAY_LIGHTER,INPUT_BTN_DARK:ze.GRAY_DARK,INPUT_BTN_DARK_TEXT:ze.WHITE,CHART_LINE_MAIN:ze.BLUE_PRIMARY,CHART_LINE_GRADIENT_START:ze.BLUE_DARKER,CHART_LINE_GRADIENT_END:ze.BLUE_LIGHTER,CHART_PIE_A:ze.BLUE_LIGHT,CHART_PIE_B:ze.BLUE_PRIMARY,CHART_PIE_C:ze.BLUE_DARK,CHART_PIE_D:ze.BLUE_DARKER,CHART_PIE_E:ze.BLUE_DARKEST,CHART_PIE_F:ze.TEAL_LIGHT,CHART_PIE_G:ze.TEAL_PRIMARY,CHART_PIE_H:ze.TEAL_DARK,CHART_PIE_I:ze.TEAL_DARKER,CHART_PIE_J:ze.TEAL_DARKEST},kOt={...hte,BACKGROUND_LIGHT:ze.PURPLE_LIGHTER,BACKGROUND_CONTENT:ze.YELLOW_LIGHTER,BACKGROUND_NAV:ze.RED_PRIMARY,BACKGROUND_HEADER:ze.GREEN_LIGHTEST,BORDER_PRIMARY:ze.GREEN_LIGHT,BUTTON_PRIMARY:ze.GREEN_LIGHTEST,BUTTON_PRIMARY_HOVER:ze.GREEN_LIGHTER,BUTTON_PRIMARY_ACTIVE:ze.GREEN_LIGHT,BUTTON_PRIMARY_FOCUS:ze.GREEN_LIGHT,BUTTON_PRIMARY_OUTLINE:ze.GREEN_DARK,BUTTON_PRIMARY_FONT:ze.WHITE,FONT_PRIMARY:ze.RED_DARK,FONT_SECONDARY:ze.GREEN_LIGHTEST,FONT_TITLE_INFO:ze.GREEN_LIGHT,FONT_LINK:ze.PURPLE_LIGHT,INPUT_BG_LIGHT:ze.ORANGE_LIGHTER,INPUT_BORDER_LIGHT:ze.ORANGE_PRIMARY,INPUT_OUTLINE_LIGHT:ze.ORANGE_LIGHTEST,INPUT_FONT_LIGHT:ze.WHITE,INPUT_BG_DARK:ze.PURPLE_LIGHTER,INPUT_BORDER_DARK:ze.PURPLE_LIGHT,INPUT_OUTLINE_DARK:ze.PURPLE_PRIMARY,INPUT_FONT_DARK:ze.PURPLE_LIGHTEST,INPUT_BTN_DARK:ze.PURPLE_PRIMARY,INPUT_PLACEHOLDER_DARK:ze.PURPLE_DARKER,INPUT_BTN_DARK_TEXT:ze.WHITE,CHART_LINE_MAIN:ze.ORANGE_LIGHTER,CHART_LINE_GRADIENT_START:ze.PURPLE_LIGHTER,CHART_LINE_GRADIENT_END:ze.RED_PRIMARY,CHART_PIE_A:ze.RED_PRIMARY,CHART_PIE_B:ze.GREEN_LIGHTER,CHART_PIE_C:ze.BLUE_PRIMARY,CHART_PIE_D:ze.TEAL_LIGHT,CHART_PIE_E:ze.PURPLE_PRIMARY,CHART_PIE_F:ze.YELLOW_LIGHTER,CHART_PIE_G:ze.TEAL_PRIMARY,CHART_PIE_H:ze.RED_LIGHT,CHART_PIE_I:ze.PURPLE_LIGHT,CHART_PIE_J:ze.ORANGE_LIGHT},POt={default:hte,night:IOt,rainbow:kOt};var pb={};const ROt=bQ(PNt);Object.defineProperty(pb,"__esModule",{value:!0});var R8e=pb.default=pb.Normalize=pb.normalize=void 0,M8e=ROt,pte=(0,M8e.css)(['html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0;}main{display:block;}h1{font-size:2em;margin:0.67em 0;}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace,monospace;font-size:1em;}a{background-color:transparent;}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:bolder;}code,kbd,samp{font-family:monospace,monospace;font-size:1em;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sub{bottom:-0.25em;}sup{top:-0.5em;}img{border-style:none;}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible;}button,select{text-transform:none;}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button;}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0;}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText;}fieldset{padding:0.35em 0.75em 0.625em;}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline;}textarea{overflow:auto;}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto;}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block;}summary{display:list-item;}template{display:none;}[hidden]{display:none;}']);pb.normalize=pte;var MOt=(0,M8e.createGlobalStyle)(pte);pb.Normalize=MOt;var DOt=pte;R8e=pb.default=DOt;const NOt=p8e` - ${R8e} - - html { - font-size: 62.5%; /* =10px and will allow for all rem sizing to be easier, 1.4 rem => 14px*/ - } - - html, *, ::after, ::before { - box-sizing: border-box; - } - - body { - font-size: 10px; - letter-spacing: 0.045rem; - height: 100%; - min-height: 100vh; - position:relative; - } - - h1 { - font-size: 2.8rem; - } - - h2 { - font-size: 2.0rem; - } - - h3 { - font-size: 1.8rem; - } - - h4 { - font-size: 1.6rem; - } - - h5, h6 { - font-size: 1.4rem; - } - - p, span, li, footer { - font-size: 1.4rem; - font-weight: 200; - line-height: 1.75; - } - - ul { - padding-left: 20px; - } - - a { - text-decoration: none; - } -`,Qr=t=>{const[e,r]=Z.useState(window==null?void 0:window.matchMedia(t).matches);return Z.useEffect(()=>{const n=window==null?void 0:window.matchMedia(t),i=()=>{r(n.matches)};return n.matches!==e&&r(n.matches),n.addEventListener("change",i),()=>n.addEventListener("change",i)},[e,t]),{matches:e}},gte=()=>{const{theme:t}=Ki(),{matches:e}=Qr("(prefers-color-scheme: dark)"),r=t||(e?"night":"default");return{activeTheme:POt[r],themeName:r}},Dh=()=>{const t=ml(),e=yl(glt),r=Z.useMemo(()=>pl(hlt,t),[t]);return{...e,...r}},OOt=()=>{const t=ml(),e=yl(_lt),r=Z.useMemo(()=>pl(wlt,t),[t]);return{...e,...r,...blt}},vte=({data:t,count:e=10,startingPage:r=1})=>{const[n,i]=Z.useState(r),a=new va(t.length).div(e).round(0,3).toNumber(),o=new va(n).minus(1).times(e).toNumber(),s=new va(o).plus(e).toNumber(),l=t.slice(o,s);return{currentPage:n,changePage:i,tableData:l,totalPages:a}},Lu=()=>{const t=ml(),e=yl($lt),r=Z.useMemo(()=>pl(Nlt,t),[t]);return{...e,...r,...Olt}},LOt=()=>{const t=ml(),e=yl(Ylt),r=Z.useMemo(()=>pl(Wlt,t),[t]);return{...e,...r}},sx=(t,e,r)=>{const n=Z.useRef();Z.useEffect(()=>{n.current=t},[t]),Z.useEffect(()=>{const i=()=>{n.current()};if(e!==null){if(r)return()=>{};const a=setInterval(i,e);return()=>clearInterval(a)}return null},[e,r])},D8e=()=>{const t=ml(),e=yl(ect),r=Z.useMemo(()=>pl(Xlt,t),[t]);return{...e,...r}},US=()=>{const t=ml(),e=yl(fct),r=Z.useMemo(()=>pl(cct,t),[t]);return{...e,...r}},mte=()=>{const t=ml(),e=yl(wct),r=Z.useMemo(()=>pl(mct,t),[t]);return{...e,...r}},yte=()=>{const t=ml(),e=yl(kct),r=Z.useMemo(()=>pl(Ect,t),[t]);return{...e,...r}},wte=()=>{const t=ml(),e=yl(Lct),r=Z.useMemo(()=>pl(Nct,t),[t]);return{...e,...r}};var N8e={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=r(Z);function r(a){return a&&a.__esModule?a:{default:a}}var n=e.default.useCallback;function i(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=e.default.useState(a),s=o[0],l=o[1],c=n(function(){return l(function(d){return!d})}),u=n(function(){return l(!0)}),f=n(function(){return l(!1)});return[s,c,u,f]}})(N8e);const by=Un(N8e),$Ot=se.svg` - --secondaryColor: ${({secondaryColor:t})=>t}; - width: ${({size:t,width:e})=>e||t}; - height: ${({size:t,height:e})=>e||t}; - transform: ${({flipX:t})=>t&&"scaleX(-1)"} ${({flipY:t})=>t&&"scaleY(-1)"} - ${({spin:t})=>!!t&&`rotate(${t}deg)`}; - transition: ${({animate:t})=>t&&"transform 150ms linear"}; -`,Lr=({alt:t,animate:e=!1,color:r="BLUE_PRIMARY",icon:n,secondaryColor:i="WHITE",size:a="100%",spin:o=0,onClick:s,...l})=>{const c=_i(),u=c[r]?c[r]:r||c.ICON_PRIMARY,f=c[i]?c[i]:i||c.WHITE;return M.jsx($Ot,{...l,alt:t||`${n} icon`,animate:e,color:u,size:a,spin:o,secondaryColor:f,onClick:s,children:M.jsx("use",{href:`#${n}`})})};Lr.Icon=an;const BOt=se.button` - text-align: left; - display: flex; - align-items: center; - color: ${({theme:t,color:e})=>t[`BUTTON_${e}_FONT`]}; - background: ${({theme:t,color:e})=>t[`BUTTON_${e}`]}; - border-radius: 4px; - border: 1px solid ${({theme:t,color:e})=>t[`BUTTON_${e}`]}; - padding: 6px 12px; - cursor: pointer; - &:focus { - background: ${({disabled:t,theme:e,color:r})=>!t&&e[`BUTTON_${r}_FOCUS`]}; - border-color: ${({theme:t,color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } - &:hover { - background: ${({disabled:t,theme:e,color:r})=>!t&&e[`BUTTON_${r}_HOVER`]}; - border-color: ${({theme:t,color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } - &:active { - background: ${({disabled:t,theme:e,color:r})=>!t&&e[`BUTTON_${r}_ACTIVE`]}; - border-color: ${({theme:t,color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } - &:disabled { - background: ${({theme:t})=>t.BUTTON_DISABLED}; - cursor: not-allowed; - border-color: ${({theme:t})=>t.BUTTON_DISABLED}; - } -`,FOt=se.div` - font-size: 1.4rem; -`,jOt=se.div` - margin-left: 10px; - display: flex; -`,Ha=({className:t,color:e="primary",icon:r,iconSize:n="2.2rem",iconColor:i="ICON_WHITE",iconOptions:a,id:o,onClick:s=f=>{},children:l,disabled:c=!1,type:u})=>M.jsxs(BOt,{id:o,className:t,onClick:s,color:e.toUpperCase(),onKeyPress:f=>{f.key==="Enter"&&s()},disabled:c,type:u,children:[M.jsx(FOt,{children:l}),r&&M.jsx(jOt,{children:M.jsx(Lr,{...a,icon:r,size:n,color:i})})]}),UOt=se(Ha)` - text-transform: capitalize; -`,zOt=()=>{const[t,e]=Z.useState(!0),r="",[n,i,a,o]=by(!1),{isLoggedIn:s,setIsLoggedIn:l}=Ki(),[c,u]=Z.useState(!1);Z.useEffect(()=>{l(!!r)},[r,l]),Z.useEffect(()=>{let h;return t&&(h=setTimeout(()=>{e(!1)},2e3)),()=>h&&clearTimeout(h)},[t]);const f=()=>{a()};return{ManageProposalBtn:()=>s?M.jsx(UOt,{id:"gov-create",onClick:()=>f(),children:"Submit New Proposal"}):null,submitted:c,setSubmitted:u,modalFns:{modalOpen:n,toggleModalOpen:i,activateModalOpen:a,deactivateModalOpen:o}}},HOt=se(Ha)` - text-transform: capitalize; -`,bte=()=>{const t=ml(),e=yl(qct),r=Z.useMemo(()=>pl(Vct,t),[t]),[n,i]=Z.useState(!0),[a,o]=Z.useState(!1),[s,l]=Z.useState(),c="",{getAccountDelegations:u,getAccountAssets:f,getAccountRedelegations:d,getAccountRewards:h,getAccountUnbonding:p}=Vc(),[g,v,y,m]=by(!1),{isLoggedIn:b,setIsLoggedIn:w}=Ki();Z.useEffect(()=>{w(!!c)},[c,w]),Z.useEffect(()=>()=>{}),Z.useEffect(()=>{(async()=>{try{n&&b&&(f({address:c,count:100,page:1}),u({address:c,count:100,page:1}),d(c),p(c),h(c))}catch(S){console.error(S)}finally{i(!1)}})()},[n,b,c,f,u,h,d,p]),Z.useEffect(()=>{i(!0)},[b]),Z.useEffect(()=>{let S;return n&&(S=setTimeout(()=>{i(!1)},2e3)),()=>S&&clearTimeout(S)},[n]),Z.useEffect(()=>{g||o(!1)},[g]);const C=(S,I)=>{l(S),y(),o(I)};return{...e,...r,...Gct,isDelegate:a,ManageStakingBtn:({delegate:S,validator:I})=>b?M.jsx(HOt,{onClick:()=>C(I,S),children:S?"Delegate":"Manage"}):null,modalFns:{modalOpen:g,toggleModalOpen:v,activateModalOpen:y,deactivateModalOpen:m},validator:s}},$u=()=>{const t=ml(),e=yl(fut),r=Z.useMemo(()=>pl(uut,t),[t]);return{...e,...r}},js=()=>{const t=ml(),e=yl(Tut),r=Z.useMemo(()=>pl(Cut,t),[t]);return{...e,...r}},VOt=se(Ha)` - text-transform: capitalize; -`,GOt=()=>{const[t,e,r,n]=by(!1),{isLoggedIn:i,setIsLoggedIn:a}=Ki(),{getAccountDelegations:o}=Vc(),[s,l]=Z.useState(!1),c="";Z.useEffect(()=>{a(!!c)},[c,a]);const u=()=>{o({address:c}),r()},f=({title:d})=>i?M.jsxs(VOt,{id:"gov-voting",onClick:u,children:["Vote on ",d]}):null;return f.propTypes={title:Ie.string.isRequired},{ManageVotingBtn:f,voted:s,setVoted:l,modalFns:{modalOpen:t,toggleModalOpen:e,activateModalOpen:r,deactivateModalOpen:n}}},WOt=se.div` - width: 100%; - margin: ${({isOpen:t,dontDrop:e})=>t&&!e&&"16px 0"}; - border-top: ${({theme:t,isOpen:e,table:r})=>!e&&!r&&`${t.BORDER_PRIMARY} 1px solid`}; - box-shadow: ${({theme:t,isOpen:e})=>e&&`${t.BOX_SHADOW} 0px 2px 1px -1px ${t.BOX_SHADOW} 0px 1px 1px 0px ${t.BOX_SHADOW} 0px 1px 3px 0px`}; - background-color: ${({theme:t,index:e})=>e?(e+1)%2===0?t.BACKGROUND_LIGHT:"none":t.BACKGROUND_LIGHT}; - transition: margin 300ms cubic-bezier(0.165, 0.84, 0.44, 1); - - &:first-of-type { - margin: ${({isOpen:t})=>t&&"0 0 16px"}; - border-top: none; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - } - - &:last-of-type { - margin: ${({isOpen:t,dontDrop:e})=>t&&!e&&"16px 0 0"}; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - } -`,qOt=se.header` - display: grid; - grid-template-columns: ${({showChevron:t,changeColumns:e})=>t?e||"2fr 1fr":"1fr"}; - align-items: center; - padding: ${({table:t})=>t?"10px":"20px"}; - cursor: pointer; - user-select: none; -`,YOt=se.div` - padding: ${({isOpen:t})=>t&&"0 20px 20px"}; - height: ${({isOpen:t})=>t?"auto":0}px; - min-height: 0; - overflow: ${({isOpen:t})=>t?"visible":"hidden"}; - transition: height min-height 300ms cubic-bezier(0.165, 0.84, 0.44, 1); - visibility: ${({isOpen:t})=>!t&&"hidden"}; -`,zS=({children:t,showChevron:e,title:r,startOpen:n,changeColumns:i,dontDrop:a,table:o,index:s})=>{const[l,c]=Z.useState(n),u=_i(),f=()=>c(d=>!d);return M.jsxs(WOt,{isOpen:l,dontDrop:a,table:o,index:s,children:[M.jsxs(qOt,{onClick:f,isOpen:l,showChevron:e,changeColumns:i,table:o,children:[r,e&&M.jsx(Lr,{animate:!0,flipX:!0,color:u.FONT_PRIMARY,icon:an.CHEVRON,size:"1.6rem",spin:l?-90:null,style:{justifySelf:"end"}})]}),M.jsx(YOt,{isOpen:l,children:t})]})};zS.propTypes={children:Ie.any.isRequired,showChevron:Ie.bool,title:Ie.any.isRequired,startOpen:Ie.bool,changeColumns:Ie.string,dontDrop:Ie.bool,table:Ie.bool,index:Ie.number};zS.defaultProps={showChevron:!1,startOpen:!1,changeColumns:"",dontDrop:!1,table:!1,index:0};const KOt=se.div` - position: relative; - margin-left: 6px; - display: flex; - ${({fontColor:t})=>t&&`color: ${t};`} -`,ZOt=se.div` - display: flex; - flex-basis: 100%; - margin-bottom: 10px; - align-items: flex-start; - word-break: normal; -`,QOt=se.div` - min-width: ${({titleMinWidth:t})=>t||"100px"}; -`,XOt=se.div` - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - display: flex; - gap: 10px; - flex-direction: ${({column:t})=>t&&"column"}; - min-width: ${({noteMinWidth:t})=>t||"100px"}; -`,JOt=t=>{const{visibility:e={visible:!1,setVisible:()=>{}},icon:r={name:"HELP_OUTLINE",size:"1.7rem"},method:n=["click"],fontColor:i="FONT_WHITE",data:a=[],position:o="above",titleMinWidth:s="",noteMinWidth:l=""}=t,c=n.includes("hover"),u=n.includes("click"),{visible:f,setVisible:d}=e,h=({title:p,value:g,hideTitle:v=!1,externalLink:y,link:m,linkValue:b})=>M.jsxs(ZOt,{children:[!v&&M.jsx(QOt,{titleMinWidth:s,children:p}),M.jsx(XOt,{noteMinWidth:l,column:(m||y)&&b,children:y?M.jsxs(M.Fragment,{children:[g,M.jsx("a",{href:y,target:"_blank",rel:"noreferrer",children:b})]}):m?M.jsxs(M.Fragment,{children:[g," ",M.jsx(Wo,{to:m,children:b})]}):g})]},p);return M.jsxs(KOt,{onMouseEnter:c?()=>d(!0):void 0,onMouseLeave:c?()=>d(!1):void 0,fontColor:i,children:[M.jsx(B5,{show:f,position:o,zIndex:"1000",children:a.map(p=>h(p))}),M.jsx(Lr,{icon:r.name,size:r.size,onClick:u?()=>d(!f):void 0})]})},eLt=se.div` - position: absolute; - ${({minWidth:t})=>t&&`min-width: ${t};`}; - left: -30px; - ${({position:t})=>{switch(t){case"above":return"bottom: 150%;";case"below":return"top: 150%;";case"left":return"right: -35%; left: auto; top: 125%;";case"right":return"left: -35%; top: 125%;";default:return""}}} - padding: 10px 16px; - border-radius: 5px; - background: ${({theme:t})=>t.BACKGROUND_THEME}; - color: ${({theme:t})=>t.FONT_WHITE}; - font-size: 1.2rem; - box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.2); - transition: ${({delay:t})=>`opacity ${t}ms ease-in-out`}; - &.show { - opacity: 1; - } - &.hide { - opacity: 0; - } - z-index: ${({zIndex:t})=>t&&t}; -`,tLt=se(Lr)` - position: absolute; - left: 30px; - ${({position:t})=>{switch(t){case"above":return` - bottom: -13px; - `;case"below":return` - top: -13px; - transform: rotate(180deg); - `;case"right":return` - top: -13px; - left: 10px; - transform: rotate(180deg); - `;case"left":return` - top: -13px; - right: 10px; - left: auto; - transform: rotate(180deg); - `;default:return""}}} -`,B5=({show:t=!1,children:e=null,position:r="below",carat:n=!0,delay:i=250,className:a="",minWidth:o="",zIndex:s=""})=>{const[l,c]=Z.useState(!1),[u,f]=Z.useState(!1),[d,h]=Z.useState(!1),[p,g]=Z.useState(null);return Z.useEffect(()=>{const v=l!==t;if(v&&t&&!u){clearTimeout(p),f(!0),h(!1);const y=setTimeout(()=>{c(!0)},i);g(y)}else if(v&&!t&&!d){clearTimeout(p),h(!0),f(!1);const y=setTimeout(()=>{c(!1)},i);g(y)}},[t,i,p,l,u,d]),Z.useEffect(()=>()=>{clearTimeout(p)},[p]),l?M.jsxs(eLt,{delay:i,position:r,className:`${a} ${t?"show":"hide"}`,minWidth:o,zIndex:s,children:[n?M.jsx(tLt,{icon:"CARET",size:"1.8rem",position:r}):null,e]}):null},rLt=se.div` - position: relative; -`,nLt=se(Ha)` - border: none; - background: ${({notify:t,theme:e})=>t?e.BACKGROUND_THEME:"none"}; - @media ${_t.up("md")} { - margin-left: 5px; - } -`,O8e=({onClick:t})=>{const[e,r]=Z.useState(!1),{announcementNotifications:n}=Ki(),[i,a]=Z.useState(!1),o=_i(),{matches:s}=Qr(_t.down("md")),l=jS(),c=()=>{l.push("/announcements"),a(!1),t&&t()};Z.useEffect(()=>{n&&a(!0)},[a,n]);const u=s?"above":"left";return M.jsxs(rLt,{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[M.jsx(B5,{show:e,position:u,zIndex:"202",children:"Announcements"}),M.jsx(nLt,{onClick:c,notify:i,children:M.jsx(Lr,{icon:an.MEGAPHONE,color:o.FONT_NAV,size:"20px"})})]})},iLt=se.div` - display: flex; - align-items: center; - justify-content: flex-end; - margin-left: auto; - position: relative; -`,aLt=se.div` - margin: 0; - display: flex; - align-items: center; - width: 100%; - - @media ${_t.up("lg")} { - min-width: 500px; - } - - @media ${_t.down("lg")} { - min-width: 370px; - } -`,oLt=se.input` - background-color: ${({theme:t})=>t.INPUT_BG_DARK}; - color: ${({theme:t})=>t.INPUT_FONT_DARK}; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_DARK}; - border-radius: 4px; - padding: 6px 40px 6px 90px; - width: 100%; - font-size: 1.4rem; - line-height: 2.2rem; - &:focus { - outline: none; - box-shadow: 0 0 1px 1px ${({theme:t})=>t.INPUT_OUTLINE_DARK}; - } - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_DARK}; - } -`,sLt=se.div` - position: absolute; - right: 10px; - top: 6px; - cursor: pointer; -`,lLt=se.div` - position: absolute; - left: 3px; - min-width: 75px; - margin: 0px; - cursor: pointer; -`,cLt=se.div` - position: absolute; - display: flex; - -webkit-box-pack: center; - justify-content: center; - -webkit-box-align: center; - align-items: center; - right: 1px; - bottom: 1px; - border-left: none; - border-radius: 0px 4px 4px 0px; - pointer-events: none; - width: 26px; - height: 100%; -`,uLt=se.select` - background: ${({theme:t})=>t.INPUT_BTN_DARK}; - padding: 0 8px; - height: 30px; - color: ${({theme:t})=>t.INPUT_BTN_DARK_TEXT}; - border: none; - font-size: 1rem; - position: relative; - width: 100%; - border-radius: 4px; - line-height: 22px; - appearance: none; - outline: none; - cursor: pointer; -`,L8e=()=>{const[t,e]=Z.useState(""),[r,n]=Z.useState("address"),i=jS(),a=s=>{var c;const l=(c=s==null?void 0:s.target)==null?void 0:c.value;e(l)},o=()=>{if(!(!t||!t.length))switch(e(""),r){case"tx":{i.push(`/tx/${t}`);break}case"block":{i.push(`/block/${t}`);break}case"contract":{i.push(`/contract/${t}`);break}case"code":{i.push(`/code/${t}`);break}case"validator":{i.push(`/validator/${t}`);break}case"address":{i.push(`/accounts/${t}`);break}case"asset":{i.push(`/asset/${t}`);break}case"nft":{i.push(`/nft/${t}`);break}}};return M.jsxs(iLt,{children:[M.jsx(aLt,{children:M.jsx(oLt,{id:"SearchBar",onChange:a,onKeyPress:s=>{s.key==="Enter"&&o()},placeholder:"Enter Search Value",value:t})}),M.jsxs(lLt,{children:[M.jsxs(uLt,{id:"select",onChange:({target:s})=>n(s.value),label:"",value:r,children:[M.jsx("option",{value:"address",children:"Address"}),M.jsx("option",{value:"asset",children:"Asset"}),M.jsx("option",{value:"code",children:"Code"}),M.jsx("option",{value:"contract",children:"Contract"}),M.jsx("option",{value:"block",children:"Block"}),M.jsx("option",{value:"nft",children:"NFT"}),M.jsx("option",{value:"tx",children:"Tx"}),M.jsx("option",{value:"validator",children:"Validator"})]}),M.jsx(cLt,{children:M.jsx(Lr,{icon:"CARET",size:"0.9rem",color:"ICON_WHITE"})})]}),M.jsx(sLt,{onClick:o,children:M.jsx(Lr,{icon:"SEARCH",size:"2.2rem",color:"ICON_WHITE"})})]})};var $8e={},xte={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var e=r(Z);function r(i){return i&&i.__esModule?i:{default:i}}function n(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.default.useEffect(function(){if(i&&a)return window.addEventListener(i,a),function(){return window.removeEventListener(i,a)}},o)}})(xte);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=n(Z),r=n(xte);function n(a){return a&&a.__esModule?a:{default:a}}function i(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=e.default.useState(),l=s[0],c=s[1];return(0,r.default)("click",function(u){return l&&l!==u.target&&!l.contains(u.target)&&a()},o.concat(l)),c}})($8e);const B8e=Un($8e);var F8e={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=r(xte);function r(a){return a&&a.__esModule?a:{default:a}}var n=function(o){return o.key==="Escape"||o.keyCode===27};function i(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];(0,e.default)("keydown",function(s){return n(s)&&a()},o)}})(F8e);const _te=Un(F8e),fLt=se.div` - position: relative; -`,lpe=se.p` - text-align: center; - - @media ${_t.up("md")} { - white-space: nowrap; - } -`;se(Ha)` - border: none; - background: none; - /* animate.css @keyframe */ - animation: heartBeat; - animation-duration: 1s; - animation-delay: 2s; - animation-iteration-count: ${({isLoggedIn:t})=>t?0:2}; -`;const dLt=se(Ha)` - float: right; -`;se(Wo)` - &&& { - :hover { - opacity: 1; - text-decoration: underline; - } - :visited { - color: ${({theme:t})=>t.FONT_NAV_VISITED}; - } - - color: ${({theme:t})=>t.FONT_NAV}; - } -`;const rB=({isMobile:t})=>{const{isLoggedIn:e,setWalletUrl:r,setIsLoggedIn:n}=Ki();_Mt(),_i();const i=t?"above":"left",[a,o]=Z.useState(!1),[s,l,,c]=by(),u=B8e(c);_te(c),Z.useEffect(()=>{n(status==="connected")},[status,n]);const f=()=>{r(""),o(!1)},[d,h]=Z.useState(!1);return M.jsxs(fLt,{ref:u,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[M.jsx(B5,{show:!e&&a,position:i,zIndex:"201",children:"Login"}),M.jsx("w3m-button",{}),e&&M.jsxs(B5,{show:s,position:i,delay:0,zIndex:"201",children:[M.jsx(lpe,{children:"You are currently logged in as"}),M.jsx(lpe,{}),M.jsx(dLt,{color:"secondary",onClick:f,icon:an.LOGOUT,children:"Sign Out"})]}),!e&&M.jsx(HS,{isOpen:d,onClose:()=>h(!1),largeModal:!0,children:M.jsx(M.Fragment,{})})]})};rB.propTypes={isMobile:Ie.bool};rB.defaultProps={isMobile:!1};const hLt=se.div` - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; - padding: 10px 20px; - background: ${({theme:t})=>t.BACKGROUND_DARK}; -`,pLt=se.div` - display: flex; - justify-content: space-between; - width: 100%; -`,gLt=se.div` - position: relative; - margin: 10px 0; - padding-bottom: 5px; - ${({$subMenuDrop:t})=>!t&&` - &:first-of-type { - margin-top: 30px; - } - `} -`,vLt=se(Wo)` - font-size: 1.4rem; - color: ${({theme:t})=>t.FONT_NAV}; - opacity: 0.9; - :hover { - opacity: 1; - } - :visited { - color: ${({theme:t})=>t.FONT_NAV_VISITED}; - } - ${({$active:t,theme:e,$subMenuDrop:r})=>t&&` - opacity: 1; - font-weight: ${e.FONT_WEIGHT_BOLDEST}; - text-decoration: ${!r&&`underline solid ${e.FONT_NAV} 2px`}; - text-underline-offset: 3px; - `} - ${({$subMenuDrop:t})=>t&&"margin: 0 0 0 10px;"} -`,mLt=se(Lr)` - position: absolute; - margin: 4px 0 0 -35px; -`,yLt=se(Wo)` - display: flex; - align-items: center; -`,wLt=se.div` - cursor: pointer; -`,cpe=se.div` - display: ${({show:t})=>t?"block":"none"}; ; -`,bLt=se.div` - display: ${({show:t})=>t?"block":"none"}; - width: 100%; - padding: 30px 10px 10px 0; - position: relative; -`,xLt=se(Lr)` - position: absolute; - right: 0; - top: 10px; -`,_Lt=se(Lr)` - position: absolute; - right: 20px; - top: 70px; -`,SLt=()=>{const[t,e]=Z.useState(!1),[r,n]=Z.useState("none"),[i,a]=Z.useState(!1),{pathname:o}=fte(),s=()=>{n("none"),e(!1)},l=(h,{url:p,title:g,subMenu:v={}},y)=>{var w;const m=o===p,b=(w=Fm[h])==null?void 0:w.subMenu;return M.jsxs(gLt,{$subMenuDrop:y,children:[M.jsxs(vLt,{to:b?"#":p,$active:m,$subMenuDrop:y,onClick:b?r===h?()=>n("none"):()=>n(h):()=>e(!1),children:[g,b?M.jsx(mLt,{icon:"CHEVRON",height:"10px",spin:270}):null]}),M.jsx(cpe,{show:h===r,onClick:s,children:Object.keys(v).map(C=>l(C,Fm[h].subMenu[C],!0))})]},p)},c=()=>Object.keys(Fm).map(h=>l(h,Fm[h])),u=()=>{t?e(!1):d("menu")},f=()=>{i?a(!1):d("search")},d=h=>{h==="menu"?(a(!1),e(!0)):(a(!0),e(!1))};return M.jsxs(hLt,{children:[M.jsxs(pLt,{children:[M.jsx(wLt,{children:M.jsx(Lr,{icon:"MENU",onClick:u,size:"3.0rem",color:t?"ICON_PRIMARY":"ICON_WHITE"})}),M.jsx(yLt,{to:uc.HOME_URL,title:"Provenance Blockchain Explorer | Home",children:M.jsx(Lr,{icon:"LOGO",height:"32px"})}),M.jsx(Lr,{icon:"SEARCH",onClick:f,size:"3.0rem",color:i?"ICON_PRIMARY":"ICON_WHITE"})]}),M.jsxs(cpe,{show:t,children:[M.jsx(_Lt,{icon:"CLOSE",onClick:()=>{e(!1)},size:"1.4rem",color:"ICON_WHITE"}),c(),M.jsx(O8e,{onClick:()=>e(!1)}),M.jsx(rB,{isMobile:!0})]}),M.jsxs(bLt,{show:i,children:[M.jsx(xLt,{icon:"CLOSE",onClick:()=>{a(!1)},size:"1.4rem",color:"ICON_WHITE"}),M.jsx(L8e,{})]})]})},CLt=se.div` - display: flex; - align-items: center; - border-radius: 100px; - background: ${({theme:t})=>t.INPUT_BG_DARK}; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_DARK}; - position: relative; - height: 26px; - width: 52px; - /* - * the flex container sometimes messes with the width. - * explicitly setting the min and max here fixes that. - */ - min-width: 52px; - max-width: 52px; - overflow: hidden; - margin-left: 10px; - box-sizing: content-box; -`,ALt=se.div` - flex-basis: 50%; - height: 100%; -`,TLt=se.div` - flex-basis: 50%; - height: 100%; -`,ELt=se.div` - flex-basis: 100%; - height: 100%; - margin-left: 24px; - padding: 2px; -`,ILt=se.div` - border-radius: 100%; - height: 26px; - width: 26px; - background: ${({theme:t})=>t.TOGGLE_NOTCH}; - border: 3px solid ${({theme:t})=>t.TOGGLE_BACKGROUND}; - position: absolute; - top: 0px; - transform: ${({active:t})=>`translate(${t?"calc(100% - 1px)":0})`}; - transition: transform 0.5s ease-in-out; - z-index: 100; -`,Ste=({optionA:t,optionB:e,active:r,special:n})=>{const[i,a]=Z.useState(r),[o,s]=Z.useState(n.active),[l,c]=Z.useState(0);Z.useEffect(()=>{a(r)},[r]);const{title:u,icon:f,iconColor:d,action:h}=t,{title:p,icon:g,iconColor:v,action:y}=e,{title:m,icon:b,iconColor:w,action:C,count:A}=n,S=()=>{n&&!o&&A&&l+1===A?(a(!1),s(!0),C()):(l>A?c(0):c(l+1),s(!1),I())},I=()=>{const D=!i;a(D),D?y():h()};return M.jsxs(CLt,{"data-testid":"theme-switcher",onClick:S,children:[M.jsx(ILt,{active:i}),o?M.jsx(ELt,{title:m,children:b&&M.jsx(Lr,{icon:b,color:w})}):M.jsxs(M.Fragment,{children:[M.jsx(ALt,{title:u,children:f&&M.jsx(Lr,{icon:f,color:d})}),M.jsx(TLt,{title:p,children:g&&M.jsx(Lr,{icon:g,color:v})})]})]})};Ste.propTypes={active:Ie.bool,optionA:Ie.shape({title:Ie.string.isRequired,action:Ie.func.isRequired,icon:Ie.string,iconColor:Ie.string}).isRequired,optionB:Ie.shape({title:Ie.string.isRequired,action:Ie.func.isRequired,icon:Ie.string,iconColor:Ie.string}).isRequired,special:Ie.shape({title:Ie.string,action:Ie.func,icon:Ie.string,iconColor:Ie.string,count:Ie.number,active:Ie.bool})};Ste.defaultProps={active:!1,special:null};const kLt=se.div` - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - width: 100%; - padding: 0 10% 0 9%; - background: ${({theme:t})=>t.BACKGROUND_SUBHEADER}; - border: ${({theme:t})=>t.BACKGROUND_NAV}; - @media ${_t.down("lg")} { - padding: 0 4% 0 2%; - } -`,PLt=se.ul` - list-style: none; - display: flex; -`,Cte=se.li` - position: relative; - width: 100%; - text-align: left; -`,RLt=se.ul` - position: absolute; - max-height: 0; - overflow: hidden; - white-space: nowrap; - transition-delay: 300ms; - flex-direction: column; - list-style: none; - margin-left: -55px; - padding: 10px 0 0 0; - ${Cte}:hover & { - max-height: 200px; - transition-delay: 500ms; - } -`,MLt=se(Wo)` - display: flex; - background: ${({theme:t})=>t.BACKGROUND_SUBHEADER}; - font-size: 1.4rem; - opacity: 1; - :visited { - color: ${({theme:t})=>t.FONT_NAV_VISITED}; - } - ${({$active:t,theme:e,$subDrop:r})=>t&&` - opacity: 1; - font-weight: ${e.FONT_WEIGHT_BOLDEST}; - border-bottom: ${r?"0px":`2px solid ${e.FONT_NAV}`}; - `} - :first-child { - margin: 0 10px 0 0; - } - &&& { - color: ${({theme:t})=>t.FONT_PRIMARY}; - ${({$subDrop:t,theme:e})=>t&&` - :hover { - color: ${e.FONT_LINK}; - } - `} - } - padding: ${({$subDrop:t})=>t&&"3px 7px 3px 7px;"}; -`,DLt=se(Lr)` - position: absolute; - display: flex; - margin: -17px 0 0 47%; - transition-delay: 300ms; - transition-duration: 300ms; - ${Cte}:hover & { - transition-delay: 300ms; - transition-duration: 300ms; - transform: rotate(450deg); - } -`,NLt=()=>{const{pathname:t}=fte(),{matches:e}=Qr(_t.up("lg")),r=(i,{url:a,title:o,subMenu:s={}},l)=>{var f;const c=t===a,u=((f=Fm[i])==null?void 0:f.subMenu)||void 0;return M.jsx(PLt,{children:M.jsxs(Cte,{$subDrop:l,isLg:e,children:[M.jsx(MLt,{to:u?"#":a,$active:c,$subDrop:l,"data-testid":`${o.toLowerCase()}-navlink`,children:o},a),u&&M.jsxs(M.Fragment,{children:[M.jsx(DLt,{icon:"CHEVRON",height:"10px",spin:270}),M.jsx(RLt,{children:Object.keys(s).map(d=>r(d,Fm[i].subMenu[d],!0))})]})]})},a)},n=()=>Object.keys(Fm).map(i=>r(i,Fm[i],!1));return M.jsx(kLt,{children:n()})},OLt=se.div` - display: flex; - flex-direction: row; - align-items: center; - top: 0; - left: 0; - margin: 0 auto; - width: 100%; - padding: 15px; - background: ${({theme:t})=>t.BACKGROUND_NAV}; -`,LLt=()=>{const{setTheme:t}=Ki(),{themeName:e}=gte(),r=_i();return M.jsxs(M.Fragment,{children:[M.jsxs(OLt,{children:[M.jsx(Wo,{to:uc.HOME_URL,title:"Provenance Blockchain Explorer | Home",children:M.jsx(Lr,{icon:"LOGO",height:"32px"})}),M.jsx(L8e,{}),M.jsx(O8e,{}),M.jsx(rB,{}),M.jsx(Ste,{active:e==="night",optionA:{title:"Night Mode",icon:"MOON",iconColor:r.YELLOW_LIGHTEST,action:()=>{t("default")}},optionB:{title:"Day Mode",icon:"SUN",iconColor:r.ORANGE_LIGHTEST,action:()=>{t("night")}},special:{active:e==="rainbow",title:"Rainbow Mode",icon:"RAINBOW",count:10,action:()=>{t("rainbow")}}})]}),M.jsx(NLt,{})]})},$Lt=se.div` - position: fixed; - top: 0; - left: 0; - margin: 0 auto; - width: 100%; - max-width: 100vw; - z-index: 200; -`,BLt=()=>{const{matches:t}=Qr(_t.down("md"));return M.jsx($Lt,{children:t?M.jsx(SLt,{}):M.jsx(LLt,{})})},FLt=se.div` - cursor: pointer; - display: flex; - align-items: center; - position: relative; -`,jLt=se.div` - background: ${({theme:t})=>t.BACKGROUND_THEME}; - color: ${({theme:t})=>t.FONT_WHITE}; - position: absolute; - padding: 8px; - border-radius: 5px; - bottom: -50px; - left: -8px; - min-width: 75px; -`,ULt=se(Lr)` - position: absolute; - top: -14px; -`,xh=({value:t,className:e,size:r,icon:n,title:i})=>{const[a,o]=Z.useState(!1),[s,l]=Z.useState(null);Z.useEffect(()=>()=>{s&&clearTimeout(s)},[s]);const c=()=>{navigator.clipboard.writeText(t).then(()=>{clearTimeout(s),o(!0);const u=setTimeout(()=>{o(!1)},1e3);l(u)})};return M.jsxs(FLt,{title:i,onClick:c,className:e,children:[M.jsx(Lr,{size:r,icon:n}),a&&M.jsxs(jLt,{children:[M.jsx(ULt,{icon:"CARET",size:"1.8rem",flipY:!0}),"Copied!"]})]})};xh.propTypes={value:Ie.node,className:Ie.string,size:Ie.string,icon:Ie.string,title:Ie.string};xh.defaultProps={className:"",size:"1.8rem",icon:"REPORTS",title:"Copy Text",value:""};function zLt(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var j8e=Z,HLt=zLt(j8e);function upe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VLt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var GLt=!!(typeof window<"u"&&window.document&&window.document.createElement);function WLt(t,e,r){if(typeof t!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof e!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof r<"u"&&typeof r!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function n(i){return i.displayName||i.name||"Component"}return function(a){if(typeof a!="function")throw new Error("Expected WrappedComponent to be a React component.");var o=[],s;function l(){s=t(o.map(function(u){return u.props})),c.canUseDOM?e(s):r&&(s=r(s))}var c=function(u){VLt(f,u);function f(){return u.apply(this,arguments)||this}f.peek=function(){return s},f.rewind=function(){if(f.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var p=s;return s=void 0,o=[],p};var d=f.prototype;return d.UNSAFE_componentWillMount=function(){o.push(this),l()},d.componentDidUpdate=function(){l()},d.componentWillUnmount=function(){var p=o.indexOf(this);o.splice(p,1),l()},d.render=function(){return HLt.createElement(a,this.props)},f}(j8e.PureComponent);return upe(c,"displayName","SideEffect("+n(a)+")"),upe(c,"canUseDOM",GLt),c}}var qLt=WLt;const YLt=Un(qLt);var KLt=typeof Element<"u",ZLt=typeof Map=="function",QLt=typeof Set=="function",XLt=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function aM(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!aM(t[n],e[n]))return!1;return!0}var a;if(ZLt&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;for(a=t.entries();!(n=a.next()).done;)if(!aM(n.value[1],e.get(n.value[0])))return!1;return!0}if(QLt&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(XLt&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(KLt&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!aM(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var JLt=function(e,r){try{return aM(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const e$t=Un(JLt);/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var fpe=Object.getOwnPropertySymbols,t$t=Object.prototype.hasOwnProperty,r$t=Object.prototype.propertyIsEnumerable;function n$t(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function i$t(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(a){return e[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var a$t=i$t()?Object.assign:function(t,e){for(var r,n=n$t(t),i,a=1;a=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},h$t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},dK=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},p$t=function(e){var r=_3(e,bn.TITLE),n=_3(e,uE.TITLE_TEMPLATE);if(n&&r)return n.replace(/%s/g,function(){return Array.isArray(r)?r.join(""):r});var i=_3(e,uE.DEFAULT_TITLE);return r||i||void 0},g$t=function(e){return _3(e,uE.ON_CHANGE_CLIENT_STATE)||function(){}},eH=function(e,r){return r.filter(function(n){return typeof n[e]<"u"}).map(function(n){return n[e]}).reduce(function(n,i){return lc({},n,i)},{})},v$t=function(e,r){return r.filter(function(n){return typeof n[bn.BASE]<"u"}).map(function(n){return n[bn.BASE]}).reverse().reduce(function(n,i){if(!n.length)for(var a=Object.keys(i),o=0;o=0;n--){var i=e[n];if(i.hasOwnProperty(r))return i[r]}return null},m$t=function(e){return{baseTag:v$t([Aa.HREF,Aa.TARGET],e),bodyAttributes:eH(gb.BODY,e),defer:_3(e,uE.DEFER),encode:_3(e,uE.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:eH(gb.HTML,e),linkTags:o4(bn.LINK,[Aa.REL,Aa.HREF],e),metaTags:o4(bn.META,[Aa.NAME,Aa.CHARSET,Aa.HTTPEQUIV,Aa.PROPERTY,Aa.ITEM_PROP],e),noscriptTags:o4(bn.NOSCRIPT,[Aa.INNER_HTML],e),onChangeClientState:g$t(e),scriptTags:o4(bn.SCRIPT,[Aa.SRC,Aa.INNER_HTML],e),styleTags:o4(bn.STYLE,[Aa.CSS_TEXT],e),title:p$t(e),titleAttributes:eH(gb.TITLE,e)}},hK=function(){var t=Date.now();return function(e){var r=Date.now();r-t>16?(t=r,e(r)):setTimeout(function(){hK(e)},0)}}(),hpe=function(e){return clearTimeout(e)},y$t=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||hK:U8e.requestAnimationFrame||hK,w$t=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||hpe:U8e.cancelAnimationFrame||hpe,b$t=function(e){return console&&typeof console.warn=="function"&&console.warn(e)},s4=null,x$t=function(e){s4&&w$t(s4),e.defer?s4=y$t(function(){ppe(e,function(){s4=null})}):(ppe(e),s4=null)},ppe=function(e,r){var n=e.baseTag,i=e.bodyAttributes,a=e.htmlAttributes,o=e.linkTags,s=e.metaTags,l=e.noscriptTags,c=e.onChangeClientState,u=e.scriptTags,f=e.styleTags,d=e.title,h=e.titleAttributes;pK(bn.BODY,i),pK(bn.HTML,a),_$t(d,h);var p={baseTag:Wx(bn.BASE,n),linkTags:Wx(bn.LINK,o),metaTags:Wx(bn.META,s),noscriptTags:Wx(bn.NOSCRIPT,l),scriptTags:Wx(bn.SCRIPT,u),styleTags:Wx(bn.STYLE,f)},g={},v={};Object.keys(p).forEach(function(y){var m=p[y],b=m.newTags,w=m.oldTags;b.length&&(g[y]=b),w.length&&(v[y]=p[y].oldTags)}),r&&r(),c(e,g,v)},z8e=function(e){return Array.isArray(e)?e.join(""):e},_$t=function(e,r){typeof e<"u"&&document.title!==e&&(document.title=z8e(e)),pK(bn.TITLE,r)},pK=function(e,r){var n=document.getElementsByTagName(e)[0];if(n){for(var i=n.getAttribute(Qd),a=i?i.split(","):[],o=[].concat(a),s=Object.keys(r),l=0;l=0;d--)n.removeAttribute(o[d]);a.length===o.length?n.removeAttribute(Qd):n.getAttribute(Qd)!==s.join(",")&&n.setAttribute(Qd,s.join(","))}},Wx=function(e,r){var n=document.head||document.querySelector(bn.HEAD),i=n.querySelectorAll(e+"["+Qd+"]"),a=Array.prototype.slice.call(i),o=[],s=void 0;return r&&r.length&&r.forEach(function(l){var c=document.createElement(e);for(var u in l)if(l.hasOwnProperty(u))if(u===Aa.INNER_HTML)c.innerHTML=l.innerHTML;else if(u===Aa.CSS_TEXT)c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{var f=typeof l[u]>"u"?"":l[u];c.setAttribute(u,f)}c.setAttribute(Qd,"true"),a.some(function(d,h){return s=h,c.isEqualNode(d)})?a.splice(s,1):o.push(c)}),a.forEach(function(l){return l.parentNode.removeChild(l)}),o.forEach(function(l){return n.appendChild(l)}),{oldTags:a,newTags:o}},H8e=function(e){return Object.keys(e).reduce(function(r,n){var i=typeof e[n]<"u"?n+'="'+e[n]+'"':""+n;return r?r+" "+i:i},"")},S$t=function(e,r,n,i){var a=H8e(n),o=z8e(r);return a?"<"+e+" "+Qd+'="true" '+a+">"+dK(o,i)+"":"<"+e+" "+Qd+'="true">'+dK(o,i)+""},C$t=function(e,r,n){return r.reduce(function(i,a){var o=Object.keys(a).filter(function(c){return!(c===Aa.INNER_HTML||c===Aa.CSS_TEXT)}).reduce(function(c,u){var f=typeof a[u]>"u"?u:u+'="'+dK(a[u],n)+'"';return c?c+" "+f:f},""),s=a.innerHTML||a.cssText||"",l=l$t.indexOf(e)===-1;return i+"<"+e+" "+Qd+'="true" '+o+(l?"/>":">"+s+"")},"")},V8e=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(n,i){return n[ZN[i]||i]=e[i],n},r)},A$t=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(e).reduce(function(n,i){return n[s$t[i]||i]=e[i],n},r)},T$t=function(e,r,n){var i,a=(i={key:r},i[Qd]=!0,i),o=V8e(n,a);return[Re.createElement(bn.TITLE,o,r)]},E$t=function(e,r){return r.map(function(n,i){var a,o=(a={key:i},a[Qd]=!0,a);return Object.keys(n).forEach(function(s){var l=ZN[s]||s;if(l===Aa.INNER_HTML||l===Aa.CSS_TEXT){var c=n.innerHTML||n.cssText;o.dangerouslySetInnerHTML={__html:c}}else o[l]=n[s]}),Re.createElement(e,o)})},J0=function(e,r,n){switch(e){case bn.TITLE:return{toComponent:function(){return T$t(e,r.title,r.titleAttributes)},toString:function(){return S$t(e,r.title,r.titleAttributes,n)}};case gb.BODY:case gb.HTML:return{toComponent:function(){return V8e(r)},toString:function(){return H8e(r)}};default:return{toComponent:function(){return E$t(e,r)},toString:function(){return C$t(e,r,n)}}}},G8e=function(e){var r=e.baseTag,n=e.bodyAttributes,i=e.encode,a=e.htmlAttributes,o=e.linkTags,s=e.metaTags,l=e.noscriptTags,c=e.scriptTags,u=e.styleTags,f=e.title,d=f===void 0?"":f,h=e.titleAttributes;return{base:J0(bn.BASE,r,i),bodyAttributes:J0(gb.BODY,n,i),htmlAttributes:J0(gb.HTML,a,i),link:J0(bn.LINK,o,i),meta:J0(bn.META,s,i),noscript:J0(bn.NOSCRIPT,l,i),script:J0(bn.SCRIPT,c,i),style:J0(bn.STYLE,u,i),title:J0(bn.TITLE,{title:d,titleAttributes:h},i)}},I$t=function(e){var r,n;return n=r=function(i){d$t(a,i);function a(){return u$t(this,a),h$t(this,i.apply(this,arguments))}return a.prototype.shouldComponentUpdate=function(s){return!e$t(this.props,s)},a.prototype.mapNestedChildrenToProps=function(s,l){if(!l)return null;switch(s.type){case bn.SCRIPT:case bn.NOSCRIPT:return{innerHTML:l};case bn.STYLE:return{cssText:l}}throw new Error("<"+s.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},a.prototype.flattenArrayTypeChildren=function(s){var l,c=s.child,u=s.arrayTypeChildren,f=s.newChildProps,d=s.nestedChildren;return lc({},u,(l={},l[c.type]=[].concat(u[c.type]||[],[lc({},f,this.mapNestedChildrenToProps(c,d))]),l))},a.prototype.mapObjectTypeChildren=function(s){var l,c,u=s.child,f=s.newProps,d=s.newChildProps,h=s.nestedChildren;switch(u.type){case bn.TITLE:return lc({},f,(l={},l[u.type]=h,l.titleAttributes=lc({},d),l));case bn.BODY:return lc({},f,{bodyAttributes:lc({},d)});case bn.HTML:return lc({},f,{htmlAttributes:lc({},d)})}return lc({},f,(c={},c[u.type]=lc({},d),c))},a.prototype.mapArrayTypeChildrenToProps=function(s,l){var c=lc({},l);return Object.keys(s).forEach(function(u){var f;c=lc({},c,(f={},f[u]=s[u],f))}),c},a.prototype.warnOnInvalidChildren=function(s,l){return!0},a.prototype.mapChildrenToProps=function(s,l){var c=this,u={};return Re.Children.forEach(s,function(f){if(!(!f||!f.props)){var d=f.props,h=d.children,p=dpe(d,["children"]),g=A$t(p);switch(c.warnOnInvalidChildren(f,h),f.type){case bn.LINK:case bn.META:case bn.NOSCRIPT:case bn.SCRIPT:case bn.STYLE:u=c.flattenArrayTypeChildren({child:f,arrayTypeChildren:u,newChildProps:g,nestedChildren:h});break;default:l=c.mapObjectTypeChildren({child:f,newProps:l,newChildProps:g,nestedChildren:h});break}}}),l=this.mapArrayTypeChildrenToProps(u,l),l},a.prototype.render=function(){var s=this.props,l=s.children,c=dpe(s,["children"]),u=lc({},c);return l&&(u=this.mapChildrenToProps(l,u)),Re.createElement(e,u)},f$t(a,null,[{key:"canUseDOM",set:function(s){e.canUseDOM=s}}]),a}(Re.Component),r.propTypes={base:Ie.object,bodyAttributes:Ie.object,children:Ie.oneOfType([Ie.arrayOf(Ie.node),Ie.node]),defaultTitle:Ie.string,defer:Ie.bool,encodeSpecialCharacters:Ie.bool,htmlAttributes:Ie.object,link:Ie.arrayOf(Ie.object),meta:Ie.arrayOf(Ie.object),noscript:Ie.arrayOf(Ie.object),onChangeClientState:Ie.func,script:Ie.arrayOf(Ie.object),style:Ie.arrayOf(Ie.object),title:Ie.string,titleAttributes:Ie.object,titleTemplate:Ie.string},r.defaultProps={defer:!0,encodeSpecialCharacters:!0},r.peek=e.peek,r.rewind=function(){var i=e.rewind();return i||(i=G8e({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),i},n},k$t=function(){return null},P$t=YLt(m$t,x$t,G8e)(k$t),QN=I$t(P$t);QN.renderStatic=QN.rewind;const R$t=se.div` - position: absolute; - top: 110px; - left: 0; - display: flex; - width: 100%; - align-items: center; - padding: 14px 10%; - background: ${({theme:t})=>t.BACKGROUND_HEADER}; - color: ${({theme:t})=>t.FONT_PRIMARY}; - box-shadow: 0 1px 10px 0 ${({theme:t})=>t.BOX_SHADOW}; - z-index: 100; - - @media ${_t.down("lg")} { - padding: 14px 4%; - top: 110px; - } - @media ${_t.down("md")} { - padding: 10px; - top: 52px; - } -`,M$t=se.h2` - && { - margin: 0; - padding: 0; - font-size: 1.4rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - } -`,D$t=se.div` - margin: 0 12px; -`,N$t=se.div` - display: flex; - align-items: center; -`,gpe=se.div` - user-select: none; -`,to=({title:t,copyValue:e,copyTitle:r,value:n,valueLink:i,children:a})=>{const o=n||a,s=()=>M.jsxs(N$t,{children:[i?M.jsx(Wo,{to:i,children:M.jsx(gpe,{children:n})}):M.jsx(gpe,{children:n}),e?M.jsx(xh,{value:e,title:r||e}):null]});return M.jsxs(R$t,{children:[M.jsx(QN,{children:M.jsxs("title",{children:["Provenance Blockchain Explorer - ",t]})}),M.jsx(M$t,{"data-testid":"page-title",children:t}),o&&M.jsx(D$t,{children:"|"}),a,n?s():null]})},O$t=se.div``,Z8=({timestamp:t,interval:e,text:r})=>{const[n,i]=Z.useState(""),[a,o]=Z.useState(!0);return sx(()=>i(gle(t)),1e3),Z.useEffect(()=>{a&&(o(!1),i(gle(t)))},[a,t]),M.jsxs(O$t,{children:[n," ",r]})};Z8.propTypes={timestamp:Ie.string.isRequired,interval:Ie.number,text:Ie.string};Z8.defaultProps={interval:1e3,text:"ago"};const L$t=nte` - from { transform: rotate(0deg); } - to { transform: rotate(360deg); } -`,$$t=se.div` - height: 150px; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - margin: auto; - svg { - animation: ${L$t} 2s linear infinite; - } -`,Br=Re.forwardRef(({className:t,size:e},r)=>M.jsx($$t,{ref:r,className:t,children:M.jsx(Lr,{icon:"IN_PROGRESS",size:e})}));Br.propTypes={className:Ie.string,size:Ie.string};Br.defaultProps={className:"",size:"5rem"};const B$t="3.5.0",F$t=se.footer` - padding: 20px 50px; - background: ${({theme:t})=>t.BACKGROUND_NAV}; - color: ${({theme:t})=>t.FONT_SECONDARY}; - display: flex; - position: absolute; - align-items: center; - justify-content: space-between; - bottom: 0; - left: 0; - width: 100%; - z-index: 1; - flex-wrap: wrap; - @media ${_t.down("md")} { - justify-content: center; - } - @media ${_t.down("sm")} { - padding: 10px; - } -`,vpe=se.div` - @media ${_t.down("md")} { - flex-basis: 100%; - text-align: center; - } -`,j$t=se.div` - display: flex; - align-items: center; - @media ${_t.down("md")} { - flex-basis: 100%; - text-align: center; - justify-content: center; - } -`,tH=se.a` - display: block; - margin: 4px; - svg { - display: block; - } -`,U$t=se.div` - margin-left: 25px; -`,z$t=()=>{const{data:t,isLoading:e,isFetching:r}=MWe();return!e&&!r?M.jsxs(F$t,{children:[M.jsx(vpe,{children:"Provenance Blockchain Explorer"}),M.jsxs(vpe,{children:["Chain ID: ",t,M.jsxs(M.Fragment,{children:[" ","|"," ",M.jsx(Wo,{to:"/faucet",title:`${t} faucet`,children:"Faucet"})]})]}),M.jsxs(j$t,{children:[M.jsx(tH,{href:uGe,target:"_blank",rel:"noreferrer",title:"Visit Provenance Blockchain",children:M.jsx(Lr,{icon:"PROVENANCE",size:"1.8rem",color:"WHITE"})}),M.jsx(tH,{href:cGe,target:"_blank",rel:"noreferrer",title:"Provenance Blockchain Explorer GitHub",children:M.jsx(Lr,{icon:"GITHUB",size:"1.8rem",color:"WHITE"})}),M.jsx(tH,{href:fGe,target:"_blank",rel:"noreferrer",title:"Provenance Blockchain Explorer Discord",children:M.jsx(Lr,{icon:"DISCORD",size:"2.2rem",color:"WHITE"})}),M.jsxs(U$t,{children:["v",B$t]})]})]}):M.jsx(Br,{})},H$t=se.div` - padding: 6px 10px; - border-radius: 5px; - background: ${({theme:t})=>t.INPUT_BG_LIGHT}; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - position: relative; - cursor: pointer; - &:active, - &:focus { - outline: none; - border: 1px solid transparent; - box-shadow: 0 0 2px 1px ${({theme:t})=>t.INPUT_BG_THEME}; - } -`,V$t=se.div` - display: flex; - align-items: center; -`,G$t=se.div` - margin-right: 20px; -`,W$t=se(Lr)` - position: absolute; - top: -14px; - left: 14px; -`,q$t=se.div` - position: absolute; - align-items: center; - flex-wrap: wrap; - max-height: 216px; - top: 150%; - left: 0; - z-index: 100; -`,Y$t=se.div` - max-height: ${({maxHeight:t})=>t}; - overflow: ${({maxHeight:t})=>!!t&&"scroll"}; -`,K$t=se.div` - padding: 10px 20px; - background: ${({theme:t})=>t.INPUT_BG_LIGHT}; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.3); - min-width: 150px; - cursor: pointer; - &:hover { - color: ${({theme:t})=>t.INPUT_FONT_THEME}; - } -`,Z$t=se.div``,Q$t=se.div` - white-space: nowrap; - ${({active:t,theme:e})=>t&&`font-weight: bold; color:${e.FONT_THEME};`} -`,X$t=se.div` - background: ${({theme:t})=>t.BACKGROUND_WHITE}; - box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.3); - position: absolute; - left: 150px; - top: 0; - display: ${({open:t})=>t?"block":"none"}; - max-height: 216px; - overflow-y: auto; - z-index: 10; -`,J$t=se.div` - background: ${({theme:t})=>t.INPUT_BG_LIGHT}; - font-weight: initial; - white-space: nowrap; - ${({active:t,theme:e})=>t&&`font-weight: bold; color:${e.FONT_THEME};`} - &:hover { - color: ${({theme:t})=>t.FONT_THEME}; - } -`,eBt=(t={})=>{const e=Object.keys(t);for(let r=0;r{const{options:e}=t;if(!e)return null;const r=Object.keys(e);for(let n=0;n{const i=eBt(t),a=tBt(t[i]),[o,s]=Z.useState(i),[l,c]=Z.useState(a),[u,f]=Z.useState(null),[d,h]=Z.useState(t[i].title),[p,g]=Z.useState(!1);Z.useEffect(()=>{Rn(n)||(n.Filter&&s(n.Filter),n.Folder&&c(n.Folder),n.FilterTitle&&h(n.FilterTitle))},[]);const v=m=>{m.stopPropagation(),g(!p)},y=(m,b)=>Object.keys(m).map(C=>{const A=m[C],{title:S,options:I}=A;return M.jsx(K$t,{children:I?M.jsxs(Z$t,{onMouseEnter:()=>f(C),children:[M.jsx(Q$t,{active:l===C,children:`${S} >`}),M.jsx(X$t,{open:u===C,children:y(I,!0)})]}):M.jsx(J$t,{onMouseEnter:()=>b?null:f(null),active:o===C,onClick:D=>{D.stopPropagation(),g(!1),s(C),h(S),c(u||null),e(C)},children:S})},`${C}_${S}`)});return M.jsxs(H$t,{onClick:()=>g(!0),onBlur:()=>g(!1),tabIndex:"0",children:[M.jsxs(V$t,{children:[M.jsx(G$t,{children:d}),M.jsx(Lr,{icon:"CHEVRON",size:"1.0rem",color:"ICON_PRIMARY",spin:p?"90":"-90",onClick:v})]}),p&&M.jsxs(q$t,{children:[M.jsx(W$t,{icon:"CARET",size:"1.8rem",flipY:!0,color:"INPUT_BG_LIGHT"}),M.jsx(Y$t,{maxHeight:r,children:y(t)})]})]})};nB.propTypes={allOptions:Ie.object.isRequired,action:Ie.func.isRequired,maxHeight:Ie.string,setDefaults:Ie.object};nB.defaultProps={maxHeight:null,setDefaults:{}};var W8e={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var a="",o=0;o=0)&&(r[i]=t[i]);return r}function mpe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aBt(t,e,r){return t===e?!0:t.correspondingElement?t.correspondingElement.classList.contains(r):t.classList.contains(r)}function oBt(t,e,r){if(t===e)return!0;for(;t.parentNode||t.host;){if(t.parentNode&&aBt(t,e,r))return!0;t=t.parentNode||t.host}return t}function sBt(t){return document.documentElement.clientWidth<=t.clientX||document.documentElement.clientHeight<=t.clientY}var lBt=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var e=!1,r=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};return window.addEventListener("testPassiveEventSupport",n,r),window.removeEventListener("testPassiveEventSupport",n,r),e}};function cBt(t){return t===void 0&&(t=0),function(){return++t}}var uBt=cBt(),vK,M7={},rH={},fBt=["touchstart","touchmove"],dBt="ignore-react-onclickoutside";function ype(t,e){var r={},n=fBt.indexOf(e)!==-1;return n&&vK&&(r.passive=!t.props.preventDefault),r}function iB(t,e){var r,n,i=t.displayName||t.name||"Component";return n=r=function(a){nBt(o,a);function o(l){var c;return c=a.call(this,l)||this,c.__outsideClickHandler=function(u){if(typeof c.__clickOutsideHandlerProp=="function"){c.__clickOutsideHandlerProp(u);return}var f=c.getInstance();if(typeof f.props.handleClickOutside=="function"){f.props.handleClickOutside(u);return}if(typeof f.handleClickOutside=="function"){f.handleClickOutside(u);return}throw new Error("WrappedComponent: "+i+" lacks a handleClickOutside(event) function for processing outside click events.")},c.__getComponentNode=function(){var u=c.getInstance();return typeof u.setClickOutsideRef=="function"?u.setClickOutsideRef():gX.findDOMNode(u)},c.enableOnClickOutside=function(){if(!(typeof document>"u"||rH[c._uid])){typeof vK>"u"&&(vK=lBt()),rH[c._uid]=!0;var u=c.props.eventTypes;u.forEach||(u=[u]),M7[c._uid]=function(f){if(c.componentNode!==null&&!(c.initTimeStamp>f.timeStamp)&&(c.props.preventDefault&&f.preventDefault(),c.props.stopPropagation&&f.stopPropagation(),!(c.props.excludeScrollbar&&sBt(f)))){var d=f.composed&&f.composedPath&&f.composedPath().shift()||f.target;oBt(d,c.componentNode,c.props.outsideClickIgnoreClass)===document&&c.__outsideClickHandler(f)}},u.forEach(function(f){document.addEventListener(f,M7[c._uid],ype(mpe(c),f))})}},c.disableOnClickOutside=function(){delete rH[c._uid];var u=M7[c._uid];if(u&&typeof document<"u"){var f=c.props.eventTypes;f.forEach||(f=[f]),f.forEach(function(d){return document.removeEventListener(d,u,ype(mpe(c),d))}),delete M7[c._uid]}},c.getRef=function(u){return c.instanceRef=u},c._uid=uBt(),c.initTimeStamp=performance.now(),c}var s=o.prototype;return s.getInstance=function(){if(t.prototype&&!t.prototype.isReactComponent)return this;var c=this.instanceRef;return c.getInstance?c.getInstance():c},s.componentDidMount=function(){typeof document>"u"||!document.createElement||(this.getInstance(),this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside())},s.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},s.componentWillUnmount=function(){this.disableOnClickOutside()},s.render=function(){var c=this.props;c.excludeScrollbar;var u=iBt(c,["excludeScrollbar"]);return t.prototype&&t.prototype.isReactComponent?u.ref=this.getRef:u.wrappedRef=this.getRef,u.disableOnClickOutside=this.disableOnClickOutside,u.enableOnClickOutside=this.enableOnClickOutside,Z.createElement(t,u)},o}(Z.Component),r.displayName="OnClickOutside("+i+")",r.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:!1,outsideClickIgnoreClass:dBt,preventDefault:!1,stopPropagation:!1},r.getClass=function(){return t.getClass?t.getClass():t},n}var q8e=Z.createContext(),Y8e=Z.createContext();function hBt(t){var e=t.children,r=Z.useState(null),n=r[0],i=r[1],a=Z.useRef(!1);Z.useEffect(function(){return function(){a.current=!0}},[]);var o=Z.useCallback(function(s){a.current||i(s)},[]);return Z.createElement(q8e.Provider,{value:n},Z.createElement(Y8e.Provider,{value:o},e))}var K8e=function(e){return Array.isArray(e)?e[0]:e},Z8e=function(e){if(typeof e=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i"u")return!1;var e=Su(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function TBt(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},a=e.elements[r];!Ff(a)||!f0(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function EBt(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],a=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),s=o.reduce(function(l,c){return l[c]="",l},{});!Ff(i)||!f0(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const IBt={name:"applyStyles",enabled:!0,phase:"write",fn:TBt,effect:EBt,requires:["computeStyles"]};function jp(t){return t.split("-")[0]}var vb=Math.max,XN=Math.min,j5=Math.round;function yK(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J8e(){return!/^((?!chrome|android).)*safari/i.test(yK())}function U5(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Ff(t)&&(i=t.offsetWidth>0&&j5(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&j5(n.height)/t.offsetHeight||1);var o=y2(t)?Su(t):window,s=o.visualViewport,l=!J8e()&&r,c=(n.left+(l&&s?s.offsetLeft:0))/i,u=(n.top+(l&&s?s.offsetTop:0))/a,f=n.width/i,d=n.height/a;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function Ete(t){var e=U5(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function e9e(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Tte(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function uv(t){return Su(t).getComputedStyle(t)}function kBt(t){return["table","td","th"].indexOf(f0(t))>=0}function xy(t){return((y2(t)?t.ownerDocument:t.document)||window.document).documentElement}function aB(t){return f0(t)==="html"?t:t.assignedSlot||t.parentNode||(Tte(t)?t.host:null)||xy(t)}function _pe(t){return!Ff(t)||uv(t).position==="fixed"?null:t.offsetParent}function PBt(t){var e=/firefox/i.test(yK()),r=/Trident/i.test(yK());if(r&&Ff(t)){var n=uv(t);if(n.position==="fixed")return null}var i=aB(t);for(Tte(i)&&(i=i.host);Ff(i)&&["html","body"].indexOf(f0(i))<0;){var a=uv(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function X8(t){for(var e=Su(t),r=_pe(t);r&&kBt(r)&&uv(r).position==="static";)r=_pe(r);return r&&(f0(r)==="html"||f0(r)==="body"&&uv(r).position==="static")?e:r||PBt(t)||e}function Ite(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function e6(t,e,r){return vb(t,XN(e,r))}function RBt(t,e,r){var n=e6(t,e,r);return n>r?r:n}function t9e(){return{top:0,right:0,bottom:0,left:0}}function r9e(t){return Object.assign({},t9e(),t)}function n9e(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var MBt=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,r9e(typeof e!="number"?e:n9e(e,Q8))};function DBt(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=jp(r.placement),l=Ite(s),c=[Mc,Qf].indexOf(s)>=0,u=c?"height":"width";if(!(!a||!o)){var f=MBt(i.padding,r),d=Ete(a),h=l==="y"?Rc:Mc,p=l==="y"?Zf:Qf,g=r.rects.reference[u]+r.rects.reference[l]-o[l]-r.rects.popper[u],v=o[l]-r.rects.reference[l],y=X8(a),m=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,b=g/2-v/2,w=f[h],C=m-d[u]-f[p],A=m/2-d[u]/2+b,S=e6(w,A,C),I=l;r.modifiersData[n]=(e={},e[I]=S,e.centerOffset=S-A,e)}}function NBt(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||e9e(e.elements.popper,i)&&(e.elements.arrow=i))}const OBt={name:"arrow",enabled:!0,phase:"main",fn:DBt,effect:NBt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function z5(t){return t.split("-")[1]}var LBt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $Bt(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:j5(r*i)/i||0,y:j5(n*i)/i||0}}function Spe(t){var e,r=t.popper,n=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=o.x,h=d===void 0?0:d,p=o.y,g=p===void 0?0:p,v=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var y=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),b=Mc,w=Rc,C=window;if(c){var A=X8(r),S="clientHeight",I="clientWidth";if(A===Su(r)&&(A=xy(r),uv(A).position!=="static"&&s==="absolute"&&(S="scrollHeight",I="scrollWidth")),A=A,i===Rc||(i===Mc||i===Qf)&&a===fE){w=Zf;var D=f&&A===C&&C.visualViewport?C.visualViewport.height:A[S];g-=D-n.height,g*=l?1:-1}if(i===Mc||(i===Rc||i===Zf)&&a===fE){b=Qf;var L=f&&A===C&&C.visualViewport?C.visualViewport.width:A[I];h-=L-n.width,h*=l?1:-1}}var O=Object.assign({position:s},c&&LBt),P=u===!0?$Bt({x:h,y:g},Su(r)):{x:h,y:g};if(h=P.x,g=P.y,l){var x;return Object.assign({},O,(x={},x[w]=m?"0":"",x[b]=y?"0":"",x.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",x))}return Object.assign({},O,(e={},e[w]=m?g+"px":"",e[b]=y?h+"px":"",e.transform="",e))}function BBt(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,a=r.adaptive,o=a===void 0?!0:a,s=r.roundOffsets,l=s===void 0?!0:s,c={placement:jp(e.placement),variation:z5(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Spe(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Spe(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const FBt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BBt,data:{}};var D7={passive:!0};function jBt(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,l=Su(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&c.forEach(function(u){u.addEventListener("scroll",r.update,D7)}),s&&l.addEventListener("resize",r.update,D7),function(){a&&c.forEach(function(u){u.removeEventListener("scroll",r.update,D7)}),s&&l.removeEventListener("resize",r.update,D7)}}const UBt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jBt,data:{}};var zBt={left:"right",right:"left",bottom:"top",top:"bottom"};function oM(t){return t.replace(/left|right|bottom|top/g,function(e){return zBt[e]})}var HBt={start:"end",end:"start"};function Cpe(t){return t.replace(/start|end/g,function(e){return HBt[e]})}function kte(t){var e=Su(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Pte(t){return U5(xy(t)).left+kte(t).scrollLeft}function VBt(t,e){var r=Su(t),n=xy(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var c=J8e();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+Pte(t),y:l}}function GBt(t){var e,r=xy(t),n=kte(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=vb(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=vb(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+Pte(t),l=-n.scrollTop;return uv(i||r).direction==="rtl"&&(s+=vb(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}function Rte(t){var e=uv(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function i9e(t){return["html","body","#document"].indexOf(f0(t))>=0?t.ownerDocument.body:Ff(t)&&Rte(t)?t:i9e(aB(t))}function t6(t,e){var r;e===void 0&&(e=[]);var n=i9e(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=Su(n),o=i?[a].concat(a.visualViewport||[],Rte(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(t6(aB(o)))}function wK(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function WBt(t,e){var r=U5(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function Ape(t,e,r){return e===Q8e?wK(VBt(t,r)):y2(e)?WBt(e,r):wK(GBt(xy(t)))}function qBt(t){var e=t6(aB(t)),r=["absolute","fixed"].indexOf(uv(t).position)>=0,n=r&&Ff(t)?X8(t):t;return y2(n)?e.filter(function(i){return y2(i)&&e9e(i,n)&&f0(i)!=="body"}):[]}function YBt(t,e,r,n){var i=e==="clippingParents"?qBt(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(l,c){var u=Ape(t,c,n);return l.top=vb(u.top,l.top),l.right=XN(u.right,l.right),l.bottom=XN(u.bottom,l.bottom),l.left=vb(u.left,l.left),l},Ape(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function a9e(t){var e=t.reference,r=t.element,n=t.placement,i=n?jp(n):null,a=n?z5(n):null,o=e.x+e.width/2-r.width/2,s=e.y+e.height/2-r.height/2,l;switch(i){case Rc:l={x:o,y:e.y-r.height};break;case Zf:l={x:o,y:e.y+e.height};break;case Qf:l={x:e.x+e.width,y:s};break;case Mc:l={x:e.x-r.width,y:s};break;default:l={x:e.x,y:e.y}}var c=i?Ite(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(a){case F5:l[c]=l[c]-(e[u]/2-r[u]/2);break;case fE:l[c]=l[c]+(e[u]/2-r[u]/2);break}}return l}function dE(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,a=r.strategy,o=a===void 0?t.strategy:a,s=r.boundary,l=s===void 0?pBt:s,c=r.rootBoundary,u=c===void 0?Q8e:c,f=r.elementContext,d=f===void 0?l4:f,h=r.altBoundary,p=h===void 0?!1:h,g=r.padding,v=g===void 0?0:g,y=r9e(typeof v!="number"?v:n9e(v,Q8)),m=d===l4?gBt:l4,b=t.rects.popper,w=t.elements[p?m:d],C=YBt(y2(w)?w:w.contextElement||xy(t.elements.popper),l,u,o),A=U5(t.elements.reference),S=a9e({reference:A,element:b,strategy:"absolute",placement:i}),I=wK(Object.assign({},b,S)),D=d===l4?I:A,L={top:C.top-D.top+y.top,bottom:D.bottom-C.bottom+y.bottom,left:C.left-D.left+y.left,right:D.right-C.right+y.right},O=t.modifiersData.offset;if(d===l4&&O){var P=O[i];Object.keys(L).forEach(function(x){var T=[Qf,Zf].indexOf(x)>=0?1:-1,E=[Rc,Zf].indexOf(x)>=0?"y":"x";L[x]+=P[E]*T})}return L}function KBt(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?X8e:l,u=z5(n),f=u?s?xpe:xpe.filter(function(p){return z5(p)===u}):Q8,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=dE(t,{placement:g,boundary:i,rootBoundary:a,padding:o})[jp(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function ZBt(t){if(jp(t)===Ate)return[];var e=oM(t);return[Cpe(t),e,Cpe(e)]}function QBt(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!0:o,l=r.fallbackPlacements,c=r.padding,u=r.boundary,f=r.rootBoundary,d=r.altBoundary,h=r.flipVariations,p=h===void 0?!0:h,g=r.allowedAutoPlacements,v=e.options.placement,y=jp(v),m=y===v,b=l||(m||!p?[oM(v)]:ZBt(v)),w=[v].concat(b).reduce(function(ie,W){return ie.concat(jp(W)===Ate?KBt(e,{placement:W,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):W)},[]),C=e.rects.reference,A=e.rects.popper,S=new Map,I=!0,D=w[0],L=0;L=0,E=T?"width":"height",N=dE(e,{placement:O,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),F=T?x?Qf:Mc:x?Zf:Rc;C[E]>A[E]&&(F=oM(F));var B=oM(F),j=[];if(a&&j.push(N[P]<=0),s&&j.push(N[F]<=0,N[B]<=0),j.every(function(ie){return ie})){D=O,I=!1;break}S.set(O,j)}if(I)for(var k=p?3:1,$=function(W){var Q=w.find(function(J){var ee=S.get(J);if(ee)return ee.slice(0,W).every(function(ne){return ne})});if(Q)return D=Q,"break"},H=k;H>0;H--){var Y=$(H);if(Y==="break")break}e.placement!==D&&(e.modifiersData[n]._skip=!0,e.placement=D,e.reset=!0)}}const XBt={name:"flip",enabled:!0,phase:"main",fn:QBt,requiresIfExists:["offset"],data:{_skip:!1}};function Tpe(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Epe(t){return[Rc,Qf,Zf,Mc].some(function(e){return t[e]>=0})}function JBt(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=dE(e,{elementContext:"reference"}),s=dE(e,{altBoundary:!0}),l=Tpe(o,n),c=Tpe(s,i,a),u=Epe(l),f=Epe(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const eFt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:JBt};function tFt(t,e,r){var n=jp(t),i=[Mc,Rc].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[Mc,Qf].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function rFt(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=X8e.reduce(function(u,f){return u[f]=tFt(f,e.rects,a),u},{}),s=o[e.placement],l=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}const nFt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:rFt};function iFt(t){var e=t.state,r=t.name;e.modifiersData[r]=a9e({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const aFt={name:"popperOffsets",enabled:!0,phase:"read",fn:iFt,data:{}};function oFt(t){return t==="x"?"y":"x"}function sFt(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!1:o,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,f=r.padding,d=r.tether,h=d===void 0?!0:d,p=r.tetherOffset,g=p===void 0?0:p,v=dE(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),y=jp(e.placement),m=z5(e.placement),b=!m,w=Ite(y),C=oFt(w),A=e.modifiersData.popperOffsets,S=e.rects.reference,I=e.rects.popper,D=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,L=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(A){if(a){var x,T=w==="y"?Rc:Mc,E=w==="y"?Zf:Qf,N=w==="y"?"height":"width",F=A[w],B=F+v[T],j=F-v[E],k=h?-I[N]/2:0,$=m===F5?S[N]:I[N],H=m===F5?-I[N]:-S[N],Y=e.elements.arrow,ie=h&&Y?Ete(Y):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:t9e(),Q=W[T],J=W[E],ee=e6(0,S[N],ie[N]),ne=b?S[N]/2-k-ee-Q-L.mainAxis:$-ee-Q-L.mainAxis,V=b?-S[N]/2+k+ee+J+L.mainAxis:H+ee+J+L.mainAxis,oe=e.elements.arrow&&X8(e.elements.arrow),ye=oe?w==="y"?oe.clientTop||0:oe.clientLeft||0:0,Te=(x=O==null?void 0:O[w])!=null?x:0,Me=F+ne-Te-ye,Oe=F+V-Te,nt=e6(h?XN(B,Me):B,F,h?vb(j,Oe):j);A[w]=nt,P[w]=nt-F}if(s){var it,St=w==="x"?Rc:Mc,bt=w==="x"?Zf:Qf,Ce=A[C],We=C==="y"?"height":"width",Le=Ce+v[St],Ke=Ce-v[bt],qe=[Rc,Mc].indexOf(y)!==-1,we=(it=O==null?void 0:O[C])!=null?it:0,Se=qe?Le:Ce-S[We]-I[We]-we+L.altAxis,q=qe?Ce+S[We]+I[We]-we-L.altAxis:Ke,z=h&&qe?RBt(Se,Ce,q):e6(h?Se:Le,Ce,h?q:Ke);A[C]=z,P[C]=z-Ce}e.modifiersData[n]=P}}const lFt={name:"preventOverflow",enabled:!0,phase:"main",fn:sFt,requiresIfExists:["offset"]};function cFt(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function uFt(t){return t===Su(t)||!Ff(t)?kte(t):cFt(t)}function fFt(t){var e=t.getBoundingClientRect(),r=j5(e.width)/t.offsetWidth||1,n=j5(e.height)/t.offsetHeight||1;return r!==1||n!==1}function dFt(t,e,r){r===void 0&&(r=!1);var n=Ff(e),i=Ff(e)&&fFt(e),a=xy(e),o=U5(t,i,r),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((f0(e)!=="body"||Rte(a))&&(s=uFt(e)),Ff(e)?(l=U5(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=Pte(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function hFt(t){var e=new Map,r=new Set,n=[];t.forEach(function(a){e.set(a.name,a)});function i(a){r.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var l=e.get(s);l&&i(l)}}),n.push(a)}return t.forEach(function(a){r.has(a.name)||i(a)}),n}function pFt(t){var e=hFt(t);return ABt.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function gFt(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function vFt(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var Ipe={placement:"bottom",modifiers:[],strategy:"absolute"};function kpe(){for(var t=arguments.length,e=new Array(t),r=0;r"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}}();return function(){var r,n=bK(t);if(e){var i=bK(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return LFt(this,r)}}function $Ft(t){return function(e){if(Array.isArray(e))return nH(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,r){if(e){if(typeof e=="string")return nH(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nH(e,r)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function nH(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(a=NA(t,e.slice(0,t.length),new Date)),ym(a)||(a=new Date(t))),ym(a)&&s?a:null)}function ym(t,e){return e=e||new Date("1/1/1000"),i5e(t)&&Wg(t,e)}function $o(t,e,r){if(r==="en")return sn(t,e,{awareOfUnicodeTokens:!0});var n=wb(r);return r&&!n&&console.warn('A locale object was not found for the provided string ["'.concat(r,'"].')),!n&&yb()&&wb(yb())&&(n=wb(yb())),sn(t,e,{locale:n||null,awareOfUnicodeTokens:!0})}function iH(t,e){var r=e.dateFormat,n=e.locale;return t&&$o(t,Array.isArray(r)?r[0]:r,n)||""}function Ope(t,e){var r=e.hour,n=r===void 0?0:r,i=e.minute,a=i===void 0?0:i,o=e.second;return OA(LA(kKe(t,o===void 0?0:o),a),n)}function UFt(t,e){var r=yb()&&wb(yb());return zYe(t,r?{locale:r}:null)}function zFt(t,e){return $o(t,"ddd",e)}function HFt(t){return Rp(t)}function Mte(t,e,r){var n=wb(e||yb());return m5e(t,{locale:n,weekStartsOn:r})}function mb(t){return LYe(t)}function fA(t){return $Ye(t)}function VFt(t){return QW(t)}function c9e(t,e){return t&&e?dKe(t,e):!t&&!e}function Gm(t,e){return t&&e?uKe(t,e):!t&&!e}function JN(t,e){return t&&e?fKe(t,e):!t&&!e}function mc(t,e){return t&&e?OYe(t,e):!t&&!e}function Wm(t,e){return t&&e?GYe(t,e):!t&&!e}function lM(t,e,r){var n,i=Rp(e),a=ZW(r);try{n=w5e(t,{start:i,end:a})}catch{n=!1}return n}function yb(){return(typeof window<"u"?window:o9e).__localeId__}function wb(t){if(typeof t=="string"){var e=typeof window<"u"?window:o9e;return e.__localeData__?e.__localeData__[t]:null}return t}function u9e(t,e){return $o(yp(cs(),t),"LLLL",e)}function f9e(t,e){return $o(yp(cs(),t),"LLL",e)}function GFt(t,e){return $o(nA(cs(),t),"QQQ",e)}function Dte(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.maxDate,i=e.excludeDates,a=e.includeDates,o=e.filterDate;return sB(t,{minDate:r,maxDate:n})||i&&i.some(function(s){return mc(t,s)})||a&&!a.some(function(s){return mc(t,s)})||o&&!o(cs(t))||!1}function d9e(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.excludeDates;return r&&r.some(function(n){return mc(t,n)})||!1}function WFt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.maxDate,i=e.excludeDates,a=e.includeDates,o=e.filterDate;return sB(t,{minDate:r,maxDate:n})||i&&i.some(function(s){return Gm(t,s)})||a&&!a.some(function(s){return Gm(t,s)})||o&&!o(cs(t))||!1}function qFt(t,e,r,n){var i=Bi(t),a=su(t),o=Bi(e),s=su(e),l=Bi(n);return i===o&&i===l?a<=r&&r<=s:i=r||li:void 0}function YFt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.maxDate,i=e.excludeDates,a=e.includeDates,o=e.filterDate;return sB(t,{minDate:r,maxDate:n})||i&&i.some(function(s){return JN(t,s)})||a&&!a.some(function(s){return JN(t,s)})||o&&!o(cs(t))||!1}function KFt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.maxDate,i=new Date(t,0,1);return sB(i,{minDate:r,maxDate:n})||!1}function ZFt(t,e,r,n){var i=Bi(t),a=KW(t),o=Bi(e),s=KW(e),l=Bi(n);return i===o&&i===l?a<=r&&r<=s:i=r||li:void 0}function sB(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.maxDate;return r&&fD(t,r)<0||n&&fD(t,n)>0}function Lpe(t,e){return e.some(function(r){return th(r)===th(t)&&rh(r)===rh(t)})}function $pe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.excludeTimes,n=e.includeTimes,i=e.filterTime;return r&&Lpe(t,r)||n&&!Lpe(t,n)||i&&!i(t)||!1}function Bpe(t,e){var r=e.minTime,n=e.maxTime;if(!r||!n)throw new Error("Both minTime and maxTime props required");var i,a=cs(),o=OA(LA(a,rh(t)),th(t)),s=OA(LA(a,rh(r)),th(r)),l=OA(LA(a,rh(n)),th(n));try{i=!w5e(o,{start:s,end:l})}catch{i=!1}return i}function Fpe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.includeDates,i=q6(t,1);return r&&dD(r,i)>0||n&&n.every(function(a){return dD(a,i)>0})||!1}function jpe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.maxDate,n=e.includeDates,i=Gg(t,1);return r&&dD(i,r)>0||n&&n.every(function(a){return dD(i,a)>0})||!1}function Upe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.minDate,n=e.includeDates,i=vD(t,1);return r&&hD(r,i)>0||n&&n.every(function(a){return hD(a,i)>0})||!1}function zpe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.maxDate,n=e.includeDates,i=W6(t,1);return r&&hD(i,r)>0||n&&n.every(function(a){return hD(i,a)>0})||!1}function h9e(t){var e=t.minDate,r=t.includeDates;if(r&&e){var n=r.filter(function(i){return fD(i,e)>=0});return ple(n)}return r?ple(r):e}function p9e(t){var e=t.maxDate,r=t.includeDates;if(r&&e){var n=r.filter(function(i){return fD(i,e)<=0});return hle(n)}return r?hle(r):e}function Hpe(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"react-datepicker__day--highlighted",r=new Map,n=0,i=t.length;n1&&arguments[1]!==void 0?arguments[1]:12,r=Math.ceil(Bi(t)/e)*e,n=r-(e-1);return{startPeriod:n,endPeriod:r}}function XFt(t,e,r,n){for(var i=[],a=0;a<2*e+1;a++){var o=t+e-a,s=!0;r&&(s=Bi(r)<=o),n&&s&&(s=Bi(n)>=o),s&&i.push(o)}return i}var JFt=iB(function(t){ms(r,Re.Component);var e=ys(r);function r(n){var i;gs(this,r),De(je(i=e.call(this,n)),"renderOptions",function(){var l=i.props.year,c=i.state.yearsList.map(function(d){return Re.createElement("div",{className:l===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:i.onChange.bind(je(i),d)},l===d?Re.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),u=i.props.minDate?Bi(i.props.minDate):null,f=i.props.maxDate?Bi(i.props.maxDate):null;return f&&i.state.yearsList.find(function(d){return d===f})||c.unshift(Re.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:i.incrementYears},Re.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),u&&i.state.yearsList.find(function(d){return d===u})||c.push(Re.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:i.decrementYears},Re.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c}),De(je(i),"onChange",function(l){i.props.onChange(l)}),De(je(i),"handleClickOutside",function(){i.props.onCancel()}),De(je(i),"shiftYears",function(l){var c=i.state.yearsList.map(function(u){return u+l});i.setState({yearsList:c})}),De(je(i),"incrementYears",function(){return i.shiftYears(1)}),De(je(i),"decrementYears",function(){return i.shiftYears(-1)});var a=n.yearDropdownItemNumber,o=n.scrollableYearDropdown,s=a||(o?10:5);return i.state={yearsList:XFt(i.props.year,s,i.props.minDate,i.props.maxDate)},i}return vs(r,[{key:"render",value:function(){var n=Pc({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return Re.createElement("div",{className:n},this.renderOptions())}}]),r}()),ejt=function(t){ms(r,Re.Component);var e=ys(r);function r(){var n;gs(this,r);for(var i=arguments.length,a=new Array(i),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},l=!1;n.getTabIndex()===0&&!s.isInputFocused&&n.isSameDay(n.props.preSelection)&&(document.activeElement&&document.activeElement!==document.body||(l=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(l=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement.classList.contains("react-datepicker__day")&&(l=!0)),l&&n.dayEl.current.focus({preventScroll:!0})}),De(je(n),"renderDayContents",function(){return n.isOutsideMonth()&&(n.props.monthShowsDuplicateDaysEnd&&WI(n.props.day)<10||n.props.monthShowsDuplicateDaysStart&&WI(n.props.day)>20)?null:n.props.renderDayContents?n.props.renderDayContents(WI(n.props.day),n.props.day):WI(n.props.day)}),De(je(n),"render",function(){return Re.createElement("div",{ref:n.dayEl,className:n.getClassNames(n.props.day),onKeyDown:n.handleOnKeyDown,onClick:n.handleClick,onMouseEnter:n.handleMouseEnter,tabIndex:n.getTabIndex(),"aria-label":n.getAriaLabel(),role:"button","aria-disabled":n.isDisabled()},n.renderDayContents())}),n}return vs(r,[{key:"componentDidMount",value:function(){this.handleFocusDay()}},{key:"componentDidUpdate",value:function(n){this.handleFocusDay(n)}}]),r}(),sjt=function(t){ms(r,Re.Component);var e=ys(r);function r(){var n;gs(this,r);for(var i=arguments.length,a=new Array(i),o=0;o=6,h=!l&&!n.isWeekInMonth(f);if(d||h){if(!n.props.peekNextMonth)break;u=!0}}return s}),De(je(n),"onMonthClick",function(s,l){n.handleDayClick(mb(yp(n.props.day,l)),s)}),De(je(n),"handleMonthNavigation",function(s,l){n.isDisabled(l)||n.isExcluded(l)||(n.props.setPreSelection(l),n.MONTH_REFS[s].current&&n.MONTH_REFS[s].current.focus())}),De(je(n),"onMonthKeyDown",function(s,l){var c=s.key;if(!n.props.disabledKeyboardNavigation)switch(c){case"Enter":n.onMonthClick(s,l),n.props.setPreSelection(n.props.selected);break;case"ArrowRight":n.handleMonthNavigation(l===11?0:l+1,Gg(n.props.preSelection,1));break;case"ArrowLeft":n.handleMonthNavigation(l===0?11:l-1,q6(n.props.preSelection,1))}}),De(je(n),"onQuarterClick",function(s,l){n.handleDayClick(VFt(nA(n.props.day,l)),s)}),De(je(n),"getMonthClassNames",function(s){var l=n.props,c=l.day,u=l.startDate,f=l.endDate,d=l.selected,h=l.minDate,p=l.maxDate,g=l.preSelection,v=l.monthClassName,y=v?v(c):void 0;return Pc("react-datepicker__month-text","react-datepicker__month-".concat(s),y,{"react-datepicker__month--disabled":(h||p)&&WFt(yp(c,s),n.props),"react-datepicker__month--selected":su(c)===s&&Bi(c)===Bi(d),"react-datepicker__month-text--keyboard-selected":su(g)===s,"react-datepicker__month--in-range":qFt(u,f,s,c),"react-datepicker__month--range-start":n.isRangeStartMonth(s),"react-datepicker__month--range-end":n.isRangeEndMonth(s)})}),De(je(n),"getTabIndex",function(s){var l=su(n.props.preSelection);return n.props.disabledKeyboardNavigation||s!==l?"-1":"0"}),De(je(n),"getAriaLabel",function(s){var l=n.props,c=l.ariaLabelPrefix,u=c===void 0?"Choose":c,f=l.disabledDayAriaLabelPrefix,d=f===void 0?"Not available":f,h=l.day,p=yp(h,s),g=n.isDisabled(p)||n.isExcluded(p)?d:u;return"".concat(g," ").concat($o(p,"MMMM yyyy"))}),De(je(n),"getQuarterClassNames",function(s){var l=n.props,c=l.day,u=l.startDate,f=l.endDate,d=l.selected,h=l.minDate,p=l.maxDate;return Pc("react-datepicker__quarter-text","react-datepicker__quarter-".concat(s),{"react-datepicker__quarter--disabled":(h||p)&&YFt(nA(c,s),n.props),"react-datepicker__quarter--selected":KW(c)===s&&Bi(c)===Bi(d),"react-datepicker__quarter--in-range":ZFt(u,f,s,c),"react-datepicker__quarter--range-start":n.isRangeStartQuarter(s),"react-datepicker__quarter--range-end":n.isRangeEndQuarter(s)})}),De(je(n),"renderMonths",function(){var s=n.props,l=s.showFullMonthYearPicker,c=s.showTwoColumnMonthYearPicker,u=s.showFourColumnMonthYearPicker,f=s.locale;return(u?[[0,1,2,3],[4,5,6,7],[8,9,10,11]]:c?[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]]:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]]).map(function(d,h){return Re.createElement("div",{className:"react-datepicker__month-wrapper",key:h},d.map(function(p,g){return Re.createElement("div",{ref:n.MONTH_REFS[p],key:g,onClick:function(v){n.onMonthClick(v,p)},onKeyDown:function(v){n.onMonthKeyDown(v,p)},tabIndex:n.getTabIndex(p),className:n.getMonthClassNames(p),role:"button","aria-label":n.getAriaLabel(p)},l?u9e(p,f):f9e(p,f))}))})}),De(je(n),"renderQuarters",function(){return Re.createElement("div",{className:"react-datepicker__quarter-wrapper"},[1,2,3,4].map(function(s,l){return Re.createElement("div",{key:l,onClick:function(c){n.onQuarterClick(c,s)},className:n.getQuarterClassNames(s)},GFt(s,n.props.locale))}))}),De(je(n),"getClassNames",function(){var s=n.props;s.day;var l=s.selectingDate,c=s.selectsStart,u=s.selectsEnd,f=s.showMonthYearPicker,d=s.showQuarterYearPicker;return Pc("react-datepicker__month",{"react-datepicker__month--selecting-range":l&&(c||u)},{"react-datepicker__monthPicker":f},{"react-datepicker__quarterPicker":d})}),n}return vs(r,[{key:"render",value:function(){var n=this.props,i=n.showMonthYearPicker,a=n.showQuarterYearPicker,o=n.day,s=n.ariaLabelPrefix,l=s===void 0?"month ":s;return Re.createElement("div",{className:this.getClassNames(),onMouseLeave:this.handleMouseLeave,"aria-label":"".concat(l," ").concat($o(o,"yyyy-MM"))},i?this.renderMonths():a?this.renderQuarters():this.renderWeeks())}}]),r}(),g9e=function(t){ms(r,Re.Component);var e=ys(r);function r(){var n;gs(this,r);for(var i=arguments.length,a=new Array(i),o=0;o0&&arguments[0]!==void 0?arguments[0]:{}).className||"").split(/\s+/);return hjt.some(function(s){return o.indexOf(s)>=0})})(a.target)&&i.props.onDropdownFocus()}),De(je(i),"getDateInView",function(){var a=i.props,o=a.preSelection,s=a.selected,l=a.openToDate,c=h9e(i.props),u=p9e(i.props),f=cs(),d=l||s||o;return d||(c&&jm(f,c)?c:u&&Wg(f,u)?u:f)}),De(je(i),"increaseMonth",function(){i.setState(function(a){var o=a.date;return{date:Gg(o,1)}},function(){return i.handleMonthChange(i.state.date)})}),De(je(i),"decreaseMonth",function(){i.setState(function(a){var o=a.date;return{date:q6(o,1)}},function(){return i.handleMonthChange(i.state.date)})}),De(je(i),"handleDayClick",function(a,o,s){i.props.onSelect(a,o,s),i.props.setPreSelection&&i.props.setPreSelection(a)}),De(je(i),"handleDayMouseEnter",function(a){i.setState({selectingDate:a}),i.props.onDayMouseEnter&&i.props.onDayMouseEnter(a)}),De(je(i),"handleMonthMouseLeave",function(){i.setState({selectingDate:null}),i.props.onMonthMouseLeave&&i.props.onMonthMouseLeave()}),De(je(i),"handleYearChange",function(a){i.props.onYearChange&&i.props.onYearChange(a),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(a),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(a)}),De(je(i),"handleMonthChange",function(a){i.props.onMonthChange&&i.props.onMonthChange(a),i.props.adjustDateOnChange&&(i.props.onSelect&&i.props.onSelect(a),i.props.setOpen&&i.props.setOpen(!0)),i.props.setPreSelection&&i.props.setPreSelection(a)}),De(je(i),"handleMonthYearChange",function(a){i.handleYearChange(a),i.handleMonthChange(a)}),De(je(i),"changeYear",function(a){i.setState(function(o){var s=o.date;return{date:gD(s,a)}},function(){return i.handleYearChange(i.state.date)})}),De(je(i),"changeMonth",function(a){i.setState(function(o){var s=o.date;return{date:yp(s,a)}},function(){return i.handleMonthChange(i.state.date)})}),De(je(i),"changeMonthYear",function(a){i.setState(function(o){var s=o.date;return{date:gD(yp(s,su(a)),Bi(a))}},function(){return i.handleMonthYearChange(i.state.date)})}),De(je(i),"header",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i.state.date,o=Mte(a,i.props.locale,i.props.calendarStartDay),s=[];return i.props.showWeekNumbers&&s.push(Re.createElement("div",{key:"W",className:"react-datepicker__day-name"},i.props.weekLabel||"#")),s.concat([0,1,2,3,4,5,6].map(function(l){var c=$2(o,l),u=i.formatWeekday(c,i.props.locale),f=i.props.weekDayClassName?i.props.weekDayClassName(c):void 0;return Re.createElement("div",{key:l,className:Pc("react-datepicker__day-name",f)},u)}))}),De(je(i),"formatWeekday",function(a,o){return i.props.formatWeekDay?function(s,l,c){return l($o(s,"EEEE",c))}(a,i.props.formatWeekDay,o):i.props.useWeekdaysShort?function(s,l){return $o(s,"EEE",l)}(a,o):function(s,l){return $o(s,"EEEEEE",l)}(a,o)}),De(je(i),"decreaseYear",function(){i.setState(function(a){var o=a.date;return{date:vD(o,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),De(je(i),"renderPreviousButton",function(){if(!i.props.renderCustomHeader){var a;switch(!0){case i.props.showMonthYearPicker:a=Upe(i.state.date,i.props);break;case i.props.showYearPicker:a=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=g.minDate,y=g.yearItemNumber,m=y===void 0?12:y,b=cM(fA(vD(p,m)),m).endPeriod,w=v&&Bi(v);return w&&w>b||!1}(i.state.date,i.props);break;default:a=Fpe(i.state.date,i.props)}if((i.props.forceShowMonthNavigation||i.props.showDisabledMonthNavigation||!a)&&!i.props.showTimeSelectOnly){var o=["react-datepicker__navigation","react-datepicker__navigation--previous"],s=i.decreaseMonth;(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker)&&(s=i.decreaseYear),a&&i.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--previous--disabled"),s=null);var l=i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker,c=i.props,u=c.previousMonthAriaLabel,f=u===void 0?"Previous Month":u,d=c.previousYearAriaLabel,h=d===void 0?"Previous Year":d;return Re.createElement("button",{type:"button",className:o.join(" "),onClick:s,"aria-label":l?h:f},Re.createElement("span",{className:["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"].join(" ")},l?i.props.previousYearButtonLabel:i.props.previousMonthButtonLabel))}}}),De(je(i),"increaseYear",function(){i.setState(function(a){var o=a.date;return{date:W6(o,i.props.showYearPicker?i.props.yearItemNumber:1)}},function(){return i.handleYearChange(i.state.date)})}),De(je(i),"renderNextButton",function(){if(!i.props.renderCustomHeader){var a;switch(!0){case i.props.showMonthYearPicker:a=zpe(i.state.date,i.props);break;case i.props.showYearPicker:a=function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=g.maxDate,y=g.yearItemNumber,m=y===void 0?12:y,b=cM(W6(p,m),m).startPeriod,w=v&&Bi(v);return w&&w0&&arguments[0]!==void 0?arguments[0]:i.state.date,o=["react-datepicker__current-month"];return i.props.showYearDropdown&&o.push("react-datepicker__current-month--hasYearDropdown"),i.props.showMonthDropdown&&o.push("react-datepicker__current-month--hasMonthDropdown"),i.props.showMonthYearDropdown&&o.push("react-datepicker__current-month--hasMonthYearDropdown"),Re.createElement("div",{className:o.join(" ")},$o(a,i.props.dateFormat,i.props.locale))}),De(je(i),"renderYearDropdown",function(){var a=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showYearDropdown&&!a)return Re.createElement(ejt,{adjustDateOnChange:i.props.adjustDateOnChange,date:i.state.date,onSelect:i.props.onSelect,setOpen:i.props.setOpen,dropdownMode:i.props.dropdownMode,onChange:i.changeYear,minDate:i.props.minDate,maxDate:i.props.maxDate,year:Bi(i.state.date),scrollableYearDropdown:i.props.scrollableYearDropdown,yearDropdownItemNumber:i.props.yearDropdownItemNumber})}),De(je(i),"renderMonthDropdown",function(){var a=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthDropdown&&!a)return Re.createElement(rjt,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,onChange:i.changeMonth,month:su(i.state.date),useShortMonthInDropdown:i.props.useShortMonthInDropdown})}),De(je(i),"renderMonthYearDropdown",function(){var a=arguments.length>0&&arguments[0]!==void 0&&arguments[0];if(i.props.showMonthYearDropdown&&!a)return Re.createElement(ajt,{dropdownMode:i.props.dropdownMode,locale:i.props.locale,dateFormat:i.props.dateFormat,onChange:i.changeMonthYear,minDate:i.props.minDate,maxDate:i.props.maxDate,date:i.state.date,scrollableMonthYearDropdown:i.props.scrollableMonthYearDropdown})}),De(je(i),"renderTodayButton",function(){if(i.props.todayButton&&!i.props.showTimeSelectOnly)return Re.createElement("div",{className:"react-datepicker__today-button",onClick:function(a){return i.props.onSelect(Rp(cs()),a)}},i.props.todayButton)}),De(je(i),"renderDefaultHeader",function(a){var o=a.monthDate,s=a.i;return Re.createElement("div",{className:"react-datepicker__header ".concat(i.props.showTimeSelect?"react-datepicker__header--has-time-select":"")},i.renderCurrentMonth(o),Re.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(i.props.dropdownMode),onFocus:i.handleDropdownFocus},i.renderMonthDropdown(s!==0),i.renderMonthYearDropdown(s!==0),i.renderYearDropdown(s!==0)),Re.createElement("div",{className:"react-datepicker__day-names"},i.header(o)))}),De(je(i),"renderCustomHeader",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.monthDate,s=a.i;if(i.props.showTimeSelect&&!i.state.monthContainer||i.props.showTimeSelectOnly)return null;var l=Fpe(i.state.date,i.props),c=jpe(i.state.date,i.props),u=Upe(i.state.date,i.props),f=zpe(i.state.date,i.props),d=!i.props.showMonthYearPicker&&!i.props.showQuarterYearPicker&&!i.props.showYearPicker;return Re.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:i.props.onDropdownFocus},i.props.renderCustomHeader(Rpe(Rpe({},i.state),{},{customHeaderCount:s,monthDate:o,changeMonth:i.changeMonth,changeYear:i.changeYear,decreaseMonth:i.decreaseMonth,increaseMonth:i.increaseMonth,decreaseYear:i.decreaseYear,increaseYear:i.increaseYear,prevMonthButtonDisabled:l,nextMonthButtonDisabled:c,prevYearButtonDisabled:u,nextYearButtonDisabled:f})),d&&Re.createElement("div",{className:"react-datepicker__day-names"},i.header(o)))}),De(je(i),"renderYearHeader",function(){var a=i.state.date,o=i.props,s=o.showYearPicker,l=cM(a,o.yearItemNumber),c=l.startPeriod,u=l.endPeriod;return Re.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},s?"".concat(c," - ").concat(u):Bi(a))}),De(je(i),"renderHeader",function(a){switch(!0){case i.props.renderCustomHeader!==void 0:return i.renderCustomHeader(a);case(i.props.showMonthYearPicker||i.props.showQuarterYearPicker||i.props.showYearPicker):return i.renderYearHeader(a);default:return i.renderDefaultHeader(a)}}),De(je(i),"renderMonths",function(){if(!i.props.showTimeSelectOnly&&!i.props.showYearPicker){for(var a=[],o=i.props.showPreviousMonths?i.props.monthsShown-1:0,s=q6(i.state.date,o),l=0;l0;a.push(Re.createElement("div",{key:f,ref:function(p){i.monthContainer=p},className:"react-datepicker__month-container"},i.renderHeader({monthDate:u,i:l}),Re.createElement(cjt,{chooseDayAriaLabelPrefix:i.props.chooseDayAriaLabelPrefix,disabledDayAriaLabelPrefix:i.props.disabledDayAriaLabelPrefix,weekAriaLabelPrefix:i.props.weekAriaLabelPrefix,onChange:i.changeMonthYear,day:u,dayClassName:i.props.dayClassName,calendarStartDay:i.props.calendarStartDay,monthClassName:i.props.monthClassName,onDayClick:i.handleDayClick,handleOnKeyDown:i.props.handleOnKeyDown,onDayMouseEnter:i.handleDayMouseEnter,onMouseLeave:i.handleMonthMouseLeave,onWeekSelect:i.props.onWeekSelect,orderInDisplay:l,formatWeekNumber:i.props.formatWeekNumber,locale:i.props.locale,minDate:i.props.minDate,maxDate:i.props.maxDate,excludeDates:i.props.excludeDates,highlightDates:i.props.highlightDates,selectingDate:i.state.selectingDate,includeDates:i.props.includeDates,inline:i.props.inline,shouldFocusDayInline:i.props.shouldFocusDayInline,fixedHeight:i.props.fixedHeight,filterDate:i.props.filterDate,preSelection:i.props.preSelection,setPreSelection:i.props.setPreSelection,selected:i.props.selected,selectsStart:i.props.selectsStart,selectsEnd:i.props.selectsEnd,selectsRange:i.props.selectsRange,showWeekNumbers:i.props.showWeekNumbers,startDate:i.props.startDate,endDate:i.props.endDate,peekNextMonth:i.props.peekNextMonth,setOpen:i.props.setOpen,shouldCloseOnSelect:i.props.shouldCloseOnSelect,renderDayContents:i.props.renderDayContents,disabledKeyboardNavigation:i.props.disabledKeyboardNavigation,showMonthYearPicker:i.props.showMonthYearPicker,showFullMonthYearPicker:i.props.showFullMonthYearPicker,showTwoColumnMonthYearPicker:i.props.showTwoColumnMonthYearPicker,showFourColumnMonthYearPicker:i.props.showFourColumnMonthYearPicker,showYearPicker:i.props.showYearPicker,showQuarterYearPicker:i.props.showQuarterYearPicker,isInputFocused:i.props.isInputFocused,containerRef:i.containerRef,monthShowsDuplicateDaysEnd:d,monthShowsDuplicateDaysStart:h})))}return a}}),De(je(i),"renderYears",function(){if(!i.props.showTimeSelectOnly)return i.props.showYearPicker?Re.createElement("div",{className:"react-datepicker__year--container"},i.renderHeader(),Re.createElement(ujt,oB({onDayClick:i.handleDayClick,date:i.state.date},i.props))):void 0}),De(je(i),"renderTimeSection",function(){if(i.props.showTimeSelect&&(i.state.monthContainer||i.props.showTimeSelectOnly))return Re.createElement(g9e,{selected:i.props.selected,openToDate:i.props.openToDate,onChange:i.props.onTimeChange,timeClassName:i.props.timeClassName,format:i.props.timeFormat,includeTimes:i.props.includeTimes,intervals:i.props.timeIntervals,minTime:i.props.minTime,maxTime:i.props.maxTime,excludeTimes:i.props.excludeTimes,filterTime:i.props.filterTime,timeCaption:i.props.timeCaption,todayButton:i.props.todayButton,showMonthDropdown:i.props.showMonthDropdown,showMonthYearDropdown:i.props.showMonthYearDropdown,showYearDropdown:i.props.showYearDropdown,withPortal:i.props.withPortal,monthRef:i.state.monthContainer,injectTimes:i.props.injectTimes,locale:i.props.locale,handleOnKeyDown:i.props.handleTimeKeyDown,showTimeSelectOnly:i.props.showTimeSelectOnly})}),De(je(i),"renderInputTimeSection",function(){var a=new Date(i.props.selected),o=ym(a)&&i.props.selected?"".concat(Vpe(a.getHours()),":").concat(Vpe(a.getMinutes())):"";if(i.props.showTimeInput)return Re.createElement(fjt,{date:a,timeString:o,timeInputLabel:i.props.timeInputLabel,onChange:i.props.onTimeChange,customTimeInput:i.props.customTimeInput})}),i.containerRef=Re.createRef(),i.state={date:i.getDateInView(),selectingDate:null,monthContainer:null},i}return vs(r,[{key:"componentDidMount",value:function(){var n=this;this.props.showTimeSelect&&(this.assignMonthContainer=void n.setState({monthContainer:n.monthContainer}))}},{key:"componentDidUpdate",value:function(n){this.props.preSelection&&!mc(this.props.preSelection,n.preSelection)?this.setState({date:this.props.preSelection}):this.props.openToDate&&!mc(this.props.openToDate,n.openToDate)&&this.setState({date:this.props.openToDate})}},{key:"render",value:function(){var n=this.props.container||djt;return Re.createElement("div",{ref:this.containerRef},Re.createElement(n,{className:Pc("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showPopperArrow:this.props.showPopperArrow,arrowProps:this.props.arrowProps},this.renderPreviousButton(),this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.props.children))}}],[{key:"defaultProps",get:function(){return{onDropdownFocus:function(){},monthsShown:1,monthSelectedIn:0,forceShowMonthNavigation:!1,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",customTimeInput:null,yearItemNumber:12}}}]),r}(),gjt=function(t){return!t.disabled&&t.tabIndex!==-1},vjt=function(t){ms(r,Re.Component);var e=ys(r);function r(n){var i;return gs(this,r),De(je(i=e.call(this,n)),"getTabChildren",function(){return Array.prototype.slice.call(i.tabLoopRef.current.querySelectorAll("[tabindex], a, button, input, select, textarea"),1,-1).filter(gjt)}),De(je(i),"handleFocusStart",function(a){var o=i.getTabChildren();o&&o.length>1&&o[o.length-1].focus()}),De(je(i),"handleFocusEnd",function(a){var o=i.getTabChildren();o&&o.length>1&&o[0].focus()}),i.tabLoopRef=Re.createRef(),i}return vs(r,[{key:"render",value:function(){return this.props.enableTabLoop?Re.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},Re.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:"0",onFocus:this.handleFocusStart}),this.props.children,Re.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:"0",onFocus:this.handleFocusEnd})):this.props.children}}],[{key:"defaultProps",get:function(){return{enableTabLoop:!0}}}]),r}(),mjt=function(t){ms(r,Re.Component);var e=ys(r);function r(n){var i;return gs(this,r),(i=e.call(this,n)).el=document.createElement("div"),i}return vs(r,[{key:"componentDidMount",value:function(){this.portalRoot=document.getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),document.body.appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.portalRoot.removeChild(this.el)}},{key:"render",value:function(){return d3e.createPortal(this.props.children,this.el)}}]),r}(),yjt=function(t){ms(r,Re.Component);var e=ys(r);function r(){return gs(this,r),e.apply(this,arguments)}return vs(r,[{key:"render",value:function(){var n,i=this.props,a=i.className,o=i.wrapperClassName,s=i.hidePopper,l=i.popperComponent,c=i.popperModifiers,u=i.popperPlacement,f=i.popperProps,d=i.targetComponent,h=i.enableTabLoop,p=i.popperOnKeyDown,g=i.portalId;if(!s){var v=Pc("react-datepicker-popper",a);n=Re.createElement(RFt,oB({modifiers:c,placement:u},f),function(m){var b=m.ref,w=m.style,C=m.placement,A=m.arrowProps;return Re.createElement(vjt,{enableTabLoop:h},Re.createElement("div",{ref:b,style:w,className:v,"data-placement":C,onKeyDown:p},Re.cloneElement(l,{arrowProps:A})))})}this.props.popperContainer&&(n=Re.createElement(this.props.popperContainer,{},n)),g&&!s&&(n=Re.createElement(mjt,{portalId:g},n));var y=Pc("react-datepicker-wrapper",o);return Re.createElement(hBt,{className:"react-datepicker-manager"},Re.createElement(OFt,null,function(m){var b=m.ref;return Re.createElement("div",{ref:b,className:y},d)}),n)}}],[{key:"defaultProps",get:function(){return{hidePopper:!0,popperModifiers:[],popperProps:{},popperPlacement:"bottom-start"}}}]),r}(),wjt=iB(pjt),bjt=function(t){ms(r,Re.Component);var e=ys(r);function r(n){var i;return gs(this,r),De(je(i=e.call(this,n)),"getPreSelection",function(){return i.props.openToDate?i.props.openToDate:i.props.selectsEnd&&i.props.startDate?i.props.startDate:i.props.selectsStart&&i.props.endDate?i.props.endDate:cs()}),De(je(i),"calcInitialState",function(){var a,o=i.getPreSelection(),s=h9e(i.props),l=p9e(i.props),c=s&&jm(o,Rp(s))?s:l&&Wg(o,ZW(l))?l:o;return{open:i.props.startOpen||!1,preventFocus:!1,preSelection:(a=i.props.selectsRange?i.props.startDate:i.props.selected)!==null&&a!==void 0?a:c,highlightDates:Hpe(i.props.highlightDates),focused:!1,shouldFocusDayInline:!1}}),De(je(i),"clearPreventFocusTimeout",function(){i.preventFocusTimeout&&clearTimeout(i.preventFocusTimeout)}),De(je(i),"setFocus",function(){i.input&&i.input.focus&&i.input.focus({preventScroll:!0})}),De(je(i),"setBlur",function(){i.input&&i.input.blur&&i.input.blur(),i.cancelFocusInput()}),De(je(i),"setOpen",function(a){var o=arguments.length>1&&arguments[1]!==void 0&&arguments[1];i.setState({open:a,preSelection:a&&i.state.open?i.state.preSelection:i.calcInitialState().preSelection,lastPreSelectChange:aH},function(){a||i.setState(function(s){return{focused:!!o&&s.focused}},function(){!o&&i.setBlur(),i.setState({inputValue:null})})})}),De(je(i),"inputOk",function(){return y5e(i.state.preSelection)}),De(je(i),"isCalendarOpen",function(){return i.props.open===void 0?i.state.open&&!i.props.disabled&&!i.props.readOnly:i.props.open}),De(je(i),"handleFocus",function(a){i.state.preventFocus||(i.props.onFocus(a),i.props.preventOpenOnFocus||i.props.readOnly||i.setOpen(!0)),i.setState({focused:!0})}),De(je(i),"cancelFocusInput",function(){clearTimeout(i.inputFocusTimeout),i.inputFocusTimeout=null}),De(je(i),"deferFocusInput",function(){i.cancelFocusInput(),i.inputFocusTimeout=setTimeout(function(){return i.setFocus()},1)}),De(je(i),"handleDropdownFocus",function(){i.cancelFocusInput()}),De(je(i),"handleBlur",function(a){(!i.state.open||i.props.withPortal||i.props.showTimeInput)&&i.props.onBlur(a),i.setState({focused:!1})}),De(je(i),"handleCalendarClickOutside",function(a){i.props.inline||i.setOpen(!1),i.props.onClickOutside(a),i.props.withPortal&&a.preventDefault()}),De(je(i),"handleChange",function(){for(var a=arguments.length,o=new Array(a),s=0;st.INPUT_BG_LIGHT}; - border-radius: 4px; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - outline-color: ${({theme:t})=>t.INPUT_OUTLINE_LIGHT}; - padding: 6px 10px; - max-width: 100%; - width: 140px; - @media ${_t.between("sm","md")} { - width: 100px; - } - @media ${_t.down("sm")} { - width: 115px; - } -`,Sjt=se.div` - align-items: center; - display: flex; - position: relative; - justify-content: space-between; - /* Unfortunatly, need to finetune datepicker due to rem sizing */ - .react-datepicker { - font-size: 1.5rem; - .react-datepicker__header { - background: ${({theme:t})=>t.BACKGROUND_THEME}; - } - .react-datepicker__month-container { - background: ${({theme:t})=>t.BACKGROUND_CONTENT}; - } - .react-datepicker__day, - .react-datepicker__day-name { - width: 2.7rem; - line-height: 2.7rem; - color: ${({theme:t})=>t.FONT_PRIMARY}; - } - .react-datepicker__day-name { - color: ${({theme:t})=>t.FONT_PRIMARY}; - } - .react-datepicker__current-month { - font-size: 1.4rem; - color: ${({theme:t})=>t.FONT_PRIMARY}; - } - .react-datepicker__day--selected { - background: ${({theme:t})=>t.BACKGROUND_THEME}; - } - .react-datepicker__day--disabled { - color: ${({theme:t})=>t.FONT_DISABLED}; - } - } -`,Cjt=se.label` - font-size: 1.5rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_PRIMARY}; - margin-right: 8px; - white-space: nowrap; -`,Ajt=se(bjt)` - ${_jt} -`,Nte=({label:t,maxDate:e,selected:r,onChange:n,minDate:i,placeholderText:a,dateFormat:o,className:s,...l})=>M.jsxs(Sjt,{className:s,...l,children:[t&&M.jsx(Cjt,{children:t}),M.jsx(Ajt,{selected:r,onChange:n,minDate:i,maxDate:e,placeholderText:a,dateFormat:o})]});Nte.propTypes={label:Ie.string,selected:Ie.oneOfType([Ie.instanceOf(Date).isRequired,Ie.string]),onChange:Ie.func.isRequired,minDate:Ie.instanceOf(Date),maxDate:Ie.instanceOf(Date),placeholderText:Ie.string,dateFormat:Ie.string,className:Ie.string};Nte.defaultProps={dateFormat:"yyyy-MM-dd",selected:"",className:"",placeholderText:"",minDate:null,maxDate:null,label:""};const Tjt=se.svg` - display: none; -`,Ejt=()=>M.jsxs(Tjt,{xmlns:"http://www.w3.org/2000/svg",children:[M.jsx("g",{id:an.ACCOUNT,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24",children:M.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"})})}),M.jsx("g",{id:an.ADMIN,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("path",{d:"M8.5 7.5V4.5H11.5V7.5H8.5Z",stroke:"currentColor"}),M.jsx("path",{d:"M4.5 15.5V12.5H7.5V15.5H4.5Z",stroke:"currentColor"}),M.jsx("path",{d:"M12.5 15.5V12.5H15.5V15.5H12.5Z",stroke:"currentColor"}),M.jsx("path",{d:"M6 12.5V10H14V12.5",stroke:"currentColor"}),M.jsx("path",{d:"M10 7.5V10",stroke:"currentColor"})]})}),M.jsx("g",{id:an.APPS,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("path",{d:"M4.5 12.6667V7.33333L10 5.04167L15.5 7.33334V12.6667L10 14.9583L4.5 12.6667Z",stroke:"currentColor"}),M.jsx("path",{d:"M4.5 7.5L10 9.5L15.5 7.5",stroke:"currentColor"}),M.jsx("path",{d:"M10 9.5V14.5",stroke:"currentColor"})]})}),M.jsx("g",{id:an.BACK_ARROW,children:M.jsx("svg",{viewBox:"0 0 40 40",fill:"none",children:M.jsx("path",{d:"M28 5L13 20L28 35",stroke:"currentColor",strokeWidth:"10%"})})}),M.jsx("g",{id:an.CALENDAR,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24",children:M.jsx("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"})})}),M.jsx("g",{id:an.CALL_MADE,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24",children:M.jsx("path",{d:"M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"})})}),M.jsx("g",{id:an.CARET,children:M.jsx("svg",{viewBox:"0 0 9 5",fill:"currentColor",children:M.jsx("path",{d:"M9 -1.43051e-06L4.68 4.5L3.93403e-07 -2.21732e-06L9 -1.43051e-06Z"})})}),M.jsx("g",{id:an.CHECK,children:M.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",children:M.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})})}),M.jsx("g",{id:an.CHEVRON,children:M.jsx("svg",{viewBox:"0 0 7 10",fill:"none",stroke:"currentColor",children:M.jsx("path",{d:"M5.81818 1L2 5L5.81818 9",strokeWidth:"2"})})}),M.jsx("g",{id:an.CLEAR,children:M.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",children:M.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),M.jsx("g",{id:an.CLOSE,children:M.jsxs("svg",{viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[M.jsx("path",{d:"M8.99984 1L5.09375 5L8.99984 9"}),M.jsx("path",{d:"M1.00016 1L4.90625 5L1.00016 9"})]})}),M.jsx("g",{id:an.CUBES,children:M.jsxs("svg",{viewBox:"0 0 38 33",fill:"none",children:[M.jsx("path",{d:"M19 1L10 6V14L19 19L28 14V6L19 1Z",stroke:"currentColor"}),M.jsx("path",{d:"M19 11L10 6",stroke:"currentColor"}),M.jsx("path",{d:"M28 6L19 11V18.5",stroke:"currentColor"}),M.jsx("path",{d:"M10 14L1 19V27L10 32L19 27V19L10 14Z",stroke:"currentColor"}),M.jsx("path",{d:"M10 24L1 19",stroke:"currentColor"}),M.jsx("path",{d:"M19 19L10 24V31.5",stroke:"currentColor"}),M.jsx("path",{d:"M28 14L19 19V27L28 32L37 27V19L28 14Z",stroke:"currentColor"}),M.jsx("path",{d:"M28 24L19 19",stroke:"currentColor"}),M.jsx("path",{d:"M37 19L28 24V31.5",stroke:"currentColor"})]})}),M.jsx("g",{id:an.DATA_OBJECT,children:M.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",children:M.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7zm17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4h-1z"})})}),M.jsx("g",{id:an.DISCORD,children:M.jsxs("svg",{viewBox:"0 0 245 240",fill:"currentColor",children:[M.jsx("path",{d:"M104 104c-5 0-10 5-10 11s5 11 10 11c6 0 11-5 11-11s-5-11-11-11zm37 0c-6 0-10 5-10 11s4 11 10 11 10-5 10-11-4-11-10-11z"}),M.jsx("path",{d:"M190 20H56c-12 0-21 9-21 21v135c0 11 9 20 21 20h113l-5-18 12 12 13 11 21 19V41c0-12-9-21-20-21zm-39 131l-7-9c13-3 18-11 18-11l-11 5c-5 3-10 4-15 5a70 70 0 01-40-5c-3 0-5-2-8-3l-1-1-3-2c0 1 5 9 18 12l-7 9c-22-1-30-16-30-16 0-32 14-58 14-58 14-11 28-10 28-10l1 1c-18 5-26 13-26 13l6-3c10-5 19-6 22-6h2a85 85 0 0151 9s-8-8-25-13l1-1s14-1 28 10c0 0 14 26 14 58 1 0-8 15-30 16z"})]})}),M.jsx("g",{id:an.FIGURE,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 49 80",children:M.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H48.2403V15.9718H0V0ZM0 80V32.0084H48.2403V47.9802H16.0546V80H0Z"})})}),M.jsx("g",{id:an.GITHUB,children:M.jsx("svg",{fill:"none",viewBox:"0 0 1024 1024",children:M.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M512 0a512 512 0 00-162 998c26 4 35-11 35-25v-95c-129 24-162-31-173-60-5-15-30-60-52-72-18-10-44-34-1-34 41-1 69 37 79 52 46 78 120 56 149 42 5-33 18-55 33-68-114-13-233-57-233-253 0-56 20-102 52-137-5-13-23-66 5-136 0 0 43-14 141 52a475 475 0 01256 0c98-66 141-52 141-52 28 70 10 123 5 136 33 35 53 81 53 137 0 197-120 240-234 253 19 16 35 47 35 95l-1 140c0 14 10 30 35 25A513 513 0 00512 0z",clipRule:"evenodd"})})}),M.jsx("g",{id:an.HASH,children:M.jsx("svg",{viewBox:"0 0 43 48",fill:"none",children:M.jsx("path",{fill:"currentColor",d:"M21.9214 -0.370018C21.3654 -0.689161 20.6858 -0.689161 20.1298 -0.370018L0.895803 10.7382C0.339786 11.0573 0 11.6493 0 12.2876V34.4937C0 35.1371 0.339786 35.7239 0.895803 36.0431L8.68516 40.5419V18.0218C8.68516 17.4041 9.00436 16.8276 9.53463 16.5033L14.8528 13.2244L20.0835 10.0021C20.6601 9.64692 21.386 9.64692 21.9626 10.0021L27.1933 13.2244L32.5114 16.5033C33.0417 16.8276 33.3609 17.4041 33.3609 18.0218V28.6925C33.3609 29.3153 33.0417 29.8919 32.5114 30.2161L27.1933 33.4899L21.9626 36.7122C21.4581 37.0211 20.9587 36.5115 20.9587 35.9247V31.6986C20.9587 31.1221 21.4684 30.6794 21.9626 30.3809L26.3438 27.6836C26.8689 27.3542 27.1933 26.7776 27.1933 26.16V21.8258C27.1933 21.203 26.8689 20.6264 26.3438 20.3022L21.9626 17.6049C21.386 17.2497 20.6601 17.2497 20.0835 17.6049L15.7023 20.3022C15.1772 20.6264 14.8528 21.203 14.8528 21.8258V24.9709C14.8528 24.9709 14.8477 24.9709 14.8477 24.976V38.205H14.8528C14.8528 38.205 14.8528 38.205 14.8528 38.2101V43.8569C14.8528 43.9393 14.8477 44.0165 14.8374 44.0937L20.1298 47.1513C20.6858 47.4704 21.3654 47.4704 21.9214 47.1513L41.1554 36.0431C41.7114 35.7239 42.0512 35.1371 42.0512 34.4937V12.2876C42.0512 11.6493 41.7114 11.0573 41.1554 10.7382L21.9214 -0.370018Z"})})}),M.jsx("g",{id:an.HELP,children:M.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:M.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})}),M.jsx("g",{id:an.UPGRADE,children:M.jsx("svg",{viewBox:"6 2 16 18",fill:"currentColor",children:M.jsx("path",{d:"M16 18v2H8v-2h8zM11 7.99V16h2V7.99h3L12 4 8 7.99h3z"})})}),M.jsx("g",{id:an.HELP_OUTLINE,children:M.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:M.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})})}),M.jsx("g",{id:an.IN_PROGRESS,children:M.jsx("svg",{viewBox:"0 0 18 18",fill:"none",children:M.jsx("path",{d:"M9 0.5C10.6811 0.5 12.3245 0.998516 13.7223 1.93251C15.1202 2.8665 16.2096 4.19402 16.853 5.74719C17.4963 7.30036 17.6646 9.00943 17.3367 10.6583C17.0087 12.3071 16.1992 13.8217 15.0104 15.0104C13.8217 16.1992 12.3071 17.0087 10.6583 17.3367C9.00943 17.6646 7.30036 17.4963 5.74719 16.853C4.19402 16.2096 2.8665 15.1202 1.93251 13.7223C0.998516 12.3245 0.5 10.6811 0.5 9",stroke:"currentColor"})})}),M.jsx("g",{id:an.INVENTORY,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("rect",{x:"4",y:"5",width:"1",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"6",y:"5",width:"10",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"4",y:"8",width:"1",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"6",y:"8",width:"10",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"4",y:"11",width:"1",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"6",y:"11",width:"10",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"4",y:"14",width:"1",height:"1",fill:"currentColor"}),M.jsx("rect",{x:"6",y:"14",width:"10",height:"1",fill:"currentColor"})]})}),M.jsx("g",{id:an.KEY,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{d:"M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"})})}),M.jsx("g",{id:an.LINE_CHART,children:M.jsx("svg",{viewBox:"0 0 24 24",children:M.jsx("path",{fill:"currentColor",d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"})})}),M.jsx("g",{id:an.LOGO,children:M.jsxs("svg",{viewBox:"0 0 187 32",fill:"none",children:[M.jsx("path",{fill:"var(--secondaryColor)",d:"M49 18.9V21h-8.7V9.7H49v2.1h-6v2.4h5.3v2h-5.3V19h6.2zM66.4 21l-2.8-4-2.7 4h-3l4.2-5.7-4-5.6h3l2.6 3.7 2.6-3.7H69l-4 5.5 4.3 5.8h-3zm17-11.3c1 0 1.8.2 2.6.5.7.3 1.3.8 1.7 1.4.4.6.6 1.4.6 2.2a4 4 0 01-.6 2.2c-.4.6-1 1-1.7 1.4-.8.3-1.6.5-2.6.5H81V21h-2.6V9.7h4.9zm-.2 6c.8 0 1.4-.1 1.8-.4.4-.4.6-.9.6-1.5s-.2-1.1-.6-1.5c-.4-.3-1-.5-1.8-.5H81v4H83zm15-6h2.6v9.2h5.7V21h-8.3V9.7zm23.1 11.5c-1.1 0-2.2-.3-3.2-.8-.9-.5-1.6-1.2-2.2-2-.5-1-.8-2-.8-3a5.7 5.7 0 013-5.1c1-.5 2-.8 3.2-.8 1.2 0 2.3.3 3.2.8a5.7 5.7 0 013 5 5.7 5.7 0 01-3 5.1c-1 .5-2 .8-3.2.8zm0-2.2c.7 0 1.3-.2 1.8-.5.6-.3 1-.7 1.3-1.3.3-.5.5-1.2.5-1.9s-.2-1.3-.5-1.8c-.3-.6-.7-1-1.3-1.3-.5-.3-1.1-.5-1.8-.5a3.5 3.5 0 00-3 1.8c-.4.5-.5 1.1-.5 1.8s.1 1.4.4 2a3.4 3.4 0 003.1 1.7zm23.5 2l-2.2-3.1H140V21h-2.6V9.7h4.8c1 0 2 .2 2.6.5.8.3 1.4.8 1.8 1.4.4.6.6 1.4.6 2.2 0 .8-.3 1.6-.7 2.2-.4.6-1 1-1.7 1.4l2.6 3.6h-2.8zm0-7.2c0-.6-.3-1.1-.7-1.5-.4-.3-1-.5-1.8-.5h-2.1v4h2.1c.8 0 1.4-.2 1.8-.5.4-.4.6-.9.6-1.5zm21.5 5.1V21h-8.8V9.7h8.5v2.1H160v2.4h5.2v2H160V19h6.2zm17.3 2.1l-2.2-3.1H179V21h-2.6V9.7h4.9c1 0 1.9.2 2.6.5.7.3 1.3.8 1.7 1.4.4.6.6 1.4.6 2.2 0 .8-.2 1.6-.6 2.2-.4.6-1 1-1.7 1.4l2.5 3.6h-2.8zm0-7.2c0-.6-.2-1.1-.7-1.5-.4-.3-1-.5-1.7-.5h-2.2v4h2.2c.7 0 1.3-.2 1.7-.5.5-.4.7-.9.7-1.5z"}),M.jsx("svg",{viewBox:"0 0 280 48",fill:"none",children:M.jsx("path",{fill:"currentColor",d:"M21.9214 -0.370018C21.3654 -0.689161 20.6858 -0.689161 20.1298 -0.370018L0.895803 10.7382C0.339786 11.0573 0 11.6493 0 12.2876V34.4937C0 35.1371 0.339786 35.7239 0.895803 36.0431L8.68516 40.5419V18.0218C8.68516 17.4041 9.00436 16.8276 9.53463 16.5033L14.8528 13.2244L20.0835 10.0021C20.6601 9.64692 21.386 9.64692 21.9626 10.0021L27.1933 13.2244L32.5114 16.5033C33.0417 16.8276 33.3609 17.4041 33.3609 18.0218V28.6925C33.3609 29.3153 33.0417 29.8919 32.5114 30.2161L27.1933 33.4899L21.9626 36.7122C21.4581 37.0211 20.9587 36.5115 20.9587 35.9247V31.6986C20.9587 31.1221 21.4684 30.6794 21.9626 30.3809L26.3438 27.6836C26.8689 27.3542 27.1933 26.7776 27.1933 26.16V21.8258C27.1933 21.203 26.8689 20.6264 26.3438 20.3022L21.9626 17.6049C21.386 17.2497 20.6601 17.2497 20.0835 17.6049L15.7023 20.3022C15.1772 20.6264 14.8528 21.203 14.8528 21.8258V24.9709C14.8528 24.9709 14.8477 24.9709 14.8477 24.976V38.205H14.8528C14.8528 38.205 14.8528 38.205 14.8528 38.2101V43.8569C14.8528 43.9393 14.8477 44.0165 14.8374 44.0937L20.1298 47.1513C20.6858 47.4704 21.3654 47.4704 21.9214 47.1513L41.1554 36.0431C41.7114 35.7239 42.0512 35.1371 42.0512 34.4937V12.2876C42.0512 11.6493 41.7114 11.0573 41.1554 10.7382L21.9214 -0.370018Z"})})]})}),M.jsx("g",{id:an.LOGOUT,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24",children:M.jsx("path",{d:"M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})})}),M.jsx("g",{id:an.MEGAPHONE,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24",children:M.jsx("path",{d:"M18 11v2h4v-2h-4zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61zM20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4zM4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9H4zm11.5 3c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34z"})})}),M.jsx("g",{id:an.MENU,children:M.jsxs("svg",{viewBox:"0 0 20 11",fill:"none",children:[M.jsx("rect",{width:"20",height:"1",fill:"currentColor"}),M.jsx("rect",{y:"5",width:"20",height:"1",fill:"currentColor"}),M.jsx("rect",{y:"10",width:"20",height:"1",fill:"currentColor"})]})}),M.jsx("g",{id:an.MOON,children:M.jsx("svg",{viewBox:"-25 -20 170 170",fill:"currentColor",children:M.jsx("path",{d:"M110 94a65 65 0 01-78 30c-3-1-11-3-19-9l-3-6 4-2c10 0 14-1 18-3 4-1 6-4 7-8l1-4c2-2 3-2 5-2 1 0 3 2 4 1l-2-1c-1-2-3-4-2-6l5-2c4-1 2-5-1-7-5-3-17-11-8-16l9-2 10-5C74 42 80 25 74 9c-1-2-4-6-2-8h3a64 64 0 019 4c32 17 43 57 26 89z"})})}),M.jsx("g",{id:an.PARTICIPATION,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("circle",{cx:"10",cy:"8",r:"3.5",stroke:"currentColor"}),M.jsx("path",{d:"M15 16C15 14 12.7614 11.5 10 11.5C7.23858 11.5 5 13.5 5 16",stroke:"currentColor"})]})}),M.jsx("g",{id:an.PENDING,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("circle",{cx:"10",cy:"10",r:"8.5",stroke:"currentColor"}),M.jsx("path",{d:"M10 5.5V10L13.5 12.5",stroke:"currentColor"})]})}),M.jsx("g",{id:an.PRICE,children:M.jsx("svg",{viewBox:"0 0 24 24",children:M.jsx("path",{fill:"currentColor",d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"})})}),M.jsx("g",{id:an.PROVENANCE,children:M.jsx("svg",{viewBox:"0 0 43 48",fill:"none",children:M.jsx("path",{fill:"currentColor",d:"M21.9214 -0.370018C21.3654 -0.689161 20.6858 -0.689161 20.1298 -0.370018L0.895803 10.7382C0.339786 11.0573 0 11.6493 0 12.2876V34.4937C0 35.1371 0.339786 35.7239 0.895803 36.0431L8.68516 40.5419V18.0218C8.68516 17.4041 9.00436 16.8276 9.53463 16.5033L14.8528 13.2244L20.0835 10.0021C20.6601 9.64692 21.386 9.64692 21.9626 10.0021L27.1933 13.2244L32.5114 16.5033C33.0417 16.8276 33.3609 17.4041 33.3609 18.0218V28.6925C33.3609 29.3153 33.0417 29.8919 32.5114 30.2161L27.1933 33.4899L21.9626 36.7122C21.4581 37.0211 20.9587 36.5115 20.9587 35.9247V31.6986C20.9587 31.1221 21.4684 30.6794 21.9626 30.3809L26.3438 27.6836C26.8689 27.3542 27.1933 26.7776 27.1933 26.16V21.8258C27.1933 21.203 26.8689 20.6264 26.3438 20.3022L21.9626 17.6049C21.386 17.2497 20.6601 17.2497 20.0835 17.6049L15.7023 20.3022C15.1772 20.6264 14.8528 21.203 14.8528 21.8258V24.9709C14.8528 24.9709 14.8477 24.9709 14.8477 24.976V38.205H14.8528C14.8528 38.205 14.8528 38.205 14.8528 38.2101V43.8569C14.8528 43.9393 14.8477 44.0165 14.8374 44.0937L20.1298 47.1513C20.6858 47.4704 21.3654 47.4704 21.9214 47.1513L41.1554 36.0431C41.7114 35.7239 42.0512 35.1371 42.0512 34.4937V12.2876C42.0512 11.6493 41.7114 11.0573 41.1554 10.7382L21.9214 -0.370018Z"})})}),M.jsx("g",{id:an.RAINBOW,children:M.jsxs("svg",{viewBox:"0 0 512 512",fill:"none",children:[M.jsx("path",{fill:"#FF5E3B",d:"M256 128A256 256 0 000 376c0 4 4 8 8 8h25s100-206 223-206 223 206 223 206h25c4 0 8-4 8-8a256 256 0 00-256-248z"}),M.jsx("path",{fill:"#FFF67A",d:"M256 161A223 223 0 0033 384h33s85-174 190-174 190 174 190 174h33c0-123-100-223-223-223z"}),M.jsx("path",{fill:"#B2E8A6",d:"M256 194c-105 0-190 85-190 190h33s70-140 157-140 157 140 157 140h33c0-105-85-190-190-190z"}),M.jsx("path",{fill:"#A1C0F7",d:"M256 227c-87 0-157 70-157 157h33s56-107 124-107 124 107 124 107h33c0-87-70-157-157-157z"}),M.jsx("path",{fill:"#D491FF",d:"M256 260c-68 0-124 56-124 124h17l9-7c4-47 50-91 98-91s94 44 98 91l9 7h17c0-68-56-124-124-124z"}),M.jsx("path",{fill:"#5F2489",d:"M256 277c-59 0-107 48-107 107h8c4 0 8-3 8-7a91 91 0 01182 0c0 4 4 7 8 7h8c0-59-48-107-107-107z"})]})}),M.jsx("g",{id:an.REPORTS,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("path",{d:"M6 4H10.5L14.5 8V15.5H6V4Z",stroke:"currentColor"}),M.jsx("path",{d:"M10.5 4V8.5H14.5",stroke:"currentColor"})]})}),M.jsx("g",{id:an.SEARCH,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("circle",{cx:"9.02128",cy:"9.02128",r:"6.52128",stroke:"currentColor"}),M.jsx("path",{d:"M13.9362 13.9362L18.5 18.5",stroke:"currentColor"})]})}),M.jsx("g",{id:an.SETTINGS,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("path",{d:"M5.34315 9.17157C3.92894 10.5858 2.51472 12 3.22183 14.1213L13.1213 4.22183C11 3.51472 9.58579 4.92893 8.17158 6.34315L5.34315 9.17157Z",stroke:"currentColor"}),M.jsx("path",{d:"M6.05029 8.46447L14.5356 16.9497L15.9498 15.5355L7.81806 7.40381",stroke:"currentColor"})]})}),M.jsx("g",{id:an.SHARED_POOLS,children:M.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",children:[M.jsx("circle",{cx:"13.5",cy:"6.5",r:"2",stroke:"currentColor"}),M.jsx("circle",{cx:"6.5",cy:"10",r:"2",stroke:"currentColor"}),M.jsx("circle",{cx:"13.5",cy:"13.5",r:"2",stroke:"currentColor"}),M.jsx("path",{d:"M8.22461 8.97343L11.7069 7.36621",stroke:"currentColor"}),M.jsx("path",{d:"M8.22456 11L11.8311 12.6645",stroke:"currentColor"})]})}),M.jsx("g",{id:an.SLACK,children:M.jsxs("svg",{viewBox:"0 0 2447.6 2452.5",children:[M.jsx("path",{d:"m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z",fill:"currentColor"}),M.jsx("path",{d:"m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z",fill:"currentColor"}),M.jsx("path",{d:"m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z",fill:"currentColor"}),M.jsx("path",{d:"m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0",fill:"currentColor"})]})}),M.jsx("g",{id:an.SUN,children:M.jsx("svg",{viewBox:"0 -10 150 150",fill:"currentColor",children:M.jsx("path",{d:"M64 30a34 34 0 100 68 34 34 0 000-68zM57 24h14a2 2 0 002-3L66 2a2 2 0 00-4 0l-7 19v2l2 1zM97 41a2 2 0 002 1l2-2 8-19a2 2 0 00-2-2l-19 8a2 2 0 00-1 4l10 10zM126 62l-19-7h-2l-1 2v14a2 2 0 003 2l19-7 2-2-2-2zM101 88a2 2 0 00-4-1L87 97a2 2 0 001 4l19 8v1a2 2 0 002-3l-8-19zM71 104H57l-2 1v2l7 19 2 2 2-2 7-19a2 2 0 00-2-3zM31 87l-2-1-2 2-8 19v2a2 2 0 002 0l19-8a2 2 0 001-4L31 87zM22 73h1l1-2V57l-1-2h-2L2 62a2 2 0 000 4l19 7h1zM27 40a2 2 0 004 1l10-10a2 2 0 00-1-4l-19-8h-2v2l8 19z"})})}),M.jsx("g",{id:an.TRASH,children:M.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:M.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"})})}),M.jsx("g",{id:an.WARNING,children:M.jsx("svg",{fill:"currentColor",viewBox:"0 0 24 24",children:M.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})})})]}),Ijt=se.button.attrs(({type:t})=>({type:t}))` - background: none; - border: none; - padding: 0; - font: inherit; - cursor: pointer; - outline: inherit; - color: ${({theme:t})=>t.FONT_LINK}; - text-transform: uppercase; - font-size: 12px; -`,lB=t=>M.jsx(Ijt,{...t});lB.propTypes={onClick:Ie.func,type:Ie.string};lB.defaultProps={onClick:null,type:"button"};const kjt=se.ul.attrs(({className:t="paginator-list"})=>({className:t}))` - list-style: none; - display: flex; - justify-content: flex-end; - margin: 0; - padding: 24px 0 0; -`,oH=se.li.attrs(({className:t="paginator-list-item"})=>({className:t}))` - width: ${({secondary:t})=>t?"19px":"34px"}; - height: ${({secondary:t})=>t?"19px":"34px"}; - display: flex; - align-items: center; - justify-content: center; - border-width: ${({secondary:t,active:e})=>t?e?"0 0 1px 0":"0":"2px"}; - border-style: solid; - border-color: ${({theme:t})=>t.BORDER_THEME}; - background-color: ${({secondary:t,theme:e,active:r})=>!t&&r?e.BACKGROUND_THEME:"inherit"}; - > button { - color: ${({theme:t})=>t.FONT_PRIMARY}; - } - + li { - margin: 0 3.5px; - } -`,Gpe=se(lB)` - display: flex; - align-self: center; -`,Ote=({className:t,pageNumber:e,totalPages:r,onChange:n,numberOfItems:i,secondary:a})=>{let o=r-i+1;o=o<1?1:o;let s=e-Math.floor(i/2);s=Math.min(Math.max(1,s),o);const l=c=>{e!==c&&n(Math.min(Math.max(1,c),r))};return M.jsxs(kjt,{className:t,children:[M.jsx(oH,{secondary:a,active:!1,children:M.jsx(Gpe,{onClick:()=>l(e-1),children:M.jsx(Lr,{alt:"Page left",color:"ICON_PRIMARY",icon:"BACK_ARROW",size:"13px"})})}),i>0&&[...Array(Math.min(i,r))].map((c,u)=>M.jsx(oH,{secondary:a,active:u+s===e,children:M.jsx(lB,{onClick:()=>l(s+u),children:s+u})},u+s)),M.jsx(oH,{secondary:a,active:!1,children:M.jsx(Gpe,{onClick:()=>l(e+1),children:M.jsx(Lr,{alt:"Page right",flipX:!0,color:"ICON_PRIMARY",icon:"BACK_ARROW",size:"13px"})})})]})};Ote.propTypes={className:Ie.string,pageNumber:Ie.number.isRequired,totalPages:Ie.number.isRequired,onChange:Ie.func.isRequired,numberOfItems:Ie.number,secondary:Ie.bool};Ote.defaultProps={className:null,numberOfItems:3,secondary:!1};const Pjt=se.div` - display: flex; - margin-right: ${({marginRight:t})=>t||"5px"}; - align-items: center; - justify-content: center; - border-radius: 100%; - background: ${({theme:t,color:e})=>e||t.BACKGROUND_LIGHT}; - height: ${({sizeContainer:t})=>t?`${t}px`:"150px"}; - width: ${({sizeContainer:t})=>t?`${t}px`:"150px"}; - overflow: hidden; -`,Rjt=se.span` - font-size: ${({sizeText:t})=>t?`${t}px`:"7rem"}; - color: ${({theme:t,color:e})=>e||t.FONT_PRIMARY}; - font-weight: ${({fontWeight:t})=>t||""}; - text-transform: uppercase; -`,Mjt=se.img` - width: 100%; -`,Djt=se(Lr)` - align-self: center; - margin-left: ${({spriteMargin:t})=>t}; -`,w2=({icon:t,spriteProps:e,spriteMargin:r,moniker:n,address:i,sizeText:a,marginRight:o,colorBackground:s,colorFont:l,fontWeight:c})=>M.jsx(Pjt,{sizeContainer:a*2,marginRight:o,color:s,title:n||i,children:Rn(e)?t?M.jsx(Mjt,{src:t,alt:n?Rr(n,16):"?",title:n?Rr(n,16):"?"}):M.jsx(Rjt,{sizeText:a,color:l,fontWeight:c,children:n?n[0]:`${i}`[0]}):M.jsx(Djt,{spriteMargin:r,...e})});w2.propTypes={spriteProps:Ie.object,spriteMargin:Ie.string,icon:Ie.string,moniker:Ie.string,address:Ie.string.isRequired,sizeText:Ie.number,marginRight:Ie.string,colorBackground:Ie.string,colorFont:Ie.string,fontWeight:Ie.string};w2.defaultProps={spriteProps:{},spriteMargin:"",icon:null,moniker:null,sizeText:0,marginRight:"",colorBackground:"",colorFont:"",fontWeight:""};const Njt=se.div` - flex-basis: 100%; - max-width: 100%; - overflow-x: auto; - margin-bottom: 20px; -`,Ojt=se.table` - max-width: 100%; - width: 100%; - overflow-x: auto; - white-space: nowrap; - border-spacing: 0; -`,Ljt=se.thead` - padding: 0; - border-bottom: 1px solid ${({theme:t})=>t.BORDER_PRIMARY}; - text-align: left; -`,$jt=se.tr``,N7=se.tr` - background-color: ${({theme:t,index:e,isOpen:r})=>e%2!==0?t.BACKGROUND_LIGHT:""}; -`,Bjt=se.tbody``,Fjt=se.th` - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - ${({alignHeaderText:t})=>t&&`text-align: ${t}`}; - padding: 10px 15px; -`,Hy=se.td` - padding: ${({tablePadding:t})=>t||"10px 15px"}; - text-align: ${({center:t})=>t}; - display: ${({copy:t})=>t?"flex":""}; - align-items: ${({copy:t})=>t?"center":""}; - border: none; - text-decoration: ${({skipped:t,scheduled:e})=>t&&!e&&"line-through"}; - font-style: ${({skipped:t,scheduled:e})=>(t||e)&&"italic"}; - color: ${({color:t})=>t&&t}; -`,jjt=se(Ote)` - display: flex; - flex-basis: 100%; - align-items: center; - justify-content: flex-end; - margin-left: auto; -`,Ujt=se.td``,zjt=se.ul` - font-size: 1.4rem; - padding: 5px 0 10px 5px; - list-style-type: '- '; -`,Hjt=se.li` - font-size: 1.2rem; - margin-left: 30px; -`,Vjt=se.div` - display: ${({addImage:t})=>t&&"flex"}; - align-items: ${({addImage:t})=>t&&"center"}; -`,cn=({changePage:t,className:e,tableBorder:r,currentPage:n,isLoading:i,ManageStakingBtn:a,noResults:o,notes:s,resultsPerPage:l,showAge:c,showIndex:u,size:f,tableData:d,tableHeaders:h,totalPages:p,title:g,headerContent:v,accordionData:y})=>{const m=_i(),{pathname:b}=fte(),w=Sst(d,h),[C,A]=Z.useState(Object.fromEntries(w.map((j,k)=>[k,!1]))),S=w.length,D=S&&!i&&(n&&t)&&p;let P=u?[{displayName:typeof u=="string"?u:"#",dataName:"index"},...h]:h;const x={displayName:"Age",dataName:c};P=c?[...h,x]:P;const T=()=>{switch(s){case"skipped":return Object.keys(UW).map(j=>M.jsx(Hjt,{children:`${j}: ${UW[j]}`},j));default:return null}},E=()=>M.jsx(N7,{index:0,children:M.jsx(Ujt,{colSpan:"10",children:M.jsx(Br,{})})}),N=()=>P.map(({displayName:j,alignHeaderText:k="",headerIcon:$,blockImage:H})=>M.jsx(Fjt,{alignHeaderText:k,children:M.jsxs(Vjt,{addImage:!Rn(H)||!Rn($),children:[!Rn($)&&M.jsx(Lr,{...$}),!Rn(H)&&M.jsx(w2,{...H}),j]})},j)),F=(j,k)=>P.map(({dataName:$,displayName:H,headerIcon:Y={},blockImage:ie={}})=>{if(u&&$==="index")return M.jsx(Hy,{children:k+1+(n-1)*l},H);if(c&&H==="Age"){const Ke=Wi(j[$].raw);return M.jsx(Hy,{children:M.jsx(Z8,{timestamp:Ke,text:""})},H)}if($==="manageStaking"||$==="delegate")return M.jsx(Hy,{children:M.jsx(a,{delegate:$==="delegate",validator:d[k]})},H);if($==="answer")return M.jsx(Hy,{title:j[$].hover,children:M.jsx(Iqt,{data:j[$].value})},H);if($==="accordion")return M.jsx(Hy,{title:"View Data",children:M.jsx(Lr,{style:{cursor:"pointer"},size:"1.5rem",icon:"CHEVRON",spin:C[k]?"90":"-90",onClick:()=>A({[k]:!C[k]})})},$);j[$]||console.warn(`Table Error! Data not found (rowData.${$}): `,{rowData:j,rawTableData:d[k],dataName:$});const{link:W=!1,externalLink:Q="",value:J="--",hover:ee=!1,icon:ne,spin:V,skipped:oe=!1,scheduled:ye=!1,iconColor:Te=m.FONT_LINK,color:Me="",size:Oe="1.4rem",copy:nt=!1,blockImage:it={},raw:St="",addTextToLink:bt=""}=j[$]||{},Ce=Array.isArray(J)?J.map(Ke=>Ke):J,We=J==="--"||J===""||J==="--",Le=ne&&J===""?"center":"left";return M.jsxs(Hy,{title:ee||J,skipped:oe&&!ye,scheduled:ye,copy:nt||!Rn(it)&&(H==="Moniker"||H==="Proposer"),center:Le,color:Me,tablePadding:(!Rn(Y)||!Rn(ie))&&"10px 50px",children:[it&&(H==="Moniker"||H==="Proposer")&&M.jsx(w2,{icon:it.icon,moniker:it.moniker,address:it.address,sizeText:17,marginRight:"10px",colorBackground:m.IRIS_PRIMARY,colorFont:m.FONT_WHITE,fontWeight:m.FONT_WEIGHT_THIN}),W&&!We&&W!==b?M.jsxs(M.Fragment,{children:[M.jsxs(Wo,{to:W,children:[Ce,ne&&M.jsx(Lr,{icon:ne,size:Oe,color:Te})]}),bt&&` ${bt}`,nt&&M.jsx(xh,{value:St,title:`Copy ${ee}`})]}):M.jsxs(M.Fragment,{children:[Q&&M.jsx("a",{href:Q,target:"_blank",rel:"noreferrer",children:J}),!Q&&J,bt&&` ${bt}`,ne&&M.jsx(Lr,{icon:ne,size:Oe,color:Te,spin:V}),nt&&M.jsx(xh,{value:St,title:`Copy ${ee}`})]})]},H)}),B=()=>w.map((j,k)=>M.jsxs(Z.Fragment,{children:[M.jsx(N7,{index:k,children:F(j,k)},k),C[k]&&y.length>0&&M.jsx(N7,{index:k,children:M.jsx("td",{colSpan:h.length,children:y[k]})},`subindex ${k}`)]},k));return M.jsxs(ln,{className:e,size:f,title:g,headerContent:v,contentBorder:r,children:[s&&M.jsxs(zjt,{children:[`* ${Kr(s)}:`,T()]}),M.jsx(Njt,{children:M.jsxs(Ojt,{children:[M.jsx(Ljt,{children:M.jsx($jt,{children:N()})}),M.jsx(Bjt,{children:i?E():S?B():M.jsx(N7,{index:0,children:M.jsx(Hy,{colSpan:"1000",children:o})})})]})}),D?M.jsx(jjt,{numberOfItems:10,pageNumber:n,secondary:!0,totalPages:p,onChange:j=>t(j)}):null]})};cn.propTypes={changePage:Ie.func,className:Ie.string,currentPage:Ie.number,isLoading:Ie.bool,ManageStakingBtn:Ie.func,noResults:Ie.string,notes:Ie.string,resultsPerPage:Ie.number,showIndex:Ie.any,showAge:Ie.string,size:Ie.string,tableData:Ie.array,tableHeaders:Ie.array.isRequired,totalPages:Ie.number,title:Ie.string,headerContent:Ie.element,tableBorder:Ie.bool,isOpen:Ie.object,setIsOpen:Ie.func,accordionData:Ie.array};cn.defaultProps={changePage:null,className:null,currentPage:0,isLoading:!1,ManageStakingBtn:null,noResults:"No data available, refresh page to retry",notes:null,resultsPerPage:0,showAge:"",showIndex:!1,size:"100%",tableData:[],title:"",headerContent:null,totalPages:0,tableBorder:!0,isOpen:{},setIsOpen:null,accordionData:[]};const Gjt=se.div` - width: 100%; -`,Wjt=se.div` - display: flex; - flex-basis: 100%; - margin-bottom: 10px; - border-bottom: ${({theme:t})=>`3px solid ${t.FONT_SECONDARY}`}; -`,qjt=se.div` - cursor: pointer; - padding: 10px 20px; - margin-bottom: -3px; - color: ${({theme:t})=>t.FONT_SECONDARY}; - ${({active:t,theme:e})=>t&&` - font-weight: ${e.FONT_WEIGHT_NORMAL}; - color: ${e.FONT_PRIMARY}; - border-bottom: 3px solid ${e.FONT_PRIMARY}; - `} - margin-right: 10px; - user-select: none; -`,Yjt=se.div` - flex-basis: 100%; -`,Kjt=se.div` - flex-basis: 100%; -`,Zjt=se.select` - width: 100%; - text-align: left; - display: flex; - align-items: center; - color: ${({theme:t})=>t.BUTTON_PRIMARY_FONT}; - background: ${({theme:t})=>t.BUTTON_PRIMARY}; - border-radius: 4px; - padding: 6px 12px; - cursor: pointer; - &:focus { - background: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - border-color: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - } - &:hover { - background: ${({theme:t})=>t.BUTTON_PRIMARY_HOVER}; - border-color: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - } - margin-bottom: 10px; -`,Tv=({className:t="",children:e,active:r,setActive:n,isSmall:i=!1})=>{const[a,o]=Z.useState([]);Z.useEffect(()=>{const u=e.map(f=>f.key);o(u)},[e]),Z.useEffect(()=>{});const s=()=>e.map((u,f)=>f===r?M.jsx(Kjt,{children:u},f):null),l=u=>{n(Number(u.target.value))},c=()=>a.map((u,f)=>M.jsx(qjt,{active:r===f,onClick:()=>{n(f)},children:u},u));return M.jsxs(Gjt,{className:t,children:[i?M.jsx(Zjt,{onChange:u=>l(u),children:a.map((u,f)=>M.jsx("option",{label:String(u),value:f},f))}):M.jsx(Wjt,{children:c()}),M.jsx(Yjt,{children:s()})]})},Wpe=se.input` - padding: 3px; - width: 100%; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - border-radius: 4px; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - font-size: 1.4rem; - line-height: 2.2rem; - background-color: ${({theme:t})=>t.INPUT_BG_LIGHT}; - - &:focus { - outline: none; - box-shadow: 0 0 1px 1px ${({theme:t})=>t.INPUT_OUTLINE_LIGHT}; - } - - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_LIGHT}; - } -`,qpe=({title:t,action:e,list:r=[],value:n="",type:i="text",min:a="",max:o=""})=>r.length>0?M.jsxs(M.Fragment,{children:[M.jsx(Wpe,{name:t,type:i,onChange:s=>e(s.target.value),list:"mylist",value:n}),M.jsx("datalist",{id:"mylist",children:r.map(s=>M.jsx("option",{value:s},s))})]}):M.jsx(Wpe,{name:t,type:i,min:a,max:o,onChange:s=>e(s.target.value)}),Qjt=se.div` - margin-bottom: ${({flush:t})=>t?"0":"20px"}; - display: flex; - align-items: flex-end; - flex-wrap: wrap; - position: relative; -`,Ype=se.div` - margin-bottom: 10px; - min-width: ${({minWidth:t})=>t&&t}; - margin-right: 10px; - align-items: center; - input { - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - cursor: pointer; - } - &:last-of-type { - margin-right: 0; - } -`,Xjt=se.div` - font-size: 1.2rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - margin-bottom: 4px; -`,Kl=({filterData:t,mustApply:e,flush:r})=>{const n=()=>t.map(i=>{const{type:a,title:o,options:s,action:l,maxHeight:c,setDefaults:u,list:f,value:d,minWidth:h,min:p,max:g}=i,v=()=>{switch(a){case"dropdown":return M.jsx(nB,{allOptions:s,action:l,maxHeight:c,setDefaults:u});case"datepicker":return M.jsx(Nte,{...s});case"text":return M.jsx(qpe,{title:o,action:l,list:f,value:d});case"number":return M.jsx(qpe,{title:o,action:l,list:f,value:d,type:"number",min:p,max:g});default:return""}};return M.jsxs(Ype,{minWidth:h,children:[M.jsx(Xjt,{children:o}),v()]},o)});return M.jsxs(Qjt,{flush:r,children:[n(),e&&M.jsx(Ype,{children:M.jsx(Ha,{onClick:e.action,children:e.title})})]})};Kl.propTypes={flush:Ie.bool,mustApply:Ie.shape({title:Ie.string,action:Ie.func}),filterData:Ie.arrayOf(Ie.shape({title:Ie.string.isRequired,type:Ie.string.isRequired,options:Ie.object,action:Ie.func,maxHeight:Ie.string,setDefaults:Ie.object})).isRequired};Kl.defaultProps={mustApply:null,flush:!1};var v9e={exports:{}};(function(t,e){(function(r,n){t.exports=n(Z)})(R2,function(r){return function(n){var i={};function a(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=i,a.d=function(o,s,l){a.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:l})},a.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,s){if(1&s&&(o=a(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var c in o)a.d(l,c,(function(u){return o[u]}).bind(null,c));return l},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=48)}([function(n,i){n.exports=r},function(n,i){var a=n.exports={version:"2.6.12"};typeof __e=="number"&&(__e=a)},function(n,i,a){var o=a(26)("wks"),s=a(17),l=a(3).Symbol,c=typeof l=="function";(n.exports=function(u){return o[u]||(o[u]=c&&l[u]||(c?l:s)("Symbol."+u))}).store=o},function(n,i){var a=n.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=a)},function(n,i,a){n.exports=!a(8)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(n,i){var a={}.hasOwnProperty;n.exports=function(o,s){return a.call(o,s)}},function(n,i,a){var o=a(7),s=a(16);n.exports=a(4)?function(l,c,u){return o.f(l,c,s(1,u))}:function(l,c,u){return l[c]=u,l}},function(n,i,a){var o=a(10),s=a(35),l=a(23),c=Object.defineProperty;i.f=a(4)?Object.defineProperty:function(u,f,d){if(o(u),f=l(f,!0),o(d),s)try{return c(u,f,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(u[f]=d.value),u}},function(n,i){n.exports=function(a){try{return!!a()}catch{return!0}}},function(n,i,a){var o=a(40),s=a(22);n.exports=function(l){return o(s(l))}},function(n,i,a){var o=a(11);n.exports=function(s){if(!o(s))throw TypeError(s+" is not an object!");return s}},function(n,i){n.exports=function(a){return typeof a=="object"?a!==null:typeof a=="function"}},function(n,i){n.exports={}},function(n,i,a){var o=a(39),s=a(27);n.exports=Object.keys||function(l){return o(l,s)}},function(n,i){n.exports=!0},function(n,i,a){var o=a(3),s=a(1),l=a(53),c=a(6),u=a(5),f=function(d,h,p){var g,v,y,m=d&f.F,b=d&f.G,w=d&f.S,C=d&f.P,A=d&f.B,S=d&f.W,I=b?s:s[h]||(s[h]={}),D=I.prototype,L=b?o:w?o[h]:(o[h]||{}).prototype;for(g in b&&(p=h),p)(v=!m&&L&&L[g]!==void 0)&&u(I,g)||(y=v?L[g]:p[g],I[g]=b&&typeof L[g]!="function"?p[g]:A&&v?l(y,o):S&&L[g]==y?function(O){var P=function(x,T,E){if(this instanceof O){switch(arguments.length){case 0:return new O;case 1:return new O(x);case 2:return new O(x,T)}return new O(x,T,E)}return O.apply(this,arguments)};return P.prototype=O.prototype,P}(y):C&&typeof y=="function"?l(Function.call,y):y,C&&((I.virtual||(I.virtual={}))[g]=y,d&f.R&&D&&!D[g]&&c(D,g,y)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,n.exports=f},function(n,i){n.exports=function(a,o){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:o}}},function(n,i){var a=0,o=Math.random();n.exports=function(s){return"Symbol(".concat(s===void 0?"":s,")_",(++a+o).toString(36))}},function(n,i,a){var o=a(22);n.exports=function(s){return Object(o(s))}},function(n,i){i.f={}.propertyIsEnumerable},function(n,i,a){var o=a(52)(!0);a(34)(String,"String",function(s){this._t=String(s),this._i=0},function(){var s,l=this._t,c=this._i;return c>=l.length?{value:void 0,done:!0}:(s=o(l,c),this._i+=s.length,{value:s,done:!1})})},function(n,i){var a=Math.ceil,o=Math.floor;n.exports=function(s){return isNaN(s=+s)?0:(s>0?o:a)(s)}},function(n,i){n.exports=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a}},function(n,i,a){var o=a(11);n.exports=function(s,l){if(!o(s))return s;var c,u;if(l&&typeof(c=s.toString)=="function"&&!o(u=c.call(s))||typeof(c=s.valueOf)=="function"&&!o(u=c.call(s))||!l&&typeof(c=s.toString)=="function"&&!o(u=c.call(s)))return u;throw TypeError("Can't convert object to primitive value")}},function(n,i){var a={}.toString;n.exports=function(o){return a.call(o).slice(8,-1)}},function(n,i,a){var o=a(26)("keys"),s=a(17);n.exports=function(l){return o[l]||(o[l]=s(l))}},function(n,i,a){var o=a(1),s=a(3),l=s["__core-js_shared__"]||(s["__core-js_shared__"]={});(n.exports=function(c,u){return l[c]||(l[c]=u!==void 0?u:{})})("versions",[]).push({version:o.version,mode:a(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(n,i){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(n,i,a){var o=a(7).f,s=a(5),l=a(2)("toStringTag");n.exports=function(c,u,f){c&&!s(c=f?c:c.prototype,l)&&o(c,l,{configurable:!0,value:u})}},function(n,i,a){a(62);for(var o=a(3),s=a(6),l=a(12),c=a(2)("toStringTag"),u="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;fdocument.F=Object<\/script>"),d.close(),f=d.F;p--;)delete f.prototype[l[p]];return f()};n.exports=Object.create||function(d,h){var p;return d!==null?(u.prototype=o(d),p=new u,u.prototype=null,p[c]=d):p=f(),h===void 0?p:s(p,h)}},function(n,i,a){var o=a(5),s=a(9),l=a(57)(!1),c=a(25)("IE_PROTO");n.exports=function(u,f){var d,h=s(u),p=0,g=[];for(d in h)d!=c&&o(h,d)&&g.push(d);for(;f.length>p;)o(h,d=f[p++])&&(~l(g,d)||g.push(d));return g}},function(n,i,a){var o=a(24);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(s){return o(s)=="String"?s.split(""):Object(s)}},function(n,i,a){var o=a(39),s=a(27).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(l){return o(l,s)}},function(n,i,a){var o=a(24),s=a(2)("toStringTag"),l=o(function(){return arguments}())=="Arguments";n.exports=function(c){var u,f,d;return c===void 0?"Undefined":c===null?"Null":typeof(f=function(h,p){try{return h[p]}catch{}}(u=Object(c),s))=="string"?f:l?o(u):(d=o(u))=="Object"&&typeof u.callee=="function"?"Arguments":d}},function(n,i){var a;a=function(){return this}();try{a=a||new Function("return this")()}catch{typeof window=="object"&&(a=window)}n.exports=a},function(n,i){var a=/-?\d+(\.\d+)?%?/g;n.exports=function(o){return o.match(a)}},function(n,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.getBase16Theme=i.createStyling=i.invertTheme=void 0;var o=v(a(49)),s=v(a(76)),l=v(a(81)),c=v(a(89)),u=v(a(93)),f=function(D){if(D&&D.__esModule)return D;var L={};if(D!=null)for(var O in D)Object.prototype.hasOwnProperty.call(D,O)&&(L[O]=D[O]);return L.default=D,L}(a(94)),d=v(a(132)),h=v(a(133)),p=v(a(138)),g=a(139);function v(D){return D&&D.__esModule?D:{default:D}}var y=f.default,m=(0,c.default)(y),b=(0,p.default)(h.default,g.rgb2yuv,function(D){var L,O=(0,l.default)(D,3),P=O[0],x=O[1],T=O[2];return[(L=P,L<.25?1:L<.5?.9-L:1.1-L),x,T]},g.yuv2rgb,d.default),w=function(D){return function(L){return{className:[L.className,D.className].filter(Boolean).join(" "),style:(0,s.default)({},L.style||{},D.style||{})}}},C=function(D,L){var O=(0,c.default)(L);for(var P in D)O.indexOf(P)===-1&&O.push(P);return O.reduce(function(x,T){return x[T]=function(E,N){if(E===void 0)return N;if(N===void 0)return E;var F=E===void 0?"undefined":(0,o.default)(E),B=N===void 0?"undefined":(0,o.default)(N);switch(F){case"string":switch(B){case"string":return[N,E].filter(Boolean).join(" ");case"object":return w({className:E,style:N});case"function":return function(j){for(var k=arguments.length,$=Array(k>1?k-1:0),H=1;H1?k-1:0),H=1;H1?k-1:0),H=1;H1?k-1:0),H=1;H1?k-1:0),H=1;H2?O-2:0),x=2;x3?L-3:0),P=3;P1&&arguments[1]!==void 0?arguments[1]:{},T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=x.defaultBase16,N=E===void 0?y:E,F=x.base16Themes,B=F===void 0?null:F,j=I(T,B);j&&(T=(0,s.default)({},j,T));var k=m.reduce(function(ie,W){return ie[W]=T[W]||N[W],ie},{}),$=(0,c.default)(T).reduce(function(ie,W){return m.indexOf(W)===-1&&(ie[W]=T[W]),ie},{}),H=D(k),Y=C($,H);return(0,u.default)(A,2).apply(void 0,[Y].concat(O))},3),i.getBase16Theme=function(D,L){if(D&&D.extend&&(D=D.extend),typeof D=="string"){var O=D.split(":"),P=(0,l.default)(O,2),x=P[0],T=P[1];D=(L||{})[x]||f[x],T==="inverted"&&(D=S(D))}return D&&D.hasOwnProperty("base00")?D:void 0})},function(n,i,a){var o,s=typeof Reflect=="object"?Reflect:null,l=s&&typeof s.apply=="function"?s.apply:function(w,C,A){return Function.prototype.apply.call(w,C,A)};o=s&&typeof s.ownKeys=="function"?s.ownKeys:Object.getOwnPropertySymbols?function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:function(w){return Object.getOwnPropertyNames(w)};var c=Number.isNaN||function(w){return w!=w};function u(){u.init.call(this)}n.exports=u,n.exports.once=function(w,C){return new Promise(function(A,S){function I(){D!==void 0&&w.removeListener("error",D),A([].slice.call(arguments))}var D;C!=="error"&&(D=function(L){w.removeListener(C,I),S(L)},w.once("error",D)),w.once(C,I)})},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var f=10;function d(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}function h(w){return w._maxListeners===void 0?u.defaultMaxListeners:w._maxListeners}function p(w,C,A,S){var I,D,L,O;if(d(A),(D=w._events)===void 0?(D=w._events=Object.create(null),w._eventsCount=0):(D.newListener!==void 0&&(w.emit("newListener",C,A.listener?A.listener:A),D=w._events),L=D[C]),L===void 0)L=D[C]=A,++w._eventsCount;else if(typeof L=="function"?L=D[C]=S?[A,L]:[L,A]:S?L.unshift(A):L.push(A),(I=h(w))>0&&L.length>I&&!L.warned){L.warned=!0;var P=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");P.name="MaxListenersExceededWarning",P.emitter=w,P.type=C,P.count=L.length,O=P,console&&console.warn&&console.warn(O)}return w}function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(w,C,A){var S={fired:!1,wrapFn:void 0,target:w,type:C,listener:A},I=g.bind(S);return I.listener=A,S.wrapFn=I,I}function y(w,C,A){var S=w._events;if(S===void 0)return[];var I=S[C];return I===void 0?[]:typeof I=="function"?A?[I.listener||I]:[I]:A?function(D){for(var L=new Array(D.length),O=0;O0&&(D=C[0]),D instanceof Error)throw D;var L=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw L.context=D,L}var O=I[w];if(O===void 0)return!1;if(typeof O=="function")l(O,this,C);else{var P=O.length,x=b(O,P);for(A=0;A=0;D--)if(A[D]===C||A[D].listener===C){L=A[D].listener,I=D;break}if(I<0)return this;I===0?A.shift():function(O,P){for(;P+1=0;S--)this.removeListener(w,C[S]);return this},u.prototype.listeners=function(w){return y(this,w,!0)},u.prototype.rawListeners=function(w){return y(this,w,!1)},u.listenerCount=function(w,C){return typeof w.listenerCount=="function"?w.listenerCount(C):m.call(w,C)},u.prototype.listenerCount=m,u.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(n,i,a){n.exports.Dispatcher=a(140)},function(n,i,a){n.exports=a(142)},function(n,i,a){i.__esModule=!0;var o=c(a(50)),s=c(a(65)),l=typeof s.default=="function"&&typeof o.default=="symbol"?function(u){return typeof u}:function(u){return u&&typeof s.default=="function"&&u.constructor===s.default&&u!==s.default.prototype?"symbol":typeof u};function c(u){return u&&u.__esModule?u:{default:u}}i.default=typeof s.default=="function"&&l(o.default)==="symbol"?function(u){return u===void 0?"undefined":l(u)}:function(u){return u&&typeof s.default=="function"&&u.constructor===s.default&&u!==s.default.prototype?"symbol":u===void 0?"undefined":l(u)}},function(n,i,a){n.exports={default:a(51),__esModule:!0}},function(n,i,a){a(20),a(29),n.exports=a(30).f("iterator")},function(n,i,a){var o=a(21),s=a(22);n.exports=function(l){return function(c,u){var f,d,h=String(s(c)),p=o(u),g=h.length;return p<0||p>=g?l?"":void 0:(f=h.charCodeAt(p))<55296||f>56319||p+1===g||(d=h.charCodeAt(p+1))<56320||d>57343?l?h.charAt(p):f:l?h.slice(p,p+2):d-56320+(f-55296<<10)+65536}}},function(n,i,a){var o=a(54);n.exports=function(s,l,c){if(o(s),l===void 0)return s;switch(c){case 1:return function(u){return s.call(l,u)};case 2:return function(u,f){return s.call(l,u,f)};case 3:return function(u,f,d){return s.call(l,u,f,d)}}return function(){return s.apply(l,arguments)}}},function(n,i){n.exports=function(a){if(typeof a!="function")throw TypeError(a+" is not a function!");return a}},function(n,i,a){var o=a(38),s=a(16),l=a(28),c={};a(6)(c,a(2)("iterator"),function(){return this}),n.exports=function(u,f,d){u.prototype=o(c,{next:s(1,d)}),l(u,f+" Iterator")}},function(n,i,a){var o=a(7),s=a(10),l=a(13);n.exports=a(4)?Object.defineProperties:function(c,u){s(c);for(var f,d=l(u),h=d.length,p=0;h>p;)o.f(c,f=d[p++],u[f]);return c}},function(n,i,a){var o=a(9),s=a(58),l=a(59);n.exports=function(c){return function(u,f,d){var h,p=o(u),g=s(p.length),v=l(d,g);if(c&&f!=f){for(;g>v;)if((h=p[v++])!=h)return!0}else for(;g>v;v++)if((c||v in p)&&p[v]===f)return c||v||0;return!c&&-1}}},function(n,i,a){var o=a(21),s=Math.min;n.exports=function(l){return l>0?s(o(l),9007199254740991):0}},function(n,i,a){var o=a(21),s=Math.max,l=Math.min;n.exports=function(c,u){return(c=o(c))<0?s(c+u,0):l(c,u)}},function(n,i,a){var o=a(3).document;n.exports=o&&o.documentElement},function(n,i,a){var o=a(5),s=a(18),l=a(25)("IE_PROTO"),c=Object.prototype;n.exports=Object.getPrototypeOf||function(u){return u=s(u),o(u,l)?u[l]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u instanceof Object?c:null}},function(n,i,a){var o=a(63),s=a(64),l=a(12),c=a(9);n.exports=a(34)(Array,"Array",function(u,f){this._t=c(u),this._i=0,this._k=f},function(){var u=this._t,f=this._k,d=this._i++;return!u||d>=u.length?(this._t=void 0,s(1)):s(0,f=="keys"?d:f=="values"?u[d]:[d,u[d]])},"values"),l.Arguments=l.Array,o("keys"),o("values"),o("entries")},function(n,i){n.exports=function(){}},function(n,i){n.exports=function(a,o){return{value:o,done:!!a}}},function(n,i,a){n.exports={default:a(66),__esModule:!0}},function(n,i,a){a(67),a(73),a(74),a(75),n.exports=a(1).Symbol},function(n,i,a){var o=a(3),s=a(5),l=a(4),c=a(15),u=a(37),f=a(68).KEY,d=a(8),h=a(26),p=a(28),g=a(17),v=a(2),y=a(30),m=a(31),b=a(69),w=a(70),C=a(10),A=a(11),S=a(18),I=a(9),D=a(23),L=a(16),O=a(38),P=a(71),x=a(72),T=a(32),E=a(7),N=a(13),F=x.f,B=E.f,j=P.f,k=o.Symbol,$=o.JSON,H=$&&$.stringify,Y=v("_hidden"),ie=v("toPrimitive"),W={}.propertyIsEnumerable,Q=h("symbol-registry"),J=h("symbols"),ee=h("op-symbols"),ne=Object.prototype,V=typeof k=="function"&&!!T.f,oe=o.QObject,ye=!oe||!oe.prototype||!oe.prototype.findChild,Te=l&&d(function(){return O(B({},"a",{get:function(){return B(this,"a",{value:7}).a}})).a!=7})?function(q,z,G){var re=F(ne,z);re&&delete ne[z],B(q,z,G),re&&q!==ne&&B(ne,z,re)}:B,Me=function(q){var z=J[q]=O(k.prototype);return z._k=q,z},Oe=V&&typeof k.iterator=="symbol"?function(q){return typeof q=="symbol"}:function(q){return q instanceof k},nt=function(q,z,G){return q===ne&&nt(ee,z,G),C(q),z=D(z,!0),C(G),s(J,z)?(G.enumerable?(s(q,Y)&&q[Y][z]&&(q[Y][z]=!1),G=O(G,{enumerable:L(0,!1)})):(s(q,Y)||B(q,Y,L(1,{})),q[Y][z]=!0),Te(q,z,G)):B(q,z,G)},it=function(q,z){C(q);for(var G,re=b(z=I(z)),ue=0,_e=re.length;_e>ue;)nt(q,G=re[ue++],z[G]);return q},St=function(q){var z=W.call(this,q=D(q,!0));return!(this===ne&&s(J,q)&&!s(ee,q))&&(!(z||!s(this,q)||!s(J,q)||s(this,Y)&&this[Y][q])||z)},bt=function(q,z){if(q=I(q),z=D(z,!0),q!==ne||!s(J,z)||s(ee,z)){var G=F(q,z);return!G||!s(J,z)||s(q,Y)&&q[Y][z]||(G.enumerable=!0),G}},Ce=function(q){for(var z,G=j(I(q)),re=[],ue=0;G.length>ue;)s(J,z=G[ue++])||z==Y||z==f||re.push(z);return re},We=function(q){for(var z,G=q===ne,re=j(G?ee:I(q)),ue=[],_e=0;re.length>_e;)!s(J,z=re[_e++])||G&&!s(ne,z)||ue.push(J[z]);return ue};V||(u((k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var q=g(arguments.length>0?arguments[0]:void 0),z=function(G){this===ne&&z.call(ee,G),s(this,Y)&&s(this[Y],q)&&(this[Y][q]=!1),Te(this,q,L(1,G))};return l&&ye&&Te(ne,q,{configurable:!0,set:z}),Me(q)}).prototype,"toString",function(){return this._k}),x.f=bt,E.f=nt,a(41).f=P.f=Ce,a(19).f=St,T.f=We,l&&!a(14)&&u(ne,"propertyIsEnumerable",St,!0),y.f=function(q){return Me(v(q))}),c(c.G+c.W+c.F*!V,{Symbol:k});for(var Le="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ke=0;Le.length>Ke;)v(Le[Ke++]);for(var qe=N(v.store),we=0;qe.length>we;)m(qe[we++]);c(c.S+c.F*!V,"Symbol",{for:function(q){return s(Q,q+="")?Q[q]:Q[q]=k(q)},keyFor:function(q){if(!Oe(q))throw TypeError(q+" is not a symbol!");for(var z in Q)if(Q[z]===q)return z},useSetter:function(){ye=!0},useSimple:function(){ye=!1}}),c(c.S+c.F*!V,"Object",{create:function(q,z){return z===void 0?O(q):it(O(q),z)},defineProperty:nt,defineProperties:it,getOwnPropertyDescriptor:bt,getOwnPropertyNames:Ce,getOwnPropertySymbols:We});var Se=d(function(){T.f(1)});c(c.S+c.F*Se,"Object",{getOwnPropertySymbols:function(q){return T.f(S(q))}}),$&&c(c.S+c.F*(!V||d(function(){var q=k();return H([q])!="[null]"||H({a:q})!="{}"||H(Object(q))!="{}"})),"JSON",{stringify:function(q){for(var z,G,re=[q],ue=1;arguments.length>ue;)re.push(arguments[ue++]);if(G=z=re[1],(A(z)||q!==void 0)&&!Oe(q))return w(z)||(z=function(_e,Ee){if(typeof G=="function"&&(Ee=G.call(this,_e,Ee)),!Oe(Ee))return Ee}),re[1]=z,H.apply($,re)}}),k.prototype[ie]||a(6)(k.prototype,ie,k.prototype.valueOf),p(k,"Symbol"),p(Math,"Math",!0),p(o.JSON,"JSON",!0)},function(n,i,a){var o=a(17)("meta"),s=a(11),l=a(5),c=a(7).f,u=0,f=Object.isExtensible||function(){return!0},d=!a(8)(function(){return f(Object.preventExtensions({}))}),h=function(g){c(g,o,{value:{i:"O"+ ++u,w:{}}})},p=n.exports={KEY:o,NEED:!1,fastKey:function(g,v){if(!s(g))return typeof g=="symbol"?g:(typeof g=="string"?"S":"P")+g;if(!l(g,o)){if(!f(g))return"F";if(!v)return"E";h(g)}return g[o].i},getWeak:function(g,v){if(!l(g,o)){if(!f(g))return!0;if(!v)return!1;h(g)}return g[o].w},onFreeze:function(g){return d&&p.NEED&&f(g)&&!l(g,o)&&h(g),g}}},function(n,i,a){var o=a(13),s=a(32),l=a(19);n.exports=function(c){var u=o(c),f=s.f;if(f)for(var d,h=f(c),p=l.f,g=0;h.length>g;)p.call(c,d=h[g++])&&u.push(d);return u}},function(n,i,a){var o=a(24);n.exports=Array.isArray||function(s){return o(s)=="Array"}},function(n,i,a){var o=a(9),s=a(41).f,l={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function(u){return c&&l.call(u)=="[object Window]"?function(f){try{return s(f)}catch{return c.slice()}}(u):s(o(u))}},function(n,i,a){var o=a(19),s=a(16),l=a(9),c=a(23),u=a(5),f=a(35),d=Object.getOwnPropertyDescriptor;i.f=a(4)?d:function(h,p){if(h=l(h),p=c(p,!0),f)try{return d(h,p)}catch{}if(u(h,p))return s(!o.f.call(h,p),h[p])}},function(n,i){},function(n,i,a){a(31)("asyncIterator")},function(n,i,a){a(31)("observable")},function(n,i,a){i.__esModule=!0;var o,s=a(77),l=(o=s)&&o.__esModule?o:{default:o};i.default=l.default||function(c){for(var u=1;uy;)for(var w,C=f(arguments[y++]),A=m?s(C).concat(m(C)):s(C),S=A.length,I=0;S>I;)w=A[I++],o&&!b.call(C,w)||(g[w]=C[w]);return g}:d},function(n,i,a){i.__esModule=!0;var o=l(a(82)),s=l(a(85));function l(c){return c&&c.__esModule?c:{default:c}}i.default=function(c,u){if(Array.isArray(c))return c;if((0,o.default)(Object(c)))return function(f,d){var h=[],p=!0,g=!1,v=void 0;try{for(var y,m=(0,s.default)(f);!(p=(y=m.next()).done)&&(h.push(y.value),!d||h.length!==d);p=!0);}catch(b){g=!0,v=b}finally{try{!p&&m.return&&m.return()}finally{if(g)throw v}}return h}(c,u);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(n,i,a){n.exports={default:a(83),__esModule:!0}},function(n,i,a){a(29),a(20),n.exports=a(84)},function(n,i,a){var o=a(42),s=a(2)("iterator"),l=a(12);n.exports=a(1).isIterable=function(c){var u=Object(c);return u[s]!==void 0||"@@iterator"in u||l.hasOwnProperty(o(u))}},function(n,i,a){n.exports={default:a(86),__esModule:!0}},function(n,i,a){a(29),a(20),n.exports=a(87)},function(n,i,a){var o=a(10),s=a(88);n.exports=a(1).getIterator=function(l){var c=s(l);if(typeof c!="function")throw TypeError(l+" is not iterable!");return o(c.call(l))}},function(n,i,a){var o=a(42),s=a(2)("iterator"),l=a(12);n.exports=a(1).getIteratorMethod=function(c){if(c!=null)return c[s]||c["@@iterator"]||l[o(c)]}},function(n,i,a){n.exports={default:a(90),__esModule:!0}},function(n,i,a){a(91),n.exports=a(1).Object.keys},function(n,i,a){var o=a(18),s=a(13);a(92)("keys",function(){return function(l){return s(o(l))}})},function(n,i,a){var o=a(15),s=a(1),l=a(8);n.exports=function(c,u){var f=(s.Object||{})[c]||Object[c],d={};d[c]=u(f),o(o.S+o.F*l(function(){f(1)}),"Object",d)}},function(n,i,a){(function(o){var s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l=/^\s+|\s+$/g,c=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,u=/\{\n\/\* \[wrapped with (.+)\] \*/,f=/,? & /,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^\[object .+?Constructor\]$/,g=/^0o[0-7]+$/i,v=/^(?:0|[1-9]\d*)$/,y=parseInt,m=typeof o=="object"&&o&&o.Object===Object&&o,b=typeof self=="object"&&self&&self.Object===Object&&self,w=m||b||Function("return this")();function C(we,Se,q){switch(q.length){case 0:return we.call(Se);case 1:return we.call(Se,q[0]);case 2:return we.call(Se,q[0],q[1]);case 3:return we.call(Se,q[0],q[1],q[2])}return we.apply(Se,q)}function A(we,Se){return!!(we&&we.length)&&function(q,z,G){if(z!=z)return function(_e,Ee,et,pt){for(var Ct=_e.length,ot=et+-1;++ot-1}function S(we){return we!=we}function I(we,Se){for(var q=we.length,z=0;q--;)we[q]===Se&&z++;return z}function D(we,Se){for(var q=-1,z=we.length,G=0,re=[];++q2?O:void 0);function W(we){return Le(we)?$(we):{}}function Q(we){return!(!Le(we)||function(Se){return!!N&&N in Se}(we))&&(function(Se){var q=Le(Se)?j.call(Se):"";return q=="[object Function]"||q=="[object GeneratorFunction]"}(we)||function(Se){var q=!1;if(Se!=null&&typeof Se.toString!="function")try{q=!!(Se+"")}catch{}return q}(we)?k:p).test(function(Se){if(Se!=null){try{return F.call(Se)}catch{}try{return Se+""}catch{}}return""}(we))}function J(we,Se,q,z){for(var G=-1,re=we.length,ue=q.length,_e=-1,Ee=Se.length,et=H(re-ue,0),pt=Array(Ee+et),Ct=!z;++_e1&&yt.reverse(),pt&&Ee1?"& ":"")+Se[z],Se=Se.join(q>2?", ":" "),we.replace(c,`{ -/* [wrapped with `+Se+`] */ -`)}function it(we,Se){return!!(Se=Se??9007199254740991)&&(typeof we=="number"||v.test(we))&&we>-1&&we%1==0&&we1&&l--,u=6*l<1?o+6*(s-o)*l:2*l<1?s:3*l<2?o+(s-o)*(2/3-l)*6:o,c[p]=255*u;return c}},function(n,i,a){(function(o){var s=typeof o=="object"&&o&&o.Object===Object&&o,l=typeof self=="object"&&self&&self.Object===Object&&self,c=s||l||Function("return this")();function u(D,L,O){switch(O.length){case 0:return D.call(L);case 1:return D.call(L,O[0]);case 2:return D.call(L,O[0],O[1]);case 3:return D.call(L,O[0],O[1],O[2])}return D.apply(L,O)}function f(D,L){for(var O=-1,P=L.length,x=D.length;++O-1&&x%1==0&&x<=9007199254740991}(P.length)&&!function(x){var T=function(E){var N=typeof E;return!!E&&(N=="object"||N=="function")}(x)?p.call(x):"";return T=="[object Function]"||T=="[object GeneratorFunction]"}(P)}(O)}(L)&&h.call(L,"callee")&&(!v.call(L,"callee")||p.call(L)=="[object Arguments]")}(D)||!!(y&&D&&D[y])}var w=Array.isArray,C,A,S,I=(A=function(D){var L=(D=function(x,T,E,N,F){var B=-1,j=x.length;for(E||(E=b),F||(F=[]);++B2?l-2:0),u=2;u"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var le,de=p(ve);if(me){var ge=p(this).constructor;le=Reflect.construct(de,arguments,ge)}else le=de.apply(this,arguments);return y(this,le)}}a.r(i);var b=a(0),w=a.n(b);function C(){var ve=this.constructor.getDerivedStateFromProps(this.props,this.state);ve!=null&&this.setState(ve)}function A(ve){this.setState((function(me){var le=this.constructor.getDerivedStateFromProps(ve,me);return le??null}).bind(this))}function S(ve,me){try{var le=this.props,de=this.state;this.props=ve,this.state=me,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(le,de)}finally{this.props=le,this.state=de}}function I(ve){var me=ve.prototype;if(!me||!me.isReactComponent)throw new Error("Can only polyfill class components");if(typeof ve.getDerivedStateFromProps!="function"&&typeof me.getSnapshotBeforeUpdate!="function")return ve;var le=null,de=null,ge=null;if(typeof me.componentWillMount=="function"?le="componentWillMount":typeof me.UNSAFE_componentWillMount=="function"&&(le="UNSAFE_componentWillMount"),typeof me.componentWillReceiveProps=="function"?de="componentWillReceiveProps":typeof me.UNSAFE_componentWillReceiveProps=="function"&&(de="UNSAFE_componentWillReceiveProps"),typeof me.componentWillUpdate=="function"?ge="componentWillUpdate":typeof me.UNSAFE_componentWillUpdate=="function"&&(ge="UNSAFE_componentWillUpdate"),le!==null||de!==null||ge!==null){var Ue=ve.displayName||ve.name,tt=typeof ve.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. - -`+Ue+" uses "+tt+" but also contains the following legacy lifecycles:"+(le!==null?` - `+le:"")+(de!==null?` - `+de:"")+(ge!==null?` - `+ge:"")+` - -The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof ve.getDerivedStateFromProps=="function"&&(me.componentWillMount=C,me.componentWillReceiveProps=A),typeof me.getSnapshotBeforeUpdate=="function"){if(typeof me.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");me.componentWillUpdate=S;var Qe=me.componentDidUpdate;me.componentDidUpdate=function(Ne,ut,Lt){var Wr=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:Lt;Qe.call(this,Ne,ut,Wr)}}return ve}function D(ve,me){if(ve==null)return{};var le,de,ge=function(tt,Qe){if(tt==null)return{};var Ne,ut,Lt={},Wr=Object.keys(tt);for(ut=0;ut=0||(Lt[Ne]=tt[Ne]);return Lt}(ve,me);if(Object.getOwnPropertySymbols){var Ue=Object.getOwnPropertySymbols(ve);for(de=0;de=0||Object.prototype.propertyIsEnumerable.call(ve,le)&&(ge[le]=ve[le])}return ge}function L(ve){var me=function(le){return{}.toString.call(le).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}(ve);return me==="number"&&(me=isNaN(ve)?"nan":(0|ve)!=ve?"float":"integer"),me}C.__suppressDeprecationWarning=!0,A.__suppressDeprecationWarning=!0,S.__suppressDeprecationWarning=!0;var O={scheme:"rjv-default",author:"mac gainor",base00:"rgba(0, 0, 0, 0)",base01:"rgb(245, 245, 245)",base02:"rgb(235, 235, 235)",base03:"#93a1a1",base04:"rgba(0, 0, 0, 0.3)",base05:"#586e75",base06:"#073642",base07:"#002b36",base08:"#d33682",base09:"#cb4b16",base0A:"#dc322f",base0B:"#859900",base0C:"#6c71c4",base0D:"#586e75",base0E:"#2aa198",base0F:"#268bd2"},P={scheme:"rjv-grey",author:"mac gainor",base00:"rgba(1, 1, 1, 0)",base01:"rgba(1, 1, 1, 0.1)",base02:"rgba(0, 0, 0, 0.2)",base03:"rgba(1, 1, 1, 0.3)",base04:"rgba(0, 0, 0, 0.4)",base05:"rgba(1, 1, 1, 0.5)",base06:"rgba(1, 1, 1, 0.6)",base07:"rgba(1, 1, 1, 0.7)",base08:"rgba(1, 1, 1, 0.8)",base09:"rgba(1, 1, 1, 0.8)",base0A:"rgba(1, 1, 1, 0.8)",base0B:"rgba(1, 1, 1, 0.8)",base0C:"rgba(1, 1, 1, 0.8)",base0D:"rgba(1, 1, 1, 0.8)",base0E:"rgba(1, 1, 1, 0.8)",base0F:"rgba(1, 1, 1, 0.8)"},x={white:"#fff",black:"#000",transparent:"rgba(1, 1, 1, 0)",globalFontFamily:"monospace",globalCursor:"default",indentBlockWidth:"5px",braceFontWeight:"bold",braceCursor:"pointer",ellipsisFontSize:"18px",ellipsisLineHeight:"10px",ellipsisCursor:"pointer",keyMargin:"0px 5px",keyLetterSpacing:"0.5px",keyFontStyle:"none",keyBorderRadius:"3px",keyColonWeight:"bold",keyVerticalAlign:"top",keyOpacity:"0.85",keyOpacityHover:"1",keyValPaddingTop:"3px",keyValPaddingBottom:"3px",keyValPaddingRight:"5px",keyValBorderLeft:"1px solid",keyValBorderHover:"2px solid",keyValPaddingHover:"3px 5px 3px 4px",pushedContentMarginLeft:"6px",variableValuePaddingRight:"6px",nullFontSize:"11px",nullFontWeight:"bold",nullPadding:"1px 2px",nullBorderRadius:"3px",nanFontSize:"11px",nanFontWeight:"bold",nanPadding:"1px 2px",nanBorderRadius:"3px",undefinedFontSize:"11px",undefinedFontWeight:"bold",undefinedPadding:"1px 2px",undefinedBorderRadius:"3px",dataTypeFontSize:"11px",dataTypeMarginRight:"4px",datatypeOpacity:"0.8",objectSizeBorderRadius:"3px",objectSizeFontStyle:"italic",objectSizeMargin:"0px 6px 0px 0px",clipboardCursor:"pointer",clipboardCheckMarginLeft:"-12px",metaDataPadding:"0px 0px 0px 10px",arrayGroupMetaPadding:"0px 0px 0px 4px",iconContainerWidth:"17px",tooltipPadding:"4px",editInputMinWidth:"130px",editInputBorderRadius:"2px",editInputPadding:"5px",editInputMarginRight:"4px",editInputFontFamily:"monospace",iconCursor:"pointer",iconFontSize:"15px",iconPaddingRight:"1px",dateValueMarginLeft:"2px",iconMarginRight:"3px",detectedRowPaddingTop:"3px",addKeyCoverBackground:"rgba(255, 255, 255, 0.3)",addKeyCoverPosition:"absolute",addKeyCoverPositionPx:"0px",addKeyModalWidth:"200px",addKeyModalMargin:"auto",addKeyModalPadding:"10px",addKeyModalRadius:"3px"},T=a(45),E=function(ve){var me=function(le){return{backgroundColor:le.base00,ellipsisColor:le.base09,braceColor:le.base07,expandedIcon:le.base0D,collapsedIcon:le.base0E,keyColor:le.base07,arrayKeyColor:le.base0C,objectSize:le.base04,copyToClipboard:le.base0F,copyToClipboardCheck:le.base0D,objectBorder:le.base02,dataTypes:{boolean:le.base0E,date:le.base0D,float:le.base0B,function:le.base0D,integer:le.base0F,string:le.base09,nan:le.base08,null:le.base0A,undefined:le.base05,regexp:le.base0A,background:le.base02},editVariable:{editIcon:le.base0E,cancelIcon:le.base09,removeIcon:le.base09,addIcon:le.base0E,checkIcon:le.base0E,background:le.base01,color:le.base0A,border:le.base07},addKeyModal:{background:le.base05,border:le.base04,color:le.base0A,labelColor:le.base01},validationFailure:{background:le.base09,iconColor:le.base01,fontColor:le.base01}}}(ve);return{"app-container":{fontFamily:x.globalFontFamily,cursor:x.globalCursor,backgroundColor:me.backgroundColor,position:"relative"},ellipsis:{display:"inline-block",color:me.ellipsisColor,fontSize:x.ellipsisFontSize,lineHeight:x.ellipsisLineHeight,cursor:x.ellipsisCursor},"brace-row":{display:"inline-block",cursor:"pointer"},brace:{display:"inline-block",cursor:x.braceCursor,fontWeight:x.braceFontWeight,color:me.braceColor},"expanded-icon":{color:me.expandedIcon},"collapsed-icon":{color:me.collapsedIcon},colon:{display:"inline-block",margin:x.keyMargin,color:me.keyColor,verticalAlign:"top"},objectKeyVal:function(le,de){return{style:l({paddingTop:x.keyValPaddingTop,paddingRight:x.keyValPaddingRight,paddingBottom:x.keyValPaddingBottom,borderLeft:x.keyValBorderLeft+" "+me.objectBorder,":hover":{paddingLeft:de.paddingLeft-1+"px",borderLeft:x.keyValBorderHover+" "+me.objectBorder}},de)}},"object-key-val-no-border":{padding:x.keyValPadding},"pushed-content":{marginLeft:x.pushedContentMarginLeft},variableValue:function(le,de){return{style:l({display:"inline-block",paddingRight:x.variableValuePaddingRight,position:"relative"},de)}},"object-name":{display:"inline-block",color:me.keyColor,letterSpacing:x.keyLetterSpacing,fontStyle:x.keyFontStyle,verticalAlign:x.keyVerticalAlign,opacity:x.keyOpacity,":hover":{opacity:x.keyOpacityHover}},"array-key":{display:"inline-block",color:me.arrayKeyColor,letterSpacing:x.keyLetterSpacing,fontStyle:x.keyFontStyle,verticalAlign:x.keyVerticalAlign,opacity:x.keyOpacity,":hover":{opacity:x.keyOpacityHover}},"object-size":{color:me.objectSize,borderRadius:x.objectSizeBorderRadius,fontStyle:x.objectSizeFontStyle,margin:x.objectSizeMargin,cursor:"default"},"data-type-label":{fontSize:x.dataTypeFontSize,marginRight:x.dataTypeMarginRight,opacity:x.datatypeOpacity},boolean:{display:"inline-block",color:me.dataTypes.boolean},date:{display:"inline-block",color:me.dataTypes.date},"date-value":{marginLeft:x.dateValueMarginLeft},float:{display:"inline-block",color:me.dataTypes.float},function:{display:"inline-block",color:me.dataTypes.function,cursor:"pointer",whiteSpace:"pre-line"},"function-value":{fontStyle:"italic"},integer:{display:"inline-block",color:me.dataTypes.integer},string:{display:"inline-block",color:me.dataTypes.string},nan:{display:"inline-block",color:me.dataTypes.nan,fontSize:x.nanFontSize,fontWeight:x.nanFontWeight,backgroundColor:me.dataTypes.background,padding:x.nanPadding,borderRadius:x.nanBorderRadius},null:{display:"inline-block",color:me.dataTypes.null,fontSize:x.nullFontSize,fontWeight:x.nullFontWeight,backgroundColor:me.dataTypes.background,padding:x.nullPadding,borderRadius:x.nullBorderRadius},undefined:{display:"inline-block",color:me.dataTypes.undefined,fontSize:x.undefinedFontSize,padding:x.undefinedPadding,borderRadius:x.undefinedBorderRadius,backgroundColor:me.dataTypes.background},regexp:{display:"inline-block",color:me.dataTypes.regexp},"copy-to-clipboard":{cursor:x.clipboardCursor},"copy-icon":{color:me.copyToClipboard,fontSize:x.iconFontSize,marginRight:x.iconMarginRight,verticalAlign:"top"},"copy-icon-copied":{color:me.copyToClipboardCheck,marginLeft:x.clipboardCheckMarginLeft},"array-group-meta-data":{display:"inline-block",padding:x.arrayGroupMetaPadding},"object-meta-data":{display:"inline-block",padding:x.metaDataPadding},"icon-container":{display:"inline-block",width:x.iconContainerWidth},tooltip:{padding:x.tooltipPadding},removeVarIcon:{verticalAlign:"top",display:"inline-block",color:me.editVariable.removeIcon,cursor:x.iconCursor,fontSize:x.iconFontSize,marginRight:x.iconMarginRight},addVarIcon:{verticalAlign:"top",display:"inline-block",color:me.editVariable.addIcon,cursor:x.iconCursor,fontSize:x.iconFontSize,marginRight:x.iconMarginRight},editVarIcon:{verticalAlign:"top",display:"inline-block",color:me.editVariable.editIcon,cursor:x.iconCursor,fontSize:x.iconFontSize,marginRight:x.iconMarginRight},"edit-icon-container":{display:"inline-block",verticalAlign:"top"},"check-icon":{display:"inline-block",cursor:x.iconCursor,color:me.editVariable.checkIcon,fontSize:x.iconFontSize,paddingRight:x.iconPaddingRight},"cancel-icon":{display:"inline-block",cursor:x.iconCursor,color:me.editVariable.cancelIcon,fontSize:x.iconFontSize,paddingRight:x.iconPaddingRight},"edit-input":{display:"inline-block",minWidth:x.editInputMinWidth,borderRadius:x.editInputBorderRadius,backgroundColor:me.editVariable.background,color:me.editVariable.color,padding:x.editInputPadding,marginRight:x.editInputMarginRight,fontFamily:x.editInputFontFamily},"detected-row":{paddingTop:x.detectedRowPaddingTop},"key-modal-request":{position:x.addKeyCoverPosition,top:x.addKeyCoverPositionPx,left:x.addKeyCoverPositionPx,right:x.addKeyCoverPositionPx,bottom:x.addKeyCoverPositionPx,backgroundColor:x.addKeyCoverBackground},"key-modal":{width:x.addKeyModalWidth,backgroundColor:me.addKeyModal.background,marginLeft:x.addKeyModalMargin,marginRight:x.addKeyModalMargin,padding:x.addKeyModalPadding,borderRadius:x.addKeyModalRadius,marginTop:"15px",position:"relative"},"key-modal-label":{color:me.addKeyModal.labelColor,marginLeft:"2px",marginBottom:"5px",fontSize:"11px"},"key-modal-input-container":{overflow:"hidden"},"key-modal-input":{width:"100%",padding:"3px 6px",fontFamily:"monospace",color:me.addKeyModal.color,border:"none",boxSizing:"border-box",borderRadius:"2px"},"key-modal-cancel":{backgroundColor:me.editVariable.removeIcon,position:"absolute",top:"0px",right:"0px",borderRadius:"0px 3px 0px 3px",cursor:"pointer"},"key-modal-cancel-icon":{color:me.addKeyModal.labelColor,fontSize:x.iconFontSize,transform:"rotate(45deg)"},"key-modal-submit":{color:me.editVariable.addIcon,fontSize:x.iconFontSize,position:"absolute",right:"2px",top:"3px",cursor:"pointer"},"function-ellipsis":{display:"inline-block",color:me.ellipsisColor,fontSize:x.ellipsisFontSize,lineHeight:x.ellipsisLineHeight,cursor:x.ellipsisCursor},"validation-failure":{float:"right",padding:"3px 6px",borderRadius:"2px",cursor:"pointer",color:me.validationFailure.fontColor,backgroundColor:me.validationFailure.background},"validation-failure-label":{marginRight:"6px"},"validation-failure-clear":{position:"relative",verticalAlign:"top",cursor:"pointer",color:me.validationFailure.iconColor,fontSize:x.iconFontSize,transform:"rotate(45deg)"}}};function N(ve,me,le){return ve||console.error("theme has not been set"),function(de){var ge=O;return de!==!1&&de!=="none"||(ge=P),Object(T.createStyling)(E,{defaultBase16:ge})(de)}(ve)(me,le)}var F=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=(de.rjvId,de.type_name),Ue=de.displayDataTypes,tt=de.theme;return Ue?w.a.createElement("span",Object.assign({className:"data-type-label"},N(tt,"data-type-label")),ge):null}}]),le}(w.a.PureComponent),B=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props;return w.a.createElement("div",N(de.theme,"boolean"),w.a.createElement(F,Object.assign({type_name:"bool"},de)),de.value?"true":"false")}}]),le}(w.a.PureComponent),j=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props;return w.a.createElement("div",N(de.theme,"date"),w.a.createElement(F,Object.assign({type_name:"date"},de)),w.a.createElement("span",Object.assign({className:"date-value"},N(de.theme,"date-value")),de.value.toLocaleTimeString("en-us",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})))}}]),le}(w.a.PureComponent),k=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props;return w.a.createElement("div",N(de.theme,"float"),w.a.createElement(F,Object.assign({type_name:"float"},de)),this.props.value)}}]),le}(w.a.PureComponent);function $(ve,me){(me==null||me>ve.length)&&(me=ve.length);for(var le=0,de=new Array(me);le"u"||ve[Symbol.iterator]==null){if(Array.isArray(ve)||(le=H(ve))||me){le&&(ve=le);var de=0,ge=function(){};return{s:ge,n:function(){return de>=ve.length?{done:!0}:{done:!1,value:ve[de++]}},e:function(Ne){throw Ne},f:ge}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ue,tt=!0,Qe=!1;return{s:function(){le=ve[Symbol.iterator]()},n:function(){var Ne=le.next();return tt=Ne.done,Ne},e:function(Ne){Qe=!0,Ue=Ne},f:function(){try{tt||le.return==null||le.return()}finally{if(Qe)throw Ue}}}}function ie(ve){return function(me){if(Array.isArray(me))return $(me)}(ve)||function(me){if(typeof Symbol<"u"&&Symbol.iterator in Object(me))return Array.from(me)}(ve)||H(ve)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var W=a(46),Q=new(a(47)).Dispatcher,J=new(function(ve){h(le,ve);var me=m(le);function le(){var de;c(this,le);for(var ge=arguments.length,Ue=new Array(ge),tt=0;ttge&&(Qe.style.cursor="pointer",this.state.collapsed&&(tt=w.a.createElement("span",null,tt.substring(0,ge),w.a.createElement("span",N(Ue,"ellipsis")," ...")))),w.a.createElement("div",N(Ue,"string"),w.a.createElement(F,Object.assign({type_name:"string"},de)),w.a.createElement("span",Object.assign({className:"string-value"},Qe,{onClick:this.toggleCollapsed}),'"',tt,'"'))}}]),le}(w.a.PureComponent),Oe=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){return w.a.createElement("div",N(this.props.theme,"undefined"),"undefined")}}]),le}(w.a.PureComponent);function nt(){return(nt=Object.assign||function(ve){for(var me=1;me=0||(zs[ci]=Cr[ci]);return zs}(ve,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),Lt,Wr=ut.value!==void 0,nn=Object(b.useRef)(null),Dn=Ce(nn,me),Hr=Object(b.useRef)(0),Nn=Object(b.useRef)(),zn=function(){var Cr=nn.current,pi=le&&Nn.current?Nn.current:function(bs){var M0=window.getComputedStyle(bs);if(M0===null)return null;var fd,no=(fd=M0,we.reduce(function(D0,xl){return D0[xl]=fd[xl],D0},{})),bl=no.boxSizing;return bl===""?null:(Se&&bl==="border-box"&&(no.width=parseFloat(no.width)+parseFloat(no.borderRightWidth)+parseFloat(no.borderLeftWidth)+parseFloat(no.paddingRight)+parseFloat(no.paddingLeft)+"px"),{sizingStyle:no,paddingSize:parseFloat(no.paddingBottom)+parseFloat(no.paddingTop),borderSize:parseFloat(no.borderBottomWidth)+parseFloat(no.borderTopWidth)})}(Cr);if(pi){Nn.current=pi;var ci=function(bs,M0,fd,no){fd===void 0&&(fd=1),no===void 0&&(no=1/0),Ke||((Ke=document.createElement("textarea")).setAttribute("tab-index","-1"),Ke.setAttribute("aria-hidden","true"),Le(Ke)),Ke.parentNode===null&&document.body.appendChild(Ke);var bl=bs.paddingSize,D0=bs.borderSize,xl=bs.sizingStyle,$h=xl.boxSizing;Object.keys(xl).forEach(function(N0){var dd=N0;Ke.style[dd]=xl[dd]}),Le(Ke),Ke.value=M0;var Bh=function(N0,dd){var Ty=N0.scrollHeight;return dd.sizingStyle.boxSizing==="border-box"?Ty+dd.borderSize:Ty-dd.paddingSize}(Ke,bs);Ke.value="x";var Ay=Ke.scrollHeight-bl,Pv=Ay*fd;$h==="border-box"&&(Pv=Pv+bl+D0),Bh=Math.max(Pv,Bh);var Rv=Ay*no;return $h==="border-box"&&(Rv=Rv+bl+D0),[Bh=Math.min(Rv,Bh),Ay]}(pi,Cr.value||Cr.placeholder||"x",ge,de),ro=ci[0],zs=ci[1];Hr.current!==ro&&(Hr.current=ro,Cr.style.setProperty("height",ro+"px","important"),Ne(ro,{rowHeight:zs}))}};return Object(b.useLayoutEffect)(zn),Lt=St(zn),Object(b.useLayoutEffect)(function(){var Cr=function(pi){Lt.current(pi)};return window.addEventListener("resize",Cr),function(){window.removeEventListener("resize",Cr)}},[]),Object(b.createElement)("textarea",nt({},ut,{onChange:function(Cr){Wr||zn(),tt(Cr)},ref:Dn}))},z=Object(b.forwardRef)(q);function G(ve){ve=ve.trim();try{if((ve=JSON.stringify(JSON.parse(ve)))[0]==="[")return re("array",JSON.parse(ve));if(ve[0]==="{")return re("object",JSON.parse(ve));if(ve.match(/\-?\d+\.\d+/)&&ve.match(/\-?\d+\.\d+/)[0]===ve)return re("float",parseFloat(ve));if(ve.match(/\-?\d+e-\d+/)&&ve.match(/\-?\d+e-\d+/)[0]===ve)return re("float",Number(ve));if(ve.match(/\-?\d+/)&&ve.match(/\-?\d+/)[0]===ve)return re("integer",parseInt(ve));if(ve.match(/\-?\d+e\+\d+/)&&ve.match(/\-?\d+e\+\d+/)[0]===ve)return re("integer",Number(ve))}catch{}switch(ve=ve.toLowerCase()){case"undefined":return re("undefined",void 0);case"nan":return re("nan",NaN);case"null":return re("null",null);case"true":return re("boolean",!0);case"false":return re("boolean",!1);default:if(ve=Date.parse(ve))return re("date",new Date(ve))}return re(!1,null)}function re(ve,me){return{type:ve,value:me}}var ue=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7"})))}}]),le}(w.a.PureComponent),_e=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"})))}}]),le}(w.a.PureComponent),Ee=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]),tt=yt(ge).style;return w.a.createElement("span",Ue,w.a.createElement("svg",{fill:tt.color,width:tt.height,height:tt.width,style:tt,viewBox:"0 0 1792 1792"},w.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),le}(w.a.PureComponent),et=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]),tt=yt(ge).style;return w.a.createElement("span",Ue,w.a.createElement("svg",{fill:tt.color,width:tt.height,height:tt.width,style:tt,viewBox:"0 0 1792 1792"},w.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),le}(w.a.PureComponent),pt=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",{style:l(l({},yt(ge).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},w.a.createElement("path",{d:"M0 14l6-6-6-6z"})))}}]),le}(w.a.PureComponent),Ct=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",{style:l(l({},yt(ge).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},w.a.createElement("path",{d:"M0 5l6 6 6-6z"})))}}]),le}(w.a.PureComponent),ot=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("g",null,w.a.createElement("path",{d:"m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z"}))))}}]),le}(w.a.PureComponent),Pt=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("g",null,w.a.createElement("path",{d:"m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),le}(w.a.PureComponent),mr=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("g",null,w.a.createElement("path",{d:"m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),le}(w.a.PureComponent),qt=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("g",null,w.a.createElement("path",{d:"m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z"}))))}}]),le}(w.a.PureComponent),Ur=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("g",null,w.a.createElement("path",{d:"m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z"}))))}}]),le}(w.a.PureComponent),Ir=function(ve){h(le,ve);var me=m(le);function le(){return c(this,le),me.apply(this,arguments)}return f(le,[{key:"render",value:function(){var de=this.props,ge=de.style,Ue=D(de,["style"]);return w.a.createElement("span",Ue,w.a.createElement("svg",Object.assign({},yt(ge),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),w.a.createElement("g",null,w.a.createElement("path",{d:"m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),le}(w.a.PureComponent);function yt(ve){return ve||(ve={}),{style:l(l({verticalAlign:"middle"},ve),{},{color:ve.color?ve.color:"#000000",height:"1em",width:"1em"})}}var Qt=function(ve){h(le,ve);var me=m(le);function le(de){var ge;return c(this,le),(ge=me.call(this,de)).copiedTimer=null,ge.handleCopy=function(){var Ue=document.createElement("textarea"),tt=ge.props,Qe=tt.clickCallback,Ne=tt.src,ut=tt.namespace;Ue.innerHTML=JSON.stringify(ge.clipboardValue(Ne),null," "),document.body.appendChild(Ue),Ue.select(),document.execCommand("copy"),document.body.removeChild(Ue),ge.copiedTimer=setTimeout(function(){ge.setState({copied:!1})},5500),ge.setState({copied:!0},function(){typeof Qe=="function"&&Qe({src:Ne,namespace:ut,name:ut[ut.length-1]})})},ge.getClippyIcon=function(){var Ue=ge.props.theme;return ge.state.copied?w.a.createElement("span",null,w.a.createElement(ot,Object.assign({className:"copy-icon"},N(Ue,"copy-icon"))),w.a.createElement("span",N(Ue,"copy-icon-copied"),"✔")):w.a.createElement(ot,Object.assign({className:"copy-icon"},N(Ue,"copy-icon")))},ge.clipboardValue=function(Ue){switch(L(Ue)){case"function":case"regexp":return Ue.toString();default:return Ue}},ge.state={copied:!1},ge}return f(le,[{key:"componentWillUnmount",value:function(){this.copiedTimer&&(clearTimeout(this.copiedTimer),this.copiedTimer=null)}},{key:"render",value:function(){var de=this.props,ge=(de.src,de.theme),Ue=de.hidden,tt=de.rowHovered,Qe=N(ge,"copy-to-clipboard").style,Ne="inline";return Ue&&(Ne="none"),w.a.createElement("span",{className:"copy-to-clipboard-container",title:"Copy to clipboard",style:{verticalAlign:"top",display:tt?"inline-block":"none"}},w.a.createElement("span",{style:l(l({},Qe),{},{display:Ne}),onClick:this.handleCopy},this.getClippyIcon()))}}]),le}(w.a.PureComponent),Xt=function(ve){h(le,ve);var me=m(le);function le(de){var ge;return c(this,le),(ge=me.call(this,de)).getEditIcon=function(){var Ue=ge.props,tt=Ue.variable,Qe=Ue.theme;return w.a.createElement("div",{className:"click-to-edit",style:{verticalAlign:"top",display:ge.state.hovered?"inline-block":"none"}},w.a.createElement(Ur,Object.assign({className:"click-to-edit-icon"},N(Qe,"editVarIcon"),{onClick:function(){ge.prepopInput(tt)}})))},ge.prepopInput=function(Ue){if(ge.props.onEdit!==!1){var tt=function(Ne){var ut;switch(L(Ne)){case"undefined":ut="undefined";break;case"nan":ut="NaN";break;case"string":ut=Ne;break;case"date":case"function":case"regexp":ut=Ne.toString();break;default:try{ut=JSON.stringify(Ne,null," ")}catch{ut=""}}return ut}(Ue.value),Qe=G(tt);ge.setState({editMode:!0,editValue:tt,parsedInput:{type:Qe.type,value:Qe.value}})}},ge.getRemoveIcon=function(){var Ue=ge.props,tt=Ue.variable,Qe=Ue.namespace,Ne=Ue.theme,ut=Ue.rjvId;return w.a.createElement("div",{className:"click-to-remove",style:{verticalAlign:"top",display:ge.state.hovered?"inline-block":"none"}},w.a.createElement(Pt,Object.assign({className:"click-to-remove-icon"},N(Ne,"removeVarIcon"),{onClick:function(){Q.dispatch({name:"VARIABLE_REMOVED",rjvId:ut,data:{name:tt.name,namespace:Qe,existing_value:tt.value,variable_removed:!0}})}})))},ge.getValue=function(Ue,tt){var Qe=!tt&&Ue.type,Ne=v(ge).props;switch(Qe){case!1:return ge.getEditInput();case"string":return w.a.createElement(Me,Object.assign({value:Ue.value},Ne));case"integer":return w.a.createElement(ye,Object.assign({value:Ue.value},Ne));case"float":return w.a.createElement(k,Object.assign({value:Ue.value},Ne));case"boolean":return w.a.createElement(B,Object.assign({value:Ue.value},Ne));case"function":return w.a.createElement(ne,Object.assign({value:Ue.value},Ne));case"null":return w.a.createElement(oe,Ne);case"nan":return w.a.createElement(V,Ne);case"undefined":return w.a.createElement(Oe,Ne);case"date":return w.a.createElement(j,Object.assign({value:Ue.value},Ne));case"regexp":return w.a.createElement(Te,Object.assign({value:Ue.value},Ne));default:return w.a.createElement("div",{className:"object-value"},JSON.stringify(Ue.value))}},ge.getEditInput=function(){var Ue=ge.props.theme,tt=ge.state.editValue;return w.a.createElement("div",null,w.a.createElement(z,Object.assign({type:"text",inputRef:function(Qe){return Qe&&Qe.focus()},value:tt,className:"variable-editor",onChange:function(Qe){var Ne=Qe.target.value,ut=G(Ne);ge.setState({editValue:Ne,parsedInput:{type:ut.type,value:ut.value}})},onKeyDown:function(Qe){switch(Qe.key){case"Escape":ge.setState({editMode:!1,editValue:""});break;case"Enter":(Qe.ctrlKey||Qe.metaKey)&&ge.submitEdit(!0)}Qe.stopPropagation()},placeholder:"update this value",minRows:2},N(Ue,"edit-input"))),w.a.createElement("div",N(Ue,"edit-icon-container"),w.a.createElement(Pt,Object.assign({className:"edit-cancel"},N(Ue,"cancel-icon"),{onClick:function(){ge.setState({editMode:!1,editValue:""})}})),w.a.createElement(Ir,Object.assign({className:"edit-check string-value"},N(Ue,"check-icon"),{onClick:function(){ge.submitEdit()}})),w.a.createElement("div",null,ge.showDetected())))},ge.submitEdit=function(Ue){var tt=ge.props,Qe=tt.variable,Ne=tt.namespace,ut=tt.rjvId,Lt=ge.state,Wr=Lt.editValue,nn=Lt.parsedInput,Dn=Wr;Ue&&nn.type&&(Dn=nn.value),ge.setState({editMode:!1}),Q.dispatch({name:"VARIABLE_UPDATED",rjvId:ut,data:{name:Qe.name,namespace:Ne,existing_value:Qe.value,new_value:Dn,variable_removed:!1}})},ge.showDetected=function(){var Ue=ge.props,tt=Ue.theme,Qe=(Ue.variable,Ue.namespace,Ue.rjvId,ge.state.parsedInput),Ne=(Qe.type,Qe.value,ge.getDetectedInput());if(Ne)return w.a.createElement("div",null,w.a.createElement("div",N(tt,"detected-row"),Ne,w.a.createElement(Ir,{className:"edit-check detected",style:l({verticalAlign:"top",paddingLeft:"3px"},N(tt,"check-icon").style),onClick:function(){ge.submitEdit(!0)}})))},ge.getDetectedInput=function(){var Ue=ge.state.parsedInput,tt=Ue.type,Qe=Ue.value,Ne=v(ge).props,ut=Ne.theme;if(tt!==!1)switch(tt.toLowerCase()){case"object":return w.a.createElement("span",null,w.a.createElement("span",{style:l(l({},N(ut,"brace").style),{},{cursor:"default"})},"{"),w.a.createElement("span",{style:l(l({},N(ut,"ellipsis").style),{},{cursor:"default"})},"..."),w.a.createElement("span",{style:l(l({},N(ut,"brace").style),{},{cursor:"default"})},"}"));case"array":return w.a.createElement("span",null,w.a.createElement("span",{style:l(l({},N(ut,"brace").style),{},{cursor:"default"})},"["),w.a.createElement("span",{style:l(l({},N(ut,"ellipsis").style),{},{cursor:"default"})},"..."),w.a.createElement("span",{style:l(l({},N(ut,"brace").style),{},{cursor:"default"})},"]"));case"string":return w.a.createElement(Me,Object.assign({value:Qe},Ne));case"integer":return w.a.createElement(ye,Object.assign({value:Qe},Ne));case"float":return w.a.createElement(k,Object.assign({value:Qe},Ne));case"boolean":return w.a.createElement(B,Object.assign({value:Qe},Ne));case"function":return w.a.createElement(ne,Object.assign({value:Qe},Ne));case"null":return w.a.createElement(oe,Ne);case"nan":return w.a.createElement(V,Ne);case"undefined":return w.a.createElement(Oe,Ne);case"date":return w.a.createElement(j,Object.assign({value:new Date(Qe)},Ne))}},ge.state={editMode:!1,editValue:"",hovered:!1,renameKey:!1,parsedInput:{type:!1,value:null}},ge}return f(le,[{key:"render",value:function(){var de=this,ge=this.props,Ue=ge.variable,tt=ge.singleIndent,Qe=ge.type,Ne=ge.theme,ut=ge.namespace,Lt=ge.indentWidth,Wr=ge.enableClipboard,nn=ge.onEdit,Dn=ge.onDelete,Hr=ge.onSelect,Nn=ge.displayArrayKey,zn=ge.quotesOnKeys,Cr=this.state.editMode;return w.a.createElement("div",Object.assign({},N(Ne,"objectKeyVal",{paddingLeft:Lt*tt}),{onMouseEnter:function(){return de.setState(l(l({},de.state),{},{hovered:!0}))},onMouseLeave:function(){return de.setState(l(l({},de.state),{},{hovered:!1}))},className:"variable-row",key:Ue.name}),Qe=="array"?Nn?w.a.createElement("span",Object.assign({},N(Ne,"array-key"),{key:Ue.name+"_"+ut}),Ue.name,w.a.createElement("div",N(Ne,"colon"),":")):null:w.a.createElement("span",null,w.a.createElement("span",Object.assign({},N(Ne,"object-name"),{className:"object-key",key:Ue.name+"_"+ut}),!!zn&&w.a.createElement("span",{style:{verticalAlign:"top"}},'"'),w.a.createElement("span",{style:{display:"inline-block"}},Ue.name),!!zn&&w.a.createElement("span",{style:{verticalAlign:"top"}},'"')),w.a.createElement("span",N(Ne,"colon"),":")),w.a.createElement("div",Object.assign({className:"variable-value",onClick:Hr===!1&&nn===!1?null:function(pi){var ci=ie(ut);(pi.ctrlKey||pi.metaKey)&&nn!==!1?de.prepopInput(Ue):Hr!==!1&&(ci.shift(),Hr(l(l({},Ue),{},{namespace:ci})))}},N(Ne,"variableValue",{cursor:Hr===!1?"default":"pointer"})),this.getValue(Ue,Cr)),Wr?w.a.createElement(Qt,{rowHovered:this.state.hovered,hidden:Cr,src:Ue.value,clickCallback:Wr,theme:Ne,namespace:[].concat(ie(ut),[Ue.name])}):null,nn!==!1&&Cr==0?this.getEditIcon():null,Dn!==!1&&Cr==0?this.getRemoveIcon():null)}}]),le}(w.a.PureComponent),$t=function(ve){h(le,ve);var me=m(le);function le(){var de;c(this,le);for(var ge=arguments.length,Ue=new Array(ge),tt=0;tt0?Wr:null,namespace:Lt.splice(0,Lt.length-1),existing_value:nn,variable_removed:!1,key_name:null};L(nn)==="object"?Q.dispatch({name:"ADD_VARIABLE_KEY_REQUEST",rjvId:Dn,data:Nn}):Q.dispatch({name:"VARIABLE_ADDED",rjvId:Dn,data:l(l({},Nn),{},{new_value:[].concat(ie(nn),[null])})})}})))},de.getRemoveObject=function(Qe){var Ne=de.props,ut=Ne.theme,Lt=(Ne.hover,Ne.namespace),Wr=Ne.name,nn=Ne.src,Dn=Ne.rjvId;if(Lt.length!==1)return w.a.createElement("span",{className:"click-to-remove",style:{display:Qe?"inline-block":"none"}},w.a.createElement(Pt,Object.assign({className:"click-to-remove-icon"},N(ut,"removeVarIcon"),{onClick:function(){Q.dispatch({name:"VARIABLE_REMOVED",rjvId:Dn,data:{name:Wr,namespace:Lt.splice(0,Lt.length-1),existing_value:nn,variable_removed:!0}})}})))},de.render=function(){var Qe=de.props,Ne=Qe.theme,ut=Qe.onDelete,Lt=Qe.onAdd,Wr=Qe.enableClipboard,nn=Qe.src,Dn=Qe.namespace,Hr=Qe.rowHovered;return w.a.createElement("div",Object.assign({},N(Ne,"object-meta-data"),{className:"object-meta-data",onClick:function(Nn){Nn.stopPropagation()}}),de.getObjectSize(),Wr?w.a.createElement(Qt,{rowHovered:Hr,clickCallback:Wr,src:nn,theme:Ne,namespace:Dn}):null,Lt!==!1?de.getAddAttribute(Hr):null,ut!==!1?de.getRemoveObject(Hr):null)},de}return le}(w.a.PureComponent);function hr(ve){var me=ve.parent_type,le=ve.namespace,de=ve.quotesOnKeys,ge=ve.theme,Ue=ve.jsvRoot,tt=ve.name,Qe=ve.displayArrayKey,Ne=ve.name?ve.name:"";return!Ue||tt!==!1&&tt!==null?me=="array"?Qe?w.a.createElement("span",Object.assign({},N(ge,"array-key"),{key:le}),w.a.createElement("span",{className:"array-key"},Ne),w.a.createElement("span",N(ge,"colon"),":")):w.a.createElement("span",null):w.a.createElement("span",Object.assign({},N(ge,"object-name"),{key:le}),w.a.createElement("span",{className:"object-key"},de&&w.a.createElement("span",{style:{verticalAlign:"top"}},'"'),w.a.createElement("span",null,Ne),de&&w.a.createElement("span",{style:{verticalAlign:"top"}},'"')),w.a.createElement("span",N(ge,"colon"),":")):w.a.createElement("span",null)}function lr(ve){var me=ve.theme;switch(ve.iconStyle){case"triangle":return w.a.createElement(Ct,Object.assign({},N(me,"expanded-icon"),{className:"expanded-icon"}));case"square":return w.a.createElement(Ee,Object.assign({},N(me,"expanded-icon"),{className:"expanded-icon"}));default:return w.a.createElement(ue,Object.assign({},N(me,"expanded-icon"),{className:"expanded-icon"}))}}function Dt(ve){var me=ve.theme;switch(ve.iconStyle){case"triangle":return w.a.createElement(pt,Object.assign({},N(me,"collapsed-icon"),{className:"collapsed-icon"}));case"square":return w.a.createElement(et,Object.assign({},N(me,"collapsed-icon"),{className:"collapsed-icon"}));default:return w.a.createElement(_e,Object.assign({},N(me,"collapsed-icon"),{className:"collapsed-icon"}))}}var kr=function(ve){h(le,ve);var me=m(le);function le(de){var ge;return c(this,le),(ge=me.call(this,de)).toggleCollapsed=function(Ue){var tt=[];for(var Qe in ge.state.expanded)tt.push(ge.state.expanded[Qe]);tt[Ue]=!tt[Ue],ge.setState({expanded:tt})},ge.state={expanded:[]},ge}return f(le,[{key:"getExpandedIcon",value:function(de){var ge=this.props,Ue=ge.theme,tt=ge.iconStyle;return this.state.expanded[de]?w.a.createElement(lr,{theme:Ue,iconStyle:tt}):w.a.createElement(Dt,{theme:Ue,iconStyle:tt})}},{key:"render",value:function(){var de=this,ge=this.props,Ue=ge.src,tt=ge.groupArraysAfterLength,Qe=(ge.depth,ge.name),Ne=ge.theme,ut=ge.jsvRoot,Lt=ge.namespace,Wr=(ge.parent_type,D(ge,["src","groupArraysAfterLength","depth","name","theme","jsvRoot","namespace","parent_type"])),nn=0,Dn=5*this.props.indentWidth;ut||(nn=5*this.props.indentWidth);var Hr=tt,Nn=Math.ceil(Ue.length/Hr);return w.a.createElement("div",Object.assign({className:"object-key-val"},N(Ne,ut?"jsv-root":"objectKeyVal",{paddingLeft:nn})),w.a.createElement(hr,this.props),w.a.createElement("span",null,w.a.createElement($t,Object.assign({size:Ue.length},this.props))),ie(Array(Nn)).map(function(zn,Cr){return w.a.createElement("div",Object.assign({key:Cr,className:"object-key-val array-group"},N(Ne,"objectKeyVal",{marginLeft:6,paddingLeft:Dn})),w.a.createElement("span",N(Ne,"brace-row"),w.a.createElement("div",Object.assign({className:"icon-container"},N(Ne,"icon-container"),{onClick:function(pi){de.toggleCollapsed(Cr)}}),de.getExpandedIcon(Cr)),de.state.expanded[Cr]?w.a.createElement(Pr,Object.assign({key:Qe+Cr,depth:0,name:!1,collapsed:!1,groupArraysAfterLength:Hr,index_offset:Cr*Hr,src:Ue.slice(Cr*Hr,Cr*Hr+Hr),namespace:Lt,type:"array",parent_type:"array_group",theme:Ne},Wr)):w.a.createElement("span",Object.assign({},N(Ne,"brace"),{onClick:function(pi){de.toggleCollapsed(Cr)},className:"array-group-brace"}),"[",w.a.createElement("div",Object.assign({},N(Ne,"array-group-meta-data"),{className:"array-group-meta-data"}),w.a.createElement("span",Object.assign({className:"object-size"},N(Ne,"object-size")),Cr*Hr," - ",Cr*Hr+Hr>Ue.length?Ue.length:Cr*Hr+Hr)),"]")))}))}}]),le}(w.a.PureComponent),_r=function(ve){h(le,ve);var me=m(le);function le(de){var ge;c(this,le),(ge=me.call(this,de)).toggleCollapsed=function(){ge.setState({expanded:!ge.state.expanded},function(){ee.set(ge.props.rjvId,ge.props.namespace,"expanded",ge.state.expanded)})},ge.getObjectContent=function(tt,Qe,Ne){return w.a.createElement("div",{className:"pushed-content object-container"},w.a.createElement("div",Object.assign({className:"object-content"},N(ge.props.theme,"pushed-content")),ge.renderObjectContents(Qe,Ne)))},ge.getEllipsis=function(){return ge.state.size===0?null:w.a.createElement("div",Object.assign({},N(ge.props.theme,"ellipsis"),{className:"node-ellipsis",onClick:ge.toggleCollapsed}),"...")},ge.getObjectMetaData=function(tt){var Qe=ge.props,Ne=(Qe.rjvId,Qe.theme,ge.state),ut=Ne.size,Lt=Ne.hovered;return w.a.createElement($t,Object.assign({rowHovered:Lt,size:ut},ge.props))},ge.renderObjectContents=function(tt,Qe){var Ne,ut=ge.props,Lt=ut.depth,Wr=ut.parent_type,nn=ut.index_offset,Dn=ut.groupArraysAfterLength,Hr=ut.namespace,Nn=ge.state.object_type,zn=[],Cr=Object.keys(tt||{});return ge.props.sortKeys&&Nn!=="array"&&(Cr=Cr.sort()),Cr.forEach(function(pi){if(Ne=new Jt(pi,tt[pi]),Wr==="array_group"&&nn&&(Ne.name=parseInt(Ne.name)+nn),tt.hasOwnProperty(pi))if(Ne.type==="object")zn.push(w.a.createElement(Pr,Object.assign({key:Ne.name,depth:Lt+1,name:Ne.name,src:Ne.value,namespace:Hr.concat(Ne.name),parent_type:Nn},Qe)));else if(Ne.type==="array"){var ci=Pr;Dn&&Ne.value.length>Dn&&(ci=kr),zn.push(w.a.createElement(ci,Object.assign({key:Ne.name,depth:Lt+1,name:Ne.name,src:Ne.value,namespace:Hr.concat(Ne.name),type:"array",parent_type:Nn},Qe)))}else zn.push(w.a.createElement(Xt,Object.assign({key:Ne.name+"_"+Hr,variable:Ne,singleIndent:5,namespace:Hr,type:ge.props.type},Qe)))}),zn};var Ue=le.getState(de);return ge.state=l(l({},Ue),{},{prevProps:{}}),ge}return f(le,[{key:"getBraceStart",value:function(de,ge){var Ue=this,tt=this.props,Qe=tt.src,Ne=tt.theme,ut=tt.iconStyle;if(tt.parent_type==="array_group")return w.a.createElement("span",null,w.a.createElement("span",N(Ne,"brace"),de==="array"?"[":"{"),ge?this.getObjectMetaData(Qe):null);var Lt=ge?lr:Dt;return w.a.createElement("span",null,w.a.createElement("span",Object.assign({onClick:function(Wr){Ue.toggleCollapsed()}},N(Ne,"brace-row")),w.a.createElement("div",Object.assign({className:"icon-container"},N(Ne,"icon-container")),w.a.createElement(Lt,{theme:Ne,iconStyle:ut})),w.a.createElement(hr,this.props),w.a.createElement("span",N(Ne,"brace"),de==="array"?"[":"{")),ge?this.getObjectMetaData(Qe):null)}},{key:"render",value:function(){var de=this,ge=this.props,Ue=ge.depth,tt=ge.src,Qe=(ge.namespace,ge.name,ge.type,ge.parent_type),Ne=ge.theme,ut=ge.jsvRoot,Lt=ge.iconStyle,Wr=D(ge,["depth","src","namespace","name","type","parent_type","theme","jsvRoot","iconStyle"]),nn=this.state,Dn=nn.object_type,Hr=nn.expanded,Nn={};return ut||Qe==="array_group"?Qe==="array_group"&&(Nn.borderLeft=0,Nn.display="inline"):Nn.paddingLeft=5*this.props.indentWidth,w.a.createElement("div",Object.assign({className:"object-key-val",onMouseEnter:function(){return de.setState(l(l({},de.state),{},{hovered:!0}))},onMouseLeave:function(){return de.setState(l(l({},de.state),{},{hovered:!1}))}},N(Ne,ut?"jsv-root":"objectKeyVal",Nn)),this.getBraceStart(Dn,Hr),Hr?this.getObjectContent(Ue,tt,l({theme:Ne,iconStyle:Lt},Wr)):this.getEllipsis(),w.a.createElement("span",{className:"brace-row"},w.a.createElement("span",{style:l(l({},N(Ne,"brace").style),{},{paddingLeft:Hr?"3px":"0px"})},Dn==="array"?"]":"}"),Hr?null:this.getObjectMetaData(tt)))}}],[{key:"getDerivedStateFromProps",value:function(de,ge){var Ue=ge.prevProps;return de.src!==Ue.src||de.collapsed!==Ue.collapsed||de.name!==Ue.name||de.namespace!==Ue.namespace||de.rjvId!==Ue.rjvId?l(l({},le.getState(de)),{},{prevProps:de}):null}}]),le}(w.a.PureComponent);_r.getState=function(ve){var me=Object.keys(ve.src).length,le=(ve.collapsed===!1||ve.collapsed!==!0&&ve.collapsed>ve.depth)&&(!ve.shouldCollapse||ve.shouldCollapse({name:ve.name,src:ve.src,type:L(ve.src),namespace:ve.namespace})===!1)&&me!==0;return{expanded:ee.get(ve.rjvId,ve.namespace,"expanded",le),object_type:ve.type==="array"?"array":"object",parent_type:ve.type==="array"?"array":"object",size:me,hovered:!1}};var Jt=function ve(me,le){c(this,ve),this.name=me,this.value=le,this.type=L(le)};I(_r);var Pr=_r,zr=function(ve){h(le,ve);var me=m(le);function le(){var de;c(this,le);for(var ge=arguments.length,Ue=new Array(ge),tt=0;ttQe.groupArraysAfterLength&&(ut=kr),w.a.createElement("div",{className:"pretty-json-container object-container"},w.a.createElement("div",{className:"object-content"},w.a.createElement(ut,Object.assign({namespace:Ne,depth:0,jsvRoot:!0},Qe))))},de}return le}(w.a.PureComponent),Zt=function(ve){h(le,ve);var me=m(le);function le(de){var ge;return c(this,le),(ge=me.call(this,de)).closeModal=function(){Q.dispatch({rjvId:ge.props.rjvId,name:"RESET"})},ge.submit=function(){ge.props.submit(ge.state.input)},ge.state={input:de.input?de.input:""},ge}return f(le,[{key:"render",value:function(){var de=this,ge=this.props,Ue=ge.theme,tt=ge.rjvId,Qe=ge.isValid,Ne=this.state.input,ut=Qe(Ne);return w.a.createElement("div",Object.assign({className:"key-modal-request"},N(Ue,"key-modal-request"),{onClick:this.closeModal}),w.a.createElement("div",Object.assign({},N(Ue,"key-modal"),{onClick:function(Lt){Lt.stopPropagation()}}),w.a.createElement("div",N(Ue,"key-modal-label"),"Key Name:"),w.a.createElement("div",{style:{position:"relative"}},w.a.createElement("input",Object.assign({},N(Ue,"key-modal-input"),{className:"key-modal-input",ref:function(Lt){return Lt&&Lt.focus()},spellCheck:!1,value:Ne,placeholder:"...",onChange:function(Lt){de.setState({input:Lt.target.value})},onKeyPress:function(Lt){ut&&Lt.key==="Enter"?de.submit():Lt.key==="Escape"&&de.closeModal()}})),ut?w.a.createElement(Ir,Object.assign({},N(Ue,"key-modal-submit"),{className:"key-modal-submit",onClick:function(Lt){return de.submit()}})):null),w.a.createElement("span",N(Ue,"key-modal-cancel"),w.a.createElement(qt,Object.assign({},N(Ue,"key-modal-cancel-icon"),{className:"key-modal-cancel",onClick:function(){Q.dispatch({rjvId:tt,name:"RESET"})}})))))}}]),le}(w.a.PureComponent),Nr=function(ve){h(le,ve);var me=m(le);function le(){var de;c(this,le);for(var ge=arguments.length,Ue=new Array(ge),tt=0;ttt||"200px"}; - color: ${({theme:t})=>t.FONT_TITLE_INFO}; -`,xK=se.div` - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - display: flex; -`,rUt=se(eUt)` - word-break: ${({nobreak:t})=>t?"normal":"break-all"}; - @media ${_t.up("md")} { - flex-basis: ${({isJson:t})=>t?100:50}%; - } -`,nUt=se.div` - color: ${({negative:t,theme:e})=>t?e.RED_DARK:e.GREEN_PRIMARY}; -`,iUt=se.div` - position: relative; - margin-left: 6px; - ${({fontColor:t})=>t&&`color: ${t};`} -`,aUt=se.div` - display: flex; - flex-basis: 100%; - margin-bottom: 10px; - align-items: flex-start; - word-break: normal; -`,oUt=se.div` - min-width: ${({titleMinWidth:t})=>t||"100px"}; -`,sUt=se.div` - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - display: flex; - min-width: ${({noteMinWidth:t})=>t||"100px"}; -`,lUt=se.ul` - margin: 0; - padding: 0; - list-style: none; - font-size: 0px; - line-height: 0px; -`,Kpe=se.li` - line-height: 17px; - margin-bottom: 5px; -`,Zpe=se.div` - display: flex; -`,cUt=t=>{const{visibility:e={visible:!1,setVisible:()=>{}},icon:r={name:"HELP_OUTLINE",size:"1.7rem"},method:n=["click"],fontColor:i="FONT_WHITE",data:a=[],position:o="above",titleMinWidth:s="",noteMinWidth:l=""}=t,c=n.includes("hover"),u=n.includes("click"),{visible:f,setVisible:d}=e,h=({title:p,value:g,hideTitle:v=!1})=>M.jsxs(aUt,{children:[!v&&M.jsx(oUt,{titleMinWidth:s,children:p}),M.jsx(sUt,{noteMinWidth:l,children:g})]},p);return M.jsxs(iUt,{onMouseEnter:c?()=>d(!0):void 0,onMouseLeave:c?()=>d(!1):void 0,fontColor:i,children:[M.jsx(B5,{show:f,position:o,children:a.map(p=>h(p))}),M.jsx(Lr,{icon:r.name,size:r.size,onClick:u?()=>d(!f):void 0})]})},uUt=(t,e)=>M.jsxs(Z.Fragment,{children:[e," (",M.jsx(nUt,{negative:t[0]==="-",children:t}),")"]}),fUt=(t,e)=>M.jsxs(Z.Fragment,{children:[e," ",cUt(t)]}),dUt=(t,e)=>M.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:e}),hUt=(t,e,r)=>{let n="";if(r&&e&&typeof e=="string"){const i=e.split(" ");n=i[0]+" ",e=i[1]}return M.jsxs(Z.Fragment,{children:[r&&M.jsxs(xK,{children:[n," "]}),M.jsx(Wo,{to:t,children:Rr(e,12,"6")})]})},pUt=(t,e,r)=>M.jsxs(Z.Fragment,{children:[r," ",M.jsx(xh,{value:t,title:`Copy ${e}`})]}),gUt=(t,e,r,n)=>{let i=-1;return t.map(o=>(i++,e?M.jsxs(Zpe,{children:[M.jsx(Wo,{to:e[i],onClick:r?()=>r(o):void 0,children:M.jsx(Kpe,{children:o})},o),n&&M.jsx(xh,{value:n[i]})]},o):M.jsxs(Zpe,{children:[M.jsx(Kpe,{onClick:r?()=>r(o):void 0,children:o},o),n&&M.jsx(xh,{value:n[i]})]},o)))},Qpe=(t,e)=>{const{value:r,link:n,change:i,externalLink:a,popupNote:o,copy:s,title:l,isJson:c,splitOnSpace:u=!1,list:f,linkList:d,onClick:h,copyList:p}=t;let g=r;return i&&(g=uUt(i,g)),a&&(g=dUt(a,g)),n&&(g=hUt(n,g,u)),s&&(g=pUt(s,l,g)),o&&(g=fUt(o,g)),f&&(g=M.jsx(lUt,{children:gUt(f,d,h,p)})),c&&typeof g=="string"&&(g=M.jsx(Lte,{src:JSON.parse(g),theme:e==="night"?"summerfruit":"summerfruit:inverted",collapsed:!0})),g},vUt=(t,e,r)=>{const{isJson:n,nobreak:i=!1,title:a,value:o,hover:s="",table:l}=t,c=o==null||o==="";return M.jsxs(rUt,{isJson:n||!1,nobreak:i,children:[M.jsxs(tUt,{children:[a,":"]}),l&&M.jsx(cn,{tableHeaders:l.tableHeaders,tableData:l.tableData,isLoading:l.isLoading,showIndex:l.showIndex}),s?M.jsx(xK,{title:s,children:c?"--":Qpe(t,e)}):M.jsx(xK,{children:c?"--":Qpe(t,e)})]},`${a} ${r}`)},jo=({data:t})=>{const{themeName:e}=gte();return M.jsx(M.Fragment,{children:t.map((r,n)=>vUt(r,e,n))})},mUt=se.div` - width: ${({width:t})=>t||"50%"}; - @media ${_t.down("sm")} { - min-width: 100%; - } -`,yUt=se.div` - border: 1px solid ${({theme:t})=>t.BORDER_PRIMARY}; - padding: 15px; - margin: 10px; - border-radius: 5px; - @media ${_t.down("md")} { - font-size: 1.2rem; - } -`,m9e=se(Lr)` - margin-right: 8px; -`,wUt=se.div` - display: flex; - margin: ${({titleMargin:t})=>t||"0 0 30px 0"}; -`,bUt=se.div` - font-size: ${({titleSize:t})=>t||"1.4rem"}; -`,xUt=se.div` - display: flex; - flex-wrap: wrap; -`,Xpe=se.div` - flex-basis: 100%; - margin-bottom: 10px; - &:first-of-type { - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - font-size: 1.8rem; - } - &:last-of-type { - margin-bottom: 0; - } -`,_Ut=se(m9e)` - margin-left: auto; - :hover { - cursor: pointer; - } -`,bp=({className:t,icon:e,title:r,children:n,width:i,handleClose:a,iconColor:o,titleMargin:s,titleSize:l,popup:c})=>M.jsx(mUt,{className:t,width:i,children:M.jsxs(yUt,{children:[M.jsxs(wUt,{titleMargin:s,children:[e&&M.jsx(m9e,{icon:e,size:"1.8rem",color:o}),M.jsx(bUt,{titleSize:l,children:r}),a&&M.jsx(_Ut,{icon:"CLOSE",onClick:a,size:"1.4rem",color:"ICON_WHITE"}),c&&JOt(c)]}),M.jsx(xUt,{children:Array.isArray(n)?n.map((u,f)=>M.jsx(Xpe,{children:u},f)):M.jsx(Xpe,{children:n})})]})}),SUt=se.div` - display: flex; - flex-basis: 100%; - margin-bottom: 10px; - word-break: ${({nobreak:t})=>t?"normal":"break-all"}; - align-items: flex-start; -`,CUt=se.div` - min-width: ${({size:t})=>t}; - color: ${({color:t,theme:e})=>t||e.FONT_TITLE_INFO}; -`,J8=({children:t,color:e,nobreak:r,size:n})=>M.jsx(SUt,{nobreak:r,children:M.jsx(CUt,{color:e,size:n,children:t})});J8.propTypes={children:Ie.any.isRequired,color:Ie.string,nobreak:Ie.bool,size:Ie.string};J8.defaultProps={color:null,nobreak:!1,size:"200px"};const AUt=se.div` - position: relative; -`,TUt=se.div` - position: relative; - padding-right: 1.6rem; -`,EUt=se(Ha)` - text-transform: capitalize; -`,IUt=se.button` - position: absolute; - display: flex; - justify-content: center; - align-items: center; - right: 0; - top: 0; - height: 100%; - width: 26px; - border: none; - border-radius: 0px 4px 4px 0px; - background: ${({theme:t,$color:e})=>t[`BUTTON_${e}`]}; - cursor: pointer; - - &:focus { - background: ${({disabled:t,theme:e,$color:r})=>!t&&e[`BUTTON_${r}_FOCUS`]}; - border-color: ${({theme:t,$color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } - &:hover { - background: ${({disabled:t,theme:e,$color:r})=>!t&&e[`BUTTON_${r}_HOVER`]}; - border-color: ${({theme:t,$color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } - &:active { - background: ${({disabled:t,theme:e,$color:r})=>!t&&e[`BUTTON_${r}_ACTIVE`]}; - border-color: ${({theme:t,$color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } - &:disabled { - background: ${({theme:t})=>t.BUTTON_DISABLED}; - cursor: not-allowed; - border-color: ${({theme:t})=>t.BUTTON_DISABLED}; - } -`,kUt=se.ul` - display: ${({show:t})=>t?"block":"none"}; - position: absolute; - right: 0; - margin: 10px 0 0; - padding: 0; - border-radius: 4px; - background: ${({theme:t})=>t.BACKGROUND_LIGHT}; - list-style: none; - z-index: 1; -`,PUt=se.li` - margin: 5px 0; - padding: 10px 20px; - text-transform: capitalize; - cursor: pointer; - white-space: nowrap; - - &:hover { - color: ${({theme:t,$color:e})=>t[`BUTTON_${e}_FONT`]}; - background: ${({disabled:t,theme:e,$color:r})=>!t&&e[`BUTTON_${r}_HOVER`]}; - border-color: ${({theme:t,$color:e})=>t[`BUTTON_${e}_FOCUS`]}; - } -`,$te=({className:t,color:e,initial:r,onClick:n,options:i,type:a})=>{const o=e.toUpperCase(),[s,l,,c]=by(),u=B8e(c),[f,d]=Z.useState(i),h=_i();_te(c),Z.useEffect(()=>{d(i.filter(v=>v!==r))},[i,r]);const p=v=>{c(),n(r.toLowerCase(),v)},g=(v,y)=>{c(),n(v.toLowerCase(),y)};return M.jsxs(AUt,{className:t,ref:u,children:[M.jsxs(TUt,{children:[M.jsx(EUt,{color:e,onClick:p,type:a,children:r}),M.jsx(IUt,{$color:o,onClick:l,type:a,children:M.jsx(Lr,{icon:"CARET",size:"0.9rem",color:h[`BUTTON_${o}_FONT`]})})]}),M.jsx(kUt,{show:s,children:f.map(v=>M.jsx(PUt,{$color:o,onClick:y=>g(v,y),children:v},v))})]})};$te.propTypes={className:Ie.string,color:Ie.string,initial:Ie.string.isRequired,onClick:Ie.func.isRequired,options:Ie.array.isRequired,type:Ie.string};$te.defaultProps={className:null,color:"primary"};const RUt=se.div` - display: ${({isOpen:t})=>t?"flex":"none"}; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - z-index: 1050; -`,MUt=se.div` - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - background-color: rgba(0, 0, 0, 0.16); -`,DUt=se.div` - display: flex; - align-items: center; - position: relative; - margin: 0.5rem; - width: 100%; - /* animate.css @keyframe */ - animation: flipInX; - animation-duration: 0.8s; - - @media ${_t.up("sm")} { - margin: 1.75rem auto; - max-width: 500px; - } -`,NUt=se.div` - position: ${({largeModal:t})=>t?"absolute":"relative"}; - display: flex; - flex-direction: column; - max-height: ${({largeModal:t})=>t&&"70vh"}; - overflow-y: ${({largeModal:t})=>t&&"auto"}; - padding: 2.4rem; - width: 100%; - border-radius: 4px; - box-shadow: 0 15px 35px rgb(50 50 93 / 20%), 0 5px 15px rgb(0 0 0 / 17%); - color: ${({theme:t})=>t.FONT_PRIMARY}; - background-color: ${({theme:t})=>t.BACKGROUND_CONTENT}; -`,OUt=se(Lr)` - position: absolute; - top: 1.6rem; - right: 1.6rem; - cursor: pointer; -`,LUt=se.div` - flex: 1 1 auto; -`,HS=Re.memo(({children:t,isOpen:e=!1,onClose:r,largeModal:n=!1})=>{const i=_i();return _te(r),M.jsxs(RUt,{isOpen:e,children:[M.jsx(MUt,{}),M.jsx(DUt,{children:M.jsxs(NUt,{largeModal:n,children:[M.jsx(OUt,{icon:"CLOSE",color:i.FONT_PRIMARY,size:"2rem",onClick:r}),M.jsx(LUt,{children:t})]})})]})});function $Ut(){var t=new Map;function e(r){var n=r.root,i=r.rootMargin,a=r.threshold,o=t.get(n);o||(o=new Map,t.set(n,o));var s=JSON.stringify({rootMargin:i,threshold:a}),l=o.get(s);if(!l){var c=new Map,u=new IntersectionObserver(function(f){f.forEach(function(d){var h=c.get(d.target);h==null||h(d)})},{root:n,rootMargin:i,threshold:a});l={observer:u,entryCallbacks:c},o.set(s,l)}return{observe:function(d,h){var p,g;(p=l)==null||p.entryCallbacks.set(d,h),(g=l)==null||g.observer.observe(d)},unobserve:function(d){var h,p;(h=l)==null||h.entryCallbacks.delete(d),(p=l)==null||p.observer.unobserve(d)}}}return{getObserver:e}}var BUt="0px",FUt=[0],jUt=$Ut();function UUt(t){var e,r,n=(e=t==null?void 0:t.rootMargin)!=null?e:BUt,i=(r=t==null?void 0:t.threshold)!=null?r:FUt,a=Z.useRef(null),o=Z.useRef(null),s=Z.useRef(null),l=Z.useState(),c=l[0],u=l[1],f=Z.useCallback(function(){var g=a.current;if(!g){u(void 0);return}var v=jUt.getObserver({root:o.current,rootMargin:n,threshold:i});v.observe(g,function(y){u(y)}),s.current=v},[n,i]),d=Z.useCallback(function(){var g=s.current,v=a.current;v&&(g==null||g.unobserve(v)),s.current=null},[]),h=Z.useCallback(function(g){d(),a.current=g,f()},[f,d]),p=Z.useCallback(function(g){d(),o.current=g,f()},[f,d]);return[h,{entry:c,rootRef:p}]}function _K(){return _K=Object.assign||function(t){for(var e=1;e{const[l,c]=Z.useState(n),[u,f]=Z.useState(!0);Z.useEffect(()=>{f(s>l)},[l,s]);const d=Z.useCallback(()=>{a(l+1),c(p=>p+1)},[l,a]),[h]=VUt({delayInMs:e,disabled:r,loading:i,hasNextPage:u,onLoadMore:d,rootMargin:o});return typeof t!="function"?(console.warn("Infinite Scroll expects a function as it's children"),null):t({sentryRef:h,page:l,hasNextPage:u})};cB.propTypes={children:Ie.func.isRequired,delayInMs:Ie.number,disabled:Ie.bool,initialPage:Ie.number,loading:Ie.bool.isRequired,onLoadMore:Ie.func.isRequired,rootMargin:Ie.string,totalPages:Ie.number.isRequired};cB.defaultProps={delayInMs:100,disabled:!1,initialPage:1,rootMargin:null};var Jpe=Array.isArray,e0e=Object.keys,GUt=Object.prototype.hasOwnProperty,WUt=typeof Element<"u";function SK(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var r=Jpe(t),n=Jpe(e),i,a,o;if(r&&n){if(a=t.length,a!=e.length)return!1;for(i=a;i--!==0;)if(!SK(t[i],e[i]))return!1;return!0}if(r!=n)return!1;var s=t instanceof Date,l=e instanceof Date;if(s!=l)return!1;if(s&&l)return t.getTime()==e.getTime();var c=t instanceof RegExp,u=e instanceof RegExp;if(c!=u)return!1;if(c&&u)return t.toString()==e.toString();var f=e0e(t);if(a=f.length,a!==e0e(e).length)return!1;for(i=a;i--!==0;)if(!GUt.call(e,f[i]))return!1;if(WUt&&t instanceof Element&&e instanceof Element)return t===e;for(i=a;i--!==0;)if(o=f[i],!(o==="_owner"&&t.$$typeof)&&!SK(t[o],e[o]))return!1;return!0}return t!==t&&e!==e}var qUt=function(e,r){try{return SK(e,r)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||n.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}};const wm=Un(qUt);var YUt=function(e){return KUt(e)&&!ZUt(e)};function KUt(t){return!!t&&typeof t=="object"}function ZUt(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||JUt(t)}var QUt=typeof Symbol=="function"&&Symbol.for,XUt=QUt?Symbol.for("react.element"):60103;function JUt(t){return t.$$typeof===XUt}function ezt(t){return Array.isArray(t)?[]:{}}function eO(t,e){return e.clone!==!1&&e.isMergeableObject(t)?hE(ezt(t),t,e):t}function tzt(t,e,r){return t.concat(e).map(function(n){return eO(n,r)})}function rzt(t,e,r){var n={};return r.isMergeableObject(t)&&Object.keys(t).forEach(function(i){n[i]=eO(t[i],r)}),Object.keys(e).forEach(function(i){!r.isMergeableObject(e[i])||!t[i]?n[i]=eO(e[i],r):n[i]=hE(t[i],e[i],r)}),n}function hE(t,e,r){r=r||{},r.arrayMerge=r.arrayMerge||tzt,r.isMergeableObject=r.isMergeableObject||YUt;var n=Array.isArray(e),i=Array.isArray(t),a=n===i;return a?n?r.arrayMerge(t,e,r):rzt(t,e,r):eO(e,r)}hE.all=function(e,r){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return hE(n,i,r)},{})};var CK=hE,O7={},y9e=typeof O7=="object"&&O7&&O7.Object===Object&&O7,nzt=typeof self=="object"&&self&&self.Object===Object&&self,I0=y9e||nzt||Function("return this")(),W1=I0.Symbol,w9e=Object.prototype,izt=w9e.hasOwnProperty,azt=w9e.toString,c4=W1?W1.toStringTag:void 0;function ozt(t){var e=izt.call(t,c4),r=t[c4];try{t[c4]=void 0;var n=!0}catch{}var i=azt.call(t);return n&&(e?t[c4]=r:delete t[c4]),i}var szt=Object.prototype,lzt=szt.toString;function czt(t){return lzt.call(t)}var uzt="[object Null]",fzt="[object Undefined]",t0e=W1?W1.toStringTag:void 0;function lx(t){return t==null?t===void 0?fzt:uzt:t0e&&t0e in Object(t)?ozt(t):czt(t)}function b9e(t,e){return function(r){return t(e(r))}}var Bte=b9e(Object.getPrototypeOf,Object);function cx(t){return t!=null&&typeof t=="object"}var dzt="[object Object]",hzt=Function.prototype,pzt=Object.prototype,x9e=hzt.toString,gzt=pzt.hasOwnProperty,vzt=x9e.call(Object);function r0e(t){if(!cx(t)||lx(t)!=dzt)return!1;var e=Bte(t);if(e===null)return!0;var r=gzt.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&x9e.call(r)==vzt}function mzt(){this.__data__=[],this.size=0}function _9e(t,e){return t===e||t!==t&&e!==e}function uB(t,e){for(var r=t.length;r--;)if(_9e(t[r][0],e))return r;return-1}var yzt=Array.prototype,wzt=yzt.splice;function bzt(t){var e=this.__data__,r=uB(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():wzt.call(e,r,1),--this.size,!0}function xzt(t){var e=this.__data__,r=uB(e,t);return r<0?void 0:e[r][1]}function _zt(t){return uB(this.__data__,t)>-1}function Szt(t,e){var r=this.__data__,n=uB(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Ev(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=SHt}var CHt="[object Arguments]",AHt="[object Array]",THt="[object Boolean]",EHt="[object Date]",IHt="[object Error]",kHt="[object Function]",PHt="[object Map]",RHt="[object Number]",MHt="[object Object]",DHt="[object RegExp]",NHt="[object Set]",OHt="[object String]",LHt="[object WeakMap]",$Ht="[object ArrayBuffer]",BHt="[object DataView]",FHt="[object Float32Array]",jHt="[object Float64Array]",UHt="[object Int8Array]",zHt="[object Int16Array]",HHt="[object Int32Array]",VHt="[object Uint8Array]",GHt="[object Uint8ClampedArray]",WHt="[object Uint16Array]",qHt="[object Uint32Array]",da={};da[FHt]=da[jHt]=da[UHt]=da[zHt]=da[HHt]=da[VHt]=da[GHt]=da[WHt]=da[qHt]=!0;da[CHt]=da[AHt]=da[$Ht]=da[THt]=da[BHt]=da[EHt]=da[IHt]=da[kHt]=da[PHt]=da[RHt]=da[MHt]=da[DHt]=da[NHt]=da[OHt]=da[LHt]=!1;function YHt(t){return cx(t)&&k9e(t.length)&&!!da[lx(t)]}function Fte(t){return function(e){return t(e)}}var P9e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,r6=P9e&&typeof module=="object"&&module&&!module.nodeType&&module,KHt=r6&&r6.exports===P9e,lH=KHt&&y9e.process,H5=function(){try{var t=r6&&r6.require&&r6.require("util").types;return t||lH&&lH.binding&&lH.binding("util")}catch{}}(),l0e=H5&&H5.isTypedArray,ZHt=l0e?Fte(l0e):YHt,QHt=Object.prototype,XHt=QHt.hasOwnProperty;function R9e(t,e){var r=t9(t),n=!r&&vHt(t),i=!r&&!n&&I9e(t),a=!r&&!n&&!i&&ZHt(t),o=r||n||i||a,s=o?dHt(t.length,String):[],l=s.length;for(var c in t)(e||XHt.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||_Ht(c,l)))&&s.push(c);return s}var JHt=Object.prototype;function jte(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||JHt;return t===r}var eVt=b9e(Object.keys,Object),tVt=Object.prototype,rVt=tVt.hasOwnProperty;function nVt(t){if(!jte(t))return eVt(t);var e=[];for(var r in Object(t))rVt.call(t,r)&&r!="constructor"&&e.push(r);return e}function M9e(t){return t!=null&&k9e(t.length)&&!S9e(t)}function Ute(t){return M9e(t)?R9e(t):nVt(t)}function iVt(t,e){return t&&dB(e,Ute(e),t)}function aVt(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var oVt=Object.prototype,sVt=oVt.hasOwnProperty;function lVt(t){if(!e9(t))return aVt(t);var e=jte(t),r=[];for(var n in t)n=="constructor"&&(e||!sVt.call(t,n))||r.push(n);return r}function zte(t){return M9e(t)?R9e(t,!0):lVt(t)}function cVt(t,e){return t&&dB(e,zte(e),t)}var D9e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,c0e=D9e&&typeof module=="object"&&module&&!module.nodeType&&module,uVt=c0e&&c0e.exports===D9e,u0e=uVt?I0.Buffer:void 0,f0e=u0e?u0e.allocUnsafe:void 0;function fVt(t,e){if(e)return t.slice();var r=t.length,n=f0e?f0e(r):new t.constructor(r);return t.copy(n),n}function N9e(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r=0)&&(r[i]=t[i]);return r}function E0e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var I0e=function(e){return Array.isArray(e)&&e.length===0},rl=function(e){return typeof e=="function"},hB=function(e){return e!==null&&typeof e=="object"},KGt=function(e){return String(Math.floor(Number(e)))===e},cH=function(e){return Object.prototype.toString.call(e)==="[object String]"},W9e=function(e){return Z.Children.count(e)===0},uH=function(e){return hB(e)&&rl(e.then)};function Ba(t,e,r,n){n===void 0&&(n=0);for(var i=V9e(e);t&&n=0?[]:{}}}return(a===0?t:i)[o[a]]===r?t:(r===void 0?delete i[o[a]]:i[o[a]]=r,a===0&&r===void 0&&delete n[o[a]],n)}function q9e(t,e,r,n){r===void 0&&(r=new WeakMap),n===void 0&&(n={});for(var i=0,a=Object.keys(t);i0?We.map(function(Ke){return I(Ke,Ba(Ce,Ke))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Le).then(function(Ke){return Ke.reduce(function(qe,we,Se){return we==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||we&&(qe=Up(qe,We[Se],we)),qe},{})})},[I]),L=Z.useCallback(function(Ce){return Promise.all([D(Ce),d.validationSchema?S(Ce):{},d.validate?A(Ce):{}]).then(function(We){var Le=We[0],Ke=We[1],qe=We[2],we=CK.all([Le,Ke,qe],{arrayMerge:rWt});return we})},[d.validate,d.validationSchema,D,A,S]),O=ef(function(Ce){return Ce===void 0&&(Ce=w.values),C({type:"SET_ISVALIDATING",payload:!0}),L(Ce).then(function(We){return y.current&&(C({type:"SET_ISVALIDATING",payload:!1}),C({type:"SET_ERRORS",payload:We})),We})});Z.useEffect(function(){o&&y.current===!0&&wm(h.current,d.initialValues)&&O(h.current)},[o,O]);var P=Z.useCallback(function(Ce){var We=Ce&&Ce.values?Ce.values:h.current,Le=Ce&&Ce.errors?Ce.errors:p.current?p.current:d.initialErrors||{},Ke=Ce&&Ce.touched?Ce.touched:g.current?g.current:d.initialTouched||{},qe=Ce&&Ce.status?Ce.status:v.current?v.current:d.initialStatus;h.current=We,p.current=Le,g.current=Ke,v.current=qe;var we=function(){C({type:"RESET_FORM",payload:{isSubmitting:!!Ce&&!!Ce.isSubmitting,errors:Le,touched:Ke,status:qe,values:We,isValidating:!!Ce&&!!Ce.isValidating,submitCount:Ce&&Ce.submitCount&&typeof Ce.submitCount=="number"?Ce.submitCount:0}})};if(d.onReset){var Se=d.onReset(w.values,oe);uH(Se)?Se.then(we):we()}else we()},[d.initialErrors,d.initialStatus,d.initialTouched]);Z.useEffect(function(){y.current===!0&&!wm(h.current,d.initialValues)&&(c&&(h.current=d.initialValues,P()),o&&O(h.current))},[c,d.initialValues,P,o,O]),Z.useEffect(function(){c&&y.current===!0&&!wm(p.current,d.initialErrors)&&(p.current=d.initialErrors||Vy,C({type:"SET_ERRORS",payload:d.initialErrors||Vy}))},[c,d.initialErrors]),Z.useEffect(function(){c&&y.current===!0&&!wm(g.current,d.initialTouched)&&(g.current=d.initialTouched||L7,C({type:"SET_TOUCHED",payload:d.initialTouched||L7}))},[c,d.initialTouched]),Z.useEffect(function(){c&&y.current===!0&&!wm(v.current,d.initialStatus)&&(v.current=d.initialStatus,C({type:"SET_STATUS",payload:d.initialStatus}))},[c,d.initialStatus,d.initialTouched]);var x=ef(function(Ce){if(m.current[Ce]&&rl(m.current[Ce].validate)){var We=Ba(w.values,Ce),Le=m.current[Ce].validate(We);return uH(Le)?(C({type:"SET_ISVALIDATING",payload:!0}),Le.then(function(Ke){return Ke}).then(function(Ke){C({type:"SET_FIELD_ERROR",payload:{field:Ce,value:Ke}}),C({type:"SET_ISVALIDATING",payload:!1})})):(C({type:"SET_FIELD_ERROR",payload:{field:Ce,value:Le}}),Promise.resolve(Le))}else if(d.validationSchema)return C({type:"SET_ISVALIDATING",payload:!0}),S(w.values,Ce).then(function(Ke){return Ke}).then(function(Ke){C({type:"SET_FIELD_ERROR",payload:{field:Ce,value:Ke[Ce]}}),C({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),T=Z.useCallback(function(Ce,We){var Le=We.validate;m.current[Ce]={validate:Le}},[]),E=Z.useCallback(function(Ce){delete m.current[Ce]},[]),N=ef(function(Ce,We){C({type:"SET_TOUCHED",payload:Ce});var Le=We===void 0?i:We;return Le?O(w.values):Promise.resolve()}),F=Z.useCallback(function(Ce){C({type:"SET_ERRORS",payload:Ce})},[]),B=ef(function(Ce,We){var Le=rl(Ce)?Ce(w.values):Ce;C({type:"SET_VALUES",payload:Le});var Ke=We===void 0?r:We;return Ke?O(Le):Promise.resolve()}),j=Z.useCallback(function(Ce,We){C({type:"SET_FIELD_ERROR",payload:{field:Ce,value:We}})},[]),k=ef(function(Ce,We,Le){C({type:"SET_FIELD_VALUE",payload:{field:Ce,value:We}});var Ke=Le===void 0?r:Le;return Ke?O(Up(w.values,Ce,We)):Promise.resolve()}),$=Z.useCallback(function(Ce,We){var Le=We,Ke=Ce,qe;if(!cH(Ce)){Ce.persist&&Ce.persist();var we=Ce.target?Ce.target:Ce.currentTarget,Se=we.type,q=we.name,z=we.id,G=we.value,re=we.checked,ue=we.outerHTML,_e=we.options,Ee=we.multiple;Le=We||q||z,Ke=/number|range/.test(Se)?(qe=parseFloat(G),isNaN(qe)?"":qe):/checkbox/.test(Se)?iWt(Ba(w.values,Le),re,G):_e&&Ee?nWt(_e):G}Le&&k(Le,Ke)},[k,w.values]),H=ef(function(Ce){if(cH(Ce))return function(We){return $(We,Ce)};$(Ce)}),Y=ef(function(Ce,We,Le){We===void 0&&(We=!0),C({type:"SET_FIELD_TOUCHED",payload:{field:Ce,value:We}});var Ke=Le===void 0?i:Le;return Ke?O(w.values):Promise.resolve()}),ie=Z.useCallback(function(Ce,We){Ce.persist&&Ce.persist();var Le=Ce.target,Ke=Le.name,qe=Le.id,we=Le.outerHTML,Se=We||Ke||qe;Y(Se,!0)},[Y]),W=ef(function(Ce){if(cH(Ce))return function(We){return ie(We,Ce)};ie(Ce)}),Q=Z.useCallback(function(Ce){rl(Ce)?C({type:"SET_FORMIK_STATE",payload:Ce}):C({type:"SET_FORMIK_STATE",payload:function(){return Ce}})},[]),J=Z.useCallback(function(Ce){C({type:"SET_STATUS",payload:Ce})},[]),ee=Z.useCallback(function(Ce){C({type:"SET_ISSUBMITTING",payload:Ce})},[]),ne=ef(function(){return C({type:"SUBMIT_ATTEMPT"}),O().then(function(Ce){var We=Ce instanceof Error,Le=!We&&Object.keys(Ce).length===0;if(Le){var Ke;try{if(Ke=ye(),Ke===void 0)return}catch(qe){throw qe}return Promise.resolve(Ke).then(function(qe){return y.current&&C({type:"SUBMIT_SUCCESS"}),qe}).catch(function(qe){if(y.current)throw C({type:"SUBMIT_FAILURE"}),qe})}else if(y.current&&(C({type:"SUBMIT_FAILURE"}),We))throw Ce})}),V=ef(function(Ce){Ce&&Ce.preventDefault&&rl(Ce.preventDefault)&&Ce.preventDefault(),Ce&&Ce.stopPropagation&&rl(Ce.stopPropagation)&&Ce.stopPropagation(),ne().catch(function(We){console.warn("Warning: An unhandled error was caught from submitForm()",We)})}),oe={resetForm:P,validateForm:O,validateField:x,setErrors:F,setFieldError:j,setFieldTouched:Y,setFieldValue:k,setStatus:J,setSubmitting:ee,setTouched:N,setValues:B,setFormikState:Q,submitForm:ne},ye=ef(function(){return u(w.values,oe)}),Te=ef(function(Ce){Ce&&Ce.preventDefault&&rl(Ce.preventDefault)&&Ce.preventDefault(),Ce&&Ce.stopPropagation&&rl(Ce.stopPropagation)&&Ce.stopPropagation(),P()}),Me=Z.useCallback(function(Ce){return{value:Ba(w.values,Ce),error:Ba(w.errors,Ce),touched:!!Ba(w.touched,Ce),initialValue:Ba(h.current,Ce),initialTouched:!!Ba(g.current,Ce),initialError:Ba(p.current,Ce)}},[w.errors,w.touched,w.values]),Oe=Z.useCallback(function(Ce){return{setValue:function(Le,Ke){return k(Ce,Le,Ke)},setTouched:function(Le,Ke){return Y(Ce,Le,Ke)},setError:function(Le){return j(Ce,Le)}}},[k,Y,j]),nt=Z.useCallback(function(Ce){var We=hB(Ce),Le=We?Ce.name:Ce,Ke=Ba(w.values,Le),qe={name:Le,value:Ke,onChange:H,onBlur:W};if(We){var we=Ce.type,Se=Ce.value,q=Ce.as,z=Ce.multiple;we==="checkbox"?Se===void 0?qe.checked=!!Ke:(qe.checked=!!(Array.isArray(Ke)&&~Ke.indexOf(Se)),qe.value=Se):we==="radio"?(qe.checked=Ke===Se,qe.value=Se):q==="select"&&z&&(qe.value=qe.value||[],qe.multiple=!0)}return qe},[W,H,w.values]),it=Z.useMemo(function(){return!wm(h.current,w.values)},[h.current,w.values]),St=Z.useMemo(function(){return typeof s<"u"?it?w.errors&&Object.keys(w.errors).length===0:s!==!1&&rl(s)?s(d):s:w.errors&&Object.keys(w.errors).length===0},[s,it,w.errors,d]),bt=Gi({},w,{initialValues:h.current,initialErrors:p.current,initialTouched:g.current,initialStatus:v.current,handleBlur:W,handleChange:H,handleReset:Te,handleSubmit:V,resetForm:P,setErrors:F,setFormikState:Q,setFieldTouched:Y,setFieldValue:k,setFieldError:j,setStatus:J,setSubmitting:ee,setTouched:N,setValues:B,submitForm:ne,validateForm:O,validateField:x,isValid:St,dirty:it,unregisterField:E,registerField:T,getFieldProps:nt,getFieldMeta:Me,getFieldHelpers:Oe,validateOnBlur:i,validateOnChange:r,validateOnMount:o});return bt}function gB(t){var e=JGt(t),r=t.component,n=t.children,i=t.render,a=t.innerRef;return Z.useImperativeHandle(a,function(){return e}),Z.createElement(ZGt,{value:e},r?Z.createElement(r,e):i?i(e):n?rl(n)?n(e):W9e(n)?null:Z.Children.only(n):null)}function eWt(t){var e={};if(t.inner){if(t.inner.length===0)return Up(e,t.path,t.message);for(var i=t.inner,r=Array.isArray(i),n=0,i=r?i:i[Symbol.iterator]();;){var a;if(r){if(n>=i.length)break;a=i[n++]}else{if(n=i.next(),n.done)break;a=n.value}var o=a;Ba(e,o.path)||(e=Up(e,o.path,o.message))}}return e}function tWt(t,e,r,n){r===void 0&&(r=!1),n===void 0&&(n={});var i=kK(t);return e[r?"validateSync":"validate"](i,{abortEarly:!1,context:n})}function kK(t){var e=Array.isArray(t)?[]:{};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=String(r);Array.isArray(t[n])===!0?e[n]=t[n].map(function(i){return Array.isArray(i)===!0||r0e(i)?kK(i):i!==""?i:void 0}):r0e(t[n])?e[n]=kK(t[n]):e[n]=t[n]!==""?t[n]:void 0}return e}function rWt(t,e,r){var n=t.slice();return e.forEach(function(a,o){if(typeof n[o]>"u"){var s=r.clone!==!1,l=s&&r.isMergeableObject(a);n[o]=l?CK(Array.isArray(a)?[]:{},a,r):a}else r.isMergeableObject(a)?n[o]=CK(t[o],a,r):t.indexOf(a)===-1&&n.push(a)}),n}function nWt(t){return Array.from(t).filter(function(e){return e.selected}).map(function(e){return e.value})}function iWt(t,e,r){if(typeof t=="boolean")return!!e;var n=[],i=!1,a=-1;if(Array.isArray(t))n=t,a=t.indexOf(r),i=a>=0;else if(!r||r=="true"||r=="false")return!!e;return e&&r&&!i?n.concat(r):i?n.slice(0,a).concat(n.slice(a+1)):n}var aWt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Z.useLayoutEffect:Z.useEffect;function ef(t){var e=Z.useRef(t);return aWt(function(){e.current=t}),Z.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;in?i:n},0);return Array.from(Gi({},e,{length:r+1}))}else return[]},Q9e=function(t){G9e(e,t);function e(n){var i;return i=t.call(this,n)||this,i.updateArrayField=function(a,o,s){var l=i.props,c=l.name,u=l.formik.setFormikState;u(function(f){var d=typeof s=="function"?s:a,h=typeof o=="function"?o:a,p=Up(f.values,c,a(Ba(f.values,c))),g=s?d(Ba(f.errors,c)):void 0,v=o?h(Ba(f.touched,c)):void 0;return I0e(g)&&(g=void 0),I0e(v)&&(v=void 0),Gi({},f,{values:p,errors:s?Up(f.errors,c,g):f.errors,touched:o?Up(f.touched,c,v):f.touched})})},i.push=function(a){return i.updateArrayField(function(o){return[].concat(V5(o),[YGt(a)])},!1,!1)},i.handlePush=function(a){return function(){return i.push(a)}},i.swap=function(a,o){return i.updateArrayField(function(s){return lWt(s,a,o)},!0,!0)},i.handleSwap=function(a,o){return function(){return i.swap(a,o)}},i.move=function(a,o){return i.updateArrayField(function(s){return sWt(s,a,o)},!0,!0)},i.handleMove=function(a,o){return function(){return i.move(a,o)}},i.insert=function(a,o){return i.updateArrayField(function(s){return fH(s,a,o)},function(s){return fH(s,a,null)},function(s){return fH(s,a,null)})},i.handleInsert=function(a,o){return function(){return i.insert(a,o)}},i.replace=function(a,o){return i.updateArrayField(function(s){return cWt(s,a,o)},!1,!1)},i.handleReplace=function(a,o){return function(){return i.replace(a,o)}},i.unshift=function(a){var o=-1;return i.updateArrayField(function(s){var l=s?[a].concat(s):[a];return o<0&&(o=l.length),l},function(s){var l=s?[null].concat(s):[null];return o<0&&(o=l.length),l},function(s){var l=s?[null].concat(s):[null];return o<0&&(o=l.length),l}),o},i.handleUnshift=function(a){return function(){return i.unshift(a)}},i.handleRemove=function(a){return function(){return i.remove(a)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(E0e(i)),i.pop=i.pop.bind(E0e(i)),i}var r=e.prototype;return r.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!wm(Ba(i.formik.values,i.name),Ba(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},r.remove=function(i){var a;return this.updateArrayField(function(o){var s=o?V5(o):[];return a||(a=s[i]),rl(s.splice)&&s.splice(i,1),s},!0,!0),a},r.pop=function(){var i;return this.updateArrayField(function(a){var o=a;return i||(i=o&&o.pop&&o.pop()),o},!0,!0),i},r.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},a=this.props,o=a.component,s=a.render,l=a.children,c=a.name,u=a.formik,f=qm(u,["validate","validationSchema"]),d=Gi({},i,{form:f,name:c});return o?Z.createElement(o,d):s?s(d):l?typeof l=="function"?l(d):W9e(l)?null:Z.Children.only(l):null},e}(Z.Component);Q9e.defaultProps={validateOnChange:!0};var uWt=Z9e(Q9e),fWt=function(t){G9e(e,t);function e(){return t.apply(this,arguments)||this}var r=e.prototype;return r.shouldComponentUpdate=function(i){return Ba(this.props.formik.errors,this.props.name)!==Ba(i.formik.errors,this.props.name)||Ba(this.props.formik.touched,this.props.name)!==Ba(i.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(i).length},r.render=function(){var i=this.props,a=i.component,o=i.formik,s=i.render,l=i.children,c=i.name,u=qm(i,["component","formik","render","children","name"]),f=Ba(o.touched,c),d=Ba(o.errors,c);return f&&d?s?rl(s)?s(d):null:l?rl(l)?l(d):null:a?Z.createElement(a,u,d):d:null},e}(Z.Component),qx=Z9e(fWt);const dWt=se.div` - margin-top: 10px; - padding: 20px 0; - width: 100%; - border: ${({dragActive:t,theme:e})=>`${t?"2px solid":"1px dashed"} ${e.INPUT_BORDER_LIGHT}`}; - border-radius: 4px; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - font-size: 1.2rem; - line-height: 2.2rem; - background-color: ${({theme:t})=>t.INPUT_BG_LIGHT}; - height: 100px; - &:focus { - outline: none; - box-shadow: 0 0 1px 1px ${({theme:t})=>t.INPUT_OUTLINE_LIGHT}; - } - &:hover { - border: 2px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - } - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_LIGHT}; - } -`,hWt=se(Br)` - max-height: 10px; -`,pWt=se.div` - justify-self: center; -`,gWt=se.label` - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; -`,vWt=se.input` - opacity: 0; - position: absolute; - margin: 0; - width: 90%; -`,mWt=se.div` - display: flex; - justify-content: center; - align-items: center; - z-index: 100; -`,yWt=se.div` - display: grid; -`,wWt=({field:t,form:e,mediaTypes:r,onFileChanged:n,maxFileSizeMb:i=1,...a})=>{const[o,s]=Z.useState(!1),[l,c]=Z.useState(""),[u,f]=Z.useState(""),[d,h]=Z.useState(0),p=m=>new Promise((b,w)=>{(r?r.includes(m.type):!0)?e.setFieldValue(t.name,m,!0).finally(()=>{e.setFieldTouched(t.name,!0).finally(()=>{b(),n&&n(m)})}):w(new Error(`Unsupported file type: ${m.type}`))}),g=()=>{e.setFieldValue(t.name,null,!0).finally(()=>{e.setFieldTouched(t.name,!0).finally(()=>{n&&n(null)})}),c(""),s(!1),h(0)},v=Z.useCallback(async m=>{var w,C;if(!((C=(w=m.target.files)==null?void 0:w[0])!=null&&C.size)||!i||m.target.files[0].size/1048576{m.preventDefault(),m.stopPropagation(),m.type==="dragenter"||m.type==="dragover"?s(!0):m.type==="dragleave"&&s(!1)};return M.jsx(dWt,{onDragOver:y,onDragLeave:y,dragActive:o||d===2,onDrop:v,children:l?d===2?M.jsxs(mWt,{children:[M.jsxs(yWt,{children:[M.jsxs("div",{children:["File: ",l]}),M.jsxs("div",{children:["Size: ",u]})]}),M.jsx(Lr,{icon:"TRASH",size:"5rem",onClick:g})]}):M.jsx(hWt,{}):M.jsxs(gWt,{children:[M.jsx(vWt,{type:"file",...t,...a,onChange:v}),M.jsx(pWt,{children:M.jsx(Lr,{icon:"UPGRADE",size:"3rem"})}),"Upload .wasm file"]})})},bWt=se.option` - background: ${({theme:t})=>t.INPUT_BG_LIGHT}; - font-weight: initial; - white-space: nowrap; - &:hover { - color: ${({theme:t})=>t.FONT_THEME}; - } -`,Yx=se.div` - margin-top: 5px; - color: red; -`,Kx=se(K9e)` - margin-top: ${({$issub:t})=>t?"5px":"10px"}; - padding: ${({$issub:t})=>t?"5px":"10px"}; - width: 100%; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - border-radius: 4px; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - font-size: ${({$issub:t})=>t?"1.2rem":"1.4rem"}; - line-height: 2.2rem; - background-color: ${({theme:t})=>t.INPUT_BG_LIGHT}; - height: ${({height:t})=>t&&t}; - - &:focus { - outline: none; - box-shadow: ${({theme:t,$noShadow:e})=>!e&&`0 0 1px 1px ${t.INPUT_BG_LIGHT}`}; - } - - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_LIGHT}; - } -`,xWt=se.textarea` - margin-top: ${({$issub:t})=>t?"5px":"10px"}; - padding: ${({$issub:t})=>t?"5px":"10px"}; - width: 100%; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - border-radius: 4px; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - font-size: ${({$issub:t})=>t?"1.2rem":"1.4rem"}; - line-height: 2.2rem; - background-color: ${({theme:t})=>t.INPUT_BG_LIGHT}; - - &:focus { - outline: none; - box-shadow: 0 0 1px 1px ${({theme:t})=>t.INPUT_OUTLINE_LIGHT}; - } - - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_LIGHT}; - } - height: 200px; - text-align: top; -`,Zv=se.div` - padding: 1.6rem 0 1.6rem 0; - display: ${({grid:t})=>t&&"grid"}; - grid-template-columns: ${({grid:t})=>t&&" 3fr 0.75fr"}; - border-bottom: ${({grid:t,theme:e,noBorder:r})=>!r&&t&&`1px solid ${e.INPUT_BG_LIGHT}`}; -`,Gy=se.label` - margin-top: ${({grid:t})=>t&&"10px"}; - font-size: ${({$issub:t})=>t?"1.4rem":"1.6rem"}; - font-weight: ${({theme:t,$issub:e})=>!e&&t.FONT_WEIGHT_BOLD}; - line-height: 1.75; - align-self: center; -`,dH=({name:t,label:e,type:r,dropdown:n,formik:i,issub:a=!1,grid:o=!1,blockNumber:s})=>{const l=(c,u,f,d)=>{switch(f){case"text":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:o,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:o,children:Kr(u)}),M.jsx(Kx,{$issub:a,name:c,type:"text",placeholder:`Enter ${u}`,value:i.getFieldProps(c).value||""}),M.jsx(qx,{name:c,children:h=>M.jsx(Yx,{children:h})})]})},c);case"date":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:o,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:o,children:Kr(u)}),M.jsx(Kx,{$issub:a,name:c,type:"date",value:i.getFieldProps(c).value||""}),M.jsx(qx,{name:c,children:h=>M.jsx(Yx,{children:h})})]})},c);case"file":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:o,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:o,children:Kr(u)}),M.jsx(Kx,{component:wWt,height:"100px",$issub:a,name:c,type:"file",value:void 0}),M.jsx(qx,{name:c,children:h=>M.jsx(Yx,{children:h})})]})},c);case"textarea":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:o,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:o,children:Kr(u)}),M.jsx(xWt,{$issub:a,id:c,placeholder:`Enter ${u}`,...i.getFieldProps(`${c}`)}),M.jsx(qx,{name:c,children:h=>M.jsx(Yx,{children:h})})]})},c);case"number":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:o,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:o,children:Kr(u)}),M.jsx(Kx,{$issub:a,name:c,type:"number",placeholder:c==="height"?String(s):"0",value:c==="height"?i.getFieldProps(c).value||"":void 0}),M.jsx(qx,{name:c,children:h=>M.jsx(Yx,{children:h})})]})},c);case"checkbox":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:!0,noBorder:!0,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:!0,children:Kr(u)}),M.jsx(Kx,{$issub:a,name:c,type:"checkbox",$noShadow:!0}),M.jsx(qx,{name:c,children:h=>M.jsx(Yx,{children:h})})]})},c);case"dropdown":return M.jsx(Z.Fragment,{children:M.jsxs(Zv,{grid:o,children:[M.jsx(Gy,{htmlFor:c,$issub:a,grid:o,children:Kr(u)}),M.jsx(Kx,{$issub:a,as:"select",...i.getFieldProps(`${c}`),children:d&&Object.keys(d).map(h=>{const p=d[h];return M.jsx(bWt,{value:p,children:Kr(p)},p)})})]})},c);default:return M.jsx(Zv,{grid:o,children:"Unsupported field"})}};return M.jsx(M.Fragment,{children:l(t,e,r,n)})},k0e=se.div` - padding-top: 1.6rem; -`,_Wt=se.label` - font-size: ${({$issub:t})=>t?"1.4rem":"1.6rem"}; - font-weight: ${({theme:t,$issub:e})=>!e&&t.FONT_WEIGHT_BOLD}; - line-height: 1.75; -`,SWt=se(Ha)` - margin-top: 10px; -`,CWt=se(Ha)` - margin-top: 10px; - justify-content: flex-end; -`,AWt=se.div` - font-size: 1.4rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,TWt=se.div` - margin-top: 5px; - padding: 10px; - border: 1px solid ${({theme:t})=>t.FONT_PRIMARY}; - border-radius: 5px; -`,S3=({config:t,formik:e,issub:r=!1,grid:n=!1,blockNumber:i})=>{const a=o=>{switch(o.type){case"text":case"date":case"textarea":case"checkbox":case"number":case"file":return M.jsx(dH,{name:o.field,label:o.label,type:o.type,formik:e,grid:n,blockNumber:i},o.field);case"dropdown":return M.jsx(dH,{name:o.field,label:o.label,type:o.type,dropdown:o.dropdown,formik:e,grid:n},o.field);case"repeating":return M.jsx(Z.Fragment,{children:M.jsxs(k0e,{children:[M.jsx(_Wt,{htmlFor:o.field,$issub:r,children:`${Kr(o.label)}s:`}),M.jsx(uWt,{name:o.field,render:s=>M.jsxs("div",{children:[e.getFieldProps(o.field).value&&e.getFieldProps(o.field).value.length>0&&e.getFieldProps(o.field).value.map((l,c)=>M.jsxs(TWt,{children:[M.jsx(AWt,{children:`${Kr(o.label)} ${c+1}:`}),o.subFields&&o.subFields.map(({type:u,label:f,field:d,dropdown:h})=>M.jsx(dH,{name:`${o.field}.${c}.${d}`,label:f,type:u,dropdown:h,formik:e,issub:!0,grid:n},`${o.field}.${c}.${d}`)),M.jsx(CWt,{type:"button",onClick:()=>s.remove(c),children:`Remove ${Kr(o.label)} ${c+1}`})]},c)),M.jsxs(SWt,{type:"button",onClick:()=>s.push({}),children:["Add ",o.label]})]})})]})},o.field);default:return M.jsx(k0e,{children:"Unsupported field"})}};return M.jsx(M.Fragment,{children:t.map(o=>a(o))})},EWt=se(bp)` - display: ${({show:t})=>t?"":"none"}; -`,IWt=({NotifyProps:t,onClick:e})=>{const[r,n]=Z.useState(!0),i=()=>{n(!r),e()};return M.jsx(EWt,{width:"100%",title:`${Kr(t.type)}s`,handleClose:i,icon:t.type==="proposal"?"REPORTS":t.type==="upgrade"?"UPGRADE":"PROVENANCE",iconColor:"FONT_NAV",show:r,titleMargin:"0 0 10px 0",titleSize:"1.8rem",children:M.jsx(NWt,{...t})})},kWt=se.div` - font-size: 1.4rem; - @media ${_t.down("md")} { - min-width: 300px; - } - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - color: ${({theme:t})=>t.FONT_NAV}; - padding-top: 5px; -`,PWt=se.li` -`,RWt=se.ul` - margin-bottom: 0; - @media ${_t.down("sm")} { - margin: 0; - } -`,MWt=se.span` - font-weight: bold; - color: ${({theme:t})=>t.YELLOW_LIGHTEST}; -`,DWt=se(Wo)` - color: ${({theme:t})=>t.FONT_PRIMARY}; - font-size: 1.4rem; - &&& { - :hover { - opacity: 1; - text-decoration: underline; - } - :visited { - color: ${({theme:t})=>t.FONT_NAV}; - } - - color: ${({theme:t})=>t.FONT_NAV}; - } -`,NWt=({data:t,type:e})=>{const{matches:r}=Qr(_t.down("sm"));let n="",i="";switch(e){case"proposal":n="/proposal/",i=`${t.length>1?"Multiple proposals are ":"A proposal is "} - now active! Visit the proposal page to review, deposit and/or vote.`;break;case"upgrade":n="/network/upgrades",i=`${t.length>1?"Multiple upgrades ":"An upgrade "} - is scheduled! Visit the upgrades page to learn more about what new - features are heading to Provenance.`;break;default:n="/announcement/",i=`${t.length>1?"We have some new announcements! ":"We have an announcement! "} - Click on the below link${t.length>1?"s":""} to see what's in store for the Provenance community.`;break}const a=(o,s)=>o.map(l=>{const c=l.title,u=l.id,f=l.isUpgrade?"SOFTWARE UPGRADE - ":"";return M.jsx(PWt,{children:M.jsx(DWt,{to:s==="upgrade"?n:`${n}${u}`,children:f?M.jsx(MWt,{children:`${f} PROPOSAL ${u}: ${c}`}):r?c:`${Kr(s)} ${u}: ${c}`})},u)});return M.jsxs(M.Fragment,{children:[!r&&M.jsx(kWt,{children:i}),M.jsx(RWt,{children:a(t,e)})]})},OWt=se.div` - display: ${({show:t})=>t?"":"none"}; - width: 100%; - margin-bottom: 20px; -`,LWt=se(Ha)` - margin-left: auto; - border: 1px solid white; - :hover { - cursor: pointer; - } -`,$Wt=()=>{const t=_i(),{setProposalNotifications:e,proposalNotifications:r,setUpgradeNotifications:n,upgradeNotifications:i,setAnnouncementNotifications:a,announcementNotifications:o}=Ki(),{openProposals:s,openAnnouncements:l,scheduledUpgrades:c,getProposalNotifications:u,getUpgradeNotifications:f,getAnnouncementNotifications:d}=yte(),g=sn(lu(new Date,7),"yyyy-MM-dd");Z.useEffect(()=>{u(),f(),d({fromDate:g})},[u,f,d,g]);const[v,y]=Z.useState(r||i||o);sx(()=>{u(),f(),d({fromDate:g}),A(s,"proposal",e),A(c,"upgrade",n),A(l,"announcement",a)},iS.notifications);const m=()=>{e(!1),!i&&!o&&y(!1)},b=()=>{n(!1),!r&&!o&&y(!1)},w=()=>{a(!1),!i&&!r&&y(!1)},C=()=>{m(),b(),w(),y(!v)},A=(D,L,O)=>{const P=localStorage.getItem(L+"Notifications"),x=P?JSON.parse(P):{};D.forEach(T=>{x[T.id]||(O(!0),y(!0),x[T.id]="set for "+L+" "+T.title)}),localStorage.setItem(L+"Notifications",JSON.stringify(x))};A(s,"proposal",e),A(c,"upgrade",n),A(l,"announcement",a);const S=(D,L,O)=>M.jsx(IWt,{onClick:O,NotifyProps:{data:D,type:L}}),I=M.jsx(LWt,{onClick:C,color:"PRIMARY",children:"Close All"});return M.jsx(OWt,{show:v&&(s.length>0||c.length>0||l.length>0)&&(r||i||o),children:M.jsxs(ln,{icon:"MEGAPHONE",iconColor:t.FONT_NAV,title:"News and Announcements",titleSize:"2.0rem",background:t.BACKGROUND_THEME,borderRadius:"5px",headerContent:I,color:t.FONT_NAV,children:[s.length>0&&r&&S(s,"proposal",m),c.length>0&&i&&S(c,"upgrade",b),l.length>0&&o&&S(l,"announcement",w)]})})};/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */var PK=function(t,e){return PK=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},PK(t,e)};function BWt(t,e){PK(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var po=function(){return po=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u"&&(a=t.call(this,n),e.set(i,a)),a}function J9e(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),a=e.get(i);return typeof a>"u"&&(a=t.apply(this,n),e.set(i,a)),a}function qte(t,e,r,n,i){return r.bind(e,t,n,i)}function WWt(t,e){var r=t.length===1?X9e:J9e;return qte(t,this,r,e.cache.create(),e.serializer)}function qWt(t,e){var r=J9e;return qte(t,this,r,e.cache.create(),e.serializer)}function YWt(t,e){var r=X9e;return qte(t,this,r,e.cache.create(),e.serializer)}function KWt(){return JSON.stringify(arguments)}function vB(){this.cache=Object.create(null)}vB.prototype.has=function(t){return t in this.cache};vB.prototype.get=function(t){return this.cache[t]};vB.prototype.set=function(t,e){this.cache[t]=e};var ZWt={create:function(){return new vB}},eIe=VWt,QWt={variadic:qWt,monadic:YWt};eIe.strategies=QWt;var tIe=function(e){return!!e&&!HWt(e)},rIe=function(e){return tIe(e)?e:[]},Yte=function(e){var r=e.data,n=vE(e,["data"]),i=rIe(r),a=po({parent:"",level:0},n),o=function(c){return c.reduce(function(u,f,d){var h=po({node:f,index:d,nodeName:f.key},a),p=P0e(h);return mE(u,p)},[])},s=function(c){return Object.entries(c).sort(function(u,f){return u[1].index-f[1].index}).reduce(function(u,f){var d=f[0],h=f[1],p=po({node:h,nodeName:d},a),g=P0e(p);return mE(u,g)},[])};return Array.isArray(i)?o(i):s(i)},XWt=function(e){var r=e.label,n=e.searchTerm,i=function(o){return o.trim().toLowerCase()};return i(r).includes(i(n))},JWt=function(e){var r=e.label;return r},P0e=function(e){var r=e.node,n=e.nodeName,i=e.matchSearch,a=i===void 0?XWt:i,o=e.locale,s=o===void 0?JWt:o,l=vE(e,["node","nodeName","matchSearch","locale"]),c=l.parent,u=l.level,f=l.openNodes,d=l.searchTerm,h=r.nodes,p=r.label,g=p===void 0?"unknown":p,v=vE(r,["nodes","label"]),y=[c,n].filter(function(D){return D}).join("/"),m=tIe(h),b=m&&(f.includes(y)||!!d),w=s(po({label:g},v)),C=!d||a(po({label:w,searchTerm:d},v)),A=po(po(po({},l),v),{label:w,hasNodes:m,isOpen:b,key:y}),S=rIe(h),I=b?Yte(po(po({data:S,locale:s,matchSearch:a},l),{parent:y,level:u+1})):[];return C?mE([A],I):I},eqt=eIe(Yte),tqt=Yte;function rqt(t,e){return e={exports:{}},t(e,e.exports),e.exports}var nqt=rqt(function(t){/*! - Copyright (c) 2017 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i1?d.slice(0,d.length-1).join("/"):f.key};return{up:function(){r.setState(function(f){var d=f.focusKey;return{focusKey:l>0?n[l-1].key:d}})},down:function(){r.setState(function(f){var d=f.focusKey;return{focusKey:lt?"grid":"inherit"}; - grid-template-columns: 2fr 1fr; - gap: 20px; -`,dqt=se.div` - display: flex; - gap: 10px; - margin-bottom: 10px; -`,hqt=se.input` - width: 50%; -`,pqt=se.ul` - margin: 0; - padding: 0; - list-style-type: none; -`,gqt=se.div` - position: sticky; - align-self: start; - top: 220px; - right: 0; -`,vqt=se.div` - :child { - float: left; - width: 50%; - } - :last-child { - border-bottom: none; - } - cursor: pointer; - .rstm-toggle-icon { - display: inline-block; - } - .rstm-toggle-icon-symbol { - width: 2rem; - height: 2rem; - text-align: center; - line-height: 2rem; - } - - .rstm-tree-item-group { - list-style-type: none; - padding-left: 0; - border-top: ${({theme:t})=>`1px solid ${t.FONT_PRIMARY}`}; - text-align: left; - width: 100%; - } - - .rstm-tree-item { - padding: 0.75rem 1rem; - cursor: pointer; - color: ${({theme:t})=>t.FONT_PRIMARY}; - background: none; - border-bottom: ${({theme:t})=>`1px solid ${t.FONT_PRIMARY}`}; - box-shadow: none; - z-index: unset; - position: relative; - } - .rstm-tree-item--active { - color: ${({theme:t})=>t.FONT_PRIMARY}; - background: ${({theme:t})=>t.BLUE_LIGHT}; - border-bottom: none; - } - .rstm-tree-item--focused { - box-shadow: 0 0 5px 0 #222; - z-index: 999; - } - - .rstm-search { - padding: 1rem 1.5rem; - border: none; - width: 100%; - } -`,mqt=({data:t,inputPlaceHolderText:e="",showSearch:r=!1,showResetButton:n=!1,info:i,currentLabel:a="",searchList:o,setCurrentLabel:s})=>{const[l,c]=Z.useState(""),u=_i();return M.jsxs(fqt,{info:!!i,children:[M.jsx(uqt,{data:t,hasSearch:r,children:({search:f,items:d,resetOpenNodes:h})=>M.jsxs(M.Fragment,{children:[f&&f(l),(n||r)&&M.jsxs(dqt,{children:[n&&M.jsx(Ha,{onClick:()=>{h&&h(),c("")},children:"Reset"}),r&&M.jsxs(M.Fragment,{children:[M.jsx(hqt,{placeholder:e,list:o&&"mylist",value:l,onChange:p=>{c(p.target.value),f&&f(l)}}),o&&M.jsx("datalist",{id:"mylist",children:o.map((p,g)=>M.jsx("option",{value:p},g))})]})]}),M.jsx(pqt,{children:d.map(({key:p,label:g,...v})=>M.jsx(vqt,{theme:u,onClick:s?()=>s(g):void 0,children:M.jsx(nIe,{label:g,...v,onClick:()=>null,active:a===g},p)},p))})]})}),i&&M.jsx(gqt,{children:M.jsx(ln,{children:i})})]})},yqt=se.div` - max-width: ${({size:t})=>t||"100%"}; - max-height: ${({height:t})=>t||"100%"}; - position: relative; - color: ${({color:t})=>t&&t}; - flex-basis: ${({size:t})=>t}; - ${({alignSelf:t})=>t&&`align-self: ${t};`}; -`,wqt=se.div` - padding: 20px; - border-radius: ${({borderRadius:t})=>t&&t}; - display: flex; - align-items: ${({alignItems:t})=>t}; - ${({alignContent:t})=>t&&`align-content: ${t};`}; - background: ${({theme:t,background:e})=>e||t.BACKGROUND_CONTENT}; - border: ${({border:t,theme:e})=>t&&`1px solid ${e.BORDER_PRIMARY}`}; - border-bottom: ${({borderBottom:t})=>t&&t}; - border-top: ${({borderTop:t})=>t&&t}; - flex-wrap: wrap; - height: 100%; - justify-content: ${({justify:t})=>t}; -`,bqt=se.h3` - && { - display: flex; - align-items: center; - flex-basis: 100%; - margin: ${({headerMargin:t})=>t||"0 0 18px"}; - @media ${_t.between("sm","md")} { - margin: ${({headerMargin:t})=>t||"0 0 12px"}; - } - } -`,xqt=se(Lr)` - margin-right: 10px; -`,_qt=se.div` - font-size: ${({titleSize:t})=>t||"1.6rem"}; -`,Sqt=se(Wo)` - justify-content: flex-end; - margin-left: auto; - color: ${({theme:t})=>t.FONT_LINK}; - :visited { - color: ${({theme:t})=>t.FONT_LINK_VISITED}; - } -`,ln=({children:t,size:e,height:r,justify:n,alignItems:i,title:a,titleSize:o,icon:s,iconColor:l,link:c,className:u,alignSelf:f,alignContent:d,headerContent:h,headerMargin:p,contentBorder:g,borderTop:v,borderBottom:y,background:m,borderRadius:b,color:w})=>{const{to:C,title:A}=c,S=a||s||C||A,I=()=>M.jsxs(bqt,{headerMargin:p,children:[s&&M.jsx(xqt,{icon:s,size:"2rem",color:l}),a&&M.jsx(_qt,{titleSize:o,children:a}),C&&A&&M.jsx(Sqt,{to:c.to,children:c.title}),h]});return M.jsx(yqt,{size:e,height:r,className:u,alignSelf:f,color:w,children:M.jsxs(wqt,{justify:n,alignItems:i,alignContent:d,borderBottom:y,borderTop:v,background:m,borderRadius:b,border:g,children:[S&&I(),t]})})};ln.propTypes={children:Ie.node,size:Ie.string,height:Ie.string,justify:Ie.string,alignItems:Ie.string,alignSelf:Ie.string,alignContent:Ie.string,title:Ie.string,titleSize:Ie.string,icon:Ie.string,iconColor:Ie.string,link:Ie.object,className:Ie.string,headerContent:Ie.node,headerMargin:Ie.string,borderBottom:Ie.string,borderTop:Ie.string,background:Ie.string,borderRadius:Ie.string,color:Ie.string,contentBorder:Ie.bool};ln.defaultProps={className:null,children:null,size:"100%",height:"100%",justify:"initial",alignItems:"center",alignSelf:"",alignContent:"flex-start",title:null,titleSize:"",icon:null,iconColor:"",link:{},headerContent:"",headerMargin:null,borderTop:"",borderBottom:"",background:"",borderRadius:"",color:"",contentBorder:!0};const Cqt=se.div` - display: flex; - justify-content: space-between; - /* flex-wrap: wrap; */ - flex-basis: 100%; - flex-direction: column; - gap: 20px; - width: 100%; - margin-bottom: 20px; - ${({header:t})=>t&&"margin-top: 50px;"} - - @media ${_t.down("lg")} { - ${({header:t})=>t&&"margin-top: 60px;"} - } - - @media ${_t.down("md")} { - ${({header:t})=>t&&"margin-top: 0px;"} - } - - @media ${_t.up("sm")} { - flex-direction: row; - } -`,cr=({children:t,header:e})=>M.jsx(Cqt,{header:e,children:t});cr.propTypes={children:Ie.node,header:Ie.bool};cr.defaultProps={children:null,header:!1};const Aqt=se.div` - padding: 131px 10%; - position: relative; - background-color: transparent; - font-size: 1.4rem; - @media ${_t.down("lg")} { - padding: ${({noHeader:t})=>t?"126px 4%":"110px 4%"}; - } - @media ${_t.down("md")} { - padding: ${({noHeader:t})=>t?"96px 4%":"110px 4%"}; - } -`,Ni=({children:t=null,noHeader:e=!1})=>M.jsx(Aqt,{noHeader:e,children:t}),Tqt=se.div` - height: 100%; - min-height: 100vh; - background-color: ${({theme:t})=>t.BACKGROUND_LIGHT}; - font-family: ${({theme:t})=>t.PRIMARY_FONT}; - color: ${({theme:t})=>t.FONT_PRIMARY}; - a { - color: ${({theme:t})=>t.FONT_LINK}; - :visited { - color: ${({theme:t})=>t.FONT_LINK_VISITED}; - } - } - h1, - h2, - h3 { - font-family: ${({theme:t})=>t.HEADER_FONT}; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_THIN}; - } - h4, - h5, - h6 { - font-family: ${({theme:t})=>t.PRIMARY_FONT}; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - } - p, - span, - li, - footer { - font-family: ${({theme:t})=>t.PRIMARY_FONT}; - } - th { - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - } -`,iIe=({children:t})=>M.jsx(Tqt,{"data-testid":"base-style",children:t});iIe.propTypes={children:Ie.node.isRequired};const Eqt=se.div` - position: relative; - width: 100%; - height: 20px; - box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5) inset; - background-color: ${({theme:t})=>t.BACKGROUND_LIGHT}; -`,M0e=se.span` - position: absolute; - left: ${({start:t=0})=>t}%; - display: block; - width: ${({value:t})=>t>100?100:t}%; - height: ${({height:t=100})=>t}%; - text-indent: -9999px; - background-color: ${({color:t,theme:e})=>e[t]}; -`,Iqt=({data:t})=>{let e=0,r=0;return M.jsx(Z.Fragment,{children:M.jsx(Eqt,{children:t.map(n=>r===0?(r++,M.jsx(M0e,{color:n.color,height:n.height||100,start:0,value:n.value},n.color)):(e+=t[r-1].value,r++,M.jsx(M0e,{color:n.color,height:n.height||100,start:e,value:n.value},n.color)))})})},D0e=se.div` - display: flex; - flex-wrap: wrap; - flex-basis: ${({size:t})=>t||"auto"}; -`,$7=se.div` - text-align: center; - margin: 12px 0; - display: flex; - align-items: center; - justify-content: center; - flex-basis: 100%; -`,kqt=se(Lr)` - margin-right: 8px; -`,u4=se(Wo)` - font-size: ${({size:t})=>t||"inherit"}; - ${({weight:t})=>t&&`font-weight: ${t};`} -`,Pqt=()=>{const[t,e]=Z.useState(!0),[r,n]=Z.useState(!1),{blockLatest:i,getBlockSpotlight:a,blockSpotlightFailed:o,blockSpotlightLoading:s}=wy(),{matches:l}=Qr(_t.down("lg"));Z.useEffect(()=>{(async()=>{if(t){n(!0),e(!1);try{await Promise.all([a()]),n(!1)}catch{n(!1)}}})()},[a,t]),sx(()=>!s&&a(),iS.blockSpotlight,o);const{avgBlockTime:c,bondedTokens:u={},latestBlock:f={},totalTxCount:d,totalAum:h={}}=i,{count:p,denom:g,total:v}=u,{height:y,icon:m,moniker:b,proposerAddress:w="",time:C,validatorCount:A={},votingPower:S={}}=f,{count:I,total:D}=A,{count:L,total:O}=S,P=C?`${Wi(C)}+UTC`:"--",x=`${Qn(L/O*100,2)}%`,T=`${Qn(p/v*100,4,{minimumFractionDigits:2})}%`,E=Qn(d,1,{shorthand:!0});return M.jsxs(ln,{justify:"center",alignItems:"flex-start",children:[r&&M.jsx(Br,{}),o&&!i.length&&M.jsx("div",{children:"Block Spotlight failed to load, refresh page to try again"}),!r&&!o&&M.jsxs(M.Fragment,{children:[M.jsxs(D0e,{size:"30%",children:[M.jsxs($7,{children:[M.jsx(kqt,{icon:"CUBES",size:"1.8rem"})," Block Height"]}),M.jsx($7,{children:M.jsx(u4,{to:`/block/${y}`,size:"2rem",weight:"900",children:y})}),M.jsx($7,{children:M.jsx(w2,{icon:m,moniker:b,address:w})}),M.jsx($7,{title:b||w,children:M.jsx(u4,{to:`/validator/${w}`,children:b?Rr(b,16):Rr(w,16,5)})})]}),M.jsxs(D0e,{size:"70%",children:[M.jsxs(bp,{icon:"PROVENANCE",title:"Chain Value",children:[`$${zt(h.amount,h.denom,{decimal:2,minimumFractionDigits:2,shorthand:l})}`,M.jsx(u4,{to:"/assets",children:"All Assets"})]}),M.jsxs(bp,{icon:"ADMIN",title:"Transactions",children:[M.jsx(u4,{to:"/txs/",children:E}),P]}),M.jsxs(bp,{icon:"PARTICIPATION",title:"Voting Power",children:[x,M.jsxs(u4,{to:`/block/${y}`,children:[I,"/",D," Validators"]})]}),M.jsxs(bp,{icon:"PENDING",title:"Avg Block Time",children:[RKe(c,2),"Last 100 Blocks"]}),M.jsxs(bp,{icon:"SHARED_POOLS",title:"Bonded Tokens",children:[T,M.jsxs(Z.Fragment,{children:[zt(p,g,{shorthand:!0,decimal:2})," /"," ",zt(v,g,{shorthand:!0,decimal:2})]})]})]})]})]})};/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var RK=function(t,e){return RK=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},RK(t,e)};function Ge(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");RK(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var MK=function(){return MK=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u"&&typeof self<"u"?(Ar.worker=!0,Ar.canvasSupported=!0):typeof navigator>"u"?(Ar.node=!0,Ar.canvasSupported=!0,Ar.svgSupported=!0):Nqt(navigator.userAgent,Ar);function Nqt(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var aIe={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},oIe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},GS=Object.prototype.toString,mB=Array.prototype,Oqt=mB.forEach,Lqt=mB.filter,Kte=mB.slice,$qt=mB.map,N0e=(function(){}).constructor,B7=N0e?N0e.prototype:null,Zte="__proto__",sIe={},Bqt=2311;function lIe(){return Bqt++}function Dg(){for(var t=[],e=0;e>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[c]+":0",n[1-l]+":auto",i[1-c]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function Jqt(t,e,r){for(var n=r?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),f=2*c,d=u.left,h=u.top;o.push(d,h),l=l&&a&&d===a[f]&&h===a[f+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&i?i:(e.srcCoords=o,e[n]=r?$0e(s,o):$0e(o,s))}function uIe(t){return t.nodeName.toUpperCase()==="CANVAS"}var tre=typeof window<"u"&&!!window.addEventListener,eYt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,gH=[];function jK(t,e,r,n){return r=r||{},n||!Ar.canvasSupported?F0e(t,e,r):Ar.browser.firefox&&Ar.browser.version<"39"&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):F0e(t,e,r),r}function F0e(t,e,r){if(Ar.domSupported&&t.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(uIe(t)){var a=t.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(FK(gH,t,n,i)){r.zrX=gH[0],r.zrY=gH[1];return}}r.zrX=r.zrY=0}function rre(t){return t||window.event}function yf(t,e,r){if(e=rre(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&jK(t,o,e,r)}else{jK(t,e,e,r);var a=tYt(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&eYt.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function tYt(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function UK(t,e,r,n){tre?t.addEventListener(e,r,n):t.attachEvent("on"+e,r)}function rYt(t,e,r,n){tre?t.removeEventListener(e,r,n):t.detachEvent("on"+e,r)}var fv=tre?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function j0e(t){return t.which===2||t.which===3}var nYt=function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:r,event:e},o=0,s=i.length;o1&&n&&n.length>1){var a=U0e(n)/U0e(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=iYt(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},fIe="silent";function aYt(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:oYt}}function oYt(){fv(this.event)}var sYt=function(t){hi(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(ad),f4=function(){function t(e,r){this.x=e,this.y=r}return t}(),lYt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],dIe=function(t){hi(e,t);function e(r,n,i,a){var o=t.call(this)||this;return o._hovered=new f4(0,0),o.storage=r,o.painter=n,o.painterRoot=a,i=i||new sYt,o.proxy=null,o.setHandlerProxy(i),o._draggingMgr=new Kqt(o),o}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(te(lYt,function(n){r.on&&r.on(n,this[n],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var n=r.zrX,i=r.zrY,a=hIe(this,n,i),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new f4(n,i):this.findHover(n,i),c=l.target,u=this.proxy;u.setCursor&&u.setCursor(c?c.cursor:"default"),s&&c!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),c&&c!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var n=r.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new f4(0,0)},e.prototype.dispatch=function(r,n){var i=this[r];i&&i.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var n=this.proxy;n.setCursor&&n.setCursor(r)},e.prototype.dispatchToElement=function(r,n,i){r=r||{};var a=r.target;if(!(a&&a.silent)){for(var o="on"+n,s=aYt(n,r,i);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(n,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(r,n,i){for(var a=this.storage.getDisplayList(),o=new f4(r,n),s=a.length-1;s>=0;s--){var l=void 0;if(a[s]!==i&&!a[s].ignore&&(l=cYt(a[s],r,n))&&(!o.topTarget&&(o.topTarget=a[s]),l!==fIe)){o.target=a[s];break}}return o},e.prototype.processGesture=function(r,n){this._gestureMgr||(this._gestureMgr=new nYt);var i=this._gestureMgr;n==="start"&&i.clear();var a=i.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(n==="end"&&i.clear(),a){var o=a.type;r.gestureEvent=o;var s=new f4;s.target=a.target,this.dispatchToElement(s,o,a.event)}},e}(ad);te(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){dIe.prototype[t]=function(e){var r=e.zrX,n=e.zrY,i=hIe(this,r,n),a,o;if((t!=="mouseup"||!i)&&(a=this.findHover(r,n),o=a.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||Ym(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function cYt(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(e,r))return!1;n.silent&&(i=!0)}var s=n.__hostTarget;n=s||n.parent}return i?fIe:!0}return!1}function hIe(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var pIe=32,d4=7;function uYt(t){for(var e=0;t>=pIe;)e|=t&1,t>>=1;return t+e}function z0e(t,e,r,n){var i=e+1;if(i===r)return 1;if(n(t[i++],t[e])<0){for(;i=0;)i++;return i-e}function fYt(t,e,r){for(r--;e>>1,i(a,t[l])<0?s=l:o=l+1;var c=n-o;switch(c){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;c>0;)t[o+c]=t[o+c-1],c--}t[o]=a}}function mH(t,e,r,n,i,a){var o=0,s=0,l=1;if(a(t,e[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var c=o;o=i-l,l=i-c}for(o++;o>>1);a(t,e[r+u])>0?o=u+1:l=u}return l}function yH(t,e,r,n,i,a){var o=0,s=0,l=1;if(a(t,e[r+i])<0){for(s=i+1;ls&&(l=s);var c=o;o=i-l,l=i-c}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(t,e[r+u])<0?l=u:o=u+1}return l}function dYt(t,e){var r=d4,n,i,a=0;t.length;var o=[];n=[],i=[];function s(h,p){n[a]=h,i[a]=p,a+=1}function l(){for(;a>1;){var h=a-2;if(h>=1&&i[h-1]<=i[h]+i[h+1]||h>=2&&i[h-2]<=i[h]+i[h-1])i[h-1]i[h+1])break;u(h)}}function c(){for(;a>1;){var h=a-2;h>0&&i[h-1]=d4||S>=d4);if(I)break;C<0&&(C=0),C+=2}if(r=C,r<1&&(r=1),p===1){for(y=0;y=0;y--)t[A+y]=t[C+y];t[w]=o[b];return}for(var S=r;;){var I=0,D=0,L=!1;do if(e(o[b],t[m])<0){if(t[w--]=t[m--],I++,D=0,--p===0){L=!0;break}}else if(t[w--]=o[b--],D++,I=0,--v===1){L=!0;break}while((I|D)=0;y--)t[A+y]=t[C+y];if(p===0){L=!0;break}}if(t[w--]=o[b--],--v===1){L=!0;break}if(D=v-mH(t[m],o,0,v,v-1,e),D!==0){for(w-=D,b-=D,v-=D,A=w+1,C=b+1,y=0;y=d4||D>=d4);if(L)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),v===1){for(w-=p,m-=p,A=w+1,C=m+1,y=p-1;y>=0;y--)t[A+y]=t[C+y];t[w]=o[b]}else{if(v===0)throw new Error;for(C=w-(v-1),y=0;ys&&(l=s),H0e(t,r,r+l,r+a,e),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var iu=1,dA=2,E_=4,V0e=!1;function wH(){V0e||(V0e=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function G0e(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var hYt=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=G0e}return t.prototype.traverse=function(e,r){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(wH(),u.z=0),isNaN(u.z2)&&(wH(),u.z2=0),isNaN(u.zlevel)&&(wH(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,r,n);var d=e.getTextGuideLine();d&&this._updateAndAddDisplayable(d,r,n);var h=e.getTextContent();h&&this._updateAndAddDisplayable(h,r,n)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,n=e.length;r=0&&this._roots.splice(i,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),iO;iO=typeof window<"u"&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var fM={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-fM.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?fM.bounceIn(t*2)*.5:fM.bounceOut(t*2-1)*.5+.5}},pYt=function(){function t(e){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop==null?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}return t.prototype.step=function(e,r){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused){this._pausedTime+=r;return}var n=(e-this._startTime-this._pausedTime)/this._life;n<0&&(n=0),n=Math.min(n,1);var i=this.easing,a=typeof i=="string"?fM[i]:i,o=typeof a=="function"?a(n):n;if(this.onframe&&this.onframe(o),n===1)if(this.loop)this._restart(e),this.onrestart&&this.onrestart();else return!0;return!1},t.prototype._restart=function(e){var r=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-r+this.gap,this._pausedTime=0},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t}(),gIe=function(){function t(e){this.value=e}return t}(),gYt=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new gIe(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),i9=function(){function t(e){this._list=new gYt,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,i=this._map,a=null;if(i[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new gIe(r),s.key=e,n.insertEntry(s),i[e]=s}return a},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),W0e={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function oh(t){return t=Math.round(t),t<0?0:t>255?255:t}function vYt(t){return t=Math.round(t),t<0?0:t>360?360:t}function wE(t){return t<0?0:t>1?1:t}function bH(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?oh(parseFloat(e)/100*255):oh(parseInt(e,10))}function q5(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?wE(parseFloat(e)/100):wE(parseFloat(e))}function xH(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function Km(t,e,r){return t+(e-t)*r}function df(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function HK(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var vIe=new i9(20),F7=null;function Qx(t,e){F7&&HK(F7,e),F7=vIe.put(t,F7||e.slice())}function Zl(t,e){if(t){e=e||[];var r=vIe.get(t);if(r)return HK(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in W0e)return HK(e,W0e[n]),Qx(t,e),e;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){df(e,0,0,0,1);return}return df(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),Qx(t,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){df(e,0,0,0,1);return}return df(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),Qx(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),c=n.substr(o+1,s-(o+1)).split(","),u=1;switch(l){case"rgba":if(c.length!==4)return c.length===3?df(e,+c[0],+c[1],+c[2],1):df(e,0,0,0,1);u=q5(c.pop());case"rgb":if(c.length!==3){df(e,0,0,0,1);return}return df(e,bH(c[0]),bH(c[1]),bH(c[2]),u),Qx(t,e),e;case"hsla":if(c.length!==4){df(e,0,0,0,1);return}return c[3]=q5(c[3]),VK(c,e),Qx(t,e),e;case"hsl":if(c.length!==3){df(e,0,0,0,1);return}return VK(c,e),Qx(t,e),e;default:return}}df(e,0,0,0,1)}}function VK(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=q5(t[1]),i=q5(t[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return e=e||[],df(e,oh(xH(o,a,r+1/3)*255),oh(xH(o,a,r)*255),oh(xH(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function mYt(t){if(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=a-i,s=(a+i)/2,l,c;if(o===0)l=0,c=0;else{s<.5?c=o/(a+i):c=o/(2-a-i);var u=((a-e)/6+o/2)/o,f=((a-r)/6+o/2)/o,d=((a-n)/6+o/2)/o;e===a?l=d-f:r===a?l=1/3+u-d:n===a&&(l=2/3+f-u),l<0&&(l+=1),l>1&&(l-=1)}var h=[l*360,c,s];return t[3]!=null&&h.push(t[3]),h}}function mIe(t,e){var r=Zl(t);if(r){for(var n=0;n<3;n++)e<0?r[n]=r[n]*(1-e)|0:r[n]=(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Hp(r,r.length===4?"rgba":"rgb")}}function yIe(t){var e=Zl(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function _H(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var n=t*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=e[i],s=e[a],l=n-i;return r[0]=oh(Km(o[0],s[0],l)),r[1]=oh(Km(o[1],s[1],l)),r[2]=oh(Km(o[2],s[2],l)),r[3]=wE(Km(o[3],s[3],l)),r}}function yYt(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=Zl(e[i]),s=Zl(e[a]),l=n-i,c=Hp([oh(Km(o[0],s[0],l)),oh(Km(o[1],s[1],l)),oh(Km(o[2],s[2],l)),wE(Km(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:i,rightIndex:a,value:n}:c}}function a6(t,e,r,n){var i=Zl(t);if(t)return i=mYt(i),e!=null&&(i[0]=vYt(e)),r!=null&&(i[1]=q5(r)),n!=null&&(i[2]=q5(n)),Hp(VK(i),"rgba")}function aO(t,e){var r=Zl(t);if(r&&e!=null)return r[3]=wE(e),Hp(r,"rgba")}function Hp(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function oO(t,e){var r=Zl(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var GK=Array.prototype.slice;function bE(t,e,r){return(e-t)*r+t}function wYt(t,e,r){return r>.5?e:t}function q0e(t,e,r,n){for(var i=e.length,a=0;ao;if(s)n.length=o;else for(var l=a;l=2&&this.interpolable&&this.maxTime>0},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r){e>=this.maxTime?this.maxTime=e:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(jc(r)){var a=SYt(r);if(i>0&&this.arrDim!==a){this.interpolable=!1;return}if(a===1&&typeof r[0]!="number"||a===2&&typeof r[0][0]!="number"){this.interpolable=!1;return}if(i>0){var o=n[i-1];this._isAllValueEqual&&(a===1?K0e(r,o.value)||(this._isAllValueEqual=!1):this._isAllValueEqual=!1)}this.arrDim=a}else{if(this.arrDim>0){this.interpolable=!1;return}if(typeof r=="string"){var s=Zl(r);s?(r=s,this.isValueColor=!0):this.interpolable=!1}else if(typeof r!="number"||isNaN(r)){this.interpolable=!1;return}if(this._isAllValueEqual&&i>0){var o=n[i-1];this.isValueColor&&!K0e(o.value,r)?this._isAllValueEqual=!1:o.value!==r&&(this._isAllValueEqual=!1)}}var l={time:e,value:r,percent:0};return this.keyframes.push(l),l},t.prototype.prepare=function(e){var r=this.keyframes;this._needsSort&&r.sort(function(l,c){return l.time-c.time});for(var n=this.arrDim,i=r.length,a=r[i-1],o=0;o0&&o!==i-1&&xYt(r[o].value,a.value,n);if(e&&this.needsAnimate()&&e.needsAnimate()&&n===e.arrDim&&this.isValueColor===e.isValueColor&&!e._finished){this._additiveTrack=e;for(var s=r[0].value,o=0;o=0&&!(a[u].percent<=r);u--);u=Math.min(u,o-2)}else{for(u=this._lastFrame;ur);u++);u=Math.min(u-1,o-2)}var d=a[u+1],h=a[u];if(h&&d){this._lastFrame=u,this._lastFramePercent=r;var p=d.percent-h.percent;if(p!==0){var g=(r-h.percent)/p,v=n?this._additiveValue:c?h4:e[s];if((l>0||c)&&!v&&(v=this._additiveValue=[]),this.useSpline){var y=a[u][i],m=a[u===0?u:u-1][i],b=a[u>o-2?o-1:u+1][i],w=a[u>o-3?o-1:u+2][i];if(l>0)l===1?Z0e(v,m,y,b,w,g,g*g,g*g*g):_Yt(v,m,y,b,w,g,g*g,g*g*g);else if(c)Z0e(v,m,y,b,w,g,g*g,g*g*g),n||(e[s]=s6(v));else{var C=void 0;this.interpolable?C=nre(m,y,b,w,g,g*g,g*g*g):C=b,n?this._additiveValue=C:e[s]=C}}else if(l>0)l===1?q0e(v,h[i],d[i],g):bYt(v,h[i],d[i],g);else if(c)q0e(v,h[i],d[i],g),n||(e[s]=s6(v));else{var C=void 0;this.interpolable?C=bE(h[i],d[i],g):C=wYt(h[i],d[i],g),n?this._additiveValue=C:e[s]=C}n&&this._addToTarget(e)}}}},t.prototype._addToTarget=function(e){var r=this.arrDim,n=this.propName,i=this._additiveValue;r===0?this.isValueColor?(Zl(e[n],h4),j7(h4,h4,i,1),e[n]=s6(h4)):e[n]=e[n]+i:r===1?j7(e[n],e[n],i,1):r===2&&Y0e(e[n],e[n],i,1)},t}(),ire=function(){function t(e,r,n){if(this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&n){Dg("Can' use additive animation on looped animation.");return}this._additiveAnimators=n}return t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r){return this.whenWithKeys(e,r,Gn(r))},t.prototype.whenWithKeys=function(e,r,n){for(var i=this._tracks,a=0;a0)){this._started=1;for(var n=this,i=[],a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(a.getAdditiveTrack())}}}},t}(),AYt=function(t){hi(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n.onframe=r.onframe||function(){},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._clipsHead?(this._clipsTail.next=r,r.prev=this._clipsTail,r.next=null,this._clipsTail=r):this._clipsHead=this._clipsTail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,i=r.next;n?n.next=i:this._clipsHead=i,i?i.prev=n:this._clipsTail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=new Date().getTime()-this._pausedTime,i=n-this._time,a=this._clipsHead;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy&&a.ondestroy(),this.removeClip(a)),a=o}this._time=n,r||(this.onframe(i),this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(iO(n),!r._paused&&r.update())}iO(n)},e.prototype.start=function(){this._running||(this._time=new Date().getTime(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=new Date().getTime(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=new Date().getTime()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._clipsHead;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._clipsHead=this._clipsTail=null},e.prototype.isFinished=function(){return this._clipsHead==null},e.prototype.animate=function(r,n){n=n||{},this.start();var i=new ire(r,n.loop);return this.addAnimator(i),i},e}(ad),TYt=300,SH=Ar.domSupported,CH=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=ft(t,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:t,touch:e,pointer:n}}(),Q0e={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},X0e=!1;function WK(t){var e=t.pointerType;return e==="pen"||e==="touch"}function EYt(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function AH(t){t&&(t.zrByTouch=!0)}function IYt(t,e){return yf(t.dom,new kYt(t,e),!0)}function wIe(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var kYt=function(){function t(e,r){this.stopPropagation=zp,this.stopImmediatePropagation=zp,this.preventDefault=zp,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),Od={mousedown:function(t){t=yf(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=yf(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=yf(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=yf(this.dom,t);var e=t.toElement||t.relatedTarget;wIe(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){X0e=!0,t=yf(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){X0e||(t=yf(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=yf(this.dom,t),AH(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Od.mousemove.call(this,t),Od.mousedown.call(this,t)},touchmove:function(t){t=yf(this.dom,t),AH(t),this.handler.processGesture(t,"change"),Od.mousemove.call(this,t)},touchend:function(t){t=yf(this.dom,t),AH(t),this.handler.processGesture(t,"end"),Od.mouseup.call(this,t),+new Date-+this.__lastTouchMomenttge||t<-tge}var Wy=[],Xx=[],EH=Xf(),IH=Math.abs,Eg=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return p4(this.rotation)||p4(this.x)||p4(this.y)||p4(this.scaleX-1)||p4(this.scaleY-1)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&ege(n);return}n=n||Xf(),r?this.getLocalTransform(n):ege(n),e&&(r?Lg(n,e,n):are(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Wy);var n=Wy[0]<0?-1:1,i=Wy[1]<0?-1:1,a=((Wy[0]-n)*r+n)/Wy[0]||0,o=((Wy[1]-i)*r+i)/Wy[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Xf(),WS(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(Lg(Xx,e.invTransform,r),r=Xx);var n=this.originX,i=this.originY;(n||i)&&(EH[4]=n,EH[5]=i,Lg(Xx,r,EH),Xx[4]-=n,Xx[5]-=i,r=Xx),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],i=this.invTransform;return i&&us(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],i=this.transform;return i&&us(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&IH(e[0]-1)>1e-10&&IH(e[3]-1)>1e-10?Math.sqrt(IH(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){for(var r=this,n=0;np&&(p=b,gp&&(p=w,y=n.x&&e<=n.x+n.width&&r>=n.y&&r<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,n){if(!n){e!==r&&t.copy(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];e.x=r.x*i+o,e.y=r.y*a+s,e.width=r.width*i,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}qy.x=Ky.x=r.x,qy.y=Zy.y=r.y,Yy.x=Zy.x=r.x+r.width,Yy.y=Ky.y=r.y+r.height,qy.transform(n),Zy.transform(n),Yy.transform(n),Ky.transform(n),e.x=U7(qy.x,Yy.x,Ky.x,Zy.x),e.y=U7(qy.y,Yy.y,Ky.y,Zy.y);var l=z7(qy.x,Yy.x,Ky.x,Zy.x),c=z7(qy.y,Yy.y,Ky.y,Zy.y);e.width=l-e.x,e.height=c-e.y},t}(),nge={},x2="12px sans-serif",H7,ige;function OYt(t,e){return H7||(H7=G5().getContext("2d")),ige!==e&&(ige=H7.font=e||x2),H7.measureText(t)}var LYt={measureText:OYt};function pu(t,e){e=e||x2;var r=nge[e];r||(r=nge[e]=new i9(500));var n=r.get(t);return n==null&&(n=LYt.measureText(t,e).width,r.put(t,n)),n}function age(t,e,r,n){var i=pu(t,e),a=wB(e),o=hA(0,i,r),s=I_(0,a,n),l=new tn(o,s,i,a);return l}function a9(t,e,r,n){var i=((t||"")+"").split(` -`),a=i.length;if(a===1)return age(i[0],e,r,n);for(var o=new tn(0,0,0,0),s=0;s=0?parseFloat(t)/100*e:parseFloat(t):t}function lO(t,e,r){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,c=r.y,u="left",f="top";if(n instanceof Array)l+=Jf(n[0],r.width),c+=Jf(n[1],r.height),u=null,f=null;else switch(n){case"left":l-=i,c+=s,u="right",f="middle";break;case"right":l+=i+o,c+=s,f="middle";break;case"top":l+=o/2,c-=i,u="center",f="bottom";break;case"bottom":l+=o/2,c+=a+i,u="center";break;case"inside":l+=o/2,c+=s,u="center",f="middle";break;case"insideLeft":l+=i,c+=s,f="middle";break;case"insideRight":l+=o-i,c+=s,u="right",f="middle";break;case"insideTop":l+=o/2,c+=i,u="center";break;case"insideBottom":l+=o/2,c+=a-i,u="center",f="bottom";break;case"insideTopLeft":l+=i,c+=i;break;case"insideTopRight":l+=o-i,c+=i,u="right";break;case"insideBottomLeft":l+=i,c+=a-i,f="bottom";break;case"insideBottomRight":l+=o-i,c+=a-i,u="right",f="bottom";break}return t=t||{},t.x=l,t.y=c,t.align=u,t.verticalAlign=f,t}var kH="__zr_normal__",PH=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],$Yt={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},Jx={},BYt=new tn(0,0,0,0),bB=function(){function t(e){this.id=lIe(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var c=!1;if(a.copyTransform(r),n.position!=null){var u=BYt;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Jx,n,u):lO(Jx,n,u),a.x=Jx.x,a.y=Jx.y,o=Jx.align,s=Jx.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var d=void 0,h=void 0;f==="center"?(d=u.width*.5,h=u.height*.5):(d=Jf(f[0],u.width),h=Jf(f[1],u.height)),c=!0,a.originX=-a.x+d+(i?0:u.x),a.originY=-a.y+h+(i?0:u.y)}}n.rotation!=null&&(a.rotation=n.rotation);var p=n.offset;p&&(a.x+=p[0],a.y+=p[1],c||(a.originX=-p[0],a.originY=-p[1]));var g=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,m=void 0,b=void 0;g&&this.canBeInsideText()?(y=n.insideFill,m=n.insideStroke,(y==null||y==="auto")&&(y=this.getInsideTextFill()),(m==null||m==="auto")&&(m=this.getInsideTextStroke(y),b=!0)):(y=n.outsideFill,m=n.outsideStroke,(y==null||y==="auto")&&(y=this.getOutsideFill()),(m==null||m==="auto")&&(m=this.getOutsideStroke(y),b=!0)),y=y||"#000",(y!==v.fill||m!==v.stroke||b!==v.autoStroke||o!==v.align||s!==v.verticalAlign)&&(l=!0,v.fill=y,v.stroke=m,v.autoStroke=b,v.align=o,v.verticalAlign=s,r.setDefaultTextStyle(v)),r.__dirty|=iu,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?ZK:KK},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Zl(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Hp(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},st(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(dr(e))for(var n=e,i=Gn(n),a=0;a0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(kH,!1,e)},t.prototype.useState=function(e,r,n,i){var a=e===kH,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(en(s,e)>=0&&(r||s.length===1))){var c;if(this.stateProxy&&!a&&(c=this.stateProxy(e)),c||(c=this.states&&this.states[e]),!c&&!a){Dg("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(c);var u=!!(c&&c.hoverLayer||i);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,c,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,d=this._textGuide;return f&&f.useState(e,r,n,u),d&&d.useState(e,r,n,u),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~iu),c}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,p);var g=this._textContent,v=this._textGuide;g&&g.useStates(e,r,d),v&&v.useStates(e,r,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~iu)}},t.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var i=this.currentStates.slice(),a=en(i,e),o=en(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&i.push(r),this.useStates(i)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,i=n.length,a=[],o=0;o8)&&(i("position","_legacyPos","x","y"),i("scale","_legacyScale","scaleX","scaleY"),i("origin","_legacyOrigin","originX","originY"))}(),t}();xo(bB,ad);xo(bB,Eg);function RH(t,e,r,n,i){r=r||{};var a=[];xIe(t,"",t,e,r,n,a,i);var o=a.length,s=!1,l=r.done,c=r.aborted,u=function(){s=!0,o--,o<=0&&(s?l&&l():c&&c())},f=function(){o--,o<=0&&(s?l&&l():c&&c())};o||l&&l(),a.length>0&&r.during&&a[0].during(function(p,g){r.during(g)});for(var d=0;d0||i.force&&!o.length){for(var b=t.animators,w=[],C=0;C=0&&(i.splice(a,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var i=en(this._children,r);return i>=0&&this.replaceAt(n,i),this},e.prototype.replaceAt=function(r,n){var i=this._children,a=i[n];if(r&&r!==this&&r.parent!==this&&r!==a){i[n]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,i=this._children,a=en(i,r);return a<0?this:(i.splice(a,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.addHover=function(e){},t.prototype.removeHover=function(e){},t.prototype.clearHover=function(){},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},t.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.pathToImage=function(e,r){if(this.painter.pathToImage)return this.painter.pathToImage(e,r)},t.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this.handler.off(e,r)},t.prototype.trigger=function(e,r){this.handler.trigger(e,r)},t.prototype.clear=function(){for(var e=this.storage.getRoots(),r=0;r0){if(t<=i)return o;if(t>=a)return s}else{if(t>=i)return o;if(t<=a)return s}else{if(t===i)return o;if(t===a)return s}return(t-i)/l*c+o}function xt(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return typeof t=="string"?WYt(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function Bo(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),SIe),t=(+t).toFixed(e),r?t:+t}function Lf(t){return t.sort(function(e,r){return e-r}),t}function Cp(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return qYt(t)}function qYt(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,i=r>0?r:e.length,a=e.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function CIe(t,e){var r=Math.log,n=Math.LN10,i=Math.floor(r(t[1]-t[0])/n),a=Math.round(r(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function YYt(t,e,r){if(!t[e])return 0;var n=W5(t,function(p,g){return p+(isNaN(g)?0:g)},0);if(n===0)return 0;for(var i=Math.pow(10,r),a=ft(t,function(p){return(isNaN(p)?0:p)/n*i*100}),o=i*100,s=ft(a,function(p){return Math.floor(p)}),l=W5(s,function(p,g){return p+g},0),c=ft(a,function(p,g){return p-s[g]});lu&&(u=c[d],f=d);++s[f],c[f]=0,++l}return s[e]/i}function KYt(t,e){var r=Math.max(Cp(t),Cp(e)),n=t+e;return r>SIe?n:Bo(n,r)}var lge=9007199254740991;function AIe(t){var e=Math.PI*2;return(t%e+e)%e}function cO(t){return t>-sge&&t=10&&e++,e}function EIe(t,e){var r=TIe(t),n=Math.pow(10,r),i=t/n,a;return i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10,t=a*n,r>=-20?+t.toFixed(r<0?-r:0):t}function DH(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i}function cge(t){t.sort(function(l,c){return s(l,c,0)?-1:1});for(var e=-1/0,r=1,n=0;n=0||a&&en(a,l)<0)){var c=n.getShallow(l,e);c!=null&&(o[t[s][0]]=c)}}return o}}var xKt=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],_Kt=C2(xKt),SKt=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return _Kt(this,e,r)},t}(),XK=new i9(50);function CKt(t){if(typeof t=="string"){var e=XK.get(t);return e&&e.image}else return t}function ure(t,e,r,n,i){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=XK.get(t),o={hostEl:r,cb:n,cbPayload:i};return a?(e=a.image,!_B(e)&&a.pending.push(o)):(e=new Image,e.onload=e.onerror=AKt,XK.put(t,e.__cachedImgObj={image:e,pending:[o]}),e.src=e.__zrImageSrc=t),e}else return t;else return e}function AKt(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var c=pu(r,e);return c>s&&(r="",c=0),s=t-c,i.ellipsis=r,i.ellipsisWidth=c,i.contentWidth=s,i.containerWidth=t,i}function jIe(t,e){var r=e.containerWidth,n=e.font,i=e.contentWidth;if(!r)return"";var a=pu(t,n);if(a<=r)return t;for(var o=0;;o++){if(a<=i||o>=e.maxIterations){t+=e.ellipsis;break}var s=o===0?EKt(t,i,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*i/a):0;t=t.substr(0,s),a=pu(t,n)}return t===""&&(t=e.placeholder),t}function EKt(t,e,r,n){for(var i=0,a=0,o=t.length;ad&&l){var h=Math.floor(d/s);u=u.slice(0,h)}var p=d,g=c;if(n&&(p+=n[0]+n[2],g!=null&&(g+=n[1]+n[3])),t&&a&&g!=null)for(var v=FIe(c,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),y=0;ys&&OH(r,t.substring(s,c),e,o),OH(r,l[2],e,o,l[1]),s=NH.lastIndex}si){C>0?(m.tokens=m.tokens.slice(0,C),v(m,w,b),r.lines=r.lines.slice(0,y+1)):r.lines=r.lines.slice(0,y);break e}var P=S.width,x=P==null||P==="auto";if(typeof P=="string"&&P.charAt(P.length-1)==="%")A.percentWidth=P,u.push(A),A.contentWidth=pu(A.text,L);else{if(x){var T=S.backgroundColor,E=T&&T.image;E&&(E=CKt(E),_B(E)&&(A.width=Math.max(A.width,E.width*O/E.height)))}var N=p&&n!=null?n-w:null;N!=null&&N0&&p+n.accumWidth>n.width&&(u=e.split(` -`),c=!0),n.accumWidth=p}else{var g=UIe(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=g.accumWidth+h,f=g.linesWidths,u=g.lines}}else u=e.split(` -`);for(var v=0;v=33&&e<=255}var DKt=W5(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function NKt(t){return MKt(t)?!!DKt[t]:!0}function UIe(t,e,r,n,i){for(var a=[],o=[],s="",l="",c=0,u=0,f=0;fr:i+u+h>r){u?(s||l)&&(p?(s||(s=l,l="",c=0,u=c),a.push(s),o.push(u-c),l+=d,c+=h,s="",u=c):(l&&(s+=l,u+=c,l="",c=0),a.push(s),o.push(u),s=d,u=h)):p?(a.push(l),o.push(c),l=d,c=h):(a.push(d),o.push(h));continue}u+=h,p?(l+=d,c+=h):(l&&(s+=l,l="",c=0),s+=d)}return!a.length&&!s&&(s=t,l="",c=0),l&&(s+=l),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}var JK="__zr_style_"+Math.round(Math.random()*10),xb={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},SB={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};xb[JK]=!0;var hge=["z","z2","invisible"],OKt=["invisible"],sh=function(t){hi(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=Gn(r),i=0;i-uO&&tuO||t<-uO}function ka(t,e,r,n,i){var a=1-i;return a*a*(a*t+3*i*e)+i*i*(i*n+3*a*r)}function gge(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)}function eZ(t,e,r,n,i,a){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),c=t-i,u=s*s-3*o*l,f=s*l-9*o*c,d=l*l-3*s*c,h=0;if(Zm(u)&&Zm(f))if(Zm(s))a[0]=0;else{var p=-l/s;p>=0&&p<=1&&(a[h++]=p)}else{var g=f*f-4*u*d;if(Zm(g)){var v=f/u,p=-s/o+v,y=-v/2;p>=0&&p<=1&&(a[h++]=p),y>=0&&y<=1&&(a[h++]=y)}else if(g>0){var m=y1(g),b=u*s+1.5*o*(-f+m),w=u*s+1.5*o*(-f-m);b<0?b=-V7(-b,G7):b=V7(b,G7),w<0?w=-V7(-w,G7):w=V7(w,G7);var p=(-s-(b+w))/(3*o);p>=0&&p<=1&&(a[h++]=p)}else{var C=(2*u*s-3*o*f)/(2*y1(u*u*u)),A=Math.acos(C)/3,S=y1(u),I=Math.cos(A),p=(-s-2*S*I)/(3*o),y=(-s+S*(I+pge*Math.sin(A)))/(3*o),D=(-s+S*(I-pge*Math.sin(A)))/(3*o);p>=0&&p<=1&&(a[h++]=p),y>=0&&y<=1&&(a[h++]=y),D>=0&&D<=1&&(a[h++]=D)}}return h}function VIe(t,e,r,n,i){var a=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(Zm(o)){if(HIe(a)){var c=-s/a;c>=0&&c<=1&&(i[l++]=c)}}else{var u=a*a-4*o*s;if(Zm(u))i[0]=-a/(2*o);else if(u>0){var f=y1(u),c=(-a+f)/(2*o),d=(-a-f)/(2*o);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function q1(t,e,r,n,i,a){var o=(e-t)*i+t,s=(r-e)*i+e,l=(n-r)*i+r,c=(s-o)*i+o,u=(l-s)*i+s,f=(u-c)*i+c;a[0]=t,a[1]=o,a[2]=c,a[3]=f,a[4]=f,a[5]=u,a[6]=l,a[7]=n}function GIe(t,e,r,n,i,a,o,s,l,c,u){var f,d=.005,h=1/0,p,g,v,y;xp[0]=l,xp[1]=c;for(var m=0;m<1;m+=.05)Ef[0]=ka(t,r,i,o,m),Ef[1]=ka(e,n,a,s,m),v=bb(xp,Ef),v=0&&v=0&&c<=1&&(i[l++]=c)}}else{var u=o*o-4*a*s;if(Zm(u)){var c=-o/(2*a);c>=0&&c<=1&&(i[l++]=c)}else if(u>0){var f=y1(u),c=(-o+f)/(2*a),d=(-o-f)/(2*a);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function WIe(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function _E(t,e,r,n,i){var a=(e-t)*n+t,o=(r-e)*n+e,s=(o-a)*n+a;i[0]=t,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function qIe(t,e,r,n,i,a,o,s,l){var c,u=.005,f=1/0;xp[0]=o,xp[1]=s;for(var d=0;d<1;d+=.05){Ef[0]=ns(t,r,i,d),Ef[1]=ns(e,n,a,d);var h=bb(xp,Ef);h=0&&h1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(W7[0]=FH(i)*r+t,W7[1]=BH(i)*n+e,q7[0]=FH(a)*r+t,q7[1]=BH(a)*n+e,c(s,W7,q7),u(l,W7,q7),i=i%Xy,i<0&&(i=i+Xy),a=a%Xy,a<0&&(a=a+Xy),i>a&&!o?a+=Xy:ii&&(Y7[0]=FH(h)*r+t,Y7[1]=BH(h)*n+e,c(s,Y7,s),u(l,Y7,l))}var Ci={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Jy=[],ew=[],Zh=[],Qv=[],Qh=[],Xh=[],m4=Math.min,y4=Math.max,tw=Math.cos,rw=Math.sin,K7=Math.sqrt,eg=Math.abs,rZ=Math.PI,cm=rZ*2,jH=typeof Float32Array<"u",w4=[];function UH(t){var e=Math.round(t/rZ*1e8)/1e8;return e%2*rZ}function YIe(t,e){var r=UH(t[0]);r<0&&(r+=cm);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=cm?i=r+cm:e&&r-i>=cm?i=r-cm:!e&&r>i?i=r+(cm-UH(r-i)):e&&r0&&(this._ux=eg(n/sO/e)||0,this._uy=eg(n/sO/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(Ci.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=eg(e-this._xi),i=eg(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Ci.L,e,r),this._ctx&&a&&(this._needsDash?this._dashedLineTo(e,r):this._ctx.lineTo(e,r)),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,i,a,o){return this._drawPendingPt(),this.addData(Ci.C,e,r,n,i,a,o),this._ctx&&(this._needsDash?this._dashedBezierTo(e,r,n,i,a,o):this._ctx.bezierCurveTo(e,r,n,i,a,o)),this._xi=a,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,i){return this._drawPendingPt(),this.addData(Ci.Q,e,r,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(e,r,n,i):this._ctx.quadraticCurveTo(e,r,n,i)),this._xi=n,this._yi=i,this},t.prototype.arc=function(e,r,n,i,a,o){this._drawPendingPt(),w4[0]=i,w4[1]=a,YIe(w4,o),i=w4[0],a=w4[1];var s=a-i;return this.addData(Ci.A,e,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,o),this._xi=tw(a)*n+e,this._yi=rw(a)*n+r,this},t.prototype.arcTo=function(e,r,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,i,a),this},t.prototype.rect=function(e,r,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,i),this.addData(Ci.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ci.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&(this._needsDash&&this._dashedLineTo(r,n),e.closePath()),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.setLineDash=function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var r=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r0&&d<=e||c<0&&d>=e||c===0&&(u>0&&h<=r||u<0&&h>=r);)v=this._dashIdx,g=i[v],d+=c*g,h+=u*g,this._dashIdx=(v+1)%p,!(c>0&&ds||u>0&&hl)&&a[v%2?"moveTo":"lineTo"](c>=0?m4(d,e):y4(d,e),u>=0?m4(h,r):y4(h,r));c=d-e,u=h-r,this._dashOffset=-K7(c*c+u*u)},t.prototype._dashedBezierTo=function(e,r,n,i,a,o){var s=this._ctx,l=this._dashSum,c=this._dashOffset,u=this._lineDash,f=this._xi,d=this._yi,h=0,p=this._dashIdx,g=u.length,v,y,m,b,w,C=0;for(c<0&&(c=l+c),c%=l,v=0;v<1;v+=.1)y=ka(f,e,n,a,v+.1)-ka(f,e,n,a,v),m=ka(d,r,i,o,v+.1)-ka(d,r,i,o,v),h+=K7(y*y+m*m);for(;pc));p++);for(v=(C-c)/h;v<=1;)b=ka(f,e,n,a,v),w=ka(d,r,i,o,v),p%2?s.moveTo(b,w):s.lineTo(b,w),v+=u[p]/h,p=(p+1)%g;p%2!==0&&s.lineTo(a,o),y=a-b,m=o-w,this._dashOffset=-K7(y*y+m*m)},t.prototype._dashedQuadraticTo=function(e,r,n,i){var a=n,o=i;n=(n+2*e)/3,i=(i+2*r)/3,e=(this._xi+2*e)/3,r=(this._yi+2*r)/3,this._dashedBezierTo(e,r,n,i,a,o)},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,jH&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Zh[0]=Zh[1]=Qh[0]=Qh[1]=Number.MAX_VALUE,Qv[0]=Qv[1]=Xh[0]=Xh[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||eg(b)>i||d===r-1)&&(g=Math.sqrt(m*m+b*b),a=v,o=y);break}case Ci.C:{var w=e[d++],C=e[d++],v=e[d++],y=e[d++],A=e[d++],S=e[d++];g=$Kt(a,o,w,C,v,y,A,S,10),a=A,o=S;break}case Ci.Q:{var w=e[d++],C=e[d++],v=e[d++],y=e[d++];g=FKt(a,o,w,C,v,y,10),a=v,o=y;break}case Ci.A:var I=e[d++],D=e[d++],L=e[d++],O=e[d++],P=e[d++],x=e[d++],T=x+P;d+=1,e[d++],p&&(s=tw(P)*L+I,l=rw(P)*O+D),g=y4(L,O)*m4(cm,Math.abs(x)),a=tw(T)*L+I,o=rw(T)*O+D;break;case Ci.R:{s=a=e[d++],l=o=e[d++];var E=e[d++],N=e[d++];g=E*2+N*2;break}case Ci.Z:{var m=s-a,b=l-o;g=Math.sqrt(m*m+b*b),a=s,o=l;break}}g>=0&&(c[f++]=g,u+=g)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,r){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,c,u,f,d,h=r<1,p,g,v=0,y=0,m,b=0,w,C;if(!(h&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,g=this._pathLen,m=r*g,!m)))e:for(var A=0;A0&&(e.lineTo(w,C),b=0),S){case Ci.M:s=c=n[A++],l=u=n[A++],e.moveTo(c,u);break;case Ci.L:{f=n[A++],d=n[A++];var D=eg(f-c),L=eg(d-u);if(D>i||L>a){if(h){var O=p[y++];if(v+O>m){var P=(m-v)/O;e.lineTo(c*(1-P)+f*P,u*(1-P)+d*P);break e}v+=O}e.lineTo(f,d),c=f,u=d,b=0}else{var x=D*D+L*L;x>b&&(w=f,C=d,b=x)}break}case Ci.C:{var T=n[A++],E=n[A++],N=n[A++],F=n[A++],B=n[A++],j=n[A++];if(h){var O=p[y++];if(v+O>m){var P=(m-v)/O;q1(c,T,N,B,P,Jy),q1(u,E,F,j,P,ew),e.bezierCurveTo(Jy[1],ew[1],Jy[2],ew[2],Jy[3],ew[3]);break e}v+=O}e.bezierCurveTo(T,E,N,F,B,j),c=B,u=j;break}case Ci.Q:{var T=n[A++],E=n[A++],N=n[A++],F=n[A++];if(h){var O=p[y++];if(v+O>m){var P=(m-v)/O;_E(c,T,N,P,Jy),_E(u,E,F,P,ew),e.quadraticCurveTo(Jy[1],ew[1],Jy[2],ew[2]);break e}v+=O}e.quadraticCurveTo(T,E,N,F),c=N,u=F;break}case Ci.A:var k=n[A++],$=n[A++],H=n[A++],Y=n[A++],ie=n[A++],W=n[A++],Q=n[A++],J=!n[A++],ee=H>Y?H:Y,ne=eg(H-Y)>.001,V=ie+W,oe=!1;if(h){var O=p[y++];v+O>m&&(V=ie+W*(m-v)/O,oe=!0),v+=O}if(ne&&e.ellipse?e.ellipse(k,$,H,Y,Q,ie,V,J):e.arc(k,$,ee,ie,V,J),oe)break e;I&&(s=tw(ie)*H+k,l=rw(ie)*Y+$),c=tw(V)*H+k,u=rw(V)*Y+$;break;case Ci.R:s=c=n[A],l=u=n[A+1],f=n[A++],d=n[A++];var ye=n[A++],Te=n[A++];if(h){var O=p[y++];if(v+O>m){var Me=m-v;e.moveTo(f,d),e.lineTo(f+m4(Me,ye),d),Me-=ye,Me>0&&e.lineTo(f+ye,d+m4(Me,Te)),Me-=Te,Me>0&&e.lineTo(f+y4(ye-Me,0),d+Te),Me-=ye,Me>0&&e.lineTo(f,d+y4(Te-Me,0));break e}v+=O}e.rect(f,d,ye,Te);break;case Ci.Z:if(h){var O=p[y++];if(v+O>m){var P=(m-v)/O;e.lineTo(c*(1-P)+s*P,u*(1-P)+l*P);break e}v+=O}e.closePath(),c=s,u=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=Ci,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._needsDash=!1,e._dashOffset=0,e._dashIdx=0,e._dashSum=0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function bm(t,e,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,c=t;if(o>e+s&&o>n+s||ot+s&&a>r+s||ae+f&&u>n+f&&u>a+f&&u>s+f||ut+f&&c>r+f&&c>i+f&&c>o+f||ce+c&&l>n+c&&l>a+c||lt+c&&s>r+c&&s>i+c||sr||u+ci&&(i+=b4);var d=Math.atan2(l,s);return d<0&&(d+=b4),d>=n&&d<=i||d+b4>=n&&d+b4<=i}function dg(t,e,r,n,i,a){if(a>e&&a>n||ai?s:0}var Xv=hv.CMD,nw=Math.PI*2,GKt=1e-4;function WKt(t,e){return Math.abs(t-e)e&&c>n&&c>a&&c>s||c1&&qKt(),h=ka(e,n,a,s,_f[0]),d>1&&(p=ka(e,n,a,s,_f[1]))),d===2?v<_f[0]?f+=he&&s>n&&s>a||s=0&&c<=1){for(var u=0,f=ns(e,n,a,c),d=0;dr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Nl[0]=-l,Nl[1]=l;var c=Math.abs(n-i);if(c<1e-4)return 0;if(c>=nw-1e-4){n=0,i=nw;var u=a?1:-1;return o>=Nl[0]+t&&o<=Nl[1]+t?u:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=nw,i+=nw);for(var d=0,h=0;h<2;h++){var p=Nl[h];if(p+t>o){var g=Math.atan2(s,p),u=a?1:-1;g<0&&(g=nw+g),(g>=n&&g<=i||g+nw>=n&&g+nw<=i)&&(g>Math.PI/2&&g1&&(r||(s+=dg(l,c,u,f,n,i))),v&&(l=a[p],c=a[p+1],u=l,f=c),g){case Xv.M:u=a[p++],f=a[p++],l=u,c=f;break;case Xv.L:if(r){if(bm(l,c,a[p],a[p+1],e,n,i))return!0}else s+=dg(l,c,a[p],a[p+1],n,i)||0;l=a[p++],c=a[p++];break;case Xv.C:if(r){if(HKt(l,c,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],e,n,i))return!0}else s+=YKt(l,c,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],n,i)||0;l=a[p++],c=a[p++];break;case Xv.Q:if(r){if(KIe(l,c,a[p++],a[p++],a[p],a[p+1],e,n,i))return!0}else s+=KKt(l,c,a[p++],a[p++],a[p],a[p+1],n,i)||0;l=a[p++],c=a[p++];break;case Xv.A:var y=a[p++],m=a[p++],b=a[p++],w=a[p++],C=a[p++],A=a[p++];p+=1;var S=!!(1-a[p++]);d=Math.cos(C)*b+y,h=Math.sin(C)*w+m,v?(u=d,f=h):s+=dg(l,c,d,h,n,i);var I=(n-y)*w/b+y;if(r){if(VKt(y,m,w,C,C+A,S,e,I,i))return!0}else s+=ZKt(y,m,w,C,C+A,S,I,i);l=Math.cos(C+A)*b+y,c=Math.sin(C+A)*w+m;break;case Xv.R:u=l=a[p++],f=c=a[p++];var D=a[p++],L=a[p++];if(d=u+D,h=f+L,r){if(bm(u,f,d,f,e,n,i)||bm(d,f,d,h,e,n,i)||bm(d,h,u,h,e,n,i)||bm(u,h,u,f,e,n,i))return!0}else s+=dg(d,f,d,h,n,i),s+=dg(u,h,u,f,n,i);break;case Xv.Z:if(r){if(bm(l,c,u,f,e,n,i))return!0}else s+=dg(l,c,u,f,n,i);l=u,c=f;break}}return!r&&!WKt(c,f)&&(s+=dg(l,c,u,f,n,i)||0),s!==0}function QKt(t,e,r){return ZIe(t,0,!1,e,r)}function XKt(t,e,r,n){return ZIe(t,e,!0,r,n)}var QIe=tr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},xb),JKt={style:tr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},SB.style)},zH=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],rn=function(t){hi(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){r.buildPath(l,r.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?KK:n>.2?DYt:ZK}else if(r)return ZK}return KK},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(En(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=oO(r,0)0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,i=!r;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&E_)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectWithStroke||(this._rectWithStroke=r.clone());if(this.__dirty||i){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,c=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;c=Math.max(c,u??4)}l>1e-10&&(s.width+=c/l,s.height+=c/l,s.x-=c/l/2,s.y-=c/l/2)}return s}return r},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,c=o.strokeNoScale?this.getLineScale():1;if(c>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),XKt(s,l/c,r,n)))return!0}if(this.hasFill())return QKt(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=E_,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var i=this.shape;return i||(i=this.shape={}),typeof r=="string"?i[r]=n:st(i,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&E_)},e.prototype.createStyle=function(r){return r9(QIe,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=st({},this.shape))},e.prototype._applyStateObj=function(r,n,i,a,o,s){t.prototype._applyStateObj.call(this,r,n,i,a,o,s);var l=!(n&&a),c;if(n&&n.shape?o?a?c=n.shape:(c=st({},i.shape),st(c,n.shape)):(c=st({},a?this.shape:i.shape),st(c,n.shape)):l&&(c=i.shape),c)if(o){this.shape=st({},this.shape);for(var u={},f=Gn(c),d=0;d0},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(r){return r9(eZt,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var n=r.text;n!=null?n+="":n="";var i=a9(n,r.font,r.textAlign,r.textBaseline);if(i.x+=r.x||0,i.y+=r.y||0,this.hasStroke()){var a=r.lineWidth;i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a}this._rect=i}return this._rect},e.initDefaultProps=function(){var r=e.prototype;r.dirtyRectTolerance=10}(),e}(sh);A2.prototype.type="tspan";var tZt=tr({x:0,y:0},xb),rZt={style:tr({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},SB.style)};function nZt(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var Io=function(t){hi(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return r9(tZt,r)},e.prototype._getSize=function(r){var n=this.style,i=n[r];if(i!=null)return i;var a=nZt(n.image)?n.image:this.__image;if(!a)return 0;var o=r==="width"?"height":"width",s=n[o];return s==null?a[r]:a[r]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return rZt},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new tn(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e}(sh);Io.prototype.type="image";function iZt(t,e){var r=e.x,n=e.y,i=e.width,a=e.height,o=e.r,s,l,c,u;i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),typeof o=="number"?s=l=c=u=o:o instanceof Array?o.length===1?s=l=c=u=o[0]:o.length===2?(s=c=o[0],l=u=o[1]):o.length===3?(s=o[0],l=u=o[1],c=o[2]):(s=o[0],l=o[1],c=o[2],u=o[3]):s=l=c=u=0;var f;s+l>i&&(f=s+l,s*=i/f,l*=i/f),c+u>i&&(f=c+u,c*=i/f,u*=i/f),l+c>a&&(f=l+c,l*=a/f,c*=a/f),s+u>a&&(f=s+u,s*=a/f,u*=a/f),t.moveTo(r+s,n),t.lineTo(r+i-l,n),l!==0&&t.arc(r+i-l,n+l,l,-Math.PI/2,0),t.lineTo(r+i,n+a-c),c!==0&&t.arc(r+i-c,n+a-c,c,0,Math.PI/2),t.lineTo(r+u,n+a),u!==0&&t.arc(r+u,n+a-u,u,Math.PI/2,Math.PI),t.lineTo(r,n+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var Z_=Math.round;function XIe(t,e,r){if(e){var n=e.x1,i=e.x2,a=e.y1,o=e.y2;t.x1=n,t.x2=i,t.y1=a,t.y2=o;var s=r&&r.lineWidth;return s&&(Z_(n*2)===Z_(i*2)&&(t.x1=t.x2=Jw(n,s,!0)),Z_(a*2)===Z_(o*2)&&(t.y1=t.y2=Jw(a,s,!0))),t}}function JIe(t,e,r){if(e){var n=e.x,i=e.y,a=e.width,o=e.height;t.x=n,t.y=i,t.width=a,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=Jw(n,s,!0),t.y=Jw(i,s,!0),t.width=Math.max(Jw(n+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Jw(i+o,s,!1)-t.y,o===0?0:1)),t}}function Jw(t,e,r){if(!e)return t;var n=Z_(t*2);return(n+Z_(e))%2===0?n/2:(n+(r?1:-1))/2}var aZt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),oZt={},In=function(t){hi(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new aZt},e.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=JIe(oZt,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?iZt(r,n):r.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(rn);In.prototype.type="rect";var bge={fill:"#000"},xge=2,sZt={style:tr({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},SB.style)},Bn=function(t){hi(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=bge,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,O=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),P=o.calculatedLineHeight,x=0;x=0&&(T=A[x],T.align==="right");)this._placeToken(T,r,I,y,P,"right",b),D-=T.width,P-=T.width,x--;for(O+=(a-(O-v)-(m-P)-D)/2;L<=x;)T=A[L],this._placeToken(T,r,I,y,O+T.width/2,"center",b),O+=T.width,L++;y+=I}},e.prototype._placeToken=function(r,n,i,a,o,s,l){var c=n.rich[r.styleName]||{};c.text=r.text;var u=r.verticalAlign,f=a+i/2;u==="top"?f=a+r.height/2:u==="bottom"&&(f=a+i-r.height/2);var d=!r.isLineHolder&&HH(c);d&&this._renderBackground(c,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var h=!!c.backgroundColor,p=r.textPadding;p&&(o=Age(o,s,p),f-=r.height/2-p[0]-r.innerHeight/2);var g=this._getOrCreateChild(A2),v=g.createStyle();g.useStyle(v);var y=this._defaultStyle,m=!1,b=0,w=Cge("fill"in c?c.fill:"fill"in n?n.fill:(m=!0,y.fill)),C=Sge("stroke"in c?c.stroke:"stroke"in n?n.stroke:!h&&!l&&(!y.autoStroke||m)?(b=xge,y.stroke):null),A=c.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=o,v.y=f,A&&(v.shadowBlur=c.textShadowBlur||n.textShadowBlur||0,v.shadowColor=c.textShadowColor||n.textShadowColor||"transparent",v.shadowOffsetX=c.textShadowOffsetX||n.textShadowOffsetX||0,v.shadowOffsetY=c.textShadowOffsetY||n.textShadowOffsetY||0),v.textAlign=s,v.textBaseline="middle",v.font=r.font||x2,v.opacity=Ng(c.opacity,n.opacity,1),C&&(v.lineWidth=Ng(c.lineWidth,n.lineWidth,b),v.lineDash=Cn(c.lineDash,n.lineDash),v.lineDashOffset=n.lineDashOffset||0,v.stroke=C),w&&(v.fill=w);var S=r.contentWidth,I=r.contentHeight;g.setBoundingRect(new tn(hA(v.x,S,v.textAlign),I_(v.y,I,v.textBaseline),S,I))},e.prototype._renderBackground=function(r,n,i,a,o,s){var l=r.backgroundColor,c=r.borderWidth,u=r.borderColor,f=l&&l.image,d=l&&!f,h=r.borderRadius,p=this,g,v;if(d||r.lineHeight||c&&u){g=this._getOrCreateChild(In),g.useStyle(g.createStyle()),g.style.fill=null;var y=g.shape;y.x=i,y.y=a,y.width=o,y.height=s,y.r=h,g.dirtyShape()}if(d){var m=g.style;m.fill=l||null,m.fillOpacity=Cn(r.fillOpacity,1)}else if(f){v=this._getOrCreateChild(Io),v.onload=function(){p.dirtyStyle()};var b=v.style;b.image=l.image,b.x=i,b.y=a,b.width=o,b.height=s}if(c&&u){var m=g.style;m.lineWidth=c,m.stroke=u,m.strokeOpacity=Cn(r.strokeOpacity,1),m.lineDash=r.borderDash,m.lineDashOffset=r.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var w=(g||v).style;w.shadowBlur=r.shadowBlur||0,w.shadowColor=r.shadowColor||"transparent",w.shadowOffsetX=r.shadowOffsetX||0,w.shadowOffsetY=r.shadowOffsetY||0,w.opacity=Ng(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";if(r.fontSize||r.fontFamily||r.fontWeight){var i="";typeof r.fontSize=="string"&&(r.fontSize.indexOf("px")!==-1||r.fontSize.indexOf("rem")!==-1||r.fontSize.indexOf("em")!==-1)?i=r.fontSize:isNaN(+r.fontSize)?i="12px":i=r.fontSize+"px",n=[r.fontStyle,r.fontWeight,i,r.fontFamily||"sans-serif"].join(" ")}return n&&dx(n)||r.textFont||r.font},e}(sh),lZt={left:!0,right:1,center:1},cZt={top:1,bottom:1,middle:1};function uZt(t){return _ge(t),te(t.rich,_ge),t}function _ge(t){if(t){t.font=Bn.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||lZt[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||cZt[r]?r:"top";var n=t.padding;n&&(t.padding=ere(t.padding))}}function Sge(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function Cge(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function Age(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function Tge(t){var e=t.text;return e!=null&&(e+=""),e}function HH(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var br=qn(),nZ=function(t,e,r,n){if(n){var i=br(n);i.dataIndex=r,i.dataType=e,i.seriesIndex=t,n.type==="group"&&n.traverse(function(a){var o=br(a);o.seriesIndex=t,o.dataIndex=r,o.dataType=e})}},Ege=1,Ige={},e7e=qn(),fre=0,l9=1,CB=2,Ql=["emphasis","blur","select"],SE=["normal","emphasis","blur","select"],YS=10,fZt=9,_b="highlight",hM="downplay",u6="select",pM="unselect",f6="toggleSelect";function e_(t){return t!=null&&t!=="none"}var kge=new i9(100);function Pge(t){if(typeof t!="string")return t;var e=kge.get(t);return e||(e=mIe(t,-.1),kge.put(t,e)),e}function AB(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function t7e(t){AB(t,"emphasis",CB)}function r7e(t){t.hoverState===CB&&AB(t,"normal",fre)}function dre(t){AB(t,"blur",l9)}function n7e(t){t.hoverState===l9&&AB(t,"normal",fre)}function dZt(t){t.selected=!0}function hZt(t){t.selected=!1}function Rge(t,e,r){e(t,r)}function Iv(t,e,r){Rge(t,e,r),t.isGroup&&t.traverse(function(n){Rge(n,e,r)})}function fO(t,e){switch(e){case"emphasis":t.hoverState=CB;break;case"normal":t.hoverState=fre;break;case"blur":t.hoverState=l9;break;case"select":t.selected=!0}}function pZt(t,e,r,n){for(var i=t.style,a={},o=0;o=0,a=!1;if(t instanceof rn){var o=e7e(t),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(e_(s)||e_(l)){n=n||{};var c=n.style||{};c.fill==="inherit"?(a=!0,n=st({},n),c=st({},c),c.fill=s):!e_(c.fill)&&e_(s)?(a=!0,n=st({},n),c=st({},c),c.fill=Pge(s)):!e_(c.stroke)&&e_(l)&&(a||(n=st({},n),c=st({},c)),c.stroke=Pge(l)),n.style=c}}if(n&&n.z2==null){a||(n=st({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(u??YS)}return n}function vZt(t,e,r){if(r&&r.z2==null){r=st({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??fZt)}return r}function mZt(t,e,r){var n=en(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:pZt(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=st({},r),o=st({opacity:n?i:a.opacity*.1},o),r.style=o),r}function VH(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return gZt(this,t,e,r);if(t==="blur")return mZt(this,t,r);if(t==="select")return vZt(this,t,r)}return r}function T2(t){t.stateProxy=VH;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=VH),r&&(r.stateProxy=VH)}function Mge(t,e){!l7e(t,e)&&!t.__highByOuter&&Iv(t,t7e)}function Dge(t,e){!l7e(t,e)&&!t.__highByOuter&&Iv(t,r7e)}function Vp(t,e){t.__highByOuter|=1<<(e||0),Iv(t,t7e)}function Gp(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Iv(t,r7e)}function i7e(t){Iv(t,dre)}function a7e(t){Iv(t,n7e)}function o7e(t){Iv(t,dZt)}function s7e(t){Iv(t,hZt)}function l7e(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function c7e(t){var e=t.getModel();e.eachComponent(function(r,n){var i=r==="series"?t.getViewOfSeriesModel(n):t.getViewOfComponentModel(n);i.group.traverse(function(a){n7e(a)})})}function iZ(t,e,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(c,u){for(var f=0;f0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Ri(t,e,r){Q_(t,!0),Iv(t,T2),oZ(t,e,r)}function oZ(t,e,r){var n=br(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var Oge=["emphasis","blur","select"],SZt={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Os(t,e,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=WH(p),s*=WH(p));var g=(i===a?-1:1)*WH((o*o*(s*s)-o*o*(h*h)-s*s*(d*d))/(o*o*(h*h)+s*s*(d*d)))||0,v=g*o*h/s,y=g*-s*d/o,m=(t+r)/2+Q7(f)*v-Z7(f)*y,b=(e+n)/2+Z7(f)*v+Q7(f)*y,w=Bge([1,0],[(d-v)/o,(h-y)/s]),C=[(d-v)/o,(h-y)/s],A=[(-1*d-v)/o,(-1*h-y)/s],S=Bge(C,A);if(lZ(C,A)<=-1&&(S=x4),lZ(C,A)>=1&&(S=0),S<0){var I=Math.round(S/x4*1e6)/1e6;S=x4*2+I%2*x4}u.addData(c,m,b,o,s,w,S,f,a)}var kZt=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,PZt=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function RZt(t){var e=new hv;if(!t)return e;var r=0,n=0,i=r,a=n,o,s=hv.CMD,l=t.match(kZt);if(!l)return e;for(var c=0;cT*T+E*E&&(I=L,D=O),{cx:I,cy:D,x01:-u,y01:-f,x11:I*(i/C-1),y11:D*(i/C-1)}}function FZt(t,e){var r=cZ(e.r,0),n=cZ(e.r0||0,0),i=r>0,a=n>0;if(!(!i&&!a)){if(i||(r=n,n=0),n>r){var o=r;r=n,n=o}var s=!!e.clockwise,l=e.startAngle,c=e.endAngle,u;if(l===c)u=0;else{var f=[l,c];YIe(f,!s),u=jge(f[0]-f[1])}var d=e.cx,h=e.cy,p=e.cornerRadius||0,g=e.innerCornerRadius||0;if(!(r>Nd))t.moveTo(d,h);else if(u>LZt-Nd)t.moveTo(d+r*r_(l),h+r*iw(l)),t.arc(d,h,r,l,c,!s),n>Nd&&(t.moveTo(d+n*r_(c),h+n*iw(c)),t.arc(d,h,n,c,l,s));else{var v=jge(r-n)/2,y=X7(v,p),m=X7(v,g),b=m,w=y,C=r*r_(l),A=r*iw(l),S=n*r_(c),I=n*iw(c),D=void 0,L=void 0,O=void 0,P=void 0;if((y>Nd||m>Nd)&&(D=r*r_(c),L=r*iw(c),O=n*r_(l),P=n*iw(l),uNd))t.moveTo(d+C,h+A);else if(w>Nd){var k=J7(O,P,C,A,r,w,s),$=J7(D,L,S,I,r,w,s);t.moveTo(d+k.cx+k.x01,h+k.cy+k.y01),wNd)||!(u>Nd))t.lineTo(d+S,h+I);else if(b>Nd){var k=J7(S,I,D,L,n,-b,s),$=J7(C,A,O,P,n,-b,s);t.lineTo(d+k.cx+k.x01,h+k.cy+k.y01),br-2?r-1:l+1],h=t[l>r-3?r-1:l+2]);var p=c*c,g=c*p;n.push([Uge(u[0],f[0],d[0],h[0],c,p,g),Uge(u[1],f[1],d[1],h[1],c,p,g)])}return n}function HZt(t,e,r,n){var i=[],a=[],o=[],s=[],l,c,u,f;if(n){u=[1/0,1/0],f=[-1/0,-1/0];for(var d=0,h=t.length;d=2){if(n&&n!=="spline"){var a=HZt(i,n,r,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],c=a[s*2+1],u=i[(s+1)%o];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{n==="spline"&&(i=zZt(i,r)),t.moveTo(i[0][0],i[0][1]);for(var s=1,f=i.length;sow[1]){if(s=!1,a)return s;var u=Math.abs(ow[0]-aw[1]),f=Math.abs(aw[0]-ow[1]);Math.min(u,f)>i.len()&&(u0){var f=u.duration,d=u.delay,h=u.easing,p={duration:f,delay:d||0,easing:h,done:a,force:!!a||!!o,setToFinal:!c,scope:t,during:o};s?e.animateFrom(r,p):e.animateTo(r,p)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),a&&a()}function Mn(t,e,r,n,i,a){gre("update",t,e,r,n,i,a)}function la(t,e,r,n,i,a){gre("init",t,e,r,n,i,a)}function A3(t){if(!t.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Vge(t){return!t.isGroup}function nQt(t){return t.shape!=null}function f9(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){Vge(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return nQt(o)&&(s.shape=st({},o.shape)),s}var a=n(t);e.traverse(function(o){if(Vge(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),Mn(o,l,r,br(o).dataIndex)}}})}function C7e(t,e){return ft(t,function(r){var n=r[0];n=pO(n,e.x),n=gO(n,e.x+e.width);var i=r[1];return i=pO(i,e.y),i=gO(i,e.y+e.height),[n,i]})}function iQt(t,e){var r=pO(t.x,e.x),n=gO(t.x+t.width,e.x+e.width),i=pO(t.y,e.y),a=gO(t.y+t.height,e.y+e.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}}function d9(t,e,r){var n=st({rectHover:!0},e),i=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(i.image=t.slice(8),tr(i,r),new Io(n)):PB(t.replace("path://",""),n,r,"center")}function gA(t,e,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var v=qH(h,p,u,f)/d;return!(v<0||v>1)}function qH(t,e,r,n){return t*n-r*e}function aQt(t){return t<=1e-6&&t>=-1e-6}function KS(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,i=En(e)?{formatter:e}:e,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&te(Gn(l),function(u){Nt(s,u)||(s[u]=l[u],s.$vars.push(u))});var c=br(t.el);c.componentMainType=a,c.componentIndex=o,c.tooltipConfig={name:n,option:tr({content:n,formatterParams:s},i)}}Oh("circle",_h);Oh("ellipse",TB);Oh("sector",Xl);Oh("ring",c9);Oh("polygon",dl);Oh("polyline",Gc);Oh("rect",In);Oh("line",Fo);Oh("bezierCurve",u9);Oh("arc",EB);const h9=Object.freeze(Object.defineProperty({__proto__:null,Arc:EB,BezierCurve:u9,BoundingRect:tn,Circle:_h,CompoundPath:m7e,Ellipse:TB,Group:fr,Image:Io,IncrementalDisplayable:IB,Line:Fo,LinearGradient:Nh,OrientedBoundingRect:hO,Path:rn,Point:Mr,Polygon:dl,Polyline:Gc,RadialGradient:w7e,Rect:In,Ring:c9,Sector:Xl,Text:Bn,applyTransform:lh,clipPointsByRect:C7e,clipRectByRect:iQt,createIcon:d9,extendPath:eQt,extendShape:XZt,getShapeClass:vre,getTransform:Sb,groupTransition:f9,initProps:la,isElementRemoved:A3,lineLineIntersect:A7e,linePolygonIntersect:gA,makeImage:x7e,makePath:PB,mergePath:Mf,registerShape:Oh,removeElement:Y1,removeElementWithFadeOut:CE,resizePath:S7e,setTooltipConfig:KS,subPixelOptimize:gM,subPixelOptimizeLine:tQt,subPixelOptimizeRect:rQt,transformDirection:RB,updateProps:Mn},Symbol.toStringTag,{value:"Module"}));var MB={};function T7e(t,e){for(var r=0;r=0&&s.push(l)}),s}}function Sy(t,e){return $r($r({},t,!0),e,!0)}const mQt={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},yQt={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var mO="ZH",mre="EN",AE=mre,vM={},yre={},M7e=Ar.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return t.indexOf(mO)>-1?mO:AE}():AE;function D7e(t,e){t=t.toUpperCase(),yre[t]=new ai(e),vM[t]=e}function wQt(t){if(En(t)){var e=vM[t.toUpperCase()]||{};return t===mO||t===mre?ur(e):$r(ur(e),ur(vM[AE]),!1)}else return $r(ur(t),ur(vM[AE]),!1)}function dZ(t){return yre[t]}function bQt(){return yre[AE]}D7e(mre,mQt);D7e(mO,yQt);var wre=1e3,bre=wre*60,h6=bre*60,Df=h6*24,Kge=Df*365,vA={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},rk="{yyyy}-{MM}-{dd}",Zge={year:"{yyyy}",month:"{yyyy}-{MM}",day:rk,hour:rk+" "+vA.hour,minute:rk+" "+vA.minute,second:rk+" "+vA.second,millisecond:vA.none},KH=["year","month","day","hour","minute","second","millisecond"],N7e=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function sw(t,e){return t+="","0000".substr(0,e-t.length)+t}function T3(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function xQt(t){return t===T3(t)}function _Qt(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function DB(t,e,r,n){var i=h0(t),a=i[xre(r)](),o=i[E3(r)]()+1,s=Math.floor((o-1)/4)+1,l=i[NB(r)](),c=i["get"+(r?"UTC":"")+"Day"](),u=i[TE(r)](),f=(u-1)%12+1,d=i[OB(r)](),h=i[LB(r)](),p=i[$B(r)](),g=n instanceof ai?n:dZ(n||M7e)||bQt(),v=g.getModel("time"),y=v.get("month"),m=v.get("monthAbbr"),b=v.get("dayOfWeek"),w=v.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,a%100+"").replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[o-1]).replace(/{MMM}/g,m[o-1]).replace(/{MM}/g,sw(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,sw(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,b[c]).replace(/{ee}/g,w[c]).replace(/{e}/g,c+"").replace(/{HH}/g,sw(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,sw(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,sw(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,sw(h,2)).replace(/{s}/g,h+"").replace(/{SSS}/g,sw(p,3)).replace(/{S}/g,p+"")}function SQt(t,e,r,n,i){var a=null;if(typeof r=="string")a=r;else if(typeof r=="function")a=r(t.value,e,{level:t.level});else{var o=st({},vA);if(t.level>0)for(var s=0;s=0;--s)if(l[c]){a=l[c];break}a=a||o.none}if(lt(a)){var f=t.level==null?0:t.level>=0?t.level:a.length+t.level;f=Math.min(f,a.length-1),a=a[f]}}return DB(new Date(t.value),a,i,n)}function O7e(t,e){var r=h0(t),n=r[E3(e)]()+1,i=r[NB(e)](),a=r[TE(e)](),o=r[OB(e)](),s=r[LB(e)](),l=r[$B(e)](),c=l===0,u=c&&s===0,f=u&&o===0,d=f&&a===0,h=d&&i===1,p=h&&n===1;return p?"year":h?"month":d?"day":f?"hour":u?"minute":c?"second":"millisecond"}function Qge(t,e,r){var n=typeof t=="number"?h0(t):t;switch(e=e||O7e(t,r),e){case"year":return n[xre(r)]();case"half-year":return n[E3(r)]()>=6?1:0;case"quarter":return Math.floor((n[E3(r)]()+1)/4);case"month":return n[E3(r)]();case"day":return n[NB(r)]();case"half-day":return n[TE(r)]()/24;case"hour":return n[TE(r)]();case"minute":return n[OB(r)]();case"second":return n[LB(r)]();case"millisecond":return n[$B(r)]()}}function xre(t){return t?"getUTCFullYear":"getFullYear"}function E3(t){return t?"getUTCMonth":"getMonth"}function NB(t){return t?"getUTCDate":"getDate"}function TE(t){return t?"getUTCHours":"getHours"}function OB(t){return t?"getUTCMinutes":"getMinutes"}function LB(t){return t?"getUTCSeconds":"getSeconds"}function $B(t){return t?"getUTCMilliseconds":"getMilliseconds"}function CQt(t){return t?"setUTCFullYear":"setFullYear"}function L7e(t){return t?"setUTCMonth":"setMonth"}function $7e(t){return t?"setUTCDate":"setDate"}function B7e(t){return t?"setUTCHours":"setHours"}function F7e(t){return t?"setUTCMinutes":"setMinutes"}function j7e(t){return t?"setUTCSeconds":"setSeconds"}function U7e(t){return t?"setUTCMilliseconds":"setMilliseconds"}function z7e(t){if(!IIe(t))return En(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function H7e(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var XS=ere,AQt=/([&<>"'])/g,TQt={"&":"&","<":"<",">":">",'"':""","'":"'"};function If(t){return t==null?"":(t+"").replace(AQt,function(e,r){return TQt[r]})}function nk(t,e,r){var n="{yyyy}-{MM}-{dd} {hh}:{mm}:{ss}";function i(u){return u&&dx(u)?u:"-"}function a(u){return!!(u!=null&&!isNaN(u)&&isFinite(u))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?h0(t):t;if(isNaN(+l)){if(s)return"-"}else return DB(l,n,r)}if(e==="ordinal")return DK(t)?i(t):Xte(t)&&a(t)?t+"":"-";var c=dv(t);return a(c)?z7e(c):DK(t)?i(t):typeof t=="boolean"?t+"":"-"}var Xge=["a","b","c","d","e","f","g"],ZH=function(t,e){return"{"+t+(e??"")+"}"};function V7e(t,e,r){lt(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function E2(t,e){return e=e||"transparent",En(t)?t:dr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function yO(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var mM=te,G7e=["left","right","top","bottom","width","height"],eb=[["width","left","right"],["height","top","bottom"]];function _re(t,e,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;e.eachChild(function(l,c){var u=l.getBoundingRect(),f=e.childAt(c+1),d=f&&f.getBoundingRect(),h,p;if(t==="horizontal"){var g=u.width+(d?-d.x+u.x:0);h=a+g,h>n||l.newline?(a=0,h=g,o+=s+r,s=u.height):s=Math.max(s,u.height)}else{var v=u.height+(d?-d.y+u.y:0);p=o+v,p>i||l.newline?(a+=s+r,o=0,p=v,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=h+r:o=p+r)})}var Cb=_re;Er(_re,"vertical");Er(_re,"horizontal");function kQt(t,e,r){var n=e.width,i=e.height,a=xt(t.left,n),o=xt(t.top,i),s=xt(t.right,n),l=xt(t.bottom,i);return(isNaN(a)||isNaN(parseFloat(t.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(t.right)))&&(s=n),(isNaN(o)||isNaN(parseFloat(t.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(t.bottom)))&&(l=i),r=XS(r||0),{width:Math.max(s-a-r[1]-r[3],0),height:Math.max(l-o-r[0]-r[2],0)}}function Eo(t,e,r){r=XS(r||0);var n=e.width,i=e.height,a=xt(t.left,n),o=xt(t.top,i),s=xt(t.right,n),l=xt(t.bottom,i),c=xt(t.width,n),u=xt(t.height,i),f=r[2]+r[0],d=r[1]+r[3],h=t.aspect;switch(isNaN(c)&&(c=n-s-d-a),isNaN(u)&&(u=i-l-f-o),h!=null&&(isNaN(c)&&isNaN(u)&&(h>n/i?c=n*.8:u=i*.8),isNaN(c)&&(c=h*u),isNaN(u)&&(u=c/h)),isNaN(a)&&(a=n-s-c-d),isNaN(o)&&(o=i-l-u-f),t.left||t.right){case"center":a=n/2-c/2-r[3];break;case"right":a=n-c-d;break}switch(t.top||t.bottom){case"middle":case"center":o=i/2-u/2-r[0];break;case"bottom":o=i-u-f;break}a=a||0,o=o||0,isNaN(c)&&(c=n-d-a-(s||0)),isNaN(u)&&(u=i-f-o-(l||0));var p=new tn(a+r[3],o+r[0],c,u);return p.margin=r,p}function BB(t,e,r,n,i){var a=!i||!i.hv||i.hv[0],o=!i||!i.hv||i.hv[1],s=i&&i.boundingMode||"all";if(!(!a&&!o)){var l;if(s==="raw")l=t.type==="group"?new tn(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(l=t.getBoundingRect(),t.needLocalTransform()){var c=t.getLocalTransform();l=l.clone(),l.applyTransform(c)}var u=Eo(tr({width:l.width,height:l.height},e),r,n),f=a?u.x-l.x:0,d=o?u.y-l.y:0;s==="raw"?(t.x=f,t.y=d):(t.x+=f,t.y+=d),t.markRedraw()}}function PQt(t,e){return t[eb[e][0]]!=null||t[eb[e][1]]!=null&&t[eb[e][2]]!=null}function EE(t){var e=t.layoutMode||t.constructor.layoutMode;return dr(e)?e:e?{type:e}:null}function K1(t,e,r){var n=r&&r.ignoreSize;!lt(n)&&(n=[n,n]);var i=o(eb[0],0),a=o(eb[1],1);c(eb[0],t,i),c(eb[1],t,a);function o(u,f){var d={},h=0,p={},g=0,v=2;if(mM(u,function(b){p[b]=t[b]}),mM(u,function(b){s(e,b)&&(d[b]=p[b]=e[b]),l(d,b)&&h++,l(p,b)&&g++}),n[f])return l(e,u[1])?p[u[2]]=null:l(e,u[2])&&(p[u[1]]=null),p;if(g===v||!h)return p;if(h>=v)return d;for(var y=0;y=0;l--)s=$r(s,i[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return o9(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.protoInitialize=function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),e}(ai);BIe(fn,ai);xB(fn);gQt(fn);vQt(fn,MQt);function MQt(t){var e=[];return te(fn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=ft(e,function(r){return Ap(r).main}),t!=="dataset"&&en(e,"dataset")<=0&&e.unshift("dataset"),e}var q7e="";typeof navigator<"u"&&(q7e=navigator.platform||"");var n_="rgba(0, 0, 0, 0.2)";const DQt={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:n_,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:n_,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:n_,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:n_,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:n_,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:n_,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:q7e.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var Y7e=Gt(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),od="original",hl="arrayRows",sd="objectRows",k0="keyedColumns",w1="typedArray",K7e="unknown",Wp="column",eC="row",As={Must:1,Might:2,Not:3},Z7e=qn();function NQt(t){Z7e(t).datasetMap=Gt()}function Q7e(t,e,r){var n={},i=Cre(e);if(!i||!t)return n;var a=[],o=[],s=e.ecModel,l=Z7e(s).datasetMap,c=i.uid+"_"+r.seriesLayoutBy,u,f;t=t.slice(),te(t,function(g,v){var y=dr(g)?g:t[v]={name:g};y.type==="ordinal"&&u==null&&(u=v,f=p(y)),n[y.name]=[]});var d=l.get(c)||l.set(c,{categoryWayDim:f,valueWayDim:0});te(t,function(g,v){var y=g.name,m=p(g);if(u==null){var b=d.valueWayDim;h(n[y],b,m),h(o,b,m),d.valueWayDim+=m}else if(u===v)h(n[y],0,m),h(a,0,m);else{var b=d.categoryWayDim;h(n[y],b,m),h(o,b,m),d.categoryWayDim+=m}});function h(g,v,y){for(var m=0;me)return t[n];return t[r-1]}function eke(t,e,r,n,i,a,o){a=a||t;var s=e(a),l=s.paletteIdx||0,c=s.paletteNameMap=s.paletteNameMap||{};if(c.hasOwnProperty(i))return c[i];var u=o==null||!n?r:FQt(n,o);if(u=u||r,!(!u||!u.length)){var f=u[l];return i&&(c[i]=f),s.paletteIdx=(l+1)%u.length,f}}function jQt(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var ik,_4,eve,tve="\0_ec_inner",UQt=1,Tre=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new ai(a),this._locale=new ai(o),this._optionManager=s},e.prototype.setOption=function(r,n,i){var a=ive(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,ive(n))},e.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?eve(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&te(l,function(c){i=!0,this._mergeOption(c,n)},this)}return i},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=Gt(),c=n&&n.replaceMergeMainTypeMap;NQt(this),te(r,function(f,d){f!=null&&(fn.hasClass(d)?d&&(s.push(d),l.set(d,!0)):i[d]=i[d]==null?ur(f):$r(i[d],f,!0))}),c&&c.each(function(f,d){fn.hasClass(d)&&!l.get(d)&&(s.push(d),l.set(d,!0))}),fn.topologicalTravel(s,fn.getAllClassMainTypes(),u,this);function u(f){var d=$Qt(this,f,di(r[f])),h=a.get(f),p=h?c&&c.get(f)?"replaceMerge":"normalMerge":"replaceAll",g=DIe(h,d,p);oKt(g,f,fn),i[f]=null,a.set(f,null),o.set(f,0);var v=[],y=[],m=0;te(g,function(b,w){var C=b.existing,A=b.newOption;if(!A)C&&(C.mergeOption({},this),C.optionUpdated({},!1));else{var S=f==="series",I=fn.getClass(f,b.keyInfo.subType,!S);if(!I)return;if(C&&C.constructor===I)C.name=b.keyInfo.name,C.mergeOption(A,this),C.optionUpdated(A,!1);else{var D=st({componentIndex:w},b.keyInfo);C=new I(A,this,this,D),st(C,D),b.brandNew&&(C.__requireNewView=!0),C.init(A,this,this),C.optionUpdated(null,!0)}}C?(v.push(C.option),y.push(C),m++):(v.push(void 0),y.push(void 0))},this),i[f]=v,a.set(f,y),o.set(f,m),f==="series"&&ik(this)}this._seriesIndices||ik(this)},e.prototype.getOption=function(){var r=ur(this.option);return te(r,function(n,i){if(fn.hasClass(i)){for(var a=di(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!xE(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[tve],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var i=this._componentsMap.get(r);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=e:r==="max"?t<=e:t===e}function ZQt(t,e){return t.join(",")===e.join(",")}var Pd=te,IE=dr,ave=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function XH(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=ave.length;r=0;g--){var v=t[g];if(s||(h=v.data.rawIndexOf(v.stackedByDimension,d)),h>=0){var y=v.data.getByRawIndex(v.stackResultDimension,h);if(f>=0&&y>0||f<=0&&y<0){f=KYt(f,y),p=y;break}}}return n[0]=f,n[1]=p,n})})}var FB=function(){function t(e){this.data=e.data||(e.sourceFormat===k0?{}:[]),this.sourceFormat=e.sourceFormat||K7e,this.seriesLayoutBy=e.seriesLayoutBy||Wp,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;ng&&(g=b)}h[0]=p,h[1]=g}},i=function(){return this._data?this._data.length/this._dimSize:0};dve=(e={},e[hl+"_"+Wp]={pure:!0,appendData:a},e[hl+"_"+eC]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[sd]={pure:!0,appendData:a},e[k0]={pure:!0,appendData:function(o){var s=this._data;te(o,function(l,c){for(var u=s[c]||(s[c]=[]),f=0;f<(l||[]).length;f++)u.push(l[f])})}},e[od]={appendData:a},e[w1]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[v])}return g!=null?g+"":""})}},t.prototype.getRawValue=function(e,r){return Y5(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function vve(t){var e,r;return dr(t)?t.type&&(r=t):e=t,{markupText:e,markupFragment:r}}function p6(t){return new hXt(t)}var hXt=function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var i=this.context;i.data=i.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=u(this._modBy),s=this._modDataCount||0,l=u(e&&e.modBy),c=e&&e.modDataCount||0;(o!==l||s!==c)&&(a="reset");function u(m){return!(m>=1)&&(m=1),m}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=c;var d=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var h=this._dueIndex,p=Math.min(d!=null?this._dueIndex+d:1/0,this._dueEnd);if(!n&&(f||h1&&n>0?s:o}};return a;function o(){return e=t?null:le},gte:function(t,e){return t>=e}},gXt=function(){function t(e,r){if(typeof r!="number"){var n="";Xn(n)}this._opFn=fke[e],this._rvalFloat=dv(r)}return t.prototype.evaluate=function(e){return typeof e=="number"?this._opFn(e,this._rvalFloat):this._opFn(dv(e),this._rvalFloat)},t}(),dke=function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=typeof e,i=typeof r,a=n==="number"?e:dv(e),o=i==="number"?r:dv(r),s=isNaN(a),l=isNaN(o);if(s&&(a=this._incomparable),l&&(o=this._incomparable),s&&l){var c=n==="string",u=i==="string";c&&(a=u?e:0),u&&(o=c?r:0)}return ao?-this._resultLT:0},t}(),vXt=function(){function t(e,r){this._rval=r,this._isEQ=e,this._rvalTypeof=typeof r,this._rvalFloat=dv(r)}return t.prototype.evaluate=function(e){var r=e===this._rval;if(!r){var n=typeof e;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(r=dv(e)===this._rvalFloat)}return this._isEQ?r:!r},t}();function mXt(t,e){return t==="eq"||t==="ne"?new vXt(t==="eq",e):Nt(fke,t)?new gXt(t,e):null}var yXt=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return b1(e,r)},t}();function wXt(t,e){var r=new yXt,n=t.data,i=r.sourceFormat=t.sourceFormat,a=t.startIndex,o="";t.seriesLayoutBy!==Wp&&Xn(o);var s=[],l={},c=t.dimensionsDefine;if(c)te(c,function(g,v){var y=g.name,m={index:v,name:y,displayName:g.displayName};if(s.push(m),y!=null){var b="";Nt(l,y)&&Xn(b),l[y]=m}});else for(var u=0;u65535?EXt:IXt}function i_(){return[1/0,-1/0]}function kXt(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function wve(t,e,r,n,i){var a=gke[r||"float"];if(i){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new a(n),c=0;cv[1]&&(v[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,c=ft(o,function(m){return m.property}),u=0;uy[1]&&(y[1]=v)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r=0&&r=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&ne)a=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,n){var i=this._chunks,a=i[e],o=[];if(!a)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,c=0,u=0,f=this.count();u=0&&l<0)&&(s=p,l=h,c=0),h===l&&(o[c++]=u))}return o.length=c,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=f&&m<=d||isNaN(m))&&(l[c++]=g),g++}p=!0}else if(a===2){for(var v=h[i[0]],b=h[i[1]],w=e[i[1]][0],C=e[i[1]][1],y=0;y=f&&m<=d||isNaN(m))&&(A>=w&&A<=C||isNaN(A))&&(l[c++]=g),g++}p=!0}}if(!p)if(a===1)for(var y=0;y=f&&m<=d||isNaN(m))&&(l[c++]=S)}else for(var y=0;ye[L][1])&&(I=!1)}I&&(l[c++]=r.getRawIndex(y))}return cy[1]&&(y[1]=v)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),i=n._chunks,a=i[e],o=this.count(),s=0,l=Math.floor(1/r),c=this.getRawIndex(0),u,f,d,h=new(C4(this._rawCount))(Math.ceil(o/l)+2);h[s++]=c;for(var p=1;pu&&(u=f,d=w))}h[s++]=d,c=d}return h[s++]=this.getRawIndex(o-1),n._count=s,n._indices=h,n.getRawIndex=this._getRawIdx,n},t.prototype.downSample=function(e,r,n,i){for(var a=this.clone([e],!0),o=a._chunks,s=[],l=Math.floor(1/r),c=o[e],u=this.count(),f=a._rawExtent[e]=i_(),d=new(C4(this._rawCount))(Math.ceil(u/l)),h=0,p=0;pu-p&&(l=u-p,s.length=l);for(var g=0;gf[1]&&(f[1]=y),d[h++]=m}return a._count=h,a._indices=d,a._updateGetRawIdx(),a},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,i=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function e(r,n,i,a){return b1(r[a],this._dimensions[a])}tV={arrayRows:e,objectRows:function(r,n,i,a){return b1(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return b1(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),vke=function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,i,a;if(ak(e)){var o=e,s=void 0,l=void 0,c=void 0;if(n){var u=r[0];u.prepareSource(),c=u.getSource(),s=c.data,l=c.sourceFormat,a=[u._getVersionSign()]}else s=o.get("data",!0),l=Cu(s)?w1:od,a=[];var f=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},h=Cn(f.seriesLayoutBy,d.seriesLayoutBy)||null,p=Cn(f.sourceHeader,d.sourceHeader)||null,g=Cn(f.dimensions,d.dimensions),v=h!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||g;i=v?[gZ(s,{seriesLayoutBy:h,sourceHeader:p,dimensions:g},l)]:[]}else{var y=e;if(n){var m=this._applyTransform(r);i=m.sourceList,a=m.upstreamSignList}else{var b=y.get("source",!0);i=[gZ(b,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),i=r.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&xve(a)}var o,s=[],l=[];return te(e,function(c){c.prepareSource();var u=c.getSource(i||0),f="";i!=null&&!u&&xve(f),s.push(u),l.push(c._getVersionSign())}),n?o=AXt(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[oXt(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r1||e>0&&!t.noHeader,n=0;te(t.blocks,function(i){Mre(i).planLayout(i);var a=i.__gapLevelBetweenSubBlocks;a>=n&&(n=a+(r&&(!a||i.type==="section"&&!i.noHeader)?1:0))}),t.__gapLevelBetweenSubBlocks=n},build:function(t,e,r,n){var i=e.noHeader,a=yke(e),o=MXt(t,e,i?r:a.html,n);if(i)return o;var s=nk(e.header,"ordinal",t.useUTC),l=_ve(n,t.renderMode).nameStyle;return t.renderMode==="richText"?Ave(t,s,l)+a.richText+o:mZ('
'+If(s)+"
"+o,r)}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,r,n){var i=t.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,c=e.value,u=t.useUTC;if(!(a&&o)){var f=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),d=a?"":nk(l,"ordinal",u),h=e.valueType,p=o?[]:lt(c)?ft(c,function(w,C){return nk(w,lt(h)?h[C]:h,u)}):[nk(c,lt(h)?h[0]:h,u)],g=!s||!a,v=!s&&a,y=_ve(n,i),m=y.nameStyle,b=y.valueStyle;return i==="richText"?(s?"":f)+(a?"":Ave(t,d,m))+(o?"":OXt(t,p,g,v,b)):mZ((s?"":f)+(a?"":DXt(d,!s,m))+(o?"":NXt(p,g,v,b)),r)}}}};function MXt(t,e,r,n){var i=[],a=e.blocks||[];Au(!a||lt(a)),a=a||[];var o=t.orderMode;if(e.sortBlocks&&o){a=a.slice();var s={valueAsc:"asc",valueDesc:"desc"};if(Nt(s,o)){var l=new dke(s[o],null);a.sort(function(u,f){return l.evaluate(u.sortParam,f.sortParam)})}else o==="seriesDesc"&&a.reverse()}var c=yke(e);if(te(a,function(u,f){var d=Mre(u).build(t,u,f>0?c.html:0,n);d!=null&&i.push(d)}),!!i.length)return t.renderMode==="richText"?i.join(c.richText):mZ(i.join(""),r)}function Cve(t,e,r,n,i,a){if(t){var o=Mre(t);o.planLayout(t);var s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e};return o.build(s,t,0,a)}}function yke(t){var e=t.__gapLevelBetweenSubBlocks;return{html:PXt[e],richText:RXt[e]}}function mZ(t,e){var r='
',n="margin: "+e+"px 0 0";return'
'+t+r+"
"}function DXt(t,e,r){var n=e?"margin-left:2px":"";return''+If(t)+""}function NXt(t,e,r,n){var i=r?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return''+ft(t,function(o){return If(o)}).join("  ")+""}function Ave(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function OXt(t,e,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(e.join(" "),a)}function wke(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return E2(n)}function bke(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var rV=function(){function t(){this.richTextStyles={},this._nextStyleNameId=kIe()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var i=n==="richText"?this._generateStyleName():null,a=IQt({color:r,type:e,renderMode:n,markerId:i});return En(a)?a:(this.richTextStyles[i]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};lt(r)?te(r,function(a){return st(n,a)}):st(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},t}();function xke(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(r),l=lt(s),c=wke(e,r),u,f,d,h;if(o>1||l&&!o){var p=LXt(s,e,r,a,c);u=p.inlineValues,f=p.inlineValueTypes,d=p.blocks,h=p.inlineValues[0]}else if(o){var g=i.getDimensionInfo(a[0]);h=u=Y5(i,r,a[0]),f=g.type}else h=u=l?s[0]:s;var v=sre(e),y=v&&e.name||"",m=i.getName(r),b=n?y:m;return Ho("section",{header:y,noHeader:n||!v,sortParam:h,blocks:[Ho("nameValue",{markerType:"item",markerColor:c,name:b,noName:!dx(b),value:u,valueType:f})].concat(d||[])})}function LXt(t,e,r,n,i){var a=e.getData(),o=W5(t,function(f,d,h){var p=a.getDimensionInfo(h);return f=f||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],c=[];n.length?te(n,function(f){u(Y5(a,r,f),f)}):te(t,u);function u(f,d){var h=a.getDimensionInfo(d);!h||h.otherDims.tooltip===!1||(o?c.push(Ho("nameValue",{markerType:"subItem",markerColor:i,name:h.displayName,value:f,valueType:h.type})):(s.push(f),l.push(h.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:c}}var Jv=qn();function ok(t,e){return t.getName(e)||t.getId(e)}var yM="__universalTransitionEnabled",Mi=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,i){this.seriesIndex=this.componentIndex,this.dataTask=p6({count:BXt,reset:FXt}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Jv(this).sourceManager=new vke(this);a.prepareSource();var o=this.getInitialData(r,i);Eve(o,this),this.dataTask.context.data=o,Jv(this).dataBeforeProcessed=o,Tve(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=EE(this),a=i?JS(r):{},o=this.subType;fn.hasClass(o)&&(o+="Series"),$r(r,n.getTheme().get(this.subType)),$r(r,this.getDefaultOption()),_2(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&K1(r,a,i)},e.prototype.mergeOption=function(r,n){r=$r(this.option,r,!0),this.fillDataTextStyle(r.data);var i=EE(this);i&&K1(this.option,r,i);var a=Jv(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Eve(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Jv(this).dataBeforeProcessed=o,Tve(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Cu(r))for(var n=["show"],i=0;ithis.getShallow("animationThreshold")&&(r=!1),!!r},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,i){var a=this.ecModel,o=Are.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var i=this.option.selectedMap;if(i)for(var a=this.getData(n),o=0;o=0&&i.push(o)}return i},e.prototype.isSelected=function(r,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n),o=ok(a,r);return i[o]||!1},e.prototype.isUniversalTransitionEnabled=function(){if(this[yM])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var i,a,o=this.option.selectedMode,s=n.length;if(!(!o||!s)){if(o==="multiple")for(var l=this.option.selectedMap||(this.option.selectedMap={}),c=0;c0&&this._innerSelect(r,n)}},e.registerClass=function(r){return fn.registerClass(r)},e.protoInitialize=function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),e}(fn);xo(Mi,Pre);xo(Mi,Are);BIe(Mi,fn);function Tve(t){var e=t.name;sre(t)||(t.name=$Xt(t)||e)}function $Xt(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return te(r,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function BXt(t){return t.model.getRawData().count()}function FXt(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),jXt}function jXt(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Eve(t,e){te(NK(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,Er(UXt,e))})}function UXt(t,e){var r=yZ(t);return r&&r.setOutputEnd((e||this).count()),e}function yZ(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(t.uid))}return n}}var ca=function(){function t(){this.group=new fr,this.uid=QS("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,i){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,i){},t.prototype.updateLayout=function(e,r,n,i){},t.prototype.updateVisual=function(e,r,n,i){},t.prototype.blurSeries=function(e,r){},t}();cre(ca);xB(ca);function tC(){var t=qn();return function(e){var r=t(e),n=e.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var _ke=qn(),zXt=tC(),xi=function(){function t(){this.group=new fr,this.uid=QS("viewChart"),this.renderTask=p6({plan:HXt,reset:VXt}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,i){},t.prototype.highlight=function(e,r,n,i){kve(e.getData(),i,"emphasis")},t.prototype.downplay=function(e,r,n,i){kve(e.getData(),i,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,i){this.render(e,r,n,i)},t.prototype.updateLayout=function(e,r,n,i){this.render(e,r,n,i)},t.prototype.updateVisual=function(e,r,n,i){this.render(e,r,n,i)},t.markUpdateMethod=function(e,r){_ke(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function Ive(t,e,r){t&&(e==="emphasis"?Vp:Gp)(t,r)}function kve(t,e,r){var n=S2(t,e),i=e&&e.highlightKey!=null?AZt(e.highlightKey):null;n!=null?te(di(n),function(a){Ive(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){Ive(a,r,i)})}cre(xi);xB(xi);function HXt(t){return zXt(t.model)}function VXt(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=i&&_ke(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,i),GXt[l]}var GXt={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},wO="\0__throttleOriginMethod",Pve="\0__throttleRate",Rve="\0__throttleType";function UB(t,e,r){var n,i=0,a=0,o=null,s,l,c,u;e=e||0;function f(){a=new Date().getTime(),o=null,t.apply(l,c||[])}var d=function(){for(var h=[],p=0;p=0?f():o=setTimeout(f,-s),i=n};return d.clear=function(){o&&(clearTimeout(o),o=null)},d.debounceNextCall=function(h){u=h},d}function g9(t,e,r,n){var i=t[e];if(i){var a=i[wO]||i,o=i[Rve],s=i[Pve];if(s!==r||o!==n){if(r==null||!n)return t[e]=a;i=t[e]=UB(a,r,n==="debounce"),i[wO]=a,i[Rve]=n,i[Pve]=r}return i}}function WXt(t,e){var r=t[e];r&&r[wO]&&(t[e]=r[wO])}var Mve=qn(),Dve={itemStyle:C2(R7e,!0),lineStyle:C2(P7e,!0)},qXt={lineStyle:"stroke",itemStyle:"fill"};function Ske(t,e){var r=t.visualStyleMapper||Dve[e];return r||(console.warn("Unkown style type '"+e+"'."),Dve.itemStyle)}function Cke(t,e){var r=t.visualDrawType||qXt[e];return r||(console.warn("Unkown style type '"+e+"'."),"fill")}var YXt={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=Ske(t,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=Cke(t,n),c=o[l],u=si(c)?c:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||u||f){var d=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=d,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||typeof o.fill=="function"?d:o.fill,o.stroke=o.stroke==="auto"||typeof o.stroke=="function"?d:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&u)return r.setVisual("colorFromPalette",!1),{dataEach:function(h,p){var g=t.getDataParams(p),v=st({},o);v[l]=u(g),h.setItemVisual(p,"style",v)}}}},A4=new ai,KXt={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=Ske(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){A4.option=l[n];var c=i(A4),u=o.ensureUniqueItemVisual(s,"style");st(u,c),A4.option.decal&&(o.setItemVisual(s,"decal",A4.option.decal),A4.option.decal.dirty=!0),a in c&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},ZXt={performRawSeries:!0,overallReset:function(t){var e=Gt();t.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var i=r.type+"-"+n,a=e.get(i);a||(a={},e.set(i,a)),Mve(r).scope=a}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=Mve(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=Cke(r,s);a.each(function(c){var u=a.getRawIndex(c);i[u]=c}),n.each(function(c){var u=i[c],f=a.getItemVisual(u,"colorFromPalette");if(f){var d=a.ensureUniqueItemVisual(u,"style"),h=n.getName(c)||c+"",p=n.count();d[l]=r.getColorFromPalette(h,o,p)}})}})}},sk=Math.PI;function QXt(t,e){e=e||{},tr(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new fr,n=new In({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var i=new Bn({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new In({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var o;return e.showSpinner&&(o=new EB({shape:{startAngle:-sk/2,endAngle:-sk/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:sk*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:sk*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,c=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:c,cy:u}),a.setShape({x:c-l,y:u-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var Ake=function(){function t(e,r,n,i){this._stageTaskMap=Gt(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!r&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&a>=n.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,n=r._pipelineMap=Gt();e.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(i,i.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;te(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";Au(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,r,n),i.overallReset&&this._createOverallStageTask(i,a,r,n)},this)},t.prototype.prepareView=function(e,r,n,i){var a=e.renderTask,o=a.context;o.model=r,o.ecModel=n,o.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(r,a)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,i){i=i||{};var a=!1,o=this;te(e,function(l,c){if(!(i.visualType&&i.visualType!==l.visualType)){var u=o._stageTaskMap.get(l.uid),f=u.seriesTaskMap,d=u.overallTask;if(d){var h,p=d.agentStubMap;p.each(function(v){s(i,v)&&(v.dirty(),h=!0)}),h&&d.dirty(),o.updatePayload(d,n);var g=o.getPerformArgs(d,i.block);p.each(function(v){v.perform(g)}),d.perform(g)&&(a=!0)}else f&&f.each(function(v,y){s(i,v)&&v.dirty();var m=o.getPerformArgs(v,i.block);m.skip=!l.performRawSeries&&r.isSeriesFiltered(v.context.model),o.updatePayload(v,n),v.perform(m)&&(a=!0)})}});function s(l,c){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(c.__pipeline.id))}this.unfinished=a||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,i){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=Gt(),l=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(u):l?n.eachRawSeriesByType(l,u):c&&c(n,i).each(u);function u(f){var d=f.uid,h=s.set(d,o&&o.get(d)||p6({plan:rJt,reset:nJt,count:aJt}));h.context={model:f,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(f,h)}},t.prototype._createOverallStageTask=function(e,r,n,i){var a=this,o=r.overallTask=r.overallTask||p6({reset:XXt});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=Gt(),c=e.seriesType,u=e.getTargetSeries,f=!0,d=!1,h="";Au(!e.createOnAllSeries,h),c?n.eachRawSeriesByType(c,p):u?u(n,i).each(p):(f=!1,te(n.getSeries(),p));function p(g){var v=g.uid,y=l.set(v,s&&s.get(v)||(d=!0,p6({reset:JXt,onDirty:tJt})));y.context={model:g,overallProgress:f},y.agent=o,y.__block=f,a._pipe(g,y)}d&&o.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=r),i.tail&&i.tail.pipe(r),i.tail=r,r.__idxInPipeline=i.count++,r.__pipeline=i},t.wrapStageHandler=function(e,r){return si(e)&&(e={overallReset:e,seriesType:oJt(e)}),e.uid=QS("stageHandler"),r&&(e.visualType=r),e},t}();function XXt(t){t.overallReset(t.ecModel,t.api,t.payload)}function JXt(t){return t.overallProgress&&eJt}function eJt(){this.agent.dirty(),this.getDownstream().dirty()}function tJt(){this.agent&&this.agent.dirty()}function rJt(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function nJt(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=di(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?ft(e,function(r,n){return Tke(n)}):iJt}var iJt=Tke(0);function Tke(t){return function(e,r){var n=r.data,i=r.resetDefines[t];if(i&&i.dataEach)for(var a=e.start;a0&&h===c.length-d.length){var p=c.slice(0,h);p!=="data"&&(r.mainType=p,r[d.toLowerCase()]=l,u=!0)}}s.hasOwnProperty(c)&&(n[c]=l,u=!0),u||(i[c]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:i}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,c=r.dataQuery;return u(l,o,"mainType")&&u(l,o,"subType")&&u(l,o,"index","componentIndex")&&u(l,o,"name")&&u(l,o,"id")&&u(c,a,"name")&&u(c,a,"dataIndex")&&u(c,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,i,a));function u(f,d,h,p){return f[h]==null||d[p||h]===f[h]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),cJt={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;var n=t.get("symbol"),i=t.get("symbolSize"),a=t.get("symbolKeepAspect"),o=t.get("symbolRotate"),s=t.get("symbolOffset"),l=si(n),c=si(i),u=si(o),f=si(s),d=l||c||u||f,h=!l&&n?n:t.defaultSymbol,p=c?null:i,g=u?null:o,v=f?null:s;if(r.setVisual({legendIcon:t.legendIcon||h,symbol:h,symbolSize:p,symbolKeepAspect:a,symbolRotate:g,symbolOffset:v}),e.isSeriesFiltered(t))return;function y(m,b){var w=t.getRawValue(b),C=t.getDataParams(b);l&&m.setItemVisual(b,"symbol",n(w,C)),c&&m.setItemVisual(b,"symbolSize",i(w,C)),u&&m.setItemVisual(b,"symbolRotate",o(w,C)),f&&m.setItemVisual(b,"symbolOffset",s(w,C))}return{dataEach:d?y:null}}},uJt={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function n(i,a){var o=i.getItemModel(a),s=o.getShallow("symbol",!0),l=o.getShallow("symbolSize",!0),c=o.getShallow("symbolRotate",!0),u=o.getShallow("symbolOffset",!0),f=o.getShallow("symbolKeepAspect",!0);s!=null&&i.setItemVisual(a,"symbol",s),l!=null&&i.setItemVisual(a,"symbolSize",l),c!=null&&i.setItemVisual(a,"symbolRotate",c),u!=null&&i.setItemVisual(a,"symbolOffset",u),f!=null&&i.setItemVisual(a,"symbolKeepAspect",f)}return{dataEach:r.hasItemOption?n:null}}};function Dre(t,e,r){switch(r){case"color":var n=t.getItemVisual(e,"style");return n[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function v9(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function Pke(t,e,r,n){switch(r){case"color":var i=t.ensureUniqueItemVisual(e,"style");i[t.getVisual("drawType")]=n,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=n;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,r,n);break}}function Rke(t,e){function r(n,i){var a=[];return n.eachComponent({mainType:"series",subType:t,query:i},function(o){a.push(o.seriesIndex)}),a}te([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],function(n){e(n[0],function(i,a,o){i=st({},i),o.dispatchAction(st(i,{type:n[1],seriesIndex:r(a,i)}))})})}function a_(t,e,r,n,i){var a=t+e;r.isSilent(a)||n.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=i.selected,c=0;c0)?null:(e=e||1,t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Xte(t)?[t]:lt(t)?t:null)}var CJt=new hv(!0);function _O(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function $ve(t){return typeof t=="string"&&t!=="none"}function SO(t){var e=t.fill;return e!=null&&e!=="none"}function Bve(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function Fve(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function bZ(t,e,r){var n=ure(e.image,e.__image,r);if(_B(n)){var i=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i.setTransform){var a=new DOMMatrix;a.rotateSelf(0,0,(e.rotation||0)/Math.PI*180),a.scaleSelf(e.scaleX||1,e.scaleY||1),a.translateSelf(e.x||0,e.y||0),i.setTransform(a)}return i}}function AJt(t,e,r,n){var i=_O(r),a=SO(r),o=r.strokePercent,s=o<1,l=!e.path;(!e.silent||s)&&l&&e.createPathProxy();var c=e.path||CJt;if(!n){var u=r.fill,f=r.stroke,d=a&&!!u.colorStops,h=i&&!!f.colorStops,p=a&&!!u.image,g=i&&!!f.image,v=void 0,y=void 0,m=void 0,b=void 0,w=void 0;(d||h)&&(w=e.getBoundingRect()),d&&(v=e.__dirty?wZ(t,u,w):e.__canvasFillGradient,e.__canvasFillGradient=v),h&&(y=e.__dirty?wZ(t,f,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),p&&(m=e.__dirty||!e.__canvasFillPattern?bZ(t,u,e):e.__canvasFillPattern,e.__canvasFillPattern=m),g&&(b=e.__dirty||!e.__canvasStrokePattern?bZ(t,f,e):e.__canvasStrokePattern,e.__canvasStrokePattern=m),d?t.fillStyle=v:p&&(m?t.fillStyle=m:a=!1),h?t.strokeStyle=y:g&&(b?t.strokeStyle=b:i=!1)}var C=r.lineDash&&r.lineWidth>0&&Nre(r.lineDash,r.lineWidth),A=r.lineDashOffset,S=!!t.setLineDash,I=e.getGlobalScale();if(c.setScale(I[0],I[1],e.segmentIgnoreThreshold),C){var D=r.strokeNoScale&&e.getLineScale?e.getLineScale():1;D&&D!==1&&(C=ft(C,function(O){return O/D}),A/=D)}var L=!0;(l||e.__dirty&E_||C&&!S&&i)&&(c.setDPR(t.dpr),s?c.setContext(null):(c.setContext(t),L=!1),c.reset(),C&&!S&&(c.setLineDash(C),c.setLineDashOffset(A)),e.buildPath(c,e.shape,n),c.toStatic(),e.pathUpdated()),L&&c.rebuildPath(t,s?o:1),C&&S&&(t.setLineDash(C),t.lineDashOffset=A),n||(r.strokeFirst?(i&&Fve(t,r),a&&Bve(t,r)):(a&&Bve(t,r),i&&Fve(t,r))),C&&S&&t.setLineDash([])}function TJt(t,e,r){var n=e.__image=ure(r.image,e.__image,e,e.onload);if(!(!n||!_B(n))){var i=r.x||0,a=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var c=r.sx||0,u=r.sy||0;t.drawImage(n,c,u,r.sWidth,r.sHeight,i,a,o,s)}else if(r.sx&&r.sy){var c=r.sx,u=r.sy,f=o-c,d=s-u;t.drawImage(n,c,u,f,d,i,a,o,s)}else t.drawImage(n,i,a,o,s)}}function EJt(t,e,r){var n=r.text;if(n!=null&&(n+=""),n){t.font=r.font||x2,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var i=void 0;if(t.setLineDash){var a=r.lineDash&&r.lineWidth>0&&Nre(r.lineDash,r.lineWidth),o=r.lineDashOffset;if(a){var s=r.strokeNoScale&&e.getLineScale?e.getLineScale():1;s&&s!==1&&(a=ft(a,function(l){return l/s}),o/=s),t.setLineDash(a),t.lineDashOffset=o,i=!0}}r.strokeFirst?(_O(r)&&t.strokeText(n,r.x,r.y),SO(r)&&t.fillText(n,r.x,r.y)):(SO(r)&&t.fillText(n,r.x,r.y),_O(r)&&t.strokeText(n,r.x,r.y)),i&&t.setLineDash([])}}var jve=["shadowBlur","shadowOffsetX","shadowOffsetY"],Uve=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Nke(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){a||(xc(t,i),a=!0);var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?xb.opacity:o}(n||e.blend!==r.blend)&&(a||(xc(t,i),a=!0),t.globalCompositeOperation=e.blend||xb.blend);for(var s=0;s=4&&(u={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(u&&s!=null&&l!=null&&(f=zke(u,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var h=i;i=new fr,i.add(h),h.scaleX=h.scaleY=f.scale,h.x=f.x,h.y=f.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new In({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:u,viewBoxTransform:f,named:a}},t.prototype._parseNode=function(e,r,n,i,a,o){var s=e.nodeName.toLowerCase(),l,c=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var u=iV[s];if(u&&Nt(iV,s)){l=u.call(this,e,r);var f=e.getAttribute("name");if(f){var d={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(d),s==="g"&&(c=d)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var h=Qve[s];if(h&&Nt(Qve,s)){var p=h.call(this,e),g=e.getAttribute("id");g&&(this._defs[g]=p)}}if(l&&l.isGroup)for(var v=e.firstChild;v;)v.nodeType===1?this._parseNode(v,l,n,c,a,o):v.nodeType===3&&o&&this._parseText(v,l),v=v.nextSibling},t.prototype._parseText=function(e,r){var n=new A2({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),$Jt(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},t.internalField=function(){iV={g:function(e,r){var n=new fr;return tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new In;return tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,r){var n=new _h;return tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,r){var n=new Fo;return tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,r){var n=new TB;return tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,r){var n=e.getAttribute("points"),i;n&&(i=eme(n));var a=new dl({shape:{points:i||[]},silent:!0});return tf(r,a),Qc(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=eme(n));var a=new Gc({shape:{points:i||[]},silent:!0});return tf(r,a),Qc(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new Io;return tf(r,n),Qc(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,r){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new fr;return tf(r,s),Qc(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,r){var n=e.getAttribute("x"),i=e.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new fr;return tf(r,s),Qc(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,r){var n=e.getAttribute("d")||"",i=p7e(n);return tf(r,i),Qc(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),Qve={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),r=parseInt(t.getAttribute("y1")||"0",10),n=parseInt(t.getAttribute("x2")||"10",10),i=parseInt(t.getAttribute("y2")||"0",10),a=new Nh(e,r,n,i);return Xve(t,a),Jve(t,a),a},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),r=parseInt(t.getAttribute("cy")||"0",10),n=parseInt(t.getAttribute("r")||"0",10),i=new w7e(e,r,n);return Xve(t,i),Jve(t,i),i}};function Xve(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function Jve(t,e){for(var r=t.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var n=r.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};Uke(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function tf(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),tr(e.__inheritedStyle,t.__inheritedStyle))}function eme(t){for(var e=zB(t),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=zB(o);switch(i=i||Xf(),s){case"translate":d0(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":ore(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":px(i,i,-parseFloat(l[0])*aV);break;case"skewX":var c=Math.tan(parseFloat(l[0])*aV);Lg(i,[1,0,c,1,0,0],i);break;case"skewY":var u=Math.tan(parseFloat(l[0])*aV);Lg(i,[1,u,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var rme=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Uke(t,e,r){var n=t.getAttribute("style");if(n){rme.lastIndex=0;for(var i;(i=rme.exec(n))!=null;){var a=i[1],o=Nt(CO,a)?CO[a]:null;o&&(e[o]=i[2]);var s=Nt(AO,a)?AO[a]:null;s&&(r[s]=i[2])}}}function HJt(t,e,r){for(var n=0;n>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function JJt(t,e){return t=XJt(t),ft(qi(t.features,function(r){return r.geometry&&r.properties&&r.geometry.coordinates.length>0}),function(r){var n=r.properties,i=r.geometry,a=[];if(i.type==="Polygon"){var o=i.coordinates;a.push({type:"polygon",exterior:o[0],interiors:o.slice(1)})}if(i.type==="MultiPolygon"){var o=i.coordinates;te(o,function(c){c[0]&&a.push({type:"polygon",exterior:c[0],interiors:c.slice(1)})})}var s=new Vke(n[e||"name"],a,n.cp);return s.properties=n,s})}var xZ=[126,25],ame="南海诸岛",Ew=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for(var fw=0;fw0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.setOption=function(r,n,i){if(this._disposed){this.id;return}var a,o,s;if(dr(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Jh]=!0,!this._model||n){var l=new WQt(this._api),c=this._theme,u=this._model=new Tre;u.scheduler=this._scheduler,u.init(null,null,null,c,this._locale,l)}this._model.setOption(r,{replaceMerge:o},SZ);var f={seriesTransition:s,optionChanged:!0};i?(this[rf]={silent:a,updateParams:f},this[Jh]=!1,this.getZr().wakeUp()):(s_(this),em.update.call(this,null,f),this._zr.flush(),this[rf]=null,this[Jh]=!1,E4.call(this,a),I4.call(this,a))},e.prototype.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||fer&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){if(Ar.canvasSupported)return r=r||{},this._zr.painter.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.getSvgDataURL=function(){if(Ar.svgSupported){var r=this._zr,n=r.storage.getDisplayList();return te(n,function(i){i.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,i=this._model,a=[],o=this;te(n,function(l){i.eachComponent({mainType:l},function(c){var u=o._componentsMap[c.__viewId];u.group.ignore||(a.push(u),u.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.getRenderedCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return te(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}if(Ar.canvasSupported){var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(hme[i]){var l=s,c=s,u=-s,f=-s,d=[],h=r&&r.pixelRatio||this.getDevicePixelRatio();te(v6,function(b,w){if(b.group===i){var C=n?b.getZr().painter.getSvgDom().innerHTML:b.getRenderedCanvas(ur(r)),A=b.getDom().getBoundingClientRect();l=a(A.left,l),c=a(A.top,c),u=o(A.right,u),f=o(A.bottom,f),d.push({dom:C,left:A.left,top:A.top})}}),l*=h,c*=h,u*=h,f*=h;var p=u-l,g=f-c,v=G5(),y=oge(v,{renderer:n?"svg":"canvas"});if(y.resize({width:p,height:g}),n){var m="";return te(d,function(b){var w=b.left-l,C=b.top-c;m+=''+b.dom+""}),y.painter.getSvgRoot().innerHTML=m,r.connectedBackgroundColor&&y.painter.setBackgroundColor(r.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return r.connectedBackgroundColor&&y.add(new In({shape:{x:0,y:0,width:p,height:g},style:{fill:r.connectedBackgroundColor}})),te(d,function(b){var w=new Io({style:{x:b.left*h-l,y:b.top*h-c,image:b.dom}});y.add(w)}),y.refreshImmediately(),v.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)}},e.prototype.convertToPixel=function(r,n){return cV(this,"convertToPixel",r,n)},e.prototype.convertFromPixel=function(r,n){return cV(this,"convertFromPixel",r,n)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=c6(i,r);return te(o,function(s,l){l.indexOf("Models")>=0&&te(s,function(c){var u=c.coordinateSystem;if(u&&u.containPoint)a=a||!!u.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[c.__viewId];f&&f.containPoint&&(a=a||f.containPoint(n,c))}},this)},this),!!a},e.prototype.getVisual=function(r,n){var i=this._model,a=c6(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?Dre(s,l,n):v9(s,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;te(Ter,function(n){var i=function(a){var o=r.getModel(),s=a.target,l,c=n==="globalout";if(c?l={}:s&&X_(s,function(p){var g=br(p);if(g&&g.dataIndex!=null){var v=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=v&&v.getDataParams(g.dataIndex,g.dataType)||{},!0}else if(g.eventData)return l=st({},g.eventData),!0},!0),l){var u=l.componentType,f=l.componentIndex;(u==="markLine"||u==="markPoint"||u==="markArea")&&(u="series",f=l.seriesIndex);var d=u&&f!=null&&o.getComponent(u,f),h=d&&r[d.mainType==="series"?"_chartsMap":"_componentsMap"][d.__viewId];l.event=a,l.type=n,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:d,view:h},r.trigger(n,l)}};i.zrEventfulCallAtLast=!0,r._zr.on(n,i,r)}),te(g6,function(n,i){r._messageCenter.on(i,function(a){this.trigger(i,a)},r)}),te(["selectchanged"],function(n){r._messageCenter.on(n,function(i){this.trigger(n,i)},r)}),fJt(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,OIe(this.getDom(),$re,"");var r=this,n=r._api,i=r._model;te(r._componentsViews,function(a){a.dispose(i,n)}),te(r._chartsViews,function(a){a.dispose(i,n)}),r._zr.dispose(),r._dom=r._model=r._chartsMap=r._componentsMap=r._chartsViews=r._componentsViews=r._scheduler=r._api=r._zr=r._throttledZrFlush=r._theme=r._coordSysMgr=r._messageCenter=null,delete v6[r.id]},e.prototype.resize=function(r){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=r&&r.silent;this[rf]&&(a==null&&(a=this[rf].silent),i=!0,this[rf]=null),this[Jh]=!0,i&&s_(this),em.update.call(this,{type:"resize",animation:st({duration:0},r&&r.animation)}),this[Jh]=!1,E4.call(this,a),I4.call(this,a)}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(dr(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!CZ[r]){var i=CZ[r](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=st({},r);return n.type=g6[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(dr(n)||(n={silent:!!n}),!!TO[r.type]&&this._model){if(this[Jh]){this._pendingActions.push(r);return}var i=n.silent;fV.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Ar.browser.weChat&&this._throttledZrFlush(),E4.call(this,i),I4.call(this,i)}},e.prototype.updateLabelLayout=function(){Ld.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){s_=function(c){var u=c._scheduler;u.restorePipelines(c._model),u.prepareStageTasks(),lV(c,!0),lV(c,!1),u.plan()},lV=function(c,u){for(var f=c._model,d=c._scheduler,h=u?c._componentsViews:c._chartsViews,p=u?c._componentsMap:c._chartsMap,g=c._zr,v=c._api,y=0;yu.get("hoverLayerThreshold")&&!Ar.node&&!Ar.worker&&u.eachSeries(function(p){if(!p.preventUsingHoverLayer){var g=c._chartsMap[p.__viewId];g.__alive&&g.group.traverse(function(v){v.states.emphasis&&(v.states.emphasis.hoverLayer=!0)})}})}function i(c,u){var f=c.get("blendMode")||null;u.group.traverse(function(d){d.isGroup||(d.style.blend=f),d.eachPendingDisplayable&&d.eachPendingDisplayable(function(h){h.style.blend=f})})}function a(c,u){c.preventAutoZ||o(u.group,c.get("z")||0,c.get("zlevel")||0,-1/0)}function o(c,u,f,d){var h=c.getTextContent(),p=c.getTextGuideLine(),g=c.isGroup;if(g)for(var v=c.childrenRef(),y=0;y0?{duration:h,delay:f.get("delay"),easing:f.get("easing")}:null;u.group.traverse(function(g){if(g.states&&g.states.emphasis){if(A3(g))return;if(g instanceof rn&&TZt(g),g.__dirty){var v=g.prevStates;v&&g.useStates(v)}if(d){g.stateTransition=p;var y=g.getTextContent(),m=g.getTextGuideLine();y&&(y.stateTransition=p),m&&(m.stateTransition=p)}g.__dirty&&r(g)}})}fme=function(c){return new(function(u){Ge(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.prototype.getCoordinateSystems=function(){return c._coordSysMgr.getCoordinateSystems()},f.prototype.getComponentByElement=function(d){for(;d;){var h=d.__ecComponentInfo;if(h!=null)return c._model.getComponent(h.mainType,h.index);d=d.parent}},f.prototype.enterEmphasis=function(d,h){Vp(d,h),nf(c)},f.prototype.leaveEmphasis=function(d,h){Gp(d,h),nf(c)},f.prototype.enterBlur=function(d){i7e(d),nf(c)},f.prototype.leaveBlur=function(d){a7e(d),nf(c)},f.prototype.enterSelect=function(d){o7e(d),nf(c)},f.prototype.leaveSelect=function(d){s7e(d),nf(c)},f.prototype.getModel=function(){return c.getModel()},f.prototype.getViewOfComponentModel=function(d){return c.getViewOfComponentModel(d)},f.prototype.getViewOfSeriesModel=function(d){return c.getViewOfSeriesModel(d)},f}(tke))(c)},Jke=function(c){function u(f,d){for(var h=0;h=0)){pme.push(r);var a=Ake.wrapStageHandler(r,i);a.__prio=e,a.__raw=r,t.push(a)}}function aPe(t,e){CZ[t]=e}function Mer(t,e,r){Z1.registerMap(t,e,r)}var Der=CXt;gx(Ore,YXt);gx(HB,KXt);gx(HB,ZXt);gx(Ore,cJt);gx(HB,uJt);gx(qke,OJt);nPe(nke);iPe(per,iXt);aPe("default",QXt);P0({type:_b,event:_b,update:_b},zp);P0({type:hM,event:hM,update:hM},zp);P0({type:u6,event:u6,update:u6},zp);P0({type:pM,event:pM,update:pM},zp);P0({type:f6,event:f6,update:f6},zp);rPe("light",sJt);rPe("dark",kke);var gme=[],Ner={registerPreprocessor:nPe,registerProcessor:iPe,registerPostInit:Ier,registerPostUpdate:ker,registerUpdateLifecycle:Bre,registerAction:P0,registerCoordinateSystem:Per,registerLayout:Rer,registerVisual:gx,registerTransform:Der,registerLoading:aPe,registerMap:Mer,PRIORITY:Ser,ComponentModel:fn,ComponentView:ca,SeriesModel:Mi,ChartView:xi,registerComponentModel:function(t){fn.registerClass(t)},registerComponentView:function(t){ca.registerClass(t)},registerSeriesModel:function(t){Mi.registerClass(t)},registerChartView:function(t){xi.registerClass(t)},registerSubTypeDefaulter:function(t,e){fn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){GYt(t,e)}};function Xr(t){if(lt(t)){te(t,function(e){Xr(e)});return}en(gme,t)>=0||(gme.push(t),si(t)&&(t={install:t}),t.install(Ner))}function P4(t){return t==null?0:t.length||1}function vme(t){return t}var pv=function(){function t(e,r,n,i,a,o){this._old=e,this._new=r,this._oldKeyGetter=n||vme,this._newKeyGetter=i||vme,this.context=a,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},i=new Array(e.length),a=new Array(r.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(r,n,a,"_newKeyGetter");for(var o=0;o1){var u=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(u,o)}else c===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&d===1)this._updateManyToOne&&this._updateManyToOne(u,c),i[l]=null;else if(f===1&&d>1)this._updateOneToMany&&this._updateOneToMany(u,c),i[l]=null;else if(f===1&&d===1)this._update&&this._update(u,c),i[l]=null;else if(f>1&&d>1)this._updateManyToMany&&this._updateManyToMany(u,c),i[l]=null;else if(f>1)for(var h=0;h1)for(var s=0;s30}var R4=dr,tm=ft,jer=typeof Int32Array>"u"?Array:Int32Array,Uer="e\0\0",mme=-1,zer=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Her=["_approximateExtent"],yme,fk,M4,D4,pV,dk,gV,Ul=function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var n,i=!1;sPe(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},o=[],s={},l=!1,c={},u=0;u=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===od;if(l&&!i.pure)for(var c=[],u=e;u0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[r];return a==null&&(a=this.getVisual(r),lt(a)?a=a.slice():R4(a)&&(a=st({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,R4(r)?st(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){if(R4(e)){for(var n in e)e.hasOwnProperty(n)&&this.setLayout(n,e[n]);return}this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?st(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;nZ(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){te(this._graphicEls,function(n,i){n&&e&&e.call(r,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:tm(this.dimensions,this._getDimInfo,this),this.hostModel)),pV(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];typeof n=="function"&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(Jte(arguments)))})},t.internalField=function(){yme=function(e){var r=e._invertedIndicesMap;te(r,function(n,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){n=r[i]=new jer(o.categories.length);for(var l=0;l1&&(l+="__ec__"+u),i[r]=l}}}(),t}();function y9(t,e){Ere(t)||(t=Ire(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=Gt(),a=[],o=Ger(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&uPe(o),l=n===t.dimensionsDefine,c=l?cPe(t):lPe(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,o));for(var f=Gt(u),d=new pke(o),h=0;h0&&(n.name=i+(a-1)),a++,e.set(i,a)}}function Ger(t,e,r,n){var i=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return te(e,function(a){var o;dr(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function Wer(t,e,r){var n=e.data;if(r||n.hasOwnProperty(t)){for(var i=0;n.hasOwnProperty(t+i);)i++;t+=i}return e.set(t,!0),t}var qer=function(){function t(e){this.coordSysDims=[],this.axisMap=Gt(),this.categoryAxisMap=Gt(),this.coordSysName=e}return t}();function Yer(t){var e=t.get("coordinateSystem"),r=new qer(e),n=Ker[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var Ker={cartesian2d:function(t,e,r,n){var i=t.getReferringComponents("xAxis",yo).models[0],a=t.getReferringComponents("yAxis",yo).models[0];e.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),l_(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),l_(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var i=t.getReferringComponents("singleAxis",yo).models[0];e.coordSysDims=["single"],r.set("single",i),l_(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var i=t.getReferringComponents("polar",yo).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),l_(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),l_(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var i=t.ecModel,a=i.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();te(a.parallelAxisIndex,function(s,l){var c=i.getComponent("parallelAxis",s),u=o[l];r.set(u,c),l_(c)&&(n.set(u,c),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function l_(t){return t.get("type")==="category"}function Zer(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;Qer(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),c,u,f,d;if(te(a,function(m,b){En(m)&&(a[b]=m={name:m}),l&&!m.isExtraCoord&&(!n&&!c&&m.ordinalMeta&&(c=m),!u&&m.type!=="ordinal"&&m.type!=="time"&&(!i||i===m.coordDim)&&(u=m))}),u&&!n&&!c&&(n=!0),u){f="__\0ecstackresult_"+t.id,d="__\0ecstackedover_"+t.id,c&&(c.createInvertedIndices=!0);var h=u.coordDim,p=u.type,g=0;te(a,function(m){m.coordDim===h&&g++});var v={name:f,coordDim:h,coordDimIndex:g,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:d,coordDim:d,coordDimIndex:g+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(d,p),y.storeDimIndex=s.ensureCalculationDimension(f,p)),o.appendCalculationDimension(v),o.appendCalculationDimension(y)):(a.push(v),a.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:c&&c.name,isStackedByIndex:n,stackedOverDimension:d,stackResultDimension:f}}function Qer(t){return!sPe(t.schema)}function Q1(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function fPe(t,e){return Q1(t,e)?t.getCalculationInfo("stackResultDimension"):e}function Xer(t,e){var r=t.get("coordinateSystem"),n=p9.get(r),i;return e&&e.coordSysDims&&(i=ft(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=IO(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Jer(t,e,r){var n,i;return r&&te(t,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(t[n].otherDims.itemName=0),n}function kv(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=Ire(t)):(i=n.getSource(),a=i.sourceFormat===od);var o=Yer(e),s=Xer(e,o),l=r.useEncodeDefaulter,c=si(l)?l:l?Er(Q7e,s,e):null,u={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!a},f=y9(i,u),d=Jer(f.dimensions,r.createInvertedIndices,o),h=a?null:n.getSharedDataStore(f),p=Zer(e,{schema:f,store:h}),g=new Ul(f,e);g.setCalculationInfo(p);var v=d!=null&&etr(i)?function(y,m,b,w){return w===d?b:this.defaultDimValueGetter(y,m,b,w)}:null;return g.hasItemOption=!1,g.initData(a?i:h,null,v),g}function etr(t){if(t.sourceFormat===od){var e=ttr(t.data||[]);return e!=null&&!lt(qS(e))}}function ttr(t){for(var e=0;er[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(r)||(n[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t}();xB(R0);var rtr=0,AZ=function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++rtr}return t.createByAxisModel=function(e){var r=e.option,n=r.data,i=n&&ft(n,ntr);return new t({categories:i,needCollect:!i,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,n=this._needCollect;if(typeof e!="string"&&!n)return e;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var i=this._getOrCreateMap();return r=i.get(e),r==null&&(n?(r=this.categories.length,this.categories[r]=e,i.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=Gt(this.categories))},t}();function ntr(t){return dr(t)&&t.value!=null?t.value:t+""}var wme=Bo;function itr(t,e,r,n){var i={},a=t[1]-t[0],o=i.interval=EIe(a/e);r!=null&&on&&(o=i.interval=n);var s=i.intervalPrecision=dPe(o),l=i.niceTickExtent=[wme(Math.ceil(t[0]/o)*o,s),wme(Math.floor(t[1]/o)*o,s)];return atr(l,t),i}function dPe(t){return Cp(t)+2}function bme(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function atr(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),bme(t,0,e),bme(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function VB(t,e){return t>=e[0]&&t<=e[1]}function GB(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function WB(t,e){return t*(e[1]-e[0])+e[0]}var qB=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new AZ({})),lt(i)&&(i=new AZ({categories:ft(i,function(a){return dr(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e.prototype.parse=function(r){return typeof r=="string"?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),VB(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),GB(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(WB(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],n=this._extent,i=n[0];i<=n[1];)r.push({value:i}),i++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o=0&&r=0&&r=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.niceTicks=function(){},e.prototype.niceExtent=function(){},e.type="ordinal",e}(R0);R0.registerClass(qB);var dw=Bo,vx=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return VB(r,this._extent)},e.prototype.normalize=function(r){return GB(r,this._extent)},e.prototype.scale=function(r){return WB(r,this._extent)},e.prototype.setExtent=function(r,n){var i=this._extent;isNaN(r)||(i[0]=parseFloat(r)),isNaN(n)||(i[1]=parseFloat(n))},e.prototype.unionExtent=function(r){var n=this._extent;r[0]n[1]&&(n[1]=r[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=dPe(r)},e.prototype.getTicks=function(r){var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;i[0]l)return[];var u=s.length?s[s.length-1].value:a[1];return i[1]>u&&(r?s.push({value:dw(u+n,o)}):s.push({value:i[1]})),s},e.prototype.getMinorTicks=function(r){for(var n=this.getTicks(!0),i=[],a=this.getExtent(),o=1;oa[0]&&h0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function zre(t){var e=str(t),r=[];return te(t,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,c=e[l],u=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),d=Math.abs(f[1]-f[0]);s=c?u/d*c:u}else{var h=n.getData();s=Math.abs(o[1]-o[0])/h.count()}var p=xt(n.get("barWidth"),s),g=xt(n.get("barMaxWidth"),s),v=xt(n.get("barMinWidth")||1,s),y=n.get("barGap"),m=n.get("barCategoryGap");r.push({bandWidth:s,barWidth:p,barMaxWidth:g,barMinWidth:v,barGap:y,barCategoryGap:m,axisKey:Ure(a),stackId:jre(n)})}),pPe(r)}function pPe(t){var e={};te(t,function(n,i){var a=n.axisKey,o=n.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var c=n.stackId;l[c]||s.autoWidthCount++,l[c]=l[c]||{width:0,maxWidth:0};var u=n.barWidth;u&&!l[c].width&&(l[c].width=u,u=Math.min(s.remainedWidth,u),s.remainedWidth-=u);var f=n.barMaxWidth;f&&(l[c].maxWidth=f);var d=n.barMinWidth;d&&(l[c].minWidth=d);var h=n.barGap;h!=null&&(s.gap=h);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var r={};return te(e,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Gn(a).length;s=Math.max(35-l*4,15)+"%"}var c=xt(s,o),u=xt(n.gap,1),f=n.remainedWidth,d=n.autoWidthCount,h=(f-c)/(d+(d-1)*u);h=Math.max(h,0),te(a,function(y){var m=y.maxWidth,b=y.minWidth;if(y.width){var w=y.width;m&&(w=Math.min(w,m)),b&&(w=Math.max(w,b)),y.width=w,f-=w+u*w,d--}else{var w=h;m&&mw&&(w=b),w!==h&&(y.width=w,f-=w+u*w,d--)}}),h=(f-c)/(d+(d-1)*u),h=Math.max(h,0);var p=0,g;te(a,function(y,m){y.width||(y.width=h),g=y,p+=y.width*(1+u)}),g&&(p-=g.width*u);var v=-p/2;te(a,function(y,m){r[i][m]=r[i][m]||{bandWidth:o,offset:v,width:y.width},v+=y.width*(1+u)})}),r}function gPe(t,e,r){if(t&&e){var n=t[Ure(e)];return n!=null&&r!=null?n[jre(r)]:n}}function vPe(t,e){var r=hPe(t,e),n=zre(r),i={};te(r,function(a){var o=a.getData(),s=a.coordinateSystem,l=s.getBaseAxis(),c=jre(a),u=n[Ure(l)][c],f=u.offset,d=u.width,h=s.getOtherAxis(l),p=a.get("barMinHeight")||0;i[c]=i[c]||[],o.setLayout({bandWidth:u.bandWidth,offset:f,size:d});for(var g=o.mapDimension(h.dim),v=o.mapDimension(l.dim),y=Q1(o,g),m=h.isHorizontal(),b=wPe(l,h),w=o.getStore(),C=o.getDimensionIndex(g),A=o.getDimensionIndex(v),S=0,I=w.count();S=0?"p":"n",P=b;y&&(i[c][L]||(i[c][L]={p:b,n:b}),P=i[c][L][O]);var x=void 0,T=void 0,E=void 0,N=void 0;if(m){var F=s.dataToPoint([D,L]);x=P,T=F[1]+f,E=F[0]-b,N=d,Math.abs(E)xme||(u=xme),{progress:function(f,d){for(var h=f.count,p=new vV(h*2),g=new vV(h*2),v=new vV(h),y,m=[],b=[],w=0,C=0,A=d.getStore();(y=f.next())!=null;)b[c]=A.get(o,y),b[1-c]=A.get(s,y),m=r.dataToPoint(b,null),g[w]=l?n.x+n.width:m[0],p[w++]=m[0],g[w]=l?m[1]:n.y+n.height,p[w++]=m[1],v[C++]=y;d.setLayout({largePoints:p,largeDataIndices:v,largeBackgroundPoints:g,barWidth:u,valueAxisStart:wPe(i,a),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function mPe(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function yPe(t){return t.pipelineContext&&t.pipelineContext.large}function wPe(t,e,r){return e.toGlobalCoord(e.dataToCoord(e.type==="log"?1:0))}var ctr=function(t,e,r,n){for(;r>>1;t[i][1]i&&(this._approxInterval=i);var s=hk.length,l=Math.min(ctr(hk,this._approxInterval,0,s),s-1);this._interval=hk[l][1],this._minLevelUnit=hk[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return typeof r=="number"?r:+h0(r)},e.prototype.contain=function(r){return VB(this.parse(r),this._extent)},e.prototype.normalize=function(r){return GB(this.parse(r),this._extent)},e.prototype.scale=function(r){return WB(r,this._extent)},e.type="time",e}(vx),hk=[["second",wre],["minute",bre],["hour",h6],["quarter-day",h6*6],["half-day",h6*12],["day",Df*1.2],["half-week",Df*3.5],["week",Df*7],["month",Df*31],["quarter",Df*95],["half-year",Kge/2],["year",Kge]];function utr(t,e,r,n){var i=h0(e),a=h0(r),o=function(p){return Qge(i,p,n)===Qge(a,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},c=function(){return l()&&o("day")},u=function(){return c()&&o("hour")},f=function(){return u()&&o("minute")},d=function(){return f()&&o("second")},h=function(){return d()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return f();case"second":return d();case"millisecond":return h()}}function ftr(t,e){return t/=Df,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function dtr(t){var e=30*Df;return t/=e,t>6?6:t>3?3:t>2?2:1}function htr(t){return t/=h6,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function _me(t,e){return t/=e?bre:wre,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function ptr(t){return EIe(t)}function gtr(t,e,r){var n=new Date(t);switch(T3(e)){case"year":case"month":n[L7e(r)](0);case"day":n[$7e(r)](1);case"hour":n[B7e(r)](0);case"minute":n[F7e(r)](0);case"second":n[j7e(r)](0),n[U7e(r)](0)}return n.getTime()}function vtr(t,e,r,n){var i=1e4,a=N7e,o=0;function s(L,O,P,x,T,E,N){for(var F=new Date(O),B=O,j=F[x]();B1&&E===0&&P.unshift({value:P[0].value-B})}}for(var E=0;E=n[0]&&m<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&d>b/1.5||(c.push(v),f>b||t===a[h]))break}u=[]}}}for(var w=qi(ft(c,function(L){return qi(L,function(O){return O.value>=n[0]&&O.value<=n[1]&&!O.notAdd})}),function(L){return L.length>0}),C=[],A=w.length-1,h=0;h0;)a*=10;var s=[Bo(wtr(n[0]/a)*a),Bo(ytr(n[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.niceExtent=function(r){m6.niceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=af(r)/af(this.base),VB(r,this._extent)},e.prototype.normalize=function(r){return r=af(r)/af(this.base),GB(r,this._extent)},e.prototype.scale=function(r){return r=WB(r,this._extent),pk(this.base,r)},e.type="log",e}(R0),bPe=Vre.prototype;bPe.getMinorTicks=m6.getMinorTicks;bPe.getLabel=m6.getLabel;function gk(t,e){return mtr(t,Cp(e))}R0.registerClass(Vre);var btr=function(){function t(e,r,n){this._prepareParams(e,r,n)}return t.prototype._prepareParams=function(e,r,n){n[1]0&&l>0&&!c&&(s=0),s<0&&l<0&&!u&&(l=0));var d=this._determinedMin,h=this._determinedMax;return d!=null&&(s=d,c=!0),h!=null&&(l=h,u=!0),{min:s,max:l,minFixed:c,maxFixed:u,isBlank:f}},t.prototype.modifyDataMinMax=function(e,r){this[_tr[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var n=xtr[e];this[n]=r},t.prototype.freeze=function(){this.frozen=!0},t}(),xtr={min:"_determinedMin",max:"_determinedMax"},_tr={min:"_dataMin",max:"_dataMax"};function xPe(t,e,r){var n=t.rawExtentInfo;return n||(n=new btr(t,e,r),t.rawExtentInfo=n,n)}function J_(t,e){return e==null?null:tO(e)?NaN:t.parse(e)}function _Pe(t,e){var r=t.type,n=xPe(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var i=n.min,a=n.max,o=e.ecModel;if(o&&r==="time"){var s=hPe("bar",o),l=!1;if(te(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var c=zre(s),u=Str(i,a,e,c);i=u.min,a=u.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function Str(t,e,r,n){var i=r.axis.getExtent(),a=i[1]-i[0],o=gPe(n,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;te(o,function(h){s=Math.min(h.offset,s)});var l=-1/0;te(o,function(h){l=Math.max(h.offset+h.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,f=1-(s+l)/a,d=u/f-u;return e+=d*(l/c),t-=d*(s/c),{min:t,max:e}}function I2(t,e){var r=e,n=_Pe(t,r),i=n.extent,a=r.get("splitNumber");t instanceof Vre&&(t.base=r.get("logBase"));var o=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:o==="interval"||o==="time"?r.get("minInterval"):null,maxInterval:o==="interval"||o==="time"?r.get("maxInterval"):null});var s=r.get("interval");s!=null&&t.setInterval&&t.setInterval(s)}function YB(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new qB({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new Hre({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(R0.getClass(e)||vx)}}function Ctr(t){var e=t.scale.getExtent(),r=e[0],n=e[1];return!(r>0&&n>0||r<0&&n<0)}function w9(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?function(n){return function(i,a){return t.scale.getFormattedLabel(i,a,n)}}(e):typeof e=="string"?function(n){return function(i){var a=t.scale.getLabel(i),o=n.replace("{value}",a??"");return o}}(e):typeof e=="function"?function(n){return function(i,a){return r!=null&&(a=i.value-r),n(Gre(t,i),a,i.level!=null?{level:i.level}:null)}}(e):function(n){return t.scale.getLabel(n)}}function Gre(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function Atr(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var n,i,a=r.getExtent();r instanceof qB?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=w9(t),l,c=1;i>40&&(c=Math.ceil(i/40));for(var u=0;ut[1]&&(t[1]=i[1])})}var b9=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t}(),ME=qn();function Itr(t){return t.type==="category"?Ptr(t):Mtr(t)}function ktr(t,e){return t.type==="category"?Rtr(t,e):{ticks:ft(t.scale.getTicks(),function(r){return r.value})}}function Ptr(t){var e=t.getLabelModel(),r=CPe(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function CPe(t,e){var r=APe(t,"labels"),n=Wre(e),i=TPe(r,n);if(i)return i;var a,o;return si(n)?a=kPe(t,n):(o=n==="auto"?Dtr(t):n,a=IPe(t,o)),EPe(r,n,{labels:a,labelCategoryInterval:o})}function Rtr(t,e){var r=APe(t,"ticks"),n=Wre(e),i=TPe(r,n);if(i)return i;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),si(n))a=kPe(t,n,!0);else if(n==="auto"){var s=CPe(t,t.getLabelModel());o=s.labelCategoryInterval,a=ft(s.labels,function(l){return l.tickValue})}else o=n,a=IPe(t,o,!0);return EPe(r,n,{ticks:a,tickCategoryInterval:o})}function Mtr(t){var e=t.scale.getTicks(),r=w9(t);return{labels:ft(e,function(n,i){return{level:n.level,formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tickValue:n.value}})}}function APe(t,e){return ME(t)[e]||(ME(t)[e]=[])}function TPe(t,e){for(var r=0;r40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(n)),f=Math.abs(c*Math.sin(n)),d=0,h=0;l<=a[1];l+=s){var p=0,g=0,v=a9(r({value:l}),e.font,"center","top");p=v.width*1.3,g=v.height*1.3,d=Math.max(d,p,7),h=Math.max(h,g,7)}var y=d/u,m=h/f;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var b=Math.max(0,Math.floor(Math.min(y,m))),w=ME(t.model),C=t.getExtent(),A=w.lastAutoInterval,S=w.lastTickCount;return A!=null&&S!=null&&Math.abs(A-b)<=1&&Math.abs(S-o)<=1&&A>b&&w.axisExtent0===C[0]&&w.axisExtent1===C[1]?b=A:(w.lastTickCount=o,w.lastAutoInterval=b,w.axisExtent0=C[0],w.axisExtent1=C[1]),b}function Otr(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function IPe(t,e,r){var n=w9(t),i=t.scale,a=i.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=a[0],u=i.count();c!==0&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var f=SPe(t),d=o.get("showMinLabel")||f,h=o.get("showMaxLabel")||f;d&&c!==a[0]&&g(a[0]);for(var p=c;p<=a[1];p+=l)g(p);h&&p-l!==a[1]&&g(a[1]);function g(v){var y={value:v};s.push(r?v:{formattedLabel:n(y),rawLabel:i.getLabel(y),tickValue:v})}return s}function kPe(t,e,r){var n=t.scale,i=w9(t),a=[];return te(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&a.push(r?l:{formattedLabel:i(o),rawLabel:s,tickValue:l})}),a}var Cme=[0,1],Lh=function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return e>=n&&e<=i},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return CIe(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(n=n.slice(),Ame(n,i.count())),oi(e,Cme,n,r)},t.prototype.coordToData=function(e,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),Ame(n,i.count()));var a=oi(e,n,Cme,r);return this.scale.scale(a)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=ktr(this,r),i=n.ticks,a=ft(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return Ltr(this,a,o,e.clamp),a},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),i=ft(n,function(a){return ft(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},t.prototype.getViewLabels=function(){return Itr(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return Ntr(this)},t}();function Ame(t,e){var r=t[1]-t[0],n=e,i=r/n/2;t[0]+=i,t[1]-=i}function Ltr(t,e,r,n){var i=e.length;if(!t.onBand||r||!i)return;var a=t.getExtent(),o,s;if(i===1)e[0].coord=a[0],o=e[1]={coord:a[0]};else{var l=e[i-1].tickValue-e[0].tickValue,c=(e[i-1].coord-e[0].coord)/l;te(e,function(h){h.coord-=c/2});var u=t.scale.getExtent();s=1+u[1]-e[i-1].tickValue,o={coord:e[i-1].coord+c*s},e.push(o)}var f=a[0]>a[1];d(e[0].coord,a[0])&&(n?e[0].coord=a[0]:e.shift()),n&&d(a[0],e[0].coord)&&e.unshift({coord:a[0]}),d(a[1],o.coord)&&(n?o.coord=a[1]:e.pop()),n&&d(o.coord,a[1])&&e.push({coord:a[1]});function d(h,p){return h=Bo(h),p=Bo(p),f?h>p:hi&&(i+=N4);var h=Math.atan2(s,o);if(h<0&&(h+=N4),h>=n&&h<=i||h+N4>=n&&h+N4<=i)return l[0]=u,l[1]=f,c-r;var p=r*Math.cos(n)+t,g=r*Math.sin(n)+e,v=r*Math.cos(i)+t,y=r*Math.sin(i)+e,m=(p-o)*(p-o)+(g-s)*(g-s),b=(v-o)*(v-o)+(y-s)*(y-s);return m0){e=e/180*Math.PI,Xd.fromArray(t[0]),ki.fromArray(t[1]),Za.fromArray(t[2]),Mr.sub(Tp,Xd,ki),Mr.sub(_p,Za,ki);var r=Tp.len(),n=_p.len();if(!(r<.001||n<.001)){Tp.scale(1/r),_p.scale(1/n);var i=Tp.dot(_p),a=Math.cos(e);if(a1&&Mr.copy(Ol,Za),Ol.toArray(t[1])}}}}function ztr(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,Xd.fromArray(t[0]),ki.fromArray(t[1]),Za.fromArray(t[2]),Mr.sub(Tp,ki,Xd),Mr.sub(_p,Za,ki);var n=Tp.len(),i=_p.len();if(!(n<.001||i<.001)){Tp.scale(1/n),_p.scale(1/i);var a=Tp.dot(e),o=Math.cos(r);if(a=l)Mr.copy(Ol,Za);else{Ol.scaleAndAdd(_p,s/Math.tan(Math.PI/2-u));var f=Za.x!==ki.x?(Ol.x-ki.x)/(Za.x-ki.x):(Ol.y-ki.y)/(Za.y-ki.y);if(isNaN(f))return;f<0?Mr.copy(Ol,ki):f>1&&Mr.copy(Ol,Za)}Ol.toArray(t[1])}}}}function Eme(t,e,r,n){var i=r==="normal",a=i?t:t.ensureState(r);a.ignore=e;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?t.useStyle(s):a.style=s}function Htr(t,e){var r=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),r>0&&n.length>=3){var i=Ym(n[0],n[1]),a=Ym(n[1],n[2]);if(!i||!a){t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*r,s=uM([],n[1],n[0],o/i),l=uM([],n[1],n[2],o/a),c=uM([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],c[0],c[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var u=1;u0&&a&&C(-u/o,0,o);var g=t[0],v=t[o-1],y,m;b(),y<0&&A(-y,.8),m<0&&A(m,.8),b(),w(y,m,1),w(m,y,-1),b(),y<0&&S(-y),m<0&&S(m);function b(){y=g.rect[e]-n,m=i-v.rect[e]-v.rect[r]}function w(I,D,L){if(I<0){var O=Math.min(D,-I);if(O>0){C(O*L,0,o);var P=O+I;P<0&&A(-P*L,1)}else A(-I*L,1)}}function C(I,D,L){I!==0&&(c=!0);for(var O=D;O0)for(var P=0;P0;P--){var N=L[P-1]*E;C(-N,P,o)}}}function S(I){var D=I<0?-1:1;I=Math.abs(I);for(var L=Math.ceil(I/(o-1)),O=0;O0?C(L,0,O+1):C(-L,o-O-1,o),I-=L,I<=0)return}return c}function Vtr(t,e,r,n){return DPe(t,"x","width",e,r,n)}function NPe(t,e,r,n){return DPe(t,"y","height",e,r,n)}function OPe(t){var e=[];t.sort(function(g,v){return v.priority-g.priority});var r=new tn(0,0,0,0);function n(g){if(!g.ignore){var v=g.ensureState("emphasis");v.ignore==null&&(v.ignore=!1)}g.ignore=!0}for(var i=0;i=0&&n.attr(a.oldLayoutSelect),en(d,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),Mn(n,c,r,l)}else if(n.attr(c),!ZS(n).valueAnimation){var f=Cn(n.style.opacity,1);n.style.opacity=0,la(n,{style:{opacity:f}},r,l)}if(a.oldLayout=c,n.states.select){var h=a.oldLayoutSelect={};vk(h,c,mk),vk(h,n.states.select,mk)}if(n.states.emphasis){var p=a.oldLayoutEmphasis={};vk(p,c,mk),vk(p,n.states.emphasis,mk)}k7e(n,l,u,r,r)}if(i&&!i.ignore&&!i.invisible){var a=qtr(i),o=a.oldLayout,g={points:i.shape.points};o?(i.attr({shape:o}),Mn(i,{shape:g},r)):(i.setShape(g),i.style.strokePercent=0,la(i,{style:{strokePercent:1}},r)),a.oldLayout=g}},t}(),yV=qn();function Ktr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=yV(r).labelManager;i||(i=yV(r).labelManager=new Ytr),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=yV(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}function bg(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function MO(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Zl(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}function Ztr(t,e,r){r||(r=function(h,p){return h===p}),t=t.slice(),e=e.slice();var n=e.length,i=t.length,a=1,o=n+i,s=[{newPos:-1,components:[]}],l=kme(s[0],e,t,0,r);if(s[0].newPos+1>=n&&l+1>=i){for(var c=[],u=0;u=n&&y+1>=i)return Qtr(p.components);s[h]=p}a++}for(;a<=o;){var d=f();if(d)return d}}function kme(t,e,r,n,i){for(var a=e.length,o=r.length,s=t.newPos,l=s-n,c=0;s+1-Nme}function err(t){var e=t.fill;return e!=null&&e!==y6}function trr(t){var e=t.stroke;return e!=null&&e!==y6}function Kre(t,e){e&&ha(t,"transform","matrix("+yk(e[0])+","+yk(e[1])+","+yk(e[2])+","+yk(e[3])+","+hg(e[4])+","+hg(e[5])+")")}function ha(t,e,r){(!r||r.type!=="linear"&&r.type!=="radial")&&t.setAttribute(e,r)}function rrr(t,e,r){t.setAttributeNS("http://www.w3.org/1999/xlink",e,r)}function nrr(t,e,r){t.setAttributeNS("http://www.w3.org/XML/1998/namespace",e,r)}function Zre(t,e,r){var n=e.opacity==null?1:e.opacity;if(r instanceof Io){ha(t,"opacity",n+"");return}if(err(e)){var i=MO(e.fill);ha(t,"fill",i.color),ha(t,"fill-opacity",(e.fillOpacity!=null?e.fillOpacity*i.opacity*n:i.opacity*n)+"")}else ha(t,"fill",y6);if(trr(e)){var a=MO(e.stroke);ha(t,"stroke",a.color);var o=e.lineWidth,s=e.strokeNoScale?r.getLineScale():1;ha(t,"stroke-width",(s?o/s:0)+""),ha(t,"paint-order",e.strokeFirst?"stroke":"fill"),ha(t,"stroke-opacity",(e.strokeOpacity!=null?e.strokeOpacity*a.opacity*n:a.opacity*n)+"");var l=e.lineDash&&o>0&&Nre(e.lineDash,o);if(l){var c=e.lineDashOffset;s&&s!==1&&(l=ft(l,function(u){return u/s}),c&&(c/=s,c=KB(c))),ha(t,"stroke-dasharray",l.join(",")),ha(t,"stroke-dashoffset",(c||0)+"")}else ha(t,"stroke-dasharray",y6);e.lineCap&&ha(t,"stroke-linecap",e.lineCap),e.lineJoin&&ha(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&ha(t,"stroke-miterlimit",e.miterLimit+"")}else ha(t,"stroke",y6)}var irr=function(){function t(){}return t.prototype.reset=function(){this._d=[],this._str=""},t.prototype.moveTo=function(e,r){this._add("M",e,r)},t.prototype.lineTo=function(e,r){this._add("L",e,r)},t.prototype.bezierCurveTo=function(e,r,n,i,a,o){this._add("C",e,r,n,i,a,o)},t.prototype.quadraticCurveTo=function(e,r,n,i){this._add("Q",e,r,n,i)},t.prototype.arc=function(e,r,n,i,a,o){this.ellipse(e,r,n,n,0,i,a,o)},t.prototype.ellipse=function(e,r,n,i,a,o,s,l){var c=this._d.length===0,u=s-o,f=!l,d=Math.abs(u),h=Ome(d-rm)||(f?u>=rm:-u>=rm),p=u>0?u%rm:u%rm+rm,g=!1;h?g=!0:Ome(d)?g=!1:g=p>=LPe==!!f;var v=hg(e+n*Mme(o)),y=hg(r+i*Rme(o));h&&(f?u=rm-1e-4:u=-rm+1e-4,g=!0,c&&this._d.push("M",v,y));var m=hg(e+n*Mme(o+u)),b=hg(r+i*Rme(o+u));if(isNaN(v)||isNaN(y)||isNaN(n)||isNaN(i)||isNaN(a)||isNaN(Dme)||isNaN(m)||isNaN(b))return"";this._d.push("A",hg(n),hg(i),KB(a*Dme),+g,+f,m,b)},t.prototype.rect=function(e,r,n,i){this._add("M",e,r),this._add("L",e+n,r),this._add("L",e+n,r+i),this._add("L",e,r+i),this._add("L",e,r),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(e,r,n,i,a,o,s,l,c){this._d.push(e);for(var u=1;u=0;--s)if(o[s]===a)return!0;return!1}),i}else return null;else return n[0]},t.prototype.doUpdate=function(e,r){if(e){var n=this.getDefs(!1);if(e[this._domName]&&n.contains(e[this._domName]))typeof r=="function"&&r(e);else{var i=this.add(e);i&&(e[this._domName]=i)}}},t.prototype.add=function(e){return null},t.prototype.addDom=function(e){var r=this.getDefs(!0);e.parentNode!==r&&r.appendChild(e)},t.prototype.removeDom=function(e){var r=this.getDefs(!1);r&&e[this._domName]&&(r.removeChild(e[this._domName]),e[this._domName]=null)},t.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var r=[];return te(this._tagNames,function(n){for(var i=e.getElementsByTagName(n),a=0;a-1){var c=Zl(l)[3],u=yIe(l);s.setAttribute("stop-color","#"+u),s.setAttribute("stop-opacity",c+"")}else s.setAttribute("stop-color",i[a].color);n.appendChild(s)}r.__dom=n},e.prototype.markUsed=function(r){if(r.style){var n=r.style.fill;n&&n.__dom&&t.prototype.markDomUsed.call(this,n.__dom),n=r.style.stroke,n&&n.__dom&&t.prototype.markDomUsed.call(this,n.__dom)}},e}(ZB);function O4(t){return t&&(!!t.image||!!t.svgElement)}var L4=new Mke,lrr=function(t){hi(e,t);function e(r,n){return t.call(this,r,n,["pattern"],"__pattern_in_use__")||this}return e.prototype.addWithoutUpdate=function(r,n){if(n&&n.style){var i=this;te(["fill","stroke"],function(a){var o=n.style[a];if(O4(o)){var s=i.getDefs(!0),l=L4.get(o);l?s.contains(l)||i.addDom(l):l=i.add(o),i.markUsed(n);var c=l.getAttribute("id");r.setAttribute(a,"url(#"+c+")")}})}},e.prototype.add=function(r){if(O4(r)){var n=this.createElement("pattern");return r.id=r.id==null?this.nextId++:r.id,n.setAttribute("id","zr"+this._zrId+"-pattern-"+r.id),n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("patternUnits","userSpaceOnUse"),this.updateDom(r,n),this.addDom(n),n}},e.prototype.update=function(r){if(O4(r)){var n=this;this.doUpdate(r,function(){var i=L4.get(r);n.updateDom(r,i)})}},e.prototype.updateDom=function(r,n){var i=r.svgElement;if(i instanceof SVGElement)i.parentNode!==n&&(n.innerHTML="",n.appendChild(i),n.setAttribute("width",r.svgWidth+""),n.setAttribute("height",r.svgHeight+""));else{var a=void 0,o=n.getElementsByTagName("image");if(o.length)if(r.image)a=o[0];else{n.removeChild(o[0]);return}else r.image&&(a=this.createElement("image"));if(a){var s=void 0,l=r.image;if(typeof l=="string"?s=l:l instanceof HTMLImageElement?s=l.src:l instanceof HTMLCanvasElement&&(s=l.toDataURL()),s){a.setAttribute("href",s),a.setAttribute("x","0"),a.setAttribute("y","0");var c={dirty:function(){}},u=ure(s,a,c,function(y){n.setAttribute("width",y.width+""),n.setAttribute("height",y.height+"")});u&&u.width&&u.height&&(n.setAttribute("width",u.width+""),n.setAttribute("height",u.height+"")),n.appendChild(a)}}}var f=r.x||0,d=r.y||0,h=(r.rotation||0)/Math.PI*180,p=r.scaleX||1,g=r.scaleY||1,v="translate("+f+", "+d+") rotate("+h+") scale("+p+", "+g+")";n.setAttribute("patternTransform",v),L4.set(r,n)},e.prototype.markUsed=function(r){r.style&&(O4(r.style.fill)&&t.prototype.markDomUsed.call(this,L4.get(r.style.fill)),O4(r.style.stroke)&&t.prototype.markDomUsed.call(this,L4.get(r.style.stroke)))},e}(ZB);function crr(t){var e=[];if(t)for(var r=0;r0}var urr=function(t){hi(e,t);function e(r,n){var i=t.call(this,r,n,"clipPath","__clippath_in_use__")||this;return i._refGroups={},i._keyDuplicateCount={},i}return e.prototype.markAllUnused=function(){t.prototype.markAllUnused.call(this);var r=this._refGroups;for(var n in r)r.hasOwnProperty(n)&&this.markDomUnused(r[n]);this._keyDuplicateCount={}},e.prototype._getClipPathGroup=function(r,n){if(FPe(r)){var i=r.__clipPaths,a=this._keyDuplicateCount,o=crr(i);return Dke(i,n&&n.__clipPaths)&&(a[o]=a[o]||0,a[o]&&(o+="-"+a[o]),a[o]++),this._refGroups[o]||(this._refGroups[o]=this.createElement("g"))}},e.prototype.update=function(r,n){var i=this._getClipPathGroup(r,n);return i&&(this.markDomUsed(i),this.updateDom(i,r.__clipPaths)),i},e.prototype.updateDom=function(r,n){if(n&&n.length>0){var i=this.getDefs(!0),a=n[0],o=void 0,s=void 0;a._dom?(s=a._dom.getAttribute("id"),o=a._dom,i.contains(o)||i.appendChild(o)):(s="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,o=this.createElement("clipPath"),o.setAttribute("id",s),i.appendChild(o),a._dom=o);var l=this.getSvgProxy(a);l.brush(a);var c=this.getSvgElement(a);o.innerHTML="",o.appendChild(c),r.setAttribute("clip-path","url(#"+s+")"),n.length>1&&this.updateDom(o,n.slice(1))}else r&&r.setAttribute("clip-path","none")},e.prototype.markUsed=function(r){var n=this;r.__clipPaths&&te(r.__clipPaths,function(i){i._dom&&t.prototype.markDomUsed.call(n,i._dom)})},e.prototype.removeUnused=function(){t.prototype.removeUnused.call(this);var r={},n=this._refGroups;for(var i in n)if(n.hasOwnProperty(i)){var a=n[i];this.isDomUnused(a)?a.parentNode&&a.parentNode.removeChild(a):r[i]=a}this._refGroups=r},e}(ZB),frr=function(t){hi(e,t);function e(r,n){var i=t.call(this,r,n,["filter"],"__filter_in_use__","_shadowDom")||this;return i._shadowDomMap={},i._shadowDomPool=[],i}return e.prototype._getFromPool=function(){var r=this._shadowDomPool.pop();if(!r){r=this.createElement("filter"),r.setAttribute("id","zr"+this._zrId+"-shadow-"+this.nextId++);var n=this.createElement("feDropShadow");r.appendChild(n),this.addDom(r)}return r},e.prototype.update=function(r,n){var i=n.style;if(drr(i)){var a=hrr(n),o=n._shadowDom=this._shadowDomMap[a];o||(o=this._getFromPool(),this._shadowDomMap[a]=o),this.updateDom(r,n,o)}else this.remove(r,n)},e.prototype.remove=function(r,n){n._shadowDom!=null&&(n._shadowDom=null,r.removeAttribute("filter"))},e.prototype.updateDom=function(r,n,i){var a=i.children[0],o=n.style,s=n.getGlobalScale(),l=s[0],c=s[1];if(!(!l||!c)){var u=o.shadowOffsetX||0,f=o.shadowOffsetY||0,d=o.shadowBlur,h=MO(o.shadowColor);a.setAttribute("dx",u/l+""),a.setAttribute("dy",f/c+""),a.setAttribute("flood-color",h.color),a.setAttribute("flood-opacity",h.opacity+"");var p=d/2/l,g=d/2/c,v=p+" "+g;a.setAttribute("stdDeviation",v),i.setAttribute("x","-100%"),i.setAttribute("y","-100%"),i.setAttribute("width","300%"),i.setAttribute("height","300%"),n._shadowDom=i;var y=i.getAttribute("id");r.setAttribute("filter","url(#"+y+")")}},e.prototype.removeUnused=function(){var r=this.getDefs(!1);if(r){var n=this._shadowDomPool,i=this._shadowDomMap;for(var a in i)i.hasOwnProperty(a)&&n.push(i[a]);this._shadowDomMap={}}},e}(ZB);function drr(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function hrr(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function wk(t){return parseInt(t,10)}function Ume(t){return t instanceof rn?DO:t instanceof Io?$Pe:t instanceof A2?BPe:DO}function jPe(t,e){return e&&t&&e.parentNode!==t}function zme(t,e,r){if(jPe(t,e)&&r){var n=r.nextSibling;n?t.insertBefore(e,n):t.appendChild(e)}}function Hme(t,e){if(jPe(t,e)){var r=t.firstChild;r?t.insertBefore(e,r):t.appendChild(e)}}function prr(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)}function grr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function $4(t){return t.__svgEl}var vrr=function(){function t(e,r,n,i){this.type="svg",this.refreshHover=wV("refreshHover"),this.pathToImage=wV("pathToImage"),this.configLayer=wV("configLayer"),this.root=e,this.storage=r,this._opts=n=st({},n||{});var a=bg("svg");a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttribute("version","1.1"),a.setAttribute("baseProfile","full"),a.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=bg("g");a.appendChild(o);var s=bg("g");a.appendChild(s),this._gradientManager=new srr(i,s),this._patternManager=new lrr(i,s),this._clipPathManager=new urr(i,s),this._shadowManager=new frr(i,s);var l=document.createElement("div");l.style.cssText="overflow:hidden;position:relative",this._svgDom=a,this._svgRoot=s,this._backgroundRoot=o,this._viewport=l,e.appendChild(l),l.appendChild(a),this.resize(n.width,n.height),this._visibleList=[]}return t.prototype.getType=function(){return"svg"},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.getSvgRoot=function(){return this._svgRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},t.prototype.setBackgroundColor=function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var r=bg("rect");r.setAttribute("width",this.getWidth()),r.setAttribute("height",this.getHeight()),r.setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("id",0);var n=MO(e),i=n.color,a=n.opacity;r.setAttribute("fill",i),r.setAttribute("fill-opacity",a),this._backgroundRoot.appendChild(r),this._backgroundNode=r},t.prototype.createSVGElement=function(e){return bg(e)},t.prototype.paintOne=function(e){var r=Ume(e);return r&&r.brush(e),$4(e)},t.prototype._paintList=function(e){var r=this._gradientManager,n=this._patternManager,i=this._clipPathManager,a=this._shadowManager;r.markAllUnused(),n.markAllUnused(),i.markAllUnused(),a.markAllUnused();for(var o=this._svgRoot,s=this._visibleList,l=e.length,c=[],u=0;u -\r<`));return"data:image/svg+xml;charset=UTF-8,"+n},t}();function wV(t){return function(){Dg('In SVG mode painter not support method "'+t+'"')}}function mrr(t){t.registerPainter("svg",vrr)}function yrr(){return!1}function Vme(t,e,r){var n=G5(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var bV=function(t){hi(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||sO,typeof r=="string"?o=Vme(r,n,i):dr(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(o.onselectstart=yrr,s.webkitUserSelect="none",s.userSelect="none",s.webkitTapHighlightColor="rgba(0,0,0,0)",s["-webkit-touch-callout"]="none",s.padding="0",s.margin="0",s.borderWidth="0"),a.domBack=null,a.ctxBack=null,a.painter=n,a.config=null,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=Vme("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,c=new tn(0,0,0,0);function u(m){if(!(!m.isFinite()||m.isZero()))if(o.length===0){var b=new tn(0,0,0,0);b.copy(m),o.push(b)}else{for(var w=!1,C=1/0,A=0,S=0;S=s)}}for(var f=this.__startIndex;f15)break}}T.prevElClipPaths&&y.restore()};if(m)if(m.length===0)I=v.__endIndex;else for(var L=h.dpr,O=0;O0&&e>i[0]){for(l=0;le);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var c=s.dom;c.nextSibling?o.insertBefore(r.dom,c.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.__painter=this},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i0?bk:0),this._needsManuallyCompositing),u.__builtin__||Dg("ZLevel "+c+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==l&&(u.__dirty=!0),u.__startIndex=l,u.incremental?u.__drawIndex=-1:u.__drawIndex=l,r(l),a=u),i.__dirty&iu&&!i.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,d){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,te(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?$r(n[e],r,!0):n[e]=r;for(var i=0;i-1&&(c.style.stroke=c.style.fill,c.style.fill="#fff",c.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={zlevel:0,z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0,lineStyle:{width:"bolder"}},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Mi);function K5(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Y5(t,e,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(e[a])}return n.join(" ")}var x9=function(t){Ge(e,t);function e(r,n,i,a){var o=t.call(this)||this;return o.updateData(r,n,i,a),o}return e.prototype._createSymbol=function(r,n,i,a,o){this.removeAll();var s=bo(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=Arr,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Vp(this.childAt(0))},e.prototype.downplay=function(){Gp(this.childAt(0))},e.prototype.setZ=function(r,n){var i=this.childAt(0);i.zlevel=r,i.z=n},e.prototype.setDraggable=function(r){var n=this.childAt(0);n.draggable=r,n.cursor=r?"move":n.cursor},e.prototype.updateData=function(r,n,i,a){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),c=o!==this._symbolType,u=a&&a.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,f)}else{var d=this.childAt(0);d.silent=!1;var h={scaleX:l[0]/2,scaleY:l[1]/2};u?d.attr(h):Mn(d,h,s,n),Sh(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!u){var h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,la(d,h,s,n)}}u&&this.childAt(0).stopAnimation("remove"),this._seriesModel=s},e.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,c,u,f,d,h,p,g,v;if(a&&(c=a.emphasisItemStyle,u=a.blurItemStyle,f=a.selectItemStyle,d=a.focus,h=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,v=a.cursorStyle),!a||r.hasItemOption){var y=a&&a.itemModel?a.itemModel:r.getItemModel(n),m=y.getModel("emphasis");c=m.getModel("itemStyle").getItemStyle(),f=y.getModel(["select","itemStyle"]).getItemStyle(),u=y.getModel(["blur","itemStyle"]).getItemStyle(),d=m.get("focus"),h=m.get("blurScope"),p=ds(y),g=m.getShallow("scale"),v=y.getShallow("cursor")}var b=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(b||0)*Math.PI/180||0);var w=rC(r.getItemVisual(n,"symbolOffset"),i);w&&(s.x=w[0],s.y=w[1]),v&&s.attr("cursor",v);var C=r.getItemVisual(n,"style"),A=C.fill;if(s instanceof Io){var S=s.style;s.useStyle(st({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},C))}else s.__isEmptyBrush?s.useStyle(st({},C)):s.useStyle(C),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),D=this._z2;I!=null?D==null&&(this._z2=s.z2,s.z2+=I):D!=null&&(s.z2=D,this._z2=null);var L=o&&o.useNameLabel;wl(s,p,{labelFetcher:l,labelDataIndex:n,defaultText:O,inheritColor:A,defaultOpacity:C.opacity});function O(T){return L?r.getName(T):K5(r,T)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var P=s.ensureState("emphasis");if(P.style=c,s.ensureState("select").style=f,s.ensureState("blur").style=u,g){var x=Math.max(1.1,3/this._sizeY);P.scaleX=this._sizeX*x,P.scaleY=this._sizeY*x}this.setSymbolScale(1),Ri(this,d,h)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n){var i=this.childAt(0),a=this._seriesModel,o=br(this).dataIndex,s=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var l=i.getTextContent();l&&Y1(l,{style:{opacity:0}},a,{dataIndex:o,removeOpt:s,cb:function(){i.removeTextContent()}})}else i.removeTextContent();Y1(i,{style:{opacity:0},scaleX:0,scaleY:0},a,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return m9(r.getItemVisual(n,"symbolSize"))},e}(fr);function Arr(t,e){this.parent.drift(t,e)}function xV(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Wme(t){return t!=null&&!dr(t)&&(t={isIgnore:t}),t||{}}function qme(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),hoverScale:r.get("scale"),labelStatesModels:ds(e),cursorStyle:e.get("cursor")}}var _9=function(){function t(e){this.group=new fr,this._SymbolCtor=e||x9}return t.prototype.updateData=function(e,r){r=Wme(r);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=qme(e),c={disableAnimation:s},u=r.getSymbolPoint||function(f){return e.getItemLayout(f)};a||n.removeAll(),e.diff(a).add(function(f){var d=u(f);if(xV(e,d,f,r)){var h=new o(e,f,l,c);h.setPosition(d),e.setItemGraphicEl(f,h),n.add(h)}}).update(function(f,d){var h=a.getItemGraphicEl(d),p=u(f);if(!xV(e,p,f,r)){n.remove(h);return}var g=e.getItemVisual(f,"symbol")||"circle",v=h&&h.getSymbolType&&h.getSymbolType();if(!h||v&&v!==g)n.remove(h),h=new o(e,f,l,c),h.setPosition(p);else{h.updateData(e,f,l,c);var y={x:p[0],y:p[1]};s?h.attr(y):Mn(h,y,i)}n.add(h),e.setItemGraphicEl(f,h)}).remove(function(f){var d=a.getItemGraphicEl(f);d&&d.fadeOut(function(){n.remove(d)})}).execute(),this._getSymbolPoint=u,this._data=e},t.prototype.isPersistent=function(){return!0},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(n,i){var a=e._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=qme(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){n=Wme(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?r=n[0]:n[1]<0&&(r=n[1]),r}function HPe(t,e,r,n){var i=NaN;t.stacked&&(i=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=r.get(t.baseDim,n),o[1-a]=i,e.dataToPoint(o)}var VPe=typeof Float32Array<"u",Err=VPe?Float32Array:Array;function e3(t){return lt(t)?VPe?new Float32Array(t):t:new Err(t)}function Irr(t,e){var r=[];return e.diff(t).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,i){r.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function krr(t,e,r,n,i,a,o,s){for(var l=Irr(t,e),c=[],u=[],f=[],d=[],h=[],p=[],g=[],v=zPe(i,e,o),y=t.getLayout("points")||[],m=e.getLayout("points")||[],b=0;b=i||g<0)break;if(Ab(y,m)){if(l){g+=a;continue}break}if(g===r)t[a>0?"moveTo":"lineTo"](y,m),f=y,d=m;else{var b=y-c,w=m-u;if(b*b+w*w<.5){g+=a;continue}if(o>0){for(var C=g+a,A=e[C*2],S=e[C*2+1];A===y&&S===m&&v=n||Ab(A,S))h=y,p=m;else{L=A-c,O=S-u;var T=y-c,E=A-y,N=m-u,F=S-m,B=void 0,j=void 0;s==="x"?(B=Math.abs(T),j=Math.abs(E),h=y-B*o,p=m,P=y+B*o,x=m):s==="y"?(B=Math.abs(N),j=Math.abs(F),h=y,p=m-B*o,P=y,x=m+B*o):(B=Math.sqrt(T*T+N*N),j=Math.sqrt(E*E+F*F),D=j/(j+B),h=y-L*o*(1-D),p=m-O*o*(1-D),P=y+L*o*D,x=m+O*o*D,P=nm(P,im(A,y)),x=nm(x,im(S,m)),P=im(P,nm(A,y)),x=im(x,nm(S,m)),L=P-y,O=x-m,h=y-L*B/j,p=m-O*B/j,h=nm(h,im(c,y)),p=nm(p,im(u,m)),h=im(h,nm(c,y)),p=im(p,nm(u,m)),L=y-h,O=m-p,P=y+L*j/B,x=m+O*j/B)}t.bezierCurveTo(f,d,h,p,y,m),f=P,d=x}else t.lineTo(y,m)}c=y,u=m,g+=a}return v}var GPe=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),Prr=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new GPe},e.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Ab(i[o*2-2],i[o*2-1]);o--);for(;a=0){var w=c?(p-l)*b+l:(h-s)*b+s;return c?[r,w]:[w,r]}s=h,l=p;break;case o.C:h=a[f++],p=a[f++],g=a[f++],v=a[f++],y=a[f++],m=a[f++];var C=c?eZ(s,h,g,y,r,u):eZ(l,p,v,m,r,u);if(C>0)for(var A=0;A=0){var w=c?ka(l,p,v,m,S):ka(s,h,g,y,S);return c?[r,w]:[w,r]}}s=y,l=m;break}}},e}(rn),Rrr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(GPe),WPe=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new Rrr},e.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Ab(i[s*2-2],i[s*2-1]);s--);for(;oe){a?r.push(o(a,l,e)):i&&r.push(o(i,l,0),o(i,l,e));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function Nrr(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=e.getAxis(i),c=ft(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),u=c.length,f=a.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),f.reverse());var d=Drr(c,i==="x"?r.getWidth():r.getHeight()),h=d.length;if(!h&&u)return c[0].coord<0?f[1]?f[1]:c[u-1].color:f[0]?f[0]:c[0].color;var p=10,g=d[0].coord-p,v=d[h-1].coord+p,y=v-g;if(y<.001)return"transparent";te(d,function(b){b.offset=(b.coord-g)/y}),d.push({offset:h?d[h-1].offset:.5,color:f[1]||"transparent"}),d.unshift({offset:h?d[0].offset:.5,color:f[0]||"transparent"});var m=new Nh(0,0,0,0,d,!0);return m[i]=g,m[i+"2"]=v,m}}}function Orr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&Lrr(a,e))){var o=e.mapDimension(a.dim),s={};return te(a.getViewLabels(),function(l){var c=a.scale.getRawOrdinalNumber(l.tickValue);s[c]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function Lrr(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function $rr(t,e){return isNaN(t)||isNaN(e)}function Brr(t){for(var e=t.length/2;e>0&&$rr(t[e*2-2],t[e*2-1]);e--);return e-1}function Xme(t,e){return[t[e*2],t[e*2+1]]}function Frr(t,e,r){for(var n=t.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,c=0;c=e||a>=e&&o<=e){l=c;break}s=c,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function KPe(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var F=g.getState("emphasis").style;F.lineWidth=+g.style.lineWidth+1}br(g).seriesIndex=r.seriesIndex,Ri(g,E,N);var B=Qme(r.get("smooth")),j=r.get("smoothMonotone"),k=r.get("connectNulls");if(g.setShape({smooth:B,smoothMonotone:j,connectNulls:k}),v){var $=l.getCalculationInfo("stackedOnSeries"),H=0;v.useStyle(tr(u.getAreaStyle(),{fill:P,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),$&&(H=Qme($.get("smooth"))),v.setShape({smooth:B,stackedOnSmooth:H,smoothMonotone:j,connectNulls:k}),Os(v,r,"areaStyle"),br(v).seriesIndex=r.seriesIndex,Ri(v,E,N)}var Y=function(ie){a._changePolyState(ie)};l.eachItemGraphicEl(function(ie){ie&&(ie.onHoverStateChange=Y)}),this._polyline.onHoverStateChange=Y,this._data=l,this._coordSys=o,this._stackedOnPoints=A,this._points=f,this._step=L,this._valueOrigin=w,r.get("triggerLineEvent")&&(this.packEventData(r,g),v&&this.packEventData(r,v))},e.prototype.packEventData=function(r,n){br(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,n,i,a){var o=r.getData(),s=S2(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),c=o.getItemGraphicEl(s);if(!c){var u=l[s*2],f=l[s*2+1];if(isNaN(u)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(u,f))return;var d=r.get("zlevel"),h=r.get("z");c=new x9(o,s),c.x=u,c.y=f,c.setZ(d,h);var p=c.getSymbolPath().getTextContent();p&&(p.zlevel=d,p.z=h,p.z2=this._polyline.z2+1),c.__temp=!0,o.setItemGraphicEl(s,c),c.stopSymbolAnimation(!0),this.group.add(c)}c.highlight()}else xi.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=S2(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else xi.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;fO(this._polyline,r),n&&fO(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Prr({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new WPe({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var c=r.hostModel,u=c.get("animationDuration");typeof u=="function"&&(u=u(null));var f=c.get("animationDelay")||0,d=typeof f=="function"?f(null):f;r.eachItemGraphicEl(function(h,p){var g=h;if(g){var v=[h.x,h.y],y=void 0,m=void 0,b=void 0;if(i)if(o){var w=i,C=n.pointToCoord(v);a?(y=w.startAngle,m=w.endAngle,b=-C[1]/180*Math.PI):(y=w.r0,m=w.r,b=C[0])}else{var A=i;a?(y=A.x,m=A.x+A.width,b=h.x):(y=A.y+A.height,m=A.y,b=h.y)}var S=m===y?0:(b-y)/(m-y);l&&(S=1-S);var I=typeof f=="function"?f(p):u*S+d,D=g.getSymbolPath(),L=D.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:I}),L&&L.animateFrom({style:{opacity:0}},{duration:300,delay:I}),D.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(KPe(r)){var o=r.getData(),s=this._polyline,l=this._endLabel;l||(l=this._endLabel=new Bn({z2:200}),l.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=Brr(o.getLayout("points"));c>=0&&(wl(s,ds(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(u,f,d){return d!=null?UPe(o,d):K5(o,u)},enableTextSetter:!0},jrr(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,i,a,o,s,l){var c=this._endLabel,u=this._polyline;if(c){r<1&&a.originalX==null&&(a.originalX=c.x,a.originalY=c.y);var f=i.getLayout("points"),d=i.hostModel,h=d.get("connectNulls"),p=s.get("precision"),g=s.get("distance")||0,v=l.getBaseAxis(),y=v.isHorizontal(),m=v.inverse,b=n.shape,w=m?y?b.x:b.y+b.height:y?b.x+b.width:b.y,C=(y?g:0)*(m?-1:1),A=(y?0:-g)*(m?-1:1),S=y?"x":"y",I=Frr(f,w,S),D=I.range,L=D[1]-D[0],O=void 0;if(L>=1){if(L>1&&!h){var P=Xme(f,D[0]);c.attr({x:P[0]+C,y:P[1]+A}),o&&(O=d.getRawValue(D[0]))}else{var P=u.getPointOn(w,S);P&&c.attr({x:P[0]+C,y:P[1]+A});var x=d.getRawValue(D[0]),T=d.getRawValue(D[1]);o&&(O=LIe(i,p,x,T,I.t))}a.lastFrameIndex=D[0]}else{var E=r===1||a.lastFrameIndex>0?D[0]:0,P=Xme(f,E);o&&(O=d.getRawValue(E)),c.attr({x:P[0]+C,y:P[1]+A})}o&&ZS(c).setLabelText(O)}},e.prototype._doUpdateAnimation=function(r,n,i,a,o,s){var l=this._polyline,c=this._polygon,u=r.hostModel,f=krr(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=f.current,h=f.stackedOnCurrent,p=f.next,g=f.stackedOnNext;if(o&&(d=am(f.current,i,o),h=am(f.stackedOnCurrent,i,o),p=am(f.next,i,o),g=am(f.stackedOnNext,i,o)),Zme(d,p)>3e3||c&&Zme(h,g)>3e3){l.stopAnimation(),l.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:g}));return}l.shape.__points=f.current,l.shape.points=d;var v={shape:{points:p}};f.current!==d&&(v.shape.__points=f.next),l.stopAnimation(),Mn(l,v,u),c&&(c.setShape({points:d,stackedOnPoints:h}),c.stopAnimation(),Mn(c,{shape:{stackedOnPoints:g}},u),l.shape.points!==c.shape.points&&(c.shape.points=l.shape.points));for(var y=[],m=f.status,b=0;be&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),c=o.getOtherAxis(l),u=l.getExtent(),f=n.getDevicePixelRatio(),d=Math.abs(u[1]-u[0])*(f||1),h=Math.round(s/d);if(h>1){a==="lttb"&&e.setData(i.lttbDownSample(i.mapDimension(c.dim),1/h));var p=void 0;typeof a=="string"?p=zrr[a]:typeof a=="function"&&(p=a),p&&e.setData(i.downSample(i.mapDimension(c.dim),1/h,p,Hrr))}}}}}function Vrr(t){t.registerChartView(Urr),t.registerSeriesModel(Crr),t.registerLayout(S9("line",!0)),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,ZPe("line"))}var DE=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return kv(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(r){var n=this.coordinateSystem;if(n&&n.clampData){var i=n.dataToPoint(n.clampData(r)),a=this.getData(),o=a.getLayout("offset"),s=a.getLayout("size"),l=n.getBaseAxis().isHorizontal()?0:1;return i[l]+=o+s/2,i}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Mi);Mi.registerClass(DE);var Grr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return kv(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},e.prototype.brushSelector=function(r,n,i){return i.rect(n.getItemLayout(r))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Sy(DE.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(DE),Wrr=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t}(),NO=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new Wrr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,c=o+l,u=n.startAngle,f=n.endAngle,d=n.clockwise,h=Math.cos(u),p=Math.sin(u),g=Math.cos(f),v=Math.sin(f),y=d?f-uMath.PI/2&&us)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,i=this._data;r&&r.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){CE(a,r,br(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(xi),Jme={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var i=t.x+t.width,a=t.y+t.height,o=SV(e.x,t.x),s=CV(e.x+e.width,i),l=SV(e.y,t.y),c=CV(e.y+e.height,a),u=si?s:o,e.y=f&&l>a?c:l,e.width=u?0:s-o,e.height=f?0:c-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),u||f},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var i=CV(e.r,t.r),a=SV(e.r0,t.r0);e.r=i,e.r0=a;var o=i-a<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},e1e={cartesian2d:function(t,e,r,n,i,a,o,s,l){var c=new In({shape:st({},n),z2:1});if(c.__dataIndex=r,c.name="item",a){var u=c.shape,f=i?"height":"width";u[f]=0}return c},polar:function(t,e,r,n,i,a,o,s,l){var c=!i&&l?NO:Xl,u=new c({shape:n,z2:1});u.name="item";var f=QPe(i);if(u.calculateTextPosition=qrr(f,{isRoundCap:c===NO}),a){var d=u.shape,h=i?"r":"endAngle",p={};d[h]=i?0:n.startAngle,p[h]=n[h],(s?Mn:la)(u,{shape:p},a)}return u}};function Qrr(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function t1e(t,e,r,n,i,a,o,s){var l,c;a?(c={x:n.x,width:n.width},l={y:n.y,height:n.height}):(c={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?Mn:la)(r,{shape:l},e,i,null);var u=e?t.baseAxis.model:null;(o?Mn:la)(r,{shape:c},u,i)}function r1e(t,e){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function enr(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function QPe(t){return function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}}(t)}function i1e(t,e,r,n,i,a,o,s){var l=e.getItemVisual(r,"style");s||t.setShape("r",n.get(["itemStyle","borderRadius"])||0),t.useStyle(l);var c=n.getShallow("cursor");c&&t.attr("cursor",c);var u=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",f=ds(n);wl(t,f,{labelFetcher:a,labelDataIndex:r,defaultText:K5(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:u});var d=t.getTextContent();if(s&&d){var h=n.get(["label","position"]);t.textConfig.inside=h==="middle"?!0:null,Yrr(t,h==="outside"?u:h,QPe(o),n.get(["label","rotate"]))}I7e(d,f,a.getRawValue(r),function(g){return UPe(e,g)});var p=n.getModel(["emphasis"]);Ri(t,p.get("focus"),p.get("blurScope")),Os(t,n),enr(i)&&(t.style.fill="none",t.style.stroke="none",te(t.states,function(g){g.style&&(g.style.fill=g.style.stroke="none")}))}function tnr(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,i,a)}var rnr=function(){function t(){}return t}(),a1e=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new rnr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.__startPoint,o=this.__baseDimIdx,s=0;s=0?r:null},30,!1);function nnr(t,e,r){var n=t.__baseDimIdx,i=1-n,a=t.shape.points,o=t.__largeDataIndices,s=Math.abs(t.__barWidth/2),l=t.__startPoint[i];Ck[0]=e,Ck[1]=r;for(var c=Ck[n],u=Ck[1-n],f=c-s,d=c+s,h=0,p=a.length/2;h=f&&v<=d&&(l<=y?u>=l&&u<=y:u>=y&&u<=l))return o[h]}return-1}function inr(t,e,r){var n=r.getVisual("style");t.useStyle(st({},n)),t.style.fill=null,t.style.stroke=n.fill,t.style.lineWidth=r.getLayout("barWidth")}function anr(t,e,r){var n=e.get("borderColor")||e.get("color"),i=e.getItemStyle();t.useStyle(i),t.style.fill=null,t.style.stroke=n,t.style.lineWidth=r.getLayout("barWidth")}function XPe(t,e,r){if($g(r,"cartesian2d")){var n=e,i=r.getArea();return{x:t?n.x:i.x,y:t?i.y:n.y,width:t?n.width:i.width,height:t?i.height:n.height}}else{var i=r.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:t?i.r0:a.r0,r:t?i.r:a.r,startAngle:t?a.startAngle:0,endAngle:t?a.endAngle:Math.PI*2}}}function onr(t,e,r){var n=t.type==="polar"?Xl:In;return new n({shape:XPe(e,r,t),silent:!0,z2:0})}function snr(t){t.registerChartView(Zrr),t.registerSeriesModel(Grr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Er(vPe,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,ltr),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,ZPe("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var Tk=Math.PI*2,l1e=Math.PI/180;function JPe(t,e){return Eo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function eRe(t,e){var r=JPe(t,e),n=t.get("center"),i=t.get("radius");lt(i)||(i=[0,i]),lt(n)||(n=[n,n]);var a=xt(r.width,e.getWidth()),o=xt(r.height,e.getHeight()),s=Math.min(a,o),l=xt(n[0],a)+r.x,c=xt(n[1],o)+r.y,u=xt(i[0],s/2),f=xt(i[1],s/2);return{cx:l,cy:c,r0:u,r:f}}function lnr(t,e,r){e.eachSeriesByType(t,function(n){var i=n.getData(),a=i.mapDimension("value"),o=JPe(n,r),s=eRe(n,r),l=s.cx,c=s.cy,u=s.r,f=s.r0,d=-n.get("startAngle")*l1e,h=n.get("minAngle")*l1e,p=0;i.each(a,function(L){!isNaN(L)&&p++});var g=i.getSum(a),v=Math.PI/(g||p)*2,y=n.get("clockwise"),m=n.get("roseType"),b=n.get("stillShowZeroSum"),w=i.getDataExtent(a);w[0]=0;var C=Tk,A=0,S=d,I=y?1:-1;if(i.setLayout({viewRect:o,r:u}),i.each(a,function(L,O){var P;if(isNaN(L)){i.setItemLayout(O,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:y,cx:l,cy:c,r0:f,r:m?NaN:u});return}m!=="area"?P=g===0&&b?v:L*v:P=Tk/p,Pr?y:v,C=Math.abs(b.label.y-r);if(C>w.maxY){var A=b.label.x-e-b.len2*i,S=n+b.len,I=Math.abs(A)0?"right":"left":H>0?"left":"right"}var Oe,nt=P.get("rotate");if(typeof nt=="number")Oe=nt*(Math.PI/180);else if(x==="center")Oe=0;else{var it=H<0?-$+Math.PI:-$;nt==="radial"||nt===!0?Oe=it:nt==="tangential"&&x!=="outside"&&x!=="outer"?(Oe=it+Math.PI/2,Oe>Math.PI/2&&(Oe-=Math.PI)):Oe=0}if(a=!!Oe,D.x=ie,D.y=W,D.rotation=Oe,D.setStyle({verticalAlign:"middle"}),ee){D.setStyle({align:J});var Ce=D.states.select;Ce&&(Ce.x+=D.x,Ce.y+=D.y)}else{var St=D.getBoundingRect().clone();St.applyTransform(D.getComputedTransform());var bt=(D.style.margin||0)+2.1;St.y-=bt/2,St.height+=bt,r.push({label:D,labelLine:L,position:x,len:j,len2:k,minTurnAngle:B.get("minTurnAngle"),maxSurfaceAngle:B.get("maxSurfaceAngle"),surfaceNormal:new Mr(H,Y),linePoints:Q,textAlign:J,labelDistance:T,labelAlignTo:E,edgeDistance:N,bleedMargin:F,rect:St})}S.setTextConfig({inside:ee})}}),!a&&t.get("avoidLabelOverlap")&&unr(r,n,i,l,c,d,u,f);for(var g=0;g0){for(var u=o.getItemLayout(0),f=1;isNaN(u&&u.startAngle)&&f=a.r0}},e.type="pie",e}(xi);function nC(t,e,r){e=lt(e)&&{coordDimensions:e}||st({encodeDefine:t.getEncode()},e);var n=t.getSource(),i=y9(n,e).dimensions,a=new Ul(i,t);return a.initData(n,r),a}var A9=function(){function t(e,r){this._getDataWithEncodedVisual=e,this._getRawData=r}return t.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},t.prototype.containName=function(e){var r=this._getRawData();return r.indexOfName(e)>=0},t.prototype.indexOfName=function(e){var r=this._getDataWithEncodedVisual();return r.indexOfName(e)},t.prototype.getItemVisual=function(e,r){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,r)},t}(),pnr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new A9(Mt(this.getData,this),Mt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return nC(this,{coordDimensions:["value"],encodeDefaulter:Er(Sre,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=t.prototype.getDataParams.call(this,r),a=[];return n.each(n.mapDimension("value"),function(o){a.push(o)}),i.percent=YYt(a,r,n.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},e.prototype._defaultLabelLine=function(r){_2(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},e.type="series.pie",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Mi);function gnr(t){return{seriesType:t,reset:function(e,r){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(typeof o=="number"&&!isNaN(o)&&o<0)})}}}function vnr(t){t.registerChartView(hnr),t.registerSeriesModel(pnr),Rke("pie",t.registerAction),t.registerLayout(Er(lnr,"pie")),t.registerProcessor(C9("pie")),t.registerProcessor(gnr("pie"))}var mnr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r,n){return kv(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(r,n,i){return i.point(n.getItemLayout(r))},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Mi),tRe=4,ynr=function(){function t(){}return t}(),AV=function(t){Ge(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new ynr},e.prototype.buildPath=function(r,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,c=l&&a[0]=0;c--){var u=c*2,f=a[u]-s/2,d=a[u+1]-l/2;if(r>=f&&n>=d&&r<=f+s&&n<=d+l)return c}return-1},e}(rn),wnr=function(){function t(){this.group=new fr}return t.prototype.isPersistent=function(){return!this._incremental},t.prototype.updateData=function(e,r){this.group.removeAll();var n=new AV({rectHover:!0,cursor:"default"});n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,!1,r),this.group.add(n),this._incremental=null},t.prototype.updateLayout=function(e){if(!this._incremental){var r=e.getLayout("points");this.group.eachChild(function(n){if(n.startIndex!=null){var i=(n.endIndex-n.startIndex)*2,a=n.startIndex*4*2;r=new Float32Array(r.buffer,a,i)}n.setShape("points",r)})}},t.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new IB({silent:!0})),this.group.add(this._incremental)):this._incremental=null},t.prototype.incrementalUpdate=function(e,r,n){var i;this._incremental?(i=new AV,this._incremental.addDisplayable(i,!0)):(i=new AV({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end}),i.incremental=!0,this.group.add(i)),i.setShape({points:r.getLayout("points")}),this._setCommon(i,r,!!this._incremental,n)},t.prototype._setCommon=function(e,r,n,i){var a=r.hostModel;i=i||{};var o=r.getVisual("symbolSize");e.setShape("size",o instanceof Array?o:[o,o]),e.softClipShape=i.clipShape||null,e.symbolProxy=bo(r.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var s=e.shape.size[0]=0&&(u.dataIndex=d+(e.startIndex||0))})}},t.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},t.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},t}(),bnr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.updateData(a,{clipShape:this._getClipShape(r)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=r.end===n.getData().count()},e.prototype.updateTransform=function(r,n,i){var a=r.getData();if(this.group.dirty(),!this._finished||a.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var o=S9("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype._getClipShape=function(r){var n=r.coordinateSystem,i=n&&n.getArea&&n.getArea();return r.get("clip",!0)?i:null},e.prototype._updateSymbolDraw=function(r,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new wnr:new _9,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(r,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(xi),xnr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(fn),IZ=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",yo).models[0]},e.type="cartesian2dAxis",e}(fn);xo(IZ,b9);var rRe={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},_nr=$r({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},rRe),Qre=$r({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},rRe),Snr=$r({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},Qre),Cnr=tr({scale:!0,logBase:10},Qre);const nRe={category:_nr,value:Qre,time:Snr,log:Cnr};var Anr={value:1,category:1,time:1,log:1};function Z5(t,e,r,n){te(Anr,function(i,a){var o=$r($r({},nRe[a],!0),n,!0),s=function(l){Ge(c,l);function c(){var u=l!==null&&l.apply(this,arguments)||this;return u.type=e+"Axis."+a,u}return c.prototype.mergeDefaultAndTheme=function(u,f){var d=EE(this),h=d?JS(u):{},p=f.getTheme();$r(u,p.get(a+"Axis")),$r(u,this.getDefaultOption()),u.type=f1e(u),d&&K1(u,h,d)},c.prototype.optionUpdated=function(){var u=this.option;u.type==="category"&&(this.__ordinalMeta=AZ.createByAxisModel(this))},c.prototype.getCategories=function(u){var f=this.option;if(f.type==="category")return u?f.data:this.__ordinalMeta.categories},c.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},c.type=e+"Axis."+a,c.defaultOption=o,c}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",f1e)}function f1e(t){return t.type||(t.data?"category":"value")}var Tnr=function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return ft(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),qi(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t}(),kZ=["x","y"];function d1e(t){return t.type==="interval"||t.type==="time"}var Enr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=kZ,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!d1e(r)||!d1e(n))){var i=r.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],c=a[1]-a[0];if(!(!l||!c)){var u=(s[0]-o[0])/l,f=(s[1]-o[1])/c,d=o[0]-i[0]*u,h=o[1]-a[0]*f,p=this._transform=[u,0,0,f,d,h];this._invTransform=WS([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&i.contain(i.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return us(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},e.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),c=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),c),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n){var i=[];if(this._invTransform)return us(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.toLocalCoord(r[1]),n),i},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(){var r=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(r[0],r[1]),a=Math.min(n[0],n[1]),o=Math.max(r[0],r[1])-i,s=Math.max(n[0],n[1])-a;return new tn(i,a,o,s)},e}(Tnr),Inr=function(t){Ge(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e}(Lh);function PZ(t,e,r){r=r||{};var n=t.coordinateSystem,i=e.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,l=o?"onZero":s,c=i.dim,u=n.getRect(),f=[u.x,u.x+u.width,u.y,u.y+u.height],d={left:0,right:1,top:0,bottom:1,onZero:2},h=e.get("offset")||0,p=c==="x"?[f[2]-h,f[3]+h]:[f[0]-h,f[1]+h];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}a.position=[c==="y"?p[d[l]]:f[0],c==="x"?p[d[l]]:f[3]],a.rotation=Math.PI/2*(c==="x"?0:1);var v={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=v[s],a.labelOffset=o?p[d[s]]-p[d.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),as(r.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var y=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-y:y,a.z2=1,a}function h1e(t){return t.get("coordinateSystem")==="cartesian2d"}function p1e(t){var e={xAxisModel:null,yAxisModel:null};return te(e,function(r,n){var i=n.replace(/Model$/,""),a=t.getReferringComponents(i,yo).models[0];e[n]=a}),e}var knr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=kZ,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;this._updateScale(e,this.model),te(n.x,function(a){I2(a.scale,a.model)}),te(n.y,function(a){I2(a.scale,a.model)});var i={};te(n.x,function(a){g1e(n,"y",a,i)}),te(n.y,function(a){g1e(n,"x",a,i)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=e.getBoxLayoutParams(),a=!n&&e.get("containLabel"),o=Eo(i,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(te(s,function(c){if(!c.model.get(["axisLabel","inside"])){var u=Atr(c);if(u){var f=c.isHorizontal()?"height":"width",d=c.model.get(["axisLabel","margin"]);o[f]-=u[f]+d,c.position==="top"?o.y+=u.height+d:c.position==="left"&&(o.x+=u.width+d)}}}),l()),te(this._coordsList,function(c){c.calcAffineTransform()});function l(){te(s,function(c){var u=c.isHorizontal(),f=u?[0,o.width]:[0,o.height],d=c.inverse?1:0;c.setExtent(f[d],f[1-d]),Pnr(c,u?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}dr(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i0?"top":"bottom",a="center"):cO(i-Xm)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t}(),m1e={axisLine:function(t,e,r,n){var i=e.get(["axisLine","show"]);if(i==="auto"&&t.handleAutoShown&&(i=t.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),o=n.transform,s=[a[0],0],l=[a[1],0];o&&(us(s,s,o),us(l,l,o));var c=st({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),u=new Fo({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});u.anid="line",r.add(u);var f=e.get(["axisLine","symbol"]);if(f!=null){var d=e.get(["axisLine","symbolSize"]);typeof f=="string"&&(f=[f,f]),(typeof d=="string"||typeof d=="number")&&(d=[d,d]);var h=rC(e.get(["axisLine","symbolOffset"])||0,d),p=d[0],g=d[1];te([{rotate:t.rotation+Math.PI/2,offset:h[0],r:0},{rotate:t.rotation-Math.PI/2,offset:h[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,y){if(f[y]!=="none"&&f[y]!=null){var m=bo(f[y],-p/2,-g/2,p,g,c.stroke,!0),b=v.r+v.offset;m.attr({rotation:v.rotate,x:s[0]+b*Math.cos(t.rotation),y:s[1]-b*Math.sin(t.rotation),silent:!0,z2:11}),r.add(m)}})}}},axisTickLabel:function(t,e,r,n){var i=Dnr(r,n,e,t),a=Onr(r,n,e,t);if(Mnr(e,a,i),Nnr(r,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=MPe(ft(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));OPe(o)}},axisName:function(t,e,r,n){var i=as(t.axisName,e.get("name"));if(i){var a=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,c=e.axis.getExtent(),u=c[0]>c[1]?-1:1,f=[a==="start"?c[0]-u*l:a==="end"?c[1]+u*l:(c[0]+c[1])/2,w1e(a)?t.labelOffset+o*l:0],d,h=e.get("nameRotate");h!=null&&(h=h*Xm/180);var p;w1e(a)?d=zl.innerTextLayout(t.rotation,h??t.rotation,o):(d=Rnr(t.rotation,a,h||0,c),p=t.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(d.rotation)),!isFinite(p)&&(p=null)));var g=s.getFont(),v=e.get("nameTruncate",!0)||{},y=v.ellipsis,m=as(t.nameTruncateMaxWidth,v.maxWidth,p),b=new Bn({x:f[0],y:f[1],rotation:d.rotation,silent:zl.isLabelSilent(e),style:Ja(s,{text:i,font:g,overflow:"truncate",width:m,ellipsis:y,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||d.textAlign,verticalAlign:s.get("verticalAlign")||d.textVerticalAlign}),z2:1});if(KS({el:b,componentModel:e,itemName:i}),b.__fullText=i,b.anid="name",e.get("triggerEvent")){var w=zl.makeAxisEventDataBase(e);w.targetType="axisName",w.name=i,br(b).eventData=w}n.add(b),b.updateTransform(),r.add(b),b.decomposeTransform()}}};function Rnr(t,e,r,n){var i=AIe(r-t),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return cO(i-Xm/2)?(o=l?"bottom":"top",a="center"):cO(i-Xm*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iXm/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function Mnr(t,e,r){if(!SPe(t.axis)){var n=t.get(["axisLabel","showMinLabel"]),i=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],c=r[0],u=r[1],f=r[r.length-1],d=r[r.length-2];n===!1?(of(a),of(c)):y1e(a,o)&&(n?(of(o),of(u)):(of(a),of(c))),i===!1?(of(s),of(f)):y1e(l,s)&&(i?(of(l),of(d)):(of(s),of(f)))}}function of(t){t&&(t.ignore=!0)}function y1e(t,e){var r=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!r||!n)){var i=yB([]);return px(i,i,-t.rotation),r.applyTransform(Lg([],i,t.getLocalTransform())),n.applyTransform(Lg([],i,e.getLocalTransform())),r.intersect(n)}}function w1e(t){return t==="middle"||t==="center"}function iRe(t,e,r,n,i){for(var a=[],o=[],s=[],l=0;l=0||t===e}function Unr(t){var e=Xre(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=RZ(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!p.min?p.min=0:p.min!=null&&p.min<0&&!p.max&&(p.max=0);var g=l;p.color!=null&&(g=tr({color:p.color},l));var v=$r(ur(p),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:p.text,nameLocation:"end",nameGap:f,nameTextStyle:g,triggerEvent:d},!1);if(c||(v.name=""),typeof u=="string"){var y=v.name;v.name=u.replace("{value}",y??"")}else typeof u=="function"&&(v.name=u(v.name,v));var m=new ai(v,null,this.ecModel);return xo(m,b9.prototype),m.mainType="radar",m.componentIndex=this.componentIndex,m},this);this._indicatorModels=h},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:$r({lineStyle:{color:"#bbb"}},B4.axisLine),axisLabel:Ek(B4.axisLabel,!1),axisTick:Ek(B4.axisTick,!1),splitLine:Ek(B4.splitLine,!0),splitArea:Ek(B4.splitArea,!0),indicator:[]},e}(fn),eir=["axisLine","axisTickLabel","axisName"],tir=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group;a.removeAll(),this._buildAxes(r),this._buildSplitLineAndArea(r)},e.prototype._buildAxes=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes(),a=ft(i,function(o){var s=new zl(o.model,{position:[n.cx,n.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return s});te(a,function(o){te(eir,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),c=s.getModel("areaStyle"),u=o.get("show"),f=s.get("show"),d=l.get("color"),h=c.get("color"),p=lt(d)?d:[d],g=lt(h)?h:[h],v=[],y=[];function m(E,N,F){var B=F%N.length;return E[B]=E[B]||[],B}if(a==="circle")for(var b=i[0].getTicksCoords(),w=n.cx,C=n.cy,A=0;Ac[0]&&isFinite(v)&&isFinite(c[0]))}else{var y=f.getTicks().length-1;y>a&&(p=o(p));var g=Math.ceil(c[1]/p)*p,v=Bo(g-p*a);f.setExtent(v,g),f.setInterval(p)}})},t.prototype.convertToPixel=function(e,r,n){return console.warn("Not implemented."),null},t.prototype.convertFromPixel=function(e,r,n){return console.warn("Not implemented."),null},t.prototype.containPoint=function(e){return console.warn("Not implemented."),!1},t.create=function(e,r){var n=[];return e.eachComponent("radar",function(i){var a=new t(i,e,r);n.push(a),i.coordinateSystem=a}),e.eachSeriesByType("radar",function(i){i.get("coordinateSystem")==="radar"&&(i.coordinateSystem=n[i.get("radarIndex")||0])}),n},t.dimensions=[],t}();function iir(t){t.registerCoordinateSystem("radar",nir),t.registerComponentModel(Jnr),t.registerComponentView(tir),t.registerVisual({seriesType:"radar",reset:function(e){var r=e.getData();r.each(function(n){r.setItemVisual(n,"legendIcon","roundRect")}),r.setVisual("legendIcon","roundRect")}})}function air(t){Xr(iir),t.registerChartView(Qnr),t.registerSeriesModel(Xnr),t.registerLayout(Knr),t.registerProcessor(C9("radar")),t.registerPreprocessor(Znr)}var C1e="\0_ec_interaction_mutex";function oir(t,e,r){var n=Jre(t);n[e]=r}function sir(t,e,r){var n=Jre(t),i=n[e];i===r&&(n[e]=null)}function A1e(t,e){return!!Jre(t)[e]}function Jre(t){return t[C1e]||(t[C1e]={})}P0({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){});var T9=function(t){Ge(e,t);function e(r){var n=t.call(this)||this;n._zr=r;var i=Mt(n._mousedownHandler,n),a=Mt(n._mousemoveHandler,n),o=Mt(n._mouseupHandler,n),s=Mt(n._mousewheelHandler,n),l=Mt(n._pinchHandler,n);return n.enable=function(c,u){this.disable(),this._opt=tr(ur(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),c==null&&(c=!0),(c===!0||c==="move"||c==="pan")&&(r.on("mousedown",i),r.on("mousemove",a),r.on("mouseup",o)),(c===!0||c==="scale"||c==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},n.disable=function(){r.off("mousedown",i),r.off("mousemove",a),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},n}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!(j0e(r)||r.target&&r.target.draggable)){var n=r.offsetX,i=r.offsetY;this.pointerChecker&&this.pointerChecker(r,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!bM("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||A1e(this._zr,"globalPan"))){var n=r.offsetX,i=r.offsetY,a=this._x,o=this._y,s=n-a,l=i-o;this._x=n,this._y=i,this._opt.preventDefaultMouseMove&&fv(r.event),uRe(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:a,oldY:o,newX:n,newY:i,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){j0e(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var n=bM("zoomOnMouseWheel",r,this._opt),i=bM("moveOnMouseWheel",r,this._opt),a=r.wheelDelta,o=Math.abs(a),s=r.offsetX,l=r.offsetY;if(!(a===0||!n&&!i)){if(n){var c=o>3?1.4:o>1?1.2:1.1,u=a>0?c:1/c;IV(this,"zoom","zoomOnMouseWheel",r,{scale:u,originX:s,originY:l,isAvailableBehavior:null})}if(i){var f=Math.abs(a),d=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);IV(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:d,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!A1e(this._zr,"globalPan")){var n=r.pinchScale>1?1.1:1/1.1;IV(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e}(ad);function IV(t,e,r,n,i){t.pointerChecker&&t.pointerChecker(n,i.originX,i.originY)&&(fv(n.event),uRe(t,e,r,n,i))}function uRe(t,e,r,n,i){i.isAvailableBehavior=Mt(bM,null,r,n),t.trigger(e,i)}function bM(t,e,r){var n=r[t];return!t||n&&(!En(n)||e.event[n+"Key"])}function ene(t,e,r){var n=t.target;n.x+=e,n.y+=r,n.dirty()}function tne(t,e,r,n){var i=t.target,a=t.zoomLimit,o=t.zoom=t.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var c=o/t.zoom;t.zoom=o,i.x-=(r-i.x)*(c-1),i.y-=(n-i.y)*(c-1),i.scaleX*=c,i.scaleY*=c,i.dirty()}var lir={axisPointer:1,tooltip:1,brush:1};function XB(t,e,r){var n=e.getComponentByElement(t.topTarget),i=n&&n.coordinateSystem;return n&&n!==r&&!lir.hasOwnProperty(n.mainType)&&i&&i.model!==r}var rne=["rect","circle","line","ellipse","polygon","polyline","path"],cir=Gt(rne),uir=Gt(rne.concat(["g"])),fir=Gt(rne.concat(["g"])),fRe=qn();function Ik(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}var dRe=function(){function t(e){var r=new fr;this.uid=QS("ec_map_draw"),this._controller=new T9(e.getZr()),this._controllerHost={target:r},this.group=r,r.add(this._regionsGroup=new fr),r.add(this._svgGroup=new fr)}return t.prototype.draw=function(e,r,n,i,a){var o=e.mainType==="geo",s=e.getData&&e.getData();o&&r.eachComponent({mainType:"series",subType:"map"},function(y){!s&&y.getHostGeoModel()===e&&(s=y.getData())});var l=e.coordinateSystem,c=this._regionsGroup,u=this.group,f=l.getTransformInfo(),d=f.raw,h=f.roam,p=!c.childAt(0)||a;p?(u.x=h.x,u.y=h.y,u.scaleX=h.scaleX,u.scaleY=h.scaleY,u.dirty()):Mn(u,h,e);var g=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0,v={api:n,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:g,isGeo:o,transformInfoRaw:d};l.resourceType==="geoJSON"?this._buildGeoJSON(v):l.resourceType==="geoSVG"&&this._buildSVG(v),this._updateController(e,r,n),this._updateMapSelectHandler(e,c,n,i)},t.prototype._buildGeoJSON=function(e){var r=this._regionsGroupByName=Gt(),n=Gt(),i=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=function(c){return[c[0]*a.scaleX+a.x,c[1]*a.scaleY+a.y]};i.removeAll(),te(e.geo.regions,function(c){var u=c.name,f=r.get(u),d=n.get(u)||{},h=d.dataIdx,p=d.regionModel;f||(f=r.set(u,new fr),i.add(f),h=s?s.indexOfName(u):null,p=e.isGeo?o.getRegionModel(u):s?s.getItemModel(h):null,n.set(u,{dataIdx:h,regionModel:p}));var g=new m7e({segmentIgnoreThreshold:1,shape:{paths:[]}});f.add(g),te(c.geometries,function(y){if(y.type==="polygon"){for(var m=[],b=0;b=0)&&(d=i);var h=o?{normal:{align:"center",verticalAlign:"middle"}}:null;wl(e,ds(n),{labelFetcher:d,labelDataIndex:f,defaultText:r},h);var p=e.getTextContent();if(p&&(fRe(p).ignore=p.ignore,e.textConfig&&o)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(o[0]-g.x)/g.width*100+"%",(o[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function I1e(t,e,r,n,i,a){t.data?t.data.setItemGraphicEl(a,e):br(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:r,region:n&&n.option||{}}}function k1e(t,e,r,n,i){t.data||KS({el:e,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function P1e(t,e,r,n,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Ri(e,o,a.get("blurScope")),t.isGeo&&CZt(e,i,r),o}var dir=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var o=this.group;if(o.removeAll(),!r.getHostGeoModel()){if(this._mapDraw&&a&&a.type==="geoRoam"&&this._mapDraw.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===r.id){var s=this._mapDraw;s&&o.add(s.group)}else if(r.needsDrawMap){var s=this._mapDraw||new dRe(i);o.add(s.group),s.draw(r,n,i,this,a),this._mapDraw=s}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;r.get("showLegendSymbol")&&n.getComponent("legend")&&this._renderSymbols(r,n,i)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(r,n,i){var a=r.originalData,o=this.group;a.each(a.mapDimension("value"),function(s,l){if(!isNaN(s)){var c=a.getItemLayout(l);if(!(!c||!c.point)){var u=c.point,f=c.offset,d=new _h({style:{fill:r.getData().getVisual("style").fill},shape:{cx:u[0]+f*9,cy:u[1],r:3},silent:!0,z2:8+(f?0:YS+1)});if(!f){var h=r.mainSeries.getData(),p=a.getName(l),g=h.indexOfName(p),v=a.getItemModel(l),y=v.getModel("label"),m=h.getItemGraphicEl(g);wl(d,ds(v),{labelFetcher:{getFormattedLabel:function(b,w){return r.getFormattedLabel(g,w)}}}),d.disableLabelAnimation=!0,y.get("position")||d.setTextConfig({position:"bottom"}),m.onHoverStateChange=function(b){fO(d,b)}}o.add(d)}}})},e.type="map",e}(xi),hir=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.needsDrawMap=!1,r.seriesGroup=[],r.getTooltipPosition=function(n){if(n!=null){var i=this.getData().getName(n),a=this.coordinateSystem,o=a.getRegion(i);return o&&a.dataToPoint(o.getCenter())}},r}return e.prototype.getInitialData=function(r){for(var n=nC(this,{coordDimensions:["value"],encodeDefaulter:Er(Sre,this)}),i=Gt(),a=[],o=0,s=n.count();o-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Mi);function pir(t,e){var r={};return te(t,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);r[o]=r[o]||[],isNaN(i)||r[o].push(i)})}),t[0].map(t[0].mapDimension("value"),function(n,i){for(var a="ec-"+t[0].getName(i),o=0,s=1/0,l=-1/0,c=r[a].length,u=0;u1?(p.width=h,p.height=h/u):(p.height=h,p.width=h*u),p.y=d[1]-p.height/2,p.x=d[0]-p.width/2;else{var g=t.getBoxLayoutParams();g.aspect=u,p=Eo(g,{width:l,height:c})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function yir(t,e){te(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var wir=function(){function t(){this.dimensions=hRe}return t.prototype.create=function(e,r){var n=[];e.eachComponent("geo",function(a,o){var s=a.get("map"),l=new DZ(s+o,s,{nameMap:a.get("nameMap"),nameProperty:a.get("nameProperty"),aspectScale:a.get("aspectScale")});l.zoomLimit=a.get("scaleLimit"),n.push(l),a.coordinateSystem=l,l.model=a,l.resize=N1e,l.resize(a,r)}),e.eachSeries(function(a){var o=a.get("coordinateSystem");if(o==="geo"){var s=a.get("geoIndex")||0;a.coordinateSystem=n[s]}});var i={};return e.eachSeriesByType("map",function(a){if(!a.getHostGeoModel()){var o=a.getMapType();i[o]=i[o]||[],i[o].push(a)}}),te(i,function(a,o){var s=ft(a,function(c){return c.get("nameMap")}),l=new DZ(o,o,{nameMap:Qte(s),nameProperty:a[0].get("nameProperty"),aspectScale:a[0].get("aspectScale")});l.zoomLimit=as.apply(null,ft(a,function(c){return c.get("scaleLimit")})),n.push(l),l.resize=N1e,l.resize(a[0],r),te(a,function(c){c.coordinateSystem=l,yir(l,c)})}),n},t.prototype.getFilledRegions=function(e,r,n,i){for(var a=(e||[]).slice(),o=Gt(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function Cir(t,e){var r=t.isExpand?t.children:[],n=t.parentNode.children,i=t.hierNode.i?n[t.hierNode.i-1]:null;if(r.length){Eir(t);var a=(r[0].hierNode.prelim+r[r.length-1].hierNode.prelim)/2;i?(t.hierNode.prelim=i.hierNode.prelim+e(t,i),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else i&&(t.hierNode.prelim=i.hierNode.prelim+e(t,i));t.parentNode.hierNode.defaultAncestor=Iir(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function Air(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function O1e(t){return arguments.length?t:Rir}function yA(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function Tir(t,e){return Eo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Eir(t){for(var e=t.children,r=e.length,n=0,i=0;--r>=0;){var a=e[r];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function Iir(t,e,r,n){if(e){for(var i=t,a=t,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,c=a.hierNode.modifier,u=o.hierNode.modifier,f=s.hierNode.modifier;s=kV(s),a=PV(a),s&&a;){i=kV(i),o=PV(o),i.hierNode.ancestor=t;var d=s.hierNode.prelim+f-a.hierNode.prelim-c+n(s,a);d>0&&(Pir(kir(s,t,r),t,d),c+=d,l+=d),f+=s.hierNode.modifier,c+=a.hierNode.modifier,l+=i.hierNode.modifier,u+=o.hierNode.modifier}s&&!kV(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!PV(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=c-u,r=t)}return r}function kV(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function PV(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function kir(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function Pir(t,e,r){var n=r/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=r,e.hierNode.modifier+=r,e.hierNode.prelim+=r,t.hierNode.change+=n}function Rir(t,e){return t.parentNode===e.parentNode?1:2}var Mir=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),Dir=function(t){Ge(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Mir},e.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var c=n.orient,u=c==="TB"||c==="BT"?0:1,f=1-u,d=xt(n.forkPosition,1),h=[];h[u]=o[u],h[f]=o[f]+(l[f]-o[f])*d,r.moveTo(o[0],o[1]),r.lineTo(h[0],h[1]),r.moveTo(s[0],s[1]),h[u]=s[u],r.lineTo(h[0],h[1]),h[u]=l[u],r.lineTo(h[0],h[1]),r.lineTo(l[0],l[1]);for(var p=1;pm.x,C||(w=w-Math.PI));var S=C?"left":"right",I=s.getModel("label"),D=I.get("rotate"),L=D*(Math.PI/180),O=v.getTextContent();O&&(v.setTextConfig({position:I.get("position")||S,rotation:D==null?-w:L,origin:"center"}),O.setStyle("verticalAlign","middle"))}var P=s.get(["emphasis","focus"]),x=P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():null;x&&(br(r).focus=x),Oir(i,o,u,r,p,h,g,n),r.__edge&&(r.onHoverStateChange=function(T){if(T!=="blur"){var E=o.parentNode&&t.getItemGraphicEl(o.parentNode.dataIndex);E&&E.hoverState===l9||fO(r.__edge,T)}})}function Oir(t,e,r,n,i,a,o,s){var l=e.getModel(),c=t.get("edgeShape"),u=t.get("layout"),f=t.getOrient(),d=t.get(["lineStyle","curveness"]),h=t.get("edgeForkPosition"),p=l.getModel("lineStyle").getLineStyle(),g=n.__edge;if(c==="curve")e.parentNode&&e.parentNode!==r&&(g||(g=n.__edge=new u9({shape:NZ(u,f,d,i,i)})),Mn(g,{shape:NZ(u,f,d,a,o)},t));else if(c==="polyline"&&u==="orthogonal"&&e!==r&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var v=e.children,y=[],m=0;mr&&(r=i.height)}this.height=r+1},t.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var r=0,n=this.children,i=n.length;r=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,r)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(e){if(!(this.dataIndex<0)){var r=this.hostTree,n=r.data.getItemModel(this.dataIndex);return n.getModel(e)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(e,r){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,r)},t.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,r=0;r=0){var n=r.getData().tree.root,i=t.targetNode;if(typeof i=="string"&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=t.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function wRe(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function one(t,e){var r=wRe(t);return en(r,e)>=0}function JB(t,e){for(var r=[];t;){var n=t.dataIndex;r.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return r.reverse(),r}var Vir=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasSymbolVisual=!0,r.ignoreStyleOnData=!0,r}return e.prototype.getInitialData=function(r){var n={name:r.name,children:r.data},i=r.leaves||{},a=new ai(i,this,this.ecModel),o=ane.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(d,h){var p=o.getNodeByDataIndex(h);return p&&p.children.length&&p.isExpand||(d.parentModel=a),d})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var c=r.expandAndCollapse,u=c&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var d=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=d&&d.collapsed!=null?!d.collapsed:f.depth<=u}),o.data},e.prototype.getOrient=function(){var r=this.get("orient");return r==="horizontal"?r="LR":r==="vertical"&&(r="TB"),r},e.prototype.setZoom=function(r){this.option.zoom=r},e.prototype.setCenter=function(r){this.option.center=r},e.prototype.formatTooltip=function(r,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),c=s.name;s&&s!==o;)c=s.parentNode.name+"."+c,s=s.parentNode;return Ho("nameValue",{name:c,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=JB(i,this),n},e.type="series.tree",e.layoutMode="box",e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Mi);function Gir(t,e,r){for(var n=[t],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)r.push(i[a])}}function Wir(t,e){t.eachSeriesByType("tree",function(r){qir(r,e)})}function qir(t,e){var r=Tir(t,e);t.layoutInfo=r;var n=t.get("layout"),i=0,a=0,o=null;n==="radial"?(i=2*Math.PI,a=Math.min(r.height,r.width)/2,o=O1e(function(b,w){return(b.parentNode===w.parentNode?1:2)/b.depth})):(i=r.width,a=r.height,o=O1e());var s=t.getData().tree.root,l=s.children[0];if(l){Sir(s),Gir(l,Cir,o),s.hierNode.modifier=-l.hierNode.prelim,F4(l,Air);var c=l,u=l,f=l;F4(l,function(b){var w=b.getLayout().x;wu.getLayout().x&&(u=b),b.depth>f.depth&&(f=b)});var d=c===u?1:o(c,u)/2,h=d-c.getLayout().x,p=0,g=0,v=0,y=0;if(n==="radial")p=i/(u.getLayout().x+d+h),g=a/(f.depth-1||1),F4(l,function(b){v=(b.getLayout().x+h)*p,y=(b.depth-1)*g;var w=yA(v,y);b.setLayout({x:w.x,y:w.y,rawX:v,rawY:y},!0)});else{var m=t.getOrient();m==="RL"||m==="LR"?(g=a/(u.getLayout().x+d+h),p=i/(f.depth-1||1),F4(l,function(b){y=(b.getLayout().x+h)*g,v=m==="LR"?(b.depth-1)*p:i-(b.depth-1)*p,b.setLayout({x:v,y},!0)})):(m==="TB"||m==="BT")&&(p=i/(u.getLayout().x+d+h),g=a/(f.depth-1||1),F4(l,function(b){v=(b.getLayout().x+h)*p,y=m==="TB"?(b.depth-1)*g:a-(b.depth-1)*g,b.setLayout({x:v,y},!0)}))}}}function Yir(t){t.eachSeriesByType("tree",function(e){var r=e.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");st(s,o)})})}function Kir(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,r){r.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var i=n.coordinateSystem,a=nne(i,e);n.setCenter&&n.setCenter(a.center),n.setZoom&&n.setZoom(a.zoom)})})}function Zir(t){t.registerChartView(Nir),t.registerSeriesModel(Vir),t.registerLayout(Wir),t.registerVisual(Yir),Kir(t)}var Qir=function(){},j1e=["treemapZoomToNode","treemapRender","treemapMove"];function Xir(t){for(var e=0;e1;)a=a.parentNode;var o=pZ(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var Jir=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventUsingHoverLayer=!0,r}return e.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};xRe(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new ai({itemStyle:o},this,n);a=r.levels=ear(a,n);var l=ft(a||[],function(f){return new ai(f,s,n)},this),c=ane.createTree(i,this,u);function u(f){f.wrapMethod("getItemModel",function(d,h){var p=c.getNodeByDataIndex(h),g=p?l[p.depth]:null;return d.parentModel=g||s,d})}return c.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return Ho("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=JB(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},st(this.layoutInfo,r)},e.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=Gt(),this._idIndexMapCount=0);var i=n.get(r);return i==null&&n.set(r,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){bRe(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Mi);function xRe(t){var e=0;te(t.children,function(n){xRe(n);var i=n.value;lt(i)&&(i=i[0]),e+=i});var r=t.value;lt(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=e),r<0&&(r=0),lt(t.value)?t.value[0]=r:t.value=r}function ear(t,e){var r=di(e.get("color")),n=di(e.get(["aria","decal","decals"]));if(r){t=t||[];var i,a;te(t,function(s){var l=new ai(s),c=l.get("color"),u=l.get("decal");(l.get(["itemStyle","color"])||c&&c!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||u&&u!=="none")&&(a=!0)});var o=t[0]||(t[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),t}}var tar=8,U1e=8,RV=5,rar=function(){function t(e){this.group=new fr,e.add(this.group)}return t.prototype.render=function(e,r,n,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=s.getModel("textStyle"),c={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:r.getWidth(),height:r.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,c,l),this._renderContent(e,c,s,l,i),BB(o,c.pos,c.box)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=To(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+tar*2,r.emptyItemWidth);r.totalWidth+=s+U1e,r.renderList.push({node:i,text:a,width:s})}},t.prototype._renderContent=function(e,r,n,i,a){for(var o=0,s=r.emptyItemWidth,l=e.get(["breadcrumb","height"]),c=kQt(r.pos,r.box),u=r.totalWidth,f=r.renderList,d=f.length-1;d>=0;d--){var h=f[d],p=h.node,g=h.width,v=h.text;u>c.width&&(u-=g-s,g=s,v=null);var y=new dl({shape:{points:nar(o,0,g,l,d===f.length-1,d===0)},style:tr(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Bn({style:{text:v,fill:i.getTextColor(),font:i.getFont()}}),textConfig:{position:"inside"},z2:YS*1e4,onclick:Er(a,p)});y.disableLabelAnimation=!0,this.group.add(y),iar(y,e,p),o+=g+U1e}},t.prototype.remove=function(){this.group.removeAll()},t}();function nar(t,e,r,n,i,a){var o=[[i?t:t-RV,e],[t+r,e],[t+r,e+n],[i?t:t-RV,e+n]];return!a&&o.splice(2,0,[t+r+RV,e+n/2]),!i&&o.push([t,e+n/2]),o}function iar(t,e,r){br(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&JB(r,e)}}var aar=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(e,r,n,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:r,duration:n,delay:i,easing:a}),!0)},t.prototype.finished=function(e){return this._finishedCallback=e,this},t.prototype.start=function(){for(var e=this,r=this._storage.length,n=function(){r--,r<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;iH1e||Math.abs(r.dy)>H1e)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+r.dx,y:i.y+r.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(r){var n=r.originX,i=r.originY;if(this._state!=="animating"){var a=this.seriesModel.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new tn(o.x,o.y,o.width,o.height),l=this.seriesModel.layoutInfo;n-=l.x,i-=l.y;var c=Xf();d0(c,c,[-n,-i]),ore(c,c,[r.scale,r.scale]),d0(c,c,[n,i]),s.applyTransform(c),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(r){var n=this;r.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),c=l.get("link",!0),u=l.get("target",!0)||"blank";c&&yO(c,u)}}}}},this)},e.prototype._renderBreadcrumb=function(r,n,i){var a=this;i||(i=r.get("leafDepth",!0)!=null?{node:r.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:r.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new rar(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(one(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=j4(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(r){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},e.prototype._rootToNode=function(r){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:r.node})},e.prototype.findTarget=function(r,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),c=s.shape;if(c.x<=l[0]&&l[0]<=c.x+c.width&&c.y<=l[1]&&l[1]<=c.y+c.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(xi);function j4(){return{nodeGroup:[],background:[],content:[]}}function far(t,e,r,n,i,a,o,s,l,c){if(!o)return;var u=o.getLayout(),f=t.getData(),d=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!u||!u.isInView)return;var h=u.width,p=u.height,g=u.borderWidth,v=u.invisible,y=o.getRawIndex(),m=s&&s.getRawIndex(),b=o.viewChildren,w=u.upperHeight,C=b&&b.length,A=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),I=d.getModel(["blur","itemStyle"]),D=d.getModel(["select","itemStyle"]),L=A.get("borderRadius")||0,O=H("nodeGroup",OZ);if(!O)return;if(l.add(O),O.x=u.x||0,O.y=u.y||0,O.markRedraw(),OO(O).nodeWidth=h,OO(O).nodeHeight=p,u.isAboveViewRoot)return O;var P=H("background",z1e,c,lar);P&&F(O,P,C&&u.upperLabelHeight);var x=d.get(["emphasis","focus"]),T=d.get(["emphasis","blurScope"]),E=x==="ancestor"?o.getAncestorsIndices():x==="descendant"?o.getDescendantIndices():x;if(C)dO(O)&&Q_(O,!1),P&&(Q_(P,!0),f.setItemGraphicEl(o.dataIndex,P),oZ(P,E,T));else{var N=H("content",z1e,c,car);N&&B(O,N),P.disableMorphing=!0,P&&dO(P)&&Q_(P,!1),Q_(O,!0),f.setItemGraphicEl(o.dataIndex,O),oZ(O,E,T)}return O;function F(W,Q,J){var ee=br(Q);if(ee.dataIndex=o.dataIndex,ee.seriesIndex=t.seriesIndex,Q.setShape({x:0,y:0,width:h,height:p,r:L}),v)j(Q);else{Q.invisible=!1;var ne=o.getVisual("style"),V=ne.stroke,oe=W1e(A);oe.fill=V;var ye=Iw(S);ye.fill=S.get("borderColor");var Te=Iw(I);Te.fill=I.get("borderColor");var Me=Iw(D);if(Me.fill=D.get("borderColor"),J){var Oe=h-2*g;k(Q,V,ne.opacity,{x:g,y:0,width:Oe,height:w})}else Q.removeTextContent();Q.setStyle(oe),Q.ensureState("emphasis").style=ye,Q.ensureState("blur").style=Te,Q.ensureState("select").style=Me,T2(Q)}W.add(Q)}function B(W,Q){var J=br(Q);J.dataIndex=o.dataIndex,J.seriesIndex=t.seriesIndex;var ee=Math.max(h-2*g,0),ne=Math.max(p-2*g,0);if(Q.culling=!0,Q.setShape({x:g,y:g,width:ee,height:ne,r:L}),v)j(Q);else{Q.invisible=!1;var V=o.getVisual("style"),oe=V.fill,ye=W1e(A);ye.fill=oe,ye.decal=V.decal;var Te=Iw(S),Me=Iw(I),Oe=Iw(D);k(Q,oe,V.opacity,null),Q.setStyle(ye),Q.ensureState("emphasis").style=Te,Q.ensureState("blur").style=Me,Q.ensureState("select").style=Oe,T2(Q)}W.add(Q)}function j(W){!W.invisible&&a.push(W)}function k(W,Q,J,ee){var ne=d.getModel(ee?G1e:V1e),V=To(d.get("name"),null),oe=ne.getShallow("show");wl(W,ds(d,ee?G1e:V1e),{defaultText:oe?V:null,inheritColor:Q,defaultOpacity:J,labelFetcher:t,labelDataIndex:o.dataIndex});var ye=W.getTextContent();if(ye){var Te=ye.style,Me=ere(Te.padding||0);ee&&(W.setTextConfig({layoutRect:ee}),ye.disableLabelLayout=!0),ye.beforeUpdate=function(){var nt=Math.max((ee?ee.width:W.shape.width)-Me[1]-Me[3],0),it=Math.max((ee?ee.height:W.shape.height)-Me[0]-Me[2],0);(Te.width!==nt||Te.height!==it)&&ye.setStyle({width:nt,height:it})},Te.truncateMinChar=2,Te.lineOverflow="truncate",$(Te,ee,u);var Oe=ye.getState("emphasis");$(Oe?Oe.style:null,ee,u)}}function $(W,Q,J){var ee=W?W.text:null;if(!Q&&J.isLeafRoot&&ee!=null){var ne=t.get("drillDownIcon",!0);W.text=ne?ne+" "+ee:ee}}function H(W,Q,J,ee){var ne=m!=null&&r[W][m],V=i[W];return ne?(r[W][m]=null,Y(V,ne)):v||(ne=new Q,ne instanceof sh&&(ne.z2=dar(J,ee)),ie(V,ne)),e[W][y]=ne}function Y(W,Q){var J=W[y]={};Q instanceof OZ?(J.oldX=Q.x,J.oldY=Q.y):J.oldShape=st({},Q.shape)}function ie(W,Q){var J=W[y]={},ee=o.parentNode,ne=Q instanceof fr;if(ee&&(!n||n.direction==="drillDown")){var V=0,oe=0,ye=i.background[ee.getRawIndex()];!n&&ye&&ye.oldShape&&(V=ye.oldShape.width,oe=ye.oldShape.height),ne?(J.oldX=0,J.oldY=oe):J.oldShape={x:V,y:oe,width:0,height:0}}J.fadein=!ne}}function dar(t,e){return t*sar+e}var LE=te,har=dr,LO=-1,Uo=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=ur(e);this.type=n,this.mappingMethod=r,this._normalizeData=mar[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(MV(i),par(i)):r==="category"?i.categories?gar(i):MV(i,!0):(Au(r!=="linear"||i.dataExtent),MV(i))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return Mt(this._normalizeData,this)},t.listVisualTypes=function(){return Gn(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,n){dr(e)?te(e,r,n):r.call(n,e)},t.mapVisual=function(e,r,n){var i,a=lt(e)?[]:dr(e)?{}:(i=!0,null);return t.eachVisual(e,function(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},t.retrieveVisuals=function(e){var r={},n;return e&&LE(t.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(r[a]=e[a],n=!0)}),n?r:null},t.prepareVisualTypes=function(e){if(lt(e))e=e.slice();else if(har(e)){var r=[];LE(e,function(n,i){r.push(i)}),e=r}else return[];return e.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),e},t.dependsOn=function(e,r){return r==="color"?!!(e&&e.indexOf(r)===0):e===r},t.findPieceIndex=function(e,r,n){for(var i,a=1/0,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[e[a]],e.pop())}function MV(t,e){var r=t.visual,n=[];dr(r)?LE(r,function(a){n.push(a)}):r!=null&&n.push(r);var i={color:1,symbol:1};!e&&n.length===1&&!i.hasOwnProperty(t.type)&&(n[1]=n[0]),_Re(t,n)}function kk(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:LZ([0,1])}}function q1e(t){var e=this.option.visual;return e[Math.round(oi(t,[0,1],[0,e.length-1],!0))]||{}}function U4(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function wA(t){var e=this.option.visual;return e[this.option.loop&&t!==LO?t%e.length:t]}function kw(){return this.option.visual[0]}function LZ(t){return{linear:function(e){return oi(e,t,this.option.visual,!0)},category:wA,piecewise:function(e,r){var n=$Z.call(this,r);return n==null&&(n=oi(e,t,this.option.visual,!0)),n},fixed:kw}}function $Z(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=Uo.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function _Re(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=ft(e,function(r){return Zl(r)})),e}var mar={linear:function(t){return oi(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=Uo.findPieceIndex(t,e,!0);if(r!=null)return oi(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??LO},fixed:zp};function Pk(t,e,r){return t?e<=r:e=r.length||g===r[g.depth]){var y=Sar(i,l,g,v,p,n);CRe(g,y,r,n)}})}}}function bar(t,e,r){var n=st({},e),i=r.designatedVisualItemStyle;return te(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=t.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function Y1e(t){var e=DV(t,"color");if(e){var r=DV(t,"colorAlpha"),n=DV(t,"colorSaturation");return n&&(e=a6(e,null,null,n)),r&&(e=aO(e,r)),e}}function xar(t,e){return e!=null?a6(e,null,null,t):null}function DV(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function _ar(t,e,r,n,i,a){if(!(!a||!a.length)){var o=NV(e,"color")||i.color!=null&&i.color!=="none"&&(NV(e,"colorAlpha")||NV(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),c=r.dataExtent.slice();s!=null&&sc[1]&&(c[1]=l);var u=e.get("colorMappingBy"),f={type:o.name,dataExtent:c,visual:o.range};f.type==="color"&&(u==="index"||u==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var d=new Uo(f);return SRe(d).drColorMappingBy=u,d}}}function NV(t,e){var r=t.get(e);return lt(r)&&r.length?{name:e,range:r}:null}function Sar(t,e,r,n,i,a){var o=st({},e);if(i){var s=i.type,l=s==="color"&&SRe(i).drColorMappingBy,c=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(t.get("visualDimension"));o[s]=i.mapValueToVisual(c)}return o}var $E=Math.max,$O=Math.min,K1e=as,sne=te,ARe=["itemStyle","borderWidth"],Car=["itemStyle","gapWidth"],Aar=["upperLabel","show"],Tar=["upperLabel","height"];const Ear={seriesType:"treemap",reset:function(t,e,r,n){var i=r.getWidth(),a=r.getHeight(),o=t.option,s=Eo(t.getBoxLayoutParams(),{width:r.getWidth(),height:r.getHeight()}),l=o.size||[],c=xt(K1e(s.width,l[0]),i),u=xt(K1e(s.height,l[1]),a),f=n&&n.type,d=["treemapZoomToNode","treemapRootToNode"],h=OE(n,d,t),p=f==="treemapRender"||f==="treemapMove"?n.rootRect:null,g=t.getViewRoot(),v=wRe(g);if(f!=="treemapMove"){var y=f==="treemapZoomToNode"?Dar(t,h,g,c,u):p?[p.width,p.height]:[c,u],m=o.sort;m&&m!=="asc"&&m!=="desc"&&(m="desc");var b={squareRatio:o.squareRatio,sort:m,leafDepth:o.leafDepth};g.hostTree.clearLayouts();var w={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(w),TRe(g,b,!1,0),w=g.getLayout(),sne(v,function(A,S){var I=(v[S+1]||g).getValue();A.setLayout(st({dataExtent:[I,I],borderWidth:0,upperHeight:0},w))})}var C=t.getData().tree.root;C.setLayout(Nar(s,p,h),!0),t.setLayoutInfo(s),ERe(C,new tn(-s.x,-s.y,i,a),v,g,0)}};function TRe(t,e,r,n){var i,a;if(!t.isRemoved()){var o=t.getLayout();i=o.width,a=o.height;var s=t.getModel(),l=s.get(ARe),c=s.get(Car)/2,u=IRe(s),f=Math.max(l,u),d=l-c,h=f-c;t.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:u},!0),i=$E(i-2*d,0),a=$E(a-d-h,0);var p=i*a,g=Iar(t,s,p,e,r,n);if(g.length){var v={x:d,y:h,width:i,height:a},y=$O(i,a),m=1/0,b=[];b.area=0;for(var w=0,C=g.length;w=0;l--){var c=i[n==="asc"?o-l-1:l].getValue();c/r*es[1]&&(s[1]=c)})),{sum:n,dataExtent:s}}function Mar(t,e,r){for(var n=0,i=1/0,a=0,o=void 0,s=t.length;an&&(n=o));var l=t.area*t.area,c=e*e*r;return l?$E(c*n/l,l/(c*i)):1/0}function Z1e(t,e,r,n,i){var a=e===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],c=r[s[a]],u=e?t.area/e:0;(i||u>r[l[o]])&&(u=r[l[o]]);for(var f=0,d=t.length;flge&&(c=lge),a=s}cn&&(n=e);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(C[0]=-C[0],C[1]=-C[1]);var S=w[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var I=-Math.atan2(w[1],w[0]);f[0].8?"left":d[0]<-.8?"right":"center",g=d[1]>.8?"top":d[1]<-.8?"bottom":"middle";break;case"start":a.x=-d[0]*y+u[0],a.y=-d[1]*m+u[1],p=d[0]>.8?"right":d[0]<-.8?"left":"center",g=d[1]>.8?"bottom":d[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=y*S+u[0],a.y=u[1]+D,p=w[0]<0?"right":"left",a.originX=-y*S,a.originY=-D;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=A[0],a.y=A[1]+D,p="center",a.originY=-D;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-y*S+f[0],a.y=f[1]+D,p=w[0]>=0?"right":"left",a.originX=y*S,a.originY=-D;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||g,align:a.__align||p})}},e}(fr),une=function(){function t(e){this.group=new fr,this._LineCtor=e||cne}return t.prototype.isPersistent=function(){return!0},t.prototype.updateData=function(e){var r=this,n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var o=tye(e);e.diff(a).add(function(s){r._doAdd(e,s,o)}).update(function(s,l){r._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},t.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(r,n){r.updateLayout(e,n)},this)},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=tye(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r){function n(s){!s.isGroup&&!Xar(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function tye(t){var e=t.hostModel;return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:e.getModel(["emphasis","lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),labelStatesModels:ds(e)}}function rye(t){return isNaN(t[0])||isNaN(t[1])}function FV(t){return!rye(t[0])&&!rye(t[1])}var jV=[],UV=[],zV=[],u_=ns,HV=bb,nye=Math.abs;function iye(t,e,r){for(var n=t[0],i=t[1],a=t[2],o=1/0,s,l=r*r,c=.1,u=.1;u<=.9;u+=.1){jV[0]=u_(n[0],i[0],a[0],u),jV[1]=u_(n[1],i[1],a[1],u);var f=nye(HV(jV,e)-l);f=0?s=s+c:s=s-c:p>=0?s=s-c:s=s+c}return s}function VV(t,e){var r=[],n=_E,i=[[],[],[]],a=[[],[]],o=[];e/=2,t.eachEdge(function(s,l){var c=s.getLayout(),u=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");c.__original||(c.__original=[Og(c[0]),Og(c[1])],c[2]&&c.__original.push(Og(c[2])));var d=c.__original;if(c[2]!=null){if(Ml(i[0],d[0]),Ml(i[1],d[2]),Ml(i[2],d[1]),u&&u!=="none"){var h=xA(s.node1),p=iye(i,d[0],h*e);n(i[0][0],i[1][0],i[2][0],p,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],p,r),i[0][1]=r[3],i[1][1]=r[4]}if(f&&f!=="none"){var h=xA(s.node2),p=iye(i,d[1],h*e);n(i[0][0],i[1][0],i[2][0],p,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],p,r),i[1][1]=r[1],i[2][1]=r[2]}Ml(c[0],i[0]),Ml(c[1],i[2]),Ml(c[2],i[1])}else{if(Ml(a[0],d[0]),Ml(a[1],d[1]),Zw(o,a[1],a[0]),n9(o,o),u&&u!=="none"){var h=xA(s.node1);LK(a[0],a[0],o,h*e)}if(f&&f!=="none"){var h=xA(s.node2);LK(a[1],a[1],o,-h*e)}Ml(c[0],a[0]),Ml(c[1],a[1])}})}function aye(t){return t.type==="view"}var Jar=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){var i=new _9,a=new une,o=this.group;this._controller=new T9(n.getZr()),this._controllerHost={target:o},o.add(i.group),o.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(r,n,i){var a=this,o=r.coordinateSystem;this._model=r;var s=this._symbolDraw,l=this._lineDraw,c=this.group;if(aye(o)){var u={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?c.attr(u):Mn(c,u,r)}VV(r.getGraph(),bA(r));var f=r.getData();s.updateData(f);var d=r.getEdgeData();l.updateData(d),this._updateNodeAndLinkScale(),this._updateController(r,n,i),clearTimeout(this._layoutTimeout);var h=r.forceLayout,p=r.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,p),f.graph.eachNode(function(m){var b=m.dataIndex,w=m.getGraphicEl(),C=m.getModel();w.off("drag").off("dragend");var A=C.get("draggable");A&&w.on("drag",function(){h&&(h.warmUp(),!a._layouting&&a._startForceLayoutIteration(h,p),h.setFixed(b),f.setItemLayout(b,[w.x,w.y]))}).on("dragend",function(){h&&h.setUnfixed(b)}),w.setDraggable(A&&!!h);var S=C.get(["emphasis","focus"]);S==="adjacency"&&(br(w).focus=m.getAdjacentDataIndices())}),f.graph.eachEdge(function(m){var b=m.getGraphicEl(),w=m.getModel().get(["emphasis","focus"]);w==="adjacency"&&(br(b).focus={edge:[m.dataIndex],node:[m.node1.dataIndex,m.node2.dataIndex]})});var g=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),v=f.getLayout("cx"),y=f.getLayout("cy");f.eachItemGraphicEl(function(m,b){var w=f.getItemModel(b),C=w.get(["label","rotate"])||0,A=m.getSymbolPath();if(g){var S=f.getItemLayout(b),I=Math.atan2(S[1]-y,S[0]-v);I<0&&(I=Math.PI*2+I);var D=S[0]=0&&e.call(r,n[a],a)},t.prototype.eachEdge=function(e,r){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(r,n[a],a)},t.prototype.breadthFirstTraverse=function(e,r,n,i){if(r instanceof Pw||(r=this._nodesMap[f_(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&this[t][e].setItemVisual(this.dataIndex,r,n)},getVisual:function(r){return this[t][e].getItemVisual(this.dataIndex,r)},setLayout:function(r,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,r,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}xo(Pw,LRe("hostGraph","data"));xo(ORe,LRe("hostGraph","edgeData"));function $Re(t,e,r,n,i){for(var a=new eor(n),o=0;o "+d)),c++)}var h=r.get("coordinateSystem"),p;if(h==="cartesian2d"||h==="polar")p=kv(t,r);else{var g=p9.get(h),v=g?g.dimensions||[]:[];en(v,"value")<0&&v.concat(["value"]);var y=y9(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;p=new Ul(y,r),p.initData(t)}var m=new Ul(["value"],r);return m.initData(l,s),i&&i(p,m),mRe({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var tor=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new A9(i,i),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(r.edges||r.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(r){t.prototype.mergeDefaultAndTheme.apply(this,arguments),_2(r,"edgeLabel",["show"])},e.prototype.getInitialData=function(r,n){var i=r.edges||r.links||[],a=r.data||r.nodes||[],o=this;if(a&&i){Uar(this);var s=$Re(a,i,this,!0,l);return te(s.edges,function(c){zar(c.node1,c.node2,this,c.dataIndex)},this),s.data}function l(c,u){c.wrapMethod("getItemModel",function(p){var g=o._categoriesModels,v=p.getShallow("category"),y=g[v];return y&&(y.parentModel=p.parentModel,p.parentModel=y),p});var f=ai.prototype.getModel;function d(p,g){var v=f.call(this,p,g);return v.resolveParentPath=h,v}u.wrapMethod("getItemModel",function(p){return p.resolveParentPath=h,p.getModel=d,p});function h(p){if(p&&(p[0]==="label"||p[1]==="label")){var g=p.slice();return p[0]==="label"?g[0]="edgeLabel":p[1]==="label"&&(g[1]="edgeLabel"),g}return p}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(r,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(r,i),s=a.graph.getEdgeByIndex(r),l=a.getName(s.node1.dataIndex),c=a.getName(s.node2.dataIndex),u=[];return l!=null&&u.push(l),c!=null&&u.push(c),Ho("nameValue",{name:u.join(" > "),value:o.value,noValue:o.value==null})}var f=xke({series:this,dataIndex:r,multipleSeries:n});return f},e.prototype._updateCategoriesData=function(){var r=ft(this.option.categories||[],function(i){return i.value!=null?i:st({value:0},i)}),n=new Ul(["value"],this);n.initData(r),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},e.prototype.setZoom=function(r){this.option.zoom=r},e.prototype.setCenter=function(r){this.option.center=r},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Mi),ror={type:"graphRoam",event:"graphRoam",update:"none"};function nor(t){t.registerChartView(Jar),t.registerSeriesModel(tor),t.registerProcessor(Lar),t.registerVisual($ar),t.registerVisual(Bar),t.registerLayout(Har),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,Gar),t.registerLayout(qar),t.registerCoordinateSystem("graphView",{dimensions:Q5.dimensions,create:Kar}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},function(){}),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},function(){}),t.registerAction(ror,function(e,r){r.eachComponent({mainType:"series",query:e},function(n){var i=n.coordinateSystem,a=nne(i,e);n.setCenter&&n.setCenter(a.center),n.setZoom&&n.setZoom(a.zoom)})})}var ior=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),aor=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new ior},e.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,c=n.x-i(l)*s*(s>=o/3?1:2),u=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(c,u),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(c,u)},e}(rn);function oor(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=xt(r[0],e.getWidth()),s=xt(r[1],e.getHeight()),l=xt(t.get("radius"),a/2);return{cx:o,cy:s,r:l}}function Mk(t,e){var r=t==null?"":t+"";return e&&(typeof e=="string"?r=e.replace("{value}",r):typeof e=="function"&&(r=e(t))),r}var GV=Math.PI*2,sor=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){this.group.removeAll();var a=r.get(["axisLine","lineStyle","color"]),o=oor(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(r,n,i,a,o){for(var s=this.group,l=r.get("clockwise"),c=-r.get("startAngle")/180*Math.PI,u=-r.get("endAngle")/180*Math.PI,f=r.getModel("axisLine"),d=f.get("roundCap"),h=d?NO:Xl,p=f.get("show"),g=f.getModel("lineStyle"),v=g.get("width"),y=!((u-c)%GV)&&u!==c?GV:(u-c)%GV,m=c,b=0;p&&b=I&&(D===0?0:a[D-1][0]).8?"bottom":"middle",align:T<-.4?"left":T>.4?"right":"center"},{inheritColor:k}),silent:!0}))}if(m.get("show")&&N!==w){var F=m.get("distance");F=F?F+u:u;for(var $=0;$<=C;$++){T=Math.cos(I),E=Math.sin(I);var H=new Fo({shape:{x1:T*(p-F)+d,y1:E*(p-F)+h,x2:T*(p-S-F)+d,y2:E*(p-S-F)+h},silent:!0,style:P});P.stroke==="auto"&&H.setStyle({stroke:a((N+$/C)/w)}),f.add(H),I+=L}I-=L}else I+=D}},e.prototype._renderPointer=function(r,n,i,a,o,s,l,c,u){var f=this.group,d=this._data,h=this._progressEls,p=[],g=r.get(["pointer","show"]),v=r.getModel("progress"),y=v.get("show"),m=r.getData(),b=m.mapDimension("value"),w=+r.get("min"),C=+r.get("max"),A=[w,C],S=[s,l];function I(L,O){var P=m.getItemModel(L),x=P.getModel("pointer"),T=xt(x.get("width"),o.r),E=xt(x.get("length"),o.r),N=r.get(["pointer","icon"]),F=x.get("offsetCenter"),B=xt(F[0],o.r),j=xt(F[1],o.r),k=x.get("keepAspect"),$;return N?$=bo(N,B-T/2,j-E,T,E,null,k):$=new aor({shape:{angle:-Math.PI/2,width:T,r:E,x:B,y:j}}),$.rotation=-(O+Math.PI/2),$.x=o.cx,$.y=o.cy,$}function D(L,O){var P=v.get("roundCap"),x=P?NO:Xl,T=v.get("overlap"),E=T?v.get("width"):u/m.count(),N=T?o.r-E:o.r-(L+1)*E,F=T?o.r:o.r-L*E,B=new x({shape:{startAngle:s,endAngle:O,cx:o.cx,cy:o.cy,clockwise:c,r0:N,r:F}});return T&&(B.z2=C-m.get(b,L)%C),B}(y||g)&&(m.diff(d).add(function(L){if(g){var O=I(L,s);la(O,{rotation:-(oi(m.get(b,L),A,S,!0)+Math.PI/2)},r),f.add(O),m.setItemGraphicEl(L,O)}if(y){var P=D(L,s),x=v.get("clip");la(P,{shape:{endAngle:oi(m.get(b,L),A,S,x)}},r),f.add(P),nZ(r.seriesIndex,m.dataType,L,P),p[L]=P}}).update(function(L,O){if(g){var P=d.getItemGraphicEl(O),x=P?P.rotation:s,T=I(L,x);T.rotation=x,Mn(T,{rotation:-(oi(m.get(b,L),A,S,!0)+Math.PI/2)},r),f.add(T),m.setItemGraphicEl(L,T)}if(y){var E=h[O],N=E?E.shape.endAngle:s,F=D(L,N),B=v.get("clip");Mn(F,{shape:{endAngle:oi(m.get(b,L),A,S,B)}},r),f.add(F),nZ(r.seriesIndex,m.dataType,L,F),p[L]=F}}).execute(),m.each(function(L){var O=m.getItemModel(L),P=O.getModel("emphasis");if(g){var x=m.getItemGraphicEl(L),T=m.getItemVisual(L,"style"),E=T.fill;if(x instanceof Io){var N=x.style;x.useStyle(st({image:N.image,x:N.x,y:N.y,width:N.width,height:N.height},T))}else x.useStyle(T),x.type!=="pointer"&&x.setColor(E);x.setStyle(O.getModel(["pointer","itemStyle"]).getItemStyle()),x.style.fill==="auto"&&x.setStyle("fill",a(oi(m.get(b,L),A,[0,1],!0))),x.z2EmphasisLift=0,Os(x,O),Ri(x,P.get("focus"),P.get("blurScope"))}if(y){var F=p[L];F.useStyle(m.getItemVisual(L,"style")),F.setStyle(O.getModel(["progress","itemStyle"]).getItemStyle()),F.z2EmphasisLift=0,Os(F,O),Ri(F,P.get("focus"),P.get("blurScope"))}}),this._progressEls=p)},e.prototype._renderAnchor=function(r,n){var i=r.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),c=i.get("keepAspect"),u=bo(s,n.cx-o/2+xt(l[0],n.r),n.cy-o/2+xt(l[1],n.r),o,o,null,c);u.z2=i.get("showAbove")?1:0,u.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(u)}},e.prototype._renderTitleAndDetail=function(r,n,i,a,o){var s=this,l=r.getData(),c=l.mapDimension("value"),u=+r.get("min"),f=+r.get("max"),d=new fr,h=[],p=[],g=r.isAnimationEnabled(),v=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){h[y]=new Bn({silent:!0}),p[y]=new Bn({silent:!0})}).update(function(y,m){h[y]=s._titleEls[m],p[y]=s._detailEls[m]}).execute(),l.each(function(y){var m=l.getItemModel(y),b=l.get(c,y),w=new fr,C=a(oi(b,[u,f],[0,1],!0)),A=m.getModel("title");if(A.get("show")){var S=A.get("offsetCenter"),I=o.cx+xt(S[0],o.r),D=o.cy+xt(S[1],o.r),L=h[y];L.attr({z2:v?0:2,style:Ja(A,{x:I,y:D,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:C})}),w.add(L)}var O=m.getModel("detail");if(O.get("show")){var P=O.get("offsetCenter"),x=o.cx+xt(P[0],o.r),T=o.cy+xt(P[1],o.r),E=xt(O.get("width"),o.r),N=xt(O.get("height"),o.r),F=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:C,L=p[y],B=O.get("formatter");L.attr({z2:v?0:2,style:Ja(O,{x,y:T,text:Mk(b,B),width:isNaN(E)?null:E,height:isNaN(N)?null:N,align:"center",verticalAlign:"middle"},{inheritColor:F})}),I7e(L,{normal:O},b,function(k){return Mk(k,B)}),g&&k7e(L,y,l,r,{getFormattedLabel:function(k,$,H,Y,ie,W){return Mk(W?W.interpolatedValue:b,B)}}),w.add(L)}d.add(w)}),this.group.add(d),this._titleEls=h,this._detailEls=p},e.type="gauge",e}(xi),lor=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.visualStyleAccessPath="itemStyle",r}return e.prototype.getInitialData=function(r,n){return nC(this,["value"])},e.type="series.gauge",e.defaultOption={zlevel:0,z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Mi);function cor(t){t.registerChartView(sor),t.registerSeriesModel(lor)}var uor=["itemStyle","opacity"],dor=function(t){Ge(e,t);function e(r,n){var i=t.call(this)||this,a=i,o=new Gc,s=new Bn;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return e.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),c=s.getModel("emphasis"),u=s.get(uor);u=u??1,i||Sh(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,la(a,{style:{opacity:u}},o,n)):Mn(a,{style:{opacity:u},shape:{points:l.points}},o,n),Os(a,s),this._updateLabel(r,n),Ri(this,c.get("focus"),c.get("blurScope"))},e.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),c=r.getItemLayout(n),u=c.label,f=r.getItemVisual(n,"style"),d=f.fill;wl(o,ds(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:r.getName(n)},{normal:{align:u.textAlign,verticalAlign:u.verticalAlign}}),i.setTextConfig({local:!0,inside:!!u.inside,insideStroke:d,outsideFill:d});var h=u.linePoints;a.setShape({points:h}),i.textGuideLineConfig={anchor:h?new Mr(h[0][0],h[0][1]):null},Mn(o,{style:{x:u.x,y:u.y}},s,n),o.attr({rotation:u.rotation,originX:u.x,originY:u.y,z2:10}),qre(i,Yre(l),{stroke:d})},e}(dl),hor=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.ignoreLabelLineUpdate=!0,r}return e.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var c=new dor(a,l);a.setItemGraphicEl(l,c),s.add(c)}).update(function(l,c){var u=o.getItemGraphicEl(c);u.updateData(a,l),s.add(u),a.setItemGraphicEl(l,u)}).remove(function(l){var c=o.getItemGraphicEl(l);CE(c,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(xi),por=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new A9(Mt(this.getData,this),Mt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return nC(this,{coordDimensions:["value"],encodeDefaulter:Er(Sre,this)})},e.prototype._defaultLabelLine=function(r){_2(r,"labelLine",["show"]);var n=r.labelLine,i=r.emphasis.labelLine;n.show=n.show&&r.label.show,i.show=i.show&&r.emphasis.label.show},e.prototype.getDataParams=function(r){var n=this.getData(),i=t.prototype.getDataParams.call(this,r),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Mi);function gor(t,e){return Eo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function vor(t,e){for(var r=t.mapDimension("value"),n=t.mapArray(r,function(l){return l}),i=[],a=e==="ascending",o=0,s=t.count();oMor)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!(this._mouseDownPoint||!qV(this,"mousemove"))){var e=this._model,r=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=r.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:r.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function qV(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var Oor=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(r){var n=this.option;r&&$r(n,r,!0),this._initDimensions()},e.prototype.contains=function(r,n){var i=r.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(r){te(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){r.hasOwnProperty(n)&&(this.option[n]=r[n])},this)},e.prototype._initDimensions=function(){var r=this.dimensions=[],n=this.parallelAxisIndex=[],i=qi(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);te(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(fn),Lor=function(t){Ge(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(Lh);function yx(t,e,r,n,i,a){t=t||0;var o=r[1]-r[0];if(i!=null&&(i=d_(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=d_(s,[0,o]),i=a=d_(s,[i,a]),n=0}e[0]=d_(e[0],r),e[1]=d_(e[1],r);var l=YV(e,n);e[n]+=t;var c=i||0,u=r.slice();l.sign<0?u[0]+=c:u[1]-=c,e[n]=d_(e[n],u);var f;return f=YV(e,n),i!=null&&(f.sign!==l.sign||f.spana&&(e[1-n]=e[n]+f.sign*a),e}function YV(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function d_(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var KV=te,FRe=Math.min,jRe=Math.max,lye=Math.floor,$or=Math.ceil,cye=Bo,Bor=Math.PI,For=function(){function t(e,r,n){this.type="parallel",this._axesMap=Gt(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,r,n)}return t.prototype._init=function(e,r,n){var i=e.dimensions,a=e.parallelAxisIndex;KV(i,function(o,s){var l=a[s],c=r.getComponent("parallelAxis",l),u=this._axesMap.set(o,new Lor(o,YB(c),[0,0],c.get("type"),l)),f=u.type==="category";u.onBand=f&&c.get("boundaryGap"),u.inverse=c.get("inverse"),c.axis=u,u.model=c,u.coordinateSystem=c.coordinateSystem=this},this)},t.prototype.update=function(e,r){this._updateAxesFromSeries(this._model,e)},t.prototype.containPoint=function(e){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=e[1-a],s=e[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(e,r){r.eachSeries(function(n){if(e.contains(n,r)){var i=n.getData();KV(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),I2(o.scale,o.model)},this)}},this)},t.prototype.resize=function(e,r){this._rect=Eo(e.getBoxLayoutParams(),{width:r.getWidth(),height:r.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var e=this._model,r=this._rect,n=["x","y"],i=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],c=this.dimensions.length,u=Dk(e.get("axisExpandWidth"),l),f=Dk(e.get("axisExpandCount")||0,[0,c]),d=e.get("axisExpandable")&&c>3&&c>f&&f>1&&u>0&&s>0,h=e.get("axisExpandWindow"),p;if(h)p=Dk(h[1]-h[0],l),h[1]=h[0]+p;else{p=Dk(u*(f-1),l);var g=e.get("axisExpandCenter")||lye(c/2);h=[u*g-p/2],h[1]=h[0]+p}var v=(s-p)/(c-f);v<3&&(v=0);var y=[lye(cye(h[0]/u,1))+1,$or(cye(h[1]/u,1))-1],m=v/u*h[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],axisExpandable:d,axisExpandWidth:u,axisCollapseWidth:v,axisExpandWindow:h,axisCount:c,winInnerIndices:y,axisExpandWindow0Pos:m}},t.prototype._layoutAxes=function(){var e=this._rect,r=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;r.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),KV(n,function(o,s){var l=(i.axisExpandable?Uor:jor)(s,i),c={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},u={horizontal:Bor/2,vertical:0},f=[c[a].x+e.x,c[a].y+e.y],d=u[a],h=Xf();px(h,h,d),d0(h,h,f),this._axesLayout[o]={position:f,rotation:d,transform:h,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},t.prototype.getAxis=function(e){return this._axesMap.get(e)},t.prototype.dataToPoint=function(e,r){return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(e),r)},t.prototype.eachActiveState=function(e,r,n,i){n==null&&(n=0),i==null&&(i=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];te(o,function(v){s.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var c=this.hasAxisBrushed(),u=n;ua*(1-f[0])?(c="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=r.axisExpandWidth/u,l?yx(l,i,o,"all"):c="none";else{var h=i[1]-i[0],p=o[1]*s/h;i=[jRe(0,p-h/2)],i[1]=FRe(o[1],i[0]+h),i[0]=i[1]-h}return{axisExpandWindow:i,behavior:c}},t}();function Dk(t,e){return FRe(jRe(t,e[0]),e[1])}function jor(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function Uor(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,c=!1,u;return t=0;i--)Lf(n[i])},e.prototype.getActiveState=function(r){var n=this.activeIntervals;if(!n.length)return"normal";if(r==null||isNaN(+r))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=r&&r<=i[1])return"active"}else for(var a=0,o=n.length;aWor}function WRe(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function qRe(t,e,r,n){var i=new fr;return i.add(new In({name:"main",style:gne(r),silent:!0,draggable:!0,cursor:"move",drift:Er(dye,t,e,i,["n","s","w","e"]),ondragend:Er(P2,e,{isEnd:!0})})),te(n,function(a){i.add(new In({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Er(dye,t,e,i,a),ondragend:Er(P2,e,{isEnd:!0})}))}),i}function YRe(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=X5(i,qor),o=r[0][0],s=r[1][0],l=o-i/2,c=s-i/2,u=r[0][1],f=r[1][1],d=u-a+i/2,h=f-a+i/2,p=u-o,g=f-s,v=p+i,y=g+i;rg(t,e,"main",o,s,p,g),n.transformable&&(rg(t,e,"w",l,c,a,y),rg(t,e,"e",d,c,a,y),rg(t,e,"n",l,c,v,a),rg(t,e,"s",l,h,v,a),rg(t,e,"nw",l,c,a,a),rg(t,e,"ne",d,c,a,a),rg(t,e,"sw",l,h,a,a),rg(t,e,"se",d,h,a,a))}function HZ(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(gne(r)),i.attr({silent:!n,cursor:n?"move":"default"}),te([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?VZ(t,a[0]):Jor(t,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Kor[s]+"-resize":null})})}function rg(t,e,r,n,i,a,o){var s=e.childOfName(r);s&&s.setShape(tsr(vne(t,e,[[n,i],[n+a,i+o]])))}function gne(t){return tr({strokeNoScale:!0},t.brushStyle)}function KRe(t,e,r,n){var i=[FE(t,r),FE(e,n)],a=[X5(t,r),X5(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Xor(t){return Sb(t.group)}function VZ(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=RB(r[e],Xor(t));return n[i]}function Jor(t,e){var r=[VZ(t,e[0]),VZ(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function dye(t,e,r,n,i,a){var o=r.__brushOption,s=t.toRectRange(o.range),l=ZRe(e,i,a);te(n,function(c){var u=Yor[c];s[u[0]][u[1]]+=l[u[0]]}),o.range=t.fromRectRange(KRe(s[0][0],s[1][0],s[0][1],s[1][1])),dne(e,r),P2(e,{isEnd:!1})}function esr(t,e,r,n){var i=e.__brushOption.range,a=ZRe(t,r,n);te(i,function(o){o[0]+=a[0],o[1]+=a[1]}),dne(t,e),P2(t,{isEnd:!1})}function ZRe(t,e,r){var n=t.group,i=n.transformCoordToLocal(e,r),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function vne(t,e,r){var n=GRe(t,e);return n&&n!==k2?n.clipPath(r,t._transform):ur(r)}function tsr(t){var e=FE(t[0][0],t[1][0]),r=FE(t[0][1],t[1][1]),n=X5(t[0][0],t[1][0]),i=X5(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function rsr(t,e,r){if(!(!t._brushType||isr(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=pne(t,e,r);if(!t._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var tF={lineX:gye(0),lineY:gye(1),rect:{createCover:function(t,e){function r(n){return n}return qRe({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=WRe(t);return KRe(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){YRe(t,e,r,n)},updateCommon:HZ,contain:WZ},polygon:{createCover:function(t,e){var r=new fr;return r.add(new Gc({name:"main",style:gne(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new dl({name:"main",draggable:!0,drift:Er(esr,t,e),ondragend:Er(P2,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:vne(t,e,r)})},updateCommon:HZ,contain:WZ}};function gye(t){return{createCover:function(e,r){return qRe({toRectRange:function(n){var i=[n,[0,100]];return t&&i.reverse(),i},fromRectRange:function(n){return n[t]}},e,r,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var r=WRe(e),n=FE(r[0][t],r[1][t]),i=X5(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,o=GRe(e,r);if(o!==k2&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(t);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[n,a];t&&l.reverse(),YRe(e,r,l,i)},updateCommon:HZ,contain:WZ}}function XRe(t){return t=mne(t),function(e){return C7e(e,t)}}function JRe(t,e){return t=mne(t),function(r){var n=e??r,i=n?t.width:t.height,a=n?t.x:t.y;return[a,a+(i||0)]}}function eMe(t,e,r){var n=mne(t);return function(i,a){return n.contain(a[0],a[1])&&!XB(i,e,r)}}function mne(t){return tn.create(t)}var asr=["axisLine","axisTickLabel","axisName"],osr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){t.prototype.init.apply(this,arguments),(this._brushController=new fne(n.getZr())).on("brush",Mt(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!ssr(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new fr,this.group.add(this._axisGroup),!!r.get("show")){var s=csr(r,n),l=s.coordinateSystem,c=r.getAreaSelectStyle(),u=c.width,f=r.axis.dim,d=l.getAxisLayout(f),h=st({strokeContainThreshold:u},d),p=new zl(r,h);te(asr,p.add,p),this._axisGroup.add(p.getGroup()),this._refreshBrushController(h,c,r,s,u,i),f9(o,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),c=l[1]-l[0],u=Math.min(30,Math.abs(c)*.1),f=tn.create({x:l[0],y:-o/2,width:c,height:o});f.x-=u,f.width+=2*u,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:XRe(f),isTargetByCursor:eMe(f,s,a),getLinearBrushOtherExtent:JRe(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(lsr(i))},e.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=ft(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(ca);function ssr(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function lsr(t){var e=t.axis;return ft(t.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(r[0],!0),e.dataToCoord(r[1],!0)]}})}function csr(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var usr={type:"axisAreaSelect",event:"axisAreaSelected"};function fsr(t){t.registerAction(usr,function(e,r){r.eachComponent({mainType:"parallelAxis",query:e},function(n){n.axis.model.setActiveIntervals(e.intervals)})}),t.registerAction("parallelAxisExpand",function(e,r){r.eachComponent({mainType:"parallel",query:e},function(n){n.setAxisExpand(e)})})}var dsr={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function tMe(t){t.registerComponentView(Dor),t.registerComponentModel(Oor),t.registerCoordinateSystem("parallel",Hor),t.registerPreprocessor(kor),t.registerComponentModel(UZ),t.registerComponentView(osr),Z5(t,"parallel",UZ,dsr),fsr(t)}function hsr(t){Xr(tMe),t.registerChartView(xor),t.registerSeriesModel(Cor),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,Ior)}var psr=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return t}(),gsr=function(t){Ge(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new psr},e.prototype.buildPath=function(r,n){var i=n.extent;r.moveTo(n.x1,n.y1),r.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(r.lineTo(n.x2+i,n.y2),r.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(r.lineTo(n.x2,n.y2+i),r.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),r.closePath()},e.prototype.highlight=function(){Vp(this)},e.prototype.downplay=function(){Gp(this)},e}(rn),vsr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._focusAdjacencyDisabled=!1,r}return e.prototype.render=function(r,n,i){var a=this,o=r.getGraph(),s=this.group,l=r.layoutInfo,c=l.width,u=l.height,f=r.getData(),d=r.getData("edge"),h=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(p){var g=new gsr,v=br(g);v.dataIndex=p.dataIndex,v.seriesIndex=r.seriesIndex,v.dataType="edge";var y=p.getModel(),m=y.getModel("lineStyle"),b=m.get("curveness"),w=p.node1.getLayout(),C=p.node1.getModel(),A=C.get("localX"),S=C.get("localY"),I=p.node2.getLayout(),D=p.node2.getModel(),L=D.get("localX"),O=D.get("localY"),P=p.getLayout(),x,T,E,N,F,B,j,k;switch(g.shape.extent=Math.max(1,P.dy),g.shape.orient=h,h==="vertical"?(x=(A!=null?A*c:w.x)+P.sy,T=(S!=null?S*u:w.y)+w.dy,E=(L!=null?L*c:I.x)+P.ty,N=O!=null?O*u:I.y,F=x,B=T*(1-b)+N*b,j=E,k=T*b+N*(1-b)):(x=(A!=null?A*c:w.x)+w.dx,T=(S!=null?S*u:w.y)+P.sy,E=L!=null?L*c:I.x,N=(O!=null?O*u:I.y)+P.ty,F=x*(1-b)+E*b,B=T,j=x*b+E*(1-b),k=N),g.setShape({x1:x,y1:T,x2:E,y2:N,cpx1:F,cpy1:B,cpx2:j,cpy2:k}),g.useStyle(m.getItemStyle()),g.style.fill){case"source":g.style.fill=p.node1.getVisual("color"),g.style.decal=p.node1.getVisual("style").decal;break;case"target":g.style.fill=p.node2.getVisual("color"),g.style.decal=p.node2.getVisual("style").decal;break;case"gradient":var $=p.node1.getVisual("color"),H=p.node2.getVisual("color");typeof $=="string"&&typeof H=="string"&&(g.style.fill=new Nh(0,0,+(h==="horizontal"),+(h==="vertical"),[{color:$,offset:0},{color:H,offset:1}]))}var Y=y.getModel("emphasis");Os(g,y,"lineStyle",function(W){return W.getItemStyle()}),s.add(g),d.setItemGraphicEl(p.dataIndex,g);var ie=Y.get("focus");Ri(g,ie==="adjacency"?p.getAdjacentDataIndices():ie,Y.get("blurScope")),br(g).dataType="edge"}),o.eachNode(function(p){var g=p.getLayout(),v=p.getModel(),y=v.get("localX"),m=v.get("localY"),b=v.getModel("emphasis"),w=new In({shape:{x:y!=null?y*c:g.x,y:m!=null?m*u:g.y,width:g.dx,height:g.dy},style:v.getModel("itemStyle").getItemStyle(),z2:10});wl(w,ds(v),{labelFetcher:r,labelDataIndex:p.dataIndex,defaultText:p.id}),w.disableLabelAnimation=!0,w.setStyle("fill",p.getVisual("color")),w.setStyle("decal",p.getVisual("style").decal),Os(w,v),s.add(w),f.setItemGraphicEl(p.dataIndex,w),br(w).dataType="node";var C=b.get("focus");Ri(w,C==="adjacency"?p.getAdjacentDataIndices():C,b.get("blurScope"))}),f.eachItemGraphicEl(function(p,g){var v=f.getItemModel(g);v.get("draggable")&&(p.drift=function(y,m){a._focusAdjacencyDisabled=!0,this.shape.x+=y,this.shape.y+=m,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:f.getRawIndex(g),localX:this.shape.x/c,localY:this.shape.y/u})},p.ondragend=function(){a._focusAdjacencyDisabled=!1},p.draggable=!0,p.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(msr(s.getBoundingRect(),r,function(){s.removeClipPath()})),this._data=r.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(xi);function msr(t,e,r){var n=new In({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return la(n,{shape:{width:t.width+20}},e,r),n}var ysr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){var i=r.edges||r.links,a=r.data||r.nodes,o=r.levels;this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new ai(o[l],this,n));if(a&&i){var c=$Re(a,i,this,!0,u);return c.data}function u(f,d){f.wrapMethod("getItemModel",function(h,p){var g=h.parentModel,v=g.getData().getItemLayout(p);if(v){var y=v.depth,m=g.levelModels[y];m&&(h.parentModel=m)}return h}),d.wrapMethod("getItemModel",function(h,p){var g=h.parentModel,v=g.getGraph().getEdgeByIndex(p),y=v.node1.getLayout();if(y){var m=y.depth,b=g.levelModels[m];b&&(h.parentModel=b)}return h})}},e.prototype.setNodePosition=function(r,n){var i=this.option.data||this.option.nodes,a=i[r];a.localX=n[0],a.localY=n[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(r,n,i){function a(h){return isNaN(h)||h==null}if(i==="edge"){var o=this.getDataParams(r,i),s=o.data,l=o.value,c=s.source+" -- "+s.target;return Ho("nameValue",{name:c,value:l,noValue:a(l)})}else{var u=this.getGraph().getNodeByIndex(r),f=u.getLayout().value,d=this.getDataParams(r,i).data.name;return Ho("nameValue",{name:d!=null?d+"":null,value:f,noValue:a(f)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(r,n){var i=t.prototype.getDataParams.call(this,r,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(r),o=a.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(Mi);function wsr(t,e){t.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=bsr(r,e);r.layoutInfo=a;var o=a.width,s=a.height,l=r.getGraph(),c=l.nodes,u=l.edges;_sr(c);var f=qi(c,function(g){return g.getLayout().value===0}),d=f.length!==0?0:r.get("layoutIterations"),h=r.get("orient"),p=r.get("nodeAlign");xsr(c,u,n,i,o,s,d,h,p)})}function bsr(t,e){return Eo(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function xsr(t,e,r,n,i,a,o,s,l){Ssr(t,e,r,i,a,s,l),Esr(t,e,a,i,n,o,s),Lsr(t,s)}function _sr(t){te(t,function(e){var r=x1(e.outEdges,BO),n=x1(e.inEdges,BO),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function Ssr(t,e,r,n,i,a,o){for(var s=[],l=[],c=[],u=[],f=0,d=0;d=0;y&&v.depth>h&&(h=v.depth),g.setLayout({depth:y?v.depth:f},!0),a==="vertical"?g.setLayout({dy:r},!0):g.setLayout({dx:r},!0);for(var m=0;mf-1?h:f-1;o&&o!=="left"&&Csr(t,o,a,S);var I=a==="vertical"?(i-r)/S:(n-r)/S;Tsr(t,I,a)}function rMe(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function Csr(t,e,r,n){if(e==="right"){for(var i=[],a=t,o=0;a.length;){for(var s=0;s0;a--)l*=.99,Psr(s,l,o),ZV(s,i,r,n,o),Osr(s,l,o),ZV(s,i,r,n,o)}function Isr(t,e){var r=[],n=e==="vertical"?"y":"x",i=QK(t,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),te(i.keys,function(a){r.push(i.buckets.get(a))}),r}function ksr(t,e,r,n,i,a){var o=1/0;te(t,function(s){var l=s.length,c=0;te(s,function(f){c+=f.getLayout().value});var u=a==="vertical"?(n-(l-1)*i)/c:(r-(l-1)*i)/c;u0&&(s=l.getLayout()[a]+c,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),u=l.getLayout()[a]+l.getLayout()[d]+e;var p=i==="vertical"?n:r;if(c=u-e-p,c>0){s=l.getLayout()[a]-c,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),u=s;for(var h=f-2;h>=0;--h)l=o[h],c=l.getLayout()[a]+l.getLayout()[d]+e-u,c>0&&(s=l.getLayout()[a]-c,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),u=l.getLayout()[a]}})}function Psr(t,e,r){te(t.slice().reverse(),function(n){te(n,function(i){if(i.outEdges.length){var a=x1(i.outEdges,Rsr,r)/x1(i.outEdges,BO);if(isNaN(a)){var o=i.outEdges.length;a=o?x1(i.outEdges,Msr,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-X1(i,r))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-X1(i,r))*e;i.setLayout({y:l},!0)}}})})}function Rsr(t,e){return X1(t.node2,e)*t.getValue()}function Msr(t,e){return X1(t.node2,e)}function Dsr(t,e){return X1(t.node1,e)*t.getValue()}function Nsr(t,e){return X1(t.node1,e)}function X1(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function BO(t){return t.getValue()}function x1(t,e,r){for(var n=0,i=t.length,a=-1;++aa&&(a=s)}),te(n,function(o){var s=new Uo({type:"color",mappingMethod:"linear",dataExtent:[i,a],visual:e.get("color")}),l=s.mapValueToVisual(o.getLayout().value),c=o.getModel().get(["itemStyle","color"]);c!=null?(o.setVisual("color",c),o.setVisual("style",{fill:c})):(o.setVisual("color",l),o.setVisual("style",{fill:l}))})}})}function Bsr(t){t.registerChartView(vsr),t.registerSeriesModel(ysr),t.registerLayout(wsr),t.registerVisual($sr),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:"series",subType:"sankey",query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var nMe=function(){function t(){}return t.prototype.getInitialData=function(e,r){var n,i=r.getComponent("xAxis",this.get("xAxisIndex")),a=r.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",n=i.getOrdinalMeta(),l=!0):s==="category"?(e.layout="vertical",n=a.getOrdinalMeta(),l=!0):e.layout=e.layout||"horizontal";var c=["x","y"],u=e.layout==="horizontal"?0:1,f=this._baseAxisDim=c[u],d=c[1-u],h=[i,a],p=h[u].get("type"),g=h[1-u].get("type"),v=e.data;if(v&&l){var y=[];te(v,function(w,C){var A;lt(w)?(A=w.slice(),w.unshift(C)):lt(w.value)?(A=st({},w),A.value=A.value.slice(),w.value.unshift(C)):A=w,y.push(A)}),e.data=y}var m=this.defaultValueDimensions,b=[{name:f,type:IO(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:d,type:IO(g),dimsDef:m.slice()}];return nC(this,{coordDimensions:b,dimensionsCount:m.length+1,encodeDefaulter:Er(Q7e,b,this)})},t.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},t}(),iMe=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],r.visualDrawType="stroke",r}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(Mi);xo(iMe,nMe,!0);var Fsr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=r.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=r.get("layout")==="horizontal"?1:0;a.diff(s).add(function(c){if(a.hasValue(c)){var u=a.getItemLayout(c),f=vye(u,a,c,l,!0);a.setItemGraphicEl(c,f),o.add(f)}}).update(function(c,u){var f=s.getItemGraphicEl(u);if(!a.hasValue(c)){o.remove(f);return}var d=a.getItemLayout(c);f?(Sh(f),aMe(d,f,a,c)):f=vye(d,a,c,l),o.add(f),a.setItemGraphicEl(c,f)}).remove(function(c){var u=s.getItemGraphicEl(c);u&&o.remove(u)}).execute(),this._data=a},e.prototype.remove=function(r){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},e.type="boxplot",e}(xi),jsr=function(){function t(){}return t}(),Usr=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="boxplotBoxPath",n}return e.prototype.getDefaultShape=function(){return new jsr},e.prototype.buildPath=function(r,n){var i=n.points,a=0;for(r.moveTo(i[a][0],i[a][1]),a++;a<4;a++)r.lineTo(i[a][0],i[a][1]);for(r.closePath();ag){var w=[y,b];n.push(w)}}}return{boxData:r,outliers:n}}var Ksr={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==hl){var n="";Xn(n)}var i=Ysr(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Zsr(t){t.registerSeriesModel(iMe),t.registerChartView(Fsr),t.registerVisual(Hsr),t.registerLayout(Vsr),t.registerTransform(Ksr)}var Qsr=["color","borderColor"],Xsr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){this.group.removeClipPath(),this._updateDrawMode(r),this._isLargeDraw?this._renderLarge(r):this._renderNormal(r)},e.prototype.incrementalPrepareRender=function(r,n,i){this._clear(),this._updateDrawMode(r)},e.prototype.incrementalRender=function(r,n,i,a){this._isLargeDraw?this._incrementalRenderLarge(r,n):this._incrementalRenderNormal(r,n)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r){var n=r.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,c=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(u){if(n.hasValue(u)){var f=n.getItemLayout(u);if(s&&mye(c,f))return;var d=QV(f,u,!0);la(d,{shape:{points:f.ends}},r,u),XV(d,n,u,o),a.add(d),n.setItemGraphicEl(u,d)}}).update(function(u,f){var d=i.getItemGraphicEl(f);if(!n.hasValue(u)){a.remove(d);return}var h=n.getItemLayout(u);if(s&&mye(c,h)){a.remove(d);return}d?(Mn(d,{shape:{points:h.ends}},r,u),Sh(d)):d=QV(h),XV(d,n,u,o),a.add(d),n.setItemGraphicEl(u,d)}).remove(function(u){var f=i.getItemGraphicEl(u);f&&a.remove(f)}).execute(),this._data=n},e.prototype._renderLarge=function(r){this._clear(),wye(r,this.group);var n=r.get("clip",!0)?QB(r.coordinateSystem,!1,r):null;n?this.group.setClipPath(n):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=r.next())!=null;){var s=i.getItemLayout(o),l=QV(s);XV(l,i,o,a),l.incremental=!0,this.group.add(l)}},e.prototype._incrementalRenderLarge=function(r,n){wye(n,this.group,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(xi),Jsr=function(){function t(){}return t}(),elr=function(t){Ge(e,t);function e(r){var n=t.call(this,r)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new Jsr},e.prototype.buildPath=function(r,n){var i=n.points;this.__simpleBox?(r.moveTo(i[4][0],i[4][1]),r.lineTo(i[6][0],i[6][1])):(r.moveTo(i[0][0],i[0][1]),r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]),r.lineTo(i[3][0],i[3][1]),r.closePath(),r.moveTo(i[4][0],i[4][1]),r.lineTo(i[5][0],i[5][1]),r.moveTo(i[6][0],i[6][1]),r.lineTo(i[7][0],i[7][1]))},e}(rn);function QV(t,e,r){var n=t.ends;return new elr({shape:{points:r?tlr(n,t):n},z2:100})}function mye(t,e){for(var r=!0,n=0;n0?"borderColor":"borderColor0"])||r.get(["itemStyle",t>0?"color":"color0"]),a=r.getModel("itemStyle").getItemStyle(Qsr);e.useStyle(a),e.style.fill=null,e.style.stroke=i}var oMe=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],r}return e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(r,n,i){var a=n.getItemLayout(r);return a&&i.rect(a.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Mi);xo(oMe,nMe,!0);function nlr(t){!t||!lt(t.series)||te(t.series,function(e){dr(e)&&e.type==="k"&&(e.type="candlestick")})}var ilr=["itemStyle","borderColor"],alr=["itemStyle","borderColor0"],olr=["itemStyle","color"],slr=["itemStyle","color0"],llr={seriesType:"candlestick",plan:tC(),performRawSeries:!0,reset:function(t,e){function r(a,o){return o.get(a>0?olr:slr)}function n(a,o){return o.get(a>0?ilr:alr)}if(!e.isSeriesFiltered(t)){var i=t.pipelineContext.large;return!i&&{progress:function(a,o){for(var s;(s=a.next())!=null;){var l=o.getItemModel(s),c=o.getItemLayout(s).sign,u=l.getItemStyle();u.fill=r(c,l),u.stroke=n(c,l)||u.fill;var f=o.ensureUniqueItemVisual(s,"style");st(f,u)}}}}}},clr=typeof Float32Array<"u"?Float32Array:Array,ulr={seriesType:"candlestick",plan:tC(),reset:function(t){var e=t.coordinateSystem,r=t.getData(),n=flr(t,r),i=0,a=1,o=["x","y"],s=r.getDimensionIndex(r.mapDimension(o[i])),l=ft(r.mapDimensionsAll(o[a]),r.getDimensionIndex,r),c=l[0],u=l[1],f=l[2],d=l[3];if(r.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),s<0||l.length<4)return;return{progress:t.pipelineContext.large?p:h};function h(g,v){for(var y,m=v.getStore();(y=g.next())!=null;){var b=m.get(s,y),w=m.get(c,y),C=m.get(u,y),A=m.get(f,y),S=m.get(d,y),I=Math.min(w,C),D=Math.max(w,C),L=E(I,b),O=E(D,b),P=E(A,b),x=E(S,b),T=[];N(T,O,0),N(T,L,1),T.push(B(x),B(O),B(P),B(L)),v.setItemLayout(y,{sign:xye(m,y,w,C,u),initBaseline:w>C?O[a]:L[a],ends:T,brushRect:F(A,S,b)})}function E(j,k){var $=[];return $[i]=k,$[a]=j,isNaN(k)||isNaN(j)?[NaN,NaN]:e.dataToPoint($)}function N(j,k,$){var H=k.slice(),Y=k.slice();H[i]=gM(H[i]+n/2,1,!1),Y[i]=gM(Y[i]-n/2,1,!0),$?j.push(H,Y):j.push(Y,H)}function F(j,k,$){var H=E(j,$),Y=E(k,$);return H[i]-=n/2,Y[i]-=n/2,{x:H[0],y:H[1],width:n,height:Y[1]-H[1]}}function B(j){return j[i]=gM(j[i],1),j}}function p(g,v){for(var y=new clr(g.count*4),m=0,b,w=[],C=[],A,S=v.getStore();(A=g.next())!=null;){var I=S.get(s,A),D=S.get(c,A),L=S.get(u,A),O=S.get(f,A),P=S.get(d,A);if(isNaN(I)||isNaN(O)||isNaN(P)){y[m++]=NaN,m+=3;continue}y[m++]=xye(S,A,D,L,u),w[i]=I,w[a]=O,b=e.dataToPoint(w,null,C),y[m++]=b?b[0]:NaN,y[m++]=b?b[1]:NaN,w[a]=P,b=e.dataToPoint(w,null,C),y[m++]=b?b[1]:NaN}v.setLayout("largePoints",y)}}};function xye(t,e,r,n,i){var a;return r>n?a=-1:r0?t.get(i,e-1)<=n?1:-1:1,a}function flr(t,e){var r=t.getBaseAxis(),n,i=r.type==="category"?r.getBandWidth():(n=r.getExtent(),Math.abs(n[1]-n[0])/e.count()),a=xt(Cn(t.get("barMaxWidth"),i),i),o=xt(Cn(t.get("barMinWidth"),1),i),s=t.get("barWidth");return s!=null?xt(s,i):Math.max(Math.min(i/2,a),o)}function dlr(t){t.registerChartView(Xsr),t.registerSeriesModel(oMe),t.registerPreprocessor(nlr),t.registerVisual(llr),t.registerLayout(ulr)}function _ye(t,e){var r=e.rippleEffectColor||e.color;t.eachChild(function(n){n.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?r:null,fill:e.brushType==="fill"?r:null}})})}var hlr=function(t){Ge(e,t);function e(r,n){var i=t.call(this)||this,a=new x9(r,n),o=new fr;return i.add(a),i.add(o),i.updateData(r,n),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(r){for(var n=r.symbolType,i=r.color,a=r.rippleNumber,o=this.childAt(1),s=0;s0&&(l=this._getLineLength(a)/u*1e3),(l!==this._period||c!==this._loop)&&(a.stopAnimation(),l>0)){var d=void 0;typeof f=="function"?d=f(i):d=f,a.__t>0&&(d=-l*a.__t),a.__t=0;var h=a.animate("",c).when(l,{__t:1}).delay(d).during(function(){o._updateSymbolPosition(a)});c||h.done(function(){o.remove(a)}),h.start()}this._period=l,this._loop=c}},e.prototype._getLineLength=function(r){return Ym(r.__p1,r.__cp1)+Ym(r.__cp1,r.__p2)},e.prototype._updateAnimationPoints=function(r,n){r.__p1=n[0],r.__p2=n[1],r.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},e.prototype.updateData=function(r,n,i){this.childAt(0).updateData(r,n,i),this._updateEffectSymbol(r,n)},e.prototype._updateSymbolPosition=function(r){var n=r.__p1,i=r.__p2,a=r.__cp1,o=r.__t,s=[r.x,r.y],l=s.slice(),c=ns,u=tZ;s[0]=c(n[0],a[0],i[0],o),s[1]=c(n[1],a[1],i[1],o);var f=u(n[0],a[0],i[0],o),d=u(n[1],a[1],i[1],o);r.rotation=-Math.atan2(d,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(r.__lastT!==void 0&&r.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var u=(n-a[l])/(a[l+1]-a[l]),f=i[l],d=i[l+1];r.x=f[0]*(1-u)+u*d[0],r.y=f[1]*(1-u)+u*d[1];var h=d[0]-f[0],p=d[1]-f[1];r.rotation=-Math.atan2(p,h)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},e}(sMe),ylr=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),Sye=function(t){Ge(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ylr},e.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness;if(n.polyline)for(var o=0;o0){r.moveTo(i[o++],i[o++]);for(var l=1;l0){var h=(c+f)/2-(u-d)*a,p=(u+d)/2-(f-c)*a;r.quadraticCurveTo(h,p,f,d)}else r.lineTo(f,d)}},e.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,c=0;c0)for(var f=a[c++],d=a[c++],h=1;h0){var v=(f+p)/2-(d-g)*o,y=(d+g)/2-(p-f)*o;if(KIe(f,d,v,y,p,g,s,r,n))return l}else if(bm(f,d,p,g,s,r,n))return l;l++}return-1},e}(rn),wlr=function(){function t(){this.group=new fr}return t.prototype.isPersistent=function(){return!this._incremental},t.prototype.updateData=function(e){this.group.removeAll();var r=new Sye({rectHover:!0,cursor:"default"});r.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(r,e),this.group.add(r),this._incremental=null},t.prototype.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new IB({silent:!0})),this.group.add(this._incremental)):this._incremental=null},t.prototype.incrementalUpdate=function(e,r){var n=new Sye;n.setShape({segs:r.getLayout("linesPoints")}),this._setCommon(n,r,!!this._incremental),this._incremental?this._incremental.addDisplayable(n,!0):(n.rectHover=!0,n.cursor="default",n.__startIndex=e.start,this.group.add(n))},t.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},t.prototype._setCommon=function(e,r,n){var i=r.hostModel;e.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),e.useStyle(i.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var a=r.getVisual("style");if(a&&a.stroke&&e.setStyle("stroke",a.stroke),e.setStyle("fill",null),!n){var o=br(e);o.seriesIndex=i.seriesIndex,e.on("mousemove",function(s){o.dataIndex=null;var l=e.findDataIndex(s.offsetX,s.offsetY);l>0&&(o.dataIndex=l+e.__startIndex)})}},t.prototype._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()},t}(),cMe={seriesType:"lines",plan:tC(),reset:function(t){var e=t.coordinateSystem,r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var c=0,u=i.start;u"u"?Array:Uint32Array,_lr=typeof Float64Array>"u"?Array:Float64Array;function Cye(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=ft(e,function(r){var n=[r[0].coord,r[1].coord],i={coords:n};return r[0].name&&(i.fromName=r[0].name),r[1].name&&(i.toName=r[1].name),Qte([i,r[0],r[1]])}))}var Slr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.visualStyleAccessPath="lineStyle",r.visualDrawType="stroke",r}return e.prototype.init=function(r){r.data=r.data||[],Cye(r);var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(r){if(Cye(r),r.data){var n=this._processFlatCoordsArray(r.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(r.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(r){var n=this._processFlatCoordsArray(r.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=NK(this._flatCoords,n.flatCoords),this._flatCoordsOffset=NK(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),r.data=new Float32Array(n.count)),this.getRawData().appendData(r.data)},e.prototype._getCoordsFromItemModel=function(r){var n=this.getData().getItemModel(r),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(r){return this._flatCoordsOffset?this._flatCoordsOffset[r*2+1]:this._getCoordsFromItemModel(r).length},e.prototype.getLineCoords=function(r,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[r*2],a=this._flatCoordsOffset[r*2+1],o=0;o ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var r=this.option.progressive;return r??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var r=this.option.progressiveThreshold;return r??(this.option.large?2e4:this.get("progressiveThreshold"))},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Mi);function Nk(t){return t instanceof Array||(t=[t,t]),t}var Clr={seriesType:"lines",reset:function(t){var e=Nk(t.get("symbol")),r=Nk(t.get("symbolSize")),n=t.getData();n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]);function i(a,o){var s=a.getItemModel(o),l=Nk(s.getShallow("symbol",!0)),c=Nk(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),c[0]&&a.setItemVisual(o,"fromSymbolSize",c[0]),c[1]&&a.setItemVisual(o,"toSymbolSize",c[1])}return{dataEach:n.hasItemOption?i:null}}};function Alr(t){t.registerChartView(blr),t.registerSeriesModel(Slr),t.registerLayout(cMe),t.registerVisual(Clr)}var Tlr=256,Elr=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=G5();this.canvas=e}return t.prototype.update=function(e,r,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),c=this._getGradient(a,"outOfRange"),u=this.pointSize+this.blurSize,f=this.canvas,d=f.getContext("2d"),h=e.length;f.width=r,f.height=n;for(var p=0;p0){var P=o(b)?l:c;b>0&&(b=b*L+I),C[A++]=P[O],C[A++]=P[O+1],C[A++]=P[O+2],C[A++]=P[O+3]*b*256}else A+=4}return d.putImageData(w,0,0),f},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=G5()),r=this.pointSize+this.blurSize,n=r*2;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-r,r,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},t.prototype._getGradient=function(e,r){for(var n=this._gradientPixels,i=n[r]||(n[r]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},t}();function Ilr(t,e,r){var n=t[1]-t[0];e=ft(e,function(o){return{interval:[(o.interval[0]-t[0])/n,(o.interval[1]-t[0])/n]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&n<=e[1]}}function Aye(t){var e=t.dimensions;return e[0]==="lng"&&e[1]==="lat"}var Plr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this.group.removeAll(),this._incrementalDisplayable=null;var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(r,i,0,r.getData().count()):Aye(o)&&this._renderOnGeo(o,r,a,i)},e.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(Aye(o)?this.render(n,i,a):this._renderOnCartesianAndCalendar(n,a,r.start,r.end,!0))},e.prototype._renderOnCartesianAndCalendar=function(r,n,i,a,o){var s=r.coordinateSystem,l,c,u,f;if($g(s,"cartesian2d")){var d=s.getAxis("x"),h=s.getAxis("y");l=d.getBandWidth(),c=h.getBandWidth(),u=d.scale.getExtent(),f=h.scale.getExtent()}for(var p=this.group,g=r.getData(),v=r.getModel(["emphasis","itemStyle"]).getItemStyle(),y=r.getModel(["blur","itemStyle"]).getItemStyle(),m=r.getModel(["select","itemStyle"]).getItemStyle(),b=ds(r),w=r.get(["emphasis","focus"]),C=r.get(["emphasis","blurScope"]),A=$g(s,"cartesian2d")?[g.mapDimension("x"),g.mapDimension("y"),g.mapDimension("value")]:[g.mapDimension("time"),g.mapDimension("value")],S=i;Su[1]||Of[1])continue;var P=s.dataToPoint([L,O]);I=new In({shape:{x:Math.floor(Math.round(P[0])-l/2),y:Math.floor(Math.round(P[1])-c/2),width:Math.ceil(l),height:Math.ceil(c)},style:D})}else{if(isNaN(g.get(A[1],S)))continue;I=new In({z2:1,shape:s.dataToRect([g.get(A[0],S)]).contentShape,style:D})}var x=g.getItemModel(S);if(g.hasItemOption){var T=x.getModel("emphasis");v=T.getModel("itemStyle").getItemStyle(),y=x.getModel(["blur","itemStyle"]).getItemStyle(),m=x.getModel(["select","itemStyle"]).getItemStyle(),w=T.get("focus"),C=T.get("blurScope"),b=ds(x)}var E=r.getRawValue(S),N="-";E&&E[2]!=null&&(N=E[2]+""),wl(I,b,{labelFetcher:r,labelDataIndex:S,defaultOpacity:D.opacity,defaultText:N}),I.ensureState("emphasis").style=v,I.ensureState("blur").style=y,I.ensureState("select").style=m,Ri(I,w,C),I.incremental=o,o&&(I.states.emphasis.hoverLayer=!0),p.add(I),g.setItemGraphicEl(S,I)}},e.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),c=this._hmLayer||this._hmLayer||new Elr;c.blurSize=n.get("blurSize"),c.pointSize=n.get("pointSize"),c.minOpacity=n.get("minOpacity"),c.maxOpacity=n.get("maxOpacity");var u=r.getViewRect().clone(),f=r.getRoamTransform();u.applyTransform(f);var d=Math.max(u.x,0),h=Math.max(u.y,0),p=Math.min(u.width+u.x,a.getWidth()),g=Math.min(u.height+u.y,a.getHeight()),v=p-d,y=g-h,m=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(m,function(S,I,D){var L=r.dataToPoint([S,I]);return L[0]-=d,L[1]-=h,L.push(D),L}),w=i.getExtent(),C=i.type==="visualMap.continuous"?klr(w,i.option.range):Ilr(w,i.getPieceList(),i.option.selected);c.update(b,v,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},C);var A=new Io({style:{width:v,height:y,x:d,y:h,image:c.canvas},silent:!0});this.group.add(A)},e.type="heatmap",e}(xi),Rlr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return kv(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=p9.get(this.get("coordinateSystem"));if(r&&r.dimensions)return r.dimensions[0]==="lng"&&r.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(Mi);function Mlr(t){t.registerChartView(Plr),t.registerSeriesModel(Rlr)}var Dlr=["itemStyle","borderWidth"],Tye=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],JV=new _h,Nlr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=this._data,l=r.coordinateSystem,c=l.getBaseAxis(),u=c.isHorizontal(),f=l.master.getRect(),d={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:u,valueDim:Tye[+u],categoryDim:Tye[1-+u]};return o.diff(s).add(function(h){if(o.hasValue(h)){var p=Iye(o,h),g=Eye(o,h,p,d),v=kye(o,d,g);o.setItemGraphicEl(h,v),a.add(v),Rye(v,d,g)}}).update(function(h,p){var g=s.getItemGraphicEl(p);if(!o.hasValue(h)){a.remove(g);return}var v=Iye(o,h),y=Eye(o,h,v,d),m=gMe(o,y);g&&m!==g.__pictorialShapeStr&&(a.remove(g),o.setItemGraphicEl(h,null),g=null),g?Ulr(g,d,y):g=kye(o,d,y,!0),o.setItemGraphicEl(h,g),g.__pictorialSymbolMeta=y,a.add(g),Rye(g,d,y)}).remove(function(h){var p=s.getItemGraphicEl(h);p&&Pye(s,h,p.__pictorialSymbolMeta.animationModel,p)}).execute(),this._data=o,this.group},e.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){Pye(a,br(o).dataIndex,r,o)}):i.removeAll()},e.type="pictorialBar",e}(xi);function Eye(t,e,r,n){var i=t.getItemLayout(e),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=r.get("symbolPosition")||"start",l=r.get("symbolRotate"),c=(l||0)*Math.PI/180||0,u=r.get("symbolPatternSize")||2,f=r.isAnimationEnabled(),d={dataIndex:e,layout:i,itemModel:r,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:r.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:c,animationModel:f?r:null,hoverScale:f&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};Olr(r,a,i,n,d),Llr(t,e,i,a,o,d.boundingLength,d.pxSign,u,n,d),$lr(r,d.symbolScale,c,n,d);var h=d.symbolSize,p=rC(r.get("symbolOffset"),h);return Blr(r,h,i,a,o,p,s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,n,d),d}function Olr(t,e,r,n,i){var a=n.valueDim,o=t.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),c=1-+(r[a.wh]<=0),u;if(lt(o)){var f=[eG(s,o[0])-l,eG(s,o[1])-l];f[1]0?1:u<0?-1:0}function eG(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function Llr(t,e,r,n,i,a,o,s,l,c){var u=l.valueDim,f=l.categoryDim,d=Math.abs(r[f.wh]),h=t.getItemVisual(e,"symbolSize"),p;lt(h)?p=h.slice():h==null?p=["100%","100%"]:p=[h,h],p[f.index]=xt(p[f.index],d),p[u.index]=xt(p[u.index],n?d:Math.abs(a)),c.symbolSize=p;var g=c.symbolScale=[p[0]/s,p[1]/s];g[u.index]*=(l.isHorizontal?-1:1)*o}function $lr(t,e,r,n,i){var a=t.get(Dlr)||0;a&&(JV.attr({scaleX:e[0],scaleY:e[1],rotation:r}),JV.updateTransform(),a/=JV.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a}function Blr(t,e,r,n,i,a,o,s,l,c,u,f){var d=u.categoryDim,h=u.valueDim,p=f.pxSign,g=Math.max(e[h.index]+s,0),v=g;if(n){var y=Math.abs(l),m=as(t.get("symbolMargin"),"15%")+"",b=!1;m.lastIndexOf("!")===m.length-1&&(b=!0,m=m.slice(0,m.length-1));var w=xt(m,e[h.index]),C=Math.max(g+w*2,0),A=b?0:w*2,S=IIe(n),I=S?n:Mye((y+A)/C),D=y-I*g;w=D/2/(b?I:Math.max(I-1,1)),C=g+w*2,A=b?0:w*2,!S&&n!=="fixed"&&(I=c?Mye((Math.abs(c)+A)/C):0),v=I*C-A,f.repeatTimes=I,f.symbolMargin=w}var L=p*(v/2),O=f.pathPosition=[];O[d.index]=r[d.wh]/2,O[h.index]=o==="start"?L:o==="end"?l-L:l/2,a&&(O[0]+=a[0],O[1]+=a[1]);var P=f.bundlePosition=[];P[d.index]=r[d.xy],P[h.index]=r[h.xy];var x=f.barRectShape=st({},r);x[h.wh]=p*Math.max(Math.abs(r[h.wh]),Math.abs(O[h.index]+L)),x[d.wh]=r[d.wh];var T=f.clipShape={};T[d.xy]=-r[d.xy],T[d.wh]=u.ecSize[d.wh],T[h.xy]=0,T[h.wh]=r[h.wh]}function uMe(t){var e=t.symbolPatternSize,r=bo(t.symbolType,-e/2,-e/2,e,e);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function fMe(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=e.valueDim,c=r.repeatTimes||0,u=0,f=a[e.valueDim.index]+o+r.symbolMargin*2;for(yne(t,function(g){g.__pictorialAnimationIndex=u,g.__pictorialRepeatTimes=c,u0:y<0)&&(m=c-1-g),v[l.index]=f*(m-c/2+.5)+s[l.index],{x:v[0],y:v[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function dMe(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?I3(a,null,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation},r,n):(a=t.__pictorialMainPath=uMe(r),i.add(a),I3(a,{x:r.pathPosition[0],y:r.pathPosition[1],scaleX:0,scaleY:0,rotation:r.rotation},{scaleX:r.symbolScale[0],scaleY:r.symbolScale[1]},r,n))}function hMe(t,e,r){var n=st({},e.barRectShape),i=t.__pictorialBarRect;i?I3(i,null,{shape:n},e,r):(i=t.__pictorialBarRect=new In({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,t.add(i))}function pMe(t,e,r,n){if(r.symbolClip){var i=t.__pictorialClipPath,a=st({},r.clipShape),o=e.valueDim,s=r.animationModel,l=r.dataIndex;if(i)Mn(i,{shape:a},s,l);else{a[o.wh]=0,i=new In({shape:a}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var c={};c[o.wh]=r.clipShape[o.wh],h9[n?"updateProps":"initProps"](i,{shape:c},s,l)}}}function Iye(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=Flr,r.isAnimationEnabled=jlr,r}function Flr(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function jlr(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function kye(t,e,r,n){var i=new fr,a=new fr;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?fMe(i,e,r):dMe(i,e,r),hMe(i,r,n),pMe(i,e,r,n),i.__pictorialShapeStr=gMe(t,r),i.__pictorialSymbolMeta=r,i}function Ulr(t,e,r){var n=r.animationModel,i=r.dataIndex,a=t.__pictorialBundle;Mn(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?fMe(t,e,r,!0):dMe(t,e,r,!0),hMe(t,r,!0),pMe(t,e,r,!0)}function Pye(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];yne(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),te(a,function(o){Y1(o,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function gMe(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function yne(t,e,r){te(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function I3(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&h9[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function Rye(t,e,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),c=i.getShallow("cursor"),u=a.get("focus"),f=a.get("blurScope"),d=a.get("scale");yne(t,function(g){if(g instanceof Io){var v=g.style;g.useStyle(st({image:v.image,x:v.x,y:v.y,width:v.width,height:v.height},r.style))}else g.useStyle(r.style);var y=g.ensureState("emphasis");y.style=o,d&&(y.scaleX=g.scaleX*1.1,y.scaleY=g.scaleY*1.1),g.ensureState("blur").style=s,g.ensureState("select").style=l,c&&(g.cursor=c),g.z2=r.z2});var h=e.valueDim.posDesc[+(r.boundingLength>0)],p=t.__pictorialBarRect;wl(p,ds(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:K5(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:h}),Ri(t,u,f)}function Mye(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var zlr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r.defaultSymbol="roundRect",r}return e.prototype.getInitialData=function(r){return r.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=Sy(DE.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(DE);function Hlr(t){t.registerChartView(Nlr),t.registerSeriesModel(zlr),t.registerLayout(Er(vPe,"pictorialBar"))}var Vlr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._layers=[],r}return e.prototype.render=function(r,n,i){var a=r.getData(),o=this,s=this.group,l=r.getLayerSeries(),c=a.getLayout("layoutInfo"),u=c.rect,f=c.boundaryGap;s.x=0,s.y=u.y+f[0];function d(v){return v.name}var h=new pv(this._layersSeries||[],l,d,d),p=[];h.add(Mt(g,this,"add")).update(Mt(g,this,"update")).remove(Mt(g,this,"remove")).execute();function g(v,y,m){var b=o._layers;if(v==="remove"){s.remove(b[y]);return}for(var w=[],C=[],A,S=l[y].indices,I=0;Ia&&(a=s),n.push(s)}for(var c=0;ca&&(a=f)}return{y0:i,max:a}}function Klr(t){t.registerChartView(Vlr),t.registerSeriesModel(Wlr),t.registerLayout(qlr),t.registerProcessor(C9("themeRiver"))}var Zlr=2,Qlr=4,Nye=function(t){Ge(e,t);function e(r,n,i,a){var o=t.call(this)||this;o.z2=Zlr,o.textConfig={inside:!0},br(o).seriesIndex=n.seriesIndex;var s=new Bn({z2:Qlr,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return e.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;br(s).dataIndex=n.dataIndex;var l=n.getModel(),c=l.getModel("emphasis"),u=n.getLayout(),f=st({},u);f.label=null;var d=n.getVisual("style");d.lineJoin="bevel";var h=n.getVisual("decal");h&&(d.decal=RE(h,o));var p=t3(l.getModel("itemStyle"),f,!0);st(f,p),te(Ql,function(m){var b=s.ensureState(m),w=l.getModel([m,"itemStyle"]);b.style=w.getItemStyle();var C=t3(w,f);C&&(b.shape=C)}),r?(s.setShape(f),s.shape.r=u.r0,Mn(s,{shape:{r:u.r}},i,n.dataIndex)):(Mn(s,{shape:f},i),Sh(s)),s.useStyle(d),this._updateLabel(i);var g=l.getShallow("cursor");g&&s.attr("cursor",g),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=c.get("focus"),y=v==="ancestor"?n.getAncestorsIndices():v==="descendant"?n.getDescendantIndices():v;Ri(this,y,c.get("blurScope"))},e.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,c=Math.cos(l),u=Math.sin(l),f=this,d=f.getTextContent(),h=this.node.dataIndex,p=a.get("minAngle")/180*Math.PI,g=a.get("show")&&!(p!=null&&Math.abs(s)Math.PI/2?"right":"left"):!P||P==="center"?(L=(o.r+o.r0)/2,P="center"):P==="left"?(L=o.r0+O,l>Math.PI/2&&(P="right")):P==="right"&&(L=o.r-O,l>Math.PI/2&&(P="left")),w.style.align=P,w.style.verticalAlign=v(m,"verticalAlign")||"middle",w.x=L*c+o.cx,w.y=L*u+o.cy;var x=v(m,"rotate"),T=0;x==="radial"?(T=-l,T<-Math.PI/2&&(T+=Math.PI)):x==="tangential"?(T=Math.PI/2-l,T>Math.PI/2?T-=Math.PI:T<-Math.PI/2&&(T+=Math.PI)):typeof x=="number"&&(T=x*Math.PI/180),w.rotation=T});function v(y,m){var b=y.get(m);return b??a.get(m)}d.dirtyStyle()},e}(Xl),qZ="sunburstRootToNode",Oye="sunburstHighlight",Xlr="sunburstUnhighlight";function Jlr(t){t.registerAction({type:qZ,update:"updateView"},function(e,r){r.eachComponent({mainType:"series",subType:"sunburst",query:e},n);function n(i,a){var o=OE(e,[qZ],i);if(o){var s=i.getViewRoot();s&&(e.direction=one(s,o.node)?"rollUp":"drillDown"),i.resetViewRoot(o.node)}}}),t.registerAction({type:Oye,update:"none"},function(e,r,n){e=st({},e),r.eachComponent({mainType:"series",subType:"sunburst",query:e},i);function i(a){var o=OE(e,[Oye],a);o&&(e.dataIndex=o.node.dataIndex)}n.dispatchAction(st(e,{type:"highlight"}))}),t.registerAction({type:Xlr,update:"updateView"},function(e,r,n){e=st({},e),n.dispatchAction(st(e,{type:"downplay"}))})}var ecr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i,a){var o=this;this.seriesModel=r,this.api=i,this.ecModel=n;var s=r.getData(),l=s.tree.root,c=r.getViewRoot(),u=this.group,f=r.get("renderLabelForZeroData"),d=[];c.eachNode(function(m){d.push(m)});var h=this._oldChildren||[];p(d,h),y(l,c),this._initEvents(),this._oldChildren=d;function p(m,b){if(m.length===0&&b.length===0)return;new pv(b,m,w,w).add(C).update(C).remove(Er(C,null)).execute();function w(A){return A.getId()}function C(A,S){var I=A==null?null:m[A],D=S==null?null:b[S];g(I,D)}}function g(m,b){if(!f&&m&&!m.getValue()&&(m=null),m!==l&&b!==l){if(b&&b.piece)m?(b.piece.updateData(!1,m,r,n,i),s.setItemGraphicEl(m.dataIndex,b.piece)):v(b);else if(m){var w=new Nye(m,r,n,i);u.add(w),s.setItemGraphicEl(m.dataIndex,w)}}}function v(m){m&&m.piece&&(u.remove(m.piece),m.piece=null)}function y(m,b){b.depth>0?(o.virtualPiece?o.virtualPiece.updateData(!1,m,r,n,i):(o.virtualPiece=new Nye(m,r,n,i),u.add(o.virtualPiece)),b.piece.off("click"),o.virtualPiece.on("click",function(w){o._rootToNode(b.parentNode)})):o.virtualPiece&&(u.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var r=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=r.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),c=l.get("link");if(c){var u=l.get("target",!0)||"_blank";yO(c,u)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:qZ,from:this.uid,seriesId:this.seriesModel.id,targetNode:r})},e.prototype.containPoint=function(r,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(xi),tcr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.ignoreStyleOnData=!0,r}return e.prototype.getInitialData=function(r,n){var i={name:r.name,children:r.data};vMe(i);var a=this._levelModels=ft(r.levels||[],function(l){return new ai(l,this,n)},this),o=ane.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(c,u){var f=o.getNodeByDataIndex(u),d=a[f.depth];return d&&(c.parentModel=d),c})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treePathInfo=JB(i,this),n},e.prototype.getLevelModel=function(r){return this._levelModels&&this._levelModels[r.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(r){r?this._viewRoot=r:r=this._viewRoot;var n=this.getRawData().tree.root;(!r||r!==n&&!n.contains(r))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){bRe(this)},e.type="series.sunburst",e.defaultOption={zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(Mi);function vMe(t){var e=0;te(t.children,function(n){vMe(n);var i=n.value;lt(i)&&(i=i[0]),e+=i});var r=t.value;lt(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=e),r<0&&(r=0),lt(t.value)?t.value[0]=r:t.value=r}var Lye=Math.PI/180;function rcr(t,e,r){e.eachSeriesByType(t,function(n){var i=n.get("center"),a=n.get("radius");lt(a)||(a=[0,a]),lt(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),c=xt(i[0],o),u=xt(i[1],s),f=xt(a[0],l/2),d=xt(a[1],l/2),h=-n.get("startAngle")*Lye,p=n.get("minAngle")*Lye,g=n.getData().tree.root,v=n.getViewRoot(),y=v.depth,m=n.get("sort");m!=null&&mMe(v,m);var b=0;te(v.children,function(N){!isNaN(N.getValue())&&b++});var w=v.getValue(),C=Math.PI/(w||b)*2,A=v.depth>0,S=v.height-(A?-1:1),I=(d-f)/(S||1),D=n.get("clockwise"),L=n.get("stillShowZeroSum"),O=D?1:-1,P=function(N,F){if(N){var B=F;if(N!==g){var j=N.getValue(),k=w===0&&L?C:j*C;k1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return n.depth>1&&typeof s=="string"&&(s=mIe(s,(n.depth-1)/(a-1)*.5)),s}t.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var c=i.ensureUniqueItemVisual(o.dataIndex,"style");st(c,l)})})}function acr(t){t.registerChartView(ecr),t.registerSeriesModel(tcr),t.registerLayout(Er(rcr,"sunburst")),t.registerProcessor(Er(C9,"sunburst")),t.registerVisual(icr),Jlr(t)}var ocr={x:1,y:1,scaleX:1,scaleY:1,originX:1,originY:1,rotation:1},$ye={color:"fill",borderColor:"stroke"},scr={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},ch=qn(),lcr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(r,n){return kv(null,this)},e.prototype.getDataParams=function(r,n,i){var a=t.prototype.getDataParams.call(this,r,n);return i&&(a.info=ch(i).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,clip:!1},e}(Mi);function ccr(t,e){return e=e||[0,0],ft(["x","y"],function(r,n){var i=this.getAxis(r),a=e[n],o=t[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function ucr(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(r){return t.dataToPoint(r)},size:Mt(ccr,t)}}}function fcr(t,e){return e=e||[0,0],ft([0,1],function(r){var n=e[r],i=t[r]/2,a=[],o=[];return a[r]=n-i,o[r]=n+i,a[1-r]=o[1-r]=e[1-r],Math.abs(this.dataToPoint(a)[r]-this.dataToPoint(o)[r])},this)}function dcr(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(r){return t.dataToPoint(r)},size:Mt(fcr,t)}}}function hcr(t,e){var r=this.getAxis(),n=e instanceof Array?e[0]:e,i=(t instanceof Array?t[0]:t)/2;return r.type==="category"?r.getBandWidth():Math.abs(r.dataToCoord(n-i)-r.dataToCoord(n+i))}function pcr(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(r){return t.dataToPoint(r)},size:Mt(hcr,t)}}}function gcr(t,e){return e=e||[0,0],ft(["Radius","Angle"],function(r,n){var i="get"+r+"Axis",a=this[i](),o=e[n],s=t[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return r==="Angle"&&(l=l*Math.PI/180),l},this)}function vcr(t){var e=t.getRadiusAxis(),r=t.getAngleAxis(),n=e.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),o=r.dataToAngle(i[1]),s=t.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Mt(gcr,t)}}}function mcr(t){var e=t.getRect(),r=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:r.start,end:r.end,weeks:r.weeks,dayCount:r.allDay}},api:{coord:function(n,i){return t.dataToPoint(n,i)}}}}function yMe(t,e,r,n){return t&&(t.legacy||t.legacy!==!1&&!r&&!n&&e!=="tspan"&&(e==="text"||Nt(t,"text")))}function wMe(t,e,r){var n=t,i,a,o;if(e==="text")o=n;else{o={},Nt(n,"text")&&(o.text=n.text),Nt(n,"rich")&&(o.rich=n.rich),Nt(n,"textFill")&&(o.fill=n.textFill),Nt(n,"textStroke")&&(o.stroke=n.textStroke),Nt(n,"fontFamily")&&(o.fontFamily=n.fontFamily),Nt(n,"fontSize")&&(o.fontSize=n.fontSize),Nt(n,"fontStyle")&&(o.fontStyle=n.fontStyle),Nt(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=Nt(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),Nt(n,"textPosition")&&(i.position=n.textPosition),Nt(n,"textOffset")&&(i.offset=n.textOffset),Nt(n,"textRotation")&&(i.rotation=n.textRotation),Nt(n,"textDistance")&&(i.distance=n.textDistance)}return Bye(o,t),te(o.rich,function(l){Bye(l,l)}),{textConfig:i,textContent:a}}function Bye(t,e){e&&(e.font=e.textFont||e.font,Nt(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),Nt(e,"textAlign")&&(t.align=e.textAlign),Nt(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),Nt(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),Nt(e,"textWidth")&&(t.width=e.textWidth),Nt(e,"textHeight")&&(t.height=e.textHeight),Nt(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),Nt(e,"textPadding")&&(t.padding=e.textPadding),Nt(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),Nt(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),Nt(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),Nt(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),Nt(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),Nt(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),Nt(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function Fye(t,e,r){var n=t;n.textPosition=n.textPosition||r.position||"inside",r.offset!=null&&(n.textOffset=r.offset),r.rotation!=null&&(n.textRotation=r.rotation),r.distance!=null&&(n.textDistance=r.distance);var i=n.textPosition.indexOf("inside")>=0,a=t.fill||"#000";jye(n,e);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||"#fff",!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=t.fill||r.outsideFill||"#000"),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=e.text,n.rich=e.rich,te(e.rich,function(s){jye(s,s)}),n}function jye(t,e){e&&(Nt(e,"fill")&&(t.textFill=e.fill),Nt(e,"stroke")&&(t.textStroke=e.fill),Nt(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),Nt(e,"font")&&(t.font=e.font),Nt(e,"fontStyle")&&(t.fontStyle=e.fontStyle),Nt(e,"fontWeight")&&(t.fontWeight=e.fontWeight),Nt(e,"fontSize")&&(t.fontSize=e.fontSize),Nt(e,"fontFamily")&&(t.fontFamily=e.fontFamily),Nt(e,"align")&&(t.textAlign=e.align),Nt(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),Nt(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),Nt(e,"width")&&(t.textWidth=e.width),Nt(e,"height")&&(t.textHeight=e.height),Nt(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),Nt(e,"padding")&&(t.textPadding=e.padding),Nt(e,"borderColor")&&(t.textBorderColor=e.borderColor),Nt(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),Nt(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),Nt(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),Nt(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),Nt(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),Nt(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),Nt(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),Nt(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),Nt(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),Nt(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var ycr={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]};function rG(t,e,r){var n=t[r],i=ycr[r];n&&(e[i[0]]=n[0],e[i[1]]=n[1])}function gw(t,e,r){t[r]!=null&&(e[r]=t[r])}function Uye(t,e,r){r&&(t[e]=r[e])}function zye(t,e,r,n,i){var a=r[t];if(a){var o=e[t],s,l=a.enterFrom;if(i&&l){!s&&(s=n[t]={});for(var c=Gn(l),u=0;u=0){!s&&(s=n[t]={});for(var p=Gn(o),u=0;u=0){var h=t.getAnimationStyleProps(),p=h?h.style:null;if(p){!o&&(o=n.style={});for(var g=Gn(r),c=0;c=0?e.getStore().get(F,E):void 0}var B=e.get(N.name,E),j=N&&N.ordinalMeta;return j?j.categories[B]:B}function A(T,E){E==null&&(E=c);var N=e.getItemVisual(E,"style"),F=N&&N.fill,B=N&&N.opacity,j=m(E,Jm).getItemStyle();F!=null&&(j.fill=F),B!=null&&(j.opacity=B);var k={inheritColor:En(F)?F:"#000"},$=b(E,Jm),H=Ja($,null,k,!1,!0);H.text=$.getShallow("show")?Cn(t.getFormattedLabel(E,Jm),K5(e,E)):null;var Y=vO($,k,!1);return D(T,j),j=Fye(j,H,Y),T&&I(j,T),j.legacy=!0,j}function S(T,E){E==null&&(E=c);var N=m(E,Bg).getItemStyle(),F=b(E,Bg),B=Ja(F,null,null,!0,!0);B.text=F.getShallow("show")?Ng(t.getFormattedLabel(E,Bg),t.getFormattedLabel(E,Jm),K5(e,E)):null;var j=vO(F,null,!0);return D(T,N),N=Fye(N,B,j),T&&I(N,T),N.legacy=!0,N}function I(T,E){for(var N in E)Nt(E,N)&&(T[N]=E[N])}function D(T,E){T&&(T.textFill&&(E.textFill=T.textFill),T.textPosition&&(E.textPosition=T.textPosition))}function L(T,E){if(E==null&&(E=c),Nt($ye,T)){var N=e.getItemVisual(E,"style");return N?N[$ye[T]]:null}if(Nt(scr,T))return e.getItemVisual(E,T)}function O(T){if(a.type==="cartesian2d"){var E=a.getBaseAxis();return otr(tr({axis:E},T))}}function P(){return r.getCurrentSeriesIndices()}function x(T){return E7e(T,r)}}function Ncr(t){var e={};return te(t.dimensions,function(r){var n=t.getDimensionInfo(r);if(!n.isExtraCoord){var i=n.coordDim,a=e[i]=e[i]||[];a[n.coordDimIndex]=t.getDimensionIndex(r)}}),e}function aG(t,e,r,n,i,a,o){if(!n){a.remove(e);return}var s=Cne(t,e,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Ri(s,n.focus,n.blurScope),s}function Cne(t,e,r,n,i,a,o){var s=-1,l=e;e&&xMe(e,n,i)&&(s=en(a.childrenRef(),e),e=null);var c=!e,u=e;u?u.clearStates():(u=_ne(n),l&&Acr(l,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),sf.normal.cfg=sf.normal.conOpt=sf.emphasis.cfg=sf.emphasis.conOpt=sf.blur.cfg=sf.blur.conOpt=sf.select.cfg=sf.select.conOpt=null,sf.isLegacy=!1,Lcr(u,r,n,i,c,sf),Ocr(u,r,n,i,c),Sne(t,u,r,n,sf,i,c,!1);for(var f=0;f=0?a.replaceAt(u,s):a.add(u),u}function xMe(t,e,r){var n=ch(t),i=e.type,a=e.shape,o=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&jcr(a)&&_Me(a)!==n.customPathData||i==="image"&&Nt(o,"image")&&o.image!==n.customImagePath}function Ocr(t,e,r,n,i){var a=r.clipPath;if(a===!1)t&&t.getClipPath()&&t.removeClipPath();else if(a){var o=t.getClipPath();o&&xMe(o,a,n)&&(o=null),o||(o=_ne(a),t.setClipPath(o)),Sne(null,o,e,a,null,n,i,!1)}}function Lcr(t,e,r,n,i,a){if(!t.isGroup){Gye(r,null,a),Gye(r,Bg,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,c=a.select.conOpt;if(o!=null||s!=null||c!=null||l!=null){var u=t.getTextContent();if(o===!1)u&&t.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},u?u.clearStates():(u=_ne(o),t.setTextContent(u)),Sne(null,u,e,o,null,n,i,!0);for(var f=o&&o.style,d=0;d=u;f--)Tne(e.childAt(f),i,e)}}function Bcr(t){new pv(t.oldChildren,t.newChildren,Wye,Wye,t).add(qye).update(qye).remove(Fcr).execute()}function Wye(t,e){var r=t&&t.name;return r??Scr+e}function qye(t,e){var r=this.context,n=t!=null?r.newChildren[t]:null,i=e!=null?r.oldChildren[e]:null;Cne(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function Fcr(t){var e=this.context,r=e.oldChildren[t];Tne(r,e.seriesModel,e.group)}function Tne(t,e,r){if(t){var n=ch(t).leaveToProps;n?Mn(t,n,e,{cb:function(){r.remove(t)}}):r.remove(t)}}function _Me(t){return t&&(t.pathData||t.d)}function jcr(t){return t&&(Nt(t,"pathData")||Nt(t,"d"))}function Ucr(t){t.registerChartView(Tcr),t.registerSeriesModel(lcr)}var Lw=qn(),Yye=ur,oG=Mt,Ene=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var c={};this.makeElOption(c,a,e,r,n);var u=c.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var f=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new fr,this.createPointerEl(s,c,e,r),this.createLabelEl(s,c,e,r),n.getZr().add(s);else{var d=Er(Kye,r,f);this.updatePointerEl(s,c,d),this.updateLabelEl(s,c,d,r)}Qye(s,r,!0),this._renderHandle(a)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),i=e.axis,a=i.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=Xre(e).seriesDataCount,c=i.getExtent();return Math.abs(c[0]-c[1])/l>s}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,i,a){},t.prototype.createPointerEl=function(e,r,n,i){var a=r.pointer;if(a){var o=Lw(e).pointerEl=new h9[a.type](Yye(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=Lw(e).labelEl=new Bn(Yye(r.label));e.add(a),Zye(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=Lw(e).pointerEl;i&&r.pointer&&(i.setStyle(r.pointer.style),n(i,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,i){var a=Lw(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),Zye(a,i))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=d9(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(c){fv(c.event)},onmousedown:oG(this._onHandleDragMove,this,0,0),drift:oG(this._onHandleDragMove,this),ondragend:oG(this._onHandleDragEnd,this)}),n.add(i)),Qye(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");lt(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,g9(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Kye(this._axisPointerModel,!r&&this._moveAnimation,this._handle,sG(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(sG(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(sG(i)),Lw(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,i=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),i&&r.remove(i),this._group=null,this._handle=null,this._payloadInfo=null)},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t}();function Kye(t,e,r,n){SMe(Lw(r).lastProp,n)||(Lw(r).lastProp=n,e?Mn(r,n,t):(r.stopAnimation(),r.attr(n)))}function SMe(t,e){if(dr(t)&&dr(e)){var r=!0;return te(e,function(n,i){r=r&&SMe(t[i],n)}),!!r}else return t===e}function Zye(t,e){t[e.get(["label","show"])?"show":"hide"]()}function sG(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function Qye(t,e,r){var n=e.get("z"),i=e.get("zlevel");t&&t.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=r)})}function Ine(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function CMe(t,e,r,n,i){var a=r.get("value"),o=AMe(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=XS(s.get("padding")||0),c=s.getFont(),u=a9(o,c),f=i.position,d=u.width+l[1]+l[3],h=u.height+l[0]+l[2],p=i.align;p==="right"&&(f[0]-=d),p==="center"&&(f[0]-=d/2);var g=i.verticalAlign;g==="bottom"&&(f[1]-=h),g==="middle"&&(f[1]-=h/2),zcr(f,d,h,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:f[0],y:f[1],style:Ja(s,{text:o,font:c,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function zcr(t,e,r,n){var i=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,i)-e,t[1]=Math.min(t[1]+r,a)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function AMe(t,e,r,n,i){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:i.precision}),o=i.formatter;if(o){var s={value:Gre(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};te(n,function(l){var c=r.getSeriesByIndex(l.seriesIndex),u=l.dataIndexInside,f=c&&c.getDataParams(u);f&&s.seriesData.push(f)}),En(o)?a=o.replace("{value}",a):si(o)&&(a=o(s))}return a}function kne(t,e,r){var n=Xf();return px(n,n,r.rotation),d0(n,n,r.position),lh([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function TMe(t,e,r,n,i,a){var o=zl.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),CMe(e,n,i,a,{position:kne(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function Pne(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function EMe(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function Xye(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var Hcr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,c=a.get("type"),u=Jye(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(c&&c!=="none"){var d=Ine(a),h=Vcr[c](s,f,u);h.style=d,r.graphicKey=h.type,r.pointer=h}var p=PZ(l.model,i);TMe(n,r,p,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=PZ(n.axis.grid.model,n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=kne(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),c=Jye(s,o).getOtherAxis(o).getGlobalExtent(),u=o.dim==="x"?0:1,f=[r.x,r.y];f[u]+=n[u],f[u]=Math.min(l[1],f[u]),f[u]=Math.max(l[0],f[u]);var d=(c[1]+c[0])/2,h=[d,d];h[u]=f[u];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:h,tooltipOption:p[u]}},e}(Ene);function Jye(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var Vcr={line:function(t,e,r){var n=Pne([e,r[0]],[e,r[1]],ewe(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r){var n=Math.max(1,t.getBandWidth()),i=r[1]-r[0];return{type:"Rect",shape:EMe([e-n/2,r[0]],[n,i],ewe(t))}}};function ewe(t){return t.dim==="x"?0:1}var Gcr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(fn),Ig=qn(),Wcr=te;function IMe(t,e,r){if(!Ar.node){var n=e.getZr();Ig(n).records||(Ig(n).records={}),qcr(n,e);var i=Ig(n).records[t]||(Ig(n).records[t]={});i.handler=r}}function qcr(t,e){if(Ig(t).initialized)return;Ig(t).initialized=!0,r("click",Er(twe,"click")),r("mousemove",Er(twe,"mousemove")),r("globalout",Kcr);function r(n,i){t.on(n,function(a){var o=Zcr(e);Wcr(Ig(t).records,function(s){s&&i(s,a,o.dispatchAction)}),Ycr(o.pendings,e)})}}function Ycr(t,e){var r=t.showTip.length,n=t.hideTip.length,i;r?i=t.showTip[r-1]:n&&(i=t.hideTip[n-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function Kcr(t,e,r){t.handler("leave",null,r)}function twe(t,e,r,n){e.handler(t,r,n)}function Zcr(t){var e={showTip:[],hideTip:[]},r=function(n){var i=e[n.type];i?i.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function KZ(t,e){if(!Ar.node){var r=e.getZr(),n=(Ig(r).records||{})[t];n&&(Ig(r).records[t]=null)}}var Qcr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=n.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";IMe("axisPointer",i,function(s,l,c){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&c({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){KZ("axisPointer",n)},e.prototype.dispose=function(r,n){KZ("axisPointer",n)},e.type="axisPointer",e}(ca);function kMe(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=S2(a,t);if(o==null||o<0||lt(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c),f=u.dim,d=c.dim,h=f==="x"||f==="radius"?1:0,p=a.mapDimension(d),g=[];g[h]=a.get(p,o),g[1-h]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(g)||[]}else r=l.dataToPoint(a.getValues(ft(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:s}}var rwe=qn();function Xcr(t,e,r){var n=t.currTrigger,i=[t.x,t.y],a=t,o=t.dispatchAction||Mt(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){xM(i)&&(i=kMe({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=xM(i),c=a.axesInfo,u=s.axesInfo,f=n==="leave"||xM(i),d={},h={},p={list:[],map:{}},g={showPointer:Er(eur,h),showTooltip:Er(tur,p)};te(s.coordSysMap,function(y,m){var b=l||y.containPoint(i);te(s.coordSysAxesInfo[m],function(w,C){var A=w.axis,S=aur(c,w);if(!f&&b&&(!c||S)){var I=S&&S.value;I==null&&!l&&(I=A.pointToData(i)),I!=null&&nwe(w,I,g,!1,d)}})});var v={};return te(u,function(y,m){var b=y.linkGroup;b&&!h[m]&&te(b.axesInfo,function(w,C){var A=h[C];if(w!==y&&A){var S=A.value;b.mapper&&(S=y.axis.scale.parse(b.mapper(S,iwe(w),iwe(y)))),v[y.key]=S}})}),te(v,function(y,m){nwe(u[m],y,g,!0,d)}),rur(h,u,d),nur(p,i,t,o),iur(u,o,r),d}}function nwe(t,e,r,n,i){var a=t.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=Jcr(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&st(i,s[0]),!n&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function Jcr(t,e){var r=e.axis,n=r.dim,i=t,a=[],o=Number.MAX_VALUE,s=-1;return te(e.seriesModels,function(l,c){var u=l.getData().mapDimensionsAll(n),f,d;if(l.getAxisTooltipData){var h=l.getAxisTooltipData(u,t,r);d=h.dataIndices,f=h.nestestValue}else{if(d=l.getData().indicesOfNearest(u[0],t,r.type==="category"?.5:null),!d.length)return;f=l.getData().get(u[0],d[0])}if(!(f==null||!isFinite(f))){var p=t-f,g=Math.abs(p);g<=o&&((g=0&&s<0)&&(o=g,s=p,i=f,a.length=0),te(d,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function eur(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function tur(t,e,r,n){var i=r.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,c=NE(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function rur(t,e,r){var n=r.axesInfo=[];te(e,function(i,a){var o=i.axisPointerModel.option,s=t[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function nur(t,e,r,n){if(xM(e)||!t.list.length){n({type:"hideTip"});return}var i=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:t.list})}function iur(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=rwe(n)[i]||{},o=rwe(n)[i]={};te(t,function(c,u){var f=c.axisPointerModel.option;f.status==="show"&&te(f.seriesDataIndices,function(d){var h=d.seriesIndex+" | "+d.dataIndex;o[h]=d})});var s=[],l=[];te(a,function(c,u){!o[u]&&l.push(c)}),te(o,function(c,u){!a[u]&&s.push(c)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function aur(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function iwe(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function xM(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function E9(t){mx.registerAxisPointerClass("CartesianAxisPointer",Hcr),t.registerComponentModel(Gcr),t.registerComponentView(Qcr),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!lt(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=Lnr(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Xcr)}function our(t){Xr(cRe),Xr(E9)}var sur=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,c=l.getOtherAxis(s),u=c.getExtent(),f=s.dataToCoord(n),d=a.get("type");if(d&&d!=="none"){var h=Ine(a),p=cur[d](s,l,f,u);p.style=h,r.graphicKey=p.type,r.pointer=p}var g=a.get(["label","margin"]),v=lur(n,i,a,l,g);CMe(r,i,a,o,v)},e}(Ene);function lur(t,e,r,n,i){var a=e.axis,o=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),c,u,f;if(a.dim==="radius"){var d=Xf();px(d,d,s),d0(d,d,[n.cx,n.cy]),c=lh([o,-i],d);var h=e.getModel("axisLabel").get("rotate")||0,p=zl.innerTextLayout(s,h*Math.PI/180,-1);u=p.textAlign,f=p.textVerticalAlign}else{var g=l[1];c=n.coordToPoint([g+i,o]);var v=n.cx,y=n.cy;u=Math.abs(c[0]-v)/g<.3?"center":c[0]>v?"left":"right",f=Math.abs(c[1]-y)/g<.3?"middle":c[1]>y?"top":"bottom"}return{position:c,align:u,verticalAlign:f}}var cur={line:function(t,e,r,n){return t.dim==="angle"?{type:"Line",shape:Pne(e.coordToPoint([n[0],r]),e.coordToPoint([n[1],r]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r}}},shadow:function(t,e,r,n){var i=Math.max(1,t.getBandWidth()),a=Math.PI/180;return t.dim==="angle"?{type:"Sector",shape:Xye(e.cx,e.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:Xye(e.cx,e.cy,r-i/2,r+i/2,0,Math.PI*2)}}},uur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.findAxisModel=function(r){var n,i=this.ecModel;return i.eachComponent(r,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"80%"},e}(fn),Rne=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",yo).models[0]},e.type="polarAxis",e}(fn);xo(Rne,b9);var fur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="angleAxis",e}(Rne),dur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="radiusAxis",e}(Rne),Mne=function(t){Ge(e,t);function e(r,n){return t.call(this,"radius",r,n)||this}return e.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},e}(Lh);Mne.prototype.dataToRadius=Lh.prototype.dataToCoord;Mne.prototype.radiusToData=Lh.prototype.coordToData;var hur=qn(),Dne=function(t){Ge(e,t);function e(r,n){return t.call(this,"angle",r,n||[0,360])||this}return e.prototype.pointToData=function(r,n){return this.polar.pointToData(r,n)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var r=this,n=r.getLabelModel(),i=r.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),c=Math.abs(l),u=a9(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(u.height,7),d=f/c;isNaN(d)&&(d=1/0);var h=Math.max(0,Math.floor(d)),p=hur(r.model),g=p.lastAutoInterval,v=p.lastTickCount;return g!=null&&v!=null&&Math.abs(g-h)<=1&&Math.abs(v-o)<=1&&g>h?h=g:(p.lastTickCount=o,p.lastAutoInterval=h),h},e}(Lh);Dne.prototype.dataToAngle=Lh.prototype.dataToCoord;Dne.prototype.angleToData=Lh.prototype.coordToData;var PMe=["radius","angle"],pur=function(){function t(e){this.dimensions=PMe,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new Mne,this._angleAxis=new Dne,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(e){var r=this.pointToCoord(e);return this._radiusAxis.contain(r[0])&&this._angleAxis.contain(r[1])},t.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},t.prototype.getAxis=function(e){var r="_"+e+"Axis";return this[r]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(e){var r=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&r.push(n),i.scale.type===e&&r.push(i),r},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(e){var r=this._angleAxis;return e===r?this._radiusAxis:r},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(e){var r=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[r],otherAxes:[this.getOtherAxis(r)]}},t.prototype.dataToPoint=function(e,r){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],r),this._angleAxis.dataToAngle(e[1],r)])},t.prototype.pointToData=function(e,r){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],r),this._angleAxis.angleToData(n[1],r)]},t.prototype.pointToCoord=function(e){var r=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var c=Math.atan2(-n,r)/Math.PI*180,u=cs;)c+=u*360;return[l,c]},t.prototype.coordToPoint=function(e){var r=e[0],n=e[1]/180*Math.PI,i=Math.cos(n)*r+this.cx,a=-Math.sin(n)*r+this.cy;return[i,a]},t.prototype.getArea=function(){var e=this.getAngleAxis(),r=this.getRadiusAxis(),n=r.getExtent().slice();n[0]>n[1]&&n.reverse();var i=e.getExtent(),a=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(o,s){var l=o-this.cx,c=s-this.cy,u=l*l+c*c,f=this.r,d=this.r0;return u<=f*f&&u>=d*d}}},t.prototype.convertToPixel=function(e,r,n){var i=awe(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=awe(r);return i===this?this.pointToData(n):null},t}();function awe(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function gur(t,e,r){var n=e.get("center"),i=r.getWidth(),a=r.getHeight();t.cx=xt(n[0],i),t.cy=xt(n[1],a);var o=t.getRadiusAxis(),s=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:lt(l)||(l=[0,l]);var c=[xt(l[0],s),xt(l[1],s)];o.inverse?o.setExtent(c[1],c[0]):o.setExtent(c[0],c[1])}function vur(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),t.eachSeries(function(s){if(s.coordinateSystem===r){var l=s.getData();te(kO(l,"radius"),function(c){i.scale.unionExtentFromData(l,c)}),te(kO(l,"angle"),function(c){n.scale.unionExtentFromData(l,c)})}}),I2(n.scale,n.model),I2(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function mur(t){return t.mainType==="angleAxis"}function owe(t,e){if(t.type=e.get("type"),t.scale=YB(e),t.onBand=e.get("boundaryGap")&&t.type==="category",t.inverse=e.get("inverse"),mur(e)){t.inverse=t.inverse!==e.get("clockwise");var r=e.get("startAngle");t.setExtent(r,r+(t.inverse?-360:360))}e.axis=t,t.model=e}var yur={dimensions:PMe,create:function(t,e){var r=[];return t.eachComponent("polar",function(n,i){var a=new pur(i+"");a.update=vur;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),c=n.findAxisModel("angleAxis");owe(o,l),owe(s,c),gur(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",yo).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},wur=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Ok(t,e,r){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],r]),i=t.coordToPoint([e[1],r]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function Lk(t){var e=t.getRadiusAxis();return e.inverse?0:1}function swe(t){var e=t[0],r=t[t.length-1];e&&r&&Math.abs(Math.abs(e.coord-r.coord)-360)<1e-4&&t.pop()}var bur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="PolarAxisPointer",r}return e.prototype.render=function(r,n){if(this.group.removeAll(),!!r.get("show")){var i=r.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),c=ft(i.getViewLabels(),function(u){u=ur(u);var f=i.scale,d=f.type==="ordinal"?f.getRawOrdinalNumber(u.tickValue):u.tickValue;return u.coord=i.dataToCoord(d),u});swe(c),swe(s),te(wur,function(u){r.get([u,"show"])&&(!i.scale.isBlank()||u==="axisLine")&&xur[u](this.group,r,a,s,l,o,c)},this)}},e.type="angleAxis",e}(mx),xur={axisLine:function(t,e,r,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=Lk(r),l=s?0:1,c;a[l]===0?c=new _h({shape:{cx:r.cx,cy:r.cy,r:a[s]},style:o.getLineStyle(),z2:1,silent:!0}):c=new c9({shape:{cx:r.cx,cy:r.cy,r:a[s],r0:a[l]},style:o.getLineStyle(),z2:1,silent:!0}),c.style.fill=null,t.add(c)},axisTick:function(t,e,r,n,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Lk(r)],c=ft(n,function(u){return new Fo({shape:Ok(r,[l,l+s],u.coord)})});t.add(Mf(c,{style:tr(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,r,n,i,a){if(i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),c=a[Lk(r)],u=[],f=0;fy?"left":"right",w=Math.abs(v[1]-m)/g<.3?"middle":v[1]>m?"top":"bottom";if(s&&s[p]){var C=s[p];dr(C)&&C.textStyle&&(h=new ai(C.textStyle,l,l.ecModel))}var A=new Bn({silent:zl.isLabelSilent(e),style:Ja(h,{x:v[0],y:v[1],fill:h.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:b,verticalAlign:w})});if(t.add(A),u){var S=zl.makeAxisEventDataBase(e);S.targetType="axisLabel",S.value=f.rawLabel,br(A).eventData=S}},this)},splitLine:function(t,e,r,n,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),c=0;l=l instanceof Array?l:[l];for(var u=[],f=0;f=0?"p":"n",x=S;C&&(n[u][O]||(n[u][O]={p:S,n:S}),x=n[u][O][P]);var T=void 0,E=void 0,N=void 0,F=void 0;if(p.dim==="radius"){var B=p.dataToCoord(L)-S,j=l.dataToCoord(O);Math.abs(B)=F})}}})}function Iur(t){var e={};te(t,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=MMe(o,s),c=s.getExtent(),u=s.type==="category"?s.getBandWidth():Math.abs(c[1]-c[0])/a.count(),f=e[l]||{bandWidth:u,remainedWidth:u,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},d=f.stacks;e[l]=f;var h=RMe(n);d[h]||f.autoWidthCount++,d[h]=d[h]||{width:0,maxWidth:0};var p=xt(n.get("barWidth"),u),g=xt(n.get("barMaxWidth"),u),v=n.get("barGap"),y=n.get("barCategoryGap");p&&!d[h].width&&(p=Math.min(f.remainedWidth,p),d[h].width=p,f.remainedWidth-=p),g&&(d[h].maxWidth=g),v!=null&&(f.gap=v),y!=null&&(f.categoryGap=y)});var r={};return te(e,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=xt(n.categoryGap,o),l=xt(n.gap,1),c=n.remainedWidth,u=n.autoWidthCount,f=(c-s)/(u+(u-1)*l);f=Math.max(f,0),te(a,function(g,v){var y=g.maxWidth;y&&y=r.y&&e[1]<=r.y+r.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=r.y&&e[0]<=r.y+r.height},t.prototype.pointToData=function(e){var r=this.getAxis();return[r.coordToData(r.toLocalCoord(e[r.orient==="horizontal"?0:1]))]},t.prototype.dataToPoint=function(e){var r=this.getAxis(),n=this.getRect(),i=[],a=r.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),i[a]=r.toGlobalCoord(r.dataToCoord(+e)),i[1-a]=a===0?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(e,r,n){var i=lwe(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=lwe(r);return i===this?this.pointToData(n):null},t}();function lwe(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function Fur(t,e){var r=[];return t.eachComponent("singleAxis",function(n,i){var a=new Bur(n,t,e);a.name="single_"+i,a.resize(n,e),n.coordinateSystem=a,r.push(a)}),t.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",yo).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var jur={create:Fur,dimensions:DMe},cwe=["x","y"],Uur=["width","height"],zur=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,c=lG(l,1-UO(s)),u=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var d=Ine(a),h=Hur[f](s,u,c);h.style=d,r.graphicKey=h.type,r.pointer=h}var p=ZZ(i);TMe(n,r,p,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=ZZ(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=kne(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=UO(o),c=lG(s,l),u=[r.x,r.y];u[l]+=n[l],u[l]=Math.min(c[1],u[l]),u[l]=Math.max(c[0],u[l]);var f=lG(s,1-l),d=(f[1]+f[0])/2,h=[d,d];return h[l]=u[l],{x:u[0],y:u[1],rotation:r.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},e}(Ene),Hur={line:function(t,e,r){var n=Pne([e,r[0]],[e,r[1]],UO(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r){var n=t.getBandWidth(),i=r[1]-r[0];return{type:"Rect",shape:EMe([e-n/2,r[0]],[n,i],UO(t))}}};function UO(t){return t.isHorizontal()?0:1}function lG(t,e){var r=t.getRect();return[r[cwe[e]],r[cwe[e]]+r[Uur[e]]]}var Vur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="single",e}(ca);function Gur(t){Xr(E9),mx.registerAxisPointerClass("SingleAxisPointer",zur),t.registerComponentView(Vur),t.registerComponentView(Our),t.registerComponentModel(_M),Z5(t,"single",_M,_M.defaultOption),t.registerCoordinateSystem("single",jur)}var Wur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n,i){var a=JS(r);t.prototype.init.apply(this,arguments),uwe(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),uwe(this.option,r)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(fn);function uwe(t,e){var r=t.cellSize,n;lt(r)?n=r:n=t.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=ft([0,1],function(a){return PQt(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});K1(t,e,{type:"box",ignoreSize:i})}var qur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){var a=this.group;a.removeAll();var o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),c=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,c,l,a),this._renderWeekText(r,c,s,l,a)},e.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),c=n.start.time;c<=n.end.time;c=a.getNextNDay(c,1).time){var u=a.dataToRect([c],!1).tl,f=new In({shape:{x:u[0],y:u[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},e.prototype._renderLines=function(r,n,i,a){var o=this,s=r.coordinateSystem,l=r.getModel(["splitLine","lineStyle"]).getLineStyle(),c=r.get(["splitLine","show"]),u=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=n.start,d=0;f.time<=n.end.time;d++){p(f.formatedDate),d===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var h=f.date;h.setMonth(h.getMonth()+1),f=s.getDateInfo(h)}p(s.getNextNDay(n.end.time,1).formatedDate);function p(g){o._firstDayOfMonth.push(s.getDateInfo(g)),o._firstDayPoints.push(s.dataToRect([g],!1).tl);var v=o._getLinePointsOfOneWeek(r,g,i);o._tlpoints.push(v[0]),o._blpoints.push(v[v.length-1]),c&&o._drawSplitline(v,l,a)}c&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,u,i),l,a),c&&this._drawSplitline(o._getEdgesPoints(o._blpoints,u,i),l,a)},e.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},e.prototype._drawSplitline=function(r,n,i){var a=new Gc({z2:20,shape:{points:r},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var c=a.getNextNDay(o.time,l),u=a.dataToRect([c.time],!1);s[2*c.day]=u.tl,s[2*c.day+1]=u[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(r,n){return typeof r=="string"&&r?EQt(r,n):typeof r=="function"?r(n):n.nameMap},e.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],c=["center","bottom"];a==="bottom"?(l+=o,c=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,c=["center","top"]):l-=o;var u=0;return(a==="left"||a==="right")&&(u=Math.PI/2),{rotation:u,x:s,y:l,style:{align:c[0],verticalAlign:c[1]}}},e.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var c=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],u=(c[0][0]+c[1][0])/2,f=(c[0][1]+c[1][1])/2,d=i==="horizontal"?0:1,h={top:[u,c[d][1]],bottom:[u,c[1-d][1]],left:[c[1-d][0],f],right:[c[d][0],f]},p=n.start.y;+n.end.y>+n.start.y&&(p=p+"-"+n.end.y);var g=o.get("formatter"),v={start:n.start.y,end:n.end.y,nameMap:p},y=this._formatterLabel(g,v),m=new Bn({z2:30,style:Ja(o,{text:y})});m.attr(this._yearTextPositionControl(m,h[l],i,l,s)),a.add(m)}},e.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",c=r[0],u=r[1];return i==="horizontal"?(u=u+o,n&&(s="center"),a==="start"&&(l="bottom")):(c=c+o,n&&(l="middle"),a==="start"&&(s="right")),{x:c,y:u,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),c=o.get("position"),u=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||En(s))&&(s&&(n=dZ(s)||n),s=n.get(["time","monthAbbr"])||[]);var d=c==="start"?0:1,h=i==="horizontal"?0:1;l=c==="start"?-l:l;for(var p=u==="center",g=0;g=i.start.time&&n.times.end.time&&r.reverse(),r},t.prototype._getRangeInfo=function(e){var r=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;r[0].time>r[1].time&&(n=!0,r.reverse());var i=Math.floor(r[1].time/cG)-Math.floor(r[0].time/cG)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var c=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-r[1].time)*c>0;)i-=c,a.setDate(l-c);var u=Math.floor((i+r[0].day+6)/7),f=n?-u+1:u-1;return n&&r.reverse(),{range:[r[0].formatedDate,r[1].formatedDate],start:r[0],end:r[1],allDay:i,weeks:u,nthWeek:f,fweek:r[0].day,lweek:r[1].day}},t.prototype._getDateByWeeksAndDay=function(e,r,n){var i=this._getRangeInfo(n);if(e>i.weeks||e===0&&ri.lweek)return null;var a=(e-1)*7-i.fweek+r,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},t.create=function(e,r){var n=[];return e.eachComponent("calendar",function(i){var a=new t(i);n.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=n[i.get("calendarIndex")||0])}),n},t.dimensions=["time","value"],t}();function fwe(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function Kur(t){t.registerComponentModel(Wur),t.registerComponentView(qur),t.registerCoordinateSystem("calendar",Yur)}var r3=qn(),dwe={path:null,compoundPath:null,group:fr,image:Io,text:Bn},Zur=function(t){var e=t.graphic;lt(e)?!e[0]||!e[0].elements?t.graphic=[{elements:e}]:t.graphic=[t.graphic[0]]:e&&!e.elements&&(t.graphic=[{elements:[e]}])},Qur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventAutoZ=!0,r}return e.prototype.mergeOption=function(r,n){var i=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,r,n),this.option.elements=i},e.prototype.optionUpdated=function(r,n){var i=this.option,a=(n?i:r).elements,o=i.elements=n?[]:i.elements,s=[];this._flatten(a,s,null);var l=DIe(o,s,"normalMerge"),c=this._elOptionsToUpdate=[];te(l,function(f,d){var h=f.newOption;h&&(c.push(h),efr(f,h),tfr(o,d,h),rfr(o[d],h))},this);for(var u=o.length-1;u>=0;u--)o[u]==null?o.splice(u,1):delete o[u].$action},e.prototype._flatten=function(r,n,i){te(r,function(a){if(a){i&&(a.parentOption=i),n.push(a);var o=a.children;a.type==="group"&&o&&this._flatten(o,n,a),delete a.children}},this)},e.prototype.useElOptionsToUpdate=function(){var r=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,r},e.type="graphic",e.defaultOption={elements:[]},e}(fn),Xur=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){this._elMap=Gt()},e.prototype.render=function(r,n,i){r!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=r,this._updateElements(r),this._relocate(r,i)},e.prototype._updateElements=function(r){var n=r.useElOptionsToUpdate();if(n){var i=this._elMap,a=this.group;te(n,function(o){var s=To(o.id,null),l=s!=null?i.get(s):null,c=To(o.parentId,null),u=c!=null?i.get(c):a,f=o.type,d=o.style;f==="text"&&d&&o.hv&&o.hv[1]&&(d.textVerticalAlign=d.textBaseline=d.verticalAlign=d.align=null);var h=o.textContent,p=o.textConfig;if(d&&yMe(d,f,!!p,!!h)){var g=wMe(d,f,!0);!p&&g.textConfig&&(p=o.textConfig=g.textConfig),!h&&g.textContent&&(h=g.textContent)}var v=Jur(o),y=o.$action||"merge";y==="merge"?l?l.attr(v):hwe(s,u,v,i):y==="replace"?(SM(l,i),hwe(s,u,v,i)):y==="remove"&&SM(l,i);var m=i.get(s);if(m&&h)if(y==="merge"){var b=m.getTextContent();b?b.attr(h):m.setTextContent(new Bn(h))}else y==="replace"&&m.setTextContent(new Bn(h));if(m){var w=r3(m);w.__ecGraphicWidthOption=o.width,w.__ecGraphicHeightOption=o.height,nfr(m,r,o),KS({el:m,componentModel:r,itemName:m.name,itemTooltipOption:o.tooltip})}})}},e.prototype._relocate=function(r,n){for(var i=r.option.elements,a=this.group,o=this._elMap,s=n.getWidth(),l=n.getHeight(),c=0;c=0;c--){var u=i[c],f=To(u.id,null),d=f!=null?o.get(f):null;if(d){var h=d.parent,v=r3(h),y=h===a?{width:s,height:l}:{width:v.__ecGraphicWidth,height:v.__ecGraphicHeight};BB(d,u,y,null,{hv:u.hv,boundingMode:u.bounding})}}},e.prototype._clear=function(){var r=this._elMap;r.each(function(n){SM(n,r)}),this._elMap=Gt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(ca);function hwe(t,e,r,n){var i=r.type,a=Nt(dwe,i)?dwe[i]:vre(i),o=new a(r);e.add(o),n.set(t,o),r3(o).__ecGraphicId=t}function SM(t,e){var r=t&&t.parent;r&&(t.type==="group"&&t.traverse(function(n){SM(n,e)}),e.removeKey(r3(t).__ecGraphicId),r.remove(t))}function Jur(t){return t=st({},t),te(["id","parentId","$action","hv","bounding","textContent"].concat(G7e),function(e){delete t[e]}),t}function pwe(t,e){var r;return te(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function efr(t,e){var r=t.existing;if(e.id=t.keyInfo.id,!e.type&&r&&(e.type=r.type),e.parentId==null){var n=e.parentOption;n?e.parentId=n.id:r&&(e.parentId=r.parentId)}e.parentOption=null}function tfr(t,e,r){var n=st({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?($r(i,n,!0),K1(i,n,{ignoreSize:!0}),W7e(r,i)):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}function rfr(t,e){if(t&&(t.hv=e.hv=[pwe(e,["left","right"]),pwe(e,["top","bottom"])],t.type==="group")){var r=t,n=e;r.width==null&&(r.width=n.width=0),r.height==null&&(r.height=n.height=0)}}function nfr(t,e,r){var n=br(t).eventData;!t.silent&&!t.ignore&&!n&&(n=br(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),n&&(n.info=r.info)}function ifr(t){t.registerComponentModel(Qur),t.registerComponentView(Xur),t.registerPreprocessor(Zur)}var gwe=["x","y","radius","angle","single"],afr=["cartesian2d","polar","singleAxis"];function ofr(t){var e=t.get("coordinateSystem");return en(afr,e)>=0}function e1(t){return t+"Axis"}function sfr(t,e){var r=Gt(),n=[],i=Gt();t.eachComponent({mainType:"dataZoom",query:e},function(u){i.get(u.uid)||s(u)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(u){!i.get(u.uid)&&l(u)&&(s(u),a=!0)}function s(u){i.set(u.uid,!0),n.push(u),c(u)}function l(u){var f=!1;return u.eachTargetAxis(function(d,h){var p=r.get(d);p&&p[h]&&(f=!0)}),f}function c(u){u.eachTargetAxis(function(f,d){(r.get(f)||r.set(f,[]))[d]=!0})}return n}function NMe(t){var e=t.ecModel,r={infoList:[],infoMap:Gt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(e1(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}var uG=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t}(),jE=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,i){var a=vwe(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=vwe(r);$r(this.option,r,!0),$r(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var i=this.settledOption;te([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=Gt(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return te(gwe,function(i){var a=this.getReferringComponents(e1(i),uKt);if(a.specified){n=!0;var o=new uG;te(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(u){return u.get("orient",!0)===n}});l(s,"single")}function l(c,u){var f=c[0];if(f){var d=new uG;if(d.add(f.componentIndex),r.set(u,d),a=!1,u==="x"||u==="y"){var h=f.getReferringComponents("grid",yo).models[0];h&&te(c,function(p){f.componentIndex!==p.componentIndex&&h===p.getReferringComponents("grid",yo).models[0]&&d.add(p.componentIndex)})}}}a&&te(gwe,function(c){if(a){var u=i.findComponents({mainType:e1(c),filter:function(d){return d.get("type",!0)==="category"}});if(u[0]){var f=new uG;f.add(u[0].componentIndex),r.set(c,f),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,i=this.get("rangeMode");te([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,i){r==null&&(r=this.ecModel.getComponent(e1(n),i))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){te(i.indexList,function(o){r.call(n,a,o)})})},e.prototype.getAxisProxy=function(r,n){var i=this.getAxisModel(r,n);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(r,n){var i=this._targetAxisInfoMap.get(r);if(i&&i.indexMap[n])return this.ecModel.getComponent(e1(r),n)},e.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;te([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(n[a[0]]=i[a[0]]=r[a[0]],n[a[1]]=i[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;te(["start","startValue","end","endValue"],function(i){n[i]=r[i]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(b&&!w&&!C)return!0;b&&(v=!0),w&&(p=!0),C&&(g=!0)}return v&&p&&g})}else k_(u,function(h){if(a==="empty")l.setData(c=c.map(h,function(g){return s(g)?g:NaN}));else{var p={};p[h]=o,c.selectRange(p)}});k_(u,function(h){c.setApproximateExtent(o,h)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;k_(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=oi(n[0]+o,n,[0,100],!0):a!=null&&(o=oi(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var i=CIe(n,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;r[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),r[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},t}();function ffr(t,e,r){var n=[1/0,-1/0];k_(r,function(o){Etr(n,o.getData(),e)});var i=t.getAxisModel(),a=xPe(i.axis.scale,i,n).calculate();return[a.min,a.max]}var dfr={getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(e1(o),s);i(o,s,l,a)})})}e(function(i,a,o,s){o.__dzAxisProxy=null});var r=[];e(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new ufr(i,a,s,t),r.push(o.__dzAxisProxy))});var n=Gt();return te(r,function(i){te(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).reset(r)}),r.eachTargetAxis(function(n,i){r.getAxisProxy(n,i).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();r.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};function hfr(t){t.registerAction("dataZoom",function(e,r){var n=sfr(r,e);te(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var ywe=!1;function One(t){ywe||(ywe=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,dfr),hfr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function pfr(t){t.registerComponentModel(lfr),t.registerComponentView(cfr),One(t)}var kf=function(){function t(){}return t}(),OMe={};function P_(t,e){OMe[t]=e}function LMe(t){return OMe[t]}var gfr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var r=this.ecModel;te(this.option.feature,function(n,i){var a=LMe(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),$r(n,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(fn);function vfr(t,e,r){var n=e.getBoxLayoutParams(),i=e.get("padding"),a={width:r.getWidth(),height:r.getHeight()},o=Eo(n,a,i);Cb(e.get("orient"),t,e.get("itemGap"),o.width,o.height),BB(t,n,a,i)}function $Me(t,e){var r=XS(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new In({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),t}var mfr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("feature")||{},c=this._features||(this._features={}),u=[];te(l,function(h,p){u.push(p)}),new pv(this._featureNames||[],u).add(f).update(f).remove(Er(f,null)).execute(),this._featureNames=u;function f(h,p){var g=u[h],v=u[p],y=l[g],m=new ai(y,r,r.ecModel),b;if(a&&a.newTitle!=null&&a.featureName===g&&(y.title=a.newTitle),g&&!v){if(yfr(g))b={onclick:m.option.onclick,featureName:g};else{var w=LMe(g);if(!w)return;b=new w}c[g]=b}else if(b=c[v],!b)return;b.uid=QS("toolbox-feature"),b.model=m,b.ecModel=n,b.api=i;var C=b instanceof kf;if(!g&&v){C&&b.dispose&&b.dispose(n,i);return}if(!m.get("show")||C&&b.unusable){C&&b.remove&&b.remove(n,i);return}d(m,b,g),m.setIconStatus=function(A,S){var I=this.option,D=this.iconPaths;I.iconStatus=I.iconStatus||{},I.iconStatus[A]=S,D[A]&&(S==="emphasis"?Vp:Gp)(D[A])},b instanceof kf&&b.render&&b.render(m,n,i,a)}function d(h,p,g){var v=h.getModel("iconStyle"),y=h.getModel(["emphasis","iconStyle"]),m=p instanceof kf&&p.getIcons?p.getIcons():h.get("icon"),b=h.get("title")||{},w,C;typeof m=="string"?(w={},w[g]=m):w=m,typeof b=="string"?(C={},C[g]=b):C=b;var A=h.iconPaths={};te(w,function(S,I){var D=d9(S,{},{x:-s/2,y:-s/2,width:s,height:s});D.setStyle(v.getItemStyle());var L=D.ensureState("emphasis");L.style=y.getItemStyle();var O=new Bn({style:{text:C[I],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null},ignore:!0});D.setTextContent(O),KS({el:D,componentModel:r,itemName:I,formatterParamsExtra:{title:C[I]}}),D.__title=C[I],D.on("mouseover",function(){var P=y.getItemStyle(),x=r.get("orient")==="vertical"?r.get("right")==null?"right":"left":r.get("bottom")==null?"bottom":"top";O.setStyle({fill:y.get("textFill")||P.fill||P.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),D.setTextConfig({position:y.get("textPosition")||x}),O.ignore=!r.get("showTitle"),Vp(this)}).on("mouseout",function(){h.get(["iconStatus",I])!=="emphasis"&&Gp(this),O.hide()}),(h.get(["iconStatus",I])==="emphasis"?Vp:Gp)(D),o.add(D),D.on("click",Mt(p.onclick,p,n,i,I)),A[I]=D})}vfr(o,r,i),o.add($Me(o.getBoundingRect(),r)),o.eachChild(function(h){var p=h.__title,g=h.ensureState("emphasis"),v=g.textConfig||(g.textConfig={}),y=h.getTextContent(),m=y&&y.states.emphasis;if(m&&!si(m)&&p){var b=m.style||(m.style={}),w=a9(p,Bn.makeFont(b)),C=h.x+o.x,A=h.y+o.y+s,S=!1;A+w.height>i.getHeight()&&(v.position="top",S=!0);var I=S?-5-w.height:s+8;C+w.width/2>i.getWidth()?(v.position=["100%",I],b.align="right"):C-w.width/2<0&&(v.position=[0,I],b.align="left")}})},e.prototype.updateView=function(r,n,i,a){te(this._features,function(o){o instanceof kf&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.remove=function(r,n){te(this._features,function(i){i instanceof kf&&i.remove&&i.remove(r,n)}),this.group.removeAll()},e.prototype.dispose=function(r,n){te(this._features,function(i){i instanceof kf&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(ca);function yfr(t){return t.indexOf("my")===0}var BMe=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){var i=this.model,a=i.get("name")||r.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if(typeof MouseEvent=="function"&&(Ar.browser.newEdge||!Ar.browser.ie&&!Ar.browser.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||o){var f=l.split(","),d=f[0].indexOf("base64")>-1,h=o?decodeURIComponent(f[1]):f[1];d&&(h=window.atob(h));var p=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var g=h.length,v=new Uint8Array(g);g--;)v[g]=h.charCodeAt(g);var y=new Blob([v]);window.navigator.msSaveOrOpenBlob(y,p)}else{var m=document.createElement("iframe");document.body.appendChild(m);var b=m.contentWindow,w=b.document;w.open("image/svg+xml","replace"),w.write(h),w.close(),b.focus(),w.execCommand("SaveAs",!0,p),document.body.removeChild(m)}}else{var C=i.get("lang"),A='',S=window.open();S.document.write(A),S.document.title=a}},e.getDefaultOption=function(r){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:r.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(kf);BMe.prototype.unusable=!Ar.canvasSupported;var wwe="__ec_magicType_stack__",wfr=[["line","bar"],["stack"]],bfr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getIcons=function(){var r=this.model,n=r.get("icon"),i={};return te(r.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},e.getDefaultOption=function(r){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:r.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},e.prototype.onclick=function(r,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(bwe[i]){var s={series:[]},l=function(f){var d=f.subType,h=f.id,p=bwe[i](d,h,f,a);p&&(tr(p,f.option),s.series.push(p));var g=f.coordinateSystem;if(g&&g.type==="cartesian2d"&&(i==="line"||i==="bar")){var v=g.getAxesByScale("ordinal")[0];if(v){var y=v.dim,m=y+"Axis",b=f.getReferringComponents(m,yo).models[0],w=b.componentIndex;s[m]=s[m]||[];for(var C=0;C<=w;C++)s[m][w]=s[m][w]||{};s[m][w].boundaryGap=i==="bar"}}};te(wfr,function(f){en(f,i)>=0&&te(f,function(d){a.setIconStatus(d,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var c,u=i;i==="stack"&&(c=$r({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(u="tiled")),n.dispatchAction({type:"changeMagicType",currentType:u,newOption:s,newTitle:c,featureName:"magicType"})}},e}(kf),bwe={line:function(t,e,r,n){if(t==="bar")return $r({id:e,type:"line",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(t,e,r,n){if(t==="line")return $r({id:e,type:"bar",data:r.get("data"),stack:r.get("stack"),markPoint:r.get("markPoint"),markLine:r.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(t,e,r,n){var i=r.get("stack")===wwe;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),$r({id:e,stack:i?"":wwe},n.get(["option","stack"])||{},!0)}};P0({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var rF=new Array(60).join("-"),J5=" ";function xfr(t){var e={},r=[],n=[];return t.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:e,other:r,meta:n}}function _fr(t){var e=[];return te(t,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(ft(r.series,function(h){return h.name})),l=[i.model.getCategories()];te(r.series,function(h){var p=h.getRawData();l.push(h.getRawData().mapArray(p.mapDimension(o),function(g){return g}))});for(var c=[s.join(J5)],u=0;u=0)return!0}var QZ=new RegExp("["+J5+"]+","g");function Tfr(t){for(var e=t.split(/\n+/g),r=zO(e.shift()).split(QZ),n=[],i=ft(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(e)}function Mfr(t){var e=Lne(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return FMe(r,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){n[a]=i;break}}),n}function Dfr(t){jMe(t).snapshots=null}function Nfr(t){return Lne(t).length}function Lne(t){var e=jMe(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var Ofr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){Dfr(r),n.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(r){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:r.getLocaleModel().get(["toolbox","restore","title"])};return n},e}(kf);P0({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var Lfr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],$ne=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=xwe(r,e);te($fr,function(o,s){(!n||!n.include||en(n.include,s)>=0)&&o(a,i._targetInfoList)})}return t.prototype.setOutputRanges=function(e,r){return this.matchOutputRanges(e,r,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=fG[n.brushType](0,a,i);n.__rangeOffset={offset:Awe[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},t.prototype.matchOutputRanges=function(e,r,n){te(e,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&te(a.coordSyses,function(o){var s=fG[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},t.prototype.setInputRanges=function(e,r){te(e,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=fG[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?Awe[n.brushType](a.values,o.offset,Bfr(a.xyMinMax,o.xyMinMax)):a.values}},this)},t.prototype.makePanelOpts=function(e,r){return ft(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:XRe(i),isTargetByCursor:eMe(i,e,n.coordSysModel),getLinearBrushOtherExtent:JRe(i)}})},t.prototype.controlSeries=function(e,r,n){var i=this.findTargetInfo(e,n);return i===!0||i&&en(i.coordSyses,r.coordinateSystem)>=0},t.prototype.findTargetInfo=function(e,r){for(var n=this._targetInfoList,i=xwe(r,e),a=0;at[1]&&t.reverse(),t}function xwe(t,e){return c6(t,e,{includeMainTypes:Lfr})}var $fr={grid:function(t,e){var r=t.xAxisModels,n=t.yAxisModels,i=t.gridModels,a=Gt(),o={},s={};!r&&!n&&!i||(te(r,function(l){var c=l.axis.grid.model;a.set(c.id,c),o[c.id]=!0}),te(n,function(l){var c=l.axis.grid.model;a.set(c.id,c),s[c.id]=!0}),te(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var c=l.coordinateSystem,u=[];te(c.getCartesians(),function(f,d){(en(r,f.getAxis("x").model)>=0||en(n,f.getAxis("y").model)>=0)&&u.push(f)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:u[0],coordSyses:u,getPanelRect:Swe.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(t,e){te(t.geoModels,function(r){var n=r.coordinateSystem;e.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:Swe.geo})})}},_we=[function(t,e){var r=t.xAxisModel,n=t.yAxisModel,i=t.gridModel;return!i&&r&&(i=r.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===e.gridModel},function(t,e){var r=t.geoModel;return r&&r===e.geoModel}],Swe={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Sb(t)),e}},fG={lineX:Er(Cwe,0),lineY:Er(Cwe,1),rect:function(t,e,r,n){var i=t?e.pointToData([r[0][0],r[1][0]],n):e.dataToPoint([r[0][0],r[1][0]],n),a=t?e.pointToData([r[0][1],r[1][1]],n):e.dataToPoint([r[0][1],r[1][1]],n),o=[XZ([i[0],a[0]]),XZ([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(t,e,r,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=ft(r,function(o){var s=t?e.pointToData(o,n):e.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function Cwe(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=XZ(ft([0,1],function(s){return e?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[t]=a,o[1-t]=[NaN,NaN],{values:a,xyMinMax:o}}var Awe={lineX:Er(Twe,0),lineY:Er(Twe,1),rect:function(t,e,r){return[[t[0][0]-r[0]*e[0][0],t[0][1]-r[0]*e[0][1]],[t[1][0]-r[1]*e[1][0],t[1][1]-r[1]*e[1][1]]]},polygon:function(t,e,r){return ft(t,function(n,i){return[n[0]-r[0]*e[i][0],n[1]-r[1]*e[i][1]]})}};function Twe(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function Bfr(t,e){var r=Ewe(t),n=Ewe(e),i=[r[0]/n[0],r[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function Ewe(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var JZ=te,Ffr=aKt("toolbox-dataZoom_"),jfr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){this._brushController||(this._brushController=new fne(i.getZr()),this._brushController.on("brush",Mt(this._onBrush,this)).mount()),Hfr(r,n,this,a,i),zfr(r,n)},e.prototype.onclick=function(r,n,i){Ufr[i].call(this)},e.prototype.remove=function(r,n){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(r,n){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(r){var n=r.areas;if(!r.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new $ne(Bne(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(c,u,f){if(f.type==="cartesian2d"){var d=c.brushType;d==="rect"?(s("x",f,u[0]),s("y",f,u[1])):s({lineX:"x",lineY:"y"}[d],f,u)}}),Rfr(a,i),this._dispatchZoomAction(i);function s(c,u,f){var d=u.getAxis(c),h=d.model,p=l(c,h,a),g=p.findRepresentativeAxisProxy(h).getMinMaxSpan();(g.minValueSpan!=null||g.maxValueSpan!=null)&&(f=yx(0,f.slice(),d.scale.getExtent(),0,g.minValueSpan,g.maxValueSpan)),p&&(i[p.id]={dataZoomId:p.id,startValue:f[0],endValue:f[1]})}function l(c,u,f){var d;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(h){var p=h.getAxisModel(c,u.componentIndex);p&&(d=h)}),d}},e.prototype._dispatchZoomAction=function(r){var n=[];JZ(r,function(i,a){n.push(ur(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},e.getDefaultOption=function(r){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:r.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return n},e}(kf),Ufr={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(Mfr(this.ecModel))}};function Bne(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function zfr(t,e){t.setIconStatus("back",Nfr(e)>1?"emphasis":"normal")}function Hfr(t,e,r,n,i){var a=r._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),r._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var o=new $ne(Bne(t),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()}:!1)}LQt("dataZoom",function(t){var e=t.getComponent("toolbox",0),r=["feature","dataZoom"];if(!e||e.get(r)==null)return;var n=e.getModel(r),i=[],a=Bne(n),o=c6(t,a);JZ(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),JZ(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,c,u){var f=l.componentIndex,d={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Ffr+c+f};d[u]=f,i.push(d)}return i});function Vfr(t){t.registerComponentModel(gfr),t.registerComponentView(mfr),P_("saveAsImage",BMe),P_("magicType",bfr),P_("dataView",kfr),P_("dataZoom",jfr),P_("restore",Ofr),Xr(pfr)}var Gfr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(fn);function UMe(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function zMe(t){if(Ar.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(c=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(c=a==="top"?225:45)+"deg)");var u=c*Math.PI/180,f=o+i,d=f*Math.abs(Math.cos(u))+f*Math.abs(Math.sin(u)),h=Math.round(((d-Math.SQRT2*i)/2+Math.SQRT2*i-(d-f)/2)*100)/100;s+=";"+a+":-"+h+"px";var p=e+" solid "+i+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'
'}function Xfr(t,e){var r="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+r,i="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+r,i+=Ar.transformSupported?","+Fne+n:",left"+n+",top"+n),Yfr+":"+i}function Iwe(t,e,r){var n=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Ar.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Ar.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+Fne+":"+o+";":[["top",0],["left",0],[HMe,o]]}function Jfr(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont()),r&&e.push("line-height:"+Math.round(r*3/2)+"px");var i=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,o=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return i&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+i),te(["decoration","align"],function(l){var c=t.get(l);c&&e.push("text-"+l+":"+c)}),e.join(";")}function edr(t,e,r){var n=[],i=t.get("transitionDuration"),a=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),f=bke(t,"html"),d=l+"px "+c+"px "+o+"px "+s;return n.push("box-shadow:"+d),e&&i&&n.push(Xfr(i,r)),a&&(Ar.canvasSupported?n.push("background-color:"+a):(n.push("background-color:#"+yIe(a)),n.push("filter:alpha(opacity=70)"))),te(["width","color","radius"],function(h){var p="border-"+h,g=H7e(p),v=t.get(g);v!=null&&n.push(p+":"+v+(h==="color"?"":"px"))}),n.push(Jfr(u)),f!=null&&n.push("padding:"+XS(f).join("px ")+"px"),n.join(";")+";"}function kwe(t,e,r,n,i){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&Qqt(t,o,document.body,n,i)}else{t[0]=n,t[1]=i;var s=a&&a.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var tdr=function(){function t(e,r,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,Ar.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var a=this._zr=r.getZr(),o=this._appendToBody=n&&n.appendToBody;kwe(this._styleCoord,a,o,r.getWidth()/2,r.getHeight()/2),o?document.body.appendChild(i):e.appendChild(i),this._container=e;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var c=a.handler,u=a.painter.getViewportRoot();yf(u,l,!0),c.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){var r=this._container,n=qfr(r,"position"),i=r.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative");var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=Kfr+edr(e,!this._firstShow,this._longHide)+Iwe(a[0],a[1],!0)+("border-color:"+E2(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,i,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(En(a)&&n.get("trigger")==="item"&&!UMe(n)&&(s=Qfr(n,i,a)),En(e))o.innerHTML=e+s;else if(e){o.innerHTML="",lt(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,i=this._api;if(this._lastX!=null&&this._lastY!=null&&r.get("triggerOn")!=="none"){var a=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&a.manuallyShowTip(r,n,i,{x:a._lastX,y:a._lastY,dataByCoordSys:a._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||Ar.node)){var o=Dwe(a,i);this._ticket="";var s=a.dataByCoordSys,l=ldr(a,n,i);if(l){var c=l.el.getBoundingRect().clone();c.applyTransform(l.el.transform),this._tryShow({offsetX:c.x+c.width/2,offsetY:c.y+c.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var u=ndr;u.x=a.x,u.y=a.y,u.update(),br(u).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:u},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var f=kMe(a,n),d=f.point[0],h=f.point[1];d!=null&&h!=null&&this._tryShow({offsetX:d,offsetY:h,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(Dwe(a,i))},e.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var c=n.getSeriesByIndex(o);if(c){var u=c.getData(),f=$k([u.getItemModel(s),c,(c.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(r,n){var i=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){this._lastDataByCoordSys=null;var s,l;X_(i,function(c){if(br(c).dataIndex!=null)return s=c,!0;if(br(c).tooltipConfig!=null)return l=c,!0},!0),s?this._showSeriesItemTooltip(r,s,n):l?this._showComponentItemTooltip(r,l,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var i=r.get("showDelay");n=Mt(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},e.prototype._showAxisTooltip=function(r,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=$k([n.tooltipOption],a),l=this._renderMode,c=[],u=Ho("section",{blocks:[],noHeader:!0}),f=[],d=new rV;z4(r,function(m){z4(m.dataByAxis,function(b){var w=i.getComponent(b.axisDim+"Axis",b.axisIndex),C=b.value;if(!(!w||C==null)){var A=AMe(C,w.axis,i,b.seriesDataIndices,b.valueLabelOpt),S=Ho("section",{header:A,noHeader:!dx(A),sortBlocks:!0,blocks:[]});u.blocks.push(S),te(b.seriesDataIndices,function(I){var D=i.getSeriesByIndex(I.seriesIndex),L=I.dataIndexInside,O=D.getDataParams(L);if(!(O.dataIndex<0)){O.axisDim=b.axisDim,O.axisIndex=b.axisIndex,O.axisType=b.axisType,O.axisId=b.axisId,O.axisValue=Gre(w.axis,{value:C}),O.axisValueLabel=A,O.marker=d.makeTooltipMarker("item",E2(O.color),l);var P=vve(D.formatTooltip(L,!0,null));P.markupFragment&&S.blocks.push(P.markupFragment),P.markupText&&f.push(P.markupText),c.push(O)}})}})}),u.blocks.reverse(),f.reverse();var h=n.position,p=s.get("order"),g=Cve(u,d,l,p,i.get("useUTC"),s.get("textStyle"));g&&f.unshift(g);var v=l==="richText"?` - -`:"
",y=f.join(v);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,c)?this._updatePosition(s,h,o[0],o[1],this._tooltipContent,c):this._showTooltipContent(s,y,c,Math.random()+"",o[0],o[1],h,null,d)})},e.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=br(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),c=o.dataModel||l,u=o.dataIndex,f=o.dataType,d=c.getData(f),h=this._renderMode,p=r.positionDefault,g=$k([d.getItemModel(u),c,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),v=g.get("trigger");if(!(v!=null&&v!=="item")){var y=c.getDataParams(u,f),m=new rV;y.marker=m.makeTooltipMarker("item",E2(y.color),h);var b=vve(c.formatTooltip(u,!1,f)),w=g.get("order"),C=b.markupFragment?Cve(b.markupFragment,m,h,w,a.get("useUTC"),g.get("textStyle")):b.markupText,A="item_"+c.name+"_"+u;this._showOrMove(g,function(){this._showTooltipContent(g,C,y,A,r.offsetX,r.offsetY,r.position,r.target,m)}),i({type:"showTip",dataIndexInside:u,dataIndex:d.getRawIndex(u),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,i){var a=br(n),o=a.tooltipConfig,s=o.option||{};if(En(s)){var l=s;s={content:l,formatter:l}}var c=[s],u=this._ecModel.getComponent(a.componentMainType,a.componentIndex);u&&c.push(u),c.push({formatter:s.content});var f=r.positionDefault,d=$k(c,this._tooltipModel,f?{position:f}:null),h=d.get("content"),p=Math.random()+"",g=new rV;this._showOrMove(d,function(){var v=ur(d.get("formatterParams")||{});this._showTooltipContent(d,h,v,p,r.offsetX,r.offsetY,r.position,n,g)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,i,a,o,s,l,c,u){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent,d=r.get("formatter");l=l||r.get("position");var h=n,p=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor")),g=p.color;if(d)if(En(d)){var v=r.ecModel.get("useUTC"),y=lt(i)?i[0]:i,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;h=d,m&&(h=DB(y.axisValue,h,v)),h=V7e(h,i,!0)}else if(si(d)){var b=dG(function(w,C){w===this._ticket&&(f.setContent(C,u,r,g,l),this._updatePosition(r,l,o,s,f,i,c))},this);this._ticket=a,h=d(i,a,b)}else h=d;f.setContent(h,u,r,g,l),f.show(r,g),this._updatePosition(r,l,o,s,f,i,c)}},e.prototype._getNearestPoint=function(r,n,i,a){if(i==="axis"||lt(n))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!lt(n))return{color:a||n.color||n.borderColor}},e.prototype._doUpdatePosition=function(r,n,i,a,o,s,l){var c=this._api.getWidth(),u=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),d=r.get("align"),h=r.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),si(n)&&(n=n([i,a],s,o.el,p,{viewSize:[c,u],contentSize:f.slice()})),lt(n))i=Mwe(n[0],c),a=Mwe(n[1],u);else if(dr(n)){var g=n;g.width=f[0],g.height=f[1];var v=Eo(g,{width:c,height:u});i=v.x,a=v.y,d=null,h=null}else if(En(n)&&l){var y=sdr(n,p,f,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=adr(i,a,o,c,u,d?null:20,h?null:20);i=y[0],a=y[1]}if(d&&(i-=Nwe(d)?f[0]/2:d==="right"?f[0]:0),h&&(a-=Nwe(h)?f[1]/2:h==="bottom"?f[1]:0),UMe(r)){var y=odr(i,a,o,c,u);i=y[0],a=y[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&z4(i,function(s,l){var c=s.dataByAxis||[],u=r[l]||{},f=u.dataByAxis||[];o=o&&c.length===f.length,o&&z4(c,function(d,h){var p=f[h]||{},g=d.seriesDataIndices||[],v=p.seriesDataIndices||[];o=o&&d.value===p.value&&d.axisType===p.axisType&&d.axisId===p.axisId&&g.length===v.length,o&&z4(g,function(y,m){var b=v[m];o=o&&y.seriesIndex===b.seriesIndex&&y.dataIndex===b.dataIndex}),a&&te(d.seriesDataIndices,function(y){var m=y.seriesIndex,b=n[m],w=a[m];b&&w&&w.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){Ar.node||(this._tooltipContent.dispose(),KZ("itemTooltip",n))},e.type="tooltip",e}(ca);function $k(t,e,r){var n=e.ecModel,i;r?(i=new ai(r,n,n),i=new ai(e.option,i,n)):i=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof ai&&(o=o.get("tooltip",!0)),En(o)&&(o={formatter:o}),o&&(i=new ai(o,i,n)))}return i}function Dwe(t,e){return t.dispatchAction||Mt(e.dispatchAction,e)}function adr(t,e,r,n,i,a,o){var s=r.getSize(),l=s[0],c=s[1];return a!=null&&(t+l+a+2>n?t-=l+a:t+=a),o!=null&&(e+c+o>i?e-=c+o:e+=o),[t,e]}function odr(t,e,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,i)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function sdr(t,e,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-i/2,l=e.y+u/2-a/2;break;case"top":s=e.x+c/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+c/2-i/2,l=e.y+u+o;break;case"left":s=e.x-i-o,l=e.y+u/2-a/2;break;case"right":s=e.x+c+o,l=e.y+u/2-a/2}return[s,l]}function Nwe(t){return t==="center"||t==="middle"}function ldr(t,e,r){var n=lre(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=o9(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(c){var u=br(c).tooltipConfig;if(u&&u.name===t.name)return l=c,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function cdr(t){Xr(E9),t.registerComponentModel(Gfr),t.registerComponentView(idr),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){})}var udr=["rect","polygon","keep","clear"];function fdr(t,e){var r=di(t?t.brush:[]);if(r.length){var n=[];te(r,function(l){var c=l.hasOwnProperty("toolbox")?l.toolbox:[];c instanceof Array&&(n=n.concat(c))});var i=t&&t.toolbox;lt(i)&&(i=i[0]),i||(i={feature:{}},t.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),ddr(s),e&&!s.length&&s.push.apply(s,udr)}}function ddr(t){var e={};te(t,function(r){e[r]=1}),t.length=0,te(e,function(r,n){t.push(n)})}var Owe=te;function Lwe(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function eQ(t,e,r){var n={};return Owe(e,function(a){var o=n[a]=i();Owe(t[a],function(s,l){if(Uo.isValidType(l)){var c={type:l,visual:s};r&&r(c,a),o[l]=new Uo(c),l==="opacity"&&(c=ur(c),c.type="colorAlpha",o.__hidden.__alphaForOpacity=new Uo(c))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function GMe(t,e,r){var n;te(r,function(i){e.hasOwnProperty(i)&&Lwe(e[i])&&(n=!0)}),n&&te(r,function(i){e.hasOwnProperty(i)&&Lwe(e[i])?t[i]=ur(e[i]):delete t[i]})}function hdr(t,e,r,n,i,a){var o={};te(t,function(f){var d=Uo.prepareVisualTypes(e[f]);o[f]=d});var s;function l(f){return Dre(r,s,f)}function c(f,d){Pke(r,s,f,d)}r.each(u);function u(f,d){s=f;var h=r.getRawDataItem(s);if(!(h&&h.visualMap===!1))for(var p=n.call(i,f),g=e[p],v=o[p],y=0,m=v.length;ye[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&Uwe(e)}};function Uwe(t){return new tn(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var xdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new fne(n.getZr())).on("brush",Mt(this._onBrush,this)).mount()},e.prototype.render=function(r,n,i,a){this.model=r,this._updateController(r,n,i,a)},e.prototype.updateTransform=function(r,n,i,a){WMe(n),this._updateController(r,n,i,a)},e.prototype.updateVisual=function(r,n,i,a){this.updateTransform(r,n,i,a)},e.prototype.updateView=function(r,n,i,a){this._updateController(r,n,i,a)},e.prototype._updateController=function(r,n,i,a){(!a||a.$from!==r.id)&&this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(r){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(r.areas,this.ecModel);(!r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:ur(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:ur(i),$from:n})},e.type="brush",e}(ca),_dr="#ddd",Sdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.areas=[],r.brushOption={},r}return e.prototype.optionUpdated=function(r,n){var i=this.option;!n&&GMe(i,r,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:_dr},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(r){r&&(this.areas=ft(r,function(n){return zwe(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=zwe(this.option,r),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(fn);function zwe(t,e){return $r({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new ai(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var Cdr=["rect","polygon","lineX","lineY","keep","clear"],Adr=function(t){Ge(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,te(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(r,n,i){this.render(r,n,i)},e.prototype.getIcons=function(){var r=this.model,n=r.get("icon",!0),i={};return te(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(r,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(r){var n={show:!0,type:Cdr.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:r.getLocaleModel().get(["toolbox","brush","title"])};return n},e}(kf);function Tdr(t){t.registerComponentView(xdr),t.registerComponentModel(Sdr),t.registerPreprocessor(fdr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,vdr),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,r){r.eachComponent({mainType:"brush",query:e},function(n){n.setAreas(e.areas)})}),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},function(){}),P_("brush",Adr)}var Edr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.type="title",e.defaultOption={zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(fn),Idr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),c=Cn(r.get("textBaseline"),r.get("textVerticalAlign")),u=new Bn({style:Ja(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=u.getBoundingRect(),d=r.get("subtext"),h=new Bn({style:Ja(s,{text:d,fill:s.getTextColor(),y:f.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=r.get("link"),g=r.get("sublink"),v=r.get("triggerEvent",!0);u.silent=!p&&!v,h.silent=!g&&!v,p&&u.on("click",function(){yO(p,"_"+r.get("target"))}),g&&h.on("click",function(){yO(g,"_"+r.get("subtarget"))}),br(u).eventData=br(h).eventData=v?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(u),d&&a.add(h);var y=a.getBoundingRect(),m=r.getBoxLayoutParams();m.width=y.width,m.height=y.height;var b=Eo(m,{width:i.getWidth(),height:i.getHeight()},r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?b.x+=b.width:l==="center"&&(b.x+=b.width/2)),c||(c=r.get("top")||r.get("bottom"),c==="center"&&(c="middle"),c==="bottom"?b.y+=b.height:c==="middle"&&(b.y+=b.height/2),c=c||"top"),a.x=b.x,a.y=b.y,a.markRedraw();var w={align:l,verticalAlign:c};u.setStyle(w),h.setStyle(w),y=a.getBoundingRect();var C=b.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var S=new In({shape:{x:y.x-C[3],y:y.y-C[0],width:y.width+C[1]+C[3],height:y.height+C[0]+C[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(S)}},e.type="title",e}(ca);function kdr(t){t.registerComponentModel(Edr),t.registerComponentView(Idr)}var Hwe=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode="box",r}return e.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),this._initData()},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(r){r==null&&(r=this.option.currentIndex);var n=this._data.count();this.option.loop?r=(r%n+n)%n:(r>=n&&(r=n-1),r<0&&(r=0)),this.option.currentIndex=r},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(r){this.option.autoPlay=!!r},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var r=this.option,n=r.data||[],i=r.axisType,a=this._names=[],o;i==="category"?(o=[],te(n,function(c,u){var f=To(qS(c),""),d;dr(c)?(d=ur(c),d.value=u):d=u,o.push(d),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new Ul([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(fn),qMe=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline.slider",e.defaultOption=Sy(Hwe.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(Hwe);xo(qMe,Pre.prototype);var Pdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline",e}(ca),Rdr=function(t){Ge(e,t);function e(r,n,i,a){var o=t.call(this,r,n,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(Lh),pG=Math.PI,Vwe=qn(),Mdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){this.api=n},e.prototype.render=function(r,n,i){if(this.model=r,this.api=i,this.ecModel=n,this.group.removeAll(),r.get("show",!0)){var a=this._layout(r,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(c){var u=l.scale.getLabel({value:c});return Ho("nameValue",{noName:!0,value:u})},te(["AxisLine","AxisTick","Control","CurrentPointer"],function(c){this["_render"+c](a,o,l,r)},this),this._renderAxisLabel(a,s,l,r),this._position(a,r)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(r,n){var i=r.get(["label","position"]),a=r.get("orient"),o=Ndr(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},c={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},u={horizontal:0,vertical:pG/2},f=a==="vertical"?o.height:o.width,d=r.getModel("controlStyle"),h=d.get("show",!0),p=h?d.get("itemSize"):0,g=h?d.get("itemGap"):0,v=p+g,y=r.get(["label","rotate"])||0;y=y*pG/180;var m,b,w,C=d.get("position",!0),A=h&&d.get("showPlayBtn",!0),S=h&&d.get("showPrevBtn",!0),I=h&&d.get("showNextBtn",!0),D=0,L=f;C==="left"||C==="bottom"?(A&&(m=[0,0],D+=v),S&&(b=[D,0],D+=v),I&&(w=[L-p,0],L-=v)):(A&&(m=[L-p,0],L-=v),S&&(b=[0,0],D+=v),I&&(w=[L-p,0],L-=v));var O=[D,L];return r.get("inverse")&&O.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:u[a],labelRotation:y,labelPosOpt:s,labelAlign:r.get(["label","align"])||l[a],labelBaseline:r.get(["label","verticalAlign"])||r.get(["label","baseline"])||c[a],playPosition:m,prevBtnPosition:b,nextBtnPosition:w,axisExtent:O,controlSize:p,controlGap:g}},e.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=Xf(),l=o.x,c=o.y+o.height;d0(s,s,[-l,-c]),px(s,s,-pG/2),d0(s,s,[l,c]),o=o.clone(),o.applyTransform(s)}var u=m(o),f=m(i.getBoundingRect()),d=m(a.getBoundingRect()),h=[i.x,i.y],p=[a.x,a.y];p[0]=h[0]=u[0][0];var g=r.labelPosOpt;if(g==null||En(g)){var v=g==="+"?0:1;b(h,f,u,1,v),b(p,d,u,1,1-v)}else{var v=g>=0?0:1;b(h,f,u,1,v),p[1]=h[1]+g}i.setPosition(h),a.setPosition(p),i.rotation=a.rotation=r.rotation,y(i),y(a);function y(w){w.originX=u[0][0]-w.x,w.originY=u[1][0]-w.y}function m(w){return[[w.x,w.x+w.width],[w.y,w.y+w.height]]}function b(w,C,A,S,I){w[S]+=A[S][I]-C[S][I]}},e.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=Ddr(n,a);o.getTicks=function(){return i.mapArray(["value"],function(c){return{value:c}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.niceTicks();var l=new Rdr("value",o,r.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(r){var n=this[r]=new fr;return this.group.add(n),n},e.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new Fo({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:st({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new Fo({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:tr({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],te(l,function(c){var u=i.dataToCoord(c.value),f=s.getItemModel(c.value),d=f.getModel("itemStyle"),h=f.getModel(["emphasis","itemStyle"]),p=f.getModel(["progress","itemStyle"]),g={x:u,y:0,onclick:Mt(o._changeTimeline,o,c.value)},v=Gwe(f,d,n,g);v.ensureState("emphasis").style=h.getItemStyle(),v.ensureState("progress").style=p.getItemStyle(),Ri(v);var y=br(v);f.get("tooltip")?(y.dataIndex=c.value,y.dataModel=a):y.dataIndex=y.dataModel=null,o._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),c=i.getViewLabels();this._tickLabels=[],te(c,function(u){var f=u.tickValue,d=l.getItemModel(f),h=d.getModel("label"),p=d.getModel(["emphasis","label"]),g=d.getModel(["progress","label"]),v=i.dataToCoord(u.tickValue),y=new Bn({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Mt(o._changeTimeline,o,f),silent:!1,style:Ja(h,{text:u.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=Ja(p),y.ensureState("progress").style=Ja(g),n.add(y),Ri(y),Vwe(y).dataIndex=f,o._tickLabels.push(y)})}},e.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=r.rotation,l=a.getModel("controlStyle").getItemStyle(),c=a.getModel(["emphasis","controlStyle"]).getItemStyle(),u=a.getPlayState(),f=a.get("inverse",!0);d(r.nextBtnPosition,"next",Mt(this._changeTimeline,this,f?"-":"+")),d(r.prevBtnPosition,"prev",Mt(this._changeTimeline,this,f?"+":"-")),d(r.playPosition,u?"stop":"play",Mt(this._handlePlayClick,this,!u),!0);function d(h,p,g,v){if(h){var y=Jf(Cn(a.get(["controlStyle",p+"BtnSize"]),o),o),m=[0,-y/2,y,y],b=Odr(a,p+"Icon",m,{x:h[0],y:h[1],originX:o/2,originY:0,rotation:v?-s:0,rectHover:!0,style:l,onclick:g});b.ensureState("emphasis").style=c,n.add(b),Ri(b)}}},e.prototype._renderCurrentPointer=function(r,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),c=this,u={onCreate:function(f){f.draggable=!0,f.drift=Mt(c._handlePointerDrag,c),f.ondragend=Mt(c._handlePointerDragend,c),Wwe(f,c._progressLine,s,i,a,!0)},onUpdate:function(f){Wwe(f,c._progressLine,s,i,a)}};this._currentPointer=Gwe(l,l,this._mainGroup,{},this._currentPointer,u)},e.prototype._handlePlayClick=function(r){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:r,from:this.uid})},e.prototype._handlePointerDrag=function(r,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(r){this._pointerChangeTimeline([r.offsetX,r.offsetY],!0)},e.prototype._pointerChangeTimeline=function(r,n){var i=this._toAxisCoord(r)[0],a=this._axis,o=Lf(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(o[a]=+o[a].toFixed(d)),[o,f]}var gG={min:Er(jk,"min"),max:Er(jk,"max"),average:Er(jk,"average"),median:Er(jk,"median")};function UE(t,e){var r=t.getData(),n=t.coordinateSystem;if(e&&!zdr(e)&&!lt(e.coord)&&n){var i=n.dimensions,a=YMe(e,r,n,t);if(e=ur(e),e.type&&gG[e.type]&&a.baseAxis&&a.valueAxis){var o=en(i,a.baseAxis.dim),s=en(i,a.valueAxis.dim),l=gG[e.type](r,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else{for(var c=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis],u=0;u<2;u++)gG[c[u]]&&(c[u]=Une(r,r.mapDimension(i[u]),c[u]));e.coord=c}}return e}function YMe(t,e,r,n){var i={};return t.valueIndex!=null||t.valueDim!=null?(i.valueDataDim=t.valueIndex!=null?e.getDimension(t.valueIndex):t.valueDim,i.valueAxis=r.getAxis(Hdr(n,i.valueDataDim)),i.baseAxis=r.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=r.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function Hdr(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function zE(t,e){return t&&t.containData&&e.coord&&!Udr(e)?t.containData(e.coord):!0}function KMe(t,e){return t?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return b1(o,e[a])}:function(r,n,i,a){return b1(r.value,e[a])}}function Une(t,e,r){if(r==="average"){var n=0,i=0;return t.each(e,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?t.getMedian(e):t.getDataExtent(e)[r==="max"?1:0]}var vG=qn(),zne=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){this.markerGroupMap=Gt()},e.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){vG(s).keep=!1}),n.eachSeries(function(s){var l=gv.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!vG(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(r){vG(r).keep=!0},e.prototype.blurSeries=function(r){var n=this;te(r,function(i){var a=gv.getMarkerModelFromSeries(i,n.type);if(a){var o=a.getData();o.eachItemGraphicEl(function(s){s&&i7e(s)})}})},e.type="marker",e}(ca);function Ywe(t,e,r){var n=e.coordinateSystem;t.each(function(i){var a=t.getItemModel(i),o,s=xt(a.get("x"),r.getWidth()),l=xt(a.get("y"),r.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,i));else if(n){var c=t.get(n.dimensions[0],i),u=t.get(n.dimensions[1],i);o=n.dataToPoint([c,u])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(i,o)})}var Vdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=gv.getMarkerModelFromSeries(a,"markPoint");o&&(Ywe(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),c=this.markerGroupMap,u=c.get(s)||c.set(s,new _9),f=Gdr(o,r,n);n.setData(f),Ywe(n.getData(),r,a),f.each(function(d){var h=f.getItemModel(d),p=h.getShallow("symbol"),g=h.getShallow("symbolSize"),v=h.getShallow("symbolRotate"),y=h.getShallow("symbolOffset"),m=h.getShallow("symbolKeepAspect");if(si(p)||si(g)||si(v)||si(y)){var b=n.getRawValue(d),w=n.getDataParams(d);si(p)&&(p=p(b,w)),si(g)&&(g=g(b,w)),si(v)&&(v=v(b,w)),si(y)&&(y=y(b,w))}var C=h.getModel("itemStyle").getItemStyle(),A=v9(l,"color");C.fill||(C.fill=A),f.setItemVisual(d,{symbol:p,symbolSize:g,symbolRotate:v,symbolOffset:y,symbolKeepAspect:m,style:C})}),u.updateData(f),this.group.add(u.group),f.eachItemGraphicEl(function(d){d.traverse(function(h){br(h).dataModel=n})}),this.markKeep(u),u.group.silent=n.get("silent")||r.get("silent")},e.type="markPoint",e}(zne);function Gdr(t,e,r){var n;t?n=ft(t&&t.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return st(st({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Ul(n,r),a=ft(r.get("data"),Er(UE,e));t&&(a=qi(a,Er(zE,t)));var o=KMe(!!t,n);return i.initData(a,null,o),i}function Wdr(t){t.registerComponentModel(jdr),t.registerComponentView(Vdr),t.registerPreprocessor(function(e){jne(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var qdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.createMarkerModelFromSeries=function(r,n,i){return new e(r,n,i)},e.type="markLine",e.defaultOption={zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(gv),Uk=qn(),Ydr=function(t,e,r,n){var i=t.getData(),a;if(lt(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=e.getAxis(n.yAxis!=null?"y":"x"),l=as(n.yAxis,n.xAxis);else{var c=YMe(n,i,e,t);s=c.valueAxis;var u=fPe(i,c.valueDataDim);l=Une(i,u,o)}var f=s.dim==="x"?0:1,d=1-f,h=ur(n),p={coord:[]};h.type=null,h.coord=[],h.coord[d]=-1/0,p.coord[d]=1/0;var g=r.get("precision");g>=0&&typeof l=="number"&&(l=+l.toFixed(Math.min(g,20))),h.coord[f]=p.coord[f]=l,a=[h,p,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[UE(t,a[0]),UE(t,a[1]),st({},a[2])];return v[2].type=v[2].type||null,$r(v[2],v[0]),$r(v[2],v[1]),v};function HO(t){return!isNaN(t)&&!isFinite(t)}function Kwe(t,e,r,n){var i=1-t,a=n.dimensions[t];return HO(e[i])&&HO(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function Kdr(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Kwe(1,r,n,t)||Kwe(0,r,n,t)))return!0}return zE(t,e[0])&&zE(t,e[1])}function mG(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=xt(o.get("x"),i.getWidth()),c=xt(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(c))s=[l,c];else{if(n.getMarkerPosition)s=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var u=a.dimensions,f=t.get(u[0],e),d=t.get(u[1],e);s=a.dataToPoint([f,d])}if($g(a,"cartesian2d")){var h=a.getAxis("x"),p=a.getAxis("y"),u=a.dimensions;HO(t.get(u[0],e))?s[0]=h.toGlobalCoord(h.getExtent()[r?0:1]):HO(t.get(u[1],e))&&(s[1]=p.toGlobalCoord(p.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(c)||(s[1]=c)}t.setItemLayout(e,s)}var Zdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=gv.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=Uk(o).from,c=Uk(o).to;l.each(function(u){mG(l,u,!0,a,i),mG(c,u,!1,a,i)}),s.each(function(u){s.setItemLayout(u,[l.getItemLayout(u),c.getItemLayout(u)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),c=this.markerGroupMap,u=c.get(s)||c.set(s,new une);this.group.add(u.group);var f=Qdr(o,r,n),d=f.from,h=f.to,p=f.line;Uk(n).from=d,Uk(n).to=h,n.setData(p);var g=n.get("symbol"),v=n.get("symbolSize"),y=n.get("symbolRotate"),m=n.get("symbolOffset");lt(g)||(g=[g,g]),lt(v)||(v=[v,v]),lt(y)||(y=[y,y]),lt(m)||(m=[m,m]),f.from.each(function(w){b(d,w,!0),b(h,w,!1)}),p.each(function(w){var C=p.getItemModel(w).getModel("lineStyle").getLineStyle();p.setItemLayout(w,[d.getItemLayout(w),h.getItemLayout(w)]),C.stroke==null&&(C.stroke=d.getItemVisual(w,"style").fill),p.setItemVisual(w,{fromSymbolKeepAspect:d.getItemVisual(w,"symbolKeepAspect"),fromSymbolOffset:d.getItemVisual(w,"symbolOffset"),fromSymbolRotate:d.getItemVisual(w,"symbolRotate"),fromSymbolSize:d.getItemVisual(w,"symbolSize"),fromSymbol:d.getItemVisual(w,"symbol"),toSymbolKeepAspect:h.getItemVisual(w,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(w,"symbolOffset"),toSymbolRotate:h.getItemVisual(w,"symbolRotate"),toSymbolSize:h.getItemVisual(w,"symbolSize"),toSymbol:h.getItemVisual(w,"symbol"),style:C})}),u.updateData(p),f.line.eachItemGraphicEl(function(w,C){w.traverse(function(A){br(A).dataModel=n})});function b(w,C,A){var S=w.getItemModel(C);mG(w,C,A,r,a);var I=S.getModel("itemStyle").getItemStyle();I.fill==null&&(I.fill=v9(l,"color")),w.setItemVisual(C,{symbolKeepAspect:S.get("symbolKeepAspect"),symbolOffset:Cn(S.get("symbolOffset",!0),m[A?0:1]),symbolRotate:Cn(S.get("symbolRotate",!0),y[A?0:1]),symbolSize:Cn(S.get("symbolSize"),v[A?0:1]),symbol:Cn(S.get("symbol",!0),g[A?0:1]),style:I})}this.markKeep(u),u.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(zne);function Qdr(t,e,r){var n;t?n=ft(t&&t.dimensions,function(c){var u=e.getData().getDimensionInfo(e.getData().mapDimension(c))||{};return st(st({},u),{name:c,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new Ul(n,r),a=new Ul(n,r),o=new Ul([],r),s=ft(r.get("data"),Er(Ydr,e,t,r));t&&(s=qi(s,Er(Kdr,t)));var l=KMe(!!t,n);return i.initData(ft(s,function(c){return c[0]}),null,l),a.initData(ft(s,function(c){return c[1]}),null,l),o.initData(ft(s,function(c){return c[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Xdr(t){t.registerComponentModel(qdr),t.registerComponentView(Zdr),t.registerPreprocessor(function(e){jne(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var Jdr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.createMarkerModelFromSeries=function(r,n,i){return new e(r,n,i)},e.type="markArea",e.defaultOption={zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(gv),zk=qn(),ehr=function(t,e,r,n){var i=UE(t,n[0]),a=UE(t,n[1]),o=i.coord,s=a.coord;o[0]=as(o[0],-1/0),o[1]=as(o[1],-1/0),s[0]=as(s[0],1/0),s[1]=as(s[1],1/0);var l=Qte([{},i,a]);return l.coord=[i.coord,a.coord],l.x0=i.x,l.y0=i.y,l.x1=a.x,l.y1=a.y,l};function VO(t){return!isNaN(t)&&!isFinite(t)}function Zwe(t,e,r,n){var i=1-t;return VO(e[i])&&VO(r[i])}function thr(t,e){var r=e.coord[0],n=e.coord[1];return $g(t,"cartesian2d")&&r&&n&&(Zwe(1,r,n)||Zwe(0,r,n))?!0:zE(t,{coord:r,x:e.x0,y:e.y0})||zE(t,{coord:n,x:e.x1,y:e.y1})}function Qwe(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=xt(o.get(r[0]),i.getWidth()),c=xt(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(c))s=[l,c];else{if(n.getMarkerPosition)s=n.getMarkerPosition(t.getValues(r,e));else{var u=t.get(r[0],e),f=t.get(r[1],e),d=[u,f];a.clampData&&a.clampData(d,d),s=a.dataToPoint(d,!0)}if($g(a,"cartesian2d")){var h=a.getAxis("x"),p=a.getAxis("y"),u=t.get(r[0],e),f=t.get(r[1],e);VO(u)?s[0]=h.toGlobalCoord(h.getExtent()[r[0]==="x0"?0:1]):VO(f)&&(s[1]=p.toGlobalCoord(p.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(c)||(s[1]=c)}return s}var Xwe=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],rhr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.updateTransform=function(r,n,i){n.eachSeries(function(a){var o=gv.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var c=ft(Xwe,function(f){return Qwe(s,l,f,a,i)});s.setItemLayout(l,c);var u=s.getItemGraphicEl(l);u.setShape("points",c)})}},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),c=this.markerGroupMap,u=c.get(s)||c.set(s,{group:new fr});this.group.add(u.group),this.markKeep(u);var f=nhr(o,r,n);n.setData(f),f.each(function(d){var h=ft(Xwe,function(I){return Qwe(f,d,I,r,a)}),p=o.getAxis("x").scale,g=o.getAxis("y").scale,v=p.getExtent(),y=g.getExtent(),m=[p.parse(f.get("x0",d)),p.parse(f.get("x1",d))],b=[g.parse(f.get("y0",d)),g.parse(f.get("y1",d))];Lf(m),Lf(b);var w=!(v[0]>m[1]||v[1]b[1]||y[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(fn),h_=Er,nQ=te,Hk=fr,ZMe=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new Hk),this.group.add(this._selectorGroup=new Hk),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),c=r.get("selectorPosition",!0);l&&(!c||c==="auto")&&(c=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,c);var u=r.getBoxLayoutParams(),f={width:i.getWidth(),height:i.getHeight()},d=r.get("padding"),h=Eo(u,f,d),p=this.layoutInner(r,o,h,a,l,c),g=Eo(tr({width:p.width,height:p.height},u),f,d);this.group.x=g.x-p.x,this.group.y=g.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=$Me(p,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,i,a,o,s,l){var c=this.getContentGroup(),u=Gt(),f=n.get("selectedMode"),d=[];i.eachRawSeries(function(h){!h.get("legendHoverLink")&&d.push(h.id)}),nQ(n.getData(),function(h,p){var g=h.get("name");if(!this.newlineDisabled&&(g===""||g===` -`)){var v=new Hk;v.newline=!0,c.add(v);return}var y=i.getSeriesByName(g)[0];if(!u.get(g))if(y){var m=y.getData(),b=m.getVisual("legendLineStyle")||{},w=m.getVisual("legendIcon"),C=m.getVisual("style"),A=this._createItem(y,g,p,h,n,r,b,C,w,f);A.on("click",h_(Jwe,g,null,a,d)).on("mouseover",h_(iQ,y.name,null,a,d)).on("mouseout",h_(aQ,y.name,null,a,d)),u.set(g,!0)}else i.eachRawSeries(function(S){if(!u.get(g)&&S.legendVisualProvider){var I=S.legendVisualProvider;if(!I.containName(g))return;var D=I.indexOfName(g),L=I.getItemVisual(D,"style"),O=I.getItemVisual(D,"legendIcon"),P=Zl(L.fill);P&&P[3]===0&&(P[3]=.2,L.fill=Hp(P,"rgba"));var x=this._createItem(S,g,p,h,n,r,{},L,O,f);x.on("click",h_(Jwe,null,g,a,d)).on("mouseover",h_(iQ,null,g,a,d)).on("mouseout",h_(aQ,null,g,a,d)),u.set(g,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},e.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();nQ(r,function(c){var u=c.type,f=new Bn({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:u==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(f);var d=n.getModel("selectorLabel"),h=n.getModel(["emphasis","selectorLabel"]);wl(f,{normal:d,emphasis:h},{defaultText:c.title}),Ri(f)})},e.prototype._createItem=function(r,n,i,a,o,s,l,c,u,f){var d=r.visualDrawType,h=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(n),v=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),m=a.get("icon");u=m||u||"roundRect";var b=ohr(u,a,l,c,d,g),w=new Hk,C=a.getModel("textStyle");if(typeof r.getLegendIcon=="function"&&(!m||m==="inherit"))w.add(r.getLegendIcon({itemWidth:h,itemHeight:p,icon:u,iconRotate:v,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:y}));else{var A=m==="inherit"&&r.getData().getVisual("symbol")?v==="inherit"?r.getData().getVisual("symbolRotate"):v:0;w.add(shr({itemWidth:h,itemHeight:p,icon:u,iconRotate:A,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:y}))}var S=s==="left"?h+5:-5,I=s,D=o.get("formatter"),L=n;typeof D=="string"&&D?L=D.replace("{name}",n??""):typeof D=="function"&&(L=D(n));var O=a.get("inactiveColor");w.add(new Bn({style:Ja(C,{text:L,x:S,y:p/2,fill:g?C.getTextColor():O,align:I,verticalAlign:"middle"})}));var P=new In({shape:w.getBoundingRect(),invisible:!0}),x=a.getModel("tooltip");return x.get("show")&&KS({el:P,componentModel:o,itemName:n,itemTooltipOption:x.option}),w.add(P),w.eachChild(function(T){T.silent=!0}),P.silent=!f,this.getContentGroup().add(w),Ri(w),w.__legendDataIndex=i,w},e.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),c=this.getSelectorGroup();Cb(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var u=l.getBoundingRect(),f=[-u.x,-u.y];if(c.markRedraw(),l.markRedraw(),o){Cb("horizontal",c,r.get("selectorItemGap",!0));var d=c.getBoundingRect(),h=[-d.x,-d.y],p=r.get("selectorButtonGap",!0),g=r.getOrient().index,v=g===0?"width":"height",y=g===0?"height":"width",m=g===0?"y":"x";s==="end"?h[g]+=u[v]+p:f[g]+=d[v]+p,h[1-g]+=u[y]/2-d[y]/2,c.x=h[0],c.y=h[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[v]=u[v]+p+d[v],b[y]=Math.max(u[y],d[y]),b[m]=Math.min(0,d[m]+h[1-g]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(ca);function ohr(t,e,r,n,i,a){function o(p,g){p.lineWidth==="auto"&&(p.lineWidth=g.lineWidth>0?2:0),nQ(p,function(v,y){p[y]==="inherit"&&(p[y]=g[y])})}var s=e.getModel("itemStyle"),l=s.getItemStyle(),c=t.lastIndexOf("empty",0)===0?"fill":"stroke";l.decal=n.decal,l.fill==="inherit"&&(l.fill=n[i]),l.stroke==="inherit"&&(l.stroke=n[c]),l.opacity==="inherit"&&(l.opacity=(i==="fill"?n:r).opacity),o(l,n);var u=e.getModel("lineStyle"),f=u.getLineStyle();if(o(f,r),l.fill==="auto"&&(l.fill=n.fill),l.stroke==="auto"&&(l.stroke=n.fill),f.stroke==="auto"&&(f.stroke=n.fill),!a){var d=e.get("inactiveBorderWidth"),h=l[c];l.lineWidth=d==="auto"?n.lineWidth>0&&h?2:0:l.lineWidth,l.fill=e.get("inactiveColor"),l.stroke=e.get("inactiveBorderColor"),f.stroke=u.get("inactiveColor"),f.lineWidth=u.get("inactiveWidth")}return{itemStyle:l,lineStyle:f}}function shr(t){var e=t.icon||"roundRect",r=bo(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill="#fff",r.style.lineWidth=2),r}function Jwe(t,e,r,n){aQ(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),iQ(t,e,r,n)}function QMe(t){for(var e=t.getZr().storage.getDisplayList(),r,n=0,i=e.length;ni[o],v=[-h.x,-h.y];n||(v[a]=u[c]);var y=[0,0],m=[-p.x,-p.y],b=Cn(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(g){var w=r.get("pageButtonPosition",!0);w==="end"?m[a]+=i[o]-p[o]:y[a]+=p[o]+b}m[1-a]+=h[s]/2-p[s]/2,u.setPosition(v),f.setPosition(y),d.setPosition(m);var C={x:0,y:0};if(C[o]=g?i[o]:h[o],C[s]=Math.max(h[s],p[s]),C[l]=Math.min(0,p[l]+m[1-a]),f.__rectSize=i[o],g){var A={x:0,y:0};A[o]=Math.max(i[o]-p[o]-b,0),A[s]=C[s],f.setClipPath(new In({shape:A})),f.__rectSize=A[o]}else d.eachChild(function(I){I.attr({invisible:!0,silent:!0})});var S=this._getPageInfo(r);return S.pageIndex!=null&&Mn(u,{x:S.contentPosition[0],y:S.contentPosition[1]},g?r:null),this._updatePageInfoView(r,S),C},e.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;te(["pagePrev","pageNext"],function(u){var f=u+"DataIndex",d=n[f]!=null,h=i.childOfName(u);h&&(h.setStyle("fill",d?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),h.cursor=d?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,c=n.pageCount;a&&o&&a.setStyle("text",En(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",c==null?"":c+""):o({current:l,total:c}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=yG[o],l=wG[o],c=this._findTargetItemIndex(n),u=i.children(),f=u[c],d=u.length,h=d?1:0,p={contentPosition:[i.x,i.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return p;var g=w(f);p.contentPosition[o]=-g.s;for(var v=c+1,y=g,m=g,b=null;v<=d;++v)b=w(u[v]),(!b&&m.e>y.s+a||b&&!C(b,y.s))&&(m.i>y.i?y=m:y=b,y&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=y.i),++p.pageCount)),m=b;for(var v=c-1,y=g,m=g,b=null;v>=-1;--v)b=w(u[v]),(!b||!C(m,b.s))&&y.i=S&&A.s<=S+a}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},e.type="legend.scroll",e}(ZMe);function dhr(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(n)})})}function hhr(t){Xr(XMe),t.registerComponentModel(uhr),t.registerComponentView(fhr),dhr(t)}function phr(t){Xr(XMe),Xr(hhr)}var ghr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=Sy(jE.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(jE),Hne=qn();function vhr(t,e,r){Hne(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function mhr(t,e){for(var r=Hne(t).coordSysRecordMap,n=r.keys(),i=0;in[r+e]&&(e=s),i=i&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function _hr(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var n=Hne(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=Gt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=NMe(a);te(o.infoList,function(s){var l=s.model.uid,c=i.get(l)||i.set(l,yhr(r,s.model)),u=c.dataZoomInfoMap||(c.dataZoomInfoMap=Gt());u.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var c=l.keys()[0];c!=null&&(s=l.get(c))}if(!s){JMe(i,a);return}var u=xhr(l);o.enable(u.controlType,u.opt),o.setPointerChecker(a.containsPoint),g9(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Shr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,i){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),vhr(i,r,{pan:Mt(bG.pan,this),zoom:Mt(bG.zoom,this),scrollMove:Mt(bG.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){mhr(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Nne),bG={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),o=t.axisModels[0];if(o){var s=xG[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],c=Math.max(1/n.scale,0);a[0]=(a[0]-l)*c+l,a[1]=(a[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(yx(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:rbe(function(t,e,r,n,i,a){var o=xG[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:rbe(function(t,e,r,n,i,a){var o=xG[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function rbe(t){return function(e,r,n,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,i);if(yx(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var xG={grid:function(t,e,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(t,e,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),c=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return t=t||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function eDe(t){One(t),t.registerComponentModel(ghr),t.registerComponentView(Shr),_hr(t)}var Chr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Sy(jE.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(jE),G4=In,nbe=7,Ahr=1,_G=30,Thr=7,W4="horizontal",ibe="vertical",Ehr=5,Ihr=["line","bar","candlestick","scatter"],khr={easing:"cubicOut",duration:100,delay:0},Phr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._displayables={},r}return e.prototype.init=function(r,n){this.api=n,this._onBrush=Mt(this._onBrush,this),this._onBrushEnd=Mt(this._onBrushEnd,this)},e.prototype.render=function(r,n,i,a){if(t.prototype.render.apply(this,arguments),g9(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){WXt(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new fr;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(n),this._positionGroup()},e.prototype._resetLocation=function(){var r=this.dataZoomModel,n=this.api,i=r.get("brushSelect"),a=i?Thr:0,o=this._findCoordRect(),s={width:n.getWidth(),height:n.getHeight()},l=this._orient===W4?{right:s.width-o.x-o.width,top:s.height-_G-nbe-a,width:o.width,height:_G}:{right:nbe,top:o.y,width:_G,height:o.height},c=JS(r.option);te(["right","top","width","height"],function(f){c[f]==="ph"&&(c[f]=l[f])});var u=Eo(c,s);this._location={x:u.x,y:u.y},this._size=[u.width,u.height],this._orient===ibe&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===W4&&!o?{scaleY:l?1:-1,scaleX:1}:i===W4&&o?{scaleY:l?1:-1,scaleX:-1}:i===ibe&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var c=r.getBoundingRect([s]);r.x=n.x-c.x,r.y=n.y-c.y,r.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var r=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=r.get("brushSelect");i.add(new G4({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new G4({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:Mt(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},e.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var n=this._size,i=r.series,a=i.getRawData(),o=i.getShadowDim?i.getShadowDim():r.otherDim;if(o==null)return;var s=a.getDataExtent(o),l=(s[1]-s[0])*.3;s=[s[0]-l,s[1]+l];var c=[0,n[1]],u=[0,n[0]],f=[[n[0],0],[0,0]],d=[],h=u[1]/(a.count()-1),p=0,g=Math.round(a.count()/n[0]),v;a.each([o],function(C,A){if(g>0&&A%g){p+=h;return}var S=C==null||isNaN(C)||C==="",I=S?0:oi(C,s,c,!0);S&&!v&&A?(f.push([f[f.length-1][0],0]),d.push([d[d.length-1][0],0])):!S&&v&&(f.push([p,0]),d.push([p,0])),f.push([p,I]),d.push([p,I]),p+=h,v=S});var y=this.dataZoomModel;function m(C){var A=y.getModel(C?"selectedDataBackground":"dataBackground"),S=new fr,I=new dl({shape:{points:f},segmentIgnoreThreshold:1,style:A.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),D=new Gc({shape:{points:d},segmentIgnoreThreshold:1,style:A.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return S.add(I),S.add(D),S}for(var b=0;b<3;b++){var w=m(b===1);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}},e.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,n=r.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();te(l,function(c){if(!i&&!(n!==!0&&en(Ihr,c.get("type"))<0)){var u=a.getComponent(e1(o),s).axis,f=Rhr(o),d,h=c.coordinateSystem;f!=null&&h.getOtherAxis&&(d=h.getOtherAxis(u).inverse),f=c.getData().mapDimension(f),i={thisAxis:u,series:c,thisDim:o,otherDim:f,otherAxisInverse:d}}},this)},this),i}},e.prototype._renderHandle=function(){var r=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,c=this.api,u=l.get("borderRadius")||0,f=l.get("brushSelect"),d=n.filler=new G4({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(d),o.add(new G4({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:u},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:Ahr,fill:"rgba(0,0,0,0)"}})),te([0,1],function(b){var w=l.get("handleIcon");!xO[w]&&w.indexOf("path://")<0&&w.indexOf("image://")<0&&(w="path://"+w);var C=bo(w,-1,0,2,2,null,!0);C.attr({cursor:abe(this._orient),draggable:!0,drift:Mt(this._onDragMove,this,b),ondragend:Mt(this._onDragEnd,this),onmouseover:Mt(this._showDataInfo,this,!0),onmouseout:Mt(this._showDataInfo,this,!1),z2:5});var A=C.getBoundingRect(),S=l.get("handleSize");this._handleHeight=xt(S,this._size[1]),this._handleWidth=A.width/A.height*this._handleHeight,C.setStyle(l.getModel("handleStyle").getItemStyle()),C.style.strokeNoScale=!0,C.rectHover=!0,C.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),Ri(C);var I=l.get("handleColor");I!=null&&(C.style.fill=I),o.add(i[b]=C);var D=l.getModel("textStyle");r.add(a[b]=new Bn({silent:!0,invisible:!0,style:Ja(D,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:D.getTextColor(),font:D.getFont()}),z2:10}))},this);var h=d;if(f){var p=xt(l.get("moveHandleSize"),s[1]),g=n.moveHandle=new In({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:p}}),v=p*.8,y=n.moveHandleIcon=bo(l.get("moveHandleIcon"),-v/2,-v/2,v,v,"#fff",!0);y.silent=!0,y.y=s[1]+p/2-.5,g.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(s[1]/2,Math.max(p,10));h=n.moveZone=new In({invisible:!0,shape:{y:s[1]-m,height:p+m}}),h.on("mouseover",function(){c.enterEmphasis(g)}).on("mouseout",function(){c.leaveEmphasis(g)}),o.add(g),o.add(y),o.add(h)}h.attr({draggable:!0,cursor:abe(this._orient),drift:Mt(this._onDragMove,this,"all"),ondragstart:Mt(this._showDataInfo,this,!0),ondragend:Mt(this._onDragEnd,this),onmouseover:Mt(this._showDataInfo,this,!0),onmouseout:Mt(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[oi(r[0],[0,100],n,!0),oi(r[1],[0,100],n,!0)]},e.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];yx(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?oi(s.minSpan,l,o,!0):null,s.maxSpan!=null?oi(s.maxSpan,l,o,!0):null);var c=this._range,u=this._range=Lf([oi(a[0],o,l,!0),oi(a[1],o,l,!0)]);return!c||c[0]!==u[0]||c[1]!==u[1]},e.prototype._updateView=function(r){var n=this._displayables,i=this._handleEnds,a=Lf(i.slice()),o=this._size;te([0,1],function(h){var p=n.handles[h],g=this._handleHeight;p.attr({scaleX:g/2,scaleY:g/2,x:i[h]+(h?-1:1),y:o[1]/2-g/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,c=[0,a[0],a[1],o[0]],u=0;un[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(r){var n=r.offsetX,i=r.offsetY;this._brushStart=new Mr(n,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(r){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Lf([oi(i.x,o,s,!0),oi(i.x+i.width,o,s,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(fv(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new G4({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,c=l.transformCoordToLocal(r,n),u=l.transformCoordToLocal(s.x,s.y),f=this._size;c[0]=Math.max(Math.min(f[0],c[0]),0),o.setShape({x:u[0],y:0,width:c[0]-u[0],height:f[1]})},e.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?khr:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=NMe(this.dataZoomModel).infoList;if(!r&&n.length){var i=n[0].model.coordinateSystem;r=i.getRect&&i.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},e.type="dataZoom.slider",e}(Nne);function Rhr(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function abe(t){return t==="vertical"?"ns-resize":"ew-resize"}function tDe(t){t.registerComponentModel(Chr),t.registerComponentView(Phr),One(t)}function Mhr(t){Xr(eDe),Xr(tDe)}var rDe={get:function(t,e,r){var n=ur((Dhr[t]||{})[e]);return r&<(n)?n[n.length-1]:n}},Dhr={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},obe=Uo.mapVisual,Nhr=Uo.eachVisual,Ohr=lt,sbe=te,Lhr=Lf,$hr=oi,GO=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return e.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i)},e.prototype.optionUpdated=function(r,n){var i=this.option;Ar.canvasSupported||(i.realtime=!1),!n&&GMe(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var n=this.stateList;r=Mt(r,this),this.controllerVisuals=eQ(this.option.controller,n,r),this.targetVisuals=eQ(this.option.target,n,r)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var r=this.option.seriesIndex,n=[];return r==null||r==="all"?this.ecModel.eachSeries(function(i,a){n.push(a)}):n=di(r),n},e.prototype.eachTargetSeries=function(r,n){te(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&r.call(n,a)},this)},e.prototype.isTargetSeries=function(r){var n=!1;return this.eachTargetSeries(function(i){i===r&&(n=!0)}),n},e.prototype.formatValueText=function(r,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,c;i=i||["<",">"],lt(r)&&(r=r.slice(),c=!0);var u=n?r:c?[f(r[0]),f(r[1])]:f(r);if(En(l))return l.replace("{value}",c?u[0]:u).replace("{value2}",c?u[1]:u);if(si(l))return c?l(r[0],r[1]):l(r);if(c)return r[0]===s[0]?i[0]+" "+u[1]:r[1]===s[1]?i[1]+" "+u[0]:u[0]+" - "+u[1];return u;function f(d){return d===s[0]?"min":d===s[1]?"max":(+d).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var r=this.option,n=Lhr([r.min,r.max]);this._dataExtent=n},e.prototype.getDataDimensionIndex=function(r){var n=this.option.dimension;if(n!=null)return r.getDimensionIndex(n);for(var i=r.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=r.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var r=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});$r(a,i),$r(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),c.call(this,a,"inRange","outOfRange"),u.call(this,o);function l(f){Ohr(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:r.get("gradientColor")}}function c(f,d,h){var p=f[d],g=f[h];p&&!g&&(g=f[h]={},sbe(p,function(v,y){if(Uo.isValidType(y)){var m=rDe.get(y,"inactive",s);m!=null&&(g[y]=m,y==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function u(f){var d=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,h=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,p=this.get("inactiveColor"),g=this.getItemSymbol(),v=g||"roundRect";sbe(this.stateList,function(y){var m=this.itemSize,b=f[y];b||(b=f[y]={color:s?p:[p]}),b.symbol==null&&(b.symbol=d&&ur(d)||(s?v:[v])),b.symbolSize==null&&(b.symbolSize=h&&ur(h)||(s?m[0]:[m[0],m[0]])),b.symbol=obe(b.symbol,function(A){return A==="none"?v:A});var w=b.symbolSize;if(w!=null){var C=-1/0;Nhr(w,function(A){A>C&&(C=A)}),b.symbolSize=obe(w,function(A){return $hr(A,[0,C],[0,m[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(r){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(r){return null},e.prototype.getVisualMeta=function(r){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(fn),lbe=[20,140],Bhr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(r,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=lbe[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=lbe[1])},e.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):lt(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],r[0]),n[1]=Math.min(n[1],r[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),te(this.stateList,function(r){var n=this.option.controller[r].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},e.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},e.prototype.getSelected=function(){var r=this.getExtent(),n=Lf((this.get("range")||[]).slice());return n[0]>r[1]&&(n[0]=r[1]),n[1]>r[1]&&(n[1]=r[1]),n[0]=i[1]||r<=n[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(r){var n=cbe(this,"outOfRange",this.getExtent()),i=cbe(this,"inRange",this.option.range.slice()),a=[];function o(h,p){a.push({value:h,color:r(h,p)})}for(var s=0,l=0,c=i.length,u=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(r[1],"color",n),offset:1}),a},e.prototype._createBarPoints=function(r,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],r[0]],[i[0],r[0]],[i[0],r[1]],[i[0]-n[1],r[1]]]},e.prototype._createBarGroup=function(r){var n=this._orient,i=this.visualMapModel.get("inverse");return new fr(n==="horizontal"&&!i?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},e.prototype._updateHandle=function(r,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,c=a.getExtent();Fhr([0,1],function(u){var f=o[u];f.setStyle("fill",n.handlesColor[u]),f.y=r[u];var d=np(r[u],[0,l[1]],c,!0),h=this.getControllerVisual(d,"symbolSize");f.scaleX=f.scaleY=h/l[0],f.x=l[0]-h/2;var p=lh(i.handleLabelPoints[u],Sb(f,this.group));s[u].setStyle({x:p[0],y:p[1],text:a.formatValueText(this._dataInterval[u]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(r,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,c=[0,l[1]],u=this._shapes,f=u.indicator;if(f){f.attr("invisible",!1);var d={convertOpacityToAlpha:!0},h=this.getControllerVisual(r,"color",d),p=this.getControllerVisual(r,"symbolSize"),g=np(r,s,c,!0),v=l[0]-p/2,y={x:f.x,y:f.y};f.y=g,f.x=v;var m=lh(u.indicatorLabelPoint,Sb(f,this.group)),b=u.indicatorLabel;b.attr("invisible",!1);var w=this._applyTransform("left",u.mainGroup),C=this._orient,A=C==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:A?w:"middle",align:A?"center":w});var S={x:v,y:g,style:{fill:h}},I={style:{x:m[0],y:m[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var D={duration:100,easing:"cubicInOut",additive:!0};f.x=y.x,f.y=y.y,f.animateTo(S,D),b.animateTo(I,D)}else f.attr(S),b.attr(I);this._firstShowIndicator=!1;var L=this._shapes.handleLabels;if(L)for(var O=0;Oo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(u,f[1],"< ",l):f[1]===1/0?this._showIndicator(u,f[0],"> ",l):this._showIndicator(u,u,"≈ ",l));var d=this._hoverLinkDataIndices,h=[];(n||hbe(i))&&(h=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var p=lKt(d,h);this._dispatchHighDown("downplay",CM(p[0],i)),this._dispatchHighDown("highlight",CM(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n=r.target,i=this.visualMapModel;if(!(!n||br(n).dataIndex==null)){var a=br(n),o=this.ecModel.getSeriesByIndex(a.seriesIndex);if(i.isTargetSeries(o)){var s=o.getData(a.dataType),l=s.getStore().get(i.getDataDimensionIndex(s),a.dataIndex);isNaN(l)||this._showIndicator(l,l)}}},e.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),t.getData().setVisual("visualMeta",n)}}];function qhr(t,e,r,n){for(var i=e.targetVisuals[n],a=Uo.prepareVisualTypes(i),o={color:v9(t.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(Vhr,Ghr),te(Whr,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(Yhr))}function oDe(t){t.registerComponentModel(Bhr),t.registerComponentView(zhr),aDe(t)}var Khr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._pieceList=[],r}return e.prototype.optionUpdated=function(r,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],Zhr[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=ur(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=ft(this._pieceList,function(l){return l=ur(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,n={},i=Uo.listVisualTypes(),a=this.isCategory();te(r.pieces,function(s){te(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),te(n,function(s,l){var c=!1;te(this.stateList,function(u){c=c||o(r,u,l)||o(r.target,u,l)},this),!c&&te(this.stateList,function(u){(r[u]||(r[u]={}))[l]=rDe.get(l,u==="inRange"?"active":"inactive",a)})},this);function o(s,l,c){return s&&s[l]&&s[l].hasOwnProperty(c)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,te(a,function(l,c){var u=this.getSelectedMapKey(l);o.hasOwnProperty(u)||(o[u]=!0)},this),i.selectedMode==="single"){var s=!1;te(a,function(l,c){var u=this.getSelectedMapKey(l);o[u]&&(s?o[u]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(r){this.option.selected=ur(r)},e.prototype.getValueState=function(r){var n=Uo.findPieceIndex(r,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,c){var u=Uo.findPieceIndex(l,i);u===r&&o.push(c)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},e.prototype.getRepresentValue=function(r){var n;if(this.isCategory())n=r.value;else if(r.value!=null)n=r.value;else{var i=r.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},e.prototype.getVisualMeta=function(r){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(u,f){var d=a.getRepresentValue({interval:u});f||(f=a.getValueState(d));var h=r(d,f);u[0]===-1/0?i[0]=h:u[1]===1/0?i[1]=h:n.push({value:u[0],color:h},{value:u[1],color:h})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var c=-1/0;return te(s,function(u){var f=u.interval;f&&(f[0]>c&&o([c,f[0]],"outOfRange"),o(f.slice()),c=f[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=Sy(GO.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(GO),Zhr={splitNumber:function(t){var e=this.option,r=Math.min(e.precision,20),n=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(r)!==a&&r<5;)r++;e.precision=r,a=+a.toFixed(r),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function mbe(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var Qhr=function(t){Ge(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.doRender=function(){var r=this.group;r.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),c=n.itemSize,u=this._getViewData(),f=u.endsText,d=as(n.get("showLabel",!0),!f);f&&this._renderEndsText(r,f[0],c,d,l),te(u.viewPieceList,function(h){var p=h.piece,g=new fr;g.onclick=Mt(this._onItemClick,this,p),this._enableHoverLink(g,h.indexInModelPieceList);var v=n.getRepresentValue(p);if(this._createItemSymbol(g,v,[0,0,c[0],c[1]]),d){var y=this.visualMapModel.getValueState(v);g.add(new Bn({style:{x:l==="right"?-i:c[0]+i,y:c[1]/2,text:p.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:y==="outOfRange"?.5:1}}))}r.add(g)},this),f&&this._renderEndsText(r,f[1],c,d,l),Cb(n.get("orient"),r,n.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},e.prototype._enableHoverLink=function(r,n){var i=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:CM(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return iDe(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new fr,l=this.visualMapModel.textStyleModel;s.add(new Bn({style:{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n,font:l.getFont(),fill:l.getTextColor()}})),r.add(s)}},e.prototype._getViewData=function(){var r=this.visualMapModel,n=ft(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(r,n,i){r.add(bo(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color")))},e.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=ur(i.selected),o=n.getSelectedMapKey(r);i.selectedMode==="single"?(a[o]=!0,te(a,function(s,l){a[l]=l===o})):a[o]=!a[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:a})},e.type="visualMap.piecewise",e}(nDe);function sDe(t){t.registerComponentModel(Khr),t.registerComponentView(Qhr),aDe(t)}function Xhr(t){Xr(oDe),Xr(sDe)}var Jhr={label:{enabled:!0},decal:{show:!1}},ybe=qn(),epr={};function tpr(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=ur(Jhr);$r(n.label,t.getLocaleModel().get("aria"),!1),$r(r.option,n,!1),i(),a();function i(){var c=r.getModel("decal"),u=c.get("show");if(u){var f=Gt();t.eachSeries(function(d){if(!d.isColorBySeries()){var h=f.get(d.type);h||(h={},f.set(d.type,h)),ybe(d).scope=h}}),t.eachRawSeries(function(d){if(t.isSeriesFiltered(d))return;if(typeof d.enableAriaDecal=="function"){d.enableAriaDecal();return}var h=d.getData();if(d.isColorBySeries()){var m=pZ(d.ecModel,d.name,epr,t.getSeriesCount()),b=h.getVisual("decal");h.setVisual("decal",w(b,m))}else{var p=d.getRawData(),g={},v=ybe(d).scope;h.each(function(C){var A=h.getRawIndex(C);g[A]=C});var y=p.count();p.each(function(C){var A=g[C],S=p.getName(C)||C+"",I=pZ(d.ecModel,S,v,y),D=h.getItemVisual(A,"decal");h.setItemVisual(A,"decal",w(D,I))})}function w(C,A){var S=C?st(st({},A),C):A;return S.dirty=!0,S}})}}function a(){var c=t.getLocaleModel().get("aria"),u=r.getModel("label");if(u.option=tr(u.option,c),!!u.get("enabled")){var f=e.getZr().dom;if(u.get("description")){f.setAttribute("aria-label",u.get("description"));return}var d=t.getSeriesCount(),h=u.get(["data","maxCount"])||10,p=u.get(["series","maxCount"])||10,g=Math.min(d,p),v;if(!(d<1)){var y=s();if(y){var m=u.get(["general","withTitle"]);v=o(m,{title:y})}else v=u.get(["general","withoutTitle"]);var b=[],w=d>1?u.get(["series","multiple","prefix"]):u.get(["series","single","prefix"]);v+=o(w,{seriesCount:d}),t.eachSeries(function(I,D){if(D1?u.get(["series","multiple",P]):u.get(["series","single",P]),L=o(L,{seriesId:I.seriesIndex,seriesName:I.get("name"),seriesType:l(I.subType)});var x=I.getData();if(x.count()>h){var T=u.get(["data","partialData"]);L+=o(T,{displayCnt:h})}else L+=u.get(["data","allData"]);for(var E=u.get(["data","separator","middle"]),N=u.get(["data","separator","end"]),F=[],B=0;B":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},ipr=function(){function t(e){var r=this._condVal=En(e)?new RegExp(e):Vqt(e)?e:null;if(r==null){var n="";Xn(n)}}return t.prototype.evaluate=function(e){var r=typeof e;return r==="string"?this._condVal.test(e):r==="number"?this._condVal.test(e+""):!1},t}(),apr=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),opr=function(){function t(){}return t.prototype.evaluate=function(){for(var e=this.children,r=0;r2&&n.push(i),i=[x,T]}function u(x,T,E,N){n3(x,E)&&n3(T,N)||i.push(x,T,E,N,E,N)}function f(x,T,E,N,F,B){var j=Math.abs(T-x),k=Math.tan(j/4)*4/3,$=TI:O2&&n.push(i),n}function sQ(t,e,r,n,i,a,o,s,l,c){if(n3(t,r)&&n3(e,n)&&n3(i,o)&&n3(a,s)){l.push(o,s);return}var u=2/c,f=u*u,d=o-t,h=s-e,p=Math.sqrt(d*d+h*h);d/=p,h/=p;var g=r-t,v=n-e,y=i-o,m=a-s,b=g*g+v*v,w=y*y+m*m;if(b=0&&I=0){l.push(o,s);return}var D=[],L=[];q1(t,r,i,o,.5,D),q1(e,n,a,s,.5,L),sQ(D[0],L[0],D[1],L[1],D[2],L[2],D[3],L[3],l,c),sQ(D[4],L[4],D[5],L[5],D[6],L[6],D[7],L[7],l,c)}function bpr(t,e){var r=oQ(t),n=[];e=e||1;for(var i=0;i0)for(var c=0;cMath.abs(c),f=cDe([l,c],u?0:1,e),d=(u?s:c)/f.length,h=0;hi,o=cDe([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",c=a?"x":"y",u=a?"y":"x",f=t[s]/o.length,d=0;d1?null:new Mr(g*l+t,g*c+e)}function Spr(t,e,r){var n=new Mr;Mr.sub(n,r,e),n.normalize();var i=new Mr;Mr.sub(i,t,e);var a=i.dot(n);return a}function g_(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function Cpr(t,e,r){for(var n=t.length,i=[],a=0;ao?(c.x=u.x=s+a/2,c.y=l,u.y=l+o):(c.y=u.y=l+o/2,c.x=s,u.x=s+a),Cpr(e,c,u)}function WO(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);WO(t,a[0],i,n),WO(t,a[1],r-i,n)}return n}function Apr(t,e){for(var r=[],n=0;n0;c/=2){var u=0,f=0;(t&c)>0&&(u=1),(e&c)>0&&(f=1),s+=c*c*(3*u^f),f===0&&(u===1&&(t=c-1-t,e=c-1-e),l=t,t=e,e=l)}return s}function KO(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=ft(t,function(s){var l=s.getBoundingRect(),c=s.getComputedTransform(),u=l.x+l.width/2+(c?c[4]:0),f=l.y+l.height/2+(c?c[5]:0);return e=Math.min(u,e),r=Math.min(f,r),n=Math.max(u,n),i=Math.max(f,i),[u,f]}),o=ft(a,function(s,l){return{cp:s,z:Npr(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function dDe(t){return Ipr(t.path,t.count)}function lQ(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Opr(t,e,r){var n=[];function i(C){for(var A=0;A=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,c=Math.ceil(a/2);r[i].many=l.slice(c,a),r[s].many=l.slice(0,c),s++}return r}var $pr={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),c,u;Ebe(t)&&(c=t,u=e),Ebe(e)&&(c=e,u=t);function f(y,m,b,w,C){var A=y.many,S=y.one;if(A.length===1&&!C){var I=m?A[0]:S,D=m?S:A[0];if(qO(I))f({many:[I],one:D},!0,b,w,!0);else{var L=s?tr({delay:s(b,w)},l):l;Gne(I,D,L),a(I,D,I,D,L)}}else for(var O=tr({dividePath:$pr[r],individualDelay:s&&function(F,B,j,k){return s(F+b,w)}},l),P=m?Opr(A,S,O):Lpr(S,A,O),x=P.fromIndividuals,T=P.toIndividuals,E=x.length,N=0;Ne.length,h=c?Ibe(u,c):Ibe(d?e:t,[d?t:e]),p=0,g=0;ghDe))for(var i=n.getIndices(),a=Fpr(n),o=0;o0&&w.group.traverse(function(A){A instanceof rn&&!A.animators.length&&A.animateFrom({style:{opacity:0}},C)})})}function Pbe(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Rbe(t){return lt(t)?t.sort().join(","):t}function xm(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function zpr(t,e){var r=Gt(),n=Gt(),i=Gt();return te(t.oldSeries,function(a,o){var s=t.oldData[o],l=Pbe(a),c=Rbe(l);n.set(c,s),lt(l)&&te(l,function(u){i.set(u,{data:s,key:c})})}),te(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.getData(),s=Pbe(a),l=Rbe(s),c=n.get(l);if(c)r.set(l,{oldSeries:[{divide:xm(c),data:c}],newSeries:[{divide:xm(o),data:o}]});else if(lt(s)){var u=[];te(s,function(h){var p=n.get(h);p&&u.push({divide:xm(p),data:p})}),u.length&&r.set(l,{oldSeries:u,newSeries:[{data:o,divide:xm(o)}]})}else{var f=i.get(s);if(f){var d=r.get(f.key);d||(d={oldSeries:[{data:f.data,divide:xm(f.data)}],newSeries:[]},r.set(f.key,d)),d.newSeries.push({data:o,divide:xm(o)})}}}}),r}function Mbe(t,e){for(var r=0;r=0&&i.push({data:e.oldData[s],divide:xm(e.oldData[s]),dim:o.dimension})}),te(di(t.to),function(o){var s=Mbe(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({data:l,divide:xm(l),dim:o.dimension})}}),i.length>0&&a.length>0&&pDe(i,a,n)}function Vpr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){te(di(n.seriesTransition),function(i){te(di(i.to),function(a){for(var o=n.updatedSeries,s=0;s{const[t,e]=Z.useState(null),[r,n]=Z.useState(!0),i=Z.useRef(null),{topCount:a}=Ki(),{getTopValidators:o,topValidatorsLoading:s,topValidators:l}=js(),c=_i(),{matches:u}=Qr(_t.down("md")),{matches:f}=Qr(_t.between("sm","md")),{matches:d}=Qr(_t.between("md","lg")),{matches:h}=Qr(_t.up("lg")),{matches:p}=Qr(_t.up("xl")),g=l.length;return Z.useEffect(()=>{if(r)o({page:1,count:a}),n(!1);else if(g>0){let v=ws(i.current);v||(v=Us(i.current)),window.allCharts.push(v),e(v);const m=(()=>{const b=[];return l.forEach(({votingPower:w,moniker:C,addressId:A})=>{const S=Rr(C||A,20),I=w==null?void 0:w.count;b.push({value:I,name:S})}),{color:[c.CHART_PIE_A,c.CHART_PIE_B,c.CHART_PIE_C,c.CHART_PIE_D,c.CHART_PIE_E,c.CHART_PIE_F,c.CHART_PIE_G,c.CHART_PIE_H,c.CHART_PIE_I,c.CHART_PIE_J],tooltip:{trigger:"item",position:["10%"],formatter:({data:w,percent:C})=>{const{name:A,value:S}=w;return`${A}
Voting Power: ${Qn(S)} (${C}%)`}},legend:{type:h?"plain":"scroll",orient:h?"vertical":"horizontal",right:h?p?"15%":"6%":"2%",top:h?"6%":"2%",itemGap:h?10:30,textStyle:{color:c.FONT_PRIMARY}},series:[{center:h?["30%","50%"]:["50%","60%"],radius:h?p?"90%":"60%":"70%",type:"pie",data:b,label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}})();t&&t.setOption(m),t&&t.setOption(m),window.addEventListener("resize",()=>{t&&t.resize()})}return window.removeEventListener("resize",()=>t&&t.resize())},[e,t,o,l,r,a,u,f,d,h,p,c,g]),M.jsx(ln,{alignItems:"flex-start",alignContent:"flex-start",size:f||u?"100%":"50%",icon:"PARTICIPATION",title:g>0?`Top ${g} Validators`:"Top Validators",link:{to:"/validators",title:"View All"},children:s?M.jsx(Br,{}):g>0?M.jsx(Gpr,{ref:i}):M.jsx("div",{children:"No validators available"})})},qpr=se.div` - margin-top: 22px; - flex-basis: 100%; -`,Ypr=se.div` - flex-basis: 100%; - border-top: 1px solid ${({theme:t})=>t.BORDER_PRIMARY}; -`,Dbe=se.div` - margin: 10px 0; - display: flex; - align-items: flex-start; - justify-content: space-between; -`,Kpr=()=>{const[t,e]=Z.useState(!1),{getBlocksRecent:r,blocks:n,recentBlocksCount:i,blocksRecentLoading:a}=wy(),{matches:o}=Qr(_t.down("md")),s=n.length;sx(()=>!a&&r({count:i}),iS.recentBlocks),Z.useEffect(()=>{e(!0),r({count:i}).then(()=>e(!1)).catch(()=>e(!1))},[r,e,i]);const l=()=>n.map(({txNum:c,height:u,time:f})=>{const d=f?Wi(f):"--";return M.jsxs(Ypr,{children:[M.jsxs(Dbe,{children:[M.jsx(Wo,{to:`/block/${u}`,children:u}),M.jsx(Z8,{timestamp:d})]}),M.jsxs(Dbe,{children:[M.jsxs("div",{children:["Transactions: ",c]}),M.jsxs("div",{children:[d,"+UTC"]})]})]},u)});return M.jsx(ln,{alignSelf:"flex-start",size:o?"100%":"50%",icon:"APPS",title:s>0?`${s} Most Recent Blocks`:"Most Recent Blocks",link:{to:"/blocks",title:"View All"},children:t?M.jsx(Br,{}):s>0?M.jsx(qpr,{children:l()}):M.jsx("div",{children:"No recent blocks available"})})},Zpr=se.div` - margin-top: 22px; - flex-basis: 100%; -`,Qpr=se.div` - flex-basis: 100%; - border-top: 1px solid ${({theme:t})=>t.BORDER_PRIMARY}; -`,Nbe=se.div` - margin: 10px 0; - display: flex; - align-items: flex-start; - justify-content: space-between; -`,Xpr=se.div` - text-transform: capitalize; - @media ${_t.down("sm")} { - font-size: 1.2rem; - max-width: 50%; - } -`,Jpr=se.div` - @media ${_t.down("sm")} { - font-size: 1.2rem; - } -`,e0r=se.div` - display: inline-block; - @media ${_t.down("sm")} { - font-size: 1rem; - } -`,t0r=()=>{const[t,e]=Z.useState(!1),{txs:r,getTxsRecent:n,recentTxsCount:i,txsRecentLoading:a}=$u(),{matches:o}=Qr(_t.down("md")),s=r.length;sx(()=>!a&&n({count:i}),iS.recentTxs),Z.useEffect(()=>{e(!0),n({count:i}).then(()=>e(!1)).catch(()=>e(!1))},[n,i]);const l=()=>r.map(({txHash:c,fee:u,block:f,msg:{displayMsgType:d="--"},denomination:h="--",time:p},g)=>{const{amount:v,denom:y}=u,m=p?Wi(p):"--",b=o?10:16,w=zt(v,y);return M.jsxs(Qpr,{children:[M.jsxs(Nbe,{title:c,children:[M.jsxs("div",{children:["TX# ",M.jsx(Wo,{to:`/tx/${c}/${f}`,children:Rr(c,b)})]}),M.jsx(Z8,{timestamp:m})]}),M.jsxs(Nbe,{children:[M.jsx(Xpr,{children:Kr(d)}),M.jsxs(Jpr,{children:[M.jsx(e0r,{children:"Fee:"})," ",w]})]})]},`${c}_${g}`)});return M.jsx(ln,{size:o?"100%":"50%",alignItems:"flex-start",alignSelf:"flex-start",icon:"SETTINGS",title:s>0?`${s} Most Recent Transactions`:"Most Recent Transactions",link:{to:"/txs",title:"View All"},children:t?M.jsx(Br,{}):s>0?M.jsx(Zpr,{children:l()}):M.jsx("div",{children:"No recent transactions available"})})},r0r=se.div` - height: 300px; - width: 100%; -`,n0r=se.div` - width: 100%; - margin-top: 20px; -`,Qs={color:"",grid:{bottom:0},dataZoom:[{type:"",startValue:"",endValue:""},{startValue:"",endValue:""}],tooltip:{axisPointer:{lineStyle:{color:"",width:"1"}},position:[""],show:!0,trigger:"axis",formatter:t=>""},toolbox:{feature:{dataZoom:{yAxisIndex:"none"},restore:{},saveAsImage:{}}},xAxis:{data:[],type:"time",boundaryGap:!1,axisLabel:{formatter:"{MMM}-{dd}",color:"",rotate:0}},yAxis:{type:"value",name:"Price (USD)",boundaryGap:!1,offset:0,axisTick:{show:!0},axisLabel:{rotate:0,color:""},splitLine:{show:!1},axisLine:{lineStyle:{color:""}},max:t=>0,min:t=>""},series:[{data:[],name:"Hash Price ($USD)",type:"line",smooth:!0,symbol:"none",areaStyle:{color:new Nh(0,0,0,1,[{offset:0,color:""},{offset:1,color:""}])}}]},Obe=(t,e)=>{let r=e[e.length-1].time_close;for(let n=e.length-1;n>=0;n--)if(t===e[n].time_close.slice(0,10)){r=e[n].time_close;break}return r},i0r=({startDate:t,endDate:e,data:r})=>{const[n,i]=Z.useState(null),a=Z.useRef(null),o=_i(),{matches:s}=Qr(_t.down("sm")),{matches:l}=Qr(_t.down("lg")),c=r.length,u=Z.useCallback((f,d,h)=>{const p=f.map(g=>{const v=sn(nl(g.time_close),"yyyy-MM-dd"),y=parseFloat(g.quote.USD.close.toFixed(3)),m=parseFloat(g.quote.USD.high.toFixed(3)),b=parseFloat(g.quote.USD.low.toFixed(3));return[v,y,m,b,g.quote.USD.volume]});Qs.grid={bottom:l?90:75},Qs.tooltip.axisPointer={lineStyle:{color:o.CHART_LINE_MAIN,width:"1"}},Qs.tooltip.position=s?["10%","70%"]:[""],Qs.tooltip.formatter=g=>{const v=`Date: ${g[0].value[0].slice(0,10)}`;let y="";return g.forEach(m=>{const b=`$${m.value[2]}`,w=`$${m.value[3]}`,C=`${m.value[4]}`;y+=` - - ${b} - ${w} - $${C} - `}),` - -
-
${v}
-
Price: ${g[0].value[1]}
-
- - - - - - - ${y} - -
HighLowVolume
`},Qs.xAxis.axisLabel.color=o.FONT_PRIMARY,Qs.xAxis.axisLabel.rotate=l?45:0,Qs.yAxis.offset=s?-14:0,Qs.yAxis.axisLabel={rotate:l?45:0,color:o.FONT_PRIMARY},Qs.dataZoom=[{type:"inside",startValue:Obe(d,f),endValue:h},{startValue:Obe(d,f),endValue:h}],Qs.yAxis.axisLine.lineStyle.color=o.FONT_PRIMARY,Qs.yAxis.max=g=>g.max,Qs.yAxis.min=g=>g.min,Qs.color=o.CHART_LINE_MAIN,Qs.series[0].data=p,Qs.series[0].areaStyle={color:new Nh(0,0,0,1,[{offset:0,color:o.CHART_LINE_GRADIENT_START},{offset:1,color:o.CHART_LINE_GRADIENT_END}])}},[o,l,s]);return Z.useEffect(()=>{let f;return a.current&&(f=ws(a.current)||Us(a.current)),u(r,t,e),f==null||f.setOption(Qs),window.addEventListener("resize",()=>{f&&f.resize()}),window.removeEventListener("resize",()=>f&&f.resize())},[i,n,t,e,r,u]),c>0?M.jsx(r0r,{ref:a}):M.jsx(n0r,{children:"No pricing history available"})},a0r=se.div` - position: relative; -`,o0r=se.div` - position: relative; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,gDe=()=>{var N,F,B,j,k,$;const t=new Date,e="yyyy-MM-dd",{getHistoricalPricing:r,historicalPricing:n,historicalPricingLoading:i,getCurrentPricing:a,currentPricing:o,currentPricingLoading:s}=wte(),l=n.length>0,c=sn(lu(t,13),e),u=sn(t,e),f=l&&new Date(n[0].time_close.slice(0,10).replace(/-/,"/"));let d={};!s&&o.last_updated&&(d={quote:{USD:{close:(N=o.quote.USD)==null?void 0:N.price,high:(F=o.quote.USD)==null?void 0:F.price,low:(B=o.quote.USD)==null?void 0:B.price,market_cap:(j=o.quote.USD)==null?void 0:j.market_cap,open:(k=o.quote.USD)==null?void 0:k.price,timestamp:new Date(o.last_updated).toISOString(),volume:($=o.quote.USD)==null?void 0:$.volume_24h.toFixed(2)}},time_close:new Date(o.last_updated).toISOString(),time_high:new Date(o.last_updated).toISOString(),time_low:new Date(o.last_updated).toISOString(),time_open:new Date(o.last_updated).toISOString()});const h=JSON.parse(JSON.stringify(n));l&&!s&&h.push(d);const[p,g]=Z.useState(u),[v,y]=Z.useState(c),[m,b]=Z.useState(u),[w,C]=Z.useState(c),[A,S]=Z.useState(""),I=(Number(new Date(m))-Number(new Date(w)))/(1e3*60*60*24)+1,D=m.replace(/-/g,"/"),L=w.replace(/-/g,"/"),O=new Date(D),P=new Date(L);Z.useEffect(()=>{r({startTime:"",endTime:""}),a()},[r,a]);const x=()=>{const H=new Date(m.replace(/-/g,"/")),Y=new Date(w.replace(/-/g,"/"));return H<=Y?(S('Filter Error: "To" date must be greater than "From" date.'),!1):lu(H,7)(S(""),x()?(y(w),g(m),!0):!1),E=[{title:"From:",type:"datepicker",options:{placeholderText:"Select From Date",onChange:H=>H&&C(sn(H,e)),selected:P,dateFormat:e,minDate:l?f:P,maxDate:lu(O,1)},action:C},{title:"To:",type:"datepicker",options:{placeholderText:"Select To Date",onChange:H=>H&&b(sn(H,e)),selected:O,dateFormat:e,minDate:l?lu(f,-1):P,maxDate:t},action:b}];return M.jsx(ln,{alignItems:"flex-start",alignContent:"flex-start",icon:"HASH",title:A?"Hash Price History":`${I}-Day Hash Price History`,children:l&&!i&&!s?M.jsxs(M.Fragment,{children:[M.jsxs(a0r,{children:[A&&M.jsx(o0r,{children:A}),M.jsx(Kl,{filterData:E,mustApply:{title:"Apply",action:T},flush:!0})]}),M.jsx(i0r,{startDate:p,endDate:v,data:h})]}):M.jsx(Br,{})})},s0r=se.p` - margin: 0; - padding: 0; - margin-top: 5px; -`,l0r=se.span` - color: ${({color:t})=>t}; - font-weight: bold; -`,vDe=()=>{var d,h,p,g;const{getCurrentPricing:t,currentPricing:e,historicalPricingLoading:r,currentPricingLoading:n,historicalPricingFailed:i,currentPricingFailed:a}=wte(),o=_i(),{matches:s}=Qr(_t.down("sm"));Z.useEffect(()=>{t()},[t]),sx(()=>t(),iS.latestPrice,a);const l=((d=e.quote.USD)==null?void 0:d.price)||0,c=((h=e.quote.USD)==null?void 0:h.percent_change_24h)||0,u=(p=e.quote.USD)==null?void 0:p.volume_24h,f=(g=e.quote.USD)==null?void 0:g.market_cap_by_total_supply;return M.jsxs(ln,{justify:"center",alignItems:"flex-start",icon:"HASH",title:"Hash Value",size:s?"100%":"40%",children:[n&&r&&!e.last_updated&&!c&&M.jsx(Br,{}),a&&i&&M.jsx("div",{children:"Hash data failed to load, refresh page to try again"}),!n&&!a?M.jsxs(M.Fragment,{children:[M.jsx(bp,{icon:"PRICE",title:"Latest Price (USD)",width:"100%",children:M.jsxs(M.Fragment,{children:[`$${zt(l,"",{minimumFractionDigits:3})} `,M.jsxs(s0r,{children:["24 hour change:"," ",M.jsxs(l0r,{color:c>=0?o.POSITIVE_CHANGE:o.NEGATIVE_CHANGE,children:[c?c.toFixed(1):0,"%"]})]})]})}),M.jsx(bp,{icon:"LINE_CHART",title:"Hash Market Cap",width:"100%",children:`$${zt(Number(f),"USD",{shorthand:!0,decimal:2})}`}),M.jsx(bp,{icon:"CALENDAR",title:"24hr Volume (USD)",width:"100%",children:`$${zt(Number(u),"",{shorthand:!0,decimal:2})}`})]}):M.jsx(Br,{})]})},c0r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],u0r=se.div` - height: 300px; - width: 100%; -`,f0r=se.div` - width: 100%; - margin: 10px 0; -`,Sa={color:[""],title:{text:"",top:-5,left:"5%",textStyle:{color:"",fontWeight:"normal"}},tooltip:{show:!0,trigger:"axis",axisPointer:{lineStyle:{color:"",width:"1"}},formatter:([])=>""},grid:{right:"15%",left:"15%"},legend:{data:["Transactions","Fees"],textStyle:{},itemGap:20,padding:0},xAxis:[{type:"category",boundaryGap:!1,data:{},axisLabel:{rotate:45,color:""}}],yAxis:[{type:"value",name:"Transactions",alignTicks:!0,position:"left",offset:0,axisLabel:{rotate:0,color:""},nameTextStyle:{align:"left"},axisLine:{show:!0,lineStyle:{color:""}},splitLine:{lineStyle:{color:""}}},{type:"value",name:"Fees (USD)",axisTick:{inside:!0,show:!0},position:"right",offset:0,axisLine:{show:!0,lineStyle:{color:""}},axisLabel:{rotate:0,color:""},nameTextStyle:{align:"right"},splitLine:{show:!1,lineStyle:{color:""}}}],series:[{name:"Transactions",type:"line",smooth:!0,data:{},areaStyle:{color:new Nh(0,0,0,1,[{offset:0,color:""},{offset:1,color:""}])}},{name:"Fees",type:"line",showSymbol:!1,smooth:!0,data:{},areaStyle:{color:"none"},yAxisIndex:1}]},mDe=({txHistoryGran:t,data:e,span:r,today:n,showDayOfWeek:i=!1,title:a="",grid:o,legendPadding:s=20})=>{const[l,c]=Z.useState(null),u=Z.useRef(null),f=_i(),{matches:d}=Qr(_t.down("sm")),{matches:h}=Qr(_t.down("lg")),p=t==="DAY",g=t==="MONTH",{getCurrentPricing:v,currentPricing:y}=wte();Z.useEffect(()=>{v()},[v]);const m=e&&e.length,b=Z.useCallback(()=>{const w=[],C=[],A=[];let S=[];if(t==="DAY"){if(m-1!==r){for(let D=Number(r);D>=0;D--)A.push({date:new Date(sn(lu(n,D),"yyyy-MM-dd")).getTime(),feepayer:null,txCount:0,feeAmountInBaseToken:0,gasWanted:0,gasUsed:0,feeAmountInToken:0,feesPaidInUsd:0,maxTokenPriceUsd:0,minTokenPriceUsd:0,avgTokenPriceUsd:0});A.forEach((D,L)=>{const O=e.findIndex(P=>P.date===D.date);O!==-1&&(A[L]=e[O])})}S=(A.length===0?e:A).map(({txCount:D,date:L,feesPaidInUsd:O,feeAmountInToken:P})=>{var x,T;return w.push({value:D,name:new Date(L).toISOString()}),C.push({value:O?Number(O):new va(P).times(((T=(x=y==null?void 0:y.quote)==null?void 0:x.USD)==null?void 0:T.price)||0).toNumber(),name:new Date(L).toISOString()}),i?c0r[new Date(new Date(L).toISOString().slice(0,10)).getDay()+1]||"Sun":sn(nl(new Date(L).toISOString().slice(0,10)),p?"MMM dd":g?"MMM":"MM/dd, hh:mm")})}else{if(m-1!==13){for(let D=13;D>=0;D--)A.push({date:new Date(new Date(new Date(sn(lu(n,D*30),"yyyy-MM-dd")).setDate(1)).setHours(-6)).getTime(),feepayer:null,txCount:0,feeAmountInBaseToken:0,gasWanted:0,gasUsed:0,feeAmountInToken:0,feesPaidInUsd:0,maxTokenPriceUsd:0,minTokenPriceUsd:0,avgTokenPriceUsd:0});A.forEach((D,L)=>{const O=e.findIndex(P=>P.date===D.date);O!==-1&&(A[L]=e[O])})}S=(A.length===0?e:A).map(({txCount:D,date:L,feesPaidInUsd:O,feeAmountInToken:P})=>{var x,T;return w.push({value:D,name:new Date(L).toISOString()}),C.push({value:O?Number(O):new va(P).times(((T=(x=y==null?void 0:y.quote)==null?void 0:x.USD)==null?void 0:T.price)||0).toNumber(),name:new Date(L).toISOString()}),sn(nl(new Date(L).toISOString().slice(0,10)),p?"MMM dd":g?"MMM":"MM/dd, hh:mm")})}const I=[f.CHART_LINE_MAIN,f.CHART_PIE_YES];Sa.color=I,Sa.xAxis[0].data=S,Sa.xAxis[0].axisLabel.color=f.FONT_PRIMARY,Sa.yAxis[0].axisLine.lineStyle.color=f.FONT_PRIMARY,Sa.yAxis[0].offset=d?-14:0,Sa.yAxis[0].axisLabel.color=f.FONT_PRIMARY,Sa.yAxis[0].axisLabel.rotate=h?45:0,Sa.series[0].data=w,Sa.series[0].areaStyle.color=new Nh(0,0,0,1,[{offset:0,color:f.CHART_LINE_GRADIENT_START},{offset:1,color:f.CHART_LINE_GRADIENT_END}]),Sa.yAxis[0].splitLine.lineStyle.color=f.FONT_PRIMARY,Sa.yAxis[1].axisLine.lineStyle.color=I[1],Sa.yAxis[1].offset=d?-14:0,Sa.yAxis[1].axisLabel.color=f.FONT_PRIMARY,Sa.yAxis[1].axisLabel.rotate=h?-45:0,Sa.series[1].data=C,Sa.yAxis[1].axisLabel.color=I[1],Sa.tooltip.axisPointer.lineStyle.color=I[0],Sa.tooltip.formatter=D=>{let L="",O=0;return D.forEach(P=>{L+=` -
-
-
-
- ${P.seriesName}: ${P.seriesName==="Fees"?`$${zt(parseFloat(P.data.value),"USD",{decimal:2,minimumFractionDigits:2})}`:zt(Number(P.data.value),"")} -
-
`,O++}),L=`
${sn(nl(D[0].data.name.slice(0,10)),p?"MMM dd":"MMM-yyyy")}
${L}`,L},Sa.title.text=a,Sa.title.textStyle.color=f.FONT_PRIMARY,o&&(Sa.grid=o),Sa.legend.padding=s},[e,p,g,h,d,f,y,r,n,m,i,a,o,s,t]);return Sa.legend.textStyle={color:f.FONT_PRIMARY},Z.useEffect(()=>{let w;return m>0&&!Rn(y)&&(u.current&&(w=ws(u.current)||Us(u.current)),b(),w==null||w.setOption(Sa),window.addEventListener("resize",()=>{w&&w.resize()})),window.removeEventListener("resize",()=>w&&w.resize())},[c,m,l,b,y]),m>0?M.jsx(u0r,{ref:u}):M.jsxs(f0r,{children:["No transactions in the last ",r," days"]})},d0r=se(Ha)` - margin-top: 10px; - align-self: flex-end; -`,h0r=se.div` - text-align: center; - font-size: 2rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - margin: 20px 0; -`,p0r=se.div` - display: ${({show:t})=>t?"flex":"none"}; - margin: 1.6rem 0; - padding: 20px; - border: ${({theme:t})=>t.ORANGE_PRIMARY} 1px solid; - border-radius: 0.6rem; - color: ${({theme:t})=>t.ORANGE_PRIMARY}; - flex-direction: column; - text-align: justify; - line-height: 1.3; -`,yDe=({modalOpen:t,onClose:e,address:r})=>{const[n,i]=Z.useState(!1),a=()=>{i(!1),e(),o.current.resetForm()};Z.useEffect(()=>{i(t)},[t]);const o=Z.useRef();return M.jsx(HS,{isOpen:n,onClose:a,largeModal:!0,children:M.jsx(gB,{innerRef:o,enableReinitialize:!0,initialValues:{fromDate:"",toDate:"",granularity:"DAY",advancedMetrics:!1},validationSchema:bst(),onSubmit:({fromDate:s,toDate:l,granularity:c,advancedMetrics:u},{resetForm:f})=>{const d=document.createElement("a");d.href=`${r?`${H_}/${r}/tx_history`:`${B3e}/history`}/download?${eo.stringify({fromDate:s,toDate:l,granularity:c,advancedMetrics:u})}`,d.download="true",document.body.append(d),d.click(),document.body.removeChild(d),f(),a()},children:s=>M.jsxs("form",{onSubmit:s.handleSubmit,children:[M.jsxs(h0r,{children:["Generate a CSV of ",r?Rr(r,12,"4"):""," Transaction Information"]}),M.jsx(S3,{config:MKe(),formik:s}),M.jsx(p0r,{show:s.values.advancedMetrics,children:"Toggling on advanced metrics will include transaction and fee type metrics in the CSV"}),M.jsx(d0r,{type:"submit",children:"Download"})]})})})},g0r=se.div` - display: flex; - justify-content: space-around; - width: 100%; - margin-bottom: 20px; -`,v0r=se.input``,m0r=se.label` - margin-left: 10px; -`,Lbe=[{label:"2 weeks",value:14},{label:"2 months",value:60},{label:"1 year",value:365}],wDe=({address:t,size:e="50%"})=>{const[r,n,i]=by(!1),a="yyyy-MM-dd",o=new Date,s=sn(o,a),[l,c]=Z.useState(Lbe[0].value),u="DAY",[f,d]=Z.useState(u),{data:h,isLoading:p,error:g}=t5e({fromDate:sn(lu(o,l),a),toDate:s,granularity:f.toUpperCase(),address:t}),{matches:v}=Qr(_t.down("sm")),{matches:y}=Qr(_t.between("sm","md")),m=b=>{c(b.target.value),b.target.value==="365"?d("MONTH"):d("DAY")};return M.jsxs(ln,{alignItems:"flex-start",alignContent:"flex-start",size:e==="50%"?y||v?"100%":"50%":e,icon:"INVENTORY",title:`${h&&h.length>0?`${l}-Day`:""} ${y||v?"Tx":"Transaction"} Activity`,link:t?{}:{to:"/txs",title:"View All"},children:[h&&!g&&M.jsx(g0r,{children:Lbe.map(b=>M.jsxs("div",{children:[M.jsx(v0r,{type:"radio",id:b.label,name:"radio-button",value:b.value,onClick:m,defaultChecked:l===b.value},b.value),M.jsx(m0r,{htmlFor:"radio-button",children:b.label})]},b.value))}),p?M.jsx(Br,{}):M.jsx(mDe,{txHistoryGran:f,data:h,span:l,today:o,title:""}),h&&!g&&M.jsx(Ha,{onClick:i,children:"Generate CSV"}),M.jsx(yDe,{modalOpen:r,onClose:n,address:t})]})},y0r=()=>{const[t,e]=Z.useState(1),{addressId:r}=Gr(),{accountAssets:n,accountAssetsTotal:i,accountAssetsPages:a,getAccountAssets:o,accountAssetsLoading:s}=Vc(),{assetMetadata:l,getAssetMetadata:c}=Av();Z.useEffect(()=>{o({address:r,page:t,count:10}),c()},[o,t,r,c]);const u=n.map(d=>{var h,p,g,v;return{...d,displayDenom:(h=l.find(y=>y.base===d.denom))==null?void 0:h.display,exponent:((v=(g=(p=l.find(y=>y.base===d.denom))==null?void 0:p.denomUnits)==null?void 0:g.find(y=>!!y.exponent))==null?void 0:v.exponent)||0}}),f=[{displayName:"Asset",dataName:"denom"},{displayName:"Total Balance",dataName:"balances"},{displayName:"Price Per Unit",dataName:"pricePerToken"},{displayName:"Total Value",dataName:"totalBalancePrice.amount"}];return M.jsx(cn,{changePage:e,currentPage:t,isLoading:s,tableData:u,tableHeaders:f,totalPages:a,title:`Total Assets: ${i}`})},w0r=se.div` - display: flex; - align-items: center; -`,b0r=se.div` - display: flex; - align-items: center; - justify-content: center; - border-radius: 100%; - background: ${({theme:t})=>t.BACKGROUND_LIGHT}; - margin-right: 1.5rem; - height: 75px; - width: 75px; - min-width: 75px; - overflow: hidden; -`,x0r=se.span` - font-size: 4rem; - color: ${({theme:t})=>t.FONT_PRIMARY}; - text-transform: uppercase; -`,_0r=se.div` - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - margin: 5px 0; - font-size: 1.7rem; -`,S0r=se.div` - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - font-style: italic; - max-width: 500px; - margin: 0 auto; - margin-top: 5px; -`,q4=se.div` - margin: 1.6rem 0; -`,ng=se.div` - padding-bottom: 1.6rem; -`,C0r=se.div` - display: flex; - justify-content: space-between; -`,ig=se.div` - font-size: 1.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - line-height: 1.75; -`,ag=se.div` - display: flex; - font-size: 1.6rem; - line-height: 1.75; -`,$be=se.div` - display: flex; - justify-content: flex-end; - gap: 1rem; - margin-top: 40px; -`,Vk=se.div` - display: flex; - margin-bottom: 1.6rem; - padding: 20px; - border: ${({theme:t,help:e,color:r})=>r||(e?t.BORDER_THEME:t.WARNING_BORDER)} - 1px solid; - border-radius: 0.6rem; - color: ${({theme:t,help:e,color:r})=>r||(e?t.FONT_THEME:t.FONT_WARNING)}; -`,Gk=se.div` - margin: 5px 20px 0 0; -`,Wk=se.h3` - && { - margin: 0; - font-size: 1.5rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - line-height: 2.4rem; - } -`,qk=se.p` - margin: 0; - padding: 0; - line-height: 2.2rem; - list-style-type: '– '; -`,bDe=({isDelegate:t,isLoggedIn:e,modalOpen:r,onClose:n,validator:i})=>{const{allValidators:a,getValidatorSpotlight:o,validatorSpotlight:s,validatorSpotlightLoading:l}=js(),c=_i(),{accountAssets:u}=Vc(),{delegateAction:f,redelegateAction:d,undelegateAction:h,withdrawRewardsAction:p}=bte(),g="",[v,y]=Z.useState(!1),[m,b]=Z.useState(""),[w,C]=Z.useState("");Z.useEffect(()=>{y(e&&i&&r)},[e,r,i,l,s]),Z.useEffect(()=>{i!=null&&i.addressId&&o(i==null?void 0:i.addressId)},[o,i==null?void 0:i.addressId]);const A=W=>{const{amount:Q,denom:J}=d3(W,"hash",!0);let ee={amount:{amount:String(Q),denom:J},delegator:g,validator:i.addressId};switch(m){case Ca.UNDELEGATE:return{action:h,data:ee};case Ca.REDELEGATE:return ee={amount:{amount:String(Q),denom:J},delegator:g,validatorDst:w,validatorSrc:i.addressId},{action:d,data:ee};case Ca.CLAIM:return ee={delegator:g,validator:i.addressId},{action:p,data:ee};default:return{action:f,data:ee}}},S=async W=>{const{action:Q,data:J}=A(W);await Q(J)},I=()=>{n(),b(""),C("")},D=W=>{C(W)},L=(W,Q)=>{Q.stopPropagation(),b(W),C("")},O=new va(1e-9).toNumber(),{description:P,imgUrl:x,moniker:T,siteUrl:E}=s,{commission:N,amount:F}=i,B=Number(N)*100,{amount:j,denom:k}=d3(Number(F==null?void 0:F.amount),(F==null?void 0:F.denom)||""),$=7,H=u==null?void 0:u.find(W=>W.denom==="nhash"),{amount:Y,denom:ie}=d3(Number(H==null?void 0:H.amount),(H==null?void 0:H.denom)||"");return M.jsx(HS,{isOpen:v,onClose:I,children:l||i.addressId!==s.operatorAddress?M.jsx(Br,{}):M.jsx(gB,{enableReinitialize:!0,initialValues:{amount:0},validationSchema:Sf().shape({amount:m===Ca.DELEGATE?Of().min(O,"Min delegation amount is 1e-9 hash").max(new va(Y).toNumber(),`Maximum delegation amount is ${Y} hash`).required("A delegation amount is required"):m===Ca.UNDELEGATE?Of().min(O,"Minimum undelegation amount is 1e-9 hash").max(new va(j).toNumber(),`Maximum amount is ${Qn(j,$)} hash`).required("Please specify an amount to undelegate"):m===Ca.REDELEGATE?Of().min(O,"Minimum redelegation amount is 1e-9 hash").max(new va(j).toNumber(),`Maximum amount is ${Qn(j,$)} hash`).required("Please specify an amount to redelegate"):Of()}),onSubmit:async(W,{resetForm:Q})=>{S(W.amount),I(),Q()},children:W=>M.jsxs("form",{onSubmit:W.handleSubmit,children:[M.jsxs(w0r,{children:[M.jsx(b0r,{children:x?M.jsx("img",{src:x,alt:T,title:T,width:"75rem"}):M.jsx(x0r,{children:T?T[0]:"?"})}),M.jsxs("div",{children:[M.jsx(_0r,{title:T,children:Rr(T,35)}),M.jsxs(S0r,{children:["Commission - ",B<1e-4?">0.0001":Qn(B,4),"%"]})]})]}),!m&&M.jsxs(M.Fragment,{children:[M.jsxs(q4,{children:[E&&M.jsxs(ng,{children:[M.jsx(ig,{children:"Website"}),M.jsx(ag,{children:M.jsx("a",{href:E,children:E})})]}),P&&M.jsxs(ng,{children:[M.jsx(ig,{children:"Description"}),M.jsx(ag,{children:P})]}),M.jsxs(C0r,{children:[M.jsx(ig,{children:"Current Delegation"}),M.jsxs(ag,{children:[j?Qn(j,$):"0"," Hash"]})]})]}),M.jsxs($be,{children:[j?M.jsx($te,{type:"button",options:i.reward&&i.reward.length>0?[Ca.UNDELEGATE,Ca.REDELEGATE,Ca.CLAIM]:[Ca.UNDELEGATE,Ca.REDELEGATE],initial:Ca.UNDELEGATE,onClick:L}):null,M.jsx(Ha,{type:"button",onClick:Q=>L("delegate",Q),children:"Delegate"})]})]}),m===Ca.DELEGATE&&M.jsxs(q4,{children:[M.jsxs(Vk,{children:[M.jsx(Gk,{children:M.jsx(Lr,{icon:"WARNING",size:"3.2rem",color:c.FONT_WARNING})}),M.jsxs("div",{children:[M.jsx(Wk,{children:"Staking will lock your funds for 21+ days"}),M.jsx(qk,{children:"You will need to undelegate in order for your staked assets to be liquid again. This process will take 21 days to complete."})]})]}),new va(W.values.amount||0).gt(new va(Y).minus(IVe).toNumber())&&M.jsxs(Vk,{color:c.FONT_ERROR,children:[M.jsx(Gk,{children:M.jsx(Lr,{icon:"WARNING",size:"3.2rem",color:c.FONT_ERROR})}),M.jsxs("div",{children:[M.jsx(Wk,{children:"Warning: Account will lock"}),M.jsx(qk,{children:"In order to undelegate funds back into this account, the account will need to be able to pay the required fees. Delegating the specified amount of funds from this account will result in it being locked until another account sends it funds."})]})]}),M.jsxs(ng,{children:[M.jsx(ig,{children:"My Delegation"}),M.jsxs(ag,{children:[j?Qn(j,$):"0"," ",k]})]}),M.jsxs(ng,{children:[M.jsx(ig,{children:"Available Balance"}),M.jsxs(ag,{children:[Qn(Y,$)," ",ie]})]}),M.jsx(ng,{children:M.jsx(S3,{config:[{type:"number",label:"amount to delegate (hash)",field:"amount"}],formik:W})})]}),m===Ca.UNDELEGATE&&M.jsxs(q4,{children:[M.jsxs(Vk,{children:[M.jsx(Gk,{children:M.jsx(Lr,{icon:"WARNING",size:"3.2rem",color:c.FONT_WARNING})}),M.jsxs("div",{children:[M.jsx(Wk,{children:"Once the unbonding period begins you will:"}),M.jsxs(qk,{as:"ul",children:[M.jsx("li",{children:"not receive staking reward"}),M.jsx("li",{children:"not be able to cancel the unbonding"}),M.jsx("li",{children:"need to wait 21 days for the amount to be liquid"})]})]})]}),M.jsxs(Vk,{help:!0,children:[M.jsx(Gk,{children:M.jsx(Lr,{icon:"HELP",size:"3.2rem",color:c.FONT_THEME})}),M.jsxs("div",{children:[M.jsx(Wk,{children:"Trying to switch validators?"}),M.jsx(qk,{children:"Use the ‘Redelegate’ feature to instantly stake your assets to another validator."})]})]}),M.jsxs(ng,{children:[M.jsxs(ig,{children:["Available for undelegation: ",Qn(j,$)," HASH"," "]}),M.jsx(ag,{children:M.jsx(S3,{config:[{type:"number",label:"amount to undelegate (hash)",field:"amount"}],formik:W})})]})]}),m===Ca.REDELEGATE&&M.jsxs(q4,{children:[M.jsxs(ng,{children:[M.jsx(ig,{children:"Redelegate to:"}),M.jsx(ag,{children:M.jsx(nB,{maxHeight:"21rem",action:D,allOptions:a.reduce((Q,J)=>i.addressId===J.addressId?Q:{...Q,[J.addressId]:{title:J.moniker}},{noop:{isDefault:!0,title:""}})})})]}),w&&M.jsxs(ng,{children:[M.jsxs(ig,{children:["Available for redelegation: ",Qn(j,$)," HASH"," "]}),M.jsx(ag,{children:M.jsx(S3,{config:[{type:"number",label:"amount to redelegate (hash)",field:"amount"}],formik:W})})]})]}),m&&M.jsxs(M.Fragment,{children:[m===Ca.CLAIM&&i.reward&&M.jsx(q4,{children:M.jsxs(ng,{children:[M.jsx(ig,{children:"Total Rewards Available"}),M.jsx(ag,{children:zt(Number(i.reward[0].amount),i.reward[0].denom)})]})}),M.jsxs($be,{children:[!t&&M.jsx(Ha,{type:"button",onClick:Q=>L("",Q),color:"secondary",children:"Back"}),M.jsx(Ha,{type:"submit",children:Kr(m)})]})]})]})})})},A0r=()=>{const[t,e]=Z.useState(1),[r,n]=Z.useState([]),{accountDelegations:i,accountDelegationsTotal:{amount:a,denom:o},accountDelegationsLoading:s,accountDelegationsPages:l,getAccountDelegations:c}=Vc(),{addressId:u}=Gr(),{handleStaking:f,isDelegate:d,ManageStakingBtn:h,modalFns:p,validator:g}=bte(),{isLoggedIn:v}=Ki(),{allValidators:y,allValidatorsLoading:m,getAllValidators:b}=js(),w=5;Z.useEffect(()=>{v&&b({}),c({address:u,page:t,count:w})},[v,u,b,c,t]),Z.useEffect(()=>{n(i.map(S=>({...y.find(D=>D.addressId===S.validatorSrcAddr),...S})))},[y,i,n]);const C=zt(Number(a),o,{decimal:2}),A=[{displayName:"Staking",dataName:"manageStaking"},{displayName:"Moniker",dataName:"moniker"},{displayName:"Amount",dataName:"amount"}];return M.jsxs(M.Fragment,{children:[M.jsx(cn,{changePage:e,currentPage:t,isLoading:s||m,ManageStakingBtn:h,tableData:r,tableHeaders:A,totalPages:l,title:`Total Delegations: ${C}`}),M.jsx(bDe,{isDelegate:d,isLoggedIn:v,modalOpen:p.modalOpen,onClose:p.deactivateModalOpen,onStaking:f,validator:g||{}})]})},EG=({grant:t,type:e,currentPage:r,changePage:n})=>{const{addressId:i}=Gr(),{data:a,error:o,isLoading:s,isFetching:l}=$We({grant:t,type:e,address:i,page:r}),{results:c=[],pages:u=0,total:f=0}=a||{},d=(g,v)=>[{displayName:`${Kr(v)}`,dataName:v},{displayName:"Type",dataName:"type"},...g==="authz"?[{displayName:"Expiration",dataName:"expiration"}]:[],{displayName:"",dataName:"accordion"}],h=c.map(g=>M.jsx(ln,{title:"Details",children:!Rn(g.authorization)&&M.jsx(jo,{data:Object.keys(g.authorization).map(v=>({title:v,value:g.authorization[v],list:Array.isArray(g.authorization[v])?v==="transferLimits"?g.authorization[v].map(y=>zt(y.amount,y.denom)):g.authorization[v]:void 0}))})})),p=c.map(g=>M.jsx(ln,{title:"Details",children:!Rn(g.allowance)&&M.jsx(jo,{data:Object.keys(g.allowance).map(v=>({title:v,value:JSON.stringify(g.allowance[v]),isJson:!0}))})}));return M.jsx(M.Fragment,{children:o?M.jsx(ln,{title:"Error processing request",children:M.jsx(Lte,{src:JSON.parse(JSON.stringify(o)),theme:"summerfruit",collapsed:!0})}):l||s?M.jsx(Br,{}):M.jsx(cn,{title:`${t==="feegrant"?"Fee Grant":"Authz"} ${Kr(e)} (${f})`,tableData:c,tableHeaders:d(t,e==="grantee"?"granter":"grantee"),totalPages:u,currentPage:r,changePage:n,accordionData:c.length?t==="authz"?h:p:void 0})})},T0r=()=>{const[t,e]=Z.useState(1),[r,n]=Z.useState(1),[i,a]=Z.useState(1),[o,s]=Z.useState(0);return M.jsx(ln,{children:M.jsxs(Tv,{active:o,setActive:s,children:[M.jsx(Z.Fragment,{children:EG({grant:"authz",type:"granter",currentPage:r,changePage:n})},"Authz Granter"),M.jsx(Z.Fragment,{children:EG({grant:"authz",type:"grantee",currentPage:t,changePage:e})},"Authz Grantee"),M.jsx(Z.Fragment,{children:EG({grant:"feegrant",type:"granter",currentPage:i,changePage:a})},"Fee Grant Granter")]})})},E0r=()=>{const[t,e]=Z.useState([]),{accountRedelegations:r,accountRedelegationsLoading:n,getAccountRedelegations:i,accountRedelegationsTotal:{amount:a,denom:o}}=Vc(),{allValidators:s,allValidatorsLoading:l,getAllValidators:c}=js(),{addressId:u}=Gr(),{tableData:f,currentPage:d,changePage:h,totalPages:p}=vte({data:t,count:5});Z.useEffect(()=>{c({}),i(u)},[u,c,i]),Z.useEffect(()=>{e(r.map(y=>({...s.find(b=>b.addressId===y.validatorSrcAddr),...y})).sort((y,m)=>Number(y.endTime.millis)-Number(m.endTime.millis)))},[s,r,e]);const g=zt(parseFloat(a||"0"),o,{decimal:2}),v=[{displayName:"Moniker",dataName:"moniker"},{displayName:"Amount",dataName:"amount"},{displayName:"End Time",dataName:"endTime"}];return M.jsx(cn,{isLoading:n||l,tableData:f,tableHeaders:v,changePage:h,currentPage:d,totalPages:p,title:`Total Redelegations (${g})`})},I0r=()=>{const[t,e]=Z.useState([]),{accountRewards:r,accountRewardsLoading:n,getAccountRewards:i}=Vc(),{allValidators:a,allValidatorsLoading:o,getAllValidators:s}=js(),{addressId:l}=Gr(),{tableData:c,currentPage:u,changePage:f,totalPages:d}=vte({data:t});Z.useEffect(()=>{s({}),i(l)},[s,l,i]),Z.useEffect(()=>{var v;e((v=r.rewards)==null?void 0:v.map(y=>{const m=a.find(w=>w.addressId===y.validatorAddress);return{totalBalancePrice:y.reward.length>0?`$${zt(Number(y.reward[0].totalBalancePrice.amount),y.reward[0].totalBalancePrice.denom,{decimal:4,minimumFractionDigits:2})}`:null,...m,...y}}))},[r,a,e]);const p=!Rn(r)&&r.total.length>0?`${zt(Number(r.total[0].amount),r.total[0].denom,{decimal:2,minimumFractionDigits:2})}`:"0 hash",g=[{displayName:"Moniker",dataName:"moniker"},{displayName:"Reward",dataName:"reward"},{displayName:"Value",dataName:"totalBalancePrice"}];return M.jsx(cn,{isLoading:n||o,tableData:c.filter(v=>v.totalBalancePrice),tableHeaders:g,changePage:f,currentPage:u,totalPages:d,title:`Total Rewards: ${p}`})},k0r=()=>{const[t,e]=Z.useState([]),{accountUnbonding:r,accountUnbondingLoading:n,getAccountUnbonding:i,accountUnbondingTotal:{amount:a,denom:o}}=Vc(),{allValidators:s,allValidatorsLoading:l,getAllValidators:c}=js(),{addressId:u}=Gr(),{tableData:f,currentPage:d,changePage:h,totalPages:p}=vte({data:t});Z.useEffect(()=>{c({}),i(u)},[u,c,i]),Z.useEffect(()=>{e(r.map(y=>({...s.find(b=>b.addressId===y.validatorSrcAddr),...y})).sort((y,m)=>Number(y.endTime.millis)-Number(m.endTime.millis)))},[s,r,e]);const g=zt(parseFloat(a||"0"),o,{decimal:2}),v=[{displayName:"Moniker",dataName:"moniker"},{displayName:"Amount",dataName:"amount"},{displayName:"End Time",dataName:"endTime"}];return M.jsx(cn,{isLoading:n||l,tableData:f,tableHeaders:v,changePage:h,currentPage:d,totalPages:p,title:`Total Unbondings (${g})`})},P0r=()=>{const{accountInfo:t,accountInfoLoading:e,getAccountInfo:r}=Vc(),{addressId:n}=Gr();Z.useEffect(()=>{r(n)},[r,n]);const{attributes:i}=t,a=[{displayName:"Attribute",dataName:"attribute"},{displayName:"Data",dataName:"data"}];return M.jsx(cn,{isLoading:e,tableData:i,tableHeaders:a,title:`Total Attributes: ${i?i.length:"0"}`})},R0r=se.div` - width: 100%; -`,M0r=se.div` - position: relative; - margin-bottom: 18px; -`,D0r=se.div` - position: absolute; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,N0r=()=>{const t="yyyy-MM-dd",[e,r]=Z.useState(1),[n,i]=Z.useState(""),[a,o]=Z.useState(""),[s,l]=Z.useState(""),[c,u]=Z.useState(""),[f,d]=Z.useState(""),{txsByAddress:h,txsByAddressPages:p,txsByAddressLoading:g,getTxsByAddress:v,txTypes:y,getTxTypes:m,txTypesLoading:b}=$u(),{tableCount:w}=Ki(),{addressId:C,blockHeight:A}=Gr(),S=c.replace(/-/g,"/"),I=s.replace(/-/g,"/"),D=c?new Date(S):"",L=s?new Date(I):"",O=Object.keys(y).length>0;Z.useEffect(()=>{O||m()},[m,O]),Z.useEffect(()=>{v({address:C,page:1,count:w,type:"",status:"",toDate:"",fromDate:""})},[v,A,w,C]);const P=j=>{r(j),v({address:C,page:j,count:w,type:n,status:a,toDate:c,fromDate:s})},x=j=>{i(j==="allTxTypes"?"":j)},T=j=>{o(j==="all"?"":j)},E=()=>{const j=new Date(c),k=new Date(s);return j15?(d("Filter Error: Maximum date range is 15 days."),!1):!0},N=()=>{if(d(""),E()){r(1);const j=c?Wi(`${c}T00:00:00`,"yyyy-MM-dd"):"",k=s?Wi(`${s}T00:00:00`,"yyyy-MM-dd"):"";v({address:C,toDate:j,fromDate:k,page:1,count:w,type:n,status:a})}},F=[{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Tx Type",dataName:"txType"},{displayName:"Block",dataName:"block"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}],B=[{title:"Type:",type:"dropdown",options:y,action:x},{title:"Status:",type:"dropdown",options:yL,action:T},{title:"From:",type:"datepicker",options:{placeholderText:"Pick From Date",onChange:j=>l(j?sn(j,t):""),selected:L,dateFormat:t},action:l},{title:"To:",type:"datepicker",options:{placeholderText:"Pick To Date",onChange:j=>u(j?sn(j,t):""),selected:D,dateFormat:t},action:u}];return M.jsxs(R0r,{children:[!b&&Object.keys(y).length>0&&M.jsxs(M0r,{children:[f&&M.jsx(D0r,{children:f}),M.jsx(Kl,{filterData:B,mustApply:{title:"Apply",action:N},flush:!0})]}),M.jsx(cn,{tableHeaders:F,tableData:h,currentPage:e,changePage:P,totalPages:p,isLoading:g,title:"Account Transactions"})]})},O0r=se.div` - text-align: center; - font-size: 1.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - margin: 30px 0 20px 0; -`,L0r=se.li` - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - max-width: 500px; - margin: 0 auto; - margin-bottom: 20px; -`,$0r=({modalOpen:t,onClose:e,data:r})=>{const[n,i]=Z.useState(!1);Z.useEffect(()=>{i(t)},[t]);const a=()=>{i(!1),e()};return M.jsx(HS,{isOpen:n,onClose:a,children:M.jsxs(M.Fragment,{children:[M.jsx(O0r,{children:"The following accounts form this multi-sig account"}),M.jsx("ol",{children:r.map(o=>M.jsx(L0r,{children:M.jsx(Wo,{to:`/accounts/${o.address}`,onClick:a,children:o.address})},o.idx))})]})})},B0r=se(Ha)` - margin: 0; -`,F0r=se.div` - display: flex; -`,j0r=()=>{const{accountInfo:t,getAccountAssets:e,getAccountInfo:r,getAccountRewards:n}=Vc(),[i,a,o]=by(!1),{addressId:s}=Gr(),[l,c]=Z.useState(!1),[u,f]=Z.useState(!1),[d,h]=Z.useState(!1),[p,g]=Z.useState(!1),[v,y]=Z.useState(!1);Z.useEffect(()=>{e({address:s}),r(s),n(s)},[e,r,n,s]);const{accountName:m="--",accountNumber:b="--",accountType:w="--",publicKey:C={base64:"",sigList:[],type:""},sequence:A="--",tokens:S={fungibleCount:0,nonFungibleCount:0},accountAum:I={amount:0,denom:""}}=t,{base64:D,sigList:L,type:O}=C,P={visibility:{visible:l,setVisible:c},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"Key Type:",value:O}],titleMinWidth:"70px",noteMinWidth:"70px"},x={visibility:{visible:u,setVisible:f},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"",value:"Total value of all account assets under management (AUM)"}],titleMinWidth:"0px",noteMinWidth:"150px"},T={visibility:{visible:d,setVisible:h},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"",value:"The alias applied to this address. If N/A, it does not exist.",externalLink:"https://provenance-io.github.io/provenance-docs/docs/pb/modules/name-module",linkValue:"Docs"}],titleMinWidth:"0px",noteMinWidth:"250px"},E={visibility:{visible:p,setVisible:g},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"",value:"The number of this account in the Provenance Network.",hideTitle:!0}],titleMinWidth:"0px",noteMinWidth:"150px"},N={visibility:{visible:v,setVisible:y},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"",value:"The number of transactions signed by this account.",hideTitle:!0}],titleMinWidth:"0px",noteMinWidth:"150px"},F=[{title:"Total AUM",value:`$${zt(Number(I.amount),I.denom,{decimal:2,minimumFractionDigits:2})}`,popupNote:x},{title:"Type",value:w},{title:"Fungible Tokens",value:String(S.fungibleCount)},{title:"Non-Fungible Tokens",value:String(S.nonFungibleCount),link:`/nfts/${s}`},{title:"Name",value:m||"N/A",popupNote:T},{title:"Number",value:String(b),popupNote:E},{title:"Public Key",value:D&&L.length===1?Rr(D,12,"3"):"N/A",copy:D&&D,popupNote:O?P:void 0,button:!D&&L.length>1?M.jsx(B0r,{icon:"INVENTORY",onClick:o,children:"View All"}):void 0},{title:"Sequence",value:String(A),popupNote:N}];return M.jsxs(M.Fragment,{children:[M.jsx(M.Fragment,{children:F.map(B=>M.jsx(bp,{title:B.title,popup:B.popupNote,titleMargin:B.button&&"0 0 15px 0",children:M.jsxs(F0r,{children:[B.button&&B.button,B.link?M.jsx(Wo,{to:B.link,children:B.value}):B.value,B.copy&&M.jsx(xh,{value:B.copy,title:`Copy ${B.title}`,size:"2rem"})]})},B.title))}),M.jsx($0r,{modalOpen:i,onClose:a,data:L})]})},U0r=se(cr)` - max-width: 100%; -`,z0r=()=>{const{matches:t}=Qr(_t.down("lg"));Gr();const[e,r]=Z.useState(0);return M.jsx(U0r,{children:M.jsxs(Tv,{active:e,setActive:r,isSmall:t,children:[M.jsx(y0r,{},"Assets"),M.jsx(A0r,{},"Delegations"),M.jsx(E0r,{},"Redelegations"),M.jsx(k0r,{},"Unbondings"),M.jsx(I0r,{},"Rewards"),M.jsx(P0r,{},"Attributes"),M.jsx(N0r,{},"Transactions"),M.jsx(T0r,{},"Grants")]})})},H0r=se.div` - width: 100%; - height: ${({height:t})=>t||"155px"}; -`,vw={color:"",polar:{radius:[40,"80%"]},angleAxis:{max:0,interval:0,startAngle:90,axisLabel:{show:!1}},radiusAxis:{type:"category",data:[""]},series:{type:"bar",data:[0],coordinateSystem:"polar",label:{show:!1}}},V0r=({data:t})=>{const[e,r]=Z.useState(null),n=Z.useRef(null),i=_i(),{matches:a}=Qr(_t.up("lg")),{matches:o}=Qr(_t.down("md")),{matches:s}=Qr(_t.down("sm")),l=Z.useCallback(()=>{const c=new va(Number(t==null?void 0:t.originalVestingList[0].amount)).div(1e9).div(new va(Number(t.periodicVestingList[0].coins[0].amount)).div(1e9).toNumber()).toNumber();vw.angleAxis.interval=c<=48?new va(Number(t.periodicVestingList[0].coins[0].amount)).div(1e9).toNumber():new va(Number(t==null?void 0:t.originalVestingList[0].amount)).div(1e9).div(48).toNumber(),vw.angleAxis.max=new va(Number(t==null?void 0:t.originalVestingList[0].amount)).div(1e9).toNumber();let u=0;const f=Number(t.periodicVestingList.length),d=t.periodicVestingList;if(d)for(let h=0;h{let c;return Rn(t)||(n.current&&(c=ws(n.current)||Us(n.current)),l(),c==null||c.setOption(vw),window.addEventListener("resize",()=>{c&&c.resize()})),window.removeEventListener("resize",()=>c&&c.resize())},[e,l,r,t]),M.jsx(H0r,{ref:n,height:s||a?"155px":o?"250px":""})},G0r=({data:t,isLoading:e})=>{const r=t.periodicVestingList.find(s=>!s.isVested);let n=0;const i=Number(t.periodicVestingList.length),a=t.periodicVestingList;if(a)for(let s=0;st||"155px"}; -`,q0r=se.div` - width: 100%; - margin-top: 20px; -`,Y4={radar:{indicator:[{name:"",max:0}],splitNumber:3,axisNameGap:5},series:[{name:"Hash",type:"radar",data:[{name:"",value:[0]}],symbolSize:10,backgroundColor:"",areaStyle:{color:new Nh(0,0,0,1,[{offset:0,color:""},{offset:1,color:""}])}}]},Bbe=({hashData:t,isLoading:e})=>{const[r,n]=Z.useState(null),i=Z.useRef(null),a=_i(),{matches:o}=Qr(_t.up("lg")),{matches:s}=Qr(_t.down("md")),{matches:l}=Qr(_t.down("sm")),c=Z.useCallback(()=>{Y4.series[0].data[0].value=[t.hashAvailable,t.hashRewards,t.hashRedelegations,t.hashUnbondings,t.hashDelegations],Y4.radar.indicator=[{name:"Available",max:t.hashTotal||1},{name:"Reward",max:t.hashTotal||1},{name:"Redelegated",max:t.hashTotal||1},{name:"Unbonding",max:t.hashTotal||1},{name:"Delegated",max:t.hashTotal||1}],Y4.series[0].backgroundColor=a.CHART_LINE_MAIN,Y4.series[0].areaStyle.color=new Nh(0,0,0,1,[{offset:0,color:a.CHART_LINE_GRADIENT_START},{offset:1,color:a.CHART_LINE_GRADIENT_END}])},[t,a]);return Z.useEffect(()=>{let u;return i.current&&(u=ws(i.current)||Us(i.current)),c(),u==null||u.setOption(Y4),window.addEventListener("resize",()=>{u&&u.resize()}),window.removeEventListener("resize",()=>u&&u.resize())},[r,c,n]),e?M.jsx(Br,{}):Rn(t)?M.jsx(q0r,{children:"No hash data available"}):M.jsx(W0r,{ref:i,height:l||o?"155px":s?"250px":""})},Fbe=({hashData:t,isLoading:e})=>{const r=[{hashBucket:"Total",hashAmount:{amount:t.hashTotal,denom:"nhash"}},{hashBucket:"Available",hashAmount:{amount:t.hashAvailable,denom:"nhash"}},{hashBucket:"Delegated",hashAmount:{amount:t.hashDelegations,denom:"nhash"}},{hashBucket:"Redelegated",hashAmount:{amount:t.hashRedelegations,denom:"nhash"}},{hashBucket:"Unbondings",hashAmount:{amount:t.hashUnbondings,denom:"nhash"}},{hashBucket:"Rewards",hashAmount:{amount:t.hashRewards,denom:"nhash"}}];return M.jsx(cn,{isLoading:e,tableData:r,tableHeaders:[{displayName:"Hash",dataName:"hashBucket"},{displayName:"Amount",dataName:"hashAmount"}],tableBorder:!1})},jbe=()=>{const[t,e]=Z.useState(0),{addressId:r}=Gr(),{data:n,isLoading:i}=PWe({address:r}),{data:a,isLoading:o,error:s}=kWe({address:r}),{matches:l}=Qr(_t.down("md")),c=cqe(n);return M.jsx(ln,{justify:"center",alignItems:"center",size:l?"100%":"60%",children:a&&!s?i||o?M.jsx(Br,{}):M.jsxs(Tv,{active:t,setActive:e,children:[M.jsxs(Z.Fragment,{children:[M.jsx(Bbe,{hashData:c,isLoading:i}),M.jsx(Fbe,{hashData:c,isLoading:i})]},"Hash Info"),M.jsxs(Z.Fragment,{children:[o?M.jsx(Br,{}):M.jsx(V0r,{data:a}),M.jsx(G0r,{data:a,isLoading:o})]},"Vesting Info")]}):M.jsxs(M.Fragment,{children:[M.jsx(Bbe,{hashData:c,isLoading:i}),M.jsx(Fbe,{hashData:c,isLoading:i})]})})},Y0r=se.div` - display: ${({isMdSm:t})=>t?"block":"flex"}; - align-items: center; - width: 100%; -`,K0r=()=>{const{addressId:t}=Gr(),{matches:e}=Qr(_t.down("sm")),{matches:r}=Qr(_t.down("md")),{matches:n}=Qr(_t.only("md")),{matches:i}=Qr("(max-width: 780px)"),{matches:a}=Qr(_t.up("md")),{accountInfoFailure:o}=Vc(),s=e?Rr(t,20,"3"):t;return M.jsxs(Ni,{children:[M.jsx(to,{title:"Account Details",value:s,copyValue:t,copyTitle:"Copy Address"}),o?M.jsx(gF,{message:"No account exists for this address"}):M.jsxs(Z.Fragment,{children:[M.jsxs(cr,{header:!0,children:[M.jsx(ln,{justify:"flex-start",alignItems:"center",children:M.jsx(j0r,{})}),a&&!n&&M.jsx(jbe,{})]}),r&&M.jsx(cr,{children:M.jsx(Y0r,{isMdSm:i,children:M.jsx(jbe,{})})}),M.jsx(cr,{children:M.jsx(wDe,{address:t,size:"100%"})}),M.jsx(cr,{children:M.jsx(z0r,{})})]})]})},Ube=["http","https","mailto","tel"];function Z0r(t){const e=(t||"").trim(),r=e.charAt(0);if(r==="#"||r==="/")return e;const n=e.indexOf(":");if(n===-1)return e;let i=-1;for(;++ii||(i=e.indexOf("#"),i!==-1&&n>i)?e:"javascript:void(0)"}/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */var Q0r=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const X0r=Un(Q0r);function x6(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?zbe(t.position):"start"in t||"end"in t?zbe(t):"line"in t||"column"in t?cQ(t):""}function cQ(t){return Hbe(t&&t.line)+":"+Hbe(t&&t.column)}function zbe(t){return cQ(t&&t.start)+"-"+cQ(t&&t.end)}function Hbe(t){return t&&typeof t=="number"?t:1}class ld extends Error{constructor(e,r,n){const i=[null,null];let a={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof r=="string"&&(n=r,r=void 0),typeof n=="string"){const o=n.indexOf(":");o===-1?i[1]=n:(i[0]=n.slice(0,o),i[1]=n.slice(o+1))}r&&("type"in r||"position"in r?r.position&&(a=r.position):"start"in r||"end"in r?a=r:("line"in r||"column"in r)&&(a.start=r)),this.name=x6(r)||"1:1",this.message=typeof e=="object"?e.message:e,this.stack="",typeof e=="object"&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=a.start.line,this.column=a.start.column,this.position=a,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}ld.prototype.file="";ld.prototype.name="";ld.prototype.reason="";ld.prototype.message="";ld.prototype.stack="";ld.prototype.fatal=null;ld.prototype.column=null;ld.prototype.line=null;ld.prototype.source=null;ld.prototype.ruleId=null;ld.prototype.position=null;const fp={basename:J0r,dirname:egr,extname:tgr,join:rgr,sep:"/"};function J0r(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');I9(t);let r=0,n=-1,i=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.charCodeAt(i)===47){if(a){r=i+1;break}}else n<0&&(a=!0,n=i+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let o=-1,s=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(a){r=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(t.charCodeAt(i)===e.charCodeAt(s--)?s<0&&(n=i):(s=-1,n=o));return r===n?n=o:n<0&&(n=t.length),t.slice(r,n)}function egr(t){if(I9(t),t.length===0)return".";let e=-1,r=t.length,n;for(;--r;)if(t.charCodeAt(r)===47){if(n){e=r;break}}else n||(n=!0);return e<0?t.charCodeAt(0)===47?"/":".":e===1&&t.charCodeAt(0)===47?"//":t.slice(0,e)}function tgr(t){I9(t);let e=t.length,r=-1,n=0,i=-1,a=0,o;for(;e--;){const s=t.charCodeAt(e);if(s===47){if(o){n=e+1;break}continue}r<0&&(o=!0,r=e+1),s===46?i<0?i=e:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||r<0||a===0||a===1&&i===r-1&&i===n+1?"":t.slice(i,r)}function rgr(...t){let e=-1,r;for(;++e0&&t.charCodeAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function igr(t,e){let r="",n=0,i=-1,a=0,o=-1,s,l;for(;++o<=t.length;){if(o2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=o,a=0;continue}}else if(r.length>0){r="",n=0,i=o,a=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,o):r=t.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return r}function I9(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const agr={cwd:ogr};function ogr(){return"/"}function uQ(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function sgr(t){if(typeof t=="string")t=new URL(t);else if(!uQ(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return lgr(t)}function lgr(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let r=-1;for(;++r - * @license MIT - */var ugr=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const fgr=Un(ugr);var AM=Object.prototype.hasOwnProperty,_De=Object.prototype.toString,Wbe=Object.defineProperty,qbe=Object.getOwnPropertyDescriptor,Ybe=function(e){return typeof Array.isArray=="function"?Array.isArray(e):_De.call(e)==="[object Array]"},Kbe=function(e){if(!e||_De.call(e)!=="[object Object]")return!1;var r=AM.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&AM.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||AM.call(e,i)},Zbe=function(e,r){Wbe&&r.name==="__proto__"?Wbe(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},Qbe=function(e,r){if(r==="__proto__")if(AM.call(e,r)){if(qbe)return qbe(e,r).value}else return;return e[r]},dgr=function t(){var e,r,n,i,a,o,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});lo.length;let l;s&&o.push(i);try{l=t.apply(this,o)}catch(c){const u=c;if(s&&r)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){r||(r=!0,e(o,...s))}function a(o){i(null,o)}}const ggr=CDe().freeze(),SDe={}.hasOwnProperty;function CDe(){const t=hgr(),e=[];let r={},n,i=-1;return a.data=o,a.Parser=void 0,a.Compiler=void 0,a.freeze=s,a.attachers=e,a.use=l,a.parse=c,a.stringify=u,a.run=f,a.runSync=d,a.process=h,a.processSync=p,a;function a(){const g=CDe();let v=-1;for(;++v{if(A||!S||!I)C(A);else{const D=a.stringify(S,I);D==null||(ygr(D)?I.value=D:I.result=D),C(A,I)}});function C(A,S){A||!S?b(A):m?m(S):v(null,S)}}}function p(g){let v;a.freeze(),RG("processSync",a.Parser),MG("processSync",a.Compiler);const y=K4(g);return a.process(y,m),t2e("processSync","process",v),y;function m(b){v=!0,Gbe(b)}}}function Jbe(t,e){return typeof t=="function"&&t.prototype&&(vgr(t.prototype)||e in t.prototype)}function vgr(t){let e;for(e in t)if(SDe.call(t,e))return!0;return!1}function RG(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function MG(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function DG(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function e2e(t){if(!fQ(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function t2e(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function K4(t){return mgr(t)?t:new xDe(t)}function mgr(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ygr(t){return typeof t=="string"||fgr(t)}const wgr={};function bgr(t,e){const r=wgr,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return ADe(t,n,i)}function ADe(t,e,r){if(xgr(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return r2e(t.children,e,r)}return Array.isArray(t)?r2e(t,e,r):""}function r2e(t,e,r){const n=[];let i=-1;for(;++ii?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(e,r),t.splice(...o);else for(r&&t.splice(e,r);a0?(p0(t,t.length,0,e),t):e}const n2e={}.hasOwnProperty;function _gr(t){const e={};let r=-1;for(;++ro))return;const S=e.events.length;let I=S,D,L;for(;I--;)if(e.events[I][0]==="exit"&&e.events[I][1].type==="chunkFlow"){if(D){L=e.events[I][1].end;break}D=!0}for(y(n),A=S;Ab;){const C=r[w];e.containerState=C[1],C[0].exit.call(e,t)}r.length=b}function m(){i.write([null]),a=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Ogr(t,e,r){return oa(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function a2e(t){if(t===null||Dc(t)||Pgr(t))return 1;if(kgr(t))return 2}function Wne(t,e,r){const n=[];let i=-1;for(;++i1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const f=Object.assign({},t[n][1].end),d=Object.assign({},t[r][1].start);o2e(f,-l),o2e(d,l),o={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[n][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[r][1].start),end:d},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[n][1].end),end:Object.assign({},t[r][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},t[n][1].end=Object.assign({},o.start),t[r][1].start=Object.assign({},s.end),c=[],t[n][1].end.offset-t[n][1].start.offset&&(c=Pf(c,[["enter",t[n][1],e],["exit",t[n][1],e]])),c=Pf(c,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",a,e]]),c=Pf(c,Wne(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),c=Pf(c,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(u=2,c=Pf(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):u=0,p0(t,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r0&&bi(A)?oa(t,m,"linePrefix",a+1)(A):m(A)}function m(A){return A===null||on(A)?t.check(l2e,g,w)(A):(t.enter("codeFlowValue"),b(A))}function b(A){return A===null||on(A)?(t.exit("codeFlowValue"),m(A)):(t.consume(A),b)}function w(A){return t.exit("codeFenced"),e(A)}function C(A,S,I){let D=0;return L;function L(E){return A.enter("lineEnding"),A.consume(E),A.exit("lineEnding"),O}function O(E){return A.enter("codeFencedFence"),bi(E)?oa(A,P,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):P(E)}function P(E){return E===s?(A.enter("codeFencedFenceSequence"),x(E)):I(E)}function x(E){return E===s?(D++,A.consume(E),x):D>=o?(A.exit("codeFencedFenceSequence"),bi(E)?oa(A,T,"whitespace")(E):T(E)):I(E)}function T(E){return E===null||on(E)?(A.exit("codeFencedFence"),S(E)):I(E)}}}function qgr(t,e,r){const n=this;return i;function i(o){return o===null?r(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a)}function a(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}const NG={name:"codeIndented",tokenize:Kgr},Ygr={tokenize:Zgr,partial:!0};function Kgr(t,e,r){const n=this;return i;function i(c){return t.enter("codeIndented"),oa(t,a,"linePrefix",5)(c)}function a(c){const u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):r(c)}function o(c){return c===null?l(c):on(c)?t.attempt(Ygr,o,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||on(c)?(t.exit("codeFlowValue"),o(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function Zgr(t,e,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):on(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):oa(t,a,"linePrefix",5)(o)}function a(o){const s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(o):on(o)?i(o):r(o)}}const Qgr={name:"codeText",tokenize:evr,resolve:Xgr,previous:Jgr};function Xgr(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n=4?e(o):t.interrupt(n.parser.constructs.flow,r,e)(o)}}function PDe(t,e,r,n,i,a,o,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(y){return y===60?(t.enter(n),t.enter(i),t.enter(a),t.consume(y),t.exit(a),d):y===null||y===32||y===41||dQ(y)?r(y):(t.enter(n),t.enter(o),t.enter(s),t.enter("chunkString",{contentType:"string"}),g(y))}function d(y){return y===62?(t.enter(a),t.consume(y),t.exit(a),t.exit(i),t.exit(n),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(t.exit("chunkString"),t.exit(s),d(y)):y===null||y===60||on(y)?r(y):(t.consume(y),y===92?p:h)}function p(y){return y===60||y===62||y===92?(t.consume(y),h):h(y)}function g(y){return!u&&(y===null||y===41||Dc(y))?(t.exit("chunkString"),t.exit(s),t.exit(o),t.exit(n),e(y)):u999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?r(h):h===93?(t.exit(a),t.enter(i),t.consume(h),t.exit(i),t.exit(n),e):on(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||on(h)||s++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!bi(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),s++,f):f(h)}}function MDe(t,e,r,n,i,a){let o;return s;function s(d){return d===34||d===39||d===40?(t.enter(n),t.enter(i),t.consume(d),t.exit(i),o=d===40?41:d,l):r(d)}function l(d){return d===o?(t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):(t.enter(a),c(d))}function c(d){return d===o?(t.exit(a),l(o)):d===null?r(d):on(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),oa(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===o||d===null||on(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===o||d===92?(t.consume(d),u):u(d)}}function _6(t,e){let r;return n;function n(i){return on(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):bi(i)?oa(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}function k3(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const svr={name:"definition",tokenize:cvr},lvr={tokenize:uvr,partial:!0};function cvr(t,e,r){const n=this;let i;return a;function a(h){return t.enter("definition"),o(h)}function o(h){return RDe.call(n,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=k3(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):r(h)}function l(h){return Dc(h)?_6(t,c)(h):c(h)}function c(h){return PDe(t,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(lvr,f,f)(h)}function f(h){return bi(h)?oa(t,d,"whitespace")(h):d(h)}function d(h){return h===null||on(h)?(t.exit("definition"),n.parser.defined.push(i),e(h)):r(h)}}function uvr(t,e,r){return n;function n(s){return Dc(s)?_6(t,i)(s):r(s)}function i(s){return MDe(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return bi(s)?oa(t,o,"whitespace")(s):o(s)}function o(s){return s===null||on(s)?e(s):r(s)}}const fvr={name:"hardBreakEscape",tokenize:dvr};function dvr(t,e,r){return n;function n(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return on(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}const hvr={name:"headingAtx",tokenize:gvr,resolve:pvr};function pvr(t,e){let r=t.length-2,n=3,i,a;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},a={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},p0(t,n,r-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function gvr(t,e,r){let n=0;return i;function i(u){return t.enter("atxHeading"),a(u)}function a(u){return t.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&n++<6?(t.consume(u),o):u===null||Dc(u)?(t.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||on(u)?(t.exit("atxHeading"),e(u)):bi(u)?oa(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Dc(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}const vvr=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],u2e=["pre","script","style","textarea"],mvr={name:"htmlFlow",tokenize:xvr,resolveTo:bvr,concrete:!0},yvr={tokenize:Svr,partial:!0},wvr={tokenize:_vr,partial:!0};function bvr(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function xvr(t,e,r){const n=this;let i,a,o,s,l;return c;function c(Y){return u(Y)}function u(Y){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(Y),f}function f(Y){return Y===33?(t.consume(Y),d):Y===47?(t.consume(Y),a=!0,g):Y===63?(t.consume(Y),i=3,n.interrupt?e:k):Sp(Y)?(t.consume(Y),o=String.fromCharCode(Y),v):r(Y)}function d(Y){return Y===45?(t.consume(Y),i=2,h):Y===91?(t.consume(Y),i=5,s=0,p):Sp(Y)?(t.consume(Y),i=4,n.interrupt?e:k):r(Y)}function h(Y){return Y===45?(t.consume(Y),n.interrupt?e:k):r(Y)}function p(Y){const ie="CDATA[";return Y===ie.charCodeAt(s++)?(t.consume(Y),s===ie.length?n.interrupt?e:P:p):r(Y)}function g(Y){return Sp(Y)?(t.consume(Y),o=String.fromCharCode(Y),v):r(Y)}function v(Y){if(Y===null||Y===47||Y===62||Dc(Y)){const ie=Y===47,W=o.toLowerCase();return!ie&&!a&&u2e.includes(W)?(i=1,n.interrupt?e(Y):P(Y)):vvr.includes(o.toLowerCase())?(i=6,ie?(t.consume(Y),y):n.interrupt?e(Y):P(Y)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(Y):a?m(Y):b(Y))}return Y===45||fu(Y)?(t.consume(Y),o+=String.fromCharCode(Y),v):r(Y)}function y(Y){return Y===62?(t.consume(Y),n.interrupt?e:P):r(Y)}function m(Y){return bi(Y)?(t.consume(Y),m):L(Y)}function b(Y){return Y===47?(t.consume(Y),L):Y===58||Y===95||Sp(Y)?(t.consume(Y),w):bi(Y)?(t.consume(Y),b):L(Y)}function w(Y){return Y===45||Y===46||Y===58||Y===95||fu(Y)?(t.consume(Y),w):C(Y)}function C(Y){return Y===61?(t.consume(Y),A):bi(Y)?(t.consume(Y),C):b(Y)}function A(Y){return Y===null||Y===60||Y===61||Y===62||Y===96?r(Y):Y===34||Y===39?(t.consume(Y),l=Y,S):bi(Y)?(t.consume(Y),A):I(Y)}function S(Y){return Y===l?(t.consume(Y),l=null,D):Y===null||on(Y)?r(Y):(t.consume(Y),S)}function I(Y){return Y===null||Y===34||Y===39||Y===47||Y===60||Y===61||Y===62||Y===96||Dc(Y)?C(Y):(t.consume(Y),I)}function D(Y){return Y===47||Y===62||bi(Y)?b(Y):r(Y)}function L(Y){return Y===62?(t.consume(Y),O):r(Y)}function O(Y){return Y===null||on(Y)?P(Y):bi(Y)?(t.consume(Y),O):r(Y)}function P(Y){return Y===45&&i===2?(t.consume(Y),N):Y===60&&i===1?(t.consume(Y),F):Y===62&&i===4?(t.consume(Y),$):Y===63&&i===3?(t.consume(Y),k):Y===93&&i===5?(t.consume(Y),j):on(Y)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(yvr,H,x)(Y)):Y===null||on(Y)?(t.exit("htmlFlowData"),x(Y)):(t.consume(Y),P)}function x(Y){return t.check(wvr,T,H)(Y)}function T(Y){return t.enter("lineEnding"),t.consume(Y),t.exit("lineEnding"),E}function E(Y){return Y===null||on(Y)?x(Y):(t.enter("htmlFlowData"),P(Y))}function N(Y){return Y===45?(t.consume(Y),k):P(Y)}function F(Y){return Y===47?(t.consume(Y),o="",B):P(Y)}function B(Y){if(Y===62){const ie=o.toLowerCase();return u2e.includes(ie)?(t.consume(Y),$):P(Y)}return Sp(Y)&&o.length<8?(t.consume(Y),o+=String.fromCharCode(Y),B):P(Y)}function j(Y){return Y===93?(t.consume(Y),k):P(Y)}function k(Y){return Y===62?(t.consume(Y),$):Y===45&&i===2?(t.consume(Y),k):P(Y)}function $(Y){return Y===null||on(Y)?(t.exit("htmlFlowData"),H(Y)):(t.consume(Y),$)}function H(Y){return t.exit("htmlFlow"),e(Y)}}function _vr(t,e,r){const n=this;return i;function i(o){return on(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a):r(o)}function a(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}function Svr(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(nF,e,r)}}const Cvr={name:"htmlText",tokenize:Avr};function Avr(t,e,r){const n=this;let i,a,o;return s;function s(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),c):k===47?(t.consume(k),C):k===63?(t.consume(k),b):Sp(k)?(t.consume(k),I):r(k)}function c(k){return k===45?(t.consume(k),u):k===91?(t.consume(k),a=0,p):Sp(k)?(t.consume(k),m):r(k)}function u(k){return k===45?(t.consume(k),h):r(k)}function f(k){return k===null?r(k):k===45?(t.consume(k),d):on(k)?(o=f,F(k)):(t.consume(k),f)}function d(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?N(k):k===45?d(k):f(k)}function p(k){const $="CDATA[";return k===$.charCodeAt(a++)?(t.consume(k),a===$.length?g:p):r(k)}function g(k){return k===null?r(k):k===93?(t.consume(k),v):on(k)?(o=g,F(k)):(t.consume(k),g)}function v(k){return k===93?(t.consume(k),y):g(k)}function y(k){return k===62?N(k):k===93?(t.consume(k),y):g(k)}function m(k){return k===null||k===62?N(k):on(k)?(o=m,F(k)):(t.consume(k),m)}function b(k){return k===null?r(k):k===63?(t.consume(k),w):on(k)?(o=b,F(k)):(t.consume(k),b)}function w(k){return k===62?N(k):b(k)}function C(k){return Sp(k)?(t.consume(k),A):r(k)}function A(k){return k===45||fu(k)?(t.consume(k),A):S(k)}function S(k){return on(k)?(o=S,F(k)):bi(k)?(t.consume(k),S):N(k)}function I(k){return k===45||fu(k)?(t.consume(k),I):k===47||k===62||Dc(k)?D(k):r(k)}function D(k){return k===47?(t.consume(k),N):k===58||k===95||Sp(k)?(t.consume(k),L):on(k)?(o=D,F(k)):bi(k)?(t.consume(k),D):N(k)}function L(k){return k===45||k===46||k===58||k===95||fu(k)?(t.consume(k),L):O(k)}function O(k){return k===61?(t.consume(k),P):on(k)?(o=O,F(k)):bi(k)?(t.consume(k),O):D(k)}function P(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(t.consume(k),i=k,x):on(k)?(o=P,F(k)):bi(k)?(t.consume(k),P):(t.consume(k),T)}function x(k){return k===i?(t.consume(k),i=void 0,E):k===null?r(k):on(k)?(o=x,F(k)):(t.consume(k),x)}function T(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||Dc(k)?D(k):(t.consume(k),T)}function E(k){return k===47||k===62||Dc(k)?D(k):r(k)}function N(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):r(k)}function F(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),B}function B(k){return bi(k)?oa(t,j,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):j(k)}function j(k){return t.enter("htmlTextData"),o(k)}}const Yne={name:"labelEnd",tokenize:Rvr,resolveTo:Pvr,resolveAll:kvr},Tvr={tokenize:Mvr},Evr={tokenize:Dvr},Ivr={tokenize:Nvr};function kvr(t){let e=-1;for(;++e=3&&(c===null||on(c))?(t.exit("thematicBreak"),e(c)):r(c)}function l(c){return c===i?(t.consume(c),n++,l):(t.exit("thematicBreakSequence"),bi(c)?oa(t,s,"whitespace")(c):s(c))}}const cc={name:"list",tokenize:Hvr,continuation:{tokenize:Vvr},exit:Wvr},Uvr={tokenize:qvr,partial:!0},zvr={tokenize:Gvr,partial:!0};function Hvr(t,e,r){const n=this,i=n.events[n.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(h){const p=n.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||h===n.containerState.marker:hQ(h)){if(n.containerState.type||(n.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(TM,r,c)(h):c(h);if(!n.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return r(h)}function l(h){return hQ(h)&&++o<10?(t.consume(h),l):(!n.interrupt||o<2)&&(n.containerState.marker?h===n.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):r(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||h,t.check(nF,n.interrupt?r:u,t.attempt(Uvr,d,f))}function u(h){return n.containerState.initialBlankLine=!0,a++,d(h)}function f(h){return bi(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):r(h)}function d(h){return n.containerState.size=a+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function Vvr(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(nF,i,a);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,oa(t,e,"listItemIndent",n.containerState.size+1)(s)}function a(s){return n.containerState.furtherBlankLines||!bi(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(zvr,e,o)(s))}function o(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,oa(t,t.attempt(cc,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Gvr(t,e,r){const n=this;return oa(t,i,"listItemIndent",n.containerState.size+1);function i(a){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(a):r(a)}}function Wvr(t){t.exit(this.containerState.type)}function qvr(t,e,r){const n=this;return oa(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=n.events[n.events.length-1];return!bi(a)&&o&&o[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}const f2e={name:"setextUnderline",tokenize:Kvr,resolveTo:Yvr};function Yvr(t,e){let r=t.length,n,i,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);const o={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",a?(t.splice(i,0,["enter",o,e]),t.splice(a+1,0,["exit",t[n][1],e]),t[n][1].end=Object.assign({},t[a][1].end)):t[n][1]=o,t.push(["exit",o,e]),t}function Kvr(t,e,r){const n=this;let i;return a;function a(c){let u=n.events.length,f;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){f=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=c,o(c)):r(c)}function o(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),bi(c)?oa(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||on(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}const Zvr={tokenize:Qvr};function Qvr(t){const e=this,r=t.attempt(nF,n,t.attempt(this.parser.constructs.flowInitial,i,oa(t,t.attempt(this.parser.constructs.flow,i,t.attempt(rvr,i)),"linePrefix")));return r;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}const Xvr={resolveAll:NDe()},Jvr=DDe("string"),emr=DDe("text");function DDe(t){return{tokenize:e,resolveAll:NDe(t==="text"?tmr:void 0)};function e(r){const n=this,i=this.parser.constructs[t],a=r.attempt(i,o,s);return o;function o(u){return c(u)?a(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),a(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const s=o[0];typeof s=="string"?o[0]=s.slice(n):o.shift()}a>0&&o.push(t[i].slice(0,a))}return o}function imr(t,e){let r=-1;const n=[];let i;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCharCode(r)}const ymr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wmr(t){return t.replace(ymr,bmr)}function bmr(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),a=i===120||i===88;return ODe(r.slice(a?2:1),a?16:10)}return qne(r)||t}const LDe={}.hasOwnProperty,xmr=function(t,e,r){return typeof e!="string"&&(r=e,e=void 0),_mr(r)(mmr(gmr(r).document().write(vmr()(t,e,!0))))};function _mr(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ce),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(nt),blockQuote:s(oe),characterEscape:O,characterReference:O,codeFenced:s(ye),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(ye,l),codeText:s(Te,l),codeTextData:O,data:O,codeFlowValue:O,definition:s(Me),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Oe),hardBreakEscape:s(it),hardBreakTrailing:s(it),htmlFlow:s(St,l),htmlFlowData:O,htmlText:s(St,l),htmlTextData:O,image:s(bt),label:l,link:s(Ce),listItem:s(Le),listItemValue:p,listOrdered:s(We,h),listUnordered:s(We),paragraph:s(Ke),reference:W,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(nt),strong:s(qe),thematicBreak:s(Se)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:V,autolinkProtocol:ne,blockQuote:u(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ee,codeFenced:u(m),codeFencedFence:y,codeFencedFenceInfo:g,codeFencedFenceMeta:v,codeFlowValue:P,codeIndented:u(b),codeText:u(F),codeTextData:P,data:P,definition:u(),definitionDestinationString:A,definitionLabelString:w,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(E),htmlFlowData:P,htmlText:u(N),htmlTextData:P,image:u(j),label:$,labelText:k,lineEnding:x,link:u(B),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Q,resourceDestinationString:H,resourceTitleString:Y,resource:ie,setextHeading:u(L),setextHeadingLineSequence:D,setextHeadingText:I,strong:u(),thematicBreak:u()}};$De(e,(t||{}).mdastExtensions||[]);const r={};return n;function n(q){let z={type:"root",children:[]};const G={stack:[z],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:a,getData:o},re=[];let ue=-1;for(;++ue0){const _e=G.tokenStack[G.tokenStack.length-1];(_e[1]||h2e).call(G,void 0,_e[0])}for(z.position={start:om(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:om(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue{const n=this.data("settings");return xmr(r,Object.assign({},n,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Amr(t,e){const r={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,r),t.applyData(e,r)}function Tmr(t,e){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,r),[t.applyData(e,r),{type:"text",value:` -`}]}function Emr(t,e){const r=e.value?e.value+` -`:"",n=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};n&&(i.className=["language-"+n]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return e.meta&&(a.data={meta:e.meta}),t.patch(e,a),a=t.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},t.patch(e,a),a}function Imr(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function kmr(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function iC(t){const e=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const s=t.charCodeAt(r+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(e.push(t.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return e.join("")+t.slice(n)}function BDe(t,e){const r=String(e.identifier).toUpperCase(),n=iC(r.toLowerCase()),i=t.footnoteOrder.indexOf(r);let a;i===-1?(t.footnoteOrder.push(r),t.footnoteCounts[r]=1,a=t.footnoteOrder.length):(t.footnoteCounts[r]++,a=i+1);const o=t.footnoteCounts[r],s={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+n,id:t.clobberPrefix+"fnref-"+n+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return t.patch(e,l),t.applyData(e,l)}function Pmr(t,e){const r=t.footnoteById;let n=1;for(;n in r;)n++;const i=String(n);return r[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:e.children}],position:e.position},BDe(t,{type:"footnoteReference",identifier:i,position:e.position})}function Rmr(t,e){const r={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Mmr(t,e){if(t.dangerous){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}return null}function FDe(t,e){const r=e.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+n};const i=t.all(e),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function Dmr(t,e){const r=t.definition(e.identifier);if(!r)return FDe(t,e);const n={src:iC(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(n.title=r.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function Nmr(t,e){const r={src:iC(e.url)};e.alt!==null&&e.alt!==void 0&&(r.alt=e.alt),e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,n),t.applyData(e,n)}function Omr(t,e){const r={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(e,n),t.applyData(e,n)}function Lmr(t,e){const r=t.definition(e.identifier);if(!r)return FDe(t,e);const n={href:iC(r.url||"")};r.title!==null&&r.title!==void 0&&(n.title=r.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function $mr(t,e){const r={href:iC(e.url)};e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Bmr(t,e,r){const n=t.all(e),i=r?Fmr(r):jDe(e),a={},o=[];if(typeof e.checked=="boolean"){const u=n[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},n.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s1}function jmr(t,e){const r={},n=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++i-1?n.offset:null}}}function Gmr(t,e){const r=t.all(e),n=r.shift(),i=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],o),i.push(o)}if(r.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},s=Kne(e.children[1]),l=Zne(e.children[e.children.length-1]);s.line&&l.line&&(o.position={start:s,end:l}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function Wmr(t,e,r){const n=r?r.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,s=o?o.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),n[0]),i=n.index+n[0].length,n=r.exec(e);return a.push(v2e(e.slice(i),i>0,!1)),a.join("")}function v2e(t,e,r){let n=0,i=t.length;if(e){let a=t.codePointAt(n);for(;a===p2e||a===g2e;)n++,a=t.codePointAt(n)}if(r){let a=t.codePointAt(i-1);for(;a===p2e||a===g2e;)i--,a=t.codePointAt(i-1)}return i>n?t.slice(n,i):""}function Kmr(t,e){const r={type:"text",value:Ymr(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function Zmr(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const Qmr={blockquote:Amr,break:Tmr,code:Emr,delete:Imr,emphasis:kmr,footnoteReference:BDe,footnote:Pmr,heading:Rmr,html:Mmr,imageReference:Dmr,image:Nmr,inlineCode:Omr,linkReference:Lmr,link:$mr,listItem:Bmr,list:jmr,paragraph:Umr,root:zmr,strong:Hmr,table:Gmr,tableCell:qmr,tableRow:Wmr,text:Kmr,thematicBreak:Zmr,toml:Yk,yaml:Yk,definition:Yk,footnoteDefinition:Yk};function Yk(){return null}const zDe=function(t){if(t==null)return t1r;if(typeof t=="string")return e1r(t);if(typeof t=="object")return Array.isArray(t)?Xmr(t):Jmr(t);if(typeof t=="function")return iF(t);throw new Error("Expected function, string, or object as test")};function Xmr(t){const e=[];let r=-1;for(;++r":""))+")"})}return f;function f(){let d=[],h,p,g;if((!e||i(s,l,c[c.length-1]||null))&&(d=a1r(r(s,c)),d[0]===m2e))return d;if(s.children&&d[0]!==n1r)for(p=(n?s.children.length:-1)+a,g=c.concat(s);p>-1&&p{const i=w2e(n.identifier);i&&!y2e.call(e,i)&&(e[i]=n)}),r;function r(n){const i=w2e(n);return i&&y2e.call(e,i)?e[i]:null}}function w2e(t){return String(t||"").toUpperCase()}const ZO={}.hasOwnProperty;function l1r(t,e){const r=e||{},n=r.allowDangerousHtml||!1,i={};return o.dangerous=n,o.clobberPrefix=r.clobberPrefix===void 0||r.clobberPrefix===null?"user-content-":r.clobberPrefix,o.footnoteLabel=r.footnoteLabel||"Footnotes",o.footnoteLabelTagName=r.footnoteLabelTagName||"h2",o.footnoteLabelProperties=r.footnoteLabelProperties||{className:["sr-only"]},o.footnoteBackLabel=r.footnoteBackLabel||"Back to content",o.unknownHandler=r.unknownHandler,o.passThrough=r.passThrough,o.handlers={...Qmr,...r.handlers},o.definition=s1r(t),o.footnoteById=i,o.footnoteOrder=[],o.footnoteCounts={},o.patch=c1r,o.applyData=u1r,o.one=s,o.all=l,o.wrap=d1r,o.augment=a,Qne(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();ZO.call(i,u)||(i[u]=c)}),o;function a(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};o1r(f)||(u.position={start:Kne(f),end:Zne(f)})}return u}function o(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),a(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function s(c,u){return HDe(o,c,u)}function l(c){return Xne(o,c)}}function c1r(t,e){t.position&&(e.position=Vmr(t))}function u1r(t,e){let r=e;if(t&&t.data){const n=t.data.hName,i=t.data.hChildren,a=t.data.hProperties;typeof n=="string"&&(r.type==="element"?r.tagName=n:r={type:"element",tagName:n,properties:{},children:[]}),r.type==="element"&&a&&(r.properties={...r.properties,...a}),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function HDe(t,e,r){const n=e&&e.type;if(!n)throw new Error("Expected node, got `"+e+"`");return ZO.call(t.handlers,n)?t.handlers[n](t,e,r):t.passThrough&&t.passThrough.includes(n)?"children"in e?{...e,children:Xne(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,r):f1r(t,e)}function Xne(t,e){const r=[];if("children"in e){const n=e.children;let i=-1;for(;++i0&&r.push({type:"text",value:` -`}),r}function h1r(t){const e=[];let r=-1;for(;++r1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:t.clobberPrefix+"fn-"+o},children:t.wrap(i,!0)};t.patch(n,u),e.push(u)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:t.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(t.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:t.footnoteLabel}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:t.wrap(e,!0)},{type:"text",value:` -`}]}}function VDe(t,e){const r=l1r(t,e),n=r.one(t,null),i=h1r(r);return i&&n.children.push({type:"text",value:` -`},i),Array.isArray(n)?{type:"root",children:n}:n}const p1r=function(t,e){return t&&"run"in t?g1r(t,e):v1r(t||e)};function g1r(t,e){return(r,n,i)=>{t.run(VDe(r,e),n,a=>{i(a)})}}function v1r(t){return e=>VDe(e,t)}class k9{constructor(e,r,n){this.property=e,this.normal=r,n&&(this.space=n)}}k9.prototype.property={};k9.prototype.normal={};k9.prototype.space=null;function GDe(t,e){const r={},n={};let i=-1;for(;++i4&&r.slice(0,4)==="data"&&x1r.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(x2e,A1r);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!x2e.test(a)){let o=a.replace(_1r,C1r);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=Jne}return new i(n,e)}function C1r(t){return"-"+t.toLowerCase()}function A1r(t){return t.charAt(1).toUpperCase()}const _2e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},T1r=GDe([YDe,qDe,QDe,XDe,w1r],"html"),E1r=GDe([YDe,qDe,QDe,XDe,b1r],"svg");function I1r(t){if(t.allowedElements&&t.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(t.allowedElements||t.disallowedElements||t.allowElement)return e=>{Qne(e,"element",(r,n,i)=>{const a=i;let o;if(t.allowedElements?o=!t.allowedElements.includes(r.tagName):t.disallowedElements&&(o=t.disallowedElements.includes(r.tagName)),!o&&t.allowElement&&typeof n=="number"&&(o=!t.allowElement(r,n,a)),o&&typeof n=="number")return t.unwrapDisallowed&&r.children?a.children.splice(n,1,...r.children):a.children.splice(n,1),n})}}var JDe={exports:{}},Oi={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var eie=Symbol.for("react.element"),tie=Symbol.for("react.portal"),aF=Symbol.for("react.fragment"),oF=Symbol.for("react.strict_mode"),sF=Symbol.for("react.profiler"),lF=Symbol.for("react.provider"),cF=Symbol.for("react.context"),k1r=Symbol.for("react.server_context"),uF=Symbol.for("react.forward_ref"),fF=Symbol.for("react.suspense"),dF=Symbol.for("react.suspense_list"),hF=Symbol.for("react.memo"),pF=Symbol.for("react.lazy"),P1r=Symbol.for("react.offscreen"),eNe;eNe=Symbol.for("react.module.reference");function ud(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case eie:switch(t=t.type,t){case aF:case sF:case oF:case fF:case dF:return t;default:switch(t=t&&t.$$typeof,t){case k1r:case cF:case uF:case pF:case hF:case lF:return t;default:return e}}case tie:return e}}}Oi.ContextConsumer=cF;Oi.ContextProvider=lF;Oi.Element=eie;Oi.ForwardRef=uF;Oi.Fragment=aF;Oi.Lazy=pF;Oi.Memo=hF;Oi.Portal=tie;Oi.Profiler=sF;Oi.StrictMode=oF;Oi.Suspense=fF;Oi.SuspenseList=dF;Oi.isAsyncMode=function(){return!1};Oi.isConcurrentMode=function(){return!1};Oi.isContextConsumer=function(t){return ud(t)===cF};Oi.isContextProvider=function(t){return ud(t)===lF};Oi.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===eie};Oi.isForwardRef=function(t){return ud(t)===uF};Oi.isFragment=function(t){return ud(t)===aF};Oi.isLazy=function(t){return ud(t)===pF};Oi.isMemo=function(t){return ud(t)===hF};Oi.isPortal=function(t){return ud(t)===tie};Oi.isProfiler=function(t){return ud(t)===sF};Oi.isStrictMode=function(t){return ud(t)===oF};Oi.isSuspense=function(t){return ud(t)===fF};Oi.isSuspenseList=function(t){return ud(t)===dF};Oi.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===aF||t===sF||t===oF||t===fF||t===dF||t===P1r||typeof t=="object"&&t!==null&&(t.$$typeof===pF||t.$$typeof===hF||t.$$typeof===lF||t.$$typeof===cF||t.$$typeof===uF||t.$$typeof===eNe||t.getModuleId!==void 0)};Oi.typeOf=ud;JDe.exports=Oi;var R1r=JDe.exports;const M1r=Un(R1r);function D1r(t){const e=t&&typeof t=="object"&&t.type==="text"?t.value||"":t;return typeof e=="string"&&e.replace(/[ \t\n\f\r]/g,"")===""}function N1r(t){return t.join(" ").trim()}function O1r(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var S2e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,L1r=/\n/g,$1r=/^\s*/,B1r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,F1r=/^:\s*/,j1r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,U1r=/^[;\s]*/,z1r=/^\s+|\s+$/g,H1r=` -`,C2e="/",A2e="*",Bw="",V1r="comment",G1r="declaration",W1r=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var r=1,n=1;function i(p){var g=p.match(L1r);g&&(r+=g.length);var v=p.lastIndexOf(H1r);n=~v?p.length-v:n+p.length}function a(){var p={line:r,column:n};return function(g){return g.position=new o(p),c(),g}}function o(p){this.start=p,this.end={line:r,column:n},this.source=e.source}o.prototype.content=t;function s(p){var g=new Error(e.source+":"+r+":"+n+": "+p);if(g.reason=p,g.filename=e.source,g.line=r,g.column=n,g.source=t,!e.silent)throw g}function l(p){var g=p.exec(t);if(g){var v=g[0];return i(v),t=t.slice(v.length),g}}function c(){l($1r)}function u(p){var g;for(p=p||[];g=f();)g!==!1&&p.push(g);return p}function f(){var p=a();if(!(C2e!=t.charAt(0)||A2e!=t.charAt(1))){for(var g=2;Bw!=t.charAt(g)&&(A2e!=t.charAt(g)||C2e!=t.charAt(g+1));)++g;if(g+=2,Bw===t.charAt(g-1))return s("End of comment missing");var v=t.slice(2,g-2);return n+=2,i(v),t=t.slice(g),n+=2,p({type:V1r,comment:v})}}function d(){var p=a(),g=l(B1r);if(g){if(f(),!l(F1r))return s("property missing ':'");var v=l(j1r),y=p({type:G1r,property:T2e(g[0].replace(S2e,Bw)),value:v?T2e(v[0].replace(S2e,Bw)):Bw});return l(U1r),y}}function h(){var p=[];u(p);for(var g;g=d();)g!==!1&&(p.push(g),u(p));return p}return c(),h()};function T2e(t){return t?t.replace(z1r,Bw):Bw}var q1r=W1r;function Y1r(t,e){var r=null;if(!t||typeof t!="string")return r;for(var n,i=q1r(t),a=typeof e=="function",o,s,l=0,c=i.length;l0?Re.createElement(d,s,u):Re.createElement(d,s)}function J1r(t){let e=-1;for(;++eString(e)).join("")}const E2e={}.hasOwnProperty,iyr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Kk={plugins:{to:"plugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function rie(t){for(const a in Kk)if(E2e.call(Kk,a)&&E2e.call(t,a)){const o=Kk[a];console.warn(`[react-markdown] Warning: please ${o.to?`use \`${o.to}\` instead of`:"remove"} \`${a}\` (see <${iyr}#${o.id}> for more info)`),delete Kk[a]}const e=ggr().use(Cmr).use(t.remarkPlugins||[]).use(p1r,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(I1r,t),r=new xDe;typeof t.children=="string"?r.value=t.children:t.children!==void 0&&t.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${t.children}\`)`);const n=e.runSync(e.parse(r),r);if(n.type!=="root")throw new TypeError("Expected a `root` node");let i=Re.createElement(Re.Fragment,{},tNe({options:t,schema:T1r,listDepth:0},n));return t.className&&(i=Re.createElement("div",{className:t.className},i)),i}rie.defaultProps={transformLinkUri:Z0r};rie.propTypes={children:Ie.string,className:Ie.string,allowElement:Ie.func,allowedElements:Ie.arrayOf(Ie.string),disallowedElements:Ie.arrayOf(Ie.string),unwrapDisallowed:Ie.bool,remarkPlugins:Ie.arrayOf(Ie.oneOfType([Ie.object,Ie.func,Ie.arrayOf(Ie.oneOfType([Ie.bool,Ie.string,Ie.object,Ie.func,Ie.arrayOf(Ie.any)]))])),rehypePlugins:Ie.arrayOf(Ie.oneOfType([Ie.object,Ie.func,Ie.arrayOf(Ie.oneOfType([Ie.bool,Ie.string,Ie.object,Ie.func,Ie.arrayOf(Ie.any)]))])),sourcePos:Ie.bool,rawSourcePos:Ie.bool,skipHtml:Ie.bool,includeElementIndex:Ie.bool,transformLinkUri:Ie.oneOfType([Ie.func,Ie.bool]),linkTarget:Ie.oneOfType([Ie.func,Ie.string]),transformImageUri:Ie.func,components:Ie.object};const ayr=se.div` - display: flex; -`,I2e=se.div` - cursor: pointer; - display: flex; - align-items: center; - ${({disabled:t})=>t&&"cursor: not-allowed;"} -`,oyr=se.div` - user-select: none; - margin: 0 10px; -`,syr=({prevId:t,nextId:e})=>{const{announcementId:r}=Gr(),n=jS(),i=e&&e!=="",a=t&&t!=="",o=s=>{const l=s==="back"?t:e;n.push(`/announcement/${l}`)};return M.jsxs(ayr,{children:[M.jsx(I2e,{disabled:!a,onClick:()=>a&&o("back"),children:M.jsx(Lr,{icon:"CHEVRON",size:"1.3rem",color:a?"ICON_PRIMARY":"ICON_DISABLED"})}),M.jsx(oyr,{children:r}),M.jsx(I2e,{disabled:!i,onClick:()=>i&&o("forward"),children:M.jsx(Lr,{icon:"CHEVRON",size:"1.3rem",spin:"180",color:i?"ICON_PRIMARY":"ICON_DISABLED"})})]})},lyr=se.div` - padding-top: 20px; - font-size: 3.0rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - align-self: center; -`,cyr=se.div` - font-size: 1.4rem; -`,uyr=()=>{const{announcementInfo:t,announcementInfoLoading:e,getAnnouncementInfo:r}=yte(),{announcementId:n}=Gr();Z.useEffect(()=>{r({id:n})},[r,n]);const{title:i,id:a,timestamp:o,body:s,nextId:l,prevId:c}=t;return M.jsxs(Ni,{children:[M.jsx(to,{title:`Announcement ${a}`,children:M.jsx(syr,{nextId:l,prevId:c})}),e||Rn(t)?M.jsx(Br,{}):M.jsxs(M.Fragment,{children:[M.jsx(cr,{header:!0,children:M.jsx(lyr,{children:i})}),M.jsx(cyr,{children:`Posted on ${o.slice(0,10)}`}),M.jsx(rie,{children:s})]})]})},fyr=se.div` - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - width: 100%; -`,dyr=se.div` - font-size: 2rem; - color: ${({theme:t})=>t.FONT_PRIMARY}; - margin: 40px 0; - flex-basis: 100%; - text-align: center; -`,hyr=se.button` - width: 100%; - cursor: pointer; - border-radius: 4px; - color: ${({theme:t})=>t.BUTTON_PRIMARY_FONT}; - background: ${({theme:t})=>t.BUTTON_PRIMARY}; - padding: 20px; - margin: 10px; - :first-child { - margin-top: 20px; - } - &:focus { - background: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - border-color: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - } - &:hover { - background: ${({theme:t})=>t.BUTTON_PRIMARY_HOVER}; - border-color: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - } - &:active { - background: ${({theme:t})=>t.BUTTON_PRIMARY_ACTIVE}; - border-color: ${({theme:t})=>t.BUTTON_PRIMARY_FOCUS}; - } -`,pyr=se.div` - display: flex; - font-size: 1.4rem; -`,gyr=se.div` - align-self: center; -`,vyr=se.div` - margin: 10px; - text-align: left; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,myr=se.div` - margin: 10px; - margin-left: auto; -`,yyr=()=>{const{matches:t}=Qr(_t.down("md")),e=jS(),r=c=>{const u=`/announcement/${c}`;e.push(u)},{allAnnouncements:n,allAnnouncementsLoading:i,allAnnouncementsPages:a,getAnnouncementsAll:o}=yte(),s=Z.useCallback(c=>{o({fromDate:"",page:c,count:30})},[o]);Z.useEffect(()=>{s(1)},[s]);const l=()=>i?M.jsx(Br,{}):n.map(c=>{const u=c.title,f=c.id,d=c.timestamp.slice(0,10),h=M.jsxs(pyr,{children:[M.jsx(gyr,{children:`${f}.`}),M.jsx(vyr,{children:u}),M.jsx(myr,{children:t?"":d})]});return M.jsx(hyr,{onClick:()=>r(f),children:h},f)});return M.jsx(M.Fragment,{children:!i&&n.length>0?M.jsx(ln,{children:M.jsx(cB,{loading:i,onLoadMore:s,totalPages:a,children:({sentryRef:c,hasNextPage:u})=>M.jsxs(M.Fragment,{children:[l(),(u||i)&&M.jsx(Br,{ref:c})]})})}):i?M.jsx(Br,{}):M.jsx(fyr,{children:M.jsx(dyr,{children:` - There aren't any announcements yet, but check back soon! - `})})})},wyr=()=>M.jsxs(Ni,{children:[M.jsx(to,{title:"All Announcements"}),M.jsx(cr,{header:!0,children:M.jsx(yyr,{})})]}),byr=()=>{const{tableCount:t}=Ki(),[e,r]=Z.useState(1),{assetId:n}=Gr(),{getAssetHolders:i,assetHolders:a,assetHoldersLoading:o,assetHoldersPages:s}=Av();Z.useEffect(()=>{i({assetId:n,page:e,count:t})},[i,n,t,e]);const l=[{displayName:"Address",dataName:"ownerAddress"},{displayName:"Quantity",dataName:"balance"},{displayName:"Percentage",dataName:"percentageHolders"}];return M.jsx(cn,{tableHeaders:l,tableData:a,currentPage:e,changePage:r,resultsPerPage:t,totalPages:s,isLoading:o,title:"Asset Holders",showIndex:"Rank"})},xyr=se.div` - white-space: nowrap; -`,_yr=()=>{var P,x,T,E,N,F;const[t,e]=Z.useState(!1),{assetId:r}=Gr(),{getAssetInfo:n,assetInfo:i,totalBalancePrice:a,assetInfoLoading:o,assetMetadata:s}=Av();Z.useEffect(()=>{n(r)},[r,n]);const{marker:l,holdingAccount:c,supply:{amount:u,denom:f}={},mintable:d,holderCount:h,txnCount:p,markerStatus:g,markerType:v,tokens:{fungibleCount:y,nonFungibleCount:m}={}}=i,b=s.find(B=>B.base===l),w=(b==null?void 0:b.display)||l,C=((x=(P=b==null?void 0:b.denomUnits)==null?void 0:P.find(B=>B.denom===(b==null?void 0:b.display)))==null?void 0:x.exponent)||0,{amount:A,denom:S}=d3(1,w,!0);let I=((E=(T=i==null?void 0:i.supply)==null?void 0:T.pricePerToken)==null?void 0:E.amount)||"-- --";C&&I!=="-- --"&&(I=I*10**C);const D=((F=(N=i==null?void 0:i.supply)==null?void 0:N.pricePerToken)==null?void 0:F.denom)||"-- --",L={visibility:{visible:t,setVisible:e},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{hideTitle:!0,title:"Conversion:",value:M.jsxs(xyr,{children:["1 ",w," = ",A," ",S]})}]},O=[{title:"Asset Name",value:(b==null?void 0:b.display)||l},{title:"Holding Account",value:c,link:`/accounts/${c}`,copy:c},{title:"Supply",value:zt(u,f,{decimals:3,shorthand:!0,showDenom:!1})},{title:"Mintable",value:`${d}`},{title:"Min Unit",value:l,popupNote:L},{title:"Decimal",value:C},{title:"Holders",value:h},{title:"Transactions",value:Qn(p)},{title:"Marker Status",value:Kr(g)},{title:"Marker Type",value:Kr(v)},{title:"Fungible Tokens",value:Qn(y)},{title:"Non-Fungible Tokens",value:Qn(m),link:`/nfts/${c}`},{title:"Price Per Unit",value:I==="-- --"?I:`$${zt(I,D,{decimal:2,minimumFractionDigits:2})}`},{title:"Total Value",value:a==="-- --"?a:`$${a}`}];return M.jsx(ln,{title:"Asset Information",children:o?M.jsx(Br,{}):M.jsx(jo,{data:O})})},Syr=()=>{const[t,e]=Z.useState(1),[r,n]=Z.useState(1),[i,a]=Z.useState(0),[o,s]=Z.useState([]),{assetId:l}=Gr(),{getAssetAdminTransactions:c,assetAdminTransactions:u,assetAdminTransactionsLoading:f,assetAdminTransactionsPages:d,getAssetTransferTransactions:h,assetTransferTransactions:p,assetTransferTransactionsLoading:g,assetTransferTransactionsPages:v}=Av(),{tableCount:y}=Ki();Z.useEffect(()=>{i===0&&!o.includes(0)&&(s([...o,0]),c({page:t,count:y,denom:l}))},[c,l,y,t,i,o]),Z.useEffect(()=>{i===1&&!o.includes(1)&&(s([...o,1]),h({page:r,count:y,denom:l}))},[h,l,y,r,i,o]);const m=A=>{s(o.filter(S=>S!==0)),e(A)},b=A=>{s(o.filter(S=>S!==1)),n(A)},w=[{displayName:"TxHash",dataName:"txHash"},{displayName:"Block",dataName:"block"},{displayName:"TxType",dataName:"txType"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}],C=[{displayName:"TxHash",dataName:"txHash"},{displayName:"Block",dataName:"block"},{displayName:"TxType",dataName:"txType"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}];return M.jsxs(Tv,{active:i,setActive:a,children:[M.jsx(cn,{tableHeaders:w,tableData:u,currentPage:t,changePage:m,totalPages:d,isLoading:f,showAge:"time"},"Admin Transaction List"),M.jsx(cn,{tableHeaders:C,tableData:p,currentPage:r,changePage:b,totalPages:v,isLoading:g,showAge:"time"},"Transfer Transaction List")]})},Cyr=se(cn)` - & > div { - padding: 20px 0; - border: none; - } -`,Ayr=()=>{const{assetInfo:{managingAccounts:{allowGovControl:t,managers:e={}}={}}={},assetInfoLoading:r}=Av(),n=[{title:"Allow Governance",value:Kr(`${t}`)}],i=[{displayName:"Address",dataName:"manager"},{displayName:"Permissions",dataName:"permissions"}],a=Object.keys(e||{}).reduce((o,s)=>[...o,{manager:s,permissions:e[s]}],[]);return M.jsx(ln,{title:"Managing Accounts",children:r?M.jsx(Br,{}):M.jsxs(Z.Fragment,{children:[M.jsx(jo,{data:n}),M.jsx(Cyr,{tableHeaders:i,tableData:a,isLoading:r})]})})},Tyr=()=>{var i;const{assetMetadata:t,getAssetMetadata:e}=Av(),{assetId:r}=Gr();Z.useEffect(()=>{e()},[e]);const n=((i=t.find(a=>a.base===r))==null?void 0:i.display)||r;return M.jsxs(Ni,{children:[M.jsx(to,{title:"Asset Details",value:n,copyValue:n,copyTitle:`Copy Asset Name ${n}`}),M.jsx(cr,{header:!0,children:M.jsx(_yr,{})}),M.jsx(cr,{children:M.jsx(Ayr,{})}),M.jsx(cr,{children:M.jsx(byr,{})}),M.jsx(cr,{children:M.jsx(Syr,{})})]})},Eyr=()=>{const[t,e]=Z.useState(1),{tableCount:r}=Ki(),{assets:n,assetsLoading:i,assetsPages:a,assetMetadata:o,getAssetMetadata:s,getAssetsList:l}=Av(),c=n.map(f=>{var d,h,p,g;return{...f,displayDenom:(d=o.find(v=>v.base===f.marker))==null?void 0:d.display,exponent:((g=(p=(h=o.find(v=>v.base===f.marker))==null?void 0:h.denomUnits)==null?void 0:p.find(v=>!!v.exponent))==null?void 0:g.exponent)||0}});Z.useEffect(()=>{l({page:t,count:r}),s()},[l,r,t,s]);const u=[{displayName:"Name",dataName:"marker"},{displayName:"Total Supply",dataName:"supply"},{displayName:"Price Per Unit",dataName:"supply.pricePerToken"},{displayName:"Total Value",dataName:"totalBalancePrice"},{displayName:"Holding Account",dataName:"holdingAccount"},{displayName:"Marker Type",dataName:"markerType"},{displayName:"Last Tx",dataName:"lastTxTimestamp"}];return M.jsx(cn,{showAge:"lastTxTimestamp",tableHeaders:u,tableData:c,currentPage:t,changePage:e,totalPages:a,isLoading:i,title:"Assets List"})},Iyr=se.div` - justify-content: flex-end; - margin-left: auto; - font-weight: 500; - font-size: 2.5rem; - @media ${_t.between("xs","sm","md")} { - font-size: 1.8rem; - } -`,kyr=()=>{const{blockLatest:t,getBlockSpotlight:e,blockSpotlightFailed:r,blockSpotlightLoading:n}=wy(),{totalAum:i={}}=t;Z.useEffect(()=>{e()},[e]),sx(()=>!n&&e(),iS.totalAum,r);const a=`$${zt(i.amount,i.denom,{decimal:2,minimumFractionDigits:2})}`;return M.jsx(ln,{icon:"PROVENANCE",title:"Chain Value",headerContent:M.jsx(Iyr,{children:a}),headerMargin:"0 0 0px"})},Pyr=()=>M.jsxs(Ni,{children:[M.jsx(to,{title:"All Assets"}),M.jsx(cr,{header:!0,children:M.jsx(kyr,{})}),M.jsx(cr,{children:M.jsx(Eyr,{})})]}),Ryr=()=>{const[t,e]=Z.useState(!1),[r,n]=Z.useState(""),{blockHeight:i}=Gr(),{blockInfo:a,getBlockInfo:o,blockInfoLoading:s}=wy();Z.useEffect(()=>{!t&&i&&!isNaN(i)&&(o(i),n(i),e(!0))},[o,t,e,i]),Z.useEffect(()=>{t&&i!==r&&(o(i),n(i))},[i,o,t,n,r]);const{hash:l,proposerAddress:c,moniker:u,votingPower:f={},txNum:d,validatorCount:h={},time:p,userName:g}=a,{count:v,total:y}=f,{count:m,total:b}=h,w=Wi(p),C=Qn(v/y*100,2),A=[{title:"Block Hash",value:Rr(l,20,3),copy:l},{title:"Proposer",value:g||Rr(u,20,5),link:`/validator/${c}`,copy:c},{title:"Validators",value:`${m} / ${b}`},{title:"Voting Power",value:`${Qn(C,2)}%`},{title:"Transactions",value:d},{title:"Timestamp",value:`${w}+UTC`}];return M.jsx(ln,{size:"100%",children:s?M.jsx(Br,{}):M.jsx(jo,{data:A})})},Myr=se.div` - display: flex; -`,k2e=se.div` - cursor: pointer; - display: flex; - align-items: center; - ${({disabled:t})=>t&&"cursor: not-allowed;"} -`,Dyr=se.div` - user-select: none; - margin: 0 10px; -`,Nyr=()=>{const{getBlocksHeight:t,blocksHeight:e}=wy(),{blockHeight:r}=Gr();Z.useEffect(()=>{t()},[r,t]);const n=jS(),i=parseInt(r),a=i1,s=l=>{const c=l==="back"?i-1:i+1;n.push(`/block/${c}`)};return M.jsxs(Myr,{children:[M.jsx(k2e,{disabled:!o,onClick:()=>o&&s("back"),children:M.jsx(Lr,{icon:"CHEVRON",size:"1.3rem",color:o?"ICON_PRIMARY":"ICON_DISABLED"})}),M.jsx(Dyr,{children:i}),M.jsx(k2e,{disabled:!a,onClick:()=>a&&s("forward"),children:M.jsx(Lr,{icon:"CHEVRON",size:"1.3rem",spin:"180",color:a?"ICON_PRIMARY":"ICON_DISABLED"})})]})},Oyr=()=>{const[t,e]=Z.useState(1),{getBlockValidators:r,blockValidators:n,blockValidatorsLoading:i,blockValidatorsPages:a}=js(),{tableCount:o}=Ki(),{blockHeight:s}=Gr();Z.useEffect(()=>{r({blockHeight:s,page:t,count:o})},[r,o,t,s]);const l=[{displayName:"Moniker",dataName:"moniker"},{displayName:"Operator",dataName:"addressId"},{displayName:"Voted",dataName:"didVote",alignHeaderText:"center"},{displayName:"Proposed",dataName:"isProposer",alignHeaderText:"center"},{displayName:"Consensus Address",dataName:"consensusAddress"},{displayName:"Proposer Priority",dataName:"proposerPriority"},{displayName:"Voting Power",dataName:"votingPower"}];return M.jsx(cn,{tableHeaders:l,tableData:n,currentPage:t,changePage:e,totalPages:a,isLoading:i,showIndex:!0,title:"Block Validators",noResults:`Block ${s} has no validators`})},Lyr=()=>{const[t,e]=Z.useState(1),{getTxsByBlock:r,txsByBlock:n,txsByBlockPages:i,txsByBlockLoading:a}=$u(),{blockHeight:o}=Gr(),{tableCount:s}=Ki();Z.useEffect(()=>{r({blockheight:o,page:t,count:s})},[r,o,t,s]);const l=[{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Block",dataName:"block"},{displayName:"Tx Type",dataName:"txType"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}];return M.jsx(cn,{tableHeaders:l,tableData:n,currentPage:t,resultsPerPage:s,changePage:e,totalPages:i,isLoading:a,showIndex:!0,title:"Block Transactions",noResults:`Block ${o} has no transactions`})},$yr=()=>M.jsxs(Ni,{children:[M.jsx(to,{title:"Block Details",children:M.jsx(Nyr,{})}),M.jsx(cr,{header:!0,children:M.jsx(Ryr,{})}),M.jsx(cr,{children:M.jsx(Oyr,{})}),M.jsx(cr,{children:M.jsx(Lyr,{})})]}),Byr=()=>{const[t,e]=Z.useState(1),{tableCount:r}=Ki(),{getBlocksRecent:n,blocks:i,getBlocksHeight:a,blockPages:o,blocksRecentLoading:s}=wy();Z.useEffect(()=>{n({page:t,count:r}),a()},[n,r,t,a]);const l=[{displayName:"Block",dataName:"height"},{displayName:"Proposer",dataName:"moniker"},{displayName:"Transactions",dataName:"txNum"},{displayName:"Validators",dataName:"validatorCount"},{displayName:"Voting Power",dataName:"votingPower"},{displayName:"Timestamp",dataName:"time"}];return M.jsx(cn,{tableHeaders:l,tableData:i,currentPage:t,changePage:e,totalPages:o,isLoading:s,title:"Blocks List",showAge:"time"})},Fyr=()=>{const{blocksHeight:t}=wy();return M.jsxs(Ni,{children:[M.jsx(to,{title:"Latest Block Height",value:t||"--",valueLink:t?`/block/${t}`:null}),M.jsx(cr,{header:!0,children:M.jsx(Byr,{})})]})},jyr=()=>{const{contractCode:t,contractCodeLoading:e}=Dh(),{codeId:r,creationHeight:n,creator:i,dataHash:a}=t,o=[{title:"Code ID",value:r},{title:"Creation Height",value:n,link:`/block/${n}`},{title:"Creator",value:Rr(i,14,"6"),hover:i,link:`/accounts/${i}`,copy:i},{title:"Data Hash",value:Rr(a,14,"6"),hover:a,copy:a}];return M.jsx(ln,{title:"Code Information",children:e?M.jsx(Br,{}):M.jsx(jo,{data:o})})},Uyr=se.div` - width: 100%; -`,zyr=()=>{const[t,e]=Z.useState(1),{codeId:r}=Gr(),{contractsByCode:n,contractsByCodePages:i,contractsByCodeLoading:a,getContractsByCode:o}=Dh(),s=c=>{e(c),o({id:r,page:c,count:30})},l=[{displayName:"Contract",dataName:"contractAddress"},{displayName:"Creation Height",dataName:"creationHeight"},{displayName:"Creator",dataName:"creator"},{displayName:"Code ID",dataName:"codeId"},{displayName:"Admin",dataName:"admin"},{displayName:"Description",dataName:"label"}];return M.jsx(Uyr,{children:M.jsx(cn,{tableHeaders:l,tableData:n,currentPage:t,changePage:s,totalPages:i,isLoading:a,title:"Contracts List"})})},Hyr=se.div` - width: 100%; -`,Vyr=se.div` - position: relative; - margin-bottom: 18px; -`,Gyr=se.div` - position: absolute; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,Wyr=()=>{const t="yyyy-MM-dd",[e,r]=Z.useState(1),[n,i]=Z.useState(""),[a,o]=Z.useState(""),[s,l]=Z.useState(""),[c,u]=Z.useState(""),{codeTxs:f,codeTxsPages:d,codeTxsLoading:h,getCodeTxs:p}=Dh(),{codeId:g}=Gr(),v=s.replace(/-/g,"/"),y=a.replace(/-/g,"/"),m=s?new Date(v):"",b=a?new Date(y):"",w=L=>{r(L),p({id:g,page:L,count:30,status:n,toDate:s,fromDate:a})},C=L=>{i(L==="all"?"":L)},A=()=>{const L=new Date(s),O=new Date(a);return L{if(u(""),A()){r(1);const L=s?Wi(`${s}T00:00:00`,"yyyy-MM-dd"):"",O=a?Wi(`${a}T00:00:00`,"yyyy-MM-dd"):"";p({id:g,toDate:L,fromDate:O,page:1,count:30,status:n})}},I=[{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Tx Type",dataName:"txMsgType"},{displayName:"Block",dataName:"block"},{displayName:"Fee",dataName:"txFee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"txStatus"},{displayName:"Timestamp",dataName:"txTime"}],D=[{title:"Status:",type:"dropdown",options:yL,action:C},{title:"From:",type:"datepicker",options:{placeholderText:"Pick From Date",onChange:L=>o(L?sn(L,t):""),selected:b,dateFormat:t},action:o},{title:"To:",type:"datepicker",options:{placeholderText:"Pick To Date",onChange:L=>l(L?sn(L,t):""),selected:m,dateFormat:t},action:l}];return M.jsxs(Hyr,{children:[!h&&M.jsxs(Vyr,{children:[c&&M.jsx(Gyr,{children:c}),M.jsx(Kl,{filterData:D,mustApply:{title:"Apply",action:S},flush:!0})]}),M.jsx(cn,{tableHeaders:I,tableData:f,currentPage:e,changePage:w,totalPages:d,isLoading:h,title:"Code Transactions List"})]})},qyr=()=>{const{getContractCode:t,getContractsByCode:e,contractsByCodeTotal:r,codeTxsTotal:n,getCodeTxs:i}=Dh(),{codeId:a}=Gr(),[o,s]=Z.useState(0);return Z.useEffect(()=>{t({id:a}),e({id:a,page:1,count:30}),i({id:a,page:1,count:30,status:"",fromDate:"",toDate:""})},[a,t,e,i]),M.jsxs(Ni,{children:[M.jsx(to,{title:"Code",value:a}),M.jsx(cr,{header:!0,children:M.jsxs(Tv,{active:o,setActive:s,children:[M.jsx(jyr,{},"Details"),M.jsx(zyr,{},`Contracts (${r})`),M.jsx(Wyr,{},`Transactions (${n})`)]})})]})},Yyr=()=>{const{contractDetails:t,contractDetailsLoading:e}=Dh(),{contractAddress:r,creationHeight:n,codeId:i,creator:a,admin:o,label:s}=t,l=[{title:"Contract Address",value:Rr(r,14,"6"),hover:r,copy:r},{title:"Creation Height",value:n,link:`/block/${n}`},{title:"Code ID",value:i,link:`/code/${i}`},{title:"Creator",value:Rr(a,14,"6"),hover:a,link:`/accounts/${a}`,copy:a},{title:"Admin",value:Rr(o,14,"6"),hover:o,link:`/accounts/${o}`,copy:o},{title:"Label",value:s}];return M.jsx(ln,{title:"Contract Information",children:e?M.jsx(Br,{}):M.jsx(jo,{data:l})})},BG=se(ln)` - margin-bottom: -33px; -`,Kyr=()=>{var u;const{contractHistory:t,contractHistoryLoading:e}=Dh(),{matches:r}=Qr(_t.down("md")),{operation:n,codeId:i,msg:a}=t[0],o=[{title:"Operation",value:n||"--",nobreak:!r}],s=[{title:"Code ID",value:i?Rr(i,14,"6"):"--",link:i?`/code/${i}`:"",hover:i}],l=(f,d)=>f.map(h=>d+h),c=(u=Object.entries(a))==null?void 0:u.map(([f,d])=>{const h=YX(f);switch(f){case"convertible_base_denoms":case"supported_quote_denoms":case"capital_denom":case"base_denom":return{title:h,value:Array.isArray(d)?d:Rr(d,14,"6"),link:Array.isArray(d)?void 0:`/asset/${d}`,list:Array.isArray(d)?d.map(p=>Rr(p,14,"6")):void 0,linkList:Array.isArray(d)?l(d,"/asset/"):void 0};case"approvers":case"recovery_admin":case"lp":case"executors":return{title:h,value:Array.isArray(d)?d:Rr(d,14,"6"),link:Array.isArray(d)?void 0:`/accounts/${d}`,list:Array.isArray(d)?d.map(p=>Rr(p,14,"6")):void 0,linkList:Array.isArray(d)?l(d,"/accounts/"):void 0};case"capital":case"shares":return{title:h,value:zt(Number(d.amount),d.denom,{shorthand:!0}),link:`/asset/${d.denom}`,splitOnSpace:!0};default:return{title:h,value:Array.isArray(d)?d:Rr(d,14,"6"),list:Array.isArray(d)?d.map(p=>Rr(p,20,"6")):void 0}}});return M.jsxs(M.Fragment,{children:[M.jsx(BG,{title:"Contract History",children:e?M.jsx(Br,{}):M.jsx(jo,{data:o})}),M.jsx(BG,{borderTop:"none",borderBottom:"none",children:e?M.jsx(Br,{}):M.jsx(jo,{data:s})}),M.jsx(BG,{borderTop:"none",children:e?M.jsx(Br,{}):M.jsx(jo,{data:c})})]})},Zyr=se.div` - width: 100%; -`,Qyr=se.div` - position: relative; - margin-bottom: 18px; -`,Xyr=se.div` - position: absolute; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,Jyr=()=>{const t="yyyy-MM-dd",[e,r]=Z.useState(1),[n,i]=Z.useState(""),[a,o]=Z.useState(""),[s,l]=Z.useState(""),[c,u]=Z.useState(""),{contractTxs:f,contractTxsPages:d,contractTxsLoading:h,getContractTxs:p}=Dh(),{contractId:g}=Gr(),v=s.replace(/-/g,"/"),y=a.replace(/-/g,"/"),m=s?new Date(v):"",b=a?new Date(y):"",w=L=>{r(L),p({id:g,page:L,count:30,status:n,toDate:s,fromDate:a})},C=L=>{i(L==="all"?"":L)},A=()=>{const L=new Date(s),O=new Date(a);return L{if(u(""),A()){r(1);const L=s?Wi(`${s}T00:00:00`,"yyyy-MM-dd"):"",O=a?Wi(`${a}T00:00:00`,"yyyy-MM-dd"):"";p({id:g,toDate:L,fromDate:O,page:1,count:30,status:n})}},I=[{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Tx Type",dataName:"txMsgType"},{displayName:"Block",dataName:"block"},{displayName:"Fee",dataName:"txFee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"txStatus"},{displayName:"Timestamp",dataName:"txTime"}],D=[{title:"Status:",type:"dropdown",options:yL,action:C},{title:"From:",type:"datepicker",options:{placeholderText:"Pick From Date",onChange:L=>o(L?sn(L,t):""),selected:b,dateFormat:t},action:o},{title:"To:",type:"datepicker",options:{placeholderText:"Pick To Date",onChange:L=>l(L?sn(L,t):""),selected:m,dateFormat:t},action:l}];return M.jsxs(Zyr,{children:[!h&&M.jsxs(Qyr,{children:[c&&M.jsx(Xyr,{children:c}),M.jsx(Kl,{filterData:D,mustApply:{title:"Apply",action:S},flush:!0})]}),M.jsx(cn,{tableHeaders:I,tableData:f,currentPage:e,changePage:w,totalPages:d,isLoading:h,title:"Contract Transactions List"})]})},ewr=()=>{const{matches:t}=Qr(_t.down("lg")),{contractId:e}=Gr(),{contractTxsTotal:r,getContractDetails:n,getContractHistory:i,getContractTxs:a}=Dh(),[o,s]=Z.useState(0);return Z.useEffect(()=>{n({id:e}),i({id:e}),a({id:e,page:1,count:30,status:"",fromDate:"",toDate:""})},[n,i,a,e]),M.jsxs(Ni,{children:[M.jsx(to,{title:"Contract",value:t?Rr(e,12,"6"):e,copyTitle:`Copy Contract ID ${e}`,copyValue:e}),M.jsx(cr,{header:!0,children:M.jsxs(Tv,{active:o,setActive:s,children:[M.jsx(Yyr,{},"Details"),M.jsx(Kyr,{},"History"),M.jsx(Jyr,{},`Transactions (${r})`)]})})]})},twr=se.div` - width: 100%; -`,rwr=se.div` - position: relative; - margin-bottom: 18px; -`,nwr=()=>{const[t,e]=Z.useState(1),[r,n]=Z.useState(""),[i,a]=Z.useState(""),[o,s]=Z.useState(""),{contracts:l,contractsPages:c,contractsLoading:u,getContracts:f,getContractLabels:d,contractLabels:h}=Dh();Z.useEffect(()=>{f({page:1,count:30,label:"",creator:"",admin:""}),d()},[f]);const p=m=>{e(m),f({page:m,count:30,label:r,creator:i,admin:o})},g=()=>{e(1),f({page:t,count:30,label:r,creator:i,admin:o})},v=[{displayName:"Address",dataName:"contractAddress"},{displayName:"Creator",dataName:"creator"},{displayName:"Creation Height",dataName:"creationHeight"},{displayName:"Code ID",dataName:"codeId"},{displayName:"Admin",dataName:"admin"},{displayName:"Label",dataName:"label"}],y=[{title:"Creator:",type:"text",action:a,value:i},{title:"Admin:",type:"text",action:s,value:o},{title:"Label:",type:"text",list:h,action:n,value:r}];return M.jsxs(twr,{children:[!u&&M.jsx(rwr,{children:M.jsx(Kl,{filterData:y,mustApply:{title:"Apply",action:g},flush:!0})}),M.jsx(cn,{tableHeaders:v,tableData:l,currentPage:t,changePage:p,totalPages:c,isLoading:u,title:"Contracts List"})]})},iwr=se.div` - width: 100%; -`,awr=se.div` - position: relative; - margin-bottom: 18px; -`,owr=()=>{const[t,e]=Z.useState(1),[r,n]=Z.useState(""),[i,a]=Z.useState(""),{codes:o,codesPages:s,codesLoading:l,getCodes:c}=Dh();Z.useEffect(()=>{c({page:1,count:30,hasContracts:"",creator:""})},[c]);const u=g=>{e(g),c({page:g,count:30,hasContracts:r,creator:i})},f=g=>{n(g==="all"?"":g)},d=()=>{e(1),c({page:t,count:30,hasContracts:r,creator:i})},h=[{title:"Creator:",type:"text",action:a,value:i},{title:"Status:",type:"dropdown",options:{all:{title:"All",isDefault:r===""},true:{title:"Has Contracts",isDefault:r==="true"},false:{title:"No Contracts",isDefault:r==="false"}},action:f}],p=[{displayName:"Code ID",dataName:"codeId"},{displayName:"Creation Height",dataName:"creationHeight"},{displayName:"Creator",dataName:"creator"},{displayName:"Contracts",dataName:"contractCount"},{displayName:"Data Hash",dataName:"dataHash"}];return M.jsxs(iwr,{children:[!l&&M.jsx(awr,{children:M.jsx(Kl,{filterData:h,mustApply:{title:"Apply",action:d},flush:!0})}),M.jsx(cn,{tableHeaders:p,tableData:o,currentPage:t,changePage:u,totalPages:s,isLoading:l,title:"Codes List"})]})},swr=()=>{const{contractsTotal:t,codesTotal:e}=Dh(),[r,n]=Z.useState(0);return M.jsxs(Ni,{children:[r===0?M.jsx(to,{title:"Contract List",value:`${t} total`}):M.jsx(to,{title:"Codes List",value:`${e} total`}),M.jsx(cr,{header:!0,children:M.jsxs(Tv,{active:r,setActive:n,children:[M.jsx(nwr,{},"Contracts"),M.jsx(owr,{},"Codes")]})})]})},P2e=t=>{t.forEach(e=>{e.resize()})},lwr=()=>(Z.useEffect(()=>(window.allCharts=[],window.onresize=()=>{P2e(window.allCharts)},()=>{window.allCharts.length=0,window.removeEventListener("resize",P2e(window.allCharts))})),M.jsxs(Ni,{noHeader:!0,children:[M.jsx(QN,{children:M.jsx("title",{children:"Provenance Blockchain Explorer - Dashboard"})}),M.jsx($Wt,{}),M.jsx(cr,{children:M.jsx(Pqt,{})}),M.jsxs(cr,{children:[M.jsx(vDe,{}),M.jsx(gDe,{})]}),M.jsxs(cr,{children:[M.jsx(Wpr,{}),M.jsx(wDe,{})]}),M.jsxs(cr,{children:[M.jsx(Kpr,{}),M.jsx(t0r,{})]})]}));var HE={};Object.defineProperty(HE,"__esModule",{value:!0});HE.bech32m=iNe=HE.bech32=void 0;const QO="qpzry9x8gf2tvdw0s3jn54khce6mua7l",rNe={};for(let t=0;t>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function R2e(t){let e=1;for(let r=0;r126)return"Invalid prefix ("+t+")";e=R3(e)^n>>5}e=R3(e);for(let r=0;r=r;)a-=r,s.push(i>>a&o);if(n)a>0&&s.push(i<=e)return"Excess padding";if(i<l)throw new TypeError("Exceeds length limit");o=o.toLowerCase();let c=R2e(o);if(typeof c=="string")throw new Error(c);let u=o+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");c=R3(c)^d,u+=QO.charAt(d)}for(let f=0;f<6;++f)c=R3(c);c^=e;for(let f=0;f<6;++f){const d=c>>(5-f)*5&31;u+=QO.charAt(d)}return u}function n(o,s){if(s=s||90,o.length<8)return o+" too short";if(o.length>s)return"Exceeds length limit";const l=o.toLowerCase(),c=o.toUpperCase();if(o!==l&&o!==c)return"Mixed-case string "+o;o=l;const u=o.lastIndexOf("1");if(u===-1)return"No separator character for "+o;if(u===0)return"Missing prefix for "+o;const f=o.slice(0,u),d=o.slice(u+1);if(d.length<6)return"Data too short";let h=R2e(f);if(typeof h=="string")return h;const p=[];for(let g=0;g=d.length)&&p.push(y)}return h!==e?"Invalid checksum for "+o:{prefix:f,words:p}}function i(o,s){const l=n(o,s);if(typeof l=="object")return l}function a(o,s){const l=n(o,s);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:i,decode:a,encode:r,toWords:cwr,fromWordsUnsafe:uwr,fromWords:fwr}}var iNe=HE.bech32=nNe("bech32");HE.bech32m=nNe("bech32m");const dwr=nte` - 0% { - transform: rotate3d(0); - } - 50% { - transform: rotate3d(0, 1, 0, 180deg); - } - 100% { - transform: rotate3d(0); - } -`,hwr=se.div` - display: flex; - width: 500px; - max-width: 100%; - flex-wrap: wrap; - padding: 40px 0 30px 0; - @media ${_t.down("md")} { - width: auto; - } -`,pwr=se.div` - position: relative; - justify-content: center; - margin: 10px auto 30px auto; - text-align: center; -`,gwr=se.div` - font-size: 2.4rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - flex-basis: 100%; -`,M2e=se.div` - margin: 8px 0 8px 0; -`,vwr=se.div` - position: absolute; - right: -22px; - top: -2px; - text-align: left; - display: block; - z-index: 100; -`,mwr=se.div` - flex-basis: 100%; - text-align: center; -`,ywr=se.div` - position: relative; - margin: auto; - height: 200px; - width: 200px; -`,Z4=se(Lr)` - animation: ${dwr} 2s linear infinite forwards; - position: absolute; - right: 0; - &:nth-child(1) { - animation-duration: 20000ms; - } - &:nth-child(2) { - opacity: 0.2; - animation-duration: 20200ms; - } - &:nth-child(3) { - opacity: 0.15; - animation-duration: 20400ms; - } - &:nth-child(4) { - opacity: 0.1; - animation-duration: 20600ms; - } - &:nth-child(5) { - opacity: 0.05; - animation-duration: 20800ms; - } -`,wwr=se.div` - font-size: 1.4rem; - color: ${({theme:t})=>t.FONT_ERROR}; - position: absolute; - top: -20px; - left: 10px; -`,bwr=se.div` - display: flex; - position: relative; - flex-wrap: wrap; - max-width: 100%; - width: 100%; - margin-bottom: 10px; - @media ${_t.down("md")} { - justify-content: center; - } -`,xwr=se.input` - background-color: ${({theme:t})=>t.INPUT_BG_LIGHT}; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - border-radius: 4px; - padding: 6px 10px; - min-width: 300px; - font-size: 1.4rem; - line-height: 2.2rem; - margin-right: 20px; - &:disabled { - cursor: not-allowed; - background-color: ${({theme:t})=>t.INPUT_DISABLED}; - } - &:focus { - outline: none; - box-shadow: 0 0 1px 1px ${({theme:t})=>t.INPUT_OUTLINE_LIGHT}; - } - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_LIGHT}; - } - @media ${_t.down("md")} { - flex-basis: 100%; - min-width: auto; - margin-right: 0; - } -`,_wr=se(Ha)` - @media ${_t.down("md")} { - flex-basis: 100%; - text-align: center; - justify-content: center; - } -`,Swr=se.div` - font-size: 1.5rem; - margin-top: 8px; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - font-style: italic; - color: ${({theme:t})=>t.FONT_ERROR}; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,Cwr=se.span` - color: ${({theme:t})=>t.FONT_SUCCESS}; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,Awr=se.div` - display: flex; - align-items: center; - color: ${({theme:t})=>t.GRAY_PRIMARY}; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,Twr=se(Br)` - height: auto; - margin-left: 10px; -`,Ewr=se.div` - min-width: ${({timeoutActive:t})=>t?"93px":"auto"}; -`,Iwr=()=>{const[t,e]=Z.useState(""),[r,n]=Z.useState(""),[i,a]=Z.useState(1e4),[o,s]=Z.useState(!1),{sendFaucetAddress:l,faucetRequestStatus:c}=OOt(),f=c==="success"?M.jsx(Cwr,{children:"Successfully added nhash to address!"}):c==="failure"?"Server error, try again later.":"",d=i>0,h=c==="loading",p=d||h;Z.useEffect(()=>{let m="";return d&&(m=setTimeout(()=>{const b=i-1e3;a(b)},1e3)),()=>{clearTimeout(m)}},[d,i]);const g=()=>{if(d)return"Please wait for Token Timeout";if(!t)return"Address missing";if(t.includes(" "))return"Address cannot contain spaces";if(/[~`!#$%^&*+=\-[\]\\';,/{}|\\":<>?]/g.test(t))return"Address cannot contain special characters";try{const{prefix:m,words:b}=iNe.decode(t);if(m!=="tp")return"Only Testnet addresses allowed";if(b.length!==32)return"Address is invalid"}catch(m){return`${m}`}return"pass"},v=()=>{r&&n("");const m=g();m==="pass"?(l({address:t}),a(1e4)):n(m)},y=({target:m})=>{r&&n(""),e((m==null?void 0:m.value)||"")};return M.jsx(Ni,{children:M.jsx(cr,{children:M.jsx(ln,{justify:"center",children:M.jsxs(hwr,{children:[M.jsx(mwr,{children:M.jsxs(ywr,{children:[M.jsx(Z4,{icon:"HASH",size:"20rem"}),M.jsx(Z4,{icon:"HASH",size:"20rem"}),M.jsx(Z4,{icon:"HASH",size:"20rem"}),M.jsx(Z4,{icon:"HASH",size:"20rem"}),M.jsx(Z4,{icon:"HASH",size:"20rem"})]})}),M.jsxs(pwr,{children:[M.jsx(gwr,{children:"Provenance Blockchain Testnet Faucet"}),M.jsxs(vwr,{children:[M.jsx(Lr,{icon:"HELP_OUTLINE",size:"2.0rem",onClick:()=>s(!o),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)}),M.jsxs(B5,{show:o,position:"left",minWidth:"220px",children:[M.jsx(M2e,{children:"Each request disburses 10nhash, any account can only get max of 10,000nhash."}),M.jsx(M2e,{children:"Note: This is for Testnet Only."})]})]})]}),M.jsxs(bwr,{children:[r&&M.jsx(wwr,{children:r}),M.jsx(xwr,{disabled:p,onChange:y,onKeyPress:m=>{m.key==="Enter"&&!p&&v()},placeholder:d?"Please wait for timeout":"Enter Address",value:t}),M.jsx(_wr,{disabled:p,onClick:v,icon:"CUBES",children:M.jsx(Ewr,{timeoutActive:d,children:d?`Timeout (${i/1e3}s)`:"Get Tokens"})})]}),f&&M.jsx(Swr,{children:f}),h&&M.jsxs(Awr,{children:["Processing...",M.jsx(Twr,{size:"2rem"})]})]})})})})},kwr=se.div` - height: 600px; - width: 100%; -`,Pwr=se.div` - width: 100%; - margin-top: 20px; -`,Jc={color:"",tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:([])=>""},grid:{right:"20%"},toolbox:{right:"",feature:{saveAsImage:{show:!0}}},legend:{data:[""],textStyle:{},itemGap:20,padding:0},xAxis:[{type:"category",name:"Date",data:{},axisTick:{alignWithLabel:!0},axisLabel:{rotate:0,color:""},axisLine:{show:!0,lineStyle:{color:""}}}],yAxis:{type:"value",name:"Gas",alignTicks:!0,axisLine:{show:!0,lineStyle:{color:""}},axisLabel:{rotate:0,color:""},max:"",min:"",nameTextStyle:{align:"left"}},series:[{name:"",type:"",data:[{}]},{name:"",type:"",data:[{}],color:"",markLine:{},barGap:"-100%"}]},Rwr=({gasStatsGran:t,data:e,msgType:r,plotType:n})=>{const[i,a]=Z.useState(null),o=Z.useRef(null),s=_i(),{matches:l}=Qr(_t.down("sm")),{matches:c}=Qr(_t.up("md")),u=t==="day",f=e.length,d=Z.useCallback(h=>{const p=[],g=[];let v=0;const y=[],m=[],b=[],w=[],C=h.map(S=>S.date);let A=[...new Set(C)];if(h.forEach(S=>{var I;r&&S.messageType===r&&(p.push({value:S.avgGasUsed,name:S.date,messageType:S.messageType,minGasUsed:S.minGasUsed,maxGasUsed:S.maxGasUsed,stdDevGasUsed:S.stdDevGasUsed}),g.push([{name:"",xAxis:sn(nl(S.date),u?"MMM dd":"MM/dd, hh:mm"),yAxis:S.minGasUsed},{name:"",xAxis:sn(nl(S.date),u?"MMM dd":"MM/dd, hh:mm"),yAxis:S.maxGasUsed}]),v++),r||(p.length===0&&p.push({value:0,name:S.date,messageType:"",minGasUsed:0,maxGasUsed:0,stdDevGasUsed:0}),((I=p[v])==null?void 0:I.name)===S.date?(y.push(S.avgGasUsed),m.push(S.minGasUsed),b.push(S.maxGasUsed),w.push(S.stdDevGasUsed)):(p[v].value=y.reduce((D,L)=>D+L)/y.length,p[v].minGasUsed=m.reduce((D,L)=>D+L)/m.length,p[v].maxGasUsed=b.reduce((D,L)=>D+L)/b.length,p[v].stdDevGasUsed=w.reduce((D,L)=>D+L)/w.length,g.push([{name:"",xAxis:sn(nl(p[v].name),u?"MMM dd":"MM/dd, hh:mm"),yAxis:m.reduce((D,L)=>D+L)/m.length},{name:"",xAxis:sn(nl(p[v].name),u?"MMM dd":"MM/dd, hh:mm"),yAxis:b.reduce((D,L)=>D+L)/b.length}]),v++,p.push({value:0,name:S.date,messageType:"",minGasUsed:0,maxGasUsed:0,stdDevGasUsed:0})))}),r||(p[v].value=y.reduce((S,I)=>S+I)/y.length,p[v].minGasUsed=m.reduce((S,I)=>S+I)/m.length,p[v].maxGasUsed=b.reduce((S,I)=>S+I)/b.length,p[v].stdDevGasUsed=w.reduce((S,I)=>S+I)/w.length,g.push([{name:"",xAxis:sn(nl(p[v].name),u?"MMM dd":"MM/dd, hh:mm"),yAxis:m.reduce((S,I)=>S+I)/m.length},{name:"",xAxis:sn(nl(p[v].name),u?"MMM dd":"MM/dd, hh:mm"),yAxis:b.reduce((S,I)=>S+I)/b.length}])),A.length!==p.length&&p.length>0){let S=0;A.forEach(I=>{(S>=p.length||I!==p[S].name)&&(S===0?(p.unshift({value:p[S].value,name:I,messageType:p[S].messageType,minGasUsed:p[S].minGasUsed,maxGasUsed:p[S].maxGasUsed,stdDevGasUsed:p[S].stdDevGasUsed}),g.unshift([{name:"",xAxis:I,yAxis:g[S][0].yAxis},{name:"",xAxis:I,yAxis:g[S][1].yAxis}])):S>=p.length?(p.push({value:p[S-1].value,name:I,messageType:p[S-1].messageType,minGasUsed:p[S-1].minGasUsed,maxGasUsed:p[S-1].maxGasUsed,stdDevGasUsed:p[S-1].stdDevGasUsed}),g.push([{name:"",xAxis:I,yAxis:g[S-1][0].yAxis},{name:"",xAxis:I,yAxis:g[S-1][1].yAxis}])):(p.splice(S,0,{value:p[S].value,name:I,messageType:p[S].messageType,minGasUsed:p[S].minGasUsed,maxGasUsed:p[S].maxGasUsed,stdDevGasUsed:p[S].stdDevGasUsed}),g.splice(S,0,[{name:"",xAxis:sn(nl(I),u?"MMM dd":"MM/dd, hh:mm"),yAxis:g[S][0].yAxis},{name:"",xAxis:sn(nl(I),u?"MMM dd":"MM/dd, hh:mm"),yAxis:g[S][1].yAxis}]))),S++})}A=A.map(S=>sn(nl(S),u?"MMM dd":"MM/dd, hh:mm")),Jc.series=[{name:"Average Gas Used",type:n,data:p,color:s.CHART_LINE_MAIN,markLine:[],barGap:"-100%"},{name:"Min/Max Gas Used",type:n,data:[],color:s.CHART_PIE_K,markLine:{data:g,symbol:"line",lineStyle:{color:s.CHART_PIE_K,width:2}},barGap:"-100%"}],Jc.legend.textStyle={color:s.FONT_PRIMARY},Jc.legend.data=["Average Gas Used","Min/Max Gas Used"],Jc.xAxis[0].data=A,Jc.yAxis.max=(Math.max(...g.map(S=>S[1].yAxis))+1e4).toFixed(0),Jc.yAxis.min=(Math.min(...g.map(S=>S[0].yAxis))-1e4).toFixed(0),Jc.yAxis.axisLabel={rotate:l?90:0,color:s.FONT_PRIMARY},Jc.yAxis.axisLine.lineStyle.color=s.CHART_LINE_MAIN,Jc.xAxis[0].axisLine.lineStyle.color=s.CHART_LINE_MAIN,Jc.xAxis[0].axisLabel={rotate:l?90:0,color:s.FONT_PRIMARY},Jc.tooltip.formatter=S=>` - -
${u?S[0].data.name.slice(0,10):S[0].data.name}
-
Message Type: ${r||"All Types Average"}
-
Average Gas Used: ${zt(S[0].data.value,"",{decimal:0})}
-
Minimum Gas Used: ${zt(S[0].data.minGasUsed,"",{decimal:0})}
-
Maximum Gas Used: ${zt(S[0].data.maxGasUsed,"",{decimal:0})}
-
Standard Deviation: ${zt(S[0].data.stdDevGasUsed,"",{decimal:0})}
- - `,Jc.toolbox={right:c?"5%":"7%",feature:{saveAsImage:{show:!l}}}},[s,u,l,c,r,n]);return Z.useEffect(()=>{let h;return f>0&&(o.current&&(h=ws(o.current)||Us(o.current)),d(e),h==null||h.setOption(Jc),window.addEventListener("resize",()=>{h&&h.resize()})),window.removeEventListener("resize",()=>h&&h.resize())},[a,i,e,d,f]),f>0?M.jsx(kwr,{ref:o}):M.jsx(Pwr,{children:`No message fee data available for ${r} messages`})},Mwr=se.div` - position: relative; - margin-bottom: 20px; -`,Dwr=se.div` - position: relative; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,Nwr=()=>{const t="yyyy-MM-dd",e=new Date,r=sn(e,t),n=sn(lu(e,14),t),i="day",{networkGasStats:a,networkGasStatsLoading:o,getNetworkGasStats:s}=US(),{txTypes:l,txTypesLoading:c,getTxTypes:u}=$u(),{matches:f}=Qr(_t.down("sm")),{matches:d}=Qr(_t.between("sm","md")),[h,p]=Z.useState(i),[g,v]=Z.useState(r),[y,m]=Z.useState(n),[b,w]=Z.useState(""),[C,A]=Z.useState("send"),[S,I]=Z.useState("line"),[D,L]=Z.useState("send"),[O,P]=Z.useState("line"),x=(Number(new Date(g))-Number(new Date(y)))/(1e3*60*60*24)+1,T=g.replace(/-/g,"/"),E=y.replace(/-/g,"/"),N=new Date(T),F=new Date(E),B=!Rn(l);Z.useEffect(()=>{s({toDate:r,fromDate:n,granularity:i})},[s,r,n,i]),Z.useEffect(()=>{B||u()},[u,B]);const j=Q=>{L(Q==="allTxTypes"?"":Q)},k=Q=>{P(Q==="allTxTypes"?"":Q)},$=()=>{const Q=new Date(g),J=new Date(y);return Q30?(w("Filter Error: Maximum date range is 15 days."),!1):!0},H=()=>{if(w(""),$()){const Q=Wi(`${g}T00:00:00`,"yyyy-MM-dd"),J=Wi(`${y}T00:00:00`,"yyyy-MM-dd");s({toDate:Q,fromDate:J,granularity:h}),A(D),I(O)}},Y=JSON.parse(JSON.stringify(l));B&&(Y.allTxTypes.isDefault=!1,Y.transfer.isDefault=!0,Y.transfer.options&&(Y.transfer.options.send.isDefault=!0));const ie=[{title:"From:",type:"datepicker",options:{placeholderText:"Select From Date",onChange:Q=>Q&&m(sn(Q,t)),selected:F,dateFormat:t,maxDate:lu(N,1)},action:m},{title:"To:",type:"datepicker",options:{placeholderText:"Select To Date",onChange:Q=>Q&&v(sn(Q,t)),selected:N,dateFormat:t,maxDate:e},action:v},{title:"Granularity:",type:"dropdown",options:M3e,action:p},{title:"Message Type:",type:"dropdown",maxHeight:"30rem",options:Y,setDefaults:{Filter:"Send",Folder:"Transfer",FilterTitle:"Send"},action:j},{title:"Plot Type:",type:"dropdown",options:{line:{title:"Line",isDefault:!0},bar:{title:"Bar"}},action:k}];let W=!1;for(let Q=0;Q""},grid:{right:"20%"},toolbox:{right:"",feature:{saveAsImage:{show:!0}}},legend:{data:["Gas Used","Gas Wanted","Fee"],textStyle:{},itemGap:20,padding:0},xAxis:[{type:"category",data:{},axisTick:{alignWithLabel:!0},axisLabel:{rotate:0,color:""},axisLine:{show:!0,lineStyle:{color:""}}}],yAxis:[{type:"value",name:"Gas",position:"right",alignTicks:!0,axisLine:{show:!0,lineStyle:{color:""}},axisLabel:{rotate:0,color:""},nameTextStyle:{align:"right"}},{type:"value",name:"Fee (hash)",position:"left",alignTicks:!0,axisLine:{show:!0,lineStyle:{color:""}},axisLabel:{rotate:0,color:""},nameTextStyle:{align:"left"}}],series:[{name:"Gas Used",type:"bar",data:{}},{name:"Gas Wanted",type:"bar"},{name:"Fee",type:"line",yAxisIndex:1}]},$wr=({gasVolumeGran:t,data:e})=>{const[r,n]=Z.useState(null),i=Z.useRef(null),a=_i(),{matches:o}=Qr(_t.down("sm")),{matches:s}=Qr(_t.up("md")),l=t==="day",c=e.length,u=Z.useCallback(f=>{const d=f.map(({date:y})=>sn(nl(y),l?"MMM dd":"MM/dd, hh:mm")),h=f.map(({gasUsed:y,date:m})=>({value:parseFloat(y).toFixed(0),name:m})),p=f.map(({gasWanted:y,date:m})=>({value:parseFloat(y).toFixed(0),name:m})),g=f.map(({feeAmount:y,date:m})=>({value:parseFloat(y)/1e9,name:m})),v=[a.CHART_PIE_I,a.CHART_LINE_MAIN,a.CHART_PIE_K];Il.legend.textStyle={color:a.FONT_PRIMARY},Il.tooltip.formatter=y=>{const m=y[0].name.slice(0,10);let b="",w=0;return y.forEach(C=>{b+=` -
-
-
-
- ${C.seriesName}: ${C.seriesName==="Fee"?`${zt(parseFloat(C.data.value),"hash",{decimal:0})}`:`${zt(parseFloat(C.data.value),"",{decimal:0})}`} -
-
`,w++}),b=`
${l?m:y[0].data.name}
${b}`,b},Il.color=v,Il.yAxis[0].axisLine.lineStyle.color=a.CHART_LINE_MAIN,Il.yAxis[1].axisLine.lineStyle.color=a.CHART_PIE_K,Il.xAxis[0].axisLine.lineStyle.color=a.CHART_LINE_MAIN,Il.xAxis[0].data=d,Il.series[0].data=h,Il.series[1].data=p,Il.series[2].data=g,Il.yAxis[0].axisLabel={rotate:o?90:0,color:a.FONT_PRIMARY},Il.yAxis[1].axisLabel={rotate:o?90:0,color:a.CHART_PIE_K},Il.xAxis[0].axisLabel={rotate:o?45:0,color:a.FONT_PRIMARY},Il.toolbox={right:s?"5%":"7%",feature:{saveAsImage:{show:!o}}}},[a,l,o,s]);return Z.useEffect(()=>{let f;return c>0&&(i.current&&(f=ws(i.current)||Us(i.current)),u(e),f==null||f.setOption(Il),window.addEventListener("resize",()=>{f&&f.resize()})),window.removeEventListener("resize",()=>f&&f.resize())},[n,r,e,u,c]),c>0?M.jsx(Owr,{ref:i}):M.jsx(Lwr,{children:"No transactions available"})},Bwr=se.div` - position: relative; - margin-bottom: 20px; -`,Fwr=se.div` - position: relative; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,jwr=()=>{const t="yyyy-MM-dd",e=new Date,r=sn(e,t),n=sn(lu(e,14),t),i="day",[a,o]=Z.useState(i),[s,l]=Z.useState(r),[c,u]=Z.useState(n),[f,d]=Z.useState(""),{networkGasVolume:h,networkGasVolumeLoading:p,getNetworkGasVolume:g}=US(),{matches:v}=Qr(_t.down("sm")),{matches:y}=Qr(_t.between("sm","md")),m=(new Date(s)-new Date(c))/(1e3*60*60*24)+1,b=s.replace(/-/g,"/"),w=c.replace(/-/g,"/"),C=new Date(b),A=new Date(w);Z.useEffect(()=>{g({toDate:r,fromDate:n,granularity:i})},[g,r,n,i]);const S=()=>{const L=new Date(s),O=new Date(c);return L15?(d("Filter Error: Maximum date range is 15 days."),!1):!0},I=()=>{if(d(""),S()){const L=Wi(`${s}T00:00:00`,"yyyy-MM-dd"),O=Wi(`${c}T00:00:00`,"yyyy-MM-dd");g({toDate:L,fromDate:O,granularity:a})}},D=[{title:"From:",type:"datepicker",options:{placeholderText:"Select From Date",onChange:L=>L&&u(sn(L,t)),selected:A,dateFormat:t,maxDate:lu(C,1)},action:u},{title:"To:",type:"datepicker",options:{placeholderText:"Select To Date",onChange:L=>L&&l(sn(L,t)),selected:C,dateFormat:t,maxDate:e},action:l},{title:"Granularity:",type:"dropdown",options:M3e,action:o}];return M.jsxs(ln,{alignItems:"flex-start",alignContent:"flex-start",icon:"INVENTORY",title:`${m}-Day ${y||v?" Gas Vol":"Gas Volume"} History`,children:[M.jsxs(Bwr,{children:[f&&M.jsx(Fwr,{children:f}),M.jsx(Kl,{filterData:D,mustApply:{title:"Apply",action:I},flush:!0})]}),p?M.jsx(Br,{}):M.jsx($wr,{gasVolumeGran:a,data:h})]})},Uwr=()=>M.jsxs(Ni,{noHeader:!0,children:[M.jsx(cr,{children:M.jsx(Nwr,{})}),M.jsx(cr,{children:M.jsx(jwr,{})})]}),zwr=se.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - z-index: 1050; - background-color: white; -`,Hwr=()=>M.jsx(zwr,{children:M.jsxs(cr,{children:[M.jsx(vDe,{}),M.jsx(gDe,{})]})}),Vwr=se.span` - display: grid; - grid-template-columns: 0.1fr 1fr 1fr; - align-items: center; -`,Gwr=se.div` - grid-column-start: 2; - font-size: 2rem; - align-items: center; -`,Wwr=se.div` - font-size: 1.4rem; - grid-column-start: 2; -`,qwr=se.div` - grid-column-start: 3; - text-align: right; - align-self: end; - font-size: 1.2rem; -`,Ywr=se.span` - color: ${({color:t})=>t}; -`,Kwr=()=>{const{channelBalances:t,getChannelBalances:e,channelStatus:r,channelStatusLoading:n,getChannelStatus:i}=LOt(),{matches:a}=Qr(_t.up("sm")),o=_i();let s=0;const l=t.map(d=>{const h=d.channels.map(p=>{const g=p.srcChannel.channel,v=p.dstChannel.channel,y=p.lastTx,m=p.balances.map(b=>{var D,L,O,P;const w=(D=b.balanceIn)==null?void 0:D.amount,C=(L=b.balanceIn)==null?void 0:L.denom,A=(O=b.balanceOut)==null?void 0:O.amount,S=(P=b.balanceOut)==null?void 0:P.denom,I=b.lastTx;return{balanceInAmount:w,balanceInDenom:C,balanceOutAmount:A,balanceOutDenom:S,lastBalanceTx:I}});return{srcChannel:g,dstChannel:v,lastTx:y,balances:m}});return{chainId:d.dstChainId,chainLastTx:d.lastTx,channelList:h}}),u=r.map(d=>{s++;const h=d.dstChainId,p=d.channels.length;let g=0;const v=d.channels.map(m=>(m.status==="STATE_OPEN"&&g++,{srcChannel:m.srcChannel.channel,dstChannel:m.dstChannel.channel,channelStatus:m.status})).sort((m,b)=>{const w=parseInt(m.srcChannel.match(/-(.*)/)[1]),C=parseInt(b.srcChannel.match(/-(.*)/)[1]);return w-C}),y=`${g}/${p}`;return{chainId:h,channelStats:y,channelList:v}}).map(d=>(l.forEach(h=>{h.chainId===d.chainId&&(d.chainLastTx=h.chainLastTx,d.channelList.forEach(p=>{h.channelList.forEach(g=>{g.dstChannel===p.dstChannel&&g.srcChannel===p.srcChannel&&(p.lastTx=g.lastTx,p.balances={...g.balances})})}))}),{...d}));Z.useEffect(()=>{i({status:""}),e()},[i,e]);const f=u.map(d=>{const h=[{displayName:"Provenance",dataName:"srcChannel",blockImage:{spriteProps:{icon:"PROVENANCE",size:"11px",color:"white"},spriteMargin:"4px",address:"",sizeText:11,marginRight:"10px",colorBackground:o.IRIS_PRIMARY,colorFont:o.FONT_WHITE,fontWeight:o.FONT_WEIGHT_THIN}},{displayName:Kr(d.chainId.split("-")[0].toUpperCase()),dataName:"dstChannel",blockImage:{moniker:d.chainId,address:"",sizeText:11,marginRight:"10px",colorBackground:o.IRIS_PRIMARY,colorFont:o.FONT_WHITE,fontWeight:o.FONT_WEIGHT_BOLD}},{displayName:"Status",dataName:"channelStatus"},{displayName:"Last Tx",dataName:"lastTx"}],p=d.channelList,g=M.jsx(M.Fragment,{children:M.jsxs(Vwr,{children:[M.jsx(w2,{moniker:d.chainId,address:"",sizeText:a?25:14,marginRight:"20px",colorBackground:o.IRIS_PRIMARY,colorFont:o.FONT_WHITE,fontWeight:o.FONT_WEIGHT_THIN}),M.jsxs(Gwr,{children:[d.chainId.split("-")[0].toUpperCase(),M.jsx(Wwr,{children:a&&d.chainId})]}),M.jsxs(qwr,{children:[a&&"Channel Status: ",M.jsx(Ywr,{color:d.channelStats[0]===0?o.NEGATIVE_CHANGE:o.POSITIVE_CHANGE,children:a&&d.channelStats}),M.jsx("br",{}),a&&`Last Tx: ${Wi(d.chainLastTx)}+UTC`]})]})});return M.jsx(cr,{children:M.jsx(zS,{showChevron:!0,title:g,changeColumns:"16fr 1fr",children:M.jsx(cn,{isLoading:n,tableData:p,tableHeaders:h})})},d.chainId)});return M.jsx(ln,{title:`IBC Relayers (${s})`,children:f})},Zwr=()=>M.jsx(Ni,{noHeader:!0,children:M.jsx(cr,{children:M.jsx(Kwr,{})})}),Qwr=se.form` - display: flex; - flex-wrap: wrap; - gap: 10px; - justify-content: space-between; - - @media ${_t.up("sm")} { - gap: 5%; - } -`,Zk=se.div` - display: flex; - flex-basis: 100%; - flex-direction: column; - width: 100%; - - @media ${_t.up("sm")} { - flex-basis: 20%; - width: 20%; - } -`,Xwr=se.div` - margin: 2rem auto; - display: flex; - flex-wrap: wrap; - gap: 20px; - justify-content: space-between; -`,Jwr=se.div` - display: flex; - align-items: center; - flex-direction: column; - justify-content: center; - padding: 1rem; - min-height: 15rem; - border-radius: 4px; - text-align: center; - background-color: lightgray; -`,ebr=se.span` - width: 150px; -`,tbr=()=>{const[t,e]=Z.useState("BLUE_PRIMARY"),[r,n]=Z.useState("WHITE"),[i,a]=Z.useState(100),[o,s]=Z.useState(0);return M.jsxs(Ni,{children:[M.jsxs(Qwr,{children:[M.jsxs(Zk,{children:[M.jsx("label",{htmlFor:"iconColor",children:"Icon Color"}),M.jsx("select",{id:"iconColor",onChange:l=>e(l.target.value),defaultValue:t,children:Object.keys(KN).map(l=>M.jsx("option",{value:l,children:l},l))})]}),M.jsxs(Zk,{children:[M.jsx("label",{htmlFor:"secondaryColor",children:"Secondary Color"}),M.jsx("select",{id:"secondaryColor",onChange:l=>n(l.target.value),defaultValue:r,children:Object.keys(KN).map(l=>M.jsx("option",{value:l,children:l},l))})]}),M.jsxs(Zk,{children:[M.jsx("label",{htmlFor:"size",children:"Icon Size"}),M.jsx("input",{id:"size",type:"number",onChange:l=>a(l.target.value),value:i})]}),M.jsxs(Zk,{children:[M.jsx("label",{htmlFor:"spin",children:"Icon Rotation"}),M.jsx("input",{id:"spin",type:"number",onChange:l=>s(l.target.value),value:o})]})]}),M.jsx(Xwr,{children:Object.values(an).map(l=>M.jsxs(Jwr,{children:[M.jsx(ebr,{children:l}),M.jsx(Lr,{icon:l,color:t,secondaryColor:r,size:`${i}px`,spin:o})]},l))})]})},rbr=se.div` - height: 800px; - width: 100%; -`,nbr=se.div``,mw={tooltip:{formatter:([])=>""},series:[{name:"Name Tree",top:0,labelLine:{showAbove:!0,verticalAlign:"top"},type:"treemap",width:"100%",height:"90%",data:{},visibleMin:200,roam:!1,breadcrumb:{top:"top"},leafDepth:1,label:{show:!0,fontSize:"12",formatter:([])=>""},upperLabel:{show:!0,height:30,color:"",fontSize:"15",fontStyle:"normal",textBorderColor:"none",formatter:([])=>""},levels:[{itemStyle:{borderColor:"#555",borderWidth:5,gapWidth:4},upperLabel:{show:!0}},{itemStyle:{borderColorSaturation:.1,gapWidth:2,borderWidth:5},upperLabel:{show:!0}},{colorSaturation:[.3,.5],itemStyle:{borderColorSaturation:.3,gapWidth:2,borderWidth:1},upperLabel:{show:!0}},{colorSaturation:[.3,.5],itemStyle:{borderColorSaturation:.5,gapWidth:2,borderWidth:1},upperLabel:{show:!0}},{colorSaturation:[.3,.5],itemStyle:{borderColorSaturation:.6,gapWidth:2,borderWidth:1},upperLabel:{show:!0}},{colorSaturation:[.3,.5],itemStyle:{borderColorSaturation:.6,gapWidth:2,borderWidth:1},upperLabel:{show:!0}},{colorSaturation:[.3,.5],itemStyle:{borderColorSaturation:.7,gapWidth:2,borderWidth:1},upperLabel:{show:!0}},{colorSaturation:[.3,.5],itemStyle:{borderColorSaturation:.8,gapWidth:2,borderWidth:1},upperLabel:{show:!0}}]}]},ibr=()=>{const{nameTree:t,nameTreeLoading:e,getNameTree:r}=D8e(),[n,i]=Z.useState(null),[a,o]=Z.useState(2),s=Z.useRef(null),l=[{title:"Level View",type:"number",action:o,value:a,min:"1",max:"8"}];Z.useEffect(()=>{r()},[r]);const c=Z.useCallback(u=>{mw.series[0].data=u,mw.series[0].leafDepth=a,mw.tooltip.formatter=f=>{const d=f.data.label&&f.data.label.match(/^([^.]+)/);return` -
- Name: ${d&&d.length>0?d[0]:"Attribute Name Tree"} -
-
Total Children: ${f.data.children.length}
-
Restricted: ${String(f.data.restricted||"false")}
-
Full Name: ${f.data.fullName||"N/A"}
-
Owner: ${f.data.owner||"N/A"}
- `},mw.series[0].upperLabel.color=KN.FONT_WHITE,mw.series[0].label.formatter=f=>`${f.data.name}`,mw.series[0].upperLabel.formatter=f=>` ${f.data.fullName||"Attribute Name Tree"}`},[a]);return Z.useEffect(()=>{let u;return Rn(t)||(s.current&&(u=ws(s.current)||Us(s.current)),c(t),u==null||u.setOption(mw),window.addEventListener("resize",()=>{u&&u.resize()})),window.removeEventListener("resize",()=>u&&u.resize())},[i,n,t,c]),e?M.jsx(Br,{}):M.jsxs(ln,{title:"Attribute Names",children:[M.jsx(nbr,{children:M.jsx(Kl,{filterData:l,flush:!0})}),M.jsx(rbr,{ref:s})]})},Qk=se.div` - font-size: 1.6rem; - font-weight: bold; - margin-top: 5px; - @media ${_t.down("sm")} { - font-size: 1.2rem; - } -`,Xk=se.div` - display: ${({copy:t})=>t?"flex":"inherit"}; - font-size: 1.4rem; - padding: 5px 10px; - @media ${_t.down("sm")} { - font-size: 1rem; - } -`,abr=se.div``,obr=se.div` - text-align: right; - margin-left: auto; - @media ${_t.down("md")} { - margin: 0; - text-align: left; - } -`,sbr=()=>{const{nameTree:t,getNameTree:e}=D8e(),[r,n]=Z.useState("pb");let i=M.jsx(M.Fragment,{children:"No data was found"});const a=({key:s,tree:l})=>{l.forEach(c=>{if(s===c.fullName){i=M.jsxs(M.Fragment,{children:[M.jsxs(abr,{children:[M.jsx(Qk,{children:"Name"}),M.jsxs(Xk,{copy:!0,children:[Rr(c.fullName,10,"4"),M.jsx(xh,{value:c.fullName})]}),M.jsx(Qk,{children:"Owner"}),M.jsxs(Xk,{copy:!0,children:[M.jsx("a",{href:`/accounts/${c.owner}`,children:Rr(c.owner,10,"4")}),M.jsx(xh,{value:c.owner})]})]}),M.jsxs(obr,{children:[M.jsx(Qk,{children:"Restricted"}),M.jsx(Xk,{copy:!1,children:Kr(String(c.restricted))}),M.jsx(Qk,{children:"Children"}),M.jsx(Xk,{copy:!1,children:c.children.length})]})]});return}else c.children.length>0&&a({key:s,tree:c.children})})};a({key:r,tree:t});const o=(s,l)=>(s.forEach(c=>{l.push(c.name),c.children.length>0&&o(c.children,l)}),l);return Z.useEffect(()=>{e()},[e]),M.jsx(mqt,{data:t,inputPlaceHolderText:"Search Name Tree",showSearch:!0,showResetButton:!0,info:i,currentLabel:r,setCurrentLabel:n,searchList:o(t,[]).sort()})},lbr=()=>{const[t,e]=Z.useState(0);return M.jsxs(Ni,{children:[M.jsx(to,{title:"Name Tree"}),M.jsx(cr,{header:!0,children:M.jsxs(Tv,{active:t,setActive:e,children:[M.jsx(ibr,{},"Chart"),M.jsx(sbr,{},"File View")]})})]})},cbr=se.div` - display: grid; - grid-template-columns: 2fr 1fr; -`,FG=se.div` - height: 0; - margin: 20px 0; - border-bottom: ${({theme:t,noBorder:e})=>e?"transparent":t.BORDER_COLOR} 1px - solid; -`,ubr=()=>{const{addr:t}=Gr(),{getNftRecords:e,nftRecords:r,nftRecordsLoading:n}=mte();Z.useEffect(()=>{t&&e(t)},[t,e]);const i=o=>{if(!o.record)return[];const{lastModified:s,recordAddr:l,recordSpecAddr:c,responsibleParties:u}=o.record;return[{title:"Record Address",value:l},{title:"Record Spec Address",value:c},{title:"Last Modified",value:s},...u.reduce((f,d,h)=>[...f,{title:`Responsible Party [${h}]`,value:d.party},{title:`Responsible Party Role [${h}]`,value:Kr(d.role)}],[])]},a=o=>{const{contractSpecAddr:s,recordSpecAddr:l,responsibleParties:c}=o;return[{title:"Contract Spec Address",value:s},{title:"Record Spec Address",value:l},...c.map((u,f)=>({title:`Responsible Party [${f}]`,value:u}))]};return M.jsx(ln,{title:"NFT Records",children:n?M.jsx(Br,{}):M.jsx(Z.Fragment,{children:r.map(o=>M.jsxs(zS,{showChevron:!0,title:M.jsxs(cbr,{children:[M.jsx("span",{children:Kr(o.recordName)}),M.jsx("span",{children:Kr(o.status)})]}),children:[M.jsx(jo,{data:[{title:"Name",value:Kr(o.recordName)},{title:"Status",value:Kr(o.status)}]}),o.record&&M.jsxs(Z.Fragment,{children:[M.jsx(FG,{}),M.jsx(jo,{data:i(o)})]}),o.specList&&M.jsxs(Z.Fragment,{children:[M.jsx(FG,{}),o.specList.map(s=>M.jsxs(Z.Fragment,{children:[M.jsx(jo,{data:a(s)}),M.jsx(FG,{noBorder:!0})]},s.contractSpecAddr))]})]},o.recordName))})})},fbr=()=>{var o,s,l;const{addr:t}=Gr(),{getNftDetail:e,nftDetailLoading:r,nftDetail:n}=mte();Z.useEffect(()=>{t&&e(t)},[t,e]);const i=c=>({value:c||"--"}),a=[{title:"Name",...i((o=n==null?void 0:n.description)==null?void 0:o.name)},{title:"Description",...i((s=n==null?void 0:n.description)==null?void 0:s.description)},{title:"Website",...i((l=n==null?void 0:n.description)==null?void 0:l.websiteUrl)},{title:"Scope Address",...i(n==null?void 0:n.scopeAddr)},{title:"Spec Name",...i(n==null?void 0:n.specName)},{title:"Spec Address",...i(n==null?void 0:n.specAddr)},{title:"Value Owner",...i(n==null?void 0:n.valueOwner)}];return r?M.jsx(Br,{}):M.jsx(ln,{children:M.jsx(jo,{data:a})})},dbr=()=>{const{addr:t}=Gr(),{getTxsByNft:e,txByNft:r,txByNftLoading:n,txByNftPages:i}=$u(),[a,o]=Z.useState(1);Z.useEffect(()=>{t&&e({addr:t,page:a})},[t,e,a]);const s=[{displayName:"TxHash",dataName:"txHash"},{displayName:"Msg Type",dataName:"type"},{displayName:"Signers",dataName:"signers"},{displayName:"Block",dataName:"block"},{displayName:"Fee",dataName:"fee"},{displayName:"Time",dataName:"time"}];return M.jsx(cn,{tableHeaders:s,tableData:r,currentPage:a,changePage:o,totalPages:i,isLoading:n,title:"Transactions"})},hbr=()=>{const{addr:t}=Gr();return M.jsxs(Ni,{children:[M.jsx(to,{title:"NFT Detail",value:t,copyValue:t,copyTitle:`Copy Address ID ${t}`}),M.jsx(cr,{header:!0,children:M.jsx(fbr,{})}),M.jsx(cr,{children:M.jsx(dbr,{})}),M.jsx(cr,{children:M.jsx(ubr,{})})]})},pbr=()=>{const{addr:t}=Gr(),{getNftsByOwner:e,nftByOwner:r,nftByOwnerLoading:n,nftByOwnerPages:i}=mte(),[a,o]=Z.useState(1);Z.useEffect(()=>{t&&e({addr:t,page:a})},[t,e,a]);const s=[{displayName:"Scope Address",dataName:"scopeAddr"},{displayName:"Spec Name",dataName:"specName"},{displayName:"Spec Address",dataName:"specAddr"},{displayName:"Last Updated",dataName:"lastUpdated"}];return M.jsx(cn,{tableHeaders:s,tableData:r,currentPage:a,changePage:o,totalPages:i,isLoading:n,title:"NFT List"})},gbr=()=>{const{addr:t}=Gr();return M.jsxs(Ni,{children:[M.jsx(to,{title:"NFT List",value:t,copyValue:t,copyTitle:`Copy Address ID ${t}`}),M.jsx(cr,{header:!0,children:M.jsx(pbr,{})})]})},vbr=se.div` - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - width: 100%; - padding: 100px 0; -`,mbr=se.div` - font-size: 10rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLDEST}; - color: ${({theme:t})=>t.FONT_PRIMARY}; - flex-basis: 100%; - text-align: center; -`,ybr=se.div` - font-size: 2rem; - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - margin: 40px 0; - flex-basis: 100%; - text-align: center; -`,wbr=se.div` - background: ${({theme:t})=>t.BUTTON_PRIMARY}; - border-radius: 10px; - padding: 10px 30px; - cursor: pointer; -`,bbr=se.div` - color: ${({theme:t})=>t.FONT_WHITE}; -`,gF=({message:t})=>{const{goBack:e}=jS();return M.jsx(Ni,{noHeader:!0,children:M.jsx(cr,{children:M.jsx(ln,{children:M.jsxs(vbr,{children:[M.jsx(mbr,{children:"404"}),M.jsx(ybr,{children:t}),M.jsx(wbr,{onClick:e,children:M.jsx(bbr,{children:"Back"})})]})})})})};gF.propTypes={message:Ie.string};gF.defaultProps={message:"Seems like you've taken a wrong path somewhere, this page doesn't exist."};const D2e=(t,e,r=[],n)=>{const i=Kr(e),a=[{displayName:"Param Name",dataName:"param_name"},{displayName:"Value",dataName:"value"}];return r.length===0&&(r=Object.keys(t[e]).map(o=>{const s={};return s.value=t[e][o].toString(),s.param_name=o,s})),M.jsx(cr,{children:M.jsx(zS,{title:i,showChevron:!0,children:M.jsx(cn,{tableData:r,tableHeaders:a,tableLoading:n})})},i)},xbr=()=>{const{cosmosParams:t,getNetworkParams:e,networkParamsLoading:r}=US();Z.useEffect(()=>{e()},[e]);const n=a=>{const o=[];return a.forEach(s=>{Object.keys(s).forEach(l=>{const c={};switch(l){case"min_deposit":{const u=s[l][0].amount,f=s[l][0].denom;c.value=zt(u,f,{decimal:2});break}case"allowed_clients":c.value=s[l].join(", ");break;case"code_upload_access":c.value=s[l].permission;break;default:c.value=s[l].toString();break}c.param_name=l,o.push(c)})}),o},i=a=>Object.keys(a).map(s=>{if(s!=="gov"&&s!=="ibc"&&s!=="wasm")return D2e(a,s,[],r);{const l=Object.keys(a[s]).map(c=>a[s][c]);return D2e(a,s,n(l),r)}});return M.jsx(ln,{title:"Cosmos Parameters",children:!Rn(t)&&i(t)})},_br=(t,e,r)=>{const n=Kr(e),i=[{displayName:"Param Name",dataName:"param_name"},{displayName:"Value",dataName:"value"}],a=Object.keys(t[e]).map(o=>{const s={};if(o==="max_total_supply")s.value=zt(t[e][o],"",{decimal:0});else if(o==="unrestricted_denom_regex")s.value=JSON.stringify(t[e][o]);else if(o==="floor_gas_price"){const l=t[e][o].amount,c=t[e][o].denom;s.value=zt(l,c,{decimal:10})}else s.value=t[e][o].toString();return s.param_name=o,s});return M.jsx(cr,{children:M.jsx(zS,{title:n,showChevron:!0,children:M.jsx(cn,{tableData:a,tableHeaders:i,tableLoading:r})})},n)},Sbr=()=>{const{provParams:t,networkParamsLoading:e}=US(),r=n=>Object.keys(n).map(a=>_br(n,a,[]));return M.jsx(ln,{title:"Provenance Parameters",children:!Rn(t)&&r(t)})},Cbr=()=>M.jsxs(Ni,{noHeader:!0,children:[M.jsx(cr,{children:M.jsx(xbr,{})}),M.jsx(cr,{children:M.jsx(Sbr,{})})]}),Abr=()=>{const{tableCount:t}=Ki(),{proposalId:e}=Gr(),[r,n]=Z.useState(1),{getProposalDeposits:i,proposalDeposits:a,proposalDepositsLoading:o,proposalDepositsPages:s}=Lu();Z.useEffect(()=>{e&&i({proposalId:e,count:t,page:r})},[r,i,e,t]);const l=[{displayName:"Depositor",dataName:"voter"},{displayName:"Deposit Type",dataName:"depositType"},{displayName:"Amount",dataName:"amount"},{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Block Height",dataName:"blockHeight"},{displayName:"Timestamp",dataName:"txTimestamp"}],c=a.map(u=>({...u,depositType:u.type}));return M.jsx(cn,{tableHeaders:l,tableData:c,currentPage:r,changePage:n,totalPages:s,isLoading:o,title:"Proposal Deposits"})},Tbr=se.div` - font-weight: bold; -`,Ebr=se.span``,N2e=()=>{const{proposalId:t}=Gr(),{proposal:e,proposalLoading:r}=Lu(),{header:{description:n,details:i,proposalId:a,proposer:{address:o,moniker:s},status:l,title:c,type:u}}=e,f=(h,p)=>{let g=[];return Object.entries(h).map(([y,m])=>{const b=YX(y);if(b!=="Type")if(typeof m=="object"&&!Array.isArray(m)){g=f(m);return}else{const w=m.toString().slice(0,4)==="http";switch(y){case"@type":return;case"status":return{title:"Marker Status",value:m};case"recipient":case"manager":return{title:b,value:m,link:`/account/${m}`};case"accessList":return{title:b,value:JSON.stringify(m),isJson:!0};case"amount":return p==="CommunityPoolSpend"?{title:b,value:zt(m[0].amount,m[0].denom)}:{title:b,value:Rr(m,24,"6"),externalLink:w?m:""};case"changes":return{title:b,value:m,list:m.map(C=>Object.keys(C).map(A=>M.jsxs(Tbr,{children:[A,":",M.jsxs(Ebr,{children:[" ",C[A]]})]},C[A])))};default:return{title:b,value:Rr(m,24,"6"),externalLink:w?m:""}}}}).concat(g)},d=[{title:"ID",value:a},{title:"Title",value:c,nobreak:!0},{title:"Proposal Status",value:Kr(l==null?void 0:l.replace(/proposal_status/gi,""))},{title:"Proposer",value:s||o,link:`/accounts/${o}`},{title:"Type",value:u},{title:"Description",value:n,nobreak:!0}].filter(h=>h);return M.jsx(ln,{title:"Proposal Information",children:r?M.jsx(Br,{}):a?M.jsx(jo,{data:d.concat(f(i,u).filter(h=>h))}):M.jsxs(J8,{children:["No information exists for proposal ",t]})})},Ibr=()=>{const{proposal:t,proposalLoading:e}=Lu(),{timings:r}=t,n=[{displayName:"Submit Time",dataName:"submitTime"},{displayName:"Deposit End Time",dataName:"depositEndTime"},{displayName:"Voting Start Time",dataName:"votingTime.startTime"},{displayName:"Voting End Time",dataName:"votingTime.endTime"}];return M.jsx(cn,{tableHeaders:n,tableData:[r],isLoading:e,title:"Proposal Timing"})},kbr=()=>{const{proposalId:t}=Gr(),e=10,[r,n]=Z.useState(1),{getVotesByProposal:i,proposalVotes:a,proposalVotesPages:o,proposalVotesTotal:s,proposalVotesLoading:l}=Lu();Z.useEffect(()=>{t&&i({proposalId:t,count:e,page:r})},[i,t,e,r]);const c=[{displayName:"Voter",dataName:"voter"},{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Vote/Weight",dataName:"answer"},{displayName:"Block Height",dataName:"blockHeight"},{displayName:"Timestamp",dataName:"txTimestamp"}];return M.jsx(cn,{tableHeaders:c,tableData:a,currentPage:r,changePage:n,totalPages:o,isLoading:l,title:`Proposal Votes (${s})`})},Pbr=se.div` - display: flex; - margin: 1.6rem 0; - padding: 20px; - border: ${({theme:t})=>t.POSITIVE_CHANGE} - 1px solid; - border-radius: 0.6rem; - color: ${({theme:t})=>t.POSITIVE_CHANGE}; - flex-direction: column; - text-align: justify; -`,Rbr=se.div` - text-align: center; - margin: 10px; -`,Mbr=se.label` - font-size: 1.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - line-height: 1.75; -`,Dbr=se.div` - color: ${({theme:t})=>t.NEGATIVE_CHANGE}; - text-align: center; - font-size: 1.8rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLDEST}; - margin: 20px; -`,aNe=({onClick:t,hours:e=0,minutes:r=0,seconds:n=0,message:i,title:a})=>{const[o,s]=Z.useState(!1),[[l,c,u],f]=Z.useState([e,r,n]),d=()=>{o||(l===0&&c===0&&u===0?(s(!0),window.location.reload(),t()):f(c===0&&u===0?[l-1,59,59]:u===0?[l,c-1,59]:[l,c,u-1]))};return Z.useEffect(()=>{const h=setInterval(()=>d(),1e3);return()=>clearInterval(h)}),M.jsxs(Pbr,{children:[M.jsx(Rbr,{children:M.jsx(Mbr,{children:a})}),i,M.jsx(Dbr,{children:`${l.toString().padStart(2,"0")}: - ${c.toString().padStart(2,"0")}: - ${u.toString().padStart(2,"0")}`})]})},Nbr=se.div` - height: 200px; - width: ${({width:t})=>`${t}px`}; -`,Q4={color:[""],title:{text:"",left:"center"},tooltip:{trigger:"item",position:"inside",formatter:({})=>""},legend:{left:"center",itemGap:20,padding:0,top:"-5%",textStyle:{color:""}},series:[{name:"Votes",type:"pie",radius:"50%",data:[],label:{show:!1,position:"center"},labelLine:{show:!1}}]},Obr=t=>{const e=[],r=[{value:"",name:""}],n={};return Object.keys(t).forEach(i=>{if(i!=="total"){let a=Kr(i);i==="noWithVeto"&&(a="No With Veto"),e.push(a),r.push({value:(parseInt(t[i].amount.amount)/1e9).toString(),name:a}),n[a]=!0}}),{seriesData:r,legendData:e,selectedData:n}},Lbr=({voteData:t})=>{const[e,r]=Z.useState(null),n=Z.useRef(null),i=_i(),a=window.innerWidth>452?"452":(window.innerWidth*.85).toString(),o=Z.useCallback((s,l,c)=>{Q4.color=[i.CHART_PIE_ABSTAIN,i.CHART_PIE_G,i.CHART_PIE_NO,i.CHART_PIE_NOWITHVETO],Q4.series[0].data=s,Q4.legend.textStyle={color:i.FONT_PRIMARY},Q4.tooltip.formatter=u=>`${u.data.name}: ${zt(parseFloat(u.data.value),"")} hash (${u.percent}%)`},[i]);return Z.useEffect(()=>{let s;if(t){n.current&&(s=ws(n.current)||Us(n.current));const l=Obr(t);o(l.seriesData,l.legendData,l.selectedData),s&&s.setOption(Q4),window.addEventListener("resize",()=>{s&&s.resize()})}return window.removeEventListener("resize",()=>s&&s.resize())},[r,e,o,t]),M.jsx(Nbr,{ref:n,width:a})},$br=se.div` - display: ${({isOpen:t})=>t?"inherit":"none"}; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 100; - background: rgba(0, 0, 0, 0.5); -`,Bbr=se.div` - text-align: center; - font-size: 2rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - margin-bottom: 20px; - margin-right: 10px; -`,O2e=se.div` - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - font-style: italic; - max-width: 500px; - margin: 0 auto; - margin-bottom: 20px; -`,jG=se.div` - font-size: 1.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - line-height: 1.75; -`,Fbr=se.div` - padding-top: 1.6rem; -`,jbr=se.label` - font-size: 1.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - line-height: 1.75; -`,Ubr=se.div` - display: flex; - justify-content: space-between; - gap: 1rem; -`,zbr=se.div` - display: flex; - justify-content: flex-end; - gap: 1rem; - padding-top: 1.6rem; -`,Hbr=se.div` - display: flex; - margin: 1.6rem 0; - padding: 20px; - border: ${({theme:t,color:e})=>e?`${e} 1px solid`:`${t.ORANGE_PRIMARY} 1px solid`}; - border-radius: 0.6rem; - color: ${({theme:t,color:e})=>e||t.ORANGE_PRIMARY}; - flex-direction: column; - text-align: justify; - line-height: 1.3; -`,Vbr=se.div` - text-align: center; - margin-bottom: 20px; -`,Gbr=se.div` - align-self: center; - margin-top: 20px; -`,Wbr=se.label` - display: flex; - align-self: center; - padding-top: 1.8rem; -`,qbr=se.input` - margin-right: 5px; - width: 2rem; - height: 2rem; -`,Ybr=se.div` - padding: 1.6rem 0 1.6rem 0; - font-size: 1.8rem; - line-height: 1.75; - display: grid; - grid-template-columns: 3fr 0.5fr; -`,L2e=se.div` - display: flex; - align-self: center; - margin-right: 10px; - text-align: right; - font-size: 1.6rem; - line-height: 1.75; - color: ${({color:t})=>t&&t}; -`,Kbr=({isLoggedIn:t,modalOpen:e,onClose:r,proposalId:n,description:i,voterId:a,title:o,voted:s,setVoted:l})=>{const c=_i(),[u,f]=Z.useState(!1),[d,h]=Z.useState(""),{tally:p,submitVotes:g}=Lu(),{accountDelegationsTotal:v}=Vc(),y=parseInt(v.amount)>0,[m,b]=Z.useState(!1);Z.useEffect(()=>{f(t&&e)},[t,e]);const w=()=>{b(!1),h(""),l(!1),r()},C=()=>{h(d==="weighted"?"":"weighted")},A=D=>{const L={};return sce(D).map(O=>{if(!O.subFields)L[O.field]=O.initialValue||"";else{const P={};O.subFields.map(x=>P[x.field]=O.initialValue||""),L[O.field]=[P]}return L}),L},S=(D,L)=>{const O=parseInt(D.getFieldProps("yes").value||"0")+parseInt(D.getFieldProps("no").value||"0")+parseInt(D.getFieldProps("abstain").value||"0")+parseInt(D.getFieldProps("noWithVeto").value||"0");return L?O!==100?c.NEGATIVE_CHANGE:c.POSITIVE_CHANGE:`${O}`},I=M.jsxs(M.Fragment,{children:["Your vote has been submitted.",M.jsx("br",{}),M.jsx("br",{}),!y&&M.jsxs(M.Fragment,{children:['Since you have no delegations, your vote will not count towards the vote totals, but will be visible in the "Proposal Votes" table below.',M.jsx("br",{}),M.jsx("br",{})]}),"Results may take up to 30 seconds to post to Explorer. Please be patient.",M.jsx("br",{}),M.jsx("br",{}),"To continue, either wait for the timer to time out, at which point the page will refresh. Otherwise, exit this popup and refresh the page to see voting results."]});return M.jsx($br,{isOpen:u,children:M.jsx(HS,{isOpen:u,onClose:w,largeModal:!0,children:M.jsx(gB,{enableReinitialize:!0,initialValues:{...A(d)},validationSchema:Ast(d),onSubmit:async(D,{resetForm:L})=>{let O;d==="weighted"?O=Object.keys(D).map(P=>({option:P==="noWithVeto"?"VOTE_OPTION_NO_WITH_VETO":`VOTE_OPTION_${P.toUpperCase().replace(/ /g,"_")}`,weight:Number(D[P])})):O=[{option:`VOTE_OPTION_${D.vote.toUpperCase().replace(/ /g,"_")}`,weight:100}],s||await g({proposalId:n,voter:a,votes:O}),L()},children:D=>M.jsxs("form",{onSubmit:D.handleSubmit,children:[!y&&!m&&!s&&M.jsx(Fbr,{children:M.jsxs(Hbr,{children:[M.jsx(Vbr,{children:M.jsx(jbr,{children:"Voting Notice"})}),"You currently have no delegated hash in your account. While you are still able to submit a vote, your vote will not be counted towards the vote totals on this proposal. To have your votes counted, you must either delegate hash or log in to an account with delegated hash. Note that fees are assessed to any votes that are submitted regardless of delegation status.",M.jsx(Gbr,{children:M.jsx(Ha,{onClick:()=>b(!0),children:"Vote Anyway"})})]})}),(y||m)&&!s&&M.jsxs(M.Fragment,{children:[M.jsxs(Bbr,{children:["Vote on ",M.jsx("b",{children:o})]}),M.jsx(jG,{children:"Proposal ID"}),M.jsx(O2e,{children:n}),M.jsx(jG,{children:"Description"}),M.jsx(O2e,{children:i}),M.jsx(jG,{children:"Vote Tally"}),!Rn(p)&&M.jsx(Lbr,{voteData:p}),M.jsx(S3,{config:sce(d),formik:D,grid:d==="weighted"}),d==="weighted"&&M.jsxs(Ybr,{children:[M.jsx(L2e,{children:"Total (must be 100%):"}),M.jsxs(L2e,{color:S(D,!0),children:[S(D,!1),"%"]})]}),M.jsxs(Ubr,{children:[M.jsxs(Wbr,{children:[M.jsx(qbr,{type:"checkbox",onChange:C}),"Submit weighted votes"]}),M.jsx(zbr,{children:M.jsx(Ha,{type:"submit",disabled:d==="weighted"&&S(D,!1)!=="100",children:"Submit"})})]})]}),s&&M.jsx(aNe,{onClick:w,seconds:30,title:"Vote Submitted",message:I})]})})})})},Zbr=()=>{const{ManageVotingBtn:t,modalFns:e,voted:r,setVoted:n}=GOt(),{proposal:i,proposalVotesLoading:a}=Lu(),{isLoggedIn:o}=Ki(),{header:{description:s,proposalId:l,title:c}}=i;return M.jsxs(M.Fragment,{children:[l?M.jsx(t,{title:`Proposal ${l}`}):M.jsx(Br,{}),!a&&M.jsx(Kbr,{isLoggedIn:o,modalOpen:e.modalOpen,onClose:e.deactivateModalOpen,proposalId:l,description:s,voterId:"",title:c,voted:r,setVoted:n})]})},Qbr=se.div` - height: 200px; - width: 100%; - margin-bottom: -55px; -`,Hi={color:[""],tooltip:{trigger:"axis",axisPointer:{type:"none"},formatter:([])=>""},legend:{data:["Yes","No","Abstain","No With Veto"],textStyle:{},itemGap:20,padding:10},xAxis:{type:"value",show:!1,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",show:!1},series:[{name:"Yes",type:"bar",data:[{value:50,rawValue:0}],showBackground:!0,stack:"total",itemStyle:{borderRadius:[5,0,0,5]},backgroundStyle:{color:"",borderColor:"rgba(180, 180, 180, 0.3)",borderWidth:1,borderDashOffset:5,shadowBlur:3,shadowColor:"black",shadowOffsetX:-1,shadowOffsetY:1,borderRadius:[5,5,5,5]},emphasis:{focus:"series"},markLine:{silent:!0,data:[{name:"Pass Threshold",xAxis:0,label:{show:!0,formatter:"Pass Threshold",fontStyle:"normal",fontFamily:"Montserrat",textBorderColor:"none",color:""},lineStyle:{color:"red"}},{name:"Veto Threshold",xAxis:0,label:{show:!0,formatter:"Veto Threshold",fontStyle:"normal",fontFamily:"Montserrat",textBorderColor:"none",color:"",position:"start"},lineStyle:{color:"red"}}],symbol:"line",lineStyle:{color:"black",width:2}}},{name:"No",type:"bar",stack:"total",itemStyle:{borderRadius:[0,0,0,0]},backgroundStyle:{borderRadius:[0,0,0,0]},emphasis:{focus:"series"}},{name:"Abstain",type:"bar",stack:"total",itemStyle:{borderRadius:[0,0,0,0]},backgroundStyle:{borderRadius:[0,0,0,0]},emphasis:{focus:"series"}},{name:"No With Veto",type:"bar",stack:"total",itemStyle:{borderRadius:[0,5,5,0]},backgroundStyle:{borderRadius:[0,5,5,0]},emphasis:{focus:"series"}}]},Jk=({amount:t,denom:e,total:r})=>({value:Number(t)/Number(r),denom:e,rawValue:Number(t)}),Xbr=()=>{const{proposalId:t}=Gr(),{tally:e,params:r,getProposal:n,proposalLoading:i}=Lu(),[a,o]=Z.useState(null),s=Z.useRef(null),l=_i();Z.useEffect(()=>{Rn(e)&&n(t)},[n,e,t]);let c="0",u="",f="0",d="0";Rn(e)||(c=e.total.amount.amount,u=e.total.amount.denom,f=r.passThreshold,d=r.vetoThreshold);const h=Z.useCallback(p=>{const g=Jk({amount:p.yes.amount.amount,denom:p.yes.amount.denom,total:c}),v=Jk({amount:p.no.amount.amount,denom:p.no.amount.denom,total:c}),y=Jk({amount:p.abstain.amount.amount,denom:p.abstain.amount.denom,total:c}),m=Jk({amount:p.noWithVeto.amount.amount,denom:p.noWithVeto.amount.denom,total:c});Hi.color=[l.CHART_PIE_G,l.CHART_PIE_NO,l.CHART_PIE_ABSTAIN,l.CHART_PIE_NOWITHVETO],Hi.legend.textStyle={color:l.FONT_PRIMARY},Hi.series[0].data=[g],Hi.series[1].data=[v],Hi.series[2].data=[y],Hi.series[3].data=[m],Hi.series[0].markLine&&(Hi.series[0].markLine.data[0].label.formatter=`Pass Threshold (${Number(f)*100}%)`,Hi.series[0].markLine.data[0].xAxis=Number(f),Hi.series[0].markLine.data[0].label.color=l.FONT_PRIMARY,Hi.series[0].markLine.data[0].lineStyle.color=l.GREEN_POSITIVE_PRIMARY,Hi.series[0].markLine.data[1].label.formatter=`Veto Threshold (${Number(d)*100}%)`,Hi.series[0].markLine.data[1].xAxis=1-Number(d),Hi.series[0].markLine.data[1].label.color=l.FONT_PRIMARY,Hi.series[0].markLine.data[1].lineStyle.color=l.RED_NEGATIVE_PRIMARY),m.value===0&&y.value!==0?(Hi.series[2].itemStyle.borderRadius=[0,5,5,0],Hi.series[0].backgroundStyle.borderRadius=[5,5,5,5]):y.value===0&&m.value===0&&v.value!==0?(Hi.series[1].itemStyle.borderRadius=[0,5,5,0],Hi.series[0].itemStyle.borderRadius=[5,0,0,5]):(Hi.series[0].itemStyle.borderRadius=[5,5,5,5],Hi.series[0].backgroundStyle.borderRadius=[5,5,5,5]),Hi.series[0].backgroundStyle&&(Hi.series[0].backgroundStyle.color=l.BACKGROUND_LIGHT,Hi.series[0].backgroundStyle.shadowColor=l.BACKGROUND_BLACK),Hi.tooltip.formatter=b=>{let w="",C=0;return b.forEach(A=>{w+=` -
-
-
-
- ${A.seriesName}: ${zt(parseFloat(A.data.rawValue),A.data.denom)} - (${A.data.value?(Number(A.data.value)*100).toFixed(2):"--"}%) -
-
`,C++}),w}},[l,c,d,f]);return Z.useEffect(()=>{let p;return Rn(e)||(s.current&&(p=ws(s.current)||Us(s.current)),h(e),p&&p.setOption(Hi),window.addEventListener("resize",()=>{p&&p.resize()})),window.removeEventListener("resize",()=>p&&p.resize())},[o,a,h,e]),M.jsx(ln,{title:i?"":`Total Votes: ${zt(Number(c),u)}`,children:i?M.jsx(Br,{}):M.jsx(Qbr,{ref:s})})},Jbr=se.div` - height: 200px; - width: 100%; - margin-top: -40px; - margin-bottom: -70px; -`,Rd={color:[""],tooltip:{trigger:"axis",axisPointer:{type:"none"},formatter:([])=>""},xAxis:{type:"value",show:!1,max:100},yAxis:{type:"category",show:!1},series:[{name:"Total Votes",type:"bar",data:[{value:50,rawValue:0}],showBackground:!0,stack:"total",itemStyle:{borderRadius:[5,5,5,5]},backgroundStyle:{color:"",borderColor:"rgba(180, 180, 180, 0.3)",borderWidth:1,borderDashOffset:5,shadowBlur:3,shadowColor:"black",shadowOffsetX:-1,shadowOffsetY:1,borderRadius:[5,5,5,5]},emphasis:{focus:"series"},markLine:{silent:!0,data:[{name:"Quorum Threshold",xAxis:0,label:{show:!0,formatter:"Pass Threshold",fontStyle:"normal",fontFamily:"Montserrat",textBorderColor:"none",color:""},lineStyle:{color:"red"}}],symbol:"line",lineStyle:{color:"black",width:2}}}]},e2r=({amount:t,denom:e,total:r,totalDenom:n,totalEligible:i,totalEligibleDenom:a})=>({value:100*(Number(t)/Number(i)),valueDenom:e,rawValue:Number(t),total:r,totalEligible:i,totalEligibleDenom:a}),t2r=()=>{const{proposalId:t}=Gr(),{tally:e,params:r,getProposal:n,proposalLoading:i}=Lu(),[a,o]=Z.useState(null),s=Z.useRef(null),l=_i();Z.useEffect(()=>{Rn(e)&&n(t)},[n,e,t]);let c="0",u="0",f="",d="",h="0";Rn(e)||(c=e.total.amount.amount,u=r.totalEligibleAmount.amount,d=r.totalEligibleAmount.denom,f=e.total.amount.denom,h=r.quorumThreshold);const p=100*Number(c)/Number(u),g=Z.useCallback(v=>{const y=e2r({amount:v.total.amount.amount,denom:v.total.amount.denom,total:c,totalDenom:f,totalEligible:u,totalEligibleDenom:d});y.value>=Number(h)*100?Rd.color=[l.CHART_PIE_G]:Rd.color=[l.CHART_PIE_ABSTAIN],Rd.series[0].data=[y],Rd.series[0].backgroundStyle.color=l.BACKGROUND_LIGHT,Rd.series[0].backgroundStyle.shadowColor=l.BACKGROUND_BLACK,Rd.series[0].markLine.data[0].label.formatter=`Quorum Threshold (${Number(h)*100}%)`,Rd.series[0].markLine.data[0].xAxis=Number(h)*100,Rd.series[0].markLine.data[0].label.color=l.FONT_PRIMARY,Rd.series[0].markLine.data[0].lineStyle.color=l.GREEN_POSITIVE_PRIMARY,Rd.tooltip.formatter=m=>`
- ${m[0].seriesName}: ${zt(parseFloat(m[0].data.rawValue),m[0].data.valueDenom)} (${Number(m[0].data.value).toFixed(2)}%) -
- Eligible Votes: ${zt(parseFloat(m[0].data.totalEligible),m[0].data.totalEligibleDenom,{decimal:0,minimumFractionDigits:0})} -
- Outstanding: ${zt(parseFloat(m[0].data.totalEligible)-parseFloat(m[0].data.rawValue),m[0].data.totalEligibleDenom,{decimal:0,minimumFractionDigits:0})} -
`},[l,c,h,f,u,d]);return Z.useEffect(()=>{let v;return Rn(e)||(s.current&&(v=ws(s.current)||Us(s.current)),g(e),v&&v.setOption(Rd),window.addEventListener("resize",()=>{v&&v.resize()})),window.removeEventListener("resize",()=>v&&v.resize())},[o,a,g,e]),M.jsx(ln,{title:i?"":`Percent Voted: ${p===0||!p?"0":p<1e-4?"< 0.01":p.toFixed(2)}%`,children:i?M.jsx(Br,{}):M.jsx(Jbr,{ref:s})})},r2r=se.div` - height: 200px; - width: 100%; - margin-top: -45px; - margin-bottom: -70px; -`,lf={color:[""],tooltip:{trigger:"axis",axisPointer:{type:"none"},formatter:([])=>""},xAxis:{type:"value",show:!1,axisLabel:{formatter:"{value} %"},max:100},yAxis:{type:"category",show:!1},series:[{name:"Total Votes",type:"bar",data:[{value:50}],showBackground:!0,itemStyle:{borderRadius:[5,5,5,5]},backgroundStyle:{color:"",borderColor:"rgba(180, 180, 180, 0.3)",borderWidth:1,borderDashOffset:5,shadowBlur:3,shadowColor:"black",shadowOffsetX:-1,shadowOffsetY:1,borderRadius:[5,5,5,5]},markLine:{silent:!0,data:[{name:"Deposit Threshold",xAxis:-1,label:{show:!0,formatter:"",fontStyle:"normal",fontFamily:"Montserrat",textBorderColor:"none",color:""},lineStyle:{color:"red"}}],symbol:"line",lineStyle:{color:"black",width:2}}}]},eP=(t=0,e=1)=>new va(t).div(e).times(100).toNumber(),n2r=()=>{const{proposal:t,proposalLoading:e}=Lu(),{timings:r}=t,n=Number(r.deposit.current),i=Number(r.deposit.initial),a=Number(r.deposit.needed)||1,o=r.deposit.denom,[s,l]=Z.useState(null),c=Z.useRef(null),u=_i(),f=Z.useCallback(()=>{const d={value:eP(n,a),initialDeposit:i,currentDeposit:n,neededDeposit:a,denom:o};d.value>=100?lf.color=[u.CHART_PIE_C]:lf.color=[u.CHART_PIE_E],lf.series[0].data=[d],lf.series[0].backgroundStyle.color=u.BACKGROUND_LIGHT,lf.series[0].backgroundStyle.shadowColor=u.BACKGROUND_BLACK,eP(n,a)>=100?(lf.series[0].markLine.data[0].xAxis=eP(a,n),lf.series[0].markLine.data[0].label.color=u.FONT_PRIMARY):(lf.series[0].markLine.data[0].xAxis=100,lf.series[0].markLine.data[0].label.color=u.FONT_PRIMARY),lf.series[0].markLine.data[0].label.formatter=`Pass Threshold ${zt(a,"nhash")}`,lf.tooltip.formatter=h=>`
- Current Deposits: ${zt(Number(h[0].data.currentDeposit),o)} (${h[0].data.value}%) -
- Initial Deposit: ${zt(Number(h[0].data.initialDeposit),o)} - ${Number(h[0].data.currentDeposit) - Outstanding: ${zt(Number(h[0].data.neededDeposit)-Number(h[0].data.initialDeposit),h[0].data.denom)}`:""} -
`},[u,n,o,i,a]);return Z.useEffect(()=>{let d;return Rn(r)||(c.current&&(d=ws(c.current)||Us(c.current)),f(),d&&d.setOption(lf),window.addEventListener("resize",()=>{d&&d.resize()})),window.removeEventListener("resize",()=>d&&d.resize())},[l,s,f,r]),M.jsx(ln,{title:e?"":`Deposits: ${zt(n,o)} (${eP(n,a)}%)`,children:e?M.jsx(Br,{}):M.jsx(r2r,{ref:c})})},i2r=()=>{var d;const{proposalId:t}=Gr(),{proposal:e,proposalLoading:r,getProposal:n}=Lu(),{timings:i}=e,{accountAssets:a,getAccountAssets:o}=Vc(),{isLoggedIn:s}=Ki(),l=a==null?void 0:a.find(h=>h.denom==="nhash"),c=!Rn(l)&&parseFloat(l.amount)>0,u=!Rn(i)&&(i==null?void 0:i.votingTime.startTime.slice(0,4))!=="1901"&&new Date().getTime()>new Date((d=i==null?void 0:i.votingTime)==null?void 0:d.startTime).getTime()&&new Date().getTime(){const{tableCount:t}=Ki(),[e,r]=Z.useState(1),{getAllProposals:n,proposals:i,proposalsLoading:a,proposalsPages:o}=Lu(),{isLoggedIn:s}=Ki(),{ManageProposalBtn:l,modalFns:c,submitted:u,setSubmitted:f}=zOt(),[d,h]=Z.useState(1);Z.useEffect(()=>{!Rn(i)&&d===1&&h(i[0].header.proposalId+1)},[i,d]);const p="",g=i.map(y=>({...y.header,...y.timings}));Z.useEffect(()=>{n({count:t,page:e})},[n,t,e]);const v=[{displayName:"ID",dataName:"proposalId"},{displayName:"Title",dataName:"title"},{displayName:"Status",dataName:"status"},{displayName:"Deposit Percentage",dataName:"deposit"},{displayName:"Submit Time",dataName:"submitTime"},{displayName:"Deposit End Time",dataName:"depositEndTime"},{displayName:"Voting End Time",dataName:"votingTime.endTime"}];return M.jsxs(M.Fragment,{children:[s&&M.jsxs($2e,{header:!0,children:[M.jsx(Br,{}),M.jsx(d2r,{isLoggedIn:s,modalOpen:c.modalOpen,onClose:c.deactivateModalOpen,proposalId:`${d}`,proposerId:p,submitted:u,setSubmitted:f})]}),M.jsx($2e,{header:!s,children:M.jsx(cn,{tableHeaders:v,tableData:g,currentPage:e,changePage:r,totalPages:o,isLoading:a,title:"Proposals List"})})]})},o2r=se.div` - text-align: center; - font-size: 2rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,s2r=se.option` - background: ${({theme:t})=>t.INPUT_BG_LIGHT}; - font-weight: initial; - white-space: nowrap; - &:hover { - color: ${({theme:t})=>t.FONT_THEME}; - } -`,l2r=se(K9e)` - margin-top: 10px; - padding: 10px; - width: 100%; - border: 1px solid ${({theme:t})=>t.INPUT_BORDER_LIGHT}; - border-radius: 4px; - color: ${({theme:t})=>t.INPUT_FONT_LIGHT}; - font-size: 1.4rem; - line-height: 2.2rem; - background-color: ${({theme:t})=>t.INPUT_BG_LIGHT}; - - &:focus { - outline: none; - box-shadow: 0 0 1px 1px ${({theme:t})=>t.INPUT_OUTLINE_LIGHT}; - } - - &::placeholder { - color: ${({theme:t})=>t.INPUT_PLACEHOLDER_LIGHT}; - } -`,c2r=se.div` - padding-top: 1.6rem; -`,u2r=se.label` - font-size: 1.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - line-height: 1.75; -`,f2r=se.div` - display: flex; - justify-content: flex-end; - gap: 1rem; - padding-top: 1.6rem; -`,d2r=({isLoggedIn:t,modalOpen:e,onClose:r,proposalId:n,proposerId:i,submitted:a,setSubmitted:o})=>{const[s,l]=Z.useState(!1),[c,u]=Z.useState(0),{blocksHeight:f,getBlocksHeight:d}=wy(),[h,p]=Z.useState("text"),{submitProposal:g}=Lu(),{authToken:v}=Ki();Z.useEffect(()=>{l(t&&e)},[t,e]),Z.useEffect(()=>{d(),u(f+20)},[f,d]);const y=()=>{o(!1),r(),p("text")},m=C=>{p(C.target.value)},b=C=>{const A={};return oce(C).map(S=>{if(!S.subFields)A[S.field]=S.initialValue||"";else{const I={};S.subFields.map(D=>I[D.field]=S.initialValue||""),A[S.field]=[I]}return A}),A},w=M.jsxs(M.Fragment,{children:["Your proposal has been submitted.",M.jsx("br",{}),M.jsx("br",{}),"Results may take up to 30 seconds to post to Explorer. Please be patient.",M.jsx("br",{}),M.jsx("br",{}),"To continue, either wait for the timer to time out, at which point the page will refresh. Otherwise, exit this popup and refresh the page to view your proposal."]});return M.jsx(HS,{isOpen:s,onClose:y,largeModal:!0,children:M.jsx(gB,{enableReinitialize:!0,initialValues:{dropdown:h,submitter:i,...b(h)},validationSchema:kSe(h,c),onSubmit:async(C,{resetForm:A})=>{const S=C==null?void 0:C.file;S&&delete C.file,await g({type:C.dropdown.toUpperCase().replace(/ /g,"_"),data:ace(C),file:S||void 0,token:v}),p("text"),ace(C).initialDeposit=[{amount:"0",denom:"nhash"}],A()},children:C=>M.jsxs("form",{onSubmit:C.handleSubmit,children:[!a&&M.jsxs(M.Fragment,{children:[M.jsx(o2r,{children:`Proposal ${n}`}),M.jsxs(c2r,{children:[M.jsx(u2r,{htmlFor:"dropdown",children:"Proposal Type"}),M.jsx(l2r,{as:"select",name:"dropdown",onChange:m,value:h,children:Object.keys(Pse).map(A=>{const S=Pse[A];return M.jsx(s2r,{value:S,children:Kr(S)},S)})})]}),M.jsx(S3,{config:oce(h),formik:C,blockNumber:c}),M.jsx(f2r,{children:M.jsx(Ha,{type:"submit",children:"Submit"})})]}),a&&M.jsx(aNe,{onClick:y,seconds:30,title:"Proposal Submitted",message:w})]})})})},h2r=()=>M.jsxs(Ni,{children:[M.jsx(to,{title:"All Proposals"}),M.jsx(a2r,{})]}),p2r=se.div` - height: 600px; - width: 100%; - margin-top: 35px; -`,g2r=se.div` - width: 100%; - margin: 20px; -`,m_={color:[""],tooltip:{trigger:"item",formatter:({})=>""},legend:{top:"5%",left:"center",itemGap:20,textStyle:{color:""}},series:[{type:"pie",data:{},radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10,borderWidth:2,borderColor:""},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:"20",fontWeight:"bold"}},labelLine:{show:!1}}]},v2r=t=>[{value:(parseFloat(t.circulation.amount)/1e9).toFixed(0),name:"Circulation"},{value:(parseFloat(t.communityPool.amount)/1e9).toFixed(0),name:"Community Pool"},{value:(parseFloat(t.burned.amount)/1e9).toFixed(0),name:"Burned"},{value:(parseFloat(t.bonded.amount)/1e9).toFixed(0),name:"Bonded"},{value:((parseFloat(t.maxSupply.amount)-(parseFloat(t.circulation.amount)+parseFloat(t.communityPool.amount)+parseFloat(t.bonded.amount)+parseFloat(t.burned.amount)))/1e9).toFixed(0),name:"Locked"}],m2r=()=>{const[t,e]=Z.useState(null),r=Z.useRef(null),n=_i(),{networkTokenStats:i,getNetworkTokenStats:a,networkTokenStatsLoading:o}=US(),s=Z.useCallback((c,u)=>{m_.color=[n.CHART_PIE_CIRCULATION,n.CHART_PIE_COMMUNITY,n.CHART_PIE_BURNED,n.CHART_PIE_BONDED,n.CHART_PIE_REMAINING],m_.series[0].data=c,m_.series[0].itemStyle.borderColor=n.BACKGROUND_LIGHT,m_.legend.textStyle={color:n.FONT_PRIMARY},m_.tooltip.formatter=f=>{const d=parseFloat(f.data.value)/u*100;return`${f.data.name} Hash
- Amount: ${zt(parseFloat(f.data.value),"hash",{decimal:0})}
- Percent: ${d<.01?d.toFixed(5):d.toFixed(2)}%`}},[n]);Z.useEffect(()=>{a()},[a]),Z.useEffect(()=>{let c;if(!Rn(i)){const u=(parseFloat(i.maxSupply.amount)/1e9).toFixed(0);r.current&&(c=ws(r.current)||Us(r.current)),s(v2r(i),u),c&&c.setOption(m_),window.addEventListener("resize",()=>{c&&c.resize()})}return window.removeEventListener("resize",()=>c&&c.resize())},[e,t,i,s]);const l=!Rn(i)&&zt(Number(i.maxSupply.amount),i.maxSupply.denom,{decimal:0});return o?M.jsx(Br,{}):Rn(i)?M.jsx(g2r,{children:"Token statistics chart unavailable. Refresh to retry"}):M.jsxs(M.Fragment,{children:[M.jsx(to,{title:"Token Statistics",value:`Max Total: ${l}`}),M.jsx(p2r,{ref:r})]})},y2r=()=>{const{assetsDist:t,assetsDistLoading:e,getAssetsDist:r}=Av();Z.useEffect(()=>{r()},[r]);const n=JSON.parse(JSON.stringify(t)),i=[{displayName:"Range",dataName:"range"},{displayName:"Amount",dataName:"amountHash"},{displayName:"Percent",dataName:"percentTotal"}];return M.jsx(cn,{tableHeaders:i,tableData:n.sort((a,o)=>Number(a.range.match(/(?:\d+\.)?\d+/g)[0]||0)-Number(o.range.match(/(?:\d+\.)?\d+/g)[0])),isLoading:e,title:"Asset Distribution"})},w2r=()=>M.jsxs(Ni,{children:[M.jsx(m2r,{}),M.jsx(y2r,{})]}),b2r=se.div` - flex-wrap: no-wrap; - flex-direction: column; - align-items: flex-start; -`,x2r=()=>{const[t,e]=Z.useState(!1),[r,n]=Z.useState(!1),{txInfo:i,txInfoLoading:a,txMsgsLoading:o,getTxInfo:s}=$u(),{txHash:l,block:c}=Gr();Z.useEffect(()=>{s({txHash:l,block:c})},[l,s,c]);const u=!Rn(i),f=()=>M.jsxs(J8,{children:["No information exists for transaction ",l]}),d=()=>{const{errorCode:p,errorLog:g,fee:v,height:y,memo:m,signers:b,status:w,time:C,feepayer:A,additionalHeights:S}=i,I={amount:0,denom:""};v.map(E=>{const N=E.fees[0].amount,F=E.fees[0].denom;I.amount+=parseInt(N),I.denom=F;const B=zt(N,F,{decimal:20});return{type:E.type,amount:N,denom:F,value:B}});const D=Wi(C),L=zt(I.amount,I.denom,{decimal:I.amount/1e9<1e-4?20:4}),O={visibility:{visible:t,setVisible:e},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"Error Log:",value:g}]},P={visibility:{visible:r,setVisible:n},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"Feepayer Type:",value:A.type}]},x=JSON.parse(JSON.stringify(b)).map(E=>({copy:!0,...E})),T=[{title:"Block",value:y,link:`/block/${y}`,copy:y},{title:"Status",value:Kr(w)},{title:"Timestamp",value:`${D}+UTC`},{title:"Total Fees",value:L},{title:b.length===1?"Signer":"Signer(s)",value:b.length===1&&Rr(b[0].address,12,"4"),link:b.length===1&&`/accounts/${b[0].address}`,copy:b.length===1&&b[0].address,table:b.length>1?{tableHeaders:[{displayName:"Address",dataName:"address"},{displayName:"Sequence",dataName:"sequence"}],tableData:x,isLoading:a,showIndex:!0}:null},{title:"Feepayer",value:Rr(A.address,12,"4"),link:`/accounts/${A.address}`,copy:A.address,popupNote:P},...m?[{title:"Memo",value:Rr(m,100)||"--",copy:m}]:[],...S.length>0?[{title:"Additional Heights",value:S,list:S,linkList:S.map(E=>`/tx/${l}/${E}`)}]:[],...p!==0?[{title:"Error Code",value:p,popupNote:O}]:[]].filter(E=>E);return M.jsx(jo,{data:T})},h=()=>u?d():f();return M.jsx(Z.Fragment,{children:M.jsx(ln,{title:"Information",icon:"HASH",children:a||o?M.jsx(Br,{}):M.jsx(b2r,{children:h()})})})},_2r=se.div` - flex-basis: 100%; - margin-bottom: 10px; - padding: 10px 20px; - border: 1px solid lightgray; - border-radius: 4px; - - &:last-child { - margin: 0; - } -`,S2r=se.div` - position: relative; - margin-left: 18px; - margin-bottom: 4px; -`,C2r=()=>{var S;const[t,e]=Z.useState(""),{tableCount:r}=Ki(),{data:n,isLoading:i}=DWe(),{txInfo:a,getTxMsgs:o,resetTxMsgs:s,txMsgs:l,txMsgsLoading:c,txMsgsPages:u,txMsgsTotal:f,getTxMsgTypes:d,txMsgTypes:h,txMsgTypesLoading:p}=$u(),{txHash:g}=Gr(),v=Z.useCallback(I=>{o({txHash:g,count:r,page:I,msgType:t})},[o,g,t,r]);Z.useEffect(()=>{d(g)},[d,g]),Z.useEffect(()=>(v(1),()=>s(g)),[v,s,g,t]);const y=I=>{e(I==="allTxTypes"?"":I)},m=I=>{var L,O;const D=(O=(L=[...n].sort((P,x)=>x.prefix.length>P.prefix.length?1:-1).find(P=>I.match(P.prefix)))==null?void 0:L.type)==null?void 0:O.toLowerCase();return D==="account"?`${D}s`:D};let b=[];n&&(b=(S=l==null?void 0:l[g])==null?void 0:S.map(I=>[{title:"Tx Type",value:Kr(I.type)},...Object.entries(I==null?void 0:I.msg).map(([D,L])=>{var P;const O=YX(D);switch(D){case"amount":{let x=zt(L.amount,L.denom),T=L.denom;return ice(L)&&(T=L[0].denom,x=L.map(E=>zt(E.amount,E.denom)).join(", ")),{title:O,value:x,link:`/asset/${T}`,splitOnSpace:!0}}case"delegatorAddress":case"fromAddress":case"invoker":case"proposer":case"toAddress":case"voter":case"validatorAddr":case"granter":case"grantee":case"sender":case"account":case"owner":case"manager":case"administrator":case"admin":case"validatorAddress":return{title:O,value:((P=a==null?void 0:a.monikers)==null?void 0:P[L])||Rr(L,24,10),link:`/${m(L)}/${L}`};case"time":return{title:O,value:`${Wi(L)}+UTC`};case"denom":return{title:O,value:L,link:`/asset/${L}`};case"scopeUuid":case"scopeId":return{title:O,value:Rr(L,24,10),link:`/nft/${L}`};case"contract":return{title:O,value:typeof L=="string"?Rr(L,24,10):JSON.stringify(L),isJson:typeof L=="object",link:typeof L=="string"&&`/contract/${L}`};case"codeId":return{title:O,value:L,link:`/code/${L}`};default:return ice(L)||xst(L)?{title:O,value:JSON.stringify(L),isJson:!0}:typeof L=="boolean"?{title:O,value:L.toString()}:{title:O,value:L}}})]));const w=!Rn(b),C=Object.keys(h).length>2,A=[{title:"",type:"dropdown",options:h,action:y}];return M.jsxs(ln,{title:`Messages (${f})`,icon:"REPORTS",headerContent:!p&&C&&M.jsx(S2r,{children:M.jsx(Kl,{filterData:A,flush:!0})}),children:[(c&&!w||i)&&M.jsx(Br,{}),w?M.jsx(cB,{loading:c,onLoadMore:v,totalPages:u,children:({sentryRef:I,hasNextPage:D})=>M.jsxs(Z.Fragment,{children:[b==null?void 0:b.map(L=>M.jsx(_2r,{children:M.jsx(jo,{data:L})},JSON.stringify(L))),(D||c)&&M.jsx(Br,{ref:I})]})}):!c&&M.jsxs(J8,{children:["No information exists for transaction ",g]})]})},A2r=se.div` - height: 300px; - width: 80%; - margin: 0 auto; - @media ${_t.down("lg")} { - height: 350px; - width: 100%; - } -`,y_={color:[""],tooltip:{trigger:"item",formatter:({data:t,percent:e})=>{const{name:r,amount:n}=t;return`${r}
Value: ${n} (${e}%)
`}},legend:{data:[],selected:{},top:"0%",width:"65%",type:"scroll",left:"center",itemGap:20,textStyle:{color:""}},series:[{data:[],type:"pie",radius:"70%",avoidLabelOverlap:!1,label:{show:!1},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]},T2r=t=>{const e=t.fees.reduce((a,o)=>a+Number(o.amount),0),r=t.fees[0].denom,n=zt(e,r,{decimal:20}),i=parseFloat(zt(e,r,{decimal:e/1e9<1e-4?20:4,showDenom:!1}));return{type:t.type,amount:n,value:e,roundAmount:i}},E2r=t=>{const e=[],r=[],n={};return t.forEach(({type:i,value:a,amount:o,roundAmount:s})=>{if(s>0){const l=i;e.push(l),r.push({value:a,name:l,amount:o}),n[l]=!0}}),{seriesData:r,legendData:e,selectedData:n}},I2r=()=>{const[t,e]=Z.useState(null),r=Z.useRef(null),n=_i(),{txInfo:i,txsInfoLoading:a,txMsgsLoading:o}=$u(),s=!Rn(i),l=s&&i.fee.map(f=>T2r(f));let c=0;l&&l.forEach(f=>c+=parseFloat(f.amount));const u=Z.useCallback((f,d,h)=>{y_.color=[n.CHART_PIE_C,n.CHART_PIE_K,n.CHART_PIE_I,n.CHART_PIE_L],y_.legend.data=d,y_.legend.textStyle={color:n.FONT_PRIMARY},y_.legend.selected=h,y_.series[0].data=f},[n]);return Z.useEffect(()=>{if(l){const d=E2r(l);u(d.seriesData,d.legendData,d.selectedData)}let f;return r.current&&(f=ws(r.current)||Us(r.current)),f==null||f.setOption(y_),window.addEventListener("resize",()=>{f&&f.resize()}),window.removeEventListener("resize",()=>f&&f.resize())},[e,u,t,l]),M.jsx(ln,{alignItems:"flex-start",alignContent:"flex-start",icon:"PRICE",title:`Fees: ${o?"--":zt(c,"hash",{decimal:c<1e-4?20:4})}`,children:a||o?M.jsx(Br,{}):s?M.jsx(A2r,{ref:r}):M.jsx("div",{children:"Fee information not available for this transaction"})})},k2r=se.div` - color: ${({theme:t})=>t.FONT_LINK}; - margin-top: 20px; - font-style: italic; - cursor: pointer; - font-size: 1.2rem; -`,P2r=se.div` - padding: 18px; - margin-top: 10px; - border: 1px solid ${({theme:t})=>t.BORDER_PRIMARY}; - width: 100%; - font-size: 1.2rem; -`,B2e=se.div` - color: ${({theme:t})=>t.FONT_PRIMARY}; - font-family: ${({theme:t})=>t.CODE_FONT}; - font-style: normal; - width: 100%; - max-width: 100%; - max-height: 700px; - overflow: scroll; -`,R2r=se.div` - color: ${({theme:t})=>t.FONT_LINK}; - margin-top: 10px; - font-style: italic; - cursor: pointer; -`,M2r=()=>{const[t,e]=Z.useState(!1),{txFullJSONLoading:r,txFullJSON:n,getTxFullJSON:i}=$u(),{txHash:a}=Gr(),o=()=>{i(a)},s=()=>{(!t&&!n||a!==(n==null?void 0:n.txhash))&&o(),e(!t)};return M.jsxs(ln,{title:"Full JSON",icon:"DATA_OBJECT",children:[M.jsxs(k2r,{onClick:s,children:[t?"Hide":"Show"," full transaction JSON"]}),t&&M.jsxs(P2r,{children:[r&&M.jsx(Br,{}),!r&&(n?M.jsx(B2e,{children:M.jsx(Lte,{src:n,theme:"ocean"})}):M.jsxs(B2e,{children:[M.jsx("div",{children:"Unable to load JSON data..."}),M.jsx(R2r,{onClick:o,children:"Retry"})]}))]})]})},D2r=()=>{const{matches:t}=Qr(_t.down("lg")),{txInfoLoading:e}=$u(),{txHash:r}=Gr();return e?M.jsx(Br,{}):M.jsxs(Ni,{children:[M.jsx(to,{title:t?"Tx Details":"Transaction Details",value:t?Rr(r,12,6):r,copyTitle:`Copy Transaction Hash ${r}`,copyValue:r}),M.jsxs(cr,{header:!0,children:[M.jsx(x2r,{}),M.jsx(I2r,{})]}),M.jsx(cr,{children:M.jsx(M2r,{})}),M.jsx(cr,{children:M.jsx(C2r,{})})]})},N2r=se.div` - height: 600px; - width: 25%; -`,O2r=se.div` - width: 100%; - margin-top: 20px; -`,L2r=["12am","1am","2am","3am","4am","5am","6am","7am","8am","9am","10am","11am","12pm","1pm","2pm","3pm","4pm","5pm","6pm","7pm","8pm","9pm","10pm","11pm"],yw={title:{text:"Txs By Hrs of Day",left:"5%",textStyle:{color:"",fontWeight:"normal"}},color:"",tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{top:"5.5%",bottom:"5%",containLabel:!0},xAxis:{type:"value",show:!1,axisLabel:{color:""}},yAxis:{type:"category",data:[""],axisLabel:{color:""}},series:[{name:"Tx Count",type:"bar",data:[0]}]},$2r=()=>{const[t,e]=Z.useState(null),r=Z.useRef(null),n=_i(),{data:i,isLoading:a}=kX(),o=Z.useCallback(s=>{const l=[],c=[];s.slice().reverse().forEach(u=>{l.push(u.numberTxs),c.push(L2r[u.hour])}),yw.yAxis.data=c,yw.series[0].data=l,yw.color=n.CHART_PIE_D,yw.xAxis.axisLabel.color=n.FONT_PRIMARY,yw.yAxis.axisLabel.color=n.FONT_PRIMARY,yw.title.textStyle.color=n.FONT_PRIMARY},[n]);return Z.useEffect(()=>{let s;return a||(r.current&&(s=ws(r.current)||Us(r.current)),o(i==null?void 0:i.hourlyTotal),s==null||s.setOption(yw),window.addEventListener("resize",()=>{s&&s.resize()})),window.removeEventListener("resize",()=>s&&s.resize())},[e,t,i,a,o]),i?M.jsx(N2r,{ref:r}):M.jsx(O2r,{children:"No transactions heatmap data available"})},B2r=se.div` - height: 300px; - width: 100%; -`,F2r=se.div` - width: 100%; - margin-top: 20px; -`,ww={title:{text:"Txs By Days Of Week",top:-5,left:"5%",textStyle:{color:"",fontWeight:"normal"}},tooltip:{position:"top",formatter:({})=>""},series:[{name:"Days of Week Transaction Counts",type:"pie",radius:[25,75],center:["50%","50%"],roseType:"area",itemStyle:{color:"",borderRadius:1,borderColor:""},label:{color:""},labelLine:{length:3,length2:3},data:[{value:0,name:""}]}]},j2r=()=>{const[t,e]=Z.useState(null),r=Z.useRef(null),n=_i(),{data:i,isLoading:a}=kX(),o=Z.useCallback(s=>{const l=[];s.forEach(c=>l.push({value:c.numberTxs,name:Kr(c.day)})),ww.series[0].data=l,ww.tooltip.formatter=c=>`
Txs Count: ${zt(c.data.value,"")}
`,ww.series[0].itemStyle.borderColor=n.FONT_PRIMARY,ww.series[0].itemStyle.color=n.CHART_PIE_D,ww.series[0].label.color=n.FONT_PRIMARY,ww.title.textStyle.color=n.FONT_PRIMARY},[n]);return Z.useEffect(()=>{let s;return a||(r.current&&(s=ws(r.current)||Us(r.current)),o(i==null?void 0:i.dailyTotal),s==null||s.setOption(ww),window.addEventListener("resize",()=>{s&&s.resize()})),window.removeEventListener("resize",()=>s&&s.resize())},[e,t,i,a,o]),i?M.jsx(B2r,{ref:r}):M.jsx(F2r,{children:"No transactions heatmap data available"})},U2r=se.div` - height: 600px; - width: 100%; -`,z2r=se.div` - width: 100%; - margin-top: 20px; -`,yQ=["12am","1am","2am","3am","4am","5am","6am","7am","8am","9am","10am","11am","12pm","1pm","2pm","3pm","4pm","5pm","6pm","7pm","8pm","9pm","10pm","11pm"],wQ=["Sat","Fri","Thu","Wed","Tue","Mon","Sun"],tp={title:{text:"Txs by Time/DOW Heatmap",textStyle:{color:"",fontWeight:"normal"}},tooltip:{position:"top",formatter:({})=>""},grid:{height:"85%",top:"6%",left:35,right:85,bottom:0},xAxis:{type:"category",data:yQ,splitArea:{show:!0},axisLabel:{color:""}},yAxis:{type:"category",data:wQ,splitArea:{show:!0},axisLabel:{color:""}},visualMap:{min:0,max:10,inRange:{color:["",""]},calculable:!0,orient:"vertical",align:"left",right:0,itemHeight:510,top:"4.5%",textStyle:{color:""}},series:[{name:"Weekly Transactions",type:"heatmap",data:[],label:{color:"BLACK",show:!0,formatter:({})=>""},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"},label:{show:!1}}}]},H2r=()=>{const[t,e]=Z.useState(null),r=Z.useRef(null),n=_i(),{data:i,isLoading:a}=kX(),o=Z.useCallback(s=>{const l=[];let c=0;s.forEach(u=>{u.data.forEach((f,d)=>{l.push([f.hour,Math.abs(u.dow-6),f.numberTxs||"-"]),f.numberTxs>c&&(c=f.numberTxs)})}),tp.series[0].data=l,tp.visualMap.max=c,tp.visualMap.inRange.color=[n.CHART_PIE_A,n.CHART_PIE_D,n.RED_PRIMARY],tp.tooltip.formatter=u=>` -
Day: ${wQ[u.data[1]]||wQ[u.data.value[1]]}
-
Hour: ${yQ[u.data[0]]||yQ[u.data.value[0]]}
-
Txs Count: ${zt(u.data[2]||u.data.value[2],"")}
- `,tp.series[0].label.formatter=u=>u.data[2]===c?"Max":"",tp.xAxis.axisLabel.color=n.FONT_PRIMARY,tp.yAxis.axisLabel.color=n.FONT_PRIMARY,tp.visualMap.textStyle.color=n.FONT_PRIMARY,tp.title.textStyle.color=n.FONT_PRIMARY},[n]);return Z.useEffect(()=>{let s;return a||(r.current&&(s=ws(r.current)||Us(r.current)),o(i==null?void 0:i.heatmap),s==null||s.setOption(tp),window.addEventListener("resize",()=>{s&&s.resize()})),window.removeEventListener("resize",()=>s&&s.resize())},[e,t,i,a,o]),i?M.jsx(U2r,{ref:r}):M.jsx(z2r,{children:"No transactions heatmap data available"})},V2r=se.div` - position: relative; - display: flex; - flex-wrap: wrap; -`,G2r=se.div` - display: flex; - justify-content: space-around; - width: 100%; - margin-bottom: 20px; -`,W2r=se.input``,q2r=se.label` - margin-left: 10px; -`,F2e=[{label:"1 week",value:6},{label:"2 months",value:60},{label:"1 year",value:365}],Y2r=({address:t,size:e="50%"})=>{const r="yyyy-MM-dd",n=new Date,i=sn(n,r),[a,o]=Z.useState(F2e[0].value),s="DAY",[l,c]=Z.useState(s),{data:u,isLoading:f,error:d}=t5e({fromDate:sn(lu(n,a),r),toDate:i,granularity:l.toUpperCase(),address:t}),h=p=>{o(p.target.value),p.target.value==="365"?c("MONTH"):c("DAY")};return M.jsxs(V2r,{children:[f?M.jsx(Br,{}):M.jsx(mDe,{txHistoryGran:l,data:u,span:a,today:n,showDayOfWeek:a===6,title:`${a===6?"Weekly Tx Data":a===60?"2 Month Tx Data":"Yearly Tx Data"}`,grid:{left:"10%",right:"10%",bottom:"17%"},legendPadding:20}),u&&!d&&M.jsx(G2r,{children:F2e.map(p=>M.jsxs("div",{children:[M.jsx(W2r,{type:"radio",id:p.label,name:"radio-button",value:p.value,onClick:h,defaultChecked:a===p.value},p.value),M.jsx(q2r,{htmlFor:"radio-button",children:p.label})]},p.value))})]})},K2r=se.div` - text-align: center; - font-size: 3.6rem; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; -`,j2e=se.div` - display: flex; -`,Z2r=se.div` - display: flex; - justify-content: flex-end; - margin-top: 20px; - margin-right: 10px; -`,U2e=se.div` - width: ${({size:t})=>t}; -`,Q2r=()=>{const[t,e,r]=by(!1);return M.jsxs(Ni,{children:[M.jsx(K2r,{children:"Provenance Explorer Txs Dashboard"}),M.jsx(Z2r,{children:M.jsx(Ha,{onClick:r,children:"Generate Tx Data CSV"})}),M.jsxs(j2e,{children:[M.jsx($2r,{}),M.jsx(H2r,{})]}),M.jsxs(j2e,{children:[M.jsx(U2e,{size:"30%",children:M.jsx(j2r,{})}),M.jsx(U2e,{size:"70%",children:M.jsx(Y2r,{})})]}),M.jsx(yDe,{modalOpen:t,onClose:e})]})},X2r=se.div` - width: 100%; -`,J2r=se.div` - position: relative; - margin-bottom: 18px; -`,exr=se.div` - position: absolute; - top: -16px; - left: 0; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - color: ${({theme:t})=>t.FONT_ERROR}; - @media ${_t.between("sm","md")} { - font-size: 1.2rem; - } -`,txr=()=>{const t="yyyy-MM-dd",[e,r]=Z.useState(1),[n,i]=Z.useState(""),[a,o]=Z.useState(""),[s,l]=Z.useState(""),[c,u]=Z.useState(""),[f,d]=Z.useState(""),{txs:h,txsPages:p,txsRecentLoading:g,getTxsRecent:v,txTypes:y,getTxTypes:m,txTypesLoading:b}=$u(),{tableCount:w}=Ki(),{blockHeight:C}=Gr(),A=c.replace(/-/g,"/"),S=s.replace(/-/g,"/"),I=c?new Date(A):"",D=s?new Date(S):"",L=Object.keys(y).length>0;Z.useEffect(()=>{L||m()},[m,L]),Z.useEffect(()=>{v({page:1,count:w,type:"",status:"",toDate:"",fromDate:""})},[v,C,w]);const O=B=>{r(B),v({page:B,count:w,type:n,status:a,toDate:c,fromDate:s})},P=B=>{i(B==="allTxTypes"?"":B)},x=B=>{o(B==="all"?"":B)},T=()=>{const B=new Date(c),j=new Date(s);return B15?(d("Filter Error: Maximum date range is 15 days."),!1):!0},E=()=>{if(d(""),T()){r(1);const B=c?Wi(`${c}T00:00:00`,"yyyy-MM-dd"):"",j=s?Wi(`${s}T00:00:00`,"yyyy-MM-dd"):"";v({toDate:B,fromDate:j,page:1,count:w,type:n,status:a})}},N=[{displayName:"Tx Hash",dataName:"txHash"},{displayName:"Tx Type",dataName:"txType"},{displayName:"Block",dataName:"block"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}],F=[{title:"Type:",type:"dropdown",options:y,action:P},{title:"Status:",type:"dropdown",options:yL,action:x},{title:"From:",type:"datepicker",options:{placeholderText:"Pick From Date",onChange:B=>l(B?sn(B,t):""),selected:D,dateFormat:t},action:l},{title:"To:",type:"datepicker",options:{placeholderText:"Pick To Date",onChange:B=>u(B?sn(B,t):""),selected:I,dateFormat:t},action:u}];return M.jsxs(X2r,{children:[!b&&Object.keys(y).length>0&&M.jsxs(J2r,{children:[f&&M.jsx(exr,{children:f}),M.jsx(Kl,{filterData:F,mustApply:{title:"Apply",action:E},flush:!0})]}),M.jsx(cn,{tableHeaders:N,tableData:h,currentPage:e,changePage:O,totalPages:p,isLoading:g,title:"Transactions List"})]})},rxr=()=>{const{txTotal:t}=$u();return M.jsxs(Ni,{children:[M.jsx(to,{title:"Transaction List",value:`${t} total`}),M.jsx(cr,{header:!0,children:M.jsx(txr,{})})]})},nxr=se.div` - width: 100%; -`,ixr=()=>{const{networkUpgrades:t,getNetworkUpgrades:e,networkUpgradesLoading:r}=US();Z.useEffect(()=>{e()},[e]);const n=t.find(a=>a.skipped&&!a.scheduled)?"skipped":"",i=[{displayName:"Upgrade Height",dataName:"upgradeHeight"},{displayName:"Upgrade Name",dataName:"upgradeName"},{displayName:"Recommended Version",dataName:"currentVersion"},{displayName:"Events",dataName:"events"}];return M.jsx(nxr,{children:M.jsx(cn,{tableHeaders:i,tableData:t,isLoading:r,title:"Version History",notes:n})})},axr=()=>M.jsxs(Ni,{children:[M.jsx(to,{title:"Provenance Upgrade History"}),M.jsx(cr,{header:!0,children:M.jsx(ixr,{})})]}),oxr=()=>{const[t,e]=Z.useState(!1),{getValidatorCommission:r,validatorCommission:n,validatorCommissionLoading:i}=js(),{validatorId:a}=Gr();Z.useEffect(()=>{r(a)},[a,r]);const{commissionRate:o={},bondedTokens:s={},selfBonded:l={},delegatorBonded:c={},delegatorCount:u,totalShares:f,commissionRewards:d={}}=n,{count:h,denom:p}=s,{maxChangeRate:g,maxRate:v,rate:y}=o,{amount:m,denom:b}=d,{count:w,denom:C}=c,{count:A,denom:S}=l,I=`${Qn(w/h*100,2)} %`,D=`${Qn(A/h*100,2)} %`,L=`${Qn(y*100,2)} %`,O=`${Qn(v*100,2)} %`,P=`${Qn(g*100,2)} %`,x={visibility:{visible:t,setVisible:e},icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{title:"Self-Bonded:",value:`${zt(A,S)} (${D})`},{title:"Delegator Bonded:",value:`${zt(w,C)} (${I})`}]},T=[{title:"Commission Rate",value:L},{title:"Bonded Tokens",value:`${zt(h,p)}`,popupNote:x},{title:"Delegators",value:u},{title:"Total Shares",value:`${Qn(f,7)}`},{title:"Commission Rewards",value:zt(m,b)},{title:"Commission Rate Range",value:`0 ~ ${O}`},{title:"Max Change Rate",value:P}];return M.jsx(ln,{size:"100%",title:"Commission Information",children:i?M.jsx(Br,{}):M.jsx(jo,{data:T})})},sxr=()=>{const[t,e]=Z.useState(1),{matches:r}=Qr(_t.up("sm")),{getValidatorDelegations:n,validatorDelegations:i,validatorDelegationsLoading:a,validatorDelegationsPages:o}=js(),{validatorId:s}=Gr(),l=10;Z.useEffect(()=>{n({id:s,page:t,count:l})},[n,l,t,s]);const c=[{displayName:"Address",dataName:"delegatorAddr"},{displayName:"Amount",dataName:"amount"},{displayName:"Shares",dataName:"shares"}];return M.jsx(cn,{tableHeaders:c,tableData:i,currentPage:t,changePage:e,totalPages:o,isLoading:a,title:"Delegations",size:r&&"48%"})},lxr=()=>{const[t,e]=Z.useState(1),{getValidatorDelegationTxs:r,validatorDelegationTxs:n,validatorDelegationTxsLoading:i,validatorDelegationTxsPages:a}=js(),{validatorId:o}=Gr(),s=10;Z.useEffect(()=>{r({id:o,page:t,count:s})},[r,s,t,o]);const l=[{displayName:"TxHash",dataName:"txHash"},{displayName:"TxType",dataName:"type"},{displayName:"Block",dataName:"block"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}];return M.jsx(cn,{tableHeaders:l,tableData:n,currentPage:t,changePage:e,totalPages:a,isLoading:i,title:"Delegation Transactions"})},cxr=()=>{const[t,e]=Z.useState(1),{validatorSpotlight:r}=js(),{getTxByModule:n,txByModule:i,txByModuleLoading:a,txByModulePages:o}=$u(),{ownerAddress:s}=r;Z.useEffect(()=>{s&&n({module:"gov",address:s,count:10,page:t})},[s,n,t]);const l=[{displayName:"TxHash",dataName:"txHash"},{displayName:"Block",dataName:"block"},{displayName:"Proposal Type",dataName:"proposalType"},{displayName:"Proposal Id",dataName:"proposalId"},{displayName:"Proposal Title",dataName:"proposalTitle"},{displayName:"Amount",dataName:"depositAmount"},{displayName:"TxType",dataName:"txMsgType"},{displayName:"Fee",dataName:"txFee"},{displayName:"Signer",dataName:"signers"},{displayName:"Timestamp",dataName:"txTime"}];return M.jsx(cn,{tableHeaders:l,tableData:i,currentPage:t,changePage:e,totalPages:o,isLoading:a})},uxr=()=>{const[t,e]=Z.useState(1),{validatorSpotlight:r}=js(),{getVotesByAddress:n,addressVotes:i,addressVotesLoading:a,addressVotesPages:o}=Lu(),{ownerAddress:s}=r;Z.useEffect(()=>{s&&n({address:s,count:10,page:t})},[s,n,t]);const l=[{displayName:"Proposal ID",dataName:"proposalId"},{displayName:"Proposal Title",dataName:"proposalTitle"},{displayName:"Proposal Status",dataName:"proposalStatus"},{displayName:"Vote/Weight",dataName:"answer"},{displayName:"TxHash",dataName:"txHash"}];return M.jsx(cn,{tableHeaders:l,tableData:i,currentPage:t,changePage:e,totalPages:o,isLoading:a})},fxr=()=>{const[t,e]=Z.useState(0);return M.jsxs(Tv,{active:t,setActive:e,children:[M.jsx(cxr,{},"Gov Txs"),M.jsx(uxr,{},"Voted Proposals")]})},dxr=se(jo)` - border: 10px solid white; -`,hxr=se.div` - display: flex; - align-items: center; - justify-content: center; -`,UG=se.div` - flex-basis: 100%; - margin-bottom: 10px; -`,pxr=se.div` - display: grid; - width: 100%; - grid-template-columns: 1fr; - justify-items: center; - align-items: center; - gap: 40px; - - @media ${_t.up("sm")} { - text-align: center; - grid-template-columns: 1fr 1fr; - } - - @media ${_t.up("lg")} { - text-align: center; - grid-template-columns: 0.75fr 1fr 1fr; - } -`,gxr=se.div` - grid-column: auto; - @media ${_t.up("sm")} { - /* For remove validator metrics */ - /* grid-column: span 2; */ - } - @media ${_t.up("lg")} { - grid-column: auto; - } -`,vxr=se.div` - font-weight: ${({theme:t})=>t.FONT_WEIGHT_BOLD}; - margin: 10px 0; - font-size: 1.7rem; -`,mxr=se.div` - color: ${({theme:t})=>t.FONT_TITLE_INFO}; - font-style: italic; - margin: 0 auto; - margin-top: 10px; -`,yxr=se.div` - background: ${({theme:t,status:e})=>t[`CHIP_${e==null?void 0:e.toUpperCase()}`]}; - color: ${({theme:t})=>t.FONT_WHITE}; - padding: 3px 10px; - border-radius: 10px; - font-weight: ${({theme:t})=>t.FONT_WEIGHT_NORMAL}; - max-width: 100px; -`,wxr=()=>{const[t,e]=Z.useState(!1),{getValidatorSpotlight:r,validatorSpotlight:n,validatorSpotlightLoading:i}=js(),{validatorId:a}=Gr();Z.useEffect(()=>{r(a)},[r,a]);const{blockCount:o={count:0,total:0},bondHeight:s="--",consensusPubKey:l,description:c,imgUrl:u,jailedUntil:f,moniker:d,ownerAddress:h,operatorAddress:p,status:g,unbondingHeight:v,uptime:y,url:m,votingPower:b,withdrawalAddress:w}=n,C=g==="jailed",{count:A,total:S}=b||{},I=Qn(A/S*100,2),{count:D,total:L}=o,O={visibility:{visible:t,setVisible:e},noteMinWidth:"300px",position:"left",icon:{name:"HELP_OUTLINE",size:"1.7rem"},method:["click","hover"],fontColor:"FONT_WHITE",data:[{hideTitle:!0,title:"Explanation",value:"The address you used to create a validator, delegate, withdraw delegator reward, etc"}]},P=[{title:"Operator Address",value:Rr(p,11,"3"),copy:p,popupNote:O},{title:"Owner Address",value:Rr(h,11,"3"),copy:h,link:`/accounts/${h}`},{title:"Withdraw Address",value:Rr(w,11,"3"),copy:w,link:`/accounts/${w}`},...C?[{title:"Jailed Until",value:f?v5e(new Date(f)):"unknown"},{title:"Unbonding Height",value:v}]:[{title:"Voting Power",value:`${I}%`},{title:"Uptime",value:`${Qn(y,2)}%`},{title:"Missed Blocks",value:`${Qn(D)} in ${Qn(L)}`},{title:"Bond Height",value:Qn(s)}],{title:"Consensus Pubkey",value:Rr(l,11,"3"),copy:l}];return M.jsx(ln,{children:i?M.jsx(Br,{}):M.jsx(M.Fragment,{children:M.jsxs(pxr,{children:[M.jsxs(gxr,{children:[M.jsx(hxr,{children:M.jsx(w2,{icon:u,moniker:d,address:p})}),M.jsx(UG,{children:M.jsx(vxr,{title:d,children:Rr(d,18)})}),m&&M.jsx(UG,{title:d,children:M.jsx("a",{href:m,title:`${Rr(d,18)} url link`,target:"_blank",rel:"noopener noreferrer",children:m})}),c&&M.jsx(UG,{children:M.jsx(mxr,{children:c})})]}),M.jsxs("div",{children:[M.jsx(yxr,{status:g,children:Kr(g)}),M.jsx(dxr,{data:P})]})]})})})},bxr=()=>{const[t,e]=Z.useState(1),{matches:r}=Qr(_t.up("sm")),{getValidatorUnbondingDelegations:n,validatorUnbondingDelegations:i,validatorUnbondingDelegationsLoading:a,validatorUnbondingDelegationsPages:o,validatorUnbondingDelegationsTotal:s}=js(),{validatorId:l}=Gr(),c=5;Z.useEffect(()=>{n({id:l,page:t,count:c})},[n,c,t,l]);const u=[{displayName:"Address",dataName:"delegatorAddr"},{displayName:"Amount",dataName:"amount"},{displayName:"Block",dataName:"block"},{displayName:"End Time",dataName:"endTime"}],f=zt(s.amount,s.denom,{decimal:2});return M.jsx(cn,{tableHeaders:u,tableData:i,currentPage:t,changePage:e,totalPages:o,isLoading:a,title:`Unbonding Delegations (${f})`,size:r&&"48%"})},xxr=()=>{const[t,e]=Z.useState(1),{getValidatorTxs:r,validatorTxs:n,validatorTxsLoading:i,validatorTxsPages:a}=js(),{validatorId:o}=Gr(),s=10;Z.useEffect(()=>{r({id:o,page:t,count:s})},[r,s,t,o]);const l=[{displayName:"TxHash",dataName:"txHash"},{displayName:"Block",dataName:"block"},{displayName:"TxType",dataName:"txType"},{displayName:"Fee",dataName:"fee"},{displayName:"Signer",dataName:"signers"},{displayName:"Status",dataName:"status"},{displayName:"Timestamp",dataName:"time"}];return M.jsx(cn,{tableHeaders:l,tableData:n,currentPage:t,changePage:e,totalPages:a,isLoading:i,title:"Validation Transactions"})},_xr=()=>{const{validatorId:t}=Gr(),{matches:e}=Qr(_t.down("sm")),r=e?Rr(t,20,3):t;return M.jsxs(Ni,{children:[M.jsx(to,{title:"Validator Details",value:r,copyValue:t,copyTitle:"Copy Validator ID"}),M.jsx(cr,{header:!0,children:M.jsx(wxr,{})}),M.jsx(cr,{children:M.jsx(oxr,{})}),M.jsxs(cr,{children:[M.jsx(sxr,{}),M.jsx(bxr,{})]}),M.jsx(cr,{children:M.jsx(lxr,{})}),M.jsx(cr,{children:M.jsx(xxr,{})}),M.jsx(cr,{children:M.jsx(fxr,{})})]})},Sxr=se.div` - width: 100%; -`,Cxr=se(cn)` - margin-bottom: 20px; -`,Axr=()=>{const[t,e]=Z.useState(1),[r,n]=Z.useState(1),[i,a]=Z.useState("active"),[o,s]=Z.useState(Ca.DELEGATE),[l,c]=Z.useState([]),[u,f]=Z.useState(0),{allValidators:d,allValidatorsLoading:h,validators:p,validatorsPages:g,validatorsRecentLoading:v,getAllValidators:y,getValidatorsRecent:m,validatorsTotal:b=1}=js(),{isDelegate:w,ManageStakingBtn:C,modalFns:A,validator:S}=bte(),{accountDelegations:I,accountDelegationsLoading:D,accountDelegationsPages:L,accountRedelegations:O,accountRedelegationsLoading:P,accountRewards:x,accountRewardsLoading:T,accountUnbonding:E,accountUnbondingLoading:N}=Vc(),{tableCount:F,isLoggedIn:B}=Ki(),j=Z.useMemo(()=>{switch(o){case Ca.DELEGATE:return I;case Ca.REDELEGATE:return O;case Ca.UNDELEGATE:return E;default:return null}},[o,I,O,E]),k=i==="active",$=i==="jailed",H=o===Ca.DELEGATE;Z.useEffect(()=>{B&&y({page:1,count:100,status:"all"})},[B,y]),Z.useEffect(()=>{m({page:t,count:F,status:i})},[m,F,t,i]),Z.useEffect(()=>{c(j.map(J=>{const ee=d.find(oe=>oe.addressId===J.validatorSrcAddr),ne=x.rewards.find(oe=>oe.validatorAddress===J.validatorSrcAddr),V=(ne==null?void 0:ne.reward.length)>0?`$${zt(ne.reward[0].totalBalancePrice.amount,ne.reward[0].totalBalancePrice.denom,{decimal:4,minimumFractionDigits:2})}`:"-- --";return{...ne,totalBalancePrice:V,...ee,...J}})),n(1)},[x,d,j,H,c]),Z.useEffect(()=>{const J=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),ee=1/b*5.5,ne=J.format(ee);f(ne)},[b]);const Y=[H&&{displayName:"Staking",dataName:"manageStaking"},{displayName:"Moniker",dataName:"moniker"},{displayName:"Commission",dataName:"commission"},{displayName:"Delegation Amount",dataName:"amount"},H&&{displayName:"Reward",dataName:"reward"},H&&{displayName:"Total Value",dataName:"totalBalancePrice"},!H&&{displayName:"End Time",dataName:"endTime"}].filter(J=>J),ie=[B&&{displayName:"Staking",dataName:"delegate"},{displayName:"Moniker",dataName:"moniker"},{displayName:"Address",dataName:"addressId"},{displayName:"Commission",dataName:"commission"},{displayName:"Bonded Tokens",dataName:"bondedTokens"},k&&{displayName:"Voting Power*",dataName:"votingPower"},k&&{displayName:"24Hr Power Change",dataName:"hr24Change"},!$&&{displayName:"Delegators",dataName:"delegators"},$&&{displayName:"Unbonding Height",dataName:"unbondingHeight"}].filter(J=>J),W=[{title:"My Validator Type:",type:"dropdown",options:kVe,action:s}],Q=[{title:"Validator Status:",type:"dropdown",options:PVe,action:a}];return M.jsxs(Sxr,{children:[[...I,...O,...E].length>0&&B&&M.jsxs(Z.Fragment,{children:[M.jsx(Kl,{filterData:W}),M.jsx(Cxr,{changePage:n,currentPage:r,isLoading:D||P||N||T||h,ManageStakingBtn:C,tableData:l,tableHeaders:Y,title:"My Validators",totalPages:H?L:1})]}),M.jsx(Kl,{filterData:Q}),M.jsx(cn,{tableHeaders:ie,tableData:p,currentPage:t,changePage:e,totalPages:g,isLoading:v,title:"Validators List",ManageStakingBtn:C}),M.jsx(bDe,{isDelegate:w,isLoggedIn:B,modalOpen:A.modalOpen,onClose:A.deactivateModalOpen,validator:S||{}}),k&&M.jsxs("p",{children:["*Maximum voting power is currently ",u]})]})},Txr=()=>{const{validatorsTotal:t}=js();return M.jsxs(Ni,{children:[M.jsx(to,{title:"Validators List",value:`${t} total`}),M.jsx(cr,{header:!0,children:M.jsx(Axr,{})})]})},Exr=()=>{const t="",{activeTheme:e}=gte(),{setAuthToken:r}=Ki(),{assetMetadata:n,assetMetadataLoading:i,getAssetMetadata:a,assetMetadataFailed:o}=Av();return Z.useEffect(()=>{Rn(n)&&!i&&!o&&a()},[n,i,a,o]),Z.useEffect(()=>{},[r,t]),M.jsxs(SOt,{basename:"",children:[M.jsx(NOt,{theme:e}),M.jsx(Ejt,{}),M.jsx(d8e,{theme:e,children:M.jsxs(iIe,{children:[M.jsx(BLt,{}),M.jsxs(_Ot,{children:[M.jsx(yi,{exact:!0,path:"/",children:M.jsx(mOt,{to:"/dashboard"})}),M.jsx(yi,{path:"/accounts/:addressId",component:K0r}),M.jsx(yi,{path:"/announcement/:announcementId",component:uyr}),M.jsx(yi,{path:"/announcements",component:wyr}),M.jsx(yi,{path:"/asset/:assetId*",component:Tyr}),M.jsx(yi,{path:"/assets",component:Pyr}),M.jsx(yi,{path:"/blocks",component:Fyr}),M.jsx(yi,{path:"/block/:blockHeight",component:$yr}),M.jsx(yi,{path:"/code/:codeId",component:qyr}),M.jsx(yi,{path:"/contract/:contractId",component:ewr}),M.jsx(yi,{path:"/contracts",component:swr}),M.jsx(yi,{exact:!0,path:"/dashboard",component:lwr}),M.jsx(yi,{path:"/faucet",children:M.jsx(Iwr,{})}),M.jsx(yi,{path:"/hashstats",component:Hwr}),M.jsx(yi,{path:"/ibc",component:Zwr}),M.jsx(yi,{path:"/icons",children:M.jsx(tbr,{})}),M.jsx(yi,{path:"/network/name-tree",component:lbr}),M.jsx(yi,{path:"/nft/:addr",component:hbr}),M.jsx(yi,{path:"/nfts/:addr",component:gbr}),M.jsx(yi,{path:"/proposal/:proposalId",component:i2r}),M.jsx(yi,{path:"/proposals",component:h2r}),M.jsx(yi,{path:"/network/token-stats",component:w2r}),M.jsx(yi,{path:"/network/gas",component:Uwr}),M.jsx(yi,{path:"/network/upgrades",component:axr}),M.jsx(yi,{path:"/network/params",component:Cbr}),M.jsx(yi,{path:"/tx/:txHash",component:D2r}),M.jsx(yi,{path:"/txdash",component:Q2r}),M.jsx(yi,{path:"/txs",component:rxr}),M.jsx(yi,{path:"/validator/:validatorId",component:_xr}),M.jsx(yi,{path:"/validators",component:Txr}),M.jsx(yi,{component:gF})]}),M.jsx(z$t,{})]})})]})};d3e.render(M.jsx(EHe,{store:kut(),children:M.jsx(mDt,{children:M.jsx(Exr,{})})}),document.getElementById("root"));export{VD as $,Ze as A,jD as B,Pe as C,jb as D,Vt as E,Vf as F,UD as G,Qg as H,ph as I,hT as J,r5 as K,Tq as L,jr as M,zD as N,At as O,pT as P,n5 as Q,Ye as R,vr as S,Gw as T,Tr as U,uN as V,xn as W,Ub as X,$Ae as Y,hh as Z,zb as _,Hl as a,UT as a$,gT as a0,gh as a1,vT as a2,Gf as a3,mu as a4,Iq as a5,yu as a6,yT as a7,GD as a8,i5 as a9,p5 as aA,tv as aB,Jp as aC,g5 as aD,Vb as aE,Gb as aF,AT as aG,TT as aH,Wb as aI,KD as aJ,Gl as aK,Nc as aL,ZD as aM,xr as aN,Bf as aO,gt as aP,ya as aQ,Ia as aR,R2 as aS,Un as aT,IJ as aU,td as aV,bQ as aW,PRt as aX,jSe as aY,s$ as aZ,H1 as a_,Zg as aa,a5 as ab,Zp as ac,Dq as ad,O1 as ae,Hb as af,Qp as ag,bT as ah,mT as ai,u5 as aj,Xp as ak,Xg as al,f5 as am,Kg as an,d5 as ao,xT as ap,h5 as aq,L1 as ar,$1 as as,YD as at,_T as au,B1 as av,Jg as aw,ev as ax,ST as ay,CT as az,xe as b,kt as b0,xee as b1,ah as b2,Bkt as b3,Oee as b4,d2 as b5,fTe as b6,ZA as b7,lv as b8,nTe as b9,GSr as ba,hee as bb,DN as bc,N$ as bd,WSr as be,YSr as bf,T7t as bg,Fe as c,Dr as d,BAe as e,mt as f,s7 as g,He as h,Je as i,Qxr as j,X as k,lCe as l,Ppt as m,Cq as n,e5 as o,wa as p,t5 as q,Wd as r,gl as s,Aq as t,fT as u,FD as v,Bb as w,Fb as x,dT as y,Hf as z}; diff --git a/dist/assets/secp256k1-CThcWgWC.js b/dist/assets/secp256k1-CThcWgWC.js deleted file mode 100644 index 5bff3a0d..00000000 --- a/dist/assets/secp256k1-CThcWgWC.js +++ /dev/null @@ -1 +0,0 @@ -import{b9 as Pt,ba as Ft,bb as Gt,bc as Ot,bd as Wt,be as Xt,bf as Dt,bg as Qt}from"./index-DY4jrsxT.js";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ut=BigInt(0),ht=BigInt(1),Jt=BigInt(2);function nt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function lt(e){if(!nt(e))throw new Error("Uint8Array expected")}const te=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function st(e){lt(e);let n="";for(let t=0;t=P._0&&e<=P._9)return e-P._0;if(e>=P._A&&e<=P._F)return e-(P._A-10);if(e>=P._a&&e<=P._f)return e-(P._a-10)}function ct(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const n=e.length,t=n/2;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const r=new Uint8Array(t);for(let s=0,i=0;sUt;e>>=ht,n+=1);return n}function ie(e,n){return e>>BigInt(n)&ht}function se(e,n,t){return e|(t?ht:Ut)<(Jt<new Uint8Array(e),_t=e=>Uint8Array.from(e);function Ct(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=wt(e),s=wt(e),i=0;const l=()=>{r.fill(1),s.fill(0),i=0},c=(...w)=>t(s,r,...w),o=(w=wt())=>{s=c(_t([0]),w),r=c(),w.length!==0&&(s=c(_t([1]),w),r=c())},a=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const q=[];for(;w{l(),o(w);let T;for(;!(T=q(a()));)o();return l(),T}}const ce={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||nt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,n)=>n.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function dt(e,n,t={}){const r=(s,i,l)=>{const c=ce[i];if(typeof c!="function")throw new Error(`Invalid validator "${i}", expected function`);const o=e[s];if(!(l&&o===void 0)&&!c(o,e))throw new Error(`Invalid param ${String(s)}=${o} (${typeof o}), expected ${i}`)};for(const[s,i]of Object.entries(n))r(s,i,!1);for(const[s,i]of Object.entries(t))r(s,i,!0);return e}const fe=Object.freeze(Object.defineProperty({__proto__:null,abytes:lt,bitGet:ie,bitLen:oe,bitMask:It,bitSet:se,bytesToHex:st,bytesToNumberBE:et,bytesToNumberLE:xt,concatBytes:ut,createHmacDrbg:Ct,ensureBytes:M,equalBytes:ne,hexToBytes:ct,hexToNumber:Bt,isBytes:nt,numberToBytesBE:ft,numberToBytesLE:vt,numberToHexUnpadded:Rt,numberToVarBytesBE:ee,utf8ToBytes:re,validateObject:dt},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const L=BigInt(0),$=BigInt(1),J=BigInt(2),ae=BigInt(3),yt=BigInt(4),Tt=BigInt(5),$t=BigInt(8);BigInt(9);BigInt(16);function R(e,n){const t=e%n;return t>=L?t:n+t}function ue(e,n,t){if(t<=L||n 0");if(t===$)return L;let r=$;for(;n>L;)n&$&&(r=r*e%t),e=e*e%t,n>>=$;return r}function V(e,n,t){let r=e;for(;n-- >L;)r*=r,r%=t;return r}function bt(e,n){if(e===L||n<=L)throw new Error(`invert: expected positive integers, got n=${e} mod=${n}`);let t=R(e,n),r=n,s=L,i=$;for(;t!==L;){const c=r/t,o=r%t,a=s-i*c;r=t,t=o,s=i,i=a}if(r!==$)throw new Error("invert: does not exist");return R(s,n)}function le(e){const n=(e-$)/J;let t,r,s;for(t=e-$,r=0;t%J===L;t/=J,r++);for(s=J;s(r[s]="function",r),n);return dt(e,t)}function we(e,n,t){if(t 0");if(t===L)return e.ONE;if(t===$)return n;let r=e.ONE,s=n;for(;t>L;)t&$&&(r=e.mul(r,s)),s=e.sqr(s),t>>=$;return r}function pe(e,n){const t=new Array(n.length),r=n.reduce((i,l,c)=>e.is0(l)?i:(t[c]=i,e.mul(i,l)),e.ONE),s=e.inv(r);return n.reduceRight((i,l,c)=>e.is0(l)?i:(t[c]=e.mul(i,t[c]),e.mul(i,l)),s),t}function zt(e,n){const t=n!==void 0?n:e.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function ye(e,n,t=!1,r={}){if(e<=L)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:i}=zt(e,n);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=de(e),c=Object.freeze({ORDER:e,BITS:s,BYTES:i,MASK:It(s),ZERO:L,ONE:$,create:o=>R(o,e),isValid:o=>{if(typeof o!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof o}`);return L<=o&&oo===L,isOdd:o=>(o&$)===$,neg:o=>R(-o,e),eql:(o,a)=>o===a,sqr:o=>R(o*o,e),add:(o,a)=>R(o+a,e),sub:(o,a)=>R(o-a,e),mul:(o,a)=>R(o*a,e),pow:(o,a)=>we(c,o,a),div:(o,a)=>R(o*bt(a,e),e),sqrN:o=>o*o,addN:(o,a)=>o+a,subN:(o,a)=>o-a,mulN:(o,a)=>o*a,inv:o=>bt(o,e),sqrt:r.sqrt||(o=>l(c,o)),invertBatch:o=>pe(c,o),cmov:(o,a,y)=>y?a:o,toBytes:o=>t?vt(o,i):ft(o,i),fromBytes:o=>{if(o.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${o.length}`);return t?xt(o):et(o)}});return Object.freeze(c)}function kt(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const n=e.toString(2).length;return Math.ceil(n/8)}function Vt(e){const n=kt(e);return n+Math.ceil(n/2)}function be(e,n,t=!1){const r=e.length,s=kt(n),i=Vt(n);if(r<16||r1024)throw new Error(`expected ${i}-1024 bytes of input, got ${r}`);const l=t?et(e):xt(e),c=R(l,n-$)+$;return t?vt(c,s):ft(c,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const me=BigInt(0),pt=BigInt(1);function Ee(e,n){const t=(s,i)=>{const l=i.negate();return s?l:i},r=s=>{const i=Math.ceil(n/s)+1,l=2**(s-1);return{windows:i,windowSize:l}};return{constTimeNegate:t,unsafeLadder(s,i){let l=e.ZERO,c=s;for(;i>me;)i&pt&&(l=l.add(c)),c=c.double(),i>>=pt;return l},precomputeWindow(s,i){const{windows:l,windowSize:c}=r(i),o=[];let a=s,y=a;for(let w=0;w>=T,d>o&&(d-=q,l+=pt);const h=f,m=f+Math.abs(d)-1,B=b%2!==0,S=d<0;d===0?y=y.add(t(B,i[h])):a=a.add(t(S,i[m]))}return{p:a,f:y}},wNAFCached(s,i,l,c){const o=s._WINDOW_SIZE||1;let a=i.get(s);return a||(a=this.precomputeWindow(s,o),o!==1&&i.set(s,c(a))),this.wNAF(o,a,l)}}}function jt(e){return ge(e.Fp),dt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...zt(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Be(e){const n=jt(e);dt(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:r,a:s}=n;if(t){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:xe,hexToBytes:ve}=fe,tt={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(e){const{Err:n}=tt;if(e.length<2||e[0]!==2)throw new n("Invalid signature integer tag");const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new n("Invalid signature integer: wrong length");if(r[0]&128)throw new n("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new n("Invalid signature integer: unnecessary leading zero");return{d:xe(r),l:e.subarray(t+2)}},toSig(e){const{Err:n}=tt,t=typeof e=="string"?ve(e):e;lt(t);let r=t.length;if(r<2||t[0]!=48)throw new n("Invalid signature tag");if(t[1]!==r-2)throw new n("Invalid signature: incorrect length");const{d:s,l:i}=tt._parseInt(t.subarray(2)),{d:l,l:c}=tt._parseInt(i);if(c.length)throw new n("Invalid signature: left bytes after parsing");return{r:s,s:l}},hexFromSig(e){const n=a=>Number.parseInt(a[0],16)&8?"00"+a:a,t=a=>{const y=a.toString(16);return y.length&1?`0${y}`:y},r=n(t(e.s)),s=n(t(e.r)),i=r.length/2,l=s.length/2,c=t(i),o=t(l);return`30${t(l+i+4)}02${o}${s}02${c}${r}`}},F=BigInt(0),j=BigInt(1);BigInt(2);const Ht=BigInt(3);BigInt(4);function Ie(e){const n=Be(e),{Fp:t}=n,r=n.toBytes||((b,f,d)=>{const h=f.toAffine();return ut(Uint8Array.from([4]),t.toBytes(h.x),t.toBytes(h.y))}),s=n.fromBytes||(b=>{const f=b.subarray(1),d=t.fromBytes(f.subarray(0,t.BYTES)),h=t.fromBytes(f.subarray(t.BYTES,2*t.BYTES));return{x:d,y:h}});function i(b){const{a:f,b:d}=n,h=t.sqr(b),m=t.mul(h,b);return t.add(t.add(m,t.mul(b,f)),d)}if(!t.eql(t.sqr(n.Gy),i(n.Gx)))throw new Error("bad generator point: equation left != right");function l(b){return typeof b=="bigint"&&Ft.eql(B,t.ZERO);return m(d)&&m(h)?w.ZERO:new w(d,h,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(f){const d=t.invertBatch(f.map(h=>h.pz));return f.map((h,m)=>h.toAffine(d[m])).map(w.fromAffine)}static fromHex(f){const d=w.fromAffine(s(M("pointHex",f)));return d.assertValidity(),d}static fromPrivateKey(f){return w.BASE.multiply(o(f))}_setWindowSize(f){this._WINDOW_SIZE=f,a.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:f,y:d}=this.toAffine();if(!t.isValid(f)||!t.isValid(d))throw new Error("bad point: x or y not FE");const h=t.sqr(d),m=i(f);if(!t.eql(h,m))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:f}=this.toAffine();if(t.isOdd)return!t.isOdd(f);throw new Error("Field doesn't support isOdd")}equals(f){y(f);const{px:d,py:h,pz:m}=this,{px:B,py:S,pz:I}=f,p=t.eql(t.mul(d,I),t.mul(B,m)),E=t.eql(t.mul(h,I),t.mul(S,m));return p&&E}negate(){return new w(this.px,t.neg(this.py),this.pz)}double(){const{a:f,b:d}=n,h=t.mul(d,Ht),{px:m,py:B,pz:S}=this;let I=t.ZERO,p=t.ZERO,E=t.ZERO,v=t.mul(m,m),k=t.mul(B,B),_=t.mul(S,S),A=t.mul(m,B);return A=t.add(A,A),E=t.mul(m,S),E=t.add(E,E),I=t.mul(f,E),p=t.mul(h,_),p=t.add(I,p),I=t.sub(k,p),p=t.add(k,p),p=t.mul(I,p),I=t.mul(A,I),E=t.mul(h,E),_=t.mul(f,_),A=t.sub(v,_),A=t.mul(f,A),A=t.add(A,E),E=t.add(v,v),v=t.add(E,v),v=t.add(v,_),v=t.mul(v,A),p=t.add(p,v),_=t.mul(B,S),_=t.add(_,_),v=t.mul(_,A),I=t.sub(I,v),E=t.mul(_,k),E=t.add(E,E),E=t.add(E,E),new w(I,p,E)}add(f){y(f);const{px:d,py:h,pz:m}=this,{px:B,py:S,pz:I}=f;let p=t.ZERO,E=t.ZERO,v=t.ZERO;const k=n.a,_=t.mul(n.b,Ht);let A=t.mul(d,B),C=t.mul(h,S),z=t.mul(m,I),G=t.add(d,h),u=t.add(B,S);G=t.mul(G,u),u=t.add(A,C),G=t.sub(G,u),u=t.add(d,m);let g=t.add(B,I);return u=t.mul(u,g),g=t.add(A,z),u=t.sub(u,g),g=t.add(h,m),p=t.add(S,I),g=t.mul(g,p),p=t.add(C,z),g=t.sub(g,p),v=t.mul(k,u),p=t.mul(_,z),v=t.add(p,v),p=t.sub(C,v),v=t.add(C,v),E=t.mul(p,v),C=t.add(A,A),C=t.add(C,A),z=t.mul(k,z),u=t.mul(_,u),C=t.add(C,z),z=t.sub(A,z),z=t.mul(k,z),u=t.add(u,z),A=t.mul(C,u),E=t.add(E,A),A=t.mul(g,u),p=t.mul(G,p),p=t.sub(p,A),A=t.mul(G,C),v=t.mul(g,v),v=t.add(v,A),new w(p,E,v)}subtract(f){return this.add(f.negate())}is0(){return this.equals(w.ZERO)}wNAF(f){return T.wNAFCached(this,a,f,d=>{const h=t.invertBatch(d.map(m=>m.pz));return d.map((m,B)=>m.toAffine(h[B])).map(w.fromAffine)})}multiplyUnsafe(f){const d=w.ZERO;if(f===F)return d;if(c(f),f===j)return this;const{endo:h}=n;if(!h)return T.unsafeLadder(this,f);let{k1neg:m,k1:B,k2neg:S,k2:I}=h.splitScalar(f),p=d,E=d,v=this;for(;B>F||I>F;)B&j&&(p=p.add(v)),I&j&&(E=E.add(v)),v=v.double(),B>>=j,I>>=j;return m&&(p=p.negate()),S&&(E=E.negate()),E=new w(t.mul(E.px,h.beta),E.py,E.pz),p.add(E)}multiply(f){c(f);let d=f,h,m;const{endo:B}=n;if(B){const{k1neg:S,k1:I,k2neg:p,k2:E}=B.splitScalar(d);let{p:v,f:k}=this.wNAF(I),{p:_,f:A}=this.wNAF(E);v=T.constTimeNegate(S,v),_=T.constTimeNegate(p,_),_=new w(t.mul(_.px,B.beta),_.py,_.pz),h=v.add(_),m=k.add(A)}else{const{p:S,f:I}=this.wNAF(d);h=S,m=I}return w.normalizeZ([h,m])[0]}multiplyAndAddUnsafe(f,d,h){const m=w.BASE,B=(I,p)=>p===F||p===j||!I.equals(m)?I.multiplyUnsafe(p):I.multiply(p),S=B(this,d).add(B(f,h));return S.is0()?void 0:S}toAffine(f){const{px:d,py:h,pz:m}=this,B=this.is0();f==null&&(f=B?t.ONE:t.inv(m));const S=t.mul(d,f),I=t.mul(h,f),p=t.mul(m,f);if(B)return{x:t.ZERO,y:t.ZERO};if(!t.eql(p,t.ONE))throw new Error("invZ was invalid");return{x:S,y:I}}isTorsionFree(){const{h:f,isTorsionFree:d}=n;if(f===j)return!0;if(d)return d(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:f,clearCofactor:d}=n;return f===j?this:d?d(w,this):this.multiplyUnsafe(n.h)}toRawBytes(f=!0){return this.assertValidity(),r(w,this,f)}toHex(f=!0){return st(this.toRawBytes(f))}}w.BASE=new w(n.Gx,n.Gy,t.ONE),w.ZERO=new w(t.ZERO,t.ONE,t.ZERO);const q=n.nBitLength,T=Ee(w,n.endo?Math.ceil(q/2):q);return{CURVE:n,ProjectivePoint:w,normPrivateKeyToScalar:o,weierstrassEquation:i,isWithinCurveOrder:l}}function Se(e){const n=jt(e);return dt(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function Ae(e){const n=Se(e),{Fp:t,n:r}=n,s=t.BYTES+1,i=2*t.BYTES+1;function l(u){return Fst(ft(u,n.nByteLength));function b(u){const g=r>>j;return u>g}function f(u){return b(u)?c(-u):u}const d=(u,g,x)=>et(u.slice(g,x));class h{constructor(g,x,N){this.r=g,this.s=x,this.recovery=N,this.assertValidity()}static fromCompact(g){const x=n.nByteLength;return g=M("compactSignature",g,x*2),new h(d(g,0,x),d(g,x,2*x))}static fromDER(g){const{r:x,s:N}=tt.toSig(M("DER",g));return new h(x,N)}assertValidity(){if(!q(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!q(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(g){return new h(this.r,this.s,g)}recoverPublicKey(g){const{r:x,s:N,recovery:O}=this,H=E(M("msgHash",g));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const Z=O===2||O===3?x+n.n:x;if(Z>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const U=O&1?"03":"02",W=a.fromHex(U+T(Z)),Y=o(Z),X=c(-H*Y),at=c(N*Y),D=a.BASE.multiplyAndAddUnsafe(W,X,at);if(!D)throw new Error("point at infinify");return D.assertValidity(),D}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return ct(this.toDERHex())}toDERHex(){return tt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ct(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}const m={isValidPrivateKey(u){try{return y(u),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const u=Vt(n.n);return be(n.randomBytes(u),n.n)},precompute(u=8,g=a.BASE){return g._setWindowSize(u),g.multiply(BigInt(3)),g}};function B(u,g=!0){return a.fromPrivateKey(u).toRawBytes(g)}function S(u){const g=nt(u),x=typeof u=="string",N=(g||x)&&u.length;return g?N===s||N===i:x?N===2*s||N===2*i:u instanceof a}function I(u,g,x=!0){if(S(u))throw new Error("first arg must be private key");if(!S(g))throw new Error("second arg must be public key");return a.fromHex(g).multiply(y(u)).toRawBytes(x)}const p=n.bits2int||function(u){const g=et(u),x=u.length*8-n.nBitLength;return x>0?g>>BigInt(x):g},E=n.bits2int_modN||function(u){return c(p(u))},v=It(n.nBitLength);function k(u){if(typeof u!="bigint")throw new Error("bigint expected");if(!(F<=u&&uQ in x))throw new Error("sign() legacy options not supported");const{hash:N,randomBytes:O}=n;let{lowS:H,prehash:Z,extraEntropy:U}=x;H==null&&(H=!0),u=M("msgHash",u),Z&&(u=M("prehashed msgHash",N(u)));const W=E(u),Y=y(g),X=[k(Y),k(W)];if(U!=null&&U!==!1){const Q=U===!0?O(t.BYTES):U;X.push(M("extraEntropy",Q))}const at=ut(...X),D=W;function gt(Q){const rt=p(Q);if(!q(rt))return;const St=o(rt),ot=a.BASE.multiply(rt).toAffine(),K=c(ot.x);if(K===F)return;const it=c(St*c(D+K*Y));if(it===F)return;let At=(ot.x===K?0:2)|Number(ot.y&j),qt=it;return H&&b(it)&&(qt=f(it),At^=1),new h(K,qt,At)}return{seed:at,k2sig:gt}}const A={lowS:n.lowS,prehash:!1},C={lowS:n.lowS,prehash:!1};function z(u,g,x=A){const{seed:N,k2sig:O}=_(u,g,x),H=n;return Ct(H.hash.outputLen,H.nByteLength,H.hmac)(N,O)}a.BASE._setWindowSize(8);function G(u,g,x,N=C){var ot;const O=u;if(g=M("msgHash",g),x=M("publicKey",x),"strict"in N)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:Z}=N;let U,W;try{if(typeof O=="string"||nt(O))try{U=h.fromDER(O)}catch(K){if(!(K instanceof tt.Err))throw K;U=h.fromCompact(O)}else if(typeof O=="object"&&typeof O.r=="bigint"&&typeof O.s=="bigint"){const{r:K,s:it}=O;U=new h(K,it)}else throw new Error("PARSE");W=a.fromHex(x)}catch(K){if(K.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&U.hasHighS())return!1;Z&&(g=n.hash(g));const{r:Y,s:X}=U,at=E(g),D=o(X),gt=c(at*D),Q=c(Y*D),rt=(ot=a.BASE.multiplyAndAddUnsafe(W,gt,Q))==null?void 0:ot.toAffine();return rt?c(rt.x)===Y:!1}return{CURVE:n,getPublicKey:B,getSharedSecret:I,sign:z,verify:G,ProjectivePoint:a,Signature:h,utils:m}}class Yt extends Pt{constructor(n,t){super(),this.finished=!1,this.destroyed=!1,Ft(n);const r=Gt(t);if(this.iHash=n.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;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?n.create().update(r).digest():r);for(let l=0;lnew Yt(e,n).update(t).digest();Kt.create=(e,n)=>new Yt(e,n);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qe(e){return{hash:e,hmac:(n,...t)=>Kt(e,n,Xt(...t)),randomBytes:Dt}}function Oe(e,n){const t=r=>Ae({...e,...qe(r)});return Object.freeze({...t(n),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Mt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Lt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ne=BigInt(1),mt=BigInt(2),Zt=(e,n)=>(e+n/mt)/n;function _e(e){const n=Mt,t=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),l=BigInt(23),c=BigInt(44),o=BigInt(88),a=e*e*e%n,y=a*a*e%n,w=V(y,t,n)*y%n,q=V(w,t,n)*y%n,T=V(q,mt,n)*a%n,b=V(T,s,n)*T%n,f=V(b,i,n)*b%n,d=V(f,c,n)*f%n,h=V(d,o,n)*d%n,m=V(h,c,n)*f%n,B=V(m,t,n)*y%n,S=V(B,l,n)*b%n,I=V(S,r,n)*a%n,p=V(I,mt,n);if(!Et.eql(Et.sqr(p),e))throw new Error("Cannot find square root");return p}const Et=ye(Mt,void 0,void 0,{sqrt:_e}),Te=Oe({a:BigInt(0),b:BigInt(7),Fp:Et,n:Lt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const n=Lt,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ne*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,l=BigInt("0x100000000000000000000000000000000"),c=Zt(i*e,n),o=Zt(-r*e,n);let a=R(e-c*t-o*s,n),y=R(-c*r-o*i,n);const w=a>l,q=y>l;if(w&&(a=n-a),q&&(y=n-y),a>l||y>l)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:w,k1:a,k2neg:q,k2:y}}}},Qt);BigInt(0);Te.ProjectivePoint;export{Te as secp256k1}; diff --git a/dist/assets/w3m-modal-BzJLjRtR.js b/dist/assets/w3m-modal-BzJLjRtR.js deleted file mode 100644 index f9d32152..00000000 --- a/dist/assets/w3m-modal-BzJLjRtR.js +++ /dev/null @@ -1,151 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Cdw1Pm6b.js","./index-DY4jrsxT.js","./index-DUBt2OAj.css"])))=>i.map(i=>d[i]); -import{i as C,h as k,M as n,C as h,O as v,aN as S,A as p,E,k as A,R as c,aO as f,U as x,j as _,S as O,aP as b,aQ as L,b as w,aR as N,c as I}from"./index-DY4jrsxT.js";const R=C` - :host { - z-index: var(--w3m-z-index); - display: block; - backface-visibility: hidden; - will-change: opacity; - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - pointer-events: none; - opacity: 0; - background-color: var(--wui-cover); - transition: opacity 0.2s var(--wui-ease-out-power-2); - will-change: opacity; - } - - :host(.open) { - opacity: 1; - } - - wui-card { - max-width: var(--w3m-modal-width); - width: 100%; - position: relative; - animation: zoom-in 0.2s var(--wui-ease-out-power-2); - animation-fill-mode: backwards; - outline: none; - } - - wui-card[shake='true'] { - animation: - zoom-in 0.2s var(--wui-ease-out-power-2), - w3m-shake 0.5s var(--wui-ease-out-power-2); - } - - wui-flex { - overflow-x: hidden; - overflow-y: auto; - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 100%; - } - - @media (max-height: 700px) and (min-width: 431px) { - wui-flex { - align-items: flex-start; - } - - wui-card { - margin: var(--wui-spacing-xxl) 0px; - } - } - - @media (max-width: 430px) { - wui-flex { - align-items: flex-end; - } - - wui-card { - max-width: 100%; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - border-bottom: none; - animation: slide-in 0.2s var(--wui-ease-out-power-2); - } - - wui-card[shake='true'] { - animation: - slide-in 0.2s var(--wui-ease-out-power-2), - w3m-shake 0.5s var(--wui-ease-out-power-2); - } - } - - @keyframes zoom-in { - 0% { - transform: scale(0.95) translateY(0); - } - 100% { - transform: scale(1) translateY(0); - } - } - - @keyframes slide-in { - 0% { - transform: scale(1) translateY(50px); - } - 100% { - transform: scale(1) translateY(0); - } - } - - @keyframes w3m-shake { - 0% { - transform: scale(1) rotate(0deg); - } - 20% { - transform: scale(1) rotate(-1deg); - } - 40% { - transform: scale(1) rotate(1.5deg); - } - 60% { - transform: scale(1) rotate(-1.5deg); - } - 80% { - transform: scale(1) rotate(1deg); - } - 100% { - transform: scale(1) rotate(0deg); - } - } - - @keyframes w3m-view-height { - from { - height: var(--prev-height); - } - to { - height: var(--new-height); - } - } -`;var d=function(u,e,t,i){var s=arguments.length,o=s<3?e:i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(u,e,t,i);else for(var r=u.length-1;r>=0;r--)(a=u[r])&&(o=(s<3?a(o):s>3?a(e,t,o):a(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const g="scroll-lock";let l=class extends k{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=n.state.open,this.caipAddress=h.state.activeCaipAddress,this.caipNetwork=h.state.activeCaipNetwork,this.isSiweEnabled=v.state.isSiweEnabled,this.shake=n.state.shake,this.initializeTheming(),S.prefetch(),this.unsubscribe.push(n.subscribeKey("open",e=>e?this.onOpen():this.onClose()),n.subscribeKey("shake",e=>this.shake=e),p.subscribeKey("siweStatus",e=>this.onSiweStatusChange(e),"eip155"),h.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),h.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),v.subscribeKey("isSiweEnabled",e=>this.isSiweEnabled=e)),E.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?A` - - - - - - - - - - `:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=c.state.view==="ConnectingSiwe",t=c.state.view==="ApproveTransaction";if(this.isSiweEnabled){const{SIWEController:i}=await f(async()=>{const{SIWEController:o}=await import("./index-Cdw1Pm6b.js");return{SIWEController:o}},__vite__mapDeps([0,1,2]),import.meta.url);i.state.status!=="success"&&(e||t)?n.shake():n.close()}else n.close()}initializeTheming(){const{themeVariables:e,themeMode:t}=N.state,i=x.getColorTheme(t);_(e,i)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),O.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=g,e.textContent=` - body { - touch-action: none; - overflow: hidden; - overscroll-behavior: contain; - } - w3m-modal { - pointer-events: auto; - } - `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${g}"]`);e&&e.remove()}onAddKeyboardListener(){var t;this.abortController=new AbortController;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",i=>{if(i.key==="Escape")this.handleClose();else if(i.key==="Tab"){const{tagName:s}=i.target;s&&!s.includes("W3M-")&&!s.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}onSiweStatusChange(e){e==="success"&&n.close()}async onNewAddress(e){var o;const t=this.caipAddress?b.getPlainAddress(this.caipAddress):void 0,i=e?b.getPlainAddress(e):void 0;if(i&&!(t===i)&&this.isSiweEnabled){const{SIWEController:a}=await f(async()=>{const{SIWEController:m}=await import("./index-Cdw1Pm6b.js");return{SIWEController:m}},__vite__mapDeps([0,1,2]),import.meta.url),r=p.state.siweStatus==="success";!t&&i?this.onSiweNavigation():r&&t&&i&&t!==i&&(o=a.state._client)!=null&&o.options.signOutOnAccountChange&&(await a.signOut(),this.onSiweNavigation())}i||n.close(),this.caipAddress=e}async onNewNetwork(e){var s,o,a,r;if(!this.caipAddress){this.caipNetwork=e,c.goBack();return}const t=(o=(s=this.caipNetwork)==null?void 0:s.id)==null?void 0:o.toString(),i=(a=e==null?void 0:e.id)==null?void 0:a.toString();if(t&&i&&t!==i)if(this.isSiweEnabled){const{SIWEController:m}=await f(async()=>{const{SIWEController:y}=await import("./index-Cdw1Pm6b.js");return{SIWEController:y}},__vite__mapDeps([0,1,2]),import.meta.url);(r=m.state._client)!=null&&r.options.signOutOnNetworkChange?(await m.signOut(),this.onSiweNavigation()):c.goBack()}else c.goBack();this.caipNetwork=e}onSiweNavigation(){const e=h.state.activeChain===L.CHAIN.EVM;!(p.state.siweStatus==="success")&&e?this.open?c.replace("ConnectingSiwe"):n.open({view:"ConnectingSiwe"}):c.goBack()}};l.styles=R;d([w()],l.prototype,"open",void 0);d([w()],l.prototype,"caipAddress",void 0);d([w()],l.prototype,"caipNetwork",void 0);d([w()],l.prototype,"isSiweEnabled",void 0);d([w()],l.prototype,"shake",void 0);l=d([I("w3m-modal")],l);export{l as W3mModal}; diff --git a/dist/index.html b/dist/index.html index de1b3750..07039bc4 100644 --- a/dist/index.html +++ b/dist/index.html @@ -18,8 +18,8 @@ Provenance Explorer - - + + diff --git a/package.json b/package.json index d73d6a29..3e458404 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,8 @@ }, "scripts": { "start": "vite", - "build": "tsc && vite build", + "build": "vite build", + "tsc": "tsc", "preview": "vite preview", "cy:install": "cypress install", "cy:run": "cypress run",