@dcl-regenesislabs/mobile-hub 1.0.0-20757928235.commit-b3d789a → 1.0.0-20758375146.commit-52c1b5b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{basic-BQO5o_DD.js → basic-C8gnXMKI.js} +1 -1
- package/assets/{core-DA2gUngt.js → core-BBLJuI_X.js} +4 -4
- package/assets/{features-DXhmrXcq.js → features-xI4TOttq.js} +1 -1
- package/assets/{fortmatic-BzJZzvUF.js → fortmatic-Bigjbinp.js} +1 -1
- package/assets/{index-CJG34S_2.js → index-BZlrjP3Z.js} +1 -1
- package/assets/{index-D68J4FGm.js → index-CZcWiNLw.js} +3 -3
- package/assets/{index-Cp2XRMt-.js → index-Ct2V8Mct.js} +1 -1
- package/assets/{index-DUgkijoM.js → index-DKgoLPJk.js} +1 -1
- package/assets/{index-Dn8UEJKP.js → index-DZdhdqWs.js} +2 -2
- package/assets/index-Dni1mpT6.css +1 -0
- package/assets/{w3m-modal-DghGDwdc.js → w3m-modal-CkqdZmhu.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-emR-Bcq4.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as l,X as S,Y as g,Z as w,c as f,_ as u,B as A,A as m}from"./core-
|
|
1
|
+
import{n as l,X as S,Y as g,Z as w,c as f,_ as u,B as A,A as m}from"./core-BBLJuI_X.js";import"./index-DZdhdqWs.js";import"./index-CZcWiNLw.js";class p{constructor(e){this.getNonce=e.getNonce}async createMessage(e){const t={accountAddress:e.accountAddress,chainId:e.chainId,version:"1",domain:typeof document>"u"?"Unknown Domain":document.location.host,uri:typeof document>"u"?"Unknown URI":document.location.href,resources:this.resources,nonce:await this.getNonce(e),issuedAt:this.stringifyDate(new Date),statement:void 0,expirationTime:void 0,notBefore:void 0};return Object.assign(t,{toString:()=>this.stringify(t)})}stringify(e){const t=this.getNetworkName(e.chainId);return[`${e.domain} wants you to sign in with your ${t} account:`,e.accountAddress,e.statement?`
|
|
2
2
|
${e.statement}
|
|
3
3
|
`:"",`URI: ${e.uri}`,`Version: ${e.version}`,`Chain ID: ${e.chainId}`,`Nonce: ${e.nonce}`,e.issuedAt&&`Issued At: ${e.issuedAt}`,e.expirationTime&&`Expiration Time: ${e.expirationTime}`,e.notBefore&&`Not Before: ${e.notBefore}`,e.requestId&&`Request ID: ${e.requestId}`,e.resources?.length&&e.resources.reduce((n,s)=>`${n}
|
|
4
4
|
- ${s}`,"Resources:")].filter(n=>typeof n=="string").join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as $}from"./index-Dn8UEJKP.js";var V,J;function X(){return J||(J=1,V=(function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)})([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=(function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if((function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0})()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:(function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"hideOverlay",value:(function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:(function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"postMessage",value:(function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}})()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P})();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=(function(){return this||typeof self=="object"&&self})()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},B(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},B(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),N=l.call(i,"finallyLoc");if(j&&N){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!N)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=(function(N,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return z()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var q=Q(H,E);if(q){if(q===f)continue;return q}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(N,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}})(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function B(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function N(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,q=H.value;return q&&typeof q=="object"&&l.call(q,"__await")?Promise.resolve(q.__await).then(function(L){N("next",L,k,S)},function(L){N("throw",L,k,S)}):Promise.resolve(q).then(function(L){H.value=L,k(H)},function(L){return N("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function Q(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,Q(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function Z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:z}}function z(){return{value:r,done:!0}}})((function(){return this||typeof self=="object"&&self})()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
|
|
1
|
+
import{a as $}from"./index-DZdhdqWs.js";var V,J;function X(){return J||(J=1,V=(function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)})([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=(function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if((function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0})()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:(function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"hideOverlay",value:(function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:(function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"postMessage",value:(function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}})()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P})();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=(function(){return this||typeof self=="object"&&self})()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},B(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},B(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),N=l.call(i,"finallyLoc");if(j&&N){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!N)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=(function(N,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return z()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var q=Q(H,E);if(q){if(q===f)continue;return q}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(N,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}})(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function B(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function N(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,q=H.value;return q&&typeof q=="object"&&l.call(q,"__await")?Promise.resolve(q.__await).then(function(L){N("next",L,k,S)},function(L){N("throw",L,k,S)}):Promise.resolve(q).then(function(L){H.value=L,k(H)},function(L){return N("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function Q(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,Q(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function Z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:z}}function z(){return{value:r,done:!0}}})((function(){return this||typeof self=="object"&&self})()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
|
|
2
2
|
.fortmatic-iframe {
|
|
3
3
|
display: none;
|
|
4
4
|
position: fixed;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PhArrowCircleDown-BtlNV0TZ.js","assets/property-CnFDNXw5.js","assets/PhArrowClockwise-mOiWYLMV.js","assets/PhArrowDown-CkoOD89h.js","assets/PhArrowLeft-C0jlxVhM.js","assets/PhArrowRight-BI-V03Xf.js","assets/PhArrowSquareOut-DnQ7n_B4.js","assets/PhArrowsDownUp-PZosTqZG.js","assets/PhArrowsLeftRight-CYsRQ2qh.js","assets/PhArrowUp-izKvURUW.js","assets/PhArrowUpRight-Bn-JhHsY.js","assets/PhArrowsClockwise-Brtx2Re-.js","assets/PhBank-hhPAIPVb.js","assets/PhBrowser-BjzAmrHO.js","assets/PhCaretDown-ddSjwcwm.js","assets/PhCaretLeft-B7YLoNEF.js","assets/PhCaretRight-BY8D5MIg.js","assets/PhCaretUp-BG10nSut.js","assets/PhCheck-DrKd7pBC.js","assets/PhCircleHalf-Bk9C4DvT.js","assets/PhClock-Sj17weCB.js","assets/PhCompass-Df1ugFO-.js","assets/PhCopy-rgttky8E.js","assets/PhCreditCard-CZpdid2n.js","assets/PhCurrencyDollar-B6IKKjue.js","assets/PhDesktop-BuCDXYJj.js","assets/PhDeviceMobile-CnybhXY-.js","assets/PhDotsThree-CSAEcba1.js","assets/PhVault-B8m1usHw.js","assets/PhEnvelope-SmaNeXoQ.js","assets/PhFunnelSimple-DKx35ITq.js","assets/PhGlobe-q1mqj65V.js","assets/PhIdentificationCard-BeLXJpfZ.js","assets/PhImage-BYrKfN9k.js","assets/PhInfo-X33f06Ej.js","assets/PhLightbulb-DMZJsowR.js","assets/PhMagnifyingGlass-B6D0sWFL.js","assets/PhPaperPlaneRight-Dvo-nXr9.js","assets/PhPlus-CBvZvLax.js","assets/PhPower-D8-AcNM6.js","assets/PhPuzzlePiece-C-7mYqGO.js","assets/PhQrCode-uIXlI5ER.js","assets/PhQuestion-rUoqC2sC.js","assets/PhQuestionMark-W55Txvvb.js","assets/PhSealCheck-BeVLq9PH.js","assets/PhSignOut-Cq2PivQ6.js","assets/PhSpinner-CZMtAFdX.js","assets/PhTrash-BamrmMsN.js","assets/PhUser-A2fxqIV0.js","assets/PhWarning-CpkID9oi.js","assets/PhWarningCircle-Cm58gXb9.js","assets/PhX-C3b4cCEy.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Q as it,U as rt,s as q,r as w,i as $,d as h,q as ot,w as d,K as p,V as at,e as x,j as Z}from"./core-
|
|
2
|
+
import{Q as it,U as rt,s as q,r as w,i as $,d as h,q as ot,w as d,K as p,V as at,e as x,j as Z}from"./core-BBLJuI_X.js";import{_ as c}from"./index-DZdhdqWs.js";const W=".",E={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--apkt-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--apkt-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},formatCurrency(t=0,e={}){const i=Number(t);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...e}).format(i)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:i,truncate:o}){return t.length<=e+i?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-i)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(i))}`},generateAvatarColors(t){const i=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(i),a=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),n=100-3*Number(a?.replace("px","")),l=`${n}% ${n}% at 65% 40%`,u=[];for(let v=0;v<5;v+=1){const S=this.tintColor(o,.15*v);u.push(`rgb(${S[0]}, ${S[1]}, ${S[2]})`)}return`
|
|
3
3
|
--local-color-1: ${u[0]};
|
|
4
4
|
--local-color-2: ${u[1]};
|
|
5
5
|
--local-color-3: ${u[2]};
|