dapp-plugin.min.js 75 KB

1
  1. !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Dapp",[],t):"object"==typeof exports?exports.Dapp=t():e.Dapp=t()}(self,(function(){return function(){var e={757:function(e,t,r){e.exports=r(666)},669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),o=r(26),s=r(372),i=r(327),a=r(97),c=r(109),u=r(985),f=r(61),l=r(655),p=r(263);e.exports=function(e){return new Promise((function(t,r){var h,d=e.data,v=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(d)&&delete v["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(w+":"+b)}var x=a(e.baseURL,e.url);function k(){if(m){var n="getAllResponseHeaders"in m?c(m.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m};o((function(e){t(e),y()}),(function(e){r(e),y()}),s),m=null}}if(m.open(e.method.toUpperCase(),i(x,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,"onloadend"in m?m.onloadend=k:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(k)},m.onabort=function(){m&&(r(f("Request aborted",e,"ECONNABORTED",m)),m=null)},m.onerror=function(){r(f("Network Error",e,null,m)),m=null},m.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||l.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",m)),m=null},n.isStandardBrowserEnv()){var O=(e.withCredentials||u(x))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;O&&(v[e.xsrfHeaderName]=O)}"setRequestHeader"in m&&n.forEach(v,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete v[t]:m.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(m.withCredentials=!!e.withCredentials),g&&"json"!==g&&(m.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&m.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){m&&(r(!e||e&&e.type?new p("canceled"):e),m.abort(),m=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),d||(d=null),m.send(d)}))}},609:function(e,t,r){"use strict";var n=r(867),o=r(849),s=r(321),i=r(185),a=function e(t){var r=new s(t),a=o(s.prototype.request,r);return n.extend(a,s.prototype,r),n.extend(a,r),a.create=function(r){return e(i(t,r))},a}(r(655));a.Axios=s,a.Cancel=r(263),a.CancelToken=r(972),a.isCancel=r(502),a.VERSION=r(288).version,a.all=function(e){return Promise.all(e)},a.spread=r(713),a.isAxiosError=r(268),e.exports=a,e.exports.default=a},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(867),o=r(327),s=r(782),i=r(572),a=r(185),c=r(875),u=c.validators;function f(e){this.defaults=e,this.interceptors={request:new s,response:new s}}f.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!n){var f=[i,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(s),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift());return o}for(var l=e;r.length;){var p=r.shift(),h=r.shift();try{l=p(l)}catch(e){h(e);break}}try{o=i(l)}catch(e){return Promise.reject(e)}for(;s.length;)o=o.then(s.shift(),s.shift());return o},f.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){f.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=f},782:function(e,t,r){"use strict";var n=r(867);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},97:function(e,t,r){"use strict";var n=r(793),o=r(303);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},61:function(e,t,r){"use strict";var n=r(481);e.exports=function(e,t,r,o,s){var i=new Error(e);return n(i,t,r,o,s)}},572:function(e,t,r){"use strict";var n=r(867),o=r(527),s=r(502),i=r(655),a=r(263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:function(e){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},185:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){t=t||{};var r={};function o(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(e[r],t[r])}function i(e){if(!n.isUndefined(t[e]))return o(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(void 0,t[r])}function c(r){return r in t?o(e[r],t[r]):r in e?o(void 0,e[r]):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||s,o=t(e);n.isUndefined(o)&&t!==c||(r[e]=o)})),r}},26:function(e,t,r){"use strict";var n=r(61);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},527:function(e,t,r){"use strict";var n=r(867),o=r(655);e.exports=function(e,t,r){var s=this||o;return n.forEach(r,(function(r){e=r.call(s,e,t)})),e}},655:function(e,t,r){"use strict";var n=r(867),o=r(16),s=r(481),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=r(448)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,r=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||o&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(i)})),e.exports=u},288:function(e){e.exports={version:"0.24.0"}},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},327:function(e,t,r){"use strict";var n=r(867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(n.isURLSearchParams(t))s=t.toString();else{var i=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:function(e,t,r){"use strict";var n=r(867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},16:function(e,t,r){"use strict";var n=r(867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},109:function(e,t,r){"use strict";var n=r(867),o=["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"];e.exports=function(e){var t,r,s,i={};return e?(n.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=n.trim(e.substr(0,s)).toLowerCase(),r=n.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,i){if(!1===e)throw new Error(o(n," has been removed"+(t?" in "+t:"")));return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,i)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],i=t[s];if(i){var a=e[s],c=void 0===a||i(a,s,e);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+s)}},validators:o}},867:function(e,t,r){"use strict";var n=r(849),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){c(t[n])&&c(r)?t[n]=e(t[n],r):c(r)?t[n]=e({},r):s(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},431:function(e,t,r){var n;!function(o){"use strict";var s,i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",f=u+"Number primitive has more than 15 significant digits: ",l=1e14,p=14,h=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],v=1e7,g=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,o=e.length,s=e[0]+"";n<o;){for(t=e[n++]+"",r=p-t.length;r--;t="0"+t);s+=t}for(o=s.length;48===s.charCodeAt(--o););return s.slice(0,o+1||1)}function w(e,t){var r,n,o=e.c,s=t.c,i=e.s,a=t.s,c=e.e,u=t.e;if(!i||!a)return null;if(r=o&&!o[0],n=s&&!s[0],r||n)return r?n?0:-a:i;if(i!=a)return i;if(r=i<0,n=c==u,!o||!s)return n?0:!o^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=o.length)<(u=s.length)?c:u,i=0;i<a;i++)if(o[i]!=s[i])return o[i]>s[i]^r?1:-1;return c==u?0:c>u^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(u+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return y(e.e/p)==t&&e.c[t]%2!=0}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function O(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}s=function e(t){var r,n,o,s,E,A,C,S,N,_,j=V.prototype={constructor:V,toString:null,valueOf:null},P=new V(1),R=20,T=4,L=-7,I=21,U=-1e7,B=1e7,D=!1,M=1,F=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},G="0123456789abcdefghijklmnopqrstuvwxyz",W=!0;function V(e,t){var r,s,a,u,l,d,v,g,y=this;if(!(y instanceof V))return new V(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>B?y.c=y.e=null:e.e<U?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,l=e;l>=10;l/=10,u++);return void(u>B?y.c=y.e=null:(y.e=u,y.c=[e]))}g=String(e)}else{if(!i.test(g=String(e)))return o(y,g,d);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(u<0&&(u=l),u+=+g.slice(l+1),g=g.substring(0,l)):u<0&&(u=g.length)}else{if(b(t,2,G.length,"Base"),10==t&&W)return $(y=new V(e),R+y.e+1,T);if(g=String(e),d="number"==typeof e){if(0*e!=0)return o(y,g,d,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,V.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=G.slice(0,t),u=l=0,v=g.length;l<v;l++)if(r.indexOf(s=g.charAt(l))<0){if("."==s){if(l>u){u=v;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,l=-1,u=0;continue}return o(y,String(e),d,t)}d=!1,(u=(g=n(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(l=0;48===g.charCodeAt(l);l++);for(v=g.length;48===g.charCodeAt(--v););if(g=g.slice(l,++v)){if(v-=l,d&&V.DEBUG&&v>15&&(e>h||e!==c(e)))throw Error(f+y.s*e);if((u=u-l-1)>B)y.c=y.e=null;else if(u<U)y.c=[y.e=0];else{if(y.e=u,y.c=[],l=(u+1)%p,u<0&&(l+=p),l<v){for(l&&y.c.push(+g.slice(0,l)),v-=p;l<v;)y.c.push(+g.slice(l,l+=p));l=p-(g=g.slice(l)).length}else l-=v;for(;l--;g+="0");y.c.push(+g)}}else y.c=[y.e=0]}function H(e,t,r,n){var o,s,i,a,c;if(null==r?r=T:b(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)c=m(e.c),c=1==n||2==n&&(i<=L||i>=I)?k(c,i):O(c,i,"0");else if(s=(e=$(new V(e),t,r)).e,a=(c=m(e.c)).length,1==n||2==n&&(t<=s||s<=L)){for(;a<t;c+="0",a++);c=k(c,s)}else if(t-=i,c=O(c,s,"0"),s+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=s-a)>0)for(s+1==a&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function z(e,t){for(var r,n=1,o=new V(e[0]);n<e.length;n++){if(!(r=new V(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function J(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*p-1)>B?e.c=e.e=null:r<U?e.c=[e.e=0]:(e.e=r,e.c=t),e}function $(e,t,r,n){var o,s,i,u,f,h,v,g=e.c,y=d;if(g){e:{for(o=1,u=g[0];u>=10;u/=10,o++);if((s=t-o)<0)s+=p,i=t,v=(f=g[h=0])/y[o-i-1]%10|0;else if((h=a((s+1)/p))>=g.length){if(!n)break e;for(;g.length<=h;g.push(0));f=v=0,o=1,i=(s%=p)-p+1}else{for(f=u=g[h],o=1;u>=10;u/=10,o++);v=(i=(s%=p)-p+o)<0?0:f/y[o-i-1]%10|0}if(n=n||t<0||null!=g[h+1]||(i<0?f:f%y[o-i-1]),n=r<4?(v||n)&&(0==r||r==(e.s<0?3:2)):v>5||5==v&&(4==r||n||6==r&&(s>0?i>0?f/y[o-i]:0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(p-t%p)%p],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=h,u=1,h--):(g.length=h+1,u=y[p-s],g[h]=i>0?c(f/y[o-i]%y[i])*u:0),n)for(;;){if(0==h){for(s=1,i=g[0];i>=10;i/=10,s++);for(i=g[0]+=u,u=1;i>=10;i/=10,u++);s!=u&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[h]+=u,g[h]!=l)break;g[h--]=0,u=1}for(s=g.length;0===g[--s];g.pop());}e.e>B?e.c=e.e=null:e.e<U&&(e.c=[e.e=0])}return e}function X(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=L||r>=I?k(t,r):O(t,r,"0"),e.s<0?"-"+t:t)}return V.clone=e,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,g,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),T=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-g,0,t),b(r[1],0,g,t),L=r[0],I=r[1]):(b(r,-g,g,t),L=-(I=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-g,-1,t),b(r[1],1,g,t),U=r[0],B=r[1];else{if(b(r,-g,g,t),!r)throw Error(u+t+" cannot be zero: "+r);U=-(B=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!r,Error(u+"crypto unavailable");D=r}else D=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),M=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,g,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);q=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);W="0123456789"==r.slice(0,10),G=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:T,EXPONENTIAL_AT:[L,I],RANGE:[U,B],CRYPTO:D,MODULO_MODE:M,POW_PRECISION:F,FORMAT:q,ALPHABET:G}},V.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!V.DEBUG)return!0;var t,r,n=e.c,o=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&o>=-g&&o<=g&&o===c(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%p)<1&&(t+=p),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+e)},V.maximum=V.max=function(){return z(arguments,j.lt)},V.minimum=V.min=function(){return z(arguments,j.gt)},V.random=(s=9007199254740992,E=Math.random()*s&2097151?function(){return c(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,s,i=0,f=[],l=new V(P);if(null==e?e=R:b(e,0,g),o=a(e/p),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));i<o;)(s=131072*t[i]+(t[i+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[i]=r[0],t[i+1]=r[1]):(f.push(s%1e14),i+=2);i=o/2}else{if(!crypto.randomBytes)throw D=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(o*=7);i<o;)(s=281474976710656*(31&t[i])+1099511627776*t[i+1]+4294967296*t[i+2]+16777216*t[i+3]+(t[i+4]<<16)+(t[i+5]<<8)+t[i+6])>=9e15?crypto.randomBytes(7).copy(t,i):(f.push(s%1e14),i+=7);i=o/7}if(!D)for(;i<o;)(s=E())<9e15&&(f[i++]=s%1e14);for(o=f[--i],e%=p,o&&e&&(s=d[p-e],f[i]=c(o/s)*s);0===f[i];f.pop(),i--);if(i<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=p);for(i=1,s=f[0];s>=10;s/=10,i++);i<p&&(n-=p-i)}return l.e=n,l.c=f,l}),V.sum=function(){for(var e=1,t=arguments,r=new V(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,s,i=[0],a=0,c=e.length;a<c;){for(s=i.length;s--;i[s]*=t);for(i[0]+=n.indexOf(e.charAt(a++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,s,i,a){var c,u,f,l,p,h,d,v,g=n.indexOf("."),y=R,w=T;for(g>=0&&(l=F,F=0,n=n.replace(".",""),h=(v=new V(o)).pow(n.length-g),F=l,v.c=t(O(m(h.c),h.e,"0"),10,s,e),v.e=v.c.length),f=l=(d=t(n,o,s,a?(c=G,e):(c=e,G))).length;0==d[--l];d.pop());if(!d[0])return c.charAt(0);if(g<0?--f:(h.c=d,h.e=f,h.s=i,d=(h=r(h,v,y,w,s)).c,p=h.r,f=h.e),g=d[u=f+y+1],l=s/2,p=p||u<0||null!=d[u+1],p=w<4?(null!=g||p)&&(0==w||w==(h.s<0?3:2)):g>l||g==l&&(4==w||p||6==w&&1&d[u-1]||w==(h.s<0?8:7)),u<1||!d[0])n=p?O(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(d.length=u,p)for(--s;++d[--u]>s;)d[u]=0,u||(++f,d=[1].concat(d));for(l=d.length;!d[--l];);for(g=0,n="";g<=l;n+=c.charAt(d[g++]));n=O(n,f,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,s,i,a=0,c=e.length,u=t%v,f=t/v|0;for(e=e.slice();c--;)a=((o=u*(s=e[c]%v)+(n=f*s+(i=e[c]/v|0)*u)%v*v+a)/r|0)+(n/v|0)+f*i,e[c]=o%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var o,s;if(r!=n)s=r>n?1:-1;else for(o=s=0;o<r;o++)if(e[o]!=t[o]){s=e[o]>t[o]?1:-1;break}return s}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,s,i,a){var u,f,h,d,v,g,m,w,b,x,k,O,E,A,C,S,N,_=n.s==o.s?1:-1,j=n.c,P=o.c;if(!(j&&j[0]&&P&&P[0]))return new V(n.s&&o.s&&(j?!P||j[0]!=P[0]:P)?j&&0==j[0]||!P?0*_:_/0:NaN);for(b=(w=new V(_)).c=[],_=s+(f=n.e-o.e)+1,a||(a=l,f=y(n.e/p)-y(o.e/p),_=_/p|0),h=0;P[h]==(j[h]||0);h++);if(P[h]>(j[h]||0)&&f--,_<0)b.push(1),d=!0;else{for(A=j.length,S=P.length,h=0,_+=2,(v=c(a/(P[0]+1)))>1&&(P=e(P,v,a),j=e(j,v,a),S=P.length,A=j.length),E=S,k=(x=j.slice(0,S)).length;k<S;x[k++]=0);N=P.slice(),N=[0].concat(N),C=P[0],P[1]>=a/2&&C++;do{if(v=0,(u=t(P,x,S,k))<0){if(O=x[0],S!=k&&(O=O*a+(x[1]||0)),(v=c(O/C))>1)for(v>=a&&(v=a-1),m=(g=e(P,v,a)).length,k=x.length;1==t(g,x,m,k);)v--,r(g,S<m?N:P,m,a),m=g.length,u=1;else 0==v&&(u=v=1),m=(g=P.slice()).length;if(m<k&&(g=[0].concat(g)),r(x,g,k,a),k=x.length,-1==u)for(;t(P,x,S,k)<1;)v++,r(x,S<k?N:P,k,a),k=x.length}else 0===u&&(v++,x=[0]);b[h++]=v,x[0]?x[k++]=j[E]||0:(x=[j[E]],k=1)}while((E++<A||null!=x[0])&&_--);d=null!=x[0],b[0]||b.splice(0,1)}if(a==l){for(h=1,_=b[0];_>=10;_/=10,h++);$(w,s+(w.e=h+f*p-1)+1,i,d)}else w.e=f,w.r=+d;return w}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,S=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,s=r?t:t.replace(_,"");if(N.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(A,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,s=s.replace(C,"$1").replace(S,"0.$1")),t!=s))return new V(s,o);if(V.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},j.absoluteValue=j.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return w(this,new V(e,t))},j.decimalPlaces=j.dp=function(e,t){var r,n,o,s=this;if(null!=e)return b(e,0,g),null==t?t=T:b(t,0,8),$(new V(s),e+s.e+1,t);if(!(r=s.c))return null;if(n=((o=r.length-1)-y(this.e/p))*p,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},j.dividedBy=j.div=function(e,t){return r(this,new V(e,t),R,T)},j.dividedToIntegerBy=j.idiv=function(e,t){return r(this,new V(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var r,n,o,s,i,f,l,h,d=this;if((e=new V(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+X(e));if(null!=t&&(t=new V(t)),i=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return h=new V(Math.pow(+X(d),i?2-x(e):+X(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new V(NaN);(n=!f&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||i&&d.c[1]>=24e7:d.c[0]<8e13||i&&d.c[0]<=9999975e7)))return s=d.s<0&&x(e)?-0:0,d.e>-1&&(s=1/s),new V(f?1/s:s);F&&(s=a(F/p+2))}for(i?(r=new V(.5),f&&(e.s=1),l=x(e)):l=(o=Math.abs(+X(e)))%2,h=new V(P);;){if(l){if(!(h=h.times(d)).c)break;s?h.c.length>s&&(h.c.length=s):n&&(h=h.mod(t))}if(o){if(0===(o=c(o/2)))break;l=o%2}else if($(e=e.times(r),e.e+1,1),e.e>14)l=x(e);else{if(0==(o=+X(e)))break;l=o%2}d=d.times(d),s?d.c&&d.c.length>s&&(d.c.length=s):n&&(d=d.mod(t))}return n?h:(f&&(h=P.div(h)),t?h.mod(t):s?$(h,F,T,void 0):h)},j.integerValue=function(e){var t=new V(this);return null==e?e=T:b(e,0,8),$(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===w(this,new V(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return w(this,new V(e,t))>0},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=w(this,new V(e,t)))||0===t},j.isInteger=function(){return!!this.c&&y(this.e/p)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return w(this,new V(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=w(this,new V(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var r,n,o,s,i=this,a=i.s;if(t=(e=new V(e,t)).s,!a||!t)return new V(NaN);if(a!=t)return e.s=-t,i.plus(e);var c=i.e/p,u=e.e/p,f=i.c,h=e.c;if(!c||!u){if(!f||!h)return f?(e.s=-t,e):new V(h?i:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new V(f[0]?i:3==T?-0:0)}if(c=y(c),u=y(u),f=f.slice(),a=c-u){for((s=a<0)?(a=-a,o=f):(u=c,o=h),o.reverse(),t=a;t--;o.push(0));o.reverse()}else for(n=(s=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){s=f[t]<h[t];break}if(s&&(o=f,f=h,h=o,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--u);return f[0]?J(e,f,u):(e.s=3==T?-1:1,e.c=[e.e=0],e)},j.modulo=j.mod=function(e,t){var n,o,s=this;return e=new V(e,t),!s.c||!e.s||e.c&&!e.c[0]?new V(NaN):!e.c||s.c&&!s.c[0]?new V(s):(9==M?(o=e.s,e.s=1,n=r(s,e,0,3),e.s=o,n.s*=o):n=r(s,e,0,M),(e=s.minus(n.times(e))).c[0]||1!=M||(e.s=s.s),e)},j.multipliedBy=j.times=function(e,t){var r,n,o,s,i,a,c,u,f,h,d,g,m,w,b,x=this,k=x.c,O=(e=new V(e,t)).c;if(!(k&&O&&k[0]&&O[0]))return!x.s||!e.s||k&&!k[0]&&!O||O&&!O[0]&&!k?e.c=e.e=e.s=null:(e.s*=x.s,k&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=y(x.e/p)+y(e.e/p),e.s*=x.s,(c=k.length)<(h=O.length)&&(m=k,k=O,O=m,o=c,c=h,h=o),o=c+h,m=[];o--;m.push(0));for(w=l,b=v,o=h;--o>=0;){for(r=0,d=O[o]%b,g=O[o]/b|0,s=o+(i=c);s>o;)r=((u=d*(u=k[--i]%b)+(a=g*u+(f=k[i]/b|0)*d)%b*b+m[s]+r)/w|0)+(a/b|0)+g*f,m[s--]=u%w;m[s]=r}return r?++n:m.splice(0,1),J(e,m,n)},j.negated=function(){var e=new V(this);return e.s=-e.s||null,e},j.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new V(e,t)).s,!o||!t)return new V(NaN);if(o!=t)return e.s=-t,n.minus(e);var s=n.e/p,i=e.e/p,a=n.c,c=e.c;if(!s||!i){if(!a||!c)return new V(o/0);if(!a[0]||!c[0])return c[0]?e:new V(a[0]?n:0*o)}if(s=y(s),i=y(i),a=a.slice(),o=s-i){for(o>0?(i=s,r=c):(o=-o,r=a),r.reverse();o--;r.push(0));r.reverse()}for((o=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=o),o=0;t;)o=(a[--t]=a[t]+c[t]+o)/l|0,a[t]=l===a[t]?0:a[t]%l;return o&&(a=[o].concat(a),++i),J(e,a,i)},j.precision=j.sd=function(e,t){var r,n,o,s=this;if(null!=e&&e!==!!e)return b(e,1,g),null==t?t=T:b(t,0,8),$(new V(s),e,t);if(!(r=s.c))return null;if(n=(o=r.length-1)*p+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&s.e+1>n&&(n=s.e+1),n},j.shiftedBy=function(e){return b(e,-9007199254740991,h),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,n,o,s,i=this,a=i.c,c=i.s,u=i.e,f=R+4,l=new V("0.5");if(1!==c||!a||!a[0])return new V(!c||c<0&&(!a||a[0])?NaN:a?i:1/0);if(0==(c=Math.sqrt(+X(i)))||c==1/0?(((t=m(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=y((u+1)/2)-(u<0||u%2),n=new V(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new V(c+""),n.c[0])for((c=(u=n.e)+f)<3&&(c=0);;)if(s=n,n=l.times(s.plus(r(i,s,f,1))),m(s.c).slice(0,c)===(t=m(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($(n,n.e+R+2,1),e=!n.times(n).eq(i));break}if(!o&&($(s,s.e+R+2,0),s.times(s).eq(i))){n=s;break}f+=4,c+=4,o=1}return $(n,n.e+R+1,T,e)},j.toExponential=function(e,t){return null!=e&&(b(e,0,g),e++),H(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(b(e,0,g),e=e+this.e+1),H(this,e,t)},j.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=q;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var s,i=n.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,f=r.groupSeparator||"",l=i[0],p=i[1],h=o.s<0,d=h?l.slice(1):l,v=d.length;if(c&&(s=a,a=c,c=s,v-=s),a>0&&v>0){for(s=v%a||a,l=d.substr(0,s);s<v;s+=a)l+=f+d.substr(s,a);c>0&&(l+=f+d.slice(s)),h&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},j.toFraction=function(e){var t,n,o,s,i,a,c,f,l,h,v,g,y=this,w=y.c;if(null!=e&&(!(c=new V(e)).isInteger()&&(c.c||1!==c.s)||c.lt(P)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+X(c));if(!w)return new V(y);for(t=new V(P),l=n=new V(P),o=f=new V(P),g=m(w),i=t.e=g.length-y.e-1,t.c[0]=d[(a=i%p)<0?p+a:a],e=!e||c.comparedTo(t)>0?i>0?t:l:c,a=B,B=1/0,c=new V(g),f.c[0]=0;h=r(c,t,0,1),1!=(s=n.plus(h.times(o))).comparedTo(e);)n=o,o=s,l=f.plus(h.times(s=l)),f=s,t=c.minus(h.times(s=t)),c=s;return s=r(e.minus(n),o,0,1),f=f.plus(s.times(l)),n=n.plus(s.times(o)),f.s=l.s=y.s,v=r(l,o,i*=2,T).minus(y).abs().comparedTo(r(f,n,i,T).minus(y).abs())<1?[l,o]:[f,n],B=a,v},j.toNumber=function(){return+X(this)},j.toPrecision=function(e,t){return null!=e&&b(e,1,g),H(this,e,t,2)},j.toString=function(e){var t,r=this,o=r.s,s=r.e;return null===s?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=s<=L||s>=I?k(m(r.c),s):O(m(r.c),s,"0"):10===e&&W?t=O(m((r=$(new V(r),R+s+1,T)).c),r.e,"0"):(b(e,2,G.length,"Base"),t=n(O(m(r.c),s,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return X(this)},j._isBigNumber=!0,null!=t&&V.set(t),V}(),s.default=s.BigNumber=s,void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,s=Object.create(o.prototype),i=new N(n||[]);return s._invoke=function(e,t,r){var n=l;return function(o,s){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw s;return j()}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=A(i,r);if(a){if(a===v)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=f(e,t,r);if("normal"===c.type){if(n=r.done?d:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(e,r,i),s}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",p="suspendedYield",h="executing",d="completed",v={};function g(){}function y(){}function m(){}var w={};c(w,s,(function(){return this}));var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,s)&&(w=x);var k=m.prototype=g.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,s,i,a){var c=f(e[o],e,s);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,a)}))}a(c.arg)}var o;this._invoke=function(e,n){function s(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(s,s):s()}}function A(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(e){if(e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}return{next:j}}function j(){return{value:t,done:!0}}return y.prototype=m,c(k,"constructor",m),c(m,"constructor",y),y.displayName=c(m,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,a,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},O(E.prototype),c(E.prototype,i,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,s){void 0===s&&(s=Promise);var i=new E(u(t,r,n,o),s);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(k),c(k,a,"Generator"),c(k,s,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var s=this.tryEntries.length-1;s>=0;--s){var i=this.tryEntries[s],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var i=s?s.completion:{};return i.type=e,i.arg=t,s?(this.method="next",this.next=s.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}function o(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw o}}return s}}(e,r)||t(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t,r,n,o,s,i){try{var a=e[s](i),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,c,"next",e)}function c(e){s(i,n,o,a,c,"throw",e)}a(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(n,{default:function(){return W}});var l=r(757),p=r.n(l),h=r(669),d=r.n(h),v=function(e){return{res:e,err:null}},g=function(e){return{res:null,err:e}},y=function(){function e(){a(this,e),f(this,"service",null)}var t,r,n,o;return u(e,null,[{key:"createService",value:function(e){var t=d().create({baseURL:e,timeout:5e3});t.interceptors.request.use((function(e){return e}),(function(e){console.log(e),Promise.reject(e)})),t.interceptors.response.use((function(e){var t=e.status,r=e.data;return 200!==t?Promise.reject("server error"):r&&200===r.code?Promise.resolve(r.data):Promise.reject(r.msg?r.msg:"api error")}),(function(e){console.error(e);var t=e.response,r="请求失败,服务繁忙中……";return t.data&&void 0!==t.data.msg&&(r=t.data.msg),Promise.reject(r)})),this.service=t}},{key:"get",value:(o=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.get(t,{params:r});case 3:return n=e.sent,e.abrupt("return",v(n));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",g(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(n=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.post(t,r);case 3:return n=e.sent,e.abrupt("return",v(n));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",g(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"put",value:(r=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.put(t,r);case 3:return n=e.sent,e.abrupt("return",v(n));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",g(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.delete(t,{data:r});case 3:return n=e.sent,e.abrupt("return",v(n));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",g(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,r){return t.apply(this,arguments)})}]),e}();function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e,t){return w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},w(e,t)}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function k(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function E(r){return function(t){if(Array.isArray(t))return e(t)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||t(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A=function(){function e(t,r){a(this,e),f(this,"dapp",null),f(this,"address",null),f(this,"instance",null),this.dapp=t,this.address=r}var t,r,n,o,s;return u(e,[{key:"initContract",value:(s=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==this.dapp.instance){e.next=2;break}throw new Error("tronweb is null");case 2:if(null!==this.instance){e.next=6;break}return e.next=5,this.dapp.instance.contract().at(this.address);case 5:this.instance=e.sent;case 6:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"callContract",value:(o=i(p().mark((function e(t){var r,n,o=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:[],e.next=3,this.initContract();case 3:return e.next=5,(r=this.instance.methods)[t].apply(r,E(n)).call();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"sendContract",value:(n=i(p().mark((function e(t){var r,n,o,s,i,a=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:[],n=a.length>2&&void 0!==a[2]?a[2]:{},o=a.length>3&&void 0!==a[3]?a[3]:0,e.prev=3,e.next=6,this.initContract();case 6:return e.next=8,(s=this.instance)[t].apply(s,E(r));case 8:return i=e.sent,e.next=11,this.dapp._executeContract(i,n,o);case 11:return e.abrupt("return",e.sent);case 14:if(e.prev=14,e.t0=e.catch(3),!e.t0.message){e.next=18;break}return e.abrupt("return",[e.t0.message,null]);case 18:return e.abrupt("return",[e.t0,null]);case 19:case"end":return e.stop()}}),e,this,[[3,14]])}))),function(e){return n.apply(this,arguments)})},{key:"triggerConstantContract",value:(r=i(p().mark((function e(t){var r,n,o=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2&&void 0!==o[2]?o[2]:{},e.next=4,this.dapp._triggerConstantContract(this.address,t,r,n);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"triggerSmartContract",value:(t=i(p().mark((function e(t){var r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:[],e.next=3,this.dapp._triggerSmartContract(this.address,t,r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();var C=function(e){b(d,e);var t,r,n,o,s,c,l,h=(c=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(c);if(l){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return k(this,e)});function d(e,t){var r;return a(this,d),f(m(r=h.call(this,e,t)),"decimals",18),r}return u(d,[{key:"approve",value:(s=i(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.allowance(this.dapp.currentAddress,t);case 2:if(r=e.sent,console.log("合约地址:",t,"额度:",r.toString()),!(Number(r.toString())>1e9)){e.next=6;break}return e.abrupt("return",[null,null]);case 6:return e.next=8,this.sendContract("approve",[t,this.dapp.MAX_APPROVE]);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"transfer",value:(o=i(p().mark((function e(t,r){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendContract("transfer",[t,this.dapp.toToken(r,this.decimals)]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"balanceOf",value:(n=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.dapp.currentAddress,e.next=3,this.callContract("balanceOf",[t]);case 3:return r=e.sent,e.abrupt("return",this.dapp.fromToken(r.toString(),this.decimals));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"allowance",value:(r=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.callContract("allowance",[t,r]);case 2:return n=e.sent,e.abrupt("return",this.dapp.fromToken(n.toString(),this.decimals));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"burn",value:(t=i(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendContract("burn",[this.dapp.toToken(t,this.decimals)]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),d}(A);var S=function(e){b(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O(t);if(r){var o=O(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return k(this,e)});function o(e,t){var r;return a(this,o),f(m(r=n.call(this,e,t)),"decimals",6),r}return u(o)}(C);var N=function(e){b(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O(t);if(r){var o=O(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return k(this,e)});function o(e,t){var r;return a(this,o),f(m(r=n.call(this,e,t)),"decimals",0),r}return u(o)}(C);var _=function(e){b(f,e);var t,r,n,o,s,c=(o=f,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(o);if(s){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return k(this,e)});function f(e,t){return a(this,f),c.call(this,e,t)}return u(f,[{key:"payCnt",value:(n=i(p().mark((function e(t,r,n){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendContract("payCnt",[this.dapp.toToken(t,18),r,n]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"swapCnt",value:(r=i(p().mark((function e(t){var r,n,o,s,i,a,c,u;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.amount1,n=t.amount2,o=t.fee,s=t.deadline,i=t.nonce,a=t.v,c=t.r,u=t.s,e.next=3,this.sendContract("swapCnt",[r,n,o,s,i,a,c,u]);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"withdrawCnt",value:(t=i(p().mark((function e(t){var r,n,o,s,i,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.amount,n=t.deadline,o=t.nonce,s=t.v,i=t.r,a=t.s,e.next=3,this.sendContract("withdrawCnt",[r,n,o,s,i,a]);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),f}(A),j=r(431),P=r.n(j);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){var r=new RegExp(e,"g");return this.replace(r,t)});var L=function(){function e(){a(this,e),f(this,"MAX_APPROVE","115792089237316195423570985008687907853269984665640564039457584007913129639935"),f(this,"instance",null),f(this,"currentAddress",null),f(this,"contracts",null),f(this,"contractsInstance",{}),f(this,"tronNode",""),f(this,"isTestNet",!1)}var t,r,n,o,s,c,l,h,d,v,g,m,w,b;return u(e,[{key:"initConfig",value:(b=i(p().mark((function e(){var t,r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y.get("index/contracts");case 2:t=e.sent,r=t.err,n=t.res,null===r&&(this.contracts=n,console.log(n));case 6:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"waitTronwebInit",value:(w=i(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var n=0,o=setInterval((function(){window.tronWeb&&window.tronWeb.defaultAddress.base58&&(o&&clearInterval(o),t.instance=window.tronWeb,t.currentAddress=window.tronWeb.defaultAddress.base58,e("success")),++n>5&&(clearInterval(o),r("请在tronlink环境下运行"))}),1e3)})));case 1:case"end":return e.stop()}}),e)}))),function(){return w.apply(this,arguments)})},{key:"accountChanged",value:function(e){this.currentAddress!==e&&(this.currentAddress=e,this._onAccountChanged&&this._onAccountChanged({address:e}))}},{key:"onAccountChanged",value:function(e){var t=this;return this._onAccountChanged=e,function(){return t._onAccountChanged=void 0}}},{key:"nodeChanged",value:function(e){this.tronNode.fullNode!==e.fullNode&&(this.tronNode=e,this._onNetworkChanged&&this._onNetworkChanged(e))}},{key:"onNetworkChanged",value:function(e){var t=this;return this._onNetworkChanged=e,function(){return t._onNetworkChanged=void 0}}},{key:"registerEvent",value:function(){var e=this;window.addEventListener("message",(function(t){t.data.message&&"tabReply"==t.data.message.action&&t.data.message.data.data&&t.data.message.data.data.node&&e.nodeChanged(t.data.message.data.data.node),t.data.message&&"setAccount"==t.data.message.action&&e.accountChanged(t.data.message.data.address),t.data.message&&"setNode"==t.data.message.action&&(e.nodeChanged(t.data.message.data.node),t.data.message&&"connect"==t.data.message.action&&console.log("connect event",t.data.message.isTronLink),t.data.message&&"disconnect"==t.data.message.action&&console.log("disconnect event",t.data.message.isTronLink),t.data.message&&"accountsChanged"==t.data.message.action&&(console.log("accountsChanged event",t.data.message),e.accountChanged(t.data.message.data.address)),t.data.message&&"connectWeb"==t.data.message.action&&(console.log("connectWeb event",t.data.message),e.accountChanged(t.data.message.data.address)),t.data.message&&"acceptWeb"==t.data.message.action&&console.log("acceptWeb event",t.data.message),t.data.message&&"disconnectWeb"==t.data.message.action&&console.log("disconnectWeb event",t.data.message),t.data.message&&"rejectWeb"==t.data.message.action&&console.log("rejectWeb event",t.data.message))}))}},{key:"init",value:(m=i(p().mark((function e(){var t,r=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],this.isTestNet=t,this.registerEvent(),e.next=5,this.initConfig();case 5:return e.next=7,this.waitTronwebInit();case 7:window.dapp=this.instance;case 8:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"isInit",value:(g=i(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.currentAddress||null===this.contracts){e.next=2;break}return e.abrupt("return","success");case 2:return e.abrupt("return",new Promise((function(e,r){var n=0,o=setInterval((function(){o&&null!==t.currentAddress&&null!==t.contracts&&(clearInterval(o),e("success")),++n>10&&o&&(clearInterval(o),null===t.currentAddress&&r("error, wallet not connect"))}),1e3)})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"usdt",value:(v=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.usdt||(this.contractsInstance.usdt=new S(this,this.contracts.usdt)),e.abrupt("return",this.contractsInstance.usdt);case 4:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"cnt",value:(d=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.cnt||(this.contractsInstance.cnt=new C(this,this.contracts.cnt)),e.abrupt("return",this.contractsInstance.cnt);case 4:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"lot",value:(h=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.lot||(this.contractsInstance.lot=new N(this,this.contracts.lot)),e.abrupt("return",this.contractsInstance.lot);case 4:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"farm",value:(l=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.farm||(this.contractsInstance.farm=new _(this,this.contracts.farm)),e.abrupt("return",this.contractsInstance.farm);case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"_executeContract",value:(c=i(p().mark((function e(t){var r,n,o,s=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2&&void 0!==s[2]?s[2]:0,e.next=4,t.send(T({feeLimit:1e8,callValue:n,shouldPollResponse:!1},r));case 4:return o=e.sent,e.next=7,this._getTransactionReceipt(o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"_triggerConstantContract",value:(s=i(p().mark((function e(t,r){var n,o,s,i=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3&&void 0!==i[3]?i[3]:{},e.next=4,this.instance.transactionBuilder.triggerConstantContract(t,r,o,n);case 4:return s=e.sent,e.abrupt("return",s);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"_triggerSmartContract",value:(o=i(p().mark((function e(t,r){var n,o,s=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>2&&void 0!==s[2]?s[2]:[],e.next=3,this.instance.transactionBuilder.triggerSmartContract(t,r,{feeLimit:1e8},n);case 3:return o=e.sent,e.next=6,this._broadcast(o.transaction);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_broadcast",value:(n=i(p().mark((function e(t){var r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.instance.trx.sign(t);case 2:if((r=e.sent).signature){e.next=6;break}return console.error("Transaction was not signed properly"),e.abrupt("return",["Transaction was not signed properly",null]);case 6:return e.next=8,this.instance.trx.sendRawTransaction(r);case 8:if(!(n=e.sent).txid){e.next=15;break}return e.next=12,this._getTransactionReceipt(n.txid);case 12:return e.abrupt("return",e.sent);case 15:return console.error("broadcast",n),e.abrupt("return",["send raw transaction error",null]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_getTransactionReceipt",value:(r=i(p().mark((function e(t){var r,n,o=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){setTimeout(i(p().mark((function r(){var n,s,i;return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.instance.trx.getUnconfirmedTransactionInfo(t);case 2:"SUCCESS"===(n=r.sent).result||n.receipt&&"SUCCESS"===n.receipt.result?e("success"):"FAILED"===n.result||n.receipt&&"SUCCESS"!==n.receipt.result?(s="操作失败","OUT_OF_ENERGY"===(i=n.receipt||n.receipt.result)?s+="能量不足":"string"==typeof i&&(s=s+","+i),console.log(s),e(s)):e("null");case 4:case"end":return r.stop()}}),r)}))),2e3)}));case 2:if("null"!==(r=e.sent)){e.next=7;break}return e.next=6,this._getTransactionReceipt(t);case 6:return e.abrupt("return",e.sent);case 7:return n=null,"success"!==r&&(n=r),e.abrupt("return",[n,t]);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"toToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new(P())(e).multipliedBy(new(P())(Math.pow(10,t))).toFormat().replaceAll(",","")}},{key:"fromToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new(P())(e).dividedBy(new(P())(Math.pow(10,t))).toFormat().replaceAll(",","")}},{key:"signMessage",value:(t=i(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.instance.trx.sign(this.instance.toHex(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),I=new L,U=function(e){return y.post("account/becomeVillageChief",e)},B=function(e){return y.get("cnt/swapLog",e)},D=function(e){return y.get("cnt/cntDivideLog",e)},M=function(e){return y.get("cnt/cntWithdrawLog",e)},F=function(e){return y.get("cnt/cntLog",e)};function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var W=function(){function e(t){a(this,e),f(this,"baseUrl","https://yt.landownership.live/api/"),f(this,"_userInfo",{}),t&&(this.baseUrl=t)}var t,r,n,s,c,l,h,d,v,g,m,w,b,x,k,O,E,A,C,S,N;return u(e,[{key:"init",value:(N=i(p().mark((function e(){var t,r=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=r.length>0&&void 0!==r[0]&&r[0])&&(this.baseUrl="https://wp.landownership.live/api/"),y.createService(this.baseUrl),e.next=5,I.init(t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return N.apply(this,arguments)})},{key:"getAddress",value:function(){return I.currentAddress}},{key:"getTronNode",value:function(){return I.tronNode}},{key:"onAccountChanged",value:function(e){return I.onAccountChanged(e)}},{key:"onNetworkChanged",value:function(e){return I.onNetworkChanged(e)}},{key:"_checkUserInfo",value:function(){if(!this._userInfo.id)throw new Error("请先初始化用户信息:userInfo")}},{key:"enabled",value:(S=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.isInit();case 2:case"end":return e.stop()}}),e)}))),function(){return S.apply(this,arguments)})},{key:"userInfo",value:(C=i(p().mark((function e(){var t,r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.enabled();case 2:return e.next=4,o={address:this.getAddress()},y.get("account/info",o);case 4:return t=e.sent,r=t.err,n=t.res,null===r&&(this._userInfo=n),e.abrupt("return",{err:r,res:n});case 9:case"end":return e.stop()}var o}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"userLevel",value:(A=i(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.enabled();case 2:return e.next=4,r={address:t},y.get("account/level",r);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}var r}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"bindParent",value:(E=i(p().mark((function e(t){var r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),r=JSON.stringify({code:t,address:this.getAddress()}),e.next=4,I.signMessage(r);case 4:return n=e.sent,e.next=7,o={signature:n,code:t,address:this.getAddress()},y.post("account/bindParent",o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}var o}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"getLoginSign",value:(O=i(p().mark((function e(){var t,r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),t={id:this._userInfo.id,timestamp:parseInt(Date.now()/1e3),address:this.getAddress()},r=JSON.stringify(t),e.next=5,I.signMessage(r);case 5:return n=e.sent,e.abrupt("return",G({signature:n},t));case 7:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"cntBalance",value:(k=i(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.cnt();case 2:return t=e.sent,e.next=5,t.balanceOf();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(){return k.apply(this,arguments)})},{key:"cntTransfer",value:(x=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.cnt();case 2:return n=e.sent,e.next=5,n.transfer(t,r);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return x.apply(this,arguments)})},{key:"lotBalance",value:(b=i(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.lot();case 2:return t=e.sent,e.next=5,t.balanceOf();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)})},{key:"lotTransfer",value:(w=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.lot();case 2:return n=e.sent,e.next=5,n.transfer(t,r);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return w.apply(this,arguments)})},{key:"cntCanWithdrawBalance",value:(m=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,t={address:this.getAddress()},y.get("cnt/cntBalance",t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}var t}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"cntWithdraw",value:(g=i(p().mark((function e(t){var r,n,s,i,a,c,u,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,l={address:this.getAddress(),amount:t},y.get("cnt/cntWithdraw",l);case 3:if(r=e.sent,n=r.err,s=r.res,null!==n){e.next=18;break}return e.next=9,I.farm();case 9:return i=e.sent,e.next=12,i.withdrawCnt(s);case 12:return a=e.sent,c=o(a,2),u=c[0],f=c[1],e.abrupt("return",[u,f]);case 18:return e.abrupt("return",[n,null]);case 19:case"end":return e.stop()}var l}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"snbToCnt",value:(v=i(p().mark((function e(t){var r,n,s,i,a,c,u,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,l={address:this.getAddress(),amount:t},y.get("cnt/getSwapSign",l);case 3:if(r=e.sent,n=r.err,s=r.res,!n){e.next=8;break}return e.abrupt("return",[n,null]);case 8:return e.next=10,I.farm();case 10:return i=e.sent,e.next=13,i.swapCnt(s);case 13:return a=e.sent,c=o(a,2),u=c[0],f=c[1],e.abrupt("return",[u,f]);case 18:case"end":return e.stop()}var l}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"swapLog",value:(d=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,B({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"cntDivideLog",value:(h=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,D({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"cntWithdrawLog",value:(l=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,M({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"cntLog",value:(c=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,F({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"payCnt",value:(s=i(p().mark((function e(t,r,n){var s,i,a,c,u,f,l,h,d,v;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._checkUserInfo(),!(String(n).length>100)){e.next=3;break}return e.abrupt("return",["item type 过长",null]);case 3:return e.next=5,this.cntBalance();case 5:if(s=e.sent,!(Number(s)<Number(t))){e.next=8;break}return e.abrupt("return",["CNT余额不足",null]);case 8:return e.next=10,I.farm();case 10:return i=e.sent,e.next=13,I.cnt();case 13:return a=e.sent,e.next=16,a.approve(i.address);case 16:if(c=e.sent,u=o(c,1),null!==(f=u[0])){e.next=30;break}return e.next=22,i.payCnt(t,r,n);case 22:if(l=e.sent,h=o(l,2),d=h[0],v=h[1],null!==d){e.next=29;break}return e.next=29,p={address:this.getAddress(),amount:t,pay_type:r,item_type:n,tx_hash:v},y.post("cnt/createPayData",p);case 29:return e.abrupt("return",[d,v]);case 30:return e.abrupt("return",[f,null]);case 31:case"end":return e.stop()}var p}),e,this)}))),function(e,t,r){return s.apply(this,arguments)})},{key:"becomeVillageChief",value:(n=i(p().mark((function e(){var t,r,n,s,i,a,c;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,u={address:this.getAddress()},y.get("account/checkVillageChief",u);case 3:if(t=e.sent,!(r=t.err)){e.next=7;break}return e.abrupt("return",[r,null]);case 7:return e.next=9,I.lot();case 9:return n=e.sent,e.next=12,n.burn("1");case 12:if(s=e.sent,i=o(s,2),a=i[0],c=i[1],null!==a){e.next=19;break}return e.next=19,U({address:this.getAddress(),tx_hash:c});case 19:return e.abrupt("return",[a,null]);case 20:case"end":return e.stop()}var u}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"applyMayor",value:(r=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,t={address:this.getAddress()},y.post("account/applyMayor",t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}var t}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"teamData",value:(t=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,t={address:this.getAddress()},y.get("account/teamData",t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}var t}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()}(),n.default}()}));