@abtnode/blocklet-services 1.16.14-beta-7423f9ef → 1.16.14-beta-a2de000a

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.
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[6186],{5954:function(e,n,t){t.d(n,{cK:function(){return d},h6:function(){return p}});var r=t(30969),o=t(41395),i=t(20244),a=t(48952),l=t(90781),c=t(99042),s=t(37574),u=o.sy.Provider;o.sy.Consumer;function d(e){var n=e.children,t="".concat(i.WELLKNOWN_SERVICE_PATH_PREFIX,"/static/images"),r=window.env,o=r.serverDid,d=r.serverVersion,p=r.mode,m={imgPrefix:t,api:a.Z,restApi:c.Z,ws:{getWsClient:l.ZP,create:l.Ue,useSubscription:l.mU},type:"service",info:{did:o,version:d,mode:p}};return(0,s.jsx)(u,{value:{node:m},children:n})}function p(){return(0,r.useContext)(o.sy).node}},6186:function(e,n,t){t.r(n),t.d(n,{default:function(){return Qe}});var r,o=t(71171),i=t(16380),a=t(30969),l=t(30734),c=t(38361),s=t(51711),u=t(47333),d=t(19865),p=t(7017),m=t(20244),f=t(24891),v=t(94308),g=t(43820),h=t(94282),x=t(33028),b=t(32723),Z=t(34795),y=t(96234),k=t(59740),j=t(24974),C=t.n(j),w=t(86822),P=t(17708),D=t(94551),E=t(48082),S=t(75295),R=t(89667),T=t(2689),B=t(37973),N=t(93310),_=t(86008),I=t(33359),A=t(76492),U=t(97517),O=t(49884),L=t(18877),z=t(29996),F=t(59505),M=t(94984),V=t(90617),q=t(41395),K=t(8479),W=t(55008),X=t(45008),G=t(37574),H=["blocklet","onStart","onComplete","variant","hasPermission","useBlockletUrlEvaluation"];function J(e){var n,t,r,o,i=e.blocklet,c=e.onStart,s=e.onComplete,d=e.variant,g=e.hasPermission,h=e.useBlockletUrlEvaluation,j=(0,k.Z)(e,H),C=(0,l.useNavigate)(),J=(0,q.h6)(),Q=(0,a.useState)(null),$=(0,y.Z)(Q,2),ee=$[0],ne=$[1],te=(0,a.useState)(null),re=(0,y.Z)(te,2),oe=re[0],ie=re[1],ae=(0,a.useState)(!1),le=(0,y.Z)(ae,2),ce=le[0],se=le[1],ue=(0,a.useState)(null),de=(0,y.Z)(ue,2),pe=de[0],me=de[1],fe=(0,a.useContext)(u.RD).t,ve=(0,P.Z)("skip-blocklet-setup",!1),ge=(0,y.Z)(ve,1)[0],he=h(i),xe=he.loading,be=he.recommendedUrl,Ze=(0,X.y0)().nftState,ye=(0,p.isInProgress)(i.status),ke=(null===i||void 0===i||null===(n=i.controller)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.value)===F.BLOCKLET_CONTROLLER_STATUS.suspended;null!==Ze&&void 0!==Ze&&Ze.expired||(null===i||void 0===i||null===(r=i.controller)||void 0===r||null===(o=r.status)||void 0===o?void 0:o.reason)!==F.SUSPENDED_REASON.expired||(ke=!1);var je=J.inService,Ce=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,Z.Z)((0,b.Z)().mark((function r(){var o,a,l,u,d;return(0,b.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=function(){var t=(0,Z.Z)((0,b.Z)().mark((function t(r){var o,a,l,u,d,m,v,g,h,x;return(0,b.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c({action:e,blocklet:i}),se(!0),ie(e),me(null),o=!1,t.prev=5,"remove"!==e){t.next=11;break}return t.next=9,n(r);case 9:t.next=38;break;case 11:if("start"!==e){t.next=28;break}if((0,p.hasRunnableComponent)(i)){t.next=15;break}return M.Z.error(fe("blocklet.noComponent")),t.abrupt("return");case 15:if(je||ge||null!==(a=i.settings)&&void 0!==a&&a.initialized||i.mode===F.BLOCKLET_MODES.DEVELOPMENT){t.next=22;break}return l=(0,V.RU)(J.info),(u=new URL(be)).searchParams.set("serverUrl",l),window.open(u.href),s({action:e,blocklet:i}),t.abrupt("return");case 22:return d=i.children.filter((function(e){return!(0,p.isInProgress)(e.status)&&"running"!==e.status})).map((function(e){return e.meta.did})),m={did:i.meta.did,componentDids:d},t.next=26,n({input:m});case 26:t.next=38;break;case 28:if(!["stop","restart","reload"].includes(e)){t.next=35;break}return v=i.children.filter((function(e){return"running"===e.status})).map((function(e){return e.meta.did})),g={did:i.meta.did,componentDids:v},t.next=33,n({input:g});case 33:t.next=38;break;case 35:return h={did:i.meta.did},t.next=38,n({input:h});case 38:if("remove"!==e){t.next=42;break}o=!0,t.next=44;break;case 42:return t.next=44,(0,f._v)(1e3);case 44:"reload"===e&&M.Z.success(fe("blocklet.reloadSuccess")),s({action:e,blocklet:i}),t.next=52;break;case 48:t.prev=48,t.t0=t.catch(5),x="Blocklet ".concat(e," failed: ").concat((0,f.Z)(t.t0)),s({action:e,blocklet:i,error:new Error(x)});case 52:return t.prev=52,o||se(!1),t.finish(52);case 55:case"end":return t.stop()}}),t,null,[[5,48,52,55]])})));return function(e){return t.apply(this,arguments)}}(),a=function(){se(!1),me(null)},l=(0,p.getDisplayName)(i,!0),u=i.mode===F.BLOCKLET_MODES.DEVELOPMENT?{description:function(){return(0,G.jsx)(I.Z,{component:"div",children:(0,G.jsx)(I.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")})})},params:{removeType:"complete"}}:{description:function(e,n){return(0,G.jsxs)(I.Z,{component:"div",children:[(0,G.jsx)(I.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")}),(0,G.jsxs)(U.Z,{name:"removeType",value:e.removeType,onChange:function(t){return n((0,x.Z)((0,x.Z)({},e),{},{removeType:t.target.value}))},children:[(0,G.jsx)(O.Z,{value:"backup",control:(0,G.jsx)(A.Z,{}),label:fe("blocklet.action.removeApplicationAfterBackup")}),(0,G.jsx)(O.Z,{value:"complete",control:(0,G.jsx)(A.Z,{}),label:fe("blocklet.action.removeApplicationComplete")})]})]})},params:{removeType:"backup"}},d={stop:{title:"".concat(fe("common.stop")," ").concat(l),description:fe("blocklet.action.stopDescription"),confirm:fe("blocklet.action.confirmStop"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a},restart:{title:"".concat(fe("common.restart")," ").concat(l),description:fe("blocklet.action.restartDescription"),confirm:fe("blocklet.action.confirmRestart"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a},remove:(0,x.Z)({title:"".concat(fe("common.remove")," ").concat(l),confirm:fe("blocklet.action.confirmRemove"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a},u),cancelDownload:{title:"".concat(fe("common.cancel")),description:fe("blocklet.action.cancelDownloadDescription",{name:l}),confirm:fe("common.confirm"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a}},!t){r.next=9;break}me(d[e]),r.next=11;break;case 9:return r.next=11,o();case 11:case"end":return r.stop()}}),r)})))},we=Boolean(ee),Pe=function(){var e=(0,Z.Z)((0,b.Z)().mark((function e(n,t){return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.stopPropagation(),t.preventDefault()}catch(r){}if(ne(null),"function"!==typeof n.handler){e.next=16;break}return e.prev=3,se(!0),ie(n.action),e.next=8,n.handler();case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),console.error("Blocklet ".concat(n.name," failed: "),e.t0);case 13:return e.prev=13,se(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[3,10,13,16]])})));return function(n,t){return e.apply(this,arguments)}}(),De=!je&&(0,p.isDeletableBlocklet)(i)&&i.structVersion===m.APP_STRUCT_VERSION?{action:"remove",icon:W.Z.Remove,name:fe("common.remove"),handler:Ce("remove",function(){var e=(0,Z.Z)((0,b.Z)().mark((function e(n){return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("backup"!==n.removeType){e.next=4;break}return e.next=4,J.api.backupBlocklet({input:{appDid:i.appDid,to:"disk"}});case 4:return e.next=6,J.api.deleteBlocklet({input:{did:i.meta.did,keepData:!1}});case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),!0),disabled:ye}:null,Ee={action:"remove",icon:W.Z.Remove,name:fe("common.cancel"),handler:Ce("cancelDownload",J.api.cancelDownloadBlocklet,!0)},Se=(0,p.getAppMissingConfigs)(i),Re=[{action:"start",icon:W.Z.Start,name:fe("common.start"),handler:Ce("start",J.api.startBlocklet),disabled:ke||i.children.every((function(e){return"running"===e.status}))||(0,f.XN)(i.status)||xe||ye},{action:"stop",icon:W.Z.Stop,name:fe("common.stop"),handler:Ce("stop",J.api.stopBlocklet,!0),disabled:!["running","starting"].includes(i.status)},{action:"restart",icon:W.Z.Restart,name:fe("common.restart"),handler:Ce("restart",J.api.restartBlocklet,!0),disabled:ke||"running"!==i.status},{action:"reload",icon:W.Z.Reload,name:fe("common.reload"),handler:Ce("reload",J.api.reloadBlocklet),disabled:ke||"running"!==i.status},(0,f.XN)(i.status)?Ee:De,{separator:!0},{onlyInMenu:!0,action:"config",icon:W.Z.Config,name:fe("common.config"),handler:function(){C("/blocklets/".concat(i.meta.did,"/configuration"))},disabled:(0,f.XN)(i.status)},{onlyInMenu:!0,action:"team",icon:W.Z.Group,name:fe("common.manageTeam"),handler:function(){C("/blocklets/".concat(i.meta.did,"/members"))},disabled:(0,f.XN)(i.status)},{onlyInMenu:!0,action:"log",icon:W.Z.Log,name:fe("common.log"),handler:function(){C("/logs/blocklet-".concat(i.meta.did))},disabled:(0,f.XN)(i.status)}].filter(Boolean);return"menu"===d?(0,G.jsxs)(Y,{"data-cy":"blocklet-actions",children:[(0,G.jsx)(D.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":i.meta.did,onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(e.currentTarget)},size:"small",disabled:!g||!(0,f.XN)(i.status)&&ce,children:(0,G.jsx)(B.Z,{})}),(0,G.jsxs)(E.Z,{id:"actions-menu",anchorEl:ee,keepMounted:!0,open:we,onClose:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(null)},PaperProps:{},children:[Se.length>0&&(0,G.jsxs)(L.Z,{style:{maxWidth:"400px"},severity:"error",children:[fe("blocklet.config.missingRequired"),(0,G.jsx)("br",{}),(0,G.jsx)(w.rU,{to:"/blocklets/".concat(i.meta.did,"/components"),children:fe("blocklet.config.gotoFix")})]}),Re.map((function(e,n){return e.separator?(0,G.jsx)(S.Z,{},"separator-".concat(n)):(0,G.jsxs)(T.Z,{dense:!0,onClick:function(n){return Pe(e,n)},disabled:e.disabled,"data-cy":"".concat(e.action,"-blocklet"),children:[(0,G.jsx)(N.Z,{style:{minWidth:24},children:(0,G.jsx)(e.icon,{fontSize:"small"})}),(0,G.jsx)(_.Z,{primary:e.name})]},e.name)}))]}),pe&&(0,G.jsx)(K.Z,{title:pe.title,description:pe.description,confirm:pe.confirm,cancel:pe.cancel,params:pe.params,onConfirm:pe.onConfirm,onCancel:pe.onCancel})]}):(0,G.jsxs)(Y,(0,x.Z)((0,x.Z)({"data-cy":"blocklet-actions"},j),{},{children:[(0,G.jsx)(R.Z,{children:Re.filter((function(e){return!e.separator&&!e.onlyInMenu})).map((function(e){return(0,G.jsxs)(z.Z,{title:e.name,"data-cy":"".concat(e.action,"-blocklet"),onClick:function(){return Pe(e)},disabled:Boolean(e.disabled)||ce,children:[oe===e.action&&ce&&ye?(0,G.jsx)(v.Z,{size:16}):(0,G.jsx)(e.icon,{}),(0,G.jsx)("span",{className:"blocklet-action-text",children:e.name})]},e.name)}))}),pe&&(0,G.jsx)(K.Z,{title:pe.title,description:pe.description,confirm:pe.confirm,cancel:pe.cancel,params:pe.params,onConfirm:pe.onConfirm,onCancel:pe.onCancel})]}))}J.propTypes={blocklet:C().object.isRequired,onStart:C().func.isRequired,onComplete:C().func.isRequired,variant:C().oneOf(["menu","group"]),hasPermission:C().bool,useBlockletUrlEvaluation:C().func},J.defaultProps={variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:function(){var e,n;return{loading:!1,recommendedUrl:null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.href}}};var Y=i.default.div(r||(r=(0,o.Z)(["\n display: flex;\n align-items: center;\n\n @media (max-width: ","px) {\n .MuiButton-root {\n padding: 4px;\n font-size: 10px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.sm})),Q=t(84802),$=t(23299),ee=t(50007),ne=t(77370),te=function(e){var n={},t=null;return(0,p.forEachBlockletSync)(e,(function(e){n[e.meta.bundleDid]?t=(0,p.getDisplayName)(e,!0):e.meta.bundleDid&&(n[e.meta.bundleDid]=!0)})),t},re=function(e,n,t){var r=e.hostname,o=e.href;if(!n)return o;if(t){var i,a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;var l=a[0],c=(((null===(i=n.site)||void 0===i?void 0:i.domainAliases)||[]).map((function(e){return e.value})).filter(Boolean).find((function(e){return e.endsWith(m.DEFAULT_DID_DOMAIN)}))||"").replace(".".concat(m.DEFAULT_DID_DOMAIN),"");return c?o.replace(r,"".concat(c,"-").concat(l,".").concat(m.DEFAULT_IP_DOMAIN_SUFFIX)):o}return o.replace(n.meta.bundleDid,n.appPid)};function oe(){var e=(0,u.PE)().t,n=(0,ne.T)().api,t=(0,X.y0)().blocklet,r=(0,q.h6)().inService,o=(0,a.useState)(!1),i=(0,y.Z)(o,2),l=i[0],s=i[1],d=(0,a.useState)(5),v=(0,y.Z)(d,2),g=v[0],h=v[1],x=t&&t.structVersion!==m.APP_STRUCT_VERSION;return[x&&(0,G.jsxs)($.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,G.jsxs)(c.Z,{display:"flex",alignItems:"center",children:[(0,G.jsx)(z.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return function(){try{if("running"===t.status)return void M.Z.error(e("blocklet.migrate.tip.running"));var n=te(t);if(n)return void M.Z.error(e("blocklet.migrate.tip.duplicate",{name:n}));s(!0)}catch(r){M.Z.error((0,f.Z)(r))}}()},style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,G.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((function(n){return(0,G.jsx)(c.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(n))},n)}))]},"alert"),t&&(0,G.jsx)(ee.default,{popup:!0,open:l,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:n.get,checkTimeout:3e5,onSuccess:function(){var e=re(window.location,t,r);setTimeout((function(){window.location.href=e}),5e3),h(5),setInterval((function(){h((function(e){return e-1}))}),1e3)},extraParams:{appDid:t.appDid,did:t.meta.did,wt:(0,V.iK)(t,!0),title:(0,p.getDisplayName)(t)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:g>=0?e("blocklet.migrate.success",{sec:g}):"Redirecting..."},onClose:function(){return s(!1)}},"connect")]}oe.propTypes={};var ie=t(90781),ae=t(64864),le=t(5954),ce=t(80670),se=t(48952),ue=ce.Gy.Provider,de=(ce.Gy.Consumer,window.env),pe=de.did,me=de.appId;function fe(e){var n,t,r=e.children,o=(0,ae.y0)().blocklet,i=(0,a.useState)([]),l=(0,y.Z)(i,2),c=l[0],s=l[1],u=(0,a.useState)([]),d=(0,y.Z)(u,2),f=d[0],v=d[1],g=(0,a.useState)([]),h=(0,y.Z)(g,2),x=h[0],k=h[1],j=(0,p.getDisplayName)(o),C=(null===(n=((null===o||void 0===o?void 0:o.environments)||[]).find((function(e){return e.key===F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR})))||void 0===n?void 0:n.value)||"auto",w=(null===o||void 0===o?void 0:o.trustedPassports)||[],P=(null===o||void 0===o?void 0:o.trustedFactories)||[],D=!1!==(null===o||void 0===o?void 0:o.enablePassportIssuance),E=function(){var e=(0,Z.Z)((0,b.Z)().mark((function e(){var n;return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,se.Z.doBatchQuery({getRoles:{input:{teamDid:pe}},getPermissions:{input:{teamDid:pe}},getInvitations:{input:{teamDid:pe}}});case 3:n=e.sent,v((n.getRoles.roles||[]).filter((function(e){return!m.RBAC_CONFIG.roles.some((function(n){return n.name===e.name&&(!n.passport||n.ci)}))})).map((function(e){return e.description=e.description||"Use this passport to connect ".concat(j," as ").concat(e.title),e}))),k(n.getPermissions.permissions||[]),s(n.getInvitations.invitations||[]),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),M.Z.error(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();(0,a.useEffect)((function(){var e;null!==o&&void 0!==o&&null!==(e=o.meta)&&void 0!==e&&e.did&&E()}),[null===o||void 0===o||null===(t=o.meta)||void 0===t?void 0:t.did]);var S=function(e){e.teamDid===pe&&E(pe)};(0,ie.mU)(m.EVENTS.USER_ADDED,S,[pe]),(0,ie.mU)(m.EVENTS.USER_REMOVED,S,[pe]),(0,ie.mU)(m.EVENTS.USER_UPDATED,S,[pe]);var R={teamDid:pe,teamIssuerDid:me,teamName:j,invitations:c,roles:f,permissions:x,trustedPassports:w,trustedFactories:P,isNodeTeam:!1,enablePassportIssuance:D,refresh:function(){return E()},passportColor:C,endpoint:window.location.origin,blocklet:o,api:{getUser:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).did,n={teamDid:pe,user:{did:e}};return se.Z.getUser({input:n})},getUsers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.query,t=e.paging,r={teamDid:pe};return t&&(r.paging=t),n&&(r.query=n),r.sort={lastLoginAt:-1},se.Z.getUsers({input:r})},getUsersCountPerRole:function(){return se.Z.getUsersCountPerRole({input:{teamDid:pe}})}}};return(0,G.jsx)(ue,{value:R,children:r})}t(53420);var ve=t(25177),ge=t(75255),he=t(51921),xe=t(19638),be=t(13328);function Ze(e){var n=e.infos,t=(0,u.PE)().t,r=n.map((function(e){return"* ".concat(e.label,": ").concat(e.value)})).join("\n"),o=new URL("https://github.com/blocklet/blocklet-site/issues/new");return o.searchParams.set("title","[Feedback]"),o.searchParams.set("body","\x3c!-- [Enter feedback here] --\x3e\n\n\n\n\x3c!--\nDocument Details\n".concat(r,"\n* Page: ").concat(window.location.href,"\n--\x3e\n")),(0,be.tZ)(c.Z,{sx:{mx:{xs:0,md:2}},children:(0,be.tZ)(xe.Z,{sx:{color:"text.primary"},target:"_blank",href:o.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}Ze.propTypes={infos:C().arrayOf(C().shape({label:C().string,value:C().string}))},Ze.defaultProps={infos:[]};var ye=t(238),ke=t(37433),je=t(39563),Ce=t(93033),we=t.n(Ce),Pe=t(7173),De=t(83176),Ee=t(19886),Se=t.n(Ee),Re=t(22073),Te=t(43178),Be=["chainHost","nftId","retention"],Ne=["sx"];function _e(e){var n,t,r,o=e.chainHost,i=e.nftId,l=(e.retention,(0,k.Z)(e,Be)),s=(0,u.PE)(),d=s.t,p=s.locale,m=(0,Te.Z)({safeIframeRef:null,popoverAnchorEl:null}),g=(0,y.Z)(m,2),h=g[0],b=g[1],Z=(0,a.useRef)(null),j=l.sx,C=void 0===j?{}:j,w=(0,k.Z)(l,Ne),P=(0,Re.Z)((function(){return(0,f.Nh)(o,i)}));if(P.loading)return(0,G.jsxs)(c.Z,(0,x.Z)((0,x.Z)({sx:(0,x.Z)({display:"flex",alignItems:"center",color:"grey",gap:1},C)},w),{},{children:[(0,G.jsx)(v.Z,{size:16}),d("expiration.loading")]}));if(P.error)return console.error(P.error),(0,G.jsx)(Pe.Z,(0,x.Z)((0,x.Z)({label:d("expiration.loadFailed"),color:"error",variant:"success",sx:(0,x.Z)({cursor:"pointer"},C)},w),{},{onClick:function(){return P.retry()}}));var D=(0,f.D9)(P.value),E=null===(n=P.value)||void 0===n||null===(t=n.data)||void 0===t||null===(r=t.value)||void 0===r?void 0:r.launcherUrl,S=Se()(D).isBefore(Se()()),R=Se()(D).diff(Se()(),"ms"),T="success";R<=2592e6&&(T="warning"),S&&(T="error");return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pe.Z,(0,x.Z)((0,x.Z)({label:d("expiration.tips.".concat(T),{validity:we()(R,{locale:(0,f.tA)(p),compact:!0,verbose:!0})}),color:T,variant:"success"!==T?"contained":"outlined",sx:(0,x.Z)({cursor:"pointer"},C)},w),{},{onClick:function(e){b({popoverAnchorEl:e.currentTarget})}})),(0,G.jsx)(De.ZP,{id:"popover-info",open:Boolean(h.popoverAnchorEl),anchorEl:h.popoverAnchorEl,onClose:function(){b({popoverAnchorEl:null})},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,G.jsx)("iframe",{ref:Z,title:d("common.subscription"),width:"360px",height:"600px",style:{border:0},src:(0,f.qZ)({launcherUrl:E,nftId:i,locale:p})})})]})}_e.propTypes={chainHost:C().string.isRequired,nftId:C().string.isRequired,sx:C().object,retention:C().number},_e.defaultProps={sx:{},retention:0};var Ie,Ae=_e;function Ue(e){var n,t=e.children,r=(0,u.PE)().t,o=(0,ae.y0)(),i=o.loading,a=o.error,s=o.actions.refreshBlocklet,d=o.env,p=o.blocklet,g=(0,le.h6)().info,h=(0,l.useLocation)(),x=(0,ge.Z)((function(e){return e.breakpoints.down("md")})),b=[{label:"App ID",value:d.appId},{label:"App Version",value:d.version},{label:"App Bundle Name",value:null===p||void 0===p||null===(n=p.meta)||void 0===n?void 0:n.bundleName},{label:"Server Id",value:g.did},{label:"Server Version",value:g.version}],Z={};return x&&(Z.logo=null),(0,be.BX)(Le,{legacy:!1,fullWidth:!0,headerAddons:function(e){var n,t;if(!(0,V.ep)(p))return e;var r=Array.isArray(e)?e:[e];return r.unshift((0,be.tZ)(Ae,{chainHost:null===p||void 0===p||null===(n=p.controller)||void 0===n?void 0:n.chainHost,nftId:null===p||void 0===p||null===(t=p.controller)||void 0===t?void 0:t.nftId,retention:m.EXPIRED_BLOCKLET_DATA_RETENTION_DAYS,sx:{cursor:"pointer",marginRight:{xs:"8px",md:"48px"}}})),r},headerProps:Z,footerProps:{addon:(0,be.tZ)(Ze,{infos:b})},children:[!p&&i&&(0,be.tZ)(ye.Z,{relative:"parent",children:(0,be.tZ)(v.Z,{})}),!p&&a&&(0,be.BX)(ye.Z,{relative:"parent",children:[(0,be.BX)(c.Z,{display:"flex",alignItems:"center",children:[(0,be.tZ)(ve.Z,{color:"error",sx:{marginRight:1}}),(0,f.Z)(a)]}),(0,be.tZ)(z.Z,{onClick:function(){return s()},children:(0,be.tZ)("span",{style:{textDecoration:"underline"},children:r("common.retry")})})]}),!!p&&(0,be.tZ)("div",{className:"dashboard-layout-body",children:(0,be.tZ)("div",{className:"dashboard-layout-main",children:(0,be.tZ)(c.Z,{className:"dashboard-layout-main",children:(0,be.tZ)(c.Z,{flex:1,padding:"16px",display:"flex",flexDirection:"column",children:(0,be.tZ)(he.ErrorBoundary,{FallbackComponent:ke.H,resetKeys:[h.pathname],children:t})})})})})]})}Ue.defaultProps={children:null};var Oe,Le=(0,i.default)(je.Z)(Ie||(Ie=(0,o.Z)(["\n .dashboard-layout-body {\n flex: 1;\n display: flex;\n padding-top: 16px;\n }\n .dashboard-layout-main {\n flex: 1;\n padding: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n"]))),ze=t(38507),Fe=(0,a.lazy)((function(){return Promise.all([t.e(926),t.e(6326)]).then(t.bind(t,56326))})),Me=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(2631),t.e(4212),t.e(2291),t.e(617),t.e(2653)]).then(t.bind(t,92653))})),Ve=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(4319),t.e(252),t.e(3593)]).then(t.bind(t,23593))})),qe=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(2631),t.e(4212),t.e(2291),t.e(4764),t.e(1546),t.e(878),t.e(5541),t.e(5355)]).then(t.bind(t,29733))})),Ke=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7606),t.e(3154),t.e(6771)]).then(t.bind(t,26771))})),We=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(576),t.e(5645),t.e(5982)]).then(t.bind(t,25205))})),Xe=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(5960),t.e(576),t.e(2631),t.e(9260),t.e(4764),t.e(8365),t.e(4023)]).then(t.bind(t,4023))})),Ge=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(576),t.e(2631),t.e(4212),t.e(2291),t.e(4164),t.e(8527),t.e(3179),t.e(9657),t.e(8179)]).then(t.bind(t,58179))})),He=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(576),t.e(4212),t.e(4164),t.e(4319),t.e(445),t.e(9260),t.e(5465),t.e(7606),t.e(6921),t.e(1546),t.e(7272),t.e(5541),t.e(1565)]).then(t.bind(t,31565))})),Je=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(2631),t.e(4212),t.e(2291),t.e(5465),t.e(6700),t.e(2393)]).then(t.bind(t,2393))}));function Ye(){var e,n,t=(0,l.useNavigate)(),r=(0,l.useParams)().tab,o=void 0===r?"overview":r,i=(0,ae.y0)(),x=i.blocklet,b=i.actions.refreshBlocklet,Z=(0,u.PE)().t,y=null===x||void 0===x||null===(e=x.meta)||void 0===e?void 0:e.did,k=!x||(0,f.wS)(x.status)?[]:(0,p.getAppMissingConfigs)(x),j=[{label:Z("common.overview"),value:"overview"},{label:(0,G.jsx)(s.Z,{color:"error",variant:"dot",invisible:!k.length,children:Z("common.components")}),value:"components"}];(0,f.wS)(null===x||void 0===x?void 0:x.status)||j.push({label:Z("common.configuration"),value:"configuration"}),j.push({label:Z("common.auditLogs"),value:"audit-logs"}),x&&null!==(n=x.children)&&void 0!==n&&n.length&&x.structVersion===m.APP_STRUCT_VERSION&&j.push({label:Z("common.logs"),value:"logs"}),j.push({label:Z("common.configNavigation"),value:"navigation"}),j.push({label:Z("common.storage"),value:"storage"});var C=(0,G.jsx)(Ke,{scope:y,categories:["blocklet","team","security","certificates","gateway"]}),w={overview:(0,G.jsx)(Fe,{}),members:(0,G.jsx)(c.Z,{mt:-5,children:(0,G.jsx)(Me,{type:"blocklet",createPassportSvg:ze.Ju})}),passports:(0,G.jsx)(c.Z,{mt:-4.5,children:(0,G.jsx)(Ve,{createPassportSvg:ze.Ju})}),components:He,configuration:(0,G.jsx)(qe,{blocklet:x,onUpdate:function(){b()}}),"audit-logs":C,logs:We,navigation:Xe,storage:(0,G.jsx)(Ge,{}),analytics:(0,G.jsx)(c.Z,{mt:-5,children:(0,G.jsx)(Je,{})})},P=w[o]||w.overview,D=!["members","passports","analytics"].includes(o),E=x?(0,G.jsxs)(g.g,{type:"components",children:[D&&(0,G.jsx)(d.Z,{tabs:j,current:o,onChange:function(e){t("".concat(m.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/").concat(e))},scrollButtons:"auto"}),(0,G.jsx)("div",{className:"page-content",children:(0,G.jsx)(a.Suspense,{fallback:(0,G.jsx)(v.Z,{}),children:(0,a.isValidElement)(P)?P:(0,G.jsx)(P,{blocklet:x})})})]}):(0,G.jsx)(v.Z,{});return(0,G.jsx)(le.cK,{children:(0,G.jsx)(fe,{children:(0,G.jsx)(Ue,{children:(0,G.jsxs)($e,{children:[D&&(0,G.jsxs)(c.Z,{component:"div",className:"page-header",children:[(0,G.jsxs)(c.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[x?(0,G.jsx)(Q.Z,{blocklet:x,style:{marginRight:16}}):null,x?(0,G.jsxs)(c.Z,{display:"flex",alignItems:"center",children:[(0,G.jsx)(c.Z,{children:(0,p.getDisplayName)(x)}),"unknown"!==(null===x||void 0===x?void 0:x.status)&&(0,G.jsx)(h.Z,{size:"12px",style:{marginLeft:8},status:x.status,source:x.source})]}):"".concat(Z("common.blocklet")," ").concat(Z("common.detail"))]}),x?(0,G.jsx)(J,{className:"page-actions",hasPermission:!0,blocklet:x,onStart:function(){},onComplete:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).error;e&&M.Z.error(e.message)},variant:"group"}):null]}),(0,G.jsx)(oe,{}),E]})})})})}function Qe(){var e,n=(0,ae.y0)().blocklet,t=null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.did;return(0,a.useEffect)((function(){var e=(0,ie.ZP)();return t&&e.connect(),function(){t&&e.isConnected()&&e.disconnect()}}),[t]),(0,G.jsx)(Ye,{})}var $e=i.default.main(Oe||(Oe=(0,o.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 36px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.md}))},84802:function(e,n,t){t.d(n,{Z:function(){return m}});var r=t(33028),o=t(59740),i=t(24974),a=t.n(i),l=t(59467),c=t(62399),s=t(59505),u=t(15300),d=t(37574),p=["blocklet","style","size"];function m(e){var n,t=e.blocklet,i=e.style,a=e.size,m=(0,o.Z)(e,p),f=(0,u.Z)({blocklet:t}).logoUrl,v=m.variant,g=(0,d.jsx)("img",{src:f,alt:"",style:{width:a}});t.meta.logo||((null===(n=(t.configs||[]).find((function(e){return e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE})))||void 0===n?void 0:n.value)||(g=(0,d.jsx)(c.Z,{did:t.meta.did||"",responsive:!0})));return(0,d.jsx)(l.Z,(0,r.Z)((0,r.Z)({variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,borderRadius:10},i)},m),{},{children:g}))}m.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string])},m.defaultProps={style:{},size:40}},55008:function(e,n,t){var r=t(10814),o=t(8825),i=t(60003),a=t(13875),l=t(57256),c=t(14079),s=t(51389),u=t(98127);n.Z={Start:o.Z,Stop:i.Z,Restart:a.default,Reload:l.Z,Remove:r.default,Config:c.Z,Log:s.Z,Group:u.Z}},94282:function(e,n,t){t.d(n,{Z:function(){return h}});var r=t(33028),o=t(59740),i=t(30969),a=t(24974),l=t.n(a),c=t(94308),s=t(6779),u=t(47333),d=t(7017),p=t(19708),m=t(61472),f=t(37574),v=["status","variant","source"],g={yellow:"#FFCF71",grey:"#888888"};function h(e){var n=e.status,t=e.variant,a=(e.source,(0,o.Z)(e,v)),l=(0,i.useContext)(u.RD).t,h={added:g.grey,waiting:g.yellow,downloading:g.yellow,downloaded:g.grey,installing:g.yellow,installed:g.grey,starting:g.yellow,running:"success",stopping:g.yellow,stopped:g.grey,error:"error",upgrading:g.yellow,restarting:g.yellow,corrupted:"error",deleting:g.yellow},x=(0,d.isInProgress)(n),b=l("blocklet.status.".concat(n));return"dot"===t?(0,f.jsx)(s.Z,{title:l("blocklet.statusTip",{status:b}),children:(0,f.jsx)(p.Z,(0,r.Z)({color:h[n]},a))}):(0,f.jsxs)(m.Z,(0,r.Z)((0,r.Z)({type:{added:"primary",waiting:"warning",downloading:"warning",downloaded:"primary",installing:"warning",installed:"primary",starting:"warning",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"warning",restarting:"warning",corrupted:"error",deleting:"warning"}[n]},a),{},{children:[x&&(0,f.jsx)(c.Z,{size:12,color:"inherit",style:{marginRight:5}}),b]}))}h.propTypes={status:l().string.isRequired,variant:l().oneOf(["dot","tag"]),source:l().string},h.defaultProps={variant:"tag",source:""}},8479:function(e,n,t){t.d(n,{Z:function(){return D}});var r=t(71171),o=t(32723),i=t(34795),a=t(96234),l=t(30969),c=t(24974),s=t.n(c),u=t(16380),d=t(84636),p=t(94308),m=t(96074),f=t(59071),v=t(43207),g=t(38357),h=t(18877),x=t(94702),b=t(75255),Z=t(47333),y=t(29996),k=t(24891),j=t(45555);var C,w=function(){var e=(0,j.Z)();return{minWidth:(0,b.Z)(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}},P=t(37574);function D(e){var n=e.title,t=e.description,r=e.showCancel,c=e.cancel,s=e.confirm,u=e.color,d=e.params,j=e.onCancel,C=e.onConfirm,D=e.loading,S=(0,l.useState)(d),R=(0,a.Z)(S,2),T=R[0],B=R[1],N=(0,l.useState)(!0),_=(0,a.Z)(N,2),I=_[0],A=_[1],U=(0,l.useState)(!1),O=(0,a.Z)(U,2),L=O[0],z=O[1],F=(0,l.useState)(""),M=(0,a.Z)(F,2),V=M[0],q=M[1],K=(0,Z.PE)().t,W=(0,x.Z)(),X=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(n){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!==typeof n){e.next=17;break}return z(!0),e.prev=2,e.next=5,n(T);case 5:A(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),q((0,k.Z)(e.t0)),console.error(e.t0);case 12:return e.prev=12,z(!1),e.finish(12);case 15:e.next=18;break;case 17:A(!1);case 18:case"end":return e.stop()}}),e,null,[[2,8,12,15]])})));return function(n){return e.apply(this,arguments)}}(),G="function"===typeof n?n():n,H="function"===typeof t?t(T,B,q):t,J=(0,b.Z)(W.breakpoints.down("md")),Y=w().minWidth;return(0,P.jsxs)(E,{onClick:function(e){e.stopPropagation()},fullScreen:J,open:I,style:{minWidth:Y},children:[(0,P.jsx)(g.Z,{children:G}),(0,P.jsxs)(f.Z,{style:{minWidth:Y},children:[(0,P.jsx)(v.Z,{component:"div",children:H}),!!V&&(0,P.jsx)(h.Z,{severity:"error",style:{width:"100%",marginTop:8},children:V})]}),(0,P.jsxs)(m.Z,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[r&&(0,P.jsx)(y.Z,{onClick:function(e){e.stopPropagation(),X(j)},color:"inherit","data-cy":"cancel-confirm-dialog",children:c||K("common.cancel")}),(0,P.jsxs)(y.Z,{onClick:function(e){e.stopPropagation(),X(C)},color:u,disabled:T.__disableConfirm||L||D,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(L||D)&&(0,P.jsx)(p.Z,{size:16}),s]})]})]})}D.propTypes={title:s().any.isRequired,description:s().any.isRequired,showCancel:s().bool,cancel:s().string,color:s().string,confirm:s().string,params:s().object,onCancel:s().func,onConfirm:s().func.isRequired,loading:s().bool},D.defaultProps={onCancel:function(){},showCancel:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1};var E=(0,u.default)(d.Z)(C||(C=(0,r.Z)(["\n .delete-actions .Mui-disabled {\n color: rgba(0, 0, 0, 0.26) !important;\n box-shadow: none;\n background-color: rgba(0, 0, 0, 0.12) !important;\n }\n"])))},43820:function(e,n,t){t.d(n,{K:function(){return m},g:function(){return p}});var r=t(68079),o=t(96234),i=t(30969),a=t(24974),l=t.n(a),c=t(16986),s=t.n(c),u=t(37574),d=(0,i.createContext)({});function p(e){var n=e.children,t=e.type,a=(0,i.useState)([]),l=(0,o.Z)(a,2),c=l[0],p=l[1],m=(0,i.useRef)([]),f=function(e){if(m.current.includes(e)){var n=m.current.filter((function(n){return n!==e}));p(n),m.current=n}};return(0,u.jsx)(d.Provider,{value:{type:t,deletingBlocklets:c,addDeletingDid:function(e){if(!m.current.includes(e)){var n=[].concat((0,r.Z)(m.current),[e]);p(n),m.current=n}},removeDeletingDid:f,matchDeletingDid:function(e){var n=c.filter((function(n){return e.find((function(e){return e===n}))}));s()(n,c).forEach((function(e){return f(e)}))}},children:n})}function m(){return(0,i.useContext)(d)}p.propTypes={type:l().string,children:l().node.isRequired},p.defaultProps={type:"blocklets"}},41395:function(e,n,t){t.d(n,{h6:function(){return a},sy:function(){return i}});var r=t(33028),o=t(30969),i=(0,o.createContext)({});i.Provider,i.Consumer;function a(){var e=(0,o.useContext)(i).node;return(0,r.Z)((0,r.Z)({},e),{},{inService:"service"===e.type,inDaemon:"daemon"===e.type})}},77370:function(e,n,t){t.d(n,{B:function(){return o.B3},T:function(){return i}});var r=t(30969),o=t(35371);function i(){return(0,r.useContext)(o.B3)}},80670:function(e,n,t){t.d(n,{DJ:function(){return i},Gy:function(){return o}});var r=t(30969),o=(0,r.createContext)({});o.Provider,o.Consumer;function i(){return(0,r.useContext)(o)}},19708:function(e,n,t){var r,o=t(71171),i=t(16380),a={success:"#3ab39d",error:"#D0021B"},l="10px",c=i.default.div(r||(r=(0,o.Z)(["\n display: inline-block;\n width: ",";\n height: ",";\n background: ",";\n border-radius: 100%;\n"])),(function(e){return e.size||l}),(function(e){return e.size||l}),(function(e){return a[e.color]||e.color||a.success}));n.Z=c},15300:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(19611),o=t.n(r),i=t(41395),a=t(24891);function l(e){var n,t,r=e.blocklet,l=(0,i.h6)().inService,c=(null===(n=window.env)||void 0===n?void 0:n.apiPrefix)||"/",s="?v=".concat(null===r||void 0===r||null===(t=r.meta)||void 0===t?void 0:t.version).concat((0,a.wS)(null===r||void 0===r?void 0:r.status)?"~":"");return{logoUrl:o()(c,"/blocklet/logo/".concat(l?"":r.meta.did),s)}}},61472:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(33028),o=t(59740),i=t(24974),a=t.n(i),l=t(9715),c=t(37574),s=["children","style"];function u(e){var n=e.children,t=e.style,i=(0,o.Z)(e,s);return(0,c.jsx)(l.Z,(0,r.Z)((0,r.Z)({style:t},i),{},{children:n}))}u.propTypes={children:a().any.isRequired,style:a().object},u.defaultProps={style:{}}}}]);
2
- //# sourceMappingURL=6186.6cc57610.chunk.js.map
1
+ "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[6186],{5954:function(e,n,t){t.d(n,{cK:function(){return d},h6:function(){return p}});var r=t(30969),o=t(41395),i=t(20244),a=t(48952),l=t(90781),c=t(99042),s=t(37574),u=o.sy.Provider;o.sy.Consumer;function d(e){var n=e.children,t="".concat(i.WELLKNOWN_SERVICE_PATH_PREFIX,"/static/images"),r=window.env,o=r.serverDid,d=r.serverVersion,p=r.mode,m={imgPrefix:t,api:a.Z,restApi:c.Z,ws:{getWsClient:l.ZP,create:l.Ue,useSubscription:l.mU},type:"service",info:{did:o,version:d,mode:p}};return(0,s.jsx)(u,{value:{node:m},children:n})}function p(){return(0,r.useContext)(o.sy).node}},6186:function(e,n,t){t.r(n),t.d(n,{default:function(){return Qe}});var r,o=t(71171),i=t(16380),a=t(30969),l=t(30734),c=t(38361),s=t(51711),u=t(47333),d=t(19865),p=t(7017),m=t(20244),f=t(24891),v=t(94308),g=t(43820),h=t(94282),x=t(33028),b=t(32723),Z=t(34795),y=t(96234),k=t(59740),j=t(24974),C=t.n(j),w=t(86822),P=t(17708),D=t(94551),E=t(48082),S=t(75295),R=t(89667),T=t(2689),B=t(37973),N=t(93310),_=t(86008),I=t(33359),A=t(76492),U=t(97517),O=t(49884),L=t(18877),z=t(29996),F=t(59505),M=t(94984),V=t(90617),q=t(41395),K=t(8479),W=t(55008),X=t(45008),G=t(37574),H=["blocklet","onStart","onComplete","variant","hasPermission","useBlockletUrlEvaluation"];function J(e){var n,t,r,o,i=e.blocklet,c=e.onStart,s=e.onComplete,d=e.variant,g=e.hasPermission,h=e.useBlockletUrlEvaluation,j=(0,k.Z)(e,H),C=(0,l.useNavigate)(),J=(0,q.h6)(),Q=(0,a.useState)(null),$=(0,y.Z)(Q,2),ee=$[0],ne=$[1],te=(0,a.useState)(null),re=(0,y.Z)(te,2),oe=re[0],ie=re[1],ae=(0,a.useState)(!1),le=(0,y.Z)(ae,2),ce=le[0],se=le[1],ue=(0,a.useState)(null),de=(0,y.Z)(ue,2),pe=de[0],me=de[1],fe=(0,a.useContext)(u.RD).t,ve=(0,P.Z)("skip-blocklet-setup",!1),ge=(0,y.Z)(ve,1)[0],he=h(i),xe=he.loading,be=he.recommendedUrl,Ze=(0,X.y0)().nftState,ye=(0,p.isInProgress)(i.status),ke=(null===i||void 0===i||null===(n=i.controller)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.value)===F.BLOCKLET_CONTROLLER_STATUS.suspended;null!==Ze&&void 0!==Ze&&Ze.expired||(null===i||void 0===i||null===(r=i.controller)||void 0===r||null===(o=r.status)||void 0===o?void 0:o.reason)!==F.SUSPENDED_REASON.expired||(ke=!1);var je=J.inService,Ce=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,Z.Z)((0,b.Z)().mark((function r(){var o,a,l,u,d;return(0,b.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=function(){var t=(0,Z.Z)((0,b.Z)().mark((function t(r){var o,a,l,u,d,m,v,g,h,x;return(0,b.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c({action:e,blocklet:i}),se(!0),ie(e),me(null),o=!1,t.prev=5,"remove"!==e){t.next=11;break}return t.next=9,n(r);case 9:t.next=38;break;case 11:if("start"!==e){t.next=28;break}if((0,p.hasRunnableComponent)(i)){t.next=15;break}return M.Z.error(fe("blocklet.noComponent")),t.abrupt("return");case 15:if(je||ge||null!==(a=i.settings)&&void 0!==a&&a.initialized||i.mode===F.BLOCKLET_MODES.DEVELOPMENT){t.next=22;break}return l=(0,V.RU)(J.info),(u=new URL(be)).searchParams.set("serverUrl",l),window.open(u.href),s({action:e,blocklet:i}),t.abrupt("return");case 22:return d=i.children.filter((function(e){return!(0,p.isInProgress)(e.status)&&"running"!==e.status})).map((function(e){return e.meta.did})),m={did:i.meta.did,componentDids:d},t.next=26,n({input:m});case 26:t.next=38;break;case 28:if(!["stop","restart","reload"].includes(e)){t.next=35;break}return v=i.children.filter((function(e){return"running"===e.status})).map((function(e){return e.meta.did})),g={did:i.meta.did,componentDids:v},t.next=33,n({input:g});case 33:t.next=38;break;case 35:return h={did:i.meta.did},t.next=38,n({input:h});case 38:if("remove"!==e){t.next=42;break}o=!0,t.next=44;break;case 42:return t.next=44,(0,f._v)(1e3);case 44:"reload"===e&&M.Z.success(fe("blocklet.reloadSuccess")),s({action:e,blocklet:i}),t.next=52;break;case 48:t.prev=48,t.t0=t.catch(5),x="Blocklet ".concat(e," failed: ").concat((0,f.Z)(t.t0)),s({action:e,blocklet:i,error:new Error(x)});case 52:return t.prev=52,o||se(!1),t.finish(52);case 55:case"end":return t.stop()}}),t,null,[[5,48,52,55]])})));return function(e){return t.apply(this,arguments)}}(),a=function(){se(!1),me(null)},l=(0,p.getDisplayName)(i,!0),u=i.mode===F.BLOCKLET_MODES.DEVELOPMENT?{description:function(){return(0,G.jsx)(I.Z,{component:"div",children:(0,G.jsx)(I.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")})})},params:{removeType:"complete"}}:{description:function(e,n){return(0,G.jsxs)(I.Z,{component:"div",children:[(0,G.jsx)(I.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")}),(0,G.jsxs)(U.Z,{name:"removeType",value:e.removeType,onChange:function(t){return n((0,x.Z)((0,x.Z)({},e),{},{removeType:t.target.value}))},children:[(0,G.jsx)(O.Z,{value:"backup",control:(0,G.jsx)(A.Z,{}),label:fe("blocklet.action.removeApplicationAfterBackup")}),(0,G.jsx)(O.Z,{value:"complete",control:(0,G.jsx)(A.Z,{}),label:fe("blocklet.action.removeApplicationComplete")})]})]})},params:{removeType:"backup"}},d={stop:{title:"".concat(fe("common.stop")," ").concat(l),description:fe("blocklet.action.stopDescription"),confirm:fe("blocklet.action.confirmStop"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a},restart:{title:"".concat(fe("common.restart")," ").concat(l),description:fe("blocklet.action.restartDescription"),confirm:fe("blocklet.action.confirmRestart"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a},remove:(0,x.Z)({title:"".concat(fe("common.remove")," ").concat(l),confirm:fe("blocklet.action.confirmRemove"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a},u),cancelDownload:{title:"".concat(fe("common.cancel")),description:fe("blocklet.action.cancelDownloadDescription",{name:l}),confirm:fe("common.confirm"),cancel:fe("common.cancel"),onConfirm:o,onCancel:a}},!t){r.next=9;break}me(d[e]),r.next=11;break;case 9:return r.next=11,o();case 11:case"end":return r.stop()}}),r)})))},we=Boolean(ee),Pe=function(){var e=(0,Z.Z)((0,b.Z)().mark((function e(n,t){return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.stopPropagation(),t.preventDefault()}catch(r){}if(ne(null),"function"!==typeof n.handler){e.next=16;break}return e.prev=3,se(!0),ie(n.action),e.next=8,n.handler();case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),console.error("Blocklet ".concat(n.name," failed: "),e.t0);case 13:return e.prev=13,se(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[3,10,13,16]])})));return function(n,t){return e.apply(this,arguments)}}(),De=!je&&(0,p.isDeletableBlocklet)(i)&&i.structVersion===m.APP_STRUCT_VERSION?{action:"remove",icon:W.Z.Remove,name:fe("common.remove"),handler:Ce("remove",function(){var e=(0,Z.Z)((0,b.Z)().mark((function e(n){return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("backup"!==n.removeType){e.next=4;break}return e.next=4,J.api.backupBlocklet({input:{appDid:i.appDid,to:"disk"}});case 4:return e.next=6,J.api.deleteBlocklet({input:{did:i.meta.did,keepData:!1}});case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),!0),disabled:ye}:null,Ee={action:"remove",icon:W.Z.Remove,name:fe("common.cancel"),handler:Ce("cancelDownload",J.api.cancelDownloadBlocklet,!0)},Se=(0,p.getAppMissingConfigs)(i),Re=[{action:"start",icon:W.Z.Start,name:fe("common.start"),handler:Ce("start",J.api.startBlocklet),disabled:ke||i.children.every((function(e){return"running"===e.status}))||(0,f.XN)(i.status)||xe||ye},{action:"stop",icon:W.Z.Stop,name:fe("common.stop"),handler:Ce("stop",J.api.stopBlocklet,!0),disabled:!["running","starting"].includes(i.status)},{action:"restart",icon:W.Z.Restart,name:fe("common.restart"),handler:Ce("restart",J.api.restartBlocklet,!0),disabled:ke||"running"!==i.status},{action:"reload",icon:W.Z.Reload,name:fe("common.reload"),handler:Ce("reload",J.api.reloadBlocklet),disabled:ke||"running"!==i.status},(0,f.XN)(i.status)?Ee:De,{separator:!0},{onlyInMenu:!0,action:"config",icon:W.Z.Config,name:fe("common.config"),handler:function(){C("/blocklets/".concat(i.meta.did,"/configuration"))},disabled:(0,f.XN)(i.status)},{onlyInMenu:!0,action:"team",icon:W.Z.Group,name:fe("common.manageTeam"),handler:function(){C("/blocklets/".concat(i.meta.did,"/members"))},disabled:(0,f.XN)(i.status)},{onlyInMenu:!0,action:"log",icon:W.Z.Log,name:fe("common.log"),handler:function(){C("/logs/blocklet-".concat(i.meta.did))},disabled:(0,f.XN)(i.status)}].filter(Boolean);return"menu"===d?(0,G.jsxs)(Y,{"data-cy":"blocklet-actions",children:[(0,G.jsx)(D.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":i.meta.did,onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(e.currentTarget)},size:"small",disabled:!g||!(0,f.XN)(i.status)&&ce,children:(0,G.jsx)(B.Z,{})}),(0,G.jsxs)(E.Z,{id:"actions-menu",anchorEl:ee,keepMounted:!0,open:we,onClose:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(null)},PaperProps:{},children:[Se.length>0&&(0,G.jsxs)(L.Z,{style:{maxWidth:"400px"},severity:"error",children:[fe("blocklet.config.missingRequired"),(0,G.jsx)("br",{}),(0,G.jsx)(w.rU,{to:"/blocklets/".concat(i.meta.did,"/components"),children:fe("blocklet.config.gotoFix")})]}),Re.map((function(e,n){return e.separator?(0,G.jsx)(S.Z,{},"separator-".concat(n)):(0,G.jsxs)(T.Z,{dense:!0,onClick:function(n){return Pe(e,n)},disabled:e.disabled,"data-cy":"".concat(e.action,"-blocklet"),children:[(0,G.jsx)(N.Z,{style:{minWidth:24},children:(0,G.jsx)(e.icon,{fontSize:"small"})}),(0,G.jsx)(_.Z,{primary:e.name})]},e.name)}))]}),pe&&(0,G.jsx)(K.Z,{title:pe.title,description:pe.description,confirm:pe.confirm,cancel:pe.cancel,params:pe.params,onConfirm:pe.onConfirm,onCancel:pe.onCancel})]}):(0,G.jsxs)(Y,(0,x.Z)((0,x.Z)({"data-cy":"blocklet-actions"},j),{},{children:[(0,G.jsx)(R.Z,{children:Re.filter((function(e){return!e.separator&&!e.onlyInMenu})).map((function(e){return(0,G.jsxs)(z.Z,{title:e.name,"data-cy":"".concat(e.action,"-blocklet"),onClick:function(){return Pe(e)},disabled:Boolean(e.disabled)||ce,children:[oe===e.action&&ce&&ye?(0,G.jsx)(v.Z,{size:16}):(0,G.jsx)(e.icon,{}),(0,G.jsx)("span",{className:"blocklet-action-text",children:e.name})]},e.name)}))}),pe&&(0,G.jsx)(K.Z,{title:pe.title,description:pe.description,confirm:pe.confirm,cancel:pe.cancel,params:pe.params,onConfirm:pe.onConfirm,onCancel:pe.onCancel})]}))}J.propTypes={blocklet:C().object.isRequired,onStart:C().func.isRequired,onComplete:C().func.isRequired,variant:C().oneOf(["menu","group"]),hasPermission:C().bool,useBlockletUrlEvaluation:C().func},J.defaultProps={variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:function(){var e,n;return{loading:!1,recommendedUrl:null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.href}}};var Y=i.default.div(r||(r=(0,o.Z)(["\n display: flex;\n align-items: center;\n\n @media (max-width: ","px) {\n .MuiButton-root {\n padding: 4px;\n font-size: 10px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.sm})),Q=t(84802),$=t(23299),ee=t(50007),ne=t(77370),te=function(e){var n={},t=null;return(0,p.forEachBlockletSync)(e,(function(e){n[e.meta.bundleDid]?t=(0,p.getDisplayName)(e,!0):e.meta.bundleDid&&(n[e.meta.bundleDid]=!0)})),t},re=function(e,n,t){var r=e.hostname,o=e.href;if(!n)return o;if(t){var i,a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;var l=a[0],c=(((null===(i=n.site)||void 0===i?void 0:i.domainAliases)||[]).map((function(e){return e.value})).filter(Boolean).find((function(e){return e.endsWith(m.DEFAULT_DID_DOMAIN)}))||"").replace(".".concat(m.DEFAULT_DID_DOMAIN),"");return c?o.replace(r,"".concat(c,"-").concat(l,".").concat(m.DEFAULT_IP_DOMAIN_SUFFIX)):o}return o.replace(n.meta.bundleDid,n.appPid)};function oe(){var e=(0,u.PE)().t,n=(0,ne.T)().api,t=(0,X.y0)().blocklet,r=(0,q.h6)().inService,o=(0,a.useState)(!1),i=(0,y.Z)(o,2),l=i[0],s=i[1],d=(0,a.useState)(5),v=(0,y.Z)(d,2),g=v[0],h=v[1],x=t&&t.structVersion!==m.APP_STRUCT_VERSION;return[x&&(0,G.jsxs)($.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,G.jsxs)(c.Z,{display:"flex",alignItems:"center",children:[(0,G.jsx)(z.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return function(){try{if("running"===t.status)return void M.Z.error(e("blocklet.migrate.tip.running"));var n=te(t);if(n)return void M.Z.error(e("blocklet.migrate.tip.duplicate",{name:n}));s(!0)}catch(r){M.Z.error((0,f.Z)(r))}}()},style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,G.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((function(n){return(0,G.jsx)(c.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(n))},n)}))]},"alert"),t&&(0,G.jsx)(ee.default,{popup:!0,open:l,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:n.get,checkTimeout:3e5,onSuccess:function(){var e=re(window.location,t,r);setTimeout((function(){window.location.href=e}),5e3),h(5),setInterval((function(){h((function(e){return e-1}))}),1e3)},extraParams:{appDid:t.appDid,did:t.meta.did,wt:(0,V.iK)(t,!0),title:(0,p.getDisplayName)(t)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:g>=0?e("blocklet.migrate.success",{sec:g}):"Redirecting..."},onClose:function(){return s(!1)}},"connect")]}oe.propTypes={};var ie=t(90781),ae=t(64864),le=t(5954),ce=t(80670),se=t(48952),ue=ce.Gy.Provider,de=(ce.Gy.Consumer,window.env),pe=de.did,me=de.appId;function fe(e){var n,t,r=e.children,o=(0,ae.y0)().blocklet,i=(0,a.useState)([]),l=(0,y.Z)(i,2),c=l[0],s=l[1],u=(0,a.useState)([]),d=(0,y.Z)(u,2),f=d[0],v=d[1],g=(0,a.useState)([]),h=(0,y.Z)(g,2),x=h[0],k=h[1],j=(0,p.getDisplayName)(o),C=(null===(n=((null===o||void 0===o?void 0:o.environments)||[]).find((function(e){return e.key===F.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR})))||void 0===n?void 0:n.value)||"auto",w=(null===o||void 0===o?void 0:o.trustedPassports)||[],P=(null===o||void 0===o?void 0:o.trustedFactories)||[],D=!1!==(null===o||void 0===o?void 0:o.enablePassportIssuance),E=function(){var e=(0,Z.Z)((0,b.Z)().mark((function e(){var n;return(0,b.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,se.Z.doBatchQuery({getRoles:{input:{teamDid:pe}},getPermissions:{input:{teamDid:pe}},getInvitations:{input:{teamDid:pe}}});case 3:n=e.sent,v((n.getRoles.roles||[]).filter((function(e){return!m.RBAC_CONFIG.roles.some((function(n){return n.name===e.name&&(!n.passport||n.ci)}))})).map((function(e){return e.description=e.description||"Use this passport to connect ".concat(j," as ").concat(e.title),e}))),k(n.getPermissions.permissions||[]),s(n.getInvitations.invitations||[]),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),M.Z.error(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();(0,a.useEffect)((function(){var e;null!==o&&void 0!==o&&null!==(e=o.meta)&&void 0!==e&&e.did&&E()}),[null===o||void 0===o||null===(t=o.meta)||void 0===t?void 0:t.did]);var S=function(e){e.teamDid===pe&&E(pe)};(0,ie.mU)(m.EVENTS.USER_ADDED,S,[pe]),(0,ie.mU)(m.EVENTS.USER_REMOVED,S,[pe]),(0,ie.mU)(m.EVENTS.USER_UPDATED,S,[pe]);var R={teamDid:pe,teamIssuerDid:me,teamName:j,invitations:c,roles:f,permissions:x,trustedPassports:w,trustedFactories:P,isNodeTeam:!1,enablePassportIssuance:D,refresh:function(){return E()},passportColor:C,endpoint:window.location.origin,blocklet:o,api:{getUser:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).did,n={teamDid:pe,user:{did:e}};return se.Z.getUser({input:n})},getUsers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.query,t=e.paging,r={teamDid:pe};return t&&(r.paging=t),n&&(r.query=n),r.sort={lastLoginAt:-1},se.Z.getUsers({input:r})},getUsersCountPerRole:function(){return se.Z.getUsersCountPerRole({input:{teamDid:pe}})}}};return(0,G.jsx)(ue,{value:R,children:r})}t(53420);var ve=t(25177),ge=t(75255),he=t(51921),xe=t(19638),be=t(13328);function Ze(e){var n=e.infos,t=(0,u.PE)().t,r=n.map((function(e){return"* ".concat(e.label,": ").concat(e.value)})).join("\n"),o=new URL("https://github.com/blocklet/blocklet-site/issues/new");return o.searchParams.set("title","[Feedback]"),o.searchParams.set("body","\x3c!-- [Enter feedback here] --\x3e\n\n\n\n\x3c!--\nDocument Details\n".concat(r,"\n* Page: ").concat(window.location.href,"\n--\x3e\n")),(0,be.tZ)(c.Z,{sx:{mx:{xs:0,md:2}},children:(0,be.tZ)(xe.Z,{sx:{color:"text.primary"},target:"_blank",href:o.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}Ze.propTypes={infos:C().arrayOf(C().shape({label:C().string,value:C().string}))},Ze.defaultProps={infos:[]};var ye=t(238),ke=t(37433),je=t(39563),Ce=t(93033),we=t.n(Ce),Pe=t(7173),De=t(83176),Ee=t(19886),Se=t.n(Ee),Re=t(22073),Te=t(43178),Be=["chainHost","nftId","retention"],Ne=["sx"];function _e(e){var n,t,r,o=e.chainHost,i=e.nftId,l=(e.retention,(0,k.Z)(e,Be)),s=(0,u.PE)(),d=s.t,p=s.locale,m=(0,Te.Z)({safeIframeRef:null,popoverAnchorEl:null}),g=(0,y.Z)(m,2),h=g[0],b=g[1],Z=(0,a.useRef)(null),j=l.sx,C=void 0===j?{}:j,w=(0,k.Z)(l,Ne),P=(0,Re.Z)((function(){return(0,f.Nh)(o,i)}));if(P.loading)return(0,G.jsxs)(c.Z,(0,x.Z)((0,x.Z)({sx:(0,x.Z)({display:"flex",alignItems:"center",color:"grey",gap:1},C)},w),{},{children:[(0,G.jsx)(v.Z,{size:16}),d("expiration.loading")]}));if(P.error)return console.error(P.error),(0,G.jsx)(Pe.Z,(0,x.Z)((0,x.Z)({label:d("expiration.loadFailed"),color:"error",variant:"success",sx:(0,x.Z)({cursor:"pointer"},C)},w),{},{onClick:function(){return P.retry()}}));var D=(0,f.D9)(P.value),E=null===(n=P.value)||void 0===n||null===(t=n.data)||void 0===t||null===(r=t.value)||void 0===r?void 0:r.launcherUrl,S=Se()(D).isBefore(Se()()),R=Se()(D).diff(Se()(),"ms"),T="success";R<=2592e6&&(T="warning"),S&&(T="error");return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pe.Z,(0,x.Z)((0,x.Z)({label:d("expiration.tips.".concat(T),{validity:we()(R,{locale:(0,f.tA)(p),compact:!0,verbose:!0})}),color:T,variant:"success"!==T?"contained":"outlined",sx:(0,x.Z)({cursor:"pointer"},C)},w),{},{onClick:function(e){b({popoverAnchorEl:e.currentTarget})}})),(0,G.jsx)(De.ZP,{id:"popover-info",open:Boolean(h.popoverAnchorEl),anchorEl:h.popoverAnchorEl,onClose:function(){b({popoverAnchorEl:null})},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,G.jsx)("iframe",{ref:Z,title:d("common.subscription"),width:"360px",height:"600px",style:{border:0},src:(0,f.qZ)({launcherUrl:E,nftId:i,locale:p})})})]})}_e.propTypes={chainHost:C().string.isRequired,nftId:C().string.isRequired,sx:C().object,retention:C().number},_e.defaultProps={sx:{},retention:0};var Ie,Ae=_e;function Ue(e){var n,t=e.children,r=(0,u.PE)().t,o=(0,ae.y0)(),i=o.loading,a=o.error,s=o.actions.refreshBlocklet,d=o.env,p=o.blocklet,g=(0,le.h6)().info,h=(0,l.useLocation)(),x=(0,ge.Z)((function(e){return e.breakpoints.down("md")})),b=[{label:"App ID",value:d.appId},{label:"App Version",value:d.version},{label:"App Bundle Name",value:null===p||void 0===p||null===(n=p.meta)||void 0===n?void 0:n.bundleName},{label:"Server Id",value:g.did},{label:"Server Version",value:g.version}],Z={};return x&&(Z.logo=null),(0,be.BX)(Le,{legacy:!1,fullWidth:!0,headerAddons:function(e){var n,t;if(!(0,V.ep)(p))return e;var r=Array.isArray(e)?e:[e];return r.unshift((0,be.tZ)(Ae,{chainHost:null===p||void 0===p||null===(n=p.controller)||void 0===n?void 0:n.chainHost,nftId:null===p||void 0===p||null===(t=p.controller)||void 0===t?void 0:t.nftId,retention:m.EXPIRED_BLOCKLET_DATA_RETENTION_DAYS,sx:{cursor:"pointer",marginRight:{xs:"8px",md:"48px"}}})),r},headerProps:Z,footerProps:{addon:(0,be.tZ)(Ze,{infos:b})},children:[!p&&i&&(0,be.tZ)(ye.Z,{relative:"parent",children:(0,be.tZ)(v.Z,{})}),!p&&a&&(0,be.BX)(ye.Z,{relative:"parent",children:[(0,be.BX)(c.Z,{display:"flex",alignItems:"center",children:[(0,be.tZ)(ve.Z,{color:"error",sx:{marginRight:1}}),(0,f.Z)(a)]}),(0,be.tZ)(z.Z,{onClick:function(){return s()},children:(0,be.tZ)("span",{style:{textDecoration:"underline"},children:r("common.retry")})})]}),!!p&&(0,be.tZ)("div",{className:"dashboard-layout-body",children:(0,be.tZ)("div",{className:"dashboard-layout-main",children:(0,be.tZ)(c.Z,{className:"dashboard-layout-main",children:(0,be.tZ)(c.Z,{flex:1,padding:"16px",display:"flex",flexDirection:"column",children:(0,be.tZ)(he.ErrorBoundary,{FallbackComponent:ke.H,resetKeys:[h.pathname],children:t})})})})})]})}Ue.defaultProps={children:null};var Oe,Le=(0,i.default)(je.Z)(Ie||(Ie=(0,o.Z)(["\n .dashboard-layout-body {\n flex: 1;\n display: flex;\n padding-top: 16px;\n }\n .dashboard-layout-main {\n flex: 1;\n padding: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n"]))),ze=t(38507),Fe=(0,a.lazy)((function(){return Promise.all([t.e(926),t.e(6326)]).then(t.bind(t,56326))})),Me=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(2631),t.e(4212),t.e(2291),t.e(617),t.e(2653)]).then(t.bind(t,92653))})),Ve=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(4319),t.e(252),t.e(3593)]).then(t.bind(t,23593))})),qe=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(2631),t.e(4212),t.e(2291),t.e(4764),t.e(1546),t.e(878),t.e(5541),t.e(5355)]).then(t.bind(t,29733))})),Ke=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7606),t.e(3154),t.e(6771)]).then(t.bind(t,26771))})),We=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(576),t.e(5645),t.e(5982)]).then(t.bind(t,25205))})),Xe=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(5960),t.e(576),t.e(2631),t.e(9260),t.e(4764),t.e(8365),t.e(4023)]).then(t.bind(t,4023))})),Ge=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(576),t.e(2631),t.e(4212),t.e(2291),t.e(4164),t.e(8527),t.e(3179),t.e(9657),t.e(6869)]).then(t.bind(t,66869))})),He=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(576),t.e(4212),t.e(4164),t.e(4319),t.e(445),t.e(9260),t.e(5465),t.e(7606),t.e(6921),t.e(1546),t.e(7272),t.e(5541),t.e(1565)]).then(t.bind(t,31565))})),Je=(0,a.lazy)((function(){return Promise.all([t.e(5683),t.e(7006),t.e(1614),t.e(5960),t.e(2631),t.e(4212),t.e(2291),t.e(5465),t.e(6700),t.e(2393)]).then(t.bind(t,2393))}));function Ye(){var e,n,t=(0,l.useNavigate)(),r=(0,l.useParams)().tab,o=void 0===r?"overview":r,i=(0,ae.y0)(),x=i.blocklet,b=i.actions.refreshBlocklet,Z=(0,u.PE)().t,y=null===x||void 0===x||null===(e=x.meta)||void 0===e?void 0:e.did,k=!x||(0,f.wS)(x.status)?[]:(0,p.getAppMissingConfigs)(x),j=[{label:Z("common.overview"),value:"overview"},{label:(0,G.jsx)(s.Z,{color:"error",variant:"dot",invisible:!k.length,children:Z("common.components")}),value:"components"}];(0,f.wS)(null===x||void 0===x?void 0:x.status)||j.push({label:Z("common.configuration"),value:"configuration"}),j.push({label:Z("common.auditLogs"),value:"audit-logs"}),x&&null!==(n=x.children)&&void 0!==n&&n.length&&x.structVersion===m.APP_STRUCT_VERSION&&j.push({label:Z("common.logs"),value:"logs"}),j.push({label:Z("common.configNavigation"),value:"navigation"}),j.push({label:Z("common.storage"),value:"storage"});var C=(0,G.jsx)(Ke,{scope:y,categories:["blocklet","team","security","certificates","gateway"]}),w={overview:(0,G.jsx)(Fe,{}),members:(0,G.jsx)(c.Z,{mt:-5,children:(0,G.jsx)(Me,{type:"blocklet",createPassportSvg:ze.Ju})}),passports:(0,G.jsx)(c.Z,{mt:-4.5,children:(0,G.jsx)(Ve,{createPassportSvg:ze.Ju})}),components:He,configuration:(0,G.jsx)(qe,{blocklet:x,onUpdate:function(){b()}}),"audit-logs":C,logs:We,navigation:Xe,storage:(0,G.jsx)(Ge,{}),analytics:(0,G.jsx)(c.Z,{mt:-5,children:(0,G.jsx)(Je,{})})},P=w[o]||w.overview,D=!["members","passports","analytics"].includes(o),E=x?(0,G.jsxs)(g.g,{type:"components",children:[D&&(0,G.jsx)(d.Z,{tabs:j,current:o,onChange:function(e){t("".concat(m.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/").concat(e))},scrollButtons:"auto"}),(0,G.jsx)("div",{className:"page-content",children:(0,G.jsx)(a.Suspense,{fallback:(0,G.jsx)(v.Z,{}),children:(0,a.isValidElement)(P)?P:(0,G.jsx)(P,{blocklet:x})})})]}):(0,G.jsx)(v.Z,{});return(0,G.jsx)(le.cK,{children:(0,G.jsx)(fe,{children:(0,G.jsx)(Ue,{children:(0,G.jsxs)($e,{children:[D&&(0,G.jsxs)(c.Z,{component:"div",className:"page-header",children:[(0,G.jsxs)(c.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[x?(0,G.jsx)(Q.Z,{blocklet:x,style:{marginRight:16}}):null,x?(0,G.jsxs)(c.Z,{display:"flex",alignItems:"center",children:[(0,G.jsx)(c.Z,{children:(0,p.getDisplayName)(x)}),"unknown"!==(null===x||void 0===x?void 0:x.status)&&(0,G.jsx)(h.Z,{size:"12px",style:{marginLeft:8},status:x.status,source:x.source})]}):"".concat(Z("common.blocklet")," ").concat(Z("common.detail"))]}),x?(0,G.jsx)(J,{className:"page-actions",hasPermission:!0,blocklet:x,onStart:function(){},onComplete:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).error;e&&M.Z.error(e.message)},variant:"group"}):null]}),(0,G.jsx)(oe,{}),E]})})})})}function Qe(){var e,n=(0,ae.y0)().blocklet,t=null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.did;return(0,a.useEffect)((function(){var e=(0,ie.ZP)();return t&&e.connect(),function(){t&&e.isConnected()&&e.disconnect()}}),[t]),(0,G.jsx)(Ye,{})}var $e=i.default.main(Oe||(Oe=(0,o.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 36px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.values.md}))},84802:function(e,n,t){t.d(n,{Z:function(){return m}});var r=t(33028),o=t(59740),i=t(24974),a=t.n(i),l=t(59467),c=t(62399),s=t(59505),u=t(15300),d=t(37574),p=["blocklet","style","size"];function m(e){var n,t=e.blocklet,i=e.style,a=e.size,m=(0,o.Z)(e,p),f=(0,u.Z)({blocklet:t}).logoUrl,v=m.variant,g=(0,d.jsx)("img",{src:f,alt:"",style:{width:a}});t.meta.logo||((null===(n=(t.configs||[]).find((function(e){return e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE})))||void 0===n?void 0:n.value)||(g=(0,d.jsx)(c.Z,{did:t.meta.did||"",responsive:!0})));return(0,d.jsx)(l.Z,(0,r.Z)((0,r.Z)({variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,borderRadius:10},i)},m),{},{children:g}))}m.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string])},m.defaultProps={style:{},size:40}},55008:function(e,n,t){var r=t(10814),o=t(8825),i=t(60003),a=t(13875),l=t(57256),c=t(14079),s=t(51389),u=t(98127);n.Z={Start:o.Z,Stop:i.Z,Restart:a.default,Reload:l.Z,Remove:r.default,Config:c.Z,Log:s.Z,Group:u.Z}},94282:function(e,n,t){t.d(n,{Z:function(){return h}});var r=t(33028),o=t(59740),i=t(30969),a=t(24974),l=t.n(a),c=t(94308),s=t(6779),u=t(47333),d=t(7017),p=t(19708),m=t(61472),f=t(37574),v=["status","variant","source"],g={yellow:"#FFCF71",grey:"#888888"};function h(e){var n=e.status,t=e.variant,a=(e.source,(0,o.Z)(e,v)),l=(0,i.useContext)(u.RD).t,h={added:g.grey,waiting:g.yellow,downloading:g.yellow,downloaded:g.grey,installing:g.yellow,installed:g.grey,starting:g.yellow,running:"success",stopping:g.yellow,stopped:g.grey,error:"error",upgrading:g.yellow,restarting:g.yellow,corrupted:"error",deleting:g.yellow},x=(0,d.isInProgress)(n),b=l("blocklet.status.".concat(n));return"dot"===t?(0,f.jsx)(s.Z,{title:l("blocklet.statusTip",{status:b}),children:(0,f.jsx)(p.Z,(0,r.Z)({color:h[n]},a))}):(0,f.jsxs)(m.Z,(0,r.Z)((0,r.Z)({type:{added:"primary",waiting:"warning",downloading:"warning",downloaded:"primary",installing:"warning",installed:"primary",starting:"warning",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"warning",restarting:"warning",corrupted:"error",deleting:"warning"}[n]},a),{},{children:[x&&(0,f.jsx)(c.Z,{size:12,color:"inherit",style:{marginRight:5}}),b]}))}h.propTypes={status:l().string.isRequired,variant:l().oneOf(["dot","tag"]),source:l().string},h.defaultProps={variant:"tag",source:""}},8479:function(e,n,t){t.d(n,{Z:function(){return D}});var r=t(71171),o=t(32723),i=t(34795),a=t(96234),l=t(30969),c=t(24974),s=t.n(c),u=t(16380),d=t(84636),p=t(94308),m=t(96074),f=t(59071),v=t(43207),g=t(38357),h=t(18877),x=t(94702),b=t(75255),Z=t(47333),y=t(29996),k=t(24891),j=t(45555);var C,w=function(){var e=(0,j.Z)();return{minWidth:(0,b.Z)(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}},P=t(37574);function D(e){var n=e.title,t=e.description,r=e.showCancel,c=e.cancel,s=e.confirm,u=e.color,d=e.params,j=e.onCancel,C=e.onConfirm,D=e.loading,S=(0,l.useState)(d),R=(0,a.Z)(S,2),T=R[0],B=R[1],N=(0,l.useState)(!0),_=(0,a.Z)(N,2),I=_[0],A=_[1],U=(0,l.useState)(!1),O=(0,a.Z)(U,2),L=O[0],z=O[1],F=(0,l.useState)(""),M=(0,a.Z)(F,2),V=M[0],q=M[1],K=(0,Z.PE)().t,W=(0,x.Z)(),X=function(){var e=(0,i.Z)((0,o.Z)().mark((function e(n){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!==typeof n){e.next=17;break}return z(!0),e.prev=2,e.next=5,n(T);case 5:A(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),q((0,k.Z)(e.t0)),console.error(e.t0);case 12:return e.prev=12,z(!1),e.finish(12);case 15:e.next=18;break;case 17:A(!1);case 18:case"end":return e.stop()}}),e,null,[[2,8,12,15]])})));return function(n){return e.apply(this,arguments)}}(),G="function"===typeof n?n():n,H="function"===typeof t?t(T,B,q):t,J=(0,b.Z)(W.breakpoints.down("md")),Y=w().minWidth;return(0,P.jsxs)(E,{onClick:function(e){e.stopPropagation()},fullScreen:J,open:I,style:{minWidth:Y},children:[(0,P.jsx)(g.Z,{children:G}),(0,P.jsxs)(f.Z,{style:{minWidth:Y},children:[(0,P.jsx)(v.Z,{component:"div",children:H}),!!V&&(0,P.jsx)(h.Z,{severity:"error",style:{width:"100%",marginTop:8},children:V})]}),(0,P.jsxs)(m.Z,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[r&&(0,P.jsx)(y.Z,{onClick:function(e){e.stopPropagation(),X(j)},color:"inherit","data-cy":"cancel-confirm-dialog",children:c||K("common.cancel")}),(0,P.jsxs)(y.Z,{onClick:function(e){e.stopPropagation(),X(C)},color:u,disabled:T.__disableConfirm||L||D,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(L||D)&&(0,P.jsx)(p.Z,{size:16}),s]})]})]})}D.propTypes={title:s().any.isRequired,description:s().any.isRequired,showCancel:s().bool,cancel:s().string,color:s().string,confirm:s().string,params:s().object,onCancel:s().func,onConfirm:s().func.isRequired,loading:s().bool},D.defaultProps={onCancel:function(){},showCancel:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1};var E=(0,u.default)(d.Z)(C||(C=(0,r.Z)(["\n .delete-actions .Mui-disabled {\n color: rgba(0, 0, 0, 0.26) !important;\n box-shadow: none;\n background-color: rgba(0, 0, 0, 0.12) !important;\n }\n"])))},43820:function(e,n,t){t.d(n,{K:function(){return m},g:function(){return p}});var r=t(68079),o=t(96234),i=t(30969),a=t(24974),l=t.n(a),c=t(16986),s=t.n(c),u=t(37574),d=(0,i.createContext)({});function p(e){var n=e.children,t=e.type,a=(0,i.useState)([]),l=(0,o.Z)(a,2),c=l[0],p=l[1],m=(0,i.useRef)([]),f=function(e){if(m.current.includes(e)){var n=m.current.filter((function(n){return n!==e}));p(n),m.current=n}};return(0,u.jsx)(d.Provider,{value:{type:t,deletingBlocklets:c,addDeletingDid:function(e){if(!m.current.includes(e)){var n=[].concat((0,r.Z)(m.current),[e]);p(n),m.current=n}},removeDeletingDid:f,matchDeletingDid:function(e){var n=c.filter((function(n){return e.find((function(e){return e===n}))}));s()(n,c).forEach((function(e){return f(e)}))}},children:n})}function m(){return(0,i.useContext)(d)}p.propTypes={type:l().string,children:l().node.isRequired},p.defaultProps={type:"blocklets"}},41395:function(e,n,t){t.d(n,{h6:function(){return a},sy:function(){return i}});var r=t(33028),o=t(30969),i=(0,o.createContext)({});i.Provider,i.Consumer;function a(){var e=(0,o.useContext)(i).node;return(0,r.Z)((0,r.Z)({},e),{},{inService:"service"===e.type,inDaemon:"daemon"===e.type})}},77370:function(e,n,t){t.d(n,{B:function(){return o.B3},T:function(){return i}});var r=t(30969),o=t(35371);function i(){return(0,r.useContext)(o.B3)}},80670:function(e,n,t){t.d(n,{DJ:function(){return i},Gy:function(){return o}});var r=t(30969),o=(0,r.createContext)({});o.Provider,o.Consumer;function i(){return(0,r.useContext)(o)}},19708:function(e,n,t){var r,o=t(71171),i=t(16380),a={success:"#3ab39d",error:"#D0021B"},l="10px",c=i.default.div(r||(r=(0,o.Z)(["\n display: inline-block;\n width: ",";\n height: ",";\n background: ",";\n border-radius: 100%;\n"])),(function(e){return e.size||l}),(function(e){return e.size||l}),(function(e){return a[e.color]||e.color||a.success}));n.Z=c},15300:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(19611),o=t.n(r),i=t(41395),a=t(24891);function l(e){var n,t,r=e.blocklet,l=(0,i.h6)().inService,c=(null===(n=window.env)||void 0===n?void 0:n.apiPrefix)||"/",s="?v=".concat(null===r||void 0===r||null===(t=r.meta)||void 0===t?void 0:t.version).concat((0,a.wS)(null===r||void 0===r?void 0:r.status)?"~":"");return{logoUrl:o()(c,"/blocklet/logo/".concat(l?"":r.meta.did),s)}}},61472:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(33028),o=t(59740),i=t(24974),a=t.n(i),l=t(9715),c=t(37574),s=["children","style"];function u(e){var n=e.children,t=e.style,i=(0,o.Z)(e,s);return(0,c.jsx)(l.Z,(0,r.Z)((0,r.Z)({style:t},i),{},{children:n}))}u.propTypes={children:a().any.isRequired,style:a().object},u.defaultProps={style:{}}}}]);
2
+ //# sourceMappingURL=6186.2a5f97da.chunk.js.map
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[8179],{92746:function(e,n,t){var r,a=t(71171),s=t(33028),o=t(59740),i=t(16380),c=t(50442),l=t(37574),p=["labelProps","className","style"];function u(e){var n=e.labelProps,t=e.className,r=e.style,a=(0,o.Z)(e,p),i=(0,s.Z)((0,s.Z)({},n),{},{labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"});return(0,l.jsx)(d,{className:t,style:r,children:(0,l.jsx)(c.Z,(0,s.Z)({labelProps:i},a))})}u.propTypes=c.Z.propTypes,u.defaultProps=c.Z.defaultProps;var d=i.default.div(r||(r=(0,a.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(function(e){return e.theme.breakpoints.down("sm")}));n.Z=u},58179:function(e,n,t){t.r(n),t.d(n,{default:function(){return Je}});var r=t(30969),a=t(45008),s=t(30134),o=t(33028),i=t(38361),c=t(33359),l=t(47333),p=t(32723),u=t(34795),d=t(96234),f=t(59740),h=t(94308),m=t(43207),x=t(87006),v=t(29996),g=t(50007),Z=t(19611),y=t.n(Z),k=t(94984),j=t(59505),b=t(15419),w=t(50496),A=t(23299),C=t(24974),B=t.n(C),S=t(54559),I=t(24891),D=t(41395),E=t(83998),U=t(37574),R=["spaceGateways","refreshSpaceGateways"];function T(e){var n=e.spaceGateways,t=e.refreshSpaceGateways,Z=(0,f.Z)(e,R),C=(0,a.y0)().blocklet,B=(0,D.h6)(),T=B.info,L=B.api,F=(0,l.PE)(),G=F.t,N=F.locale,z=(0,r.useMemo)((function(){return(0,s.mo)(null===C||void 0===C?void 0:C.environments)}),[C]),O=(0,r.useState)(""),M=(0,d.Z)(O,2),P=M[0],J=M[1],Q=(0,r.useState)(!1),H=(0,d.Z)(Q,2),K=H[0],V=H[1],X=(0,r.useState)(!1),Y=(0,d.Z)(X,2),W=Y[0],q=Y[1],_=(0,r.useState)(""),$=(0,d.Z)(_,2),ee=$[0],ne=$[1],te=(0,E.Z)({blocklet:C}),re=(0,I.yP)(T),ae=(0,r.useState)({open:!1,action:"get-did-spaces-endpoint",checkTimeout:3e5,checkFn:S.od.create({baseURL:y()(window.location.origin,(0,I.Y5)())}).get,messages:{title:G("storage.spaces.provideNFT.title",{appName:te.appName},N),scan:G("storage.spaces.provideNFT.scan",{appName:te.appName},N),confirm:"",success:(0,U.jsx)(c.Z,{gutterBottom:!0,children:G("storage.spaces.provideNFT.success")})},onClose:function(){ie((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),se=(0,d.Z)(ae,2),oe=se[0],ie=se[1],ce=(0,r.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:G("storage.spaces.authorize.title",{appName:te.appName},N),scan:G("storage.spaces.authorize.scan",{appName:te.appName},N),confirm:"",success:(0,U.jsx)(c.Z,{gutterBottom:!0,children:G("storage.spaces.authorize.success")})},onClose:function(){ue((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),le=(0,d.Z)(ce,2),pe=le[0],ue=le[1],de=function(e,n){setTimeout((0,u.Z)((0,p.Z)().mark((function t(){var r,a;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ue((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),ie((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),r=n(e.endpoint),a=e.space?n(e.space):{},t.next=6,fe((0,o.Z)((0,o.Z)({endpoint:r},{did:(0,s.LQ)(r),name:"DID Space"}),a));case 6:case"end":return t.stop()}}),t)}))),0)},fe=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(r){var a,o,i,c,l,u,d,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=r.endpoint,l=r.name,u=r.did,(d=null===c||void 0===c||null===(a=c.replace(/\/api\/.+/,""))||void 0===a||null===(o=a.trim())||void 0===o?void 0:o.replace(/\/$/,"")).startsWith("http")||(d="https://".concat(d)),e.next=5,(0,s.w2)(d);case 5:if(e.sent){e.next=8;break}return k.Z.error(G("storage.spaces.gateway.add.invalidUrl")),e.abrupt("return");case 8:if(!n.some((function(e){return e.endpoint===c}))){e.next=12;break}return k.Z.error(G("storage.spaces.gateway.add.duplicate",{name:l})),e.abrupt("return");case 12:return f={name:l,did:u,url:d,endpoint:c},e.next=15,L.addBlockletSpaceGateway({input:{did:C.meta.did,spaceGateway:f}});case 15:if(z===c){e.next=18;break}return e.next=18,L.configBlocklet({input:{did:[C.meta.did],configs:[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:c}]}});case 18:k.Z.success(G("storage.spaces.connectedWithName",{name:null!==(i=null===f||void 0===f?void 0:f.name)&&void 0!==i?i:"DID Spaces"})),t();case 20:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),he=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){var n,t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,V(!0),n=P.startsWith("http")?P:"https://".concat(P),e.next=5,(0,s.w2)(n);case 5:if(e.sent){e.next=7;break}throw new Error(G("storage.spaces.gateway.add.invalidUrl"));case 7:ue((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!0,prefix:y()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:S.od.create({baseURL:y()(n,"space")}).get,extraParams:{appDid:te.appDid,appName:te.appName,appDescription:te.appDescription,scopes:te.scopes,appUrl:te.appUrl,referrer:te.referrer,nodeDid:T.did}})})),q(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),t="".concat(G("storage.spaces.gateway.add.failed",N),": ").concat((0,I.Z)(e.t0)),ne(t);case 15:return e.prev=15,V(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,11,15,18]])})));return function(){return e.apply(this,arguments)}}();return(0,U.jsxs)(i.Z,{children:[(0,U.jsx)(b.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:function(){ie((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!0,extraParams:{appDid:te.appDid,appName:te.appName,appDescription:te.appDescription,scopes:te.scopes,appUrl:te.appUrl,referrer:te.referrer,nodeDid:T.did}})}))},menu:[(0,U.jsx)(b.Z.Item,(0,o.Z)((0,o.Z)({sx:{textTransform:"none"},onClick:function(){return q(!0)},size:"small"},Z),{},{children:G("storage.spaces.connect.useSpaceGateway")}),"1")],children:(0,U.jsx)(c.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:G("storage.spaces.connect.useWallet")})}),(0,U.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:oe.prefix,open:oe.open,popup:!0,action:oe.action,webWalletUrl:re,baseUrl:oe.baseUrl,checkFn:oe.checkFn,onSuccess:de,onClose:oe.onClose,checkTimeout:oe.checkTimeout,extraParams:oe.extraParams,messages:oe.messages,locale:N}),(0,U.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:pe.prefix,open:pe.open,popup:!0,action:pe.action,baseUrl:pe.baseUrl,checkFn:pe.checkFn,onSuccess:de,onClose:pe.onClose,checkTimeout:pe.checkTimeout,extraParams:pe.extraParams,messages:pe.messages,locale:N}),(0,U.jsxs)(w.Z,{title:G("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:W,onClose:function(){return q(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(v.Z,{onClick:function(e){e.stopPropagation(),q(!1)},color:"inherit",children:G("common.cancel")}),(0,U.jsxs)(v.Z,{onClick:he,color:"primary",disabled:K||!P,variant:"contained",autoFocus:!0,children:[K&&(0,U.jsx)(h.Z,{size:16}),G("common.confirm")]})]}),children:[(0,U.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,U.jsx)(m.Z,{component:"div",children:(0,U.jsx)(c.Z,{component:"div",children:(0,U.jsx)(x.Z,{label:G("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:P,onChange:function(e){ne(null),J(e.target.value)},disabled:K,onKeyPress:function(){var e=(0,u.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==n.key){e.next=3;break}return e.next=3,he();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),autoFocus:!0})})})}),Boolean(ee)&&(0,U.jsx)(A.Z,{type:"error",style:{width:"100%"},children:ee})]})]})}T.propTypes={spaceGateways:C.array,refreshSpaceGateways:C.func},T.defaultProps={spaceGateways:[],refreshSpaceGateways:function(){}};var L,F=T,G=t(71171),N=t(16380),z=t(99237),O=t.n(z),M=t(19638),P=t(70177),J=["blocklet"];function Q(e){var n=e.blocklet,t=(0,f.Z)(e,J),a=(0,r.useContext)(l.RD).t;if(!n.diskInfo)return(0,U.jsx)(c.Z,{children:a("blocklet.diskInfo.empty")});var s=function(e,n,t){return(0,U.jsxs)(c.Z,{children:[t?(0,U.jsx)(M.Z,{style:{cursor:"pointer"},onClick:t,underline:"hover",children:e}):e," ",(0,U.jsx)("strong",{children:n?O()(n):"empty"})]})},i=n.environments.reduce((function(e,n){return e[n.key]=n.value,e}),{}),p=[{key:"appDir",name:a("blocklet.diskInfo.appDir"),value:s(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:a("blocklet.diskInfo.dataDir"),value:s(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:a("blocklet.diskInfo.logDir"),value:s(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:a("blocklet.diskInfo.cacheDir"),value:s(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return(0,U.jsx)(H,(0,o.Z)((0,o.Z)({component:"div"},t),{},{children:p.map((function(e){return(0,U.jsx)(P.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.key)}))}))}Q.propTypes={blocklet:B().object.isRequired},Q.defaultProps={};var H=(0,N.default)(c.Z)(L||(L=(0,G.Z)([""]))),K=function(e){return(0,U.jsxs)("svg",(0,o.Z)((0,o.Z)({},e),{},{children:[(0,U.jsxs)("g",{filter:"url(#a)",children:[(0,U.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#DDD"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97z",fill:"#000",fillOpacity:".08"}),(0,U.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,U.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#D9D9D9"})}),(0,U.jsxs)("g",{mask:"url(#b)",children:[(0,U.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,U.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,U.jsx)("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm11.546-10.102V169h-1.756v-11.636h1.756zM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29z",fill:"#fff"}),(0,U.jsx)("path",{d:"M117.604 47.263L121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847z",fill:"url(#e)"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z",fill:"url(#f)"}),(0,U.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,U.jsx)("path",{d:"M50.928 216.089l1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911zm2.439.564h-1.13v1.193h1.13v-1.193zm-1.13 2.983h1.13v1.193h-1.13v-1.193z",fillOpacity:".8"}),(0,U.jsx)("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762zM36.355 214h-1.011v7.783h1.01V214zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75zM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894zm6.946 1.803h1.13v1.193h-1.13v-1.193zm1.13 2.983h-1.13v1.193h1.13v-1.193zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751z"})]}),(0,U.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,U.jsx)("path",{d:"M192.064 213.333l.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46z",fill:"#fff"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26z",fill:"#fff"})]})]}),(0,U.jsxs)("defs",{children:[(0,U.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,U.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,U.jsx)("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,U.jsx)("feOffset",{dy:"2"}),(0,U.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,U.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,U.jsx)("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),(0,U.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,U.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,U.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,U.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,U.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#101010"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,U.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,U.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#fff"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,U.jsxs)("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[(0,U.jsx)("stop",{stopColor:"#016BED"}),(0,U.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,U.jsx)("clipPath",{id:"g",children:(0,U.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,U.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwA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n9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]}))};function V(){var e=(0,l.PE)().t,n=(0,a.y0)().blocklet;return(0,U.jsxs)(i.Z,{children:[(0,U.jsxs)(i.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,U.jsx)(K,{style:{width:200,height:250}}),(0,U.jsx)(c.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.provider")}),(0,U.jsx)(F,{})]}),(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:e("common.dataStorage")}),(0,U.jsx)(Q,{blocklet:n})]})}K.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},V.propTypes={};var X=V,Y=t(57982),W=t(7173),q=t(38627),_=t(54164),$=t(50576),ee=t(38996),ne=t(36558),te=t(92746),re=t(94551),ae=t(48082),se=t(2689),oe=t(93310),ie=t(86008),ce=t(37973),le=t(20352),pe=t(61292),ue=t(60030),de=t(30291),fe=t(67531);function he(e){var n=e.spaceGateway,t=e.onDelete,a=(0,l.PE)().t,s=(0,r.useState)(!1),o=(0,d.Z)(s,2),i=o[0],c=o[1],f=(0,r.useState)(!1),h=(0,d.Z)(f,2),m=h[0],x=h[1],v=function(e,n){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),c(n)},g=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(r){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,null===r||void 0===r||r.stopPropagation(),x(!0),e.next=5,t(n);case 5:c(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),k.Z.error("".concat(a("storage.space.gateway.delete.failed"),": ").concat((0,I.Z)(e.t0)));case 12:return e.prev=12,x(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(se.Z,{color:"red",onClick:function(e){return v(e,!0)},children:[(0,U.jsx)(oe.Z,{style:{minWidth:24,color:"red"},children:(0,U.jsx)(de.default,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{style:{color:"red"},children:a("common.delete")})]}),(0,U.jsx)(fe.Z,{title:a("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:i,confirmButton:{text:a("common.confirm"),props:{variant:"contained",color:"error",loading:m}},cancelButton:{text:a("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:g,onCancel:function(e){return v(e,!1)}})]})}he.propTypes={onDelete:B().func,spaceGateway:B().shape({name:B().string.isRequired,url:B().string.isRequired,protected:B().bool}).isRequired},he.defaultProps={onDelete:function(){}};var me=he,xe=["spaceGateway","connected","onDelete","onConnect","enableSwitchToSpace"];function ve(e){var n=e.spaceGateway,t=e.connected,a=e.onDelete,i=e.onConnect,c=e.enableSwitchToSpace,h=(0,f.Z)(e,xe),m=(0,r.useState)(null),x=(0,d.Z)(m,2),v=x[0],g=x[1],Z=(0,l.PE)().t,y=function(e,n){e.stopPropagation(),e.preventDefault(),g(n&&e.currentTarget)},k=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(t,!1),e.next=3,i(n);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(re.Z,(0,o.Z)((0,o.Z)({"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:function(e){return y(e,!0)},size:"small"},h),{},{children:(0,U.jsx)(ce.Z,{})})),(0,U.jsxs)(ae.Z,{id:"simple-menu",anchorEl:v,keepMounted:!0,open:Boolean(v),onClose:function(e){return y(e,!1)},children:[(0,U.jsxs)(se.Z,{onClick:function(e){y(e,!1),window.open(n.endpoint?(0,s.nD)(n.endpoint):n.url)},children:[(0,U.jsx)(oe.Z,{style:{minWidth:24},children:(0,U.jsx)(le.Z,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{children:Z("common.open")})]}),(0,U.jsxs)(se.Z,{onClick:function(e){y(e,!1),window.open((0,s.Xv)(n.endpoint))},children:[(0,U.jsx)(oe.Z,{style:{minWidth:24},children:(0,U.jsx)(ue.Z,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{children:Z("storage.spaces.strategy.viewBackupFiles")})]}),!t&&c&&(0,U.jsxs)(se.Z,{onClick:k,children:[(0,U.jsx)(oe.Z,{style:{minWidth:24},children:(0,U.jsx)(pe.Z,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{children:Z("storage.spaces.connect.switchToSpace")})]}),!t&&(0,U.jsx)(me,{spaceGateway:n,onDelete:a})]})]})}ve.propTypes={spaceGateway:B().shape({name:B().string.isRequired,url:B().string.isRequired,protected:B().bool,endpoint:B().string.isRequired}).isRequired,connected:B().bool.isRequired,enableSwitchToSpace:B().bool,onDelete:B().func,onConnect:B().func},ve.defaultProps={onDelete:function(){},onConnect:function(){},enableSwitchToSpace:!0};var ge,Ze=ve,ye=t(19066),ke=t(50202),je=["spaceGateway","connected","progress","onDelete","onBackupNow","refreshSpaceGateways"],be=function(e){return(0,U.jsx)("svg",(0,o.Z)((0,o.Z)({},e),{},{children:(0,U.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})}))};be.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var we=function(e){return(0,U.jsx)("svg",(0,o.Z)((0,o.Z)({},e),{},{children:(0,U.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})}))};function Ae(e){var n=e.spaceGateway,t=e.connected,h=e.progress,m=e.onDelete,x=e.onBackupNow,Z=e.refreshSpaceGateways,b=(0,f.Z)(e,je),w=(0,l.PE)(),A=w.t,C=w.locale,B=(0,r.useState)(!1),I=(0,d.Z)(B,2),R=I[0],T=I[1],L=(0,a.y0)().blocklet,F=(0,D.h6)(),G=F.api,N=F.info.did,z=(0,E.Z)({blocklet:L}),O=z.appDid,M=z.appName,P=z.appDescription,J=z.scopes,Q=z.appUrl,H=z.referrer,K=(0,r.useMemo)((function(){return(0,s.mo)(null===L||void 0===L?void 0:L.environments)}),[L]),V=(0,r.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:A("storage.spaces.authorize.title",{appName:M},C),scan:A("storage.spaces.authorize.scan",{appName:M},C),confirm:"",success:(0,U.jsx)(c.Z,{gutterBottom:!0,children:A("storage.spaces.authorize.success")})},onClose:function(){re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),X=(0,d.Z)(V,2),Y=X[0],re=X[1],ae=(0,_.Z)((0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",!0);case 2:return e.abrupt("return",(0,s.Nb)(K));case 3:case"end":return e.stop()}}),e)}))),{refreshDeps:[t,K,null===Y||void 0===Y?void 0:Y.open,R]}),se=ae.data,oe=ae.loading,ie=t&&se,ce=t&&!R&&se,le=t&&R&&se,pe=t&&!se&&!oe&&!R,ue=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,s.Nb)(null===n||void 0===n?void 0:n.endpoint);case 2:if(!e.sent){e.next=8;break}return e.next=6,G.configBlocklet({input:{did:[L.meta.did],configs:[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 6:return k.Z.success(A("storage.spaces.connect.switchToSpaceSucceeded",{name:n.name?"(".concat(n.name,")"):""})),e.abrupt("return");case 8:re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!0,prefix:y()(n.url,"space/api/did"),baseUrl:new URL(n.url).origin,checkFn:S.od.create({baseURL:y()(n.url,"space")}).get,extraParams:{appDid:O,appName:M,appDescription:P,scopes:J,appUrl:Q,referrer:H,nodeDid:N}})}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(t,r){var a,i,c,l,u,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r(t.endpoint),u=(0,s.LQ)(l),d=t.space?r(t.space):{},!n.did||u===n.did){e.next=7;break}return re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),k.Z.error(A("storage.spaces.gateway.switch.failedForMismatchSpace",{name:null!==d&&void 0!==d&&d.name?d.name:""})),e.abrupt("return");case 7:return e.next=9,G.updateBlockletSpaceGateway({input:{did:L.meta.did,where:{url:null===n||void 0===n?void 0:n.url},spaceGateway:(0,o.Z)((0,o.Z)({},n),{},{name:null!==(a=d.name)&&void 0!==a?a:"DID Space",did:null!==(i=d.did)&&void 0!==i?i:(0,s.LQ)(l),endpoint:l})}});case 9:if(K===l){e.next=12;break}return e.next=12,G.configBlocklet({input:{did:[L.meta.did],configs:[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:l}]}});case 12:k.Z.success(A("storage.spaces.connectedWithName",{name:null!==(c=null===n||void 0===n?void 0:n.name)&&void 0!==c?c:"DID Spaces"})),re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),Z();case 15:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),fe=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!R){e.next=3;break}return e.abrupt("return");case 3:return T(!0),e.next=6,x();case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),k.Z.error(e.t0.message);case 12:return e.prev=12,T(!0),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)((function(){null!==h&&void 0!==h&&h.completed?(100===(null===h||void 0===h?void 0:h.progress)?k.Z.success(A("storage.spaces.backupSuccessfully")):-1===(null===h||void 0===h?void 0:h.progress)&&k.Z.error(null===h||void 0===h?void 0:h.message),T(!1),h.progress=0,h.message=""):h.progress&&T(!0)}),[h]),(0,U.jsxs)(Ce,{style:{position:"relative"},children:[(0,U.jsxs)(i.Z,(0,o.Z)((0,o.Z)({sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px"},b),{},{children:[(0,U.jsx)(i.Z,{display:"flex",children:(0,U.jsx)(ke.Z,{alt:n.did,src:(0,s.Jf)(n.endpoint)})}),(0,U.jsxs)(i.Z,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:le?"row":"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,U.jsxs)(i.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,U.jsx)(c.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),ie&&(0,U.jsx)(W.Z,{label:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(be,{style:{marginRight:"4px"}}),A("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}}),pe&&(0,U.jsx)(W.Z,{label:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(we,{style:{marginRight:"4px"}}),A("storage.spaces.disconnected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}})]}),(0,U.jsx)(i.Z,{className:"spaces-address",display:le?"none":"flex",color:"#9397A1",marginTop:"8px",children:(0,U.jsx)(c.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,U.jsx)(ne.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,U.jsxs)(i.Z,{className:"spaces-backup",display:"flex",alignItems:"center",children:[ce&&(0,U.jsxs)(i.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:[(0,U.jsx)(v.Z,{variant:"contained",size:"small",onClick:fe,children:A("storage.spaces.strategy.backupNow")}),ye.C&&(0,U.jsx)(te.Z,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:(0,U.jsx)(c.Z,{sx:{marginRight:"8px",fontSize:"16px"},children:(0,U.jsx)("span",{children:A("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),le&&(0,U.jsxs)(i.Z,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",minWidth:"640px",marginRight:"auto",alignSelf:"end",children:[(0,U.jsx)(c.Z,{color:"primary",children:null===h||void 0===h?void 0:h.message}),(0,U.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[(0,U.jsx)(i.Z,{sx:{width:"100%",mr:1},children:(0,U.jsx)(q.Z,{color:"primary",variant:"determinate",value:null===h||void 0===h?void 0:h.progress})}),(0,U.jsx)(i.Z,{sx:{minWidth:35},children:(0,U.jsxs)(c.Z,{variant:"body2",color:"text.secondary",children:[null===h||void 0===h?void 0:h.progress,"%"]})})]})]}),pe&&(0,U.jsx)(i.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,U.jsx)(v.Z,{color:"error",variant:"contained",size:"small",onClick:ue,children:A("storage.spaces.disconnected.reconnectNow")})}),(0,U.jsx)(Ze,{sx:{marginLeft:"16px",marginRight:"16px"},spaceGateway:n,connected:t,onDelete:m,onConnect:ue,enableSwitchToSpace:(null===h||void 0===h?void 0:h.completed)||(0,$.isEmpty)(null===h||void 0===h?void 0:h.message)})]})]})),(0,U.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:Y.prefix,open:Y.open,popup:!0,action:Y.action,baseUrl:Y.baseUrl,checkFn:Y.checkFn,onSuccess:de,onClose:Y.onClose,checkTimeout:Y.checkTimeout,extraParams:Y.extraParams,messages:Y.messages,locale:C},"get-endpoint"),(0,U.jsx)(i.Z,{className:"selected-container ".concat(t?"selected":""),children:(0,U.jsx)(ee.default,{className:"selected-icon"})})]})}we.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ae.propTypes={spaceGateway:B().shape({did:B().string.isRequired,name:B().string.isRequired,url:B().string.isRequired,endpoint:B().string.isRequired,protected:B().bool}).isRequired,connected:B().bool.isRequired,progress:B().any.isRequired,refreshSpaceGateways:B().func.isRequired,onDelete:B().func,onBackupNow:B().func},Ae.defaultProps={onDelete:function(){},onBackupNow:function(){}};var Ce=(0,N.default)(i.Z)(ge||(ge=(0,G.Z)(["\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"]))),Be=Ae,Se=t(9715),Ie=t(2291),De=t(6779),Ee=t(20296),Ue=t(19886),Re=t.n(Ue),Te=t(88666),Le=["progress","spaceGateways"];function Fe(e){var n=e.progress,t=e.spaceGateways,s=(0,f.Z)(e,Le),m=(0,l.PE)(),x=m.t,v=m.locale,g=function(e){var n,t=e.blocklet,a=e.loading,s=e.progress,o=(0,r.useState)([]),i=(0,d.Z)(o,2),c=i[0],l=i[1],f=(0,D.h6)().api,h=(0,r.useCallback)((0,$.throttle)((0,u.Z)((0,p.Z)().mark((function e(){var n,r,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.getBlockletBackups({input:{did:null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.did}});case 2:r=e.sent,a=r.backups,l(null!==a&&void 0!==a?a:[]);case 5:case"end":return e.stop()}}),e)}))),2e3),[]);return(0,Y.Z)((0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h();case 1:case"end":return e.stop()}}),e)}))),[null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.did,s,a]),{backups:c}}({blocklet:(0,a.y0)().blocklet,progress:n}),Z=g.backups,y=[{label:"DID Spaces",name:"target",options:{customBodyRenderLite:function(e){var n,r=Z[e],a=r.targetUrl,s=r.targetName,o=(null===(n=t.find((function(e){return null===a||void 0===a?void 0:a.includes(null===e||void 0===e?void 0:e.url)})))||void 0===n?void 0:n.name)||s||"DID Space";return(0,U.jsx)(M.Z,{fontSize:"16px",href:a,target:"_blank",children:o})}}},{label:x("common.strategy"),name:"strategy",options:{customBodyRender:function(e){var n=x(0===e?"common.auto":"common.manual");return(0,U.jsx)(Se.Z,{children:n})}}},{label:x("common.startTime"),name:"createdAt",options:{customBodyRender:function(e){return Re()(e).format("YYYY-MM-DD HH:mm:ss")}}},{label:x("common.endTime"),name:"updatedAt",options:{customBodyRender:function(e){return(0,$.isEmpty)(e)?"":Re()(e).format("YYYY-MM-DD HH:mm:ss")}}},{label:x("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n,t=null!==(n=null===Z||void 0===Z?void 0:Z[e])&&void 0!==n?n:{},r=t.status,a=t.message,s=t.createdAt,o=(0,$.isNull)(r)&&Re()().diff(s,"hours")>6,l=o&&x("common.timeoutError"),p=0===r&&!o;return(0,$.isNull)(r)&&!o?(0,U.jsxs)(c.Z,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[(0,U.jsx)(h.Z,{sx:{marginRight:"4px"},size:"12px"}),x("common.progress")]}):p?(0,U.jsx)(Se.Z,{type:"success",children:x("common.succeeded")}):(0,U.jsxs)(i.Z,{display:"inline-flex",alignItems:"center",children:[(0,U.jsx)(Se.Z,{type:"error",children:x("common.failed")})," \xa0",(0,U.jsx)(De.Z,{style:{display:"flex",alignItems:"center",flexShrink:0},title:a||l,children:(0,U.jsx)(Ee.Z,{children:(0,U.jsx)(Te.Z,{style:{width:"24px",height:"24px"},color:"error"})})})]})}}}];return(0,U.jsx)(i.Z,(0,o.Z)((0,o.Z)({},s),{},{children:null!==Z&&void 0!==Z&&Z.length?(0,U.jsx)(Ie.Z,{title:(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",children:x("storage.spaces.backup.records")}),data:Z,columns:y,emptyNode:x("storage.spaces.record.emptyData",v),options:{download:!1,filter:!1,print:!1}}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i.Z,{display:"flex",height:"56px",lineHeight:"56px",alignItems:"center",children:(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",children:x("storage.spaces.backup.records")})}),(0,U.jsx)(i.Z,{color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:x("storage.spaces.record.emptyData")})]})}))}Fe.propTypes={progress:C.object.isRequired,spaceGateways:C.array.isRequired};var Ge=Fe;var Ne=function(e){var n=e.appDid,t=(0,r.useState)({message:"",progress:0,completed:!1}),a=(0,d.Z)(t,2),s=a[0],i=a[1];return(0,(0,D.h6)().ws.useSubscription)(j.BlockletEvents.backupProgress,(function(e){i((function(){return(0,o.Z)({},e)}))}),[n]),s};function ze(e){return Oe.apply(this,arguments)}function Oe(){return Oe=(0,u.Z)((0,p.Z)().mark((function e(n){var t,r,a,i,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.blockletDid,r=n.nodeApi,a=n.spaceGateways,i=!1,e.next=4,Promise.all(a.map(function(){var e=(0,u.Z)((0,p.Z)().mark((function e(n){var t,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.name,e.next=3,(0,s.nU)(n.endpoint);case 3:return r=e.sent,(0,$.isEmpty)(r)||r===t||(t=r,i=!0),e.abrupt("return",(0,o.Z)((0,o.Z)({},n),{},{name:t}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 4:if(c=e.sent,!i){e.next=8;break}return e.next=8,Promise.all(c.filter((function(e){return e.did})).map((function(e){return r.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:(0,o.Z)({},e)}})})));case 8:return e.abrupt("return",c);case 9:case"end":return e.stop()}}),e)}))),Oe.apply(this,arguments)}var Me=function(){var e,n=(0,l.PE)().t,t=(0,a.y0)(),o=t.blocklet,f=t.actions.refreshBlocklet,m=(0,D.h6)().api,x=(0,r.useMemo)((function(){return(0,s.mo)(null===o||void 0===o?void 0:o.environments)}),[o]),v=Ne({appDid:null===o||void 0===o?void 0:o.appDid}),g=(0,r.useState)(!1),Z=(0,d.Z)(g,2),y=Z[0],j=Z[1],b=function(e){var n=e.blockletDid,t=e.setLoading,a=void 0===t?function(){}:t,s=(0,r.useState)(!1),o=(0,d.Z)(s,2),i=o[0],c=o[1],l=(0,r.useState)([]),f=(0,d.Z)(l,2),h=f[0],m=f[1],x=(0,D.h6)().api;return(0,Y.Z)((0,u.Z)((0,p.Z)().mark((function e(){var t,r,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n){e.next=4;break}return m([]),e.abrupt("return");case 4:return a(!0),e.next=7,x.getBlockletSpaceGateways({input:{did:n}});case 7:return t=e.sent,r=t.spaceGateways,e.next=11,ze({blockletDid:n,nodeApi:x,spaceGateways:r});case 11:s=e.sent,m(null!==s&&void 0!==s?s:[]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0),k.Z.error((0,I.Z)(e.t0));case 19:return e.prev=19,a(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])}))),[n,i]),{refreshSpaceGateways:function(){c((function(e){return!e}))},spaceGateways:h}}({blockletDid:null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,setLoading:j,refreshBlocklet:f}),w=b.spaceGateways,A=b.refreshSpaceGateways,C=y&&!(null!==w&&void 0!==w&&w.length),B=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:if(t.endpoint!==x){e.next=5;break}return k.Z.warning(n("storage.spaces.gateway.delete.failedForConnected")),e.abrupt("return");case 5:return e.next=7,m.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:null===t||void 0===t?void 0:t.did}});case 7:k.Z.success(n("storage.spaces.gateway.delete.succeeded",{name:"(".concat(t.name,")")})),A();case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),S=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.backupBlocklet({input:{appDid:o.appDid,to:"spaces"}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,U.jsxs)(i.Z,{display:"flex",flexDirection:"column",children:[(0,U.jsxs)(i.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:[(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",children:n("storage.spaces.connected.title")}),(0,U.jsx)(F,{spaceGateways:w,refreshSpaceGateways:A})]}),(0,U.jsx)(i.Z,{children:C?(0,U.jsx)(i.Z,{display:"flex",justifyContent:"center",children:(0,U.jsx)(h.Z,{})}):w.map((function(e,n){return(0,U.jsx)(Be,{style:{marginTop:"12px"},spaceGateway:e,connected:w.findIndex((function(e){return e.endpoint===x}))===n,onDelete:B,onBackupNow:S,progress:v,refreshSpaceGateways:A},e.endpoint)}))}),(0,U.jsx)(Ge,{sx:{marginTop:"24px"},spaceGateways:w,progress:v}),(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:n("common.dataStorage")}),(0,U.jsx)(Q,{blocklet:o})]})};function Pe(){var e=(0,a.y0)().blocklet;return(0,r.useMemo)((function(){return(0,s.mo)(null===e||void 0===e?void 0:e.environments)}),[e])?(0,U.jsx)(Me,{}):(0,U.jsx)(X,{})}Pe.propTypes={};var Je=Pe},54559:function(e,n,t){t.d(n,{hi:function(){return s},od:function(){return a.a}});var r=t(95803),a=t.n(r);a().defaults.timeout=1e4;var s=a().create()},19066:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")},30134:function(e,n,t){t.d(n,{EJ:function(){return j},Jf:function(){return k},LQ:function(){return f},Nb:function(){return h},Xv:function(){return u},mo:function(){return x},nD:function(){return d},nU:function(){return Z},w2:function(){return v}});var r=t(32723),a=t(34795),s=t(92522),o=t.n(s),i=t(59505),c=t(50576),l=t(54559),p=t(19611);function u(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return p(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 p(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,o()(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 x(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function v(e){return g.apply(this,arguments)}function g(){return(g=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,s,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=p(n,"space/api/did/one-click-authorization/token"),e.next=6,l.hi.get(t,{timeout:5e3});case 6:return a=e.sent,s=a.status,i=a.data,e.abrupt("return",200===s&&(0,c.isObject)(i));case 12:return e.prev=12,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function Z(e){return y.apply(this,arguments)}function y(){return(y=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,s;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(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,s=a["x-space-name"],e.abrupt("return",s?decodeURIComponent(s):"");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 k(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return p(n,"/api/space/nft/display?spaceDid=".concat(t))}var j=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===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null}}}]);
2
- //# sourceMappingURL=8179.0c88ebf9.chunk.js.map
1
+ "use strict";(self.webpackChunk_abtnode_blocklet_services=self.webpackChunk_abtnode_blocklet_services||[]).push([[6869],{92746:function(e,n,t){var r,a=t(71171),s=t(33028),o=t(59740),i=t(16380),c=t(50442),l=t(37574),p=["labelProps","className","style"];function u(e){var n=e.labelProps,t=e.className,r=e.style,a=(0,o.Z)(e,p),i=(0,s.Z)((0,s.Z)({},n),{},{labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"});return(0,l.jsx)(d,{className:t,style:r,children:(0,l.jsx)(c.Z,(0,s.Z)({labelProps:i},a))})}u.propTypes=c.Z.propTypes,u.defaultProps=c.Z.defaultProps;var d=i.default.div(r||(r=(0,a.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(function(e){return e.theme.breakpoints.down("sm")}));n.Z=u},66869:function(e,n,t){t.r(n),t.d(n,{default:function(){return Qe}});var r=t(30969),a=t(45008),s=t(30134),o=t(33028),i=t(38361),c=t(33359),l=t(47333),p=t(32723),u=t(34795),d=t(96234),f=t(59740),h=t(94308),m=t(43207),x=t(87006),v=t(29996),g=t(50007),Z=t(19611),y=t.n(Z),k=t(94984),j=t(59505),b=t(15419),w=t(50496),A=t(23299),C=t(24974),B=t.n(C),S=t(54559),I=t(24891),D=t(41395),E=t(83998),U=t(37574),R=["spaceGateways","refreshSpaceGateways"];function T(e){var n=e.spaceGateways,t=e.refreshSpaceGateways,Z=(0,f.Z)(e,R),C=(0,a.y0)().blocklet,B=(0,D.h6)(),T=B.info,L=B.api,F=(0,l.PE)(),G=F.t,N=F.locale,z=(0,r.useMemo)((function(){return(0,s.mo)(null===C||void 0===C?void 0:C.environments)}),[C]),O=(0,r.useState)(""),M=(0,d.Z)(O,2),P=M[0],J=M[1],Q=(0,r.useState)(!1),H=(0,d.Z)(Q,2),K=H[0],V=H[1],X=(0,r.useState)(!1),Y=(0,d.Z)(X,2),W=Y[0],q=Y[1],_=(0,r.useState)(""),$=(0,d.Z)(_,2),ee=$[0],ne=$[1],te=(0,E.Z)({blocklet:C}),re=(0,I.yP)(T),ae=(0,r.useState)({open:!1,action:"get-did-spaces-endpoint",checkTimeout:3e5,checkFn:S.od.create({baseURL:y()(window.location.origin,(0,I.Y5)())}).get,messages:{title:G("storage.spaces.provideNFT.title",{appName:te.appName},N),scan:G("storage.spaces.provideNFT.scan",{appName:te.appName},N),confirm:"",success:(0,U.jsx)(c.Z,{gutterBottom:!0,children:G("storage.spaces.provideNFT.success")})},onClose:function(){ie((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),se=(0,d.Z)(ae,2),oe=se[0],ie=se[1],ce=(0,r.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:G("storage.spaces.authorize.title",{appName:te.appName},N),scan:G("storage.spaces.authorize.scan",{appName:te.appName},N),confirm:"",success:(0,U.jsx)(c.Z,{gutterBottom:!0,children:G("storage.spaces.authorize.success")})},onClose:function(){ue((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),le=(0,d.Z)(ce,2),pe=le[0],ue=le[1],de=function(e,n){setTimeout((0,u.Z)((0,p.Z)().mark((function t(){var r,a;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ue((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),ie((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),r=n(e.endpoint),a=e.space?n(e.space):{},t.next=6,fe((0,o.Z)((0,o.Z)({endpoint:r},{did:(0,s.LQ)(r),name:"DID Space"}),a));case 6:case"end":return t.stop()}}),t)}))),0)},fe=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(r){var a,o,i,c,l,u,d,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=r.endpoint,l=r.name,u=r.did,(d=null===c||void 0===c||null===(a=c.replace(/\/api\/.+/,""))||void 0===a||null===(o=a.trim())||void 0===o?void 0:o.replace(/\/$/,"")).startsWith("http")||(d="https://".concat(d)),e.next=5,(0,s.w2)(d);case 5:if(e.sent){e.next=8;break}return k.Z.error(G("storage.spaces.gateway.add.invalidUrl")),e.abrupt("return");case 8:if(!n.some((function(e){return e.endpoint===c}))){e.next=12;break}return k.Z.error(G("storage.spaces.gateway.add.duplicate",{name:l})),e.abrupt("return");case 12:return f={name:l,did:u,url:d,endpoint:c},e.next=15,L.addBlockletSpaceGateway({input:{did:C.meta.did,spaceGateway:f}});case 15:if(z===c){e.next=18;break}return e.next=18,L.configBlocklet({input:{did:[C.meta.did],configs:[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:c}]}});case 18:k.Z.success(G("storage.spaces.connectedWithName",{name:null!==(i=null===f||void 0===f?void 0:f.name)&&void 0!==i?i:"DID Spaces"})),t();case 20:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),he=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){var n,t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,V(!0),n=P.startsWith("http")?P:"https://".concat(P),e.next=5,(0,s.w2)(n);case 5:if(e.sent){e.next=7;break}throw new Error(G("storage.spaces.gateway.add.invalidUrl"));case 7:ue((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!0,prefix:y()(n,"space/api/did"),baseUrl:new URL(n).origin,checkFn:S.od.create({baseURL:y()(n,"space")}).get,extraParams:{appDid:te.appDid,appName:te.appName,appDescription:te.appDescription,scopes:te.scopes,appUrl:te.appUrl,referrer:te.referrer,nodeDid:T.did}})})),q(!1),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),t="".concat(G("storage.spaces.gateway.add.failed",N),": ").concat((0,I.Z)(e.t0)),ne(t);case 15:return e.prev=15,V(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,11,15,18]])})));return function(){return e.apply(this,arguments)}}();return(0,U.jsxs)(i.Z,{children:[(0,U.jsx)(b.Z,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:function(){ie((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!0,extraParams:{appDid:te.appDid,appName:te.appName,appDescription:te.appDescription,scopes:te.scopes,appUrl:te.appUrl,referrer:te.referrer,nodeDid:T.did}})}))},menu:[(0,U.jsx)(b.Z.Item,(0,o.Z)((0,o.Z)({sx:{textTransform:"none"},onClick:function(){return q(!0)},size:"small"},Z),{},{children:G("storage.spaces.connect.useSpaceGateway")}),"1")],children:(0,U.jsx)(c.Z,{sx:{fontWeight:"bold",textTransform:"none"},children:G("storage.spaces.connect.useWallet")})}),(0,U.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:oe.prefix,open:oe.open,popup:!0,action:oe.action,webWalletUrl:re,baseUrl:oe.baseUrl,checkFn:oe.checkFn,onSuccess:de,onClose:oe.onClose,checkTimeout:oe.checkTimeout,extraParams:oe.extraParams,messages:oe.messages,locale:N}),(0,U.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:pe.prefix,open:pe.open,popup:!0,action:pe.action,baseUrl:pe.baseUrl,checkFn:pe.checkFn,onSuccess:de,onClose:pe.onClose,checkTimeout:pe.checkTimeout,extraParams:pe.extraParams,messages:pe.messages,locale:N}),(0,U.jsxs)(w.Z,{title:G("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:W,onClose:function(){return q(!1)},PaperProps:{style:{minHeight:"auto"}},actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(v.Z,{onClick:function(e){e.stopPropagation(),q(!1)},color:"inherit",children:G("common.cancel")}),(0,U.jsxs)(v.Z,{onClick:he,color:"primary",disabled:K||!P,variant:"contained",autoFocus:!0,children:[K&&(0,U.jsx)(h.Z,{size:16}),G("common.confirm")]})]}),children:[(0,U.jsx)("div",{style:{paddingTop:12,overflowY:"hidden"},children:(0,U.jsx)(m.Z,{component:"div",children:(0,U.jsx)(c.Z,{component:"div",children:(0,U.jsx)(x.Z,{label:G("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:P,onChange:function(e){ne(null),J(e.target.value)},disabled:K,onKeyPress:function(){var e=(0,u.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==n.key){e.next=3;break}return e.next=3,he();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),autoFocus:!0})})})}),Boolean(ee)&&(0,U.jsx)(A.Z,{type:"error",style:{width:"100%"},children:ee})]})]})}T.propTypes={spaceGateways:C.array,refreshSpaceGateways:C.func},T.defaultProps={spaceGateways:[],refreshSpaceGateways:function(){}};var L,F=T,G=t(71171),N=t(16380),z=t(99237),O=t.n(z),M=t(19638),P=t(70177),J=["blocklet"];function Q(e){var n=e.blocklet,t=(0,f.Z)(e,J),a=(0,r.useContext)(l.RD).t;if(!n.diskInfo)return(0,U.jsx)(c.Z,{children:a("blocklet.diskInfo.empty")});var s=function(e,n,t){return(0,U.jsxs)(c.Z,{children:[t?(0,U.jsx)(M.Z,{style:{cursor:"pointer"},onClick:t,underline:"hover",children:e}):e," ",(0,U.jsx)("strong",{children:n?O()(n):"empty"})]})},i=n.environments.reduce((function(e,n){return e[n.key]=n.value,e}),{}),p=[{key:"appDir",name:a("blocklet.diskInfo.appDir"),value:s(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:a("blocklet.diskInfo.dataDir"),value:s(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:a("blocklet.diskInfo.logDir"),value:s(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:a("blocklet.diskInfo.cacheDir"),value:s(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return(0,U.jsx)(H,(0,o.Z)((0,o.Z)({component:"div"},t),{},{children:p.map((function(e){return(0,U.jsx)(P.Z,{valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.key)}))}))}Q.propTypes={blocklet:B().object.isRequired},Q.defaultProps={};var H=(0,N.default)(c.Z)(L||(L=(0,G.Z)([""]))),K=function(e){return(0,U.jsxs)("svg",(0,o.Z)((0,o.Z)({},e),{},{children:[(0,U.jsxs)("g",{filter:"url(#a)",children:[(0,U.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#DDD"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.192 6.222l-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97z",fill:"#000",fillOpacity:".08"}),(0,U.jsx)("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:(0,U.jsx)("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97z",fill:"#D9D9D9"})}),(0,U.jsxs)("g",{mask:"url(#b)",children:[(0,U.jsx)("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),(0,U.jsx)("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),(0,U.jsx)("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm11.546-10.102V169h-1.756v-11.636h1.756zM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29z",fill:"#fff"}),(0,U.jsx)("path",{d:"M117.604 47.263L121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847z",fill:"url(#e)"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z",fill:"url(#f)"}),(0,U.jsxs)("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[(0,U.jsx)("path",{d:"M50.928 216.089l1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911zm2.439.564h-1.13v1.193h1.13v-1.193zm-1.13 2.983h1.13v1.193h-1.13v-1.193z",fillOpacity:".8"}),(0,U.jsx)("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762zM36.355 214h-1.011v7.783h1.01V214zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75zM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894zm6.946 1.803h1.13v1.193h-1.13v-1.193zm1.13 2.983h-1.13v1.193h1.13v-1.193zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751z"})]}),(0,U.jsx)("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),(0,U.jsx)("path",{d:"M192.064 213.333l.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46z",fill:"#fff"}),(0,U.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26z",fill:"#fff"})]})]}),(0,U.jsxs)("defs",{children:[(0,U.jsxs)("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,U.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,U.jsx)("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,U.jsx)("feOffset",{dy:"2"}),(0,U.jsx)("feGaussianBlur",{stdDeviation:"2"}),(0,U.jsx)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,U.jsx)("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),(0,U.jsx)("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),(0,U.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),(0,U.jsx)("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,U.jsx)("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),(0,U.jsxs)("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#101010"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#272727"})]}),(0,U.jsxs)("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#fff",stopOpacity:".4"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#fff"})]}),(0,U.jsxs)("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[(0,U.jsx)("stop",{stopColor:"#fff"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),(0,U.jsxs)("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[(0,U.jsx)("stop",{stopColor:"#016BED"}),(0,U.jsx)("stop",{offset:".699",stopColor:"#4498FB"}),(0,U.jsx)("stop",{offset:"1",stopColor:"#9DFFE8"})]}),(0,U.jsx)("clipPath",{id:"g",children:(0,U.jsx)("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),(0,U.jsx)("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYz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OECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]}))};function V(){var e=(0,l.PE)().t,n=(0,a.y0)().blocklet;return(0,U.jsxs)(i.Z,{children:[(0,U.jsxs)(i.Z,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[(0,U.jsx)(K,{style:{width:200,height:250}}),(0,U.jsx)(c.Z,{marginTop:"24px",marginBottom:"24px",children:e("storage.spaces.connect.provider")}),(0,U.jsx)(F,{})]}),(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:e("common.dataStorage")}),(0,U.jsx)(Q,{blocklet:n})]})}K.defaultProps={width:"228",height:"258",viewBox:"0 0 228 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},V.propTypes={};var X=V,Y=t(57982),W=t(7173),q=t(38627),_=t(54164),$=t(50576),ee=t(38996),ne=t(36558),te=t(92746),re=t(94551),ae=t(48082),se=t(2689),oe=t(93310),ie=t(86008),ce=t(37973),le=t(20352),pe=t(61292),ue=t(60030),de=t(30291),fe=t(67531);function he(e){var n=e.spaceGateway,t=e.onDelete,a=(0,l.PE)().t,s=(0,r.useState)(!1),o=(0,d.Z)(s,2),i=o[0],c=o[1],f=(0,r.useState)(!1),h=(0,d.Z)(f,2),m=h[0],x=h[1],v=function(e,n){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),c(n)},g=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(r){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,null===r||void 0===r||r.stopPropagation(),x(!0),e.next=5,t(n);case 5:c(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),k.Z.error("".concat(a("storage.space.gateway.delete.failed"),": ").concat((0,I.Z)(e.t0)));case 12:return e.prev=12,x(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(se.Z,{color:"red",onClick:function(e){return v(e,!0)},children:[(0,U.jsx)(oe.Z,{style:{minWidth:24,color:"red"},children:(0,U.jsx)(de.default,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{style:{color:"red"},children:a("common.delete")})]}),(0,U.jsx)(fe.Z,{title:a("common.delConfirmDescription",{data:"".concat(null===n||void 0===n?void 0:n.name)}),open:i,confirmButton:{text:a("common.confirm"),props:{variant:"contained",color:"error",loading:m}},cancelButton:{text:a("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:g,onCancel:function(e){return v(e,!1)}})]})}he.propTypes={onDelete:B().func,spaceGateway:B().shape({name:B().string.isRequired,url:B().string.isRequired,protected:B().bool}).isRequired},he.defaultProps={onDelete:function(){}};var me=he,xe=["spaceGateway","connected","onDelete","onConnect","enableSwitchToSpace"];function ve(e){var n=e.spaceGateway,t=e.connected,a=e.onDelete,i=e.onConnect,c=e.enableSwitchToSpace,h=(0,f.Z)(e,xe),m=(0,r.useState)(null),x=(0,d.Z)(m,2),v=x[0],g=x[1],Z=(0,l.PE)().t,y=function(e,n){e.stopPropagation(),e.preventDefault(),g(n&&e.currentTarget)},k=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(t,!1),e.next=3,i(n);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(re.Z,(0,o.Z)((0,o.Z)({"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",onClick:function(e){return y(e,!0)},size:"small"},h),{},{children:(0,U.jsx)(ce.Z,{})})),(0,U.jsxs)(ae.Z,{id:"simple-menu",anchorEl:v,keepMounted:!0,open:Boolean(v),onClose:function(e){return y(e,!1)},children:[(0,U.jsxs)(se.Z,{onClick:function(e){y(e,!1),window.open(n.endpoint?(0,s.nD)(n.endpoint):n.url)},children:[(0,U.jsx)(oe.Z,{style:{minWidth:24},children:(0,U.jsx)(le.Z,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{children:Z("common.open")})]}),(0,U.jsxs)(se.Z,{onClick:function(e){y(e,!1),window.open((0,s.Xv)(n.endpoint))},children:[(0,U.jsx)(oe.Z,{style:{minWidth:24},children:(0,U.jsx)(ue.Z,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{children:Z("storage.spaces.strategy.viewBackupFiles")})]}),!t&&c&&(0,U.jsxs)(se.Z,{onClick:k,children:[(0,U.jsx)(oe.Z,{style:{minWidth:24},children:(0,U.jsx)(pe.Z,{fontSize:"small"})}),(0,U.jsx)(ie.Z,{children:Z("storage.spaces.connect.switchToSpace")})]}),!t&&(0,U.jsx)(me,{spaceGateway:n,onDelete:a})]})]})}ve.propTypes={spaceGateway:B().shape({name:B().string.isRequired,url:B().string.isRequired,protected:B().bool,endpoint:B().string.isRequired}).isRequired,connected:B().bool.isRequired,enableSwitchToSpace:B().bool,onDelete:B().func,onConnect:B().func},ve.defaultProps={onDelete:function(){},onConnect:function(){},enableSwitchToSpace:!0};var ge,Ze=ve,ye=t(19066),ke=t(50202),je=["spaceGateway","connected","progress","onDelete","onBackupNow","refreshSpaceGateways"],be=function(e){return(0,U.jsx)("svg",(0,o.Z)((0,o.Z)({},e),{},{children:(0,U.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})}))};be.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var we=function(e){return(0,U.jsx)("svg",(0,o.Z)((0,o.Z)({},e),{},{children:(0,U.jsx)("circle",{cx:"4",cy:"4",r:"4",fill:"#F16E6E"})}))};function Ae(e){var n=e.spaceGateway,t=e.connected,h=e.progress,m=e.onDelete,x=e.onBackupNow,Z=e.refreshSpaceGateways,b=(0,f.Z)(e,je),w=(0,l.PE)(),A=w.t,C=w.locale,B=(0,r.useState)(!1),I=(0,d.Z)(B,2),R=I[0],T=I[1],L=(0,a.y0)().blocklet,F=(0,D.h6)(),G=F.api,N=F.info.did,z=(0,E.Z)({blocklet:L}),O=z.appDid,M=z.appName,P=z.appDescription,J=z.scopes,Q=z.appUrl,H=z.referrer,K=(0,r.useMemo)((function(){return(0,s.mo)(null===L||void 0===L?void 0:L.environments)}),[L]),V=(0,r.useState)({open:!1,action:"one-click-authorization",checkTimeout:3e5,messages:{title:A("storage.spaces.authorize.title",{appName:M},C),scan:A("storage.spaces.authorize.scan",{appName:M},C),confirm:"",success:(0,U.jsx)(c.Z,{gutterBottom:!0,children:A("storage.spaces.authorize.success")})},onClose:function(){re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})}))}}),X=(0,d.Z)(V,2),Y=X[0],re=X[1],ae=(0,_.Z)((0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",!0);case 2:return e.abrupt("return",(0,s.Nb)(K));case 3:case"end":return e.stop()}}),e)}))),{refreshDeps:[t,K,null===Y||void 0===Y?void 0:Y.open,R]}),se=ae.data,oe=ae.loading,ie=t&&se,ce=t&&!R&&se,le=t&&R&&se,pe=t&&!se&&!oe&&!R,ue=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,s.Nb)(null===n||void 0===n?void 0:n.endpoint);case 2:if(!e.sent){e.next=8;break}return e.next=6,G.configBlocklet({input:{did:[L.meta.did],configs:[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 6:return k.Z.success(A("storage.spaces.connect.switchToSpaceSucceeded",{name:n.name?"(".concat(n.name,")"):""})),e.abrupt("return");case 8:re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!0,prefix:y()(n.url,"space/api/did"),baseUrl:new URL(n.url).origin,checkFn:S.od.create({baseURL:y()(n.url,"space")}).get,extraParams:{appDid:O,appName:M,appDescription:P,scopes:J,appUrl:Q,referrer:H,nodeDid:N}})}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(t,r){var a,i,c,l,u,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r(t.endpoint),u=(0,s.LQ)(l),d=t.space?r(t.space):{},!n.did||u===n.did){e.next=7;break}return re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),k.Z.error(A("storage.spaces.gateway.switch.failedForMismatchSpace",{name:null!==d&&void 0!==d&&d.name?d.name:""})),e.abrupt("return");case 7:return e.next=9,G.updateBlockletSpaceGateway({input:{did:L.meta.did,where:{url:null===n||void 0===n?void 0:n.url},spaceGateway:(0,o.Z)((0,o.Z)({},n),{},{name:null!==(a=d.name)&&void 0!==a?a:"DID Space",did:null!==(i=d.did)&&void 0!==i?i:(0,s.LQ)(l),endpoint:l})}});case 9:if(K===l){e.next=12;break}return e.next=12,G.configBlocklet({input:{did:[L.meta.did],configs:[{key:j.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:l}]}});case 12:k.Z.success(A("storage.spaces.connectedWithName",{name:null!==(c=null===n||void 0===n?void 0:n.name)&&void 0!==c?c:"DID Spaces"})),re((function(e){return(0,o.Z)((0,o.Z)({},e),{},{open:!1})})),Z();case 15:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),fe=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!R){e.next=3;break}return e.abrupt("return");case 3:return T(!0),e.next=6,x();case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0),k.Z.error(e.t0.message);case 12:return e.prev=12,T(!0),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,8,12,15]])})));return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)((function(){null!==h&&void 0!==h&&h.completed?(100===(null===h||void 0===h?void 0:h.progress)?k.Z.success(A("storage.spaces.backupSuccessfully")):-1===(null===h||void 0===h?void 0:h.progress)&&k.Z.error(null===h||void 0===h?void 0:h.message),T(!1),h.progress=0,h.message=""):h.progress&&T(!0)}),[h]),(0,U.jsxs)(Ce,{style:{position:"relative"},children:[(0,U.jsxs)(i.Z,(0,o.Z)((0,o.Z)({sx:{backgroundColor:t?"#F0FDFF":"inherit","&:hover":{backgroundColor:t?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px"},b),{},{children:[(0,U.jsx)(i.Z,{display:"flex",children:(0,U.jsx)(ke.Z,{alt:n.did,src:(0,s.Jf)(n.endpoint)})}),(0,U.jsxs)(i.Z,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:le?"row":"column",sx:{marginLeft:"20px",padding:"0px 0px"},children:[(0,U.jsxs)(i.Z,{className:"spaces-info",display:"flex",maxWidth:"360px",alignItems:"center",children:[(0,U.jsx)(c.Z,{color:t?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",children:n.name}),ie&&(0,U.jsx)(W.Z,{label:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(be,{style:{marginRight:"4px"}}),A("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}}),pe&&(0,U.jsx)(W.Z,{label:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(we,{style:{marginRight:"4px"}}),A("storage.spaces.disconnected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:"20px",fontWeight:"bold"}})]}),(0,U.jsx)(i.Z,{className:"spaces-address",display:le?"none":"flex",color:"#9397A1",marginTop:"8px",children:(0,U.jsx)(c.Z,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:n.did&&(0,U.jsx)(ne.Z,{copyable:!1,size:14,compact:!0,responsive:!1,did:n.did})})})]}),(0,U.jsxs)(i.Z,{className:"spaces-backup",display:"flex",alignItems:"center",children:[ce&&(0,U.jsxs)(i.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:[(0,U.jsx)(v.Z,{variant:"contained",size:"small",onClick:fe,children:A("storage.spaces.strategy.backupNow")}),ye.C&&(0,U.jsx)(te.Z,{name:"enable-auto-backup",title:"coming soon",disabled:!0,labelProps:{label:(0,U.jsx)(c.Z,{sx:{marginRight:"8px",fontSize:"16px"},children:(0,U.jsx)("span",{children:A("storage.spaces.strategy.autoBackup")})})},style:{marginLeft:"64px"}})]}),le&&(0,U.jsxs)(i.Z,{className:"backup-progress",display:"flex",flexDirection:"column",alignItems:"center",minWidth:"640px",marginRight:"auto",alignSelf:"end",children:[(0,U.jsx)(c.Z,{color:"primary",children:null===h||void 0===h?void 0:h.message}),(0,U.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center"},width:"100%",children:[(0,U.jsx)(i.Z,{sx:{width:"100%",mr:1},children:(0,U.jsx)(q.Z,{color:"primary",variant:"determinate",value:null===h||void 0===h?void 0:h.progress})}),(0,U.jsx)(i.Z,{sx:{minWidth:35},children:(0,U.jsxs)(c.Z,{variant:"body2",color:"text.secondary",children:[null===h||void 0===h?void 0:h.progress,"%"]})})]})]}),pe&&(0,U.jsx)(i.Z,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:(0,U.jsx)(v.Z,{color:"error",variant:"contained",size:"small",onClick:ue,children:A("storage.spaces.disconnected.reconnectNow")})}),(0,U.jsx)(Ze,{sx:{marginLeft:"16px",marginRight:"16px"},spaceGateway:n,connected:t,onDelete:m,onConnect:ue,enableSwitchToSpace:(null===h||void 0===h?void 0:h.completed)||(0,$.isEmpty)(null===h||void 0===h?void 0:h.message)})]})]})),(0,U.jsx)(g.default,{forceConnected:!1,saveConnect:!1,prefix:Y.prefix,open:Y.open,popup:!0,action:Y.action,baseUrl:Y.baseUrl,checkFn:Y.checkFn,onSuccess:de,onClose:Y.onClose,checkTimeout:Y.checkTimeout,extraParams:Y.extraParams,messages:Y.messages,locale:C},"get-endpoint"),(0,U.jsx)(i.Z,{className:"selected-container ".concat(t?"selected":""),children:(0,U.jsx)(ee.default,{className:"selected-icon"})})]})}we.defaultProps={width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ae.propTypes={spaceGateway:B().shape({did:B().string.isRequired,name:B().string.isRequired,url:B().string.isRequired,endpoint:B().string.isRequired,protected:B().bool}).isRequired,connected:B().bool.isRequired,progress:B().any.isRequired,refreshSpaceGateways:B().func.isRequired,onDelete:B().func,onBackupNow:B().func},Ae.defaultProps={onDelete:function(){},onBackupNow:function(){}};var Ce=(0,N.default)(i.Z)(ge||(ge=(0,G.Z)(["\n .selected-container {\n position: absolute;\n right: 0px;\n bottom: 0px;\n display: flex;\n -webkit-box-pack: end;\n justify-content: flex-end;\n align-items: flex-end;\n width: 32px;\n height: 32px;\n border-radius: 0px 0px 8px;\n color: rgb(255, 255, 255);\n overflow: hidden;\n transition: all 0.4s ease 0s;\n\n &::after {\n position: absolute;\n z-index: 0;\n left: 60px;\n top: 60px;\n display: block;\n width: 0px;\n height: 0px;\n border-width: 16px;\n border-style: solid;\n border-color: transparent #1dc1c7 #1dc1c7 transparent;\n transition: all 0.1s ease 0s;\n content: '';\n }\n\n .selected-icon {\n visibility: hidden;\n width: 60%;\n height: 60%;\n position: relative;\n z-index: 2;\n margin: 0px 1px 1px 0px;\n font-size: 16px;\n transition: all 0.2s ease 0s;\n }\n }\n\n .selected-container.selected {\n &::after {\n left: 0px;\n top: 0px;\n }\n\n .selected-icon {\n visibility: visible;\n }\n }\n"]))),Be=Ae,Se=t(9715),Ie=t(2291),De=t(6779),Ee=t(20296),Ue=t(19886),Re=t.n(Ue),Te=t(88666);function Le(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.loading,s=n.progress,o=(0,a.y0)().blocklet,i=(0,r.useState)([]),c=(0,d.Z)(i,2),l=c[0],f=c[1],h=(0,D.h6)().api,m=(0,r.useCallback)((0,$.throttle)((0,u.Z)((0,p.Z)().mark((function e(){var n,t,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h.getBlockletBackups({input:{did:null===o||void 0===o||null===(n=o.meta)||void 0===n?void 0:n.did}});case 2:t=e.sent,r=t.backups,f(null!==r&&void 0!==r?r:[]);case 5:case"end":return e.stop()}}),e)}))),2e3),[]);return(0,Y.Z)((0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m();case 1:case"end":return e.stop()}}),e)}))),[null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,s,t]),{backups:l}}var Fe=["progress","spaceGateways"];function Ge(e){var n=e.progress,t=e.spaceGateways,r=(0,f.Z)(e,Fe),a=(0,l.PE)(),s=a.t,p=a.locale,u=Le({progress:n}).backups,d=[{label:"DID Spaces",name:"target",options:{customBodyRenderLite:function(e){var n,r=u[e],a=r.targetUrl,s=r.targetName,o=(null===(n=t.find((function(e){return null===a||void 0===a?void 0:a.includes(null===e||void 0===e?void 0:e.url)})))||void 0===n?void 0:n.name)||s||"DID Space";return(0,U.jsx)(M.Z,{fontSize:"16px",href:a,target:"_blank",children:o})}}},{label:s("common.strategy"),name:"strategy",options:{customBodyRender:function(e){var n=s(0===e?"common.auto":"common.manual");return(0,U.jsx)(Se.Z,{children:n})}}},{label:s("common.startTime"),name:"createdAt",options:{customBodyRender:function(e){return Re()(e).format("YYYY-MM-DD HH:mm:ss")}}},{label:s("common.endTime"),name:"updatedAt",options:{customBodyRender:function(e){return(0,$.isEmpty)(e)?"":Re()(e).format("YYYY-MM-DD HH:mm:ss")}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:function(e){var n,t=null!==(n=null===u||void 0===u?void 0:u[e])&&void 0!==n?n:{},r=t.status,a=t.message,o=t.createdAt,l=(0,$.isNull)(r)&&Re()().diff(o,"hours")>6,p=l&&s("common.timeoutError"),d=0===r&&!l;return(0,$.isNull)(r)&&!l?(0,U.jsxs)(c.Z,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[(0,U.jsx)(h.Z,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):d?(0,U.jsx)(Se.Z,{type:"success",children:s("common.succeeded")}):(0,U.jsxs)(i.Z,{display:"inline-flex",alignItems:"center",children:[(0,U.jsx)(Se.Z,{type:"error",children:s("common.failed")})," \xa0",(0,U.jsx)(De.Z,{style:{display:"flex",alignItems:"center",flexShrink:0},title:a||p,children:(0,U.jsx)(Ee.Z,{children:(0,U.jsx)(Te.Z,{style:{width:"24px",height:"24px"},color:"error"})})})]})}}}];return(0,U.jsx)(i.Z,(0,o.Z)((0,o.Z)({},r),{},{children:null!==u&&void 0!==u&&u.length?(0,U.jsx)(Ie.Z,{title:(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")}),data:u,columns:d,emptyNode:s("storage.spaces.record.emptyData",p),options:{download:!1,filter:!1,print:!1}}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i.Z,{display:"flex",height:"56px",lineHeight:"56px",alignItems:"center",children:(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),(0,U.jsx)(i.Z,{color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:s("storage.spaces.record.emptyData")})]})}))}Ge.propTypes={progress:C.object.isRequired,spaceGateways:C.array.isRequired};var Ne=Ge;var ze=function(e){var n=e.appDid,t=Le().backups,a=(0,r.useState)({message:"",progress:0,completed:!1}),s=(0,d.Z)(a,2),i=s[0],c=s[1];return(0,(0,D.h6)().ws.useSubscription)(j.BlockletEvents.backupProgress,(function(e){c((function(){return(0,o.Z)({},e)}))}),[n]),(0,r.useEffect)((function(){var e;if(null!==t&&void 0!==t&&t.length&&(0,$.isNull)(null===(e=t[0])||void 0===e?void 0:e.status)){var n=(0,d.Z)(t,1)[0];c((function(){return{message:n.message,progress:n.progress,completed:Boolean(n.progress>=100)}}))}}),[t]),i};function Oe(e){return Me.apply(this,arguments)}function Me(){return Me=(0,u.Z)((0,p.Z)().mark((function e(n){var t,r,a,i,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.blockletDid,r=n.nodeApi,a=n.spaceGateways,i=!1,e.next=4,Promise.all(a.map(function(){var e=(0,u.Z)((0,p.Z)().mark((function e(n){var t,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.name,e.next=3,(0,s.nU)(n.endpoint);case 3:return r=e.sent,(0,$.isEmpty)(r)||r===t||(t=r,i=!0),e.abrupt("return",(0,o.Z)((0,o.Z)({},n),{},{name:t}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 4:if(c=e.sent,!i){e.next=8;break}return e.next=8,Promise.all(c.filter((function(e){return e.did})).map((function(e){return r.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:(0,o.Z)({},e)}})})));case 8:return e.abrupt("return",c);case 9:case"end":return e.stop()}}),e)}))),Me.apply(this,arguments)}var Pe=function(){var e,n=(0,l.PE)().t,t=(0,a.y0)(),o=t.blocklet,f=t.actions.refreshBlocklet,m=(0,D.h6)().api,x=(0,r.useMemo)((function(){return(0,s.mo)(null===o||void 0===o?void 0:o.environments)}),[o]),v=ze({appDid:null===o||void 0===o?void 0:o.appDid}),g=(0,r.useState)(!1),Z=(0,d.Z)(g,2),y=Z[0],j=Z[1],b=function(e){var n=e.blockletDid,t=e.setLoading,a=void 0===t?function(){}:t,s=(0,r.useState)(!1),o=(0,d.Z)(s,2),i=o[0],c=o[1],l=(0,r.useState)([]),f=(0,d.Z)(l,2),h=f[0],m=f[1],x=(0,D.h6)().api;return(0,Y.Z)((0,u.Z)((0,p.Z)().mark((function e(){var t,r,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n){e.next=4;break}return m([]),e.abrupt("return");case 4:return a(!0),e.next=7,x.getBlockletSpaceGateways({input:{did:n}});case 7:return t=e.sent,r=t.spaceGateways,e.next=11,Oe({blockletDid:n,nodeApi:x,spaceGateways:r});case 11:s=e.sent,m(null!==s&&void 0!==s?s:[]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0),k.Z.error((0,I.Z)(e.t0));case 19:return e.prev=19,a(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])}))),[n,i]),{refreshSpaceGateways:function(){c((function(e){return!e}))},spaceGateways:h}}({blockletDid:null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,setLoading:j,refreshBlocklet:f}),w=b.spaceGateways,A=b.refreshSpaceGateways,C=y&&!(null!==w&&void 0!==w&&w.length),B=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:if(t.endpoint!==x){e.next=5;break}return k.Z.warning(n("storage.spaces.gateway.delete.failedForConnected")),e.abrupt("return");case 5:return e.next=7,m.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:null===t||void 0===t?void 0:t.did}});case 7:k.Z.success(n("storage.spaces.gateway.delete.succeeded",{name:"(".concat(t.name,")")})),A();case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),S=function(){var e=(0,u.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.backupBlocklet({input:{appDid:o.appDid,to:"spaces"}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,U.jsxs)(i.Z,{display:"flex",flexDirection:"column",children:[(0,U.jsxs)(i.Z,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:[(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",children:n("storage.spaces.connected.title")}),(0,U.jsx)(F,{spaceGateways:w,refreshSpaceGateways:A})]}),(0,U.jsx)(i.Z,{children:C?(0,U.jsx)(i.Z,{display:"flex",justifyContent:"center",children:(0,U.jsx)(h.Z,{})}):w.map((function(e,n){return(0,U.jsx)(Be,{style:{marginTop:"12px"},spaceGateway:e,connected:w.findIndex((function(e){return e.endpoint===x}))===n,onDelete:B,onBackupNow:S,progress:v,refreshSpaceGateways:A},e.endpoint)}))}),(0,U.jsx)(Ne,{sx:{marginTop:"24px"},spaceGateways:w,progress:v}),(0,U.jsx)(c.Z,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:n("common.dataStorage")}),(0,U.jsx)(Q,{blocklet:o})]})};function Je(){var e=(0,a.y0)().blocklet;return(0,r.useMemo)((function(){return(0,s.mo)(null===e||void 0===e?void 0:e.environments)}),[e])?(0,U.jsx)(Pe,{}):(0,U.jsx)(X,{})}Je.propTypes={};var Qe=Je},54559:function(e,n,t){t.d(n,{hi:function(){return s},od:function(){return a.a}});var r=t(95803),a=t.n(r);a().defaults.timeout=1e4;var s=a().create()},19066:function(e,n,t){t.d(n,{C:function(){return r}});var r="true"===localStorage.getItem("enableDebug")},30134:function(e,n,t){t.d(n,{EJ:function(){return j},Jf:function(){return k},LQ:function(){return f},Nb:function(){return h},Xv:function(){return u},mo:function(){return x},nD:function(){return d},nU:function(){return Z},w2:function(){return v}});var r=t(32723),a=t(34795),s=t(92522),o=t.n(s),i=t(59505),c=t(50576),l=t(54559),p=t(19611);function u(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return p(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 p(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,o()(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 x(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function v(e){return g.apply(this,arguments)}function g(){return(g=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,s,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(n)){e.next=3;break}return e.abrupt("return",!1);case 3:return t=p(n,"space/api/did/one-click-authorization/token"),e.next=6,l.hi.get(t,{timeout:5e3});case 6:return a=e.sent,s=a.status,i=a.data,e.abrupt("return",200===s&&(0,c.isObject)(i));case 12:return e.prev=12,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function Z(e){return y.apply(this,arguments)}function y(){return(y=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,s;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o()(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,s=a["x-space-name"],e.abrupt("return",s?decodeURIComponent(s):"");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 k(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return p(n,"/api/space/nft/display?spaceDid=".concat(t))}var j=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===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT})))||void 0===t?void 0:t.value)||null}}}]);
2
+ //# sourceMappingURL=6869.f4060231.chunk.js.map