@abtnode/blocklet-services 1.16.38-beta-20250110-093740-edc58f78 → 1.16.38-beta-20250114-011103-277f0108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/libs/connect/session.js +47 -9
- package/api/routes/oauth.js +5 -7
- package/api/routes/user.js +6 -8
- package/dist/assets/{access-control-DcliPEX2.js → access-control-DYH-J6hX.js} +1 -1
- package/dist/assets/{add-component-core-DSlHbXth.js → add-component-core-BWkCzqAe.js} +1 -1
- package/dist/assets/{add-resource-B9SUcn9b.js → add-resource-gJH8Kf-h.js} +1 -1
- package/dist/assets/{analytics-BVmtToBr.js → analytics-Bv-kTIMo.js} +1 -1
- package/dist/assets/{audit-logs-DOpEhbRi.js → audit-logs-1KlkVb5T.js} +1 -1
- package/dist/assets/{branding-BIbnR-Yt.js → branding-CKhye1G1.js} +2 -2
- package/dist/assets/{bundle-avatar-DqROxHMq.js → bundle-avatar-B19h7IBb.js} +1 -1
- package/dist/assets/{complete-B_C_fwut.js → complete-XH7CJJ1E.js} +1 -1
- package/dist/assets/{component-eAmweIYL.js → component-B4nl0OGh.js} +1 -1
- package/dist/assets/{config-CWoxBu0J.js → config-B8mAOrZA.js} +1 -1
- package/dist/assets/{config-navigation-jKhcoDId.js → config-navigation-Y__TwRFz.js} +3 -3
- package/dist/assets/{config-space-Dofzrh5m.js → config-space-DJZf5rEq.js} +1 -1
- package/dist/assets/{confirm-C0rryr4e.js → confirm-CucPiuHr.js} +1 -1
- package/dist/assets/{connect-Wiz0Gw9I.js → connect-CPSe4Vws.js} +1 -1
- package/dist/assets/{connect-CfWNBUY4.js → connect-DH0hj2CX.js} +1 -1
- package/dist/assets/{connect-to-Dsq1ST9l.js → connect-to-DfzH7XJt.js} +1 -1
- package/dist/assets/{dashboard-Ca8O6iHB.js → dashboard-D7XqaqMa.js} +3 -3
- package/dist/assets/{domain-DJyjDPmO.js → domain-D80mBbZ5.js} +1 -1
- package/dist/assets/{domain-list-BEjAE8hh.js → domain-list-DGgkgu6r.js} +1 -1
- package/dist/assets/{email-C3ggDSGp.js → email-C1ha_p9W.js} +1 -1
- package/dist/assets/{exchange-passport-4QuzoW2F.js → exchange-passport-4uu5i0rP.js} +1 -1
- package/dist/assets/{form-text-input-CT57jMfW.js → form-text-input-DB90dWTR.js} +1 -1
- package/dist/assets/{fuel-CJ-CsgDu.js → fuel-PiarpzYg.js} +1 -1
- package/dist/assets/{index-CQT4qLcx.js → index-8ktBk2aq.js} +1 -1
- package/dist/assets/{index-CrvlY8Z5.js → index-B5PaGLoo.js} +1 -1
- package/dist/assets/{index-CqPx8QUY.js → index-BCUhK2IK.js} +1 -1
- package/dist/assets/{index-l4yaELph.js → index-BPFeU32W.js} +1 -1
- package/dist/assets/{index-BZnWmdZ0.js → index-BdipdMDv.js} +1 -1
- package/dist/assets/{index-BPF3oif7.js → index-CYcUSW9Y.js} +5 -5
- package/dist/assets/{index-IdPbsC-k.js → index-Cn9hlGXz.js} +1 -1
- package/dist/assets/{index-DMelUylN.js → index-D97FQw7_.js} +3 -3
- package/dist/assets/{index-BQxL3qXG.js → index-DDHKg1sP.js} +1 -1
- package/dist/assets/{index-wG4Kh8A_.js → index-DgZ1ypbb.js} +3 -3
- package/dist/assets/{index-Bxg1LKG8.js → index-N-iuMUsJ.js} +1 -1
- package/dist/assets/{index-ROkOEO9F.js → index-PIIZTXU1.js} +1 -1
- package/dist/assets/{invitation-Dn2JFqk3.js → invitation-D0h9V7Yr.js} +1 -1
- package/dist/assets/{invite-k-THgUaE.js → invite-CLadQHSg.js} +1 -1
- package/dist/assets/{issue-passport-Cp0z7zOC.js → issue-passport-DOvL3-GM.js} +1 -1
- package/dist/assets/{item-DqTNLhw3.js → item-BKMUYpdp.js} +1 -1
- package/dist/assets/{layout-BRN0uPvp.js → layout-Bb4get3W.js} +1 -1
- package/dist/assets/{log-D1ShKaDY.js → log-r4HRH3tf.js} +1 -1
- package/dist/assets/{login-D9awP98G.js → login-IiYHalJQ.js} +1 -1
- package/dist/assets/{logo-uploader-BA8U554_.js → logo-uploader-C1-XCCMv.js} +3 -3
- package/dist/assets/{lost-passport-kJqVsdV1.js → lost-passport-EcYlR7v6.js} +1 -1
- package/dist/assets/open-window-B-5Hms7z.js +1 -1
- package/dist/assets/{overview-4bff7RWe.js → overview-Bc6RN_5G.js} +1 -1
- package/dist/assets/{publish-resource-BhQQlAPL.js → publish-resource-cSMHC1nt.js} +1 -1
- package/dist/assets/{relative-time-BXb5Mt72.js → relative-time-BzZIQh7e.js} +1 -1
- package/dist/assets/{setup-DTQXAoXZ.js → setup-CdCyHLLn.js} +3 -3
- package/dist/assets/{start-DNpygdxp.js → start-owo1aKq8.js} +1 -1
- package/dist/assets/{step-actions-ClTz1KhK.js → step-actions-DnckX9Zh.js} +1 -1
- package/dist/assets/{transfer-A_yTwCWw.js → transfer-De5_Rua8.js} +1 -1
- package/dist/assets/{unsubscribe-uaBnibKD.js → unsubscribe-B0kFTEaS.js} +1 -1
- package/dist/assets/{user-center-B3stHKHJ.js → user-center-B9_0ML8Q.js} +1 -1
- package/dist/assets/{util-ao8gSgii.js → util-Ci0WMGC4.js} +1 -1
- package/dist/assets/{wrap-locale-DNve09jN.js → wrap-locale-D_rplmnG.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/share/shared-service-worker.js +60 -2
- package/package.json +21 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{aa as s,a3 as d,E as o,j as i}from"./vendor-mui-core-BlX2BJoA.js";import{_ as q}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D97FQw7_.js","assets/vendor-arcblock-CiLB_TiI.js","assets/vendor-react-D-afvo_7.js","assets/vendor-utils-DCpRgzMR.js","assets/vendor-hooks-CLzfFpO7.js","assets/vendor-mui-core-BlX2BJoA.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-BGO2DsWz.js","assets/index-DgZ1ypbb.js","assets/_createAggregator-B4i0o6gy.js","assets/index-DoZ2YM4T.js","assets/toUpper-BQrWudMF.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aa as s,a3 as d,E as o,j as i}from"./vendor-mui-core-BlX2BJoA.js";import{_ as q}from"./index-DgZ1ypbb.js";import{r as u}from"./vendor-react-D-afvo_7.js";import{j}from"./vendor-utils-DCpRgzMR.js";import{g as z,bl as S}from"./vendor-arcblock-CiLB_TiI.js";import{c as E}from"./index-DoZ2YM4T.js";const O=s.span`
|
|
3
3
|
color: ${e=>e.theme.palette.error.main};
|
|
4
4
|
&::before {
|
|
5
5
|
content: '*';
|
|
@@ -100,7 +100,7 @@ import{aa as s,a3 as d,E as o,j as i}from"./vendor-mui-core-BlX2BJoA.js";import{
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
`,_=u.lazy(()=>q(()=>import("./index-
|
|
103
|
+
`,_=u.lazy(()=>q(()=>import("./index-D97FQw7_.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.Uploader}))),F="/blocklet/logo/upload";function f({url:e,height:c,width:m,enabled:l,allowSVG:h,type:t,did:a,prefix:g,headers:x,aspectRatio:p,minWidth:b,minHeight:w,onUploaded:v}){const{t:y}=z(),n=u.useRef(null),R=()=>{var r;(r=n.current)==null||r.open()},k=()=>{var r;v(),(r=n.current)==null||r.close()},P={cursor:l?"pointer":"default","&::after":{content:`"${y("common.switch")}"`}},$=["square","favicon"].includes(t);return i.jsxs(U,{id:`uploader-${a}-${t}`,children:[i.jsx(_,{ref:n,popup:!0,onUploadFinish:k,plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:j(g,F,t,a),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:h?["image/*","application/svg+xml"]:["image/*"],maxFileSize:1024*1024*1,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:p,initialAspectRatio:p,croppedCanvasOptions:{minWidth:b,minHeight:w}}},tusProps:{headers:x}}),i.jsx(d,{className:E("uploader-wrapper",l&&"enabled"),sx:P,onClick:R,children:i.jsx("img",{alt:t,src:e,style:{width:$?m:"auto",height:c}})})]},`uploader-${a}-${t}`)}f.propTypes={url:o.string.isRequired,type:o.oneOf(["square","rect","favicon","splash-portrait","splash-landscape","og-image"]).isRequired,did:o.string.isRequired,prefix:o.string.isRequired,headers:o.func,onUploaded:o.func,height:o.number,width:o.any,enabled:o.bool,allowSVG:o.bool,aspectRatio:o.number,minWidth:o.number,minHeight:o.number};f.defaultProps={height:80,width:"auto",enabled:!0,allowSVG:!0,headers:()=>({}),onUploaded:S,aspectRatio:1,minWidth:120,minHeight:120};const U=s.div`
|
|
104
104
|
.uploader-wrapper {
|
|
105
105
|
display: inline-flex;
|
|
106
106
|
position: relative;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DVYdq7IA.js","assets/vendor-react-D-afvo_7.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a1 as F,j as t,aa as W,E as v,t as H,a3 as d,aM as X,T as I,bt as B,bu as q,bv as G,aE as O}from"./vendor-mui-core-BlX2BJoA.js";import{i as _,_ as V,S as J,c as Q,s as K,a as Y}from"./index-
|
|
2
|
+
import{a1 as F,j as t,aa as W,E as v,t as H,a3 as d,aM as X,T as I,bt as B,bu as q,bv as G,aE as O}from"./vendor-mui-core-BlX2BJoA.js";import{i as _,_ as V,S as J,c as Q,s as K,a as Y}from"./index-DgZ1ypbb.js";import{r as u,L as Z}from"./vendor-react-D-afvo_7.js";import{d as ee}from"./CheckCircle-BElcljFC.js";import{d as te}from"./ViewList-IMqkd2Sv.js";import{ad as se,ae,af as oe,W as ne,ab as $,ag as M,ah as re,ac as ie,g as ce,P as le}from"./vendor-arcblock-CiLB_TiI.js";import{d as pe}from"./Done-BCESxXX2.js";import{k as de,H as ue}from"./vendor-hooks-CLzfFpO7.js";import{W as me}from"./did-address-49U3oRW2.js";import{w as he}from"./wrap-locale-D_rplmnG.js";import{u as fe}from"./use-passport-id-B-b-_oYF.js";import{g as xe}from"./get-safe-url-CVhAz4Qr.js";import"./vendor-utils-DCpRgzMR.js";var S={},ge=F;Object.defineProperty(S,"__esModule",{value:!0});var E=S.default=void 0,ve=ge(se()),be=t;E=S.default=(0,ve.default)((0,be.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function k({list:s,width:c,height:m,cardSpace:l,onSelect:r,defaultIndex:h}){const[b,f]=u.useState(0),[a,x]=u.useState(0),w=u.useRef(null),g=n=>{if(n<0||n>s.length-1)return;f(n);const i=w.current.clientWidth;x(n*(c+l)-(i-c)/2+l*.5),r(n)};u.useEffect(()=>{g(h);const n=i=>i.preventDefault();w.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const j=n=>{o=n.touches[0].clientX},y=n=>{const i=n.changedTouches[0],P=o-i.clientX;Math.abs(P)>60&&(P>0?g(b+1):g(b-1))};return t.jsx(we,{ref:w,onTouchStart:j,onTouchEnd:y,children:t.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:s.map((n,i)=>t.jsx("div",{className:`card-item ${i===b?"selected":""}`,style:{width:c,height:m,margin:l/2},onClick:()=>g(i),children:n.display?t.jsx("div",{className:"card-content",children:t.jsx(ae,{data:n.display,style:{width:"100%",height:"100%"}})}):t.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const we=W.div`
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
5
5
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./vendor-mui-core-BlX2BJoA.js";import{r as t}from"./vendor-react-D-afvo_7.js";import{g as i}from"./get-safe-url-
|
|
1
|
+
import{j as c}from"./vendor-mui-core-BlX2BJoA.js";import{r as t}from"./vendor-react-D-afvo_7.js";import{g as i}from"./get-safe-url-RTzyOi09.js";import"./vendor-arcblock-CiLB_TiI.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";function g(){const e=t.useRef(null),n=t.useRef(Date.now());return t.useEffect(()=>{const r=`open-window-url-${new URLSearchParams(window.location.search).get("key")}`;return e.current=setInterval(()=>{if(Date.now()-n.current>10*1e3){localStorage.removeItem(r),clearInterval(e.current);return}const o=localStorage.getItem(r);if(o)try{const{url:a,time:s}=JSON.parse(o);localStorage.removeItem(r),Date.now()-s<10*1e3&&(window.location.href=i(a,{allowDomains:null}))}catch{}},200),()=>clearInterval(e.current)},[]),c.jsx("div",{})}export{g as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,a3 as k,a4 as D,aa as b,T as A}from"./vendor-mui-core-BlX2BJoA.js";import{r as S}from"./vendor-react-D-afvo_7.js";import{g as T,bI as B,ag as C,b2 as g,aq as L}from"./vendor-arcblock-CiLB_TiI.js";import{K as N}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as P}from"./index-mnKcDZP2.js";import{y as q,B as E,f as Q,I as R,v as K,m as W}from"./index-
|
|
1
|
+
import{j as o,a3 as k,a4 as D,aa as b,T as A}from"./vendor-mui-core-BlX2BJoA.js";import{r as S}from"./vendor-react-D-afvo_7.js";import{g as T,bI as B,ag as C,b2 as g,aq as L}from"./vendor-arcblock-CiLB_TiI.js";import{K as N}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{I as P}from"./index-mnKcDZP2.js";import{y as q,B as E,f as Q,I as R,v as K,m as W}from"./index-DgZ1ypbb.js";import{W as r}from"./did-address-49U3oRW2.js";import{B as _}from"./dashboard-D7XqaqMa.js";import{a as z}from"./domain-list-DGgkgu6r.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";import"./useLocalStorage-CSyjxtUy.js";import"./confirm-CucPiuHr.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-oA7gV2MA.js";import"./get-safe-url-CVhAz4Qr.js";import"./index-8ktBk2aq.js";import"./session-ocxAyn6f.js";import"./useAsyncRetry-KXMle3o0.js";import"./useAsync-cdOzMWPw.js";import"./useSetState-Crt4S51m.js";import"./Add-2VCvBnGd.js";import"./base32-COJTblwx.js";import"./LockIcon-DQtUl5vk.js";import"./CheckCircle-BElcljFC.js";import"./util-Ci0WMGC4.js";import"./permission-SgzW7fBj.js";import"./InfoOutlined-BFP30UJa.js";import"./api-C0C4sDJA.js";import"./actions-BEpPU26q.js";import"./MoreHoriz-DnFq43xg.js";const H={width:24,height:24,body:'<path fill="currentColor" d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 10.8Z"/>'},O=H,$={arcblock:"ArcBlock",ethereum:"Ethereum"};function F(){var u,h,x,f,v;const{t,locale:j}=T(),{info:c,inService:w}=q(),[a,I]=S.useState(!1),{blocklet:e}=E(),{appDid:l,appPid:m,migratedFrom:s=[]}=e,p=(u=e.environments.find(n=>n.key==="BLOCKLET_APP_CHAIN_TYPE"))==null?void 0:u.value,d=[l?{name:t("blocklet.appId"),value:o.jsx(r,{did:l,showQrcode:!0})}:null,m&&l!==m?{name:o.jsxs(k,{sx:{display:"flex",alignItems:"center",gap:1},children:[t("blocklet.appPid"),o.jsx(D,{title:t("blocklet.whyNeedAppPid"),style:{cursor:"help",fontSize:16},children:o.jsx(B,{})})]}),value:o.jsx(r,{did:m,showQrcode:!0})}:null,(s==null?void 0:s.length)>1?{name:t("blocklet.alsoKnownAs"),value:o.jsxs("div",{children:[(a?s.slice(1):s.slice(1,2)).map(n=>o.jsx(r,{did:n.appDid,showQrcode:!0})),s.length>2&&o.jsx(C,{style:{marginLeft:"18px"},endIcon:a?o.jsx(g,{icon:O}):o.jsx(g,{icon:N}),onClick:()=>I(!a),children:t(a?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,{name:t("common.name"),value:Q.getDisplayName(e,!0)},{name:t("common.status"),value:o.jsx(_,{status:e.status,source:e.source,progress:e.progress})},R(e)?{name:"NFT",value:o.jsx(r,{external:!0,href:K((h=e==null?void 0:e.controller)==null?void 0:h.chainHost,(x=e==null?void 0:e.controller)==null?void 0:x.nftId,"asset"),did:(f=e==null?void 0:e.controller)==null?void 0:f.nftId,showQrcode:!0})}:null,{name:t("blocklet.installedAt"),value:W(e.installedAt,j)},{name:t("common.owner"),value:(v=e.settings)!=null&&v.owner?o.jsx(r,{did:e.settings.owner.did,showQrcode:!0}):"-"},{name:t("blocklet.config.walletType.name"),value:$[p||"arcblock"]||p},e.externalSkSource?{name:t("blocklet.skSource"),value:e.externalSkSource}:null].filter(Boolean);w&&d.push({name:t("common.serverDid"),value:o.jsx(r,{did:c.did,showQrcode:!0})},{name:t("common.serverVersion"),value:o.jsx(L,{children:c.version})});const y=n=>n.map(i=>o.jsx(P,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:i.name,nameFormatter:()=>i.name,children:i.value},i.name));return o.jsxs(U,{component:"div",children:[o.jsx(z,{}),o.jsx("div",{className:"title",children:o.jsx("span",{children:t("common.basicInfo")})}),o.jsx("div",{className:"basicInfo",children:y(d)})]})}F.propTypes={};const U=b(A)`
|
|
2
2
|
.title {
|
|
3
3
|
font-size: 1.2rem;
|
|
4
4
|
font-weight: bold;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as n,j as i,a3 as l}from"./vendor-mui-core-BlX2BJoA.js";import{l as d,r as c}from"./vendor-react-D-afvo_7.js";import{g as u,al as h}from"./vendor-arcblock-CiLB_TiI.js";import g from"./index-
|
|
1
|
+
import{t as n,j as i,a3 as l}from"./vendor-mui-core-BlX2BJoA.js";import{l as d,r as c}from"./vendor-react-D-afvo_7.js";import{g as u,al as h}from"./vendor-arcblock-CiLB_TiI.js";import g from"./index-CYcUSW9Y.js";import"./vendor-utils-DCpRgzMR.js";import"./vendor-hooks-CLzfFpO7.js";import"./index-DgZ1ypbb.js";import"./Add-2VCvBnGd.js";import"./Error-CpAOVH8t.js";import"./confirm-CucPiuHr.js";import"./format-error-C0Ke3VXF.js";import"./session-ocxAyn6f.js";import"./did-address-49U3oRW2.js";import"./react-beautiful-dnd.esm-C8vTtkBe.js";import"./raf-schd.esm-Cxhj8umC.js";import"./bundle-avatar-B19h7IBb.js";import"./shorten-label-BnvWOC_s.js";import"./Download-BJmwtO6i.js";import"./QuestionMarkCircle-gL_QM35Z.js";import"./useSetState-Crt4S51m.js";import"./index-DoZ2YM4T.js";import"./index-DQSF6ElG.js";import"./index-N-iuMUsJ.js";import"./api-C0C4sDJA.js";import"./ChevronRight-B8pf890W.js";import"./vendor-mui-x-Bq1FyQ7S.js";import"./DeleteOutline-VzoIEqow.js";import"./item-BKMUYpdp.js";import"./Launch-BOCFiYoz.js";import"./Done-BCESxXX2.js";import"./click-to-copy-DNu8CktB.js";import"./get-safe-url-CVhAz4Qr.js";import"./ArrowDropDown-BdHlAt9a.js";import"./index-Bi1xb9O8.js";import"./index-D7mJIWyJ.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function _(){const{t:p}=u(),{componentDid:o}=d(),a=n(t=>t.breakpoints.down("md")),m=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:m,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d}from"./vendor-react-D-afvo_7.js";import{E as u,j as o,a4 as T}from"./vendor-mui-core-BlX2BJoA.js";import{p as h}from"./index-
|
|
1
|
+
import{r as d}from"./vendor-react-D-afvo_7.js";import{E as u,j as o,a4 as T}from"./vendor-mui-core-BlX2BJoA.js";import{p as h}from"./index-8ktBk2aq.js";import{g as w}from"./vendor-arcblock-CiLB_TiI.js";import{m as x,F as g}from"./index-DgZ1ypbb.js";function y({value:e,shouldUpdate:l=!1,...c}){const{t:i,locale:a}=w(),[I,v]=d.useState(1e3);if(d.useEffect(()=>{let t;if(l){const j=new Date(e).getTime(),p=Date.now(),f=Math.abs(Math.floor((j-p)/1e3)),s=()=>{v(p)};f<60?t=setInterval(s,1e3):f<60*60?t=setInterval(s,6e4):t=setInterval(s,36e5)}return()=>{clearInterval(t)}},[e,I,l]),!e)return"-";const m={locale:g(a),compact:!0},n=new Date(e).getTime(),r=Date.now();if(n>r){const t=h(n-r,m);return o.jsx(T,{title:x(e,a),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.afterTime",{time:t})})})}const D=h(r-n,m);return o.jsx(T,{title:x(e,a),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.timeAgo",{time:D})})})}y.propTypes={value:u.any,shouldUpdate:u.bool};y.defaultProps={value:"",shouldUpdate:!1};export{y as R};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-
|
|
2
|
-
import{o as X,u as J,p as A,q as Y,r as ee,P as D,N as te,f as se,S as oe,_ as m,h as j}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/connect-CPSe4Vws.js","assets/vendor-mui-core-BlX2BJoA.js","assets/vendor-react-D-afvo_7.js","assets/vendor-utils-DCpRgzMR.js","assets/useAsync-cdOzMWPw.js","assets/vendor-hooks-CLzfFpO7.js","assets/vendor-arcblock-CiLB_TiI.js","assets/vendor-arcblock-DhgPdlEj.css","assets/index-DgZ1ypbb.js","assets/config-B8mAOrZA.js","assets/index-Cn9hlGXz.js","assets/Done-BCESxXX2.js","assets/Google-rxW6OGq8.js","assets/logo-uploader-C1-XCCMv.js","assets/index-DoZ2YM4T.js","assets/page-header-6EUz18Qu.js","assets/layout-Bb4get3W.js","assets/content-layout-CK_AzZZ-.js","assets/step-actions-DnckX9Zh.js","assets/button-Bo5ZAcJk.js","assets/index-PIIZTXU1.js","assets/config-space-DJZf5rEq.js","assets/api-C0C4sDJA.js","assets/connect-to-DfzH7XJt.js","assets/DeleteOutline-VzoIEqow.js","assets/format-error-C0Ke3VXF.js","assets/domain-D80mBbZ5.js","assets/domain-list-DGgkgu6r.js","assets/Add-2VCvBnGd.js","assets/base32-COJTblwx.js","assets/LockIcon-DQtUl5vk.js","assets/CheckCircle-BElcljFC.js","assets/util-Ci0WMGC4.js","assets/useSetState-Crt4S51m.js","assets/permission-SgzW7fBj.js","assets/session-ocxAyn6f.js","assets/useAsyncRetry-KXMle3o0.js","assets/confirm-CucPiuHr.js","assets/InfoOutlined-BFP30UJa.js","assets/index-mnKcDZP2.js","assets/actions-BEpPU26q.js","assets/MoreHoriz-DnFq43xg.js","assets/access-control-DYH-J6hX.js","assets/config-d41PVAVu.js","assets/fuel-PiarpzYg.js","assets/Launch-BOCFiYoz.js","assets/did-address-49U3oRW2.js","assets/complete-XH7CJJ1E.js","assets/launch-result-message-zXOcVqEr.js","assets/get-safe-url-RTzyOi09.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as X,u as J,p as A,q as Y,r as ee,P as D,N as te,f as se,S as oe,_ as m,h as j}from"./index-DgZ1ypbb.js";import{j as e,aa as M,t as re,e as ne,bs as ae,a3 as ie,a2 as le,br as ce}from"./vendor-mui-core-BlX2BJoA.js";import{r as u,u as pe,k as ue,h as de,i as f,j as fe}from"./vendor-react-D-afvo_7.js";import{j as a}from"./vendor-utils-DCpRgzMR.js";import{g as me,a3 as Le,d as T,aj as he,ak as _e}from"./vendor-arcblock-CiLB_TiI.js";import{C as ye}from"./config-space-DJZf5rEq.js";import{H as xe}from"./addon-C8Ytd8YY.js";import{d as Ce}from"./ServerLogo-UNPlRpuM.js";import{g as je}from"./get-safe-url-RTzyOi09.js";import"./vendor-hooks-CLzfFpO7.js";import"./api-C0C4sDJA.js";import"./QuestionMarkCircle-gL_QM35Z.js";var E={};Object.defineProperty(E,"__esModule",{value:!0});var N=E.default=void 0;ge(u);var c=e;function ge(t){return t&&t.__esModule?t:{default:t}}function $(t,o){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);o&&(r=r.filter(function(C){return Object.getOwnPropertyDescriptor(t,C).enumerable})),s.push.apply(s,r)}return s}function B(t){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?$(Object(s),!0).forEach(function(r){Ee(t,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):$(Object(s)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(s,r))})}return t}function Ee(t,o,s){return(o=ve(o))in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s,t}function ve(t){var o=Pe(t,"string");return typeof o=="symbol"?o:o+""}function Pe(t,o){if(typeof t!="object"||!t)return t;var s=t[Symbol.toPrimitive];if(s!==void 0){var r=s.call(t,o||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}var v=function(o){return(0,c.jsxs)("svg",B(B({},o),{},{children:[(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),(0,c.jsxs)("defs",{children:[(0,c.jsxs)("linearGradient",{id:"paint0_linear_615_426",x1:"31.72",y1:"95.7208",x2:"95.488",y2:"34.3249",gradientUnits:"userSpaceOnUse",children:[(0,c.jsx)("stop",{stopColor:"#0FA4B7"}),(0,c.jsx)("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),(0,c.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]}),(0,c.jsxs)("linearGradient",{id:"paint1_linear_615_426",x1:"28.4374",y1:"99.2464",x2:"98.7613",y2:"44.9372",gradientUnits:"userSpaceOnUse",children:[(0,c.jsx)("stop",{stopColor:"#0FA4B7"}),(0,c.jsx)("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),(0,c.jsx)("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]}))};v.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};v.displayName="server-logo-notext";N=E.default=v;const we=M.span`
|
|
3
3
|
color: ${t=>t.theme.palette.error.main};
|
|
4
4
|
&::before {
|
|
5
5
|
content: '*';
|
|
6
6
|
}
|
|
7
|
-
`,g=we,Se=u.lazy(()=>m(()=>import("./connect-
|
|
7
|
+
`,g=we,Se=u.lazy(()=>m(()=>import("./connect-CPSe4Vws.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),Oe=u.lazy(()=>m(()=>import("./config-B8mAOrZA.js"),__vite__mapDeps([9,1,2,3,6,5,7,10,11,12,8,13,14,15,16,17,18,19]))),Re=u.lazy(()=>m(()=>import("./index-PIIZTXU1.js"),__vite__mapDeps([20,1,2,6,3,5,7,15,8,21,22,23,24,25,18,16,17]))),be=u.lazy(()=>m(()=>import("./domain-D80mBbZ5.js"),__vite__mapDeps([26,1,2,8,6,3,5,7,27,28,29,30,31,32,33,34,35,36,4,37,25,38,22,39,40,41,15,19,16,17,18]))),ke=u.lazy(()=>m(()=>import("./access-control-DYH-J6hX.js"),__vite__mapDeps([42,1,2,6,3,5,7,43,15,8,16,17,18,19]))),Ie=u.lazy(()=>m(()=>import("./fuel-PiarpzYg.js"),__vite__mapDeps([44,1,2,3,45,6,5,7,46,15,8,16,17,18,19]))),Ve=u.lazy(()=>m(()=>import("./complete-XH7CJJ1E.js"),__vite__mapDeps([47,1,2,6,3,5,7,8,48,49,19,16,17])));function qe(){var k,I,V;const t=re(i=>i.breakpoints.down("md")),o=ne(),{t:s,locale:r}=me(),[C,U]=pe(),y=ue(),{meta:L,blocklet:p,actions:d,loading:F}=X(),H=localStorage.getItem("blocklet-server-url"),{session:P}=J(),Z=A("fromLauncher"),w=A("visitorId");w&&(Le(w),C.delete("visitorId"),U(C)),u.useEffect(()=>{Y(),P.user&&(d==null||d.refreshMeta(),d==null||d.refreshBlocklet({showError:!1}))},[P.user]),u.useEffect(()=>{d.refreshFuel({showError:!1})},[(k=p==null?void 0:p.meta)==null?void 0:k.did]);const n=`${T.WELLKNOWN_SERVICE_PATH_PREFIX}/setup`,z=i=>{var x;const l=(x=i==null?void 0:i.capabilities)==null?void 0:x.didSpace;return l?l===j.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||l===j.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP?{key:"did-space",name:e.jsxs(e.Fragment,{children:[s("setup.steps.didSpace")," ",e.jsx(g,{})]}),path:a(n,"did-space")}:l===j.BLOCKLET_APP_SPACE_REQUIREMENT.OPTIONAL?{key:"did-space",name:e.jsx(e.Fragment,{children:s("setup.steps.didSpace")}),path:a(n,"did-space")}:(console.warn(`capabilities.didSpace cannot take the value ${l}`),null):null},h=[{key:"access",name:s("setup.steps.access"),path:a(n,"access")},{key:"domain",name:s("setup.steps.domain"),path:a(n,"domain")},z(p),{key:"config",name:e.jsxs(e.Fragment,{children:[s("setup.steps.config")," ",ee(L)&&e.jsx(g,{})]}),path:a(n,"config")},(V=(I=L==null?void 0:L.requirements)==null?void 0:I.fuels)!=null&&V.length?{key:"fuel",name:e.jsxs(e.Fragment,{children:[s("setup.steps.fuel")," ",e.jsx(g,{})]}),path:a(n,"fuel")}:null].filter(Boolean),S=h.findIndex(i=>`${D.replace(/\/$/,"")}${n}/${i.key}`===window.location.pathname),K=a(D,T.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?v=${p==null?void 0:p.updatedAt}`),Q=async i=>{const{search:l}=new URL(window.location.href);if(!i)h[S+1]?y(`${a(n,h[S+1].key)}${l}`):y(`${a(n,"complete")}${l}`);else{const x=h.findIndex(G=>G.key===i);x>-1?y(`${a(n,h[x].key)}${l}`):y(`${a(n,"complete")}${l}`)}await d.refreshBlocklet()},q=()=>{y(-1)};function _(i,l){return e.jsxs(Se,{children:[!p&&e.jsx(ie,{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(le,{})}),p&&e.jsx(i,{blocklet:p,...l,onNext:Q,onPrevious:q})]})}const O=()=>{window.open(je(H,{allowDomains:null}))},W=t?e.jsx(N,{onClick:O,width:"32",height:"32",style:{cursor:"pointer"}}):e.jsx(Ce,{onClick:O,width:"128",height:"48",style:{marginTop:-1,cursor:"pointer"}}),R=[{key:"install",name:s("launchBlocklet.steps.installApp"),path:a(n,"install")},{key:"setup",name:s("setup.steps.launchApp"),children:h}];let b=[{key:"agreement",name:s("launchBlocklet.introduction"),path:a(n,"agreement")},...R];return Z&&(b=[{key:"purchase-space",name:s("launchBlocklet.steps.purchaseSpace")},{key:"prepare-space",name:s("launchBlocklet.steps.prepareSpace")},...R]),e.jsx(he,{steps:b,children:e.jsx(te,{children:e.jsxs(ye,{children:[e.jsx(ae,{styles:Ae}),e.jsx(De,{locale:r,loading:F,blockletMeta:{...L,title:se.getDisplayName({...p,meta:L})},navLogo:W,pcWidth:"80%",style:{height:"100%"},logoUrl:K,useOfSkeleton:!1,headerEndAddons:e.jsx(xe,{SessionContext:oe,sessionManagerProps:{disableLogout:!0}}),theme:o,launchingText:s("setup.title"),children:e.jsxs(de,{children:[e.jsx(f,{path:"access",element:_(ke)}),e.jsx(f,{path:"domain",element:_(be)}),e.jsx(f,{path:"did-space",element:_(Re)}),e.jsx(f,{path:"config",element:_(Oe)}),e.jsx(f,{path:"fuel",element:_(Ie)}),e.jsx(f,{path:"complete",element:_(Ve)}),e.jsx(f,{path:"*",element:e.jsx(fe,{to:`access${window.location.search}`,replace:!0})})]})})]})})})}const Ae=ce`
|
|
8
8
|
html,
|
|
9
9
|
body,
|
|
10
10
|
#app,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as $,j as t,a2 as W,bs as D,a3 as l,E as m,aQ as M,br as O,aa as j,v as F}from"./vendor-mui-core-BlX2BJoA.js";import{r as h,L as T}from"./vendor-react-D-afvo_7.js";import{I as H}from"./vendor-hooks-CLzfFpO7.js";import{j as q}from"./vendor-utils-DCpRgzMR.js";import{d as K}from"./PlayArrow-oA7gV2MA.js";import{d as V}from"./Error-CpAOVH8t.js";import{g as U,z as u,C as Q,d as b,ag as k,Q as X,ai as G}from"./vendor-arcblock-CiLB_TiI.js";import{W as J}from"./did-address-49U3oRW2.js";import{d as L,e as R,g as Y,f as g,S as Z,h as ee,j as te,k as oe,l as ie,m as I,n as ne}from"./index-
|
|
1
|
+
import{t as $,j as t,a2 as W,bs as D,a3 as l,E as m,aQ as M,br as O,aa as j,v as F}from"./vendor-mui-core-BlX2BJoA.js";import{r as h,L as T}from"./vendor-react-D-afvo_7.js";import{I as H}from"./vendor-hooks-CLzfFpO7.js";import{j as q}from"./vendor-utils-DCpRgzMR.js";import{d as K}from"./PlayArrow-oA7gV2MA.js";import{d as V}from"./Error-CpAOVH8t.js";import{g as U,z as u,C as Q,d as b,ag as k,Q as X,ai as G}from"./vendor-arcblock-CiLB_TiI.js";import{W as J}from"./did-address-49U3oRW2.js";import{d as L,e as R,g as Y,f as g,S as Z,h as ee,j as te,k as oe,l as ie,m as I,n as ne}from"./index-DgZ1ypbb.js";import{d as re}from"./ServerLogo-UNPlRpuM.js";import{H as ae}from"./addon-C8Ytd8YY.js";import{g as S}from"./get-safe-url-RTzyOi09.js";import"./QuestionMarkCircle-gL_QM35Z.js";function z({appInfo:e,...r}){const[o,i]=h.useState(!1),s=$(d=>d.breakpoints.down("md"))?32:48;return o?t.jsx(X,{did:e.publisher,size:s}):t.jsx(G,{src:e.icon,alt:e.title,width:s,height:s,...r,onError:()=>i(!0)})}z.propTypes={appInfo:m.object.isRequired};const C=(e,r)=>g.findComponentByIdV2(e,r)||e;function _e(){var v,_,E,N;const{t:e,locale:r}=U(),[o,i]=H({blocklet:null,component:null,launcherSession:null,loading:!1,starting:!1,manageSubscriptionURL:""}),p=$(a=>a.breakpoints.down("md")),s=new URL(window.location.href),d=s.searchParams.get("componentId"),w=()=>{const a=s.searchParams.get("redirect")||"/";window.location.href=S(decodeURIComponent(a))},y=()=>{const a=setInterval(()=>{L.get("/blocklet/detail?nocache=1").then(({data:n})=>{const c=C(n,d);if(c.status==="running"){w();return}c.status!=="starting"&&(i({blocklet:n,starting:!1}),n!==c&&i({component:c}),clearInterval(a))}).catch(n=>{i({loading:!1}),u.error(n.message)})},3e3)};h.useEffect(()=>{i({loading:!0}),L.get("/blocklet/detail?nocache=1").then(({data:a})=>{const n=C(a,d);if(i({loading:!1}),n.status==="running"){w();return}i({blocklet:a}),a!==n&&i({component:n}),n.status==="starting"&&(i({starting:!0}),y())}).catch(a=>{i({loading:!1}),u.error(a.message)})},[]);const B=h.useCallback(()=>{var n;i({loading:!0,starting:!0});const a={did:(n=o.blocklet)==null?void 0:n.meta.did};o.component&&(a.componentDids=[o.component.meta.did]),R.startBlocklet({input:a}).then(()=>{y()}).catch(c=>{u.error(c.message),i({loading:!1,starting:!1})})},[o.component,o.blocklet]);if(h.useEffect(()=>{var a;(a=o.blocklet)!=null&&a.controller&&(Y({launcherUrl:o.blocklet.controller.launcherUrl,launcherSessionId:o.blocklet.controller.launcherSessionId,locale:r}).then(n=>{i({manageSubscriptionURL:n})}).catch(n=>{console.error("get manage subscription url error",n)}),R.getLauncherSession({input:{launcherSessionId:o.blocklet.controller.launcherSessionId,launcherUrl:o.blocklet.controller.launcherUrl}}).then(n=>{i({launcherSession:n.launcherSession}).catch(c=>{console.error("get launcher session error",c)})}))},[(v=o.blocklet)==null?void 0:v.controller]),!o.blocklet)return t.jsx(Q,{children:t.jsx(W,{})});const x={icon:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/blocklet/logo`,title:g.getDisplayName(o.blocklet),publisher:o.blocklet.appDid},f=localStorage.getItem("blocklet-server-url"),P=()=>{f&&window.open(S(f,{allowDomains:null}))};return t.jsxs(le,{children:[t.jsx(D,{styles:se}),t.jsxs("header",{className:"root-header",children:[!p&&t.jsx("div",{className:"left",children:t.jsx(re,{width:"128",height:"48",onClick:P,style:{cursor:f?"pointer":""}})}),t.jsx("div",{className:"right",children:t.jsx(ae,{SessionContext:Z})})]}),t.jsxs(de,{elevation:0,children:[t.jsxs(ce,{children:[t.jsx(z,{appInfo:x}),t.jsxs("div",{className:"app-info_content",children:[t.jsx(l,{className:"app-info_name",children:x.title}),t.jsx(J,{size:14,className:"app-info_did",did:x.publisher})]})]}),((N=(E=(_=o.blocklet)==null?void 0:_.controller)==null?void 0:E.status)==null?void 0:N.value)!==ee.BLOCKLET_CONTROLLER_STATUS.suspended&&t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(l,{className:"icon",children:t.jsx(K,{})}),t.jsx(l,{className:"title",children:e("blocklet.startApplication")})]}),t.jsx(l,{className:"sub-title",children:e("blocklet.startDescription",{name:o.component?g.getDisplayName(o.component,!0):g.getDisplayName(o.blocklet)})}),t.jsx(l,{mt:8,children:t.jsx(k,{style:{minWidth:200},disabled:o.loading||o.starting,variant:"contained",color:"primary",size:"large",loading:o.starting,onClick:()=>B(),children:o.starting?e("blocklet.starting"):e("blocklet.start")})})]}),te(o.blocklet)&&t.jsx(A,{blocklet:o.blocklet,launcherSession:o.launcherSession,manageSubscriptionURL:o.manageSubscriptionURL}),t.jsx(l,{mt:5,children:t.jsx(T,{className:"footer-link",to:`${b.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/overview`,children:e("blocklet.dashboard")})})]})]})}function A({blocklet:e,launcherSession:r,manageSubscriptionURL:o}){const{t:i,locale:p}=U();if(!e||!r)return"";const s=oe(e,r),d=ie(e,r);return!s&&!d?"":t.jsxs(t.Fragment,{children:[t.jsxs(l,{className:"title-box",children:[t.jsx(V,{className:"icon-error"}),t.jsxs(l,{className:"title error",children:[s&&i("blocklet.suspended"),d&&i("blocklet.terminated")]})]}),t.jsxs(l,{className:"sub-title",children:[s&&i("blocklet.suspendedCausedByExpired",{deadline:I(r==null?void 0:r.reservedUntil,p)}),d&&i("blocklet.suspendedCausedByTerminated",{canceledAt:I(r==null?void 0:r.terminatedAt,p),deadline:ne(r==null?void 0:r.terminatedAt,p)})]}),t.jsxs(l,{mt:8,children:[s&&t.jsx(k,{component:M,style:{minWidth:200},variant:"contained",color:"primary",size:"large",target:"_blank",href:o||"#",children:i("blocklet.manageSubscription")}),d&&t.jsx(k,{component:T,to:q(b.WELLKNOWN_SERVICE_PATH_PREFIX,"/admin/did-spaces"),style:{minWidth:200},variant:"contained",color:"primary",size:"large",children:i("common.backup")})]})]})}A.propTypes={blocklet:m.object.isRequired,launcherSession:m.object.isRequired,manageSubscriptionURL:m.string.isRequired};const se=O`
|
|
2
2
|
html,
|
|
3
3
|
body,
|
|
4
4
|
#app,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as c,t as w,j as o,a3 as r,E as e,aa as x}from"./vendor-mui-core-BlX2BJoA.js";import{g as b,ag as f}from"./vendor-arcblock-CiLB_TiI.js";import{ae as h}from"./index-
|
|
1
|
+
import{e as c,t as w,j as o,a3 as r,E as e,aa as x}from"./vendor-mui-core-BlX2BJoA.js";import{g as b,ag as f}from"./vendor-arcblock-CiLB_TiI.js";import{ae as h}from"./index-DgZ1ypbb.js";function y({key:t}={key:"sm"}){const n=c();return w(n.breakpoints.down(t))}function p({blocklet:t,onStartNow:n,children:s,disabled:l,startNowText:d,startNowProps:m}){const{t:u}=b(),a=y();return!t||h(t.meta)?o.jsx(i,{isMobile:a,children:s}):o.jsxs(i,{isMobile:a,children:[o.jsx(f,{className:"start-now",variant:"outlined",disabled:l,onClick:()=>n(),...m,children:d??u("setup.startNow")}),o.jsx(r,{display:"flex",variant:"contained",color:"primary",alignItems:"center",marginLeft:"32px",children:s})]})}p.propTypes={blocklet:e.object,onStartNow:e.func,children:e.any,disabled:e.bool,startNowText:e.string,startNowProps:e.any};p.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1,startNowText:void 0,startNowProps:{}};const i=x(r)`
|
|
2
2
|
padding-top: 24px;
|
|
3
3
|
margin-top: auto;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,a2 as k,a3 as p,T,aa as m}from"./vendor-mui-core-BlX2BJoA.js";import{g as A,R as D,d as R,ag as b,ab as P}from"./vendor-arcblock-CiLB_TiI.js";import{H as E}from"./addon-C8Ytd8YY.js";import{F}from"./fullpage-CFp4hSHz.js";import{d as I}from"./CheckCircle-BElcljFC.js";import{B as L}from"./vendor-hooks-CLzfFpO7.js";import{r as o}from"./vendor-react-D-afvo_7.js";import{u as W,d as _,s as B,a as H,S as z}from"./index-
|
|
1
|
+
import{j as e,a2 as k,a3 as p,T,aa as m}from"./vendor-mui-core-BlX2BJoA.js";import{g as A,R as D,d as R,ag as b,ab as P}from"./vendor-arcblock-CiLB_TiI.js";import{H as E}from"./addon-C8Ytd8YY.js";import{F}from"./fullpage-CFp4hSHz.js";import{d as I}from"./CheckCircle-BElcljFC.js";import{B as L}from"./vendor-hooks-CLzfFpO7.js";import{r as o}from"./vendor-react-D-afvo_7.js";import{u as W,d as _,s as B,a as H,S as z}from"./index-DgZ1ypbb.js";import"./vendor-utils-DCpRgzMR.js";import"./QuestionMarkCircle-gL_QM35Z.js";function Y(){var i,c,l,d;const{t:s,locale:u}=A(),{api:x,session:h}=W(),{searchParams:g}=new URL(window.location.href),[j,v]=o.useState(!1),n=g.get("transferId"),w=(i=window==null?void 0:window.env)==null?void 0:i.appId,S=o.useCallback(async()=>{const{data:t}=await _.get("/blocklet/transfer",{params:{transferId:n}});return t},[n]),a=L(S),C=o.useCallback(async(t,f)=>{t&&(B(f(t.sessionToken)),H(f(t.refreshToken))),await h.refresh(),v(!0)},[]);if(a.loading)return e.jsx(k,{});if(a.error)return e.jsx(q,{children:e.jsx(D,{status:"404",title:(l=(c=a.error)==null?void 0:c.response)==null?void 0:l.data,description:""})});const y=a.data.status==="success";let r;return y||j?r=e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsx(E,{SessionContext:z})}),e.jsx(p,{pt:1,color:"success.main",children:e.jsx(I,{style:{fontSize:80}})}),e.jsx(T,{my:4,variant:"h5",children:s("team.transferApp.successTitle")}),e.jsx("a",{href:`${R.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`,children:e.jsx(b,{variant:"contained",children:s("team.transferApp.visitDashboard")})})]}):r=e.jsx(P,{action:"receive-transfer-app-owner",checkFn:x.get,forceConnected:!1,autoConnect:!1,checkTimeout:10*60*1e3,onSuccess:C,onClose:()=>{},locale:u,messages:{title:s("team.transferApp.receiveDialog.title"),scan:s("team.transferApp.receiveDialog.scan"),confirm:s("team.transferApp.receiveDialog.confirm"),success:s("team.transferApp.receiveDialog.success")},extraParams:{transferId:n,appDid:w}}),e.jsx(F,{did:(d=window.blocklet)==null?void 0:d.appPid,children:e.jsx(p,{sx:{width:"560px",maxWidth:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:r})})}const N=m.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 16px;
|
|
4
4
|
right: 16px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,a3 as t,am as C,an as w,ao as k,ap as E,T as L}from"./vendor-mui-core-BlX2BJoA.js";import{f as R,L as v}from"./vendor-react-D-afvo_7.js";import{g as F,ag as u,z as a,O as P,d}from"./vendor-arcblock-CiLB_TiI.js";import{k as T,u as f,y as S}from"./vendor-hooks-CLzfFpO7.js";import{j as m}from"./vendor-utils-DCpRgzMR.js";import{u as I}from"./index-
|
|
1
|
+
import{j as i,a3 as t,am as C,an as w,ao as k,ap as E,T as L}from"./vendor-mui-core-BlX2BJoA.js";import{f as R,L as v}from"./vendor-react-D-afvo_7.js";import{g as F,ag as u,z as a,O as P,d}from"./vendor-arcblock-CiLB_TiI.js";import{k as T,u as f,y as S}from"./vendor-hooks-CLzfFpO7.js";import{j as m}from"./vendor-utils-DCpRgzMR.js";import{u as I}from"./index-DgZ1ypbb.js";function U(){var c,l;const{api:b}=I(),h=R(),{t:n}=F(),r=new URLSearchParams(h.search).get("token"),e=T({error:"",finished:!1,loading:!1}),p=f(()=>{window.close(),window.location.replace("/")}),x=f(async()=>{try{e.loading=!0;const{data:o}=await b.post("/api/user/notification/unsubscribe",{token:r});o.success===!0?(e.finished=!0,a.success(n("notification.unsubscribeSucceed"))):(e.finished=!1,a.error(n("notification.unsubscribeFailed")))}catch(o){e.finished=!1,a.error(o.message||n("notification.unsubscribeFailed"))}finally{e.loading=!1}});S(()=>{if(!r)e.error=n("notification.unsubscribeTokenRequired");else{const o=P(r);if(!o)e.error=n("notification.unsubscribeTokenInvalid");else{const{exp:y}=o;y*1e3<=Date.now()&&(e.error=n("notification.unsubscribeTokenExpired"))}}});const s=(c=window==null?void 0:window.blocklet)==null?void 0:c.copyright,g=(s==null?void 0:s.owner)||((l=window==null?void 0:window.blocklet)==null?void 0:l.appName),j=(s==null?void 0:s.year)||new Date().getFullYear();return i.jsx(t,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"#fafafa"},children:i.jsxs(t,{sx:{width:"450px",maxWidth:"90%"},children:[i.jsx(t,{sx:{width:"100%"},children:i.jsx("img",{style:{height:"40px"},src:m(d.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-rect?imageFilter=convert&f=png"),alt:"blocklet logo"})}),i.jsxs(C,{variant:"outlined",sx:{my:1},children:[i.jsx(w,{title:e.finished?n("notification.unsubscribeSucceed"):n("notification.email.unsubscribe")}),i.jsxs(k,{sx:{minHeight:"10em"},children:[e.error?e.error:null,!e.error&&!e.finished?n("notification.email.unsubscribeDescription"):null,!e.error&&e.finished?i.jsxs(i.Fragment,{children:[n("notification.email.subscribeDescription")," ",i.jsx(v,{to:m(d.WELLKNOWN_SERVICE_PATH_PREFIX,"/user/settings"),color:"primary",children:n("notification.email.subscribe")})]}):null]}),i.jsxs(E,{sx:{justifyContent:"end!important"},children:[i.jsx(u,{size:"small",color:e.error?"error":"primary",variant:"outlined",onClick:p,children:n("common.close")}),e.error||e.finished?null:i.jsx(u,{size:"small",color:"primary",variant:"contained",onClick:x,loading:e.loading,children:n("notification.unsubscribe")})]})]}),i.jsxs(L,{variant:"body2",color:"gray",children:["Copyright © ",j," ",g]})]})})}export{U as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as p,j as n,a3 as g,x as K,aQ as ge,T as N,aa as R,t as _,ah as V,am as ye,a4 as Ke,bC as Ge,aq as Qe,as as Ve,e as Xe,aK as Ye,bD as Je,bE as Ze,bF as et,aP as tt,bG as nt,M as rt,al as ue,a2 as fe}from"./vendor-mui-core-BlX2BJoA.js";import{E as st,U as X,af as D,aH as be,aI as ot,aJ as it,aK as at,v as z,g as Y,aL as lt,aM as ct,P as dt,aN as pt,d as ut}from"./vendor-arcblock-CiLB_TiI.js";import{r as m,g as ve,l as ft}from"./vendor-react-D-afvo_7.js";import{o as U}from"./vendor-hooks-CLzfFpO7.js";import{j as ht}from"./vendor-utils-DCpRgzMR.js";import{S as mt}from"./index-DQSF6ElG.js";import{B as je}from"./bundle-avatar-DqROxHMq.js";import{B as xt}from"./index-CQT4qLcx.js";import{R as gt}from"./relative-time-BXb5Mt72.js";import{M as yt,O as A,Q as bt,R as vt}from"./index-wG4Kh8A_.js";import{d as jt}from"./InfoOutlined-BFP30UJa.js";we.propTypes={theme:p.string,type:p.oneOf(["button","line"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function we({theme:e="dark",type:t="button",onSelectType:s,extra:r=void 0,currentTab:o="",loading:i=!1,...a}){const c=[{label:"All",value:""},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],u=l=>{(l!==o||!i)&&s(l)},y=m.useMemo(()=>{const l={width:"100%",bgcolor:e==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return t==="line"?Object.assign(l,{}):l},[t,e]),f=(l,h,b)=>n.jsx(K,{disabled:i,onClick:()=>u(l.value),className:`profile-button ${h?"active":""}`,...a,children:l.label},l.value||b),d=(l,h,b)=>n.jsx(K,{variant:"text",disabled:i,onClick:()=>u(l.value),className:`profile-line-button ${h?"active":""}`,...a,children:l.label},l.value||b);return n.jsxs(g,{className:"severity-tabs",sx:y,children:[n.jsx("div",{style:t==="line"?{flex:1,borderBottom:"1px solid rgba(209, 213, 219, 1)"}:{},children:c==null?void 0:c.map((l,h)=>{const b=o===(l==null?void 0:l.value);return t==="line"?n.jsx(m.Fragment,{children:d(l,b,h)},l.value||h):n.jsx(m.Fragment,{children:f(l,b,h)},l.value||h)})}),r]})}var wt=m;function Ct(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var W=Ct(wt);function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},G.apply(this,arguments)}function St(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Q(e,t)}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Q(e,t)}function Lt(e,t){if(e==null)return{};var s={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(s[o]=e[o]);return s}var he={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Tt=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function Et(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(r){t.indexOf(r)>-1||(s[r]=e[r])}),s}var Rt=["component","className","unsafeHTML"];function Ce(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),r;switch(t){case"words":r=e.textContent.split(/\b|(?=\W)/);break;case"letters":r=Array.from(e.textContent);break}r.forEach(function(c){s.appendChild(kt(c))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var o=[].slice.call(e.childNodes),i=o.length,a=0;a<i;a++)Ce(o[a],t)}function kt(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function me(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function Se(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);Se(e.parentNode,t)}}function Pt(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function F(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var Le={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Mt=Object.keys(Le),Te=function(e){St(t,e);function t(r){var o;return o=e.call(this,r)||this,o.state={html:r.unsafeHTML,clamped:!1},o.canvas=null,o.maxLine=0,o.nlUnits=[],o}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(o){o.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==o&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(o,i){return typeof o.clamped<"u"&&(this.clamped=o.clamped),e.prototype.setState.call(this,o,i)},s.initCanvas=function(){if(!this.canvas){var o=this.canvas=document.createElement("div");o.className="LinesEllipsis-canvas "+this.props.className,o.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(he).forEach(function(i){o.style[i]=he[i]}),document.body.appendChild(o)}},s.copyStyleToCanvas=function(){var o=this,i=window.getComputedStyle(this.target);Tt.forEach(function(a){o.canvas.style[a]=i[a]})},s.reflow=function(o){this.maxLine=+o.maxLine||1,this.canvas.innerHTML=o.unsafeHTML;var i=o.basedOn||(/^[\x00-\x7F]+$/.test(o.unsafeHTML)?"words":"letters");Ce(this.canvas,i);var a=this.putEllipsis(this.calcIndexes()),c={clamped:a,html:this.canvas.innerHTML};this.setState(c,o.onReflow.bind(this,c))},s.calcIndexes=function(){var o=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),a=i.length;if(!i.length)return o;var c=i.find(F);if(!c)return o;for(var u=1,y=c.offsetTop,f=1;f<a&&!(F(i[f])&&i[f].offsetTop-y>1&&(u++,o.push(f),y=i[f].offsetTop,u>this.maxLine));f++);return o},s.putEllipsis=function(o){if(o.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,o[this.maxLine]);var i=this.nlUnits.pop(),a=this.makeEllipsisSpan();do Se(i,this.canvas),Pt(i).appendChild(a),i=this.nlUnits.pop();while(i&&(!F(i)||a.offsetHeight>i.offsetHeight||a.offsetTop>i.offsetTop));return i&&me(i),this.nlUnits.forEach(me),!0},s.makeEllipsisSpan=function(){var o=this.props,i=o.ellipsisHTML,a=o.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var u=document.createElement("span");return u.className="LinesEllipsis-ellipsis",i?u.innerHTML=i:u.textContent=a,c.appendChild(u),c},s.isClamped=function(){return this.clamped},s.render=function(){var o=this,i=this.state,a=i.html,c=i.clamped,u=this.props,y=u.component,f=u.className,d=u.unsafeHTML,l=Lt(u,Rt);return W.default.createElement(y,G({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+f,ref:function(b){return o.target=b}},Et(l,Mt)),W.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?a:d}}))},t}(W.default.Component);Te.defaultProps=Le;var Nt=Te;const $t=ve(Nt),{joinURL:S,withQuery:k}=yt,{toTypeInfo:Ot}=st,{isEVMChain:_t,getExplorerUrl:At}=A,{arcChainConfig:It}=bt,Dt={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},P="https://explorer.abtnetwork.io/explorer/";var Ht=function({hash:t,asset:s,rollup:r,address:o,token:i,stake:a,chainId:c=""}){if(_t(c)){const d=At(c);return t?S(d,`tx/${t}`):s?S(d,`token/${s}`):S(d,`address/${o}`)}const u=It[c],y=u==null?void 0:u.defaultRPC,f=y?`${y}`:void 0;return r&&Ot(r).role===Dt.ROLE_ROLLUP?t?k(S(P,`rollups/${r}/moves/${t}`),{host:f}):k(S(P,`rollups/${r}`),{host:f}):s?k(S(P,`assets/${s}`),{host:f}):t?k(S(P,`txs/${t}`),{host:f}):i?k(S(P,`tokens/${i}/tx`),{host:f}):a?k(S(P,`stakes/${a}`),{host:f}):k(S(P,`accounts/${o}`),{host:f})},zt={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const O=Ht,{isSameAddr:M}=zt;class J{constructor({type:t,did:s,chainId:r,text:o}){this.text=o,this.did=s,this.type=t,this.chainId=r}}const Z=e=>{const t=[];try{let s=0;const r=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,o=e.matchAll(r);for(const i of o){const a=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,c=i[0],u=i.index||s,y=u+c.length;if([...c.matchAll(a)].length>1)return[e];let d="";const l=a.exec(c);let h="";if(l){const T=l[0];d=c.replace(T,"").replace(/^</,"").replace(/(>)$/,""),h=T.replace(/\)$/,"").replace(/^\(/,"")}else h=c;const b=h.split(":"),j=(b[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),w=(b[1]||"").replace(/>$/,"").replace(/\)$/,""),C=(b[b.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,u)),t.push(new J({type:j,chainId:w,did:C,text:d||j})),s=y}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},Ee=e=>{let t;const{type:s,chainId:r,did:o}=e;return M(s,"link")?t=`${r}:${o}`:M(s,"tx")?t=O({hash:o,chainId:r}):M(s,"stake")?t=O({stake:o,chainId:r}):M(s,"nft")?t=O({asset:o,chainId:r}):M(s,"token")?t=O({token:o,chainId:r}):M(s,"did")&&(t=O({address:o,chainId:r})),t},Bt=(e,t=!0)=>Z(e).map(r=>{if(r instanceof J){if(t){const o=Ee(r),{type:i,chainId:a,did:c}=r;return M(i,"dapp")?`<em style="font-weight:bold;" data-type="${i}" data-chain-id="${a}" data-did="${c}">${r.text}</em>`:o?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${o}">${r.text}</a>`:`<em style="font-weight:bold;" data-type="${i}" data-chain-id="${a}" data-did="${c}">${r.text}</em>`}return r.text}return r}).join(""),Ut=e=>Z(e).map(s=>s instanceof J?`<${Ee(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var xe={toClickableSpan:Bt,toTextList:Z,toSlackLink:Ut};function Re({attachment:e}){const{data:t}=e;let s="";try{s=new URL(t.url).host}catch{s=t.url}return n.jsxs(ge,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},children:[!!s&&n.jsx("span",{className:"url",children:s}),!!t.title&&n.jsx(g,{className:"title",children:t.title}),!!t.description&&n.jsx(g,{className:"description",style:{whiteSpace:"unset",color:"rgba(75, 85, 99, 1)"},children:t.description}),!!t.image&&n.jsx("img",{srcSet:`${A.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${A.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}Re.propTypes={attachment:p.object.isRequired};function ke({attachment:e}){const{data:t}=e;return n.jsx("img",{srcSet:`${A.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${A.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}ke.propTypes={attachment:p.object.isRequired};function ee({attachment:e,...t}){var c;const{data:s}=e,r=((c=s.color)==null?void 0:c.toLowerCase())||t.color,o=s.size||t.size,i=s.fontWeight||t.fontWeight||400;let a="14px";return o==="small"?a="12px":o==="normal"?a="14px":o==="big"?a="16px":o==="large"&&(a="18px"),n.jsx("span",{className:"title",style:{fontSize:a,color:r,whiteSpace:"unset",fontWeight:i},children:s.text})}ee.propTypes={attachment:p.object.isRequired};const Wt=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ft=e=>{try{return new URL(e).host}catch{return e}};var I={getChainHost:Wt,getUrlHost:Ft},B={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}};te.propTypes={locale:p.string,data:p.object.isRequired};te.defaultProps={locale:"en"};function te({locale:e="en",data:t}){const s={zh:"来自",en:"from"}[e]||"from",r={zh:"接收",en:"Received"}[e]||"Received",i=`https://${I.getUrlHost(t.chainHost)||I.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`;let a=t.amount;t.decimal&&(a=t.amount/10**t.decimal);const c=U(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return n.jsx("a",{href:i,target:"_blank",rel:"noreferrer",children:n.jsxs(g,{display:"flex",flexDirection:"column",children:[n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:r}),n.jsxs(N,{component:"div",align:"right",style:B.summaryStyle,flex:1,children:["+",a," ",t.symbol]})]}),n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",style:{...B.remarkStyle,fontSize:14},children:s}),n.jsx(g,{sx:{maxWidth:"252px",fontSize:"14px"},children:n.jsx(X,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}ne.propTypes={locale:p.string,data:p.object.isRequired};ne.defaultProps={locale:"en"};function ne({locale:e,data:t}){var u,y;const s={zh:"接收",en:"Received"}[e]||"Received",r={zh:"来自",en:"from"}[e]||"from",o=I.getUrlHost(t.chainHost)||I.getChainHost(t.chainId),i=t.did||((y=(u=t==null?void 0:t.credential)==null?void 0:u.issuer)==null?void 0:y.id)||"",a=`https://${o}/explorer/assets/${i}`,c=U(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return n.jsx(g,{sx:{pr:1},children:n.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},rel:"noreferrer",children:n.jsxs(g,{display:"flex",flexDirection:"column",children:[n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:s}),n.jsx(N,{component:"div",align:"right",style:B.summaryStyle,children:"+1 Asset"})]}),i?n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",style:{...B.remarkStyle,fontSize:14},children:r}),n.jsx(g,{sx:{maxWidth:"252px",fontSize:"14px"},children:n.jsx(X,{did:i,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}Pe.propTypes={data:p.object.isRequired,locale:p.string};function Pe({data:e,locale:t="en"}){return n.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},rel:"noreferrer",children:[n.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),n.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[n.jsx("div",{style:{marginBottom:"6px"},children:e.title}),n.jsx("div",{style:{color:"#a5a5a5",fontSize:10,maxWidth:"252px"},children:n.jsx(X,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}re.propTypes={locale:p.string,data:p.object.isRequired};re.defaultProps={locale:"en"};function re({locale:e,data:t}){const s=I.getChainHost(t.chainId),r=`https://${s}/explorer/txs/${t.hash}`,o={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",i={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash";return n.jsxs("a",{href:r,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block",fontSize:14},rel:"noreferrer",children:[n.jsx("h6",{style:{color:"#a5a5a5",margin:0},children:s}),n.jsx("p",{style:{color:"#4598fa",margin:0},children:o}),n.jsxs("div",{style:{wordBreak:"break-all"},children:[i,": ",t.hash]})]})}function Me({data:e,isMd:t=!1}){return n.jsx(g,{display:"flex",flexDirection:t?"row":"column",justifyContent:"space-between",sx:{width:t?"100%":"auto"},children:e.items.map((s,r)=>n.jsx(ee,{attachment:s,color:r===0?"rgba(156, 163, 175, 1)":"",size:r===0?"normal":"big",fontWeight:r===0?400:600},r))})}Me.propTypes={data:p.array.isRequired,isMd:p.bool};function Ne({attachment:e,...t}){const{local:s}=m.useContext(D),r=_(o=>o.breakpoints.down("md"));return n.jsxs(qt,{"data-testid":"attachment-preview",...t,isMd:r,children:[e.type==="link"&&n.jsx(Re,{attachment:e,...t,isMd:r}),e.type==="image"&&n.jsx(ke,{attachment:e,isMd:r}),e.type==="text"&&n.jsx(ee,{attachment:e,isMd:r}),e.type==="token"&&n.jsx(te,{data:e.data,local:s,isMd:r}),e.type==="asset"||e.type==="vc"?n.jsx(ne,{data:e.data,local:s,isMd:r}):null,e.type==="dapp"&&n.jsx(Pe,{data:e.data,local:s,isMd:r}),e.type==="transaction"&&n.jsx(re,{data:e.data,local:s,...t,isMd:r}),e.type==="divider"&&n.jsx(V,{sx:{mb:1,mt:1},style:{color:be.dividerColor}}),e.type==="combined"&&n.jsx(Me,{data:e,isMd:r})]})}const qt=R.div`
|
|
1
|
+
import{E as p,j as n,a3 as g,x as K,aQ as ge,T as N,aa as R,t as _,ah as V,am as ye,a4 as Ke,bC as Ge,aq as Qe,as as Ve,e as Xe,aK as Ye,bD as Je,bE as Ze,bF as et,aP as tt,bG as nt,M as rt,al as ue,a2 as fe}from"./vendor-mui-core-BlX2BJoA.js";import{E as st,U as X,af as D,aH as be,aI as ot,aJ as it,aK as at,v as z,g as Y,aL as lt,aM as ct,P as dt,aN as pt,d as ut}from"./vendor-arcblock-CiLB_TiI.js";import{r as m,g as ve,l as ft}from"./vendor-react-D-afvo_7.js";import{o as U}from"./vendor-hooks-CLzfFpO7.js";import{j as ht}from"./vendor-utils-DCpRgzMR.js";import{S as mt}from"./index-DQSF6ElG.js";import{B as je}from"./bundle-avatar-B19h7IBb.js";import{B as xt}from"./index-8ktBk2aq.js";import{R as gt}from"./relative-time-BzZIQh7e.js";import{M as yt,O as A,Q as bt,R as vt}from"./index-DgZ1ypbb.js";import{d as jt}from"./InfoOutlined-BFP30UJa.js";we.propTypes={theme:p.string,type:p.oneOf(["button","line"]),onSelectType:p.func,extra:p.node,loading:p.bool,currentTab:p.oneOf(["info","success","warning","error",""])};function we({theme:e="dark",type:t="button",onSelectType:s,extra:r=void 0,currentTab:o="",loading:i=!1,...a}){const c=[{label:"All",value:""},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],u=l=>{(l!==o||!i)&&s(l)},y=m.useMemo(()=>{const l={width:"100%",bgcolor:e==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return t==="line"?Object.assign(l,{}):l},[t,e]),f=(l,h,b)=>n.jsx(K,{disabled:i,onClick:()=>u(l.value),className:`profile-button ${h?"active":""}`,...a,children:l.label},l.value||b),d=(l,h,b)=>n.jsx(K,{variant:"text",disabled:i,onClick:()=>u(l.value),className:`profile-line-button ${h?"active":""}`,...a,children:l.label},l.value||b);return n.jsxs(g,{className:"severity-tabs",sx:y,children:[n.jsx("div",{style:t==="line"?{flex:1,borderBottom:"1px solid rgba(209, 213, 219, 1)"}:{},children:c==null?void 0:c.map((l,h)=>{const b=o===(l==null?void 0:l.value);return t==="line"?n.jsx(m.Fragment,{children:d(l,b,h)},l.value||h):n.jsx(m.Fragment,{children:f(l,b,h)},l.value||h)})}),r]})}var wt=m;function Ct(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var W=Ct(wt);function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},G.apply(this,arguments)}function St(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Q(e,t)}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Q(e,t)}function Lt(e,t){if(e==null)return{};var s={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(s[o]=e[o]);return s}var he={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Tt=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function Et(e,t){if(!e||typeof e!="object")return e;var s={};return Object.keys(e).forEach(function(r){t.indexOf(r)>-1||(s[r]=e[r])}),s}var Rt=["component","className","unsafeHTML"];function Ce(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var s=document.createDocumentFragment(),r;switch(t){case"words":r=e.textContent.split(/\b|(?=\W)/);break;case"letters":r=Array.from(e.textContent);break}r.forEach(function(c){s.appendChild(kt(c))}),e.parentNode.replaceChild(s,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var o=[].slice.call(e.childNodes),i=o.length,a=0;a<i;a++)Ce(o[a],t)}function kt(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function me(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function Se(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);Se(e.parentNode,t)}}function Pt(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function F(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var Le={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Mt=Object.keys(Le),Te=function(e){St(t,e);function t(r){var o;return o=e.call(this,r)||this,o.state={html:r.unsafeHTML,clamped:!1},o.canvas=null,o.maxLine=0,o.nlUnits=[],o}var s=t.prototype;return s.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},s.componentDidUpdate=function(o){o.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==o&&this.reflow(this.props)},s.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},s.setState=function(o,i){return typeof o.clamped<"u"&&(this.clamped=o.clamped),e.prototype.setState.call(this,o,i)},s.initCanvas=function(){if(!this.canvas){var o=this.canvas=document.createElement("div");o.className="LinesEllipsis-canvas "+this.props.className,o.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(he).forEach(function(i){o.style[i]=he[i]}),document.body.appendChild(o)}},s.copyStyleToCanvas=function(){var o=this,i=window.getComputedStyle(this.target);Tt.forEach(function(a){o.canvas.style[a]=i[a]})},s.reflow=function(o){this.maxLine=+o.maxLine||1,this.canvas.innerHTML=o.unsafeHTML;var i=o.basedOn||(/^[\x00-\x7F]+$/.test(o.unsafeHTML)?"words":"letters");Ce(this.canvas,i);var a=this.putEllipsis(this.calcIndexes()),c={clamped:a,html:this.canvas.innerHTML};this.setState(c,o.onReflow.bind(this,c))},s.calcIndexes=function(){var o=[0],i=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),a=i.length;if(!i.length)return o;var c=i.find(F);if(!c)return o;for(var u=1,y=c.offsetTop,f=1;f<a&&!(F(i[f])&&i[f].offsetTop-y>1&&(u++,o.push(f),y=i[f].offsetTop,u>this.maxLine));f++);return o},s.putEllipsis=function(o){if(o.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,o[this.maxLine]);var i=this.nlUnits.pop(),a=this.makeEllipsisSpan();do Se(i,this.canvas),Pt(i).appendChild(a),i=this.nlUnits.pop();while(i&&(!F(i)||a.offsetHeight>i.offsetHeight||a.offsetTop>i.offsetTop));return i&&me(i),this.nlUnits.forEach(me),!0},s.makeEllipsisSpan=function(){var o=this.props,i=o.ellipsisHTML,a=o.ellipsis,c=document.createElement("span");c.appendChild(document.createElement("wbr"));var u=document.createElement("span");return u.className="LinesEllipsis-ellipsis",i?u.innerHTML=i:u.textContent=a,c.appendChild(u),c},s.isClamped=function(){return this.clamped},s.render=function(){var o=this,i=this.state,a=i.html,c=i.clamped,u=this.props,y=u.component,f=u.className,d=u.unsafeHTML,l=Lt(u,Rt);return W.default.createElement(y,G({className:"LinesEllipsis "+(c?"LinesEllipsis--clamped":"")+" "+f,ref:function(b){return o.target=b}},Et(l,Mt)),W.default.createElement("div",{dangerouslySetInnerHTML:{__html:c?a:d}}))},t}(W.default.Component);Te.defaultProps=Le;var Nt=Te;const $t=ve(Nt),{joinURL:S,withQuery:k}=yt,{toTypeInfo:Ot}=st,{isEVMChain:_t,getExplorerUrl:At}=A,{arcChainConfig:It}=bt,Dt={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},P="https://explorer.abtnetwork.io/explorer/";var Ht=function({hash:t,asset:s,rollup:r,address:o,token:i,stake:a,chainId:c=""}){if(_t(c)){const d=At(c);return t?S(d,`tx/${t}`):s?S(d,`token/${s}`):S(d,`address/${o}`)}const u=It[c],y=u==null?void 0:u.defaultRPC,f=y?`${y}`:void 0;return r&&Ot(r).role===Dt.ROLE_ROLLUP?t?k(S(P,`rollups/${r}/moves/${t}`),{host:f}):k(S(P,`rollups/${r}`),{host:f}):s?k(S(P,`assets/${s}`),{host:f}):t?k(S(P,`txs/${t}`),{host:f}):i?k(S(P,`tokens/${i}/tx`),{host:f}):a?k(S(P,`stakes/${a}`),{host:f}):k(S(P,`accounts/${o}`),{host:f})},zt={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const O=Ht,{isSameAddr:M}=zt;class J{constructor({type:t,did:s,chainId:r,text:o}){this.text=o,this.did=s,this.type=t,this.chainId=r}}const Z=e=>{const t=[];try{let s=0;const r=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,o=e.matchAll(r);for(const i of o){const a=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,c=i[0],u=i.index||s,y=u+c.length;if([...c.matchAll(a)].length>1)return[e];let d="";const l=a.exec(c);let h="";if(l){const T=l[0];d=c.replace(T,"").replace(/^</,"").replace(/(>)$/,""),h=T.replace(/\)$/,"").replace(/^\(/,"")}else h=c;const b=h.split(":"),j=(b[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),w=(b[1]||"").replace(/>$/,"").replace(/\)$/,""),C=(b[b.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(s,u)),t.push(new J({type:j,chainId:w,did:C,text:d||j})),s=y}return s<e.length&&t.push(e.substring(s)),t}catch(s){return console.error(s==null?void 0:s.message),[e]}},Ee=e=>{let t;const{type:s,chainId:r,did:o}=e;return M(s,"link")?t=`${r}:${o}`:M(s,"tx")?t=O({hash:o,chainId:r}):M(s,"stake")?t=O({stake:o,chainId:r}):M(s,"nft")?t=O({asset:o,chainId:r}):M(s,"token")?t=O({token:o,chainId:r}):M(s,"did")&&(t=O({address:o,chainId:r})),t},Bt=(e,t=!0)=>Z(e).map(r=>{if(r instanceof J){if(t){const o=Ee(r),{type:i,chainId:a,did:c}=r;return M(i,"dapp")?`<em style="font-weight:bold;" data-type="${i}" data-chain-id="${a}" data-did="${c}">${r.text}</em>`:o?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${o}">${r.text}</a>`:`<em style="font-weight:bold;" data-type="${i}" data-chain-id="${a}" data-did="${c}">${r.text}</em>`}return r.text}return r}).join(""),Ut=e=>Z(e).map(s=>s instanceof J?`<${Ee(s)}|${s.text}>`:s.replace(/:\n/g,": ")).join("");var xe={toClickableSpan:Bt,toTextList:Z,toSlackLink:Ut};function Re({attachment:e}){const{data:t}=e;let s="";try{s=new URL(t.url).host}catch{s=t.url}return n.jsxs(ge,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},children:[!!s&&n.jsx("span",{className:"url",children:s}),!!t.title&&n.jsx(g,{className:"title",children:t.title}),!!t.description&&n.jsx(g,{className:"description",style:{whiteSpace:"unset",color:"rgba(75, 85, 99, 1)"},children:t.description}),!!t.image&&n.jsx("img",{srcSet:`${A.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${A.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}Re.propTypes={attachment:p.object.isRequired};function ke({attachment:e}){const{data:t}=e;return n.jsx("img",{srcSet:`${A.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${A.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}ke.propTypes={attachment:p.object.isRequired};function ee({attachment:e,...t}){var c;const{data:s}=e,r=((c=s.color)==null?void 0:c.toLowerCase())||t.color,o=s.size||t.size,i=s.fontWeight||t.fontWeight||400;let a="14px";return o==="small"?a="12px":o==="normal"?a="14px":o==="big"?a="16px":o==="large"&&(a="18px"),n.jsx("span",{className:"title",style:{fontSize:a,color:r,whiteSpace:"unset",fontWeight:i},children:s.text})}ee.propTypes={attachment:p.object.isRequired};const Wt=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},Ft=e=>{try{return new URL(e).host}catch{return e}};var I={getChainHost:Wt,getUrlHost:Ft},B={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}};te.propTypes={locale:p.string,data:p.object.isRequired};te.defaultProps={locale:"en"};function te({locale:e="en",data:t}){const s={zh:"来自",en:"from"}[e]||"from",r={zh:"接收",en:"Received"}[e]||"Received",i=`https://${I.getUrlHost(t.chainHost)||I.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`;let a=t.amount;t.decimal&&(a=t.amount/10**t.decimal);const c=U(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return n.jsx("a",{href:i,target:"_blank",rel:"noreferrer",children:n.jsxs(g,{display:"flex",flexDirection:"column",children:[n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:r}),n.jsxs(N,{component:"div",align:"right",style:B.summaryStyle,flex:1,children:["+",a," ",t.symbol]})]}),n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",style:{...B.remarkStyle,fontSize:14},children:s}),n.jsx(g,{sx:{maxWidth:"252px",fontSize:"14px"},children:n.jsx(X,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}ne.propTypes={locale:p.string,data:p.object.isRequired};ne.defaultProps={locale:"en"};function ne({locale:e,data:t}){var u,y;const s={zh:"接收",en:"Received"}[e]||"Received",r={zh:"来自",en:"from"}[e]||"from",o=I.getUrlHost(t.chainHost)||I.getChainHost(t.chainId),i=t.did||((y=(u=t==null?void 0:t.credential)==null?void 0:u.issuer)==null?void 0:y.id)||"",a=`https://${o}/explorer/assets/${i}`,c=U(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return n.jsx(g,{sx:{pr:1},children:n.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},rel:"noreferrer",children:n.jsxs(g,{display:"flex",flexDirection:"column",children:[n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:s}),n.jsx(N,{component:"div",align:"right",style:B.summaryStyle,children:"+1 Asset"})]}),i?n.jsxs(g,{sx:c,children:[n.jsx(N,{component:"div",style:{...B.remarkStyle,fontSize:14},children:r}),n.jsx(g,{sx:{maxWidth:"252px",fontSize:"14px"},children:n.jsx(X,{did:i,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}Pe.propTypes={data:p.object.isRequired,locale:p.string};function Pe({data:e,locale:t="en"}){return n.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},rel:"noreferrer",children:[n.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),n.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[n.jsx("div",{style:{marginBottom:"6px"},children:e.title}),n.jsx("div",{style:{color:"#a5a5a5",fontSize:10,maxWidth:"252px"},children:n.jsx(X,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}re.propTypes={locale:p.string,data:p.object.isRequired};re.defaultProps={locale:"en"};function re({locale:e,data:t}){const s=I.getChainHost(t.chainId),r=`https://${s}/explorer/txs/${t.hash}`,o={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",i={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash";return n.jsxs("a",{href:r,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block",fontSize:14},rel:"noreferrer",children:[n.jsx("h6",{style:{color:"#a5a5a5",margin:0},children:s}),n.jsx("p",{style:{color:"#4598fa",margin:0},children:o}),n.jsxs("div",{style:{wordBreak:"break-all"},children:[i,": ",t.hash]})]})}function Me({data:e,isMd:t=!1}){return n.jsx(g,{display:"flex",flexDirection:t?"row":"column",justifyContent:"space-between",sx:{width:t?"100%":"auto"},children:e.items.map((s,r)=>n.jsx(ee,{attachment:s,color:r===0?"rgba(156, 163, 175, 1)":"",size:r===0?"normal":"big",fontWeight:r===0?400:600},r))})}Me.propTypes={data:p.array.isRequired,isMd:p.bool};function Ne({attachment:e,...t}){const{local:s}=m.useContext(D),r=_(o=>o.breakpoints.down("md"));return n.jsxs(qt,{"data-testid":"attachment-preview",...t,isMd:r,children:[e.type==="link"&&n.jsx(Re,{attachment:e,...t,isMd:r}),e.type==="image"&&n.jsx(ke,{attachment:e,isMd:r}),e.type==="text"&&n.jsx(ee,{attachment:e,isMd:r}),e.type==="token"&&n.jsx(te,{data:e.data,local:s,isMd:r}),e.type==="asset"||e.type==="vc"?n.jsx(ne,{data:e.data,local:s,isMd:r}):null,e.type==="dapp"&&n.jsx(Pe,{data:e.data,local:s,isMd:r}),e.type==="transaction"&&n.jsx(re,{data:e.data,local:s,...t,isMd:r}),e.type==="divider"&&n.jsx(V,{sx:{mb:1,mt:1},style:{color:be.dividerColor}}),e.type==="combined"&&n.jsx(Me,{data:e,isMd:r})]})}const qt=R.div`
|
|
2
2
|
display: ${({sx:e={}})=>e.display||"flex"};
|
|
3
3
|
flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
|
|
4
4
|
gap: ${({sx:e={}})=>e.gap||1};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as d,j as l}from"./vendor-mui-core-BlX2BJoA.js";import{ad as h,d as u}from"./vendor-arcblock-CiLB_TiI.js";import{g as c}from"./vendor-react-D-afvo_7.js";import{a9 as p,aa as P,h as x}from"./index-
|
|
1
|
+
import{a1 as d,j as l}from"./vendor-mui-core-BlX2BJoA.js";import{ad as h,d as u}from"./vendor-arcblock-CiLB_TiI.js";import{g as c}from"./vendor-react-D-afvo_7.js";import{a9 as p,aa as P,h as x}from"./index-DgZ1ypbb.js";var f={},v=d;Object.defineProperty(f,"__esModule",{value:!0});var E=f.default=void 0,R=v(h()),g=l;E=f.default=(0,R.default)((0,g.jsx)("path",{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2M1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2"}),"ShoppingCart");const s=p;var m=(e,t)=>s(e)===s(t);const _=c(m),y=(e,t)=>{if(e.type===u.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error(`${t("router.validation.redirectUrlRequired")}`);if(!e.redirectCode)return new Error(`redirect ${t("router.validation.redirectCodeRequired")}`)}else if(e.type===u.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(t("router.validation.didRequired"));return null},q=(e,t)=>{const r=y(e,t);return r||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(t("router.validation.pathPrefixTooLong",{length:150})):null:new Error(t("router.validation.pathPrefixCannotBeEmpty")))},T=({params:e,blocklet:t})=>{if(t){const r=(t.children||[]).find(n=>P.hasStartEngine(n.meta)&&_(n.mountPoint,e.pathPrefix));let i="";return r&&(i=r.mountPoint),t.meta.group!=="gateway"&&e.pathPrefix==="/"&&(i="/"),i}return""},C=({params:e,blocklets:t,blocklet:r,locale:i="en"})=>{if(r&&T({params:e,blocklet:r}))return{zh:`挂载点 ${e.pathPrefix} 已存在,请使用其他挂载点`,en:`The mount point ${e.pathPrefix} already exist, please use another mount point`}[i];const n=t.find(a=>a.meta.did===e.did);if(!n)return"";const o=n.meta.interfaces.find(a=>a.type==="web");return o&&o.prefix!==x.BLOCKLET_DYNAMIC_PATH_PREFIX&&e.pathPrefix!==o.prefix?{zh:`该 blocklet 只能挂载在 ${o.prefix}`,en:`This blocklet can only be mounted on ${o.prefix}`}[i]:""},$=e=>{if(!e||typeof e!="string")return e;let t=e.trim();try{return t=t.toLowerCase(),t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t}catch(r){return console.error("format domain failed",r),t}};export{q as a,E as d,T as e,$ as p,C as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as _,L as i}from"./vendor-arcblock-CiLB_TiI.js";import{x as u,_ as e}from"./index-
|
|
1
|
+
import{f as _,L as i}from"./vendor-arcblock-CiLB_TiI.js";import{x as u,_ as e}from"./index-DgZ1ypbb.js";import{j as r}from"./vendor-mui-core-BlX2BJoA.js";const a={en:_(u),ar:()=>e(()=>import("./ar-DuHAbPhE.js"),[]).then(t=>_(t.default)),de:()=>e(()=>import("./de-CJi7wiel.js"),[]).then(t=>_(t.default)),es:()=>e(()=>import("./es-ClwhOFrW.js"),[]).then(t=>_(t.default)),fr:()=>e(()=>import("./fr-CAkkNKvy.js"),[]).then(t=>_(t.default)),hi:()=>e(()=>import("./hi-CGrG89HI.js"),[]).then(t=>_(t.default)),id:()=>e(()=>import("./id-D6PyIa8m.js"),[]).then(t=>_(t.default)),ja:()=>e(()=>import("./ja-C82Szos_.js"),[]).then(t=>_(t.default)),ko:()=>e(()=>import("./ko-zaXquvPm.js"),[]).then(t=>_(t.default)),pt:()=>e(()=>import("./pt-CMq2TmiV.js"),[]).then(t=>_(t.default)),ru:()=>e(()=>import("./ru-BwmmHWZS.js"),[]).then(t=>_(t.default)),th:()=>e(()=>import("./th-C-hKn9xa.js"),[]).then(t=>_(t.default)),vi:()=>e(()=>import("./vi-C_iM9J2X.js"),[]).then(t=>_(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-9sY6BN2s.js"),[]).then(t=>_(t.default)),zh:()=>e(()=>import("./zh-DNY792IC.js"),[]).then(t=>_(t.default))};function f(t){return function(o){return r.jsx(i,{translations:a,children:r.jsx(t,{...o})})}}export{f as w};
|
package/dist/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
background-color: transparent;
|
|
16
16
|
}
|
|
17
17
|
</style>
|
|
18
|
-
<script type="module" crossorigin src="/.well-known/service/static/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/.well-known/service/static/assets/index-DgZ1ypbb.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-react-D-afvo_7.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-mui-core-BlX2BJoA.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/.well-known/service/static/assets/vendor-utils-DCpRgzMR.js">
|