UNPKG

@unielon/wallet-tg-sdk

Version:

unielon wallet sdk for telegram

7 lines 60.3 kB
(function(O,v){typeof exports=="object"&&typeof module<"u"?v(exports):typeof define=="function"&&define.amd?define(["exports"],v):(O=typeof globalThis<"u"?globalThis:O||self,v(O.unielonWalletSdk={}))})(this,function(O){"use strict";var Er=Object.defineProperty;var Sr=(O,v,L)=>v in O?Er(O,v,{enumerable:!0,configurable:!0,writable:!0,value:L}):O[v]=L;var S=(O,v,L)=>Sr(O,typeof v!="symbol"?v+"":v,L);var St,Rt,_t,Ot;function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L={exports:{}},ue,ve;function Tt(){if(ve)return ue;ve=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*7,o=r*365.25;ue=function(a,c){c=c||{};var m=typeof a;if(m==="string"&&a.length>0)return i(a);if(m==="number"&&isFinite(a))return c.long?f(a):u(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))};function i(a){if(a=String(a),!(a.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(c){var m=parseFloat(c[1]),y=(c[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*s;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(a){var c=Math.abs(a);return c>=r?Math.round(a/r)+"d":c>=n?Math.round(a/n)+"h":c>=t?Math.round(a/t)+"m":c>=e?Math.round(a/e)+"s":a+"ms"}function f(a){var c=Math.abs(a);return c>=r?l(a,c,r,"day"):c>=n?l(a,c,n,"hour"):c>=t?l(a,c,t,"minute"):c>=e?l(a,c,e,"second"):a+" ms"}function l(a,c,m,y){var p=c>=m*1.5;return Math.round(a/m)+" "+y+(p?"s":"")}return ue}function At(e){n.debug=n,n.default=n,n.coerce=f,n.disable=o,n.enable=s,n.enabled=i,n.humanize=Tt(),n.destroy=l,Object.keys(e).forEach(a=>{n[a]=e[a]}),n.names=[],n.skips=[],n.formatters={};function t(a){let c=0;for(let m=0;m<a.length;m++)c=(c<<5)-c+a.charCodeAt(m),c|=0;return n.colors[Math.abs(c)%n.colors.length]}n.selectColor=t;function n(a){let c,m=null,y,p;function g(...h){if(!g.enabled)return;const C=g,E=Number(new Date),b=E-(c||E);C.diff=b,C.prev=c,C.curr=E,c=E,h[0]=n.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let T=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(x,k)=>{if(x==="%%")return"%";T++;const j=n.formatters[k];if(typeof j=="function"){const le=h[T];x=j.call(C,le),h.splice(T,1),T--}return x}),n.formatArgs.call(C,h),(C.log||n.log).apply(C,h)}return g.namespace=a,g.useColors=n.useColors(),g.color=n.selectColor(a),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==n.namespaces&&(y=n.namespaces,p=n.enabled(a)),p),set:h=>{m=h}}),typeof n.init=="function"&&n.init(g),g}function r(a,c){const m=n(this.namespace+(typeof c>"u"?":":c)+a);return m.log=this.log,m}function s(a){n.save(a),n.namespaces=a,n.names=[],n.skips=[];let c;const m=(typeof a=="string"?a:"").split(/[\s,]+/),y=m.length;for(c=0;c<y;c++)m[c]&&(a=m[c].replace(/\*/g,".*?"),a[0]==="-"?n.skips.push(new RegExp("^"+a.slice(1)+"$")):n.names.push(new RegExp("^"+a+"$")))}function o(){const a=[...n.names.map(u),...n.skips.map(u).map(c=>"-"+c)].join(",");return n.enable(""),a}function i(a){if(a[a.length-1]==="*")return!0;let c,m;for(c=0,m=n.skips.length;c<m;c++)if(n.skips[c].test(a))return!1;for(c=0,m=n.names.length;c<m;c++)if(n.names[c].test(a))return!0;return!1}function u(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function f(a){return a instanceof Error?a.stack||a.message:a}function l(){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 n.enable(n.load()),n}var Ft=At;(function(e,t){t.formatArgs=r,t.save=s,t.load=o,t.useColors=n,t.storage=i(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!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`."))}})(),t.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 f;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&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;f.splice(1,0,l,"color: inherit");let a=0,c=0;f[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(a++,m==="%c"&&(c=a))}),f.splice(c,0,l)}t.log=console.debug||console.log||(()=>{});function s(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function o(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=process.env.DEBUG),f}function i(){try{return localStorage}catch{}}e.exports=Ft(t);const{formatters:u}=e.exports;u.j=function(f){try{return JSON.stringify(f)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(L,L.exports);var Pe=L.exports;const G=Pe.debug("unielon:tmapi:debug"),vt=Pe.debug("unielon:tmapi:error");function Pt(e,t="_self"){G("openLink",e,t),window.open(e,t,"noopener noreferrer")}function xt(e){Pt(e,"_blank")}function X(){if(typeof window<"u")return window}class Z extends Error{constructor(t){super(t),this.name="UnielonConnectUIError"}}let N={};try{let e=location.hash.toString();N=kt(e)}catch{}let de="unknown";if(N!=null&&N.tgWebAppPlatform&&(de=N.tgWebAppPlatform??"unknown"),de==="unknown"){const e=X();de=((Rt=(St=e==null?void 0:e.Telegram)==null?void 0:St.WebApp)==null?void 0:Rt.platform)??"unknown"}let Q="6.0";if(N!=null&&N.tgWebAppVersion&&(Q=N.tgWebAppVersion),!Q){const e=X();Q=((Ot=(_t=e==null?void 0:e.Telegram)==null?void 0:_t.WebApp)==null?void 0:Ot.version)??"6.0"}function Ut(e,t){const n=new URL(e);if(n.protocol!=="http:"&&n.protocol!=="https:")throw new Z(`Url protocol is not supported: ${n}`);if(n.hostname!=="t.me")throw new Z(`Url host is not supported: ${n}`);const r=n.pathname+n.search;xe()||It("6.1")?Nt("web_app_open_tg_link",{path_full:r}):xt("https://t.me"+r)}function xe(){try{const e=X();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function Nt(e,t){try{const n=X();if(!n)throw new Z("Can't post event to parent window: window is not defined");if(n.TelegramWebviewProxy!==void 0)G("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)G("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(xe()){const r="*",s=JSON.stringify({eventType:e,eventData:t});G("postEvent",e,t),n.parent.postMessage(s,r)}else throw new Z("Can't post event to TMA")}catch(n){vt(`Can't post event to parent window: ${n}`)}}function kt(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Y(e),t;let n=e.indexOf("?");if(n>=0){let s=e.substr(0,n);t._path=Y(s),e=e.substr(n+1)}let r=Lt(e);for(let s in r)t[s]=r[s];return t}function Y(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function Lt(e){let t={};if(!e.length)return t;let n=e.split("&"),r,s,o,i;for(r=0;r<n.length;r++)s=n[r].split("="),o=Y(s[0]),i=s[1]==null?null:Y(s[1]),t[o]=i;return t}function qt(e,t){typeof e!="string"&&(e="");let n=e.replace(/^\s+|\s+$/g,"").split("."),r=t.replace(/^\s+|\s+$/g,"").split("."),s,o,i,u;for(s=Math.max(n.length,r.length),o=0;o<s;o++)if(i=parseInt(n[o])||0,u=parseInt(r[o])||0,i!==u)return i>u?1:-1;return 0}function It(e){return qt(Q,e)>=0}var Ue={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(f,l,a){this.fn=f,this.context=l,this.once=a||!1}function o(f,l,a,c,m){if(typeof a!="function")throw new TypeError("The listener must be a function");var y=new s(a,c||f,m),p=n?n+l:l;return f._events[p]?f._events[p].fn?f._events[p]=[f._events[p],y]:f._events[p].push(y):(f._events[p]=y,f._eventsCount++),f}function i(f,l){--f._eventsCount===0?f._events=new r:delete f._events[l]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],a,c;if(this._eventsCount===0)return l;for(c in a=this._events)t.call(a,c)&&l.push(n?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},u.prototype.listeners=function(l){var a=n?n+l:l,c=this._events[a];if(!c)return[];if(c.fn)return[c.fn];for(var m=0,y=c.length,p=new Array(y);m<y;m++)p[m]=c[m].fn;return p},u.prototype.listenerCount=function(l){var a=n?n+l:l,c=this._events[a];return c?c.fn?1:c.length:0},u.prototype.emit=function(l,a,c,m,y,p){var g=n?n+l:l;if(!this._events[g])return!1;var h=this._events[g],C=arguments.length,E,b;if(h.fn){switch(h.once&&this.removeListener(l,h.fn,void 0,!0),C){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,a),!0;case 3:return h.fn.call(h.context,a,c),!0;case 4:return h.fn.call(h.context,a,c,m),!0;case 5:return h.fn.call(h.context,a,c,m,y),!0;case 6:return h.fn.call(h.context,a,c,m,y,p),!0}for(b=1,E=new Array(C-1);b<C;b++)E[b-1]=arguments[b];h.fn.apply(h.context,E)}else{var T=h.length,_;for(b=0;b<T;b++)switch(h[b].once&&this.removeListener(l,h[b].fn,void 0,!0),C){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,a);break;case 3:h[b].fn.call(h[b].context,a,c);break;case 4:h[b].fn.call(h[b].context,a,c,m);break;default:if(!E)for(_=1,E=new Array(C-1);_<C;_++)E[_-1]=arguments[_];h[b].fn.apply(h[b].context,E)}}return!0},u.prototype.on=function(l,a,c){return o(this,l,a,c,!1)},u.prototype.once=function(l,a,c){return o(this,l,a,c,!0)},u.prototype.removeListener=function(l,a,c,m){var y=n?n+l:l;if(!this._events[y])return this;if(!a)return i(this,y),this;var p=this._events[y];if(p.fn)p.fn===a&&(!m||p.once)&&(!c||p.context===c)&&i(this,y);else{for(var g=0,h=[],C=p.length;g<C;g++)(p[g].fn!==a||m&&!p[g].once||c&&p[g].context!==c)&&h.push(p[g]);h.length?this._events[y]=h.length===1?h[0]:h:i(this,y)}return this},u.prototype.removeAllListeners=function(l){var a;return l?(a=n?n+l:l,this._events[a]&&i(this,a)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(Ue);var Bt=Ue.exports;const Ne=v(Bt),ke={id:"Unielon",version:"0.0.4",name:"Unielon Wallet based on Telegram",homepage:"https://unielon.com",description:"Unielon Wallet based on Telegram",downloadLinks:{telegram:"https://t.me/unielonbot/app",browserExtension:{chrome:""}},deepLinks:{direct_link:"https://t.me/unielonbot/wallet"}},$={connect_url:"https://bridge.unielon.com",connect_direct_link:"https://t.me/unielonbot/wallet"};function Le(e,t){return function(){return e.apply(t,arguments)}}const{toString:Mt}=Object.prototype,{getPrototypeOf:fe}=Object,ee=(e=>t=>{const n=Mt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>ee(t)===e),te=e=>t=>typeof t===e,{isArray:D}=Array,z=te("undefined");function jt(e){return e!==null&&!z(e)&&e.constructor!==null&&!z(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=U("ArrayBuffer");function Dt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qe(e.buffer),t}const Wt=te("string"),P=te("function"),Ie=te("number"),ne=e=>e!==null&&typeof e=="object",$t=e=>e===!0||e===!1,re=e=>{if(ee(e)!=="object")return!1;const t=fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},zt=U("Date"),Jt=U("File"),Ht=U("Blob"),Vt=U("FileList"),Kt=e=>ne(e)&&P(e.pipe),Gt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=ee(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Xt=U("URLSearchParams"),[Zt,Qt,Yt,en]=["ReadableStream","Request","Response","Headers"].map(U),tn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function J(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),D(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function Be(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const I=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Me=e=>!z(e)&&e!==I;function he(){const{caseless:e}=Me(this)&&this||{},t={},n=(r,s)=>{const o=e&&Be(t,s)||s;re(t[o])&&re(r)?t[o]=he(t[o],r):re(r)?t[o]=he({},r):D(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&J(arguments[r],n);return t}const nn=(e,t,n,{allOwnKeys:r}={})=>(J(t,(s,o)=>{n&&P(s)?e[o]=Le(s,n):e[o]=s},{allOwnKeys:r}),e),rn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},on=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},an=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},cn=e=>{if(!e)return null;if(D(e))return e;let t=e.length;if(!Ie(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ln=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&fe(Uint8Array)),un=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fn=U("HTMLFormElement"),hn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),je=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pn=U("RegExp"),De=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};J(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},mn=e=>{De(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},gn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return D(e)?r(e):r(String(e).split(t)),n},yn=()=>{},wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,pe="abcdefghijklmnopqrstuvwxyz",We="0123456789",$e={DIGIT:We,ALPHA:pe,ALPHA_DIGIT:pe+pe.toUpperCase()+We},bn=(e=16,t=$e.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Cn(e){return!!(e&&P(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const En=e=>{const t=new Array(10),n=(r,s)=>{if(ne(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=D(r)?[]:{};return J(r,(i,u)=>{const f=n(i,s+1);!z(f)&&(o[u]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Sn=U("AsyncFunction"),Rn=e=>e&&(ne(e)||P(e))&&P(e.then)&&P(e.catch),ze=((e,t)=>e?setImmediate:t?((n,r)=>(I.addEventListener("message",({source:s,data:o})=>{s===I&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),I.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(I.postMessage)),_n=typeof queueMicrotask<"u"?queueMicrotask.bind(I):typeof process<"u"&&process.nextTick||ze,d={isArray:D,isArrayBuffer:qe,isBuffer:jt,isFormData:Gt,isArrayBufferView:Dt,isString:Wt,isNumber:Ie,isBoolean:$t,isObject:ne,isPlainObject:re,isReadableStream:Zt,isRequest:Qt,isResponse:Yt,isHeaders:en,isUndefined:z,isDate:zt,isFile:Jt,isBlob:Ht,isRegExp:pn,isFunction:P,isStream:Kt,isURLSearchParams:Xt,isTypedArray:ln,isFileList:Vt,forEach:J,merge:he,extend:nn,trim:tn,stripBOM:rn,inherits:sn,toFlatObject:on,kindOf:ee,kindOfTest:U,endsWith:an,toArray:cn,forEachEntry:un,matchAll:dn,isHTMLForm:fn,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:De,freezeMethods:mn,toObjectSet:gn,toCamelCase:hn,noop:yn,toFiniteNumber:wn,findKey:Be,global:I,isContextDefined:Me,ALPHABET:$e,generateString:bn,isSpecCompliantForm:Cn,toJSONObject:En,isAsyncFn:Sn,isThenable:Rn,setImmediate:ze,asap:_n};function w(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}d.inherits(w,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.status}}});const Je=w.prototype,He={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{He[e]={value:e}}),Object.defineProperties(w,He),Object.defineProperty(Je,"isAxiosError",{value:!0}),w.from=(e,t,n,r,s,o)=>{const i=Object.create(Je);return d.toFlatObject(e,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),w.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const On=null;function me(e){return d.isPlainObject(e)||d.isArray(e)}function Ve(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function Ke(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ve(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Tn(e){return d.isArray(e)&&!e.some(me)}const An=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function se(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!d.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||a,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(s))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(d.isDate(p))return p.toISOString();if(!f&&d.isBlob(p))throw new w("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(p)||d.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,g,h){let C=p;if(p&&!h&&typeof p=="object"){if(d.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(d.isArray(p)&&Tn(p)||(d.isFileList(p)||d.endsWith(g,"[]"))&&(C=d.toArray(p)))return g=Ve(g),C.forEach(function(b,T){!(d.isUndefined(b)||b===null)&&t.append(i===!0?Ke([g],T,o):i===null?g:g+"[]",l(b))}),!1}return me(p)?!0:(t.append(Ke(h,g,o),l(p)),!1)}const c=[],m=Object.assign(An,{defaultVisitor:a,convertValue:l,isVisitable:me});function y(p,g){if(!d.isUndefined(p)){if(c.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));c.push(p),d.forEach(p,function(C,E){(!(d.isUndefined(C)||C===null)&&s.call(t,C,d.isString(E)?E.trim():E,g,m))===!0&&y(C,g?g.concat(E):[E])}),c.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Ge(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ge(e,t){this._pairs=[],e&&se(e,this,t)}const Xe=ge.prototype;Xe.append=function(t,n){this._pairs.push([t,n])},Xe.toString=function(t){const n=t?function(r){return t.call(this,r,Ge)}:Ge;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Fn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ze(e,t,n){if(!t)return e;const r=n&&n.encode||Fn,s=n&&n.serialize;let o;if(s?o=s(t,n):o=d.isURLSearchParams(t)?t.toString():new ge(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Qe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ye={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ge,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ye=typeof window<"u"&&typeof document<"u",we=typeof navigator=="object"&&navigator||void 0,Pn=ye&&(!we||["ReactNative","NativeScript","NS"].indexOf(we.product)<0),xn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Un=ye&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ye,hasStandardBrowserEnv:Pn,hasStandardBrowserWebWorkerEnv:xn,navigator:we,origin:Un},Symbol.toStringTag,{value:"Module"})),...vn};function Nn(e,t){return se(e,new A.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return A.isNode&&d.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function kn(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ln(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function et(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const u=Number.isFinite(+i),f=o>=n.length;return i=!i&&d.isArray(s)?s.length:i,f?(d.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!d.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&d.isArray(s[i])&&(s[i]=Ln(s[i])),!u)}if(d.isFormData(e)&&d.isFunction(e.entries)){const n={};return d.forEachEntry(e,(r,s)=>{t(kn(r),s,n,0)}),n}return null}function qn(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const H={transitional:Ye,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=d.isObject(t);if(o&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return s?JSON.stringify(et(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Nn(t,this.formSerializer).toString();if((u=d.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return se(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),qn(t)):t}],transformResponse:[function(t){const n=this.transitional||H.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?w.from(u,w.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{H.headers[e]={}});const In=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bn=e=>{const t={};let n,r,s;return e&&e.split(` `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&In[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},tt=Symbol("internals");function V(e){return e&&String(e).trim().toLowerCase()}function oe(e){return e===!1||e==null?e:d.isArray(e)?e.map(oe):String(e)}function Mn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const jn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function be(e,t,n,r,s){if(d.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!d.isString(t)){if(d.isString(r))return t.indexOf(r)!==-1;if(d.isRegExp(r))return r.test(t)}}function Dn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Wn(e,t){const n=d.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class F{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,f,l){const a=V(f);if(!a)throw new Error("header name must be a non-empty string");const c=d.findKey(s,a);(!c||s[c]===void 0||l===!0||l===void 0&&s[c]!==!1)&&(s[c||f]=oe(u))}const i=(u,f)=>d.forEach(u,(l,a)=>o(l,a,f));if(d.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(d.isString(t)&&(t=t.trim())&&!jn(t))i(Bn(t),n);else if(d.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=V(t),t){const r=d.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Mn(s);if(d.isFunction(n))return n.call(this,s,r);if(d.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=V(t),t){const r=d.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||be(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=V(i),i){const u=d.findKey(r,i);u&&(!n||be(r,r[u],u,n))&&(delete r[u],s=!0)}}return d.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||be(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return d.forEach(this,(s,o)=>{const i=d.findKey(r,o);if(i){n[i]=oe(s),delete n[o];return}const u=t?Dn(o):String(o).trim();u!==o&&delete n[o],n[u]=oe(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return d.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&d.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[tt]=this[tt]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=V(i);r[u]||(Wn(s,i),r[u]=!0)}return d.isArray(t)?t.forEach(o):o(t),this}}F.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),d.reduceDescriptors(F.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),d.freezeMethods(F);function Ce(e,t){const n=this||H,r=t||n,s=F.from(r.headers);let o=r.data;return d.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function nt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){w.call(this,e??"canceled",w.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(W,w,{__CANCEL__:!0});function rt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $n(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),a=r[o];i||(i=l),n[s]=f,r[s]=l;let c=o,m=0;for(;c!==s;)m+=n[c++],c=c%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const y=a&&l-a;return y?Math.round(m*1e3/y):void 0}}function Jn(e,t){let n=0,r=1e3/t,s,o;const i=(l,a=Date.now())=>{n=a,s=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const a=Date.now(),c=a-n;c>=r?i(l,a):(s=l,o||(o=setTimeout(()=>{o=null,i(s)},r-c)))},()=>s&&i(s)]}const ie=(e,t,n=3)=>{let r=0;const s=zn(50,250);return Jn(o=>{const i=o.loaded,u=o.lengthComputable?o.total:void 0,f=i-r,l=s(f),a=i<=u;r=i;const c={loaded:i,total:u,progress:u?i/u:void 0,bytes:f,rate:l||void 0,estimated:l&&u&&a?(u-i)/l:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(c)},n)},st=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ot=e=>(...t)=>d.asap(()=>e(...t)),Hn=A.hasStandardBrowserEnv?function(){const t=A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=d.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}(),Vn=A.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),d.isString(r)&&i.push("path="+r),d.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Kn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function it(e,t){return e&&!Kn(t)?Gn(e,t):t}const at=e=>e instanceof F?{...e}:e;function B(e,t){t=t||{};const n={};function r(l,a,c){return d.isPlainObject(l)&&d.isPlainObject(a)?d.merge.call({caseless:c},l,a):d.isPlainObject(a)?d.merge({},a):d.isArray(a)?a.slice():a}function s(l,a,c){if(d.isUndefined(a)){if(!d.isUndefined(l))return r(void 0,l,c)}else return r(l,a,c)}function o(l,a){if(!d.isUndefined(a))return r(void 0,a)}function i(l,a){if(d.isUndefined(a)){if(!d.isUndefined(l))return r(void 0,l)}else return r(void 0,a)}function u(l,a,c){if(c in t)return r(l,a);if(c in e)return r(void 0,l)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(l,a)=>s(at(l),at(a),!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(a){const c=f[a]||s,m=c(e[a],t[a],a);d.isUndefined(m)&&c!==u||(n[a]=m)}),n}const ct=e=>{const t=B({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:u}=t;t.headers=i=F.from(i),t.url=Ze(it(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(d.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[l,...a]=f?f.split(";").map(c=>c.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...a].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&d.isFunction(r)&&(r=r(t)),r||r!==!1&&Hn(t.url))){const l=s&&o&&Vn.read(o);l&&i.set(s,l)}return t},Xn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=ct(e);let o=s.data;const i=F.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:l}=s,a,c,m,y,p;function g(){y&&y(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(a),s.signal&&s.signal.removeEventListener("abort",a)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function C(){if(!h)return;const b=F.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),_={data:!u||u==="text"||u==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:b,config:e,request:h};rt(function(k){n(k),g()},function(k){r(k),g()},_),h=null}"onloadend"in h?h.onloadend=C:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(C)},h.onabort=function(){h&&(r(new w("Request aborted",w.ECONNABORTED,e,h)),h=null)},h.onerror=function(){r(new w("Network Error",w.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||Ye;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new w(T,_.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&d.forEach(i.toJSON(),function(T,_){h.setRequestHeader(_,T)}),d.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),u&&u!=="json"&&(h.responseType=s.responseType),l&&([m,p]=ie(l,!0),h.addEventListener("progress",m)),f&&h.upload&&([c,y]=ie(f),h.upload.addEventListener("progress",c),h.upload.addEventListener("loadend",y)),(s.cancelToken||s.signal)&&(a=b=>{h&&(r(!b||b.type?new W(null,e,h):b),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(a),s.signal&&(s.signal.aborted?a():s.signal.addEventListener("abort",a)));const E=$n(s.url);if(E&&A.protocols.indexOf(E)===-1){r(new w("Unsupported protocol "+E+":",w.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Zn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(l){if(!s){s=!0,u();const a=l instanceof Error?l:this.reason;r.abort(a instanceof w?a:new W(a instanceof Error?a.message:a))}};let i=t&&setTimeout(()=>{i=null,o(new w(`timeout ${t} of ms exceeded`,w.ETIMEDOUT))},t);const u=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>d.asap(u),f}},Qn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Yn=async function*(e,t){for await(const n of er(e))yield*Qn(n,t)},er=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},lt=(e,t,n,r)=>{const s=Yn(e,t);let o=0,i,u=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:l,value:a}=await s.next();if(l){u(),f.close();return}let c=a.byteLength;if(n){let m=o+=c;n(m)}f.enqueue(new Uint8Array(a))}catch(l){throw u(l),l}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},ae=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ut=ae&&typeof ReadableStream=="function",tr=ae&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),dt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},nr=ut&&dt(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ft=64*1024,Ee=ut&&dt(()=>d.isReadableStream(new Response("").body)),ce={stream:Ee&&(e=>e.body)};ae&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ce[t]&&(ce[t]=d.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new w(`Response type '${t}' is not supported`,w.ERR_NOT_SUPPORT,r)})})})(new Response);const rr=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(A.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await tr(e)).byteLength},sr=async(e,t)=>{const n=d.toFiniteNumber(e.getContentLength());return n??rr(t)},Se={http:On,xhr:Xn,fetch:ae&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:u,onUploadProgress:f,responseType:l,headers:a,withCredentials:c="same-origin",fetchOptions:m}=ct(e);l=l?(l+"").toLowerCase():"text";let y=Zn([s,o&&o.toAbortSignal()],i),p;const g=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let h;try{if(f&&nr&&n!=="get"&&n!=="head"&&(h=await sr(a,r))!==0){let _=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(d.isFormData(r)&&(x=_.headers.get("content-type"))&&a.setContentType(x),_.body){const[k,j]=st(h,ie(ot(f)));r=lt(_.body,ft,k,j)}}d.isString(c)||(c=c?"include":"omit");const C="credentials"in Request.prototype;p=new Request(t,{...m,signal:y,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",credentials:C?c:void 0});let E=await fetch(p);const b=Ee&&(l==="stream"||l==="response");if(Ee&&(u||b&&g)){const _={};["status","statusText","headers"].forEach(le=>{_[le]=E[le]});const x=d.toFiniteNumber(E.headers.get("content-length")),[k,j]=u&&st(x,ie(ot(u),!0))||[];E=new Response(lt(E.body,ft,k,()=>{j&&j(),g&&g()}),_)}l=l||"text";let T=await ce[d.findKey(ce,l)||"text"](E,e);return!b&&g&&g(),await new Promise((_,x)=>{rt(_,x,{data:T,headers:F.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:p})})}catch(C){throw g&&g(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,e,p),{cause:C.cause||C}):w.from(C,C&&C.code,e,p)}})};d.forEach(Se,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ht=e=>`- ${e}`,or=e=>d.isFunction(e)||e===null||e===!1,pt={getAdapter:e=>{e=d.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!or(n)&&(r=Se[(i=String(n)).toLowerCase()],r===void 0))throw new w(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since : `+o.map(ht).join(` `):" "+ht(o[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Se};function Re(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new W(null,e)}function mt(e){return Re(e),e.headers=F.from(e.headers),e.data=Ce.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pt.getAdapter(e.adapter||H.adapter)(e).then(function(r){return Re(e),r.data=Ce.call(e,e.transformResponse,r),r.headers=F.from(r.headers),r},function(r){return nt(r)||(Re(e),r&&r.response&&(r.response.data=Ce.call(e,e.transformResponse,r.response),r.response.headers=F.from(r.response.headers))),Promise.reject(r)})}const gt="1.7.7",_e={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_e[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const yt={};_e.transitional=function(t,n,r){function s(o,i){return"[Axios v"+gt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new w(s(i," has been removed"+(n?" in "+n:"")),w.ERR_DEPRECATED);return n&&!yt[i]&&(yt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function ir(e,t,n){if(typeof e!="object")throw new w("options must be an object",w.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],f=u===void 0||i(u,o,e);if(f!==!0)throw new w("option "+o+" must be "+f,w.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new w("Unknown option "+o,w.ERR_BAD_OPTION)}}const Oe={assertOptions:ir,validators:_e},q=Oe.validators;class M{constructor(t){this.defaults=t,this.interceptors={request:new Qe,response:new Qe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=B(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Oe.assertOptions(r,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),s!=null&&(d.isFunction(s)?n.paramsSerializer={serialize:s}:Oe.assertOptions(s,{encode:q.function,serialize:q.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&d.merge(o.common,o[n.method]);o&&d.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=F.concat(i,o);const u=[];let f=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(f=f&&g.synchronous,u.unshift(g.fulfilled,g.rejected))});const l=[];this.interceptors.response.forEach(function(g){l.push(g.fulfilled,g.rejected)});let a,c=0,m;if(!f){const p=[mt.bind(this),void 0];for(p.unshift.apply(p,u),p.push.apply(p,l),m=p.length,a=Promise.resolve(n);c<m;)a=a.then(p[c++],p[c++]);return a}m=u.length;let y=n;for(c=0;c<m;){const p=u[c++],g=u[c++];try{y=p(y)}catch(h){g.call(this,h);break}}try{a=mt.call(this,y)}catch(p){return Promise.reject(p)}for(c=0,m=l.length;c<m;)a=a.then(l[c++],l[c++]);return a}getUri(t){t=B(this.defaults,t);const n=it(t.baseURL,t.url);return Ze(n,t.params,t.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(t){M.prototype[t]=function(n,r){return this.request(B(r||{},{method:t,url:n,data:(r||{}).data}))}}),d.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(B(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}M.prototype[t]=n(),M.prototype[t+"Form"]=n(!0)});class Te{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new W(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Te(function(s){t=s}),cancel:t}}}function ar(e){return function(n){return e.apply(null,n)}}function cr(e){return d.isObject(e)&&e.isAxiosError===!0}const Ae={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ae).forEach(([e,t])=>{Ae[t]=e});function wt(e){const t=new M(e),n=Le(M.prototype.request,t);return d.extend(n,M.prototype,t,{allOwnKeys:!0}),d.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return wt(B(e,s))},n}const R=wt(H);R.Axios=M,R.CanceledError=W,R.CancelToken=Te,R.isCancel=nt,R.VERSION=gt,R.toFormData=se,R.AxiosError=w,R.Cancel=R.CanceledError,R.all=function(t){return Promise.all(t)},R.spread=ar,R.isAxiosError=cr,R.mergeConfig=B,R.AxiosHeaders=F,R.formToJSON=e=>et(d.isHTMLForm(e)?new FormData(e):e),R.getAdapter=pt.getAdapter,R.HttpStatusCode=Ae,R.default=R;const bt=async e=>{const t=await R.post(`${$.connect_url}/message`,e);return t==null?void 0:t.data},Fe=async e=>{const t=await R.post(`${$.connect_url}/getMessage`,{token:e});return t==null?void 0:t.data},Ct=e=>new EventSource(`${$.connect_url}/connect?token=${e}`),lr=async e=>{if(e)try{const t=await Fe(e);return(t==null?void 0:t.data)||{}}catch{return null}};function ur(e){var n;let t=window.location.hostname;try{t=((n=new URL((e==null?void 0:e.url)||""))==null?void 0:n.hostname)||t}catch{console.warn(`new URL(${e==null?void 0:e.url}) error`)}return{url:(e==null?void 0:e.url)||"",hostname:t,name:(e==null?void 0:e.name)||dr(window),icon:(e==null?void 0:e.icon)||fr(window),direct_link:e==null?void 0:e.direct_link,description:e==null?void 0:e.description}}function dr(e){const{document:t}=e,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;const r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:window.location.hostname}function fr(e){const{document:t}=e,n=t.querySelectorAll('head > link[rel~="icon"]');for(const r of Array.from(n))if(r)return r.href;return null}const hr={errors:{disconnected:()=>"UnielonWallet: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"UnielonWallet: Disconnected from UnielonWallet background. Page reload required.",sendSiteMetadata:()=>"UnielonWallet: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`UnielonWallet: The UnielonWallet Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidNetworkParams:()=>"UnielonWallet: Received invalid network parameters. Please report this bug.",invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`,invalidChains:e=>`'UnielonWallet: not supported chain with ID '${e}'. try connect wallet to supported chain.`,timeOut:e=>`'UnielonWallet: Timed out while waiting for response from '${e}'.`},info:{connected:e=>`UnielonWallet: Connected to dogecoin chain "${e}".`},warnings:{chainIdDeprecation:`UnielonWallet: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead. For more information, see: https://github.com/UnielonWallet/UnielonWallet-improvement-proposals/discussions/23`,networkVersionDeprecation:`UnielonWallet: 'e