@abtnode/blocklet-services 1.16.17-beta-3232a7af → 1.16.17-beta-703fb879
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +2 -0
- package/api/libs/connect/session.js +17 -2
- package/api/libs/open-graph/emoji.js +80 -0
- package/api/libs/open-graph/index.js +14 -1
- package/api/routes/federated.js +108 -2
- package/api/routes/oauth.js +46 -9
- package/api/routes/user-session.js +165 -0
- package/api/routes/user.js +21 -0
- package/api/services/auth/connect/login.js +13 -2
- package/api/services/auth/index.js +17 -8
- package/api/services/image/index.js +5 -0
- package/api/util/index.js +8 -1
- package/api/util/user-session.js +47 -0
- package/build/asset-manifest.json +79 -75
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/service-worker.js.map +1 -1
- package/build/static/css/{5982.ac464505.chunk.css → 8702.3ffd8486.chunk.css} +1 -1
- package/build/static/js/1148.e5dc907a.chunk.js +2 -0
- package/build/static/js/{6711.fa6dfc37.chunk.js → 1359.add26d23.chunk.js} +2 -2
- package/build/static/js/{2093.e2fce549.chunk.js → 2093.3192d241.chunk.js} +3 -3
- package/build/static/js/{2653.1307684f.chunk.js → 2653.6a6c1c6c.chunk.js} +2 -2
- package/build/static/js/2972.2d5268c3.chunk.js +2 -0
- package/build/static/js/3025.e2b1dac4.chunk.js +2 -0
- package/build/static/js/{9409.7d4a802c.chunk.js → 3033.1bbcc14e.chunk.js} +2 -2
- package/build/static/js/{1462.a4d2a902.chunk.js → 3131.f75fa792.chunk.js} +2 -2
- package/build/static/js/{3688.6edc63ba.chunk.js → 3688.2cea0226.chunk.js} +2 -2
- package/build/static/js/{4023.8cfc3ec6.chunk.js → 4023.a79b0858.chunk.js} +2 -2
- package/build/static/js/4076.e73cb63a.chunk.js +2 -0
- package/build/static/js/{6737.53cccea9.chunk.js → 4587.5b31e02e.chunk.js} +2 -2
- package/build/static/js/4716.1ecc2bb6.chunk.js +2 -0
- package/build/static/js/{4802.b2e38d47.chunk.js → 4802.d185b9f1.chunk.js} +2 -2
- package/build/static/js/5012.551dbbc3.chunk.js +2 -0
- package/build/static/js/5547.5a341867.chunk.js +3 -0
- package/build/static/js/5569.a7e151fc.chunk.js +2 -0
- package/build/static/js/{1565.f3579441.chunk.js → 5662.919cc4a2.chunk.js} +2 -2
- package/build/static/js/{9102.6dab0f45.chunk.js → 5982.d9eb7e90.chunk.js} +2 -2
- package/build/static/js/{6139.f7ca5bd6.chunk.js → 6139.cf6eb9b1.chunk.js} +2 -2
- package/build/static/js/6473.d89e783e.chunk.js +2 -0
- package/build/static/js/{8437.13d39ce4.chunk.js → 6637.b2e35031.chunk.js} +2 -2
- package/build/static/js/6658.0a27e04e.chunk.js +2 -0
- package/build/static/js/7050.3281ad5f.chunk.js +2 -0
- package/build/static/js/{716.cf9ba82c.chunk.js → 716.438b9c22.chunk.js} +3 -3
- package/build/static/js/779.99b3f0d2.chunk.js +2 -0
- package/build/static/js/7858.bac05f8f.chunk.js +2 -0
- package/build/static/js/8622.8478c900.chunk.js +2 -0
- package/build/static/js/8641.f2bb0ffc.chunk.js +2 -0
- package/build/static/js/{5982.0abe67c3.chunk.js → 8702.957f131a.chunk.js} +2 -2
- package/build/static/js/873.d6d31b32.chunk.js +3 -0
- package/build/static/js/{8792.fa2c5f5e.chunk.js → 8792.eff43237.chunk.js} +2 -2
- package/build/static/js/8944.09a1c53a.chunk.js +2 -0
- package/build/static/js/9403.b72e020c.chunk.js +2 -0
- package/build/static/js/9596.0e51cd6e.chunk.js +2 -0
- package/build/static/js/9900.b66896e6.chunk.js +2 -0
- package/build/static/js/{4682.f90d26fd.chunk.js → 9982.4f1ebb7f.chunk.js} +2 -2
- package/build/static/js/main.3cf7fedb.js +3 -0
- package/package.json +22 -22
- package/build/static/js/1480.88c590c2.chunk.js +0 -2
- package/build/static/js/1760.374a6e01.chunk.js +0 -2
- package/build/static/js/2393.528e5343.chunk.js +0 -2
- package/build/static/js/2836.f3dbcb77.chunk.js +0 -2
- package/build/static/js/3025.7dc2fe04.chunk.js +0 -2
- package/build/static/js/4164.5adbbbba.chunk.js +0 -2
- package/build/static/js/4420.05d9cb43.chunk.js +0 -2
- package/build/static/js/4716.bd8bed1b.chunk.js +0 -2
- package/build/static/js/5176.1963ce79.chunk.js +0 -2
- package/build/static/js/5547.e35129c6.chunk.js +0 -3
- package/build/static/js/6186.67c279db.chunk.js +0 -2
- package/build/static/js/6378.29466d9e.chunk.js +0 -2
- package/build/static/js/6576.02f6c898.chunk.js +0 -2
- package/build/static/js/6856.2eb98754.chunk.js +0 -2
- package/build/static/js/7226.4eca7c02.chunk.js +0 -3
- package/build/static/js/941.7757135a.chunk.js +0 -2
- package/build/static/js/9620.301493bc.chunk.js +0 -2
- package/build/static/js/9899.277d673f.chunk.js +0 -2
- package/build/static/js/main.f1e55cd8.js +0 -3
- /package/build/static/js/{2093.e2fce549.chunk.js.LICENSE.txt → 2093.3192d241.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{5547.e35129c6.chunk.js.LICENSE.txt → 5547.5a341867.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{716.cf9ba82c.chunk.js.LICENSE.txt → 716.438b9c22.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7226.4eca7c02.chunk.js.LICENSE.txt → 873.d6d31b32.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.f1e55cd8.js.LICENSE.txt → main.3cf7fedb.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.17-beta-
|
|
6
|
+
"version": "1.16.17-beta-703fb879",
|
|
7
7
|
"description": "Provide unified services for every blocklet",
|
|
8
8
|
"main": "api/index.js",
|
|
9
9
|
"files": [
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
34
34
|
"license": "Apache-2.0",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@abtnode/analytics": "1.16.17-beta-
|
|
37
|
-
"@abtnode/auth": "1.16.17-beta-
|
|
38
|
-
"@abtnode/client": "1.16.17-beta-
|
|
39
|
-
"@abtnode/connect-storage": "1.16.17-beta-
|
|
40
|
-
"@abtnode/constant": "1.16.17-beta-
|
|
41
|
-
"@abtnode/core": "1.16.17-beta-
|
|
42
|
-
"@abtnode/cron": "1.16.17-beta-
|
|
43
|
-
"@abtnode/logger": "1.16.17-beta-
|
|
44
|
-
"@abtnode/models": "1.16.17-beta-
|
|
45
|
-
"@abtnode/router-templates": "1.16.17-beta-
|
|
46
|
-
"@abtnode/util": "1.16.17-beta-
|
|
36
|
+
"@abtnode/analytics": "1.16.17-beta-703fb879",
|
|
37
|
+
"@abtnode/auth": "1.16.17-beta-703fb879",
|
|
38
|
+
"@abtnode/client": "1.16.17-beta-703fb879",
|
|
39
|
+
"@abtnode/connect-storage": "1.16.17-beta-703fb879",
|
|
40
|
+
"@abtnode/constant": "1.16.17-beta-703fb879",
|
|
41
|
+
"@abtnode/core": "1.16.17-beta-703fb879",
|
|
42
|
+
"@abtnode/cron": "1.16.17-beta-703fb879",
|
|
43
|
+
"@abtnode/logger": "1.16.17-beta-703fb879",
|
|
44
|
+
"@abtnode/models": "1.16.17-beta-703fb879",
|
|
45
|
+
"@abtnode/router-templates": "1.16.17-beta-703fb879",
|
|
46
|
+
"@abtnode/util": "1.16.17-beta-703fb879",
|
|
47
47
|
"@arcblock/did": "^1.18.92",
|
|
48
48
|
"@arcblock/did-auth": "1.18.92",
|
|
49
49
|
"@arcblock/did-ext": "^1.18.92",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@arcblock/jwt": "1.18.92",
|
|
53
53
|
"@arcblock/validator": "^1.18.92",
|
|
54
54
|
"@arcblock/ws": "1.18.92",
|
|
55
|
-
"@blocklet/constant": "1.16.17-beta-
|
|
55
|
+
"@blocklet/constant": "1.16.17-beta-703fb879",
|
|
56
56
|
"@blocklet/form-builder": "^0.1.11",
|
|
57
57
|
"@blocklet/form-collector": "^0.1.6",
|
|
58
|
-
"@blocklet/meta": "1.16.17-beta-
|
|
59
|
-
"@blocklet/sdk": "1.16.17-beta-
|
|
58
|
+
"@blocklet/meta": "1.16.17-beta-703fb879",
|
|
59
|
+
"@blocklet/sdk": "1.16.17-beta-703fb879",
|
|
60
60
|
"@did-connect/authenticator": "^2.2.0",
|
|
61
61
|
"@did-connect/relay-adapter-express": "^2.2.0",
|
|
62
62
|
"@did-connect/storage-nedb": "^2.2.0",
|
|
@@ -97,13 +97,13 @@
|
|
|
97
97
|
"@nedb/core": "^2.1.2"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@abtnode/ux": "1.16.17-beta-
|
|
101
|
-
"@arcblock/did-connect": "^2.
|
|
102
|
-
"@arcblock/icons": "^2.
|
|
103
|
-
"@arcblock/ux": "^2.
|
|
100
|
+
"@abtnode/ux": "1.16.17-beta-703fb879",
|
|
101
|
+
"@arcblock/did-connect": "^2.8.2",
|
|
102
|
+
"@arcblock/icons": "^2.8.2",
|
|
103
|
+
"@arcblock/ux": "^2.8.2",
|
|
104
104
|
"@blocklet/launcher-layout": "2.2.22",
|
|
105
|
-
"@blocklet/tracker": "1.16.17-beta-
|
|
106
|
-
"@blocklet/ui-react": "^2.
|
|
105
|
+
"@blocklet/tracker": "1.16.17-beta-703fb879",
|
|
106
|
+
"@blocklet/ui-react": "^2.8.2",
|
|
107
107
|
"@emotion/react": "^11.10.4",
|
|
108
108
|
"@emotion/styled": "^11.10.4",
|
|
109
109
|
"@iconify/iconify": "^2.2.1",
|
|
@@ -173,5 +173,5 @@
|
|
|
173
173
|
"url": "https://github.com/ArcBlock/blocklet-server/issues",
|
|
174
174
|
"email": "shijun@arcblock.io"
|
|
175
175
|
},
|
|
176
|
-
"gitHead": "
|
|
176
|
+
"gitHead": "97d63c671d823076e58b994107e10866367edd5d"
|
|
177
177
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[1480,6378],{44547:function(e,n,t){t.r(n);var r,o,i=t(71171),a=t(32723),c=t(34795),s=t(96234),l=t(30969),u=t(54164),p=t(16380),d=t(72836),f=t(26022),h=t(20244),v=t(94308),g=t(32901),m=t(38361),x=t(33359),b=t(20003),w=t(29996),y=t(99574),j=t(4485),Z=t(38507),k=t(99042),P=t(37574);var O=p.Z.div(r||(r=(0,i.Z)(["\n position: fixed;\n top: 16px;\n right: 16px;\n z-index: 9999;\n"]))),z=p.Z.div(o||(o=(0,i.Z)(["\n width: 100vw;\n height: 100vh;\n min-height: 100vh;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: #f6f8fa;\n"])));n.default=function(){var e,n,t,r,o,i=(0,f.PE)(),p=i.t,C=i.locale,M=(0,j.Tt)(),S=M.api,T=M.session,E=new URL(window.location.href).searchParams,L=(0,l.useState)(!1),A=(0,s.Z)(L,2),D=A[0],_=A[1],N=E.get("transferId"),I=null===(e=window)||void 0===e||null===(n=e.env)||void 0===n?void 0:n.appId,R=(0,l.useCallback)((0,c.Z)((0,a.Z)().mark((function e(){var n,t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.Z.get("/blocklet/transfer",{params:{transferId:N}});case 2:return n=e.sent,t=n.data,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),[N]),H=(0,u.Z)(R),B=(0,l.useCallback)(function(){var e=(0,c.Z)((0,a.Z)().mark((function e(n,t){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n&&((0,Z.ZB)(t(n.sessionToken)),(0,Z.zI)(t(n.refreshToken))),e.next=3,T.refresh();case 3:_(!0);case 4:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),[]);return H.loading?(0,P.jsx)(v.Z,{}):H.error?(0,P.jsx)(z,{children:(0,P.jsx)(b.Z,{status:"404",title:null===(t=H.error)||void 0===t||null===(r=t.response)||void 0===r?void 0:r.data,description:""})}):(o="success"===H.data.status||D?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(O,{children:(0,P.jsx)(y.Z,{SessionContext:j.B3})}),(0,P.jsx)(m.Z,{pt:1,color:"success.main",children:(0,P.jsx)(g.Z,{style:{fontSize:80}})}),(0,P.jsx)(x.Z,{my:4,variant:"h5",children:p("team.transferApp.successTitle")}),(0,P.jsx)("a",{href:"".concat(h.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin"),children:(0,P.jsx)(w.Z,{variant:"contained",children:p("team.transferApp.visitDashboard")})})]}):(0,P.jsx)(d.default,{action:"receive-transfer-app-owner",checkFn:S.get,forceConnected:!1,autoConnect:!1,checkTimeout:6e5,onSuccess:B,onClose:function(){},locale:C,messages:{title:p("team.transferApp.receiveDialog.title"),scan:p("team.transferApp.receiveDialog.scan"),confirm:p("team.transferApp.receiveDialog.confirm"),success:p("team.transferApp.receiveDialog.success")},extraParams:{transferId:N,appDid:I}}),(0,P.jsx)(z,{children:o}))}},99574:function(e,n,t){t.d(n,{Z:function(){return x}});var r,o=t(71171),i=t(33028),a=t(30969),c=t(16380),s=t(24974),l=t.n(s),u=t(94551),p=t(30734),d=t(19230),f=t(26681),h=t(26022),v=t(46513),g=t(91077),m=t(37574);function x(e){var n=e.SessionContext,t=e.extraItems,r=e.showLocale,o=e.showHelper,c=e.showSessionManager,s=e.sessionManagerProps,l=(0,a.useContext)(n).session,x=(0,a.useContext)(h.RD).locale,w=(0,p.useLocation)(),y={"/store":{endpoint:"https://store.blocklet.io"},"/dashboard":{path:"/conceptual/overview"},"/settings/router":{path:"/conceptual/server-architecture"}};return(0,m.jsxs)(b,{children:[t.map((function(e,n){return(0,a.cloneElement)(e,{key:n})})),r&&(0,m.jsx)(f.Z,{"data-cy":"locale-addon",icon:v.Z,size:23,showText:!1,className:"locale-addon"}),o&&(0,m.jsx)(u.Z,{onClick:function(){var e=w.pathname,n={};e.indexOf("/store")>-1?n=y["/store"]:y[e]&&(n=y[e]),window.open("".concat(n.endpoint||"https://developer.blocklet.io/docs","/").concat(x).concat(n.path||""),"_blank")},children:(0,m.jsx)(g.Z,{})}),c&&(0,m.jsx)(d.Z,(0,i.Z)((0,i.Z)({locale:x,session:l,size:24,showRole:!0},s),{},{showManageBlocklet:!1}))]})}x.propTypes={SessionContext:l().object.isRequired,webWalletUrl:l().string,extraItems:l().array,showLocale:l().bool,showSessionManager:l().bool,showHelper:l().bool,sessionManagerProps:l().object},x.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};var b=c.Z.div(r||(r=(0,o.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n .MuiIconButton-root svg {\n width: 26px;\n height: 26px;\n }\n\n .user-addon {\n .user-avatar {\n width: 28px;\n border-radius: 14px;\n height: auto;\n }\n }\n\n "," {\n > button,\n > a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}))},46513:function(e,n,t){n.Z=void 0;(r=t(30969))&&r.__esModule;var r,o=t(37574);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){c(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s=function(e){return(0,o.jsx)("svg",a(a({},e),{},{children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.606 17.32a7.933 7.933 0 0 1-.581-1.18c-.165-.411-.312-.86-.44-1.339a7.639 7.639 0 0 0-1.586 1.054 7.69 7.69 0 0 0 2.607 1.465zm.657-1.675c-.16-.4-.305-.848-.429-1.335A7.643 7.643 0 0 1 10 14h.002c.734 0 1.463.104 2.165.31-.124.487-.268.935-.428 1.335-.283.707-.604 1.235-.925 1.575-.32.339-.595.447-.813.447-.218 0-.493-.108-.813-.447-.322-.34-.642-.867-.925-1.575zM10 12.667a8.976 8.976 0 0 1 2.436.334c.116-.727.193-1.511.22-2.334H7.344c.027.823.103 1.607.22 2.334A8.972 8.972 0 0 1 10 12.667zM7.345 9.333c.027-.823.103-1.607.22-2.334.791.223 1.61.335 2.436.334A8.974 8.974 0 0 0 12.437 7c.116.727.193 1.511.22 2.334H7.344zm6.646 1.334c-.03.982-.127 1.925-.28 2.797.81.367 1.56.852 2.227 1.439a7.666 7.666 0 0 0 1.734-4.236h-3.681zm3.681-1.334H13.99a19.718 19.718 0 0 0-.28-2.798 8.975 8.975 0 0 0 2.228-1.438 7.665 7.665 0 0 1 1.734 4.236zm1.329.669A9 9 0 1 1 1 10a9 9 0 0 1 18 0v.002zM2.329 9.333a7.665 7.665 0 0 1 1.734-4.236A8.974 8.974 0 0 0 6.29 6.535a19.74 19.74 0 0 0-.28 2.798H2.329zm0 1.334h3.682c.03.983.126 1.925.28 2.797a8.974 8.974 0 0 0-2.228 1.439 7.665 7.665 0 0 1-1.734-4.236zm10.648 5.473c.164-.411.312-.86.44-1.34.57.285 1.103.639 1.585 1.055a7.687 7.687 0 0 1-2.606 1.465c.216-.354.41-.751.58-1.18zm-.581-13.46c.967.316 1.85.819 2.606 1.465A7.64 7.64 0 0 1 13.417 5.2c-.128-.48-.276-.928-.44-1.34a7.925 7.925 0 0 0-.581-1.18zm-.657 1.675c.16.4.304.848.428 1.335a7.64 7.64 0 0 1-2.165.31H10a7.64 7.64 0 0 1-2.166-.31c.124-.487.268-.935.429-1.335.283-.708.603-1.235.925-1.575.32-.339.595-.447.813-.447.218 0 .492.108.813.447.321.34.642.867.925 1.575zM7.025 3.86c-.165.411-.312.86-.44 1.34a7.64 7.64 0 0 1-1.586-1.055A7.688 7.688 0 0 1 7.606 2.68c-.216.354-.41.751-.581 1.18z",fill:"currentColor"})}))};s.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"},s.displayName="globe";var l=s;n.Z=l},91077:function(e,n,t){n.Z=void 0;(r=t(30969))&&r.__esModule;var r,o=t(37574);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){c(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s=function(e){return(0,o.jsxs)("svg",a(a({},e),{},{children:[(0,o.jsx)("path",{d:"M9.928 13.133a.981.981 0 0 0-.678.252.79.79 0 0 0-.281.61c0 .27.094.482.283.636.19.154.41.231.663.231.257 0 .48-.076.673-.228.19-.153.287-.365.287-.639a.796.796 0 0 0-.275-.61.958.958 0 0 0-.672-.252zM12.633 7.2a2.526 2.526 0 0 0-1.035-.88c-.441-.212-.955-.32-1.528-.32-.617 0-1.166.129-1.63.383-.467.255-.826.582-1.07.972-.245.392-.37.786-.37 1.172 0 .205.086.397.254.57.169.174.38.262.625.262.419 0 .705-.246.85-.729.132-.399.296-.703.485-.905.177-.19.465-.286.856-.286.336 0 .602.095.813.29.208.191.309.42.309.698a.78.78 0 0 1-.1.387c-.07.125-.156.24-.258.342-.108.109-.287.27-.53.484a9.184 9.184 0 0 0-.679.647 2.268 2.268 0 0 0-.42.656 2.27 2.27 0 0 0-.159.884c0 .288.08.511.24.663.156.15.352.227.58.227.439 0 .714-.24.796-.687.041-.186.073-.316.094-.39.019-.067.046-.136.081-.205.034-.068.089-.144.162-.227.076-.088.179-.19.305-.306.472-.422.805-.727.99-.908.19-.186.356-.41.493-.665A1.9 1.9 0 0 0 13 8.416a2.18 2.18 0 0 0-.367-1.217",fill:"currentColor"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 17.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15zm0 1.5a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",fill:"currentColor"})]}))};s.defaultProps={width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},s.displayName="question-mark-circle";var l=s;n.Z=l},26681:function(e,n,t){t.d(n,{Z:function(){return z}});var r,o,i=t(71171),a=t(33028),c=t(96234),s=t(59740),l=t(30969),u=t(24974),p=t.n(u),d=t(72097),f=t(94551),h=t(38361),v=t(33359),g=t(38589),m=t(23484),x=t(2689),b=t(45761),w=t(38996),y=t(46513),j=t(79216),Z=t(26022),k=t(55581),P=t(37574),O=["showText","popperProps","popperType","icon","size"];function z(e){var n,t,r,o=e.showText,i=e.popperProps,u=e.popperType,p=e.icon,b=e.size,j=(0,s.Z)(e,O),z=(0,l.useContext)(Z.RD),S=z.locale,T=z.changeLocale,E=z.languages,L=(0,l.useRef)(null),A=(0,l.useState)(!1),D=(0,c.Z)(A,2),_=D[0],N=D[1],I=(0,k.Fg)(),R="dark"===(null===I||void 0===I||null===(n=I.palette)||void 0===n?void 0:n.mode),H=o?d.Z:f.Z,B="hover"===u?{onMouseEnter:function(){N(!0)},onMouseLeave:function(){N(!1)}}:{onClick:function(){N(!_)}},F=(0,l.useMemo)((function(){return p?(0,P.jsx)(p,{}):(0,P.jsx)(y.Z,{style:{width:"auto",height:b,color:I.palette.text.secondary}})}),[p,null===I||void 0===I||null===(t=I.palette)||void 0===t||null===(r=t.text)||void 0===r?void 0:r.secondary,b]);return(0,P.jsxs)(C,(0,a.Z)((0,a.Z)((0,a.Z)({component:"div",dark:R,theme:I},j),B),{},{children:[(0,P.jsx)(H,{ref:L,className:"trigger",role:"button","aria-label":"Locale selector button",children:(0,P.jsxs)(h.Z,{display:"flex",alignItems:"center",children:[F,o?(0,P.jsx)(v.Z,{component:"strong",className:"trigger-text",children:E.find((function(e){return e.code===S})).name}):""]})}),(0,P.jsx)(M,(0,a.Z)((0,a.Z)({open:_,anchorEl:L.current},i),{},{disablePortal:!0,children:(0,P.jsx)("div",{className:"locales",children:(0,P.jsx)(g.d,{onClickAway:function(e){var n;null!==(n=L.current)&&void 0!==n&&n.contains(e.target)||N(!1)},children:(0,P.jsx)(m.Z,{children:E.map((function(n){var t=n.code,r=n.name;return(0,P.jsxs)(x.Z,{className:"locale-item",onClick:function(){return T(n=t),N(!1),void("function"===typeof e.onChange&&e.onChange(n));var n},children:[(0,P.jsx)(w.default,{className:t===S?"check-icon check-icon-visible":"check-icon",fontSize:"small"}),r]},t)}))})})})}))]}))}z.propTypes={size:p().number,showText:p().bool,popperProps:p().object,onChange:p().func,popperType:p().oneOf(["hover","click"]),icon:p().any},z.defaultProps={showText:!0,size:24,popperProps:{},onChange:function(){},popperType:"click",icon:null};var C=(0,k.zo)("div",{shouldForwardProp:function(e){return"dark"!==e}})(r||(r=(0,i.Z)(["\n display: inline-block;\n\n .trigger {\n display: flex;\n flex-direction: column;\n justify-content: center;\n font-size: 14px;\n white-space: nowrap;\n\n .trigger-text {\n margin-left: 5px;\n font-size: 14px;\n color: ",";\n }\n }\n\n .locales {\n background: ",";\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);\n }\n\n .locale-item {\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n text-align: center;\n color: ",";\n cursor: pointer;\n display: flex;\n padding: 16px;\n align-items: center;\n .check-icon {\n visibility: hidden;\n margin-right: 4px;\n }\n .check-icon-visible {\n visibility: visible;\n }\n }\n"])),(function(e){return(0,j.Lq)(e)}),(function(e){return(0,j.Vu)(e)}),(function(e){return(0,j.Lq)(e)})),M=(0,k.zo)(b.Z)(o||(o=(0,i.Z)(["\n z-index: ",";\n"])),(function(e){return e.theme.zIndex.tooltip+10}))},32901:function(e,n,t){var r=t(71600);n.Z=void 0;var o=r(t(48035)),i=t(37574),a=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");n.Z=a},46378:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isNavigator=n.isBrowser=n.off=n.on=n.noop=void 0;n.noop=function(){},n.on=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];e&&e.addEventListener&&e.addEventListener.apply(e,n)},n.off=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];e&&e.removeEventListener&&e.removeEventListener.apply(e,n)},n.isBrowser="undefined"!==typeof window,n.isNavigator="undefined"!==typeof navigator}}]);
|
|
2
|
-
//# sourceMappingURL=1480.88c590c2.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[1760],{75023:function(e,n,t){t.d(n,{NU:function(){return x},mc:function(){return v}});var r=t(32723),a=t(34795),o=t(96234),c=t(30969),s=t(17708),i=t(50576),u=t(30134),l=t(41395),p=t(59505),d=t(64864),f=t(37574),h=(0,c.createContext)({}),m=h.Provider;h.Consumer;function v(e){var n=e.children,t=(0,s.Z)("spaceGatewayForInstall",null),h=(0,o.Z)(t,2),v=h[0],x=h[1],y=(0,d.y0)(),k=y.blocklet,w=y.actions.refreshBlocklet,b=(0,c.useMemo)((function(){return(0,u.EJ)(k)}),[k]),g=(0,l.h6)().api,Z=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(n),e.next=3,E(n.endpoint);case 3:w();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),E=function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.configBlocklet({input:{did:[k.meta.did],configs:[{key:p.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:n}]}});case 2:w();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){function e(){return(e=(0,a.Z)((0,r.Z)().mark((function e(){var n,t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,u.nU)(v.endpoint,v.name);case 4:n=e.sent,t=(0,i.merge)(v,{name:n}),x(t);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),(0,f.jsx)(m,{value:{spaceGateway:v,deleteSpaceGateway:function(){x(null),w()},updateSpaceGateway:Z,storageEndpoint:b,settingStorageEndpoint:E},children:n})}function x(){return(0,c.useContext)(h)}v.defaultProps={}},5954:function(e,n,t){t.d(n,{cK:function(){return d},h6:function(){return f}});var r=t(30969),a=t(41395),o=t(20244),c=t(48952),s=t(90781),i=t(99042),u=t(37574),l=a.sy.Provider,p=(a.sy.Consumer,"".concat(o.WELLKNOWN_SERVICE_PATH_PREFIX,"/static/images"));function d(e){var n=e.children,t=window.env,r=t.serverDid,a=t.serverVersion,d=t.mode,f=t.nftDomainUrl,h={api:c.Z,restApi:i.Z,prefix:o.WELLKNOWN_SERVICE_PATH_PREFIX,imgPrefix:p,getSessionInHeader:function(){return{}},ws:{getWsClient:s.ZP,create:s.Ue,useSubscription:s.mU},type:"service",info:{did:r,version:a,mode:d,nftDomainUrl:f}};return(0,u.jsx)(l,{value:{node:h},children:n})}function f(){return(0,r.useContext)(a.sy).node}},51760:function(e,n,t){t.r(n),t.d(n,{default:function(){return W}});var r,a,o,c=t(71171),s=t(33028),i=t(32723),u=t(34795),l=t(30969),p=t(30734),d=t(16380),f=t(19611),h=t.n(f),m=t(54470),v=t(38361),x=t(66629),y=t(43001),k=t(75255),w=t(26022),b=t(94308),g=t(99574),Z=t(19006),E=t(47650),P=t(20244),j=t(7017),C=t(59505),_=t(38507),L=t(64864),N=t(4485),S=d.Z.span(r||(r=(0,c.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main})),I=t(5954),R=t(75023),B=t(37574),O=(0,l.lazy)((function(){return Promise.all([t.e(2836),t.e(9409)]).then(t.bind(t,89409))})),A=(0,l.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(4319),t.e(4420)]).then(t.bind(t,91654))})),T=(0,l.lazy)((function(){return Promise.all([t.e(5683),t.e(2836),t.e(7006),t.e(3490),t.e(5673),t.e(9657),t.e(1462)]).then(t.bind(t,91462))})),U=(0,l.lazy)((function(){return Promise.all([t.e(5683),t.e(2836),t.e(7006),t.e(468),t.e(941)]).then(t.bind(t,11980))})),K=(0,l.lazy)((function(){return Promise.all([t.e(2686),t.e(6576)]).then(t.bind(t,26576))})),D=(0,l.lazy)((function(){return Promise.all([t.e(2836),t.e(5176)]).then(t.bind(t,5176))})),F=(0,l.lazy)((function(){return t.e(9102).then(t.bind(t,29102))}));function W(){var e,n,t,r=(0,k.Z)((function(e){return e.breakpoints.down("md")})),a=(0,w.PE)(),o=a.t,c=a.locale,d=(0,p.useNavigate)(),f=(0,L.y0)(),y=f.meta,W=f.blocklet,G=f.actions,H=f.loading,X=localStorage.getItem("blocklet-server-url"),V=(0,_.tX)("fromLauncher");(0,l.useEffect)((function(){G.refreshMeta(),G.refreshBlocklet({showError:!1}),(0,_.NU)()}),[]),(0,l.useEffect)((function(){G.refreshFuel({showError:!1})}),[null===W||void 0===W||null===(e=W.meta)||void 0===e?void 0:e.did]);var $="".concat(P.WELLKNOWN_SERVICE_PATH_PREFIX,"/setup"),q=[{key:"connect",name:o("setup.steps.connect"),path:h()($,"connect")},{key:"access",name:o("setup.steps.access"),path:h()($,"access")},{key:"domain",name:o("setup.steps.domain"),path:h()($,"domain")},function(e){var n,t=null===e||void 0===e||null===(n=e.capabilities)||void 0===n?void 0:n.didSpace;if(!t)return null;if(t===C.BLOCKLET_APP_SPACE_ENDPOINTS.REQUIRED)return{key:"did-space",name:(0,B.jsxs)(B.Fragment,{children:[o("setup.steps.didSpace")," ",(0,B.jsx)(S,{})]}),path:h()($,"did-space")};if(t===C.BLOCKLET_APP_SPACE_ENDPOINTS.OPTIONAL)return{key:"did-space",name:(0,B.jsx)(B.Fragment,{children:o("setup.steps.didSpace")}),path:h()($,"did-space")};throw new Error("capabilities.didSpace cannot take the value ".concat(t))}(W),{key:"config",name:(0,B.jsxs)(B.Fragment,{children:[o("setup.steps.config")," ",(0,_.o2)(y)&&(0,B.jsx)(S,{})]}),path:h()($,"config")},null!==y&&void 0!==y&&null!==(n=y.requirements)&&void 0!==n&&null!==(t=n.fuels)&&void 0!==t&&t.length?{key:"fuel",name:(0,B.jsxs)(B.Fragment,{children:[o("setup.steps.fuel")," ",(0,B.jsx)(S,{})]}),path:h()($,"fuel")}:null].filter(Boolean),J=q.findIndex((function(e){return"".concat(_.Bq.replace(/\/$/,"")).concat($,"/").concat(e.key)===window.location.pathname})),Y=h()(_.Bq,P.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),Q=function(){var e=(0,u.Z)((0,i.Z)().mark((function e(n){var t,r,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new URL(window.location.href),r=t.search,n?(a=q.findIndex((function(e){return e.key===n})),d(a>-1?"".concat(h()($,q[a].key)).concat(r):"".concat(h()($,"complete")).concat(r))):q[J+1]?d("".concat(h()($,q[J+1].key)).concat(r)):d("".concat(h()($,"complete")).concat(r)),e.next=4,G.refreshBlocklet();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ee=function(){d(-1)};function ne(e,n){return W?(0,B.jsx)(e,(0,s.Z)((0,s.Z)({blocklet:W},n),{},{onNext:Q,onPrevious:ee})):(0,B.jsx)(v.Z,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,B.jsx)(b.Z,{})})}var te=function(){window.open(X)},re=r?(0,B.jsx)(Z.Z,{onClick:te,width:"32",height:"32",style:{cursor:"pointer"}}):(0,B.jsx)(E.Z,{onClick:te,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),ae=[{key:"install",name:o("launchBlocklet.steps.installApp"),path:h()($,"install")},{key:"setup",name:o("setup.steps.launchApp"),children:q}],oe=[{key:"agreement",name:o("launchBlocklet.introduction"),path:h()($,"agreement")}].concat(ae);return V&&(oe=[{key:"purchase-space",name:o("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:o("launchBlocklet.steps.prepareSpace")}].concat(ae)),(0,B.jsx)(z,{steps:oe,children:(0,B.jsx)(I.cK,{children:(0,B.jsxs)(R.mc,{children:[(0,B.jsx)(m.Global,{styles:M}),(0,B.jsx)(x.Z,{locale:c,loading:H,blockletMeta:(0,s.Z)((0,s.Z)({},y),{},{title:(0,j.getDisplayName)((0,s.Z)((0,s.Z)({},W),{},{meta:y}))}),navLogo:re,pcWidth:"80%",style:{height:"100%"},logoUrl:Y,useOfSkeleton:!1,headerEndAddons:(0,B.jsx)(g.Z,{SessionContext:N.B3,sessionManagerProps:{disableLogout:!0}}),launchingText:o("setup.title"),children:(0,B.jsxs)(p.Routes,{children:[(0,B.jsx)(p.Route,{path:"connect",element:(0,B.jsx)(O,{onNext:Q})}),(0,B.jsx)(p.Route,{path:"domain",element:ne(U)}),(0,B.jsx)(p.Route,{path:"did-space",element:ne(T)}),(0,B.jsx)(p.Route,{path:"config",element:ne(A)}),(0,B.jsx)(p.Route,{path:"access",element:ne(K)}),(0,B.jsx)(p.Route,{path:"fuel",element:ne(D)}),(0,B.jsx)(p.Route,{path:"complete",element:ne(F)}),(0,B.jsx)(p.Route,{path:"*",element:(0,B.jsx)(p.Navigate,{to:"connect".concat(window.location.search),replace:!0})})]})})]})})})}var M=(0,m.css)(a||(a=(0,c.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),z=(0,d.Z)(y.W)(o||(o=(0,c.Z)([""])))},41395:function(e,n,t){t.d(n,{h6:function(){return c},sy:function(){return o}});var r=t(33028),a=t(30969),o=(0,a.createContext)({});o.Provider,o.Consumer;function c(){var e=(0,a.useContext)(o).node;return(0,r.Z)((0,r.Z)({},e),{},{inService:"service"===e.type,inDaemon:"daemon"===e.type})}},99574:function(e,n,t){t.d(n,{Z:function(){return y}});var r,a=t(71171),o=t(33028),c=t(30969),s=t(16380),i=t(24974),u=t.n(i),l=t(94551),p=t(30734),d=t(19230),f=t(26681),h=t(26022),m=t(46513),v=t(91077),x=t(37574);function y(e){var n=e.SessionContext,t=e.extraItems,r=e.showLocale,a=e.showHelper,s=e.showSessionManager,i=e.sessionManagerProps,u=(0,c.useContext)(n).session,y=(0,c.useContext)(h.RD).locale,w=(0,p.useLocation)(),b={"/store":{endpoint:"https://store.blocklet.io"},"/dashboard":{path:"/conceptual/overview"},"/settings/router":{path:"/conceptual/server-architecture"}};return(0,x.jsxs)(k,{children:[t.map((function(e,n){return(0,c.cloneElement)(e,{key:n})})),r&&(0,x.jsx)(f.Z,{"data-cy":"locale-addon",icon:m.Z,size:23,showText:!1,className:"locale-addon"}),a&&(0,x.jsx)(l.Z,{onClick:function(){var e=w.pathname,n={};e.indexOf("/store")>-1?n=b["/store"]:b[e]&&(n=b[e]),window.open("".concat(n.endpoint||"https://developer.blocklet.io/docs","/").concat(y).concat(n.path||""),"_blank")},children:(0,x.jsx)(v.Z,{})}),s&&(0,x.jsx)(d.Z,(0,o.Z)((0,o.Z)({locale:y,session:u,size:24,showRole:!0},i),{},{showManageBlocklet:!1}))]})}y.propTypes={SessionContext:u().object.isRequired,webWalletUrl:u().string,extraItems:u().array,showLocale:u().bool,showSessionManager:u().bool,showHelper:u().bool,sessionManagerProps:u().object},y.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};var k=s.Z.div(r||(r=(0,a.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n .MuiIconButton-root svg {\n width: 26px;\n height: 26px;\n }\n\n .user-addon {\n .user-avatar {\n width: 28px;\n border-radius: 14px;\n height: auto;\n }\n }\n\n "," {\n > button,\n > a {\n padding-left: 8px;\n padding-right: 8px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}))},54559:function(e,n,t){t.d(n,{hi:function(){return o},od:function(){return a.a}});var r=t(95803),a=t.n(r);a().defaults.timeout=1e4;var o=a().create()},30134:function(e,n,t){t.d(n,{EJ:function(){return Z},Jf:function(){return g},LQ:function(){return f},Nb:function(){return h},Xv:function(){return p},ag:function(){return x},mo:function(){return v},nD:function(){return d},nU:function(){return w},w2:function(){return y}});var r=t(32723),a=t(34795),o=t(92522),c=t.n(o),s=t(59505),i=t(50576),u=t(43430),l=t(54559);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return(0,u.xn)(n,"space",r,"apps",a,"explorer?key=/apps/".concat(a,"/.did-objects/").concat(a,"/"))}function d(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,u.xn)(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function h(e){return m.apply(this,arguments)}function m(){return(m=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,c()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,l.hi.head(n,{timeout:5e3});case 5:return t=e.sent,a=t.headers,e.abrupt("return","true"===a["x-listable"]&&"true"===a["x-readable"]&&"true"===a["x-writeable"]);case 10:return e.prev=10,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function v(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function x(e){var n=new URL(e);return(0,u.xn)(n.origin,n.pathname)}function y(e){return k.apply(this,arguments)}function k(){return(k=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o,s,p;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,c()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=x(n),a=(0,u.xn)(t,"space/api/did/one-click-authorization/token"),e.next=7,l.hi.get(a,{timeout:5e3});case 7:return o=e.sent,s=o.status,p=o.data,e.abrupt("return",200===s&&(0,i.isObject)(p));case 13:return e.prev=13,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function w(e){return b.apply(this,arguments)}function b(){return(b=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,c()(n)){e.next=3;break}return e.abrupt("return","");case 3:return e.next=5,l.hi.head(n,{timeout:3e3});case 5:return t=e.sent,a=t.headers,o=a["x-space-name"],e.abrupt("return",o?decodeURIComponent(o):"");case 11:return e.prev=11,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return","");case 15:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}function g(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return(0,u.xn)(n,"/api/space/nft/display?spaceDid=".concat(t))}var Z=function(e){var n,t;return(null===e||void 0===e||null===(n=e.configs)||void 0===n||null===(t=n.find((function(e){return e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null}}}]);
|
|
2
|
-
//# sourceMappingURL=1760.374a6e01.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[2393],{2393:function(e,t,n){n.r(t),n.d(t,{default:function(){return Fe}});var r,a=n(71171),o=n(96234),i=n(30969),s=n(16380),l=n(86822),c=n(19865),u=n(26022),d=n(33028),m=n(32723),p=n(34795),f=n(19886),h=n.n(f),y=n(49725),v=n.n(y),g=n(19611),x=n.n(g),Z=n(99237),b=n.n(Z),j=n(22073),k=n(95973),D=n(18877),P=n(94308),R=n(3994),I=n(33359),F=n(72097),w=n(94551),S=n(83176),C=n(70898),z=n(36390),E=n(58323),T=n(89629),H=n(61171),L=n(20244),N=n(41046),q=n(3691),Y=n(29162),_=n(25841),M=n(64828),U=n(27575),W=n(36319),B=n(97930),O=n(4881),A=n(24891),V=n(41395),X=n(24974),K=n.n(X),G=n(28595),J=n(78879),Q=n(35016),$=n(22994),ee=n(42846),te=n(38361),ne=n(37574);function re(e){var t=e.style,n=e.title,r=e.value,a=e.graph,o=e.description;return(0,ne.jsx)(ae,{children:(0,ne.jsxs)(ee.Z,{style:(0,d.Z)({},t),children:[(0,ne.jsx)(I.Z,{sx:{fontSize:14},color:"text.secondary",children:n}),(0,ne.jsx)(I.Z,{variant:"h5",component:"div",mt:1,children:r}),a,!!o&&(0,ne.jsx)(te.Z,{display:"flex",sx:{fontSize:12,marginTop:3},color:"text.secondary",children:o})]})})}re.propTypes={style:K().object,title:K().node,value:K().node,graph:K().node,description:K().any},re.defaultProps={style:{},title:null,value:null,graph:null,description:null};var ae=(0,s.Z)($.Z)(r||(r=(0,a.Z)(["\n .card-content {\n height: 150px;\n }\n\n .card-sparkline {\n flex: 2;\n display: flex;\n position: relative;\n *[hidden] {\n display: none;\n }\n }\n .sparkline {\n stroke: ",";\n fill: ","1A;\n }\n .tooltip {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n padding: 2px 5px;\n font-size: 12px;\n white-space: nowrap;\n z-index: 9999;\n }\n .sparkline--cursor {\n stroke: orange;\n }\n\n .sparkline--spot {\n fill: red;\n stroke: red;\n }\n"])),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main}));function oe(e){var t=e.id,n=e.title,r=e.current,a=e.description,s=e.data,l=e.dateFn,c=e.valueFn,u=(0,i.useRef)(null),m=(0,i.useRef)(null),p=(0,G.Z)({style:{top:0,left:0},hidden:!0,textContent:""}),f=(0,i.useState)(null),h=(0,o.Z)(f,2),y=h[0],v=h[1],g=(0,J.Z)(y),x={onmousemove:function(e,t){var n=t.date,r=t.value;p.textContent="".concat(l(n),": ").concat(c(r)),p.style.top=-30,p.style.left=80,p.hidden=!1},onmouseout:function(){p.hidden=!0}};return(0,i.useEffect)((function(){setTimeout((function(){v(document.querySelector(".".concat(t))),setTimeout((function(){u.current&&(0,Q.Z)(u.current,s||[],x)}),400)}))}),[s]),(0,ne.jsx)(re,{title:n,value:r,graph:(0,ne.jsxs)("div",{className:"card-sparkline ".concat(t),style:{marginTop:16},children:[(0,ne.jsx)("svg",{ref:u,className:"sparkline",width:(null===g||void 0===g?void 0:g.width)||100,height:30,strokeWidth:"2"}),(0,ne.jsx)("span",{className:"tooltip",ref:m,hidden:p.hidden,style:(0,d.Z)({},p.style),children:p.textContent})]}),description:a})}oe.propTypes={id:K().string.isRequired,title:K().string.isRequired,current:K().any.isRequired,description:K().any,data:K().array,dateFn:K().func,valueFn:K().func},oe.defaultProps={description:null,data:[],dateFn:function(e){return e},valueFn:function(e){return e}};var ie=v()(0),se=function(e,t){return[{label:"This Week",startDate:(0,N.Z)(e,{locale:t}),endDate:(0,q.Z)(e,{locale:t})},{label:"Last Week",startDate:(0,N.Z)((0,Y.Z)(e,-1),{locale:t}),endDate:(0,q.Z)((0,Y.Z)(e,-1),{locale:t})},{label:"Last 7 Days",startDate:(0,Y.Z)(e,-1),endDate:e},{label:"This Month",startDate:(0,_.Z)(e),endDate:(0,M.Z)(e)},{label:"Last Month",startDate:(0,_.Z)((0,U.Z)(e,-1)),endDate:(0,M.Z)((0,U.Z)(e,-1))},{label:"This Year",startDate:(0,W.Z)(e),endDate:(0,B.Z)(e)},{label:"Last Year",startDate:(0,W.Z)((0,O.Z)(e,-1)),endDate:(0,B.Z)((0,O.Z)(e,-1))}]};function le(e){var t=e.client,n=e.did,r=h()().subtract(1,"day").toDate(),a=(0,V.h6)(),s=a.info,l=a.inService,c=(0,u.PE)(),f=c.t,y=c.locale,v=(0,i.useState)(null),g=(0,o.Z)(v,2),Z=g[0],N=g[1],q=(0,i.useState)(!1),Y=(0,o.Z)(q,2),_=Y[0],M=Y[1],U=(0,i.useState)(r),W=(0,o.Z)(U,2),B=W[0],O=W[1],X=(0,i.useState)({startDate:h()().subtract(30,"day").toDate(),endDate:r}),K=(0,o.Z)(X,2),G=K[0],J=K[1],Q=(0,j.Z)((0,p.Z)((0,m.Z)().mark((function e(){var r;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getTrafficInsights({input:{did:n,startDate:h()(G.startDate).format("YYYY-MM-DD"),endDate:h()(G.endDate).format("YYYY-MM-DD")}});case 2:return r=e.sent,e.abrupt("return",r.list);case 4:case"end":return e.stop()}}),e)}))));(0,i.useEffect)((function(){Q.loading||G.startDate&&G.endDate&&Q.retry()}),[G]);var $=function(e){N(Z?null:e.currentTarget)},ee=Q.value||[],te=Q.loading,re=Q.error;if(!ee.length&&te)return(0,ne.jsx)(P.Z,{});if(re)return(0,ne.jsx)(D.Z,{severity:"error",children:(0,A.Z)(re)});var ae={totalRequests:ie,validRequests:ie,failedRequests:ie,uniqueVisitors:ie,uniqueFiles:ie,uniqueReferrers:ie,uniqueNotFound:ie,uniqueStaticFiles:ie,logSize:b(),bandwidth:b()},le=Object.keys(ae).map((function(e){return{id:"".concat(e,"_chart"),title:f("analytics.traffic.".concat(e)),current:ee.length?ae[e](ee[0][e]):0,data:ee.map((function(t){return{date:t.date,value:t[e]}})).reverse(),dateFn:ie,valueFn:ae[e]}})),ce=Boolean(Z),ue=ce?"date-range-picker-popover":void 0,de=l?L.WELLKNOWN_SERVICE_PATH_PREFIX:s.routing.adminPath,me=x()(window.location.origin,de,"/api/analytics/traffic?date=".concat(h()(B).format("YYYY-MM-DD"),"&did=").concat(n));return(0,ne.jsxs)("div",{children:[(0,ne.jsxs)(I.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:[f("analytics.trend"),(0,ne.jsxs)(F.Z,{onClick:$,variant:"outlined",size:"small",color:"secondary",children:[(0,A.pz)(G.startDate,y)," - ",(0,A.pz)(G.endDate,y)]})]}),(0,ne.jsx)(S.ZP,{id:ue,open:ce,anchorEl:Z,onClose:function(){return N(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,ne.jsx)(z.D,{open:!0,toggle:$,maxDate:r,definedRanges:se(B),onChange:function(e){J(e),N(null)}})}),(0,ne.jsx)(R.ZP,{container:!0,spacing:4,children:le.map((function(e){return(0,ne.jsx)(R.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,ne.jsx)(oe,(0,d.Z)({},e))},e.id)}))}),(0,ne.jsxs)(I.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mt:4,mb:1,children:[f("analytics.detail"),(0,ne.jsxs)("span",{children:[_&&(0,ne.jsx)(w.Z,{onClick:function(){window.open(me)},style:{marginRight:32},children:(0,ne.jsx)(C.Z,{})}),(0,ne.jsx)(H._,{dateAdapter:T.y,children:(0,ne.jsx)(E.M,{disableFuture:!0,format:"ll",value:h()(B),onChange:function(e){O(e.toDate()),M(!1)},slotProps:{textField:{size:"small"}}})})]})]}),(0,ne.jsx)(k.Z,{url:me,width:"100%",height:"100%",frameBorder:0,onLoad:function(){return M(!0)},styles:{border:0,minHeight:"400vh"}})]})}var ce,ue=n(93033),de=n.n(ue),me=n(2291),pe=n(7017),fe=n(45008),he=n(59740),ye=function(e){return"".concat(e,"%")};function ve(e){var t=e.cpus,n=e.currentLoad,r=e.history,a=(0,i.useContext)(u.RD),o=a.t,s=a.locale;return(0,ne.jsx)(oe,{id:"cpu-sparkline",title:o("common.cpu"),current:"".concat(Math.floor(n||0),"%"),data:r,description:"".concat(o("system.cores"),": ").concat((null===t||void 0===t?void 0:t.length)||0),dateFn:function(e){return(0,A.mr)(e,"HH:mm:ss",s)},valueFn:ye})}function ge(e){var t=e.instanceCount,n=e.title,r=e.total,a=e.used,o=e.history,i=(0,u.PE)(),s=i.t,l=i.locale,c=!!r,d=r-a,m=c?"(".concat(Math.floor(a/r*100),"%)"):"",p=[];return t&&p.push({title:s("system.instances"),metric:t}),p.push({title:s("system.used"),metric:b()(a)}),c&&p.push({title:s("system.free"),metric:b()(d)},{title:s("system.total"),metric:b()(r)}),(0,ne.jsx)(oe,{id:"mem-sparkline",title:n||s("common.memory"),current:"".concat(b()(Math.floor(a||0))," ").concat(m),data:o,description:p.map((function(e,t){return(0,ne.jsxs)(te.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title)})),dateFn:function(e){return(0,A.mr)(e,"HH:mm:ss",l)},valueFn:b()})}ve.propTypes={cpus:K().array,currentLoad:K().number,history:K().array},ve.defaultProps={cpus:[],currentLoad:0,history:[]},ge.propTypes={title:K().string,instanceCount:K().number,total:K().number,used:K().number,history:K().array},ge.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[]};var xe=["blocklet","cpuHistory","memoryHistory"];function Ze(e){var t=e.blocklet,n=e.cpuHistory,r=e.memoryHistory,a=(0,he.Z)(e,xe),o=t.appRuntimeInfo||{};return(0,ne.jsx)(je,(0,d.Z)((0,d.Z)({component:"div"},a),{},{children:(0,ne.jsxs)(R.ZP,{className:"page-metrics",container:!0,spacing:5,children:[(0,ne.jsx)(R.ZP,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!n.length&&(0,ne.jsx)(ve,{currentLoad:o.cpuUsage||0,history:n,style:{height:150}})},"cpu"),(0,ne.jsx)(R.ZP,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!r.length&&(0,ne.jsx)(ge,{used:o.memoryUsage||0,history:r,style:{height:150}})},"memory")]})}))}Ze.propTypes={blocklet:K().object.isRequired,cpuHistory:K().arrayOf(K().shape({date:K().number,value:K().number})),memoryHistory:K().arrayOf(K().shape({date:K().number,value:K().number}))},Ze.defaultProps={cpuHistory:[],memoryHistory:[]};var be,je=(0,s.Z)(I.Z)(ce||(ce=(0,a.Z)([""]))),ke=n(70998);function De(){var e=(0,u.PE)(),t=e.t,n=e.locale,r=(0,fe.y0)(),a=r.blocklet,o=r.runtimeHistory,s=r.actions.refreshBlocklet,l=(0,i.useMemo)((function(){var e=[];return(0,pe.forEachBlockletSync)(a,(function(t,n){var r=n.ancestors,o=n.id,i=n.level;t.runtimeInfo&&e.push({type:"blocklet",groupId:a.meta.did,groupName:(0,pe.getDisplayName)(a),id:o,name:(0,pe.getDisplayName)(t,!0),blocklet:a,component:t,level:i-1>=0?i-1:0,runtimeInfo:t.runtimeInfo,ancestors:r})})),e}),[a]);(0,i.useEffect)((function(){var e=setInterval((function(){s()}),1e4);return function(){clearInterval(e)}}),[]);var c=[{label:t("common.name"),name:"name",options:{customBodyRenderLite:function(e){var t=l[e],n=t.name,r=t.component,a=t.level,o=t.ancestors;return(0,ne.jsxs)(te.Z,{display:"flex",alignItems:"center",pl:2*a,children:[(0,ne.jsx)(ke.Z,{size:14,blocklet:r,ancestors:o}),(0,ne.jsx)(te.Z,{ml:1,children:n})]})}}},{label:t("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite:function(e){var t,r=l[e].runtimeInfo;return t=r.uptime,de()(Number(t||0),{locale:(0,A.FF)(n)})}}},{label:t("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite:function(e){var t=l[e].runtimeInfo;return b()((null===t||void 0===t?void 0:t.memoryUsage)||0)}}},{label:t("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite:function(e){var t=l[e].runtimeInfo;return"".concat((t.cpuUsage||0).toFixed(1),"%")}}},{label:t("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"}];return(0,ne.jsxs)(Re,{component:"div",children:[(0,ne.jsx)(I.Z,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:t("analytics.trend")}),"running"===a.status?[(0,ne.jsx)(te.Z,{children:(0,ne.jsx)(Ze,{blocklet:a,cpuHistory:o.cpu,memoryHistory:o.memory})}),(0,ne.jsx)(te.Z,{mt:3,children:(0,ne.jsx)(me.Z,{title:t("analytics.detail"),className:"monitor-table",locale:n,data:l,columns:c,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]:(0,ne.jsx)(I.Z,{children:t("blocklet.runtimeInfo.noRunning")})]})}De.propTypes={};var Pe,Re=(0,s.Z)(I.Z)(be||(be=(0,a.Z)([""]))),Ie=n(64864);function Fe(){var e=(0,i.useContext)(u.RD).t,t=(0,Ie.y0)(),n=t.did,r=t.client,a=(0,l.lr)(),s=(0,o.Z)(a,2),d=s[0],m=s[1],p=(0,i.useState)(d.get("tab")||"traffic"),f=(0,o.Z)(p,2),h=f[0],y=f[1];(0,i.useEffect)((function(){d.set("tab",h),m(d,{replace:!0})}),[h]);var v=[{label:e("common.traffic"),value:"traffic"},{label:e("common.runtime"),value:"runtime"}],g={traffic:le,runtime:De},x=g[h]||g.traffic;return(0,ne.jsxs)(we,{children:[(0,ne.jsx)(c.Z,{tabs:v,current:h,onChange:function(e){y(e)}}),(0,ne.jsx)("div",{className:"page-content",children:(0,i.isValidElement)(x)?x:(0,ne.jsx)(x,{client:r,did:n})})]},h)}var we=s.Z.main(Pe||(Pe=(0,a.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-content {\n margin-top: 16px;\n }\n"])))},70998:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(33028),a=n(59740),o=n(24974),i=n.n(o),s=n(59467),l=n(62399),c=n(19611),u=n.n(c),d=n(20244),m=n(41395),p=n(24891);var f=n(37574),h=["blocklet","style","size","ancestors"];function y(e){var t=e.blocklet,n=e.style,o=e.size,i=e.ancestors,c=(0,a.Z)(e,h),y=(0,m.h6)(),v=function(e){var t,n=e.blocklet,r=e.ancestors,a=void 0===r?[]:r,o=(0,m.h6)(),i=o.inService,s="?v=".concat(null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.version).concat((0,p.XN)(null===n||void 0===n?void 0:n.status)?"~":""),l=i?u()(p.zn,d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",s):u()(o.imgPrefix,"blocklet.png");if("registry"===n.source&&n.deployedFrom&&n.meta.logo)l=u()(n.deployedFrom,(0,p.lk)(n.meta.bundleDid,n.meta.logo),s);else{var c=window.env.apiPrefix||"/",f=a.concat(n),h=i?f.slice(1):f;l=u()(c,"/blocklet/logo-bundle".concat(h.map((function(e){return"/".concat(e.meta.did)})).join("")),s)}return{logoUrl:l,inService:i}}({blocklet:t,ancestors:i}),g=v.logoUrl,x=v.inService,Z=c.variant,b=x?function(){}:function(e){e.target.src="".concat(y.imgPrefix,"/blocklet.png")},j=(0,f.jsx)("img",{src:g,onError:b,alt:t.meta.name,style:{width:o}});return t.meta.logo||(j=(0,f.jsx)(l.Z,{did:t.meta.did||"",responsive:!0})),(0,f.jsx)(s.Z,(0,r.Z)((0,r.Z)({variant:Z||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},n)},c),{},{children:j}))}y.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},y.defaultProps={style:{},size:40,ancestors:[]}}}]);
|
|
2
|
-
//# sourceMappingURL=2393.528e5343.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
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 gn},useSecurity:function(){return B}});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),q=L().box.keyPair();function B(){var e=(0,I.Z)("__encKey",{defaultValue:(0,D.z)(q.publicKey),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",{defaultValue:(0,D.z)(q.secretKey),deserializer:function(e){return e},serializer:function(e){return e}}),i=(0,w.Z)(o,2),a=i[0],c=i[1];(0,s.useEffect)((function(){localStorage.getItem("__encKey")||r((0,D.z)(q.publicKey)),localStorage.getItem("__decKey")||c((0,D.z)(q.secretKey))}),[]);return{encryptKey:n,decryptKey:a,decrypt:function(e){return(0,D.pe)(e,n,a)}}}var W=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 N(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 T={};var U=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}}},F="/.well-known/service",H=function(){return b()(window,"blocklet.appPid")||b()(window,"blocklet.appId")||b()(window,"env.appId")||""},K=function(){return(b()(window,"env.apiPrefix")||"/").replace(/\/$/,"").replace(F,"")},V=function(e){return"relay:".concat(H(),":").concat(e)},Q=function(){return"https:"===window.location.protocol?"wss:":"ws:"},G=function(e){return!e||new URL(e).origin===window.location.origin},X=function(e){return["succeed","error","timeout","busy"].includes(e)};function $(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,q=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 U()}),[]),ie=Math.ceil(u/c),ae=(0,s.useState)(!1),se=(0,w.Z)(ae,2),ce=se[0],ue=se[1],le=B(),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 T[c]||(T[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:N(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)}}()),T[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(){q&&G(te.baseUrl)&&H()?(!be.current||!1===be.current.isConnected()||be.current.baseUrl!==te.baseUrl)&&(be.current=new z.WsClient("".concat(Q(),"//").concat(function(e){var t=e||window.location.href;return new URL(t).host}(te.baseUrl)).concat(K()).concat(F,"/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:N(te.baseUrl)})}catch(e){}try{te.token&&ye.current&&(be.current.unsubscribe(V(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:N(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&&(G(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(i){console.error("Invalid nextWorkflow: ".concat(e),i),ne({status:"error",error:"Invalid nextWorkflow: ".concat(e,": ").concat(i.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);var o=n.length>1?n:n[0];b(o,fe,{sourceAppPid:null===l||void 0===l?void 0:l.sourceAppPid})}}})),(0,s.useEffect)((function(){if(te.token&&ke&&be.current){var e=!1;ye.current?ye.current.token!==te.token&&(be.current.unsubscribe(V(ye.current.token)),e=!0):e=!0,e&&(ye.current=be.current.subscribe(V(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:N(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:N(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||X(te.status)?null:c:null),W((function(){ke&&te.token&&!1===X(te.status)&&Ae(!0)})),{state:te,generate:Ze,cancelWhenScanned:function(){return ge((function(e){return e+1}))}}}var Y=n(71171),J=n(54470),ee=n(38361),te=n(78879),ne=n(88674),re=n.n(ne),oe=n(29996),ie=n(94308),ae=n(6200),se=n(72395),ce=n(55581),ue=n(37574),le=(0,s.createContext)({isWalletWebview:!1,isMobile:!1}),de=le.Provider;le.Consumer;function fe(e){var t=e.children,n=(0,A.Z)(),r={isWalletWebview:n.wallet,isMobile:n.mobile.any};return(0,ue.jsx)(de,{value:r,children:t})}var he,pe,ve=n(46840),ge=["children"],we=["children","layout"];function me(e){var t=e.children,n=(0,a.Z)(e,ge);return(0,ue.jsx)(be,(0,r.Z)((0,r.Z)({},n),{},{children:t}))}var be=(0,ce.zo)(ee.Z)(he||(he=(0,Y.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 ye(e){var t=e.children,n=e.layout,o=(0,a.Z)(e,we);if(!t)return null;var i=(0,ve.Z)(t),s=i[0],c=i[1],u=i.slice(2);return(0,ue.jsxs)(ke,(0,r.Z)((0,r.Z)({layout:n},o),{},{children:[(0,ue.jsx)("div",{children:s}),(0,ue.jsx)("div",{children:c}),u]}))}me.propTypes={children:u().any.isRequired},ye.propTypes={layout:u().oneOf(["tb","lr"]),children:u().any},ye.defaultProps={layout:"tb",children:null};var xe,_e,ke=(0,ce.zo)(me)(pe||(pe=(0,Y.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 "})),Ce=n(72097),Se=n(33359),je=n(38996),Ze=n(44181),Pe=n(58082),Oe=n(87138),Ae=n(61923),Me=["status","nextWorkflow","mfaCode","onCancel","onRetry","messages","locale"],ze=(0,ce.zo)(Ce.Z)(xe||(xe=(0,Y.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 De(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,Me),d=R[u]||R.en;return(0,ue.jsxs)(Re,(0,r.Z)((0,r.Z)({},l),{},{children:["scanned"===t&&!n&&(0,ue.jsxs)(ee.Z,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",children:[(0,ue.jsx)(ee.Z,{children:(0,ue.jsx)(Ae.Z,{style:{width:48,height:48,fill:"#4598FA"}})}),(0,ue.jsx)(ee.Z,{mt:2,lineHeight:"34px",color:"#4598fa",fontSize:24,textAlign:"center",fontWeight:400,children:d.scanned}),(0,ue.jsxs)(ee.Z,{mt:1.5,display:"flex",alignItems:"center",children:[(0,ue.jsx)(ee.Z,{color:"#a8b4c5",fontSize:16,fontWeight:400,children:d.connected}),(0,ue.jsx)(se.Z,{style:{height:"1em",marginLeft:8}})]}),o>0&&(0,ue.jsxs)(ee.Z,{mt:3,padding:1,className:"status-mfa",children:[(0,ue.jsx)(ee.Z,{className:"status-mfa-tip",children:d.mfaCode}),(0,ue.jsx)(Se.Z,{className:"status-mfa-code",children:o})]}),(0,ue.jsx)(ee.Z,{mt:4,children:(0,ue.jsx)(ze,{onClick:function(){return i()},children:d.back})})]}),"scanned"===t&&!!n&&(0,ue.jsxs)(ee.Z,{textAlign:"center",className:"status--waiting",children:[(0,ue.jsx)("span",{className:"status-icon",children:(0,ue.jsx)(Pe.Z,{})}),(0,ue.jsx)(ee.Z,{component:"p",className:"status-icon-text",children:d.wait}),(0,ue.jsx)(ee.Z,{className:"status-desc",children:d.waiting}),o>0&&(0,ue.jsxs)(ee.Z,{mt:3,padding:1,className:"status-mfa",children:[(0,ue.jsx)(ee.Z,{className:"status-mfa-tip",children:d.mfaCode}),(0,ue.jsx)(Se.Z,{className:"status-mfa-code",children:o})]})]}),"succeed"===t&&(0,ue.jsxs)(ee.Z,{textAlign:"center",className:"status--succeed",children:[(0,ue.jsx)("span",{className:"status-icon",children:(0,ue.jsx)(je.default,{})}),(0,ue.jsx)(ee.Z,{component:"p",className:"status-icon-text",children:d.success}),(0,ue.jsx)(ee.Z,{className:"status-desc",children:c.success})]}),"error"===t&&(0,ue.jsxs)(ee.Z,{textAlign:"center",className:"status--error",children:[(0,ue.jsx)("span",{className:"status-icon",children:(0,ue.jsx)(Ze.default,{})}),(0,ue.jsx)(ee.Z,{component:"p",className:"status-icon-text",children:d.failed}),(0,ue.jsx)(ee.Z,{className:"status-desc",children:c.error||d.error}),(0,ue.jsx)(ee.Z,{mt:5,children:(0,ue.jsx)(ze,{onClick:s,children:d.retry})})]}),"busy"===t&&(0,ue.jsxs)(ee.Z,{textAlign:"center",className:"status--busy",children:[(0,ue.jsx)("span",{className:"status-icon",children:(0,ue.jsx)(Oe.Z,{})}),(0,ue.jsx)(ee.Z,{component:"p",className:"status-icon-text",children:d.busyTitle}),(0,ue.jsx)(ee.Z,{className:"status-desc",children:c.error||d.busyDesc}),(0,ue.jsx)(ee.Z,{mt:5,children:(0,ue.jsx)(ze,{onClick:s,children:d.retry})})]})]}))}De.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"])},De.defaultProps={status:"",nextWorkflow:"",mfaCode:0,onCancel:function(){},onRetry:function(){},locale:"en"};var Re=(0,ce.zo)(me)(_e||(_e=(0,Y.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"]))),Ee=n(68848),Le=n.n(Ee),Ie=["data","size","image","config"],qe={margin:0,dotsOptions:{type:"dots"},cornersSquareOptions:{type:"extra-rounded"},cornersDotOptions:{type:"dot"}};function Be(e){var t=e.data,n=e.size,o=e.image,i=e.config,c=(0,a.Z)(e,Ie),u=(0,s.useRef)(null),l=(0,s.useMemo)((function(){return(0,r.Z)((0,r.Z)((0,r.Z)({},qe),{},{data:t,width:n,height:n},o&&{image:o,imageOptions:{crossOrigin:"anonymous",margin:0}}),i)}),[t,n,o,i]),d=(0,s.useState)(new(Le())(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,ue.jsx)("div",(0,r.Z)({ref:u},c))}Be.propTypes={data:u().string.isRequired,size:u().number.isRequired,image:u().string,config:u().object},Be.defaultProps={image:null,config:{}};var We,Ne=Be,Te=n(10452),Ue=["onRefresh"];function Fe(e){var t=e.onRefresh,n=(0,a.Z)(e,Ue);return(0,ue.jsx)(He,(0,r.Z)((0,r.Z)({},n),{},{onClick:function(e){e.stopPropagation(),t()},children:(0,ue.jsx)("span",{children:(0,ue.jsx)(Te.Z,{})})}))}var He=(0,ce.zo)("div")(We||(We=(0,Y.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"])));Fe.propTypes={onRefresh:u().func.isRequired};var Ke=["qrcodeSize","tokenState","onRefresh"];function Ve(e){var t=e.qrcodeSize,n=e.tokenState,o=e.onRefresh,i=(0,a.Z)(e,Ke);return(0,ue.jsxs)(ye,(0,r.Z)((0,r.Z)({},i),{},{position:"relative",color:"#A8B4C5",fontWeight:700,status:n.status,children:[(0,ue.jsx)("div",{children:(0,ue.jsx)(ee.Z,{mt:.5,fontSize:20,color:"#666",children:"Mobile Wallet"})}),(0,ue.jsx)(Ne,{data:n.url,size:t}),"timeout"===n.status&&(0,ue.jsx)(Fe,{onRefresh:o})]}))}Ve.propTypes={tokenState:u().object.isRequired,qrcodeSize:u().number.isRequired,onRefresh:u().func.isRequired};var Qe,Ge=n(38222),Xe=["tokenState","onRefresh","webWalletUrl"];function $e(e){var t=e.tokenState,n=e.onRefresh,o=e.webWalletUrl,i=(0,a.Z)(e,Xe),s="lr"===i.layout?48:64,c="timeout"===t.status,u="".concat(i.className||""," ").concat(c?"card-timeout":""),l=new URL(o);return(0,ue.jsxs)(Je,(0,r.Z)((0,r.Z)({},i),{},{color:"#A8B4C5",bgcolor:"#FFF",fontWeight:700,className:u,children:[(0,ue.jsxs)("div",{children:[(0,ue.jsx)(ee.Z,{mt:.5,fontSize:20,color:"#666",children:"Web Wallet"}),(0,M.HG)()?(0,ue.jsx)(ee.Z,{mt:.5,fontSize:12,style:{wordBreak:"break-all"},children:"Web Wallet Extension"}):o?(0,ue.jsx)(ee.Z,{mt:.5,fontSize:12,style:{wordBreak:"break-all"},children:l.hostname}):null]}),(0,ue.jsx)(Ge.Z,{style:{width:s,height:s}}),c&&(0,ue.jsx)(Fe,{onRefresh:n})]}))}$e.propTypes={tokenState:u().object.isRequired,onRefresh:u().func.isRequired,webWalletUrl:u().string},$e.defaultProps={webWalletUrl:""};var Ye,Je=(0,ce.zo)(ye)(Qe||(Qe=(0,Y.Z)(["\n position: relative;\n cursor: pointer;\n &:not(.card-timeout):hover {\n background-color: #f2f8ff;\n svg {\n color: #4598fa;\n }\n }\n"]))),et=n(12118),tt=["tokenState","onRefresh","deepLink"];function nt(e){var t=e.tokenState,n=e.onRefresh,o=e.deepLink,i=(0,a.Z)(e,tt),c="lr"===i.layout?[20,34]:[40,68],u=(0,s.useRef)();return(0,ue.jsxs)(ot,(0,r.Z)((0,r.Z)({},i),{},{color:"#A8B4C5",fontWeight:700,onClick:function(){return u.current.click()},children:[(0,ue.jsxs)("div",{children:[(0,ue.jsx)(ee.Z,{fontSize:16,children:"Open In"}),(0,ue.jsx)(ee.Z,{mt:.5,fontSize:20,color:"#334660",children:"Mobile Wallet"})]}),(0,ue.jsx)(et.Z,{style:{width:c[0],height:c[1]}}),"timeout"===t.status&&(0,ue.jsx)(Fe,{onRefresh:n}),(0,ue.jsx)("a",{href:o,target:"_blank",ref:u,style:{display:"none"},rel:"noreferrer",children:"link"})]}))}var rt,ot=(0,ce.zo)(ye)(Ye||(Ye=(0,Y.Z)(["\n position: relative;\n cursor: pointer;\n"])));nt.propTypes={tokenState:u().object.isRequired,onRefresh:u().func.isRequired,deepLink:u().string.isRequired};var it=["locale"];function at(e){var t=e.locale,n=(0,a.Z)(e,it),o=(0,s.useRef)();return(0,ue.jsxs)(ut,(0,r.Z)((0,r.Z)({},n),{},{onClick:function(){return o.current.click()},children:[(0,ue.jsx)(ee.Z,{component:"span",ml:1,fontWeight:700,fontSize:14,color:"#9397A1",dangerouslySetInnerHTML:{__html:(R[t]||R.en).getWallet}}),(0,ue.jsx)("a",{href:"https://www.didwallet.io/".concat("zh"===t?"zh":"en"),target:"_blank",ref:o,style:{display:"none"},rel:"noreferrer",children:"link"})]}))}at.propTypes={locale:u().oneOf(["en","zh"])},at.defaultProps={locale:"en"};var st,ct,ut=(0,ce.zo)(ee.Z)(rt||(rt=(0,Y.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]))),lt=n(41414),dt=n(94551),ft=n(48082),ht=n(2689),pt=n(12268),vt=n(76032),gt=n.n(vt),wt=n(19611),mt=n.n(wt),bt=n(96628),yt={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"/>'},xt=n(48317),_t=n(75260),kt=n(62399),Ct=["appInfo"],St=function(e){return e?e.split(":").pop():""};function jt(e){var t=e.appInfo,n=(0,a.Z)(e,Ct),o=(0,s.useState)(!1),i=(0,w.Z)(o,2),c=i[0],u=i[1];return c||!t.appUrl&&!t.appLogo?(0,ue.jsx)(kt.Z,{did:t.appPid,size:32}):(0,ue.jsx)(pt.Z,(0,r.Z)((0,r.Z)({src:mt()(t.appUrl||"",t.appLogo||""),alt:t.appName||"Blocklet Icon",width:32,height:32},n),{},{onError:function(){return u(!0)}}))}function Zt(e){var t=e.appInfo,n=e.active;return(0,ue.jsxs)(Rt,{children:[(0,ue.jsx)(jt,{appInfo:t}),(0,ue.jsxs)(ee.Z,{className:"app-info-content",children:[(0,ue.jsx)(ee.Z,{className:"app-info-name",children:t.appName}),t.appPid&&(0,ue.jsx)(_t.Z,{size:14,className:"app-info-did",children:St(t.appPid)})]}),n?(0,ue.jsx)(dt.Z,{color:"success",children:(0,ue.jsx)(bt.JO,{icon:xt.Z,color:"success"})}):null]})}function Pt(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 gt()(t)?null:(0,ue.jsxs)(Et,{children:[t.length>1?(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(dt.Z,{ref:i,size:"small",mr:1,onClick:function(){o.open=!0},children:(0,ue.jsx)(bt.JO,{icon:yt})}),(0,ue.jsx)(ft.Z,{anchorEl:i.current,open:o.open,onClose:function(){o.open=!1},children:t.map((function(e){return(0,ue.jsx)(ht.Z,{onClick:function(){o.open=!1,r(e.sourceAppPid)},children:(0,ue.jsx)(Zt,{appInfo:e,active:e.sourceAppPid===n})},e.appPid)}))})]}):null,(0,ue.jsx)(Zt,{appInfo:a})]})}jt.propTypes={appInfo:u().object.isRequired},Zt.propTypes={appInfo:u().object.isRequired,active:u().bool},Zt.defaultProps={active:!1},Pt.propTypes={appInfoList:u().array,sourceAppPid:u().string,onChangeSourceAppPid:u().func},Pt.defaultProps={appInfoList:[],sourceAppPid:void 0,onChangeSourceAppPid:function(){}};var Ot,At,Mt,zt,Dt,Rt=(0,ce.zo)(ee.Z)(st||(st=(0,Y.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"]))),Et=(0,ce.zo)(ee.Z)(ct||(ct=(0,Y.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"]))),Lt=["locale","tokenKey","messages","qrcodeSize","showDownload","webWalletUrl","tokenState","generate","cancelWhenScanned","enabledConnectTypes","onRecreateSession","extraContent","loadingEle","onError","onSuccess","extraParams","provider","allowWallet","appInfoList","onChangeSourceAppPid"],It=!document.hidden;function qt(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,Lt);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,ce.Fg)(),N=(0,s.useRef)(null),T=(0,te.Z)(N),U=((null===T||void 0===T?void 0:T.width)||0)<600,F=(0,s.useContext)(le),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),J=(0,w.Z)(Y,2),ne=J[0],de=J[1],fe=(0,s.useState)(0),he=(0,w.Z)(fe,2),pe=he[0],ve=he[1],ge=(0,lt.F5)(),we=ge.configs,me=ge.loginOAuth,be=ge.loginOAuthLoading,ye=ge.getProvider,xe=ge.logoutOAuth,_e=Object.entries(we).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})),ke=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},Ce=function(){m(),B.inExistingSession||h(!1)};(0,s.useEffect)((function(){if(H){var e=ke();"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 Se=function(e){(0,M.E7)({webWalletUrl:d,url:e,locale:t})},je=!1,Ze=!1,Pe=(0,s.useMemo)((function(){if(!["created","timeout"].includes(B.status))return!1;if(0===_e.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,_e.length,j,S,O.forceConnected,O.user,C.forceConnected]);["created","timeout"].includes(B.status)&&!H&&(g.includes("web")&&(V||(0,M.HG)())&&(je=!0),Ze=g.includes("mobile"));var Oe=(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,me(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}),{sourceAppPid:null===C||void 0===C?void 0:C.sourceAppPid})),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,xe({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)}}()),Ae=(0,s.useMemo)((function(){if(pe>0)return!1;if("created"===B.status){if(H&&ke())return!0;if(O.autoConnect&&je&&B.saveConnect&&"created"===B.status&&It&&"web"===x().get("connected_wallet_os"))return!0}return!1}),[B.status,je,B.saveConnect]);if((0,s.useEffect)((function(){!1===j&&Pe&&Oe(_e[0])}),[]),!1===j&&(Pe||be||I.loading))return(0,ue.jsx)(Tt,{children:y||(0,ue.jsx)(ie.Z,{sx:{color:ae.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),Re=!Me&&(H||K);if(Me)return(0,ue.jsx)(Tt,{children:y||(0,ue.jsx)(ie.Z,{sx:{color:ae.Z.did.primary}})});O.autoConnect&&je&&B.saveConnect&&"created"===B.status&&"web"===x().get("connected_wallet_os")&&!ne&&B.url&&It&&(de(!0),Se(B.url));var Ee={confirm:u.confirm,success:u.success,error:I.error||f.error||""};return(0,ue.jsx)(Nt,(0,r.Z)((0,r.Z)({},re()(O,["forceConnected","autoConnect"])),{},{theme:W,ref:N,"data-did-auth-url":B.url,children:(0,ue.jsxs)("div",{className:"auth-inner",children:[!ze&&(0,ue.jsx)(Pt,{appInfoList:Z,sourceAppPid:null===C||void 0===C?void 0:C.sourceAppPid,onChangeSourceAppPid:P}),!ze&&(0,ue.jsxs)(Ut,{theme:W,children:[(0,ue.jsx)("h6",{className:"action-info-title",children:u.title}),u.scan&&(0,ue.jsx)("p",{className:"action-info-desc",children:u.scan})]}),(0,ue.jsx)(Ft,{className:U?"auth-main--small":"",children:(0,ue.jsxs)("div",{children:[!ze&&!Ae&&(0,ue.jsxs)(ee.Z,{display:"flex",alignItems:"center",justifyContent:"center",children:[(0,ue.jsx)(ee.Z,{color:"#999",fontSize:14,fontWeight:400,lineHeight:1,children:A.connect}),(0,ue.jsx)(se.Z,{style:{height:"1em",marginLeft:8}})]}),!ze&&Ae&&(0,ue.jsxs)(ee.Z,{display:"flex",alignItems:"center",justifyContent:"center",flexWrap:"wrap",lineHeight:"24px",color:"#999",fontSize:14,fontWeight:400,children:[(0,ue.jsx)(ie.Z,{size:12,sx:{color:ae.Z.did.primary}}),(0,ue.jsxs)(ee.Z,{display:"flex",alignItems:"center",ml:1,lineHeight:1,children:[A.connecting,(0,ue.jsx)(se.Z,{style:{height:"1em",marginLeft:8}})]}),(0,ue.jsx)(ee.Z,{ml:1,children:A.connectingSuffix})]}),(0,ue.jsxs)("div",{className:"auth-main-inner",style:{alignItems:"scanned"===B.status?"center":"stretch"},children:[ze&&(0,ue.jsx)(De,{status:B.status,nextWorkflow:B.nextWorkflow,mfaCode:B.mfaCode,onCancel:function(){m(),B.inExistingSession||(ve(pe+1),p())},onRetry:function(){m(),q((0,r.Z)({},z)),!1!==j?B.inExistingSession||($(!1),h()):Oe(_e[0])},messages:Ee,locale:t,className:"auth-status"}),(je||Ze)&&(0,ue.jsxs)("div",{className:"auth-connect-types",children:[!K&&je&&(0,ue.jsx)($e,{className:"auth-connect-type",layout:U?"lr":"tb",tokenState:B,onRefresh:Ce,onClick:function(){return Se(B.url)},webWalletUrl:d}),Ze&&(0,ue.jsx)(Ve,{className:"auth-connect-type",qrcodeSize:l,tokenState:B,onRefresh:Ce,layout:U?"lr":"tb"}),Re&&(0,ue.jsx)(nt,{deepLink:ke(),className:"auth-connect-type",tokenState:B,onRefresh:Ce,layout:U?"lr":"tb"})]})]}),(Pe||be)&&(0,ue.jsx)(ee.Z,{display:"flex",justifyContent:"center",mt:2,className:"auth-oauth-panel",children:_e.map((function(e){return(0,ue.jsxs)(oe.Z,{variant:"contained",onClick:function(){return Oe(e)},loading:be&&e.provider===ye(),children:[A.loginWithBefore,e.provider,A.loginWithAfter]},e.provider)}))}),!H&&(0,ue.jsx)(at,{locale:t,width:1,p:2,pb:1,mt:2,visibility:ze?"hidden":"visible"}),(je||Ze)&&b]})})]})}))}qt.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},qt.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 Bt,Wt=(0,J.css)(Ot||(Ot=(0,Y.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n"]))),Nt=(0,ce.zo)("div")(At||(At=(0,Y.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"])),Wt),Tt=(0,ce.zo)("div")(Mt||(Mt=(0,Y.Z)(["\n ",";\n height: 100%;\n min-width: 160px;\n min-height: 160px;\n"])),Wt),Ut=(0,ce.zo)("div")(zt||(zt=(0,Y.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")})),Ft=(0,ce.zo)("main")(Dt||(Dt=(0,Y.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"])),Wt,Wt,Wt),Ht=n(84636),Kt=n(87130),Vt=n(75255),Qt=n(10524),Gt=["popup","open","dialogStyle","responsive","hideCloseButton"],Xt=(0,s.forwardRef)((function(e,t){return(0,ue.jsx)(Qt.Z,(0,r.Z)({direction:"up",ref:t},e))}));var $t,Yt=(0,ce.zo)("div")(Bt||(Bt=(0,Y.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"]))),Jt=n(20281),en=n(23283),tn=["webWalletUrl","maxIdleTime"],nn=function(){!function(){var e=document.getElementById($t);e&&document.body.removeChild(e)}(),$t=null},rn=function(e){$t||($t="web_wallet_sw_keeper_".concat(Date.now()),function(e){var t=document.createElement("iframe");t.title="abt wallet",t.id=$t,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 on(e){var t=e.webWalletUrl,n=e.maxIdleTime,r=(0,s.useRef)(!!$t),o=(0,Jt.Z)(n),i=function(){r.current||nn()};return(0,s.useEffect)((function(){o?i():rn(t)}),[o]),(0,s.useEffect)((function(){return function(){return i()}}),[]),null}on.propTypes={webWalletUrl:u().string.isRequired,maxIdleTime:u().number},on.defaultProps={maxIdleTime:18e5};var an=n(64765),sn=n(33665),cn=n(57982),un=(0,s.createContext)(),ln=un.Provider;un.Consumer;function dn(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,cn.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,ue.jsx)(ln,{value:c,children:c?t:null})}dn.propTypes={baseUrl:u().string,children:u().any.isRequired},dn.defaultProps={baseUrl:""};var fn=["baseUrl"];n(40622),n(82236);var hn=["onClose","onSuccess","onError","action","prefix","checkFn","checkInterval","checkTimeout","extraParams","locale","tokenKey","encKey","baseUrl","autoConnect","forceConnected","saveConnect","useSocket","allowWallet","provider","blocklet"];function pn(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,hn);if("function"!==typeof b)throw new Error("Cannot initialize did connect component without a fetchFn");var L=(0,s.useContext)(an.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=$({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,autoConnect:Z});return(0,ue.jsx)(fe,{children:(0,ue.jsx)(qt,(0,r.Z)({},Q))})}pn.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},pn.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 vn,gn=(vn=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,Gt),l=(0,A.Z)(),d=(0,ce.Fg)(),f=(0,Vt.Z)(d.breakpoints.down("md"))&&l.mobile.any;if(!n&&!s)return(0,ue.jsx)(e,(0,r.Z)({},u));var h=!!s||o;return(0,ue.jsx)(Ht.Z,(0,r.Z)((0,r.Z)({open:h,fullScreen:f,maxWidth:"lg",onClose:function(e,t){}},f&&{TransitionComponent:Xt,PaperProps:{style:{background:"transparent"}},style:{paddingTop:44}}),{},{children:(0,ue.jsxs)(Kt.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,ue.jsx)(Yt,{onClick:function(){u.onClose&&u.onClose()},children:"\xd7"}),(0,ue.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,sn.Z)(t),t)),o=(0,s.useContext)(un);return(0,ue.jsx)(e,(0,r.Z)((0,r.Z)({},n),{},{blocklet:o}))}return function(e){var n=e.baseUrl,o=(0,a.Z)(e,fn);return(0,ue.jsx)(dn,{baseUrl:n,children:(0,ue.jsx)(t,(0,r.Z)({baseUrl:n},o))})}}(pn)),function(e){var t=e.webWalletUrl,n=e.maxIdleTime,o=(0,a.Z)(e,tn),i=(0,A.Z)();t=t||(0,en.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,en.PF)(t),d=i.wallet;return(0,ue.jsxs)(ue.Fragment,{children:[!c&&!u&&l&&!d&&(0,ue.jsx)(on,{webWalletUrl:t,maxIdleTime:n}),(0,ue.jsx)(vn,(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+="<";break;case">":t+=">";break;case"&":t+="&";break;case'"':t+=""";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.f3dbcb77.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[3025,6378],{83025:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return P}});var r,s=t(71171),o=t(96234),i=t(30969),a=t(16380),c=t(30734),u=t(33359),l=t(32901),f=t(38361),d=t(238),p=t(29996),v=t(72836),g=t(26022),h=t(20244),m=t(85752),x=t(86776),y=t(37574);var w=(0,a.Z)(d.Z)(r||(r=(0,s.Z)(["\n .header {\n text-align: center;\n margin-bottom: 8px;\n }\n\n .subheader {\n text-align: center;\n margin-bottom: 24px;\n }\n\n .login {\n padding: 24px;\n height: auto;\n min-height: 480px;\n display: flex;\n flex-direction: column;\n }\n\n .connect {\n background: #fafafa;\n }\n"]))),b=(0,m.Z)((function(e){var n=e.SessionContext,t=e.webWalletUrl,r=(0,i.useContext)(n),s=r.api,a=r.session,d=(0,i.useContext)(g.RD),m=d.t,b=d.locale,S=(0,i.useState)(!1),Z=(0,o.Z)(S,2),P=Z[0],N=Z[1],C=(0,c.useNavigate)(),j=(0,x.Z)().setPassportId,I={},k=new URL(window.location.href).searchParams.get("id");return k&&(I.id=k),(0,y.jsx)(w,{children:P?(0,y.jsx)("div",{className:"login",children:(0,y.jsx)("div",{className:"connect",children:(0,y.jsxs)(f.Z,{textAlign:"center",children:[(0,y.jsx)(f.Z,{mb:3,color:"success.main",children:(0,y.jsx)(l.Z,{style:{fontSize:60}})}),(0,y.jsx)(u.Z,{component:"p",variant:"body1",className:"subheader",children:m("issuePassport.dialog.success")}),(0,y.jsx)(f.Z,{mt:3,children:(0,y.jsx)(p.Z,{variant:"contained",color:"primary",onClick:function(){var e;try{a.logout()}catch(n){}((null===(e=window.env)||void 0===e?void 0:e.apiPrefix)||"").startsWith(h.WELLKNOWN_SERVICE_PATH_PREFIX)?C("".concat(h.WELLKNOWN_SERVICE_PATH_PREFIX,"/login"),{replace:!0}):C("/",{replace:!0})},children:m("issuePassport.dialog.loginWithPassport")})})]})})}):(0,y.jsx)(v.default,{className:"connect",action:"issue-passport",forceConnected:!1,autoConnect:!1,checkFn:s.get,checkTimeout:6e5,webWalletUrl:t,onSuccess:function(e){null!==e&&void 0!==e&&e.passportId&&j(e.passportId),N(!0)},locale:b,messages:{title:m("issuePassport.title"),scan:m("issuePassport.description",{name:window.env.appName}),confirm:m("issuePassport.dialog.confirm"),success:m("issuePassport.dialog.success")},extraParams:I})})})),S=t(4485),Z=t(38507);function P(){return(0,y.jsx)(b,{SessionContext:S.B3,webWalletUrl:(0,Z.yP)()})}},86776:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var r=t(96234),s=t(17708);function o(){var e=(0,s.Z)("passportId",""),n=(0,r.Z)(e,3),t=n[0],o=n[1],i=n[2];return{getPassportId:function(){return setTimeout((function(){i()}),0),t||""},setPassportId:o}}},19477:function(e,n,t){var r=t(2717),s=t(37095),o=t(93113);e.exports={translations:{zh:r(o),en:r(s)}}},85752:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var r=t(33028),s=t(26022),o=t(19477),i=t(37574);function a(e){return function(n){return(0,i.jsx)(s.Iw,{translations:o.translations,children:(0,i.jsx)(e,(0,r.Z)({},n))})}}},32901:function(e,n,t){"use strict";var r=t(71600);n.Z=void 0;var s=r(t(48035)),o=t(37574),i=(0,s.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");n.Z=i},46378:function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNavigator=n.isBrowser=n.off=n.on=n.noop=void 0;n.noop=function(){},n.on=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];e&&e.addEventListener&&e.addEventListener.apply(e,n)},n.off=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];e&&e.removeEventListener&&e.removeEventListener.apply(e,n)},n.isBrowser="undefined"!==typeof window,n.isNavigator="undefined"!==typeof navigator},17708:function(e,n,t){"use strict";var r=t(30969),s=t(46378);n.Z=function(e,n,t){if(!s.isBrowser)return[n,s.noop,s.noop];if(!e)throw new Error("useLocalStorage key may not be falsy");var o=t?t.raw?function(e){return e}:t.deserializer:JSON.parse,i=r.useRef((function(e){try{var r=t?t.raw?String:t.serializer:JSON.stringify,s=localStorage.getItem(e);return null!==s?o(s):(n&&localStorage.setItem(e,r(n)),n)}catch(a){return n}})),a=r.useState((function(){return i.current(e)})),c=a[0],u=a[1];r.useLayoutEffect((function(){return u(i.current(e))}),[e]);var l=r.useCallback((function(n){try{var r="function"===typeof n?n(c):n;if("undefined"===typeof r)return;var s=void 0;s=t?t.raw?"string"===typeof r?r:JSON.stringify(r):t.serializer?t.serializer(r):JSON.stringify(r):JSON.stringify(r),localStorage.setItem(e,s),u(o(s))}catch(a){}}),[e,u]),f=r.useCallback((function(){try{localStorage.removeItem(e),u(void 0)}catch(a){}}),[e,u]);return[c,l,f]}}}]);
|
|
2
|
-
//# sourceMappingURL=3025.7dc2fe04.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[4164],{54164:function(n,r,t){"use strict";t.d(r,{Z:function(){return I}});var e=t(11681),i=t(30969),a=t(5713),o=function(n,r){var t=r.manual,o=r.ready,u=void 0===o||o,c=r.defaultParams,s=void 0===c?[]:c,l=r.refreshDeps,f=void 0===l?[]:l,d=r.refreshDepsAction,v=(0,i.useRef)(!1);return v.current=!1,(0,a.Z)((function(){!t&&u&&(v.current=!0,n.run.apply(n,(0,e.__spreadArray)([],(0,e.__read)(s),!1)))}),[u]),(0,a.Z)((function(){v.current||t||(v.current=!0,d?d():n.refresh())}),(0,e.__spreadArray)([],(0,e.__read)(f),!1)),{onBefore:function(){if(!u)return{stopNow:!0}}}};o.onInit=function(n){var r=n.ready,t=void 0===r||r;return{loading:!n.manual&&t}};var u=o,c=t(46121),s=t(14694),l=new Map,f=new Map,d={},v=function(n,r){return d[n]||(d[n]=[]),d[n].push(r),function(){var t=d[n].indexOf(r);d[n].splice(t,1)}},p=function(n,r){var t=r.cacheKey,a=r.cacheTime,o=void 0===a?3e5:a,u=r.staleTime,p=void 0===u?0:u,h=r.setCache,_=r.getCache,y=(0,i.useRef)(),m=(0,i.useRef)(),g=function(n,r){h?h(r):function(n,r,t){var i=l.get(n);(null===i||void 0===i?void 0:i.timer)&&clearTimeout(i.timer);var a=void 0;r>-1&&(a=setTimeout((function(){l.delete(n)}),r)),l.set(n,(0,e.__assign)((0,e.__assign)({},t),{timer:a}))}(n,o,r),function(n,r){d[n]&&d[n].forEach((function(n){return n(r)}))}(n,r.data)},w=function(n,r){return void 0===r&&(r=[]),_?_(r):function(n){return l.get(n)}(n)};return(0,c.Z)((function(){if(t){var r=w(t);r&&Object.hasOwnProperty.call(r,"data")&&(n.state.data=r.data,n.state.params=r.params,(-1===p||(new Date).getTime()-r.time<=p)&&(n.state.loading=!1)),y.current=v(t,(function(r){n.setState({data:r})}))}}),[]),(0,s.Z)((function(){var n;null===(n=y.current)||void 0===n||n.call(y)})),t?{onBefore:function(n){var r=w(t,n);return r&&Object.hasOwnProperty.call(r,"data")?-1===p||(new Date).getTime()-r.time<=p?{loading:!1,data:null===r||void 0===r?void 0:r.data,error:void 0,returnNow:!0}:{data:null===r||void 0===r?void 0:r.data,error:void 0}:{}},onRequest:function(n,r){var i=function(n){return f.get(n)}(t);return i&&i!==m.current||(i=n.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(r),!1)),m.current=i,function(n,r){f.set(n,r),r.then((function(r){return f.delete(n),r})).catch((function(){f.delete(n)}))}(t,i)),{servicePromise:i}},onSuccess:function(r,e){var i;t&&(null===(i=y.current)||void 0===i||i.call(y),g(t,{data:r,params:e,time:(new Date).getTime()}),y.current=v(t,(function(r){n.setState({data:r})})))},onMutate:function(r){var e;t&&(null===(e=y.current)||void 0===e||e.call(y),g(t,{data:r,params:n.state.params,time:(new Date).getTime()}),y.current=v(t,(function(r){n.setState({data:r})})))}}:{}},h=t(17917),_=t.n(h),y=function(n,r){var t=r.debounceWait,a=r.debounceLeading,o=r.debounceTrailing,u=r.debounceMaxWait,c=(0,i.useRef)(),s=(0,i.useMemo)((function(){var n={};return void 0!==a&&(n.leading=a),void 0!==o&&(n.trailing=o),void 0!==u&&(n.maxWait=u),n}),[a,o,u]);return(0,i.useEffect)((function(){if(t){var r=n.runAsync.bind(n);return c.current=_()((function(n){n()}),t,s),n.runAsync=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return new Promise((function(t,i){var a;null===(a=c.current)||void 0===a||a.call(c,(function(){r.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(n),!1)).then(t).catch(i)}))}))},function(){var t;null===(t=c.current)||void 0===t||t.cancel(),n.runAsync=r}}}),[t,s]),t?{onCancel:function(){var n;null===(n=c.current)||void 0===n||n.cancel()}}:{}},m=function(n,r){var t=r.loadingDelay,e=r.ready,a=(0,i.useRef)();if(!t)return{};var o=function(){a.current&&clearTimeout(a.current)};return{onBefore:function(){return o(),!1!==e&&(a.current=setTimeout((function(){n.setState({loading:!0})}),t)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}},g=t(65679);function w(){return!g.Z||"hidden"!==document.visibilityState}var b=[];if(g.Z){window.addEventListener("visibilitychange",(function(){if(w())for(var n=0;n<b.length;n++){(0,b[n])()}}),!1)}var A=function(n){return b.push(n),function(){var r=b.indexOf(n);b.splice(r,1)}},T=function(n,r){var t=r.pollingInterval,e=r.pollingWhenHidden,o=void 0===e||e,u=r.pollingErrorRetryCount,c=void 0===u?-1:u,s=(0,i.useRef)(),l=(0,i.useRef)(),f=(0,i.useRef)(0),d=function(){var n;s.current&&clearTimeout(s.current),null===(n=l.current)||void 0===n||n.call(l)};return(0,a.Z)((function(){t||d()}),[t]),t?{onBefore:function(){d()},onError:function(){f.current+=1},onSuccess:function(){f.current=0},onFinally:function(){-1===c||-1!==c&&f.current<=c?s.current=setTimeout((function(){o||w()?n.refresh():l.current=A((function(){n.refresh()}))}),t):f.current=0},onCancel:function(){d()}}:{}};var P=[];if(g.Z){var Z=function(){if(w()&&(!g.Z||"undefined"===typeof navigator.onLine||navigator.onLine))for(var n=0;n<P.length;n++){(0,P[n])()}};window.addEventListener("visibilitychange",Z,!1),window.addEventListener("focus",Z,!1)}var R=function(n){return P.push(n),function(){var r=P.indexOf(n);r>-1&&P.splice(r,1)}},E=function(n,r){var t=r.refreshOnWindowFocus,a=r.focusTimespan,o=void 0===a?5e3:a,u=(0,i.useRef)(),c=function(){var n;null===(n=u.current)||void 0===n||n.call(u)};return(0,i.useEffect)((function(){if(t){var r=function(n,r){var t=!1;return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];t||(t=!0,n.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(i),!1)),setTimeout((function(){t=!1}),r))}}(n.refresh.bind(n),o);u.current=R((function(){r()}))}return function(){c()}}),[t,o]),(0,s.Z)((function(){c()})),{}},S=function(n,r){var t=r.retryInterval,e=r.retryCount,a=(0,i.useRef)(),o=(0,i.useRef)(0),u=(0,i.useRef)(!1);return e?{onBefore:function(){u.current||(o.current=0),u.current=!1,a.current&&clearTimeout(a.current)},onSuccess:function(){o.current=0},onError:function(){if(o.current+=1,-1===e||o.current<=e){var r=null!==t&&void 0!==t?t:Math.min(1e3*Math.pow(2,o.current),3e4);a.current=setTimeout((function(){u.current=!0,n.refresh()}),r)}else o.current=0},onCancel:function(){o.current=0,a.current&&clearTimeout(a.current)}}:{}},x=t(22356),C=t.n(x),O=function(n,r){var t=r.throttleWait,a=r.throttleLeading,o=r.throttleTrailing,u=(0,i.useRef)(),c={};return void 0!==a&&(c.leading=a),void 0!==o&&(c.trailing=o),(0,i.useEffect)((function(){if(t){var r=n.runAsync.bind(n);return u.current=C()((function(n){n()}),t,c),n.runAsync=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return new Promise((function(t,i){var a;null===(a=u.current)||void 0===a||a.call(u,(function(){r.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(n),!1)).then(t).catch(i)}))}))},function(){var t;n.runAsync=r,null===(t=u.current)||void 0===t||t.cancel()}}}),[t,a,o]),t?{onCancel:function(){var n;null===(n=u.current)||void 0===n||n.cancel()}}:{}},H=t(11322),M=t(35147),B=t(49476),W=t(53778),D=t(63310),F=t(32681),L=function(){function n(n,r,t,i){void 0===i&&(i={}),this.serviceRef=n,this.options=r,this.subscribe=t,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=(0,e.__assign)((0,e.__assign)((0,e.__assign)({},this.state),{loading:!r.manual}),i)}return n.prototype.setState=function(n){void 0===n&&(n={}),this.state=(0,e.__assign)((0,e.__assign)({},this.state),n),this.subscribe()},n.prototype.runPluginHandler=function(n){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var i=this.pluginImpls.map((function(t){var i;return null===(i=t[n])||void 0===i?void 0:i.call.apply(i,(0,e.__spreadArray)([t],(0,e.__read)(r),!1))})).filter(Boolean);return Object.assign.apply(Object,(0,e.__spreadArray)([{}],(0,e.__read)(i),!1))},n.prototype.runAsync=function(){for(var n,r,t,i,a,o,u,c,s,l,f=[],d=0;d<arguments.length;d++)f[d]=arguments[d];return(0,e.__awaiter)(this,void 0,void 0,(function(){var d,v,p,h,_,y,m,g,w,b,A;return(0,e.__generator)(this,(function(T){switch(T.label){case 0:if(this.count+=1,d=this.count,v=this.runPluginHandler("onBefore",f),p=v.stopNow,h=void 0!==p&&p,_=v.returnNow,y=void 0!==_&&_,m=(0,e.__rest)(v,["stopNow","returnNow"]),h)return[2,new Promise((function(){}))];if(this.setState((0,e.__assign)({loading:!0,params:f},m)),y)return[2,Promise.resolve(m.data)];null===(r=(n=this.options).onBefore)||void 0===r||r.call(n,f),T.label=1;case 1:return T.trys.push([1,3,,4]),(g=this.runPluginHandler("onRequest",this.serviceRef.current,f).servicePromise)||(g=(A=this.serviceRef).current.apply(A,(0,e.__spreadArray)([],(0,e.__read)(f),!1))),[4,g];case 2:return w=T.sent(),d!==this.count?[2,new Promise((function(){}))]:(this.setState({data:w,error:void 0,loading:!1}),null===(i=(t=this.options).onSuccess)||void 0===i||i.call(t,w,f),this.runPluginHandler("onSuccess",w,f),null===(o=(a=this.options).onFinally)||void 0===o||o.call(a,f,w,void 0),d===this.count&&this.runPluginHandler("onFinally",f,w,void 0),[2,w]);case 3:if(b=T.sent(),d!==this.count)return[2,new Promise((function(){}))];throw this.setState({error:b,loading:!1}),null===(c=(u=this.options).onError)||void 0===c||c.call(u,b,f),this.runPluginHandler("onError",b,f),null===(l=(s=this.options).onFinally)||void 0===l||l.call(s,f,void 0,b),d===this.count&&this.runPluginHandler("onFinally",f,void 0,b),b;case 4:return[2]}}))}))},n.prototype.run=function(){for(var n=this,r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];this.runAsync.apply(this,(0,e.__spreadArray)([],(0,e.__read)(r),!1)).catch((function(r){n.options.onError||console.error(r)}))},n.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},n.prototype.refresh=function(){this.run.apply(this,(0,e.__spreadArray)([],(0,e.__read)(this.state.params||[]),!1))},n.prototype.refreshAsync=function(){return this.runAsync.apply(this,(0,e.__spreadArray)([],(0,e.__read)(this.state.params||[]),!1))},n.prototype.mutate=function(n){var r=(0,F.mf)(n)?n(this.state.data):n;this.runPluginHandler("onMutate",r),this.setState({data:r})},n}(),j=L;var k=function(n,r,t){void 0===r&&(r={}),void 0===t&&(t=[]);var i=r.manual,a=void 0!==i&&i,o=(0,e.__rest)(r,["manual"]);D.Z&&r.defaultParams&&!Array.isArray(r.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof r.defaultParams));var u=(0,e.__assign)({manual:a},o),l=(0,H.Z)(n),f=(0,W.Z)(),d=(0,c.Z)((function(){var n=t.map((function(n){var r;return null===(r=null===n||void 0===n?void 0:n.onInit)||void 0===r?void 0:r.call(n,u)})).filter(Boolean);return new j(l,u,f,Object.assign.apply(Object,(0,e.__spreadArray)([{}],(0,e.__read)(n),!1)))}),[]);return d.options=u,d.pluginImpls=t.map((function(n){return n(d,u)})),(0,B.Z)((function(){if(!a){var n=d.state.params||r.defaultParams||[];d.run.apply(d,(0,e.__spreadArray)([],(0,e.__read)(n),!1))}})),(0,s.Z)((function(){d.cancel()})),{loading:d.state.loading,data:d.state.data,error:d.state.error,params:d.state.params||[],cancel:(0,M.Z)(d.cancel.bind(d)),refresh:(0,M.Z)(d.refresh.bind(d)),refreshAsync:(0,M.Z)(d.refreshAsync.bind(d)),run:(0,M.Z)(d.run.bind(d)),runAsync:(0,M.Z)(d.runAsync.bind(d)),mutate:(0,M.Z)(d.mutate.bind(d))}};var I=function(n,r,t){return k(n,r,(0,e.__spreadArray)((0,e.__spreadArray)([],(0,e.__read)(t||[]),!1),[y,m,T,E,O,u,p,S],!1))}},17917:function(n,r,t){var e=t(74274),i=t(48257),a=t(24378),o=Math.max,u=Math.min;n.exports=function(n,r,t){var c,s,l,f,d,v,p=0,h=!1,_=!1,y=!0;if("function"!=typeof n)throw new TypeError("Expected a function");function m(r){var t=c,e=s;return c=s=void 0,p=r,f=n.apply(e,t)}function g(n){var t=n-v;return void 0===v||t>=r||t<0||_&&n-p>=l}function w(){var n=i();if(g(n))return b(n);d=setTimeout(w,function(n){var t=r-(n-v);return _?u(t,l-(n-p)):t}(n))}function b(n){return d=void 0,y&&c?m(n):(c=s=void 0,f)}function A(){var n=i(),t=g(n);if(c=arguments,s=this,v=n,t){if(void 0===d)return function(n){return p=n,d=setTimeout(w,r),h?m(n):f}(v);if(_)return clearTimeout(d),d=setTimeout(w,r),m(v)}return void 0===d&&(d=setTimeout(w,r)),f}return r=a(r)||0,e(t)&&(h=!!t.leading,l=(_="maxWait"in t)?o(a(t.maxWait)||0,r):l,y="trailing"in t?!!t.trailing:y),A.cancel=function(){void 0!==d&&clearTimeout(d),p=0,c=v=s=d=void 0},A.flush=function(){return void 0===d?f:b(i())},A}},48257:function(n,r,t){var e=t(95498);n.exports=function(){return e.Date.now()}},22356:function(n,r,t){var e=t(17917),i=t(74274);n.exports=function(n,r,t){var a=!0,o=!0;if("function"!=typeof n)throw new TypeError("Expected a function");return i(t)&&(a="leading"in t?!!t.leading:a,o="trailing"in t?!!t.trailing:o),e(n,r,{leading:a,maxWait:r,trailing:o})}}}]);
|
|
2
|
-
//# sourceMappingURL=4164.5adbbbba.chunk.js.map
|