@abtnode/webapp 1.16.15 → 1.16.16-beta-d8a9fb09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +59 -59
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/{1366.80cb7943.chunk.js → 1366.035996e1.chunk.js} +2 -2
- package/build/static/js/1685.ad51d1ae.chunk.js +2 -0
- package/build/static/js/17.07b2c6ce.chunk.js +1 -0
- package/build/static/js/{2113.a0a3a688.chunk.js → 2113.7430fbc7.chunk.js} +1 -1
- package/build/static/js/2264.da57cd26.chunk.js +1 -0
- package/build/static/js/2294.d78e6ed6.chunk.js +1 -0
- package/build/static/js/{2305.1a17468a.chunk.js → 2305.1de337f9.chunk.js} +2 -2
- package/build/static/js/2334.390f073a.chunk.js +1 -0
- package/build/static/js/2537.0e8b4b3c.chunk.js +1 -0
- package/build/static/js/2611.453b18de.chunk.js +1 -0
- package/build/static/js/287.436815b1.chunk.js +1 -0
- package/build/static/js/3135.92de458b.chunk.js +1 -0
- package/build/static/js/{3245.878486bd.chunk.js → 3245.f859c2c5.chunk.js} +1 -1
- package/build/static/js/3704.e2d6cd48.chunk.js +2 -0
- package/build/static/js/3716.edb3d2ce.chunk.js +1 -0
- package/build/static/js/373.f3b27d9c.chunk.js +1 -0
- package/build/static/js/4407.61ba5c61.chunk.js +2 -0
- package/build/static/js/4448.f8411651.chunk.js +1 -0
- package/build/static/js/4471.b4cda6ce.chunk.js +1 -0
- package/build/static/js/{4775.566b21e6.chunk.js → 4775.dde53f2e.chunk.js} +1 -1
- package/build/static/js/4906.f594c3a7.chunk.js +1 -0
- package/build/static/js/5015.4b2a6f82.chunk.js +1 -0
- package/build/static/js/5074.c3560023.chunk.js +1 -0
- package/build/static/js/542.f9ed38ac.chunk.js +1 -0
- package/build/static/js/{7604.6ad5024b.chunk.js → 5526.fd2c4f9a.chunk.js} +2 -2
- package/build/static/js/5760.420f21b0.chunk.js +1 -0
- package/build/static/js/5804.d00d4267.chunk.js +1 -0
- package/build/static/js/5808.699d12fc.chunk.js +1 -0
- package/build/static/js/5928.a3e4f24e.chunk.js +1 -0
- package/build/static/js/5979.f3310ab6.chunk.js +1 -0
- package/build/static/js/6412.e1281d1a.chunk.js +1 -0
- package/build/static/js/6511.d3acc514.chunk.js +1 -0
- package/build/static/js/6580.59ebe9b2.chunk.js +1 -0
- package/build/static/js/6591.a18bd50c.chunk.js +1 -0
- package/build/static/js/{6931.acbe76ac.chunk.js → 6931.0aa9f62b.chunk.js} +1 -1
- package/build/static/js/6950.ea661eae.chunk.js +1 -0
- package/build/static/js/6960.15f4fcbf.chunk.js +1 -0
- package/build/static/js/{7020.35799de3.chunk.js → 7020.995924d8.chunk.js} +1 -1
- package/build/static/js/7126.10e43092.chunk.js +1 -0
- package/build/static/js/7327.33c2d17b.chunk.js +1 -0
- package/build/static/js/7534.e41084cc.chunk.js +1 -0
- package/build/static/js/7638.ae3e296a.chunk.js +1 -0
- package/build/static/js/{7676.b037def1.chunk.js → 7676.bc69ead5.chunk.js} +2 -2
- package/build/static/js/{7718.11941d75.chunk.js → 7718.e4a5899b.chunk.js} +1 -1
- package/build/static/js/{7913.60bf9666.chunk.js → 7913.d2d51ce2.chunk.js} +1 -1
- package/build/static/js/8059.d969b349.chunk.js +1 -0
- package/build/static/js/{8462.06893881.chunk.js → 8212.06eb9697.chunk.js} +1 -1
- package/build/static/js/8219.7e3bd847.chunk.js +1 -0
- package/build/static/js/8382.232e3b29.chunk.js +1 -0
- package/build/static/js/8973.6b8d2a7e.chunk.js +1 -0
- package/build/static/js/8986.09896e72.chunk.js +1 -0
- package/build/static/js/{9038.b426e282.chunk.js → 9038.cb77b205.chunk.js} +1 -1
- package/build/static/js/9041.2a0b2bc1.chunk.js +1 -0
- package/build/static/js/9249.fddf03b3.chunk.js +1 -0
- package/build/static/js/9272.ba198b07.chunk.js +2 -0
- package/build/static/js/{9354.6dc219d4.chunk.js → 9354.c3636ea4.chunk.js} +1 -1
- package/build/static/js/9963.2f462f42.chunk.js +1 -0
- package/build/static/js/main.56a3da7f.js +2 -0
- package/build/static/js/{main.08aa73b3.js.LICENSE.txt → main.56a3da7f.js.LICENSE.txt} +1 -1
- package/package.json +1 -1
- package/build/static/js/1685.1679bdbd.chunk.js +0 -2
- package/build/static/js/17.713812e2.chunk.js +0 -1
- package/build/static/js/2264.1bb35f21.chunk.js +0 -1
- package/build/static/js/2334.0b172bcb.chunk.js +0 -1
- package/build/static/js/2537.6b53c30e.chunk.js +0 -1
- package/build/static/js/2611.5f974cf9.chunk.js +0 -1
- package/build/static/js/2701.fd3340e3.chunk.js +0 -2
- package/build/static/js/3704.139947e9.chunk.js +0 -2
- package/build/static/js/373.4186f825.chunk.js +0 -1
- package/build/static/js/4407.0fbdcce5.chunk.js +0 -2
- package/build/static/js/4448.e395311c.chunk.js +0 -1
- package/build/static/js/4471.3c161621.chunk.js +0 -1
- package/build/static/js/4620.551c484b.chunk.js +0 -1
- package/build/static/js/4906.53f9d4cf.chunk.js +0 -1
- package/build/static/js/5074.ba8a496a.chunk.js +0 -1
- package/build/static/js/5285.93a44f4f.chunk.js +0 -1
- package/build/static/js/542.8f68a1a2.chunk.js +0 -1
- package/build/static/js/5760.e7d79d06.chunk.js +0 -1
- package/build/static/js/5804.16a15b7c.chunk.js +0 -1
- package/build/static/js/5808.d9f09727.chunk.js +0 -1
- package/build/static/js/5928.5547c6bf.chunk.js +0 -1
- package/build/static/js/5979.0302c2f7.chunk.js +0 -1
- package/build/static/js/6412.3a0769c9.chunk.js +0 -1
- package/build/static/js/6419.7040d60f.chunk.js +0 -1
- package/build/static/js/6511.2affe0af.chunk.js +0 -1
- package/build/static/js/6580.0759038f.chunk.js +0 -1
- package/build/static/js/6591.dc758fef.chunk.js +0 -1
- package/build/static/js/6950.a12e3c2c.chunk.js +0 -1
- package/build/static/js/6960.df1b5bef.chunk.js +0 -1
- package/build/static/js/7126.95bba107.chunk.js +0 -1
- package/build/static/js/7327.a5410af5.chunk.js +0 -1
- package/build/static/js/7534.0f093319.chunk.js +0 -1
- package/build/static/js/7638.4c7ee6d6.chunk.js +0 -1
- package/build/static/js/8059.680ccc09.chunk.js +0 -1
- package/build/static/js/8219.b5187ff9.chunk.js +0 -1
- package/build/static/js/8382.18c7c450.chunk.js +0 -1
- package/build/static/js/8719.27070c24.chunk.js +0 -1
- package/build/static/js/8973.9e4b78ce.chunk.js +0 -1
- package/build/static/js/9041.e02ca359.chunk.js +0 -1
- package/build/static/js/9244.01ad2b1f.chunk.js +0 -1
- package/build/static/js/9249.c13079fe.chunk.js +0 -1
- package/build/static/js/9744.b4732fbc.chunk.js +0 -1
- package/build/static/js/9963.d6ed27e8.chunk.js +0 -1
- package/build/static/js/main.08aa73b3.js +0 -2
- /package/build/static/js/{1366.80cb7943.chunk.js.LICENSE.txt → 1366.035996e1.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{1685.1679bdbd.chunk.js.LICENSE.txt → 1685.ad51d1ae.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2305.1a17468a.chunk.js.LICENSE.txt → 2305.1de337f9.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{3704.139947e9.chunk.js.LICENSE.txt → 3704.e2d6cd48.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{4407.0fbdcce5.chunk.js.LICENSE.txt → 4407.61ba5c61.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7604.6ad5024b.chunk.js.LICENSE.txt → 5526.fd2c4f9a.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{7676.b037def1.chunk.js.LICENSE.txt → 7676.bc69ead5.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{2701.fd3340e3.chunk.js.LICENSE.txt → 9272.ba198b07.chunk.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6412],{32322:function(e,n,t){n.h1=void 0;var r=t(76811);function i(e){return(null===e||void 0===e?void 0:e.connectedAccounts)||[]}function a(e){return i(e).find((function(e){return e.provider===r.LOGIN_PROVIDER.WALLET}))}n.h1=function(e){var n=a(e);return null===n||void 0===n?void 0:n.did}},92726:function(e,n,t){t.d(n,{Z:function(){return k}});var r,i=t(71171),a=t(32723),o=t(34795),s=t(33028),c=t(96234),l=t(59740),u=t(5057),d=t(55898),p=t.n(d),m=t(33518),f=t(67680),h=t(61533),x=t(74490),v=t(45267),g=t(46954),Z=t(44067),b=t(96266),j=["actions","size"],y=["icon","text","onClick","disabled"];function k(e){var n=e.actions,t=e.size,r=(0,l.Z)(e,j),i=(0,u.useState)(null),d=(0,c.Z)(i,2),p=d[0],m=d[1],k=Boolean(p),w=function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}m(null)};return(0,b.jsxs)(C,(0,s.Z)((0,s.Z)({},r),{},{children:[(0,b.jsx)(f.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}m(e.currentTarget)},size:t,children:(0,b.jsx)(v.Z,{})}),(0,b.jsx)(h.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:p,keepMounted:!0,open:k,onClose:w,PaperProps:{},children:n.map((function(e,n){if("function"===typeof e)return e({close:w});var t=e.icon,r=e.text,i=e.onClick,c=e.disabled,d=void 0!==c&&c,p=(0,l.Z)(e,y);return(0,u.createElement)(x.Z,(0,s.Z)((0,s.Z)({},p),{},{disabled:d,dense:!0,onClick:function(){var e=(0,o.Z)((0,a.Z)().mark((function e(n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i(n);case 2:w();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),key:n,"data-cy":"actions-menu-".concat(n)}),(0,b.jsx)(g.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,b.jsx)(Z.Z,{primary:r}))}))})]}))}k.propTypes={actions:p().array,size:p().oneOf(["small","medium","large"])},k.defaultProps={actions:[],size:"small"};var C=m.Z.div(r||(r=(0,i.Z)([""])))},50185:function(e,n,t){t.d(n,{Z:function(){return p}});var r=t(33028),i=t(59740),a=t(5057),o=t(55898),s=t.n(o),c=t(12937),l=t(68420),u=t(96266),d=["children"];function p(e){var n=e.children,t=(0,i.Z)(e,d),o=(0,a.useContext)(l.RD).t;return(0,u.jsx)(c.Z,(0,r.Z)((0,r.Z)({tip:o("common.copyTip"),copiedTip:o("common.copiedTip")},t),{},{children:n}))}p.propTypes={children:s().any.isRequired}},9729:function(e,n,t){t.d(n,{Z:function(){return m}});var r,i=t(71171),a=t(33028),o=t(59740),s=t(55898),c=t.n(s),l=t(33518),u=t(13727),d=t(96266),p=["passport","onDelete"];function m(e){var n=e.passport,t=e.onDelete,r=(0,o.Z)(e,p);return(0,d.jsxs)(f,(0,a.Z)((0,a.Z)({},r),{},{children:[n.title||n.name," ",!!t&&(0,d.jsx)(u.default,{"data-cy":"delete-issuance",className:"delete",onClick:t})]}))}m.propTypes={passport:c().object.isRequired,onDelete:c().func},m.defaultProps={onDelete:null};var f=l.Z.span(r||(r=(0,i.Z)(["\n display: inline-flex;\n padding: 2px 8px;\n background: ",";\n border-radius: 100vw;\n font-weight: 400;\n font-size: 12px;\n line-height: 22px;\n color: #fff;\n align-items: center;\n .delete {\n font-size: 1em;\n margin-left: 6px;\n cursor: pointer;\n }\n"])),(function(e){return e.theme.palette.primary.main}))},46412:function(e,n,t){t.r(n),t.d(n,{default:function(){return pn}});var r,i=t(71171),a=t(33028),o=t(32723),s=t(34795),c=t(96234),l=t(5057),u=t(33518),d=t(75506),p=t.n(d),m=t(55898),f=t.n(m),h=t(52277),x=t.n(h),v=t(13128),g=t(75239),Z=t(39948),b=t(26174),j=t(88092),y=t(44919),k=t(80578),C=t(72333),w=t(68420),D=t(28726),S=t(68051),P=t(18945),R=t(49777),T=t(75760),I=t(49384),E=t(35432),N=t(10381),A=t(42061),z=t(86229),B=t(22228),L=t(92816),_=t(58238),U=t(17425),W=t(29054),O=t(63406),q=t(14491),F=t(44846),M=t(55372),V=t(11750),K=t(74490),J=t(51177),H=t(47020),X=t(6041),$=t(80576),G=t(88574),Y=t(50185),Q=t(96266);function ee(e){var n=e.teamDid,t=e.roles,r=e.onCancel,i=e.onSuccess,a=e.onError,u=e.endpoint,d=(0,_.h6)().api,p=(0,l.useState)(!1),m=(0,c.Z)(p,2),f=m[0],h=m[1],x=(0,l.useState)(""),g=(0,c.Z)(x,2),Z=g[0],b=g[1],j=(0,w.PE)(),y=j.t,k=j.locale,C=(0,l.useState)(0),S=(0,c.Z)(C,2),P=S[0],R=S[1],T=(0,l.useState)(""),I=(0,c.Z)(T,2),E=I[0],N=I[1],A=(0,l.useState)(""),z=(0,c.Z)(A,2),B=z[0],L=z[1],U=(0,l.useState)(""),W=(0,c.Z)(U,2),O=W[0],ee=W[1],ne=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(){var t,r,i,s;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B){e.next=3;break}return b(y("team.member.error.passportEmpty")),e.abrupt("return");case 3:return t=O.trim(),b(null),h(!0),e.prev=6,e.next=9,d.createMemberInvitation({input:{teamDid:n,role:B,remark:t}});case 9:r=e.sent,i=r.inviteInfo,N(i),R(1),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(6),s=(0,q.Z)(e.t0),b(s),a(e.t0);case 20:return e.prev=20,h(!1),e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[6,15,20,23]])})));return function(){return e.apply(this,arguments)}}(),re=[{body:(0,Q.jsxs)(V.Z,{component:"div",children:[(0,Q.jsxs)($.Z,{style:{width:"100%"},variant:"outlined",children:[(0,Q.jsx)(X.Z,{children:y("common.passport")}),(0,Q.jsx)(J.Z,{"data-cy":"invite-member-select-role",value:B,onChange:function(e){b(null),L(e.target.value)},fullWidth:!0,label:y("common.passport"),disabled:f,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),ne())},children:t.filter((function(e){return"owner"!==e.name})).map((function(e){return(0,Q.jsx)(K.Z,{value:e.name,"data-cy":"invite-member-select-option-".concat(e.name),children:(0,Q.jsx)("span",{children:e.title||e.name})},e.name)}))})]}),(0,Q.jsx)("div",{style:{marginTop:20,marginBottom:10}}),(0,Q.jsx)(H.Z,{label:y("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:O,onChange:function(e){b(null),ee(e.target.value)},disabled:f,"data-cy":"invite-member-input-remark"}),(0,Q.jsx)("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:y("common.cancel"),confirm:y("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:ne},{body:function(){var e=(0,q.ly)({inviteId:E.inviteId,endpoint:u});return(0,Q.jsxs)("div",{children:[(0,Q.jsx)(te,{children:y("team.member.inviteDialog.createSuccessTip",{expireDate:(0,q.B2)(E.expireDate,k)})}),(0,Q.jsx)("div",{style:{marginTop:"40px"}}),(0,Q.jsx)(Y.Z,{children:e})]})},confirm:y("common.confirm"),onConfirm:i}][P];return(0,Q.jsxs)(v.ZP,{title:y("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,Q.jsxs)(Q.Fragment,{children:[re.cancel&&(0,Q.jsx)(D.Z,{onClick:re.onCancel,color:"inherit",children:re.cancel}),(0,Q.jsxs)(D.Z,{onClick:re.onConfirm,color:"primary",disabled:f||!B,variant:"contained",autoFocus:!0,children:[f&&(0,Q.jsx)(F.Z,{size:16}),re.confirm]})]}),children:[(0,Q.jsx)(M.Z,{component:"div",children:"function"===typeof re.body?re.body():re.body}),!!Z&&(0,Q.jsx)(G.Z,{type:"error",variant:"icon",children:Z})]})}ee.propTypes={teamDid:f().string.isRequired,onCancel:f().func.isRequired,onSuccess:f().func.isRequired,onError:f().func,roles:f().array,endpoint:f().string},ee.defaultProps={onError:function(){},roles:[],endpoint:""};var ne,te=u.Z.div(r||(r=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n"]))),re=t(26796),ie=t(43681),ae=t.n(ie),oe=t(96501),se=t(73545);function ce(e){var n=e.teamDid,t=e.onCancel,r=e.onSuccess,i=e.onError,a=e.endpoint,u=(0,_.h6)(),d=u.api,p=u.info,m=(0,l.useContext)(se.B).api,f=(0,l.useState)(!1),h=(0,c.Z)(f,2),x=h[0],g=h[1],Z=(0,w.PE)(),b=Z.t,j=Z.locale,y=(0,l.useState)(""),k=(0,c.Z)(y,2),C=k[0],S=k[1],P=(0,l.useState)(!1),R=(0,c.Z)(P,2),T=R[0],I=R[1],E=(0,l.useState)(0),N=(0,c.Z)(E,2),A=N[0],z=N[1],B=(0,l.useState)(""),L=(0,c.Z)(B,2),U=L[0],W=L[1],O=(0,l.useState)(""),K=(0,c.Z)(O,2),J=K[0],X=K[1],$=!!ae()(p,"ownerNft.did"),ee=(0,re.default)((0,s.Z)((0,o.Z)().mark((function e(){var n,t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!$){e.next=6;break}return e.next=3,d.getDelegationState();case 3:return n=e.sent,t=n.state,e.abrupt("return",t);case 6:return e.abrupt("return",{delegated:!0});case 7:case"end":return e.stop()}}),e)}))));if(ee.loading)return(0,Q.jsx)(v.ZP,{title:b("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:(0,Q.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,Q.jsx)(F.Z,{})})});if(ee.error)return(0,Q.jsx)(v.ZP,{title:b("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:(0,Q.jsx)(G.Z,{type:"error",variant:"icon",children:(0,q.Z)(ee.error)})});var ne=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(){var t,r,a;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(null),g(!0),e.prev=2,e.next=5,d.createTransferInvitation({input:{teamDid:n,role:"owner",remark:J.trim()}});case 5:t=e.sent,r=t.inviteInfo,W(r),z(ie.length-1),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),a=(0,q.Z)(e.t0),S(a),i(e.t0);case 16:return e.prev=16,g(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[2,11,16,19]])})));return function(){return e.apply(this,arguments)}}(),te=function(){I(!1),z(0)},ie=[{body:(0,Q.jsxs)(V.Z,{component:"div",children:[(0,Q.jsxs)(G.Z,{type:"warning",children:[(0,Q.jsx)(V.Z,{children:b("team.transferNode.inviteDialog.tips.progress")}),(0,Q.jsx)(V.Z,{children:b("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),(0,Q.jsx)(G.Z,{type:"warning",children:(0,Q.jsx)(V.Z,{children:b("team.transferNode.inviteDialog.tips.revoke")})}),(0,Q.jsx)("div",{style:{marginTop:20,marginBottom:10}}),(0,Q.jsx)(H.Z,{label:b("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:J,onChange:function(e){S(null),X(e.target.value)},disabled:x,"data-cy":"transfer-node-input-remark"}),(0,Q.jsx)("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:b("common.cancel"),confirm:b("team.transferNode.inviteDialog.createInviteLink"),onCancel:t,onConfirm:$&&!ae()(ee,"value.delegated")?function(){I(!0),z(1)}:ne},{body:function(){return(0,Q.jsx)(oe.default,{action:"delegate-transfer-nft",open:T,locale:j,checkFn:m.get,onClose:te,onSuccess:ne,checkTimeout:3e5,webWalletUrl:(0,q.yP)(p),extraParams:{targetDID:p.did},messages:{title:b("team.transferNode.delegateDialog.title"),scan:b("team.transferNode.delegateDialog.scan"),confirm:b("team.transferNode.delegateDialog.confirm"),success:b("team.transferNode.delegateDialog.success")},popup:!0})}},{body:function(){var e=(0,q.ly)({inviteId:U.inviteId,endpoint:a});return(0,Q.jsxs)("div",{children:[(0,Q.jsx)(ue,{children:b("team.transferNode.inviteDialog.createSuccessTip",{expireDate:(0,q.B2)(U.expireDate,j)})}),(0,Q.jsx)("div",{style:{marginTop:"40px"}}),(0,Q.jsx)(Y.Z,{children:e})]})},confirm:b("common.confirm"),onConfirm:r}],ce=ie[A];return(0,Q.jsxs)(v.ZP,{title:b("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,Q.jsxs)(Q.Fragment,{children:[ce.cancel&&(0,Q.jsx)(D.Z,{onClick:ce.onCancel,color:"inherit",children:ce.cancel}),(0,Q.jsxs)(D.Z,{onClick:ce.onConfirm,color:"primary",disabled:x,variant:"contained",autoFocus:!0,children:[x&&(0,Q.jsx)(F.Z,{size:16}),ce.confirm]})]}),children:[(0,Q.jsx)(M.Z,{component:"div",children:"function"===typeof ce.body?ce.body():ce.body}),!!C&&(0,Q.jsx)(G.Z,{type:"error",variant:"icon",children:C})]})}ce.propTypes={teamDid:f().string.isRequired,onCancel:f().func.isRequired,onSuccess:f().func.isRequired,onError:f().func,endpoint:f().string},ce.defaultProps={onError:function(){},endpoint:""};var le,ue=u.Z.div(ne||(ne=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n"]))),de=(t(59740),t(62681)),pe=t(94464),me=t(64886),fe=t(12987),he=t(71246),xe=t(12673),ve=t(76811),ge=t(70461),Ze=t(9729);function be(e){var n=e.issuances,t=e.teamDid,r=e.onRefresh,i=(0,_.h6)(),a=i.api,u=i.inService,d=(0,l.useContext)(w.RD),p=d.t,m=d.locale,f=(0,l.useState)(null),h=(0,c.Z)(f,2),x=h[0],v=h[1],g=(0,l.useState)(!1),b=(0,c.Z)(g,2),j=b[0],y=b[1],k=(0,U.DJ)().endpoint,C=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(n){var i;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.id,!j){e.next=3;break}return e.abrupt("return");case 3:return y(!0),e.prev=4,e.next=7,a.deletePassportIssuance({input:{teamDid:t,sessionId:i}});case 7:r(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),z.Z.error(e.t0.message);case 13:return e.prev=13,y(!1),v(null),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[4,10,13,17]])})));return function(n){return e.apply(this,arguments)}}(),D=function(){y(!1),v(null)},S=function(e){return k?(0,q._)({id:e.id,endpoint:k}):""};function P(e){var n=e.data;return(0,Q.jsxs)("div",{className:"issuance",children:[(0,Q.jsxs)(Z.Z,{display:"flex",justifyContent:"space-between",children:[(0,Q.jsx)(O.Z,{permission:u?"":"mutate_team",role:u?q.Wf:[],children:function(e){return e?(0,Q.jsx)(Ze.Z,{passport:{title:n.title,name:n.name},onDelete:function(){return v({title:p("team.passport.issuance.delete.title"),description:p("team.passport.issuance.delete.description",{link:S(n)}),confirm:p("common.delConfirm"),cancel:p("common.cancel"),onConfirm:function(){C(n)},onCancel:D})}}):(0,Q.jsx)(Ze.Z,{passport:{title:n.title,name:n.name}})}}),(0,Q.jsxs)("div",{style:{color:"#999"},children:[p("common.expires"),":\xa0",(0,q.B2)(n.expireDate,m)]})]}),(0,Q.jsx)(Z.Z,{mt:2,children:(0,Q.jsx)(Y.Z,{children:S(n)})})]})}return(0,Q.jsxs)(je,{children:[n.map((function(e){return(0,Q.jsx)(P,{data:e})})),x&&(0,Q.jsx)(ge.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}var je=u.Z.div(le||(le=(0,i.Z)(["\n .MuiTableHead-root {\n display: none;\n }\n .issuance {\n padding: 16px 0;\n border-bottom: 1px solid #f0f0f0;\n .MuiTypography-root {\n display: inline-block;\n width: 100%;\n background: #f3f3f3;\n border-radius: 4px;\n padding-top: 6px;\n padding-bottom: 6px;\n }\n }\n"])));be.propTypes={teamDid:f().string.isRequired,issuances:f().array,onRefresh:f().func},be.defaultProps={issuances:[],onRefresh:function(){}};var ye,ke=t(68079),Ce=t(26538),we=t.n(Ce),De=t(5178),Se=t(32322),Pe=t(87806),Re=t(25710),Te=t(82638),Ie=t(18901);function Ee(e){var n=e.teamDid,t=e.ownerDid,r=e.needReceive,i=e.roles,a=e.onCancel,u=e.onSuccess,d=e.onError,p=e.showOwnerPassport,m=(0,_.h6)().api,f=(0,l.useState)(!1),h=(0,c.Z)(f,2),x=h[0],g=h[1],Z=(0,l.useState)(""),b=(0,c.Z)(Z,2),j=b[0],y=b[1],k=(0,w.PE)().t,C=(0,l.useState)(""),S=(0,c.Z)(C,2),P=S[0],R=S[1],T=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(){var r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P){e.next=3;break}return y(k("team.member.error.passportEmpty")),e.abrupt("return");case 3:return y(null),g(!0),e.prev=5,e.next=8,m.createPassportIssuance({input:{teamDid:n,name:P,ownerDid:t}});case 8:u(),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(5),r=(0,q.Z)(e.t0),y(r),d(e.t0);case 16:return e.prev=16,g(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[5,11,16,19]])})));return function(){return e.apply(this,arguments)}}();return(0,Q.jsxs)(v.ZP,{title:k("team.passport.issue"),fullWidth:!0,open:!0,onClick:function(e){return e.stopPropagation()},onClose:a,disableEscapeKeyDown:!0,PaperProps:{style:{minHeight:"auto"}},actions:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(D.Z,{onClick:a,color:"inherit",size:"small",children:k("common.cancel")}),(0,Q.jsxs)(D.Z,{onClick:T,color:"primary",size:"small",disabled:x||!P,variant:"contained",autoFocus:!0,"data-cy":"issue-passport-create-btn",children:[x&&(0,Q.jsx)(F.Z,{size:16}),k(r?"team.passport.issuance.create.title":"oauth.issued")]})]}),children:[(0,Q.jsx)(M.Z,{component:"div",children:(0,Q.jsx)(V.Z,{component:"div",children:(0,Q.jsxs)($.Z,{style:{width:"100%"},variant:"outlined",children:[(0,Q.jsx)(X.Z,{children:k("common.passport")}),(0,Q.jsx)(J.Z,{"data-cy":"issue-passport-select-passport",value:P,onChange:function(e){y(null),R(e.target.value)},fullWidth:!0,label:k("common.passport"),disabled:x,onKeyPress:function(e){"Enter"===e.key&&(e.preventDefault(),T())},children:i.filter((function(e){return p||"owner"!==e.name})).map((function(e){return(0,Q.jsx)(K.Z,{value:e.name,"data-cy":"issue-passport-select-option-".concat(e.name),children:(0,Q.jsx)("span",{children:e.title||e.name})},e.name)}))})]})})}),!!j&&(0,Q.jsx)(G.Z,{type:"error",variant:"icon",children:j})]})}function Ne(e){var n=e.action,t=e.passport,r=(0,w.PE)().t,i=(0,U.DJ)().roles.find((function(e){return e.name===t.role}));return(0,Q.jsxs)("div",{children:[(0,Q.jsx)("div",{children:r("enable"===n?"team.member.enablePassportDescription":"team.member.revokePassportDescription")}),i&&(0,Q.jsx)(Z.Z,{mt:3,fontWeight:"bold",children:r("team.member.passportPermissionTitle")}),i&&(0,Q.jsx)(Z.Z,{mt:1,children:i.description})]})}function Ae(e){var n,t=e.user,r=e.onCreate,i=e.createPassportSvg,u=(0,w.PE)().t,d=(0,se.T)().session,p=(0,U.DJ)(),m=p.roles,f=p.teamDid,h=p.teamIssuerDid,x=p.refresh,v=p.enablePassportIssuance,b=p.trustedPassports,j=p.passportColor,k=p.blocklet,C=(0,W.y0)().appIdList,S=(0,_.h6)(),R=S.api,T=S.inService,I=(0,l.useState)(!1),N=(0,c.Z)(I,2),A=N[0],B=N[1],L=(0,l.useState)(null),F=(0,c.Z)(L,2),M=F[0],V=F[1],K=(0,l.useState)(!1),J=(0,c.Z)(K,2),H=J[0],X=J[1],$=(0,l.useState)(""),G=(0,c.Z)($,2),Y=G[0],ee=G[1],ne=[h].concat((0,ke.Z)(C||[])).filter(Boolean),te=(ae()(t,"passports")||[]).map((function(e){return(0,a.Z)((0,a.Z)({},e),{},{revoked:e.status===E.PASSPORT_STATUS.REVOKED})})),re=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(n){var r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!A){e.next=2;break}return e.abrupt("return");case 2:return B(!0),e.prev=3,r=n.status===E.PASSPORT_STATUS.REVOKED?"enableUserPassport":"revokeUserPassport",e.next=7,R[r]({input:{teamDid:f,userDid:t.did,passportId:n.id}});case 7:x(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),z.Z.error((0,q.Z)(e.t0));case 13:return e.prev=13,B(!1),V(null),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[3,10,13,17]])})));return function(n){return e.apply(this,arguments)}}(),ie=function(e,n){return t.did===d.user.did&&d.user.passportId&&d.user.passportId===n.id?{revokable:!1,message:u("team.passport.shouldNotDeleteCurrent")}:e?f===n.issuer.id&&"owner"===n.name?{revokable:!1,message:u("team.passport.noPermission")}:{revokable:!0}:{revokable:!1,message:u("team.passport.noPermission")}},oe=te.filter((function(e){return!Y||e.title.includes(Y)||e.name.includes(Y)}));return(0,Q.jsxs)(ze,{children:[(0,Q.jsxs)(Ie.Z,{children:[(0,Q.jsx)("div",{className:"left",children:(0,Q.jsx)(Te.Z,{placeholder:u("team.passport.search"),value:Y,onChange:function(e){return ee(e.target.value)}})}),(0,Q.jsx)("div",{className:"right",children:v&&!!t.approved&&(0,Q.jsx)(O.Z,{permission:T?"":"mutate_team",role:T?q.Wf:[],children:(0,Q.jsxs)(D.Z,{variant:"contained",color:"primary","data-cy":"issue-passport",onClick:function(){return X(!0)},children:[(0,Q.jsx)(y.Z,{style:{fontSize:16,marginRight:4}}),u("team.passport.issue")]})})})]}),(0,Q.jsxs)(Z.Z,{children:[oe.map((function(e){return(0,Q.jsx)(O.Z,{permission:T?"":"mutate_team",role:T?q.Wf:[],children:function(n){return(0,Q.jsxs)(Z.Z,{className:"passport-item",display:"flex",justifyContent:"space-between",alignItems:"center",mt:3,children:[(0,Q.jsxs)(Z.Z,{display:"flex",alignItems:"center",children:[(0,Q.jsx)("div",{dangerouslySetInnerHTML:{__html:i({title:e.title||e.name,issuer:e.issuer&&e.issuer.name,issuerDid:e.issuer&&e.issuer.id,ownerName:t.fullName,ownerDid:t.did,ownerAvatarUrl:t.avatar,revoked:e.revoked,preferredColor:j,width:"150px"})}}),(0,Q.jsxs)("div",{className:"body",children:[(0,Q.jsxs)(Z.Z,{className:"title",display:"flex",alignItems:"center",children:[we()(e.title),(0,Q.jsxs)("div",{className:"status-icons",children:[!!ne.length&&!ne.includes(e.issuer.id)&&(0,Q.jsx)(P.Z,{}),e.revoked&&(0,Q.jsx)(Pe.Z,{})]})]}),e.expirationDate&&(0,Q.jsx)(Z.Z,{className:"title",display:"flex",alignItems:"center",children:u("team.passport.validUntil",{date:e.expirationDate})}),!!ne.length&&!ne.includes(e.issuer.id)&&(0,Q.jsxs)("div",{className:"tip",children:[e.issuer.id!==h&&!b.some((function(n){return n.issuerDid===e.issuer.id}))&&(0,Q.jsx)(g.Z,{title:u("team.passport.notTrustedIssuerTip"),children:(0,Q.jsx)(Z.Z,{component:De.Z,style:{fontSize:"1.3em"},color:"error.main",mr:.5})}),(0,Q.jsx)("span",{children:u("team.passport.issueBy",{name:e.issuer.name})})]})]})]}),(0,Q.jsx)(Z.Z,{children:ie(n,e).revokable?(0,Q.jsxs)(D.Z,{variant:"outlined",color:e.revoked?"primary":"secondary",onClick:function(){return(n=e).status===E.PASSPORT_STATUS.REVOKED?V({title:u("team.member.enablePassport"),description:(0,Q.jsx)(Ne,{action:"enable",passport:n}),confirm:u("common.enable"),cancel:u("common.cancel"),onConfirm:function(){re(n)},onCancel:function(){B(!1),V(null)},color:"primary"}):V({title:u("team.member.revokePassport"),description:(0,Q.jsx)(Ne,{action:"revoke",passport:n}),confirm:u("common.revoke"),cancel:u("common.cancel"),onConfirm:function(){re(n)},onCancel:function(){B(!1),V(null)}});var n},children:[e.revoked?(0,Q.jsx)(y.Z,{style:{fontSize:16,marginRight:4}}):(0,Q.jsx)(Pe.Z,{style:{height:16,marginRight:4}}),e.revoked?u("common.enable"):u("common.revoke")]}):(0,Q.jsx)(g.Z,{title:ie(n,e).message,children:(0,Q.jsx)(De.Z,{style:{color:"#ddd"}})})})]})}},e.id)})),!oe.length&&(0,Q.jsx)(Re.Z,{children:u("common.empty")})]}),H&&(0,Q.jsx)(Ee,{teamDid:f,ownerDid:t.did,needReceive:(0,Se.h1)(t)===t.did,roles:m,onCancel:function(){return X(!1)},onSuccess:function(){r(),X(!1)},showOwnerPassport:k&&!(null!==(n=k.settings)&&void 0!==n&&n.owner)}),M&&(0,Q.jsx)(ge.Z,{title:M.title,description:M.description,confirm:M.confirm,cancel:M.cancel,params:M.params,onConfirm:M.onConfirm,onCancel:M.onCancel,color:M.color})]})}Ee.propTypes={teamDid:f().string.isRequired,ownerDid:f().string.isRequired,needReceive:f().bool,onCancel:f().func.isRequired,onSuccess:f().func.isRequired,onError:f().func,roles:f().array,showOwnerPassport:f().bool},Ee.defaultProps={onError:function(){},roles:[],showOwnerPassport:!1,needReceive:!0},Ne.propTypes={action:f().string.isRequired,passport:f().object.isRequired},Ne.defaultProps={},Ae.propTypes={user:f().object.isRequired,createPassportSvg:f().func.isRequired,onCreate:f().func},Ae.defaultProps={onCreate:function(){}};var ze=u.Z.div(ye||(ye=(0,i.Z)(["\n .passport-item {\n .body {\n padding: 0;\n margin-left: 24px;\n margin-top: 0;\n }\n .title {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n color: #222222;\n }\n .tip {\n display: flex;\n align-items: center;\n font-size: 14px;\n margin-top: 6px;\n color: #bbb;\n }\n .status-icons {\n svg {\n fill: #bfbfbf;\n height: 1.2em;\n margin-left: 0.4em;\n }\n }\n .MuiButton-outlinedSecondary {\n color: #f16e6e;\n fill: #f16e6e;\n background: #fcf3f3;\n border: 0;\n &:hover {\n border: 0;\n }\n }\n }\n"]))),Be=function(e,n){return e.nodeOwner&&e.nodeOwner.did===n},Le=function(e,n){return e&&e.did===n};function _e(e){var n,t=e.user,r=e.onCancel,i=e.onSuccess,a=e.onError,u=e.children,d=(0,_.h6)(),p=d.api,m=d.info,f=d.inService,h=(0,se.T)().session,x=(0,U.DJ)(),v=x.teamDid,g=x.refresh,Z=(0,w.PE)().t,b=(0,l.useState)(!1),j=(0,c.Z)(b,2),y=j[0],k=j[1],C=(0,l.useState)(!1),D=(0,c.Z)(C,2),S=D[0],P=D[1],R=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(n){var t,r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.did,r=n.approved,!y){e.next=3;break}return e.abrupt("return");case 3:return k(!0),e.prev=4,e.next=7,p.updateUserApproval({input:{teamDid:v,user:{did:t,approved:!r}}});case 7:P(!1),i(),g(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),z.Z.error((0,q.Z)(e.t0)),a();case 16:return e.prev=16,k(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,12,16,19]])})));return function(n){return e.apply(this,arguments)}}(),T={title:t.approved?Z("team.member.forbidLogin"):Z("team.member.allowLogin"),description:t.approved?Z("team.member.forbidLoginDescription"):Z("team.member.allowLoginDescription"),confirm:Z("common.confirm"),cancel:Z("common.cancel"),onConfirm:function(){R(t)},onCancel:function(){k(!1),P(!1),r()},color:t.approved?"error":"primary"};return(n=(f||m.nodeOwner&&!Be(m,t.did))&&!Le(h.user,t.did))?(0,Q.jsxs)(Q.Fragment,{children:["function"===typeof u?u({can:n,open:function(){return P(!0)}}):u,S?(0,Q.jsx)(ge.Z,{title:T.title,description:T.description,confirm:T.confirm,cancel:T.cancel,params:T.params,onConfirm:T.onConfirm,onCancel:T.onCancel,color:T.color}):null]}):null}_e.propTypes={user:f().object,onSuccess:f().func,onCancel:f().func,onError:f().func,children:f().oneOfType([f().object,f().func])},_e.defaultProps={user:{},onSuccess:function(){},onCancel:function(){},onError:function(){},children:null};var Ue,We,Oe,qe=t(6352),Fe=t.n(qe);function Me(e,n,t){if(e&&e.startsWith(E.USER_AVATAR_URL_PREFIX)){var r=window.env.apiPrefix||"/";return t?Fe()(r,E.USER_AVATAR_PATH_PREFIX,e.replace(E.USER_AVATAR_URL_PREFIX,"")):Fe()(r,E.USER_AVATAR_PATH_PREFIX,n,e.replace(E.USER_AVATAR_URL_PREFIX,""))}return e}function Ve(e){return(e.user.connectedAccounts||[]).map((function(e){return(0,Q.jsx)(me.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.provider,children:(0,Q.jsx)(L.Z,{did:e.did})},e.did)}))}f().string.isRequired,Ve.propTypes={user:f().object.isRequired,onChangeUser:f().func},Ve.defaultProps={onChangeUser:function(){}};var Ke="info";function Je(e){var n=e.userDid,t=e.onCancel,r=e.initTab,i=e.createPassportSvg,a=(0,_.h6)(),c=a.api,u=a.ws.useSubscription,d=a.inService,p=(0,U.DJ)(),m=p.roles,f=p.teamDid,h=p.enablePassportIssuance,x=(0,w.PE)(),g=x.t,b=x.locale,j=(0,xe.Z)({user:null,issuances:null,tab:r||Ke}),y=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(n,t){var r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.doBatchQuery({getUser:{input:{teamDid:n,user:{did:t},options:{includeTags:!0}}},getPassportIssuances:{input:{teamDid:n,ownerDid:t}}});case 3:(r=e.sent).getUser.user&&(r.getUser.user.avatar=Me(r.getUser.user.avatar,n,d),r.getUser.user.passports=(r.getUser.user.passports||[]).filter((function(e){return e.issuer}))),j.user=r.getUser.user||{},j.issuances=r.getPassportIssuances.list||[],e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),z.Z.error((0,q.Z)(e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(n,t){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){f&&y(f,n)}),[n,f]);u(E.EVENTS.USER_UPDATED,(function(e){e.teamDid===f&&e.user&&e.user.did===n&&y(f,n)}),[n,f]),(0,l.useEffect)((function(){j.issuances&&!j.issuances.length&&"issuances"===j.tab&&(j.tab=Ke)}),[j.issuances]);var k=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(n){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(f,n.did);case 2:j.tab=Ke;case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C={auth0:"Auth0",wallet:"DID wallet",federated:"Federated"},D={info:{label:g("common.basicInfo"),value:Ke,component:function(){var e,n;return(j.user?[{name:g("team.member.name"),value:j.user.fullName},{name:g("common.email"),value:j.user.email},{name:g("team.member.source"),value:(0,Q.jsx)(Z.Z,{display:"flex",alignItems:"center",children:C[(null===(e=j.user)||void 0===e?void 0:e.sourceProvider)||E.USER_TYPE.WALLET]||(null===(n=j.user)||void 0===n?void 0:n.sourceProvider)})},{name:g("team.member.allowLogin"),value:j.user.approved?g("common.yes"):g("common.no")},{name:g("team.member.lastLogin"),value:(0,q.B2)(j.user.lastLoginAt,b)},{name:g("team.member.lastLoginIp"),value:j.user.lastLoginIp||""},{name:g("common.createdAt"),value:(0,q.B2)(j.user.createdAt,b)},{name:g("common.remark"),value:j.user.remark||"--"},Array.isArray(j.user.tags)&&j.user.tags.length>0?{name:g("common.tags"),value:j.user.tags.map((function(e){return(0,Q.jsx)(B.Z,{style:{background:e.color,color:(0,R.getTextColor)(e.color),marginRight:4},children:e.title},e.id)}))}:null].filter(Boolean):[]).map((function(e){return e.name===g("common.did")?(0,Q.jsx)(me.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return g("common.did")},children:e.value},e.name):(0,Q.jsx)(me.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)}))}},oauth:{label:g("team.member.connectedAccounts"),value:"oauth",component:function(){return(0,Q.jsx)(Ve,{user:j.user,onChangeUser:k})}},passports:{label:g("common.passport"),value:"passports",component:function(){return(0,Q.jsx)(Ae,{user:j.user,teamDid:f,roles:m,createPassportSvg:i,onCreate:function(){y(f,n).then((function(){h&&j.issuances&&j.issuances.length&&(j.tab="issuances")}))},onRefresh:function(){y(f,n)}})}},issuances:{label:g("team.passport.issuance.pending"),value:"issuances",component:function(){return(0,Q.jsx)(be,{issuances:j.issuances||[],teamDid:f,onRefresh:function(){return y(f,n)}})}}},S=Object.values(D).map((function(e){return{label:e.label,value:e.value}})).filter((function(e){return"issuances"===e.value?h&&j.issuances&&!!j.issuances.length:"oauth"!==e.value||((null===(n=j.user)||void 0===n?void 0:n.connectedAccounts)||[]).find((function(e){var n;return e.provider!==((null===(n=j.user)||void 0===n?void 0:n.sourceProvider)||ve.LOGIN_PROVIDER.WALLET)}));var n})),P=D[j.tab]||D.info;return(0,Q.jsx)(v.ZP,{title:g("common.member"),onClose:t,open:!0,PaperProps:{style:{maxWidth:632,minHeight:"80vh"}},fullWidth:!0,actions:j.user&&(0,Q.jsx)(O.Z,{permission:d?"":"mutate_team",role:d?q.Wf:[],children:(0,Q.jsx)(_e,{user:j.user,children:function(e){var n=e.open;return(0,Q.jsxs)(Ge,{onClick:n,children:[j.user.approved?(0,Q.jsx)(fe.Z,{style:{fontSize:"1.2em",marginRight:"0.4em"}}):(0,Q.jsx)(he.Z,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),j.user.approved?g("team.member.forbidLogin"):g("team.member.allowLogin")]})}})}),children:(0,Q.jsxs)(Xe,{children:[!j.user&&(0,Q.jsx)($e,{children:(0,Q.jsx)(F.Z,{})}),j.user&&(0,Q.jsxs)("div",{children:[(0,Q.jsxs)(Z.Z,{display:"flex",alignItems:"center",className:"info",children:[(0,Q.jsx)(de.Z,{src:j.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),(0,Q.jsxs)(Z.Z,{children:[(0,Q.jsx)(Z.Z,{className:"name",children:j.user.fullName}),(0,Q.jsx)(Z.Z,{className:"did",mt:1,children:(0,Q.jsx)(L.Z,{did:j.user.did})})]})]}),(0,Q.jsx)(Z.Z,{mx:3,className:"tabs",children:(0,Q.jsx)(pe.Z,{tabs:S,current:j.tab,onChange:function(e){j.tab=e},scrollButtons:"auto"})}),(0,Q.jsx)("div",{className:"body",children:(0,Q.jsx)(P.component,{})})]})]})})}Je.propTypes={userDid:f().string.isRequired,onCancel:f().func.isRequired,createPassportSvg:f().func.isRequired,initTab:f().string},Je.defaultProps={initTab:Ke};var He,Xe=u.Z.div(Ue||(Ue=(0,i.Z)(["\n .info {\n .name {\n font-weight: 400;\n font-size: 18px;\n line-height: 25px;\n color: #222222;\n }\n }\n\n .tabs {\n margin-top: 24px;\n margin-left: 0;\n margin-right: 0;\n }\n\n .body {\n margin-top: 24px;\n }\n"]))),$e=u.Z.div(We||(We=(0,i.Z)(["\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 200px;\n"]))),Ge=u.Z.div(Oe||(Oe=(0,i.Z)(["\n flex-shrink: 0;\n width: 100%;\n height: 64px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n color: #999;\n fill: #999;\n font-size: 16px;\n border-top: 1px solid #f0f0f0;\n position: sticky;\n bottom: 0;\n background: #fff;\n z-index: 10;\n"]))),Ye=t(27773);function Qe(){var e=(0,_.h6)(),n=e.api,t=e.inService,r=(0,l.useContext)(w.RD),i=r.t,a=r.locale,u=(0,U.DJ)(),d=u.teamDid,p=u.invitations,m=u.refresh,f=u.endpoint,h=(0,l.useState)(null),x=(0,c.Z)(h,2),v=x[0],g=x[1],Z=(0,l.useState)(!1),b=(0,c.Z)(Z,2),j=b[0],y=b[1],k=function(){var e=(0,s.Z)((0,o.Z)().mark((function e(t){var r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.inviteId,!j){e.next=3;break}return e.abrupt("return");case 3:return y(!0),e.prev=4,e.next=7,n.deleteInvitation({input:{teamDid:d,inviteId:r}});case 7:return m(),e.next=10,(0,q._v)(800);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),console.error(e.t0);case 15:return e.prev=15,y(!1),g(null),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[4,12,15,19]])})));return function(n){return e.apply(this,arguments)}}(),C=function(){y(!1),g(null)},S=function(e){return f?(0,q.ly)({inviteId:e.inviteId,endpoint:f}):""},P=[{label:i("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:function(e){var n=p[e];return f?(0,Q.jsx)(Y.Z,{children:S(n)}):(0,Q.jsx)(F.Z,{size:16})}}},{label:i("common.role"),name:"role",widtn:70},{label:i("common.remark"),name:"remark",options:{customBodyRender:function(e){return e||"--"}}},{label:i("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:function(e,n){var t,r=n.rowIndex,i=p[r];return null===i||void 0===i||null===(t=i.inviter)||void 0===t?void 0:t.fullName}}},{label:i("common.expires"),name:"expireDate",options:{customBodyRender:function(e){return(0,Q.jsx)(I.Z,{value:e,locale:a})}}},{label:i("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:function(e){var n=p[e];return(0,Q.jsx)(O.Z,{permission:t?"":"mutate_team",role:t?q.Wf:[],children:(0,Q.jsxs)(D.Z,{onClick:function(){return g({title:i("team.inviting.delete.title"),description:i("team.inviting.delete.description",{link:S(n)}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:function(){return k(n)},onCancel:C})},size:"small",color:"error",variant:"text",children:[(0,Q.jsx)(Ye.default,{style:{fontSize:"1.2em"}}),i("common.delete")]})})}}}];return(0,Q.jsxs)(en,{children:[p.length?(0,Q.jsx)(T.Z,{locale:a,data:(0,ke.Z)(p),columns:P,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1}}):(0,Q.jsx)(Re.Z,{children:i("common.empty")}),v&&(0,Q.jsx)(ge.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel})]})}var en=u.Z.div(He||(He=(0,i.Z)(["\n margin-top: -20px;\n"])));Qe.propTypes={},Qe.defaultProps={};var nn,tn=t(46954),rn=t(44067),an=t(92726);function on(e){var n=e.user,t=e.onIssuePassport,r=(0,U.DJ)(),i=r.teamDid,a=r.roles,o=(0,l.useContext)(w.RD).t,s=(0,l.useState)(!1),u=(0,c.Z)(s,2),d=u[0],p=u[1];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(an.Z,{"data-cy":"member-actions",actions:[{icon:(0,Q.jsx)(y.Z,{fontSize:"small"}),text:o("team.passport.issue"),"data-cy":"action-issue-passport",onClick:function(e){e.stopPropagation(),p(!0)}},function(e){var t=e.close;return(0,Q.jsx)(_e,{user:n,children:function(e){var r=e.open;return(0,Q.jsxs)(K.Z,{dense:!0,onClick:function(e){e.stopPropagation(),t(),r(e)},"data-cy":"action-toggle-block",children:[(0,Q.jsx)(tn.Z,{style:{minWidth:24,marginRight:8},children:n.approved?(0,Q.jsx)(fe.Z,{}):(0,Q.jsx)(he.Z,{})}),(0,Q.jsx)(rn.Z,{primary:n.approved?o("team.member.forbidLogin"):o("team.member.allowLogin")})]})}},"toggle-approval")}]}),d&&(0,Q.jsx)(Ee,{teamDid:i,ownerDid:n.did,needReceive:(0,Se.h1)(n)===n.did,roles:a,onCancel:function(){return p(!1)},onSuccess:function(){t(),p(!1)}})]})}on.propTypes={user:f().object.isRequired,onIssuePassport:f().func},on.defaultProps={onIssuePassport:function(){}};var sn="$all",cn="$none",ln=function(e,n){var t=e.find((function(e){return e.key===n}));return(null===t||void 0===t?void 0:t.value)||0},un=function(e,n){var t=e.passports||[];return!!t.length&&!t.some((function(e){var t;return n.includes(null===(t=e.issuer)||void 0===t?void 0:t.id)}))};function dn(e){var n=e.user,t=(0,l.useContext)(w.RD).t,r=(0,Q.jsxs)("div",{className:"member-block",children:[(0,Q.jsxs)("div",{className:"member-avatar",children:[(0,Q.jsx)(C.Z,{src:"".concat(n.avatar,"?imageFilter=resize&w=48&h=48"),size:32,did:n.did,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),!n.approved&&(0,Q.jsx)("did",{className:"badge-block"}),n.isFromExternal&&(0,Q.jsx)(g.Z,{title:t("team.passport.externalPassport"),children:(0,Q.jsx)(Z.Z,{ml:1,className:"icon",children:(0,Q.jsx)(P.Z,{})})})]}),(0,Q.jsxs)("div",{className:"member-meta",children:[(0,Q.jsx)("div",{className:"member-text",children:n.fullName}),Array.isArray(n.tags)&&n.tags.length>0&&(0,Q.jsx)("div",{className:"member-tags",children:n.tags.map((function(e){return(0,Q.jsx)(B.Z,{style:{background:e.color,color:(0,R.getTextColor)(e.color),marginRight:4},children:e.title},e.id)}))})]})]});return n.approved?r:(0,Q.jsx)(Z.Z,{display:"flex",alignItems:"center",children:(0,Q.jsx)(g.Z,{title:t("team.member.forbidLoginDescription"),children:r})})}function pn(e){var n=e.type,t=e.createPassportSvg,r=(0,W.y0)().appIdList,i=void 0===r?[]:r,u=(0,U.DJ)(),d=u.teamDid,m=u.invitations,f=u.teamIssuerDid,h=u.roles,g=u.refresh,C=u.enablePassportIssuance,P=u.endpoint,R=u.api,B=(0,_.h6)(),F=B.inService,M=B.ws.useSubscription,V=(0,l.useContext)(w.RD),K=V.t,J=V.locale,H=(0,l.useState)(!1),X=(0,c.Z)(H,2),$=X[0],G=X[1],Y=(0,l.useState)(!1),ne=(0,c.Z)(Y,2),te=ne[0],re=ne[1],ie=(0,l.useState)(!1),ae=(0,c.Z)(ie,2),oe=ae[0],se=ae[1],le=(0,l.useState)(!1),ue=(0,c.Z)(le,2),de=ue[0],pe=ue[1],me=(0,l.useState)(!1),fe=(0,c.Z)(me,2),he=fe[0],xe=fe[1],ve=(0,l.useState)([]),ge=(0,c.Z)(ve,2),Ze=ge[0],be=ge[1],je=(0,l.useState)(),ye=(0,c.Z)(je,2),ke=ye[0],Ce=ye[1],we=(0,l.useState)([]),De=(0,c.Z)(we,2),Se=De[0],Pe=De[1],Re=(0,N.Z)({did:void 0}),Te=(0,c.Z)(Re,1)[0],Ie="members-".concat(d),Ee=(0,T.$)(Ie),Ne=(0,l.useState)({role:sn,searchText:Ee.searchText||"",hideBlocked:!1,pageSize:Ee.rowsPerPage||10,page:Ee.page?Ee.page+1:1}),Ae=(0,c.Z)(Ne,2),ze=Ae[0],Be=Ae[1];(0,A.Z)((0,s.Z)((0,o.Z)().mark((function e(){var n,t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Te.did){e.next=6;break}return e.next=3,R.getUser({did:Te.did});case 3:n=e.sent,(t=n.user)&&pe(t);case 6:case"end":return e.stop()}}),e)}))));var Le=(h||[]).map((function(e){return{name:e.name,title:e.title,num:ln(Se,e.name)}}));Le.unshift({name:sn,title:"All Members",num:ln(Se,sn)}),Le.push({name:cn,title:"Other",num:ln(Se,cn)});var _e=function(){var e={includeTags:!0};ze.hideBlocked&&(e.approved=!0),e.role=ze.role,ze.searchText&&(e.search=ze.searchText),xe(!0),R.getUsers({query:e,paging:{page:ze.page,pageSize:ze.pageSize}}).then((function(e){xe(!1),(e.users||[]).forEach((function(e){e.isFromExternal=un(e,p()(i)?[f]:i),e.avatar=Me(e.avatar,d,F),e.passports=(e.passports||[]).filter((function(e){return e.issuer}))})),be(e.users||[]),Ce(e.paging.total)})).catch((function(e){xe(!1),z.Z.error(e.message)}))},Ue=function(){R.getUsersCountPerRole().then((function(e){Pe(e.counts||[])})).catch((function(e){z.Z.error(e.message)}))},We=function(e){e.teamDid===d&&(_e(),Ue())};(0,l.useEffect)((function(){_e()}),["".concat(ze.hideBlocked,"-").concat(ze.role,"-").concat(ze.page,"-").concat(ze.pageSize,"-").concat(ze.searchText)]),(0,l.useEffect)((function(){Ue()}),[]),M(E.EVENTS.USER_UPDATED,We,[ze]),M(E.EVENTS.USER_ADDED,We,[ze]);var Oe=C,qe=[{label:K("common.name"),name:"fullName",options:{customBodyRenderLite:function(e){var n=Ze[e];return(0,Q.jsx)("div",{"data-cy":"member-name-".concat(n.fullName),children:(0,Q.jsx)(dn,{user:n})},n.did)}}},{label:K("common.address"),name:"did",options:{customBodyRender:function(e){return(0,Q.jsx)(L.Z,{size:14,responsive:!0,copyable:!1,did:e})}}},{label:K("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:function(e){return(0,Q.jsx)(I.Z,{value:e,locale:J})}}},{label:K("team.member.lastLoginIp"),name:"lastLoginIp",options:{customBodyRender:function(e){return e||"-"}}},{label:K("team.member.source"),name:"sourceProvider",options:{customBodyRender:function(e){var n=e||E.USER_TYPE.WALLET;return{auth0:"Auth0",wallet:"DID wallet",federated:"Federated"}[n]||n}}},{label:K("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:function(e){var n=Ze[e];return(0,Q.jsx)(O.Z,{permission:F?"":"mutate_team",role:F?q.Wf:[],children:(0,Q.jsx)(on,{user:n,onIssuePassport:function(){return pe((0,a.Z)((0,a.Z)({},n),{},{initTab:"issuances"}))}})})}}}],Fe=[];Oe&&(Fe.push((0,Q.jsxs)(D.Z,{variant:"outlined",style:{flexShrink:0,marginRight:16},color:"primary",size:"small",onClick:function(){se(!0)},children:[(0,Q.jsx)(S.Z,{style:{height:"1em",marginRight:4}}),K("common.inviting"),m.length?" (".concat(m.length,")"):""]}),(0,Q.jsx)(O.Z,{permission:F?"":"mutate_team",role:F?q.Wf:[],children:(0,Q.jsxs)(D.Z,{style:{flexShrink:0,marginRight:16},variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"invite-member",onClick:function(){return G(!0)},children:[(0,Q.jsx)(y.Z,{style:{fontSize:"1.3em",marginRight:4}}),K("team.invite")]})})),"server"===n&&Fe.push((0,Q.jsx)(O.Z,{role:"owner",children:(0,Q.jsxs)(D.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"invite-member",onClick:function(){return re(!0)},children:[(0,Q.jsx)(k.Z,{style:{fontSize:"1.3em",marginRight:4}}),K("team.transferNode.name")]})})));var Ve={sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick:function(e,n){var t=n.dataIndex,r=Ze[t];pe(r)},page:ze.page-1,rowsPerPage:ze.pageSize,count:ke,searchDebounceTime:600};return(0,Q.jsxs)(mn,{children:[(0,Q.jsxs)(Z.Z,{className:"main",display:"flex",children:[(0,Q.jsx)("div",{className:"left",children:(0,Q.jsx)("div",{className:"tabs",children:Le.map((function(e){return(0,Q.jsxs)("div",{className:"tab ".concat(ze.role===e.name?"active":""),onClick:function(){return n=e.name,void(he||Be((function(e){return(0,a.Z)((0,a.Z)({},e),{},{role:n,hideBlocked:!1,searchText:"",page:1})})));var n},children:[(0,Q.jsx)("span",{className:"text",children:e.title}),(0,Q.jsx)("span",{className:x()("badge",{"is-rect":e.num>999}),children:e.num})]},e.name)}))})}),(0,Q.jsx)("div",{className:"right",children:(0,Q.jsx)(T.Z,{className:"main-table",verticalKeyWidth:100,locale:J,durable:Ie,durableKeys:["page","rowsPerPage"],title:(0,Q.jsx)("div",{className:"table-toolbar-left",children:(0,Q.jsx)(b.Z,{control:(0,Q.jsx)(j.Z,{sx:{display:"flex !important"},disabled:he,color:"primary",checked:ze.hideBlocked,onChange:function(e){return n=e.target.checked,void Be((function(e){return(0,a.Z)((0,a.Z)({},e),{},{hideBlocked:n,page:1})}));var n}}),label:K("team.member.hideBlockedMember")})}),data:Ze,columns:qe,customButtons:Fe,options:Ve,loading:he,onChange:function(e){var n=e.page,t=e.rowsPerPage,r=e.searchText;ze.pageSize!==t?Be((function(e){return(0,a.Z)((0,a.Z)({},e),{},{pageSize:t,page:1})})):ze.page!==n+1?Be((function(e){return(0,a.Z)((0,a.Z)({},e),{},{page:n+1})})):ze.searchText!==r&&Be((function(e){return(0,a.Z)((0,a.Z)({},e),{},{searchText:r,page:1})}))}})})]}),(0,Q.jsx)(v.ZP,{title:K("common.inviting"),onClose:function(){return se(!1)},open:oe,maxWidth:"lg",fullWidth:!0,children:(0,Q.jsx)(Qe,{})}),de&&(0,Q.jsx)(Je,{onCancel:function(){return pe(null)},userDid:de.did,createPassportSvg:t,initTab:de.initTab}),$&&(0,Q.jsx)(ee,{teamDid:d,endpoint:P,roles:h,onCancel:function(){return G(!1)},onSuccess:function(){g(),G(!1)}}),te&&(0,Q.jsx)(ce,{teamDid:d,endpoint:P,roles:h,onCancel:function(){return re(!1)},onSuccess:function(){g(),re(!1)}})]})}dn.propTypes={user:f().object.isRequired};var mn=u.Z.div(nn||(nn=(0,i.Z)(["\n .main {\n .left {\n width: 168px;\n flex-shrink: 0;\n margin-right: 65px;\n .tabs {\n padding-top: 16px;\n .tab {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n transition: background 0.4s;\n\n width: 168px;\n height: 36px;\n border-radius: 8px;\n\n cursor: pointer;\n user-select: none;\n\n &:nth-child(n + 2) {\n margin-top: 24px;\n }\n\n &.active {\n background: #f2f2f2;\n }\n\n &:hover {\n background: #f2f2f2;\n }\n\n .text {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n\n color: #222222;\n }\n\n .badge {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100%;\n color: #fff;\n background: #666666;\n font-size: 10px;\n font-weight: 400;\n &.is-rect {\n width: auto;\n border-radius: 8px;\n padding: 0 4px;\n }\n }\n }\n }\n @media (max-width: ","px) {\n display: none;\n }\n }\n .right {\n flex-grow: 1;\n }\n }\n\n .member-block {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n .member-avatar {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .member-meta {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n }\n .badge-block {\n width: 14px;\n height: 14px;\n position: absolute;\n right: -4px;\n top: -4px;\n background: #ff5757;\n border-radius: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n &::after {\n content: '';\n width: 6px;\n height: 2px;\n background: #fefefe;\n }\n }\n }\n\n .table-toolbar-left {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 7px 0;\n }\n"])),(function(e){return e.theme.breakpoints.values.md}));pn.propTypes={type:f().oneOf(["server","blocklet"]).isRequired,createPassportSvg:f().func.isRequired}},82638:function(e,n,t){var r,i=t(33028),a=t(59740),o=t(71171),s=t(33518),c=t(47020),l=t(57201),u=t(96266),d=["children"],p=(0,s.Z)((function(e){var n=e.children,t=(0,a.Z)(e,d);return(0,u.jsx)(c.Z,(0,i.Z)((0,i.Z)({},t),{},{id:"outlined-basic",variant:"outlined",InputProps:{startAdornment:(0,u.jsx)(l.default,{})},size:"small",children:n}))}))(r||(r=(0,o.Z)(["\n .MuiOutlinedInput-root {\n color: #999;\n &.MuiInputBase-adornedStart .MuiSvgIcon-root {\n color: #bfbfbf;\n }\n opacity: 1;\n border-radius: 36px;\n background: #f8f8f8;\n padding-left: 16px;\n input {\n padding-left: 8px;\n font-weight: bold;\n &::placeholder {\n opacity: 1;\n color: #bfbfbf;\n }\n padding-top: 8.5px;\n padding-bottom: 8.5px;\n }\n }\n\n .MuiOutlinedInput-notchedOutline,\n .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline,\n .Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: #eee;\n border-width: 1px;\n }\n"])));n.Z=p},18901:function(e,n,t){var r,i=t(71171),a=t(33518).Z.div(r||(r=(0,i.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 14px;\n .left,\n .right {\n }\n .right {\n display: flex;\n align-items: center;\n }\n .tabs {\n .MuiButton-root {\n border: none;\n color: #999;\n &.active {\n color: #222;\n }\n }\n }\n\n @media (max-width: 600px) {\n display: block;\n .right {\n margin-top: 12px;\n }\n }\n"])));n.Z=a}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:function(e,n,t){t.r(n),t.d(n,{default:function(){return re}});var r=t(71171),a=t(5057),i=t(33518),o=t(85493),c=t(15849),s=t(68420),u=t(11750),l=t(39434),p=t(39948),d=t(10697),f=t(94464),m=t(88574),v=t(28726),h=t(38242),b=t(81010),x=t(87363),g=(t(68534),t(86229)),k=t(1722),y=t(96234),Z=t(35432),w=t(96501),j=t(58238),P=t(29054),S=t(73545),B=t(14491),D=t(4651),L=t(96266),E=function(e){var n={},t=null;return(0,h.forEachBlockletSync)(e,(function(e){n[e.meta.bundleDid]?t=(0,h.getDisplayName)(e,!0):e.meta.bundleDid&&(n[e.meta.bundleDid]=!0)})),t},_=function(e,n,t){var r=e.hostname,a=e.href;if(!n)return a;if(t){var i,o=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!o)return a;var c=o[0],s=(((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(Z.DEFAULT_DID_DOMAIN)}))||"").replace(".".concat(Z.DEFAULT_DID_DOMAIN),"");return s?a.replace(r,"".concat(s,"-").concat(c,".").concat(Z.DEFAULT_IP_DOMAIN_SUFFIX)):a}return a.replace(n.meta.bundleDid,n.appPid)};function C(){var e=(0,s.PE)().t,n=(0,S.T)().api,t=(0,P.y0)().blocklet,r=(0,j.h6)().inService,i=(0,a.useState)(!1),o=(0,y.Z)(i,2),c=o[0],u=o[1],l=(0,a.useState)(5),d=(0,y.Z)(l,2),f=d[0],b=d[1],x=t&&t.structVersion!==Z.APP_STRUCT_VERSION;return[x&&(0,L.jsxs)(m.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,L.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,L.jsx)(v.Z,{variant:"contained",size:"small",color:"primary",onClick:function(){return function(){try{if("running"===t.status)return void g.Z.error(e("blocklet.migrate.tip.running"));var n=E(t);if(n)return void g.Z.error(e("blocklet.migrate.tip.duplicate",{name:n}));u(!0)}catch(r){g.Z.error((0,B.Z)(r))}}()},style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,L.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((function(n){return(0,L.jsx)(p.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(n))},n)}))]},"alert"),t&&(0,L.jsx)(w.default,{popup:!0,open:c,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:n.get,checkTimeout:3e5,onSuccess:function(){var e=_(window.location,t,r);setTimeout((function(){window.location.href=e}),5e3),b(5),setInterval((function(){b((function(e){return e-1}))}),1e3)},extraParams:{appDid:t.appDid,did:t.meta.did,wt:(0,D.iK)(t,!0),title:(0,h.getDisplayName)(t)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:f>=0?e("blocklet.migrate.success",{sec:f}):"Redirecting..."},onClose:function(){return u(!1)}},"connect")]}C.propTypes={};var N,G=t(35966),A=t(49946),I=t(44846),T=t(78123),O=t(75793),U=t(17022),z=t(13671),K=t(74094),R=t(7199),F=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(6457),t.e(6591)]).then(t.bind(t,86591))})),M=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(2452),t.e(8059),t.e(5808),t.e(8973)]).then(t.bind(t,5119))})),V=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(105),t.e(6547),t.e(3245),t.e(2452),t.e(9272),t.e(4775)]).then(t.bind(t,14775))})),$=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(442),t.e(9662),t.e(7676),t.e(8986)]).then(t.bind(t,13239))})),X=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(1237),t.e(2305),t.e(5979),t.e(2537)]).then(t.bind(t,75979))})),Y=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(2657),t.e(6412),t.e(3216)]).then(t.bind(t,46412))})),W=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(4901),t.e(1685),t.e(5015)]).then(t.bind(t,85555))})),q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(4901),t.e(442),t.e(9366),t.e(5526),t.e(1237),t.e(7638),t.e(1685),t.e(4407),t.e(3245),t.e(3135),t.e(3936),t.e(2264),t.e(7126)]).then(t.bind(t,77126))})),J=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(9327),t.e(8219)]).then(t.bind(t,92379))})),Q=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(7534)]).then(t.bind(t,87534))})),H=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(4901),t.e(9963),t.e(2611)]).then(t.bind(t,42611))})),ee=(0,a.lazy)((function(){return Promise.all([t.e(7718),t.e(7020),t.e(8537),t.e(105),t.e(2294),t.e(3716),t.e(6547),t.e(5760),t.e(9366),t.e(9354),t.e(373)]).then(t.bind(t,90373))})),ne=function(e){return e.children};function te(){var e,n=(0,o.useNavigate)(),t=(0,o.useParams)().tab,r=void 0===t?"overview":t,i=(0,z.y0)(),y=i.did,w=i.blocklet,j=i.error,P=i.client,S=i.actions,B=S.setBlocklet,D=S.refreshBlocklet,E=(0,O.h6)().refresh,_=(0,s.PE)().t,N=(0,a.useCallback)((function(){return(0,L.jsx)($,{scope:y})}),[y]),A=(null===w||void 0===w||null===(e=w.environments.find((function(e){return"BLOCKLET_APP_URL"===e.key})))||void 0===e?void 0:e.value)||window.location.origin,te=function(e){return(0,K.bV)(e,A)},re=function(e){n("/blocklets/".concat(y,"/").concat(e))},ie=!w||(0,K.wS)(w.status)?[]:(0,h.getAppMissingConfigs)(w),oe=null,ce=[{label:_("common.overview"),value:"overview"},{breadcrumbsLabel:_("common.components"),label:(0,L.jsx)(d.Z,{color:"error",variant:"dot",invisible:!ie.length,children:_("common.components")}),value:"components"}];if(j)oe=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(m.Z,{type:"error",variant:"icon",children:(0,K.Z)(j)}),(0,L.jsx)(v.Z,{onClick:function(){return D()},children:(0,L.jsx)("span",{style:{textDecoration:"underline"},children:_("common.retry")})})]});else if(w){var se,ue={overview:(0,L.jsx)(F,{}),configuration:M,navigation:V,services:W,members:(0,L.jsx)(Y,{type:"blocklet",createPassportSvg:te}),passports:X,components:q,"audit-logs":N,logs:J,runtime:(0,L.jsx)(Q,{}),traffic:(0,L.jsx)(H,{client:P,did:y}),storage:(0,L.jsx)(ee,{})};"configuration"===r&&(0,K.wS)(w.status)&&re("overview"),(0,K.wS)(w.status)||(ce.push({label:_("common.members"),value:"members"}),ce.push({label:_("common.passport"),value:"passports"}),ce.push({label:_("common.configuration"),value:"configuration"})),ce.push({label:_("common.auditLogs"),value:"audit-logs"}),w&&null!==(se=w.children)&&void 0!==se&&se.length&&w.structVersion===Z.APP_STRUCT_VERSION&&ce.push({label:_("common.logs"),value:"logs"}),ce.push({label:_("common.configNavigation"),value:"navigation"}),ce.push({label:_("common.runtime"),value:"runtime"}),ce.push({label:_("common.traffic"),value:"traffic"}),ce.push({label:_("common.storage"),value:"storage"}),(0,h.getBlockletServices)(w).length&&ce.splice(2,0,{label:_("blocklet.services"),value:"services"});var le=ue[r]||ue.overview;oe=(0,L.jsxs)(x.g,{type:"components",children:[!(0,h.isExternalBlocklet)(w)&&(0,L.jsx)(f.Z,{tabs:ce,current:r,onChange:re,scrollButtons:"auto"}),(0,L.jsx)("div",{className:"page-content",children:(0,L.jsx)(a.Suspense,{fallback:(0,L.jsx)(G.Z,{children:(0,L.jsx)(I.Z,{})}),children:(0,a.isValidElement)(le)?le:(0,L.jsx)(le,{blocklet:w,onUpdate:function(e){e&&B(e),D()},createPassportSvg:te})})})]})}else oe=(0,L.jsx)(G.Z,{children:(0,L.jsx)(I.Z,{})});var pe=ce.find((function(e){return e.value===r})),de=w?U.G6:ne;return(0,L.jsx)(de,{teamDid:y,children:(0,L.jsxs)(ae,{children:[(0,L.jsxs)(l.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,L.jsx)(c.Link,{color:"textSecondary",to:"/blocklets",children:_("common.blocklets")}),(0,L.jsx)(c.NavLink,{to:"/blocklets/".concat(y,"/overview"),style:function(e){return e?{color:"inherit"}:{}},children:_("common.detail")}),(0,L.jsx)(u.Z,{color:"textSecondary",children:pe?pe.breadcrumbsLabel||pe.label:""})]}),(0,L.jsxs)(u.Z,{component:"div",className:"page-header",children:[(0,L.jsxs)(u.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[w?(0,L.jsx)(k.Z,{blocklet:w,style:{marginRight:16}}):null,w?(0,L.jsxs)(p.Z,{display:"flex",alignItems:"center",children:[(0,L.jsx)(p.Z,{children:(0,h.getDisplayName)(w)}),"unknown"!==(null===w||void 0===w?void 0:w.status)&&(0,L.jsx)(b.Z,{size:"12px",style:{marginLeft:8},status:w.status,source:w.source})]}):"".concat(_("common.blocklet")," ").concat(_("common.detail"))]}),(0,L.jsx)(R.Z,{permission:"mutate_blocklets",children:!!w&&!(0,h.isExternalBlocklet)(w)&&(0,L.jsx)(T.Z,{className:"page-actions",blocklet:w,onStart:function(){},onComplete:function(e){var t=e.action,r=e.error;r?g.Z.error(r.message):"remove"===t?(E(),n("/blocklets")):D()},variant:"group"})})]}),(0,L.jsx)(C,{}),oe]})})}function re(){var e=(0,o.useParams)().did;return e?(0,L.jsx)(z.$8,{did:e,children:(0,L.jsx)(A.wV,{children:(0,L.jsx)(te,{})})}):null}var ae=i.Z.main(N||(N=(0,r.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: 16px;\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}))},49946:function(e,n,t){t.d(n,{wV:function(){return B},XN:function(){return D}});var r=t(32723),a=t(33028),i=t(34795),o=t(96234),c=t(5057),s=t(55898),u=t.n(s),l=t(86229),p=t(68420),d=t(76811),f=t(29054),m=t(84584),v=t(41899),h=t(58238),b=t(65873);function x(e){return g.apply(this,arguments)}function g(){return g=(0,i.Z)((0,r.Z)().mark((function e(n){var t,o,c,s,u;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.blockletDid,o=n.nodeApi,c=n.spaceGateways,s=!1,e.next=4,Promise.all(c.map(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var t,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.name,e.next=3,(0,m.nU)(n.endpoint);case 3:return i=e.sent,(0,b.isEmpty)(i)||i===t||(t=i,s=!0),e.abrupt("return",(0,a.Z)((0,a.Z)({},n),{},{name:t}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 4:if(u=e.sent,!s){e.next=8;break}return e.next=8,Promise.all(u.filter((function(e){return e.did})).map((function(e){return o.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:(0,a.Z)({},e)}})})));case 8:return e.abrupt("return",u);case 9:case"end":return e.stop()}}),e)}))),g.apply(this,arguments)}var k=t(99875);var y=t(14491);function Z(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[],setLoading:function(){}},t=n.deps,a=n.setLoading,s=(0,f.y0)().blocklet,u=(0,c.useState)([]),p=(0,o.Z)(u,2),d=p[0],m=p[1],x=(0,h.h6)().api,g=(0,b.debounce)((0,i.Z)((0,r.Z)().mark((function e(){var n,t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,a(!0),s){e.next=5;break}return m([]),e.abrupt("return");case 5:return e.next=7,x.getBlockletBackups({input:{did:s.meta.did}});case 7:n=e.sent,t=n.backups,m(null!==t&&void 0!==t?t:[]),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,y.Z)(e.t0));case 16:return e.prev=16,a(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])}))),2e3);return(0,v.Z)((0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g();case 1:case"end":return e.stop()}}),e)}))),[null===s||void 0===s||null===(e=s.meta)||void 0===e?void 0:e.did].concat(t)),{backups:d}}var w=function(e){var n=e.appDid,t=Z().backups,r=(0,c.useState)({message:"",progress:0,completed:!1}),i=(0,o.Z)(r,2),s=i[0],u=i[1];return(0,(0,h.h6)().ws.useSubscription)(d.BlockletEvents.backupProgress,(function(e){n===(null===e||void 0===e?void 0:e.appDid)&&u((function(){return(0,a.Z)({},e)}))}),[n]),(0,c.useEffect)((function(){var e;if(null!==t&&void 0!==t&&t.length&&(0,b.isNull)(null===(e=t[0])||void 0===e?void 0:e.status)){var n=(0,o.Z)(t,1)[0];u((function(){return{message:n.message,progress:n.progress,completed:Boolean(n.progress>=100)}}))}}),[t]),s},j=t(96266),P=(0,c.createContext)({}),S=P.Provider;P.Consumer;function B(e){var n=e.children,t=(0,p.PE)().t,s=(0,h.h6)().api,u=(0,f.y0)().blocklet,b=(0,c.useState)(!1),g=(0,o.Z)(b,2),y=g[0],P=g[1],B=(0,c.useState)(!1),D=(0,o.Z)(B,2),L=D[0],E=D[1],_=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.setLoading,a=n.refresh,s=(0,f.y0)(),u=s.blocklet,p=s.actions.refreshBlocklet,d=null===u||void 0===u||null===(e=u.meta)||void 0===e?void 0:e.did,m=(0,c.useState)([]),b=(0,o.Z)(m,2),g=b[0],y=b[1],Z=(0,h.h6)().api;return(0,v.Z)((0,i.Z)((0,r.Z)().mark((function e(){var n,a,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d){e.next=4;break}return y([]),e.abrupt("return");case 4:return null===t||void 0===t||t(!0),e.next=7,Z.getBlockletSpaceGateways({input:{did:d}});case 7:return n=e.sent,a=n.spaceGateways,e.next=11,x({blockletDid:d,nodeApi:Z,spaceGateways:a});case 11:i=e.sent,y(null!==i&&void 0!==i?i:[]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0),l.Z.error((0,k.Z)(e.t0));case 19:return e.prev=19,null===t||void 0===t||t(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,15,19,22]])}))),[d,p,a]),{spaceGateways:g}}({refresh:L,setLoading:P}),C=_.spaceGateways,N=w({appDid:null===u||void 0===u?void 0:u.appDid}),G=(0,c.useState)(!1),A=(0,o.Z)(G,2),I=A[0],T=A[1],O=(0,c.useMemo)((function(){return(0,m.mo)(null===u||void 0===u?void 0:u.environments)}),[u,L,I]),U=(0,c.useState)(!1),z=(0,o.Z)(U,2),K=z[0],R=Z({deps:[N],setLoading:z[1]}).backups,F=(0,c.useState)(null===C||void 0===C?void 0:C.find((function(e){return e.endpoint===O}))),M=(0,o.Z)(F,2),V=M[0],$=M[1],X=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n,t){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C.push((0,a.Z)((0,a.Z)({},n),{},{loading:!0})),e.next=3,s.addBlockletSpaceGateway({input:{did:u.meta.did,spaceGateway:n}});case 3:if(O===t){e.next=6;break}return e.next=6,s.configBlocklet({input:{did:[u.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t}]}});case 6:q(),$(n);case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Y=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(n.endpoint!==O){e.next=5;break}return l.Z.warning(t("storage.spaces.gateway.delete.failedForConnected")),e.abrupt("return");case 5:return e.next=7,s.deleteBlockletSpaceGateway({input:{did:u.meta.did,spaceGatewayDid:null===n||void 0===n?void 0:n.did}});case 7:q(),$(n);case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.updateBlockletSpaceGateway({input:{did:u.meta.did,where:{did:n.did},spaceGateway:n}});case 2:if(O===n.endpoint){e.next=5;break}return e.next=5,s.configBlocklet({input:{did:[u.meta.did],configs:[{key:d.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:n.endpoint}]}});case 5:l.Z.success(t("storage.spaces.connectedWithName",{name:null!==(a=null===n||void 0===n?void 0:n.name)&&void 0!==a?a:"DID Spaces"})),q();case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),q=function(){E((function(e){return!e}))};return(0,j.jsx)(S,{value:{spaceGateways:C,selectedSpaceGateway:V,addSpaceGateway:X,deleteSpaceGateway:Y,updateSpaceGateway:W,refreshSpaceGateways:q,spaceGatewaysLoading:y,spaceGatewayIsSelected:function(e){return(null===e||void 0===e?void 0:e.endpoint)===O},backupEndpoint:O,backupProgress:N,backups:R,backupsLoading:K,refreshBackupEndpoint:function(){T((function(e){return!e}))}},children:n})}function D(){return(0,c.useContext)(P)}B.propTypes={children:u().any.isRequired},B.defaultProps={}},60344:function(e,n,t){t.d(n,{hi:function(){return i},od:function(){return a.a}});var r=t(10458),a=t.n(r);a().defaults.timeout=1e4;var i=a().create()},84584:function(e,n,t){t.d(n,{Jf:function(){return y},LQ:function(){return f},Nb:function(){return m},Xv:function(){return p},mo:function(){return h},nD:function(){return d},nU:function(){return g},w2:function(){return b}});var r=t(32723),a=t(34795),i=t(82434),o=t.n(i),c=t(76811),s=t(65873),u=t(60344),l=t(6352);function p(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/"),r=t.at(-4),a=t.at(-2);return l(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 l(n,"space",t)}function f(e){return e.replace(/\/$/,"").split("/").at(-4)}function m(e){return v.apply(this,arguments)}function v(){return(v=(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,u.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 h(e){var n;return(null===e||void 0===e||null===(n=e.find((function(e){return e.key===c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT})))||void 0===n?void 0:n.value)||""}function b(e){return x.apply(this,arguments)}function x(){return(x=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,i,c;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=l(n,"space/api/did/one-click-authorization/token"),e.next=6,u.hi.get(t,{timeout:5e3});case 6:return a=e.sent,i=a.status,c=a.data,e.abrupt("return",200===i&&(0,s.isObject)(c));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 g(e){return k.apply(this,arguments)}function k(){return(k=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a,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","");case 3:return e.next=5,u.hi.head(n,{timeout:3e3});case 5:return t=e.sent,a=t.headers,i=a["x-space-name"],e.abrupt("return",i?decodeURIComponent(i):"");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 y(e){var n=e.replace(/\/api\/space\/.+/,""),t=e.replace(/\/$/,"").split("/").at(-4);return l(n,"/api/space/nft/display?spaceDid=".concat(t))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6580,2611],{16580:function(e,t,n){n.r(t),n.d(t,{default:function(){return ee}});var r=n(71171),o=n(5057),a=n(33518),i=n(85493),s=n(11750),l=n(94464),c=n(68420),u=n(42611),d=n(75793),m=n(96266);function f(){var e=(0,d.h6)(),t=e.api,n=e.info;return(0,m.jsx)(u.default,{client:t,did:n.did})}var p=n(68079),v=n(32723),h=n(34795),g=n(33028),y=n(96234),Z=n(45603),x=n.n(Z),b=n(90049),j=n.n(b),k=n(39948),P=n(55402),D=n(75760),w=n(44846),I=n(35966),R=n(66506),N=n(35432),E=n(76811),S=n(86229),O=n(1722),T=n(80378),z=n(14491),C=n(38242),F=n(56169),L=n(1979),M=n(55898),U=n.n(M),B=n(50844),_=n(99154),q=n(844),Y=(0,B.Z)((function(e){return{root:{height:10},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.mode?200:700]},bar:{backgroundColor:e.palette.secondary.main}}}))(_.Z);function V(e){var t=e.value;return(0,m.jsxs)(k.Z,{display:"flex",alignItems:"center",mt:2,children:[(0,m.jsx)(k.Z,{width:"100%",style:{overflow:"hidden"},mr:1,children:(0,m.jsx)(Y,(0,g.Z)({variant:"determinate"},e))}),(0,m.jsx)(k.Z,{minWidth:35,children:(0,m.jsx)(s.Z,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(t),"%")})})]})}function W(e){var t=e.disk,n=e.platform,r=(0,o.useContext)(c.RD).t,a=[{id:1,className:"used",title:r("system.used"),metric:(0,z.RR)(t.used,n)},{id:2,className:"free",title:r("system.free"),metric:(0,z.RR)(t.free,n)},{id:3,className:"total",title:r("system.total"),metric:(0,z.RR)(t.total,n)}];return(0,m.jsx)(q.Z,{title:"".concat(r("common.disk")," (").concat(t.device,")"),value:(0,z.RR)(t.used,n),graph:(0,m.jsx)(k.Z,{mt:3,children:(0,m.jsx)(V,{value:t.used/t.total*100})}),description:a.map((function(e,t){return(0,m.jsxs)(k.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title)}))})}V.propTypes={value:U().number.isRequired},W.propTypes={disk:U().shape({used:U().number,free:U().number,total:U().number,device:U().string}),platform:U().string},W.defaultProps={disk:{used:0,free:0,total:1,device:""},platform:""};var H,A=n(52926),K=n(52581),X=n(34937),G={uptime:0,pid:-1,cpuUsage:0,memoryUsage:0},J="Blocklet Server";function Q(e){var t=e.initialBlocklets,n=(0,c.PE)(),r=n.t,a=n.locale,i=(0,d.h6)().api,l=(0,o.useMemo)((function(){var e=[];return e.push({type:"server",groupId:"server",groupName:J,id:"server:daemon",name:"Server (Daemon)",runtimeInfo:G}),e.push({type:"server",groupId:"server",groupName:J,id:"server:service",name:"Server (Service)",runtimeInfo:G}),t.forEach((function(t){(0,C.forEachBlockletSync)(t,(function(n,r){var o=r.id,a=r.ancestors;n.runtimeInfo&&e.push({type:"blocklet",groupId:t.meta.did,groupName:(0,C.getDisplayName)(t),id:o,name:(0,C.getDisplayName)(n,!0),blocklet:t,component:n,runtimeInfo:n.runtimeInfo,ancestors:a})}))})),e}),[]),u=(0,o.useState)(l),f=(0,y.Z)(u,2),p=f[0],Z=f[1],b=(0,o.useState)({os:{platform:""},mem:{used:0,free:0,total:1},cpu:{cpus:[],currentLoad:1},disks:[],daemon:{},service:{}}),w=(0,y.Z)(b,2),I=w[0],M=w[1],U=(0,o.useState)({cpu:[],mem:[],daemonMem:[],serviceMem:[]}),B=(0,y.Z)(U,2),_=B[0],q=B[1];(0,X.mU)(N.EVENTS.NODE_RUNTIME_INFO,(function(e){e.mem.total=e.mem.total||0,e.mem.used=e.mem.total-(e.mem.available||0),M(e),Z((function(t){return t.map((function(t){return"server:daemon"===t.id?(0,g.Z)((0,g.Z)({},t),{},{runtimeInfo:(0,g.Z)((0,g.Z)({},t.runtimeInfo),e.daemon)}):"server:service"===t.id?(0,g.Z)((0,g.Z)({},t),{},{runtimeInfo:(0,g.Z)((0,g.Z)({},t.runtimeInfo),e.service)}):t}))}))})),(0,X.mU)(N.EVENTS.BLOCKLETS_RUNTIME_INFO,(function(e){e&&e.length?Z((function(t){return t.map((function(t){var n=e.find((function(e){return e.componentId===t.id}));return n?(0,g.Z)((0,g.Z)({},t),{},{runtimeInfo:(0,g.Z)((0,g.Z)({},t.runtimeInfo),n.runtimeInfo)}):t}))})):console.error("incorrect blocklets runtime info format",e)}));var Y=function(e){Z((function(t){return t.filter((function(t){return t.groupId!==e.meta.did}))}))},V=function(){var e=(0,h.Z)((0,v.Z)().mark((function e(t){var n,r;return(0,v.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.getBlocklet({input:{did:t.meta.did,attachRuntimeInfo:!0}});case 3:n=e.sent,"running"!==(r=n.blocklet).status&&Y(r),Z((function(e){var t=e.filter((function(e){return e.groupId!==r.meta.did}));return(0,C.forEachBlockletSync)(r,(function(e,n){var o=n.id,a=n.ancestors;e.runtimeInfo&&t.push({type:"blocklet",groupId:r.meta.did,groupName:(0,C.getDisplayName)(r),id:o,name:(0,C.getDisplayName)(e,!0),blocklet:r,component:e,runtimeInfo:e.runtimeInfo,ancestors:a})})),t})),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),S.Z.error(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}();(0,X.mU)(E.BlockletEvents.removed,Y),(0,X.mU)(E.BlockletEvents.startFailed,Y),(0,X.mU)(E.BlockletEvents.statusChange,(function(e){"running"===e.status?V(e):Y(e)})),(0,X.mU)(E.BlockletEvents.updated,V),(0,X.mU)(E.BlockletEvents.started,V);(0,o.useEffect)((function(){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;i.getNodeRuntimeHistory({input:{hours:e}}).then((function(e){var t=e.history||[];q({cpu:t.map((function(e){return{date:e.date,value:e.cpu}})),mem:t.map((function(e){return{date:e.date,value:e.mem}})),daemonMem:t.map((function(e){return{date:e.date,value:e.daemonMem}})),serviceMem:t.map((function(e){return{date:e.date,value:e.serviceMem}}))})})).catch((function(e){S.Z.error(e.message)}))}()}),[]);var H=[{label:r("common.group"),name:"groupName",options:{customBodyRenderLite:function(e){var t=p[e],n=t.type,r=t.blocklet,o=t.groupName;return"server"===n?(0,m.jsxs)(k.Z,{display:"flex",alignItems:"center",children:[(0,m.jsx)(K.r,{width:"14",height:"14"}),(0,m.jsx)(k.Z,{ml:1,children:o})]}):(0,m.jsxs)(k.Z,{display:"flex",alignItems:"center",children:[(0,m.jsx)(O.Z,{size:14,blocklet:r}),(0,m.jsx)(k.Z,{ml:1,children:o})]})}}},{label:r("common.name"),name:"name",options:{customBodyRenderLite:function(e){var t=p[e],n=t.type,r=t.name,o=t.component,a=t.ancestors;return"server"===n?(0,m.jsxs)(k.Z,{display:"flex",alignItems:"center",children:[(0,m.jsx)(R.Z,{width:"14",height:"14"}),(0,m.jsx)(k.Z,{ml:1,children:r})]}):(0,m.jsxs)(k.Z,{display:"flex",alignItems:"center",children:[(0,m.jsx)(T.Z,{size:14,blocklet:o,ancestors:a}),(0,m.jsx)(k.Z,{ml:1,children:r})]})}}},{label:r("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite:function(e){var t,n=p[e].runtimeInfo;return t=n.uptime,x()(Number(t||0),{locale:(0,z.FF)(a)})}}},{label:r("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite:function(e){var t=p[e].runtimeInfo;return j()((null===t||void 0===t?void 0:t.memoryUsage)||0)},sortDirection:"asc"}},{label:r("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite:function(e){var t=p[e].runtimeInfo;return"".concat((t.cpuUsage||0).toFixed(1),"%")}}},{label:r("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"}];return(0,m.jsxs)("div",{children:[(0,m.jsx)(s.Z,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:r("analytics.trend")}),(0,m.jsxs)(P.ZP,{mb:4,container:!0,spacing:4,children:[(0,m.jsx)(P.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,m.jsx)(F.Z,(0,g.Z)((0,g.Z)({},I.cpu),{},{history:_.cpu}))},"cpu"),(0,m.jsx)(P.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,m.jsx)(L.Z,(0,g.Z)((0,g.Z)({},I.mem),{},{history:_.mem}))},"memory"),(0,m.jsx)(P.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,m.jsx)(L.Z,{title:"".concat(r("common.memory")," (Daemon)"),used:I.daemon.memoryUsage||0,history:_.daemonMem})},"memory-daemon"),(0,m.jsx)(P.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,m.jsx)(L.Z,{title:"".concat(r("common.memory")," (Service)"),instanceCount:I.service.instanceCount||0,used:I.service.memoryUsage||0,history:_.serviceMem})},"memory-service"),I.disks.map((function(e){return(0,m.jsx)(P.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,m.jsx)(W,{disk:e,platform:I.os.platform})},"disk")}))]}),(0,m.jsx)(D.Z,{className:"runtime-insight-list",title:r("analytics.detail"),locale:a,data:p,columns:H,options:{download:!1,filter:!1,print:!1,pagination:!1,rowsPerPage:100}})]})}function $(){var e=(0,A.RJ)(),t=e.data,n=e.externalData;if(!e.initialized)return(0,m.jsx)(I.Z,{relative:"parent",children:(0,m.jsx)(w.Z,{})});var r=[].concat((0,p.Z)(t),(0,p.Z)(n))||[];return(0,m.jsx)(Q,{initialBlocklets:r})}function ee(){var e=(0,i.useNavigate)(),t=(0,o.useContext)(c.RD).t,n=(0,i.useParams)().tab,r=void 0===n?"traffic":n,a=[{label:t("common.traffic"),value:"traffic"},{label:t("common.runtime"),value:"runtime"}],u={traffic:f,runtime:$},d=u[r]||u.traffic;return(0,m.jsxs)(te,{children:[(0,m.jsx)(s.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("common.analytics")}),(0,m.jsx)(l.Z,{tabs:a,current:r,onChange:function(t){e("/analytics/".concat(t))}}),(0,m.jsx)("div",{className:"page-content",children:(0,o.isValidElement)(d)?d:(0,m.jsx)(d,{})})]})}var te=a.Z.main(H||(H=(0,r.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-content {\n margin-top: 16px;\n }\n"])))},844:function(e,t,n){n.d(t,{Z:function(){return p}});var r,o=n(71171),a=n(33028),i=n(55898),s=n.n(i),l=n(33518),c=n(38763),u=n(75392),d=n(11750),m=n(39948),f=n(96266);function p(e){var t=e.style,n=e.title,r=e.value,o=e.graph,i=e.description;return(0,f.jsx)(v,{children:(0,f.jsxs)(u.Z,{style:(0,a.Z)({},t),children:[(0,f.jsx)(d.Z,{sx:{fontSize:14},color:"text.secondary",children:n}),(0,f.jsx)(d.Z,{variant:"h5",component:"div",mt:1,children:r}),o,!!i&&(0,f.jsx)(m.Z,{display:"flex",sx:{fontSize:12,marginTop:3},color:"text.secondary",children:i})]})})}p.propTypes={style:s().object,title:s().node,value:s().node,graph:s().node,description:s().any},p.defaultProps={style:{},title:null,value:null,graph:null,description:null};var v=(0,l.Z)(c.Z)(r||(r=(0,o.Z)(["\n .card-content {\n height: 150px;\n }\n\n .card-sparkline {\n flex: 2;\n display: flex;\n position: relative;\n *[hidden] {\n display: none;\n }\n }\n .sparkline {\n stroke: ",";\n fill: ","1A;\n }\n .tooltip {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n padding: 2px 5px;\n font-size: 12px;\n white-space: nowrap;\n z-index: 9999;\n }\n .sparkline--cursor {\n stroke: orange;\n }\n\n .sparkline--spot {\n fill: red;\n stroke: red;\n }\n"])),(function(e){return e.theme.palette.primary.main}),(function(e){return e.theme.palette.primary.main}))},52959:function(e,t,n){n.d(t,{Z:function(){return f}});var r=n(33028),o=n(96234),a=n(5057),i=n(55898),s=n.n(i),l=n(12673),c=n(28563),u=n(26089),d=n(844),m=n(96266);function f(e){var t=e.id,n=e.title,i=e.current,s=e.description,f=e.data,p=e.dateFn,v=e.valueFn,h=(0,a.useRef)(null),g=(0,a.useRef)(null),y=(0,l.Z)({style:{top:0,left:0},hidden:!0,textContent:""}),Z=(0,a.useState)(null),x=(0,o.Z)(Z,2),b=x[0],j=x[1],k=(0,c.Z)(b),P={onmousemove:function(e,t){var n=t.date,r=t.value;y.textContent="".concat(p(n),": ").concat(v(r)),y.style.top=-30,y.style.left=80,y.hidden=!1},onmouseout:function(){y.hidden=!0}};return(0,a.useEffect)((function(){setTimeout((function(){j(document.querySelector(".".concat(t))),setTimeout((function(){h.current&&(0,u.Z)(h.current,f||[],P)}),400)}))}),[f]),(0,m.jsx)(d.Z,{title:n,value:i,graph:(0,m.jsxs)("div",{className:"card-sparkline ".concat(t),style:{marginTop:16},children:[(0,m.jsx)("svg",{ref:h,className:"sparkline",width:(null===k||void 0===k?void 0:k.width)||100,height:30,strokeWidth:"2"}),(0,m.jsx)("span",{className:"tooltip",ref:g,hidden:y.hidden,style:(0,r.Z)({},y.style),children:y.textContent})]}),description:s})}f.propTypes={id:s().string.isRequired,title:s().string.isRequired,current:s().any.isRequired,description:s().any,data:s().array,dateFn:s().func,valueFn:s().func},f.defaultProps={description:null,data:[],dateFn:function(e){return e},valueFn:function(e){return e}}},56169:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(5057),o=n(55898),a=n.n(o),i=n(68420),s=n(52959),l=n(14491),c=n(96266),u=function(e){return"".concat(e,"%")};function d(e){var t=e.cpus,n=e.currentLoad,o=e.history,a=(0,r.useContext)(i.RD),d=a.t,m=a.locale;return(0,c.jsx)(s.Z,{id:"cpu-sparkline",title:d("common.cpu"),current:"".concat(Math.floor(n||0),"%"),data:o,description:"".concat(d("system.cores"),": ").concat((null===t||void 0===t?void 0:t.length)||0),dateFn:function(e){return(0,l.mr)(e,"HH:mm",m)},valueFn:u})}d.propTypes={cpus:a().array,currentLoad:a().number,history:a().array},d.defaultProps={cpus:[],currentLoad:0,history:[]}},1979:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(55898),o=n.n(r),a=n(90049),i=n.n(a),s=n(39948),l=n(68420),c=n(52959),u=n(14491),d=n(96266);function m(e){var t=e.instanceCount,n=e.title,r=e.total,o=e.used,a=e.history,m=(0,l.PE)(),f=m.t,p=m.locale,v=!!r,h=r-o,g=v?"(".concat(Math.floor(o/r*100),"%)"):"",y=[];return t&&y.push({title:f("system.instances"),metric:t}),y.push({title:f("system.used"),metric:i()(o)}),v&&y.push({title:f("system.free"),metric:i()(h)},{title:f("system.total"),metric:i()(r)}),(0,d.jsx)(c.Z,{id:"mem-sparkline",title:n||f("common.memory"),current:"".concat(i()(Math.floor(o||0))," ").concat(g),data:a,description:y.map((function(e,t){return(0,d.jsxs)(s.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title)})),dateFn:function(e){return(0,u.mr)(e,"HH:mm",p)},valueFn:i()})}m.propTypes={title:o().string,instanceCount:o().number,total:o().number,used:o().number,history:o().array},m.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[]}},42611:function(e,t,n){n.r(t),n.d(t,{default:function(){return A},getDefaultRanges:function(){return H}});var r=n(33028),o=n(32723),a=n(34795),i=n(96234),s=n(5057),l=n(1577),c=n.n(l),u=n(6465),d=n.n(u),m=n(6352),f=n.n(m),p=n(90049),v=n.n(p),h=n(74511),g=n(96181),y=n(93938),Z=n(44846),x=n(55402),b=n(11750),j=n(56556),k=n(67680),P=n(11819),D=n(13811),w=n(49204),I=n(9189),R=n(20425),N=n(34862),E=n(68420),S=n(35432),O=n(87364),T=n(39458),z=n(4903),C=n(44926),F=n(90298),L=n(43713),M=n(59497),U=n(9732),B=n(13379),_=n(14491),q=n(58238),Y=n(52959),V=n(96266),W=d()(0),H=function(e,t){return[{label:"This Week",startDate:(0,O.Z)(e,{locale:t}),endDate:(0,T.Z)(e,{locale:t})},{label:"Last Week",startDate:(0,O.Z)((0,z.Z)(e,-1),{locale:t}),endDate:(0,T.Z)((0,z.Z)(e,-1),{locale:t})},{label:"Last 7 Days",startDate:(0,z.Z)(e,-1),endDate:e},{label:"This Month",startDate:(0,C.Z)(e),endDate:(0,F.Z)(e)},{label:"Last Month",startDate:(0,C.Z)((0,L.Z)(e,-1)),endDate:(0,F.Z)((0,L.Z)(e,-1))},{label:"This Year",startDate:(0,M.Z)(e),endDate:(0,U.Z)(e)},{label:"Last Year",startDate:(0,M.Z)((0,B.Z)(e,-1)),endDate:(0,U.Z)((0,B.Z)(e,-1))}]};function A(e){var t=e.client,n=e.did,l=c()().subtract(1,"day").toDate(),u=(0,q.h6)(),d=u.info,m=u.inService,p=(0,E.PE)(),O=p.t,T=p.locale,z=(0,s.useState)(null),C=(0,i.Z)(z,2),F=C[0],L=C[1],M=(0,s.useState)(!1),U=(0,i.Z)(M,2),B=U[0],A=U[1],K=(0,s.useState)(l),X=(0,i.Z)(K,2),G=X[0],J=X[1],Q=(0,s.useState)({startDate:c()().subtract(30,"day").toDate(),endDate:l}),$=(0,i.Z)(Q,2),ee=$[0],te=$[1],ne=(0,h.Z)((0,a.Z)((0,o.Z)().mark((function e(){var r;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getTrafficInsights({input:{did:n,startDate:c()(ee.startDate).format("YYYY-MM-DD"),endDate:c()(ee.endDate).format("YYYY-MM-DD")}});case 2:return r=e.sent,e.abrupt("return",r.list);case 4:case"end":return e.stop()}}),e)}))));(0,s.useEffect)((function(){ne.loading||ee.startDate&&ee.endDate&&ne.retry()}),[ee]);var re=function(e){L(F?null:e.currentTarget)},oe=ne.value||[],ae=ne.loading,ie=ne.error;if(!oe.length&&ae)return(0,V.jsx)(Z.Z,{});if(ie)return(0,V.jsx)(y.Z,{severity:"error",children:(0,_.Z)(ie)});var se={totalRequests:W,validRequests:W,failedRequests:W,uniqueVisitors:W,uniqueFiles:W,uniqueReferrers:W,uniqueNotFound:W,uniqueStaticFiles:W,logSize:v(),bandwidth:v()},le=Object.keys(se).map((function(e){return{id:"".concat(e,"_chart"),title:O("analytics.traffic.".concat(e)),current:oe.length?se[e](oe[0][e]):0,data:oe.map((function(t){return{date:t.date,value:t[e]}})).reverse(),dateFn:W,valueFn:se[e]}})),ce=Boolean(F),ue=ce?"date-range-picker-popover":void 0,de=m?S.WELLKNOWN_SERVICE_PATH_PREFIX:d.routing.adminPath,me=f()(window.location.origin,de,"/api/analytics/traffic?date=".concat(c()(G).format("YYYY-MM-DD"),"&did=").concat(n));return(0,V.jsxs)("div",{children:[(0,V.jsxs)(b.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:[O("analytics.trend"),(0,V.jsxs)(j.Z,{onClick:re,variant:"outlined",size:"small",color:"secondary",children:[(0,_.pz)(ee.startDate,T)," - ",(0,_.pz)(ee.endDate,T)]})]}),(0,V.jsx)(P.ZP,{id:ue,open:ce,anchorEl:F,onClose:function(){return L(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,V.jsx)(w.D,{open:!0,toggle:re,maxDate:l,definedRanges:H(G),onChange:function(e){te(e),L(null)}})}),(0,V.jsx)(x.ZP,{container:!0,spacing:4,children:le.map((function(e){return(0,V.jsx)(x.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,V.jsx)(Y.Z,(0,r.Z)({},e))},e.id)}))}),(0,V.jsxs)(b.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mt:4,mb:1,children:[O("analytics.detail"),(0,V.jsxs)("span",{children:[B&&(0,V.jsx)(k.Z,{onClick:function(){window.open(me)},style:{marginRight:32},children:(0,V.jsx)(D.Z,{})}),(0,V.jsx)(N._,{dateAdapter:R.y,children:(0,V.jsx)(I.M,{disableFuture:!0,format:"ll",value:c()(G),onChange:function(e){J(e.toDate()),A(!1)},slotProps:{textField:{size:"small"}}})})]})]}),(0,V.jsx)(g.Z,{url:me,width:"100%",height:"100%",frameBorder:0,onLoad:function(){return A(!0)},styles:{border:0,minHeight:"400vh"}})]})}},1722:function(e,t,n){n.d(t,{Z:function(){return f}});var r=n(33028),o=n(59740),a=n(55898),i=n.n(a),s=n(62681),l=n(72333),c=n(76811),u=n(49522),d=n(96266),m=["blocklet","style","size"];function f(e){var t,n=e.blocklet,a=e.style,i=e.size,f=(0,o.Z)(e,m),p=(0,u.Z)({blocklet:n}).logoUrl,v=f.variant,h=(0,d.jsx)("img",{src:p,alt:"",style:{width:i}});n.meta.logo||((null===(t=(n.configs||[]).find((function(e){return e.key===c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE})))||void 0===t?void 0:t.value)||(h=(0,d.jsx)(l.Z,{did:n.meta.did||"",responsive:!0})));return(0,d.jsx)(s.Z,(0,r.Z)((0,r.Z)({variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},a)},f),{},{children:h}))}f.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string])},f.defaultProps={style:{},size:40}},80378:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(33028),o=n(59740),a=n(55898),i=n.n(a),s=n(62681),l=n(72333),c=n(6352),u=n.n(c),d=n(35432),m=n(58238),f=n(14491);var p=n(96266),v=["blocklet","style","size","ancestors"];function h(e){var t=e.blocklet,n=e.style,a=e.size,i=e.ancestors,c=(0,o.Z)(e,v),h=(0,m.h6)(),g=function(e){var t,n=e.blocklet,r=e.ancestors,o=void 0===r?[]:r,a=(0,m.h6)(),i=a.inService,s="?v=".concat(null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.version).concat((0,f.XN)(null===n||void 0===n?void 0:n.status)?"~":""),l=i?u()(f.zn,d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",s):u()(a.imgPrefix,"blocklet.png");if("registry"===n.source&&n.deployedFrom&&n.meta.logo)l=u()(n.deployedFrom,(0,f.lk)(n.meta.bundleDid,n.meta.logo),s);else{var c=window.env.apiPrefix||"/",p=o.concat(n),v=i?p.slice(1):p;l=u()(c,"/blocklet/logo-bundle".concat(v.map((function(e){return"/".concat(e.meta.did)})).join("")),s)}return{logoUrl:l,inService:i}}({blocklet:t,ancestors:i}),y=g.logoUrl,Z=g.inService,x=c.variant,b=Z?function(){}:function(e){e.target.src="".concat(h.imgPrefix,"/blocklet.png")},j=(0,p.jsx)("img",{src:y,onError:b,alt:t.meta.name,style:{width:a}});return t.meta.logo||(j=(0,p.jsx)(l.Z,{did:t.meta.did||"",responsive:!0})),(0,p.jsx)(s.Z,(0,r.Z)((0,r.Z)({variant:x||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,borderRadius:10},n)},c),{},{children:j}))}h.propTypes={blocklet:i().object.isRequired,style:i().object,size:i().oneOfType([i().number,i().string]),ancestors:i().array},h.defaultProps={style:{},size:40,ancestors:[]}},49522:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(6352),o=n.n(r),a=n(58238),i=n(14491);function s(e){var t,n,r=e.blocklet,s=(0,a.h6)().inService,l=(null===(t=window.env)||void 0===t?void 0:t.apiPrefix)||"/",c="?v=".concat(null===r||void 0===r||null===(n=r.meta)||void 0===n?void 0:n.version).concat((0,i.wS)(null===r||void 0===r?void 0:r.status)?"~":"");return{logoUrl:o()(l,"/blocklet/logo/".concat(s?"":r.meta.did),c)}}},66506:function(e,t,n){t.Z=void 0;(r=n(5057))&&r.__esModule;var r,o=n(96266);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){return(0,o.jsxs)("svg",i(i({},e),{},{children:[(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.083 3.2c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12v10.24a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V3.2zm2.24 1.12v8h23.36v-8H4.323zm-2.24 14.24c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12V28.8a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V18.56zm2.24 1.12v8h23.36v-8H4.323z",fill:"currentColor"}),(0,o.jsx)("path",{d:"M8.963 7.04h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64zm5.12-15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64z",fill:"currentColor"})]}))};l.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},l.displayName="server";var c=l;t.Z=c},50844:function(e,t,n){n.d(t,{Z:function(){return f}});var r=n(7896),o=n(31461),a=n(5057),i=n(56129),s=n.n(i),l=n(92877);var c=n(95335),u=n(96266),d=["defaultTheme","withTheme","name"],m=["classes"],f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var i=t.defaultTheme,f=t.withTheme,p=void 0!==f&&f,v=t.name,h=(0,o.Z)(t,d);var g=v,y=(0,l.Z)(e,(0,r.Z)({defaultTheme:i,Component:n,name:v||n.displayName,classNamePrefix:g},h)),Z=a.forwardRef((function(e,t){var a,s=(0,o.Z)(e,m),l=y((0,r.Z)({},n.defaultProps,e)),d=s;return("string"===typeof v||p)&&(a=(0,c.Z)()||i,v&&(d=function(e){var t=e.theme,n=e.name,o=e.props;if(!t||!t.components||!t.components[n]||!t.components[n].defaultProps)return o;var a,i=(0,r.Z)({},o),s=t.components[n].defaultProps;for(a in s)void 0===i[a]&&(i[a]=s[a]);return i}({theme:a,name:v,props:s})),p&&!d.theme&&(d.theme=a)),(0,u.jsx)(n,(0,r.Z)({ref:t,classes:l},d))}));return s()(Z,n),Z}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6591],{56742:function(e,n,t){var r=t(49394),i=r.toBuffer,o=r.toAddress,a=t(46422).base32;e.exports={encode:function(e){if(!e)return e;var n=i(o(e));return a.encode(n)}}},44543:function(e,n,t){var r=t(57156);e.exports=function(e,n){return r(e)===r(n)}},92726:function(e,n,t){"use strict";t.d(n,{Z:function(){return k}});var r,i=t(71171),o=t(32723),a=t(34795),s=t(33028),l=t(96234),c=t(59740),d=t(5057),u=t(55898),m=t.n(u),p=t(33518),f=t(67680),v=t(61533),h=t(74490),x=t(45267),Z=t(46954),g=t(44067),j=t(96266),y=["actions","size"],b=["icon","text","onClick","disabled"];function k(e){var n=e.actions,t=e.size,r=(0,c.Z)(e,y),i=(0,d.useState)(null),u=(0,l.Z)(i,2),m=u[0],p=u[1],k=Boolean(m),P=function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}p(null)};return(0,j.jsxs)(C,(0,s.Z)((0,s.Z)({},r),{},{children:[(0,j.jsx)(f.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}p(e.currentTarget)},size:t,children:(0,j.jsx)(x.Z,{})}),(0,j.jsx)(v.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:m,keepMounted:!0,open:k,onClose:P,PaperProps:{},children:n.map((function(e,n){if("function"===typeof e)return e({close:P});var t=e.icon,r=e.text,i=e.onClick,l=e.disabled,u=void 0!==l&&l,m=(0,c.Z)(e,b);return(0,d.createElement)(h.Z,(0,s.Z)((0,s.Z)({},m),{},{disabled:u,dense:!0,onClick:function(){var e=(0,a.Z)((0,o.Z)().mark((function e(n){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i(n);case 2:P();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),key:n,"data-cy":"actions-menu-".concat(n)}),(0,j.jsx)(Z.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,j.jsx)(g.Z,{primary:r}))}))})]}))}k.propTypes={actions:m().array,size:m().oneOf(["small","medium","large"])},k.defaultProps={actions:[],size:"small"};var C=p.Z.div(r||(r=(0,i.Z)([""])))},86591:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Se}});var r=t(71171),i=t(96234),o=t(28726),a=t(33518),s=t(5057),l=t(17655),c=t(76720),d=t(64886),u=t(68420),m=t(19778),p=t(38242),f=t(11750),v=t(29054),h=t(58238),x=t(92816),Z=t(14491),g=t(81010),j=t(4651),y=t(33028),b=t(55898),k=t.n(b),C=t(44919),P=t(93938),E=t(39948),w=t(67680),T=t(75239),R=t(96366),D=t(56742),S=t(49714),A=t(18067),I=t(25710),_=t(44846),z=t(63406),L=t(59740),q=t(32723),F=t(34795),W=t(74511),B=t(88574),N=t(76811),O=t(86229),M=t(70461),U=t(96266),H=["domain","domainStatus"],K=function(e){return["waiting","creating","renewaling"].includes(e)};function V(e){var n,t=(0,u.PE)().t,r=(0,s.useState)(!1),o=(0,i.Z)(r,2),a=o[0],l=o[1],c=(0,s.useState)(null),d=(0,i.Z)(c,2),m=d[0],p=d[1],f=e.domain,x=e.onAdd,Z=e.children,g=e.did,j=(0,h.h6)(),y=j.api,b=j.ws.useSubscription,k=(0,s.useState)(!1),C=(0,i.Z)(k,2),P=C[0],E=C[1],w=(0,v.y0)().actions.refreshDomainStatus,R=(0,W.Z)((0,F.Z)((0,q.Z)().mark((function e(){var n,t;return(0,q.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y.findCertificateByDomain({input:{domain:f,did:g}});case 2:return n=e.sent,t=n.cert,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})))),D=function(e,n){e.domain===f&&(E(!1),"success"===n?O.Z.success("The ".concat(e.domain," certificate is issued successfully")):"error"===n&&O.Z.error("Failed to issue certificate for ".concat(e.domain)))};if((0,s.useEffect)((function(){var e;!R.loading&&K(null===(e=R.value)||void 0===e?void 0:e.status)&&E(!0)}),[R]),b(N.BlockletEvents.certError,(function(e){return D(e,"error")})),b(N.BlockletEvents.certIssued,(function(e){R.retry(),w(e.domain),D(e,"success")})),R.loading)return"";if("normal"===(null===(n=R.value)||void 0===n?void 0:n.status))return"";var S=function(){var e=(0,F.Z)((0,q.Z)().mark((function e(){return(0,q.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,y.issueLetsEncryptCert({input:{domain:f,did:g}});case 4:x(),E(!0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.error(e.t0),E(!1);case 12:return e.prev=12,l(!1),p(null),e.finish(12);case 16:case"end":return e.stop()}}),e,null,[[1,8,12,16]])})));return function(){return e.apply(this,arguments)}}(),A={title:t("router.cert.genLetsEncryptCert.title"),description:(0,U.jsxs)("div",{children:[(0,U.jsx)(B.Z,{type:"success",children:t("router.cert.genLetsEncryptCert.dnsTip")}),t("router.cert.genLetsEncryptCert.description")]}),confirm:t("common.confirm"),onConfirm:S,onCancel:function(){l(!1),p(null)}};return(0,U.jsxs)(U.Fragment,{children:[P?(0,U.jsx)(T.Z,{title:t("router.cert.issuing"),children:(0,U.jsx)(_.Z,{size:12})}):Z({loading:a,open:function(e){e.stopPropagation(),p(A)}}),m&&(0,U.jsx)(M.Z,{color:"primary",title:m.title,description:m.description,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}function X(e){var n=e.domain,t=e.domainStatus,r=(0,L.Z)(e,H);return!(0,Z.rM)(n)||null!==t&&void 0!==t&&t.isHttps?"":(0,U.jsx)(V,(0,y.Z)({domain:n},r))}V.propTypes={domain:k().string.isRequired,did:k().string.isRequired,onAdd:k().func,children:k().any},V.defaultProps={onAdd:function(){},children:null},X.propTypes={domain:k().string.isRequired,domainStatus:k().shape({isHttps:k().bool}).isRequired,did:k().string.isRequired,onAdd:k().func,children:k().any},X.defaultProps={onAdd:function(){},children:null};var Y=t(11593),G=t(74490),J=t(47020),Q=t(12937),$=t(72904),ee=["domain","resolvedTarget"];function ne(e){var n=e.domain,t=e.resolvedTarget,r=(0,L.Z)(e,ee),i=(0,u.PE)(),o=i.t,a=i.locale;return(0,U.jsxs)(E.Z,(0,y.Z)((0,y.Z)({sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"}},r),{},{children:[(0,U.jsxs)(E.Z,{display:"flex",children:[o("router.domain.setup.tipStart"),n&&(0,U.jsx)(E.Z,{mx:.5,color:"primary.main",fontWeight:"fontWeightBold",children:n}),o("router.domain.setup.tipEnd"),":"]}),(0,U.jsxs)(E.Z,{sx:{"&>div":{mb:0},marginTop:"8px"},children:[(0,U.jsx)(te,{label:o("router.domain.setup.recordType"),value:"CNAME",locale:a}),(0,U.jsx)(te,{label:o("router.domain.setup.recordValue"),value:t,locale:a})]})]}))}function te(e){var n=e.locale,t=e.label,r=e.value,i=(0,$.Z)((function(e){return e.breakpoints.down("md")})),o=(0,R.Z)();return(0,U.jsx)(d.Z,{name:t,nameWidth:120,children:(0,U.jsxs)(E.Z,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[(0,U.jsx)(f.Z,{component:"span",color:"primary.main",wordWrap:"break-word",overflow:"auto",sx:i?{maxWidth:"95%"}:{},children:r}),(0,U.jsx)(Q.q,{content:r,locale:n,style:{marginLeft:"4px",color:o.palette.text.secondary}})]})})}ne.propTypes={domain:k().string,resolvedTarget:k().string.isRequired},ne.defaultProps={domain:""},te.propTypes={locale:k().string.isRequired,label:k().string.isRequired,value:k().string.isRequired};var re=t(51233);function ie(e){var n=e.id,t=e.children,r=e.title,o=e.teamDid,a=e.systemDomains,l=(0,u.PE)().t,c=(0,h.h6)().api,d=(0,s.useState)(!1),m=(0,i.Z)(d,2),p=m[0],v=m[1],x=(0,s.useState)(null),g=(0,i.Z)(x,2),j=g[0],b=g[1],k=a.find((function(e){return(0,S.isDidDomain)(e)})),C=function(){var e=(0,F.Z)((0,q.Z)().mark((function e(t){return(0,q.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=2;break}return e.abrupt("return");case 2:return v(!0),e.prev=3,e.next=6,c.addDomainAlias({input:{id:n,domainAlias:(0,re.sf)(t.domain),teamDid:o}});case 6:return e.next=8,(0,Z._v)(2e3);case 8:b(null);case 9:return e.prev=9,v(!1),e.finish(9);case 12:case"end":return e.stop()}}),e,null,[[3,,9,12]])})));return function(n){return e.apply(this,arguments)}}(),P=function(){var e=(0,F.Z)((0,q.Z)().mark((function e(n,t,r){return(0,q.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t(n);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),r((0,Z.Z)(e.t0));case 8:return e.prev=8,v(!1),e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[0,5,8,11]])})));return function(n,t,r){return e.apply(this,arguments)}}(),E={title:r||l("router.domainAlias.add.title"),description:function(e,n,t){return(0,U.jsxs)(f.Z,{component:"div",children:[(0,U.jsx)(J.Z,{label:l("router.domainAlias.add.domainDescription"),helperText:l("router.domainAlias.add.helperText"),autoComplete:"off",variant:"outlined",name:"domain","data-cy":"add-domain",fullWidth:!0,autoFocus:!0,inputProps:{"data-cy":"domain-name-input"},value:e.domain,style:{marginBottom:8},margin:"dense",onChange:function(r){var i=r.target.value.trim(),o=(0,re.ub)(i,l);n((0,y.Z)((0,y.Z)({},e),{},{domain:i,__disableConfirm:!!o})),t(o||"")},onKeyPress:function(n){if("Enter"===n.key){n.preventDefault();var r=n.target.value.trim(),i=(0,re.ub)(r,l);i?t(i):P(e,C,t)}}}),(0,U.jsx)(ne,{domain:e.domain,resolvedTarget:k})]})},confirm:l("common.confirm"),cancel:l("common.cancel"),params:{domain:"",__disableConfirm:!0},onConfirm:C,onCancel:function(){v(!1),b(null)}},w=function(e){e.stopPropagation(),b(E)};return(0,U.jsxs)(U.Fragment,{children:["function"===typeof t?t({loading:p,open:w}):(0,U.jsxs)(G.Z,{onClick:w,className:"rule-action","data-cy":"action-add-domain-alias",children:[p?(0,U.jsx)(_.Z,{size:16}):(0,U.jsx)(Y.Z,{style:{fontSize:18,marginRight:5}}),l("router.domainAlias.add.title")]}),j&&(0,U.jsx)(M.Z,{title:j.title,description:j.description,confirm:j.confirm,cancel:j.cancel,params:j.params,onConfirm:j.onConfirm,onCancel:j.onCancel,color:"primary",loading:p,maxWidth:"lg"})]})}ie.propTypes={id:k().string.isRequired,children:k().any,title:k().string,teamDid:k().string,systemDomains:k().arrayOf(k().string).isRequired},ie.defaultProps={children:null,title:"",teamDid:""};var oe=t(46954),ae=t(44067),se=t(27773),le=t(92726);function ce(e){var n=(0,u.PE)().t,t=(0,s.useState)(!1),r=(0,i.Z)(t,2),a=r[0],l=r[1],c=(0,s.useState)(null),d=(0,i.Z)(c,2),m=d[0],p=d[1],f=e.id,v=e.domain,x=e.children,g=e.teamDid,j=(0,h.h6)().api,y=function(){var e=(0,F.Z)((0,q.Z)().mark((function e(){return(0,q.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,j.deleteDomainAlias({input:{id:f,domainAlias:v,teamDid:g}});case 4:return e.next=6,(0,Z._v)(2e3);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),O.Z.error(e.t0.message);case 11:return e.prev=11,p(null),l(!1),e.finish(11);case 15:case"end":return e.stop()}}),e,null,[[1,8,11,15]])})));return function(){return e.apply(this,arguments)}}(),b={title:n("router.domainAlias.delete.title"),description:n("router.domainAlias.delete.description"),confirm:n("common.confirm"),onConfirm:y,onCancel:function(){l(!1),p(null)}},k=function(e){e.stopPropagation(),p(b)};return(0,U.jsxs)(U.Fragment,{children:["function"===typeof x?x({loading:a,open:k}):(0,U.jsxs)(o.Z,{edge:"end",onClick:k,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[a?(0,U.jsx)(_.Z,{size:16}):(0,U.jsx)(se.default,{style:{fontSize:16}}),n("router.domainAlias.delete.title")]}),m&&(0,U.jsx)(M.Z,{title:m.title,description:m.description,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}function de(e){var n=e.site,t=e.domain,r=e.blocklet,i=(0,u.PE)().t,o=t.value===window.location.hostname;return(0,U.jsx)(le.Z,{"data-cy":"domain-actions",size:"large",actions:[function(e){var a,s=e.close;return(0,U.jsx)(ce,{id:n.id,domain:t.value,teamDid:null===r||void 0===r||null===(a=r.meta)||void 0===a?void 0:a.did,children:function(e){var n=e.open;return(0,U.jsx)(T.Z,{title:o?i("blocklet.router.currentDomainTip"):"",children:(0,U.jsx)("span",{children:(0,U.jsxs)(G.Z,{disabled:t.isProtected||o,dense:!0,onClick:function(e){s(),n(e)},"data-cy":"action-toggle-block",children:[(0,U.jsx)(oe.Z,{style:{minWidth:24,marginRight:8},children:(0,U.jsx)(se.default,{})}),(0,U.jsx)(ae.Z,{primary:i("common.delete")})]},"remove")})})}})}]})}ce.propTypes={id:k().string.isRequired,domain:k().string.isRequired,children:k().any,teamDid:k().string},ce.defaultProps={children:null,teamDid:""},de.propTypes={site:k().object.isRequired,domain:k().object.isRequired,blocklet:k().object.isRequired},de.defaultProps={};var ue,me=t(68079),pe=t(31942),fe=t(69569),ve=k().shape({href:k().string,accessibility:k().shape({loading:k().bool,accessible:k().bool}),domainStatus:k().shape({isHttps:k().bool,matchedCert:k().object}),dns:k().shape({resolved:k().bool,ip:k().string})}),he=t(43681),xe=t.n(he),Ze=t(11819),ge=t(38763),je=t(75392);function ye(e){var n=e.certificate,t=(0,s.useState)(null),r=(0,i.Z)(t,2),o=r[0],a=r[1],l=(0,h.h6)(),c=(0,u.PE)(),d=c.t,m=c.locale,p=function(){a(null)},v=Boolean(o);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pe.Z,{"aria-owns":v?"mouse-over-popover":void 0,onMouseEnter:function(e){a(e.currentTarget)},onMouseLeave:p,style:{color:"#44cdc6",fontSize:20,marginLeft:8,cursor:"pointer"}}),(0,U.jsx)(Ze.ZP,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:v,anchorEl:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:p,disableRestoreFocus:!0,children:(0,U.jsx)(ge.Z,{children:(0,U.jsxs)(je.Z,{style:{display:"flex"},children:[(0,U.jsx)("div",{children:(0,U.jsx)("img",{src:"".concat(l.imgPrefix,"/https-certificate-icon.png"),alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),(0,U.jsxs)(f.Z,{component:"div",style:{marginLeft:"16px"},children:[(0,U.jsx)(f.Z,{component:"div",style:{fontWeight:"bold"},children:n.domain}),(0,U.jsx)(f.Z,{component:"div",children:"".concat(d("common.issuer"),": ").concat(xe()(n,"issuer.commonName",""))}),(0,U.jsx)(f.Z,{component:"div",children:"".concat(d("router.cert.issuedOn"),": ").concat((0,Z.pz)(n.validFrom,m))}),(0,U.jsx)(f.Z,{component:"div",children:"".concat(d("router.cert.expiryOn"),": ").concat((0,Z.pz)(n.validTo,m))})]})]})})})]})}function be(e){var n=e.domain,t=e.filters,r=(0,u.PE)().t,i=n.value,o=n.domainStatus;if(!(0,Z.rM)(i))return null;var a=null,l=null,c=o.isHttps,d=o.matchedCert;if(!(0,Z.ao)(i)){var m=o.dns,p=void 0===m?{}:m,f=p.resolved,v=p.ip;a=f||"127.0.0.1"===v?(0,U.jsx)(T.Z,{title:r("router.domain.verify.ok"),children:(0,U.jsx)(fe.Z,{color:"success"})}):(0,U.jsx)(T.Z,{title:r("router.domain.verify.notResolved"),children:(0,U.jsx)(fe.Z,{color:"error"})})}l=c?(0,U.jsx)(ye,{certificate:d}):(0,U.jsx)(T.Z,{title:r("router.domain.https.bad"),children:(0,U.jsx)(pe.Z,{style:{color:"#D0021B",fontSize:20,marginLeft:8,cursor:"pointer"}})});var h=t.map((function(e){return"domain"===e?a:"http"===e?l:null}));return s.createElement.apply(void 0,[s.Fragment,null].concat((0,me.Z)(h)))}ye.propTypes={certificate:k().object},ye.defaultProps={certificate:{}},be.propTypes={domain:ve.isRequired,filters:k().array},be.defaultProps={filters:["domain","http"]};var ke=(0,z.V)(Ee,"mutate_blocklets"),Ce=(0,z.V)(Ee,"",Z.Wf);function Pe(e){var n=(0,h.h6)().inService,t=(0,v.y0)(),r=t.blocklet,i=t.loadingRuntimeInfo,o=ke;return n&&(o=Ce),(0,U.jsx)(o,(0,y.Z)((0,y.Z)({},e),{},{blocklet:r,inService:n,loadingRuntimeInfo:i}))}function Ee(e){var n,t,r=e.hasPermission,a=e.blocklet,d=e.loadingRuntimeInfo,m=e.inService,f=(0,u.PE)().t,v=(0,s.useState)(!1),h=(0,i.Z)(v,2),x=h[0],g=h[1],y=(0,R.Z)(),b=(0,s.useMemo)((function(){var e=r;return(0,j.ep)(a)&&(e=e&&m),e}),[r,m,a]),k=a.site,z=(0,s.useMemo)((function(){var e;return(0,Z.oE)(null===(e=a.site)||void 0===e?void 0:e.domainAliases)}),[null===(n=a.site)||void 0===n?void 0:n.domainAliases]),L=[],q=[],F=(0,D.encode)(a.appPid),W=(0,Z.M6)(z);return z.forEach((function(e){var n=e.value||"";(0,S.isDidDomain)(n)&&!n.startsWith(F)?q.push(e):L.push(e)})),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(E.Z,{className:"title first",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,U.jsx)(E.Z,{children:f("common.domain")}),b&&(0,U.jsx)(ie,{id:k.id,title:f("router.domain.add.title"),teamDid:null===(t=a.meta)||void 0===t?void 0:t.did,systemDomains:null===W||void 0===W?void 0:W.map((function(e){return e.value})),children:function(e){var n=e.open;return(0,U.jsxs)(o.Z,{style:{marginLeft:16},variant:"contained",color:"primary","data-cy":"add-domain-alias",onClick:n,disabled:(0,p.isInProgress)(a.status),children:[(0,U.jsx)(C.Z,{style:{fontSize:"1.3em",marginRight:4}}),f("common.add")]})}})]}),"running"!==a.status&&(0,U.jsx)(E.Z,{mt:1.5,mb:1.5,children:(0,U.jsx)(P.Z,{severity:"warning",children:f("blocklet.router.noRunning")})}),(x?z:L).map((function(e,n){return(0,U.jsxs)(E.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:n?0:1,children:[(0,U.jsxs)(E.Z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[(0,U.jsx)(be,{domain:e,filters:["domain"]},"".concat(e.value,"-domain")),(0,U.jsx)(E.Z,{sx:{ml:2,mr:.5},children:(0,U.jsx)(we,{domain:e,target:"_blank",children:e.value})}),(0,U.jsx)(be,{domain:e,filters:["http"]},"".concat(e.value,"-http")),b&&(0,U.jsx)(X,{domain:e.value,domainStatus:e.domainStatus,did:a.meta.did,children:function(e){var n=e.open;return(0,U.jsx)(o.Z,{size:"small",onClick:function(e){return n(e)},children:f("router.cert.genLetsEncryptCert.title")})}})]}),b&&!e.isProtected?(0,U.jsx)(de,{site:k,domain:e,blocklet:a}):(0,U.jsx)(T.Z,{title:f("blocklet.router.domainLockTooltip"),placement:"top",children:(0,U.jsx)(w.Z,{disabled:!0,size:"large",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:(0,U.jsx)(A.Z,{style:{fill:y.palette.text.disabled}})})})]},e.value)})),q.length>0&&(0,U.jsx)("div",{style:{marginLeft:"20px",marginTop:"12px"},children:(0,U.jsx)(o.Z,{endIcon:x?(0,U.jsx)(l.Z,{}):(0,U.jsx)(c.Z,{}),onClick:function(){return g(!x)},children:f(x?"common.collapseAll":"blocklet.router.showAllDomains")})}),!z.length&&(d?(0,U.jsx)(_.Z,{size:16}):(0,U.jsx)(I.Z,{children:f("common.empty")}))]})}function we(e){var n=e.domain,t=e.children,r=(0,u.PE)().t,i=n.href,o=n.accessibility;return!o||o.loading?(0,U.jsxs)(Re,{children:[t,(0,U.jsx)(T.Z,{title:r("blocklet.router.checkUrlAccessible"),placement:"top-end",children:(0,U.jsx)("span",{className:"status",children:(0,U.jsx)(_.Z,{size:12})})})]}):o.accessible?(0,U.jsx)(Re,{children:(0,U.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:t})}):(0,U.jsx)(Re,{children:(0,U.jsx)(T.Z,{title:r("blocklet.router.urlInaccessible"),placement:"top-end",children:(0,U.jsx)("span",{children:t})})})}Ee.propTypes={hasPermission:k().bool,blocklet:k().object.isRequired,loadingRuntimeInfo:k().bool,inService:k().bool.isRequired},Ee.defaultProps={hasPermission:!1,loadingRuntimeInfo:!1},we.propTypes={domain:ve.isRequired,children:k().any.isRequired};var Te,Re=a.Z.span(ue||(ue=(0,r.Z)(["\n &,\n & > * {\n color: #222;\n font-size: 18px;\n }\n\n .status {\n margin-left: 8px;\n }\n"]))),De={arcblock:"ArcBlock",ethereum:"Ethereum"};function Se(){var e,n,t,r,a,f=(0,u.PE)(),y=f.t,b=f.locale,k=(0,h.h6)(),C=k.info,P=k.inService,E=(0,s.useState)(!1),w=(0,i.Z)(E,2),T=w[0],R=w[1],D=(0,v.y0)().blocklet,S=D.appDid,A=D.appPid,I=D.migratedFrom,_=void 0===I?[]:I,z=null===(e=D.environments.find((function(e){return"BLOCKLET_APP_CHAIN_TYPE"===e.key})))||void 0===e?void 0:e.value,L=[S?{name:y("blocklet.appId"),value:(0,U.jsx)(x.Z,{did:S})}:null,A?{name:y("blocklet.appPid"),value:(0,U.jsx)(x.Z,{did:A})}:null,(null===_||void 0===_?void 0:_.length)>1?{name:y("blocklet.alsoKnownAs"),value:(0,U.jsxs)("div",{children:[(T?_.slice(1):_.slice(1,2)).map((function(e){return(0,U.jsx)(x.Z,{did:e.appDid})})),_.length>2&&(0,U.jsx)(o.Z,{style:{marginLeft:"18px"},endIcon:T?(0,U.jsx)(l.Z,{}):(0,U.jsx)(c.Z,{}),onClick:function(){return R(!T)},children:y(T?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,{name:y("common.name"),value:(0,p.getDisplayName)(D,!0)},{name:y("common.status"),value:(0,U.jsx)(g.Z,{status:D.status,source:D.source})},(0,j.ep)(D)?{name:"NFT",value:(0,U.jsx)(x.Z,{external:!0,href:(0,Z.E8)(null===D||void 0===D||null===(n=D.controller)||void 0===n?void 0:n.chainHost,null===D||void 0===D||null===(t=D.controller)||void 0===t?void 0:t.nftId,"asset"),did:null===D||void 0===D||null===(r=D.controller)||void 0===r?void 0:r.nftId})}:null,{name:y("blocklet.installedAt"),value:(0,Z.B2)(D.installedAt,b)},{name:y("blocklet.overview.accessControl"),value:y("team.whoCanAccess.".concat((0,p.getWhoCanAccess)(D),".title"))},{name:y("common.owner"),value:null!==(a=D.settings)&&void 0!==a&&a.owner?(0,U.jsx)(x.Z,{did:D.settings.owner.did}):"--"},{name:y("blocklet.config.walletType.name"),value:De[z||"arcblock"]||z},D.externalSkSource?{name:y("blocklet.skSource"),value:D.externalSkSource}:null].filter(Boolean);P&&L.push({name:y("common.serverDid"),value:(0,U.jsx)(x.Z,{did:C.did})},{name:y("common.serverVersion"),value:(0,U.jsx)(m.Z,{children:C.version})});var q;return(0,U.jsxs)(Ae,{component:"div",children:[(0,U.jsx)(Pe,{}),(0,U.jsx)("div",{className:"title",children:(0,U.jsx)("span",{children:y("common.basicInfo")})}),(0,U.jsx)("div",{className:"basicInfo",children:(q=L,q.map((function(e){return(0,U.jsx)(d.Z,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:function(){return e.name},children:e.value},e.name)})))})]})}Se.propTypes={};var Ae=(0,a.Z)(f.Z)(Te||(Te=(0,r.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n\n &.first {\n margin-top: 0;\n }\n }\n"])),(function(e){return e.theme.spacing(5)}),(function(e){return e.theme.spacing(3)}))},51233:function(e,n,t){"use strict";t.d(n,{Rw:function(){return d},fX:function(){return c},sf:function(){return u},ub:function(){return l}});var r=t(35432),i=t(44543),o=t.n(i),a=t(76811),s=function(e,n){if(e.type===r.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error("".concat(n("router.validation.redirectUrlRequired")));if(!e.redirectCode)return new Error("redirect ".concat(n("router.validation.redirectCodeRequired")))}else if(e.type===r.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(n("router.validation.didRequired"));return null},l=function(e,n){return e?e.endsWith(r.DEFAULT_IP_DOMAIN_SUFFIX)?n("router.domain.validate.suffixTip",{suffix:r.DEFAULT_IP_DOMAIN_SUFFIX}):null:n("router.domain.validate.emptyTip")},c=function(e,n){var t=s(e,n);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(n("router.validation.pathPrefixTooLong",{length:150})):null:new Error(n("router.validation.pathPrefixCannotBeEmpty")))},d=function(e){var n=e.params,t=e.blocklets,r=e.blocklet,i=e.locale,s=void 0===i?"en":i;if(r){var l=(r.children||[]).find((function(e){return o()(e.mountPoint,n.pathPrefix)}));if("gateway"!==r.meta.group&&"/"===n.pathPrefix&&(l="/"),l)return{zh:"\u6302\u8f7d\u70b9 ".concat(n.pathPrefix," \u5df2\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u5176\u4ed6\u6302\u8f7d\u70b9"),en:"The mount point ".concat(n.pathPrefix," already exist, please use another mount point")}[s]}var c=t.find((function(e){return e.meta.did===n.did}));if(!c)return"";var d=c.meta.interfaces.find((function(e){return"web"===e.type}));return d&&d.prefix!==a.BLOCKLET_DYNAMIC_PATH_PREFIX&&n.pathPrefix!==d.prefix?{zh:"\u8be5 blocklet \u53ea\u80fd\u6302\u8f7d\u5728 ".concat(d.prefix),en:"This blocklet can only be mounted on ".concat(d.prefix)}[s]:""},u=function(e){if(!e||"string"!==typeof e)return e;var n=e.trim();try{return(n=n.toLowerCase()).startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n}catch(t){return console.error("format domain failed",t),n}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6931],{78123:function(e,n,t){t.d(n,{Z:function(){return Y}});var r,o=t(33028),i=t(33665),a=t(71171),c=t(32723),l=t(34795),s=t(96234),u=t(59740),d=t(5057),m=t(55898),p=t.n(m),f=t(33518),v=t(85493),b=t(15849),g=t(67654),k=t(67680),Z=t(61533),h=t(29034),x=t(80633),y=t(44846),w=t(74490),C=t(83294),j=t(46954),R=t(44067),D=t(11750),S=t(65140),E=t(87916),B=t(26174),P=t(93938),U=t(28726),T=t(38242),L=t(68420),O=t(76811),A=t(35432),N=t(86229),_=t(14491),M=t(4651),z=t(58238),I=t(70461),q=t(55419),K=t(29054),X=t(96266),F=["blocklet","onStart","onComplete","variant","hasPermission","useBlockletUrlEvaluation"];function G(e){var n,t,r,i,a=e.blocklet,m=e.onStart,p=e.onComplete,f=e.variant,G=e.hasPermission,W=e.useBlockletUrlEvaluation,Q=(0,u.Z)(e,F),Y=(0,v.useNavigate)(),H=(0,z.h6)(),J=(0,d.useState)(null),$=(0,s.Z)(J,2),ee=$[0],ne=$[1],te=(0,d.useState)(null),re=(0,s.Z)(te,2),oe=re[0],ie=re[1],ae=(0,d.useState)(!1),ce=(0,s.Z)(ae,2),le=ce[0],se=ce[1],ue=(0,d.useState)(null),de=(0,s.Z)(ue,2),me=de[0],pe=de[1],fe=(0,d.useContext)(L.RD).t,ve=(0,g.Z)("skip-blocklet-setup",!1),be=(0,s.Z)(ve,1)[0],ge=W(a),ke=ge.loading,Ze=ge.recommendedUrl,he=(0,K.y0)().nftState,xe=(0,T.isInProgress)(a.status),ye=(null===a||void 0===a||null===(n=a.controller)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.value)===O.BLOCKLET_CONTROLLER_STATUS.suspended;null!==he&&void 0!==he&&he.expired||(null===a||void 0===a||null===(r=a.controller)||void 0===r||null===(i=r.status)||void 0===i?void 0:i.reason)!==O.SUSPENDED_REASON.expired||(ye=!1);var we=H.inService,Ce=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,l.Z)((0,c.Z)().mark((function r(){var i,s,u,d,f;return(0,c.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=function(){var t=(0,l.Z)((0,c.Z)().mark((function t(r){var o,i,l,s,u,d,f,v,b,g;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m({action:e,blocklet:a}),se(!0),ie(e),pe(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,T.hasRunnableComponent)(a)){t.next=15;break}return N.Z.error(fe("blocklet.noComponent")),t.abrupt("return");case 15:if(we||be||null!==(i=a.settings)&&void 0!==i&&i.initialized||a.mode===O.BLOCKLET_MODES.DEVELOPMENT){t.next=22;break}return l=(0,M.RU)(H.info),(s=new URL(Ze)).searchParams.set("serverUrl",l),window.open(s.href),p({action:e,blocklet:a}),t.abrupt("return");case 22:return u=a.children.filter((function(e){return!(0,T.isInProgress)(e.status)&&"running"!==e.status})).map((function(e){return e.meta.did})),d={did:a.meta.did,componentDids:u},t.next=26,n({input:d});case 26:t.next=38;break;case 28:if(!["stop","restart","reload"].includes(e)){t.next=35;break}return f=a.children.filter((function(e){return"running"===e.status})).map((function(e){return e.meta.did})),v={did:a.meta.did,componentDids:f},t.next=33,n({input:v});case 33:t.next=38;break;case 35:return b={did:a.meta.did},t.next=38,n({input:b});case 38:if("remove"!==e){t.next=42;break}o=!0,t.next=44;break;case 42:return t.next=44,(0,_._v)(1e3);case 44:"reload"===e&&N.Z.success(fe("blocklet.reloadSuccess")),p({action:e,blocklet:a}),t.next=52;break;case 48:t.prev=48,t.t0=t.catch(5),g="Blocklet ".concat(e," failed: ").concat((0,_.Z)(t.t0)),p({action:e,blocklet:a,error:new Error(g)});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)}}(),s=function(){se(!1),pe(null)},u=(0,T.getDisplayName)(a,!0),d=a.mode===O.BLOCKLET_MODES.DEVELOPMENT?{description:function(){return(0,X.jsx)(D.Z,{component:"div",children:(0,X.jsx)(D.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")})})},params:{removeType:"complete"}}:{description:function(e,n){return(0,X.jsxs)(D.Z,{component:"div",children:[(0,X.jsx)(D.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")}),(0,X.jsxs)(E.Z,{name:"removeType",value:e.removeType,onChange:function(t){return n((0,o.Z)((0,o.Z)({},e),{},{removeType:t.target.value}))},children:[(0,X.jsx)(B.Z,{value:"backup",control:(0,X.jsx)(S.Z,{}),label:fe("blocklet.action.removeApplicationAfterBackup")}),(0,X.jsx)(B.Z,{value:"complete",control:(0,X.jsx)(S.Z,{}),label:fe("blocklet.action.removeApplicationComplete")})]})]})},params:{removeType:"backup"}},f={stop:{title:"".concat(fe("common.stop")," ").concat(u),description:fe("blocklet.action.stopDescription"),confirm:fe("blocklet.action.confirmStop"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s},restart:{title:"".concat(fe("common.restart")," ").concat(u),description:fe("blocklet.action.restartDescription"),confirm:fe("blocklet.action.confirmRestart"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s},remove:(0,o.Z)({title:"".concat(fe("common.remove")," ").concat(u),confirm:fe("blocklet.action.confirmRemove"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s},d),cancelDownload:{title:"".concat(fe("common.cancel")),description:fe("blocklet.action.cancelDownloadDescription",{name:u}),confirm:fe("common.confirm"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s}},!t){r.next=9;break}pe(f[e]),r.next=11;break;case 9:return r.next=11,i();case 11:case"end":return r.stop()}}),r)})))},je=Boolean(ee),Re=function(){var e=(0,l.Z)((0,c.Z)().mark((function e(n,t){return(0,c.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=!we&&(0,T.isDeletableBlocklet)(a)&&a.structVersion===A.APP_STRUCT_VERSION?{action:"remove",icon:q.Z.Remove,name:fe("common.remove"),handler:Ce("remove",function(){var e=(0,l.Z)((0,c.Z)().mark((function e(n){return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("backup"!==n.removeType){e.next=4;break}return e.next=4,H.api.backupBlocklet({input:{appDid:a.appDid,to:"disk"}});case 4:return e.next=6,H.api.deleteBlocklet({input:{did:a.meta.did,keepData:!1}});case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),!0),disabled:xe}:null,Se={action:"remove",icon:q.Z.Remove,name:fe("common.cancel"),handler:Ce("cancelDownload",H.api.cancelDownloadBlocklet,!0)},Ee=(0,T.getAppMissingConfigs)(a),Be=[{action:"start",icon:q.Z.Start,name:fe("common.start"),handler:Ce("start",H.api.startBlocklet),disabled:ye||a.children.every((function(e){return"running"===e.status}))||(0,_.XN)(a.status)||ke||xe},{action:"stop",icon:q.Z.Stop,name:fe("common.stop"),handler:Ce("stop",H.api.stopBlocklet,!0),disabled:!["running","starting"].includes(a.status)},{action:"restart",icon:q.Z.Restart,name:fe("common.restart"),handler:Ce("restart",H.api.restartBlocklet,!0),disabled:ye||"running"!==a.status},{action:"reload",icon:q.Z.Reload,name:fe("common.reload"),handler:Ce("reload",H.api.reloadBlocklet),disabled:ye||"running"!==a.status},(0,_.XN)(a.status)?Se:De,{separator:!0},{onlyInMenu:!0,action:"config",icon:q.Z.Config,name:fe("common.config"),handler:function(){Y("/blocklets/".concat(a.meta.did,"/configuration"))},disabled:(0,_.XN)(a.status)},{onlyInMenu:!0,action:"team",icon:q.Z.Group,name:fe("common.manageTeam"),handler:function(){Y("/blocklets/".concat(a.meta.did,"/members"))},disabled:(0,_.XN)(a.status)},{onlyInMenu:!0,action:"log",icon:q.Z.Log,name:fe("common.log"),handler:function(){Y("/logs/blocklet-".concat(a.meta.did))},disabled:(0,_.XN)(a.status)}].filter(Boolean);return"menu"===f?(0,X.jsxs)(V,{"data-cy":"blocklet-actions",children:[(0,X.jsx)(k.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":a.meta.did,onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(e.currentTarget)},size:"small",disabled:!G||!(0,_.XN)(a.status)&&le,children:(0,X.jsx)(C.Z,{})}),(0,X.jsxs)(Z.Z,{id:"actions-menu",anchorEl:ee,keepMounted:!0,open:je,onClose:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(null)},PaperProps:{},children:[Ee.length>0&&(0,X.jsxs)(P.Z,{style:{maxWidth:"400px"},severity:"error",children:[fe("blocklet.config.missingRequired"),(0,X.jsx)("br",{}),(0,X.jsx)(b.Link,{to:"/blocklets/".concat(a.meta.did,"/components"),children:fe("blocklet.config.gotoFix")})]}),Be.map((function(e,n){return e.separator?(0,X.jsx)(h.Z,{},"separator-".concat(n)):(0,X.jsxs)(w.Z,{dense:!0,onClick:function(n){return Re(e,n)},disabled:e.disabled,"data-cy":"".concat(e.action,"-blocklet"),children:[(0,X.jsx)(j.Z,{style:{minWidth:24},children:(0,X.jsx)(e.icon,{fontSize:"small"})}),(0,X.jsx)(R.Z,{primary:e.name})]},e.name)}))]}),me&&(0,X.jsx)(I.Z,{title:me.title,description:me.description,confirm:me.confirm,cancel:me.cancel,params:me.params,onConfirm:me.onConfirm,onCancel:me.onCancel})]}):(0,X.jsxs)(V,(0,o.Z)((0,o.Z)({"data-cy":"blocklet-actions"},Q),{},{children:[(0,X.jsx)(x.Z,{children:Be.filter((function(e){return!e.separator&&!e.onlyInMenu})).map((function(e){return(0,X.jsxs)(U.Z,{title:e.name,"data-cy":"".concat(e.action,"-blocklet"),onClick:function(){return Re(e)},disabled:Boolean(e.disabled)||le,children:[oe===e.action&&le&&xe?(0,X.jsx)(y.Z,{size:16}):(0,X.jsx)(e.icon,{}),(0,X.jsx)("span",{className:"blocklet-action-text",children:e.name})]},e.name)}))}),me&&(0,X.jsx)(I.Z,{title:me.title,description:me.description,confirm:me.confirm,cancel:me.cancel,params:me.params,onConfirm:me.onConfirm,onCancel:me.onCancel})]}))}G.propTypes={blocklet:p().object.isRequired,onStart:p().func.isRequired,onComplete:p().func.isRequired,variant:p().oneOf(["menu","group"]),hasPermission:p().bool,useBlockletUrlEvaluation:p().func},G.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 V=f.default.div(r||(r=(0,a.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})),W=t(7199),Q=t(24138);function Y(e){var n=Object.assign({},((0,i.Z)(e),e)),t=(0,W.V)(G,"mutate_blocklets");return(0,X.jsx)(t,(0,o.Z)((0,o.Z)({},n),{},{useBlockletUrlEvaluation:Q.BZ}))}},24138:function(e,n,t){t.d(n,{BZ:function(){return y},ZN:function(){return w}});var r=t(56666),o=t(33028),i=t(32723),a=t(34795),c=t(96234),l=t(5057),s=t(6352),u=t.n(s),d=t(35432),m=t(49714),p=t(41365),f=t.n(p),v=t(32243),b=t.n(v),g=t(68420),k=t(14491),Z=b()((function(e){return f()(u()(new URL(e).origin,d.WELLKNOWN_PING_PREFIX))})),h={};function x(e){var n=e.urls,t=e.checkAccessible,r=void 0===t?f():t,o=e.disableCache,s=void 0!==o&&o,u=(0,l.useRef)(n.filter((function(e){return h[e]})).map((function(e){return h[e]}))),d=u.current.length===n.length,p=(0,l.useState)(d?u.current:[]),v=(0,c.Z)(p,2),b=v[0],g=v[1],k=(0,l.useState)(!d),Z=(0,c.Z)(k,2),x=Z[0],y=Z[1],w=(0,l.useMemo)((function(){return!x&&b.length?b[0]:null}),[b,x]);return(0,l.useEffect)((function(){if((null===n||void 0===n?void 0:n.length)>0&&!d){var e=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y(!0),!s){e.next=8;break}return e.next=4,(0,m.evaluateURLs)(n,{checkAccessible:r});case 4:(t=e.sent).forEach((function(e){h[e.url]=e})),e.next=13;break;case 8:return e.next=10,(0,m.evaluateURLs)(n.filter((function(e){return!h[e]})),{checkAccessible:r});case 10:e.sent.forEach((function(e){h[e.url]=e})),t=n.map((function(e){return h[e]})).sort((function(e,n){return n.score-e.score}));case 13:g(t),y(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[n,s,d]),{urlsState:b,loading:x,recommendedUrlState:w,recommendedUrl:null===w||void 0===w?void 0:w.url}}function y(e){var n=(0,l.useContext)(g.RD).locale,t=(0,l.useMemo)((function(){return e?(0,k.A6)({blocklet:e,params:(0,k.f0)(e,n)}):[]}),[e,n]),r=x({urls:t,checkAccessible:Z});return{urls:t,loading:r.loading,recommendedUrlState:r.recommendedUrlState,recommendedUrl:r.recommendedUrl}}function w(e){var n,t=x({urls:(0,l.useMemo)((function(){return e.map((function(e){return(0,k.Sk)(e)}))}),[e]),checkAccessible:Z}),i=t.urlsState,a=t.loading,c=t.recommendedUrl;if(a)n={domainsAccessibility:e.reduce((function(e,n){return(0,o.Z)((0,o.Z)({},e),{},(0,r.Z)({},n,{loading:!0}))}),{}),recommendedDomain:null};else{var s,u=i.reduce((function(e,n){var t=new URL(n.url).hostname;return e[t]=(0,o.Z)((0,o.Z)({},n),{},{domain:t}),e}),{}),d=(null===(s=i.find((function(e){return e.accessible})))||void 0===s?void 0:s.url)||c;n={domainsAccessibility:u,recommendedDomain:d?new URL(d).hostname:null}}return n}},1722:function(e,n,t){t.d(n,{Z:function(){return p}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),c=t(62681),l=t(72333),s=t(76811),u=t(49522),d=t(96266),m=["blocklet","style","size"];function p(e){var n,t=e.blocklet,i=e.style,a=e.size,p=(0,o.Z)(e,m),f=(0,u.Z)({blocklet:t}).logoUrl,v=p.variant,b=(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)||(b=(0,d.jsx)(l.Z,{did:t.meta.did||"",responsive:!0})));return(0,d.jsx)(c.Z,(0,r.Z)((0,r.Z)({variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,borderRadius:10},i)},p),{},{children:b}))}p.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string])},p.defaultProps={style:{},size:40}},55419:function(e,n,t){var r=t(27773),o=t(22754),i=t(98451),a=t(32207),c=t(35258),l=t(17545),s=t(49647),u=t(70648);n.Z={Start:o.Z,Stop:i.Z,Restart:a.default,Reload:c.Z,Remove:r.default,Config:l.Z,Log:s.Z,Group:u.Z}},81010:function(e,n,t){t.d(n,{Z:function(){return g}});var r=t(33028),o=t(59740),i=t(5057),a=t(55898),c=t.n(a),l=t(44846),s=t(75239),u=t(68420),d=t(38242),m=t(69569),p=t(22228),f=t(96266),v=["status","variant","source"],b={yellow:"#FFCF71",grey:"#888888"};function g(e){var n=e.status,t=e.variant,a=(e.source,(0,o.Z)(e,v)),c=(0,i.useContext)(u.RD).t,g={added:b.grey,waiting:b.yellow,downloading:b.yellow,downloaded:b.grey,installing:b.yellow,installed:b.grey,starting:b.yellow,running:"success",stopping:b.yellow,stopped:b.grey,error:"error",upgrading:b.yellow,restarting:b.yellow,corrupted:"error",deleting:b.yellow},k=(0,d.isInProgress)(n),Z=c("blocklet.status.".concat(n));return"dot"===t?(0,f.jsx)(s.Z,{title:c("blocklet.statusTip",{status:Z}),children:(0,f.jsx)(m.Z,(0,r.Z)({color:g[n]},a))}):(0,f.jsxs)(p.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:[k&&(0,f.jsx)(l.Z,{size:12,color:"inherit",style:{marginRight:5}}),Z]}))}g.propTypes={status:c().string.isRequired,variant:c().oneOf(["dot","tag"]),source:c().string},g.defaultProps={variant:"tag",source:""}},29054:function(e,n,t){t.d(n,{Tw:function(){return o},y0:function(){return i}});var r=t(5057),o=(0,r.createContext)({});o.Provider,o.Consumer;function i(){return(0,r.useContext)(o)}},87363:function(e,n,t){t.d(n,{K:function(){return p},g:function(){return m}});var r=t(68079),o=t(96234),i=t(5057),a=t(55898),c=t.n(a),l=t(69163),s=t.n(l),u=t(96266),d=(0,i.createContext)({});function m(e){var n=e.children,t=e.type,a=(0,i.useState)([]),c=(0,o.Z)(a,2),l=c[0],m=c[1],p=(0,i.useRef)([]),f=function(e){if(p.current.includes(e)){var n=p.current.filter((function(n){return n!==e}));m(n),p.current=n}};return(0,u.jsx)(d.Provider,{value:{type:t,deletingBlocklets:l,addDeletingDid:function(e){if(!p.current.includes(e)){var n=[].concat((0,r.Z)(p.current),[e]);m(n),p.current=n}},removeDeletingDid:f,matchDeletingDid:function(e){var n=l.filter((function(n){return e.find((function(e){return e===n}))}));s()(n,l).forEach((function(e){return f(e)}))}},children:n})}function p(){return(0,i.useContext)(d)}m.propTypes={type:c().string,children:c().node.isRequired},m.defaultProps={type:"blocklets"}},69569:function(e,n,t){var r,o=t(71171),i=t(33518),a={success:"#3ab39d",error:"#D0021B"},c="10px",l=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||c}),(function(e){return e.size||c}),(function(e){return a[e.color]||e.color||a.success}));n.Z=l},49522:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(6352),o=t.n(r),i=t(58238),a=t(14491);function c(e){var n,t,r=e.blocklet,c=(0,i.h6)().inService,l=(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()(l,"/blocklet/logo/".concat(c?"":r.meta.did),s)}}},22228:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),c=t(19778),l=t(96266),s=["children","style"];function u(e){var n=e.children,t=e.style,i=(0,o.Z)(e,s);return(0,l.jsx)(c.Z,(0,r.Z)((0,r.Z)({style:t},i),{},{children:n}))}u.propTypes={children:a().any.isRequired,style:a().object},u.defaultProps={style:{}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6931],{78123:function(e,n,t){t.d(n,{Z:function(){return Y}});var r,o=t(33028),i=t(33665),a=t(71171),c=t(32723),l=t(34795),s=t(96234),u=t(59740),d=t(5057),m=t(55898),p=t.n(m),f=t(33518),v=t(85493),b=t(15849),g=t(67654),k=t(67680),Z=t(61533),h=t(29034),x=t(80633),y=t(44846),w=t(74490),C=t(83294),j=t(46954),R=t(44067),D=t(11750),S=t(65140),E=t(87916),B=t(26174),P=t(93938),U=t(28726),T=t(38242),L=t(68420),O=t(76811),A=t(35432),N=t(86229),_=t(14491),M=t(4651),z=t(58238),I=t(70461),q=t(55419),K=t(29054),X=t(96266),F=["blocklet","onStart","onComplete","variant","hasPermission","useBlockletUrlEvaluation"];function G(e){var n,t,r,i,a=e.blocklet,m=e.onStart,p=e.onComplete,f=e.variant,G=e.hasPermission,W=e.useBlockletUrlEvaluation,Q=(0,u.Z)(e,F),Y=(0,v.useNavigate)(),H=(0,z.h6)(),J=(0,d.useState)(null),$=(0,s.Z)(J,2),ee=$[0],ne=$[1],te=(0,d.useState)(null),re=(0,s.Z)(te,2),oe=re[0],ie=re[1],ae=(0,d.useState)(!1),ce=(0,s.Z)(ae,2),le=ce[0],se=ce[1],ue=(0,d.useState)(null),de=(0,s.Z)(ue,2),me=de[0],pe=de[1],fe=(0,d.useContext)(L.RD).t,ve=(0,g.Z)("skip-blocklet-setup",!1),be=(0,s.Z)(ve,1)[0],ge=W(a),ke=ge.loading,Ze=ge.recommendedUrl,he=(0,K.y0)().nftState,xe=(0,T.isInProgress)(a.status),ye=(null===a||void 0===a||null===(n=a.controller)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.value)===O.BLOCKLET_CONTROLLER_STATUS.suspended;null!==he&&void 0!==he&&he.expired||(null===a||void 0===a||null===(r=a.controller)||void 0===r||null===(i=r.status)||void 0===i?void 0:i.reason)!==O.SUSPENDED_REASON.expired||(ye=!1);var we=H.inService,Ce=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,l.Z)((0,c.Z)().mark((function r(){var i,s,u,d,f;return(0,c.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=function(){var t=(0,l.Z)((0,c.Z)().mark((function t(r){var o,i,l,s,u,d,f,v,b,g;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m({action:e,blocklet:a}),se(!0),ie(e),pe(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,T.hasRunnableComponent)(a)){t.next=15;break}return N.Z.error(fe("blocklet.noComponent")),t.abrupt("return");case 15:if(we||be||null!==(i=a.settings)&&void 0!==i&&i.initialized||a.mode===O.BLOCKLET_MODES.DEVELOPMENT){t.next=22;break}return l=(0,M.RU)(H.info),(s=new URL(Ze)).searchParams.set("serverUrl",l),window.open(s.href),p({action:e,blocklet:a}),t.abrupt("return");case 22:return u=a.children.filter((function(e){return!(0,T.isInProgress)(e.status)&&"running"!==e.status})).map((function(e){return e.meta.did})),d={did:a.meta.did,componentDids:u},t.next=26,n({input:d});case 26:t.next=38;break;case 28:if(!["stop","restart","reload"].includes(e)){t.next=35;break}return f=a.children.filter((function(e){return"running"===e.status})).map((function(e){return e.meta.did})),v={did:a.meta.did,componentDids:f},t.next=33,n({input:v});case 33:t.next=38;break;case 35:return b={did:a.meta.did},t.next=38,n({input:b});case 38:if("remove"!==e){t.next=42;break}o=!0,t.next=44;break;case 42:return t.next=44,(0,_._v)(1e3);case 44:"reload"===e&&N.Z.success(fe("blocklet.reloadSuccess")),p({action:e,blocklet:a}),t.next=52;break;case 48:t.prev=48,t.t0=t.catch(5),g="Blocklet ".concat(e," failed: ").concat((0,_.Z)(t.t0)),p({action:e,blocklet:a,error:new Error(g)});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)}}(),s=function(){se(!1),pe(null)},u=(0,T.getDisplayName)(a,!0),d=a.mode===O.BLOCKLET_MODES.DEVELOPMENT?{description:function(){return(0,X.jsx)(D.Z,{component:"div",children:(0,X.jsx)(D.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")})})},params:{removeType:"complete"}}:{description:function(e,n){return(0,X.jsxs)(D.Z,{component:"div",children:[(0,X.jsx)(D.Z,{gutterBottom:!0,children:fe("blocklet.action.removeApplicationDescription")}),(0,X.jsxs)(E.Z,{name:"removeType",value:e.removeType,onChange:function(t){return n((0,o.Z)((0,o.Z)({},e),{},{removeType:t.target.value}))},children:[(0,X.jsx)(B.Z,{value:"backup",control:(0,X.jsx)(S.Z,{}),label:fe("blocklet.action.removeApplicationAfterBackup")}),(0,X.jsx)(B.Z,{value:"complete",control:(0,X.jsx)(S.Z,{}),label:fe("blocklet.action.removeApplicationComplete")})]})]})},params:{removeType:"backup"}},f={stop:{title:"".concat(fe("common.stop")," ").concat(u),description:fe("blocklet.action.stopDescription"),confirm:fe("blocklet.action.confirmStop"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s},restart:{title:"".concat(fe("common.restart")," ").concat(u),description:fe("blocklet.action.restartDescription"),confirm:fe("blocklet.action.confirmRestart"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s},remove:(0,o.Z)({title:"".concat(fe("common.remove")," ").concat(u),confirm:fe("blocklet.action.confirmRemove"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s},d),cancelDownload:{title:"".concat(fe("common.cancel")),description:fe("blocklet.action.cancelDownloadDescription",{name:u}),confirm:fe("common.confirm"),cancel:fe("common.cancel"),onConfirm:i,onCancel:s}},!t){r.next=9;break}pe(f[e]),r.next=11;break;case 9:return r.next=11,i();case 11:case"end":return r.stop()}}),r)})))},je=Boolean(ee),Re=function(){var e=(0,l.Z)((0,c.Z)().mark((function e(n,t){return(0,c.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=!we&&(0,T.isDeletableBlocklet)(a)&&a.structVersion===A.APP_STRUCT_VERSION?{action:"remove",icon:q.Z.Remove,name:fe("common.remove"),handler:Ce("remove",function(){var e=(0,l.Z)((0,c.Z)().mark((function e(n){return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("backup"!==n.removeType){e.next=4;break}return e.next=4,H.api.backupBlocklet({input:{appDid:a.appDid,to:"disk"}});case 4:return e.next=6,H.api.deleteBlocklet({input:{did:a.meta.did,keepData:!1}});case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),!0),disabled:xe}:null,Se={action:"remove",icon:q.Z.Remove,name:fe("common.cancel"),handler:Ce("cancelDownload",H.api.cancelDownloadBlocklet,!0)},Ee=(0,T.getAppMissingConfigs)(a),Be=[{action:"start",icon:q.Z.Start,name:fe("common.start"),handler:Ce("start",H.api.startBlocklet),disabled:ye||a.children.every((function(e){return"running"===e.status}))||(0,_.XN)(a.status)||ke||xe},{action:"stop",icon:q.Z.Stop,name:fe("common.stop"),handler:Ce("stop",H.api.stopBlocklet,!0),disabled:!["running","starting"].includes(a.status)},{action:"restart",icon:q.Z.Restart,name:fe("common.restart"),handler:Ce("restart",H.api.restartBlocklet,!0),disabled:ye||"running"!==a.status},{action:"reload",icon:q.Z.Reload,name:fe("common.reload"),handler:Ce("reload",H.api.reloadBlocklet),disabled:ye||"running"!==a.status},(0,_.XN)(a.status)?Se:De,{separator:!0},{onlyInMenu:!0,action:"config",icon:q.Z.Config,name:fe("common.config"),handler:function(){Y("/blocklets/".concat(a.meta.did,"/configuration"))},disabled:(0,_.XN)(a.status)},{onlyInMenu:!0,action:"team",icon:q.Z.Group,name:fe("common.manageTeam"),handler:function(){Y("/blocklets/".concat(a.meta.did,"/members"))},disabled:(0,_.XN)(a.status)},{onlyInMenu:!0,action:"log",icon:q.Z.Log,name:fe("common.log"),handler:function(){Y("/logs/blocklet-".concat(a.meta.did))},disabled:(0,_.XN)(a.status)}].filter(Boolean);return"menu"===f?(0,X.jsxs)(V,{"data-cy":"blocklet-actions",children:[(0,X.jsx)(k.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":a.meta.did,onClick:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(e.currentTarget)},size:"small",disabled:!G||!(0,_.XN)(a.status)&&le,children:(0,X.jsx)(C.Z,{})}),(0,X.jsxs)(Z.Z,{id:"actions-menu",anchorEl:ee,keepMounted:!0,open:je,onClose:function(e){try{e.stopPropagation(),e.preventDefault()}catch(n){}ne(null)},PaperProps:{},children:[Ee.length>0&&(0,X.jsxs)(P.Z,{style:{maxWidth:"400px"},severity:"error",children:[fe("blocklet.config.missingRequired"),(0,X.jsx)("br",{}),(0,X.jsx)(b.Link,{to:"/blocklets/".concat(a.meta.did,"/components"),children:fe("blocklet.config.gotoFix")})]}),Be.map((function(e,n){return e.separator?(0,X.jsx)(h.Z,{},"separator-".concat(n)):(0,X.jsxs)(w.Z,{dense:!0,onClick:function(n){return Re(e,n)},disabled:e.disabled,"data-cy":"".concat(e.action,"-blocklet"),children:[(0,X.jsx)(j.Z,{style:{minWidth:24},children:(0,X.jsx)(e.icon,{fontSize:"small"})}),(0,X.jsx)(R.Z,{primary:e.name})]},e.name)}))]}),me&&(0,X.jsx)(I.Z,{title:me.title,description:me.description,confirm:me.confirm,cancel:me.cancel,params:me.params,onConfirm:me.onConfirm,onCancel:me.onCancel})]}):(0,X.jsxs)(V,(0,o.Z)((0,o.Z)({"data-cy":"blocklet-actions"},Q),{},{children:[(0,X.jsx)(x.Z,{children:Be.filter((function(e){return!e.separator&&!e.onlyInMenu})).map((function(e){return(0,X.jsxs)(U.Z,{title:e.name,"data-cy":"".concat(e.action,"-blocklet"),onClick:function(){return Re(e)},disabled:Boolean(e.disabled)||le,children:[oe===e.action&&le&&xe?(0,X.jsx)(y.Z,{size:16}):(0,X.jsx)(e.icon,{}),(0,X.jsx)("span",{className:"blocklet-action-text",children:e.name})]},e.name)}))}),me&&(0,X.jsx)(I.Z,{title:me.title,description:me.description,confirm:me.confirm,cancel:me.cancel,params:me.params,onConfirm:me.onConfirm,onCancel:me.onCancel})]}))}G.propTypes={blocklet:p().object.isRequired,onStart:p().func.isRequired,onComplete:p().func.isRequired,variant:p().oneOf(["menu","group"]),hasPermission:p().bool,useBlockletUrlEvaluation:p().func},G.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 V=f.Z.div(r||(r=(0,a.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})),W=t(7199),Q=t(24138);function Y(e){var n=Object.assign({},((0,i.Z)(e),e)),t=(0,W.V)(G,"mutate_blocklets");return(0,X.jsx)(t,(0,o.Z)((0,o.Z)({},n),{},{useBlockletUrlEvaluation:Q.BZ}))}},24138:function(e,n,t){t.d(n,{BZ:function(){return y},ZN:function(){return w}});var r=t(56666),o=t(33028),i=t(32723),a=t(34795),c=t(96234),l=t(5057),s=t(6352),u=t.n(s),d=t(35432),m=t(49714),p=t(41365),f=t.n(p),v=t(32243),b=t.n(v),g=t(68420),k=t(14491),Z=b()((function(e){return f()(u()(new URL(e).origin,d.WELLKNOWN_PING_PREFIX))})),h={};function x(e){var n=e.urls,t=e.checkAccessible,r=void 0===t?f():t,o=e.disableCache,s=void 0!==o&&o,u=(0,l.useRef)(n.filter((function(e){return h[e]})).map((function(e){return h[e]}))),d=u.current.length===n.length,p=(0,l.useState)(d?u.current:[]),v=(0,c.Z)(p,2),b=v[0],g=v[1],k=(0,l.useState)(!d),Z=(0,c.Z)(k,2),x=Z[0],y=Z[1],w=(0,l.useMemo)((function(){return!x&&b.length?b[0]:null}),[b,x]);return(0,l.useEffect)((function(){if((null===n||void 0===n?void 0:n.length)>0&&!d){var e=function(){var e=(0,a.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y(!0),!s){e.next=8;break}return e.next=4,(0,m.evaluateURLs)(n,{checkAccessible:r});case 4:(t=e.sent).forEach((function(e){h[e.url]=e})),e.next=13;break;case 8:return e.next=10,(0,m.evaluateURLs)(n.filter((function(e){return!h[e]})),{checkAccessible:r});case 10:e.sent.forEach((function(e){h[e.url]=e})),t=n.map((function(e){return h[e]})).sort((function(e,n){return n.score-e.score}));case 13:g(t),y(!1);case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[n,s,d]),{urlsState:b,loading:x,recommendedUrlState:w,recommendedUrl:null===w||void 0===w?void 0:w.url}}function y(e){var n=(0,l.useContext)(g.RD).locale,t=(0,l.useMemo)((function(){return e?(0,k.A6)({blocklet:e,params:(0,k.f0)(e,n)}):[]}),[e,n]),r=x({urls:t,checkAccessible:Z});return{urls:t,loading:r.loading,recommendedUrlState:r.recommendedUrlState,recommendedUrl:r.recommendedUrl}}function w(e){var n,t=x({urls:(0,l.useMemo)((function(){return e.map((function(e){return(0,k.Sk)(e)}))}),[e]),checkAccessible:Z}),i=t.urlsState,a=t.loading,c=t.recommendedUrl;if(a)n={domainsAccessibility:e.reduce((function(e,n){return(0,o.Z)((0,o.Z)({},e),{},(0,r.Z)({},n,{loading:!0}))}),{}),recommendedDomain:null};else{var s,u=i.reduce((function(e,n){var t=new URL(n.url).hostname;return e[t]=(0,o.Z)((0,o.Z)({},n),{},{domain:t}),e}),{}),d=(null===(s=i.find((function(e){return e.accessible})))||void 0===s?void 0:s.url)||c;n={domainsAccessibility:u,recommendedDomain:d?new URL(d).hostname:null}}return n}},1722:function(e,n,t){t.d(n,{Z:function(){return p}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),c=t(62681),l=t(72333),s=t(76811),u=t(49522),d=t(96266),m=["blocklet","style","size"];function p(e){var n,t=e.blocklet,i=e.style,a=e.size,p=(0,o.Z)(e,m),f=(0,u.Z)({blocklet:t}).logoUrl,v=p.variant,b=(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)||(b=(0,d.jsx)(l.Z,{did:t.meta.did||"",responsive:!0})));return(0,d.jsx)(c.Z,(0,r.Z)((0,r.Z)({variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,borderRadius:10},i)},p),{},{children:b}))}p.propTypes={blocklet:a().object.isRequired,style:a().object,size:a().oneOfType([a().number,a().string])},p.defaultProps={style:{},size:40}},55419:function(e,n,t){var r=t(27773),o=t(22754),i=t(98451),a=t(32207),c=t(35258),l=t(17545),s=t(49647),u=t(70648);n.Z={Start:o.Z,Stop:i.Z,Restart:a.default,Reload:c.Z,Remove:r.default,Config:l.Z,Log:s.Z,Group:u.Z}},81010:function(e,n,t){t.d(n,{Z:function(){return g}});var r=t(33028),o=t(59740),i=t(5057),a=t(55898),c=t.n(a),l=t(44846),s=t(75239),u=t(68420),d=t(38242),m=t(69569),p=t(22228),f=t(96266),v=["status","variant","source"],b={yellow:"#FFCF71",grey:"#888888"};function g(e){var n=e.status,t=e.variant,a=(e.source,(0,o.Z)(e,v)),c=(0,i.useContext)(u.RD).t,g={added:b.grey,waiting:b.yellow,downloading:b.yellow,downloaded:b.grey,installing:b.yellow,installed:b.grey,starting:b.yellow,running:"success",stopping:b.yellow,stopped:b.grey,error:"error",upgrading:b.yellow,restarting:b.yellow,corrupted:"error",deleting:b.yellow},k=(0,d.isInProgress)(n),Z=c("blocklet.status.".concat(n));return"dot"===t?(0,f.jsx)(s.Z,{title:c("blocklet.statusTip",{status:Z}),children:(0,f.jsx)(m.Z,(0,r.Z)({color:g[n]},a))}):(0,f.jsxs)(p.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:[k&&(0,f.jsx)(l.Z,{size:12,color:"inherit",style:{marginRight:5}}),Z]}))}g.propTypes={status:c().string.isRequired,variant:c().oneOf(["dot","tag"]),source:c().string},g.defaultProps={variant:"tag",source:""}},29054:function(e,n,t){t.d(n,{Tw:function(){return o},y0:function(){return i}});var r=t(5057),o=(0,r.createContext)({});o.Provider,o.Consumer;function i(){return(0,r.useContext)(o)}},87363:function(e,n,t){t.d(n,{K:function(){return p},g:function(){return m}});var r=t(68079),o=t(96234),i=t(5057),a=t(55898),c=t.n(a),l=t(69163),s=t.n(l),u=t(96266),d=(0,i.createContext)({});function m(e){var n=e.children,t=e.type,a=(0,i.useState)([]),c=(0,o.Z)(a,2),l=c[0],m=c[1],p=(0,i.useRef)([]),f=function(e){if(p.current.includes(e)){var n=p.current.filter((function(n){return n!==e}));m(n),p.current=n}};return(0,u.jsx)(d.Provider,{value:{type:t,deletingBlocklets:l,addDeletingDid:function(e){if(!p.current.includes(e)){var n=[].concat((0,r.Z)(p.current),[e]);m(n),p.current=n}},removeDeletingDid:f,matchDeletingDid:function(e){var n=l.filter((function(n){return e.find((function(e){return e===n}))}));s()(n,l).forEach((function(e){return f(e)}))}},children:n})}function p(){return(0,i.useContext)(d)}m.propTypes={type:c().string,children:c().node.isRequired},m.defaultProps={type:"blocklets"}},69569:function(e,n,t){var r,o=t(71171),i=t(33518),a={success:"#3ab39d",error:"#D0021B"},c="10px",l=i.Z.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||c}),(function(e){return e.size||c}),(function(e){return a[e.color]||e.color||a.success}));n.Z=l},49522:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(6352),o=t.n(r),i=t(58238),a=t(14491);function c(e){var n,t,r=e.blocklet,c=(0,i.h6)().inService,l=(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()(l,"/blocklet/logo/".concat(c?"":r.meta.did),s)}}},22228:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(33028),o=t(59740),i=t(55898),a=t.n(i),c=t(19778),l=t(96266),s=["children","style"];function u(e){var n=e.children,t=e.style,i=(0,o.Z)(e,s);return(0,l.jsx)(c.Z,(0,r.Z)((0,r.Z)({style:t},i),{},{children:n}))}u.propTypes={children:a().any.isRequired,style:a().object},u.defaultProps={style:{}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6950],{16950:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return _e}});var t,r=i(71171),o=i(33028),a=i(32723),s=i(34795),c=i(96234),l=i(5057),u=i(33518),p=i(85493),d=i(10458),v=i.n(d),f=i(6352),x=i.n(f),m=i(43681),h=i.n(m),g=i(26796),_=i(55898),Z=i.n(_),j=i(79366),w=i(44846),y=i(35474),k=i(68420),b=i(13128),S=i(57471),P=i(96266),C=(0,S.Z)((0,P.jsx)("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}),"Inbox");function z(e){var n=e.invitation,i=e.createPassportSvg,t=e.passportColor,r=(0,l.useState)(!1),o=(0,c.Z)(r,2),a=o[0],s=o[1],u=(0,l.useContext)(k.RD).t,p=(0,l.useMemo)((function(){return(n.role.title||n.role.name).toUpperCase()}),[n.role.title,n.role.name]),d=(0,l.useMemo)((function(){return i({title:p,issuer:n.info.name,issuerDid:n.info.appDid,ownerName:"Your Name",ownerDid:n.info.appDid,preferredColor:n.info.passportColor||t})}),[n,p]),v=(0,l.useCallback)((function(){s(!0)}),[]),f=(0,l.useCallback)((function(){s(!1)}),[]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(R,{children:(0,P.jsx)("div",{className:"invite-passport__card",onClick:v,children:(0,P.jsx)("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:d}})})}),(0,P.jsx)(b.ZP,{open:a,title:u("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:f,children:n.role.permissions&&n.role.permissions.length>0?(0,P.jsx)("ul",{style:{listStyle:"circle",padding:"0 20px"},children:n.role.permissions.map((function(e){return(0,P.jsx)("li",{style:{listStyle:"circle"},children:e.description},e.name)}))}):(0,P.jsxs)("div",{style:{color:"#999",textAlign:"center"},children:[(0,P.jsx)(C,{style:{width:"30px",height:"30px"}}),(0,P.jsx)("div",{children:u("invite.emptyPermission")})]})})]})}z.propTypes={invitation:Z().object.isRequired,createPassportSvg:Z().func.isRequired,passportColor:Z().string},z.defaultProps={passportColor:"auto"};var N,R=u.Z.div(t||(t=(0,r.Z)(["\n display: flex;\n max-width: 350px;\n margin: 30px auto;\n .invite-passport__card {\n margin: 0 auto;\n width: 228px;\n height: 258px;\n flex-shrink: 0;\n .invite-passport__cover {\n cursor: pointer;\n width: 100%;\n height: 100%;\n }\n }\n .invite-passport__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n .invite-passport__title {\n font-weight: 700;\n font-size: 16px;\n }\n .invite-passport__description {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n height: 3em;\n color: #999;\n font-size: 14px;\n }\n .invite-passport__view-permission {\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n line-height: 18px;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),F=z,T=i(96501),L=i(92459),I=i(5659),E=i(14491),D=i(70284);function U(e){var n,i,t,r=e.invitation,o=e.checkFn,a=e.onLogin,s=e.onReceive,u=(0,l.useState)(!1),p=(0,c.Z)(u,2),d=p[0],v=p[1],f=(0,k.PE)(),x=f.t,m=f.locale,h=(0,D.Z)().getPassportId;"undefined"!==typeof window&&(n=null===(i=window)||void 0===i||null===(t=i.blocklet)||void 0===t?void 0:t.componentId);var g={passportId:h(),inviteId:r.inviteId,baseUrl:window.location.origin,componentId:n},_=(0,l.useCallback)((function(){v(!1)}),[]),Z=(0,l.useCallback)((function(){v(!1),a.apply(void 0,arguments)}),[a]),j=(0,l.useCallback)((function(){"function"!==typeof s?v(!0):s()}),[]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(q,{children:[(0,P.jsx)(L.Z,{size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:j,children:x("invite.receive")}),(0,P.jsxs)("div",{className:"invite-receive__until",children:[x("invite.validUntil"),(0,E.o0)(r.expireDate,m)]})]}),(0,P.jsx)(T.default,{popup:!0,open:d,className:"connect",action:"invite",checkFn:o,forceConnected:!1,autoConnect:!1,checkTimeout:6e5,onSuccess:Z,onClose:_,locale:m,webWalletUrl:(0,I.yP)(),messages:{title:x("receive.dialog.title"),scan:x("receive.dialog.scan"),confirm:x("receive.dialog.confirm"),success:x("receive.dialog.success")},extraParams:g})]})}U.propTypes={invitation:Z().object.isRequired,checkFn:Z().func.isRequired,onLogin:Z().func,onReceive:Z().func},U.defaultProps={onLogin:function(){},onReceive:null};var M,q=u.Z.div(N||(N=(0,r.Z)(["\n text-align: center;\n .invite-receive__logo-wrapper {\n display: inline-flex;\n align-items: center;\n color: #9397a1;\n font-size: 14px;\n }\n .invite-receive__logo {\n height: 16px;\n margin-left: 8px;\n }\n .invite-receive__button {\n width: 100%;\n margin: 16px 0;\n white-space: nowrap;\n }\n .invite-receive__until {\n text-align: center;\n font-size: 14px;\n }\n .invite-receive__description {\n color: #999;\n text-align: left;\n list-style: decimal;\n padding: 0;\n padding-left: 1.2em;\n margin: 40px 0;\n }\n .invite-receive__description-item {\n list-style: decimal;\n }\n .invite-receive__link {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),W=U;function H(e){var n=e.onLogin,i=(0,k.PE)().t;return(0,P.jsx)(A,{children:(0,P.jsx)(L.Z,{size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:function(){return n()},children:i("common.connect")})})}H.propTypes={onLogin:Z().func},H.defaultProps={onLogin:function(){}};var O,A=u.Z.div(M||(M=(0,r.Z)(["\n text-align: center;\n .invite-receive__logo-wrapper {\n display: inline-flex;\n align-items: center;\n color: #9397a1;\n font-size: 14px;\n }\n .invite-receive__logo {\n height: 16px;\n margin-left: 8px;\n }\n .invite-receive__button {\n width: 100%;\n margin: 16px 0;\n white-space: nowrap;\n }\n .invite-receive__until {\n text-align: center;\n font-size: 14px;\n }\n .invite-receive__description {\n color: #999;\n text-align: left;\n list-style: decimal;\n padding: 0;\n padding-left: 1.2em;\n margin: 40px 0;\n }\n .invite-receive__description-item {\n list-style: decimal;\n }\n .invite-receive__link {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),V=H,B=i(72333);function Y(e){var n=e.invitation,i=(0,k.PE)().t,t=(0,l.useMemo)((function(){return(n.role.title||n.role.name).toUpperCase()}),[n.role.title,n.role.name]),r=(0,l.useMemo)((function(){return i("invite.message",{name:"{{name}}",role:t,dapp:"{{dapp}}"})}),[i,t]),o=(0,E.E8)(n.info.chainHost,n.inviter.did,"account"),a=(0,E.Zp)(r,{name:function(){return o?(0,P.jsx)("a",{target:"_blank",href:o,className:"invite-user__link",rel:"noreferrer",children:n.inviter.fullName},"name"):n.inviter.fullName},dapp:function(){return(0,P.jsx)("a",{target:"_blank",href:n.info.url,className:"invite-user__link",rel:"noreferrer",children:n.info.name},"dapp")}});return(0,P.jsxs)(K,{children:[(0,P.jsx)(B.Z,{did:n.inviter.did,src:encodeURI(n.inviter.avatar),size:80,shape:"circle",variant:"circle"}),(0,P.jsx)("div",{className:"invite-user__message",children:a})]})}Y.propTypes={invitation:Z().object.isRequired};var J,K=u.Z.div(O||(O=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n .invite-user__name {\n font-weight: 700;\n font-size: 16px;\n margin: 8px 0 2px 0;\n }\n .invite-user__address {\n font-size: 12px;\n }\n .invite-user__message {\n margin-top: 20px;\n font-weight: 700;\n /* width: 90%; */\n text-align: center;\n font-size: 18px;\n }\n .invite-user__link {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),G=Y,Q=i(39948),X=i(76005);function $(e){var n=e.invitation,i=e.type,t=(0,k.PE)().t,r=(0,l.useMemo)((function(){return t("invite.success",{dapp:"{{dapp}}"})}),[t]),o=(0,E.E8)(n.info.chainHost,n.inviter.did,"account"),a="receiver"===i?n.receiver:n.inviter,s=(0,E.Zp)(r,{name:function(){return o?(0,P.jsx)("a",{target:"_blank",href:o,className:"invite-user__link",rel:"noreferrer",children:a.fullName},"name"):a.fullName},dapp:function(){return(0,P.jsx)("a",{target:"_blank",href:n.info.url,className:"invite-user__link",rel:"noreferrer",children:n.info.name},"dapp")}});return(0,P.jsxs)(ne,{children:[(0,P.jsx)(Q.Z,{pt:1,color:"success.main",children:(0,P.jsx)(X.Z,{style:{fontSize:80}})}),(0,P.jsx)("div",{className:"invite-user__message",children:s})]})}$.propTypes={invitation:Z().object.isRequired,type:Z().oneOf("inviter","receiver")},$.defaultProps={type:"inviter"};var ee,ne=u.Z.div(J||(J=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n .invite-user__name {\n font-weight: 700;\n font-size: 16px;\n margin: 8px 0 2px 0;\n }\n .invite-user__address {\n font-size: 12px;\n }\n .invite-user__message {\n margin-top: 20px;\n font-weight: 700;\n /* width: 90%; */\n text-align: center;\n font-size: 18px;\n }\n .invite-user__link {\n color: ",";\n }\n"])),(function(e){return e.theme.palette.primary.main})),ie=$,te=i(59740),re=["invitation"];function oe(e){var n=e.invitation,i=(0,te.Z)(e,re);return(0,P.jsxs)(se,(0,o.Z)((0,o.Z)({},i),{},{children:[(0,P.jsx)(B.Z,{did:n.info.did,src:n.info.logo,style:{flexShrink:0}}),(0,P.jsxs)("div",{className:"invite-app__content",children:[(0,P.jsx)("div",{className:"invite-app__title",children:n.info.name}),(0,P.jsx)("div",{className:"invite-app__description",children:n.info.description})]})]}))}oe.propTypes={invitation:Z().object.isRequired};var ae,se=u.Z.div(ee||(ee=(0,r.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n overflow: hidden;\n .invite-app__content {\n flex: 1;\n margin: 0 12px;\n font-weight: 700;\n overflow: hidden;\n }\n .invite-app__title {\n line-height: 1;\n margin-bottom: 2px;\n overflow: hidden;\n }\n .invite-app__description {\n font-size: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n height: 1.3em;\n color: #999;\n overflow: hidden;\n }\n"]))),ce=oe,le=i(35820);function ue(e){var n,i,t=e.getDataFn,r=e.passportColor,o=e.createPassportSvg,a=e.onLoginSuccess,s=e.checkFn,c=e.onReceive,l=(0,j.Z)(t);if(l.loading)return(0,P.jsx)(w.Z,{});if(l.error)return(0,P.jsx)(y.Z,{status:"404",title:null===(n=l.error)||void 0===n||null===(i=n.response)||void 0===i?void 0:i.data,description:""});var u="success"===l.data.status,p=u?ie:G,d=u?V:W;return(0,P.jsxs)(de,{className:"page-invite__wrapper",children:[(0,P.jsx)(ce,{invitation:l.data}),(0,P.jsxs)("div",{className:"page-invite__card",children:[(0,P.jsx)(p,{invitation:l.data}),(0,P.jsx)(F,{invitation:l.data,createPassportSvg:o,passportColor:r}),(0,P.jsx)(d,{invitation:l.data,onLogin:a,checkFn:s,onReceive:c})]})]})}ue.propTypes={getDataFn:Z().func.isRequired,checkFn:Z().func.isRequired,createPassportSvg:Z().func.isRequired,onLoginSuccess:Z().func,onReceive:Z().func,passportColor:Z().string},ue.defaultProps={onLoginSuccess:function(){},passportColor:"auto",onReceive:null};var pe,de=u.Z.div(ae||(ae=(0,r.Z)(["\n max-width: 460px;\n max-height: 650px;\n min-height: 450px;\n width: 90%;\n height: 80%;\n display: flex;\n flex-direction: column;\n .page-invite__card {\n background-color: #fff;\n border-radius: 4px;\n flex: 1;\n padding: 20px 30px;\n margin-top: 10px;\n }\n .page-invite__app {\n margin-top: 20px;\n }\n"]))),ve=(0,le.Z)(ue),fe=i(25339),xe=i(75793),me=i(74094);function he(e){var n=(0,fe.Tt)(),i=n.api,t=n.session,r=(0,xe.h6)().info,u=(0,p.useLocation)(),d=(0,p.useNavigate)(),f=(0,k.PE)(),m=f.t,_=f.locale,Z=(0,T.useSecurity)().encryptKey,j=(0,l.useState)(!1),y=(0,c.Z)(j,2),b=y[0],S=y[1],C=(0,l.useMemo)((function(){return new URLSearchParams(u.search).get("inviteId")}),[u]),z=(0,g.default)((0,s.Z)((0,a.Z)().mark((function e(){var n,t,o,s,c,l,u;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,i.get("/api/invitation",{params:{inviteId:C}});case 4:if(t=e.sent,o=t.data,!(s=!!h()(r,"ownerNft.did")&&"owner"===o.role.name)){e.next=17;break}return(c=new URL(window.location.href)).pathname=x()((0,me.Y5)(),"/api/did/invite/token"),c.searchParams.set("_ek_",Z),c.searchParams.set("inviteId",C),e.next=14,i.get(c.href);case 14:l=e.sent,u=l.data,n=u;case 17:return e.abrupt("return",{invitation:o,nextWorkflow:n,needReceiveNFT:s});case 18:case"end":return e.stop()}}),e)})))),N=(0,l.useCallback)((function(){S(!0)}),[]),R=(0,l.useCallback)((function(){if(z.error)throw z.error;return z.value.invitation}),[z]),F=(0,l.useCallback)(function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n,i){var r,o;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n&&(0,me.ZB)(i(n.sessionToken)),(r=new URLSearchParams(u.search)).delete("inviteId"),o=r.toString(),e.next=6,t.refresh();case 6:d("/".concat(o?"?".concat(o):o),{replace:!0});case 7:case"end":return e.stop()}}),e)})));return function(n,i){return e.apply(this,arguments)}}(),[u,d,t]);if(z.loading)return(0,P.jsx)(w.Z,{});return(0,P.jsxs)(ge,{className:"page-invite",children:[h()(z,"value.needReceiveNFT")&&(0,P.jsx)(T.default,{action:"login",popup:!0,className:"connect",open:b,locale:_,baseUrl:r.launcher.url,checkFn:v().create({baseURL:r.launcher.url}).get,onSuccess:function(e,n){var r=new URL(window.location.href);r.pathname=x()((0,me.Y5)(),"/api/did/invite/status"),r.searchParams.set("_t_",z.value.nextWorkflow.token),r.searchParams.set("locale",_);var o=setInterval((0,s.Z)((0,a.Z)().mark((function e(){var s,c;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.get(r.href);case 2:s=e.sent,"succeed"===(c=s.data).status&&(clearInterval(o),t.updateConnectedInfo(c),F(c,Z?n:function(){}));case 5:case"end":return e.stop()}}),e)}))),2e3)},onClose:function(){S(!1)},checkTimeout:3e5,webWalletUrl:(0,me.yP)(r),extraParams:{nw:h()(z,"value.nextWorkflow.url")},messages:{title:m("invite.transferNFTDialog.title",{name:r.name}),scan:m("invite.transferNFTDialog.scan"),confirm:m("invite.transferNFTDialog.confirm"),success:m("invite.transferNFTDialog.success")},prefix:"/.well-known/service/api/did"}),(0,P.jsx)(ve,(0,o.Z)((0,o.Z)({},e),{},{getDataFn:R,createPassportSvg:function(e){return(0,me.Ju)(e,r)},checkFn:i.get,onLoginSuccess:F,passportColor:"default",onReceive:h()(z,"value.needReceiveNFT")?N:null}))]})}var ge=u.Z.div(pe||(pe=(0,r.Z)(["\n width: 100vw;\n height: 100%;\n min-height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: #f6f8fa;\n overflow: auto;\n padding: 20px;\n"])));function _e(){return(0,xe.h6)().loading?(0,P.jsx)(w.Z,{}):(0,P.jsx)(he,{})}},51281:function(e,n,i){var t=i(77668),r=i(2586),o=i(56944);e.exports={translations:{zh:t(o),en:t(r)}}},35820:function(e,n,i){"use strict";i.d(n,{Z:function(){return s}});var t=i(33028),r=i(68420),o=i(51281),a=i(96266);function s(e){return function(n){return(0,a.jsx)(r.Iw,{translations:o.translations,children:(0,a.jsx)(e,(0,t.Z)({},n))})}}},92459:function(e,n,i){"use strict";i.d(n,{Z:function(){return p}});var t=i(33028),r=i(59740),o=i(55898),a=i.n(o),s=i(28726),c=i(81089),l=i(96266),u=["children"];function p(e){var n=e.children,i=(0,r.Z)(e,u);return(0,l.jsxs)(s.Z,(0,t.Z)((0,t.Z)({color:"did",variant:"contained"},i),{},{children:[(0,l.jsx)("span",{style:{fontWeight:400},children:n||"Continue With"}),(0,l.jsx)(c.Z,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]}))}p.propTypes={children:a().any},p.defaultProps={children:""}},35474:function(e,n,i){"use strict";i.d(n,{Z:function(){return W}});var t={};i.r(t),i.d(t,{ComingSoon:function(){return L},Error:function(){return F},Forbidden:function(){return N},Info:function(){return I},InternalServerError:function(){return R},Maintenance:function(){return T},PageNotFound:function(){return z}});var r,o=i(59740),a=i(56666),s=i(33028),c=i(55898),l=i.n(c),u=i(71171),p=i(39948),d=i(47685),v=i(96266),f=["icon","title","description","extra"];function x(e){var n=e.icon,i=e.title,t=e.description,r=e.extra,a=(0,o.Z)(e,f);return(0,v.jsxs)(m,(0,s.Z)((0,s.Z)({},a),{},{children:[n,"string"===typeof i?(0,v.jsx)(p.Z,{mt:3,fontSize:22,fontWeight:400,color:"#47494E",textAlign:"center",children:i}):i,"string"===typeof t?(0,v.jsx)(p.Z,{mt:1,fontSize:14,color:"#7F828B",textAlign:"center",children:t}):t,(0,v.jsx)(p.Z,{mt:3,children:r})]}))}x.propTypes={icon:l().element,title:l().oneOfType([l().string,l().element]),description:l().oneOfType([l().string,l().element]),actions:l().any,extra:l().element},x.defaultProps={icon:void 0,title:"",description:"",actions:null,extra:void 0};var m=(0,d.zo)("div")(r||(r=(0,u.Z)(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n padding: 16px;\n\n background-color: #f7f8fb;\n"]))),h=x,g=i(36134),_=i(11532),Z={en:{404:{title:"404 - Page Not Found",description:"Sorry about that, the page you are looking for does not exist or has been moved."},403:{title:"403 \u2013 Forbidden",description:"Sorry, you are not authorized to access this page."},500:{title:"500 - Internal Server Error",description:"An internal server error has occurred. Please try again later."},error:{title:"Application Error",description:"Something went wrong. Please try again later."},maintenance:{title:"Offline for maintenance",description:"This app is undergoing maintenance right now. Please check back later."},comingSoon:{title:"Coming Soon",description:"Our website is under construction. We'll be here soon with our new website."}},zh:{404:{title:"404 - \u9875\u9762\u672a\u627e\u5230",description:"\u5f88\u62b1\u6b49\uff0c\u60a8\u6b63\u5728\u5bfb\u627e\u7684\u9875\u9762\u4e0d\u5b58\u5728\u6216\u5df2\u88ab\u79fb\u52a8\u3002"},403:{title:"403 \u2013 \u7981\u6b62\u8bbf\u95ee",description:"\u5f88\u62b1\u6b49\uff0c\u60a8\u6ca1\u6709\u6743\u9650\u8bbf\u95ee\u6b64\u9875\u9762\u3002"},500:{title:"500 - \u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef",description:"\u53d1\u751f\u4e86\u4e00\u4e2a\u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef\u3002\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002"},error:{title:"Application Error",description:"\u51fa\u9519\u4e86, \u8bf7\u7a0d\u540e\u518d\u8bd5\u3002"},maintenance:{title:"\u7ef4\u62a4\u4e2d",description:"\u5e94\u7528\u7a0b\u5e8f\u6b63\u5728\u8fdb\u884c\u7ef4\u62a4\u3002\u8bf7\u7a0d\u540e\u518d\u67e5\u770b\u3002"},comingSoon:{title:"\u5373\u5c06\u4e0a\u7ebf",description:"\u6211\u4eec\u7684\u7f51\u7ad9\u6b63\u5728\u5efa\u8bbe\u4e2d\u3002\u6211\u4eec\u5f88\u5feb\u5c31\u4f1a\u5728\u8fd9\u91cc\u63a8\u51fa\u6211\u4eec\u7684\u65b0\u7f51\u7ad9\u3002"}}},j=i(68420),w=["locale"],y=["locale"],k=["locale"],b=["locale"],S=["locale"],P=["locale"],C=function(e){e=["zh","en"].includes(e)?e:"";var n=((0,j.PE)()||{locale:"en"}).locale,i=e||n;return Z[i]?i:"en"};function z(e){var n=e.locale,i=(0,o.Z)(e,w);return n=C(n),(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(E,{}),title:Z[n][404].title,description:Z[n][404].description},i))}function N(e){var n=e.locale,i=(0,o.Z)(e,y);return n=C(n),(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(E,{}),title:Z[n][403].title,description:Z[n][403].description},i))}function R(e){var n=e.locale,i=(0,o.Z)(e,k);return n=C(n),(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(E,{}),title:Z[n][500].title,description:Z[n][500].description},i))}function F(e){var n=e.locale,i=(0,o.Z)(e,b);return n=C(n),(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(E,{}),title:Z[n].error.title,description:Z[n].error.description},i))}function T(e){var n=e.locale,i=(0,o.Z)(e,S);return n=C(n),(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(D,{}),title:Z[n].maintenance.title,description:Z[n].maintenance.description},i))}function L(e){var n=e.locale,i=(0,o.Z)(e,P);return n=C(n),(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(D,{}),title:Z[n].comingSoon.title,description:Z[n].comingSoon.description},i))}function I(e){return(0,v.jsx)(h,(0,s.Z)({icon:(0,v.jsx)(D,{})},e))}function E(e){var n=(0,d.Fg)();return(0,v.jsx)(_.Z,(0,s.Z)({style:{color:n.palette.error.main,fontSize:72}},e))}function D(e){var n=(0,d.Fg)();return(0,v.jsx)(g.Z,(0,s.Z)({style:{color:n.palette.info.main,fontSize:72}},e))}z.status="404",N.status="403",R.status="500",F.status="error",T.status="maintenance",L.status="comingSoon",I.status="info";var U=["status"],M=Object.keys(t).reduce((function(e,n){return(0,s.Z)((0,s.Z)({},e),{},(0,a.Z)({},t[n].status||n,t[n]))}),{});function q(e){var n=e.status,i=(0,o.Z)(e,U);if(n){if(M[n]){var t=M[n];return(0,v.jsx)(t,(0,s.Z)({},i))}throw new Error("Please provide a valid status for Result.status. Valid values are: ".concat(Object.keys(M).join(", ")))}return(0,v.jsx)(h,(0,s.Z)({},i))}q.propTypes=(0,s.Z)({status:l().oneOfType([l().string,l().number])},h.propTypes),q.defaultProps={status:""};var W=q},11532:function(e,n,i){"use strict";var t=i(71600);n.Z=void 0;var r=t(i(56930)),o=i(96266),a=(0,r.default)((0,o.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.9959.9959 0 0 1 0-1.41L10.59 12 7.7 9.11a.9959.9959 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41z"}),"CancelRounded");n.Z=a},76005:function(e,n,i){"use strict";var t=i(71600);n.Z=void 0;var r=t(i(56930)),o=i(96266),a=(0,r.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");n.Z=a},36134:function(e,n,i){"use strict";var t=i(71600);n.Z=void 0;var r=t(i(56930)),o=i(96266),a=(0,r.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");n.Z=a}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6960],{16960:function(e,n,t){t.r(n),t.d(n,{default:function(){return Ke}});var r,a=t(71171),i=t(33028),l=t(85493),o=t(6352),s=t.n(o),c=t(21371),d=t(72904),u=t(33518),p=t(68420),h=t(63902),m=t(51703),f=t(12073),x=t(15959),v=t(10866),g=t(4456),b=t(28864),k=t(99641),j=t(44846),w=t(88574),y=t(35966),Z=t(75793),P=t(38242),C=t(55309),N=t(59740),E=t(55898),B=t.n(E),O=t(96266),D=["children"];function L(e){var n=e.children,t=(0,N.Z)(e,D);return(0,O.jsx)(R,(0,i.Z)((0,i.Z)({},t),{},{children:n}))}L.propTypes={children:B().any.isRequired};var U,z,R=u.Z.div(r||(r=(0,a.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n\n .header {\n text-align: center;\n }\n\n .body {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 30px;\n width: 100%;\n min-height: 200px;\n flex: 1;\n\n "," {\n padding: 24px;\n }\n\n "," {\n padding: 0 16px 16px;\n }\n }\n\n .footer {\n display: flex;\n justify-content: center;\n\n "," {\n padding-bottom: 34px;\n }\n\n "," {\n margin-top: auto;\n padding-bottom: 10px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("sm")}),(function(e){return e.theme.breakpoints.down("md")})),_=t(77609),I=t(23484);var S=u.Z.a(U||(U=(0,a.Z)(["\n display: block;\n height: 36px;\n color: ",";\n"])),(function(e){return e.theme.palette.primary.main})),T=(0,u.Z)(L)(z||(z=(0,a.Z)(["\n .app-info_desc {\n font-weight: 400;\n margin-top: 40px;\n font-size: 18px;\n line-height: 21px;\n color: #222222;\n }\n\n .body {\n text-align: center;\n }\n\n "," {\n .app-info_desc {\n font-size: 16px;\n }\n }\n\n .circle_icon {\n font-size: 58px;\n color: ",";\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return"error"===e.variant?e.theme.palette.error.main:e.theme.palette.success.main})),M=function(){var e=(0,p.PE)().t,n=(0,Z.h6)().info,t=(0,I.Z)(),r=decodeURIComponent(t.get("accessUrl")||""),a=(0,_.H0)().meta;return(0,O.jsx)(T,{children:(0,O.jsx)("div",{className:"body",children:(0,O.jsx)(C.Z,{variant:"success",title:(0,P.getDisplayName)({meta:a},!0),subTitle:e("launchBlocklet.installSuccess",{serverName:n.name}),footer:(0,O.jsx)(S,{href:r,rel:"noreferrer","data-cy":"open-blocklet",children:e("common.open")})})})})},V=t(32723),A=t(34795),F=t(96234),H=t(39463),G=t(4651),W=t(86229),K=t(14491),q=t(60344),Q=t(92816),X=t(96501),Y=t(35266),J=t(76811),$=t(2660),ee=t(77429),ne=t(48086),te=t(38898),re=t(75506),ae=t.n(re),ie=t(50482),le=t.n(ie),oe=t(5057),se=t(15849),ce=t(67654),de=t(31853),ue=t(11397),pe=t.n(ue),he=t(52581),me=t(11476),fe=t(25339),xe=t(74094),ve=t(13455),ge=t(28726),be=["children"];function ke(e){var n=e.children,t=(0,N.Z)(e,be);return(0,O.jsx)(ge.Z,(0,i.Z)((0,i.Z)({variant:"contained",color:"primary"},t),{},{children:n}))}var je,we,ye,Ze,Pe=(0,oe.forwardRef)((function(e,n){return(0,O.jsx)(ke,(0,i.Z)((0,i.Z)({},e),{},{forwardedRef:n}))})),Ce=t(13932),Ne=t(93040),Ee=t(66436),Be=pe()("@abtnode/webapp:launch-blocklet:step-install"),Oe=function(e,n){return!n.statusChanged&&("installed"===e||"running"===e)&&!n.launching},De=function(e,n,t){return t("nft"===n?e?"launchBlocklet.dialog.nftFreeDescription":"launchBlocklet.dialog.nftPaidDescription":e?"launchBlocklet.dialog.freeDescription":"launchBlocklet.dialog.paidDescription")};function Le(){var e=(0,I.Z)(),n=(0,p.PE)(),t=n.t,r=n.locale,a=(0,Z.h6)(),i=a.api,o=a.info,c=(0,fe.Tt)(),d=c.session,u=c.api,h=(0,l.useNavigate)(),m=(0,_.H0)(),f=m.meta,x=m.isFree,v=m.appDid,g=m.sessionId,b=m.storeUrl,k=m.blockletMetaUrl,w=m.isExternal,C=m.setAppDid,N=m.launcherUrl,E=m.launcherSessionId,B=m.isInstalled,D=f?(0,P.getDisplayName)({meta:f},!0):null,L=e.get("launchType"),U=e.get("chainHost"),z=e.get("nftId"),R=(0,oe.useRef)(null),S=(0,X.useSecurity)(),T=S.decrypt,M=S.encryptKey,re=(0,ce.Z)("skip-blocklet-setup",!1),ie=(0,F.Z)(re,1)[0],ue=(0,de.Z)({launching:!1,visiting:!1,statusChanged:!1,isConnectOpen:!1,nextAccessUrl:"",loaded:!1,installError:null,progressIndex:0,connectData:{action:"",baseUrl:"",checkFn:function(){},extraParams:{}}}),pe=(0,F.Z)(ue,2),ge=pe[0],be=pe[1],ke=(0,Ne.Iq)({user:d.user,launchType:L,nftId:z}),je=(0,H.getServerAuthMethod)(o,L,E,ke),we=(0,me.Z)(ke?v:""),ye=we.status,Ze=we.eventName,Le=e.get("from");(0,oe.useEffect)((function(){B||ze(),be({loaded:!0})}),[]);var Ue=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(){var n,t,r;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(0,xe.bQ)(b,o.blockletRegistryList),t=n.isNew,r=n.decoded,!t){e.next=4;break}return e.next=4,i.addBlockletStore({input:{teamDid:o.did,url:r}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ze=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(){var n,t,r,a,i,l,c,u,p,h,m;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(be({installError:null}),null===d||void 0===d||!d.user||w||"serverless"===L){e.next=10;break}return e.prev=2,e.next=5,Ue();case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.error("addNewRegistryToRegistryList error:",e.t0);case 10:if(!x){e.next=15;break}a="launch-free-blocklet-by-".concat(je),be({isConnectOpen:!0,connectData:{action:a,baseUrl:"",checkFn:q.od.create({baseURL:null!==(n=null===(t=window)||void 0===t||null===(r=t.env)||void 0===r?void 0:r.apiPrefix)&&void 0!==n?n:"/"}).get,extraParams:{wt:(0,G.iK)(f),title:f.title,blockletMetaUrl:k,launchType:L,nftId:z,chainHost:decodeURIComponent(U),launcherUrl:N,launcherSessionId:E}}}),e.next=32;break;case 15:return u="launch-paid-blocklet-by-".concat(je),(p=new URL(window.location.href)).pathname=s()(null!==(i=null===(l=window)||void 0===l||null===(c=l.env)||void 0===c?void 0:c.apiPrefix)&&void 0!==i?i:"/","/api/did/".concat(u,"/token")),p.searchParams.set("wt",(0,G.iK)(f)),p.searchParams.set("_ek_",M),p.searchParams.set("title",f.title),p.searchParams.set("autoConnect",!1),p.searchParams.set("blockletMetaUrl",k),L&&p.searchParams.set("launchType",L),z&&p.searchParams.set("nftId",z),N&&p.searchParams.set("launcherUrl",N),E&&p.searchParams.set("launcherSessionId",E),e.next=29,q.hi.get(p.href);case 29:h=e.sent,m=h.data,be({isConnectOpen:!0,connectData:{action:"verify-purchase-blocklet",baseUrl:new URL(k).origin,checkFn:q.od.create({baseURL:new URL(k).origin}).get,extraParams:{serverDid:o.did,blockletDid:null===f||void 0===f?void 0:f.did,nw:m.url}}});case 32:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(n){var r,a;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W.Z.success(t("launchBlocklet.dialog.success")),!(r=Array.isArray(n)?n[n.length-1]:n).sessionToken){e.next=6;break}return(0,xe.ZB)(T(r.sessionToken)),e.next=6,d.refresh();case 6:be({launching:!r.isInstalled,isConnectOpen:!1}),r.appDid&&(C(r.appDid,r.sessionId),(a=new URL(window.location.href)).searchParams.set("appDid",r.appDid),a.searchParams.set("sessionId",r.sessionId),window.history.replaceState(null,"",a.toString()));case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Me=function(n){var t="/".concat(o.routing.adminPath,"/blocklets/").concat(n.meta.did,"/configuration").replace(/\/+/g,"/"),r="/launch-blocklet/complete?status=installed&name=".concat(encodeURIComponent(D),"&accessUrl=").concat(encodeURIComponent(t),"&blocklet_meta_url=").concat(k),a=e.get("fromLauncher");a&&(r+="&fromLauncher=".concat(a)),L&&(r+="&launchType=".concat(L)),U&&(r+="&chainHost=".concat(U)),h(r)},Ve=function(){var n=(0,A.Z)((0,V.Z)().mark((function n(r){var a,i,l,s,c,d,p;return(0,V.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Be("visitBlocklet",{status:ye,state:ge,appDid:v}),!ge.visiting){n.next=3;break}return n.abrupt("return");case 3:return be({visiting:!0}),a=(0,K.A6)({blocklet:r}),n.next=7,(0,xe.D)(a);case 7:if(i=n.sent,!(ae()(i)&&"serverless"!==L||ie)){n.next=12;break}return be({visiting:!1}),setTimeout((function(){Me(r)}),1e3),n.abrupt("return");case 12:if(!ae()(i)){n.next=16;break}return be({visiting:!1}),W.Z.error(t("blocklet.urlEmptyTip")),n.abrupt("return");case 16:if(!1!==Oe(ye,ge)){n.next=28;break}return n.prev=17,n.next=20,u.post("/api/launch/".concat(g));case 20:s=n.sent,c=s.data,l=c.setupToken,n.next=28;break;case 25:n.prev=25,n.t0=n.catch(17),W.Z.error((0,xe.Z)(n.t0));case 28:(d=new URL(i)).searchParams.set("serverUrl",(0,G.RU)(o)),"running"!==r.status&&d.searchParams.set("__start__","1"),(p=e.get("fromLauncher"))&&d.searchParams.set("fromLauncher",p),L&&d.searchParams.set("launchType",L),z&&d.searchParams.set("nftId",z),U&&d.searchParams.set("chainHost",U),l&&d.searchParams.set("setupToken",l),be({nextAccessUrl:d.href,visiting:!1}),setTimeout((function(){window.location.href=d.href}),1e3);case 39:case"end":return n.stop()}}),n,null,[[17,25]])})));return function(e){return n.apply(this,arguments)}}(),Ae=[t("launchBlocklet.waiting.verifying"),t("launchBlocklet.waiting.downloading"),t("launchBlocklet.waiting.extracting"),t("upgrading"===ye?"common.upgrading":"launchBlocklet.waiting.installing"),t("launchBlocklet.waiting.done")],Fe=function(){Be("handleInstalledProgress",{status:ye,state:ge}),ye&&(be({progressIndex:4}),R.current&&(clearTimeout(R.current),R.current=null),R.current=setTimeout((function(){i.getBlocklet({input:{did:v,attachRuntimeInfo:!0}}).then((function(e){e.blocklet&&Ve(e.blocklet)}))}),500))};if((0,oe.useEffect)((function(){if("serverless"!==L||Ze!==J.BlockletEvents.nftConsumed)switch(ye){case"waiting":be({progressIndex:1,statusChanged:!0});break;case"downloading":be({progressIndex:2,statusChanged:!0});break;case"installing":case"upgrading":be({progressIndex:3,statusChanged:!0});break;case"installed":if("serverless"===L&&!(0,Ne.MZ)(we))break;Fe();break;case"starting":case"running":case"stopped":Fe();break;case"corrupted":case"error":var e,n={message:we.error.message,name:we.eventName};if([J.BlockletEvents.downloadFailed,J.BlockletEvents.installFailed].includes(we.eventName)?n.action="retry":"error"!==ye&&"corrupted"!==ye||(n.action="view"),!le()(n,ge.installError))null!==we&&void 0!==we&&null!==(e=we.error)&&void 0!==e&&e.message&&W.Z.error((0,xe.Z)(we.error))}else Fe()}),[ye,Ze,we]),Be("render",{status:ye,eventName:Ze,launchType:L,runtimeBlockletState:we,state:ge}),d.user&&null===ye||ae()(f))return(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(j.Z,{})});if(ge.installError){var He={view:!w&&(0,O.jsx)(Pe,{className:"bottom-button",component:se.Link,to:"/blocklets/".concat(v,"/overview"),"data-cy":"view-blocklet",color:"primary",variant:"contained",children:t("launchBlocklet.viewApplication")}),retry:(0,O.jsxs)(Ie,{children:[Le&&(0,O.jsx)(Pe,{variant:"text",className:"bottom-button","data-cy":"go-back",disabled:ge.isConnectOpen,onClick:function(){window.location.href=Le},children:t("common.back")}),(0,O.jsxs)(Pe,{className:"bottom-button","data-cy":"retry-install",disabled:ge.isConnectOpen,onClick:ze,children:[ge.isConnectOpen&&(0,O.jsx)(j.Z,{size:16}),t("common.retry")]})]})},Ge=ge.installError.name?ge.installError.name.replace("blocklet.",""):"installFailed";return(0,O.jsx)(Se,{variant:"error",title:D,subTitle:(0,O.jsxs)(_e,{children:[(0,O.jsx)("div",{children:t("launchBlocklet.error.".concat(Ge))}),ge.installError.message&&(0,O.jsx)("div",{className:"error-desc",children:t("common.errorMessage")+ge.installError.message})]}),footer:He[ge.installError.action]})}if(Oe(ye,ge))return Be("alreadyExists",{status:ye,state:ge,runtimeBlockletState:we}),(0,O.jsx)(Se,{variant:"info",title:t("common.reminder"),subTitle:t("launchBlocklet.alreadyExists",{name:(0,P.getDisplayName)({meta:f},!0)}),footer:(0,O.jsxs)("div",{children:[!ge.nextAccessUrl&&(0,O.jsx)(j.Z,{size:16}),ge.nextAccessUrl&&(0,O.jsx)(te.Z,{href:ge.nextAccessUrl,"data-cy":"open-blocklet",children:t("launchBlocklet.redirect")})]})});var We=!ge.launching&&!ye;return(0,O.jsxs)(Re,{children:[(0,O.jsx)("div",{className:"header",children:(0,O.jsx)($.Z,{title:t(We?"common.install":"common.installing"),subTitle:We?t("launchBlocklet.subTitle",{appName:D,serverName:o.name}):""})}),(0,O.jsxs)("div",{className:"body",children:[We&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"illustrations",children:[(0,O.jsx)("div",{className:"ills-block ills-block-left",children:(0,O.jsxs)("div",{className:"ills-block-inner",children:[(0,O.jsx)(ve.Z,{className:"i-icon",blocklet:{meta:f},blockletMetaUrl:k}),(0,O.jsx)("div",{className:"i-name",children:D})]})}),(0,O.jsx)(ne.Z,{className:"arrow-icon"}),(0,O.jsx)("div",{className:"ills-block ills-block-right",children:(0,O.jsxs)("div",{className:"ills-block-inner",children:[(0,O.jsx)("img",{width:"64",height:"64",src:he.Z,alt:""}),(0,O.jsx)("div",{className:"i-name",children:o.name}),(0,O.jsx)(Q.Z,{size:12,responsive:!1,compact:!0,did:o.did})]})})]}),ge.loaded&&!B&&!ge.launching&&(0,O.jsxs)(Pe,{className:"bottom-button","data-cy":"start-launch",disabled:ge.isConnectOpen,onClick:ze,children:[ge.isConnectOpen&&(0,O.jsx)(j.Z,{size:16}),t("launchBlocklet.confirmInstall")]})]}),ge.launching&&(0,O.jsxs)(Ee.Z,{children:[(0,O.jsx)(Y.Z,{increaseSpeed:.3,messageLoop:!1,message:(0,O.jsx)(ee.Z,{steps:Ae,stepIndex:ge.progressIndex,autoGrowth:4===ge.progressIndex?1e3:4e3})}),[1,2].includes(ge.progressIndex)&&(0,O.jsx)(Ce.Z,{appDid:v})]})]}),ge.isConnectOpen&&(0,O.jsx)(Ce.Z,{appDid:v,visible:!1}),(0,O.jsx)(X.default,{open:ge.isConnectOpen,popup:!0,saveConnect:!1,className:"connect",baseUrl:ge.connectData.baseUrl,action:ge.connectData.action,checkFn:ge.connectData.checkFn,extraParams:ge.connectData.extraParams,checkTimeout:6e5,webWalletUrl:(0,xe.yP)(o),onSuccess:Te,onClose:function(){return be({isConnectOpen:!1})},locale:r,messages:{title:"".concat(t("launchBlocklet.dialog.title")),scan:De(x,je,t),confirm:t("launchBlocklet.dialog.confirm"),success:t("launchBlocklet.dialog.success")}})]})}var Ue,ze,Re=(0,u.Z)(L)(je||(je=(0,a.Z)(["\n .body {\n align-items: center;\n animation: fadein ease 0.3s;\n }\n\n .illustrations {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: start;\n text-align: center;\n margin-top: 16px;\n margin-bottom: 40px;\n width: 100%;\n }\n\n .ills-block,\n .ills-block-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n flex: 1;\n }\n .ills-block {\n max-width: 220px;\n .i-icon {\n width: 64px;\n height: 64px;\n }\n\n .i-name {\n margin-top: 16px;\n font-weight: 400;\n font-size: 16px;\n color: #222222;\n }\n\n .i-sub-name {\n color: #999999;\n }\n }\n\n .arrow-icon {\n align-self: start;\n color: #c4c5ca;\n font-size: 30px;\n margin: 16px 0 0;\n "," {\n margin: 25px 24px 0;\n }\n }\n\n @keyframes fadein {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")})),_e=u.Z.div(we||(we=(0,a.Z)(["\n line-height: 1.4em;\n .error-desc {\n margin-top: 8px;\n word-wrap: break-word;\n color: ",";\n }\n"])),(function(e){return e.theme.palette.grey[500]})),Ie=u.Z.div(ye||(ye=(0,a.Z)(["\n display: flex;\n justify-content: space-around;\n flex-wrap: wrap;\n button {\n margin: 0 10px 18px;\n }\n"]))),Se=(0,u.Z)(C.Z)(Ze||(Ze=(0,a.Z)(["\n .result-footer {\n height: auto;\n }\n"]))),Te=t(31440),Me=t(35432);function Ve(e){var n=e.onClickNext,t=e.handleDescEle,r=e.showPageHeader,a=(0,l.useNavigate)(),i=(0,oe.useState)(null),o=(0,F.Z)(i,2),s=o[0],c=o[1],d=(0,oe.useState)(!1),u=(0,F.Z)(d,2),h=u[0],m=u[1],f=(0,p.PE)().t,x=(0,Z.h6)(),v=x.info,g=x.api,b=(0,_.H0)(),k=b.meta,w=b.isRunning,N=b.isInstalled,E=b.appDid,B=b.isExternal,D=(0,oe.useMemo)((function(){if(!B)return"/blocklets/".concat(E,"/overview");if(!s)return"";var e=new URL(s);return"".concat(e.origin).concat(Me.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin")}),[s,B,E]),L=n||function(){a("/launch-blocklet/install".concat(window.location.search))},U=function(){var e=(0,A.Z)((0,V.Z)().mark((function e(){var n,t,r,a;return(0,V.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,m(!0),e.next=4,g.getBlocklet({input:{did:k.did,attachRuntimeInfo:!0}});case 4:return n=e.sent,t=n.blocklet,r=(0,K.A6)({blocklet:t}),e.next=9,(0,xe.D)(r);case 9:if((a=e.sent)||!ae()(a)){e.next=13;break}return c(null),e.abrupt("return");case 13:c(new URL(a).href),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),W.Z.error(e.t0.message);case 19:return e.prev=19,m(!1),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,16,19,22]])})));return function(){return e.apply(this,arguments)}}();if((0,oe.useEffect)((function(){(w||N&&B)&&U()}),[w,B,N]),N){var z=w?"alreadyRunning":"alreadyInstalled";return(0,O.jsx)(C.Z,{variant:"info",title:f("common.reminder"),subTitle:f("launchBlocklet.".concat(z),{name:(0,P.getDisplayName)({meta:k},!0)}),footer:(0,O.jsxs)(We,{children:[(0,O.jsx)(Pe,{loading:!D,"data-cy":"view-blocklet",component:B?void 0:se.Link,to:D,href:D,variant:w?"outlined":"contained",color:"primary",children:f("launchBlocklet.viewApplication")}),w&&(0,O.jsx)(Pe,{loading:h,className:"last-button",disabled:!s,href:s,"data-cy":"open-blocklet",children:f("common.open")})]})})}return v?(0,O.jsxs)(Ge,{children:[r&&(0,O.jsx)($.Z,{title:f("launchBlocklet.introduction"),subTitle:f("launchBlocklet.welcome")}),(0,O.jsx)(Te.Z,{meta:k,onClickNext:L,handleDescEle:t})]}):(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(j.Z,{})})}Ve.defaultProps={onClickNext:null,handleDescEle:"",showPageHeader:!0};var Ae,Fe,He,Ge=u.Z.div(Ue||(Ue=(0,a.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n"]))),We=u.Z.div(ze||(ze=(0,a.Z)(["\n .MuiButton-root {\n "," {\n min-width: 200px;\n }\n }\n .last-button {\n margin-left: ",";\n }\n"])),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.spacing(2)}));function Ke(){var e=(0,d.Z)((function(e){return e.breakpoints.down("md")})),n=(0,p.PE)(),t=n.t,r=n.locale,a=(0,Z.h6)().info,o=(0,xe.yP)(a),u=(0,_.H0)(),P=u.serverUrl,C=u.fromLauncher,N=u.meta,E=u.isFree,B=u.loading,D=u.error,L=u.storeUrl,U=s()((0,xe.Y5)(),"/launch-blocklet"),z=[{key:"install",name:t("launchBlocklet.steps.installApp"),path:s()(U,"install")},{key:"setup",name:t("setup.steps.launchApp")}],R=[{key:"agreement",name:t("launchBlocklet.introduction"),path:s()(U,"agreement")}].concat(z),I=function(){P&&window.open(P)},S=(0,O.jsx)(Xe,{className:"".concat(P?"logo-can-click":""),children:(0,O.jsx)(k.Z,{onClick:I,logo:e?(0,O.jsx)(v.Z,{width:"32",height:"32"}):(0,O.jsx)(g.Z,{width:"128",height:"48"})})});C&&(R=[{key:"purchase-space",name:t("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:t("launchBlocklet.steps.prepareSpace")}].concat(z),S=(0,O.jsx)(Xe,{className:"".concat(P?"logo-can-click":""),children:(0,O.jsx)(k.Z,{logo:e?(0,O.jsx)(v.Z,{onClick:I,width:"32",height:"32"}):(0,O.jsx)(g.Z,{onClick:I,width:"128",height:"48"}),previousData:{logo:e?(0,O.jsx)(x.Z,{width:"32",height:"32"}):(0,O.jsx)(b.Z,{width:"145",height:"48"})}})}));var T={meta:N,isFree:E};return(0,O.jsx)(m.W,{steps:R,children:(0,O.jsx)(h.Z,{locale:r,loading:B,blockletMeta:(0,i.Z)((0,i.Z)({},N),{},{isFree:E}),useOfSkeleton:!1,navLogo:S,headerEndAddons:(0,O.jsx)(f.Z,{webWalletUrl:o,SessionContext:fe.B3}),pcWidth:"80%",style:{height:"100%"},logoUrl:N&&N.logo?(0,xe.aZ)({did:N.did,baseUrl:L,logoPath:N.logo}):null,children:(0,O.jsxs)(Qe,{children:[(0,O.jsx)(c.Global,{styles:qe}),B&&(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(j.Z,{})}),!B&&D&&(0,O.jsx)(y.Z,{relative:"parent",children:(0,O.jsx)(w.Z,{style:{wordBreak:"break-all"},variant:"icon",type:"error",children:D})}),!B&&!D&&(0,O.jsxs)(l.Routes,{children:[(0,O.jsx)(l.Route,{path:"agreement",element:(0,O.jsx)(Ve,{})}),(0,O.jsx)(l.Route,{path:"install",element:(0,O.jsx)(Le,{})}),(0,O.jsx)(l.Route,{path:"complete",element:(0,O.jsx)(M,{blocklet:T})}),(0,O.jsx)(l.Route,{path:"*",element:(0,O.jsx)(l.Navigate,{to:"agreement".concat(window.location.search),replace:!0})})]})]})})})}var qe=(0,c.css)(Ae||(Ae=(0,a.Z)(["\n html,\n body,\n #root,\n #root > .wrapper {\n height: 100%;\n }\n"]))),Qe=u.Z.div(Fe||(Fe=(0,a.Z)(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n\n .bottom-button {\n min-width: 200px;\n }\n"]))),Xe=u.Z.div(He||(He=(0,a.Z)(["\n margin-top: -1px;\n &.logo-can-click {\n cursor: pointer;\n }\n"])))},31440:function(e,n,t){t.d(n,{Z:function(){return x}});var r,a=t(71171),i=t(55898),l=t.n(i),o=t(85493),s=t(33518),c=t(68420),d=t(40265),u=t(44566),p=t(33028),h=t(33665),m=t(96266);function f(e){var n=Object.assign({},((0,h.Z)(e),e));return(0,m.jsxs)("div",(0,p.Z)((0,p.Z)({},n),{},{style:{width:"100%"},children:[(0,m.jsx)("h3",{children:"End User License Agreement for Application"}),(0,m.jsx)("p",{children:"Blocklet Server License Agreement ArcBlock, Inc. version 2020-08-28"}),(0,m.jsx)("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),(0,m.jsx)("p",{children:"\u6682\u65e0"})]}))}function x(e){var n=e.meta,t=e.onClickNext,r=e.handleDescEle,a=(0,o.useNavigate)(),i=(0,c.PE)(),l=i.t,s=i.locale,p=t||function(){a("/launch-blocklet/install".concat(window.location.search))};return(0,m.jsxs)(v,{children:[(0,m.jsx)("div",{className:"app-content",children:(0,m.jsx)("div",{className:"agreement",children:(0,m.jsx)("div",{className:"agreement-content",children:(0,m.jsx)(u.Z,{blockletMeta:{data:n},locale:s,handleDescEle:r})})})}),(0,m.jsx)("div",{className:"button-container","data-cy":"agree-all",children:(0,m.jsx)(d.Z,{onContinue:p,description:(0,m.jsx)(f,{}),texts:{listenName:l("launchBlocklet.license"),buttonNext:l("launchBlocklet.next")}})})]})}x.propTypes={meta:l().object.isRequired,onClickNext:l().func,handleDescEle:l().node},x.defaultProps={onClickNext:null,handleDescEle:""};var v=s.Z.div(r||(r=(0,a.Z)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n flex: 1;\n .app-content {\n padding: 2px 24px 24px;\n "," {\n padding-top: 10px;\n }\n width: 100%;\n flex: 1;\n letter-spacing: normal;\n }\n .agreement {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n border: 1px solid ",";\n border-radius: 12px;\n "," {\n margin-top: 24px;\n }\n "," {\n margin-top: 16px;\n }\n .agreement-content {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n font-size: 14px;\n overflow-y: auto;\n "," {\n padding: 0 24px;\n }\n "," {\n padding: 0 16px;\n }\n &:after {\n display: block;\n content: '';\n height: 24px;\n }\n }\n }\n .button-container {\n padding-top: 24px;\n padding-bottom: 34px;\n "," {\n padding-right: 24px;\n margin-left: auto;\n }\n "," {\n padding-top: 0;\n padding-bottom: 16px;\n }\n }\n"])),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.palette.grey[100]}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}),(function(e){return e.theme.breakpoints.up("md")}),(function(e){return e.theme.breakpoints.down("md")}))},28864:function(e,n,t){n.Z=void 0;(r=t(5057))&&r.__esModule;var r,a=t(96266);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function o(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s=function(e){return(0,a.jsxs)("svg",l(l({},e),{},{children:[(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M80.005 25.994V10h7.737a3.79 3.79 0 0 1 3.79 3.79v1.149a3.777 3.777 0 0 1-1.035 2.602 3.788 3.788 0 0 1 1.901 3.286v1.377a3.79 3.79 0 0 1-3.79 3.79h-8.603zm1.684-8.957h6.226a2.105 2.105 0 0 0 1.932-2.098v-1.15a2.105 2.105 0 0 0-2.105-2.105h-6.053v5.353zm0 7.273v-5.582l6.92-.007c1.163 0 2.105.943 2.105 2.106v1.377a2.105 2.105 0 0 1-2.105 2.106h-6.92zM97.255 10v15.994h-1.762V10h1.762zm8.733 4.319h-1.827a3.81 3.81 0 0 0-3.811 3.81v4.054a3.81 3.81 0 0 0 3.811 3.81h1.827a3.811 3.811 0 0 0 3.811-3.81V18.13a3.811 3.811 0 0 0-3.811-3.81zm-1.827 1.762a2.05 2.05 0 0 0-2.049 2.048v4.054a2.05 2.05 0 0 0 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049V18.13a2.048 2.048 0 0 0-2.048-2.048h-1.827zM125.204 26v-5.754h2.148L130.674 26h2.035l-3.821-6.618 2.993-5.184h-2.035l-2.474 4.286h-2.168V10h-1.762v16h1.762zm-5.556-7.56v-.31a2.048 2.048 0 0 0-2.048-2.05h-1.827a2.048 2.048 0 0 0-2.049 2.05v4.053c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.312h-1.762zm17.918 7.554V10h-1.762v15.994h1.762zm4.989-5.357v1.546c0 1.132.917 2.049 2.049 2.049h1.827a2.048 2.048 0 0 0 2.048-2.049v-.311h1.762v.311a3.81 3.81 0 0 1-3.81 3.81h-1.827a3.81 3.81 0 0 1-3.811-3.81V18.13a3.81 3.81 0 0 1 3.811-3.81h1.827a3.81 3.81 0 0 1 3.81 3.81v.746h.001v1.762h-7.687zm5.924-1.762h-5.924v-.746c0-1.131.917-2.048 2.049-2.048h1.827c1.131 0 2.048.917 2.048 2.048v.746zm5.489-1.912H152.4v-1.762h1.568v-2.848h1.684v2.848h4.077v1.762h-4.077v5.677a1.669 1.669 0 1 0 3.339 0v-.35h1.684v.35a3.353 3.353 0 1 1-6.707 0v-5.677z",fill:"#121319"}),(0,a.jsx)("path",{d:"M92.112 50.259v3.108H80.254V33.123h3.766v17.136h8.092zM101.843 47.235c-.999.047-1.839.135-2.52.266-.681.121-1.227.28-1.638.476-.41.196-.705.425-.882.686a1.49 1.49 0 0 0-.266.854c0 .606.177 1.04.532 1.302.364.261.835.392 1.414.392.71 0 1.32-.126 1.834-.378.523-.261 1.031-.654 1.526-1.176v-2.422zm-7.924-6.23c1.652-1.512 3.64-2.268 5.964-2.268.84 0 1.591.14 2.254.42.663.27 1.223.653 1.68 1.148a4.765 4.765 0 0 1 1.036 1.75c.243.681.364 1.428.364 2.24v9.072h-1.568c-.327 0-.579-.047-.756-.14-.177-.103-.317-.303-.42-.602l-.308-1.036c-.364.327-.719.616-1.064.868a6.54 6.54 0 0 1-1.078.616 5.498 5.498 0 0 1-1.204.378c-.42.093-.887.14-1.4.14-.607 0-1.167-.08-1.68-.238a3.775 3.775 0 0 1-1.33-.742 3.297 3.297 0 0 1-.868-1.218c-.206-.486-.308-1.05-.308-1.694a3.308 3.308 0 0 1 .77-2.114 5.12 5.12 0 0 1 1.078-.924c.438-.29.975-.541 1.61-.756a13.74 13.74 0 0 1 2.24-.518c.85-.14 1.82-.224 2.912-.252v-.84c0-.962-.205-1.67-.616-2.128-.411-.467-1.003-.7-1.778-.7-.56 0-1.027.065-1.4.196-.364.13-.686.28-.966.448-.28.159-.537.303-.77.434-.224.13-.476.196-.756.196-.243 0-.448-.06-.616-.182a1.67 1.67 0 0 1-.406-.448l-.616-1.106zM120.85 39.003v14.364h-2.114c-.458 0-.747-.21-.868-.63l-.238-1.148a7.862 7.862 0 0 1-1.946 1.456c-.71.364-1.545.546-2.506.546-.784 0-1.48-.13-2.086-.392a4.236 4.236 0 0 1-1.512-1.134 5.016 5.016 0 0 1-.938-1.722 7.52 7.52 0 0 1-.308-2.212v-9.128h3.458v9.128c0 .877.2 1.559.602 2.044.41.476 1.022.714 1.834.714.597 0 1.157-.13 1.68-.392a6.037 6.037 0 0 0 1.484-1.106V39.003h3.458zM127.512 40.767c.29-.29.593-.556.91-.798a5.623 5.623 0 0 1 2.184-1.036 5.542 5.542 0 0 1 1.344-.154c.784 0 1.48.135 2.086.406a3.957 3.957 0 0 1 1.512 1.12 4.69 4.69 0 0 1 .924 1.722c.215.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.2-1.554-.602-2.03-.401-.486-1.012-.728-1.834-.728-.597 0-1.157.135-1.68.406-.522.27-1.017.64-1.484 1.106v10.388h-3.458V39.003h2.114c.448 0 .742.21.882.63l.238 1.134zM150.373 42.04c-.103.132-.205.234-.308.309-.093.075-.233.112-.42.112a.982.982 0 0 1-.518-.154 9.315 9.315 0 0 0-.602-.364 3.902 3.902 0 0 0-.84-.364c-.317-.112-.714-.168-1.19-.168-.607 0-1.139.112-1.596.336-.457.215-.84.527-1.148.938-.299.41-.523.91-.672 1.498-.149.578-.224 1.236-.224 1.974 0 .765.079 1.447.238 2.044.168.597.406 1.101.714 1.512.308.401.681.71 1.12.924.439.205.933.308 1.484.308.551 0 .994-.066 1.33-.196.345-.14.635-.29.868-.448.233-.168.434-.318.602-.448a.925.925 0 0 1 .588-.21c.28 0 .49.107.63.322l.994 1.26a6.449 6.449 0 0 1-1.246 1.134 7.144 7.144 0 0 1-1.4.728 7.208 7.208 0 0 1-1.484.378 10.3 10.3 0 0 1-1.512.112 6.448 6.448 0 0 1-2.506-.49 6 6 0 0 1-2.058-1.456c-.588-.635-1.055-1.41-1.4-2.324-.336-.924-.504-1.974-.504-3.15 0-1.055.149-2.03.448-2.926.308-.906.756-1.685 1.344-2.338a6.09 6.09 0 0 1 2.184-1.554c.868-.373 1.867-.56 2.996-.56 1.073 0 2.011.172 2.814.518.812.345 1.54.84 2.184 1.484l-.91 1.26zM157.049 40.543a7.51 7.51 0 0 1 1.848-1.274c.672-.327 1.46-.49 2.366-.49.784 0 1.479.135 2.086.406.606.261 1.11.634 1.512 1.12.41.476.718 1.05.924 1.722.214.663.322 1.395.322 2.198v9.142h-3.458v-9.142c0-.878-.201-1.554-.602-2.03-.402-.486-1.013-.728-1.834-.728-.598 0-1.158.135-1.68.406-.523.27-1.018.64-1.484 1.106v10.388h-3.458V32.563h3.458v7.98zM178.649 44.533a3.95 3.95 0 0 0-.196-1.26 2.908 2.908 0 0 0-.559-1.05 2.562 2.562 0 0 0-.967-.7c-.382-.178-.83-.266-1.343-.266-.999 0-1.788.285-2.367.854-.569.57-.933 1.377-1.091 2.422h6.523zm-6.593 2.086c.056.737.186 1.377.392 1.918.205.532.475.975.811 1.33.336.345.733.607 1.191.784.466.168.98.252 1.54.252s1.04-.066 1.442-.196c.41-.13.765-.276 1.063-.434.308-.159.575-.304.799-.434.233-.13.457-.196.671-.196.29 0 .504.107.644.322l.995 1.26a5.93 5.93 0 0 1-1.289 1.134 7.641 7.641 0 0 1-1.498.728 8.291 8.291 0 0 1-1.581.378c-.532.074-1.05.112-1.554.112a7.766 7.766 0 0 1-2.786-.49 6.352 6.352 0 0 1-2.24-1.47c-.635-.653-1.134-1.456-1.498-2.408-.364-.962-.546-2.072-.546-3.332 0-.98.158-1.9.476-2.758.317-.868.77-1.62 1.358-2.254a6.462 6.462 0 0 1 2.17-1.526c.858-.373 1.824-.56 2.898-.56.905 0 1.74.144 2.506.434a5.41 5.41 0 0 1 1.973 1.274c.551.55.981 1.232 1.289 2.044.317.803.475 1.722.475 2.758 0 .523-.055.877-.167 1.064-.112.177-.327.266-.644.266h-8.89zM187.615 41.495c.448-.859.98-1.53 1.596-2.016.616-.495 1.344-.742 2.184-.742.662 0 1.194.145 1.596.434l-.224 2.59c-.047.168-.117.29-.21.364a.558.558 0 0 1-.35.098c-.14 0-.35-.023-.63-.07a4.704 4.704 0 0 0-.798-.07c-.383 0-.724.056-1.022.168-.299.112-.57.275-.812.49a3.359 3.359 0 0 0-.63.756c-.178.298-.346.64-.504 1.022v8.848h-3.458V39.003h2.03c.354 0 .602.065.742.196.14.121.233.345.28.672l.21 1.624z",fill:"#121319"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 10.642L30.72 0 12.288 10.642v14.152L0 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L61.44 53.172V31.89l-12.288-7.095V10.642zM59.52 32.997l-12.288-7.094V11.75L30.72 2.217 14.208 11.75v14.153L1.92 32.997v19.067l16.512 9.533L30.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_416)"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.152 24.83L30.72 14.19 12.288 24.831v21.283L30.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L30.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L28.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L37.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_416)"}),(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"paint0_linear_615_416",x1:"30.72",y1:"95.721",x2:"94.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,a.jsxs)("linearGradient",{id:"paint1_linear_615_416",x1:"27.437",y1:"99.246",x2:"97.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};s.defaultProps={width:"193",height:"64",viewBox:"0 0 193 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s.displayName="launcher-logo";var c=s;n.Z=c},15959:function(e,n,t){n.Z=void 0;(r=t(5057))&&r.__esModule;var r,a=t(96266);function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function o(e,n,t){return(n=function(e){var n=function(e,n){if("object"!==typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var s=function(e){return(0,a.jsxs)("svg",l(l({},e),{},{children:[(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.642L31.72 0 13.288 10.642v14.152L1 31.89v21.283l18.432 10.642 12.258-7.077.03.017.03-.017 12.258 7.077L62.44 53.172V31.89l-12.288-7.095V10.642zM60.52 32.997l-12.288-7.094V11.75L31.72 2.217 15.208 11.75v14.153L2.92 32.997v19.067l16.512 9.533L31.69 54.52l.03.017.03-.017 12.258 7.077 16.512-9.533V32.997z",fill:"url(#paint0_linear_615_428)"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 24.83L31.72 14.19 13.288 24.831v21.283L31.72 56.756l18.432-10.642V24.831zm-34.944 1.11l16.512-9.534 16.512 9.533v19.067L31.72 54.539l-16.512-9.533V25.939zm14.52-3.756l.484.284 12.202 7.142 1.073.61V40.4l-.408.287-.461.32-12.89 7.545-7.743-4.503.02-17.35 7.722-4.516zm-5.822 20.762l.017-15.145 5.804-3.393 11.728 6.866.112.063v8.066L29.725 46.33l-5.819-3.384zm4.04-12.717l1.442-.827L38.2 34.53v1.66l-8.845 5.146-1.443-.833.034-10.273zm7.862 5.133l-5.971 3.474.023-6.935 5.948 3.46z",fill:"url(#paint1_linear_615_428)"}),(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"paint0_linear_615_428",x1:"31.72",y1:"95.721",x2:"95.488",y2:"34.325",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,a.jsxs)("linearGradient",{id:"paint1_linear_615_428",x1:"28.437",y1:"99.246",x2:"98.761",y2:"44.937",gradientUnits:"userSpaceOnUse",children:[(0,a.jsx)("stop",{stopColor:"#0FA4B7"}),(0,a.jsx)("stop",{offset:".495",stopColor:"#1DC1C7"}),(0,a.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};s.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s.displayName="launcher-logo-notext";var c=s;n.Z=c},33665:function(e,n,t){function r(e){if(null==e)throw new TypeError("Cannot destructure "+e)}t.d(n,{Z:function(){return r}})}}]);
|