@abtnode/blocklet-services 1.16.16-beta-d6c5ed65 → 1.16.16-beta-d11cb031

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.
Files changed (51) hide show
  1. package/api/index.js +1 -1
  2. package/api/libs/connect/session.js +96 -82
  3. package/api/libs/connect/shared.js +33 -12
  4. package/api/libs/jwt.js +5 -3
  5. package/api/routes/federated.js +65 -12
  6. package/api/routes/oauth.js +134 -76
  7. package/api/routes/user.js +1 -0
  8. package/api/services/auth/connect/invite.js +10 -1
  9. package/api/services/auth/connect/login.js +0 -2
  10. package/api/services/auth/connect/receive-transfer-app-owner.js +2 -1
  11. package/api/services/auth/connect/switch-passport.js +5 -1
  12. package/api/services/auth/session.js +14 -2
  13. package/api/util/federated.js +97 -0
  14. package/build/asset-manifest.json +53 -53
  15. package/build/index.html +1 -1
  16. package/build/service-worker.js +1 -1
  17. package/build/static/js/{1480.36129849.chunk.js → 1480.88c590c2.chunk.js} +2 -2
  18. package/build/static/js/{1565.ad002b88.chunk.js → 1565.6df974b9.chunk.js} +2 -2
  19. package/build/static/js/{1760.71e0c151.chunk.js → 1760.70492184.chunk.js} +2 -2
  20. package/build/static/js/{2653.6f37e8a0.chunk.js → 2653.5dc29ed5.chunk.js} +2 -2
  21. package/build/static/js/2836.f4b10b64.chunk.js +2 -0
  22. package/build/static/js/{4042.3c8e0025.chunk.js → 2838.6fa46760.chunk.js} +3 -3
  23. package/build/static/js/{1660.9fb17942.chunk.js → 3025.7dc2fe04.chunk.js} +2 -2
  24. package/build/static/js/{4023.4be0c818.chunk.js → 4023.202dcd9a.chunk.js} +2 -2
  25. package/build/static/js/{4706.df5b600d.chunk.js → 4706.212c92c8.chunk.js} +3 -3
  26. package/build/static/js/4716.88f32cf2.chunk.js +2 -0
  27. package/build/static/js/{4802.b7fa8e82.chunk.js → 4802.3b60e453.chunk.js} +2 -2
  28. package/build/static/js/{5176.53f7f419.chunk.js → 5176.7e91bc3b.chunk.js} +2 -2
  29. package/build/static/js/{5628.aa14b1a7.chunk.js → 5628.e46ecc79.chunk.js} +2 -2
  30. package/build/static/js/{6380.2b96be29.chunk.js → 5673.ab67c509.chunk.js} +2 -2
  31. package/build/static/js/{6186.6462ea21.chunk.js → 6186.ebbdb4b8.chunk.js} +2 -2
  32. package/build/static/js/{6452.4226209b.chunk.js → 6452.143af37a.chunk.js} +2 -2
  33. package/build/static/js/{6629.785fe237.chunk.js → 6629.376863d2.chunk.js} +3 -3
  34. package/build/static/js/{6640.e453c619.chunk.js → 6640.a4431c82.chunk.js} +2 -2
  35. package/build/static/js/{6737.7fe9f13a.chunk.js → 6737.7d135225.chunk.js} +2 -2
  36. package/build/static/js/{6856.9aaf692c.chunk.js → 6856.e185e317.chunk.js} +2 -2
  37. package/build/static/js/{8706.3d16907a.chunk.js → 7367.60cb10e0.chunk.js} +2 -2
  38. package/build/static/js/{7465.999f0039.chunk.js → 7465.2bb961d7.chunk.js} +3 -3
  39. package/build/static/js/{9409.fe4a0af0.chunk.js → 9409.62a2aee0.chunk.js} +2 -2
  40. package/build/static/js/{9620.db1568ef.chunk.js → 9620.301493bc.chunk.js} +2 -2
  41. package/build/static/js/{9899.92626f0a.chunk.js → 9899.b8d8a5ca.chunk.js} +2 -2
  42. package/build/static/js/main.a58f939e.js +3 -0
  43. package/package.json +34 -34
  44. package/build/static/js/4716.17a45b6a.chunk.js +0 -2
  45. package/build/static/js/5662.522d3713.chunk.js +0 -2
  46. package/build/static/js/main.85d66eb2.js +0 -3
  47. /package/build/static/js/{4042.3c8e0025.chunk.js.LICENSE.txt → 2838.6fa46760.chunk.js.LICENSE.txt} +0 -0
  48. /package/build/static/js/{4706.df5b600d.chunk.js.LICENSE.txt → 4706.212c92c8.chunk.js.LICENSE.txt} +0 -0
  49. /package/build/static/js/{6629.785fe237.chunk.js.LICENSE.txt → 6629.376863d2.chunk.js.LICENSE.txt} +0 -0
  50. /package/build/static/js/{7465.999f0039.chunk.js.LICENSE.txt → 7465.2bb961d7.chunk.js.LICENSE.txt} +0 -0
  51. /package/build/static/js/{main.85d66eb2.js.LICENSE.txt → main.a58f939e.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ (self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[2836],{75260:function(e,t,n){"use strict";n.d(t,{Z:function(){return r.Z}});var r=n(79164)},62399:function(e,t,n){"use strict";n.d(t,{Z:function(){return r.Z}});var r=n(22797)},72836:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return hn},useSecurity:function(){return q}});var r=n(33028),o=n(32723),i=n(34795),a=n(59740),s=n(30969),c=n(24974),u=n.n(c),l=n(48164),d=n(70678),f=n.n(d),h=n(28595),p=n(46121),v=n(35147),g=n(56666),w=n(96234),m=n(46292),b=n.n(m),y=n(24221),x=n.n(y),_=n(70306),k=n.n(_),C=n(60523),S=n.n(C),j=n(11681),Z=n(32681),P=function(e){var t=(0,j.__read)((0,s.useState)(e),2),n=t[0],r=t[1];return[n,(0,s.useCallback)((function(e){r((function(t){var n=(0,Z.mf)(e)?e(t):e;return n?(0,j.__assign)((0,j.__assign)({},t),n):t}))}),[])]},O=n(65457),A=n(92771),M=n(79216),z=n(13022),D=n(1775),R={en:{generateError:"Request new qrcode failed",checkError:"Status check failed!",scanned:"Use your wallet to continue operation...",mfaCode:"We sent you a verification request on your DID Wallet, enter the digits below to confirm.",refresh:"Refresh",open:"Open in DID Wallet",error:"We encountered some errors when processing the request",invalidSessionStatus:"Invalid session status",success:"Success",wait:"Wait a second",waiting:"Waiting for next workflow to complete...",failed:"Failed",oops:"Oops",forbidden:"Login user and wallet user mismatch, please logout, then login to retry",webWallet:"Auth with Web Wallet",cancel:"Cancel",retry:"Retry",retryForbidden:"Please start this workflow from the beginning",getWallet:"Don't have the DID Wallet? Get it now.",back:"Back",connect:"Use the following to connect",connecting:"Connecting to your",connectingSuffix:"Or use the following to connect",connected:"Connected to your",busyTitle:"Busy",busyDesc:"Busy processing another DID Connect request",loginWithBefore:"Login with ",loginWithAfter:"",bindOAuth:"Bind third party login",bind:"Bind ",loginOAuthFailed:"Login with third party failed"},zh:{generateError:"\u4e8c\u7ef4\u7801\u751f\u6210\u5931\u8d25",checkError:"\u626b\u7801\u72b6\u6001\u68c0\u67e5\u5931\u8d25",scanned:"\u8bf7\u5230\u60a8\u7684\u94b1\u5305\u4e0a\u7ee7\u7eed\u64cd\u4f5c\u2026\u2026",mfaCode:"\u6211\u4eec\u7ed9\u4f60\u7684 DID \u94b1\u5305\u53d1\u9001\u4e86\u4e00\u4e2a\u4e8c\u6b21\u9a8c\u8bc1\u8bf7\u6c42\uff0c\u8bf7\u8f93\u5165\u4e0b\u9762\u7684\u6570\u5b57\u5b8c\u6210\u9a8c\u8bc1",refresh:"\u5237\u65b0",open:"\u5728 DID \u94b1\u5305\u4e2d\u6253\u5f00",error:"\u670d\u52a1\u5668\u5f00\u5c0f\u5dee\u4e86!",invalidSessionStatus:"\u65e0\u6548\u7684\u4f1a\u8bdd\u72b6\u6001",success:"\u6210\u529f",failed:"\u5931\u8d25",wait:"\u8bf7\u7a0d\u5019",waiting:"\u6b63\u5728\u7b49\u5f85\u4e0b\u4e2a\u6d41\u7a0b\u5b8c\u6210...",forbidden:"\u767b\u5f55\u7528\u6237\u548c\u626b\u7801\u7528\u6237\u4e0d\u5339\u914d\uff0c\u4e3a\u4fdd\u969c\u5b89\u5168\uff0c\u8bf7\u9000\u51fa\u540e\u91cd\u65b0\u767b\u5f55",oops:"\u54ce\u5440",webWallet:"\u4f7f\u7528 Web Wallet \u9a8c\u8bc1",cancel:"\u53d6\u6d88",retry:"\u91cd\u8bd5",retryForbidden:"\u8bf7\u5173\u95ed\u5f53\u524d\u5f39\u7a97\u5e76\u91cd\u65b0\u5f00\u59cb\u5f53\u524d\u6d41\u7a0b",getWallet:"\u8fd8\u6ca1\u6709 DID Wallet? \u73b0\u5728\u4e0b\u8f7d.",back:"\u8fd4\u56de",connect:"\u8bf7\u9009\u62e9\u4ee5\u4e0b\u65b9\u5f0f\u4e4b\u4e00\u8fde\u63a5",connecting:"\u6b63\u5728\u81ea\u52a8\u8fde\u63a5\u60a8\u7684",connectingSuffix:"\u6216\u9009\u62e9\u4ee5\u4e0b\u65b9\u5f0f\u624b\u52a8\u8fde\u63a5",connected:"\u5df2\u8fde\u63a5\u60a8\u7684",busyTitle:"\u94b1\u5305\u7e41\u5fd9",busyDesc:"\u6b63\u5728\u5904\u7406\u5176\u4ed6\u8bf7\u6c42",loginWithBefore:"\u4f7f\u7528",loginWithAfter:"\u767b\u5f55",bindOAuth:"\u7ed1\u5b9a\u7b2c\u4e09\u65b9\u767b\u5f55",bind:"\u7ed1\u5b9a",loginOAuthFailed:"\u7b2c\u4e09\u65b9\u767b\u5f55\u5931\u8d25"}},E=n(90117),L=n.n(E),I=n(96394);function q(){var e=(0,I.Z)("__encKey",{deserializer:function(e){return e},serializer:function(e){return e}}),t=(0,w.Z)(e,2),n=t[0],r=t[1],o=(0,I.Z)("__decKey",{deserializer:function(e){return e},serializer:function(e){return e}}),i=(0,w.Z)(o,2),a=i[0],s=i[1];if(!n&&!a){var c=L().box.keyPair();r((0,D.z)(c.publicKey)),s((0,D.z)(c.secretKey))}return{encryptKey:n,decryptKey:a,decrypt:function(e){return(0,D.pe)(e,n,a)}}}var B=function(e){var t=(0,s.useRef)(e);(0,s.useEffect)((function(){t.current=e}),[e]),(0,s.useEffect)((function(){var e=function(e){!document.hidden&&t.current&&t.current(e)};return document.addEventListener("visibilitychange",e),function(){document.removeEventListener("visibilitychange",e)}}),[])};function W(e){var t={},n=e||window.location.href;if(n){var r=new URL(n),o=r.hostname,i=r.protocol,a=r.port;t["x-real-hostname"]=o,t["x-real-port"]=a,t["x-real-protocol"]=i.endsWith(":")?i.substring(0,i.length-1):i}return t}var N={};var T=function(){try{var e=new URL(window.location.href).searchParams.get("__connect_url__");if(!e)return null;var t=(0,D.D$)(e);return{token:(0,D.bk)(t),url:t}}catch(n){return{error:n}}},U="/.well-known/service",F=function(){return b()(window,"blocklet.appPid")||b()(window,"blocklet.appId")||b()(window,"env.appId")||""},H=function(){return(b()(window,"env.apiPrefix")||"/").replace(/\/$/,"").replace(U,"")},K=function(e){return"relay:".concat(F(),":").concat(e)},V=function(){return"https:"===window.location.protocol?"wss:":"ws:"},Q=function(e){return!e||new URL(e).origin===window.location.origin},G=function(e){return["succeed","error","timeout","busy"].includes(e)};function X(e){var t,n=e.action,a=e.checkFn,c=e.checkInterval,u=e.checkTimeout,l=e.extraParams,d=e.locale,f=e.prefix,h=e.tokenKey,p=e.encKey,m=e.onError,b=e.onSuccess,y=e.baseUrl,_=e.autoConnect,C=void 0===_||_,j=e.forceConnected,Z=void 0===j||j,E=e.saveConnect,L=void 0===E||E,I=e.useSocket,X=void 0===I||I,$=e.provider,Y=void 0===$?"wallet":$,J=P({checking:!1,loading:!1,token:"",url:"",store:null,status:"created",error:"",checkCount:0,mfaCode:0,appInfo:null,connectedDid:"",saveConnect:!1,inExistingSession:!1,nextWorkflow:"",baseUrl:y,prefix:"".concat(f,"/").concat(n),extraParams:k()(l,S()),checkFn:a,results:{},action:n,provider:Y}),ee=(0,w.Z)(J,2),te=ee[0],ne=ee[1],re=R[d]||R.en,oe=(0,s.useMemo)((function(){return T()}),[]),ie=Math.ceil(u/c),ae=(0,s.useState)(!1),se=(0,w.Z)(ae,2),ce=se[0],ue=se[1],le=q(),de=le.encryptKey,fe=le.decrypt,he=(0,s.useState)(0),pe=(0,w.Z)(he,2),ve=pe[0],ge=pe[1],we=(0,A.Z)(),me=(0,v.Z)((function(){var e=function(e){var t=e.action,n=e.prefix,r=e.checkFn,a=e.extraParams,s=e.baseUrl,c="".concat(n,"/token?").concat((0,M.Oh)(a));return N[c]||(N[c]=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var i;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(c,{headers:W(s)});case 2:if(!(i=e.sent).data||!i.data.token){e.next=5;break}return e.abrupt("return",i.data);case 5:if(!i.data||!i.data.error){e.next=7;break}throw new Error(i.data.error);case 7:throw new Error("Error generating ".concat(t," qrcode from: ").concat(s).concat(n));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),N[c]}({action:n,prefix:te.prefix,baseUrl:te.baseUrl,checkFn:te.checkFn,extraParams:(0,r.Z)((0,r.Z)((0,g.Z)({},p,de),te.extraParams),{},{locale:d,forceConnected:Z,autoConnect:C&&!we.wallet&&!ve&&["ios","android"].includes(x().get("connected_wallet_os")),provider:te.provider})});return e.apply(void 0,arguments)}));(0,s.useEffect)((function(){ve>0&&(l.nw?m(new Error(re.retryForbidden)):Ze())}),[ve]);var be=(0,s.useRef)(null),ye=(0,s.useRef)(null),xe=(0,s.useState)(!1),_e=(0,w.Z)(xe,2),ke=_e[0],Ce=_e[1];(0,s.useEffect)((function(){X&&Q(te.baseUrl)&&F()?(!be.current||!1===be.current.isConnected()||be.current.baseUrl!==te.baseUrl)&&(be.current=new z.WsClient("".concat(V(),"//").concat(function(e){var t=e||window.location.href;return new URL(t).host}(te.baseUrl)).concat(H()).concat(U,"/relay"),{longpollerTimeout:5e3,heartbeatIntervalMs:3e4}),be.current.baseUrl=te.baseUrl,be.current.onOpen((function(){return Ce(!0)})),be.current.connect()):ke&&Ce(!1);return function(){be.current&&(be.current.disconnect(),be.current=null)}}),[te.baseUrl]);var Se=Object.assign({},te.extraParams,(t={locale:d},(0,g.Z)(t,h,te.token||(null===oe||void 0===oe?void 0:oe.token)),(0,g.Z)(t,"provider",te.provider),t)),je=function(){try{Se[h]&&te.checkFn("".concat(te.prefix,"/timeout?").concat((0,M.Oh)(Se)),{headers:W(te.baseUrl)})}catch(e){}try{te.token&&ye.current&&(be.current.unsubscribe(K(te.token)),ye.current=null)}catch(e){}},Ze=(0,v.Z)((0,i.Z)((0,o.Z)().mark((function e(){var t,n,r=arguments;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(!(r.length>0&&void 0!==r[0])||r[0])&&je(),e.prev=2,ne({loading:!0,token:"",url:"",store:null,extraParams:k()(l,S())}),e.next=6,(0,D._v)();case 6:return e.next=8,me();case 8:t=e.sent,n=t.extra||{},ne({loading:!1,token:t.token,url:t.url,status:"created",error:"",checkCount:0,appInfo:t.appInfo,connectedDid:n.connectedDid,saveConnect:n.saveConnect}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),ne({loading:!1,status:"error",error:"".concat(re.generateError,": ").concat(e.t0.message)});case 16:case"end":return e.stop()}}),e,null,[[2,13]])})))),Pe=(0,s.useRef)(null);(0,s.useEffect)((function(){Pe.current={state:te,params:Se}})),(0,s.useEffect)((function(){return function(){var e=Pe.current,t=e.state,n=e.params;"created"===t.status&&n[h]&&t.checkFn("".concat(t.prefix,"/timeout?").concat((0,M.Oh)(n)),{headers:W(t.baseUrl)})}}),[]);var Oe=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!oe.error){e.next=3;break}throw oe.error;case 3:return ne({loading:!0,token:oe.token,url:oe.url,inExistingSession:!0}),e.next=6,Ae();case 6:if(null===(t=e.sent)||void 0===t||!t.status||"created"===(null===t||void 0===t?void 0:t.status)){e.next=9;break}throw new Error("".concat(re.invalidSessionStatus," [").concat(t.status,"]"));case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),ne({status:"error",error:e.t0.message}),m(e.t0,null===te||void 0===te?void 0:te.store,fe);case 15:return e.prev=15,ne({loading:!1}),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,11,15,18]])})));return function(){return e.apply(this,arguments)}}();(0,s.useEffect)((function(){if(!te.token&&!te.store&&!te.loading&&!te.error){if(!oe)return void Ze(!1);Oe()}if("timeout"!==te.status&&te.checkCount>ie)return ne({status:"timeout"}),void je();if("succeed"===te.status&&!ce&&(Q(te.baseUrl)&&L&&te.saveConnect&&te.store.did&&(0,D.SJ)((0,r.Z)((0,r.Z)({},te.store),{},{appInfo:te.appInfo})),te.store)){var e=te.store.nextWorkflow;if(e)try{var t=(0,D.Qz)(e,h);ne((function(n){return(0,r.Z)((0,r.Z)({nextWorkflow:e},t),{},{store:null,error:"",url:"",appInfo:null,checkCount:0,status:"scanned",results:(0,r.Z)((0,r.Z)({},n.results),{},(0,g.Z)({},n.token,te.store)),checkFn:(0,D.Vl)({baseURL:t.baseUrl,timeout:8e3}).get})})),Ae()}catch(o){console.error("Invalid nextWorkflow: ".concat(e),o),ne({status:"error",error:"Invalid nextWorkflow: ".concat(e,": ").concat(o.message)})}else if(te.nextWorkflow&&ne({nextWorkflow:"",url:""}),"function"===typeof b){var n=Object.values((0,r.Z)((0,r.Z)({},te.results),{},(0,g.Z)({},te.token,te.store)));ue(!0),b(n.length>1?n:n[0],fe)}}})),(0,s.useEffect)((function(){if(te.token&&ke&&be.current){var e=!1;ye.current?ye.current.token!==te.token&&(be.current.unsubscribe(K(ye.current.token)),e=!0):e=!0,e&&(ye.current=be.current.subscribe(K(te.token)),ye.current.token=te.token,ye.current.on("updated",(function(e){var t=e.response,n=t.status,r=t.error;"forbidden"===n&&(r=re.forbidden,n="error"),ne({status:n,mfaCode:t.mfaCode||0,store:t,error:r})})))}}),[te.token,ke,be.current]);var Ae=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(){var t,n,r,i,a,s,c,u,l,d,f,p=arguments;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>0&&void 0!==p[0]&&p[0],!te.checking){e.next=3;break}return e.abrupt("return",null);case 3:if(ne((function(e){return{checkCount:e.checkCount+1}})),!ke||t){e.next=6;break}return e.abrupt("return",null);case 6:return e.prev=6,ne({checking:!0}),e.next=10,te.checkFn("".concat(te.prefix,"/status?").concat((0,M.Oh)(Se)),{headers:W(te.baseUrl)});case 10:if(n=e.sent,r=n.data,i=r.status,a=r.error,s=r.mfaCode,c=void 0===s?0:s,ne({store:n.data,mfaCode:c,checking:!1,status:i}),"error"!==i||!a){e.next=17;break}throw(u=new Error(a)).response=n,u;case 17:return e.abrupt("return",n.data);case 20:e.prev=20,e.t0=e.catch(6),(l=e.t0.response)&&l.status?(Se[h]&&te.checkFn("".concat(te.prefix,"/timeout?").concat((0,M.Oh)(Se)),{headers:W(te.baseUrl)}),d=l.data&&l.data.error?l.data.error:e.t0.message,(f=new Error(d)).code=l.status,ne({status:"error",checking:!1,error:d}),m(f,null===te||void 0===te?void 0:te.store,fe)):ne({status:"error",checking:!1,error:re.generateError});case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e,null,[[6,20]])})));return function(){return e.apply(this,arguments)}}();return(0,O.Z)(Ae,te.token?te.loading||G(te.status)?null:c:null),B((function(){ke&&te.token&&!1===G(te.status)&&Ae(!0)})),{state:te,generate:Ze,cancelWhenScanned:function(){return ge((function(e){return e+1}))}}}var $=n(71171),Y=n(54470),J=n(38361),ee=n(78879),te=n(29996),ne=n(94308),re=n(6200),oe=n(72395),ie=n(55581),ae=n(37574),se=(0,s.createContext)({isWalletWebview:!1,isMobile:!1}),ce=se.Provider;se.Consumer;function ue(e){var t=e.children,n=(0,A.Z)(),r={isWalletWebview:n.wallet,isMobile:n.mobile.any};return(0,ae.jsx)(ce,{value:r,children:t})}var le,de,fe=n(46840),he=["children"],pe=["children","layout"];function ve(e){var t=e.children,n=(0,a.Z)(e,he);return(0,ae.jsx)(ge,(0,r.Z)((0,r.Z)({},n),{},{children:t}))}var ge=(0,ie.zo)(J.Z)(le||(le=(0,$.Z)(["\n display: inline-block;\n padding: 16px;\n overflow: hidden;\n border: 1px solid #f0f0f0;\n border-radius: 12px;\n background-color: #fff;\n /* safari \u5706\u89d2\u95ee\u9898, https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */\n transform: translateZ(0);\n"])));function we(e){var t=e.children,n=e.layout,o=(0,a.Z)(e,pe);if(!t)return null;var i=(0,fe.Z)(t),s=i[0],c=i[1],u=i.slice(2);return(0,ae.jsxs)(ye,(0,r.Z)((0,r.Z)({layout:n},o),{},{children:[(0,ae.jsx)("div",{children:s}),(0,ae.jsx)("div",{children:c}),u]}))}ve.propTypes={children:u().any.isRequired},we.propTypes={layout:u().oneOf(["tb","lr"]),children:u().any},we.defaultProps={layout:"tb",children:null};var me,be,ye=(0,ie.zo)(ve)(de||(de=(0,$.Z)(["\n display: flex;\n flex-direction: ",";\n justify-content: space-between;\n > div {\n flex: 0 0 auto;\n ","\n }\n\n /* web wallet provider \u5185\u5bb9\u53ef\u80fd\u6bd4\u8f83\u957f, \u7a84\u5c4f\u4e0b\u9700\u8981\u652f\u6301 shrink, \u5e76\u4e14\u4e0e\u53f3\u8fb9\u7684 icon \u4fdd\u6301\u95f4\u8ddd */\n ","\n"])),(function(e){return"tb"===e.layout?"column":"row"}),(function(e){return"lr"===e.layout?"align-self: center;":""}),(function(e){return"tb"!==e.layout&&"\n > div:first-of-type {\n flex-shrink: 1;\n min-width: 80px;\n margin-right: 8px;\n }\n "})),xe=n(72097),_e=n(33359),ke=n(38996),Ce=n(44181),Se=n(58082),je=n(87138),Ze=n(61923),Pe=["status","nextWorkflow","mfaCode","onCancel","onRetry","messages","locale"],Oe=(0,ie.zo)(xe.Z)(me||(me=(0,$.Z)(["\n && {\n padding: 4px 16px;\n color: #4598fa;\n background-color: #eaf4ff;\n\n &:hover {\n color: #fff;\n background-color: #4598fa;\n }\n }\n"])));function Ae(e){var t=e.status,n=e.nextWorkflow,o=e.mfaCode,i=e.onCancel,s=e.onRetry,c=e.messages,u=e.locale,l=(0,a.Z)(e,Pe),d=R[u]||R.en;return(0,ae.jsxs)(Me,(0,r.Z)((0,r.Z)({},l),{},{children:["scanned"===t&&!n&&(0,ae.jsxs)(J.Z,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",children:[(0,ae.jsx)(J.Z,{children:(0,ae.jsx)(Ze.Z,{style:{width:48,height:48,fill:"#4598FA"}})}),(0,ae.jsx)(J.Z,{mt:2,lineHeight:"34px",color:"#4598fa",fontSize:24,textAlign:"center",fontWeight:400,children:d.scanned}),(0,ae.jsxs)(J.Z,{mt:1.5,display:"flex",alignItems:"center",children:[(0,ae.jsx)(J.Z,{color:"#a8b4c5",fontSize:16,fontWeight:400,children:d.connected}),(0,ae.jsx)(oe.Z,{style:{height:"1em",marginLeft:8}})]}),o>0&&(0,ae.jsxs)(J.Z,{mt:3,padding:1,className:"status-mfa",children:[(0,ae.jsx)(J.Z,{className:"status-mfa-tip",children:d.mfaCode}),(0,ae.jsx)(_e.Z,{className:"status-mfa-code",children:o})]}),(0,ae.jsx)(J.Z,{mt:4,children:(0,ae.jsx)(Oe,{onClick:function(){return i()},children:d.back})})]}),"scanned"===t&&!!n&&(0,ae.jsxs)(J.Z,{textAlign:"center",className:"status--waiting",children:[(0,ae.jsx)("span",{className:"status-icon",children:(0,ae.jsx)(Se.Z,{})}),(0,ae.jsx)(J.Z,{component:"p",className:"status-icon-text",children:d.wait}),(0,ae.jsx)(J.Z,{className:"status-desc",children:d.waiting}),o>0&&(0,ae.jsxs)(J.Z,{mt:3,padding:1,className:"status-mfa",children:[(0,ae.jsx)(J.Z,{className:"status-mfa-tip",children:d.mfaCode}),(0,ae.jsx)(_e.Z,{className:"status-mfa-code",children:o})]})]}),"succeed"===t&&(0,ae.jsxs)(J.Z,{textAlign:"center",className:"status--succeed",children:[(0,ae.jsx)("span",{className:"status-icon",children:(0,ae.jsx)(ke.default,{})}),(0,ae.jsx)(J.Z,{component:"p",className:"status-icon-text",children:d.success}),(0,ae.jsx)(J.Z,{className:"status-desc",children:c.success})]}),"error"===t&&(0,ae.jsxs)(J.Z,{textAlign:"center",className:"status--error",children:[(0,ae.jsx)("span",{className:"status-icon",children:(0,ae.jsx)(Ce.default,{})}),(0,ae.jsx)(J.Z,{component:"p",className:"status-icon-text",children:d.failed}),(0,ae.jsx)(J.Z,{className:"status-desc",children:c.error||d.error}),(0,ae.jsx)(J.Z,{mt:5,children:(0,ae.jsx)(Oe,{onClick:s,children:d.retry})})]}),"busy"===t&&(0,ae.jsxs)(J.Z,{textAlign:"center",className:"status--busy",children:[(0,ae.jsx)("span",{className:"status-icon",children:(0,ae.jsx)(je.Z,{})}),(0,ae.jsx)(J.Z,{component:"p",className:"status-icon-text",children:d.busyTitle}),(0,ae.jsx)(J.Z,{className:"status-desc",children:c.error||d.busyDesc}),(0,ae.jsx)(J.Z,{mt:5,children:(0,ae.jsx)(Oe,{onClick:s,children:d.retry})})]})]}))}Ae.propTypes={status:u().string,nextWorkflow:u().string,mfaCode:u().number,onCancel:u().func,onRetry:u().func,messages:u().shape({confirm:u().string.isRequired,success:u().any.isRequired,error:u().any.isRequired}).isRequired,locale:u().oneOf(["en","zh"])},Ae.defaultProps={status:"",nextWorkflow:"",mfaCode:0,onCancel:function(){},onRetry:function(){},locale:"en"};var Me=(0,ie.zo)(ve)(be||(be=(0,$.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n border: 0;\n border-radius: 0;\n background-color: transparent;\n .status-icon {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 48px;\n height: 48px;\n border-radius: 100%;\n color: #fff;\n }\n .status-icon-text {\n margin: 16px 0;\n font-size: 24px;\n font-weight: 400;\n }\n .status-mfa {\n display: flex;\n align-items: center;\n flex-direction: column;\n background: #fff;\n border: 1px solid #ddd;\n border-radius: 4px;\n max-width: 360px;\n .status-mfa-tip {\n text-align: center;\n }\n .status-mfa-code {\n margin-top: 8px;\n line-height: 36px;\n font-size: 36px;\n font-weight: 700;\n letter-spacing: 8px;\n }\n }\n .status-desc {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 3;\n font-size: 14px;\n white-space: pre-wrap;\n }\n .status--succeed {\n .status-icon {\n background-color: #3ab39d;\n }\n .status-icon-text {\n color: #3ab39d;\n }\n }\n .status--error {\n .status-icon {\n background-color: #f16e6e;\n }\n .status-icon-text {\n color: #f16e6e;\n }\n .status-desc {\n word-break: break-all;\n }\n }\n .status--busy {\n .status-icon {\n background-color: #ed6c02;\n }\n .status-icon-text {\n color: #ed6c02;\n }\n }\n .status--waiting {\n .status-icon {\n background-color: #4598fa;\n }\n .status-icon-text {\n color: #4598fa;\n }\n }\n"]))),ze=n(68848),De=n.n(ze),Re=["data","size","image","config"],Ee={margin:0,dotsOptions:{type:"dots"},cornersSquareOptions:{type:"extra-rounded"},cornersDotOptions:{type:"dot"}};function Le(e){var t=e.data,n=e.size,o=e.image,i=e.config,c=(0,a.Z)(e,Re),u=(0,s.useRef)(null),l=(0,s.useMemo)((function(){return(0,r.Z)((0,r.Z)((0,r.Z)({},Ee),{},{data:t,width:n,height:n},o&&{image:o,imageOptions:{crossOrigin:"anonymous",margin:0}}),i)}),[t,n,o,i]),d=(0,s.useState)(new(De())(l)),f=(0,w.Z)(d,1)[0];return(0,s.useEffect)((function(){u.current&&f.append(u.current)}),[f,u]),(0,s.useEffect)((function(){f&&f.update(l)}),[t,n,o,i]),(0,ae.jsx)("div",(0,r.Z)({ref:u},c))}Le.propTypes={data:u().string.isRequired,size:u().number.isRequired,image:u().string,config:u().object},Le.defaultProps={image:null,config:{}};var Ie,qe=Le,Be=n(10452),We=["onRefresh"];function Ne(e){var t=e.onRefresh,n=(0,a.Z)(e,We);return(0,ae.jsx)(Te,(0,r.Z)((0,r.Z)({},n),{},{onClick:function(e){e.stopPropagation(),t()},children:(0,ae.jsx)("span",{children:(0,ae.jsx)(Be.Z,{})})}))}var Te=(0,ie.zo)("div")(Ie||(Ie=(0,$.Z)(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(0, 0, 0, 0.1);\n cursor: pointer;\n\n > span {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n width: 48px;\n height: 48px;\n border-radius: 100%;\n color: #fff;\n background-color: #4598fa;\n }\n .MuiSvgIcon-root {\n font-size: 28px;\n }\n"])));Ne.propTypes={onRefresh:u().func.isRequired};var Ue=["qrcodeSize","tokenState","onRefresh"];function Fe(e){var t=e.qrcodeSize,n=e.tokenState,o=e.onRefresh,i=(0,a.Z)(e,Ue);return(0,ae.jsxs)(we,(0,r.Z)((0,r.Z)({},i),{},{position:"relative",color:"#A8B4C5",fontWeight:700,status:n.status,children:[(0,ae.jsx)("div",{children:(0,ae.jsx)(J.Z,{mt:.5,fontSize:20,color:"#666",children:"Mobile Wallet"})}),(0,ae.jsx)(qe,{data:n.url,size:t}),"timeout"===n.status&&(0,ae.jsx)(Ne,{onRefresh:o})]}))}Fe.propTypes={tokenState:u().object.isRequired,qrcodeSize:u().number.isRequired,onRefresh:u().func.isRequired};var He,Ke=n(38222),Ve=["tokenState","onRefresh","webWalletUrl"];function Qe(e){var t=e.tokenState,n=e.onRefresh,o=e.webWalletUrl,i=(0,a.Z)(e,Ve),s="lr"===i.layout?48:64,c="timeout"===t.status,u="".concat(i.className||""," ").concat(c?"card-timeout":""),l=new URL(o);return(0,ae.jsxs)(Xe,(0,r.Z)((0,r.Z)({},i),{},{color:"#A8B4C5",bgcolor:"#FFF",fontWeight:700,className:u,children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)(J.Z,{mt:.5,fontSize:20,color:"#666",children:"Web Wallet"}),(0,M.HG)()?(0,ae.jsx)(J.Z,{mt:.5,fontSize:12,style:{wordBreak:"break-all"},children:"Web Wallet Extension"}):o?(0,ae.jsx)(J.Z,{mt:.5,fontSize:12,style:{wordBreak:"break-all"},children:l.hostname}):null]}),(0,ae.jsx)(Ke.Z,{style:{width:s,height:s}}),c&&(0,ae.jsx)(Ne,{onRefresh:n})]}))}Qe.propTypes={tokenState:u().object.isRequired,onRefresh:u().func.isRequired,webWalletUrl:u().string},Qe.defaultProps={webWalletUrl:""};var Ge,Xe=(0,ie.zo)(we)(He||(He=(0,$.Z)(["\n position: relative;\n cursor: pointer;\n &:not(.card-timeout):hover {\n background-color: #f2f8ff;\n svg {\n color: #4598fa;\n }\n }\n"]))),$e=n(12118),Ye=["tokenState","onRefresh","deepLink"];function Je(e){var t=e.tokenState,n=e.onRefresh,o=e.deepLink,i=(0,a.Z)(e,Ye),c="lr"===i.layout?[20,34]:[40,68],u=(0,s.useRef)();return(0,ae.jsxs)(tt,(0,r.Z)((0,r.Z)({},i),{},{color:"#A8B4C5",fontWeight:700,onClick:function(){return u.current.click()},children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)(J.Z,{fontSize:16,children:"Open In"}),(0,ae.jsx)(J.Z,{mt:.5,fontSize:20,color:"#334660",children:"Mobile Wallet"})]}),(0,ae.jsx)($e.Z,{style:{width:c[0],height:c[1]}}),"timeout"===t.status&&(0,ae.jsx)(Ne,{onRefresh:n}),(0,ae.jsx)("a",{href:o,target:"_blank",ref:u,style:{display:"none"},rel:"noreferrer",children:"link"})]}))}var et,tt=(0,ie.zo)(we)(Ge||(Ge=(0,$.Z)(["\n position: relative;\n cursor: pointer;\n"])));Je.propTypes={tokenState:u().object.isRequired,onRefresh:u().func.isRequired,deepLink:u().string.isRequired};var nt=["locale"];function rt(e){var t=e.locale,n=(0,a.Z)(e,nt),o=(0,s.useRef)();return(0,ae.jsxs)(at,(0,r.Z)((0,r.Z)({},n),{},{onClick:function(){return o.current.click()},children:[(0,ae.jsx)(J.Z,{component:"span",ml:1,fontWeight:700,fontSize:14,color:"#9397A1",dangerouslySetInnerHTML:{__html:(R[t]||R.en).getWallet}}),(0,ae.jsx)("a",{href:"https://www.didwallet.io/".concat("zh"===t?"zh":"en"),target:"_blank",ref:o,style:{display:"none"},rel:"noreferrer",children:"link"})]}))}rt.propTypes={locale:u().oneOf(["en","zh"])},rt.defaultProps={locale:"en"};var ot,it,at=(0,ie.zo)(J.Z)(et||(et=(0,$.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]))),st=n(14720),ct=n(94551),ut=n(48082),lt=n(2689),dt=n(12268),ft=n(76032),ht=n.n(ft),pt=n(19611),vt=n.n(pt),gt=n(96628),wt={width:512,height:512,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="m304 48l112 112l-112 112m94.87-112H96m112 304L96 352l112-112m-94 112h302"/>'},mt=n(48317),bt=n(75260),yt=n(62399),xt=["appInfo"],_t=function(e){return e?e.split(":").pop():""};function kt(e){var t=e.appInfo,n=(0,a.Z)(e,xt),o=(0,s.useState)(!1),i=(0,w.Z)(o,2),c=i[0],u=i[1];return c||!t.appUrl&&!t.appLogo?(0,ae.jsx)(yt.Z,{did:t.appPid,size:32}):(0,ae.jsx)(dt.Z,(0,r.Z)((0,r.Z)({src:vt()(t.appUrl||"",t.appLogo||""),alt:t.appName||"Blocklet Icon",width:32,height:32},n),{},{onError:function(){return u(!0)}}))}function Ct(e){var t=e.appInfo,n=e.active;return(0,ae.jsxs)(Mt,{children:[(0,ae.jsx)(kt,{appInfo:t}),(0,ae.jsxs)(J.Z,{className:"app-info-content",children:[(0,ae.jsx)(J.Z,{className:"app-info-name",children:t.appName}),t.appPid&&(0,ae.jsx)(bt.Z,{size:14,className:"app-info-did",children:_t(t.appPid)})]}),n?(0,ae.jsx)(ct.Z,{color:"success",children:(0,ae.jsx)(gt.JO,{icon:mt.Z,color:"success"})}):null]})}function St(e){var t=e.appInfoList,n=e.sourceAppPid,r=e.onChangeSourceAppPid,o=(0,h.Z)({open:!1}),i=(0,s.useRef)(null),a=(0,p.Z)((function(){return t.find((function(e){return!!f()(n)||e.sourceAppPid===n}))}),[n,t]);return ht()(t)?null:(0,ae.jsxs)(zt,{children:[t.length>1?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(ct.Z,{ref:i,size:"small",mr:1,onClick:function(){o.open=!0},children:(0,ae.jsx)(gt.JO,{icon:wt})}),(0,ae.jsx)(ut.Z,{anchorEl:i.current,open:o.open,onClose:function(){o.open=!1},children:t.map((function(e){return(0,ae.jsx)(lt.Z,{onClick:function(){o.open=!1,r(e.sourceAppPid)},children:(0,ae.jsx)(Ct,{appInfo:e,active:e.sourceAppPid===n})},e.appPid)}))})]}):null,(0,ae.jsx)(Ct,{appInfo:a})]})}kt.propTypes={appInfo:u().object.isRequired},Ct.propTypes={appInfo:u().object.isRequired,active:u().bool},Ct.defaultProps={active:!1},St.propTypes={appInfoList:u().array,sourceAppPid:u().string,onChangeSourceAppPid:u().func},St.defaultProps={appInfoList:[],sourceAppPid:void 0,onChangeSourceAppPid:function(){}};var jt,Zt,Pt,Ot,At,Mt=(0,ie.zo)(J.Z)(ot||(ot=(0,$.Z)(["\n display: flex;\n align-items: center;\n font-weight: 700;\n color: #222;\n\n .app-info-content {\n padding-left: 8px;\n overflow: hidden;\n }\n\n .app-info-name {\n max-width: 100%;\n padding-right: 32px;\n line-height: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .app-info-did .did-address-text {\n color: #666;\n font-size: 12px;\n }\n"]))),zt=(0,ie.zo)(J.Z)(it||(it=(0,$.Z)(["\n display: flex;\n align-items: stretch;\n position: absolute;\n left: 24px;\n right: 24px;\n top: 24px;\n font-size: 16px;\n"]))),Dt=["locale","tokenKey","messages","qrcodeSize","showDownload","webWalletUrl","tokenState","generate","cancelWhenScanned","enabledConnectTypes","onRecreateSession","extraContent","loadingEle","onError","onSuccess","extraParams","provider","allowWallet","appInfoList","onChangeSourceAppPid"],Rt=!document.hidden;function Et(e){var t=e.locale,c=e.tokenKey,u=e.messages,l=e.qrcodeSize,d=(e.showDownload,e.webWalletUrl),f=e.tokenState,h=e.generate,p=e.cancelWhenScanned,g=e.enabledConnectTypes,m=e.onRecreateSession,b=e.extraContent,y=e.loadingEle,_=e.onError,k=e.onSuccess,C=e.extraParams,S=e.provider,j=e.allowWallet,Z=e.appInfoList,P=e.onChangeSourceAppPid,O=(0,a.Z)(e,Dt);R[t]||(t="en");var A=R[t];d=(0,s.useMemo)((function(){return d||(0,D.yP)()}),[d]);var z={checking:!1,loading:!1,error:"",status:f.status},E=(0,s.useState)((0,r.Z)({},z)),L=(0,w.Z)(E,2),I=L[0],q=L[1];(0,s.useEffect)((function(){q((function(e){return(0,r.Z)((0,r.Z)({},e),{},{status:f.status})}))}),[f.status]);var B=(0,r.Z)((0,r.Z)({},f),I),W=(0,ie.Fg)(),N=(0,s.useRef)(null),T=(0,ee.Z)(N),U=((null===T||void 0===T?void 0:T.width)||0)<600,F=(0,s.useContext)(se),H=F.isWalletWebview,K=F.isMobile,V=(0,D.PF)(d),Q=(0,s.useState)(!1),G=(0,w.Z)(Q,2),X=G[0],$=G[1],Y=(0,s.useState)(!1),ce=(0,w.Z)(Y,2),ue=ce[0],le=ce[1],de=(0,s.useState)(0),fe=(0,w.Z)(de,2),he=fe[0],pe=fe[1],ve=(0,st.F5)(),ge=ve.configs,we=ve.loginOAuth,me=ve.loginOAuthLoading,be=ve.getProvider,ye=ve.logoutOAuth,xe=Object.entries(ge).map((function(e){var t=(0,w.Z)(e,2),n=t[0],o=t[1];return(0,r.Z)((0,r.Z)({},o),{},{provider:n})})).filter((function(e){return e.enabled})),_e=function(){if(!B.url)return"";var e=B.url;if(K){e=e.replace(/^https?:\/\//,"abt://");var t=window.location.href;t.indexOf("?")>0?t+="&".concat(c,"=").concat(B.token):t+="?".concat(c,"=").concat(B.token),t=encodeURIComponent(t),e.indexOf("?")>0?e+="&callback=".concat(t,"&callback_delay=1500"):e+="?callback=".concat(t,"&callback_delay=1500")}return e},ke=function(){m(),B.inExistingSession||h(!1)};(0,s.useEffect)((function(){if(H){var e=_e();"created"===B.status&&e&&!X&&(n.e(5434).then(n.t.bind(n,45434,23)).then((function(t){t.call("authAction",{action:"auth",deepLink:e})})),$(!0))}}),[B]);var Ce=function(e){(0,M.E7)({webWalletUrl:d,url:e,locale:t})},Se=!1,je=!1,Ze=(0,s.useMemo)((function(){if(!["created","timeout"].includes(B.status))return!1;if(0===xe.length)return!1;if(!["login","invite"].includes(B.action))return!1;if(!1===j)return!0;if(["auth0"].includes(S)&&O.user)return!1;var e=O.forceConnected||C.forceConnected;return!e||"string"!==typeof e}),[B.status,B.action,xe.length,j,S,O.forceConnected,O.user,C.forceConnected]);["created","timeout"].includes(B.status)&&!H&&(g.includes("web")&&(V||(0,M.HG)())&&(Se=!0),je=g.includes("mobile"));var Pe=(0,v.Z)(function(){var e=(0,i.Z)((0,o.Z)().mark((function e(t){var n,i,a;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,q((function(e){return(0,r.Z)((0,r.Z)({},e),{},{loading:!0})})),e.next=4,we(t,(0,r.Z)({action:B.action},C));case 4:n=e.sent,i=(0,M.$Q)({returnDomain:!1}),x().remove("connected_did",i),x().remove("connected_pk",i),x().remove("connected_wallet_os",i),x().set("connected_app",(0,D.rh)(B.appInfo),i),n.sessionToken&&(q((function(e){return(0,r.Z)((0,r.Z)({},e),{},{loading:!1})})),k((0,r.Z)((0,r.Z)({},n),{},{encrypted:!1}),(function(e){return e}))),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(0),a=(0,D.iC)(e.t0,A.loginOAuthFailed),q((function(e){return(0,r.Z)((0,r.Z)({},e),{},{loading:!1,error:a,status:"error"})})),_(new Error(a));case 18:return e.prev=18,ye({provider:t.provider}),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[0,13,18,21]])})));return function(t){return e.apply(this,arguments)}}()),Oe=(0,s.useMemo)((function(){if(he>0)return!1;if("created"===B.status){if(H&&_e())return!0;if(Se&&B.saveConnect&&"created"===B.status&&Rt&&"web"===x().get("connected_wallet_os"))return!0}return!1}),[B.status,Se,B.saveConnect]);if((0,s.useEffect)((function(){!1===j&&Ze&&Pe(xe[0])}),[]),!1===j&&(Ze||me||I.loading))return(0,ae.jsx)(Bt,{children:y||(0,ae.jsx)(ne.Z,{sx:{color:re.Z.did.primary}})});var Me=f.loading||I.loading||"error"!==B.status&&!B.token||!["error","succeed","busy"].includes(B.status)&&H,ze=["scanned","succeed","error","busy"].includes(B.status),De=!Me&&(H||K);if(Me)return(0,ae.jsx)(Bt,{children:y||(0,ae.jsx)(ne.Z,{sx:{color:re.Z.did.primary}})});Se&&B.saveConnect&&"created"===B.status&&"web"===x().get("connected_wallet_os")&&!ue&&B.url&&Rt&&(le(!0),Ce(B.url));var Re={confirm:u.confirm,success:u.success,error:I.error||f.error||""};return(0,ae.jsx)(qt,(0,r.Z)((0,r.Z)({},O),{},{theme:W,ref:N,"data-did-auth-url":B.url,children:(0,ae.jsxs)("div",{className:"auth-inner",children:[!ze&&(0,ae.jsx)(St,{appInfoList:Z,sourceAppPid:null===C||void 0===C?void 0:C.sourceAppPid,onChangeSourceAppPid:P}),!ze&&(0,ae.jsxs)(Wt,{theme:W,children:[(0,ae.jsx)("h6",{className:"action-info-title",children:u.title}),u.scan&&(0,ae.jsx)("p",{className:"action-info-desc",children:u.scan})]}),(0,ae.jsx)(Nt,{className:U?"auth-main--small":"",children:(0,ae.jsxs)("div",{children:[!ze&&!Oe&&(0,ae.jsxs)(J.Z,{display:"flex",alignItems:"center",justifyContent:"center",children:[(0,ae.jsx)(J.Z,{color:"#999",fontSize:14,fontWeight:400,lineHeight:1,children:A.connect}),(0,ae.jsx)(oe.Z,{style:{height:"1em",marginLeft:8}})]}),!ze&&Oe&&(0,ae.jsxs)(J.Z,{display:"flex",alignItems:"center",justifyContent:"center",flexWrap:"wrap",lineHeight:"24px",color:"#999",fontSize:14,fontWeight:400,children:[(0,ae.jsx)(ne.Z,{size:12,sx:{color:re.Z.did.primary}}),(0,ae.jsxs)(J.Z,{display:"flex",alignItems:"center",ml:1,lineHeight:1,children:[A.connecting,(0,ae.jsx)(oe.Z,{style:{height:"1em",marginLeft:8}})]}),(0,ae.jsx)(J.Z,{ml:1,children:A.connectingSuffix})]}),(0,ae.jsxs)("div",{className:"auth-main-inner",style:{alignItems:"scanned"===B.status?"center":"stretch"},children:[ze&&(0,ae.jsx)(Ae,{status:B.status,nextWorkflow:B.nextWorkflow,mfaCode:B.mfaCode,onCancel:function(){m(),B.inExistingSession||(pe(he+1),p())},onRetry:function(){m(),q((0,r.Z)({},z)),!1!==j?B.inExistingSession||($(!1),h()):Pe(xe[0])},messages:Re,locale:t,className:"auth-status"}),(Se||je)&&(0,ae.jsxs)("div",{className:"auth-connect-types",children:[!K&&Se&&(0,ae.jsx)(Qe,{className:"auth-connect-type",layout:U?"lr":"tb",tokenState:B,onRefresh:ke,onClick:function(){return Ce(B.url)},webWalletUrl:d}),je&&(0,ae.jsx)(Fe,{className:"auth-connect-type",qrcodeSize:l,tokenState:B,onRefresh:ke,layout:U?"lr":"tb"}),De&&(0,ae.jsx)(Je,{deepLink:_e(),className:"auth-connect-type",tokenState:B,onRefresh:ke,layout:U?"lr":"tb"})]})]}),(Ze||me)&&(0,ae.jsx)(J.Z,{display:"flex",justifyContent:"center",mt:2,className:"auth-oauth-panel",children:xe.map((function(e){return(0,ae.jsxs)(te.Z,{variant:"contained",onClick:function(){return Pe(e)},loading:me&&e.provider===be(),children:[A.loginWithBefore,e.provider,A.loginWithAfter]},e.provider)}))}),!H&&(0,ae.jsx)(rt,{locale:t,width:1,p:2,pb:1,mt:2,visibility:ze?"hidden":"visible"}),(Se||je)&&b]})})]})}))}Et.propTypes={locale:u().oneOf(["en","zh",""]),tokenKey:u().string,qrcodeSize:u().number,webWalletUrl:u().string,messages:u().shape({title:u().string.isRequired,scan:u().string.isRequired,confirm:u().string.isRequired,success:u().any.isRequired}).isRequired,showDownload:u().bool,tokenState:u().object.isRequired,generate:u().func.isRequired,cancelWhenScanned:u().func.isRequired,enabledConnectTypes:u().array,onRecreateSession:u().func,extraContent:u().any,loadingEle:u().any,onSuccess:u().func,onError:u().func,extraParams:u().object,provider:u().oneOf(["wallet","auth0"]),allowWallet:u().bool,appInfoList:u().array,onChangeSourceAppPid:u().func},Et.defaultProps={locale:"en",tokenKey:"_t_",qrcodeSize:184,showDownload:!0,webWalletUrl:"",enabledConnectTypes:["web","mobile"],onRecreateSession:function(){},extraContent:null,loadingEle:"",onSuccess:function(){},onError:function(){},extraParams:{},provider:"wallet",allowWallet:!0,appInfoList:[],onChangeSourceAppPid:function(){}};var Lt,It=(0,Y.css)(jt||(jt=(0,$.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n"]))),qt=(0,ie.zo)("div")(Zt||(Zt=(0,$.Z)(["\n ",";\n position: relative;\n height: 100%;\n overflow-y: auto;\n line-height: 1.2;\n font-family: 'Lato';\n color: #334660;\n background-color: #fbfcfd;\n\n &,\n & *,\n & *:before,\n & *:after {\n box-sizing: border-box;\n }\n\n .auth-inner {\n width: 100%;\n margin: auto 0;\n padding: 40px 16px;\n }\n"])),It),Bt=(0,ie.zo)("div")(Pt||(Pt=(0,$.Z)(["\n ",";\n height: 100%;\n min-width: 160px;\n min-height: 160px;\n"])),It),Wt=(0,ie.zo)("div")(Ot||(Ot=(0,$.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 48px;\n text-align: center;\n .action-info-title {\n margin: 0;\n font-size: 28px;\n color: #222;\n }\n .action-info-desc {\n margin: 8px 0 0 0;\n font-size: 18px;\n color: #9397a1;\n }\n "," {\n .action-info-title {\n font-size: 24px;\n }\n .action-info-desc {\n font-size: 14px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),Nt=(0,ie.zo)("main")(At||(At=(0,$.Z)(["\n ",";\n .auth-main-inner {\n ",";\n align-items: stretch;\n height: 264px;\n margin-top: 24px;\n }\n .auth-connect-type {\n width: 264px;\n }\n .auth-status {\n width: auto;\n }\n .auth-connect-types {\n ",";\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n align-items: stretch;\n flex-wrap: wrap;\n }\n .auth-connect-type + .auth-connect-type {\n margin-left: 24px;\n }\n\n /* \u7a84\u5c4f\u6837\u5f0f */\n &.auth-main--small {\n .auth-main-inner {\n height: auto;\n }\n .auth-connect-types {\n align-items: center;\n flex-direction: column;\n }\n .auth-connect-type {\n width: 340px;\n }\n .auth-connect-type + .auth-connect-type {\n margin: 24px 0 0 0;\n }\n }\n"])),It,It,It),Tt=n(84636),Ut=n(87130),Ft=n(75255),Ht=n(10524),Kt=["popup","open","dialogStyle","responsive","hideCloseButton"],Vt=(0,s.forwardRef)((function(e,t){return(0,ae.jsx)(Ht.Z,(0,r.Z)({direction:"up",ref:t},e))}));var Qt,Gt=(0,ie.zo)("div")(Lt||(Lt=(0,$.Z)(["\n position: absolute;\n top: 1rem;\n right: 1rem;\n z-index: 999;\n color: #222222;\n font-size: 2rem;\n line-height: 1rem;\n cursor: pointer;\n user-select: none;\n"]))),Xt=n(20281),$t=n(23283),Yt=["webWalletUrl","maxIdleTime"],Jt=function(){!function(){var e=document.getElementById(Qt);e&&document.body.removeChild(e)}(),Qt=null},en=function(e){Qt||(Qt="web_wallet_sw_keeper_".concat(Date.now()),function(e){var t=document.createElement("iframe");t.title="abt wallet",t.id=Qt,t.style.width=0,t.style.height=0,t.style.border=0,t.style.display="block",t.style.position="absolute",t.style.top=0,t.src="".concat(e,"?action=iframe"),document.body.appendChild(t)}(e))};function tn(e){var t=e.webWalletUrl,n=e.maxIdleTime,r=(0,s.useRef)(!!Qt),o=(0,Xt.Z)(n),i=function(){r.current||Jt()};return(0,s.useEffect)((function(){o?i():en(t)}),[o]),(0,s.useEffect)((function(){return function(){return i()}}),[]),null}tn.propTypes={webWalletUrl:u().string.isRequired,maxIdleTime:u().number},tn.defaultProps={maxIdleTime:18e5};var nn=n(64765),rn=n(33665),on=n(57982),an=(0,s.createContext)(),sn=an.Provider;an.Consumer;function cn(e){var t=e.children,n=e.baseUrl,r=(0,s.useState)(null),a=(0,w.Z)(r,2),c=a[0],u=a[1],l=(0,v.Z)((0,i.Z)((0,o.Z)().mark((function e(){var t,r,i;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&!window.location.href.startsWith(n)){e.next=2;break}throw new Error("no blocklet data");case 2:return(t=new URL("__blocklet__.js",n)).searchParams.set("type","json"),e.next=6,fetch(t.href);case 6:return r=e.sent,e.next=9,r.json();case 9:return i=e.sent,e.abrupt("return",i);case 11:case"end":return e.stop()}}),e)}))));return(0,on.Z)((0,i.Z)((0,o.Z)().mark((function e(){var t,n;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l();case 3:t=e.sent,u(t),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),n=window.blocklet||window.env,u(n);case 11:case"end":return e.stop()}}),e,null,[[0,7]])}))),[n]),(0,ae.jsx)(sn,{value:c,children:c?t:null})}cn.propTypes={baseUrl:u().string,children:u().any.isRequired},cn.defaultProps={baseUrl:""};var un=["baseUrl"];n(40622),n(82236);var ln=["onClose","onSuccess","onError","action","prefix","checkFn","checkInterval","checkTimeout","extraParams","locale","tokenKey","encKey","baseUrl","autoConnect","forceConnected","saveConnect","useSocket","allowWallet","provider","blocklet"];function dn(e){e.onClose;var t,n,c,u,d=e.onSuccess,g=e.onError,w=e.action,m=e.prefix,b=e.checkFn,y=e.checkInterval,x=e.checkTimeout,_=e.extraParams,k=e.locale,C=e.tokenKey,S=e.encKey,j=e.baseUrl,Z=e.autoConnect,P=e.forceConnected,O=e.saveConnect,A=e.useSocket,M=e.allowWallet,z=e.provider,R=e.blocklet,E=(0,a.Z)(e,ln);if("function"!==typeof b)throw new Error("Cannot initialize did connect component without a fetchFn");var L=(0,s.useContext)(nn.B),I=(0,h.Z)({sourceAppPid:void 0}),q=(0,p.Z)((function(){if(f()(null===_||void 0===_?void 0:_.sourceAppPid)){var e=(0,l.FX)(R),t=(0,l.CF)(R);if(e&&null!==t&&void 0!==t&&t.appPid)return t.appPid}return _.sourceAppPid}),[null===_||void 0===_?void 0:_.sourceAppPid]),B=(0,p.Z)((function(){var e;return z||((null===_||void 0===_?void 0:_.provider)||(null===L||void 0===L||null===(e=L.session)||void 0===e?void 0:e.provider)||"wallet")}),[null===_||void 0===_?void 0:_.provider,null===L||void 0===L||null===(t=L.session)||void 0===t?void 0:t.provider]),W=(0,p.Z)((function(){var e;return!(null!==L&&void 0!==L&&null!==(e=L.session)&&void 0!==e&&e.user&&!["login"].includes(w))}),[w,null===L||void 0===L||null===(n=L.session)||void 0===n?void 0:n.user]),N=(0,p.Z)((function(){return(0,l.C6)(R).filter((function(e){var t;return!!W||(f()(null===_||void 0===_?void 0:_.sourceAppPid)?f()(I.sourceAppPid)?null!==L&&void 0!==L&&null!==(t=L.session)&&void 0!==t&&t.user?e.sourceAppPid===L.session.user.sourceAppPid:e.sourceAppPid===q:e.sourceAppPid===I.sourceAppPid:e.sourceAppPid===_.sourceAppPid)}))}),[W,null===_||void 0===_?void 0:_.sourceAppPid,I.sourceAppPid,q,null===L||void 0===L||null===(c=L.session)||void 0===c?void 0:c.user]),T=(0,v.Z)(function(){var e=(0,i.Z)((0,o.Z)().mark((function e(t){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I.sourceAppPid=t,e.next=3,(0,D._v)();case 3:K();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),U=(0,p.Z)((function(){var e,t;return W?(0,r.Z)((0,r.Z)({},_),{},{sourceAppPid:f()(I.sourceAppPid)?q:I.sourceAppPid}):null!==L&&void 0!==L&&null!==(e=L.session)&&void 0!==e&&e.user?f()(null===_||void 0===_?void 0:_.sourceAppPid)?(0,r.Z)((0,r.Z)({},_),{},{sourceAppPid:null===(t=L.session.user)||void 0===t?void 0:t.sourceAppPid}):_:(0,r.Z)((0,r.Z)({},_),{},{sourceAppPid:q})}),[W,_,I.sourceAppPid,w,q,null===L||void 0===L||null===(u=L.session)||void 0===u?void 0:u.user]),F=X({action:w,baseUrl:j,checkFn:b,checkInterval:y,checkTimeout:x,extraParams:U,prefix:m,onError:g,onSuccess:d,locale:k,tokenKey:C,encKey:S,autoConnect:Z,forceConnected:P,saveConnect:O,useSocket:A,allowWallet:M,provider:B}),H=F.state,K=F.generate,V=F.cancelWhenScanned,Q=(0,r.Z)((0,r.Z)({},E),{},{provider:B,tokenState:H,generate:K,cancelWhenScanned:V,locale:k,tokenKey:C,onError:g,onSuccess:d,extraParams:U,allowWallet:M,onChangeSourceAppPid:T,appInfoList:N,forceConnected:P});return(0,ae.jsx)(ue,{children:(0,ae.jsx)(Et,(0,r.Z)({},Q))})}dn.propTypes={onClose:u().func,onError:u().func,onSuccess:u().func.isRequired,action:u().string.isRequired,checkFn:u().func.isRequired,prefix:u().string,checkInterval:u().number,checkTimeout:u().number,extraParams:u().object,locale:u().oneOf(["en","zh",""]),tokenKey:u().string,encKey:u().string,baseUrl:u().string,autoConnect:u().bool,forceConnected:u().oneOfType([u().bool,u().string]),saveConnect:u().bool,useSocket:u().bool,allowWallet:u().bool,provider:u().oneOf(["wallet","auth0",""]),blocklet:u().object},dn.defaultProps={prefix:"/api/did",onClose:function(){},onError:function(){},checkInterval:2e3,checkTimeout:6e4,extraParams:{},locale:"en",tokenKey:"_t_",encKey:"_ek_",baseUrl:"",autoConnect:!0,forceConnected:!0,saveConnect:!0,useSocket:!0,allowWallet:!0,provider:"",blocklet:window.blocklet};var fn,hn=(fn=function(e){function t(t){var n=t.popup,o=t.open,i=t.dialogStyle,s=t.responsive,c=t.hideCloseButton,u=(0,a.Z)(t,Kt),l=(0,A.Z)(),d=(0,ie.Fg)(),f=(0,Ft.Z)(d.breakpoints.down("md"))&&l.mobile.any;if(!n&&!s)return(0,ae.jsx)(e,(0,r.Z)({},u));var h=!!s||o;return(0,ae.jsx)(Tt.Z,(0,r.Z)((0,r.Z)({open:h,fullScreen:f,maxWidth:"lg",onClose:function(e,t){}},f&&{TransitionComponent:Vt,PaperProps:{style:{background:"transparent"}},style:{paddingTop:44}}),{},{children:(0,ae.jsxs)(Ut.Z,{style:(0,r.Z)((0,r.Z)({width:f?"100%":720,height:f?"100%":780,maxWidth:"100%",maxHeight:"100%",padding:0},i),f&&{position:"relative",borderRadius:"16px 16px 0 0",background:"#fff"}),children:[!c&&(0,ae.jsx)(Gt,{onClick:function(){u.onClose&&u.onClose()},children:"\xd7"}),(0,ae.jsx)(e,(0,r.Z)({},u))]})}))}return t.propTypes={responsive:u().bool,popup:u().bool,open:u().bool,dialogStyle:u().object,hideCloseButton:u().bool},t.defaultProps={responsive:!1,popup:!1,open:!1,dialogStyle:{},hideCloseButton:!1},t}(function(e){function t(t){var n=Object.assign({},((0,rn.Z)(t),t)),o=(0,s.useContext)(an);return(0,ae.jsx)(e,(0,r.Z)((0,r.Z)({},n),{},{blocklet:o}))}return function(e){var n=e.baseUrl,o=(0,a.Z)(e,un);return(0,ae.jsx)(cn,{baseUrl:n,children:(0,ae.jsx)(t,(0,r.Z)({baseUrl:n},o))})}}(dn)),function(e){var t=e.webWalletUrl,n=e.maxIdleTime,o=(0,a.Z)(e,Yt),i=(0,A.Z)();t=t||(0,$t.yP)();var s=(0,I.Z)("wallet_sw_keeper_disabled",{defaultValue:1}),c=(0,w.Z)(s,1)[0],u=(0,M.HG)(),l=(0,$t.PF)(t),d=i.wallet;return(0,ae.jsxs)(ae.Fragment,{children:[!c&&!u&&l&&!d&&(0,ae.jsx)(tn,{webWalletUrl:t,maxIdleTime:n}),(0,ae.jsx)(fn,(0,r.Z)({webWalletUrl:t},o))]})})},38222:function(e,t,n){"use strict";t.Z=void 0;(r=n(30969))&&r.__esModule;var r,o=n(37574);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(e){return(0,o.jsx)("svg",a(a({},e),{},{children:(0,o.jsx)("path",{d:"M5.472.371H60.94c3.061 0 5.565 2.412 5.565 5.473v35.431c0 3.061-2.504 5.658-5.565 5.658H39.328v9.183h15.768c2.319 0 2.504 7.606 2.782 7.884H8.626s0-7.884 2.783-7.884h15.768v-9.183H5.472C2.412 46.933 0 44.336 0 41.275V5.844C0 2.783 2.412.37 5.472.37zm0 40.904H60.94V5.844H5.472v35.431z"})}))};c.defaultProps={width:"67",height:"64",viewBox:"0 0 67 64",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},c.displayName="computer";var u=c;t.Z=u},61923:function(e,t,n){"use strict";t.Z=void 0;(r=n(30969))&&r.__esModule;var r,o=n(37574);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(e){return(0,o.jsxs)("svg",a(a({},e),{},{children:[(0,o.jsx)("circle",{cx:"24",cy:"24",r:"24"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.76 28.844a1.4 1.4 0 0 1 1.98 0l2.917 2.916a1.4 1.4 0 0 1 0 1.98l-2.917 2.917a1.4 1.4 0 0 1-1.98-1.98l1.927-1.927-1.927-1.927a1.4 1.4 0 0 1 0-1.98zM12.027 12.027a3.733 3.733 0 1 1 5.28 5.28 3.733 3.733 0 0 1-5.28-5.28zm2.64 1.707a.933.933 0 1 0 0 1.866.933.933 0 0 0 0-1.866z",fill:"#fff"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6 14.667a1.4 1.4 0 0 1 1.4-1.4h4.667A3.733 3.733 0 0 1 25.4 17v13.417a.933.933 0 0 0 .933.933h9.334a1.4 1.4 0 1 1 0 2.8h-9.334a3.733 3.733 0 0 1-3.733-3.733V17a.933.933 0 0 0-.933-.933H17a1.4 1.4 0 0 1-1.4-1.4z",fill:"#fff"})]}))};c.defaultProps={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c.displayName="connect";var u=c;t.Z=u},72395:function(e,t,n){"use strict";t.Z=void 0;(r=n(30969))&&r.__esModule;var r,o=n(37574);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(e){return(0,o.jsxs)("svg",a(a({},e),{},{children:[(0,o.jsx)("path",{d:"M24.604 2.263L28.524 0H42.79v41.862H28.791a1 1 0 0 1-.5-.134l-15.103-8.72V8.854l1.817-1.05 3.2 1.848-1.817 1.05V31.16l12.993 7.502H39.59V3.2H29.38l-1.576.91-3.2-1.847z",fill:"#6BBDFE"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.402 31.16V10.701L13.409 3.2H3.2v35.462h10.21l1.58-.913 3.2 1.847-3.923 2.266H0V0h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z",fill:"#4598FA"}),(0,o.jsx)("path",{d:"M152.732 9.627l-7.02 22.502h-3.009l-5.484-16.688a7.8 7.8 0 0 1-.329-1.207c-.115.48-.225.883-.329 1.207l-5.548 16.688h-2.993L121 9.627h2.789c.293 0 .538.073.737.22a.955.955 0 0 1 .392.563l4.434 15.06c.084.292.157.61.22.955.073.345.146.706.219 1.082.073-.377.146-.737.219-1.082.084-.344.178-.663.282-.956l5.078-15.059c.062-.209.193-.391.391-.548.209-.157.455-.235.737-.235h.956c.292 0 .533.073.721.22.188.145.323.334.407.563l5.061 15.06c.189.574.356 1.227.502 1.958.125-.72.261-1.374.407-1.959l4.451-15.059c.052-.209.183-.391.391-.548.209-.157.455-.235.737-.235h2.601zM162.039 25.062c-1.244.042-2.299.141-3.166.298-.867.146-1.572.345-2.115.595-.543.25-.935.549-1.175.893-.241.335-.361.71-.361 1.129 0 .397.063.741.188 1.034.136.282.314.517.533.705.23.178.496.308.799.392a3.7 3.7 0 0 0 .987.125 5.433 5.433 0 0 0 2.398-.533c.345-.177.674-.391.987-.642.314-.25.622-.538.925-.862v-3.134zm-8.964-6.629c.888-.846 1.849-1.478 2.884-1.896 1.044-.418 2.188-.626 3.431-.626.909 0 1.714.151 2.414.454.7.293 1.29.705 1.77 1.238.481.533.841 1.17 1.082 1.912.25.741.376 1.561.376 2.46v10.154h-1.364c-.303 0-.532-.047-.689-.14-.157-.105-.282-.293-.376-.565l-.329-1.395c-.408.377-.81.71-1.207 1.003a8.387 8.387 0 0 1-1.254.737c-.428.198-.888.35-1.379.454a7.84 7.84 0 0 1-1.629.157 6.1 6.1 0 0 1-1.771-.25 4.064 4.064 0 0 1-1.426-.8 3.824 3.824 0 0 1-.971-1.332c-.23-.533-.345-1.154-.345-1.865 0-.626.167-1.227.501-1.802.345-.585.899-1.107 1.661-1.567.773-.46 1.776-.835 3.009-1.128 1.243-.293 2.768-.46 4.576-.501v-1.16c0-1.201-.256-2.1-.768-2.695-.512-.596-1.264-.893-2.257-.893-.668 0-1.232.083-1.692.25a6.476 6.476 0 0 0-1.175.564 26.04 26.04 0 0 0-.862.549 1.3 1.3 0 0 1-.752.25.904.904 0 0 1-.549-.172 1.49 1.49 0 0 1-.36-.407l-.549-.988zM172.256 9v23.13h-3.071V9h3.071zM179.755 9v23.13h-3.072V9h3.072zM194.665 22.398c0-.606-.088-1.165-.266-1.677a3.714 3.714 0 0 0-.752-1.332 3.46 3.46 0 0 0-1.223-.877c-.48-.21-1.034-.314-1.661-.314-1.285 0-2.298.371-3.04 1.113-.731.742-1.196 1.77-1.394 3.087h8.336zm2.523 7.46c-.376.438-.809.82-1.3 1.143a7.805 7.805 0 0 1-1.567.768 9.5 9.5 0 0 1-1.724.439c-.585.094-1.165.14-1.74.14-1.096 0-2.115-.182-3.055-.548a7.001 7.001 0 0 1-2.429-1.63c-.679-.72-1.212-1.608-1.599-2.663-.376-1.066-.564-2.288-.564-3.667 0-1.108.173-2.137.517-3.087a7.51 7.51 0 0 1 1.473-2.508 6.915 6.915 0 0 1 2.367-1.676c.929-.408 1.974-.611 3.134-.611.971 0 1.865.161 2.679.485a5.869 5.869 0 0 1 2.132 1.38c.595.605 1.06 1.352 1.394 2.24.345.888.517 1.902.517 3.04 0 .47-.052.789-.156.956-.105.157-.298.235-.58.235H186.25c.032.95.168 1.781.408 2.492.24.7.569 1.285.987 1.755.428.47.935.82 1.52 1.05.585.23 1.238.344 1.959.344.679 0 1.264-.078 1.755-.235.501-.156.93-.323 1.285-.501.366-.188.668-.36.909-.517.25-.157.47-.235.658-.235.251 0 .444.094.58.282l.877 1.128zM205.568 32.38c-1.285 0-2.277-.36-2.977-1.081-.689-.721-1.034-1.75-1.034-3.087v-9.528h-1.849a.688.688 0 0 1-.455-.157c-.115-.114-.172-.282-.172-.5v-1.239l2.585-.36.69-4.748a.72.72 0 0 1 .235-.408.708.708 0 0 1 .47-.156h1.551v5.343h4.514v2.225h-4.514v9.324c0 .627.152 1.097.455 1.41.313.303.71.455 1.191.455.282 0 .522-.037.721-.11.209-.073.386-.151.532-.235.147-.094.272-.178.377-.25a.507.507 0 0 1 .282-.11c.104 0 .182.026.235.078a.691.691 0 0 1 .188.22l.909 1.472a5.282 5.282 0 0 1-1.787 1.066 6.232 6.232 0 0 1-2.147.376z",fill:"#4598FA"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.815 33.284V9H70.66a6.259 6.259 0 0 1 5.823 6.243v11.783a6.258 6.258 0 0 1-6.258 6.258h-12.41zM84.56 9h-3.335v24.321h3.335V9zM61.15 29.95V12.32h9.075a2.923 2.923 0 0 1 2.923 2.923v11.783a2.923 2.923 0 0 1-2.923 2.923H61.15zM89.243 9v24.284h12.409a6.258 6.258 0 0 0 6.259-6.258V15.243A6.259 6.259 0 0 0 102.087 9H89.243zm22.912 5.636h3.728v3.728h-3.728v-3.729zm3.728 9.321h-3.728v3.729h3.728v-3.729zM92.578 12.32v17.63h9.074a2.924 2.924 0 0 0 2.924-2.924V15.243a2.924 2.924 0 0 0-2.924-2.923h-9.074z",fill:"#363844"})]}))};c.defaultProps={viewBox:"0 0 210 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c.displayName="did-wallet-logo";var u=c;t.Z=u},12118:function(e,t,n){"use strict";t.Z=void 0;(r=n(30969))&&r.__esModule;var r,o=n(37574);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=function(e){return(0,o.jsx)("svg",a(a({},e),{},{children:(0,o.jsx)("path",{d:"M3.833.833h13.334A3.333 3.333 0 0 1 20.5 4.167v26.666a3.333 3.333 0 0 1-3.333 3.334H3.833A3.333 3.333 0 0 1 .5 30.833V4.168A3.333 3.333 0 0 1 3.833.833zm0 3.334v25h13.334v-25H3.833z"})}))};c.defaultProps={width:"21",height:"35",viewBox:"0 0 21 35",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},c.displayName="mobile";var u=c;t.Z=u},92771:function(e,t,n){"use strict";var r=n(43681).default;t.Z=function(){var e=(0,i.useState)({wallet:navigator.userAgent.indexOf("ABTWallet")>-1,wechat:/MicroMessenger/i.test(navigator.userAgent),mobile:c({apple:{phone:!1,ipod:!1,tablet:!1,device:!1},amazon:{phone:!1,tablet:!1,device:!1},android:{phone:!1,tablet:!1,device:!1},windows:{phone:!1,tablet:!1,device:!1},other:{blackberry:!1,blackberry10:!1,opera:!1,firefox:!1,chrome:!1,device:!1},phone:!1,tablet:!1,any:!1},(0,a.default)(navigator.userAgent))});return r(e,1)[0]};var o,i=n(30969),a=(o=n(30993))&&o.__esModule?o:{default:o};function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},65457:function(e,t,n){"use strict";t.Z=function(e,t){var n=(0,r.useRef)();(0,r.useEffect)((function(){n.current=e}),[e]),(0,r.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])};var r=n(30969)},44181:function(e,t,n){"use strict";var r=n(71600);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(48035)),i=n(37574),a=(0,o.default)((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");t.default=a},58082:function(e,t,n){"use strict";var r=n(71600);t.Z=void 0;var o=r(n(48035)),i=n(37574),a=(0,o.default)((0,i.jsx)("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5-4-4V4h8v3.5l-4 4z"}),"HourglassEmptyOutlined");t.Z=a},10452:function(e,t,n){"use strict";var r=n(71600);t.Z=void 0;var o=r(n(48035)),i=n(37574),a=(0,o.default)((0,i.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");t.Z=a},68848:function(e){e.exports=function(){var e={192:function(e,t){var n,r,o=function(){var e=function(e,t){var n=e,r=a[t],o=null,i=0,c=null,g=[],w={},b=function(e,t){o=function(e){for(var t=new Array(e),n=0;n<e;n+=1){t[n]=new Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(i=4*n+17),y(0,0),y(i-7,0),y(0,i-7),_(),x(),C(e,t),n>=7&&k(e),null==c&&(c=j(n,r,g)),S(c,t)},y=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||i<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||i<=t+r||(o[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},x=function(){for(var e=8;e<i-8;e+=1)null==o[e][6]&&(o[e][6]=e%2==0);for(var t=8;t<i-8;t+=1)null==o[6][t]&&(o[6][t]=t%2==0)},_=function(){for(var e=s.getPatternPosition(n),t=0;t<e.length;t+=1)for(var r=0;r<e.length;r+=1){var i=e[t],a=e[r];if(null==o[i][a])for(var c=-2;c<=2;c+=1)for(var u=-2;u<=2;u+=1)o[i+c][a+u]=-2==c||2==c||-2==u||2==u||0==c&&0==u}},k=function(e){for(var t=s.getBCHTypeNumber(n),r=0;r<18;r+=1){var a=!e&&1==(t>>r&1);o[Math.floor(r/3)][r%3+i-8-3]=a}for(r=0;r<18;r+=1)a=!e&&1==(t>>r&1),o[r%3+i-8-3][Math.floor(r/3)]=a},C=function(e,t){for(var n=r<<3|t,a=s.getBCHTypeInfo(n),c=0;c<15;c+=1){var u=!e&&1==(a>>c&1);c<6?o[c][8]=u:c<8?o[c+1][8]=u:o[i-15+c][8]=u}for(c=0;c<15;c+=1)u=!e&&1==(a>>c&1),c<8?o[8][i-c-1]=u:c<9?o[8][15-c-1+1]=u:o[8][15-c-1]=u;o[i-8][8]=!e},S=function(e,t){for(var n=-1,r=i-1,a=7,c=0,u=s.getMaskFunction(t),l=i-1;l>0;l-=2)for(6==l&&(l-=1);;){for(var d=0;d<2;d+=1)if(null==o[r][l-d]){var f=!1;c<e.length&&(f=1==(e[c]>>>a&1)),u(r,l-d)&&(f=!f),o[r][l-d]=f,-1==(a-=1)&&(c+=1,a=7)}if((r+=n)<0||i<=r){r-=n,n=-n;break}}},j=function(e,t,n){for(var r=l.getRSBlocks(e,t),o=d(),i=0;i<n.length;i+=1){var a=n[i];o.put(a.getMode(),4),o.put(a.getLength(),s.getLengthInBits(a.getMode(),e)),a.write(o)}var c=0;for(i=0;i<r.length;i+=1)c+=r[i].dataCount;if(o.getLengthInBits()>8*c)throw"code length overflow. ("+o.getLengthInBits()+">"+8*c+")";for(o.getLengthInBits()+4<=8*c&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*c||(o.put(236,8),o.getLengthInBits()>=8*c));)o.put(17,8);return function(e,t){for(var n=0,r=0,o=0,i=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c+=1){var l=t[c].dataCount,d=t[c].totalCount-l;r=Math.max(r,l),o=Math.max(o,d),i[c]=new Array(l);for(var f=0;f<i[c].length;f+=1)i[c][f]=255&e.getBuffer()[f+n];n+=l;var h=s.getErrorCorrectPolynomial(d),p=u(i[c],h.getLength()-1).mod(h);for(a[c]=new Array(h.getLength()-1),f=0;f<a[c].length;f+=1){var v=f+p.getLength()-a[c].length;a[c][f]=v>=0?p.getAt(v):0}}var g=0;for(f=0;f<t.length;f+=1)g+=t[f].totalCount;var w=new Array(g),m=0;for(f=0;f<r;f+=1)for(c=0;c<t.length;c+=1)f<i[c].length&&(w[m]=i[c][f],m+=1);for(f=0;f<o;f+=1)for(c=0;c<t.length;c+=1)f<a[c].length&&(w[m]=a[c][f],m+=1);return w}(o,r)};w.addData=function(e,t){var n=null;switch(t=t||"Byte"){case"Numeric":n=f(e);break;case"Alphanumeric":n=h(e);break;case"Byte":n=p(e);break;case"Kanji":n=v(e);break;default:throw"mode:"+t}g.push(n),c=null},w.isDark=function(e,t){if(e<0||i<=e||t<0||i<=t)throw e+","+t;return o[e][t]},w.getModuleCount=function(){return i},w.make=function(){if(n<1){for(var e=1;e<40;e++){for(var t=l.getRSBlocks(e,r),o=d(),i=0;i<g.length;i++){var a=g[i];o.put(a.getMode(),4),o.put(a.getLength(),s.getLengthInBits(a.getMode(),e)),a.write(o)}var c=0;for(i=0;i<t.length;i++)c+=t[i].dataCount;if(o.getLengthInBits()<=8*c)break}n=e}b(!1,function(){for(var e=0,t=0,n=0;n<8;n+=1){b(!0,n);var r=s.getLostPoint(w);(0==n||e>r)&&(e=r,t=n)}return t}())},w.createTableTag=function(e,t){e=e||2;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+(t=void 0===t?4*e:t)+"px;",n+='">',n+="<tbody>";for(var r=0;r<w.getModuleCount();r+=1){n+="<tr>";for(var o=0;o<w.getModuleCount();o+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+e+"px;",n+=" height: "+e+"px;",n+=" background-color: ",n+=w.isDark(r,o)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return(n+="</tbody>")+"</table>"},w.createSvgTag=function(e,t,n,r){var o={};"object"==typeof arguments[0]&&(e=(o=arguments[0]).cellSize,t=o.margin,n=o.alt,r=o.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var i,a,s,c,u=w.getModuleCount()*e+2*t,l="";for(c="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",l+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',l+=o.scalable?"":' width="'+u+'px" height="'+u+'px"',l+=' viewBox="0 0 '+u+" "+u+'" ',l+=' preserveAspectRatio="xMinYMin meet"',l+=r.text||n.text?' role="img" aria-labelledby="'+Z([r.id,n.id].join(" ").trim())+'"':"",l+=">",l+=r.text?'<title id="'+Z(r.id)+'">'+Z(r.text)+"</title>":"",l+=n.text?'<description id="'+Z(n.id)+'">'+Z(n.text)+"</description>":"",l+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',l+='<path d="',a=0;a<w.getModuleCount();a+=1)for(s=a*e+t,i=0;i<w.getModuleCount();i+=1)w.isDark(a,i)&&(l+="M"+(i*e+t)+","+s+c);return(l+='" stroke="transparent" fill="black"/>')+"</svg>"},w.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=w.getModuleCount()*e+2*t,r=t,o=n-t;return m(n,n,(function(t,n){if(r<=t&&t<o&&r<=n&&n<o){var i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return w.isDark(a,i)?0:1}return 1}))},w.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;var r=w.getModuleCount()*e+2*t,o="";return o+="<img",o+=' src="',o+=w.createDataURL(e,t),o+='"',o+=' width="',o+=r,o+='"',o+=' height="',o+=r,o+='"',n&&(o+=' alt="',o+=Z(n),o+='"'),o+"/>"};var Z=function(e){for(var t="",n=0;n<e.length;n+=1){var r=e.charAt(n);switch(r){case"<":t+="&lt;";break;case">":t+="&gt;";break;case"&":t+="&amp;";break;case'"':t+="&quot;";break;default:t+=r}}return t};return w.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,n,r,o,i,a=1*w.getModuleCount()+2*e,s=e,c=a-e,u={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},l={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},d="";for(t=0;t<a;t+=2){for(r=Math.floor((t-s)/1),o=Math.floor((t+1-s)/1),n=0;n<a;n+=1)i="\u2588",s<=n&&n<c&&s<=t&&t<c&&w.isDark(r,Math.floor((n-s)/1))&&(i=" "),s<=n&&n<c&&s<=t+1&&t+1<c&&w.isDark(o,Math.floor((n-s)/1))?i+=" ":i+="\u2588",d+=e<1&&t+1>=c?l[i]:u[i];d+="\n"}return a%2&&e>0?d.substring(0,d.length-a-1)+Array(a+1).join("\u2580"):d.substring(0,d.length-1)}(t);e-=1,t=void 0===t?2*e:t;var n,r,o,i,a=w.getModuleCount()*e+2*t,s=t,c=a-t,u=Array(e+1).join("\u2588\u2588"),l=Array(e+1).join(" "),d="",f="";for(n=0;n<a;n+=1){for(o=Math.floor((n-s)/e),f="",r=0;r<a;r+=1)i=1,s<=r&&r<c&&s<=n&&n<c&&w.isDark(o,Math.floor((r-s)/e))&&(i=0),f+=i?u:l;for(o=0;o<e;o+=1)d+=f+"\n"}return d.substring(0,d.length-1)},w.renderTo2dContext=function(e,t){t=t||2;for(var n=w.getModuleCount(),r=0;r<n;r++)for(var o=0;o<n;o++)e.fillStyle=w.isDark(r,o)?"black":"white",e.fillRect(r*t,o*t,t,t)},w};e.stringToBytes=(e.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(255&r)}return t}}).default,e.createStringToBytes=function(e,t){var n=function(){for(var n=w(e),r=function(){var e=n.read();if(-1==e)throw"eof";return e},o=0,i={};;){var a=n.read();if(-1==a)break;var s=r(),c=r()<<8|r();i[String.fromCharCode(a<<8|s)]=c,o+=1}if(o!=t)throw o+" != "+t;return i}(),r="?".charCodeAt(0);return function(e){for(var t=[],o=0;o<e.length;o+=1){var i=e.charCodeAt(o);if(i<128)t.push(i);else{var a=n[e.charAt(o)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(r)}}return t}};var t,n,r,o,i,a={L:1,M:0,Q:3,H:2},s=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,r=7973,i=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(o={}).getBCHTypeInfo=function(e){for(var t=e<<10;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return 21522^(e<<10|t)},o.getBCHTypeNumber=function(e){for(var t=e<<12;i(t)-i(r)>=0;)t^=r<<i(t)-i(r);return e<<12|t},o.getPatternPosition=function(e){return t[e-1]},o.getMaskFunction=function(e){switch(e){case 0:return function(e,t){return(e+t)%2==0};case 1:return function(e,t){return e%2==0};case 2:return function(e,t){return t%3==0};case 3:return function(e,t){return(e+t)%3==0};case 4:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case 5:return function(e,t){return e*t%2+e*t%3==0};case 6:return function(e,t){return(e*t%2+e*t%3)%2==0};case 7:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},o.getErrorCorrectPolynomial=function(e){for(var t=u([1],0),n=0;n<e;n+=1)t=t.multiply(u([1,c.gexp(n)],0));return t},o.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+e}else{if(!(t<41))throw"type:"+t;switch(e){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+e}}},o.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var o=0;o<t;o+=1){for(var i=0,a=e.isDark(r,o),s=-1;s<=1;s+=1)if(!(r+s<0||t<=r+s))for(var c=-1;c<=1;c+=1)o+c<0||t<=o+c||0==s&&0==c||a==e.isDark(r+s,o+c)&&(i+=1);i>5&&(n+=3+i-5)}for(r=0;r<t-1;r+=1)for(o=0;o<t-1;o+=1){var u=0;e.isDark(r,o)&&(u+=1),e.isDark(r+1,o)&&(u+=1),e.isDark(r,o+1)&&(u+=1),e.isDark(r+1,o+1)&&(u+=1),0!=u&&4!=u||(n+=3)}for(r=0;r<t;r+=1)for(o=0;o<t-6;o+=1)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(o=0;o<t;o+=1)for(r=0;r<t-6;r+=1)e.isDark(r,o)&&!e.isDark(r+1,o)&&e.isDark(r+2,o)&&e.isDark(r+3,o)&&e.isDark(r+4,o)&&!e.isDark(r+5,o)&&e.isDark(r+6,o)&&(n+=40);var l=0;for(o=0;o<t;o+=1)for(r=0;r<t;r+=1)e.isDark(r,o)&&(l+=1);return n+Math.abs(100*l/t/t-50)/5*10},o),c=function(){for(var e=new Array(256),t=new Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(n=0;n<255;n+=1)t[e[n]]=n;return{glog:function(e){if(e<1)throw"glog("+e+")";return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}}}();function u(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n<e.length&&0==e[n];)n+=1;for(var r=new Array(e.length-n+t),o=0;o<e.length-n;o+=1)r[o]=e[o+n];return r}(),r={getAt:function(e){return n[e]},getLength:function(){return n.length},multiply:function(e){for(var t=new Array(r.getLength()+e.getLength()-1),n=0;n<r.getLength();n+=1)for(var o=0;o<e.getLength();o+=1)t[n+o]^=c.gexp(c.glog(r.getAt(n))+c.glog(e.getAt(o)));return u(t,0)},mod:function(e){if(r.getLength()-e.getLength()<0)return r;for(var t=c.glog(r.getAt(0))-c.glog(e.getAt(0)),n=new Array(r.getLength()),o=0;o<r.getLength();o+=1)n[o]=r.getAt(o);for(o=0;o<e.getLength();o+=1)n[o]^=c.gexp(c.glog(e.getAt(o))+t);return u(n,0).mod(e)}};return r}var l=function(){var e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},n={getRSBlocks:function(n,r){var o=function(t,n){switch(n){case a.L:return e[4*(t-1)+0];case a.M:return e[4*(t-1)+1];case a.Q:return e[4*(t-1)+2];case a.H:return e[4*(t-1)+3];default:return}}(n,r);if(void 0===o)throw"bad rs block @ typeNumber:"+n+"/errorCorrectionLevel:"+r;for(var i=o.length/3,s=[],c=0;c<i;c+=1)for(var u=o[3*c+0],l=o[3*c+1],d=o[3*c+2],f=0;f<u;f+=1)s.push(t(l,d));return s}};return n}(),d=function(){var e=[],t=0,n={getBuffer:function(){return e},getAt:function(t){var n=Math.floor(t/8);return 1==(e[n]>>>7-t%8&1)},put:function(e,t){for(var r=0;r<t;r+=1)n.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},f=function(e){var t=e,n={getMode:function(){return 1},getLength:function(e){return t.length},write:function(e){for(var n=t,o=0;o+2<n.length;)e.put(r(n.substring(o,o+3)),10),o+=3;o<n.length&&(n.length-o==1?e.put(r(n.substring(o,o+1)),4):n.length-o==2&&e.put(r(n.substring(o,o+2)),7))}},r=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+o(e.charAt(n));return t},o=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+e};return n},h=function(e){var t=e,n={getMode:function(){return 2},getLength:function(e){return t.length},write:function(e){for(var n=t,o=0;o+1<n.length;)e.put(45*r(n.charAt(o))+r(n.charAt(o+1)),11),o+=2;o<n.length&&e.put(r(n.charAt(o)),6)}},r=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);if("A"<=e&&e<="Z")return e.charCodeAt(0)-"A".charCodeAt(0)+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return n},p=function(t){var n=e.stringToBytes(t);return{getMode:function(){return 4},getLength:function(e){return n.length},write:function(e){for(var t=0;t<n.length;t+=1)e.put(n[t],8)}}},v=function(t){var n=e.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(e,t){var r=n("\u53cb");if(2!=r.length||38726!=(r[0]<<8|r[1]))throw"sjis not supported."}();var r=n(t),o={getMode:function(){return 8},getLength:function(e){return~~(r.length/2)},write:function(e){for(var t=r,n=0;n+1<t.length;){var o=(255&t[n])<<8|255&t[n+1];if(33088<=o&&o<=40956)o-=33088;else{if(!(57408<=o&&o<=60351))throw"illegal char at "+(n+1)+"/"+o;o-=49472}o=192*(o>>>8&255)+(255&o),e.put(o,13),n+=2}if(n<t.length)throw"illegal char at "+(n+1)}};return o},g=function(){var e=[],t={writeByte:function(t){e.push(255&t)},writeShort:function(e){t.writeByte(e),t.writeByte(e>>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o<r;o+=1)t.writeByte(e[o+n])},writeString:function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},toByteArray:function(){return e},toString:function(){var t="";t+="[";for(var n=0;n<e.length;n+=1)n>0&&(t+=","),t+=e[n];return t+"]"}};return t},w=function(e){var t=e,n=0,r=0,o=0,i={read:function(){for(;o<8;){if(n>=t.length){if(0==o)return-1;throw"unexpected end of file./"+o}var e=t.charAt(n);if(n+=1,"="==e)return o=0,-1;e.match(/^\s$/)||(r=r<<6|a(e.charCodeAt(0)),o+=6)}var i=r>>>o-8&255;return o-=8,i}},a=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return i},m=function(e,t,n){for(var r=function(e,t){var n=e,r=t,o=new Array(e*t),i={setPixel:function(e,t,r){o[t*n+e]=r},write:function(e){e.writeString("GIF87a"),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);var t=a(2);e.writeByte(2);for(var o=0;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(";")}},a=function(e){for(var t=1<<e,n=1+(1<<e),r=e+1,i=s(),a=0;a<t;a+=1)i.add(String.fromCharCode(a));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(n));var c,u,l,d=g(),f=(c=d,u=0,l=0,{write:function(e,t){if(e>>>t!=0)throw"length over";for(;u+t>=8;)c.writeByte(255&(e<<u|l)),t-=8-u,e>>>=8-u,l=0,u=0;l|=e<<u,u+=t},flush:function(){u>0&&c.writeByte(l)}});f.write(t,r);var h=0,p=String.fromCharCode(o[h]);for(h+=1;h<o.length;){var v=String.fromCharCode(o[h]);h+=1,i.contains(p+v)?p+=v:(f.write(i.indexOf(p),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(p+v)),p=v)}return f.write(i.indexOf(p),r),f.write(n,r),f.flush(),d.toByteArray()},s=function(){var e={},t=0,n={add:function(r){if(n.contains(r))throw"dup key:"+r;e[r]=t,t+=1},size:function(){return t},indexOf:function(t){return e[t]},contains:function(t){return void 0!==e[t]}};return n};return i}(e,t),o=0;o<t;o+=1)for(var i=0;i<e;i+=1)r.setPixel(i,o,n(i,o));var a=g();r.write(a);for(var s=function(){var e=0,t=0,n=0,r="",o={},i=function(e){r+=String.fromCharCode(a(63&e))},a=function(e){if(e<0);else{if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47}throw"n:"+e};return o.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0)for(var o=3-n%3,a=0;a<o;a+=1)r+="="},o.toString=function(){return r},o}(),c=a.toByteArray(),u=0;u<c.length;u+=1)s.writeByte(c[u]);return s.flush(),"data:image/gif;base64,"+s};return e}();o.stringToBytesFuncs["UTF-8"]=function(e){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},void 0===(r="function"==typeof(n=function(){return o})?n.apply(t,[]):n)||(e.exports=r)},676:function(e,t,n){"use strict";n.d(t,{default:function(){return N}});var r="Numeric",o="Alphanumeric",i="Byte",a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},s=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r},c=function(e){return!!e&&"object"==typeof e&&!Array.isArray(e)};function u(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!t.length)return e;var r=t.shift();return void 0!==r&&c(e)&&c(r)?(e=a({},e),Object.keys(r).forEach((function(t){var n=e[t],o=r[t];Array.isArray(n)&&Array.isArray(o)?e[t]=o:c(n)&&c(o)?e[t]=u(Object.assign({},n),o):e[t]=o})),u.apply(void 0,s([e],t))):e}function l(e,t){var n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var d=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},f=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function h(e){return d(this,void 0,void 0,(function(){return f(this,(function(t){return[2,new Promise((function(t){var n=new XMLHttpRequest;n.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n.response)},n.open("GET",e),n.responseType="blob",n.send()}))]}))}))}for(var p={L:.07,M:.15,Q:.25,H:.3},v=function(){return v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)},g=function(){function e(e){var t=e.svg,n=e.type;this._svg=t,this._type=n}return e.prototype.draw=function(e,t,n,r){var o;switch(this._type){case"dots":o=this._drawDot;break;case"classy":o=this._drawClassy;break;case"classy-rounded":o=this._drawClassyRounded;break;case"rounded":o=this._drawRounded;break;case"extra-rounded":o=this._drawExtraRounded;break;default:o=this._drawSquare}o.call(this,{x:e,y:t,size:n,getNeighbor:r})},e.prototype._rotateFigure=function(e){var t,n=e.x,r=e.y,o=e.size,i=e.rotation,a=void 0===i?0:i,s=n+o/2,c=r+o/2;(0,e.draw)(),null===(t=this._element)||void 0===t||t.setAttribute("transform","rotate("+180*a/Math.PI+","+s+","+c+")")},e.prototype._basicDot=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(v(v({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","circle"),t._element.setAttribute("cx",String(r+n/2)),t._element.setAttribute("cy",String(o+n/2)),t._element.setAttribute("r",String(n/2))}}))},e.prototype._basicSquare=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(v(v({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","rect"),t._element.setAttribute("x",String(r)),t._element.setAttribute("y",String(o)),t._element.setAttribute("width",String(n)),t._element.setAttribute("height",String(n))}}))},e.prototype._basicSideRounded=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(v(v({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("d","M "+r+" "+o+"v "+n+"h "+n/2+"a "+n/2+" "+n/2+", 0, 0, 0, 0 "+-n)}}))},e.prototype._basicCornerRounded=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(v(v({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("d","M "+r+" "+o+"v "+n+"h "+n+"v "+-n/2+"a "+n/2+" "+n/2+", 0, 0, 0, "+-n/2+" "+-n/2)}}))},e.prototype._basicCornerExtraRounded=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(v(v({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("d","M "+r+" "+o+"v "+n+"h "+n+"a "+n+" "+n+", 0, 0, 0, "+-n+" "+-n)}}))},e.prototype._basicCornersRounded=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(v(v({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("d","M "+r+" "+o+"v "+n/2+"a "+n/2+" "+n/2+", 0, 0, 0, "+n/2+" "+n/2+"h "+n/2+"v "+-n/2+"a "+n/2+" "+n/2+", 0, 0, 0, "+-n/2+" "+-n/2)}}))},e.prototype._drawDot=function(e){var t=e.x,n=e.y,r=e.size;this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawSquare=function(e){var t=e.x,n=e.y,r=e.size;this._basicSquare({x:t,y:n,size:r,rotation:0})},e.prototype._drawRounded=function(e){var t=e.x,n=e.y,r=e.size,o=e.getNeighbor,i=o?+o(-1,0):0,a=o?+o(1,0):0,s=o?+o(0,-1):0,c=o?+o(0,1):0,u=i+a+s+c;if(0!==u)if(u>2||i&&a||s&&c)this._basicSquare({x:t,y:n,size:r,rotation:0});else{if(2===u){var l=0;return i&&s?l=Math.PI/2:s&&a?l=Math.PI:a&&c&&(l=-Math.PI/2),void this._basicCornerRounded({x:t,y:n,size:r,rotation:l})}if(1===u)return l=0,s?l=Math.PI/2:a?l=Math.PI:c&&(l=-Math.PI/2),void this._basicSideRounded({x:t,y:n,size:r,rotation:l})}else this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawExtraRounded=function(e){var t=e.x,n=e.y,r=e.size,o=e.getNeighbor,i=o?+o(-1,0):0,a=o?+o(1,0):0,s=o?+o(0,-1):0,c=o?+o(0,1):0,u=i+a+s+c;if(0!==u)if(u>2||i&&a||s&&c)this._basicSquare({x:t,y:n,size:r,rotation:0});else{if(2===u){var l=0;return i&&s?l=Math.PI/2:s&&a?l=Math.PI:a&&c&&(l=-Math.PI/2),void this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:l})}if(1===u)return l=0,s?l=Math.PI/2:a?l=Math.PI:c&&(l=-Math.PI/2),void this._basicSideRounded({x:t,y:n,size:r,rotation:l})}else this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawClassy=function(e){var t=e.x,n=e.y,r=e.size,o=e.getNeighbor,i=o?+o(-1,0):0,a=o?+o(1,0):0,s=o?+o(0,-1):0,c=o?+o(0,1):0;0!==i+a+s+c?i||s?a||c?this._basicSquare({x:t,y:n,size:r,rotation:0}):this._basicCornerRounded({x:t,y:n,size:r,rotation:Math.PI/2}):this._basicCornerRounded({x:t,y:n,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:n,size:r,rotation:Math.PI/2})},e.prototype._drawClassyRounded=function(e){var t=e.x,n=e.y,r=e.size,o=e.getNeighbor,i=o?+o(-1,0):0,a=o?+o(1,0):0,s=o?+o(0,-1):0,c=o?+o(0,1):0;0!==i+a+s+c?i||s?a||c?this._basicSquare({x:t,y:n,size:r,rotation:0}):this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:n,size:r,rotation:Math.PI/2})},e}(),w=g,m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},m.apply(this,arguments)},b=function(){function e(e){var t=e.svg,n=e.type;this._svg=t,this._type=n}return e.prototype.draw=function(e,t,n,r){var o;switch(this._type){case"square":o=this._drawSquare;break;case"extra-rounded":o=this._drawExtraRounded;break;default:o=this._drawDot}o.call(this,{x:e,y:t,size:n,rotation:r})},e.prototype._rotateFigure=function(e){var t,n=e.x,r=e.y,o=e.size,i=e.rotation,a=void 0===i?0:i,s=n+o/2,c=r+o/2;(0,e.draw)(),null===(t=this._element)||void 0===t||t.setAttribute("transform","rotate("+180*a/Math.PI+","+s+","+c+")")},e.prototype._basicDot=function(e){var t=this,n=e.size,r=e.x,o=e.y,i=n/7;this._rotateFigure(m(m({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("clip-rule","evenodd"),t._element.setAttribute("d","M "+(r+n/2)+" "+o+"a "+n/2+" "+n/2+" 0 1 0 0.1 0zm 0 "+i+"a "+(n/2-i)+" "+(n/2-i)+" 0 1 1 -0.1 0Z")}}))},e.prototype._basicSquare=function(e){var t=this,n=e.size,r=e.x,o=e.y,i=n/7;this._rotateFigure(m(m({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("clip-rule","evenodd"),t._element.setAttribute("d","M "+r+" "+o+"v "+n+"h "+n+"v "+-n+"zM "+(r+i)+" "+(o+i)+"h "+(n-2*i)+"v "+(n-2*i)+"h "+(2*i-n)+"z")}}))},e.prototype._basicExtraRounded=function(e){var t=this,n=e.size,r=e.x,o=e.y,i=n/7;this._rotateFigure(m(m({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","path"),t._element.setAttribute("clip-rule","evenodd"),t._element.setAttribute("d","M "+r+" "+(o+2.5*i)+"v "+2*i+"a "+2.5*i+" "+2.5*i+", 0, 0, 0, "+2.5*i+" "+2.5*i+"h "+2*i+"a "+2.5*i+" "+2.5*i+", 0, 0, 0, "+2.5*i+" "+2.5*-i+"v "+-2*i+"a "+2.5*i+" "+2.5*i+", 0, 0, 0, "+2.5*-i+" "+2.5*-i+"h "+-2*i+"a "+2.5*i+" "+2.5*i+", 0, 0, 0, "+2.5*-i+" "+2.5*i+"M "+(r+2.5*i)+" "+(o+i)+"h "+2*i+"a "+1.5*i+" "+1.5*i+", 0, 0, 1, "+1.5*i+" "+1.5*i+"v "+2*i+"a "+1.5*i+" "+1.5*i+", 0, 0, 1, "+1.5*-i+" "+1.5*i+"h "+-2*i+"a "+1.5*i+" "+1.5*i+", 0, 0, 1, "+1.5*-i+" "+1.5*-i+"v "+-2*i+"a "+1.5*i+" "+1.5*i+", 0, 0, 1, "+1.5*i+" "+1.5*-i)}}))},e.prototype._drawDot=function(e){var t=e.x,n=e.y,r=e.size,o=e.rotation;this._basicDot({x:t,y:n,size:r,rotation:o})},e.prototype._drawSquare=function(e){var t=e.x,n=e.y,r=e.size,o=e.rotation;this._basicSquare({x:t,y:n,size:r,rotation:o})},e.prototype._drawExtraRounded=function(e){var t=e.x,n=e.y,r=e.size,o=e.rotation;this._basicExtraRounded({x:t,y:n,size:r,rotation:o})},e}(),y=b,x=function(){return x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},x.apply(this,arguments)},_=function(){function e(e){var t=e.svg,n=e.type;this._svg=t,this._type=n}return e.prototype.draw=function(e,t,n,r){("square"===this._type?this._drawSquare:this._drawDot).call(this,{x:e,y:t,size:n,rotation:r})},e.prototype._rotateFigure=function(e){var t,n=e.x,r=e.y,o=e.size,i=e.rotation,a=void 0===i?0:i,s=n+o/2,c=r+o/2;(0,e.draw)(),null===(t=this._element)||void 0===t||t.setAttribute("transform","rotate("+180*a/Math.PI+","+s+","+c+")")},e.prototype._basicDot=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(x(x({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","circle"),t._element.setAttribute("cx",String(r+n/2)),t._element.setAttribute("cy",String(o+n/2)),t._element.setAttribute("r",String(n/2))}}))},e.prototype._basicSquare=function(e){var t=this,n=e.size,r=e.x,o=e.y;this._rotateFigure(x(x({},e),{draw:function(){t._element=document.createElementNS("http://www.w3.org/2000/svg","rect"),t._element.setAttribute("x",String(r)),t._element.setAttribute("y",String(o)),t._element.setAttribute("width",String(n)),t._element.setAttribute("height",String(n))}}))},e.prototype._drawDot=function(e){var t=e.x,n=e.y,r=e.size,o=e.rotation;this._basicDot({x:t,y:n,size:r,rotation:o})},e.prototype._drawSquare=function(e){var t=e.x,n=e.y,r=e.size,o=e.rotation;this._basicSquare({x:t,y:n,size:r,rotation:o})},e}(),k=_,C="circle",S=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},j=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Z=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],P=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]],O=function(){function e(t){this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(t.width)),this._element.setAttribute("height",String(t.height)),this._defs=document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._instanceId=e.instanceCount++,this._options=t}return Object.defineProperty(e.prototype,"width",{get:function(){return this._options.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._options.height},enumerable:!1,configurable:!0}),e.prototype.getElement=function(){return this._element},e.prototype.drawQR=function(e){return S(this,void 0,void 0,(function(){var t,n,r,o,i,a,s,c,u,l,d=this;return j(this,(function(f){switch(f.label){case 0:return t=e.getModuleCount(),n=Math.min(this._options.width,this._options.height)-2*this._options.margin,r=this._options.shape===C?n/Math.sqrt(2):n,o=r/t,i={hideXDots:0,hideYDots:0,width:0,height:0},this._qr=e,this._options.image?[4,this.loadImage()]:[3,2];case 1:if(f.sent(),!this._image)return[2];a=this._options,s=a.imageOptions,c=a.qrOptions,u=s.imageSize*p[c.errorCorrectionLevel],l=Math.floor(u*t*t),i=function(e){var t=e.originalHeight,n=e.originalWidth,r=e.maxHiddenDots,o=e.maxHiddenAxisDots,i=e.dotSize,a={x:0,y:0},s={x:0,y:0};if(t<=0||n<=0||r<=0||i<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};var c=t/n;return a.x=Math.floor(Math.sqrt(r/c)),a.x<=0&&(a.x=1),o&&o<a.x&&(a.x=o),a.x%2==0&&a.x--,s.x=a.x*i,a.y=1+2*Math.ceil((a.x*c-1)/2),s.y=Math.round(s.x*c),(a.y*a.x>r||o&&o<a.y)&&(o&&o<a.y?(a.y=o,a.y%2==0&&a.x--):a.y-=2,s.y=a.y*i,a.x=1+2*Math.ceil((a.y/c-1)/2),s.x=Math.round(s.y/c)),{height:s.y,width:s.x,hideYDots:a.y,hideXDots:a.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:l,maxHiddenAxisDots:t-14,dotSize:o}),f.label=2;case 2:return this.drawBackground(),this.drawDots((function(e,n){var r,o,a,s,c,u;return!(d._options.imageOptions.hideBackgroundDots&&e>=(t-i.hideXDots)/2&&e<(t+i.hideXDots)/2&&n>=(t-i.hideYDots)/2&&n<(t+i.hideYDots)/2||(null===(r=Z[e])||void 0===r?void 0:r[n])||(null===(o=Z[e-t+7])||void 0===o?void 0:o[n])||(null===(a=Z[e])||void 0===a?void 0:a[n-t+7])||(null===(s=P[e])||void 0===s?void 0:s[n])||(null===(c=P[e-t+7])||void 0===c?void 0:c[n])||(null===(u=P[e])||void 0===u?void 0:u[n-t+7]))})),this.drawCorners(),this._options.image?[4,this.drawImage({width:i.width,height:i.height,count:t,dotSize:o})]:[3,4];case 3:f.sent(),f.label=4;case 4:return[2]}}))}))},e.prototype.drawBackground=function(){var e,t,n,r=this._element,o=this._options;if(r){var i=null===(e=o.backgroundOptions)||void 0===e?void 0:e.gradient,a=null===(t=o.backgroundOptions)||void 0===t?void 0:t.color;if((i||a)&&this._createColor({options:i,color:a,additionalRotation:0,x:0,y:0,height:o.height,width:o.width,name:"background-color"}),null===(n=o.backgroundOptions)||void 0===n?void 0:n.round){var s=Math.min(o.width,o.height),c=document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id","clip-path-background-color"),this._defs.appendChild(this._backgroundClipPath),c.setAttribute("x",String((o.width-s)/2)),c.setAttribute("y",String((o.height-s)/2)),c.setAttribute("width",String(s)),c.setAttribute("height",String(s)),c.setAttribute("rx",String(s/2*o.backgroundOptions.round)),this._backgroundClipPath.appendChild(c)}}},e.prototype.drawDots=function(e){var t,n,r=this;if(!this._qr)throw"QR code is not defined";var o=this._options,i=this._qr.getModuleCount();if(i>o.width||i>o.height)throw"The canvas is too small.";var a=Math.min(o.width,o.height)-2*o.margin,s=(o.shape===C?a/Math.sqrt(2):a)/i,c=(o.width-i*s)/2,u=(o.height-i*s)/2,l=new w({svg:this._element,type:o.dotsOptions.type});this._dotsClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id","clip-path-dot-color-"+this._instanceId),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(t=o.dotsOptions)||void 0===t?void 0:t.gradient,color:o.dotsOptions.color,additionalRotation:0,x:0,y:0,height:o.height,width:o.width,name:"dot-color-"+this._instanceId});for(var d=function(t){for(var o=function(o){return e&&!e(t,o)?"continue":(null===(n=f._qr)||void 0===n?void 0:n.isDark(t,o))?(l.draw(c+t*s,u+o*s,s,(function(n,a){return!(t+n<0||o+a<0||t+n>=i||o+a>=i)&&!(e&&!e(t+n,o+a))&&!!r._qr&&r._qr.isDark(t+n,o+a)})),void(l._element&&f._dotsClipPath&&f._dotsClipPath.appendChild(l._element))):"continue"},a=0;a<i;a++)o(a)},f=this,h=0;h<i;h++)d(h);if(o.shape===C){var p=Math.floor((a/s-i)/2),v=i+2*p,g=c-p*s,m=u-p*s,b=[],y=Math.floor(v/2);for(h=0;h<v;h++){b[h]=[];for(var x=0;x<v;x++)h>=p-1&&h<=v-p&&x>=p-1&&x<=v-p||Math.sqrt((h-y)*(h-y)+(x-y)*(x-y))>y?b[h][x]=0:b[h][x]=this._qr.isDark(x-2*p<0?x:x>=i?x-2*p:x-p,h-2*p<0?h:h>=i?h-2*p:h-p)?1:0}var _=function(e){for(var t=function(t){if(!b[e][t])return"continue";l.draw(g+e*s,m+t*s,s,(function(n,r){var o;return!!(null===(o=b[e+n])||void 0===o?void 0:o[t+r])})),l._element&&k._dotsClipPath&&k._dotsClipPath.appendChild(l._element)},n=0;n<v;n++)t(n)},k=this;for(h=0;h<v;h++)_(h)}},e.prototype.drawCorners=function(){var e=this;if(!this._qr)throw"QR code is not defined";var t=this._element,n=this._options;if(!t)throw"Element code is not defined";var r=this._qr.getModuleCount(),o=Math.min(n.width,n.height)-2*n.margin,i=(n.shape===C?o/Math.sqrt(2):o)/r,a=7*i,s=3*i,c=(n.width-r*i)/2,u=(n.height-r*i)/2;[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach((function(t){var o,l,d,f,h,p,v,g,m,b,x,_,C=t[0],S=t[1],j=t[2],O=c+C*i*(r-7),A=u+S*i*(r-7),M=e._dotsClipPath,z=e._dotsClipPath;if(((null===(o=n.cornersSquareOptions)||void 0===o?void 0:o.gradient)||(null===(l=n.cornersSquareOptions)||void 0===l?void 0:l.color))&&((M=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-corners-square-color-"+C+"-"+S),e._defs.appendChild(M),e._cornersSquareClipPath=e._cornersDotClipPath=z=M,e._createColor({options:null===(d=n.cornersSquareOptions)||void 0===d?void 0:d.gradient,color:null===(f=n.cornersSquareOptions)||void 0===f?void 0:f.color,additionalRotation:j,x:O,y:A,height:a,width:a,name:"corners-square-color-"+C+"-"+S})),null===(h=n.cornersSquareOptions)||void 0===h?void 0:h.type){var D=new y({svg:e._element,type:n.cornersSquareOptions.type});D.draw(O,A,a,j),D._element&&M&&M.appendChild(D._element)}else for(var R=new w({svg:e._element,type:n.dotsOptions.type}),E=function(e){for(var t=function(t){if(!(null===(p=Z[e])||void 0===p?void 0:p[t]))return"continue";R.draw(O+e*i,A+t*i,i,(function(n,r){var o;return!!(null===(o=Z[e+n])||void 0===o?void 0:o[t+r])})),R._element&&M&&M.appendChild(R._element)},n=0;n<Z[e].length;n++)t(n)},L=0;L<Z.length;L++)E(L);if(((null===(v=n.cornersDotOptions)||void 0===v?void 0:v.gradient)||(null===(g=n.cornersDotOptions)||void 0===g?void 0:g.color))&&((z=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-corners-dot-color-"+C+"-"+S),e._defs.appendChild(z),e._cornersDotClipPath=z,e._createColor({options:null===(m=n.cornersDotOptions)||void 0===m?void 0:m.gradient,color:null===(b=n.cornersDotOptions)||void 0===b?void 0:b.color,additionalRotation:j,x:O+2*i,y:A+2*i,height:s,width:s,name:"corners-dot-color-"+C+"-"+S})),null===(x=n.cornersDotOptions)||void 0===x?void 0:x.type){var I=new k({svg:e._element,type:n.cornersDotOptions.type});I.draw(O+2*i,A+2*i,s,j),I._element&&z&&z.appendChild(I._element)}else{R=new w({svg:e._element,type:n.dotsOptions.type});var q=function(e){for(var t=function(t){if(!(null===(_=P[e])||void 0===_?void 0:_[t]))return"continue";R.draw(O+e*i,A+t*i,i,(function(n,r){var o;return!!(null===(o=P[e+n])||void 0===o?void 0:o[t+r])})),R._element&&z&&z.appendChild(R._element)},n=0;n<P[e].length;n++)t(n)};for(L=0;L<P.length;L++)q(L)}}))},e.prototype.loadImage=function(){var e=this;return new Promise((function(t,n){var r=e._options,o=new Image;if(!r.image)return n("Image is not defined");"string"==typeof r.imageOptions.crossOrigin&&(o.crossOrigin=r.imageOptions.crossOrigin),e._image=o,o.onload=function(){t()},o.src=r.image}))},e.prototype.drawImage=function(e){var t=e.width,n=e.height,r=e.count,o=e.dotSize;return S(this,void 0,void 0,(function(){var e,i,a,s,c,u,l,d,f;return j(this,(function(p){switch(p.label){case 0:return e=this._options,i=(e.width-r*o)/2,a=(e.height-r*o)/2,s=i+e.imageOptions.margin+(r*o-t)/2,c=a+e.imageOptions.margin+(r*o-n)/2,u=t-2*e.imageOptions.margin,l=n-2*e.imageOptions.margin,(d=document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("x",String(s)),d.setAttribute("y",String(c)),d.setAttribute("width",u+"px"),d.setAttribute("height",l+"px"),[4,h(e.image||"")];case 1:return f=p.sent(),d.setAttribute("href",f||""),this._element.appendChild(d),[2]}}))}))},e.prototype._createColor=function(e){var t=e.options,n=e.color,r=e.additionalRotation,o=e.x,i=e.y,a=e.height,s=e.width,c=e.name,u=s>a?s:a,l=document.createElementNS("http://www.w3.org/2000/svg","rect");if(l.setAttribute("x",String(o)),l.setAttribute("y",String(i)),l.setAttribute("height",String(a)),l.setAttribute("width",String(s)),l.setAttribute("clip-path","url('#clip-path-"+c+"')"),t){var d;if("radial"===t.type)(d=document.createElementNS("http://www.w3.org/2000/svg","radialGradient")).setAttribute("id",c),d.setAttribute("gradientUnits","userSpaceOnUse"),d.setAttribute("fx",String(o+s/2)),d.setAttribute("fy",String(i+a/2)),d.setAttribute("cx",String(o+s/2)),d.setAttribute("cy",String(i+a/2)),d.setAttribute("r",String(u/2));else{var f=((t.rotation||0)+r)%(2*Math.PI),h=(f+2*Math.PI)%(2*Math.PI),p=o+s/2,v=i+a/2,g=o+s/2,w=i+a/2;h>=0&&h<=.25*Math.PI||h>1.75*Math.PI&&h<=2*Math.PI?(p-=s/2,v-=a/2*Math.tan(f),g+=s/2,w+=a/2*Math.tan(f)):h>.25*Math.PI&&h<=.75*Math.PI?(v-=a/2,p-=s/2/Math.tan(f),w+=a/2,g+=s/2/Math.tan(f)):h>.75*Math.PI&&h<=1.25*Math.PI?(p+=s/2,v+=a/2*Math.tan(f),g-=s/2,w-=a/2*Math.tan(f)):h>1.25*Math.PI&&h<=1.75*Math.PI&&(v+=a/2,p+=s/2/Math.tan(f),w-=a/2,g-=s/2/Math.tan(f)),(d=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",c),d.setAttribute("gradientUnits","userSpaceOnUse"),d.setAttribute("x1",String(Math.round(p))),d.setAttribute("y1",String(Math.round(v))),d.setAttribute("x2",String(Math.round(g))),d.setAttribute("y2",String(Math.round(w)))}t.colorStops.forEach((function(e){var t=e.offset,n=e.color,r=document.createElementNS("http://www.w3.org/2000/svg","stop");r.setAttribute("offset",100*t+"%"),r.setAttribute("stop-color",n),d.appendChild(r)})),l.setAttribute("fill","url('#"+c+"')"),this._defs.appendChild(d)}else n&&l.setAttribute("fill",n);this._element.appendChild(l)},e.instanceCount=0,e}(),A="canvas",M={},z=0;z<=40;z++)M[z]=z;var D={type:A,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:M[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000"},backgroundOptions:{round:0,color:"#fff"}},R=function(){return R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},R.apply(this,arguments)};function E(e){var t=R({},e);if(!t.colorStops||!t.colorStops.length)throw"Field 'colorStops' is required in gradient";return t.rotation?t.rotation=Number(t.rotation):t.rotation=0,t.colorStops=t.colorStops.map((function(e){return R(R({},e),{offset:Number(e.offset)})})),t}function L(e){var t=R({},e);return t.width=Number(t.width),t.height=Number(t.height),t.margin=Number(t.margin),t.imageOptions=R(R({},t.imageOptions),{hideBackgroundDots:Boolean(t.imageOptions.hideBackgroundDots),imageSize:Number(t.imageOptions.imageSize),margin:Number(t.imageOptions.margin)}),t.margin>Math.min(t.width,t.height)&&(t.margin=Math.min(t.width,t.height)),t.dotsOptions=R({},t.dotsOptions),t.dotsOptions.gradient&&(t.dotsOptions.gradient=E(t.dotsOptions.gradient)),t.cornersSquareOptions&&(t.cornersSquareOptions=R({},t.cornersSquareOptions),t.cornersSquareOptions.gradient&&(t.cornersSquareOptions.gradient=E(t.cornersSquareOptions.gradient))),t.cornersDotOptions&&(t.cornersDotOptions=R({},t.cornersDotOptions),t.cornersDotOptions.gradient&&(t.cornersDotOptions.gradient=E(t.cornersDotOptions.gradient))),t.backgroundOptions&&(t.backgroundOptions=R({},t.backgroundOptions),t.backgroundOptions.gradient&&(t.backgroundOptions.gradient=E(t.backgroundOptions.gradient))),t}var I=n(192),q=n.n(I),B=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},W=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},N=function(){function e(e){this._options=e?L(u(D,e)):D,this.update()}return e._clearContainer=function(e){e&&(e.innerHTML="")},e.prototype._setupSvg=function(){var e=this;if(this._qr){var t=new O(this._options);this._svg=t.getElement(),this._svgDrawingPromise=t.drawQR(this._qr).then((function(){var n;e._svg&&(null===(n=e._extension)||void 0===n||n.call(e,t.getElement(),e._options))}))}},e.prototype._setupCanvas=function(){var e,t=this;this._qr&&(this._canvas=document.createElement("canvas"),this._canvas.width=this._options.width,this._canvas.height=this._options.height,this._setupSvg(),this._canvasDrawingPromise=null===(e=this._svgDrawingPromise)||void 0===e?void 0:e.then((function(){if(t._svg){var e=t._svg,n=(new XMLSerializer).serializeToString(e),r="data:image/svg+xml;base64,"+btoa(n),o=new Image;return new Promise((function(e){o.onload=function(){var n,r;null===(r=null===(n=t._canvas)||void 0===n?void 0:n.getContext("2d"))||void 0===r||r.drawImage(o,0,0),e()},o.src=r}))}})))},e.prototype._getElement=function(e){return void 0===e&&(e="png"),B(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:if(!this._qr)throw"QR code is empty";return"svg"!==e.toLowerCase()?[3,2]:(this._svg&&this._svgDrawingPromise||this._setupSvg(),[4,this._svgDrawingPromise]);case 1:return t.sent(),[2,this._svg];case 2:return this._canvas&&this._canvasDrawingPromise||this._setupCanvas(),[4,this._canvasDrawingPromise];case 3:return t.sent(),[2,this._canvas]}}))}))},e.prototype.update=function(t){e._clearContainer(this._container),this._options=t?L(u(this._options,t)):this._options,this._options.data&&(this._qr=q()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(e){switch(!0){case/^[0-9]*$/.test(e):return r;case/^[0-9A-Z $%*+\-./:]*$/.test(e):return o;default:return i}}(this._options.data)),this._qr.make(),this._options.type===A?this._setupCanvas():this._setupSvg(),this.append(this._container))},e.prototype.append=function(e){if(e){if("function"!=typeof e.appendChild)throw"Container should be a single DOM node";this._options.type===A?this._canvas&&e.appendChild(this._canvas):this._svg&&e.appendChild(this._svg),this._container=e}},e.prototype.applyExtension=function(e){if(!e)throw"Extension function should be defined.";this._extension=e,this.update()},e.prototype.deleteExtension=function(){this._extension=void 0,this.update()},e.prototype.getRawData=function(e){return void 0===e&&(e="png"),B(this,void 0,void 0,(function(){var t,n,r;return W(this,(function(o){switch(o.label){case 0:if(!this._qr)throw"QR code is empty";return[4,this._getElement(e)];case 1:return(t=o.sent())?"svg"===e.toLowerCase()?(n=new XMLSerializer,r=n.serializeToString(t),[2,new Blob(['<?xml version="1.0" standalone="no"?>\r\n'+r],{type:"image/svg+xml"})]):[2,new Promise((function(n){return t.toBlob(n,"image/"+e,1)}))]:[2,null]}}))}))},e.prototype.download=function(e){return B(this,void 0,void 0,(function(){var t,n,r,o,i;return W(this,(function(a){switch(a.label){case 0:if(!this._qr)throw"QR code is empty";return t="png",n="qr","string"==typeof e?(t=e,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof e&&null!==e&&(e.name&&(n=e.name),e.extension&&(t=e.extension)),[4,this._getElement(t)];case 1:return(r=a.sent())?("svg"===t.toLowerCase()?(o=new XMLSerializer,i='<?xml version="1.0" standalone="no"?>\r\n'+(i=o.serializeToString(r)),l("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i),n+".svg")):l(r.toDataURL("image/"+t),n+"."+t),[2]):[2]}}))}))},e}()}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(676)}().default},57982:function(e,t,n){"use strict";var r=n(11681),o=n(30969),i=n(32681);t.Z=function(e,t){(0,o.useEffect)((function(){var t=e(),n=!1;return function(){(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){switch(e.label){case 0:if(r=t,!(0,i.mf)(r[Symbol.asyncIterator]))return[3,4];e.label=1;case 1:return[4,t.next()];case 2:return e.sent().done||n?[3,3]:[3,1];case 3:return[3,6];case 4:return[4,t];case 5:e.sent(),e.label=6;case 6:return[2]}var r}))}))}(),function(){n=!0}}),t)}},30993:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return b}});var r=/iPhone/i,o=/iPod/i,i=/iPad/i,a=/\biOS-universal(?:.+)Mac\b/i,s=/\bAndroid(?:.+)Mobile\b/i,c=/Android/i,u=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,l=/Silk/i,d=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,h=/BlackBerry/i,p=/BB10/i,v=/Opera Mini/i,g=/\b(CriOS|Chrome)(?:.+)Mobile/i,w=/Mobile(?:.+)Firefox\b/i,m=function(e){return"undefined"!==typeof e&&"MacIntel"===e.platform&&"number"===typeof e.maxTouchPoints&&e.maxTouchPoints>1&&"undefined"===typeof MSStream};function b(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"===typeof navigator?"string"===typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=t.userAgent,b=n.split("[FBAN");"undefined"!==typeof b[1]&&(n=b[0]),"undefined"!==typeof(b=n.split("Twitter"))[1]&&(n=b[0]);var y=function(e){return function(t){return t.test(e)}}(n),x={apple:{phone:y(r)&&!y(d),ipod:y(o),tablet:!y(r)&&(y(i)||m(t))&&!y(d),universal:y(a),device:(y(r)||y(o)||y(i)||y(a)||m(t))&&!y(d)},amazon:{phone:y(u),tablet:!y(u)&&y(l),device:y(u)||y(l)},android:{phone:!y(d)&&y(u)||!y(d)&&y(s),tablet:!y(d)&&!y(u)&&!y(s)&&(y(l)||y(c)),device:!y(d)&&(y(u)||y(l)||y(s)||y(c))||y(/\bokhttp\b/i)},windows:{phone:y(d),tablet:y(f),device:y(d)||y(f)},other:{blackberry:y(h),blackberry10:y(p),opera:y(v),firefox:y(w),chrome:y(g),device:y(h)||y(p)||y(v)||y(w)||y(g)},any:!1,phone:!1,tablet:!1};return x.any=x.apple.device||x.android.device||x.windows.device||x.other.device,x.phone=x.apple.phone||x.android.phone||x.windows.phone,x.tablet=x.apple.tablet||x.android.tablet||x.windows.tablet,x}},87270:function(e){e.exports=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},70306:function(e,t,n){var r=n(48311),o=n(87270),i=n(35483);e.exports=function(e,t){return i(e,o(r(t)))}},35483:function(e,t,n){var r=n(26306),o=n(48311),i=n(45994),a=n(60699);e.exports=function(e,t){if(null==e)return{};var n=r(a(e),(function(e){return[e]}));return t=o(t),i(e,n,(function(e,n){return t(e,n[0])}))}},87138:function(e,t,n){"use strict";var r;t.Z=void 0;var o=(0,((r=n(24693))&&r.__esModule?r:{default:r}).default)("M15.9,18.45C17.25,18.45 18.35,17.35 18.35,16C18.35,14.65 17.25,13.55 15.9,13.55C14.54,13.55 13.45,14.65 13.45,16C13.45,17.35 14.54,18.45 15.9,18.45M21.1,16.68L22.58,17.84C22.71,17.95 22.75,18.13 22.66,18.29L21.26,20.71C21.17,20.86 21,20.92 20.83,20.86L19.09,20.16C18.73,20.44 18.33,20.67 17.91,20.85L17.64,22.7C17.62,22.87 17.47,23 17.3,23H14.5C14.32,23 14.18,22.87 14.15,22.7L13.89,20.85C13.46,20.67 13.07,20.44 12.71,20.16L10.96,20.86C10.81,20.92 10.62,20.86 10.54,20.71L9.14,18.29C9.05,18.13 9.09,17.95 9.22,17.84L10.7,16.68L10.65,16L10.7,15.31L9.22,14.16C9.09,14.05 9.05,13.86 9.14,13.71L10.54,11.29C10.62,11.13 10.81,11.07 10.96,11.13L12.71,11.84C13.07,11.56 13.46,11.32 13.89,11.15L14.15,9.29C14.18,9.13 14.32,9 14.5,9H17.3C17.47,9 17.62,9.13 17.64,9.29L17.91,11.15C18.33,11.32 18.73,11.56 19.09,11.84L20.83,11.13C21,11.07 21.17,11.13 21.26,11.29L22.66,13.71C22.75,13.86 22.71,14.05 22.58,14.16L21.1,15.31L21.15,16L21.1,16.68M6.69,8.07C7.56,8.07 8.26,7.37 8.26,6.5C8.26,5.63 7.56,4.92 6.69,4.92A1.58,1.58 0 0,0 5.11,6.5C5.11,7.37 5.82,8.07 6.69,8.07M10.03,6.94L11,7.68C11.07,7.75 11.09,7.87 11.03,7.97L10.13,9.53C10.08,9.63 9.96,9.67 9.86,9.63L8.74,9.18L8,9.62L7.81,10.81C7.79,10.92 7.7,11 7.59,11H5.79C5.67,11 5.58,10.92 5.56,10.81L5.4,9.62L4.64,9.18L3.5,9.63C3.41,9.67 3.3,9.63 3.24,9.53L2.34,7.97C2.28,7.87 2.31,7.75 2.39,7.68L3.34,6.94L3.31,6.5L3.34,6.06L2.39,5.32C2.31,5.25 2.28,5.13 2.34,5.03L3.24,3.47C3.3,3.37 3.41,3.33 3.5,3.37L4.63,3.82L5.4,3.38L5.56,2.19C5.58,2.08 5.67,2 5.79,2H7.59C7.7,2 7.79,2.08 7.81,2.19L8,3.38L8.74,3.82L9.86,3.37C9.96,3.33 10.08,3.37 10.13,3.47L11.03,5.03C11.09,5.13 11.07,5.25 11,5.32L10.03,6.06L10.06,6.5L10.03,6.94Z","Cogs");t.Z=o},24693:function(e,t,n){"use strict";function r(e){return r="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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=i?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=e[s]}o.default=e,n&&n.set(e,o);return o}(n(30969)),i=n(85756);function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}t.default=function(e,t){return(0,i.createSvgIcon)(o.createElement("path",{d:e}),t)}},20281:function(e,t,n){"use strict";var r=n(30969),o=n(42851),i=n(46378),a=["mousemove","mousedown","resize","keydown","touchstart","wheel"];t.Z=function(e,t,n){void 0===e&&(e=6e4),void 0===t&&(t=!1),void 0===n&&(n=a);var s=r.useState(t),c=s[0],u=s[1];return r.useEffect((function(){for(var t,r=!0,a=c,s=function(e){r&&(a=e,u(e))},l=o.throttle(50,(function(){a&&s(!1),clearTimeout(t),t=setTimeout((function(){return s(!0)}),e)})),d=function(){document.hidden||l()},f=0;f<n.length;f++)i.on(window,n[f],l);return i.on(document,"visibilitychange",d),t=setTimeout((function(){return s(!0)}),e),function(){r=!1;for(var e=0;e<n.length;e++)i.off(window,n[e],l);i.off(document,"visibilitychange",d)}}),[e,n]),c}},42851:function(e,t){"use strict";function n(e,t,n,r){var o,i=!1,a=0;function s(){o&&clearTimeout(o)}function c(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];var d=this,f=Date.now()-a;function h(){a=Date.now(),n.apply(d,u)}i||(r&&!o&&h(),s(),void 0===r&&f>e?h():!0!==t&&(o=setTimeout(r?function(){o=void 0}:h,void 0===r?e-f:e)))}return"boolean"!==typeof t&&(r=n,n=t,t=void 0),c.cancel=function(){s(),i=!0},c}Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=function(e,t,r){return void 0===r?n(e,t,!1):n(e,r,!1!==t)},t.throttle=n},33665:function(e,t,n){"use strict";function r(e){if(null==e)throw new TypeError("Cannot destructure "+e)}n.d(t,{Z:function(){return r}})}}]);
2
+ //# sourceMappingURL=2836.f4b10b64.chunk.js.map