@abtnode/blocklet-services 1.8.69-beta-650a290b → 1.16.0-beta-8ee536d7
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/middlewares/proxy-to-daemon.js +3 -1
- package/api/services/notification/index.js +1 -0
- package/api/socket/channel/app.js +19 -17
- package/api/socket/channel/relay.js +14 -8
- package/api/socket/util.js +12 -8
- package/build/asset-manifest.json +27 -27
- package/build/index.html +1 -1
- package/build/static/css/{503.b2c1f856.chunk.css → 25.4c069dc5.chunk.css} +1 -1
- package/build/static/js/{511.1dd226f9.chunk.js → 199.53a84333.chunk.js} +2 -2
- package/build/static/js/25.a96aa3ad.chunk.js +3 -0
- package/build/static/js/255.279b1bca.chunk.js +2 -0
- package/build/static/js/371.575d3b08.chunk.js +2 -0
- package/build/static/js/409.1dcd48aa.chunk.js +2 -0
- package/build/static/js/460.018e8b5d.chunk.js +2 -0
- package/build/static/js/557.5f206c85.chunk.js +2 -0
- package/build/static/js/663.11e67b21.chunk.js +3 -0
- package/build/static/js/690.e2a01dd2.chunk.js +3 -0
- package/build/static/js/{712.9667cdcd.chunk.js → 712.f88b2e9d.chunk.js} +2 -3
- package/build/static/js/737.14f154ca.chunk.js +2 -0
- package/build/static/js/main.370f8716.js +3 -0
- package/build/static/js/{main.c9dd5af4.js.LICENSE.txt → main.370f8716.js.LICENSE.txt} +7 -1
- package/package.json +28 -28
- package/build/static/js/248.ad6363a4.chunk.js +0 -2
- package/build/static/js/255.4b68f586.chunk.js +0 -2
- package/build/static/js/371.60842581.chunk.js +0 -2
- package/build/static/js/409.ceb64579.chunk.js +0 -2
- package/build/static/js/503.1b995e29.chunk.js +0 -3
- package/build/static/js/690.f9a59613.chunk.js +0 -3
- package/build/static/js/712.9667cdcd.chunk.js.LICENSE.txt +0 -5
- package/build/static/js/737.76692b09.chunk.js +0 -2
- package/build/static/js/906.ebb2512d.chunk.js +0 -2
- package/build/static/js/950.07fa9e3d.chunk.js +0 -3
- package/build/static/js/main.c9dd5af4.js +0 -3
- /package/build/static/js/{503.1b995e29.chunk.js.LICENSE.txt → 25.a96aa3ad.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{950.07fa9e3d.chunk.js.LICENSE.txt → 663.11e67b21.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{690.f9a59613.chunk.js.LICENSE.txt → 690.e2a01dd2.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[460],{53460:function(e,n,t){t.r(n),t.d(n,{default:function(){return pn}});var r,i=t(71171),o=t(33028),a=t(32723),s=t(34795),c=t(30969),l=t(30734),u=t(16380),d=t(19611),p=t.n(d),f=t(54470),h=t(38361),m=t(90445),x=t(71464),v=t(75255),g=t(42167),b=t(94308),y=t(56229),j=t(19006),k=t(47650),Z=t(20244),w=t(7017),C=t(59505),P=t(38507),S=t(18757),O=t(4485),E=t(17660),L=t(7284),N=t(33359),T=t(81721),_=t(54177),B=t(37574);function A(e){var n=e.onNext,t=(0,g.useLocaleContext)(),r=t.t,i=t.locale,o=(0,O.Tt)(),c=o.api,l=o.session,u=(0,L.useSecurity)().encryptKey,d=(0,E.default)((0,s.Z)((0,a.Z)().mark((function e(){var n,t,r,i,o,s;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=new URL(window.location.href)).pathname=p()(null!==(n=null===(t=window)||void 0===t||null===(r=t.env)||void 0===r?void 0:r.apiPrefix)&&void 0!==n?n:"/","/api/did/setup/token"),i.searchParams.set("_ek_",u),e.next=5,c.get(i.href);case 5:return o=e.sent,s=o.data,e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)})))),f=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(t,r){var i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Array.isArray(t)?t.find((function(e){return e.sessionToken})):t,(0,P.ZB)(r(i.sessionToken)),e.prev=2,e.next=5,l.refresh();case 5:n(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),_.default.error(e.t0.message);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(n,t){return e.apply(this,arguments)}}();return!d.value||d.loading?(0,B.jsx)(T.default,{relative:"parent",children:(0,B.jsx)(b.Z,{})}):d.error?(0,B.jsx)(T.default,{relative:"parent",children:(0,B.jsx)(N.Z,{children:d.error.message})}):(0,B.jsx)(D,{popup:!0,open:!0,hideCloseButton:!0,action:"pre-setup",checkFn:c.get,checkTimeout:6e5,webWalletUrl:(0,P.yP)(),onSuccess:f,locale:i,messages:{title:r("setup.connect.title"),scan:r("setup.connect.scan"),confirm:r("setup.connect.confirm"),success:r("setup.connect.success")},extraParams:{setup:!0,nw:d.value.url}})}A.defaultProps={onNext:function(){}};var I,W,R,D=(0,u.default)(L.default)(r||(r=(0,i.Z)(["\n .action-info-desc {\n padding: 0 72px;\n }\n"]))),F=t(59740),K=t(68079),U=t(96234),z=t(88674),M=t.n(z),q=t(12700),H=t.n(q),G=t(43260),Y=t.n(G),V=t(79476),X=t(65063),Q=t(47768),$=t(65724),J=t(98465),ee=(0,u.default)(J.Z)(I||(I=(0,i.Z)(["\n display: flex;\n flex-direction: column;\n padding-bottom: 16px;\n "," {\n padding-top: 34px;\n padding-bottom: 34px;\n }\n .header {\n width: 100%;\n margin-bottom: 34px;\n "," {\n margin-bottom: 64px;\n }\n }\n .container-main {\n position: relative;\n flex: 1;\n width: 100%;\n }\n .container-inner {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n overflow-y: auto;\n }\n"])),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.up("md")})),ne=t(88029);function te(e){var n=e.blocklet,t=e.onStartNow,r=e.children,i=e.disabled,o=(0,g.useLocaleContext)().t;return!n||(0,P.bg)(n.meta)?(0,B.jsx)(re,{children:r}):(0,B.jsxs)(ie,{children:[(0,B.jsx)(ne.default,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:function(){return t()},children:o("setup.startNow")}),(0,B.jsx)(h.Z,{display:"flex",alignItems:"center",children:r})]})}te.defaultProps={blocklet:null,onStartNow:function(){},children:null,disabled:!1};var re=(0,u.default)(h.Z)(W||(W=(0,i.Z)(["\n padding-top: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n .bottom-button {\n min-width: 200px;\n }\n "," {\n .bottom-button {\n min-width: 150px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),ie=(0,u.default)(h.Z)(R||(R=(0,i.Z)(["\n padding-bottom: 48px;\n padding-top: 24px;\n margin: 0 auto;\n width: 80%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .start-now {\n min-width: 140px;\n }\n .bottom-button {\n min-width: 120px;\n }\n "," {\n width: 100%;\n }\n\n "," {\n .start-now {\n min-width: 100px;\n }\n .bottom-button {\n min-width: 80px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("lg")}),(function(e){return e.theme.breakpoints.down("md")})),oe=t(33665);function ae(e){var n=Object.assign({},((0,oe.Z)(e),e));return(0,B.jsx)(ne.default,(0,o.Z)({className:"bottom-button",variant:"contained",color:"primary"},n))}var se=["childDid"],ce=["value"];function le(e){var n=e.onNext,t=e.onPrevious,r=(0,v.Z)((function(e){return e.breakpoints.down("md")})),i=(0,g.useLocaleContext)().t,l=(0,c.useState)(!1),u=(0,U.Z)(l,2),d=u[0],p=u[1],f=(0,c.useState)(null),m=(0,U.Z)(f,2),x=m[0],b=m[1],y=(0,S.y0)(),j=y.blocklet,k=y.actions,Z=(j.configs||[]).filter((function(e){return!$.BLOCKLET_CONFIGURABLE_KEY[e.key]})),C=j.environments.find((function(e){return"BLOCKLET_PASSPORT_COLOR"===e.key})),P=[{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:i("blocklet.config.name"),value:j.environments.find((function(e){return"BLOCKLET_APP_NAME"===e.key})).value},{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:i("blocklet.config.description"),value:j.environments.find((function(e){return"BLOCKLET_APP_DESCRIPTION"===e.key})).value},{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,description:i("blocklet.config.passportColor"),value:C?C.value:"auto",componentType:"passport",componentProps:{blocklet:j}}],O=[];(0,w.forEachChildSync)(j,(function(e,n){var t=n.ancestors.slice(1).map((function(e){return e.meta.did}));O.push((e.configs||[]).map((function(n){return(0,o.Z)((0,o.Z)({},n),{},{childDid:t.concat(e.meta.did)})})))}));var E=H()(Y()([].concat((0,K.Z)(Z),O)),"key").filter((function(e){return!!e.key})).sort((function(e,n){return e.required&&!n.required?-1:n.required&&!e.required?1:0})),L=(0,w.getAppMissingConfigs)(j).length,N=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){var t,r,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=x.childDid,r=(0,F.Z)(x,se),i=[(0,o.Z)((0,o.Z)({},M()(r,["componentType","componentProps"])),{},{value:n})],e.prev=2,p(!0),e.next=6,k.configBlocklet({configs:i,childDid:t});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),_.default.error(e.t0.message);case 11:return e.prev=11,p(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[2,8,11,14]])})));return function(n){return e.apply(this,arguments)}}(),T={},A=[].concat(P,(0,K.Z)(E)).map((function(e){var n=e.value,t=(0,F.Z)(e,ce);return T[e.key]=n,(0,o.Z)({},t)}));return(0,B.jsxs)(ee,{children:[(0,B.jsx)("div",{className:"header",style:{marginBottom:16},children:(0,B.jsx)(Q.default,{title:i("setup.config.title"),subTitle:i("setup.config.subTitle"),onClickBack:function(){t()}})}),(0,B.jsx)("div",{className:"container-main",children:(0,B.jsx)("div",{className:"container-inner",children:(0,B.jsx)(X.Z,{bottom:(0,B.jsx)(te,{mt:8,disabled:d||x,blocklet:j,onStartNow:function(){return n("complete")},children:(0,B.jsx)(h.Z,{display:"flex",alignItems:"center",children:(0,B.jsx)(ae,{disabled:d||L||x,onClick:function(){k.refreshFuel({showError:!1}),n()},children:i("setup.next")})})}),children:(0,B.jsx)(V.default,{style:{margin:"0 auto 20px",width:"80%",paddingTop:r?0:38},loading:d,schema:A,defaultValue:T,onChange:function(e,n){var t=n.action,r=n.currentItem;"edit"===t?b(r):["cancel","confirm"].includes(t)&&b(null),"confirm"===t&&N(e[r.key])}})})})})]})}le.defaultProps={onNext:function(){},onPrevious:function(){}};var ue,de,pe=t(87006),fe=t(50576),he=t(95803),me=t.n(he),xe=t(48952);function ve(e){var n,t,r,i=e.onNext,l=e.onPrevious,u=(0,c.useContext)(g.LocaleContext),d=u.t,f=u.locale,m=(0,c.useState)(""),x=(0,U.Z)(m,1)[0],v=(0,c.useState)(!1),b=(0,U.Z)(v,2),y=b[0],j=b[1],k=(0,S.y0)(),Z=k.blocklet,w=k.meta,P=(0,c.useState)((null===(n=Z.environments.find((function(e){return e.key===C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===n?void 0:n.value)||""),O=(0,U.Z)(P,2),E=O[0],T=O[1],A=(0,c.useState)("https://service.didspaces.com/app"),I=(0,U.Z)(A,2),W=I[0],R=I[1],D=window.blocklet,F=D.appId,K=D.appName,z=D.appDescription;function M(e,n){return q.apply(this,arguments)}function q(){return(q=(0,s.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 e.next=2,xe.Z.configBlocklet({input:{did:[n],configs:[{key:C.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}).then((function(){_.default.success(d("setup.didSpace.connected",f))})).catch((function(e){console.error(e),_.default.error(e.message)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var H=(0,c.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,checkFn:me().create({baseURL:p()(W,"space")}).get,onSuccess:function(){var e=(0,s.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 T(t(n.endpoint)),e.next=3,M(Z.meta.did,t(n.endpoint));case 3:setTimeout((function(){V((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}),3e3);case 4:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),onClose:function(){V((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),G=(0,U.Z)(H,2),Y=G[0],V=G[1],X=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,fe.isEmpty)(W)){e.next=3;break}return _.default.error(d("setup.didSpace.addressCannotEmpty",f)),e.abrupt("return");case 3:V((function(e){return(0,o.Z)((0,o.Z)({},e),{},{prefix:p()(W,"space/api/did"),baseUrl:new URL(W).origin,checkFn:me().create({baseURL:p()(W,"space")}).get,extraParams:{appDid:F,appName:K,appDescription:z,scopes:"list:object read:object write:object"},open:!0})}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){V((function(e){return(0,o.Z)((0,o.Z)({},e),{},{messages:{title:d("setup.didSpace.authorize.title",{appName:K}),scan:d("setup.didSpace.authorize.scan",{appName:K}),confirm:"",success:(0,B.jsx)(N.Z,{gutterBottom:!0,children:d("setup.didSpace.authorize.success")})}})}))}),[K,f,d]),(0,B.jsxs)(be,{children:[(0,B.jsx)("div",{className:"header",children:(0,B.jsx)(Q.default,{title:d("setup.didSpace.title"),subTitle:d("setup.didSpace.subTitle"),onClickBack:l})}),(0,B.jsx)(ye,{label:d("setup.didSpace.label"),value:W,onChange:function(e){var n=e.target.value;(0,fe.isEmpty)(n)?j(d("setup.didSpace.addressCannotEmpty",f)):j(null),R(n)},autoFocus:!0,size:"small",error:!!y,helperText:y,InputProps:{endAdornment:(0,B.jsx)(ae,{color:"primary",onClick:X,size:"small",sx:{position:"absolute",right:0,display:"flex",justifyContent:"center",alignItems:"center",width:"140px",height:"100%"},children:d(E?"setup.didSpace.reconnect":"setup.didSpace.connect")})}}),E&&(0,B.jsx)(h.Z,{color:"text.secondary",children:(0,B.jsx)(h.Z,{display:"flex",children:(0,B.jsxs)(h.Z,{display:"inline",children:[d("setup.didSpace.tips"),": \xa0"," ",(0,B.jsx)(h.Z,{display:"inline",color:"primary.main",fontWeight:"fontWeightBold",children:d("setup.didSpace.connected")})]})})}),"required"===(null===w||void 0===w||null===(t=w.capabilities)||void 0===t?void 0:t.didSpace)&&(0,B.jsx)(te,{mt:8,children:(0,B.jsx)(ae,{loading:!!x,disabled:y||!!x||!W||!E,onClick:function(){return i()},children:x||d("setup.next")})}),"optional"===(null===w||void 0===w||null===(r=w.capabilities)||void 0===r?void 0:r.didSpace)&&(0,B.jsx)(te,{mt:8,disabled:!!x,blocklet:Z,onStartNow:function(){return i("complete")},children:(0,B.jsx)(ae,{loading:!!x,disabled:!!x,onClick:function(){return i()},children:x||d(E?"setup.continue":"setup.skip")})}),(0,B.jsx)(L.default,{prefix:Y.prefix,open:Y.open,popup:!0,action:Y.action,baseUrl:Y.baseUrl,checkFn:Y.checkFn,onSuccess:Y.onSuccess,onClose:Y.onClose,checkTimeout:Y.checkTimeout,extraParams:Y.extraParams,messages:Y.messages,locale:f})]})}ve.defaultProps={onNext:function(){},onPrevious:function(){}};var ge,be=(0,u.default)(ee)(ue||(ue=(0,i.Z)(["\n height: 100%;\n overflow-y: auto;\n"]))),ye=(0,u.default)(pe.Z)(de||(de=(0,i.Z)(["\n height: 56px;\n width: 580px;\n "," {\n width: 75%;\n }\n input.MuiInputBase-input {\n width: calc(100% - 144px);\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),je=ve,ke=t(85710),Ze=t(62068),we=t(99042),Ce=function(e){return["waiting","creating","renewaling"].includes(null===e||void 0===e?void 0:e.status)},Pe=function(e){return new Promise((function(n,t){var r=setInterval((0,s.Z)((0,a.Z)().mark((function i(){var o,s;return(0,a.Z)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,xe.Z.findCertificateByDomain({input:{domain:e}});case 3:if(o=i.sent,"generated"!==(null===(s=o.cert)||void 0===s?void 0:s.status)){i.next=9;break}return clearInterval(r),n(!0),i.abrupt("return");case 9:Ce(s)||(clearInterval(r),n(!1)),i.next=16;break;case 12:i.prev=12,i.t0=i.catch(0),clearInterval(r),t(i.t0);case 16:case"end":return i.stop()}}),i,null,[[0,12]])}))),1e3)}))},Se=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,xe.Z.issueLetsEncryptCert({input:{domain:n}});case 2:return e.abrupt("return",Pe(n));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();function Oe(e){var n,t=e.onNext,r=e.onPrevious,i=(0,c.useContext)(g.LocaleContext),o=i.t,l=i.locale,u=(0,c.useState)(""),d=(0,U.Z)(u,2),p=d[0],f=d[1],m=(0,c.useState)(!1),x=(0,U.Z)(m,2),v=x[0],b=x[1],y=(0,S.y0)().blocklet,j=(0,c.useState)(""),k=(0,U.Z)(j,2),Z=k[0],C=k[1],P=(0,c.useState)(!1),O=(0,U.Z)(P,2),E=O[0],L=O[1],N=((null===y||void 0===y?void 0:y.site)||{}).domainAliases||[],T=(null===(n=N.filter((function(e){return!e.isProtected}))[0])||void 0===n?void 0:n.value)||"",A=N.filter((function(e){return e.isProtected})).map((function(e){return(0,w.replaceSlotToIp)(e.value,Z)})),I=(0,c.useState)(T),W=(0,U.Z)(I,2),R=W[0],D=W[1],F=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(o("setup.domain.addingDomain")),e.next=3,(0,ke.sleep)(1500);case 3:if(N.some((function(e){return e.value===R}))){e.next=8;break}return e.next=6,xe.Z.addDomainAlias({input:{id:y.site.id,domainAlias:R}});case 6:return e.next=8,xe.Z.takeRoutingSnapshot({input:{dryRun:!1,message:"add domain ".concat(R," from blocklet services")}});case 8:return e.next=10,xe.Z.configBlocklet({input:{did:[y.meta.did],configs:[{key:$.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,value:"http".concat(n?"s":"","://").concat(R)}]}});case 10:t();case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),K=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(){var n,t,r,i,s;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,f(o("setup.domain.checkingResolvable")),e.next=6,(0,ke.sleep)(1500);case 6:return e.next=8,we.Z.get("/dns-resolve?hostname=".concat(R));case 8:if(n=e.sent,t=n.data.address){e.next=12;break}throw new Error(o("setup.domain.cannotResolve",{domain:R}));case 12:if(t===Z){e.next=14;break}throw new Error(o("setup.domain.resolvedAddressError",{domain:R,curDomain:window.location.hostname}));case 14:return f(o("setup.domain.addingCert")),r=!1,e.next=18,xe.Z.findCertificateByDomain({input:{domain:R}});case 18:if(i=e.sent,s=i.cert){e.next=26;break}return e.next=23,Se(R,l);case 23:r=e.sent,e.next=39;break;case 26:if("generated"!==s.status){e.next=30;break}r=!0,e.next=39;break;case 30:if(!["waiting","creating","renewaling"].includes(s.status)){e.next=36;break}return e.next=33,Pe(R);case 33:r=e.sent,e.next=39;break;case 36:return e.next=38,Se(R,l);case 38:r=e.sent;case 39:r?F(r):L(!0),e.next=46;break;case 42:e.prev=42,e.t0=e.catch(2),_.default.error(e.t0.message),f("");case 46:case"end":return e.stop()}}),e,null,[[2,42]])})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){we.Z.get("/dns-resolve?hostname=".concat(window.location.hostname)).then((function(e){var n=e.data;C(n.address||"")})).catch((function(e){console.error(e.message)}))}),[]),(0,B.jsxs)(Ee,{children:[(0,B.jsx)("div",{className:"header",children:(0,B.jsx)(Q.default,{title:o("setup.domain.title"),subTitle:o("setup.domain.subTitle"),onClickBack:r})}),E&&(0,B.jsx)(Ze.default,{PaperProps:{style:{minHeight:"auto"}},open:E,showCloseButton:!1,title:o("setup.domain.genCertFailed"),actions:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ae,{color:"reverse",variant:"text",onClick:function(){f(""),L(!1)},children:o("setup.cancel")}),(0,B.jsx)(ae,{color:"primary",variant:"text",onClick:function(){L(!1),F(!1)},children:o("setup.confirm")})]}),children:o("setup.domain.certFailedDesc")}),(0,B.jsxs)(h.Z,{className:"form",children:[(0,B.jsxs)(h.Z,{children:[(0,B.jsxs)(h.Z,{mb:1,color:"text.primary",fontWeight:"fontWeightBold",children:[(0,B.jsx)(h.Z,{display:"inline",children:o("setup.domain.skipStart")}),(0,B.jsx)(ae,{variant:"text",size:"small",disabled:!!p,onClick:function(){return t()},style:{paddingTop:0},children:(0,B.jsx)("span",{style:{textDecoration:"underline"},children:o("setup.domain.skip")})}),(0,B.jsx)(h.Z,{display:"inline",children:o("setup.domain.skipEnd")})]}),A.map((function(e){return(0,B.jsx)(h.Z,{component:"li",fontWeight:"fontWeightBold",color:"primary.main",children:e})})),(0,B.jsx)(h.Z,{mt:1,fontWeight:"fontWeightBold",color:"text.secondary",children:o("setup.domain.certTip")}),(0,B.jsx)(h.Z,{})]}),(0,B.jsx)(h.Z,{mt:4,fontWeight:"fontWeightBold",children:o("setup.domain.subTitle")}),(0,B.jsx)(pe.Z,{style:{marginTop:16,minHeight:64},label:o("setup.domain.label"),fullWidth:!0,value:R,onChange:function(e){var n=e.target.value;D(n);var t=(0,ke.validateDomain)(n,l);b(t)},autoFocus:!0,size:"small",variant:"outlined",error:!!v,helperText:v}),R&&(0,B.jsxs)(h.Z,{color:"text.secondary",children:[(0,B.jsxs)(h.Z,{display:"flex",children:[o("setup.domain.tipStart"),(0,B.jsx)(h.Z,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:R}),o("setup.domain.tipEnd")]}),(0,B.jsxs)(h.Z,{component:"li",children:[o("setup.domain.recordType"),":"," ",(0,B.jsx)(h.Z,{display:"inline",fontWeight:"fontWeightBold",color:"primary.main",children:"A"})]}),(0,B.jsxs)(h.Z,{component:"li",children:[o("setup.domain.recordValue"),":"," ",(0,B.jsx)(h.Z,{display:"inline",fontWeight:"fontWeightBold",color:"primary.main",children:Z})]})]})]}),(0,B.jsx)(te,{mt:8,disabled:!!p,blocklet:y,onStartNow:function(){return t("complete")},children:R?(0,B.jsx)(ae,{loading:!!p,disabled:v||!!p||!R,onClick:function(){return K()},children:p||o("setup.next")}):(0,B.jsx)(ae,{variant:"outlined",disabled:!!p,onClick:function(){return t()},children:o("setup.skip")})})]})}Oe.defaultProps={onNext:function(){},onPrevious:function(){}};var Ee=(0,u.default)(ee)(ge||(ge=(0,i.Z)(["\n height: 100%;\n overflow-y: auto;\n .form {\n width: 580px;\n word-break: break-all;\n "," {\n width: 80%;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),Le=t(33248),Ne=t(97517),Te=t(49884),_e=t(87535),Be=t(88876),Ae=t(94702),Ie=t(15508),We=t(55829),Re=t(6779),De=t(94551);function Fe(e){var n=e.children,t=(0,g.useLocaleContext)().t;return(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[n,(0,B.jsx)(Re.Z,{title:t("blocklet.config.access.publicInstanceTip"),children:(0,B.jsx)(De.Z,{children:(0,B.jsx)(We.default,{fontSize:"small"})})})]})}var Ke,Ue=(0,c.memo)(Fe);function ze(e){var n=e.onNext,t=(0,Ae.default)(),r=(0,g.useLocaleContext)(),i=r.t,o=r.locale,l=(0,c.useState)(!1),u=(0,U.Z)(l,2),d=u[0],p=u[1],f=(0,c.useState)(""),m=(0,U.Z)(f,2),x=m[0],v=m[1],b=(0,c.useState)(!1),y=(0,U.Z)(b,2),j=y[0],k=y[1],C=(0,S.y0)(),P=C.blocklet,O=C.actions,E=C.getPublicInstance;(0,c.useEffect)((function(){v((0,w.getWhoCanAccess)(P)),k(E(P))}),[P]);var L=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),e.next=4,(0,ke.sleep)(800);case 4:return e.next=6,O.configWhoCanAccess(n);case 6:p(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),p(!1),_.default.error(e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(n){return e.apply(this,arguments)}}(),N=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!d){e.next=2;break}return e.abrupt("return");case 2:return v(n.target.value),e.next=5,L(n.target.value);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),T=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.target.checked,e.prev=1,p(!0),e.next=5,O.configPublicToStore(t);case 5:p(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),p(!1),_.default.error(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(n){return e.apply(this,arguments)}}(),A={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:t.palette.text.secondary};return(0,B.jsxs)(He,{children:[(0,B.jsx)("div",{className:"header",children:(0,B.jsx)(Q.default,{title:i("blocklet.config.access.description")})}),(0,B.jsx)(_e.Z,{component:"fieldset",children:(0,B.jsx)(Ne.Z,{name:"inherit",value:x,onChange:N,children:Ie.default.map((function(e){return(0,B.jsxs)("div",{style:{marginBottom:16},children:[(0,B.jsx)(Te.Z,{value:e.value,control:(0,B.jsx)(Le.Z,{color:"primary"}),label:(0,B.jsxs)("span",{children:[(0,B.jsx)(e.icon,{style:A}),e.title[o]]})}),(0,B.jsxs)(h.Z,{className:"tip",children:[e.description[o],e.value===Z.WHO_CAN_ACCESS.ALL&&x===Z.WHO_CAN_ACCESS.ALL&&"registry"===P.source&&(0,B.jsx)(Ue,{children:(0,B.jsx)(Te.Z,{style:{marginRight:0},value:e.value,control:(0,B.jsx)(Be.Z,{size:"small"}),label:(0,B.jsx)("span",{children:i("blocklet.config.access.publicToStore")}),onChange:T,checked:j,disabled:d})})]})]},e.value)}))})}),(0,B.jsx)(te,{mt:8,disabled:d,blocklet:P,onStartNow:function(){return n("complete")},children:(0,B.jsx)(h.Z,{display:"flex",alignItems:"center",children:(0,B.jsx)(ae,{loading:d,disabled:d,onClick:function(){return n()},children:i("setup.continue")})})})]})}ze.defaultProps={onNext:function(){}};var Me,qe,He=(0,u.default)(ee)(Ke||(Ke=(0,i.Z)(["\n height: 100%;\n overflow-y: auto;\n .header {\n width: 100%;\n }\n .tip {\n margin-left: 32px;\n font-size: 12px;\n margin-top: -8px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.text.secondary})),Ge=u.default.span(Me||(Me=(0,i.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(function(e){return e.theme.palette.error.main})),Ye=t(622),Ve=t(11909),Xe=t(51193),Qe=t.n(Xe);function $e(e){var n=e.onNext,t=e.onPrevious,r=(0,c.useContext)(g.LocaleContext),i=r.locale,a=r.t,s=(0,S.y0)(),l=s.blocklet,u=s.gas,d=s.tokenInfo,f=s.actions,m=(0,O.Tt)().api,x=(0,c.useState)(!1),v=(0,U.Z)(x,2),y=v[0],j=v[1],k=u||{},Z=k.need,w=void 0===Z?"":Z,C=k.current,P=void 0===C?"":C,E=k.owe,N=void 0===E?99999:E,T=k.deficiency,_=k.symbol,A=void 0===_?"":_,I=k.endpoint,W=(I?new URL(I):{}).origin,R=void 0===W?"/":W;(0,c.useEffect)((function(){var e=setInterval((function(){f.refreshFuel()}),2e3);return function(){clearInterval(e)}}),[]);return u?(0,B.jsxs)(tn,{children:[(0,B.jsx)("div",{className:"header",children:(0,B.jsx)(Q.default,{title:a("setup.fuel.title"),onClickBack:t})}),(0,B.jsxs)(h.Z,{className:"qr-body",children:[(0,B.jsxs)(h.Z,{mb:6,className:"tip",children:[a("setup.fuel.tipStart").replace("slot",""),(0,B.jsx)("span",{className:"amount",children:"".concat(w," ").concat(A)}),a("setup.fuel.tipEnd")]}),(0,B.jsx)(h.Z,{fontSize:16,fontWeight:"fontWeightBold",mb:.5,children:a("setup.fuel.addressTitle")}),(0,B.jsxs)(h.Z,{display:"flex",alignItems:"center",children:[(0,B.jsx)(Qe(),{className:"address",children:l.appDid}),(0,B.jsx)(Ye.Z,{style:{lineHeight:1},target:"_blank",href:p()(R,"/explorer/accounts/",l.appDid),underline:"hover",children:(0,B.jsx)(Ve.default,{className:"icon-launch"})})]}),(0,B.jsx)(h.Z,{my:2,children:(0,B.jsx)(ae,{color:"primary",onClick:function(){return j(!0)},disabled:!N,children:a("setup.fuel.fuelApp")})}),(0,B.jsx)(L.default,{popup:!0,open:y,action:"fuel",checkFn:m.get,checkTimeout:6e5,onSuccess:function(){j(!1)},onClose:function(){return j(!1)},locale:i,messages:{title:a("setup.connect.title"),scan:a("setup.connect.scan"),confirm:a("setup.connect.confirm"),success:a("setup.connect.success")},extraParams:(0,o.Z)((0,o.Z)({amount:T},d),{},{endpoint:I})}),(0,B.jsxs)(h.Z,{display:"flex",color:"text.secondary",children:[(0,B.jsxs)(h.Z,{display:"flex",children:[(0,B.jsxs)(h.Z,{children:[a("setup.fuel.need"),":"]}),(0,B.jsx)(h.Z,{ml:.5,color:"primary.main",fontWeight:"fontWeightBold",children:w})]}),(0,B.jsxs)(h.Z,{display:"flex",ml:3,children:[(0,B.jsxs)(h.Z,{children:[a("setup.fuel.current"),":"]}),(0,B.jsx)(h.Z,{ml:.5,color:N>0?"error.main":"primary.main",fontWeight:"fontWeightBold",children:P})]})]})]}),(0,B.jsx)(te,{mt:8,children:(0,B.jsx)(ae,{disabled:N>0,onClick:function(){return n()},children:a("setup.next")})})]}):(0,B.jsx)(h.Z,{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",children:(0,B.jsx)(b.Z,{})})}$e.defaultProps={onNext:function(){},onPrevious:function(){}};var Je,en,nn,tn=(0,u.default)(ee)(qe||(qe=(0,i.Z)(["\n .qr-body {\n width: 580px;\n "," {\n width: 80%;\n }\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .tip {\n font-size: 16px;\n font-weight: bold;\n }\n\n .address {\n width: 100%;\n text-align: center;\n }\n\n .amount {\n color: ",";\n }\n\n .icon-launch {\n font-size: 16px;\n margin-left: 6px;\n line-height: 1;\n color: ",";\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main})),rn=t(23426),on=t(67615);function an(e){var n=e.onPrevious,t=(0,g.useLocaleContext)().t,r=(0,c.useState)(!1),i=(0,U.Z)(r,2),o=i[0],l=i[1],u=(0,c.useState)("starting"),d=(0,U.Z)(u,2),p=d[0],f=d[1],m=(0,c.useState)(),x=(0,U.Z)(m,2),v=x[0],y=x[1],j=(0,S.y0)().blocklet,k=(0,c.useState)(""),Z=(0,U.Z)(k,2),w=Z[0],C=Z[1],O=(0,P.tX)("fromLauncher"),E=!["starting","running"].includes(p),L="starting"===p,N={stopped:t("blocklet.start"),starting:t("blocklet.starting"),running:t("blocklet.open")},T=function(){var e=new URL(window.location.href).searchParams.get("redirect");window.location.href=e?new URL(e,w).href:w},A=function(){var e=(0,s.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 l(!0),f("starting"),e.prev=2,e.next=5,we.Z.post("/blocklet/start",{fromSetup:!0});case 5:l(!1),f("running"),e.next=16;break;case 9:e.prev=9,e.t0=e.catch(2),t=(null===e.t0||void 0===e.t0||null===(n=e.t0.response)||void 0===n?void 0:n.data)||e.t0.message,_.default.error(t),l(!1),f("stopped"),y(t);case 16:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){f(j.status),["starting","running"].includes(j.status)||A()}),[]),(0,c.useEffect)((function(){var e=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(){var n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,on.evaluateURLs)(j.site.domainAliases.map((function(e){return(0,ke.getAccessUrl)(e.value,P.Bq)})));case 2:n=e.sent,C(n[0].url);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();w||e()}),[j,w]);var I=localStorage.getItem("blocklet-server-url"),W=t(v?"setup.complete.failedTitle":"setup.complete.title"),R=L||!w;return O&&!R&&(E?A():T()),(0,B.jsx)(sn,{children:(0,B.jsx)(cn,{variant:v?"error":"success",title:W,footer:(0,B.jsxs)(te,{children:[E&&(0,B.jsx)(ae,{variant:"outlined",disabled:o,onClick:function(){return n()},children:t("setup.previous")}),O?(0,B.jsxs)(dn,{rel:"noreferrer",children:[(0,B.jsx)(b.Z,{size:16,style:{marginRight:14}})," ",t("common.redirecting")]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ae,{style:{marginLeft:E?24:0},disabled:o||L,onClick:function(){return E?A():T()},loading:R,children:N[p]||N.stopped}),("running"===p||v)&&!!I&&(0,B.jsx)(h.Z,{width:"100%",mt:2,children:(0,B.jsx)("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"back-to-server-link",children:t("setup.complete.backToServer")})})]})]})})})}var sn=(0,u.default)(ee)(Je||(Je=(0,i.Z)(["\n justify-content: center;\n .icon-success {\n width: 64px;\n height: 64px;\n color: ",";\n }\n .back-to-server-link {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.success.main}),(function(e){return e.theme.palette.primary.main})),cn=(0,u.default)(rn.default)(en||(en=(0,i.Z)(["\n && .result-footer {\n height: 120px;\n > div {\n flex-wrap: wrap;\n }\n }\n"])));an.defaultProps={onPrevious:function(){}};var ln,un,dn=u.default.a(nn||(nn=(0,i.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 36px;\n color: ",";\n"])),(function(e){return e.theme.palette.primary.main}));function pn(){var e,n,t,r=(0,v.Z)((function(e){return e.breakpoints.down("md")})),i=(0,g.useLocaleContext)(),u=i.t,d=i.locale,x=(0,l.s0)(),E=(0,S.y0)(),L=E.meta,N=E.blocklet,T=E.actions,_=localStorage.getItem("blocklet-server-url"),I=(0,P.tX)("fromLauncher");(0,c.useEffect)((function(){T.refreshMeta(),T.refreshBlocklet({showError:!1}),(0,P.NU)()}),[]),(0,c.useEffect)((function(){T.refreshFuel({showError:!1})}),[null===N||void 0===N||null===(e=N.meta)||void 0===e?void 0:e.did]);var W="".concat(Z.WELLKNOWN_SERVICE_PATH_PREFIX,"/setup"),R=[{key:"connect",name:u("setup.steps.connect"),path:p()(W,"connect")},{key:"access",name:u("setup.steps.access"),path:p()(W,"access")},{key:"domain",name:u("setup.steps.domain"),path:p()(W,"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:[u("setup.steps.didSpace")," ",(0,B.jsx)(Ge,{})]}),path:p()(W,"did-space")};if(t===C.BLOCKLET_APP_SPACE_ENDPOINTS.OPTIONAL)return{key:"did-space",name:(0,B.jsx)(B.Fragment,{children:u("setup.steps.didSpace")}),path:p()(W,"did-space")};throw new Error("capabilities.didSpace cannot take the value ".concat(t))}(N),{key:"config",name:(0,B.jsxs)(B.Fragment,{children:[u("setup.steps.config")," ",(0,P.o2)(L)&&(0,B.jsx)(Ge,{})]}),path:p()(W,"config")},null!==L&&void 0!==L&&null!==(n=L.requirements)&&void 0!==n&&null!==(t=n.fuels)&&void 0!==t&&t.length?{key:"fuel",name:(0,B.jsxs)(B.Fragment,{children:[u("setup.steps.fuel")," ",(0,B.jsx)(Ge,{})]}),path:p()(W,"fuel")}:null].filter(Boolean),D=R.findIndex((function(e){return"".concat(P.Bq.replace(/\/$/,"")).concat(W,"/").concat(e.key)===window.location.pathname})),F=p()(P.Bq,Z.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),K=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){var t,r,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new URL(window.location.href),r=t.search,n?(i=R.findIndex((function(e){return e.key===n})),x(i>-1?"".concat(p()(W,R[i].key)).concat(r):"".concat(p()(W,"complete")).concat(r))):R[D+1]?x("".concat(p()(W,R[D+1].key)).concat(r)):x("".concat(p()(W,"complete")).concat(r)),e.next=4,T.refreshBlocklet();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),U=function(){x(-1)};function z(e,n){return N?(0,B.jsx)(e,(0,o.Z)((0,o.Z)({blocklet:N},n),{},{onNext:K,onPrevious:U})):(0,B.jsx)(h.Z,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:(0,B.jsx)(b.Z,{})})}var M=function(){window.open(_)},q=r?(0,B.jsx)(j.Z,{onClick:M,width:"32",height:"32",style:{cursor:"pointer"}}):(0,B.jsx)(k.Z,{onClick:M,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),H=[{key:"install",name:u("launchBlocklet.steps.installApp"),path:p()(W,"install")},{key:"setup",name:u("setup.steps.launchApp"),children:R}],G=[{key:"agreement",name:u("launchBlocklet.introduction"),path:p()(W,"agreement")}].concat(H);return I&&(G=[{key:"purchase-space",name:u("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:u("launchBlocklet.steps.prepareSpace")}].concat(H)),(0,B.jsxs)(hn,{steps:G,children:[(0,B.jsx)(f.Global,{styles:fn}),(0,B.jsx)(m.default,{locale:d,blockletMeta:(0,o.Z)((0,o.Z)({},L),{},{title:(0,w.getDisplayName)((0,o.Z)((0,o.Z)({},N),{},{meta:L}))}),navLogo:q,pcWidth:"80%",style:{height:"100%"},logoUrl:F,useOfSkeleton:!1,headerEndAddons:(0,B.jsx)(y.Z,{SessionContext:O.B3,sessionManagerProps:{disableLogout:!0}}),launchingText:u("setup.title"),children:(0,B.jsxs)(l.Z5,{children:[(0,B.jsx)(l.AW,{path:"connect",element:(0,B.jsx)(A,{onNext:K})}),(0,B.jsx)(l.AW,{path:"domain",element:z(Oe)}),(0,B.jsx)(l.AW,{path:"did-space",element:z(je)}),(0,B.jsx)(l.AW,{path:"config",element:z(le)}),(0,B.jsx)(l.AW,{path:"access",element:z(ze)}),(0,B.jsx)(l.AW,{path:"fuel",element:z($e)}),(0,B.jsx)(l.AW,{path:"complete",element:z(an)}),(0,B.jsx)(l.AW,{path:"*",element:(0,B.jsx)(l.Fg,{to:"connect".concat(window.location.search),replace:!0})})]})})]})}var fn=(0,f.css)(ln||(ln=(0,i.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),hn=(0,u.default)(x.StepProvider)(un||(un=(0,i.Z)([""])))},98465:function(e,n,t){n.Z=f;var r,i=c(t(16380)),o=c(t(24974)),a=t(37574),s=["children"];function c(e){return e&&e.__esModule?e:{default:e}}function l(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 u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){d(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function d(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}function p(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function f(e){var n=e.children,t=p(e,s);return(0,a.jsx)(x,u(u({},t),{},{children:n}))}f.propTypes={children:o.default.any.isRequired};var h,m,x=i.default.div(r||(h=["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"],m||(m=h.slice(0)),r=Object.freeze(Object.defineProperties(h,{raw:{value:Object.freeze(m)}}))),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("sm")}),(function(e){return e.theme.breakpoints.down("md")}))},56229:function(e,n,t){n.Z=b;var r,i=t(30969),o=m(t(16380)),a=m(t(24974)),s=m(t(98623)),c=t(86822),l=m(t(85820)),u=m(t(71847)),d=t(42167),p=m(t(46513)),f=m(t(91077)),h=t(37574);function m(e){return e&&e.__esModule?e:{default:e}}function x(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 v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){g(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function g(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}function b(e){var n=e.SessionContext,t=e.extraItems,r=e.showLocale,o=e.showHelper,a=e.showSessionManager,m=e.sessionManagerProps,x=(0,i.useContext)(n).session,g=(0,i.useContext)(d.LocaleContext).locale,b=(0,c.useLocation)(),y={"/store":{endpoint:"https://store.blocklet.io"},"/dashboard":{path:"/conceptual/overview"},"/settings/router":{path:"/conceptual/server-architecture"}};return(0,h.jsxs)(k,{children:[t.map((function(e,n){return(0,i.cloneElement)(e,{key:n})})),r&&(0,h.jsx)(u.default,{"data-cy":"locale-addon",icon:p.default,size:23,showText:!1,className:"locale-addon"}),o&&(0,h.jsx)(s.default,{onClick:function(){var e=b.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(g).concat(n.path||""),"_blank")},children:(0,h.jsx)(f.default,{})}),a&&(0,h.jsx)(l.default,v({session:x,size:24,showRole:!0},m))]})}b.propTypes={SessionContext:a.default.object.isRequired,webWalletUrl:a.default.string,extraItems:a.default.array,showLocale:a.default.bool,showSessionManager:a.default.bool,showHelper:a.default.bool,sessionManagerProps:a.default.object},b.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};var y,j,k=o.default.div(r||(y=["\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"],j||(j=y.slice(0)),r=Object.freeze(Object.defineProperties(y,{raw:{value:Object.freeze(j)}}))),(function(e){return e.theme.breakpoints.down("md")}))}}]);
|
|
2
|
+
//# sourceMappingURL=460.018e8b5d.chunk.js.map
|